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
5#include "get_intra_predictor.h"5#include "get_intra_predictor.h"
6#include "typedefs.h"6#include "typedefs.h"
7#include "ls_defines.h"7#include "ls_defines.h"
8#include "macros.h"
9
8using namespace WelsDec;10using namespace WelsDec;
9#define GENERATE_4x4_UT(pred, ref, ASM, CPUFLAGS) \11#define GENERATE_4x4_UT(pred, ref, ASM, CPUFLAGS) \
10 TEST(DecoderIntraPredictionTest, pred) { \12 TEST(DecoderIntraPredictionTest, pred) { \
11 const int32_t kiStride = 32; \13 const int32_t kiStride = 32; \
12 int32_t iRunTimes = 1000; \14 int32_t iRunTimes = 1000; \
13 uint8_t pPredBuffer[9 * kiStride]; \15 ENFORCE_STACK_ALIGN_1D (uint8_t, pPredBuffer, 12 * kiStride, 4); \
14 uint8_t pRefBuffer[9 * kiStride]; \16 ENFORCE_STACK_ALIGN_1D (uint8_t, pRefBuffer, 12 * kiStride, 4); \
15if (ASM) {\17if (ASM) {\
16 int32_t iNumberofCPUCore = 1; \18 int32_t iNumberofCPUCore = 1; \
17 uint32_t uiCPUFlags = WelsCPUFeatureDetect( &iNumberofCPUCore); \19 uint32_t uiCPUFlags = WelsCPUFeatureDetect( &iNumberofCPUCore); \
@@ -21,16 +23,16 @@ if (ASM) {\ · 3 unmodified lines
21}\23}\
22 srand((unsigned int)time(NULL)); \24 srand((unsigned int)time(NULL)); \
23 while(iRunTimes--) {\25 while(iRunTimes--) {\
24 for (int i = 0; i < 9; i++) {\26 for (int i = 0; i < 12; i++) {\
25 pRefBuffer[i] = pPredBuffer[i] = rand() & 255; \27 pRefBuffer[kiStride * 3 + i] = pPredBuffer[kiStride * 3 + i] = rand() & 255; \
26 pRefBuffer[i * kiStride] = pPredBuffer[i * kiStride] = rand() & 255; \28 pRefBuffer[i * kiStride + 3] = pPredBuffer[i * kiStride + 3] = rand() & 255; \
27 } \29 } \
28 pred (&pPredBuffer[kiStride + 1], kiStride); \30 pred (&pPredBuffer[kiStride * 4 + 4], kiStride); \
29 ref (&pRefBuffer[kiStride + 1], kiStride); \31 ref (&pRefBuffer[kiStride * 4 + 4], kiStride); \
30 bool ok = true; \32 bool ok = true; \
31 for (int i = 0; i < 4; i++) \33 for (int i = 0; i < 4; i++) \
32 for (int j = 0; j < 4; j++) \34 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]) { \
34 ok = false; \36 ok = false; \
35 break; \37 break; \
36 } \38 } \

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