Fixes a case where multichannel bitrate isn't accurately targetted by psy model alone, never achieving the target bitrate. Now fixed.
Unified · Split
| @@ -710,7 +710,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx, · 709 unmodified lines | |||
| 710 | const float lambda) | 710 | const float lambda) |
| 711 | { | 711 | { |
| 712 | int start = 0, i, w, w2, g; | 712 | int start = 0, i, w, w2, g; |
| 713 | int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels; | 713 | int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels * (lambda / 120.f); |
| 714 | float dists[128] = { 0 }, uplims[128]; | 714 | float dists[128] = { 0 }, uplims[128]; |
| 715 | float maxvals[128]; | 715 | float maxvals[128]; |
| 716 | int fflag, minscaler; | 716 | int fflag, minscaler; |