mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-06-28 11:27:30 +08:00
oops, non-normalized downmix to mono contaminated add_bias for non-simd float-to-int.
Originally committed as revision 14740 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@ -606,6 +606,9 @@ static void do_rematrixing(AC3DecodeContext *s)
|
|||||||
static inline void do_imdct(AC3DecodeContext *s, int channels)
|
static inline void do_imdct(AC3DecodeContext *s, int channels)
|
||||||
{
|
{
|
||||||
int ch;
|
int ch;
|
||||||
|
float add_bias = s->add_bias;
|
||||||
|
if(s->out_channels==1 && channels>1)
|
||||||
|
add_bias *= LEVEL_MINUS_3DB; // compensate for the gain in downmix
|
||||||
|
|
||||||
for (ch=1; ch<=channels; ch++) {
|
for (ch=1; ch<=channels; ch++) {
|
||||||
if (s->block_switch[ch]) {
|
if (s->block_switch[ch]) {
|
||||||
@ -614,13 +617,13 @@ static inline void do_imdct(AC3DecodeContext *s, int channels)
|
|||||||
for(i=0; i<128; i++)
|
for(i=0; i<128; i++)
|
||||||
x[i] = s->transform_coeffs[ch][2*i];
|
x[i] = s->transform_coeffs[ch][2*i];
|
||||||
ff_imdct_half(&s->imdct_256, s->tmp_output, x);
|
ff_imdct_half(&s->imdct_256, s->tmp_output, x);
|
||||||
s->dsp.vector_fmul_window(s->output[ch-1], s->delay[ch-1], s->tmp_output, s->window, s->add_bias, 128);
|
s->dsp.vector_fmul_window(s->output[ch-1], s->delay[ch-1], s->tmp_output, s->window, add_bias, 128);
|
||||||
for(i=0; i<128; i++)
|
for(i=0; i<128; i++)
|
||||||
x[i] = s->transform_coeffs[ch][2*i+1];
|
x[i] = s->transform_coeffs[ch][2*i+1];
|
||||||
ff_imdct_half(&s->imdct_256, s->delay[ch-1], x);
|
ff_imdct_half(&s->imdct_256, s->delay[ch-1], x);
|
||||||
} else {
|
} else {
|
||||||
ff_imdct_half(&s->imdct_512, s->tmp_output, s->transform_coeffs[ch]);
|
ff_imdct_half(&s->imdct_512, s->tmp_output, s->transform_coeffs[ch]);
|
||||||
s->dsp.vector_fmul_window(s->output[ch-1], s->delay[ch-1], s->tmp_output, s->window, s->add_bias, 128);
|
s->dsp.vector_fmul_window(s->output[ch-1], s->delay[ch-1], s->tmp_output, s->window, add_bias, 128);
|
||||||
memcpy(s->delay[ch-1], s->tmp_output+128, 128*sizeof(float));
|
memcpy(s->delay[ch-1], s->tmp_output+128, 128*sizeof(float));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user