From a2fd00cf38d991eed23efd8f780edf9c39c1d05f Mon Sep 17 00:00:00 2001 From: Dana Conrad Date: Sat, 31 Jul 2021 21:05:40 -0500 Subject: [PATCH] Software Volume: Remove sample rounding Change-Id: I630139333d64b4c8cae86939ecfc52c44a34ffea --- firmware/pcm_sw_volume.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware/pcm_sw_volume.c b/firmware/pcm_sw_volume.c index 29049059e6..7322269f44 100644 --- a/firmware/pcm_sw_volume.c +++ b/firmware/pcm_sw_volume.c @@ -51,10 +51,10 @@ static typeof (memcpy) *pcm_scaling_fn = NULL; #define PCM_F_T int64_t /* Requires large integer math */ #endif /* PCM_SW_VOLUME_FRACBITS */ -/* Scale and round sample by PCM factor */ +/* Scale sample by PCM factor */ static inline int32_t pcm_scale_sample(PCM_F_T f, int32_t s) { - return (f * s + (PCM_F_T)PCM_FACTOR_UNITY/2) >> PCM_SW_VOLUME_FRACBITS; + return (f * s) >> PCM_SW_VOLUME_FRACBITS; } /* Both UNITY, use direct copy */