mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-10-14 20:02:38 +00:00
audioconvert: run lr4 on tagged channels in generic case
Mark the LFE channels and run the lowpass filter on them in the generic case. Generates LFE correctly in 2.1 upmix case. See #1095
This commit is contained in:
parent
71824d0b03
commit
5724093343
|
@ -78,6 +78,10 @@ channelmix_f32_n_m_c(struct channelmix *mix, uint32_t n_dst, void * SPA_RESTRICT
|
|||
d[i][n] = sum;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < n_dst; i++) {
|
||||
if (mix->lr4_info[i] > 0)
|
||||
lr4_process(&mix->lr4[i], d[i], n_samples);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -423,10 +423,15 @@ done:
|
|||
continue;
|
||||
mix->matrix_orig[ic][jc++] = matrix[i][j];
|
||||
sum += fabs(matrix[i][j]);
|
||||
if (i == _CH(LFE))
|
||||
lr4_set(&mix->lr4[ic], BQ_LOWPASS, mix->lfe_cutoff / mix->freq);
|
||||
}
|
||||
maxsum = SPA_MAX(maxsum, sum);
|
||||
if (i == _CH(LFE)) {
|
||||
spa_log_debug(mix->log, "channel %d is LFE", ic);
|
||||
lr4_set(&mix->lr4[ic], BQ_LOWPASS, mix->lfe_cutoff / mix->freq);
|
||||
mix->lr4_info[ic] = 1;
|
||||
} else {
|
||||
mix->lr4_info[ic] = 0;
|
||||
}
|
||||
ic++;
|
||||
}
|
||||
if (SPA_FLAG_IS_SET(mix->options, CHANNELMIX_OPTION_NORMALIZE) &&
|
||||
|
|
|
@ -65,6 +65,7 @@ struct channelmix {
|
|||
|
||||
float freq; /* sample frequency */
|
||||
float lfe_cutoff; /* in Hz, 0 is disabled */
|
||||
uint32_t lr4_info[SPA_AUDIO_MAX_CHANNELS];
|
||||
struct lr4 lr4[SPA_AUDIO_MAX_CHANNELS];
|
||||
|
||||
void (*process) (struct channelmix *mix, uint32_t n_dst, void * SPA_RESTRICT dst[n_dst],
|
||||
|
|
Loading…
Reference in a new issue