aacenc: Finish 3GPP psymodel analysis for non mid/side cases.
There is still are still a few sections missing relating to TNS (not present)
and mid/side (contains other bugs).
Overall this improves quality, and vastly improves rate-control.
Signed-off-by: Martin Storsjö <[email protected]>
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index d4b6112..4ec76d0 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -606,8 +606,10 @@
}
frame_bits = put_bits_count(&s->pb);
- if (frame_bits <= 6144 * avctx->channels - 3)
+ if (frame_bits <= 6144 * avctx->channels - 3) {
+ s->psy.bitres.bits = frame_bits / avctx->channels;
break;
+ }
s->lambda *= avctx->bit_rate * 1024.0f / avctx->sample_rate / frame_bits;