[FFmpeg-cvslog] lavc: remove disabled FF_API_MPEGVIDEO_GLOBAL_OPTS cruft.

Anton Khirnov git at videolan.org
Sat Jan 28 08:04:58 CET 2012


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sun Jan 22 10:56:42 2012 +0100| [9ce2a91b842bdb99fae0f153c5317d786a3f38d8] | committer: Anton Khirnov

lavc: remove disabled FF_API_MPEGVIDEO_GLOBAL_OPTS cruft.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9ce2a91b842bdb99fae0f153c5317d786a3f38d8
---

 libavcodec/avcodec.h       |   12 --------
 libavcodec/mpeg12enc.c     |    7 -----
 libavcodec/mpegvideo_enc.c |   62 +------------------------------------------
 libavcodec/options.c       |   26 ------------------
 libavcodec/version.h       |    3 --
 5 files changed, 2 insertions(+), 108 deletions(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 3e38d3a..08a79f9 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -667,18 +667,6 @@ typedef struct RcOverride{
  * Use corresponding private codec options instead.
  * @{
  */
-#if FF_API_MPEGVIDEO_GLOBAL_OPTS
-#define CODEC_FLAG_OBMC           0x00000001 ///< OBMC
-#define CODEC_FLAG_H263P_AIV      0x00000008 ///< H.263 alternative inter VLC
-#define CODEC_FLAG_PART   0x0080  ///< Use data partitioning.
-#define CODEC_FLAG_ALT_SCAN       0x00100000 ///< Use alternate scan.
-#define CODEC_FLAG_H263P_UMV      0x02000000 ///< unlimited motion vector
-#define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000
-#define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000 ///< Will reserve space for SVCD scan offset user data.
-#define CODEC_FLAG2_INTRA_VLC     0x00000800 ///< Use MPEG-2 intra VLC table.
-#define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format.
-#define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000 ///< Use MPEG-2 nonlinear quantizer.
-#endif
 #if FF_API_MJPEG_GLOBAL_OPTS
 #define CODEC_FLAG_EXTERN_HUFF     0x1000   ///< Use external Huffman table (for MJPEG).
 #endif
diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c
index 17097db..81d366d 100644
--- a/libavcodec/mpeg12enc.c
+++ b/libavcodec/mpeg12enc.c
@@ -134,13 +134,6 @@ static av_cold int encode_init(AVCodecContext *avctx)
     if(MPV_encode_init(avctx) < 0)
         return -1;
 
-#if FF_API_MPEGVIDEO_GLOBAL_OPTS
-    if (avctx->flags2 & CODEC_FLAG2_DROP_FRAME_TIMECODE)
-        s->drop_frame_timecode = 1;
-    if (avctx->flags & CODEC_FLAG_SVCD_SCAN_OFFSET)
-        s->scan_offset = 1;
-#endif
-
     if(find_frame_rate_index(s) < 0){
         if(s->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL){
             av_log(avctx, AV_LOG_ERROR, "MPEG1/2 does not support %d/%d fps\n", avctx->time_base.den, avctx->time_base.num);
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 08484a7..2e0e982 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -351,10 +351,6 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
     s->luma_elim_threshold   = avctx->luma_elim_threshold;
     s->chroma_elim_threshold = avctx->chroma_elim_threshold;
     s->strict_std_compliance = avctx->strict_std_compliance;
-#if FF_API_MPEGVIDEO_GLOBAL_OPTS
-    if (avctx->flags & CODEC_FLAG_PART)
-        s->data_partitioning = 1;
-#endif
     s->quarter_sample     = (avctx->flags & CODEC_FLAG_QPEL) != 0;
     s->mpeg_quant         = avctx->mpeg_quant;
     s->rtp_mode           = !!avctx->rtp_payload_size;
@@ -383,12 +379,6 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
                         !s->fixed_qscale;
 
     s->loop_filter      = !!(s->flags & CODEC_FLAG_LOOP_FILTER);
-#if FF_API_MPEGVIDEO_GLOBAL_OPTS
-    s->alternate_scan   = !!(s->flags  & CODEC_FLAG_ALT_SCAN);
-    s->intra_vlc_format = !!(s->flags2 & CODEC_FLAG2_INTRA_VLC);
-    s->q_scale_type     = !!(s->flags2 & CODEC_FLAG2_NON_LINEAR_QUANT);
-    s->obmc             = !!(s->flags  & CODEC_FLAG_OBMC);
-#endif
 
     if (avctx->rc_max_rate && !avctx->rc_buffer_size) {
         av_log(avctx, AV_LOG_ERROR,
@@ -458,27 +448,11 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
         return -1;
     }
 
-#if FF_API_MPEGVIDEO_GLOBAL_OPTS
-    if (s->obmc && s->codec_id != CODEC_ID_H263 &&
-        s->codec_id != CODEC_ID_H263P) {
-        av_log(avctx, AV_LOG_ERROR, "OBMC is only supported with H263(+)\n");
-        return -1;
-    }
-#endif
-
     if (s->quarter_sample && s->codec_id != CODEC_ID_MPEG4) {
         av_log(avctx, AV_LOG_ERROR, "qpel not supported by codec\n");
         return -1;
     }
 
-#if FF_API_MPEGVIDEO_GLOBAL_OPTS
-    if (s->data_partitioning && s->codec_id != CODEC_ID_MPEG4) {
-        av_log(avctx, AV_LOG_ERROR,
-               "data partitioning not supported by codec\n");
-        return -1;
-    }
-#endif
-
     if (s->max_b_frames                    &&
         s->codec_id != CODEC_ID_MPEG4      &&
         s->codec_id != CODEC_ID_MPEG1VIDEO &&
@@ -498,11 +472,7 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
         return -1;
     }
 
-    if ((s->flags & (CODEC_FLAG_INTERLACED_DCT | CODEC_FLAG_INTERLACED_ME
-#if FF_API_MPEGVIDEO_GLOBAL_OPTS
-                    | CODEC_FLAG_ALT_SCAN
-#endif
-        )) &&
+    if ((s->flags & (CODEC_FLAG_INTERLACED_DCT | CODEC_FLAG_INTERLACED_ME)) &&
         s->codec_id != CODEC_ID_MPEG4 && s->codec_id != CODEC_ID_MPEG2VIDEO) {
         av_log(avctx, AV_LOG_ERROR, "interlacing not supported by codec\n");
         return -1;
@@ -534,15 +504,6 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
         return -1;
     }
 
-#if FF_API_MPEGVIDEO_GLOBAL_OPTS
-    if ((s->flags2 & CODEC_FLAG2_INTRA_VLC) &&
-        s->codec_id != CODEC_ID_MPEG2VIDEO) {
-        av_log(avctx, AV_LOG_ERROR,
-               "intra vlc table not supported by codec\n");
-        return -1;
-    }
-#endif
-
     if (s->flags & CODEC_FLAG_LOW_DELAY) {
         if (s->codec_id != CODEC_ID_MPEG2VIDEO) {
             av_log(avctx, AV_LOG_ERROR,
@@ -557,13 +518,6 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
     }
 
     if (s->q_scale_type == 1) {
-#if FF_API_MPEGVIDEO_GLOBAL_OPTS
-        if (s->codec_id != CODEC_ID_MPEG2VIDEO) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "non linear quant is only available for mpeg2\n");
-            return -1;
-        }
-#endif
         if (avctx->qmax > 12) {
             av_log(avctx, AV_LOG_ERROR,
                    "non linear quant only supports qmax <= 12 currently\n");
@@ -575,11 +529,7 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
         s->codec_id != CODEC_ID_MPEG4      &&
         s->codec_id != CODEC_ID_MPEG1VIDEO &&
         s->codec_id != CODEC_ID_MPEG2VIDEO &&
-        (s->codec_id != CODEC_ID_H263P
-#if FF_API_MPEGVIDEO_GLOBAL_OPTS
-         || !(s->flags & CODEC_FLAG_H263P_SLICE_STRUCT)
-#endif
-         )) {
+        (s->codec_id != CODEC_ID_H263P)) {
         av_log(avctx, AV_LOG_ERROR,
                "multi threaded encoding not supported by codec\n");
         return -1;
@@ -725,14 +675,6 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
         s->out_format = FMT_H263;
         s->h263_plus  = 1;
         /* Fx */
-#if FF_API_MPEGVIDEO_GLOBAL_OPTS
-        if (avctx->flags & CODEC_FLAG_H263P_UMV)
-            s->umvplus = 1;
-        if (avctx->flags & CODEC_FLAG_H263P_AIV)
-            s->alt_inter_vlc = 1;
-        if (avctx->flags & CODEC_FLAG_H263P_SLICE_STRUCT)
-            s->h263_slice_structured = 1;
-#endif
         s->h263_aic        = (avctx->flags & CODEC_FLAG_AC_PRED) ? 1 : 0;
         s->modified_quant  = s->h263_aic;
         s->loop_filter     = (avctx->flags & CODEC_FLAG_LOOP_FILTER) ? 1 : 0;
diff --git a/libavcodec/options.c b/libavcodec/options.c
index 201eb9b..fe15fc3 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -79,17 +79,11 @@ static const AVOption options[]={
 {"bt", "set video bitrate tolerance (in bits/s)", OFFSET(bit_rate_tolerance), AV_OPT_TYPE_INT, {.dbl = AV_CODEC_DEFAULT_BITRATE*20 }, 1, INT_MAX, V|E},
 {"flags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.dbl = DEFAULT }, 0, UINT_MAX, V|A|E|D, "flags"},
 {"mv4", "use four motion vector by macroblock (mpeg4)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_4MV }, INT_MIN, INT_MAX, V|E, "flags"},
-#if FF_API_MPEGVIDEO_GLOBAL_OPTS
-{"obmc", "use overlapped block motion compensation (h263+)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_OBMC }, INT_MIN, INT_MAX, V|E, "flags"},
-#endif
 {"qpel", "use 1/4 pel motion compensation", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_QPEL }, INT_MIN, INT_MAX, V|E, "flags"},
 {"loop", "use loop filter", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_LOOP_FILTER }, INT_MIN, INT_MAX, V|E, "flags"},
 {"qscale", "use fixed qscale", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_QSCALE }, INT_MIN, INT_MAX, 0, "flags"},
 {"gmc", "use gmc", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_GMC }, INT_MIN, INT_MAX, V|E, "flags"},
 {"mv0", "always try a mb with mv=<0,0>", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_MV0 }, INT_MIN, INT_MAX, V|E, "flags"},
-#if FF_API_MPEGVIDEO_GLOBAL_OPTS
-{"part", "use data partitioning", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_PART }, INT_MIN, INT_MAX, V|E, "flags"},
-#endif
 {"input_preserved", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_INPUT_PRESERVED }, INT_MIN, INT_MAX, 0, "flags"},
 {"pass1", "use internal 2pass ratecontrol in first  pass mode", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_PASS1 }, INT_MIN, INT_MAX, 0, "flags"},
 {"pass2", "use internal 2pass ratecontrol in second pass mode", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_PASS2 }, INT_MIN, INT_MAX, 0, "flags"},
@@ -103,25 +97,12 @@ static const AVOption options[]={
 {"naq", "normalize adaptive quantization", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_NORMALIZE_AQP }, INT_MIN, INT_MAX, V|E, "flags"},
 {"ildct", "use interlaced dct", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_INTERLACED_DCT }, INT_MIN, INT_MAX, V|E, "flags"},
 {"low_delay", "force low delay", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_LOW_DELAY }, INT_MIN, INT_MAX, V|D|E, "flags"},
-#if FF_API_MPEGVIDEO_GLOBAL_OPTS
-{"alt", "enable alternate scantable (mpeg2/mpeg4)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_ALT_SCAN }, INT_MIN, INT_MAX, V|E, "flags"},
-#endif
 {"global_header", "place global headers in extradata instead of every keyframe", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_GLOBAL_HEADER }, INT_MIN, INT_MAX, V|A|E, "flags"},
 {"bitexact", "use only bitexact stuff (except (i)dct)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_BITEXACT }, INT_MIN, INT_MAX, A|V|S|D|E, "flags"},
 {"aic", "h263 advanced intra coding / mpeg4 ac prediction", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_AC_PRED }, INT_MIN, INT_MAX, V|E, "flags"},
-#if FF_API_MPEGVIDEO_GLOBAL_OPTS
-{"umv", "use unlimited motion vectors", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_H263P_UMV }, INT_MIN, INT_MAX, V|E, "flags"},
-#endif
 {"cbp", "use rate distortion optimization for cbp", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_CBP_RD }, INT_MIN, INT_MAX, V|E, "flags"},
 {"qprd", "use rate distortion optimization for qp selection", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_QP_RD }, INT_MIN, INT_MAX, V|E, "flags"},
