Audio: SRC: Fix generic C version overflow in 16 bit round

This patch adds the missing saturation to rounding in function
src_polyphase_stage_cir_s16(). The error was caught with
"src_test(16, 16, [176400 192000], 8000)" where both conversions
made an overflow in chirp test.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This commit is contained in:
Seppo Ingalsuo 2022-12-01 17:28:02 +02:00 committed by Liam Girdwood
parent 16fbd5f081
commit e627c7994f
1 changed files with 1 additions and 1 deletions

View File

@ -392,7 +392,7 @@ void src_polyphase_stage_cir_s16(struct src_stage_prm *s)
n_min = (m < n_min) ? m : n_min;
m -= n_min;
for (i = 0; i < n_min; i++) {
*y_wptr = Q_SHIFT_RND(*fir->out_rp, 31, 15);
*y_wptr = sat_int16(Q_SHIFT_RND(*fir->out_rp, 31, 15));
y_wptr++;
fir->out_rp++;
}