comparison aaccoder.c @ 11792:a211c41465f3 libavcodec

aacenc: Remove unnecessary variables and scopes in the TLS.
author alexc
date Fri, 28 May 2010 20:42:01 +0000
parents 847502a2f850
children 9a13275c05c4
comparison
equal deleted inserted replaced
11791:51abd780bda6 11792:a211c41465f3
694 for (g = 0; g < sce->ics.num_swb; g++) { 694 for (g = 0; g < sce->ics.num_swb; g++) {
695 const float *coefs = sce->coeffs + start; 695 const float *coefs = sce->coeffs + start;
696 const float *scaled = s->scoefs + start; 696 const float *scaled = s->scoefs + start;
697 int bits = 0; 697 int bits = 0;
698 int cb; 698 int cb;
699 float mindist = INFINITY; 699 float dist = 0.0f;
700 int minbits = 0;
701 700
702 if (sce->zeroes[w*16+g] || sce->sf_idx[w*16+g] >= 218) { 701 if (sce->zeroes[w*16+g] || sce->sf_idx[w*16+g] >= 218) {
703 start += sce->ics.swb_sizes[g]; 702 start += sce->ics.swb_sizes[g];
704 continue; 703 continue;
705 } 704 }
706 minscaler = FFMIN(minscaler, sce->sf_idx[w*16+g]); 705 minscaler = FFMIN(minscaler, sce->sf_idx[w*16+g]);
707 {
708 float dist = 0.0f;
709 int bb = 0;
710 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]);
711 sce->band_type[w*16+g] = cb; 707 sce->band_type[w*16+g] = cb;
712 for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { 708 for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
713 int b; 709 int b;
714 dist += quantize_band_cost(s, coefs + w2*128, 710 dist += quantize_band_cost(s, coefs + w2*128,
717 sce->sf_idx[w*16+g], 713 sce->sf_idx[w*16+g],
718 cb, 714 cb,
719 lambda, 715 lambda,
720 INFINITY, 716 INFINITY,
721 &b); 717 &b);
722 bb += b; 718 bits += b;
723 } 719 }
724 mindist = dist; 720 dists[w*16+g] = (dist - bits) / lambda;
725 minbits = bb;
726 }
727 dists[w*16+g] = (mindist - minbits) / lambda;
728 bits = minbits;
729 if (prev != -1) { 721 if (prev != -1) {
730 bits += ff_aac_scalefactor_bits[sce->sf_idx[w*16+g] - prev + SCALE_DIFF_ZERO]; 722 bits += ff_aac_scalefactor_bits[sce->sf_idx[w*16+g] - prev + SCALE_DIFF_ZERO];
731 } 723 }
732 tbits += bits; 724 tbits += bits;
733 start += sce->ics.swb_sizes[g]; 725 start += sce->ics.swb_sizes[g];