summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2015-10-28 11:32:57 +0100
committerWim Taymans <wtaymans@redhat.com>2015-10-28 11:37:43 +0100
commit94d45bbbd9b764028af39a1a3cecac4e97f94244 (patch)
treef3826236e11fde8d2216eac8b3e59fc6ec3c4061
parent2358915754a3606dc2c5ac92f7ae0c0caa2952e9 (diff)
downloadgstreamer-plugins-base-94d45bbbd9b764028af39a1a3cecac4e97f94244.tar.gz
audioquantize: fix 8-pole noise shaping
Fix the 8-pole noise shaping error update. We were mixing errors from different channels.
-rw-r--r--gst/audioconvert/gstaudioquantize.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gst/audioconvert/gstaudioquantize.c b/gst/audioconvert/gstaudioquantize.c
index 91a8c12e0..d3df42cba 100644
--- a/gst/audioconvert/gstaudioquantize.c
+++ b/gst/audioconvert/gstaudioquantize.c
@@ -296,15 +296,14 @@ static const gdouble ns_high_coeffs[] = {
#define ADD_NS_HIGH() \
cur_error = 0.0; \
for (j = 0; j < 8; j++) \
- cur_error += errors[chan_pos + j] * ns_high_coeffs[j]; \
+ cur_error += errors[chan_pos*8 + j] * ns_high_coeffs[j]; \
tmp -= cur_error; \
orig = tmp;
#define UPDATE_ERROR_HIGH() \
for (j = 7; j > 0; j--) \
- errors[chan_pos + j] = errors[chan_pos + j-1]; \
- errors[chan_pos] = (*dst)/factor - orig;
-
+ errors[chan_pos*8 + j] = errors[chan_pos*8 + j-1]; \
+ errors[chan_pos*8] = (*dst)/factor - orig;
MAKE_QUANTIZE_FUNC_I (int_none_none, NONE_FUNC, NONE_FUNC, ROUND);
MAKE_QUANTIZE_FUNC_I (int_rpdf_none, INIT_DITHER_RPDF_I, ADD_DITHER_RPDF_I,