Originally committed as revision 23367 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -580,7 +580,7 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s, · 579 unmodified lines | |||
| 580 | for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { | 580 | for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { |
| 581 | FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(w+w2)*16+g]; | 581 | FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(w+w2)*16+g]; |
| 582 | dist += quantize_band_cost(s, coefs + w2*128, s->scoefs + start + w2*128, sce->ics.swb_sizes[g], | 582 | dist += quantize_band_cost(s, coefs + w2*128, s->scoefs + start + w2*128, sce->ics.swb_sizes[g], |
| 583 | q + q0, cb, lambda / band->threshold, INFINITY, NULL); | 583 | q + q0, cb, lambda / band->threshold, INFINITY, NULL); |
| 584 | } | 584 | } |
| 585 | minrd = FFMIN(minrd, dist); | 585 | minrd = FFMIN(minrd, dist); |
| 586 | 586 | ||
| @@ -596,8 +596,8 @@ static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s, · 9 unmodified lines | |||
| 596 | } | 596 | } |
| 597 | } else { | 597 | } else { |
| 598 | for (q = 0; q < q1 - q0; q++) { | 598 | for (q = 0; q < q1 - q0; q++) { |
| 599 | paths[idx][q].cost = paths[idx - 1][q].cost + 1; | 599 | paths[idx][q].cost = paths[idx - 1][q].cost + 1; |
| 600 | paths[idx][q].prev = q; | 600 | paths[idx][q].prev = q; |
| 601 | } | 601 | } |
| 602 | } | 602 | } |
| 603 | sce->zeroes[w*16+g] = !nz; | 603 | sce->zeroes[w*16+g] = !nz; |
| @@ -703,20 +703,20 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx, · 99 unmodified lines | |||
| 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; | 707 | sce->band_type[w*16+g] = cb; |
| 708 | for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { | 708 | for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { |
| 709 | int b; | 709 | int b; |
| 710 | dist += quantize_band_cost(s, coefs + w2*128, | 710 | dist += quantize_band_cost(s, coefs + w2*128, |
| 711 | scaled + w2*128, | 711 | scaled + w2*128, |
| 712 | sce->ics.swb_sizes[g], | 712 | sce->ics.swb_sizes[g], |
| 713 | sce->sf_idx[w*16+g], | 713 | sce->sf_idx[w*16+g], |
| 714 | cb, | 714 | cb, |
| 715 | lambda, | 715 | lambda, |
| 716 | INFINITY, | 716 | INFINITY, |
| 717 | &b); | 717 | &b); |
| 718 | bits += b; | 718 | bits += b; |
| 719 | } | 719 | } |
| 720 | dists[w*16+g] = (dist - bits) / lambda; | 720 | dists[w*16+g] = (dist - bits) / lambda; |
| 721 | if (prev != -1) { | 721 | if (prev != -1) { |
| 722 | 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]; |