Optimize mixer using XOR

Signed-off-by: Jan Hamal Dvořák <mordae@anilinux.org>
This commit is contained in:
Jan Hamal Dvořák 2024-01-27 12:57:19 +01:00
parent 8ca3a3d2bf
commit d19d4ebc87

View file

@ -486,8 +486,8 @@ static void rf_rx(void)
pos = (pos + 1) & (LO_WORDS - 1);
#if SPEED == 3
I += popcount(rx_word & cos_word) - popcount(rx_word & ~cos_word);
Q += popcount(rx_word & sin_word) - popcount(rx_word & ~sin_word);
I += popcount(rx_word ^ cos_word);
Q += popcount(rx_word ^ sin_word);
#elif SPEED == 2
interp0->accum[0] = rx_word;
interp0->accum[1] = rx_word;
@ -546,6 +546,9 @@ static void rf_rx(void)
#endif
}
I -= 16 * NUM_SAMPLES;
Q -= 16 * NUM_SAMPLES;
#if EXTRA_BITS
I <<= EXTRA_BITS;
Q <<= EXTRA_BITS;