From: "Martin Storsjö" <martin@martin.st>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 1/2] libfdk-aacdec: Add an option for setting the decoder's DRC album mode
Date: Wed, 19 Jan 2022 22:38:36 +0200
Message-ID: <20220119203837.9047-1-martin@martin.st> (raw)
---
libavcodec/libfdk-aacdec.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
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;
@@ -87,6 +88,10 @@ static const AVOption fdk_aac_dec_options[] = {
#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
+#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;
--
2.32.0 (Apple Git-132)
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next reply other threads:[~2022-01-19 20:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-19 20:38 Martin Storsjö [this message]
2022-01-19 20:38 ` [FFmpeg-devel] [PATCH 2/2] libfdk-aacdec: Flush delayed samples at the end Martin Storsjö
2022-01-21 13:00 ` Andreas Rheinhardt
2022-01-21 13:58 ` Martin Storsjö
2022-01-21 14:42 ` Andreas Rheinhardt
2022-02-03 11:53 ` Martin Storsjö
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220119203837.9047-1-martin@martin.st \
--to=martin@martin.st \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git