mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
equalizer: fix filter history usage. Fixes #597397
The process functions where overwriting the history for each channel. Also pull some static things out of the inner loop.
This commit is contained in:
parent
0040d01265
commit
7b6e594b69
1 changed files with 15 additions and 17 deletions
|
@ -577,17 +577,16 @@ gst_iir_equ_process_ ## TYPE (GstIirEqualizer *equ, guint8 *data, \
|
|||
guint size, guint channels) \
|
||||
{ \
|
||||
guint frames = size / channels / sizeof (TYPE); \
|
||||
guint i, c, f; \
|
||||
guint i, c, f, nf = equ->freq_band_count; \
|
||||
BIG_TYPE cur; \
|
||||
GstIirEqualizerBand **filters = equ->bands; \
|
||||
\
|
||||
for (i = 0; i < frames; i++) { \
|
||||
for (c = 0; c < channels; c++) { \
|
||||
SecondOrderHistory ## TYPE *history = equ->history; \
|
||||
for (c = 0; c < channels; c++) { \
|
||||
cur = *((TYPE *) data); \
|
||||
for (f = 0; f < equ->freq_band_count; f++) { \
|
||||
GstIirEqualizerBand *filter = equ->bands[f]; \
|
||||
\
|
||||
cur = one_step_ ## TYPE (filter, history, cur); \
|
||||
for (f = 0; f < nf; f++) { \
|
||||
cur = one_step_ ## TYPE (filters[f], history, cur); \
|
||||
history++; \
|
||||
} \
|
||||
cur = CLAMP (cur, MIN_VAL, MAX_VAL); \
|
||||
|
@ -628,17 +627,16 @@ gst_iir_equ_process_ ## TYPE (GstIirEqualizer *equ, guint8 *data, \
|
|||
guint size, guint channels) \
|
||||
{ \
|
||||
guint frames = size / channels / sizeof (TYPE); \
|
||||
guint i, c, f; \
|
||||
guint i, c, f, nf = equ->freq_band_count; \
|
||||
TYPE cur; \
|
||||
GstIirEqualizerBand **filters = equ->bands; \
|
||||
\
|
||||
for (i = 0; i < frames; i++) { \
|
||||
for (c = 0; c < channels; c++) { \
|
||||
SecondOrderHistory ## TYPE *history = equ->history; \
|
||||
for (c = 0; c < channels; c++) { \
|
||||
cur = *((TYPE *) data); \
|
||||
for (f = 0; f < equ->freq_band_count; f++) { \
|
||||
GstIirEqualizerBand *filter = equ->bands[f]; \
|
||||
\
|
||||
cur = one_step_ ## TYPE (filter, history, cur); \
|
||||
for (f = 0; f < nf; f++) { \
|
||||
cur = one_step_ ## TYPE (filters[f], history, cur); \
|
||||
history++; \
|
||||
} \
|
||||
*((TYPE *) data) = (TYPE) cur; \
|
||||
|
|
Loading…
Reference in a new issue