-#if FF_API_MPEGVIDEO_GLOBAL_OPTS
-{"aiv", "h263 alternative inter vlc", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_H263P_AIV }, INT_MIN, INT_MAX, V|E, "flags"},
-{"slice", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_H263P_SLICE_STRUCT }, INT_MIN, INT_MAX, V|E, "flags"},
-#endif
 {"ilme", "interlaced motion estimation", 0, AV_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, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_SVCD_SCAN_OFFSET }, INT_MIN, INT_MAX, V|E, "flags"},
-#endif
 {"cgop", "closed gop", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_CLOSED_GOP }, INT_MIN, INT_MAX, V|E, "flags"},
 {"fast", "allow non spec compliant speedup tricks", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_FAST }, INT_MIN, INT_MAX, V|E, "flags2"},
 {"sgop", "strictly enforce gop size", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_STRICT_GOP }, INT_MIN, INT_MAX, V|E, "flags2"},
@@ -411,9 +392,6 @@ static const AVOption options[]={
 {"skiprd", "RD optimal MB level residual skipping", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_SKIP_RD }, INT_MIN, INT_MAX, V|E, "flags2"},
 {"sc_factor", "multiplied by qscale for each frame and added to scene_change_score", OFFSET(scenechange_factor), AV_OPT_TYPE_INT, {.dbl = 6 }, 0, INT_MAX, V|E},
 {"mv0_threshold", NULL, OFFSET(mv0_threshold), AV_OPT_TYPE_INT, {.dbl = 256 }, 0, INT_MAX, V|E},
