Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

dsp: Optimize fractional multiplication in audio processing

Removed duplicated multiplications

Change-Id: Iafe1030cd96f16664d6b136ebbe429313b6e6448

+9 -6
+9 -6
lib/rbcodec/dsp/pbe.c
··· 159 159 { 160 160 for (int i = 0; i < count; i++) 161 161 { 162 + int32_t fracmul1 = FRACMUL(buf->p32[ch][i], tcoef1); 163 + int32_t fracmul2 = FRACMUL(buf->p32[ch][i], tcoef2); 162 164 /* 160hz - 500hz no delay */ 163 - temp_buffer = FRACMUL(buf->p32[ch][i], tcoef1) - 164 - FRACMUL(buf->p32[ch][i], tcoef2); 165 + temp_buffer = fracmul1 - 166 + fracmul2; 165 167 166 168 /* delay below 160hz*/ 167 169 x = buf->p32[ch][i] - 168 - FRACMUL(buf->p32[ch][i], tcoef1); 170 + fracmul1; 169 171 temp_buffer += dequeue(b0[ch], &b0_r[ch], b0_level); 170 172 enqueue(x, b0[ch], &b0_w[ch], b0_level ); 171 173 174 + int32_t fracmul3 = FRACMUL(buf->p32[ch][i], tcoef3); 172 175 /* delay 500-1150hz */ 173 - x = FRACMUL(buf->p32[ch][i], tcoef2) - 174 - FRACMUL(buf->p32[ch][i], tcoef3); 176 + x = fracmul2 - 177 + fracmul3; 175 178 temp_buffer += dequeue(b2[ch], &b2_r[ch], b2_level); 176 179 enqueue(x, b2[ch], &b2_w[ch], b2_level ); 177 180 178 181 /* delay anything beyond 1150hz */ 179 - x = FRACMUL(buf->p32[ch][i], tcoef3); 182 + x = fracmul3; 180 183 temp_buffer += dequeue(b3[ch], &b3_r[ch], B3_DLY); 181 184 enqueue(x, b3[ch], &b3_w[ch], B3_DLY ); 182 185