comparison wmadec.c @ 10653:50c21a46538f libavcodec

Fix apparent 10l typos introduced in r8627. These typos moved the exponent pointer too far ahead. Fixes issue1055.
author michael
date Sun, 06 Dec 2009 23:51:51 +0000
parents 559ba9eabaff
children 2dbb341a14ba
comparison
equal deleted inserted replaced
10652:b6116b343122 10653:50c21a46538f
628 628
629 n1 = s->exponent_high_sizes[bsize]; 629 n1 = s->exponent_high_sizes[bsize];
630 630
631 /* compute power of high bands */ 631 /* compute power of high bands */
632 exponents = s->exponents[ch] + 632 exponents = s->exponents[ch] +
633 (s->high_band_start[bsize]<<bsize); 633 (s->high_band_start[bsize]<<bsize>>esize);
634 last_high_band = 0; /* avoid warning */ 634 last_high_band = 0; /* avoid warning */
635 for(j=0;j<n1;j++) { 635 for(j=0;j<n1;j++) {
636 n = s->exponent_high_bands[s->frame_len_bits - 636 n = s->exponent_high_bands[s->frame_len_bits -
637 s->block_len_bits][j]; 637 s->block_len_bits][j];
638 if (s->high_band_coded[ch][j]) { 638 if (s->high_band_coded[ch][j]) {
644 } 644 }
645 exp_power[j] = e2 / n; 645 exp_power[j] = e2 / n;
646 last_high_band = j; 646 last_high_band = j;
647 tprintf(s->avctx, "%d: power=%f (%d)\n", j, exp_power[j], n); 647 tprintf(s->avctx, "%d: power=%f (%d)\n", j, exp_power[j], n);
648 } 648 }
649 exponents += n<<bsize; 649 exponents += n<<bsize>>esize;
650 } 650 }
651 651
652 /* main freqs and high freqs */ 652 /* main freqs and high freqs */
653 exponents = s->exponents[ch] + (s->coefs_start<<bsize); 653 exponents = s->exponents[ch] + (s->coefs_start<<bsize>>esize);
654 for(j=-1;j<n1;j++) { 654 for(j=-1;j<n1;j++) {
655 if (j < 0) { 655 if (j < 0) {
656 n = s->high_band_start[bsize] - 656 n = s->high_band_start[bsize] -
657 s->coefs_start; 657 s->coefs_start;
658 } else { 658 } else {
670 noise = s->noise_table[s->noise_index]; 670 noise = s->noise_table[s->noise_index];
671 s->noise_index = (s->noise_index + 1) & (NOISE_TAB_SIZE - 1); 671 s->noise_index = (s->noise_index + 1) & (NOISE_TAB_SIZE - 1);
672 *coefs++ = noise * 672 *coefs++ = noise *
673 exponents[i<<bsize>>esize] * mult1; 673 exponents[i<<bsize>>esize] * mult1;
674 } 674 }
675 exponents += n<<bsize; 675 exponents += n<<bsize>>esize;
676 } else { 676 } else {
677 /* coded values + small noise */ 677 /* coded values + small noise */
678 for(i = 0;i < n; i++) { 678 for(i = 0;i < n; i++) {
679 noise = s->noise_table[s->noise_index]; 679 noise = s->noise_table[s->noise_index];
680 s->noise_index = (s->noise_index + 1) & (NOISE_TAB_SIZE - 1); 680 s->noise_index = (s->noise_index + 1) & (NOISE_TAB_SIZE - 1);
681 *coefs++ = ((*coefs1++) + noise) * 681 *coefs++ = ((*coefs1++) + noise) *
682 exponents[i<<bsize>>esize] * mult; 682 exponents[i<<bsize>>esize] * mult;
683 } 683 }
684 exponents += n<<bsize; 684 exponents += n<<bsize>>esize;
685 } 685 }
686 } 686 }
687 687
688 /* very high freqs : noise */ 688 /* very high freqs : noise */
689 n = s->block_len - s->coefs_end[bsize]; 689 n = s->block_len - s->coefs_end[bsize];