Add unit tests for encoder MC
This commit is contained in:
parent
4df4c1d757
commit
8084a2c797
@ -414,6 +414,10 @@
|
||||
RelativePath="..\..\..\encoder\EncUT_MemoryZero.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\encoder\EncUT_MotionCompensation.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\encoder\EncUT_MotionEstimate.cpp"
|
||||
>
|
||||
|
38
test/encoder/EncUT_MotionCompensation.cpp
Normal file
38
test/encoder/EncUT_MotionCompensation.cpp
Normal 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"
|
@ -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\
|
||||
|
Loading…
x
Reference in New Issue
Block a user