[FFmpeg-cvslog] libfdk-aacdec: Make sure decoding doesn' t add any extra delay in the latest version of fdk-aac

Martin Storsjö git at videolan.org
Thu Jan 8 17:44:15 CET 2015


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Wed Jan  7 23:49:41 2015 +0200| [2dbd35b00c6433e587d5f44d5dbc8972ebbaa88e] | committer: Martin Storsjö

libfdk-aacdec: Make sure decoding doesn't add any extra delay in the latest version of fdk-aac

The latest version added support for a new option for enabling
a signal level limiter, which adds some extra delay. In fdk-aac, this
is enabled by default, but disable it by default here since we'd rather
have zero-delay decoding.

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2dbd35b00c6433e587d5f44d5dbc8972ebbaa88e
---

 libavcodec/libfdk-aacdec.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/libavcodec/libfdk-aacdec.c b/libavcodec/libfdk-aacdec.c
index deef56a..f789b75 100644
--- a/libavcodec/libfdk-aacdec.c
+++ b/libavcodec/libfdk-aacdec.c
@@ -49,6 +49,7 @@ typedef struct FDKAACDecContext {
     int drc_boost;
     int drc_heavy;
     int drc_cut;
+    int level_limit;
 } FDKAACDecContext;
 
 
@@ -71,6 +72,9 @@ static const AVOption fdk_aac_dec_options[] = {
                      OFFSET(drc_level),      AV_OPT_TYPE_INT,   { .i64 = -1},  -1, 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    },
+#ifdef AACDECODER_LIB_VL0
+    { "level_limit", "Signal level limiting", OFFSET(level_limit), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, 1, AD },
+#endif
     { NULL }
 };
 
@@ -292,6 +296,13 @@ static av_cold int fdk_aac_decode_init(AVCodecContext *avctx)
         }
     }
 
+#ifdef AACDECODER_LIB_VL0
+    if (aacDecoder_SetParam(s->handle, AAC_PCM_LIMITER_ENABLE, s->level_limit) != AAC_DEC_OK) {
+        av_log(avctx, AV_LOG_ERROR, "Unable to set in signal level limiting in the decoder\n");
+        return AVERROR_UNKNOWN;
+    }
+#endif
+
     avctx->sample_fmt = AV_SAMPLE_FMT_S16;
 
     return 0;



More information about the ffmpeg-cvslog mailing list