[pulseaudio-discuss] [PATCH] modules: Allow bluetooth SBC to disable SIMD optimizations with PULSE_NO_SIMD

Peter Meerwald pmeerw at pmeerw.net
Mon Jul 9 09:01:33 PDT 2012


From: Peter Meerwald <p.meerwald at bct-electronic.com>

allow to disable SIMD optimizations with PULSE_NO_SIMD;
to give a consistent meaning to that environment variable

Signed-off-by: Peter Meerwald <p.meerwald at bct-electronic.com>
---
 src/modules/bluetooth/sbc/sbc_primitives.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/modules/bluetooth/sbc/sbc_primitives.c b/src/modules/bluetooth/sbc/sbc_primitives.c
index ad780d0..9fc375c 100644
--- a/src/modules/bluetooth/sbc/sbc_primitives.c
+++ b/src/modules/bluetooth/sbc/sbc_primitives.c
@@ -27,6 +27,7 @@
 #include <stdint.h>
 #include <limits.h>
 #include <string.h>
+#include <stdlib.h>
 #include "sbc.h"
 #include "sbc_math.h"
 #include "sbc_tables.h"
@@ -536,19 +537,22 @@ void sbc_init_primitives(struct sbc_encoder_state *state)
 	state->sbc_calc_scalefactors_j = sbc_calc_scalefactors_j;
 	state->implementation_info = "Generic C";
 
+	if (!getenv("PULSE_NO_SIMD")) {
+
 	/* X86/AMD64 optimizations */
 #ifdef SBC_BUILD_WITH_MMX_SUPPORT
-	sbc_init_primitives_mmx(state);
+		sbc_init_primitives_mmx(state);
 #endif
 
 	/* ARM optimizations */
 #ifdef SBC_BUILD_WITH_ARMV6_SUPPORT
-	sbc_init_primitives_armv6(state);
+		sbc_init_primitives_armv6(state);
 #endif
 #ifdef SBC_BUILD_WITH_IWMMXT_SUPPORT
-	sbc_init_primitives_iwmmxt(state);
+		sbc_init_primitives_iwmmxt(state);
 #endif
 #ifdef SBC_BUILD_WITH_NEON_SUPPORT
-	sbc_init_primitives_neon(state);
+		sbc_init_primitives_neon(state);
 #endif
+	}
 }
-- 
1.7.5.4



More information about the pulseaudio-discuss mailing list