Originally committed as revision 23366 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -696,17 +696,13 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx, · 695 unmodified lines | ||
| 696 | 696 | const float *scaled = s->scoefs + start; |
| 697 | 697 | int bits = 0; |
| 698 | 698 | int cb; |
| 699 | − float mindist = INFINITY; | |
| 700 | − int minbits = 0; | |
| 699 | + float dist = 0.0f; | |
| 701 | 700 | |
| 702 | 701 | if (sce->zeroes[w*16+g] || sce->sf_idx[w*16+g] >= 218) { |
| 703 | 702 | start += sce->ics.swb_sizes[g]; |
| 704 | 703 | continue; |
| 705 | 704 | } |
| 706 | 705 | minscaler = FFMIN(minscaler, sce->sf_idx[w*16+g]); |
| 707 | − { | |
| 708 | − float dist = 0.0f; | |
| 709 | − int bb = 0; | |
| 710 | 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 | 707 | sce->band_type[w*16+g] = cb; |
| 712 | 708 | for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { |
| @@ -719,13 +715,9 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx, · 6 unmodified lines | ||
| 719 | 715 | lambda, |
| 720 | 716 | INFINITY, |
| 721 | 717 | &b); |
| 722 | − bb += b; | |
| 718 | + bits += b; | |
| 723 | 719 | } |
| 724 | − mindist = dist; | |
| 725 | − minbits = bb; | |
| 726 | − } | |
| 727 | − dists[w*16+g] = (mindist - minbits) / lambda; | |
| 728 | − bits = minbits; | |
| 720 | + dists[w*16+g] = (dist - bits) / lambda; | |
| 729 | 721 | if (prev != -1) { |
| 730 | 722 | bits += ff_aac_scalefactor_bits[sce->sf_idx[w*16+g] - prev + SCALE_DIFF_ZERO]; |
| 731 | 723 | } |