History

Add unit tests for encoder MC

Martin Storsjö committed 11 years ago

Commit 8084a2c1 parent 4df4c1d3 files · +43 −0Browse files

Showing the changes to test/encoder/EncUT_MotionCompensation.cpp (1 of 3 files). Show all

Unified · Split

test/encoder/EncUT_MotionCompensation.cpp+38−0
@@ -0,0 +1,38 @@
1+#include <gtest/gtest.h>
2+#include "codec_def.h"
3+#include "mc.h"
4+#include "cpu.h"
5+using namespace WelsEnc;
6+
7+static void McLumaFunc (SMcFunc* pFuncs, const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
8+ int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) {
9+ uint8_t uiMvpIdx = ((iMvY & 0x03) << 2) + (iMvX & 0x03);
10+ ASSERT_EQ (iWidth, 16);
11+ pFuncs->pfLumaQuarpelMc[uiMvpIdx] (pSrc, iSrcStride, pDst, iDstStride, iHeight);
12+}
13+
14+#define InitMcFunc WelsInitMcFuncs
15+
16+#define LUMA_FUNC(funcs, src, srcstride, dst, dststride, mvx, mvy, width, height) \
17+ McLumaFunc (funcs, src, srcstride, dst, dststride, mvx, mvy, width, height)
18+
19+#define CHROMA_FUNC sMcFunc.pfChromaMc
20+
21+#define PREFIX Enc
22+
23+#define DEF_MCCOPYTESTS(pfx) \
24+DEF_MCCOPYTEST (pfx, 16, 8, 0) \
25+DEF_MCCOPYTEST (pfx, 16, 16, 0)
26+
27+#define DEF_LUMA_MCTEST(pfx,a,b) \
28+DEF_LUMA_MCTEST_SUBCASE(pfx,a,b,16,8) \
29+DEF_LUMA_MCTEST_SUBCASE(pfx,a,b,16,16)
30+
31+#define DEF_CHROMA_MCTEST(pfx,a,b) \
32+DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,4,2) \
33+DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,4,4) \
34+DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,4,8) \
35+DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,8,4) \
36+DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,8,8)
37+
38+#include "mc_test_common.h"

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