summaryrefslogtreecommitdiff
path: root/libavcodec/libfdk-aacdec.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2018-09-04 11:36:37 +0300
committerMartin Storsjö <martin@martin.st>2018-09-05 22:40:50 +0300
commit2edaafe5b93832715781851dfe2663da228a05ad (patch)
treef44cdba0ae4791a8de05d411560f81f4b8c56536 /libavcodec/libfdk-aacdec.c
parentffb9b7a6bab6c6bfd3dd9a7c32e3724209824999 (diff)
libfdk-aacdec: Allow setting the new dynamic range control effect setting
This is a new setting in FDK v2. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/libfdk-aacdec.c')
-rw-r--r--libavcodec/libfdk-aacdec.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavcodec/libfdk-aacdec.c b/libavcodec/libfdk-aacdec.c
index c3d3b70fc9..ca70a49ad4 100644
--- a/libavcodec/libfdk-aacdec.c
+++ b/libavcodec/libfdk-aacdec.c
@@ -51,6 +51,7 @@ typedef struct FDKAACDecContext {
int drc_level;
int drc_boost;
int drc_heavy;
+ int drc_effect;
int drc_cut;
int level_limit;
} FDKAACDecContext;
@@ -78,6 +79,10 @@ static const AVOption fdk_aac_dec_options[] = {
#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10
{ "level_limit", "Signal level limiting", OFFSET(level_limit), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, 1, AD },
#endif
+#if FDKDEC_VER_AT_LEAST(3, 0) // 3.0.0
+ { "drc_effect","Dynamic Range Control: effect type, where e.g. [0] is none and [6] is general",
+ OFFSET(drc_effect), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 8, AD, NULL },
+#endif
{ NULL }
};
@@ -306,6 +311,15 @@ static av_cold int fdk_aac_decode_init(AVCodecContext *avctx)
}
#endif
+#if FDKDEC_VER_AT_LEAST(3, 0) // 3.0.0
+ if (s->drc_effect != -1) {
+ if (aacDecoder_SetParam(s->handle, AAC_UNIDRC_SET_EFFECT, s->drc_effect) != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to set DRC effect type in the decoder\n");
+ return AVERROR_UNKNOWN;
+ }
+ }
+#endif
+
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
s->decoder_buffer_size = DECODER_BUFFSIZE * DECODER_MAX_CHANNELS;