[FFmpeg-cvslog] libfdk-aac: Allow setting the encoder bandwidth/cutoff frequency

Martin Storsjö git at videolan.org
Fri Jul 13 22:54:08 CEST 2012


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Thu Jul 12 21:19:08 2012 +0300| [7548831c5e503814a17dc8f7fb7b7f49a0564265] | committer: Martin Storsjö

libfdk-aac: Allow setting the encoder bandwidth/cutoff frequency

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

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

 libavcodec/libfdk-aacenc.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c
index 6fda53c..b2bfad2 100644
--- a/libavcodec/libfdk-aacenc.c
+++ b/libavcodec/libfdk-aacenc.c
@@ -230,6 +230,15 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
         goto error;
     }
 
+    if (avctx->cutoff > 0) {
+        if ((err = aacEncoder_SetParam(s->handle, AACENC_BANDWIDTH,
+                                       avctx->cutoff)) != AACENC_OK) {
+            av_log(avctx, AV_LOG_ERROR, "Unable to set the encoder bandwith to %d: %s\n",
+                   avctx->cutoff, aac_get_error(err));
+            goto error;
+        }
+    }
+
     if ((err = aacEncEncode(s->handle, NULL, NULL, NULL, NULL)) != AACENC_OK) {
         av_log(avctx, AV_LOG_ERROR, "Unable to initialize the encoder: %s\n",
                aac_get_error(err));



More information about the ffmpeg-cvslog mailing list