History

Add unit tests for encoder MC

Martin Storsjö committed 11 years ago

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

Unified · Split

3 files
  1. test/build/win32/codec_ut/codec_unittest.vcproj +4 −0
  2. test/encoder/EncUT_MotionCompensation.cpp +38 −0
  3. test/encoder/targets.mk +1 −0
test/build/win32/codec_ut/codec_unittest.vcproj+4−0
@@ -414,6 +414,10 @@ · 413 unmodified lines
414414 RelativePath="..\..\..\encoder\EncUT_MemoryZero.cpp"
415415 >
416416 </File>
417+ <File
418+ RelativePath="..\..\..\encoder\EncUT_MotionCompensation.cpp"
419+ >
420+ </File>
417421 <File
418422 RelativePath="..\..\..\encoder\EncUT_MotionEstimate.cpp"
419423 >
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"
test/encoder/targets.mk+1−0
@@ -10,6 +10,7 @@ ENCODER_UNITTEST_CPP_SRCS=\ · 9 unmodified lines
1010 $(ENCODER_UNITTEST_SRCDIR)/EncUT_MBCopy.cpp\
1111 $(ENCODER_UNITTEST_SRCDIR)/EncUT_MemoryAlloc.cpp\
1212 $(ENCODER_UNITTEST_SRCDIR)/EncUT_MemoryZero.cpp\
13+ $(ENCODER_UNITTEST_SRCDIR)/EncUT_MotionCompensation.cpp\
1314 $(ENCODER_UNITTEST_SRCDIR)/EncUT_MotionEstimate.cpp\
1415 $(ENCODER_UNITTEST_SRCDIR)/EncUT_ParameterSetStrategy.cpp\
1516 $(ENCODER_UNITTEST_SRCDIR)/EncUT_Reconstruct.cpp\

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