comparison mlpdec.c @ 9508:41ab6db265d0 libavcodec

mlpdec: Read context variable to local variable to make code cleaner.
author ramiro
date Sat, 18 Apr 2009 20:23:13 +0000
parents 7e156421dcbc
children dbb16aa52d43
comparison
equal deleted inserted replaced
9507:7e156421dcbc 9508:41ab6db265d0
847 int index2 = 2 * index + 1; 847 int index2 = 2 * index + 1;
848 848
849 /* TODO: DSPContext? */ 849 /* TODO: DSPContext? */
850 850
851 for (i = 0; i < s->blockpos; i++) { 851 for (i = 0; i < s->blockpos; i++) {
852 int32_t bypassed_lsb = m->bypassed_lsbs[i][mat];
852 int32_t *samples = m->sample_buffer[i]; 853 int32_t *samples = m->sample_buffer[i];
853 int64_t accum = 0; 854 int64_t accum = 0;
854 855
855 for (src_ch = 0; src_ch <= maxchan; src_ch++) 856 for (src_ch = 0; src_ch <= maxchan; src_ch++)
856 accum += (int64_t) samples[src_ch] * coeffs[src_ch]; 857 accum += (int64_t) samples[src_ch] * coeffs[src_ch];
859 index &= m->access_unit_size_pow2 - 1; 860 index &= m->access_unit_size_pow2 - 1;
860 accum += m->noise_buffer[index] << (matrix_noise_shift + 7); 861 accum += m->noise_buffer[index] << (matrix_noise_shift + 7);
861 index += index2; 862 index += index2;
862 } 863 }
863 864
864 samples[dest_ch] = ((accum >> 14) & mask) 865 samples[dest_ch] = ((accum >> 14) & mask) + bypassed_lsb;
865 + m->bypassed_lsbs[i][mat];
866 } 866 }
867 } 867 }
868 } 868 }
869 869
870 /** Write the audio data into the output buffer. */ 870 /** Write the audio data into the output buffer. */