1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-08-22 09:15:06 +02:00

mpeg12: add 'scan_offset' private option.

Deprecate CODEC_FLAG_SVCD_SCAN_OFFSET
This commit is contained in:
Anton Khirnov 2011-08-27 10:16:14 +02:00
parent 4bcee8e7f8
commit aed7900704
4 changed files with 10 additions and 2 deletions

View File

@ -613,7 +613,9 @@ typedef struct RcOverride{
#define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000 #define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000
#endif #endif
#define CODEC_FLAG_INTERLACED_ME 0x20000000 ///< interlaced motion estimation #define CODEC_FLAG_INTERLACED_ME 0x20000000 ///< interlaced motion estimation
#if FF_API_MPEGVIDEO_GLOBAL_OPTS
#define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000 ///< Will reserve space for SVCD scan offset user data. #define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000 ///< Will reserve space for SVCD scan offset user data.
#endif
#define CODEC_FLAG_CLOSED_GOP 0x80000000 #define CODEC_FLAG_CLOSED_GOP 0x80000000
#define CODEC_FLAG2_FAST 0x00000001 ///< Allow non spec compliant speedup tricks. #define CODEC_FLAG2_FAST 0x00000001 ///< Allow non spec compliant speedup tricks.
#define CODEC_FLAG2_STRICT_GOP 0x00000002 ///< Strictly enforce GOP size. #define CODEC_FLAG2_STRICT_GOP 0x00000002 ///< Strictly enforce GOP size.

View File

@ -145,6 +145,8 @@ static av_cold int encode_init(AVCodecContext *avctx)
#if FF_API_MPEGVIDEO_GLOBAL_OPTS #if FF_API_MPEGVIDEO_GLOBAL_OPTS
if (avctx->flags2 & CODEC_FLAG2_DROP_FRAME_TIMECODE) if (avctx->flags2 & CODEC_FLAG2_DROP_FRAME_TIMECODE)
s->drop_frame_timecode = 1; s->drop_frame_timecode = 1;
if (avctx->flags & CODEC_FLAG_SVCD_SCAN_OFFSET)
s->scan_offset = 1;
#endif #endif
if(find_frame_rate_index(s) < 0){ if(find_frame_rate_index(s) < 0){
@ -420,7 +422,7 @@ void mpeg1_encode_picture_header(MpegEncContext *s, int picture_number)
put_bits(&s->pb, 1, s->progressive_frame); put_bits(&s->pb, 1, s->progressive_frame);
put_bits(&s->pb, 1, 0); //composite_display_flag put_bits(&s->pb, 1, 0); //composite_display_flag
} }
if(s->flags & CODEC_FLAG_SVCD_SCAN_OFFSET){ if (s->scan_offset) {
int i; int i;
put_header(s, USER_START_CODE); put_header(s, USER_START_CODE);
@ -936,7 +938,8 @@ static void mpeg1_encode_block(MpegEncContext *s,
#define VE AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM #define VE AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM
#define COMMON_OPTS\ #define COMMON_OPTS\
{ "intra_vlc", "Use MPEG-2 intra VLC table.", OFFSET(intra_vlc_format), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE },\ { "intra_vlc", "Use MPEG-2 intra VLC table.", OFFSET(intra_vlc_format), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE },\
{ "drop_frame_timecode", "Timecode is in drop frame format.", OFFSET(drop_frame_timecode), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE}, { "drop_frame_timecode", "Timecode is in drop frame format.", OFFSET(drop_frame_timecode), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE}, \
{ "scan_offset", "Reserve space for SVCD scan offset user data.", OFFSET(scan_offset), FF_OPT_TYPE_INT, { 0 }, 0, 1, VE },
static const AVOption mpeg1_options[] = { static const AVOption mpeg1_options[] = {
COMMON_OPTS COMMON_OPTS

View File

@ -645,6 +645,7 @@ typedef struct MpegEncContext {
int first_slice; int first_slice;
int first_field; ///< is 1 for the first field of a field picture 0 otherwise int first_field; ///< is 1 for the first field of a field picture 0 otherwise
int drop_frame_timecode; ///< timecode is in drop frame format. int drop_frame_timecode; ///< timecode is in drop frame format.
int scan_offset; ///< reserve space for SVCD scan offset user data.
/* RTP specific */ /* RTP specific */
int rtp_mode; int rtp_mode;

View File

@ -115,7 +115,9 @@ static const AVOption options[]={
{"slice", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_H263P_SLICE_STRUCT }, INT_MIN, INT_MAX, V|E, "flags"}, {"slice", NULL, 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_H263P_SLICE_STRUCT }, INT_MIN, INT_MAX, V|E, "flags"},
#endif #endif
{"ilme", "interlaced motion estimation", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_INTERLACED_ME }, INT_MIN, INT_MAX, V|E, "flags"}, {"ilme", "interlaced motion estimation", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_INTERLACED_ME }, INT_MIN, INT_MAX, V|E, "flags"},
#if FF_API_MPEGVIDEO_GLOBAL_OPTS
{"scan_offset", "will reserve space for svcd scan offset user data", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_SVCD_SCAN_OFFSET }, INT_MIN, INT_MAX, V|E, "flags"}, {"scan_offset", "will reserve space for svcd scan offset user data", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_SVCD_SCAN_OFFSET }, INT_MIN, INT_MAX, V|E, "flags"},
#endif
{"cgop", "closed gop", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_CLOSED_GOP }, INT_MIN, INT_MAX, V|E, "flags"}, {"cgop", "closed gop", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_CLOSED_GOP }, INT_MIN, INT_MAX, V|E, "flags"},
{"fast", "allow non spec compliant speedup tricks", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_FAST }, INT_MIN, INT_MAX, V|E, "flags2"}, {"fast", "allow non spec compliant speedup tricks", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_FAST }, INT_MIN, INT_MAX, V|E, "flags2"},
{"sgop", "strictly enforce gop size", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_STRICT_GOP }, INT_MIN, INT_MAX, V|E, "flags2"}, {"sgop", "strictly enforce gop size", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_STRICT_GOP }, INT_MIN, INT_MAX, V|E, "flags2"},