diff options
author | Martin Storsjö <martin@martin.st> | 2012-07-12 21:19:08 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2012-07-12 23:37:29 +0300 |
commit | 7548831c5e503814a17dc8f7fb7b7f49a0564265 (patch) | |
tree | 85c78f9a75c9b657c0ea1ea256f2a5e15d20c013 /libavcodec/libfdk-aacenc.c | |
parent | 0da29727eadcc4e1f1ed661d1db4caed6ceb17c9 (diff) | |
download | ffmpeg-7548831c5e503814a17dc8f7fb7b7f49a0564265.tar.gz |
libfdk-aac: Allow setting the encoder bandwidth/cutoff frequency
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/libfdk-aacenc.c')
-rw-r--r-- | libavcodec/libfdk-aacenc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c index 6fda53ca60..b2bfad275e 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)); |