mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avcodec/g729postfilter: Fix left shift of negative value
Fixes: Ticket8176 Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 5f0acc5064ed501cb40d4aaccae2b3ce5c4552fd) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
8b462c958a
commit
366cfe1615
@ -343,7 +343,7 @@ static int16_t long_term_filter(AudioDSPContext *adsp, int pitch_delay_int,
|
||||
L_temp1 = gain_long_num * gain_long_num;
|
||||
L_temp1 = MULL(L_temp1, gain_den, FRAC_BITS);
|
||||
|
||||
tmp = ((sh_gain_long_num - sh_gain_num) << 1) - (sh_gain_long_den - sh_gain_den);
|
||||
tmp = ((sh_gain_long_num - sh_gain_num) * 2) - (sh_gain_long_den - sh_gain_den);
|
||||
if (tmp > 0)
|
||||
L_temp0 >>= tmp;
|
||||
else
|
||||
@ -364,7 +364,7 @@ static int16_t long_term_filter(AudioDSPContext *adsp, int pitch_delay_int,
|
||||
/* Rescale selected signal to original value. */
|
||||
if (shift > 0)
|
||||
for (i = 0; i < subframe_size; i++)
|
||||
selected_signal[i] <<= shift;
|
||||
selected_signal[i] *= 1 << shift;
|
||||
else
|
||||
for (i = 0; i < subframe_size; i++)
|
||||
selected_signal[i] >>= -shift;
|
||||
@ -461,7 +461,7 @@ static int16_t get_tilt_comp(AudioDSPContext *adsp, int16_t *lp_gn,
|
||||
speech[i] = (speech[i] * temp + 0x4000) >> 15;
|
||||
}
|
||||
|
||||
return -(rh1 << 15) / rh0;
|
||||
return -(rh1 * (1 << 15)) / rh0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user