mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
audioconvert: pass state to functions
Pass some state to convert and channelmix functions. This makes it possible to select per channel optimized convert functions but also makes it possible to implement noise shaping later. Pass the channelmix matrix and volume in the state. Handle specialized 2 channel s16 -> f32 conversion
This commit is contained in:
parent
d47353c0e6
commit
d8e399dee9
17 changed files with 952 additions and 685 deletions
|
|
@ -63,6 +63,9 @@ static void run_test1(const char *name, const char *impl, bool in_packed, bool o
|
|||
void *op[n_channels];
|
||||
struct timespec ts;
|
||||
uint64_t count, t1, t2;
|
||||
struct convert conv;
|
||||
|
||||
conv.n_channels = n_channels;
|
||||
|
||||
for (j = 0; j < n_channels; j++) {
|
||||
ip[j] = &samp_in[j * n_samples * 4];
|
||||
|
|
@ -74,7 +77,7 @@ static void run_test1(const char *name, const char *impl, bool in_packed, bool o
|
|||
|
||||
count = 0;
|
||||
for (i = 0; i < MAX_COUNT; i++) {
|
||||
func(NULL, op, ip, n_channels, n_samples);
|
||||
func(&conv, op, ip, n_samples);
|
||||
count++;
|
||||
}
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
|
|
@ -223,8 +226,6 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
uint32_t i;
|
||||
|
||||
find_conv_info(0, 0, 0);
|
||||
|
||||
test_f32_u8();
|
||||
test_u8_f32();
|
||||
test_f32_s16();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue