summaryrefslogtreecommitdiff
path: root/libavcodec/aaccoder.c
diff options
context:
space:
mode:
authorAlex Converse <alex.converse@gmail.com>2009-07-16 22:20:17 +0000
committerAlex Converse <alex.converse@gmail.com>2009-07-16 22:20:17 +0000
commita5762c9b595b5d5b8f09ffaf2e29ad3ffee2a395 (patch)
treed913648e2110b95ac04f284652bb83d02a7f5c32 /libavcodec/aaccoder.c
parentca0f1e50928bda4a150d3bafe133e3d593f4aa65 (diff)
When calculating AAC quantized band cost, don't leave garbage in the bit count
for the 0 codebook. Originally committed as revision 19444 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/aaccoder.c')
-rw-r--r--libavcodec/aaccoder.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c
index f4ae130b7e..252b3592a3 100644
--- a/libavcodec/aaccoder.c
+++ b/libavcodec/aaccoder.c
@@ -124,6 +124,8 @@ static float quantize_band_cost(struct AACEncContext *s, const float *in,
if (!cb) {
for (i = 0; i < size; i++)
cost += in[i]*in[i]*lambda;
+ if (bits)
+ *bits = 0;
return cost;
}
#ifndef USE_REALLY_FULL_SEARCH