Skip to content

Commit f4049bb

Browse files
committed
Volume: Bug fix for vol_mult_s24_to_s16() function
The previous commit introduced a bug in this volume function. The input parameter for s24 PCM samples must be int32_t. The bug causes for s24 to s16 converted audio very low signal level and noise due to overflows. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 9b376d7 commit f4049bb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/audio/volume_generic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
*
5151
* Volume multiply for 24 bit input and 16 bit bit output.
5252
*/
53-
static inline int16_t vol_mult_s24_to_s16(int16_t x, int32_t vol)
53+
static inline int16_t vol_mult_s24_to_s16(int32_t x, int32_t vol)
5454
{
5555
return (int16_t)q_multsr_sat_32x32_16(sign_extend_s24(x), vol,
5656
Q_SHIFT_BITS_64(23, 16, 15));

0 commit comments

Comments
 (0)