audioconvert: expose the selected function names

And debug them.
This commit is contained in:
Wim Taymans 2022-06-28 16:45:07 +02:00
parent 048e10ee3b
commit 51f4f1fb69
8 changed files with 77 additions and 48 deletions

View file

@ -124,27 +124,27 @@ MAKE_RESAMPLER_COPY(c);
MAKE_RESAMPLER_FULL(c);
MAKE_RESAMPLER_INTER(c);
#define MAKE(fmt,copy,full,inter,...) \
{ SPA_AUDIO_FORMAT_ ##fmt, do_resample_ ##copy, #copy, \
do_resample_ ##full, #full, do_resample_ ##inter, #inter, __VA_ARGS__ }
static struct resample_info resample_table[] =
{
#if defined (HAVE_NEON)
{ SPA_AUDIO_FORMAT_F32, SPA_CPU_FLAG_NEON,
do_resample_copy_c, do_resample_full_neon, do_resample_inter_neon },
MAKE(F32, copy_c, full_neon, inter_neon, SPA_CPU_FLAG_NEON),
#endif
#if defined(HAVE_AVX) && defined(HAVE_FMA)
{ SPA_AUDIO_FORMAT_F32, SPA_CPU_FLAG_AVX | SPA_CPU_FLAG_FMA3,
do_resample_copy_c, do_resample_full_avx, do_resample_inter_avx },
MAKE(F32, copy_c, full_avx, inter_avx, SPA_CPU_FLAG_AVX | SPA_CPU_FLAG_FMA3),
#endif
#if defined (HAVE_SSSE3)
{ SPA_AUDIO_FORMAT_F32, SPA_CPU_FLAG_SSSE3 | SPA_CPU_FLAG_SLOW_UNALIGNED,
do_resample_copy_c, do_resample_full_ssse3, do_resample_inter_ssse3 },
MAKE(F32, copy_c, full_ssse3, inter_ssse3, SPA_CPU_FLAG_SSSE3 | SPA_CPU_FLAG_SLOW_UNALIGNED),
#endif
#if defined (HAVE_SSE)
{ SPA_AUDIO_FORMAT_F32, SPA_CPU_FLAG_SSE,
do_resample_copy_c, do_resample_full_sse, do_resample_inter_sse },
MAKE(F32, copy_c, full_sse, inter_sse, SPA_CPU_FLAG_SSE),
#endif
{ SPA_AUDIO_FORMAT_F32, 0,
do_resample_copy_c, do_resample_full_c, do_resample_inter_c },
MAKE(F32, copy_c, full_c, inter_c),
};
#undef MAKE
#define MATCH_CPU_FLAGS(a,b) ((a) == 0 || ((a) & (b)) == a)
static const struct resample_info *find_resample_info(uint32_t format, uint32_t cpu_flags)
@ -200,12 +200,18 @@ static void impl_native_update_rate(struct resample *r, double rate)
data->inc = data->in_rate / data->out_rate;
data->frac = data->in_rate % data->out_rate;
if (data->in_rate == data->out_rate)
if (data->in_rate == data->out_rate) {
data->func = data->info->process_copy;
else if (rate == 1.0)
r->func_name = data->info->copy_name;
}
else if (rate == 1.0) {
data->func = data->info->process_full;
else
r->func_name = data->info->full_name;
}
else {
data->func = data->info->process_inter;
r->func_name = data->info->inter_name;
}
spa_log_trace_fp(r->log, "native %p: rate:%f in:%d out:%d phase:%d inc:%d frac:%d", r,
rate, data->in_rate, data->out_rate, data->phase, data->inc, data->frac);