mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
truehd: Simplify rematrix_channels() as per Michael's original review.
Originally committed as revision 18612 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
95c14b1eea
commit
15e6748b72
@ -848,6 +848,8 @@ static void rematrix_channels(MLPDecodeContext *m, unsigned int substr)
|
|||||||
int matrix_noise_shift = s->matrix_noise_shift[mat];
|
int matrix_noise_shift = s->matrix_noise_shift[mat];
|
||||||
unsigned int dest_ch = s->matrix_out_ch[mat];
|
unsigned int dest_ch = s->matrix_out_ch[mat];
|
||||||
int32_t mask = MSB_MASK(s->quant_step_size[dest_ch]);
|
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? */
|
/* TODO: DSPContext? */
|
||||||
|
|
||||||
@ -858,9 +860,9 @@ static void rematrix_channels(MLPDecodeContext *m, unsigned int substr)
|
|||||||
* s->matrix_coeff[mat][src_ch];
|
* s->matrix_coeff[mat][src_ch];
|
||||||
}
|
}
|
||||||
if (matrix_noise_shift) {
|
if (matrix_noise_shift) {
|
||||||
uint32_t index = s->num_primitive_matrices - mat;
|
index &= m->access_unit_size_pow2 - 1;
|
||||||
index = (i * (index * 2 + 1) + index) & (m->access_unit_size_pow2 - 1);
|
|
||||||
accum += m->noise_buffer[index] << (matrix_noise_shift + 7);
|
accum += m->noise_buffer[index] << (matrix_noise_shift + 7);
|
||||||
|
index += index2;
|
||||||
}
|
}
|
||||||
m->sample_buffer[i][dest_ch] = ((accum >> 14) & mask)
|
m->sample_buffer[i][dest_ch] = ((accum >> 14) & mask)
|
||||||
+ m->bypassed_lsbs[i][mat];
|
+ m->bypassed_lsbs[i][mat];
|
||||||
|
Loading…
Reference in New Issue
Block a user