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 @@
11 #include <gtest/gtest.h>
22 #include "macros.h"
33 #include "decode_mb_aux.h"
4+#include "../../codec/decoder/core/src/decode_slice.cpp"
45 using namespace WelsDec;
56 void IdctResAddPred_ref (uint8_t* pPred, const int32_t kiStride, int16_t* pRs) {
67 int16_t iSrc[16];
@@ -39,6 +40,14 @@ void IdctResAddPred_ref (uint8_t* pPred, const int32_t kiStride, int16_t* pRs) { · 32 unmodified lines
3940 }
4041 }
4142
43+void 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+
4251 #define GENERATE_IDCTRESADDPRED(pred) \
4352 TEST(DecoderDecodeMbAux, pred) {\
4453 const int32_t kiStride = 32;\
@@ -79,3 +88,47 @@ GENERATE_IDCTRESADDPRED (IdctResAddPred_mmx) · 34 unmodified lines
7988 #if defined(HAVE_NEON)
8089 GENERATE_IDCTRESADDPRED (IdctResAddPred_neon)
8190 #endif
91+
92+#if defined(HAVE_NEON_AARCH64)
93+GENERATE_IDCTRESADDPRED (IdctResAddPred_AArch64_neon)
94+#endif
95+
96+#define GENERATE_SETNONZEROCOUNT(method) \
97+TEST(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+
126+GENERATE_SETNONZEROCOUNT (SetNonZeroCount_c)
127+
128+#if defined(HAVE_NEON)
129+GENERATE_SETNONZEROCOUNT (SetNonZeroCount_neon)
130+#endif
131+
132+#if defined(HAVE_NEON_AARCH64)
133+GENERATE_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