From 5025aa97e6ca6c08635dc0fb99753a4c8ba45563 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 17 Dec 2018 10:20:18 +0100 Subject: [PATCH] audioconvert: fix x86 feature defines --- spa/plugins/audioconvert/channelmix-ops.c | 11 ++++++----- spa/plugins/audioconvert/channelmix.c | 2 +- spa/plugins/audioconvert/fmt-ops.c | 11 +++++++---- spa/plugins/audioconvert/fmtconvert.c | 2 +- spa/plugins/audioconvert/merger.c | 2 +- spa/plugins/audioconvert/splitter.c | 2 +- 6 files changed, 17 insertions(+), 13 deletions(-) diff --git a/spa/plugins/audioconvert/channelmix-ops.c b/spa/plugins/audioconvert/channelmix-ops.c index 7c025a73d..6241aef17 100644 --- a/spa/plugins/audioconvert/channelmix-ops.c +++ b/spa/plugins/audioconvert/channelmix-ops.c @@ -424,10 +424,11 @@ static const struct channelmix_info { channelmix_func_t func; #define FEATURE_SSE (1<<0) +#define FEATURE_DEFAULT FEATURE_SSE uint32_t features; } channelmix_table[] = { -#if defined (__SSE2__) +#if defined (__SSE__) { 2, MASK_MONO, 2, MASK_MONO, channelmix_copy_sse, FEATURE_SSE }, { 2, MASK_STEREO, 2, MASK_STEREO, channelmix_copy_sse, FEATURE_SSE }, { -2, 0, -2, 0, channelmix_copy_sse, FEATURE_SSE }, @@ -438,22 +439,22 @@ static const struct channelmix_info { { 1, MASK_MONO, 2, MASK_STEREO, channelmix_f32_1_2, 0 }, { 2, MASK_STEREO, 1, MASK_MONO, channelmix_f32_2_1, 0 }, -#if defined (__SSE2__) +#if defined (__SSE__) { 2, MASK_STEREO, 4, MASK_QUAD, channelmix_f32_2_4_sse, FEATURE_SSE }, #endif { 2, MASK_STEREO, 4, MASK_QUAD, channelmix_f32_2_4, 0 }, { 2, MASK_STEREO, 4, MASK_3_1, channelmix_f32_2_3p1, 0 }, { 2, MASK_STEREO, 6, MASK_5_1, channelmix_f32_2_5p1, 0 }, -#if defined (__SSE2__) +#if defined (__SSE__) { 6, MASK_5_1, 2, MASK_STEREO, channelmix_f32_5p1_2_sse, FEATURE_SSE }, #endif { 6, MASK_5_1, 2, MASK_STEREO, channelmix_f32_5p1_2, 0 }, -#if defined (__SSE2__) +#if defined (__SSE__) { 6, MASK_5_1, 4, MASK_QUAD, channelmix_f32_5p1_4_sse, FEATURE_SSE }, #endif { 6, MASK_5_1, 4, MASK_QUAD, channelmix_f32_5p1_4, 0 }, -#if defined (__SSE2__) +#if defined (__SSE__) { 6, MASK_5_1, 4, MASK_3_1, channelmix_f32_5p1_3p1_sse, FEATURE_SSE }, #endif { 6, MASK_5_1, 4, MASK_3_1, channelmix_f32_5p1_3p1, 0 }, diff --git a/spa/plugins/audioconvert/channelmix.c b/spa/plugins/audioconvert/channelmix.c index 46e95dbf3..1c2e2ec30 100644 --- a/spa/plugins/audioconvert/channelmix.c +++ b/spa/plugins/audioconvert/channelmix.c @@ -430,7 +430,7 @@ static int setup_convert(struct impl *this, return -EINVAL; /* find convert function */ - if ((chanmix_info = find_channelmix_info(src_chan, src_mask, dst_chan, dst_mask, FEATURE_SSE)) == NULL) + if ((chanmix_info = find_channelmix_info(src_chan, src_mask, dst_chan, dst_mask, FEATURE_DEFAULT)) == NULL) return -ENOTSUP; spa_log_info(this->log, NAME " %p: got channelmix features %08x", this, chanmix_info->features); diff --git a/spa/plugins/audioconvert/fmt-ops.c b/spa/plugins/audioconvert/fmt-ops.c index 5b0cffa64..d1be443c4 100644 --- a/spa/plugins/audioconvert/fmt-ops.c +++ b/spa/plugins/audioconvert/fmt-ops.c @@ -670,6 +670,7 @@ interleave_32(void *data, int n_dst, void *dst[n_dst], int n_src, const void *sr } } + typedef void (*convert_func_t) (void *data, int n_dst, void *dst[n_dst], int n_src, const void *src[n_src], int n_samples); @@ -677,6 +678,8 @@ static const struct conv_info { uint32_t src_fmt; uint32_t dst_fmt; #define FEATURE_SSE (1<<0) +#define FEATURE_SSE2 (1<<1) +#define FEATURE_DEFAULT FEATURE_SSE uint32_t features; convert_func_t func; @@ -691,7 +694,7 @@ static const struct conv_info { { SPA_AUDIO_FORMAT_S16, SPA_AUDIO_FORMAT_F32, 0, conv_s16_to_f32 }, { SPA_AUDIO_FORMAT_S16P, SPA_AUDIO_FORMAT_F32P, 0, conv_s16_to_f32 }, -#if defined (__SSE2__) +#if defined (__SSE__) { SPA_AUDIO_FORMAT_S16, SPA_AUDIO_FORMAT_F32P, FEATURE_SSE, conv_s16_to_f32d_sse }, #endif { SPA_AUDIO_FORMAT_S16, SPA_AUDIO_FORMAT_F32P, 0, conv_s16_to_f32d }, @@ -709,7 +712,7 @@ static const struct conv_info { { SPA_AUDIO_FORMAT_S24, SPA_AUDIO_FORMAT_F32, 0, conv_s24_to_f32 }, { SPA_AUDIO_FORMAT_S24P, SPA_AUDIO_FORMAT_F32P, 0, conv_s24_to_f32 }, -#if defined (__SSE2__) +#if defined (__SSE__) { SPA_AUDIO_FORMAT_S24, SPA_AUDIO_FORMAT_F32P, FEATURE_SSE, conv_s24_to_f32d_sse }, #endif { SPA_AUDIO_FORMAT_S24, SPA_AUDIO_FORMAT_F32P, 0, conv_s24_to_f32d }, @@ -729,7 +732,7 @@ static const struct conv_info { { SPA_AUDIO_FORMAT_F32, SPA_AUDIO_FORMAT_S16, 0, conv_f32_to_s16 }, { SPA_AUDIO_FORMAT_F32P, SPA_AUDIO_FORMAT_S16P, 0, conv_f32_to_s16 }, { SPA_AUDIO_FORMAT_F32, SPA_AUDIO_FORMAT_S16P, 0, conv_f32_to_s16d }, -#if defined (__SSE2__) +#if defined (__SSE__) { SPA_AUDIO_FORMAT_F32P, SPA_AUDIO_FORMAT_S16, FEATURE_SSE, conv_f32d_to_s16_sse }, #endif { SPA_AUDIO_FORMAT_F32P, SPA_AUDIO_FORMAT_S16, 0, conv_f32d_to_s16 }, @@ -737,7 +740,7 @@ static const struct conv_info { { SPA_AUDIO_FORMAT_F32, SPA_AUDIO_FORMAT_S32, 0, conv_f32_to_s32 }, { SPA_AUDIO_FORMAT_F32P, SPA_AUDIO_FORMAT_S32P, 0, conv_f32_to_s32 }, { SPA_AUDIO_FORMAT_F32, SPA_AUDIO_FORMAT_S32P, 0, conv_f32_to_s32d }, -#if defined (__SSE2__) +#if defined (__SSE__) { SPA_AUDIO_FORMAT_F32P, SPA_AUDIO_FORMAT_S32, FEATURE_SSE, conv_f32d_to_s32_sse }, #endif { SPA_AUDIO_FORMAT_F32P, SPA_AUDIO_FORMAT_S32, 0, conv_f32d_to_s32 }, diff --git a/spa/plugins/audioconvert/fmtconvert.c b/spa/plugins/audioconvert/fmtconvert.c index 411de0de5..cd3193869 100644 --- a/spa/plugins/audioconvert/fmtconvert.c +++ b/spa/plugins/audioconvert/fmtconvert.c @@ -173,7 +173,7 @@ static int setup_convert(struct impl *this) } /* find fast path */ - conv = find_conv_info(src_fmt, dst_fmt, FEATURE_SSE); + conv = find_conv_info(src_fmt, dst_fmt, FEATURE_DEFAULT); if (conv == NULL) return -ENOTSUP; diff --git a/spa/plugins/audioconvert/merger.c b/spa/plugins/audioconvert/merger.c index 616ed3227..48db7ac77 100644 --- a/spa/plugins/audioconvert/merger.c +++ b/spa/plugins/audioconvert/merger.c @@ -576,7 +576,7 @@ static int setup_convert(struct impl *this) outport->format.info.raw.channels, outport->format.info.raw.rate); - conv = find_conv_info(src_fmt, dst_fmt, FEATURE_SSE); + conv = find_conv_info(src_fmt, dst_fmt, FEATURE_DEFAULT); if (conv != NULL) { spa_log_info(this->log, NAME " %p: got converter features %08x", this, conv->features); diff --git a/spa/plugins/audioconvert/splitter.c b/spa/plugins/audioconvert/splitter.c index 0749744e5..54c539856 100644 --- a/spa/plugins/audioconvert/splitter.c +++ b/spa/plugins/audioconvert/splitter.c @@ -569,7 +569,7 @@ static int setup_convert(struct impl *this) inport->format.info.raw.rate, this->port_count); - conv = find_conv_info(src_fmt, dst_fmt, FEATURE_SSE); + conv = find_conv_info(src_fmt, dst_fmt, FEATURE_DEFAULT); if (conv != NULL) { spa_log_info(this->log, NAME " %p: got converter features %08x", this, conv->features);