summaryrefslogtreecommitdiffstats
path: root/firmware/pcm_sw_volume.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/pcm_sw_volume.c')
-rw-r--r--firmware/pcm_sw_volume.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/firmware/pcm_sw_volume.c b/firmware/pcm_sw_volume.c
index 7322269f44..3593c684af 100644
--- a/firmware/pcm_sw_volume.c
+++ b/firmware/pcm_sw_volume.c
@@ -54,7 +54,11 @@ static typeof (memcpy) *pcm_scaling_fn = NULL;
/* Scale sample by PCM factor */
static inline int32_t pcm_scale_sample(PCM_F_T f, int32_t s)
{
+#if defined(PCM_DC_OFFSET_VALUE)
+ return (f * s + PCM_DC_OFFSET_VALUE) >> PCM_SW_VOLUME_FRACBITS;
+#else
return (f * s) >> PCM_SW_VOLUME_FRACBITS;
+#endif
}
/* Both UNITY, use direct copy */