From 3b0f586f07bc58a9d97e3fd699a9aa29f7f4beea Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 23 Feb 2013 08:20:12 +0100 Subject: [PATCH 1/3] lavc: remove disabled FF_API_MPV_GLOBAL_OPTS cruft --- libavcodec/avcodec.h | 29 ----------------------------- libavcodec/mpegvideo_enc.c | 25 ------------------------- libavcodec/options_table.h | 17 ----------------- libavcodec/version.h | 3 --- 4 files changed, 74 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index c926d5bbc7..414b35b923 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -656,12 +656,6 @@ typedef struct RcOverride{ #define CODEC_FLAG2_LOCAL_HEADER 0x00000008 ///< Place global headers at every keyframe instead of in extradata. #define CODEC_FLAG2_IGNORE_CROP 0x00010000 ///< Discard cropping information from SPS. -#if FF_API_MPV_GLOBAL_OPTS -#define CODEC_FLAG_CBP_RD 0x04000000 ///< Use rate distortion optimization for cbp. -#define CODEC_FLAG_QP_RD 0x08000000 ///< Use rate distortion optimization for qp selectioon. -#define CODEC_FLAG2_STRICT_GOP 0x00000002 ///< Strictly enforce GOP size. -#define CODEC_FLAG2_SKIP_RD 0x00004000 ///< RD optimal MB level residual skipping -#endif #define CODEC_FLAG2_CHUNKS 0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries. /* Unsupported options : @@ -1276,22 +1270,6 @@ typedef struct AVCodecContext { int b_frame_strategy; -#if FF_API_MPV_GLOBAL_OPTS - /** - * luma single coefficient elimination threshold - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int luma_elim_threshold; - - /** - * chroma single coeff elimination threshold - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int chroma_elim_threshold; -#endif - /** * qscale offset between IP and B-frames * - encoding: Set by user. @@ -1596,13 +1574,6 @@ typedef struct AVCodecContext { attribute_deprecated int inter_threshold; #endif -#if FF_API_MPV_GLOBAL_OPTS - /** - * @deprecated use mpegvideo private options instead - */ - attribute_deprecated int quantizer_noise_shaping; -#endif - /** * Motion estimation threshold below which no motion estimation is * performed, but instead the user specified motion vectors are used. diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 96e2c73b71..f671460906 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -311,12 +311,6 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) s->flags2 = avctx->flags2; s->max_b_frames = avctx->max_b_frames; s->codec_id = avctx->codec->id; -#if FF_API_MPV_GLOBAL_OPTS - if (avctx->luma_elim_threshold) - s->luma_elim_threshold = avctx->luma_elim_threshold; - if (avctx->chroma_elim_threshold) - s->chroma_elim_threshold = avctx->chroma_elim_threshold; -#endif s->strict_std_compliance = avctx->strict_std_compliance; s->quarter_sample = (avctx->flags & CODEC_FLAG_QPEL) != 0; s->mpeg_quant = avctx->mpeg_quant; @@ -336,11 +330,6 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) /* Fixed QSCALE */ s->fixed_qscale = !!(avctx->flags & CODEC_FLAG_QSCALE); -#if FF_API_MPV_GLOBAL_OPTS - if (s->flags & CODEC_FLAG_QP_RD) - s->mpv_flags |= FF_MPV_FLAG_QP_RD; -#endif - s->adaptive_quant = (s->avctx->lumi_masking || s->avctx->dark_masking || s->avctx->temporal_cplx_masking || @@ -457,11 +446,6 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) return -1; } -#if FF_API_MPV_GLOBAL_OPTS - if (s->flags & CODEC_FLAG_CBP_RD) - s->mpv_flags |= FF_MPV_FLAG_CBP_RD; -#endif - if ((s->mpv_flags & FF_MPV_FLAG_CBP_RD) && !avctx->trellis) { av_log(avctx, AV_LOG_ERROR, "CBP RD needs trellis quant\n"); return -1; @@ -578,15 +562,6 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) } s->time_increment_bits = av_log2(s->avctx->time_base.den - 1) + 1; -#if FF_API_MPV_GLOBAL_OPTS - if (avctx->flags2 & CODEC_FLAG2_SKIP_RD) - s->mpv_flags |= FF_MPV_FLAG_SKIP_RD; - if (avctx->flags2 & CODEC_FLAG2_STRICT_GOP) - s->mpv_flags |= FF_MPV_FLAG_STRICT_GOP; - if (avctx->quantizer_noise_shaping) - s->quantizer_noise_shaping = avctx->quantizer_noise_shaping; -#endif - switch (avctx->codec->id) { case AV_CODEC_ID_MPEG1VIDEO: s->out_format = FMT_MPEG1; diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h index 28ce352628..937325d479 100644 --- a/libavcodec/options_table.h +++ b/libavcodec/options_table.h @@ -65,16 +65,9 @@ static const AVOption options[]={ {"global_header", "place global headers in extradata instead of every keyframe", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_GLOBAL_HEADER }, INT_MIN, INT_MAX, V|A|E, "flags"}, {"bitexact", "use only bitexact functions (except (I)DCT)", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_BITEXACT }, INT_MIN, INT_MAX, A|V|S|D|E, "flags"}, {"aic", "H.263 advanced intra coding / MPEG-4 AC prediction", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_AC_PRED }, INT_MIN, INT_MAX, V|E, "flags"}, -#if FF_API_MPV_GLOBAL_OPTS -{"cbp", "Deprecated, use mpegvideo private options instead", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_CBP_RD }, INT_MIN, INT_MAX, V|E, "flags"}, -{"qprd", "Deprecated, use mpegvideo private options instead", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_QP_RD }, INT_MIN, INT_MAX, V|E, "flags"}, -#endif {"ilme", "interlaced motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_INTERLACED_ME }, INT_MIN, INT_MAX, V|E, "flags"}, {"cgop", "closed GOP", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_CLOSED_GOP }, INT_MIN, INT_MAX, V|E, "flags"}, {"fast", "allow non-spec-compliant speedup tricks", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_FAST }, INT_MIN, INT_MAX, V|E, "flags2"}, -#if FF_API_MPV_GLOBAL_OPTS -{"sgop", "Deprecated, use mpegvideo private options instead", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_STRICT_GOP }, INT_MIN, INT_MAX, V|E, "flags2"}, -#endif {"noout", "skip bitstream encoding", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_NO_OUTPUT }, INT_MIN, INT_MAX, V|E, "flags2"}, {"ignorecrop", "ignore cropping information from sps", 1, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_IGNORE_CROP }, INT_MIN, INT_MAX, V|D, "flags2"}, {"local_header", "place global headers at every keyframe instead of in extradata", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_LOCAL_HEADER }, INT_MIN, INT_MAX, V|E, "flags2"}, @@ -144,10 +137,6 @@ static const AVOption options[]={ {"dc_clip", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_DC_CLIP }, INT_MIN, INT_MAX, V|D, "bug"}, {"ms", "work around various bugs in Microsoft's broken decoders", 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_MS }, INT_MIN, INT_MAX, V|D, "bug"}, {"trunc", "truncated frames", 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_TRUNCATED}, INT_MIN, INT_MAX, V|D, "bug"}, -#if FF_API_MPV_GLOBAL_OPTS -{"lelim", "single coefficient elimination threshold for luminance (negative values also consider DC coefficient)", OFFSET(luma_elim_threshold), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E}, -{"celim", "single coefficient elimination threshold for chrominance (negative values also consider DC coefficient)", OFFSET(chroma_elim_threshold), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E}, -#endif {"strict", "how strictly to follow the standards", OFFSET(strict_std_compliance), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|V|D|E, "strict"}, {"very", "strictly conform to a older more strict version of the spec or reference software", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_VERY_STRICT }, INT_MIN, INT_MAX, V|D|E, "strict"}, {"strict", "strictly conform to all the things in the spec no matter what the consequences", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_STRICT }, INT_MIN, INT_MAX, V|D|E, "strict"}, @@ -302,9 +291,6 @@ static const AVOption options[]={ #endif {"flags2", NULL, OFFSET(flags2), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT}, 0, UINT_MAX, V|A|E|D, "flags2"}, {"error", NULL, OFFSET(error_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E}, -#if FF_API_MPV_GLOBAL_OPTS -{"qns", "deprecated, use mpegvideo private options instead", OFFSET(quantizer_noise_shaping), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E}, -#endif {"threads", NULL, OFFSET(thread_count), AV_OPT_TYPE_INT, {.i64 = 1 }, 0, INT_MAX, V|E|D, "threads"}, {"auto", "autodetect a suitable number of threads to use", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, INT_MIN, INT_MAX, V|E|D, "threads"}, {"me_threshold", "motion estimation threshold", OFFSET(me_threshold), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E}, @@ -353,9 +339,6 @@ static const AVOption options[]={ {"refs", "reference frames to consider for motion compensation", OFFSET(refs), AV_OPT_TYPE_INT, {.i64 = 1 }, INT_MIN, INT_MAX, V|E}, {"chromaoffset", "chroma QP offset from luma", OFFSET(chromaoffset), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"trellis", "rate-distortion optimal quantization", OFFSET(trellis), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|A|E}, -#if FF_API_MPV_GLOBAL_OPTS -{"skiprd", "Deprecated, use mpegvideo private options instead", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_SKIP_RD }, INT_MIN, INT_MAX, V|E, "flags2"}, -#endif {"sc_factor", "multiplied by qscale for each frame and added to scene_change_score", OFFSET(scenechange_factor), AV_OPT_TYPE_INT, {.i64 = 6 }, 0, INT_MAX, V|E}, {"mv0_threshold", NULL, OFFSET(mv0_threshold), AV_OPT_TYPE_INT, {.i64 = 256 }, 0, INT_MAX, V|E}, {"b_sensitivity", "adjust sensitivity of b_frame_strategy 1", OFFSET(b_sensitivity), AV_OPT_TYPE_INT, {.i64 = 40 }, 1, INT_MAX, V|E}, diff --git a/libavcodec/version.h b/libavcodec/version.h index 4f928144ee..31452f7eee 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -49,9 +49,6 @@ #ifndef FF_API_REQUEST_CHANNELS #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 56) #endif -#ifndef FF_API_MPV_GLOBAL_OPTS -#define FF_API_MPV_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 55) -#endif #ifndef FF_API_COLOR_TABLE_ID #define FF_API_COLOR_TABLE_ID (LIBAVCODEC_VERSION_MAJOR < 55) #endif From 9d6cf81f02d37d5e5ca334e2fc789abe6236eda1 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 23 Feb 2013 08:20:12 +0100 Subject: [PATCH 2/3] lavc: remove disabled FF_API_COLOR_TABLE_ID cruft --- libavcodec/avcodec.h | 10 ---------- libavcodec/options_table.h | 3 --- libavcodec/version.h | 3 --- 3 files changed, 16 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 414b35b923..2b79d0b116 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -1501,16 +1501,6 @@ typedef struct AVCodecContext { */ int inter_quant_bias; -#if FF_API_COLOR_TABLE_ID - /** - * color table ID - * - encoding: unused - * - decoding: Which clrtable should be used for 8bit RGB images. - * Tables have to be stored somewhere. FIXME - */ - attribute_deprecated int color_table_id; -#endif - /** * slice flags * - encoding: unused diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h index 937325d479..afb6edaee1 100644 --- a/libavcodec/options_table.h +++ b/libavcodec/options_table.h @@ -263,9 +263,6 @@ static const AVOption options[]={ {"me_range", "limit motion vectors range (1023 for DivX player)", OFFSET(me_range), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"ibias", "intra quant bias", OFFSET(intra_quant_bias), AV_OPT_TYPE_INT, {.i64 = FF_DEFAULT_QUANT_BIAS }, INT_MIN, INT_MAX, V|E}, {"pbias", "inter quant bias", OFFSET(inter_quant_bias), AV_OPT_TYPE_INT, {.i64 = FF_DEFAULT_QUANT_BIAS }, INT_MIN, INT_MAX, V|E}, -#if FF_API_COLOR_TABLE_ID -{"color_table_id", NULL, OFFSET(color_table_id), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX}, -#endif {"global_quality", NULL, OFFSET(global_quality), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|A|E}, {"coder", NULL, OFFSET(coder_type), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E, "coder"}, {"vlc", "variable length coder / Huffman coder", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CODER_TYPE_VLC }, INT_MIN, INT_MAX, V|E, "coder"}, diff --git a/libavcodec/version.h b/libavcodec/version.h index 31452f7eee..8423b7249d 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -49,9 +49,6 @@ #ifndef FF_API_REQUEST_CHANNELS #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 56) #endif -#ifndef FF_API_COLOR_TABLE_ID -#define FF_API_COLOR_TABLE_ID (LIBAVCODEC_VERSION_MAJOR < 55) -#endif #ifndef FF_API_INTER_THRESHOLD #define FF_API_INTER_THRESHOLD (LIBAVCODEC_VERSION_MAJOR < 55) #endif From 2a113695238e7675ab75c5fb9a5f59fc92f2ddd9 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 23 Feb 2013 08:20:12 +0100 Subject: [PATCH 3/3] lavc: remove disabled FF_API_INTER_THRESHOLD cruft --- libavcodec/avcodec.h | 7 ------- libavcodec/options_table.h | 3 --- libavcodec/version.h | 3 --- 3 files changed, 13 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 2b79d0b116..6aa7dcab83 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -1557,13 +1557,6 @@ typedef struct AVCodecContext { */ int noise_reduction; -#if FF_API_INTER_THRESHOLD - /** - * @deprecated this field is unused - */ - attribute_deprecated int inter_threshold; -#endif - /** * Motion estimation threshold below which no motion estimation is * performed, but instead the user specified motion vectors are used. diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h index afb6edaee1..7c81d5e7f1 100644 --- a/libavcodec/options_table.h +++ b/libavcodec/options_table.h @@ -283,9 +283,6 @@ static const AVOption options[]={ {"lmax", "maximum Lagrange factor (VBR)", OFFSET(lmax), AV_OPT_TYPE_INT, {.i64 = 31*FF_QP2LAMBDA }, 0, INT_MAX, V|E}, {"nr", "noise reduction", OFFSET(noise_reduction), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"rc_init_occupancy", "number of bits which should be loaded into the rc buffer before decoding starts", OFFSET(rc_initial_buffer_occupancy), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E}, -#if FF_API_INTER_THRESHOLD -{"inter_threshold", NULL, OFFSET(inter_threshold), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E}, -#endif {"flags2", NULL, OFFSET(flags2), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT}, 0, UINT_MAX, V|A|E|D, "flags2"}, {"error", NULL, OFFSET(error_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"threads", NULL, OFFSET(thread_count), AV_OPT_TYPE_INT, {.i64 = 1 }, 0, INT_MAX, V|E|D, "threads"}, diff --git a/libavcodec/version.h b/libavcodec/version.h index 8423b7249d..72a880c280 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -49,9 +49,6 @@ #ifndef FF_API_REQUEST_CHANNELS #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 56) #endif -#ifndef FF_API_INTER_THRESHOLD -#define FF_API_INTER_THRESHOLD (LIBAVCODEC_VERSION_MAJOR < 55) -#endif #ifndef FF_API_SUB_ID #define FF_API_SUB_ID (LIBAVCODEC_VERSION_MAJOR < 55) #endif