rtl_sdr_fm: consume HB cascade output in-place to avoid the final memcpy. Track the current buffer and assign lowpassed to the last stage’s output, preserving correctness while reducing memory traffic.

This commit is contained in:
arancormonk
2025-09-03 22:38:50 -04:00
parent 106aae1814
commit 8b4fa81711

View File

@@ -1608,10 +1608,8 @@ void full_demod(struct demod_state *d)
in_len = out_len_interleaved;
dst = (src == d->hb_workbuf) ? d->lowpassed : d->hb_workbuf;
}
/* Final output resides in 'src' with length in_len */
if (d->lowpassed != src) {
memcpy(d->lowpassed, src, (size_t)in_len * sizeof(int16_t));
}
/* Final output resides in 'src' with length in_len; consume in-place (no copy) */
d->lowpassed = src;
d->lp_len = in_len;
/* No droop compensation for half-band cascade */
} else {