mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
channelmix: add option to filter FC
Add an option to do a lowpass filter on the FC channel to isolate the voices better and move the higher frequencies to the stereo channels. See #861
This commit is contained in:
parent
5b3388e4ac
commit
23db50630d
7 changed files with 26 additions and 4 deletions
|
|
@ -456,8 +456,11 @@ done:
|
|||
}
|
||||
maxsum = SPA_MAX(maxsum, sum);
|
||||
if (i == _CH(LFE) && mix->lfe_cutoff > 0.0f) {
|
||||
spa_log_debug(mix->log, "channel %d is LFE", ic);
|
||||
spa_log_debug(mix->log, "channel %d is LFE cutoff:%f", ic, mix->lfe_cutoff);
|
||||
lr4_set(&mix->lr4[ic], BQ_LOWPASS, mix->lfe_cutoff / mix->freq);
|
||||
} else if (i == _CH(FC) && mix->fc_cutoff > 0.0f) {
|
||||
spa_log_debug(mix->log, "channel %d is FC cutoff:%f", ic, mix->fc_cutoff);
|
||||
lr4_set(&mix->lr4[ic], BQ_LOWPASS, mix->fc_cutoff / mix->freq);
|
||||
} else {
|
||||
mix->lr4[ic].active = false;
|
||||
}
|
||||
|
|
@ -556,7 +559,7 @@ int channelmix_init(struct channelmix *mix)
|
|||
mix->options);
|
||||
|
||||
if (mix->hilbert_taps > 0) {
|
||||
mix->n_taps = SPA_CLAMP(mix->hilbert_taps, 15, 255) | 1;
|
||||
mix->n_taps = SPA_CLAMP(mix->hilbert_taps, 15u, 255u) | 1;
|
||||
blackman_window(mix->taps, mix->n_taps);
|
||||
hilbert_generate(mix->taps, mix->n_taps);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue