summaryrefslogtreecommitdiff
path: root/libavcodec/libfdk-aacdec.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2021-08-05 14:46:23 +0300
committerMartin Storsjö <martin@martin.st>2022-02-03 23:51:47 +0200
commit340a78afebad4bec205bbc83e077be9352887502 (patch)
treeae52b61ad248f0eb55ea3cfeebbb8bcd8b0f97fb /libavcodec/libfdk-aacdec.c
parente1a14479a81f5366b95df543992a7fe637cf2dde (diff)
downloadffmpeg-340a78afebad4bec205bbc83e077be9352887502.tar.gz
libfdk-aacdec: Add an option for setting the decoder's DRC album mode
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 ffa1fdcce3..93b52023b0 100644
--- a/libavcodec/libfdk-aacdec.c
+++ b/libavcodec/libfdk-aacdec.c
@@ -56,6 +56,7 @@ typedef struct FDKAACDecContext {
int drc_heavy;
int drc_effect;
int drc_cut;
+ int album_mode;
int level_limit;
int output_delay;
} FDKAACDecContext;
@@ -88,6 +89,10 @@ static const AVOption fdk_aac_dec_options[] = {
{ "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
+#if FDKDEC_VER_AT_LEAST(3, 1) // 3.1.0
+ { "album_mode","Dynamic Range Control: album mode, where [0] is off and [1] is on",
+ OFFSET(album_mode), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 1, AD, NULL },
+#endif
{ NULL }
};
@@ -335,6 +340,15 @@ static av_cold int fdk_aac_decode_init(AVCodecContext *avctx)
}
#endif
+#if FDKDEC_VER_AT_LEAST(3, 1) // 3.1.0
+ if (s->album_mode != -1) {
+ if (aacDecoder_SetParam(s->handle, AAC_UNIDRC_ALBUM_MODE, s->album_mode) != AAC_DEC_OK) {
+ av_log(avctx, AV_LOG_ERROR, "Unable to set album mode in the decoder\n");
+ return AVERROR_UNKNOWN;
+ }
+ }
+#endif
+
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
s->decoder_buffer_size = DECODER_BUFFSIZE * DECODER_MAX_CHANNELS;