summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2020-02-04 16:23:27 +0200
committerMartin Storsjö <martin@martin.st>2020-02-11 11:40:13 +0200
commite8cbdb9adbe5fff49f9fca8879ad8660801c007e (patch)
tree9508f6ae535f0e06b731b8d09bf8298e60fce9ab /libavcodec
parent5835adee248ff80e0c743fe454261ffa85f459a6 (diff)
libfdk-aacdec: Allow explicitly disabling the DRC reference level option
Previously, it was always left in the automatic mode, if the option was set to the only special (negative) value. Now there's two separate special values for this option, -1 for automatic (metadata based) and -2 for explicitly disabled. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/libfdk-aacdec.c10
-rw-r--r--libavcodec/version.h2
2 files changed, 9 insertions, 3 deletions
diff --git a/libavcodec/libfdk-aacdec.c b/libavcodec/libfdk-aacdec.c
index ec7f236ce7..1a86dffe4b 100644
--- a/libavcodec/libfdk-aacdec.c
+++ b/libavcodec/libfdk-aacdec.c
@@ -76,8 +76,8 @@ static const AVOption fdk_aac_dec_options[] = {
OFFSET(drc_boost), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 127, AD, NULL },
{ "drc_cut", "Dynamic Range Control: attenuation factor, where [0] is none and [127] is max compression",
OFFSET(drc_cut), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 127, AD, NULL },
- { "drc_level", "Dynamic Range Control: reference level, quantized to 0.25dB steps where [0] is 0dB and [127] is -31.75dB",
- OFFSET(drc_level), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 127, AD, NULL },
+ { "drc_level", "Dynamic Range Control: reference level, quantized to 0.25dB steps where [0] is 0dB and [127] is -31.75dB, -1 for auto, and -2 for disabled",
+ OFFSET(drc_level), AV_OPT_TYPE_INT, { .i64 = -1}, -2, 127, AD, NULL },
{ "drc_heavy", "Dynamic Range Control: heavy compression, where [1] is on (RF mode) and [0] is off",
OFFSET(drc_heavy), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 1, AD, NULL },
#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10
@@ -299,6 +299,12 @@ static av_cold int fdk_aac_decode_init(AVCodecContext *avctx)
}
if (s->drc_level != -1) {
+ // This option defaults to -1, i.e. not calling
+ // aacDecoder_SetParam(AAC_DRC_REFERENCE_LEVEL) at all, which defaults
+ // to the level from DRC metadata, if available. The user can set
+ // -drc_level -2, which calls aacDecoder_SetParam(
+ // AAC_DRC_REFERENCE_LEVEL) with a negative value, which then
+ // explicitly disables the feature.
if (aacDecoder_SetParam(s->handle, AAC_DRC_REFERENCE_LEVEL, s->drc_level) != AAC_DEC_OK) {
av_log(avctx, AV_LOG_ERROR, "Unable to set DRC reference level in the decoder\n");
return AVERROR_UNKNOWN;
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 4511556f41..bc6630ea42 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
#define LIBAVCODEC_VERSION_MAJOR 58
#define LIBAVCODEC_VERSION_MINOR 68
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \