1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-07-18 18:31:46 +02:00

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.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Claudio Freire 2013-05-04 18:36:37 -03:00 committed by Michael Niedermayer
parent c545876d1b
commit 1ef82cc60d

View File

@ -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;