channelmix: normalize volumes

Normalize the volumes.
Don't mix in LFE by default but add an option
Move some booleans to flags
Improve some checks for fastpaths.
This commit is contained in:
Wim Taymans 2020-09-03 13:20:36 +02:00
parent 289a8e86ca
commit f7d8fef070
5 changed files with 89 additions and 81 deletions

View file

@ -256,11 +256,11 @@ static int setup_convert(struct impl *this,
emit_params_changed(this);
spa_log_debug(this->log, NAME " %p: got channelmix features %08x:%08x identity:%d",
spa_log_debug(this->log, NAME " %p: got channelmix features %08x:%08x flags:%08x",
this, this->cpu_flags, this->mix.cpu_flags,
this->mix.identity);
this->mix.flags);
this->is_passthrough = this->mix.identity;
this->is_passthrough = SPA_FLAG_IS_SET(this->mix.flags, CHANNELMIX_FLAG_IDENTITY);
return 0;
}
@ -1057,7 +1057,9 @@ static int impl_node_process(void *object)
void *dst_datas[n_dst_datas];
bool is_passthrough;
is_passthrough = this->is_passthrough && this->mix.identity && ctrlport->ctrl == NULL;
is_passthrough = this->is_passthrough &&
SPA_FLAG_IS_SET(this->mix.flags, CHANNELMIX_FLAG_IDENTITY) &&
ctrlport->ctrl == NULL;
n_samples = sb->datas[0].chunk->size / inport->stride;