mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-01 05:31:04 +08:00
ac3enc: scale floating-point coupling channel coefficients in
scale_coefficients() rather than in apply_channel_coupling()
This commit is contained in:
@ -104,9 +104,10 @@ static int normalize_samples(AC3EncodeContext *s)
|
|||||||
static void scale_coefficients(AC3EncodeContext *s)
|
static void scale_coefficients(AC3EncodeContext *s)
|
||||||
{
|
{
|
||||||
int chan_size = AC3_MAX_COEFS * s->num_blocks;
|
int chan_size = AC3_MAX_COEFS * s->num_blocks;
|
||||||
s->ac3dsp.float_to_fixed24(s->fixed_coef_buffer + chan_size,
|
int cpl = s->cpl_on;
|
||||||
s->mdct_coef_buffer + chan_size,
|
s->ac3dsp.float_to_fixed24(s->fixed_coef_buffer + (chan_size * !cpl),
|
||||||
chan_size * s->channels);
|
s->mdct_coef_buffer + (chan_size * !cpl),
|
||||||
|
chan_size * (s->channels + cpl));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -168,10 +168,6 @@ static void apply_channel_coupling(AC3EncodeContext *s)
|
|||||||
|
|
||||||
/* coefficients must be clipped in order to be encoded */
|
/* coefficients must be clipped in order to be encoded */
|
||||||
clip_coefficients(&s->dsp, cpl_coef, num_cpl_coefs);
|
clip_coefficients(&s->dsp, cpl_coef, num_cpl_coefs);
|
||||||
|
|
||||||
/* scale coupling coefficients from float to 24-bit fixed-point */
|
|
||||||
s->ac3dsp.float_to_fixed24(&block->fixed_coef[CPL_CH][cpl_start],
|
|
||||||
cpl_coef, num_cpl_coefs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* calculate energy in each band in coupling channel and each fbw channel */
|
/* calculate energy in each band in coupling channel and each fbw channel */
|
||||||
|
Reference in New Issue
Block a user