audioflinger: Enable ARMv5TE optimized resampler

Previously, the optimized asm option is only enabled when
__ARM_ARCH_5E__ is defined, which is assigned in armv5te.mk
rather than armv7-a series targets.  This patch checks the ARM CPU
feature about half-word multiply instructions to enable ARMv5TE
resampler optimization routines properly.

Change-Id: I4c5a5d8c932416f23bedb0b389db958349f21ea4
This commit is contained in:
Jim Huang
2011-04-06 14:19:29 +08:00
committed by Jim Huang
parent 9907d16158
commit 592a6d9768

View File

@@ -26,11 +26,15 @@
#include "AudioResamplerSinc.h"
#include "AudioResamplerCubic.h"
#ifdef __arm__
#include <machine/cpu-features.h>
#endif
namespace android {
#ifdef __ARM_ARCH_5E__ // optimized asm option
#ifdef __ARM_HAVE_HALFWORD_MULTIPLY // optimized asm option
#define ASM_ARM_RESAMP1 // enable asm optimisation for ResamplerOrder1
#endif // __ARM_ARCH_5E__
#endif // __ARM_HAVE_HALFWORD_MULTIPLY
// ----------------------------------------------------------------------------
class AudioResamplerOrder1 : public AudioResampler {