Lines Matching +full:- +full:s
2 * MPEG-1/2 encoder
4 * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 * MPEG-1/2 encoder
73 int level = i - 64; in ff_mpeg1_init_uni_ac_vlc()
81 if (alevel > rl->max_level[0][run]) in ff_mpeg1_init_uni_ac_vlc()
82 code = 111; /* rl->n */ in ff_mpeg1_init_uni_ac_vlc()
84 code = rl->index_run[0][run] + alevel - 1; in ff_mpeg1_init_uni_ac_vlc()
86 if (code < 111) { /* rl->n */ in ff_mpeg1_init_uni_ac_vlc()
88 len = rl->table_vlc[code][1] + 1; in ff_mpeg1_init_uni_ac_vlc()
90 len = rl->table_vlc[111 /* rl->n */][1] + 6; in ff_mpeg1_init_uni_ac_vlc()
104 static int find_frame_rate_index(MpegEncContext *s) in find_frame_rate_index() argument
109 AVRational target = av_inv_q(s->avctx->time_base); in find_frame_rate_index()
112 if (s->avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL && in find_frame_rate_index()
120 if (s->codec_id != AV_CODEC_ID_MPEG2VIDEO && (ext.den!=1 || ext.num!=1)) in find_frame_rate_index()
129 s->frame_rate_index = i; in find_frame_rate_index()
130 s->mpeg2_frame_rate_ext.num = ext.num; in find_frame_rate_index()
131 s->mpeg2_frame_rate_ext.den = ext.den; in find_frame_rate_index()
138 return -1; in find_frame_rate_index()
146 MpegEncContext *s = avctx->priv_data; in encode_init() local
151 if (find_frame_rate_index(s) < 0) { in encode_init()
152 if (s->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) { in encode_init()
153 av_log(avctx, AV_LOG_ERROR, "MPEG-1/2 does not support %d/%d fps\n", in encode_init()
154 avctx->time_base.den, avctx->time_base.num); in encode_init()
158 "MPEG-1/2 does not support %d/%d fps, there may be AV sync issues\n", in encode_init()
159 avctx->time_base.den, avctx->time_base.num); in encode_init()
163 if (avctx->profile == FF_PROFILE_UNKNOWN) { in encode_init()
164 if (avctx->level != FF_LEVEL_UNKNOWN) { in encode_init()
169 … avctx->profile = s->chroma_format == CHROMA_420 ? FF_PROFILE_MPEG2_MAIN : FF_PROFILE_MPEG2_422; in encode_init()
172 if (avctx->level == FF_LEVEL_UNKNOWN) { in encode_init()
173 if (avctx->profile == FF_PROFILE_MPEG2_422) { /* 4:2:2 */ in encode_init()
174 if (avctx->width <= 720 && avctx->height <= 608) in encode_init()
175 avctx->level = 5; /* Main */ in encode_init()
177 avctx->level = 2; /* High */ in encode_init()
179 if (avctx->profile != FF_PROFILE_MPEG2_HIGH && s->chroma_format != CHROMA_420) { in encode_init()
184 if (avctx->width <= 720 && avctx->height <= 576) in encode_init()
185 avctx->level = 8; /* Main */ in encode_init()
186 else if (avctx->width <= 1440) in encode_init()
187 avctx->level = 6; /* High 1440 */ in encode_init()
189 avctx->level = 4; /* High */ in encode_init()
193 if ((avctx->width & 0xFFF) == 0 && (avctx->height & 0xFFF) == 1) { in encode_init()
198 if (s->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL) { in encode_init()
199 if ((avctx->width & 0xFFF) == 0 || (avctx->height & 0xFFF) == 0) { in encode_init()
201 … "add '-strict %d' if you want to use them anyway.\n", FF_COMPLIANCE_UNOFFICIAL); in encode_init()
206 …s->drop_frame_timecode = s->drop_frame_timecode || !!(avctx->flags2 & AV_CODEC_FLAG2_DROP_FRAME_TI… in encode_init()
207 if (s->drop_frame_timecode) in encode_init()
208 s->tc.flags |= AV_TIMECODE_FLAG_DROPFRAME; in encode_init()
209 if (s->drop_frame_timecode && s->frame_rate_index != 4) { in encode_init()
217 if (avctx->timecode_frame_start) in encode_init()
218 s->timecode_frame_start = avctx->timecode_frame_start; in encode_init()
222 if (s->tc_opt_str) { in encode_init()
223 AVRational rate = ff_mpeg12_frame_rate_tab[s->frame_rate_index]; in encode_init()
224 int ret = av_timecode_init_from_string(&s->tc, rate, s->tc_opt_str, s); in encode_init()
227 s->drop_frame_timecode = !!(s->tc.flags & AV_TIMECODE_FLAG_DROPFRAME); in encode_init()
228 s->timecode_frame_start = s->tc.start; in encode_init()
230 s->timecode_frame_start = 0; // default is -1 in encode_init()
236 static void put_header(MpegEncContext *s, int header) in put_header() argument
238 align_put_bits(&s->pb); in put_header()
239 put_bits(&s->pb, 16, header >> 16); in put_header()
240 put_sbits(&s->pb, 16, header); in put_header()
244 static void mpeg1_encode_sequence_header(MpegEncContext *s) in mpeg1_encode_sequence_header() argument
250 AVRational aspect_ratio = s->avctx->sample_aspect_ratio; in mpeg1_encode_sequence_header()
255 if (s->current_picture.f->key_frame) { in mpeg1_encode_sequence_header()
256 AVRational framerate = ff_mpeg12_frame_rate_tab[s->frame_rate_index]; in mpeg1_encode_sequence_header()
258 /* MPEG-1 header repeated every GOP */ in mpeg1_encode_sequence_header()
259 put_header(s, SEQ_START_CODE); in mpeg1_encode_sequence_header()
261 put_sbits(&s->pb, 12, s->width & 0xFFF); in mpeg1_encode_sequence_header()
262 put_sbits(&s->pb, 12, s->height & 0xFFF); in mpeg1_encode_sequence_header()
266 if (s->codec_id == AV_CODEC_ID_MPEG1VIDEO || i <= 1) in mpeg1_encode_sequence_header()
267 error -= (1LL<<32) / ff_mpeg1_aspect[i]; in mpeg1_encode_sequence_header()
269 … error -= (1LL<<32)*ff_mpeg2_aspect[i].num * s->height / s->width / ff_mpeg2_aspect[i].den; in mpeg1_encode_sequence_header()
273 if (error - 2 <= best_aspect_error) { in mpeg1_encode_sequence_header()
275 s->aspect_ratio_info = i; in mpeg1_encode_sequence_header()
279 put_bits(&s->pb, 4, s->aspect_ratio_info); in mpeg1_encode_sequence_header()
280 put_bits(&s->pb, 4, s->frame_rate_index); in mpeg1_encode_sequence_header()
282 if (s->avctx->rc_max_rate) { in mpeg1_encode_sequence_header()
283 v = (s->avctx->rc_max_rate + 399) / 400; in mpeg1_encode_sequence_header()
284 if (v > 0x3ffff && s->codec_id == AV_CODEC_ID_MPEG1VIDEO) in mpeg1_encode_sequence_header()
290 if (s->avctx->rc_buffer_size) in mpeg1_encode_sequence_header()
291 vbv_buffer_size = s->avctx->rc_buffer_size; in mpeg1_encode_sequence_header()
295 vbv_buffer_size = ((20 * s->bit_rate) / (1151929 / 2)) * 8 * 1024; in mpeg1_encode_sequence_header()
298 put_sbits(&s->pb, 18, v); in mpeg1_encode_sequence_header()
299 put_bits(&s->pb, 1, 1); // marker in mpeg1_encode_sequence_header()
300 put_sbits(&s->pb, 10, vbv_buffer_size); in mpeg1_encode_sequence_header()
303 s->width <= 768 && in mpeg1_encode_sequence_header()
304 s->height <= 576 && in mpeg1_encode_sequence_header()
305 s->mb_width * s->mb_height <= 396 && in mpeg1_encode_sequence_header()
306 s->mb_width * s->mb_height * framerate.num <= 396 * 25 * framerate.den && in mpeg1_encode_sequence_header()
308 s->avctx->me_range && in mpeg1_encode_sequence_header()
309 s->avctx->me_range < 128 && in mpeg1_encode_sequence_header()
312 s->codec_id == AV_CODEC_ID_MPEG1VIDEO; in mpeg1_encode_sequence_header()
314 put_bits(&s->pb, 1, constraint_parameter_flag); in mpeg1_encode_sequence_header()
316 ff_write_quant_matrix(&s->pb, s->avctx->intra_matrix); in mpeg1_encode_sequence_header()
317 ff_write_quant_matrix(&s->pb, s->avctx->inter_matrix); in mpeg1_encode_sequence_header()
319 if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO) { in mpeg1_encode_sequence_header()
321 int width = s->width; in mpeg1_encode_sequence_header()
322 int height = s->height; in mpeg1_encode_sequence_header()
325 put_header(s, EXT_START_CODE); in mpeg1_encode_sequence_header()
326 put_bits(&s->pb, 4, 1); // seq ext in mpeg1_encode_sequence_header()
328 … put_bits(&s->pb, 1, s->avctx->profile == FF_PROFILE_MPEG2_422); // escx 1 for 4:2:2 profile in mpeg1_encode_sequence_header()
330 put_bits(&s->pb, 3, s->avctx->profile); // profile in mpeg1_encode_sequence_header()
331 put_bits(&s->pb, 4, s->avctx->level); // level in mpeg1_encode_sequence_header()
333 put_bits(&s->pb, 1, s->progressive_sequence); in mpeg1_encode_sequence_header()
334 put_bits(&s->pb, 2, s->chroma_format); in mpeg1_encode_sequence_header()
335 put_bits(&s->pb, 2, s->width >> 12); in mpeg1_encode_sequence_header()
336 put_bits(&s->pb, 2, s->height >> 12); in mpeg1_encode_sequence_header()
337 put_bits(&s->pb, 12, v >> 18); // bitrate ext in mpeg1_encode_sequence_header()
338 put_bits(&s->pb, 1, 1); // marker in mpeg1_encode_sequence_header()
339 put_bits(&s->pb, 8, vbv_buffer_size >> 10); // vbv buffer ext in mpeg1_encode_sequence_header()
340 put_bits(&s->pb, 1, s->low_delay); in mpeg1_encode_sequence_header()
341 put_bits(&s->pb, 2, s->mpeg2_frame_rate_ext.num-1); // frame_rate_ext_n in mpeg1_encode_sequence_header()
342 put_bits(&s->pb, 5, s->mpeg2_frame_rate_ext.den-1); // frame_rate_ext_d in mpeg1_encode_sequence_header()
344 side_data = av_frame_get_side_data(s->current_picture_ptr->f, AV_FRAME_DATA_PANSCAN); in mpeg1_encode_sequence_header()
346 AVPanScan *pan_scan = (AVPanScan *)side_data->data; in mpeg1_encode_sequence_header()
347 if (pan_scan->width && pan_scan->height) { in mpeg1_encode_sequence_header()
348 width = pan_scan->width >> 4; in mpeg1_encode_sequence_header()
349 height = pan_scan->height >> 4; in mpeg1_encode_sequence_header()
353 use_seq_disp_ext = (width != s->width || in mpeg1_encode_sequence_header()
354 height != s->height || in mpeg1_encode_sequence_header()
355 s->avctx->color_primaries != AVCOL_PRI_UNSPECIFIED || in mpeg1_encode_sequence_header()
356 s->avctx->color_trc != AVCOL_TRC_UNSPECIFIED || in mpeg1_encode_sequence_header()
357 s->avctx->colorspace != AVCOL_SPC_UNSPECIFIED || in mpeg1_encode_sequence_header()
358 s->video_format != VIDEO_FORMAT_UNSPECIFIED); in mpeg1_encode_sequence_header()
360 if (s->seq_disp_ext == 1 || (s->seq_disp_ext == -1 && use_seq_disp_ext)) { in mpeg1_encode_sequence_header()
361 put_header(s, EXT_START_CODE); in mpeg1_encode_sequence_header()
362 put_bits(&s->pb, 4, 2); // sequence display extension in mpeg1_encode_sequence_header()
363 put_bits(&s->pb, 3, s->video_format); // video_format in mpeg1_encode_sequence_header()
364 put_bits(&s->pb, 1, 1); // colour_description in mpeg1_encode_sequence_header()
365 put_bits(&s->pb, 8, s->avctx->color_primaries); // colour_primaries in mpeg1_encode_sequence_header()
366 put_bits(&s->pb, 8, s->avctx->color_trc); // transfer_characteristics in mpeg1_encode_sequence_header()
367 put_bits(&s->pb, 8, s->avctx->colorspace); // matrix_coefficients in mpeg1_encode_sequence_header()
368 put_bits(&s->pb, 14, width); // display_horizontal_size in mpeg1_encode_sequence_header()
369 put_bits(&s->pb, 1, 1); // marker_bit in mpeg1_encode_sequence_header()
370 put_bits(&s->pb, 14, height); // display_vertical_size in mpeg1_encode_sequence_header()
371 put_bits(&s->pb, 3, 0); // remaining 3 bits are zero padding in mpeg1_encode_sequence_header()
375 put_header(s, GOP_START_CODE); in mpeg1_encode_sequence_header()
376 put_bits(&s->pb, 1, s->drop_frame_timecode); // drop frame flag in mpeg1_encode_sequence_header()
380 time_code = s->current_picture_ptr->f->coded_picture_number + in mpeg1_encode_sequence_header()
381 s->timecode_frame_start; in mpeg1_encode_sequence_header()
383 s->gop_picture_number = s->current_picture_ptr->f->coded_picture_number; in mpeg1_encode_sequence_header()
385 av_assert0(s->drop_frame_timecode == !!(s->tc.flags & AV_TIMECODE_FLAG_DROPFRAME)); in mpeg1_encode_sequence_header()
386 if (s->drop_frame_timecode) in mpeg1_encode_sequence_header()
389 put_bits(&s->pb, 5, (uint32_t)((time_code / (fps * 3600)) % 24)); in mpeg1_encode_sequence_header()
390 put_bits(&s->pb, 6, (uint32_t)((time_code / (fps * 60)) % 60)); in mpeg1_encode_sequence_header()
391 put_bits(&s->pb, 1, 1); in mpeg1_encode_sequence_header()
392 put_bits(&s->pb, 6, (uint32_t)((time_code / fps) % 60)); in mpeg1_encode_sequence_header()
393 put_bits(&s->pb, 6, (uint32_t)((time_code % fps))); in mpeg1_encode_sequence_header()
394 …put_bits(&s->pb, 1, !!(s->avctx->flags & AV_CODEC_FLAG_CLOSED_GOP) || s->intra_only || !s->gop_pic… in mpeg1_encode_sequence_header()
395 put_bits(&s->pb, 1, 0); // broken link in mpeg1_encode_sequence_header()
399 static inline void encode_mb_skip_run(MpegEncContext *s, int run) in encode_mb_skip_run() argument
402 put_bits(&s->pb, 11, 0x008); in encode_mb_skip_run()
403 run -= 33; in encode_mb_skip_run()
405 put_bits(&s->pb, ff_mpeg12_mbAddrIncrTable[run][1], in encode_mb_skip_run()
409 static av_always_inline void put_qscale(MpegEncContext *s) in put_qscale() argument
411 put_bits(&s->pb, 5, s->qscale); in put_qscale()
414 void ff_mpeg1_encode_slice_header(MpegEncContext *s) in ff_mpeg1_encode_slice_header() argument
416 if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO && s->height > 2800) { in ff_mpeg1_encode_slice_header()
417 put_header(s, SLICE_MIN_START_CODE + (s->mb_y & 127)); in ff_mpeg1_encode_slice_header()
419 put_bits(&s->pb, 3, s->mb_y >> 7); in ff_mpeg1_encode_slice_header()
421 put_header(s, SLICE_MIN_START_CODE + s->mb_y); in ff_mpeg1_encode_slice_header()
423 put_qscale(s); in ff_mpeg1_encode_slice_header()
425 put_bits(&s->pb, 1, 0); in ff_mpeg1_encode_slice_header()
428 void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number) in ff_mpeg1_encode_picture_header() argument
431 mpeg1_encode_sequence_header(s); in ff_mpeg1_encode_picture_header()
433 /* MPEG-1 picture header */ in ff_mpeg1_encode_picture_header()
434 put_header(s, PICTURE_START_CODE); in ff_mpeg1_encode_picture_header()
437 // RAL: s->picture_number instead of s->fake_picture_number in ff_mpeg1_encode_picture_header()
438 put_bits(&s->pb, 10, in ff_mpeg1_encode_picture_header()
439 (s->picture_number - s->gop_picture_number) & 0x3ff); in ff_mpeg1_encode_picture_header()
440 put_bits(&s->pb, 3, s->pict_type); in ff_mpeg1_encode_picture_header()
442 s->vbv_delay_ptr = s->pb.buf + put_bits_count(&s->pb) / 8; in ff_mpeg1_encode_picture_header()
443 put_bits(&s->pb, 16, 0xFFFF); /* vbv_delay */ in ff_mpeg1_encode_picture_header()
445 // RAL: Forward f_code also needed for B-frames in ff_mpeg1_encode_picture_header()
446 if (s->pict_type == AV_PICTURE_TYPE_P || in ff_mpeg1_encode_picture_header()
447 s->pict_type == AV_PICTURE_TYPE_B) { in ff_mpeg1_encode_picture_header()
448 put_bits(&s->pb, 1, 0); /* half pel coordinates */ in ff_mpeg1_encode_picture_header()
449 if (s->codec_id == AV_CODEC_ID_MPEG1VIDEO) in ff_mpeg1_encode_picture_header()
450 put_bits(&s->pb, 3, s->f_code); /* forward_f_code */ in ff_mpeg1_encode_picture_header()
452 put_bits(&s->pb, 3, 7); /* forward_f_code */ in ff_mpeg1_encode_picture_header()
455 // RAL: Backward f_code necessary for B-frames in ff_mpeg1_encode_picture_header()
456 if (s->pict_type == AV_PICTURE_TYPE_B) { in ff_mpeg1_encode_picture_header()
457 put_bits(&s->pb, 1, 0); /* half pel coordinates */ in ff_mpeg1_encode_picture_header()
458 if (s->codec_id == AV_CODEC_ID_MPEG1VIDEO) in ff_mpeg1_encode_picture_header()
459 put_bits(&s->pb, 3, s->b_code); /* backward_f_code */ in ff_mpeg1_encode_picture_header()
461 put_bits(&s->pb, 3, 7); /* backward_f_code */ in ff_mpeg1_encode_picture_header()
464 put_bits(&s->pb, 1, 0); /* extra bit picture */ in ff_mpeg1_encode_picture_header()
466 s->frame_pred_frame_dct = 1; in ff_mpeg1_encode_picture_header()
467 if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO) { in ff_mpeg1_encode_picture_header()
468 put_header(s, EXT_START_CODE); in ff_mpeg1_encode_picture_header()
469 put_bits(&s->pb, 4, 8); /* pic ext */ in ff_mpeg1_encode_picture_header()
470 if (s->pict_type == AV_PICTURE_TYPE_P || in ff_mpeg1_encode_picture_header()
471 s->pict_type == AV_PICTURE_TYPE_B) { in ff_mpeg1_encode_picture_header()
472 put_bits(&s->pb, 4, s->f_code); in ff_mpeg1_encode_picture_header()
473 put_bits(&s->pb, 4, s->f_code); in ff_mpeg1_encode_picture_header()
475 put_bits(&s->pb, 8, 255); in ff_mpeg1_encode_picture_header()
477 if (s->pict_type == AV_PICTURE_TYPE_B) { in ff_mpeg1_encode_picture_header()
478 put_bits(&s->pb, 4, s->b_code); in ff_mpeg1_encode_picture_header()
479 put_bits(&s->pb, 4, s->b_code); in ff_mpeg1_encode_picture_header()
481 put_bits(&s->pb, 8, 255); in ff_mpeg1_encode_picture_header()
483 put_bits(&s->pb, 2, s->intra_dc_precision); in ff_mpeg1_encode_picture_header()
485 av_assert0(s->picture_structure == PICT_FRAME); in ff_mpeg1_encode_picture_header()
486 put_bits(&s->pb, 2, s->picture_structure); in ff_mpeg1_encode_picture_header()
487 if (s->progressive_sequence) in ff_mpeg1_encode_picture_header()
488 put_bits(&s->pb, 1, 0); /* no repeat */ in ff_mpeg1_encode_picture_header()
490 put_bits(&s->pb, 1, s->current_picture_ptr->f->top_field_first); in ff_mpeg1_encode_picture_header()
492 s->frame_pred_frame_dct = s->progressive_sequence; in ff_mpeg1_encode_picture_header()
494 put_bits(&s->pb, 1, s->frame_pred_frame_dct); in ff_mpeg1_encode_picture_header()
495 put_bits(&s->pb, 1, s->concealment_motion_vectors); in ff_mpeg1_encode_picture_header()
496 put_bits(&s->pb, 1, s->q_scale_type); in ff_mpeg1_encode_picture_header()
497 put_bits(&s->pb, 1, s->intra_vlc_format); in ff_mpeg1_encode_picture_header()
498 put_bits(&s->pb, 1, s->alternate_scan); in ff_mpeg1_encode_picture_header()
499 put_bits(&s->pb, 1, s->repeat_first_field); in ff_mpeg1_encode_picture_header()
500 s->progressive_frame = s->progressive_sequence; in ff_mpeg1_encode_picture_header()
502 put_bits(&s->pb, 1, s->chroma_format == in ff_mpeg1_encode_picture_header()
503 CHROMA_420 ? s->progressive_frame : 0); in ff_mpeg1_encode_picture_header()
504 put_bits(&s->pb, 1, s->progressive_frame); in ff_mpeg1_encode_picture_header()
505 put_bits(&s->pb, 1, 0); /* composite_display_flag */ in ff_mpeg1_encode_picture_header()
507 if (s->scan_offset) { in ff_mpeg1_encode_picture_header()
510 put_header(s, USER_START_CODE); in ff_mpeg1_encode_picture_header()
512 put_bits(&s->pb, 8, svcd_scan_offset_placeholder[i]); in ff_mpeg1_encode_picture_header()
514 side_data = av_frame_get_side_data(s->current_picture_ptr->f, in ff_mpeg1_encode_picture_header()
517 AVStereo3D *stereo = (AVStereo3D *)side_data->data; in ff_mpeg1_encode_picture_header()
520 switch (stereo->type) { in ff_mpeg1_encode_picture_header()
539 put_header(s, USER_START_CODE); in ff_mpeg1_encode_picture_header()
540 put_bits(&s->pb, 8, 'J'); // S3D_video_format_signaling_identifier in ff_mpeg1_encode_picture_header()
541 put_bits(&s->pb, 8, 'P'); in ff_mpeg1_encode_picture_header()
542 put_bits(&s->pb, 8, '3'); in ff_mpeg1_encode_picture_header()
543 put_bits(&s->pb, 8, 'D'); in ff_mpeg1_encode_picture_header()
544 put_bits(&s->pb, 8, 0x03); // S3D_video_format_length in ff_mpeg1_encode_picture_header()
546 put_bits(&s->pb, 1, 1); // reserved_bit in ff_mpeg1_encode_picture_header()
547 put_bits(&s->pb, 7, fpa_type); // S3D_video_format_type in ff_mpeg1_encode_picture_header()
548 put_bits(&s->pb, 8, 0x04); // reserved_data[0] in ff_mpeg1_encode_picture_header()
549 put_bits(&s->pb, 8, 0xFF); // reserved_data[1] in ff_mpeg1_encode_picture_header()
553 if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO && s->a53_cc) { in ff_mpeg1_encode_picture_header()
554 side_data = av_frame_get_side_data(s->current_picture_ptr->f, in ff_mpeg1_encode_picture_header()
557 if (side_data->size <= A53_MAX_CC_COUNT * 3 && side_data->size % 3 == 0) { in ff_mpeg1_encode_picture_header()
560 put_header (s, USER_START_CODE); in ff_mpeg1_encode_picture_header()
562 put_bits(&s->pb, 8, 'G'); // user_identifier in ff_mpeg1_encode_picture_header()
563 put_bits(&s->pb, 8, 'A'); in ff_mpeg1_encode_picture_header()
564 put_bits(&s->pb, 8, '9'); in ff_mpeg1_encode_picture_header()
565 put_bits(&s->pb, 8, '4'); in ff_mpeg1_encode_picture_header()
566 put_bits(&s->pb, 8, 3); // user_data_type_code in ff_mpeg1_encode_picture_header()
567 put_bits(&s->pb, 8, in ff_mpeg1_encode_picture_header()
568 (side_data->size / 3 & A53_MAX_CC_COUNT) | 0x40); // flags, cc_count in ff_mpeg1_encode_picture_header()
569 put_bits(&s->pb, 8, 0xff); // em_data in ff_mpeg1_encode_picture_header()
571 for (i = 0; i < side_data->size; i++) in ff_mpeg1_encode_picture_header()
572 put_bits(&s->pb, 8, side_data->data[i]); in ff_mpeg1_encode_picture_header()
574 put_bits(&s->pb, 8, 0xff); // marker_bits in ff_mpeg1_encode_picture_header()
576 av_log(s->avctx, AV_LOG_WARNING, in ff_mpeg1_encode_picture_header()
578 "and must be a multiple of 3\n", side_data->size); in ff_mpeg1_encode_picture_header()
583 s->mb_y = 0; in ff_mpeg1_encode_picture_header()
584 ff_mpeg1_encode_slice_header(s); in ff_mpeg1_encode_picture_header()
587 static inline void put_mb_modes(MpegEncContext *s, int n, int bits, in put_mb_modes() argument
590 put_bits(&s->pb, n, bits); in put_mb_modes()
591 if (!s->frame_pred_frame_dct) { in put_mb_modes()
594 put_bits(&s->pb, 2, 2 - field_motion); in put_mb_modes()
595 put_bits(&s->pb, 1, s->interlaced_dct); in put_mb_modes()
600 static void mpeg1_encode_motion(MpegEncContext *s, int val, int f_or_b_code) in mpeg1_encode_motion() argument
604 put_bits(&s->pb, in mpeg1_encode_motion()
609 int bit_size = f_or_b_code - 1; in mpeg1_encode_motion()
615 val--; in mpeg1_encode_motion()
617 bits = val & (range - 1); in mpeg1_encode_motion()
620 val = -val; in mpeg1_encode_motion()
621 val--; in mpeg1_encode_motion()
623 bits = val & (range - 1); in mpeg1_encode_motion()
629 put_bits(&s->pb, in mpeg1_encode_motion()
633 put_bits(&s->pb, 1, sign); in mpeg1_encode_motion()
635 put_bits(&s->pb, bit_size, bits); in mpeg1_encode_motion()
639 static inline void encode_dc(MpegEncContext *s, int diff, int component) in encode_dc() argument
646 index = av_log2_16bit(-2 * diff); in encode_dc()
647 diff--; in encode_dc()
652 put_bits(&s->pb, in encode_dc()
657 put_bits(&s->pb, in encode_dc()
663 put_bits(&s->pb, in encode_dc()
667 put_bits(&s->pb, in encode_dc()
673 static void mpeg1_encode_block(MpegEncContext *s, int16_t *block, int n) in mpeg1_encode_block() argument
679 last_index = s->block_last_index[n]; in mpeg1_encode_block()
682 if (s->mb_intra) { in mpeg1_encode_block()
685 diff = dc - s->last_dc[component]; in mpeg1_encode_block()
686 encode_dc(s, diff, component); in mpeg1_encode_block()
687 s->last_dc[component] = dc; in mpeg1_encode_block()
689 if (s->intra_vlc_format) in mpeg1_encode_block()
697 put_bits(&s->pb, 2, code | 0x02); in mpeg1_encode_block()
701 last_non_zero = -1; in mpeg1_encode_block()
707 last_non_zero = i - 1; in mpeg1_encode_block()
710 j = s->intra_scantable.permutated[i]; in mpeg1_encode_block()
716 run = i - last_non_zero - 1; in mpeg1_encode_block()
723 code = ff_rl_mpeg1.index_run[0][run] + alevel - 1; in mpeg1_encode_block()
725 put_bits(&s->pb, table_vlc[code][1] + 1, in mpeg1_encode_block()
729 put_bits(&s->pb, table_vlc[111][1], table_vlc[111][0]); in mpeg1_encode_block()
731 put_bits(&s->pb, 6, run); in mpeg1_encode_block()
732 if (s->codec_id == AV_CODEC_ID_MPEG1VIDEO) { in mpeg1_encode_block()
734 put_sbits(&s->pb, 8, level); in mpeg1_encode_block()
737 put_bits(&s->pb, 16, 0x8001 + level + 255); in mpeg1_encode_block()
739 put_sbits(&s->pb, 16, level); in mpeg1_encode_block()
742 put_sbits(&s->pb, 12, level); in mpeg1_encode_block()
749 put_bits(&s->pb, table_vlc[112][1], table_vlc[112][0]); in mpeg1_encode_block()
752 static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s, in mpeg1_encode_mb_internal() argument
758 const int mb_x = s->mb_x; in mpeg1_encode_mb_internal()
759 const int mb_y = s->mb_y; in mpeg1_encode_mb_internal()
760 const int first_mb = mb_x == s->resync_mb_x && mb_y == s->resync_mb_y; in mpeg1_encode_mb_internal()
765 if (s->block_last_index[i] >= 0) in mpeg1_encode_mb_internal()
766 cbp |= 1 << (mb_block_count - 1 - i); in mpeg1_encode_mb_internal()
768 if (cbp == 0 && !first_mb && s->mv_type == MV_TYPE_16X16 && in mpeg1_encode_mb_internal()
769 (mb_x != s->mb_width - 1 || in mpeg1_encode_mb_internal()
770 (mb_y != s->end_mb_y - 1 && s->codec_id == AV_CODEC_ID_MPEG1VIDEO)) && in mpeg1_encode_mb_internal()
771 ((s->pict_type == AV_PICTURE_TYPE_P && (motion_x | motion_y) == 0) || in mpeg1_encode_mb_internal()
772 (s->pict_type == AV_PICTURE_TYPE_B && s->mv_dir == s->last_mv_dir && in mpeg1_encode_mb_internal()
773 (((s->mv_dir & MV_DIR_FORWARD) in mpeg1_encode_mb_internal()
774 ? ((s->mv[0][0][0] - s->last_mv[0][0][0]) | in mpeg1_encode_mb_internal()
775 (s->mv[0][0][1] - s->last_mv[0][0][1])) : 0) | in mpeg1_encode_mb_internal()
776 ((s->mv_dir & MV_DIR_BACKWARD) in mpeg1_encode_mb_internal()
777 ? ((s->mv[1][0][0] - s->last_mv[1][0][0]) | in mpeg1_encode_mb_internal()
778 (s->mv[1][0][1] - s->last_mv[1][0][1])) : 0)) == 0))) { in mpeg1_encode_mb_internal()
779 s->mb_skip_run++; in mpeg1_encode_mb_internal()
780 s->qscale -= s->dquant; in mpeg1_encode_mb_internal()
781 s->skip_count++; in mpeg1_encode_mb_internal()
782 s->misc_bits++; in mpeg1_encode_mb_internal()
783 s->last_bits++; in mpeg1_encode_mb_internal()
784 if (s->pict_type == AV_PICTURE_TYPE_P) { in mpeg1_encode_mb_internal()
785 s->last_mv[0][0][0] = in mpeg1_encode_mb_internal()
786 s->last_mv[0][0][1] = in mpeg1_encode_mb_internal()
787 s->last_mv[0][1][0] = in mpeg1_encode_mb_internal()
788 s->last_mv[0][1][1] = 0; in mpeg1_encode_mb_internal()
792 av_assert0(s->mb_skip_run == 0); in mpeg1_encode_mb_internal()
793 encode_mb_skip_run(s, s->mb_x); in mpeg1_encode_mb_internal()
795 encode_mb_skip_run(s, s->mb_skip_run); in mpeg1_encode_mb_internal()
798 if (s->pict_type == AV_PICTURE_TYPE_I) { in mpeg1_encode_mb_internal()
799 if (s->dquant && cbp) { in mpeg1_encode_mb_internal()
801 put_mb_modes(s, 2, 1, 0, 0); in mpeg1_encode_mb_internal()
802 put_qscale(s); in mpeg1_encode_mb_internal()
805 put_mb_modes(s, 1, 1, 0, 0); in mpeg1_encode_mb_internal()
806 s->qscale -= s->dquant; in mpeg1_encode_mb_internal()
808 s->misc_bits += get_bits_diff(s); in mpeg1_encode_mb_internal()
809 s->i_count++; in mpeg1_encode_mb_internal()
810 } else if (s->mb_intra) { in mpeg1_encode_mb_internal()
811 if (s->dquant && cbp) { in mpeg1_encode_mb_internal()
812 put_mb_modes(s, 6, 0x01, 0, 0); in mpeg1_encode_mb_internal()
813 put_qscale(s); in mpeg1_encode_mb_internal()
815 put_mb_modes(s, 5, 0x03, 0, 0); in mpeg1_encode_mb_internal()
816 s->qscale -= s->dquant; in mpeg1_encode_mb_internal()
818 s->misc_bits += get_bits_diff(s); in mpeg1_encode_mb_internal()
819 s->i_count++; in mpeg1_encode_mb_internal()
820 memset(s->last_mv, 0, sizeof(s->last_mv)); in mpeg1_encode_mb_internal()
821 } else if (s->pict_type == AV_PICTURE_TYPE_P) { in mpeg1_encode_mb_internal()
822 if (s->mv_type == MV_TYPE_16X16) { in mpeg1_encode_mb_internal()
825 if (s->dquant) { in mpeg1_encode_mb_internal()
827 put_mb_modes(s, 5, 1, 0, 0); in mpeg1_encode_mb_internal()
828 put_qscale(s); in mpeg1_encode_mb_internal()
831 put_mb_modes(s, 2, 1, 0, 0); in mpeg1_encode_mb_internal()
833 s->misc_bits += get_bits_diff(s); in mpeg1_encode_mb_internal()
835 if (s->dquant) { in mpeg1_encode_mb_internal()
836 put_mb_modes(s, 5, 2, 1, 0); /* motion + cbp */ in mpeg1_encode_mb_internal()
837 put_qscale(s); in mpeg1_encode_mb_internal()
839 put_mb_modes(s, 1, 1, 1, 0); /* motion + cbp */ in mpeg1_encode_mb_internal()
841 s->misc_bits += get_bits_diff(s); in mpeg1_encode_mb_internal()
843 mpeg1_encode_motion(s, in mpeg1_encode_mb_internal()
844 motion_x - s->last_mv[0][0][0], in mpeg1_encode_mb_internal()
845 s->f_code); in mpeg1_encode_mb_internal()
847 mpeg1_encode_motion(s, in mpeg1_encode_mb_internal()
848 motion_y - s->last_mv[0][0][1], in mpeg1_encode_mb_internal()
849 s->f_code); in mpeg1_encode_mb_internal()
850 s->mv_bits += get_bits_diff(s); in mpeg1_encode_mb_internal()
853 put_bits(&s->pb, 3, 1); /* motion only */ in mpeg1_encode_mb_internal()
854 if (!s->frame_pred_frame_dct) in mpeg1_encode_mb_internal()
855 put_bits(&s->pb, 2, 2); /* motion_type: frame */ in mpeg1_encode_mb_internal()
856 s->misc_bits += get_bits_diff(s); in mpeg1_encode_mb_internal()
858 mpeg1_encode_motion(s, in mpeg1_encode_mb_internal()
859 motion_x - s->last_mv[0][0][0], in mpeg1_encode_mb_internal()
860 s->f_code); in mpeg1_encode_mb_internal()
862 mpeg1_encode_motion(s, in mpeg1_encode_mb_internal()
863 motion_y - s->last_mv[0][0][1], in mpeg1_encode_mb_internal()
864 s->f_code); in mpeg1_encode_mb_internal()
865 s->qscale -= s->dquant; in mpeg1_encode_mb_internal()
866 s->mv_bits += get_bits_diff(s); in mpeg1_encode_mb_internal()
868 s->last_mv[0][1][0] = s->last_mv[0][0][0] = motion_x; in mpeg1_encode_mb_internal()
869 s->last_mv[0][1][1] = s->last_mv[0][0][1] = motion_y; in mpeg1_encode_mb_internal()
871 av_assert2(!s->frame_pred_frame_dct && s->mv_type == MV_TYPE_FIELD); in mpeg1_encode_mb_internal()
874 if (s->dquant) { in mpeg1_encode_mb_internal()
875 put_mb_modes(s, 5, 2, 1, 1); /* motion + cbp */ in mpeg1_encode_mb_internal()
876 put_qscale(s); in mpeg1_encode_mb_internal()
878 put_mb_modes(s, 1, 1, 1, 1); /* motion + cbp */ in mpeg1_encode_mb_internal()
881 put_bits(&s->pb, 3, 1); /* motion only */ in mpeg1_encode_mb_internal()
882 put_bits(&s->pb, 2, 1); /* motion_type: field */ in mpeg1_encode_mb_internal()
883 s->qscale -= s->dquant; in mpeg1_encode_mb_internal()
885 s->misc_bits += get_bits_diff(s); in mpeg1_encode_mb_internal()
887 put_bits(&s->pb, 1, s->field_select[0][i]); in mpeg1_encode_mb_internal()
888 mpeg1_encode_motion(s, in mpeg1_encode_mb_internal()
889 s->mv[0][i][0] - s->last_mv[0][i][0], in mpeg1_encode_mb_internal()
890 s->f_code); in mpeg1_encode_mb_internal()
891 mpeg1_encode_motion(s, in mpeg1_encode_mb_internal()
892 s->mv[0][i][1] - (s->last_mv[0][i][1] >> 1), in mpeg1_encode_mb_internal()
893 s->f_code); in mpeg1_encode_mb_internal()
894 s->last_mv[0][i][0] = s->mv[0][i][0]; in mpeg1_encode_mb_internal()
895 s->last_mv[0][i][1] = 2 * s->mv[0][i][1]; in mpeg1_encode_mb_internal()
897 s->mv_bits += get_bits_diff(s); in mpeg1_encode_mb_internal()
900 if (s->chroma_y_shift) { in mpeg1_encode_mb_internal()
901 put_bits(&s->pb, in mpeg1_encode_mb_internal()
905 put_bits(&s->pb, in mpeg1_encode_mb_internal()
908 put_sbits(&s->pb, 2, cbp); in mpeg1_encode_mb_internal()
911 s->f_count++; in mpeg1_encode_mb_internal()
913 if (s->mv_type == MV_TYPE_16X16) { in mpeg1_encode_mb_internal()
915 if (s->dquant) { in mpeg1_encode_mb_internal()
916 if (s->mv_dir == MV_DIR_FORWARD) in mpeg1_encode_mb_internal()
917 put_mb_modes(s, 6, 3, 1, 0); in mpeg1_encode_mb_internal()
919 put_mb_modes(s, 8 - s->mv_dir, 2, 1, 0); in mpeg1_encode_mb_internal()
920 put_qscale(s); in mpeg1_encode_mb_internal()
922 put_mb_modes(s, 5 - s->mv_dir, 3, 1, 0); in mpeg1_encode_mb_internal()
925 put_bits(&s->pb, 5 - s->mv_dir, 2); in mpeg1_encode_mb_internal()
926 if (!s->frame_pred_frame_dct) in mpeg1_encode_mb_internal()
927 put_bits(&s->pb, 2, 2); /* motion_type: frame */ in mpeg1_encode_mb_internal()
928 s->qscale -= s->dquant; in mpeg1_encode_mb_internal()
930 s->misc_bits += get_bits_diff(s); in mpeg1_encode_mb_internal()
931 if (s->mv_dir & MV_DIR_FORWARD) { in mpeg1_encode_mb_internal()
932 mpeg1_encode_motion(s, in mpeg1_encode_mb_internal()
933 s->mv[0][0][0] - s->last_mv[0][0][0], in mpeg1_encode_mb_internal()
934 s->f_code); in mpeg1_encode_mb_internal()
935 mpeg1_encode_motion(s, in mpeg1_encode_mb_internal()
936 s->mv[0][0][1] - s->last_mv[0][0][1], in mpeg1_encode_mb_internal()
937 s->f_code); in mpeg1_encode_mb_internal()
938 s->last_mv[0][0][0] = in mpeg1_encode_mb_internal()
939 s->last_mv[0][1][0] = s->mv[0][0][0]; in mpeg1_encode_mb_internal()
940 s->last_mv[0][0][1] = in mpeg1_encode_mb_internal()
941 s->last_mv[0][1][1] = s->mv[0][0][1]; in mpeg1_encode_mb_internal()
942 s->f_count++; in mpeg1_encode_mb_internal()
944 if (s->mv_dir & MV_DIR_BACKWARD) { in mpeg1_encode_mb_internal()
945 mpeg1_encode_motion(s, in mpeg1_encode_mb_internal()
946 s->mv[1][0][0] - s->last_mv[1][0][0], in mpeg1_encode_mb_internal()
947 s->b_code); in mpeg1_encode_mb_internal()
948 mpeg1_encode_motion(s, in mpeg1_encode_mb_internal()
949 s->mv[1][0][1] - s->last_mv[1][0][1], in mpeg1_encode_mb_internal()
950 s->b_code); in mpeg1_encode_mb_internal()
951 s->last_mv[1][0][0] = in mpeg1_encode_mb_internal()
952 s->last_mv[1][1][0] = s->mv[1][0][0]; in mpeg1_encode_mb_internal()
953 s->last_mv[1][0][1] = in mpeg1_encode_mb_internal()
954 s->last_mv[1][1][1] = s->mv[1][0][1]; in mpeg1_encode_mb_internal()
955 s->b_count++; in mpeg1_encode_mb_internal()
958 av_assert2(s->mv_type == MV_TYPE_FIELD); in mpeg1_encode_mb_internal()
959 av_assert2(!s->frame_pred_frame_dct); in mpeg1_encode_mb_internal()
961 if (s->dquant) { in mpeg1_encode_mb_internal()
962 if (s->mv_dir == MV_DIR_FORWARD) in mpeg1_encode_mb_internal()
963 put_mb_modes(s, 6, 3, 1, 1); in mpeg1_encode_mb_internal()
965 put_mb_modes(s, 8 - s->mv_dir, 2, 1, 1); in mpeg1_encode_mb_internal()
966 put_qscale(s); in mpeg1_encode_mb_internal()
968 put_mb_modes(s, 5 - s->mv_dir, 3, 1, 1); in mpeg1_encode_mb_internal()
971 put_bits(&s->pb, 5 - s->mv_dir, 2); in mpeg1_encode_mb_internal()
972 put_bits(&s->pb, 2, 1); /* motion_type: field */ in mpeg1_encode_mb_internal()
973 s->qscale -= s->dquant; in mpeg1_encode_mb_internal()
975 s->misc_bits += get_bits_diff(s); in mpeg1_encode_mb_internal()
976 if (s->mv_dir & MV_DIR_FORWARD) { in mpeg1_encode_mb_internal()
978 put_bits(&s->pb, 1, s->field_select[0][i]); in mpeg1_encode_mb_internal()
979 mpeg1_encode_motion(s, in mpeg1_encode_mb_internal()
980 s->mv[0][i][0] - s->last_mv[0][i][0], in mpeg1_encode_mb_internal()
981 s->f_code); in mpeg1_encode_mb_internal()
982 mpeg1_encode_motion(s, in mpeg1_encode_mb_internal()
983 s->mv[0][i][1] - (s->last_mv[0][i][1] >> 1), in mpeg1_encode_mb_internal()
984 s->f_code); in mpeg1_encode_mb_internal()
985 s->last_mv[0][i][0] = s->mv[0][i][0]; in mpeg1_encode_mb_internal()
986 s->last_mv[0][i][1] = s->mv[0][i][1] * 2; in mpeg1_encode_mb_internal()
988 s->f_count++; in mpeg1_encode_mb_internal()
990 if (s->mv_dir & MV_DIR_BACKWARD) { in mpeg1_encode_mb_internal()
992 put_bits(&s->pb, 1, s->field_select[1][i]); in mpeg1_encode_mb_internal()
993 mpeg1_encode_motion(s, in mpeg1_encode_mb_internal()
994 s->mv[1][i][0] - s->last_mv[1][i][0], in mpeg1_encode_mb_internal()
995 s->b_code); in mpeg1_encode_mb_internal()
996 mpeg1_encode_motion(s, in mpeg1_encode_mb_internal()
997 s->mv[1][i][1] - (s->last_mv[1][i][1] >> 1), in mpeg1_encode_mb_internal()
998 s->b_code); in mpeg1_encode_mb_internal()
999 s->last_mv[1][i][0] = s->mv[1][i][0]; in mpeg1_encode_mb_internal()
1000 s->last_mv[1][i][1] = s->mv[1][i][1] * 2; in mpeg1_encode_mb_internal()
1002 s->b_count++; in mpeg1_encode_mb_internal()
1005 s->mv_bits += get_bits_diff(s); in mpeg1_encode_mb_internal()
1007 if (s->chroma_y_shift) { in mpeg1_encode_mb_internal()
1008 put_bits(&s->pb, in mpeg1_encode_mb_internal()
1012 put_bits(&s->pb, in mpeg1_encode_mb_internal()
1015 put_sbits(&s->pb, 2, cbp); in mpeg1_encode_mb_internal()
1020 if (cbp & (1 << (mb_block_count - 1 - i))) in mpeg1_encode_mb_internal()
1021 mpeg1_encode_block(s, block[i], i); in mpeg1_encode_mb_internal()
1022 s->mb_skip_run = 0; in mpeg1_encode_mb_internal()
1023 if (s->mb_intra) in mpeg1_encode_mb_internal()
1024 s->i_tex_bits += get_bits_diff(s); in mpeg1_encode_mb_internal()
1026 s->p_tex_bits += get_bits_diff(s); in mpeg1_encode_mb_internal()
1030 void ff_mpeg1_encode_mb(MpegEncContext *s, int16_t block[8][64], in ff_mpeg1_encode_mb() argument
1033 if (s->chroma_format == CHROMA_420) in ff_mpeg1_encode_mb()
1034 mpeg1_encode_mb_internal(s, block, motion_x, motion_y, 6); in ff_mpeg1_encode_mb()
1036 mpeg1_encode_mb_internal(s, block, motion_x, motion_y, 8); in ff_mpeg1_encode_mb()
1050 for (int i = -255; i < 256; i++) { in mpeg12_encode_init_static()
1057 diff--; in mpeg12_encode_init_static()
1072 for (int mv = -MAX_DMV; mv <= MAX_DMV; mv++) { in mpeg12_encode_init_static()
1080 bit_size = f_code - 1; in mpeg12_encode_init_static()
1084 val = -val; in mpeg12_encode_init_static()
1085 val--; in mpeg12_encode_init_static()
1099 for (int f_code = MAX_FCODE; f_code > 0; f_code--) in mpeg12_encode_init_static()
1100 for (int mv = -(8 << f_code); mv < (8 << f_code); mv++) in mpeg12_encode_init_static()
1104 av_cold void ff_mpeg1_encode_init(MpegEncContext *s) in ff_mpeg1_encode_init() argument
1108 ff_mpeg12_common_init(s); in ff_mpeg1_encode_init()
1110 s->me.mv_penalty = mv_penalty; in ff_mpeg1_encode_init()
1111 s->fcode_tab = fcode_tab; in ff_mpeg1_encode_init()
1112 if (s->codec_id == AV_CODEC_ID_MPEG1VIDEO) { in ff_mpeg1_encode_init()
1113 s->min_qcoeff = -255; in ff_mpeg1_encode_init()
1114 s->max_qcoeff = 255; in ff_mpeg1_encode_init()
1116 s->min_qcoeff = -2047; in ff_mpeg1_encode_init()
1117 s->max_qcoeff = 2047; in ff_mpeg1_encode_init()
1119 if (s->intra_vlc_format) { in ff_mpeg1_encode_init()
1120 s->intra_ac_vlc_length = in ff_mpeg1_encode_init()
1121 s->intra_ac_vlc_last_length = uni_mpeg2_ac_vlc_len; in ff_mpeg1_encode_init()
1123 s->intra_ac_vlc_length = in ff_mpeg1_encode_init()
1124 s->intra_ac_vlc_last_length = uni_mpeg1_ac_vlc_len; in ff_mpeg1_encode_init()
1126 s->inter_ac_vlc_length = in ff_mpeg1_encode_init()
1127 s->inter_ac_vlc_last_length = uni_mpeg1_ac_vlc_len; in ff_mpeg1_encode_init()
1141 { "timecode_frame_start", "GOP timecode frame start number, in non-drop-frame format", \
1142 OFFSET(timecode_frame_start), AV_OPT_TYPE_INT64, {.i64 = -1 }, -1, INT64_MAX, VE}, \
1152 { "intra_vlc", "Use MPEG-2 intra VLC table.",
1156 …play_extension blocks.", OFFSET(seq_disp_ext), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE, "seq_dis…
1157 { "auto", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = -1}, 0, 0, VE, "seq_disp_ext" },
1191 .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"),
1208 .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video"),