Mercurial > libavcodec.hg
comparison aaccoder.c @ 11997:081702713f47 libavcodec
aacenc: Fill in the estimated codebook for the final computed scalefactor in the TLS.
author | alexc |
---|---|
date | Mon, 28 Jun 2010 21:42:57 +0000 |
parents | 233b2faac076 |
children | b3c39e9d4d3e |
comparison
equal
deleted
inserted
replaced
11996:e0dae84d60ae | 11997:081702713f47 |
---|---|
702 start += sce->ics.swb_sizes[g]; | 702 start += sce->ics.swb_sizes[g]; |
703 continue; | 703 continue; |
704 } | 704 } |
705 minscaler = FFMIN(minscaler, sce->sf_idx[w*16+g]); | 705 minscaler = FFMIN(minscaler, sce->sf_idx[w*16+g]); |
706 cb = find_min_book(find_max_val(sce->ics.group_len[w], sce->ics.swb_sizes[g], scaled), sce->sf_idx[w*16+g]); | 706 cb = find_min_book(find_max_val(sce->ics.group_len[w], sce->ics.swb_sizes[g], scaled), sce->sf_idx[w*16+g]); |
707 sce->band_type[w*16+g] = cb; | |
708 for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { | 707 for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { |
709 int b; | 708 int b; |
710 dist += quantize_band_cost(s, coefs + w2*128, | 709 dist += quantize_band_cost(s, coefs + w2*128, |
711 scaled + w2*128, | 710 scaled + w2*128, |
712 sce->ics.swb_sizes[g], | 711 sce->ics.swb_sizes[g], |
746 minscaler = av_clip(minscaler, 60, 255 - SCALE_MAX_DIFF); | 745 minscaler = av_clip(minscaler, 60, 255 - SCALE_MAX_DIFF); |
747 for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { | 746 for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { |
748 start = w*128; | 747 start = w*128; |
749 for (g = 0; g < sce->ics.num_swb; g++) { | 748 for (g = 0; g < sce->ics.num_swb; g++) { |
750 int prevsc = sce->sf_idx[w*16+g]; | 749 int prevsc = sce->sf_idx[w*16+g]; |
750 const float *scaled = s->scoefs + start; | |
751 if (dists[w*16+g] > uplims[w*16+g] && sce->sf_idx[w*16+g] > 60) | 751 if (dists[w*16+g] > uplims[w*16+g] && sce->sf_idx[w*16+g] > 60) |
752 sce->sf_idx[w*16+g]--; | 752 sce->sf_idx[w*16+g]--; |
753 sce->sf_idx[w*16+g] = av_clip(sce->sf_idx[w*16+g], minscaler, minscaler + SCALE_MAX_DIFF); | 753 sce->sf_idx[w*16+g] = av_clip(sce->sf_idx[w*16+g], minscaler, minscaler + SCALE_MAX_DIFF); |
754 sce->sf_idx[w*16+g] = FFMIN(sce->sf_idx[w*16+g], 219); | 754 sce->sf_idx[w*16+g] = FFMIN(sce->sf_idx[w*16+g], 219); |
755 if (sce->sf_idx[w*16+g] != prevsc) | 755 if (sce->sf_idx[w*16+g] != prevsc) |
756 fflag = 1; | 756 fflag = 1; |
757 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]); | |
758 start += sce->ics.swb_sizes[g]; | |
757 } | 759 } |
758 } | 760 } |
759 its++; | 761 its++; |
760 } while (fflag && its < 10); | 762 } while (fflag && its < 10); |
761 } | 763 } |