-#if FF_API_MPEGVIDEO_GLOBAL_OPTS
-{"ivlc", "intra vlc table", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_INTRA_VLC }, INT_MIN, INT_MAX, V|E, "flags2"},
-#endif
 {"b_sensitivity", "adjusts sensitivity of b_frame_strategy 1", OFFSET(b_sensitivity), AV_OPT_TYPE_INT, {.dbl = 40 }, 1, INT_MAX, V|E},
 {"compression_level", NULL, OFFSET(compression_level), AV_OPT_TYPE_INT, {.dbl = FF_COMPRESSION_DEFAULT }, INT_MIN, INT_MAX, V|A|E},
 {"min_prediction_order", NULL, OFFSET(min_prediction_order), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E},
@@ -425,10 +403,6 @@ static const AVOption options[]={
 {"max_partition_order", "deprecated, use flac-specific options", OFFSET(max_partition_order), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E},
 #endif
 {"timecode_frame_start", "GOP timecode frame start number, in non drop frame format", OFFSET(timecode_frame_start), AV_OPT_TYPE_INT64, {.dbl = 0 }, 0, INT64_MAX, V|E},
-#if FF_API_MPEGVIDEO_GLOBAL_OPTS
-{"drop_frame_timecode", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_DROP_FRAME_TIMECODE }, INT_MIN, INT_MAX, V|E, "flags2"},
-{"non_linear_q", "use non linear quantizer", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_NON_LINEAR_QUANT }, INT_MIN, INT_MAX, V|E, "flags2"},
-#endif
 #if FF_API_REQUEST_CHANNELS
 {"request_channels", "set desired number of audio channels", OFFSET(request_channels), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, A|D},
 #endif
diff --git a/libavcodec/version.h b/libavcodec/version.h
index e750c5d..570c415 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -80,9 +80,6 @@
 #ifndef FF_API_AVCODEC_INIT
 #define FF_API_AVCODEC_INIT     (LIBAVCODEC_VERSION_MAJOR < 54)
 #endif
-#ifndef FF_API_MPEGVIDEO_GLOBAL_OPTS
-#define FF_API_MPEGVIDEO_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54)
-#endif
 #ifndef FF_API_LAME_GLOBAL_OPTS
 #define FF_API_LAME_GLOBAL_OPTS  (LIBAVCODEC_VERSION_MAJOR < 54)
 #endif



More information about the ffmpeg-cvslog mailing list