Add unit tests for encoder MC

This commit is contained in:
Martin Storsjö 2015-01-26 11:14:57 +02:00
parent 4df4c1d757
commit 8084a2c797
3 changed files with 43 additions and 0 deletions

View File

@ -414,6 +414,10 @@
RelativePath="..\..\..\encoder\EncUT_MemoryZero.cpp"
>
</File>
<File
RelativePath="..\..\..\encoder\EncUT_MotionCompensation.cpp"
>
</File>
<File
RelativePath="..\..\..\encoder\EncUT_MotionEstimate.cpp"
>

View File

@ -0,0 +1,38 @@
#include <gtest/gtest.h>
#include "codec_def.h"
#include "mc.h"
#include "cpu.h"
using namespace WelsEnc;
static void McLumaFunc (SMcFunc* pFuncs, const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) {
uint8_t uiMvpIdx = ((iMvY & 0x03) << 2) + (iMvX & 0x03);
ASSERT_EQ (iWidth, 16);
pFuncs->pfLumaQuarpelMc[uiMvpIdx] (pSrc, iSrcStride, pDst, iDstStride, iHeight);
}
#define InitMcFunc WelsInitMcFuncs
#define LUMA_FUNC(funcs, src, srcstride, dst, dststride, mvx, mvy, width, height) \
McLumaFunc (funcs, src, srcstride, dst, dststride, mvx, mvy, width, height)
#define CHROMA_FUNC sMcFunc.pfChromaMc
#define PREFIX Enc
#define DEF_MCCOPYTESTS(pfx) \
DEF_MCCOPYTEST (pfx, 16, 8, 0) \
DEF_MCCOPYTEST (pfx, 16, 16, 0)
#define DEF_LUMA_MCTEST(pfx,a,b) \
DEF_LUMA_MCTEST_SUBCASE(pfx,a,b,16,8) \
DEF_LUMA_MCTEST_SUBCASE(pfx,a,b,16,16)
#define DEF_CHROMA_MCTEST(pfx,a,b) \
DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,4,2) \
DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,4,4) \
DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,4,8) \
DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,8,4) \
DEF_CHROMA_MCTEST_SUBCASE(pfx,a,b,8,8)
#include "mc_test_common.h"

View File

@ -10,6 +10,7 @@ ENCODER_UNITTEST_CPP_SRCS=\
$(ENCODER_UNITTEST_SRCDIR)/EncUT_MBCopy.cpp\
$(ENCODER_UNITTEST_SRCDIR)/EncUT_MemoryAlloc.cpp\
$(ENCODER_UNITTEST_SRCDIR)/EncUT_MemoryZero.cpp\
$(ENCODER_UNITTEST_SRCDIR)/EncUT_MotionCompensation.cpp\
$(ENCODER_UNITTEST_SRCDIR)/EncUT_MotionEstimate.cpp\
$(ENCODER_UNITTEST_SRCDIR)/EncUT_ParameterSetStrategy.cpp\
$(ENCODER_UNITTEST_SRCDIR)/EncUT_Reconstruct.cpp\