summaryrefslogtreecommitdiff
path: root/libavcodec/aaccoder.c
diff options
context:
space:
mode:
authorAlex Converse <alex.converse@gmail.com>2010-06-28 21:42:57 +0000
committerAlex Converse <alex.converse@gmail.com>2010-06-28 21:42:57 +0000
commit804d489c4a97b8a97f1da216678b1ea0c03974e3 (patch)
treee4e2bcf56bb6851c28380aa2aa055a55a8b2eb11 /libavcodec/aaccoder.c
parent7ca4a72f476270df4464a3a379bc44a68257786f (diff)
downloadffmpeg-804d489c4a97b8a97f1da216678b1ea0c03974e3.tar.gz
aacenc: Fill in the estimated codebook for the final computed scalefactor in the TLS.
Originally committed as revision 23869 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/aaccoder.c')
-rw-r--r--libavcodec/aaccoder.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c
index f3193cddf6..81ece4b23b 100644
--- a/libavcodec/aaccoder.c
+++ b/libavcodec/aaccoder.c
@@ -704,7 +704,6 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
}
minscaler = FFMIN(minscaler, sce->sf_idx[w*16+g]);
cb = find_min_book(find_max_val(sce->ics.group_len[w], sce->ics.swb_sizes[g], scaled), sce->sf_idx[w*16+g]);
- sce->band_type[w*16+g] = cb;
for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
int b;
dist += quantize_band_cost(s, coefs + w2*128,
@@ -748,12 +747,15 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
start = w*128;
for (g = 0; g < sce->ics.num_swb; g++) {
int prevsc = sce->sf_idx[w*16+g];
+ const float *scaled = s->scoefs + start;
if (dists[w*16+g] > uplims[w*16+g] && sce->sf_idx[w*16+g] > 60)
sce->sf_idx[w*16+g]--;
sce->sf_idx[w*16+g] = av_clip(sce->sf_idx[w*16+g], minscaler, minscaler + SCALE_MAX_DIFF);
sce->sf_idx[w*16+g] = FFMIN(sce->sf_idx[w*16+g], 219);
if (sce->sf_idx[w*16+g] != prevsc)
fflag = 1;
+ sce->band_type[w*16+g] = find_min_book(find_max_val(sce->ics.group_len[w], sce->ics.swb_sizes[g], scaled), sce->sf_idx[w*16+g]);
+ start += sce->ics.swb_sizes[g];
}
}
its++;