mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
audioconvert: fix x86 feature defines
This commit is contained in:
parent
52368091e3
commit
5025aa97e6
6 changed files with 17 additions and 13 deletions
|
|
@ -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 },
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 },
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue