History

Prevent misaligned warning in UT

huili2 committed 12 years ago

Commit 6d0c8961 parent 91cd93e1 file · +10 −8Browse files

Showing the changes to test/decoder/DecUT_IntraPrediction.cpp (1 of 1 file). Show all

Unified · Split

test/decoder/DecUT_IntraPrediction.cpp+10−8
@@ -5,13 +5,15 @@ · 4 unmodified lines
55 #include "get_intra_predictor.h"
66 #include "typedefs.h"
77 #include "ls_defines.h"
8+#include "macros.h"
9+
810 using namespace WelsDec;
911 #define GENERATE_4x4_UT(pred, ref, ASM, CPUFLAGS) \
1012 TEST(DecoderIntraPredictionTest, pred) { \
1113 const int32_t kiStride = 32; \
1214 int32_t iRunTimes = 1000; \
13− uint8_t pPredBuffer[9 * kiStride]; \
14− uint8_t pRefBuffer[9 * kiStride]; \
15+ ENFORCE_STACK_ALIGN_1D (uint8_t, pPredBuffer, 12 * kiStride, 4); \
16+ ENFORCE_STACK_ALIGN_1D (uint8_t, pRefBuffer, 12 * kiStride, 4); \
1517 if (ASM) {\
1618 int32_t iNumberofCPUCore = 1; \
1719 uint32_t uiCPUFlags = WelsCPUFeatureDetect( &iNumberofCPUCore); \
@@ -21,16 +23,16 @@ if (ASM) {\ · 3 unmodified lines
2123 }\
2224 srand((unsigned int)time(NULL)); \
2325 while(iRunTimes--) {\
24− for (int i = 0; i < 9; i++) {\
25− pRefBuffer[i] = pPredBuffer[i] = rand() & 255; \
26− pRefBuffer[i * kiStride] = pPredBuffer[i * kiStride] = rand() & 255; \
26+ for (int i = 0; i < 12; i++) {\
27+ pRefBuffer[kiStride * 3 + i] = pPredBuffer[kiStride * 3 + i] = rand() & 255; \
28+ pRefBuffer[i * kiStride + 3] = pPredBuffer[i * kiStride + 3] = rand() & 255; \
2729 } \
28− pred (&pPredBuffer[kiStride + 1], kiStride); \
29− ref (&pRefBuffer[kiStride + 1], kiStride); \
30+ pred (&pPredBuffer[kiStride * 4 + 4], kiStride); \
31+ ref (&pRefBuffer[kiStride * 4 + 4], kiStride); \
3032 bool ok = true; \
3133 for (int i = 0; i < 4; i++) \
3234 for (int j = 0; j < 4; j++) \
33− if (pPredBuffer[(i+1) * kiStride + j + 1] != pRefBuffer[(i+1) * kiStride + j + 1]) { \
35+ if (pPredBuffer[(i+4) * kiStride + j + 4] != pRefBuffer[(i+4) * kiStride + j + 4]) { \
3436 ok = false; \
3537 break; \
3638 } \

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