History

Add checks for cpu features in tests

This allows running the tests on devices that don't have all the SIMD instruction sets.

Martin Storsjö committed 11 years ago

Commit acafbb41 parent 7f967f63 files · +97 −73Browse files

Showing the changes to test/processing/ProcessUT_AdaptiveQuantization.cpp (1 of 3 files). Show all

Unified · Split

test/processing/ProcessUT_AdaptiveQuantization.cpp+8−5
@@ -42,8 +42,11 @@ void SampleVariance16x16_ref (uint8_t* pRefY, int32_t iRefStride, uint8_t* pSrcY · 41 unmodified lines
42 pMotionTexture->uiTextureIndex = (uiCurSquare >> 8) - (uiCurSum * uiCurSum);42 pMotionTexture->uiTextureIndex = (uiCurSquare >> 8) - (uiCurSum * uiCurSum);
43}43}
44 44
45#define GENERATE_AQTEST(method) \45#define GENERATE_AQTEST(method, flag) \
46TEST (AdaptiveQuantization, method) {\46TEST (AdaptiveQuantization, method) {\
47 uint32_t uiCPUFlags = WelsCPUFeatureDetect(NULL); \
48 if ((uiCPUFlags & flag) == 0 && flag != 0) \
49 return; \
47 ENFORCE_STACK_ALIGN_1D (uint8_t, pRefY,32*16,16)\50 ENFORCE_STACK_ALIGN_1D (uint8_t, pRefY,32*16,16)\
48 ENFORCE_STACK_ALIGN_1D (uint8_t, pSrcY,48*16,16)\51 ENFORCE_STACK_ALIGN_1D (uint8_t, pSrcY,48*16,16)\
49 SMotionTextureUnit pMotionTexture[2];\52 SMotionTextureUnit pMotionTexture[2];\
@@ -61,16 +64,16 @@ TEST (AdaptiveQuantization, method) {\ · 11 unmodified lines
61 ASSERT_EQ(pMotionTexture[0].uiMotionIndex,pMotionTexture[1].uiMotionIndex);\64 ASSERT_EQ(pMotionTexture[0].uiMotionIndex,pMotionTexture[1].uiMotionIndex);\
62}65}
63 66
64GENERATE_AQTEST (SampleVariance16x16_c)67GENERATE_AQTEST (SampleVariance16x16_c, 0)
65#if defined(X86_ASM)68#if defined(X86_ASM)
66GENERATE_AQTEST (SampleVariance16x16_sse2)69GENERATE_AQTEST (SampleVariance16x16_sse2, WELS_CPU_SSE2)
67#endif70#endif
68 71
69#if defined(HAVE_NEON)72#if defined(HAVE_NEON)
70GENERATE_AQTEST (SampleVariance16x16_neon)73GENERATE_AQTEST (SampleVariance16x16_neon, WELS_CPU_NEON)
71#endif74#endif
72 75
73#if defined(HAVE_NEON_AARCH64)76#if defined(HAVE_NEON_AARCH64)
74GENERATE_AQTEST (SampleVariance16x16_AArch64_neon)77GENERATE_AQTEST (SampleVariance16x16_AArch64_neon, WELS_CPU_NEON)
75#endif78#endif
76 79

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t