[FFmpeg-cvslog] r18612 - trunk/libavcodec/mlpdec.c
ramiro
subversion
Sat Apr 18 21:39:08 CEST 2009
Author: ramiro
Date: Sat Apr 18 21:39:07 2009
New Revision: 18612
Log:
truehd: Simplify rematrix_channels() as per Michael's original review.
Modified:
trunk/libavcodec/mlpdec.c
Modified: trunk/libavcodec/mlpdec.c
==============================================================================
--- trunk/libavcodec/mlpdec.c Sat Apr 18 20:54:30 2009 (r18611)
+++ trunk/libavcodec/mlpdec.c Sat Apr 18 21:39:07 2009 (r18612)
@@ -848,6 +848,8 @@ static void rematrix_channels(MLPDecodeC
int matrix_noise_shift = s->matrix_noise_shift[mat];
unsigned int dest_ch = s->matrix_out_ch[mat];
int32_t mask = MSB_MASK(s->quant_step_size[dest_ch]);
+ int index = s->num_primitive_matrices - mat;
+ int index2 = 2 * index + 1;
/* TODO: DSPContext? */
@@ -858,9 +860,9 @@ static void rematrix_channels(MLPDecodeC
* s->matrix_coeff[mat][src_ch];
}
if (matrix_noise_shift) {
- uint32_t index = s->num_primitive_matrices - mat;
- index = (i * (index * 2 + 1) + index) & (m->access_unit_size_pow2 - 1);
+ index &= m->access_unit_size_pow2 - 1;
accum += m->noise_buffer[index] << (matrix_noise_shift + 7);
+ index += index2;
}
m->sample_buffer[i][dest_ch] = ((accum >> 14) & mask)
+ m->bypassed_lsbs[i][mat];
More information about the ffmpeg-cvslog
mailing list