summaryrefslogtreecommitdiff
path: root/gst
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:36:18 +0100
commit8d4cd51e5952cfe74fde9f3b07e5e8949d6fa753 (patch)
tree5efbee87620b10715986cbbc01c512e059ad817b /gst
parent36b80edb7263118467dfcaee3923f7c964ae6bc8 (diff)
audioquantize: fix 8-pole noise shaping
Fix the 8-pole noise shaping error update. We were mixing errors from different channels.
Diffstat (limited to 'gst')
-rw-r--r--gst/audioconvert/gstaudioquantize.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gst/audioconvert/gstaudioquantize.c b/gst/audioconvert/gstaudioquantize.c
index b61860ea0..175925002 100644
--- a/gst/audioconvert/gstaudioquantize.c
+++ b/gst/audioconvert/gstaudioquantize.c
@@ -286,14 +286,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] = (d)/factor - orig;
+ errors[chan_pos*8 + j] = errors[chan_pos*8 + j-1]; \
+ errors[chan_pos*8] = (d)/factor - orig;
MAKE_QUANTIZE_FUNC_I (int_none_none, NONE_FUNC, NONE_FUNC, ROUND);