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
414 RelativePath="..\..\..\encoder\EncUT_MemoryZero.cpp"414 RelativePath="..\..\..\encoder\EncUT_MemoryZero.cpp"
415 >415 >
416 </File>416 </File>
417 <File
418 RelativePath="..\..\..\encoder\EncUT_MotionCompensation.cpp"
419 >
420 </File>
417 <File421 <File
418 RelativePath="..\..\..\encoder\EncUT_MotionEstimate.cpp"422 RelativePath="..\..\..\encoder\EncUT_MotionEstimate.cpp"
419 >423 >
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"
5using namespace WelsEnc;
6
7static 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) \
24DEF_MCCOPYTEST (pfx, 16, 8, 0) \
25DEF_MCCOPYTEST (pfx, 16, 16, 0)
26
27#define DEF_LUMA_MCTEST(pfx,a,b) \
28DEF_LUMA_MCTEST_SUBCASE(pfx,a,b,16,8) \
29DEF_LUMA_MCTEST_SUBCASE(pfx,a,b,16,16)
30
31#define DEF_CHROMA_MCTEST(pfx,a,b) \
32DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,4,2) \
33DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,4,4) \
34DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,4,8) \
35DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,8,4) \
36DEF_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
10 $(ENCODER_UNITTEST_SRCDIR)/EncUT_MBCopy.cpp\10 $(ENCODER_UNITTEST_SRCDIR)/EncUT_MBCopy.cpp\
11 $(ENCODER_UNITTEST_SRCDIR)/EncUT_MemoryAlloc.cpp\11 $(ENCODER_UNITTEST_SRCDIR)/EncUT_MemoryAlloc.cpp\
12 $(ENCODER_UNITTEST_SRCDIR)/EncUT_MemoryZero.cpp\12 $(ENCODER_UNITTEST_SRCDIR)/EncUT_MemoryZero.cpp\
13 $(ENCODER_UNITTEST_SRCDIR)/EncUT_MotionCompensation.cpp\
13 $(ENCODER_UNITTEST_SRCDIR)/EncUT_MotionEstimate.cpp\14 $(ENCODER_UNITTEST_SRCDIR)/EncUT_MotionEstimate.cpp\
14 $(ENCODER_UNITTEST_SRCDIR)/EncUT_ParameterSetStrategy.cpp\15 $(ENCODER_UNITTEST_SRCDIR)/EncUT_ParameterSetStrategy.cpp\
15 $(ENCODER_UNITTEST_SRCDIR)/EncUT_Reconstruct.cpp\16 $(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