Преглед на файлове

fix updateCoefs(..) wasn't updating other coefficient sets

While trying to find why assigning more than one set of coefficients for
AudioFilterBiquad results in no output I discovered my check for flag
before updating other than 1st set of coefficients was flawed so I fixed
it.

I also modified the way 'data' is assigned so the assignment only occurs
once per set of coefficients, possibly not the most efficient but I like
it better than my previous method.

These changes don't appear to effect the use of AudioFilterBiquad for a
single set of coefficients and, unfortunately, it doesn't make it start
working either - implementation of a second (or more than one) set of
coefficients still results in output being silenced but the update to
updateCoefs(..) is necessary so I am committing it.
dds
robsoles преди 11 години
родител
ревизия
80155c9020
променени са 1 файла, в които са добавени 3 реда и са изтрити 4 реда
  1. +3
    -4
      filter_biquad.cpp

+ 3
- 4
filter_biquad.cpp Целия файл

int32_t *state; int32_t *state;
block = receiveWritable(); block = receiveWritable();
if (!block) return; if (!block) return;
data = (uint32_t *)(block->data);
end = data + AUDIO_BLOCK_SAMPLES/2;
end = (uint32_t *)(block->data) + AUDIO_BLOCK_SAMPLES/2;
state = (int32_t *)definition; state = (int32_t *)definition;
do { do {
a0 = *state++; a0 = *state++;
aprev = *state++; aprev = *state++;
bprev = *state++; bprev = *state++;
sum = *state & 0x3FFF; sum = *state & 0x3FFF;
data = end - AUDIO_BLOCK_SAMPLES/2;
do { do {
in2 = *data; in2 = *data;
sum = signed_multiply_accumulate_32x16b(sum, a0, in2); sum = signed_multiply_accumulate_32x16b(sum, a0, in2);
*state++ = sum | flag; *state++ = sum | flag;
*(state-2) = bprev; *(state-2) = bprev;
*(state-3) = aprev; *(state-3) = aprev;
data = (uint32_t *)(block->data); // needs to be reset, may as well be done here
} while (flag); } while (flag);
transmit(block); transmit(block);
release(block); release(block);
while(set) while(set)
{ {
*dest+=7; *dest+=7;
if(!(*dest&0x80000000)) return;
if(!(*dest)&0x80000000) return;
*dest++; *dest++;
set--; set--;
} }

Loading…
Отказ
Запис