|
|
|
|
|
|
|
|
// do passthru |
|
|
// do passthru |
|
|
if(coeff_p == FIR_PASSTHRU) { |
|
|
if(coeff_p == FIR_PASSTHRU) { |
|
|
// Just passthrough |
|
|
// Just passthrough |
|
|
block = receiveWritable(0); |
|
|
|
|
|
|
|
|
block = receiveReadOnly(0); |
|
|
if(block) { |
|
|
if(block) { |
|
|
transmit(block,0); |
|
|
transmit(block,0); |
|
|
release(block); |
|
|
release(block); |
|
|
} |
|
|
} |
|
|
block = receiveWritable(1); |
|
|
|
|
|
|
|
|
block = receiveReadOnly(1); |
|
|
if(block) { |
|
|
if(block) { |
|
|
transmit(block,1); |
|
|
transmit(block,1); |
|
|
release(block); |
|
|
release(block); |
|
|
|
|
|
|
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
// Left Channel |
|
|
// Left Channel |
|
|
block = receiveWritable(0); |
|
|
|
|
|
|
|
|
block = receiveReadOnly(0); |
|
|
// get a block for the FIR output |
|
|
// get a block for the FIR output |
|
|
b_new = allocate(); |
|
|
b_new = allocate(); |
|
|
if(block && b_new) { |
|
|
if(block && b_new) { |
|
|
|
|
|
|
|
|
if(b_new)release(b_new); |
|
|
if(b_new)release(b_new); |
|
|
|
|
|
|
|
|
// Right Channel |
|
|
// Right Channel |
|
|
block = receiveWritable(1); |
|
|
|
|
|
|
|
|
block = receiveReadOnly(1); |
|
|
b_new = allocate(); |
|
|
b_new = allocate(); |
|
|
if(block && b_new) { |
|
|
if(block && b_new) { |
|
|
arm_fir_q15(&r_fir_inst, (q15_t *)block->data, (q15_t *)b_new->data, AUDIO_BLOCK_SAMPLES); |
|
|
arm_fir_q15(&r_fir_inst, (q15_t *)block->data, (q15_t *)b_new->data, AUDIO_BLOCK_SAMPLES); |