Showing the changes to test/decoder/DecUT_IdctResAddPred.cpp (1 of 9 files). Show all
Unified · Split
| @@ -1,6 +1,7 @@ | ||
| 1 | 1 | #include <gtest/gtest.h> |
| 2 | 2 | #include "macros.h" |
| 3 | 3 | #include "decode_mb_aux.h" |
| 4 | +#include "../../codec/decoder/core/src/decode_slice.cpp" | |
| 4 | 5 | using namespace WelsDec; |
| 5 | 6 | void IdctResAddPred_ref (uint8_t* pPred, const int32_t kiStride, int16_t* pRs) { |
| 6 | 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 | |
| 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 | + | |
| 42 | 51 | #define GENERATE_IDCTRESADDPRED(pred) \ |
| 43 | 52 | TEST(DecoderDecodeMbAux, pred) {\ |
| 44 | 53 | const int32_t kiStride = 32;\ |
| @@ -79,3 +88,47 @@ GENERATE_IDCTRESADDPRED (IdctResAddPred_mmx) · 34 unmodified lines | ||
| 79 | 88 | #if defined(HAVE_NEON) |
| 80 | 89 | GENERATE_IDCTRESADDPRED (IdctResAddPred_neon) |
| 81 | 90 | #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 | |