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 | 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++) { |
| @@ -719,13 +715,9 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx, · 6 unmodified lines | |||
| 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 | } |