From 0dc6bab092f207f237b166a543cd9ea118825272 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH] lavc: remove disabled FF_API_FLAC_GLOBAL_OPTS cruft. --- libavcodec/avcodec.h | 67 --------------------------------------------------- libavcodec/flacenc.c | 68 ---------------------------------------------------- libavcodec/options.c | 14 ----------- libavcodec/version.h | 3 --- 4 files changed, 152 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 1cbc56d..d6a40fa 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -525,20 +525,6 @@ enum AVChromaLocation{ AVCHROMA_LOC_NB , ///< Not part of ABI }; -#if FF_API_FLAC_GLOBAL_OPTS -/** - * LPC analysis type - */ -enum AVLPCType { - AV_LPC_TYPE_DEFAULT = -1, ///< use the codec default LPC type - AV_LPC_TYPE_NONE = 0, ///< do not use LPC prediction or use all zero coefficients - AV_LPC_TYPE_FIXED = 1, ///< fixed LPC coefficients - AV_LPC_TYPE_LEVINSON = 2, ///< Levinson-Durbin recursion - AV_LPC_TYPE_CHOLESKY = 3, ///< Cholesky factorization - AV_LPC_TYPE_NB , ///< Not part of ABI -}; -#endif - enum AVAudioServiceType { AV_AUDIO_SERVICE_TYPE_MAIN = 0, AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, @@ -2594,43 +2580,6 @@ typedef struct AVCodecContext { */ int max_prediction_order; -#if FF_API_FLAC_GLOBAL_OPTS - /** - * @name FLAC options - * @deprecated Use FLAC encoder private options instead. - * @{ - */ - - /** - * LPC coefficient precision - used by FLAC encoder - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int lpc_coeff_precision; - - /** - * search method for selecting prediction order - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int prediction_order_method; - - /** - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int min_partition_order; - - /** - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int max_partition_order; - /** - * @} - */ -#endif - /** * GOP timecode frame start number, in non drop frame format * - encoding: Set by user. @@ -2788,22 +2737,6 @@ typedef struct AVCodecContext { int log_level_offset; -#if FF_API_FLAC_GLOBAL_OPTS - /** - * Determine which LPC analysis algorithm to use. - * - encoding: Set by user - * - decoding: unused - */ - attribute_deprecated enum AVLPCType lpc_type; - - /** - * Number of passes to use for Cholesky factorization during LPC analysis - * - encoding: Set by user - * - decoding: unused - */ - attribute_deprecated int lpc_passes; -#endif - /** * Number of slices. * Indicates number of picture subdivisions. Used for parallelized diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index 94e381d..47fcca1 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -295,29 +295,6 @@ static av_cold int flac_encode_init(AVCodecContext *avctx) if (s->options.max_partition_order < 0) s->options.max_partition_order = ((int[]){ 2, 2, 3, 3, 3, 8, 8, 8, 8, 8, 8, 8, 8})[level]; - /* set compression option overrides from AVCodecContext */ -#if FF_API_FLAC_GLOBAL_OPTS - if (avctx->lpc_type > FF_LPC_TYPE_DEFAULT) { - if (avctx->lpc_type > FF_LPC_TYPE_CHOLESKY) { - av_log(avctx, AV_LOG_ERROR, "unknown lpc type: %d\n", avctx->lpc_type); - return -1; - } - s->options.lpc_type = avctx->lpc_type; - if (s->options.lpc_type == FF_LPC_TYPE_CHOLESKY) { - if (avctx->lpc_passes < 0) { - // default number of passes for Cholesky - s->options.lpc_passes = 2; - } else if (avctx->lpc_passes == 0) { - av_log(avctx, AV_LOG_ERROR, "invalid number of lpc passes: %d\n", - avctx->lpc_passes); - return -1; - } else { - s->options.lpc_passes = avctx->lpc_passes; - } - } - } -#endif - if (s->options.lpc_type == FF_LPC_TYPE_NONE) { s->options.min_prediction_order = 0; } else if (avctx->min_prediction_order >= 0) { @@ -358,39 +335,6 @@ static av_cold int flac_encode_init(AVCodecContext *avctx) return -1; } -#if FF_API_FLAC_GLOBAL_OPTS - if (avctx->prediction_order_method >= 0) { - if (avctx->prediction_order_method > ORDER_METHOD_LOG) { - av_log(avctx, AV_LOG_ERROR, "invalid prediction order method: %d\n", - avctx->prediction_order_method); - return -1; - } - s->options.prediction_order_method = avctx->prediction_order_method; - } - - if (avctx->min_partition_order >= 0) { - if (avctx->min_partition_order > MAX_PARTITION_ORDER) { - av_log(avctx, AV_LOG_ERROR, "invalid min partition order: %d\n", - avctx->min_partition_order); - return -1; - } - s->options.min_partition_order = avctx->min_partition_order; - } - if (avctx->max_partition_order >= 0) { - if (avctx->max_partition_order > MAX_PARTITION_ORDER) { - av_log(avctx, AV_LOG_ERROR, "invalid max partition order: %d\n", - avctx->max_partition_order); - return -1; - } - s->options.max_partition_order = avctx->max_partition_order; - } - if (s->options.max_partition_order < s->options.min_partition_order) { - av_log(avctx, AV_LOG_ERROR, "invalid partition orders: min=%d max=%d\n", - s->options.min_partition_order, s->options.max_partition_order); - return -1; - } -#endif - if (avctx->frame_size > 0) { if (avctx->frame_size < FLAC_MIN_BLOCKSIZE || avctx->frame_size > FLAC_MAX_BLOCKSIZE) { @@ -403,18 +347,6 @@ static av_cold int flac_encode_init(AVCodecContext *avctx) } s->max_blocksize = s->avctx->frame_size; -#if FF_API_FLAC_GLOBAL_OPTS - /* set LPC precision */ - if (avctx->lpc_coeff_precision > 0) { - if (avctx->lpc_coeff_precision > MAX_LPC_PRECISION) { - av_log(avctx, AV_LOG_ERROR, "invalid lpc coeff precision: %d\n", - avctx->lpc_coeff_precision); - return -1; - } - s->options.lpc_coeff_precision = avctx->lpc_coeff_precision; - } -#endif - /* set maximum encoded frame size in verbatim mode */ s->max_framesize = ff_flac_get_max_frame_size(s->avctx->frame_size, s->channels, 16); diff --git a/libavcodec/options.c b/libavcodec/options.c index 33d6953..703563c 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -389,12 +389,6 @@ static const AVOption options[]={ {"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}, {"max_prediction_order", NULL, OFFSET(max_prediction_order), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E}, -#if FF_API_FLAC_GLOBAL_OPTS -{"lpc_coeff_precision", "deprecated, use flac-specific options", OFFSET(lpc_coeff_precision), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, A|E}, -{"prediction_order_method", "deprecated, use flac-specific options", OFFSET(prediction_order_method), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E}, -{"min_partition_order", "deprecated, use flac-specific options", OFFSET(min_partition_order), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E}, -{"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_REQUEST_CHANNELS {"request_channels", "set desired number of audio channels", OFFSET(request_channels), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, A|D}, @@ -417,14 +411,6 @@ static const AVOption options[]={ {"color_range", NULL, OFFSET(color_range), AV_OPT_TYPE_INT, {.dbl = AVCOL_RANGE_UNSPECIFIED }, 0, AVCOL_RANGE_NB-1, V|E|D}, {"chroma_sample_location", NULL, OFFSET(chroma_sample_location), AV_OPT_TYPE_INT, {.dbl = AVCHROMA_LOC_UNSPECIFIED }, 0, AVCHROMA_LOC_NB-1, V|E|D}, {"log_level_offset", "set the log level offset", OFFSET(log_level_offset), AV_OPT_TYPE_INT, {.dbl = 0 }, INT_MIN, INT_MAX }, -#if FF_API_FLAC_GLOBAL_OPTS -{"lpc_type", "deprecated, use flac-specific options", OFFSET(lpc_type), AV_OPT_TYPE_INT, {.dbl = AV_LPC_TYPE_DEFAULT }, AV_LPC_TYPE_DEFAULT, AV_LPC_TYPE_NB-1, A|E}, -{"none", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AV_LPC_TYPE_NONE }, INT_MIN, INT_MAX, A|E, "lpc_type"}, -{"fixed", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AV_LPC_TYPE_FIXED }, INT_MIN, INT_MAX, A|E, "lpc_type"}, -{"levinson", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AV_LPC_TYPE_LEVINSON }, INT_MIN, INT_MAX, A|E, "lpc_type"}, -{"cholesky", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AV_LPC_TYPE_CHOLESKY }, INT_MIN, INT_MAX, A|E, "lpc_type"}, -{"lpc_passes", "deprecated, use flac-specific options", OFFSET(lpc_passes), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E}, -#endif {"slices", "number of slices, used in parallelized encoding", OFFSET(slices), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, V|E}, {"thread_type", "select multithreading type", OFFSET(thread_type), AV_OPT_TYPE_FLAGS, {.dbl = FF_THREAD_SLICE|FF_THREAD_FRAME }, 0, INT_MAX, V|E|D, "thread_type"}, {"slice", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_THREAD_SLICE }, INT_MIN, INT_MAX, V|E|D, "thread_type"}, diff --git a/libavcodec/version.h b/libavcodec/version.h index ace2f35..01b25d2 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -41,9 +41,6 @@ #ifndef FF_API_REQUEST_CHANNELS #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 55) #endif -#ifndef FF_API_FLAC_GLOBAL_OPTS -#define FF_API_FLAC_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_GET_PIX_FMT_NAME #define FF_API_GET_PIX_FMT_NAME (LIBAVCODEC_VERSION_MAJOR < 54) #endif -- 2.7.4