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:
Wim Taymans 2019-03-29 17:39:59 +01:00
parent d47353c0e6
commit d8e399dee9
17 changed files with 952 additions and 685 deletions

View file

@ -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();