Lines Matching defs:avctx
131 AVRational target = av_inv_q(s->avctx->time_base);
134 if (s->avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL &&
165 static av_cold int encode_init(AVCodecContext *avctx)
167 MPEG12EncContext *const mpeg12 = avctx->priv_data;
170 int max_size = avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO ? 16383 : 4095;
172 if (avctx->width > max_size || avctx->height > max_size) {
173 av_log(avctx, AV_LOG_ERROR, "%s does not support resolutions above %dx%d\n",
174 CONFIG_SMALL ? avctx->codec->name : avctx->codec->long_name,
178 if ((avctx->width & 0xFFF) == 0 && (avctx->height & 0xFFF) == 1) {
179 av_log(avctx, AV_LOG_ERROR, "Width / Height is invalid for MPEG2\n");
183 if (avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL) {
184 if ((avctx->width & 0xFFF) == 0 || (avctx->height & 0xFFF) == 0) {
185 av_log(avctx, AV_LOG_ERROR, "Width or Height are not allowed to be multiples of 4096\n"
191 if (avctx->profile == FF_PROFILE_UNKNOWN) {
192 if (avctx->level != FF_LEVEL_UNKNOWN) {
193 av_log(avctx, AV_LOG_ERROR, "Set profile and level\n");
197 avctx->profile = avctx->pix_fmt == AV_PIX_FMT_YUV420P ? FF_PROFILE_MPEG2_MAIN
200 if (avctx->level == FF_LEVEL_UNKNOWN) {
201 if (avctx->profile == FF_PROFILE_MPEG2_422) { /* 4:2:2 */
202 if (avctx->width <= 720 && avctx->height <= 608)
203 avctx->level = 5; /* Main */
205 avctx->level = 2; /* High */
207 if (avctx->profile != FF_PROFILE_MPEG2_HIGH &&
208 avctx->pix_fmt != AV_PIX_FMT_YUV420P) {
209 av_log(avctx, AV_LOG_ERROR,
213 if (avctx->width <= 720 && avctx->height <= 576)
214 avctx->level = 8; /* Main */
215 else if (avctx->width <= 1440)
216 avctx->level = 6; /* High 1440 */
218 avctx->level = 4; /* High */
222 if ((ret = ff_mpv_encode_init(avctx)) < 0)
226 if (avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
227 av_log(avctx, AV_LOG_ERROR, "MPEG-1/2 does not support %d/%d fps\n",
228 avctx->time_base.den, avctx->time_base.num);
231 av_log(avctx, AV_LOG_INFO,
233 avctx->time_base.den, avctx->time_base.num);
237 mpeg12->drop_frame_timecode = mpeg12->drop_frame_timecode || !!(avctx->flags2 & AV_CODEC_FLAG2_DROP_FRAME_TIMECODE);
241 av_log(avctx, AV_LOG_ERROR,
276 AVRational aspect_ratio = s->avctx->sample_aspect_ratio;
309 if (s->avctx->rc_max_rate) {
310 v = (s->avctx->rc_max_rate + 399) / 400;
317 if (s->avctx->rc_buffer_size)
318 vbv_buffer_size = s->avctx->rc_buffer_size;
335 s->avctx->me_range &&
336 s->avctx->me_range < 128 &&
343 ff_write_quant_matrix(&s->pb, s->avctx->intra_matrix);
344 ff_write_quant_matrix(&s->pb, s->avctx->inter_matrix);
355 put_bits(&s->pb, 1, s->avctx->profile == FF_PROFILE_MPEG2_422); // escx 1 for 4:2:2 profile
357 put_bits(&s->pb, 3, s->avctx->profile); // profile
358 put_bits(&s->pb, 4, s->avctx->level); // level
382 s->avctx->color_primaries != AVCOL_PRI_UNSPECIFIED ||
383 s->avctx->color_trc != AVCOL_TRC_UNSPECIFIED ||
384 s->avctx->colorspace != AVCOL_SPC_UNSPECIFIED ||
393 put_bits(&s->pb, 8, s->avctx->color_primaries); // colour_primaries
394 put_bits(&s->pb, 8, s->avctx->color_trc); // transfer_characteristics
395 put_bits(&s->pb, 8, s->avctx->colorspace); // matrix_coefficients
422 put_bits(&s->pb, 1, !!(s->avctx->flags & AV_CODEC_FLAG_CLOSED_GOP) ||
605 av_log(s->avctx, AV_LOG_WARNING,
1198 #define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, { .i64 = value }, 0, 0, VE, "avctx.level"