Commit 4fa9a7b
committed
Volume: Fix overflow in s16 and s24 output conversions
The problem could be heard with extremely loud music content. The
32x32 saturating multiply function works for 32 bit output but
the result will overflow when less number of bits are used from output.
This patch adds to format.h rounded 32x32 multiply inline functions for
saturated s24 and s16 formats. The generic volume function is updated
to utilize them and the code structure is cleaned for easier maintenance
and simpler look.
The format.h file is cleaned up with function parameter indents and
remove of redundant code in saturate function.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>1 parent 43da169 commit 4fa9a7b
2 files changed
Lines changed: 154 additions & 245 deletions
0 commit comments