aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorClaudio Freire <klaussfreire@gmail.com>2013-05-04 18:36:37 -0300
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2013-06-02 16:18:09 +0200
commit9af68f8d1f3df12a32574e003e065bc565695b52 (patch)
treed485a7153da56d6b71dac577926e4df5779c6dc2 /libavcodec
parentf2361593ca1b542f0e9284d2d4276387f8fec1e3 (diff)
downloadffmpeg-9af68f8d1f3df12a32574e003e065bc565695b52.tar.gz
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@gmx.at> Signed-off-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/aaccoder.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c
index 994de286c9..45fbc2dedf 100644
--- a/libavcodec/aaccoder.c
+++ b/libavcodec/aaccoder.c
@@ -710,7 +710,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;