comparison mlpdec.c @ 9506:50feb15cbf2a libavcodec

mlpdec: Use some context arrays with local variables in rematrix_channels().
author ramiro
date Sat, 18 Apr 2009 19:46:41 +0000
parents bcef741a555a
children 7e156421dcbc
comparison
equal deleted inserted replaced
9505:bcef741a555a 9506:50feb15cbf2a
846 846
847 for (mat = 0; mat < s->num_primitive_matrices; mat++) { 847 for (mat = 0; mat < s->num_primitive_matrices; mat++) {
848 int matrix_noise_shift = s->matrix_noise_shift[mat]; 848 int matrix_noise_shift = s->matrix_noise_shift[mat];
849 unsigned int dest_ch = s->matrix_out_ch[mat]; 849 unsigned int dest_ch = s->matrix_out_ch[mat];
850 int32_t mask = MSB_MASK(s->quant_step_size[dest_ch]); 850 int32_t mask = MSB_MASK(s->quant_step_size[dest_ch]);
851 int32_t *coeffs = s->matrix_coeff[mat];
851 int index = s->num_primitive_matrices - mat; 852 int index = s->num_primitive_matrices - mat;
852 int index2 = 2 * index + 1; 853 int index2 = 2 * index + 1;
853 854
854 /* TODO: DSPContext? */ 855 /* TODO: DSPContext? */
855 856
856 for (i = 0; i < s->blockpos; i++) { 857 for (i = 0; i < s->blockpos; i++) {
858 int32_t *samples = m->sample_buffer[i];
857 int64_t accum = 0; 859 int64_t accum = 0;
858 for (src_ch = 0; src_ch <= maxchan; src_ch++) { 860 for (src_ch = 0; src_ch <= maxchan; src_ch++) {
859 accum += (int64_t)m->sample_buffer[i][src_ch] 861 accum += (int64_t)samples[src_ch]
860 * s->matrix_coeff[mat][src_ch]; 862 * coeffs[src_ch];
861 } 863 }
862 if (matrix_noise_shift) { 864 if (matrix_noise_shift) {
863 index &= m->access_unit_size_pow2 - 1; 865 index &= m->access_unit_size_pow2 - 1;
864 accum += m->noise_buffer[index] << (matrix_noise_shift + 7); 866 accum += m->noise_buffer[index] << (matrix_noise_shift + 7);
865 index += index2; 867 index += index2;
866 } 868 }
867 m->sample_buffer[i][dest_ch] = ((accum >> 14) & mask) 869 samples[dest_ch] = ((accum >> 14) & mask)
868 + m->bypassed_lsbs[i][mat]; 870 + m->bypassed_lsbs[i][mat];
869 } 871 }
870 } 872 }
871 } 873 }
872 874