[FFmpeg-devel] [PATCH 2/8] avcodec/aacenc: use AV_OPT_TYPE_BOOL

Rostislav Pehlivanov atomnuker at gmail.com
Mon Sep 7 14:27:28 CEST 2015


LGTM

The -1 to specify auto would be very useful and would allow to have far
less mess when having profiles change coding tools.

On 6 September 2015 at 18:43, Clément Bœsch <u at pkh.me> wrote:

> ---
>  libavcodec/aacenc.c | 16 ++++------------
>  1 file changed, 4 insertions(+), 12 deletions(-)
>
> diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
> index 2b2d039..bb90048 100644
> --- a/libavcodec/aacenc.c
> +++ b/libavcodec/aacenc.c
> @@ -885,18 +885,10 @@ static const AVOption aacenc_options[] = {
>          {"anmr",     "ANMR method",               0, AV_OPT_TYPE_CONST,
> {.i64 = AAC_CODER_ANMR},    INT_MIN, INT_MAX, AACENC_FLAGS, "aac_coder"},
>          {"twoloop",  "Two loop searching method", 0, AV_OPT_TYPE_CONST,
> {.i64 = AAC_CODER_TWOLOOP}, INT_MIN, INT_MAX, AACENC_FLAGS, "aac_coder"},
>          {"fast",     "Constant quantizer",        0, AV_OPT_TYPE_CONST,
> {.i64 = AAC_CODER_FAST},    INT_MIN, INT_MAX, AACENC_FLAGS, "aac_coder"},
> -    {"aac_pns", "Perceptual Noise Substitution", offsetof(AACEncContext,
> options.pns), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, AACENC_FLAGS, "aac_pns"},
> -        {"disable",  "Disable perceptual noise substitution", 0,
> AV_OPT_TYPE_CONST, {.i64 =  0 }, INT_MIN, INT_MAX, AACENC_FLAGS, "aac_pns"},
> -        {"enable",   "Enable perceptual noise substitution",  0,
> AV_OPT_TYPE_CONST, {.i64 =  1 }, INT_MIN, INT_MAX, AACENC_FLAGS, "aac_pns"},
> -    {"aac_is", "Intensity stereo coding", offsetof(AACEncContext,
> options.intensity_stereo), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, AACENC_FLAGS,
> "intensity_stereo"},
> -        {"disable",  "Disable intensity stereo coding", 0,
> AV_OPT_TYPE_CONST, {.i64 = 0}, INT_MIN, INT_MAX, AACENC_FLAGS,
> "intensity_stereo"},
> -        {"enable",   "Enable intensity stereo coding", 0,
> AV_OPT_TYPE_CONST, {.i64 = 1}, INT_MIN, INT_MAX, AACENC_FLAGS,
> "intensity_stereo"},
> -    {"aac_tns", "Temporal noise shaping", offsetof(AACEncContext,
> options.tns), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, AACENC_FLAGS, "aac_tns"},
> -        {"disable",  "Disable temporal noise shaping", 0,
> AV_OPT_TYPE_CONST, {.i64 = 0}, INT_MIN, INT_MAX, AACENC_FLAGS, "aac_tns"},
> -        {"enable",   "Enable temporal noise shaping", 0,
> AV_OPT_TYPE_CONST, {.i64 = 1}, INT_MIN, INT_MAX, AACENC_FLAGS, "aac_tns"},
> -    {"aac_pred", "AAC-Main prediction", offsetof(AACEncContext,
> options.pred), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, AACENC_FLAGS, "aac_pred"},
> -        {"disable",  "Disable AAC-Main prediction", 0, AV_OPT_TYPE_CONST,
> {.i64 = 0}, INT_MIN, INT_MAX, AACENC_FLAGS, "aac_pred"},
> -        {"enable",   "Enable AAC-Main prediction", 0, AV_OPT_TYPE_CONST,
> {.i64 = 1}, INT_MIN, INT_MAX, AACENC_FLAGS, "aac_pred"},
> +    {"aac_pns", "Perceptual Noise Substitution", offsetof(AACEncContext,
> options.pns), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AACENC_FLAGS},
> +    {"aac_is", "Intensity stereo coding", offsetof(AACEncContext,
> options.intensity_stereo), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1,
> AACENC_FLAGS},
> +    {"aac_tns", "Temporal noise shaping", offsetof(AACEncContext,
> options.tns), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AACENC_FLAGS},
> +    {"aac_pred", "AAC-Main prediction", offsetof(AACEncContext,
> options.pred), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AACENC_FLAGS},
>      {NULL}
>  };
>
> --
> 2.5.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


More information about the ffmpeg-devel mailing list