History

Add Unit Test and ARM64 code for block_add

HFVideoMac committed 12 years ago

Commit 0d1699b1 parent 9ac7cd29 files · +241 −1Browse files

Showing the changes to test/decoder/DecUT_IdctResAddPred.cpp (1 of 9 files). Show all

Unified · Split

test/decoder/DecUT_IdctResAddPred.cpp+53−0
@@ -1,6 +1,7 @@
1#include <gtest/gtest.h>1#include <gtest/gtest.h>
2#include "macros.h"2#include "macros.h"
3#include "decode_mb_aux.h"3#include "decode_mb_aux.h"
4#include "../../codec/decoder/core/src/decode_slice.cpp"
4using namespace WelsDec;5using namespace WelsDec;
5void IdctResAddPred_ref (uint8_t* pPred, const int32_t kiStride, int16_t* pRs) {6void IdctResAddPred_ref (uint8_t* pPred, const int32_t kiStride, int16_t* pRs) {
6 int16_t iSrc[16];7 int16_t iSrc[16];
@@ -39,6 +40,14 @@ void IdctResAddPred_ref (uint8_t* pPred, const int32_t kiStride, int16_t* pRs) { · 32 unmodified lines
39 }40 }
40}41}
41 42
43void SetNonZeroCount_ref (int8_t* pNonZeroCount) {
44 int32_t i;
45
46 for (i = 0; i < 24; i++) {
47 pNonZeroCount[i] = !!pNonZeroCount[i];
48 }
49}
50
42#define GENERATE_IDCTRESADDPRED(pred) \51#define GENERATE_IDCTRESADDPRED(pred) \
43TEST(DecoderDecodeMbAux, pred) {\52TEST(DecoderDecodeMbAux, pred) {\
44 const int32_t kiStride = 32;\53 const int32_t kiStride = 32;\
@@ -79,3 +88,47 @@ GENERATE_IDCTRESADDPRED (IdctResAddPred_mmx) · 34 unmodified lines
79#if defined(HAVE_NEON)88#if defined(HAVE_NEON)
80GENERATE_IDCTRESADDPRED (IdctResAddPred_neon)89GENERATE_IDCTRESADDPRED (IdctResAddPred_neon)
81#endif90#endif
91
92#if defined(HAVE_NEON_AARCH64)
93GENERATE_IDCTRESADDPRED (IdctResAddPred_AArch64_neon)
94#endif
95
96#define GENERATE_SETNONZEROCOUNT(method) \
97TEST(DecoderDecodeMbAux, method) \
98{\
99 int8_t iNonZeroCount[2][24];\
100 for(int32_t i = 0; i < 24; i++) {\
101 iNonZeroCount[0][i] = iNonZeroCount[1][i] = (rand() % 256)-128;\
102 }\
103 method(iNonZeroCount[0]);\
104 SetNonZeroCount_ref(iNonZeroCount[1]);\
105 for(int32_t i =0; i<24; i++) {\
106 ASSERT_EQ (iNonZeroCount[0][i], iNonZeroCount[1][i]);\
107 }\
108 for(int32_t i =0; i<24; i++) {\
109 iNonZeroCount[0][i] = iNonZeroCount[1][i] = -128;\
110 }\
111 method(iNonZeroCount[0]);\
112 SetNonZeroCount_ref(iNonZeroCount[1]);\
113 for(int32_t i =0; i<24; i++) {\
114 ASSERT_EQ (iNonZeroCount[0][i], iNonZeroCount[1][i]);\
115 }\
116 for(int32_t i =0; i<24; i++) {\
117 iNonZeroCount[0][i] = iNonZeroCount[1][i] = 127;\
118 }\
119 method(iNonZeroCount[0]);\
120 SetNonZeroCount_ref(iNonZeroCount[1]);\
121 for(int32_t i =0; i<24; i++) {\
122 ASSERT_EQ (iNonZeroCount[0][i], iNonZeroCount[1][i]);\
123 }\
124}
125
126GENERATE_SETNONZEROCOUNT (SetNonZeroCount_c)
127
128#if defined(HAVE_NEON)
129GENERATE_SETNONZEROCOUNT (SetNonZeroCount_neon)
130#endif
131
132#if defined(HAVE_NEON_AARCH64)
133GENERATE_SETNONZEROCOUNT (SetNonZeroCount_AArch64_neon)
134#endif

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