Add dct_mmi.c, quant_mmi.c and score_mmi.c in codec/encoder/core/mips
Showing the changes to test/encoder/EncUT_DecodeMbAux.cpp (1 of 13 files). Show all
Unified · Split
| @@ -246,6 +246,11 @@ TEST (DecodeMbAuxTest, WelsIDctT4Rec_avx2) { · 245 unmodified lines | ||
| 246 | 246 | } |
| 247 | 247 | #endif |
| 248 | 248 | #endif |
| 249 | +#if defined(HAVE_MMI) | |
| 250 | +TEST (DecodeMbAuxTest, WelsIDctT4Rec_mmi) { | |
| 251 | + TestIDctT4Rec<int16_t> (WelsIDctT4Rec_mmi); | |
| 252 | +} | |
| 253 | +#endif | |
| 249 | 254 | template<typename clip_t> |
| 250 | 255 | void WelsIDctT8Anchor (uint8_t* p_dst, int16_t dct[4][16]) { |
| 251 | 256 | WelsIDctT4Anchor<clip_t> (&p_dst[0], dct[0]); |
| @@ -380,3 +385,39 @@ TEST (DecodeMbAuxTest, WelsIDctRecI16x16Dc_sse2) { · 128 unmodified lines | ||
| 380 | 385 | } |
| 381 | 386 | } |
| 382 | 387 | #endif |
| 388 | +#if defined(HAVE_MMI) | |
| 389 | +TEST (DecodeMbAuxTest, WelsIDctFourT4Rec_mmi) { | |
| 390 | + TestIDctFourT4Rec<int16_t> (WelsIDctFourT4Rec_mmi); | |
| 391 | +} | |
| 392 | +TEST (DecodeMbAuxTest, WelsIDctRecI16x16Dc_mmi) { | |
| 393 | + int32_t iCpuCores = 0; | |
| 394 | + uint32_t uiCpuFeatureFlag = WelsCPUFeatureDetect (&iCpuCores); | |
| 395 | + | |
| 396 | + if (uiCpuFeatureFlag & WELS_CPU_MMI) { | |
| 397 | + uint8_t iRefDst[16 * FDEC_STRIDE]; | |
| 398 | + int16_t iRefDct[4][4]; | |
| 399 | + ENFORCE_STACK_ALIGN_1D (int16_t, iDct, 16, 16); | |
| 400 | + ENFORCE_STACK_ALIGN_1D (uint8_t, iPred, 16 * FDEC_STRIDE, 16); | |
| 401 | + ENFORCE_STACK_ALIGN_1D (uint8_t, iRec, 16 * FDEC_STRIDE, 16); | |
| 402 | + for (int i = 0; i < 16; i++) | |
| 403 | + for (int j = 0; j < 16; j++) | |
| 404 | + iRefDst[i * FDEC_STRIDE + j] = iPred[i * FDEC_STRIDE + j] = rand() & 255; | |
| 405 | + for (int i = 0; i < 4; i++) | |
| 406 | + for (int j = 0; j < 4; j++) | |
| 407 | + iRefDct[i][j] = iDct[i * 4 + j] = (rand() & ((1 << 15) - 1)) - (1 << | |
| 408 | + 14); //2^14 limit, (2^15+32) will cause overflow for SSE2. | |
| 409 | + WelsIDctRecI16x16DcAnchor (iRefDst, iRefDct); | |
| 410 | + WelsIDctRecI16x16Dc_mmi (iRec, FDEC_STRIDE, iPred, FDEC_STRIDE, iDct); | |
| 411 | + int ok = -1; | |
| 412 | + for (int i = 0; i < 16; i++) { | |
| 413 | + for (int j = 0; j < 16; j++) { | |
| 414 | + if (iRec[i * FDEC_STRIDE + j] != iRefDst[i * FDEC_STRIDE + j]) { | |
| 415 | + ok = i * 16 + j; | |
| 416 | + break; | |
| 417 | + } | |
| 418 | + } | |
| 419 | + } | |
| 420 | + EXPECT_EQ (ok, -1); | |
| 421 | + } | |
| 422 | +} | |
| 423 | +#endif | |