shithub: openh264

Download patch

ref: f03edd79c240f40d46cef16f0229883dcb5755f6
parent: 9a0663620a6dd1cb655b44015a3a1c4da3ccd2fc
author: Martin Storsjö <[email protected]>
date: Wed Jan 28 08:47:09 EST 2015

Merge all MC unit tests into one file

Since both encoder and decoder use the same MC implementation now,
one set of tests is enough.

--- a/codec/common/src/mc.cpp
+++ b/codec/common/src/mc.cpp
@@ -214,7 +214,7 @@
 static inline void McHorVer22_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride,
                                  int32_t iWidth,
                                  int32_t iHeight) {
-  int16_t iTmp[16 + 5]; //16
+  int16_t iTmp[17 + 5];
   int32_t i, j, k;
 
   for (i = 0; i < iHeight; i++) {
--- a/test/build/win32/codec_ut/codec_unittest.vcproj
+++ b/test/build/win32/codec_ut/codec_unittest.vcproj
@@ -623,42 +623,6 @@
 				</FileConfiguration>
 			</File>
 			<File
-				RelativePath="..\..\..\decoder\DecUT_MotionCompensation.cpp"
-				>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories="..\..\..\..\codec\api\svc;..\..\..\..\gtest\include;..\..\..\;..\..\..\..\codec\decoder\plus\inc;..\..\..\..\codec\common\inc;..\..\..\..\codec\decoder\core\inc;$(NOINHERIT)"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories="..\..\..\..\codec\api\svc;..\..\..\..\gtest\include;..\..\..\;..\..\..\..\codec\decoder\plus\inc;..\..\..\..\codec\common\inc;..\..\..\..\codec\decoder\core\inc;$(NOINHERIT)"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories="..\..\..\..\codec\api\svc;..\..\..\..\gtest\include;..\..\..\;..\..\..\..\codec\decoder\plus\inc;..\..\..\..\codec\common\inc;..\..\..\..\codec\decoder\core\inc;$(NOINHERIT)"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories="..\..\..\..\codec\api\svc;..\..\..\..\gtest\include;..\..\..\;..\..\..\..\codec\decoder\plus\inc;..\..\..\..\codec\common\inc;..\..\..\..\codec\decoder\core\inc;$(NOINHERIT)"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
 				RelativePath="..\..\..\decoder\DecUT_ParseSyntax.cpp"
 				>
 				<FileConfiguration
--- a/test/decoder/DecUT_MotionCompensation.cpp
+++ /dev/null
@@ -1,35 +1,0 @@
-#include <gtest/gtest.h>
-#include "codec_def.h"
-#include "macros.h"
-#include "mc.h"
-#include "cpu.h"
-using namespace WelsCommon;
-
-#include "mc_test_common.h"
-
-DEF_MCCOPYTEST (, 2, 2)
-DEF_MCCOPYTEST (, 2, 4)
-DEF_MCCOPYTEST (, 4, 2)
-DEF_MCCOPYTEST (, 4, 4)
-DEF_MCCOPYTEST (, 4, 8)
-DEF_MCCOPYTEST (, 8, 4)
-DEF_MCCOPYTEST (, 8, 8)
-DEF_MCCOPYTEST (, 16, 8)
-DEF_MCCOPYTEST (, 8, 16)
-DEF_MCCOPYTEST (, 16, 16)
-
-DEF_LUMA_MCTEST (, 4, 4)
-DEF_LUMA_MCTEST (, 4, 8)
-DEF_LUMA_MCTEST (, 8, 4)
-DEF_LUMA_MCTEST (, 8, 8)
-DEF_LUMA_MCTEST (, 16, 8)
-DEF_LUMA_MCTEST (, 8, 16)
-DEF_LUMA_MCTEST (, 16, 16)
-
-DEF_CHROMA_MCTEST (, 2, 2)
-DEF_CHROMA_MCTEST (, 2, 4)
-DEF_CHROMA_MCTEST (, 4, 2)
-DEF_CHROMA_MCTEST (, 4, 4)
-DEF_CHROMA_MCTEST (, 4, 8)
-DEF_CHROMA_MCTEST (, 8, 4)
-DEF_CHROMA_MCTEST (, 8, 8)
--- a/test/decoder/targets.mk
+++ b/test/decoder/targets.mk
@@ -6,7 +6,6 @@
 	$(DECODER_UNITTEST_SRCDIR)/DecUT_ErrorConcealment.cpp\
 	$(DECODER_UNITTEST_SRCDIR)/DecUT_IdctResAddPred.cpp\
 	$(DECODER_UNITTEST_SRCDIR)/DecUT_IntraPrediction.cpp\
-	$(DECODER_UNITTEST_SRCDIR)/DecUT_MotionCompensation.cpp\
 	$(DECODER_UNITTEST_SRCDIR)/DecUT_ParseSyntax.cpp\
 	$(DECODER_UNITTEST_SRCDIR)/DecUT_PredMv.cpp\
 
--- a/test/encoder/EncUT_MotionCompensation.cpp
+++ b/test/encoder/EncUT_MotionCompensation.cpp
@@ -7,17 +7,32 @@
 
 #include "mc_test_common.h"
 
-DEF_MCCOPYTEST (Enc, 16, 8)
-DEF_MCCOPYTEST (Enc, 16, 16)
+DEF_MCCOPYTEST (2, 2)
+DEF_MCCOPYTEST (2, 4)
+DEF_MCCOPYTEST (4, 2)
+DEF_MCCOPYTEST (4, 4)
+DEF_MCCOPYTEST (4, 8)
+DEF_MCCOPYTEST (8, 4)
+DEF_MCCOPYTEST (8, 8)
+DEF_MCCOPYTEST (16, 8)
+DEF_MCCOPYTEST (8, 16)
+DEF_MCCOPYTEST (16, 16)
 
-DEF_LUMA_MCTEST (Enc, 16, 8)
-DEF_LUMA_MCTEST (Enc, 16, 16)
+DEF_LUMA_MCTEST (4, 4)
+DEF_LUMA_MCTEST (4, 8)
+DEF_LUMA_MCTEST (8, 4)
+DEF_LUMA_MCTEST (8, 8)
+DEF_LUMA_MCTEST (16, 8)
+DEF_LUMA_MCTEST (8, 16)
+DEF_LUMA_MCTEST (16, 16)
 
-DEF_CHROMA_MCTEST (Enc, 4, 2)
-DEF_CHROMA_MCTEST (Enc, 4, 4)
-DEF_CHROMA_MCTEST (Enc, 4, 8)
-DEF_CHROMA_MCTEST (Enc, 8, 4)
-DEF_CHROMA_MCTEST (Enc, 8, 8)
+DEF_CHROMA_MCTEST (2, 2)
+DEF_CHROMA_MCTEST (2, 4)
+DEF_CHROMA_MCTEST (4, 2)
+DEF_CHROMA_MCTEST (4, 4)
+DEF_CHROMA_MCTEST (4, 8)
+DEF_CHROMA_MCTEST (8, 4)
+DEF_CHROMA_MCTEST (8, 8)
 
 TEST (EncMcAvg, PixelAvg) {
   SMcFunc sMcFunc;
--- a/test/mc_test_common.h
+++ b/test/mc_test_common.h
@@ -108,8 +108,8 @@
 }
 
 /**********************MC Unit Test OPENH264 Code Begin******************************/
-#define DEF_MCCOPYTEST(pfx, iW,iH) \
-TEST(pfx##McCopy_c,iW##x##iH) \
+#define DEF_MCCOPYTEST(iW,iH) \
+TEST(McCopy_c,iW##x##iH) \
 {                             \
     SMcFunc sMcFunc;      \
     int32_t iCpuCores = 1; \
@@ -149,8 +149,8 @@
     }\
 }
 
-#define DEF_LUMA_MCTEST(pfx,iW,iH) \
-TEST(pfx##McHorVer,iW##x##iH)  \
+#define DEF_LUMA_MCTEST(iW,iH) \
+TEST(McHorVer,iW##x##iH)  \
 {                       \
     for (int32_t a = 0; a < 4; a++) { \
     for (int32_t b = 0; b < 4; b++) { \
@@ -201,8 +201,8 @@
     }\
 }
 
-#define DEF_CHROMA_MCTEST(pfx,iW,iH) \
-TEST(pfx##McChroma,iW##x##iH)  \
+#define DEF_CHROMA_MCTEST(iW,iH) \
+TEST(McChroma,iW##x##iH)  \
 {                       \
     for (int32_t a = 0; a < 8; a++) { \
     for (int32_t b = 0; b < 8; b++) { \