mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
audioconvert: add optional hilbert transform to rear channels
Add an option to do a hilbert transform on the generated rear channels to do a 90 degree pahse shift on them. This can improve spacialization of the rear channels. See #861
This commit is contained in:
parent
5dd0a12875
commit
5b3388e4ac
9 changed files with 121 additions and 17 deletions
|
|
@ -35,6 +35,7 @@
|
|||
#define VOLUME_NORM 1.0f
|
||||
|
||||
#include "channelmix-ops.h"
|
||||
#include "hilbert.h"
|
||||
|
||||
#undef SPA_LOG_TOPIC_DEFAULT
|
||||
#define SPA_LOG_TOPIC_DEFAULT log_topic
|
||||
|
|
@ -469,6 +470,7 @@ done:
|
|||
for (j = 0; j < jc; j++)
|
||||
mix->matrix_orig[i][j] /= maxsum;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -550,7 +552,16 @@ int channelmix_init(struct channelmix *mix)
|
|||
mix->cpu_flags = info->cpu_flags;
|
||||
mix->delay = mix->rear_delay * mix->freq / 1000.0f;
|
||||
|
||||
spa_log_debug(mix->log, "selected %s delay:%d", info->name, mix->delay);
|
||||
spa_log_debug(mix->log, "selected %s delay:%d options:%08x", info->name, mix->delay,
|
||||
mix->options);
|
||||
|
||||
if (mix->hilbert_taps > 0) {
|
||||
mix->n_taps = SPA_CLAMP(mix->hilbert_taps, 15, 255) | 1;
|
||||
blackman_window(mix->taps, mix->n_taps);
|
||||
hilbert_generate(mix->taps, mix->n_taps);
|
||||
} else {
|
||||
mix->n_taps = 1;
|
||||
mix->taps[0] = 1.0f;
|
||||
}
|
||||
return make_matrix(mix);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue