[FFmpeg-cvslog] AAC encoder: Fix rate control on twoloop.

Claudio Freire git at videolan.org
Sun Jun 2 16:55:20 CEST 2013


ffmpeg | branch: release/0.11 | Claudio Freire <klaussfreire at gmail.com> | Sat May  4 18:36:37 2013 -0300| [f6bca606f17640e835c1f264c1c45625008eb3e6] | committer: Carl Eugen Hoyos

AAC encoder: Fix rate control on twoloop.

Fixes a case where multichannel bitrate isn't accurately
targetted by psy model alone, never achieving the target bitrate.
Now fixed.

Fixes ticket #2625.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
Signed-off-by: Carl Eugen Hoyos <cehoyos at ag.or.at>

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

 libavcodec/aaccoder.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c
index b48da99..fe3fcce 100644
--- a/libavcodec/aaccoder.c
+++ b/libavcodec/aaccoder.c
@@ -713,7 +713,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
                                           const float lambda)
 {
     int start = 0, i, w, w2, g;
-    int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels;
+    int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels * (lambda / 120.f);
     float dists[128] = { 0 }, uplims[128];
     float maxvals[128];
     int fflag, minscaler;



More information about the ffmpeg-cvslog mailing list