summaryrefslogtreecommitdiff
path: root/libavcodec/aacenc.c
diff options
context:
space:
mode:
authorNathan Caldwell <saintdev@gmail.com>2011-01-05 01:32:16 -0700
committerMartin Storsjö <martin@martin.st>2011-04-23 12:30:05 +0300
commit230c1a90754860719b017a9ea4627dc81f67ff6e (patch)
tree501ce731e992451d623f3b53dd4bcff9449033a9 /libavcodec/aacenc.c
parentcfc2a0cf848e71fcec0861a73b26c2c96a201357 (diff)
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ö <martin@martin.st>
Diffstat (limited to 'libavcodec/aacenc.c')
-rw-r--r--libavcodec/aacenc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index d4b61126bd..4ec76d063a 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -606,8 +606,10 @@ static int aac_encode_frame(AVCodecContext *avctx,
}
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;