Software Volume: Remove sample rounding

Change-Id: I630139333d64b4c8cae86939ecfc52c44a34ffea
This commit is contained in:
Dana Conrad 2021-07-31 21:05:40 -05:00 committed by Solomon Peachy
parent ecf0d631e7
commit a2fd00cf38

View file

@ -51,10 +51,10 @@ static typeof (memcpy) *pcm_scaling_fn = NULL;
#define PCM_F_T int64_t /* Requires large integer math */ #define PCM_F_T int64_t /* Requires large integer math */
#endif /* PCM_SW_VOLUME_FRACBITS */ #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) 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 */ /* Both UNITY, use direct copy */