Compare commits
38 Commits
v1.1
...
v1.1-Firef
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6310017877 | ||
|
|
c72f82e7a7 | ||
|
|
d4baad0dcb | ||
|
|
209c607020 | ||
|
|
d5c71dbe2f | ||
|
|
019fb9e20e | ||
|
|
0cafc565be | ||
|
|
0110e5df55 | ||
|
|
4edc5f60a1 | ||
|
|
7bb422803d | ||
|
|
2531e26da1 | ||
|
|
d070f9e7f2 | ||
|
|
1dd5a7a866 | ||
|
|
70e9ff3a33 | ||
|
|
17c14d44e2 | ||
|
|
a11fdcd647 | ||
|
|
beaf7c1893 | ||
|
|
e5eed1f65b | ||
|
|
ac0e5cb7b4 | ||
|
|
013de2602a | ||
|
|
b86e1f00b2 | ||
|
|
a29645cefe | ||
|
|
e465cc8bc3 | ||
|
|
fb52509cee | ||
|
|
9ccfea24a7 | ||
|
|
71617445df | ||
|
|
73ccb74414 | ||
|
|
821483a4e9 | ||
|
|
6bf65da869 | ||
|
|
569033c091 | ||
|
|
46c4335cb5 | ||
|
|
79f80ac7da | ||
|
|
3068814e90 | ||
|
|
45c2fff6b8 | ||
|
|
fb47e529fc | ||
|
|
53b79c0c1f | ||
|
|
2f53a08aba | ||
|
|
78771344b7 |
32
.travis.yml
32
.travis.yml
@@ -1,15 +1,39 @@
|
||||
language: cpp
|
||||
|
||||
compiler:
|
||||
- g++
|
||||
- clang
|
||||
|
||||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -qq nasm g++-4.6-multilib gcc-multilib libc6-dev-i386
|
||||
|
||||
install:
|
||||
- make gmp-bootstrap
|
||||
- make gtest-bootstrap
|
||||
|
||||
before_script:
|
||||
- WorkingDir=`pwd`
|
||||
- cd test/encoder_binary_comparison
|
||||
- ./run_PrepareAllTestData.sh 64
|
||||
- cd ${WorkingDir}
|
||||
|
||||
env:
|
||||
- TASK=UnitTest; TestParameter=""
|
||||
- TASK=BinaryCompare; TestParameter=BA_MW_D.264;
|
||||
- TASK=BinaryCompare; TestParameter=LS_SVA_D.264;
|
||||
- TASK=BinaryCompare; TestParameter=CVPCMNL1_SVA_C.264;
|
||||
|
||||
matrix:
|
||||
exclude:
|
||||
- compiler: clang
|
||||
env: TASK=BinaryCompare; TestParameter=BA_MW_D.264;
|
||||
- compiler: clang
|
||||
env: TASK=BinaryCompare; TestParameter=LS_SVA_D.264;
|
||||
- compiler: clang
|
||||
env: TASK=BinaryCompare; TestParameter=CVPCMNL1_SVA_C.264;
|
||||
|
||||
script:
|
||||
- make -B ENABLE64BIT=Yes BUILDTYPE=Release all plugin test
|
||||
- make -B ENABLE64BIT=Yes BUILDTYPE=Debug all plugin test
|
||||
- make -B ENABLE64BIT=No BUILDTYPE=Release all plugin test
|
||||
- make -B ENABLE64BIT=No BUILDTYPE=Debug all plugin test
|
||||
- echo "currrent test is for ${TASK}"
|
||||
- echo "test parameter is ${TestParameter}"
|
||||
- ./run_Test.sh ${TASK} ${TestParameter}
|
||||
|
||||
4
Makefile
4
Makefile
@@ -17,6 +17,7 @@ SHARED=-shared
|
||||
OBJ=o
|
||||
PROJECT_NAME=openh264
|
||||
MODULE_NAME=gmpopenh264
|
||||
GMP_API_BRANCH=Firefox32
|
||||
CCASFLAGS=$(CFLAGS)
|
||||
|
||||
ifeq (,$(wildcard ./gmp-api))
|
||||
@@ -122,7 +123,8 @@ endif
|
||||
$(QUIET)rm -f $(OBJS) $(OBJS:.$(OBJ)=.d) $(LIBRARIES) $(BINARIES)
|
||||
|
||||
gmp-bootstrap:
|
||||
git clone https://github.com/mozilla/gmp-api gmp-api
|
||||
if [ ! -d gmp-api ] ; then git clone https://github.com/mozilla/gmp-api gmp-api ; fi
|
||||
cd gmp-api && git fetch origin && git checkout $(GMP_API_BRANCH)
|
||||
|
||||
gtest-bootstrap:
|
||||
svn co https://googletest.googlecode.com/svn/trunk/ gtest
|
||||
|
||||
@@ -9,19 +9,16 @@ ifeq ($(ARCH), arm)
|
||||
LDFLAGS += -march=armv7-a -Wl,--fix-cortex-a8
|
||||
APP_ABI = armeabi-v7a
|
||||
endif
|
||||
TOOLCHAINPREFIX = $(shell NDK_PROJECT_PATH=./codec/build/android/dec make --no-print-dir -f $(NDKROOT)/build/core/build-local.mk DUMP_TOOLCHAIN_PREFIX APP_ABI=armeabi)
|
||||
ifeq (Yes, $(USE_ASM))
|
||||
ASMFLAGS += -march=armv7-a -mfpu=neon
|
||||
endif
|
||||
else ifeq ($(ARCH), x86)
|
||||
APP_ABI = x86
|
||||
TOOLCHAINPREFIX = $(shell NDK_PROJECT_PATH=./codec/build/android/dec make --no-print-dir -f $(NDKROOT)/build/core/build-local.mk DUMP_TOOLCHAIN_PREFIX APP_ABI=x86)
|
||||
ifeq (Yes, $(USE_ASM))
|
||||
ASMFLAGS += -f elf32
|
||||
endif
|
||||
else
|
||||
APP_ABI = $(ARCH)
|
||||
TOOLCHAINPREFIX = $(shell NDK_PROJECT_PATH=./codec/build/android/dec make --no-print-dir -f $(NDKROOT)/build/core/build-local.mk DUMP_TOOLCHAIN_PREFIX APP_ABI=$(APP_ABI))
|
||||
endif
|
||||
|
||||
ifndef NDKROOT
|
||||
@@ -31,6 +28,8 @@ ifndef TARGET
|
||||
$(error TARGET is not set)
|
||||
endif
|
||||
|
||||
TOOLCHAINPREFIX = $(shell NDK_PROJECT_PATH=./codec/build/android/dec make --no-print-dir -f $(NDKROOT)/build/core/build-local.mk DUMP_TOOLCHAIN_PREFIX APP_ABI=$(APP_ABI))
|
||||
|
||||
SYSROOT = $(NDKROOT)/platforms/android-$(NDKLEVEL)/arch-$(ARCH)
|
||||
CXX = $(TOOLCHAINPREFIX)g++
|
||||
CC = $(TOOLCHAINPREFIX)gcc
|
||||
|
||||
@@ -26,7 +26,7 @@ CFLAGS += -nologo -W3 -EHsc -fp:precise -Zc:wchar_t -Zc:forScope -D_VARIADIC_MAX
|
||||
CXX_LINK_O=-nologo -Fe$@
|
||||
AR_OPTS=-nologo -out:$@
|
||||
CFLAGS_OPT=-O2 -Ob1 -Oy- -Zi -GF -Gm- -GS -Gy -DNDEBUG
|
||||
CFLAGS_DEBUG=-Od -Oy- -ZI -RTC1 -D_DEBUG
|
||||
CFLAGS_DEBUG=-Od -Oy- -Zi -RTC1 -D_DEBUG
|
||||
CFLAGS_M32=
|
||||
CFLAGS_M64=
|
||||
LINK_LOCAL_DIR=
|
||||
|
||||
@@ -91,6 +91,7 @@ typedef enum {
|
||||
ENCODER_LTR_MARKING_FEEDBACK,
|
||||
ENCOCER_LTR_MARKING_PERIOD,
|
||||
ENCODER_OPTION_LTR,
|
||||
ENCODER_OPTION_COMPLEXITY,
|
||||
|
||||
ENCODER_OPTION_ENABLE_SSEI, //enable SSEI: true--enable ssei; false--disable ssei
|
||||
ENCODER_OPTION_ENABLE_PREFIX_NAL_ADDING, //enable prefix: true--enable prefix; false--disable prefix
|
||||
@@ -272,12 +273,16 @@ typedef enum {
|
||||
SCREEN_CONTENT_REAL_TIME,//screen content signal
|
||||
} EUsageType;
|
||||
|
||||
typedef enum {
|
||||
LOW_COMPLEXITY, //the lowest compleixty,the fastest speed,
|
||||
MEDIUM_COMPLEXITY, //medium complexity, medium speed,medium quality
|
||||
HIGH_COMPLEXITY, //high complexity, lowest speed, high quality
|
||||
} ECOMPLEXITY_MODE;
|
||||
// TODO: Refine the parameters definition.
|
||||
// SVC Encoding Parameters
|
||||
typedef struct TagEncParamBase {
|
||||
EUsageType
|
||||
iUsageType; //application type;// CAMERA_VIDEO_REAL_TIME: //camera video signal; SCREEN_CONTENT_REAL_TIME: screen content signal;
|
||||
int iInputCsp; // color space of input sequence
|
||||
|
||||
int iPicWidth; // width of picture in samples
|
||||
int iPicHeight; // height of picture in samples
|
||||
@@ -291,7 +296,6 @@ typedef struct TagEncParamBase {
|
||||
typedef struct TagEncParamExt {
|
||||
EUsageType
|
||||
iUsageType; //application type;// CAMERA_VIDEO_REAL_TIME: //camera video signal; SCREEN_CONTENT_REAL_TIME: screen content signal;
|
||||
int iInputCsp; // color space of input sequence
|
||||
|
||||
int iPicWidth; // width of picture in samples
|
||||
int iPicHeight; // height of picture in samples
|
||||
@@ -303,9 +307,9 @@ typedef struct TagEncParamExt {
|
||||
int iSpatialLayerNum; // layer number at spatial level
|
||||
SSpatialLayerConfig sSpatialLayers[MAX_SPATIAL_LAYER_NUM];
|
||||
|
||||
ECOMPLEXITY_MODE iComplexityMode;
|
||||
unsigned int uiIntraPeriod; // period of Intra frame
|
||||
int iNumRefFrame; // number of reference frame used
|
||||
unsigned int uiFrameToBeCoded; // frame to be encoded (at input frame rate)
|
||||
bool bEnableSpsPpsIdAddition;
|
||||
bool bPrefixNalAddingCtrl;
|
||||
bool bEnableSSEI;
|
||||
|
||||
@@ -59,12 +59,11 @@
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\..\..\..\obj\decoder\core\release/WelsDecCore.pch"
|
||||
AssemblerListingLocation=".\..\..\..\obj\decoder\core\release/"
|
||||
ObjectFile=".\..\..\..\obj\decoder\core\release/"
|
||||
ProgramDataBaseFileName=".\..\..\..\obj\decoder\core\release/"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="0"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
@@ -137,12 +136,11 @@
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\..\..\..\obj\decoder\core\release/WelsDecCore.pch"
|
||||
AssemblerListingLocation=".\..\..\..\obj\decoder\core\release/"
|
||||
ObjectFile=".\..\..\..\obj\decoder\core\release/"
|
||||
ProgramDataBaseFileName=".\..\..\..\obj\decoder\core\release/"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="0"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
@@ -212,7 +210,6 @@
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\..\..\..\obj\decoder\core\debug/WelsDecCore.pch"
|
||||
AssemblerListingLocation=".\..\..\..\obj\decoder\core\debug/"
|
||||
ObjectFile=".\..\..\..\obj\decoder\core\debug/"
|
||||
ProgramDataBaseFileName=".\..\..\..\obj\decoder\core\debug/"
|
||||
@@ -288,7 +285,6 @@
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\..\..\..\obj\decoder\core\debug/WelsDecCore.pch"
|
||||
AssemblerListingLocation=".\..\..\..\obj\decoder\core\debug/"
|
||||
ObjectFile=".\..\..\..\obj\decoder\core\debug/"
|
||||
ProgramDataBaseFileName=".\..\..\..\obj\decoder\core\debug/"
|
||||
|
||||
@@ -43,11 +43,6 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\..\..\..\..\..\bin\win32\Release/WelsDecPlus.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -58,7 +53,6 @@
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\..\..\..\obj\decoder\plus\Release/WelsDecPlus.pch"
|
||||
AssemblerListingLocation=".\..\..\..\obj\decoder\plus\Release/"
|
||||
ObjectFile=".\..\..\..\obj\decoder\plus\Release/"
|
||||
ProgramDataBaseFileName=".\..\..\..\obj\decoder\plus\Release/"
|
||||
@@ -78,10 +72,9 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=".\..\..\..\..\bin\win32\Release\welsdcore.lib"
|
||||
AdditionalDependencies="$(OutDir)\welsdcore.lib"
|
||||
OutputFile="$(OutDir)\welsdec.dll"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=".\..\..\..\libs\Release\"
|
||||
ModuleDefinitionFile="..\..\..\decoder\plus\src\wels_dec_export.def"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)\welsdec.pdb"
|
||||
@@ -140,11 +133,6 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
TargetEnvironment="3"
|
||||
TypeLibraryName=".\..\..\..\..\..\bin\win32\Release/WelsDecPlus.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -155,7 +143,6 @@
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\..\..\..\obj\decoder\plus\Release/WelsDecPlus.pch"
|
||||
AssemblerListingLocation=".\..\..\..\obj\decoder\plus\Release/"
|
||||
ObjectFile=".\..\..\..\obj\decoder\plus\Release/"
|
||||
ProgramDataBaseFileName=".\..\..\..\obj\decoder\plus\Release/"
|
||||
@@ -175,10 +162,9 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=".\..\..\..\..\bin\win64\Release\welsdcore.lib"
|
||||
AdditionalDependencies="$(OutDir)\welsdcore.lib"
|
||||
OutputFile="$(OutDir)\welsdec.dll"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories=".\..\..\..\libs\Release\"
|
||||
ModuleDefinitionFile="..\..\..\decoder\plus\src\wels_dec_export.def"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)\welsdec.pdb"
|
||||
@@ -236,11 +222,6 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\..\..\..\..\..\bin\win32\Debug/WelsDecPlus.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -250,7 +231,6 @@
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\..\..\..\obj\decoder\plus\debug/WelsDecPlus.pch"
|
||||
AssemblerListingLocation=".\..\..\..\obj\decoder\plus\debug/"
|
||||
ObjectFile=".\..\..\..\obj\decoder\plus\debug/"
|
||||
ProgramDataBaseFileName=".\..\..\..\obj\decoder\plus\debug/"
|
||||
@@ -270,10 +250,9 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=".\..\..\..\..\bin\win32\Debug\welsdcore.lib"
|
||||
AdditionalDependencies="$(OutDir)\welsdcore.lib"
|
||||
OutputFile="$(OutDir)\welsdec.dll"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\..\..\libs\debug"
|
||||
ModuleDefinitionFile="..\..\..\decoder\plus\src\wels_dec_export.def"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)\welsdec.pdb"
|
||||
@@ -329,11 +308,6 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
TargetEnvironment="3"
|
||||
TypeLibraryName=".\..\..\..\..\..\bin\win32\Debug/WelsDecPlus.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -343,7 +317,6 @@
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\..\..\..\obj\decoder\plus\debug/WelsDecPlus.pch"
|
||||
AssemblerListingLocation=".\..\..\..\obj\decoder\plus\debug/"
|
||||
ObjectFile=".\..\..\..\obj\decoder\plus\debug/"
|
||||
ProgramDataBaseFileName=".\..\..\..\obj\decoder\plus\debug/"
|
||||
@@ -363,10 +336,9 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=".\..\..\..\..\bin\win64\Debug\welsdcore.lib"
|
||||
AdditionalDependencies="$(OutDir)\welsdcore.lib"
|
||||
OutputFile="$(OutDir)\welsdec.dll"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\..\..\libs\debug"
|
||||
ModuleDefinitionFile="..\..\..\decoder\plus\src\wels_dec_export.def"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)\welsdec.pdb"
|
||||
|
||||
@@ -42,8 +42,6 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\..\..\..\..\bin\win32\Release/decConsole.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -54,11 +52,11 @@
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\..\..\..\obj\decConsole\Release/decConsole.pch"
|
||||
AssemblerListingLocation=".\..\..\..\obj\decConsole\Release/"
|
||||
ObjectFile=".\..\..\..\obj\decConsole\Release/"
|
||||
ProgramDataBaseFileName=".\..\..\..\obj\decConsole\Release/"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
@@ -76,7 +74,6 @@
|
||||
AdditionalDependencies="$(OutDir)\welsdec.lib"
|
||||
OutputFile="$(OutDir)\decConsole.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\..\..\..\bin\win32"
|
||||
ProgramDatabaseFile="$(OutDir)\decConsole.pdb"
|
||||
GenerateMapFile="false"
|
||||
SubSystem="1"
|
||||
@@ -131,9 +128,6 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
TypeLibraryName=".\..\..\..\..\bin\win32\Release/decConsole.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -144,11 +138,11 @@
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\..\..\..\obj\decConsole\Release/decConsole.pch"
|
||||
AssemblerListingLocation=".\..\..\..\obj\decConsole\Release/"
|
||||
ObjectFile=".\..\..\..\obj\decConsole\Release/"
|
||||
ProgramDataBaseFileName=".\..\..\..\obj\decConsole\Release/"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
@@ -166,7 +160,6 @@
|
||||
AdditionalDependencies="$(OutDir)\welsdec.lib"
|
||||
OutputFile="$(OutDir)\decConsole.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\..\..\..\bin\win64"
|
||||
ProgramDatabaseFile="$(OutDir)\decConsole.pdb"
|
||||
GenerateMapFile="false"
|
||||
SubSystem="1"
|
||||
@@ -221,8 +214,6 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\..\..\..\..\bin\win32\Debug/decConsole.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -232,7 +223,6 @@
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\..\..\..\obj\decConsole\Debug/decConsole.pch"
|
||||
AssemblerListingLocation=".\..\..\..\obj\decConsole\Debug/"
|
||||
ObjectFile=".\..\..\..\obj\decConsole\Debug/"
|
||||
ProgramDataBaseFileName=".\..\..\..\obj\decConsole\Debug/"
|
||||
@@ -256,7 +246,6 @@
|
||||
AdditionalDependencies="$(OutDir)\welsdec.lib"
|
||||
OutputFile="$(OutDir)\decConsoled.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\..\..\..\bin\win32"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)\decConsoled.pdb"
|
||||
SubSystem="1"
|
||||
@@ -311,9 +300,6 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
TypeLibraryName=".\..\..\..\..\bin\win32\Debug/decConsole.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -323,7 +309,6 @@
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\..\..\..\obj\decConsole\Debug/decConsole.pch"
|
||||
AssemblerListingLocation=".\..\..\..\obj\decConsole\Debug/"
|
||||
ObjectFile=".\..\..\..\obj\decConsole\Debug/"
|
||||
ProgramDataBaseFileName=".\..\..\..\obj\decConsole\Debug/"
|
||||
@@ -347,7 +332,6 @@
|
||||
AdditionalDependencies="$(OutDir)\welsdec.lib"
|
||||
OutputFile="$(OutDir)\decConsoled.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\..\..\..\bin\win64"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)\decConsoled.pdb"
|
||||
SubSystem="1"
|
||||
|
||||
@@ -57,7 +57,6 @@
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\..\..\..\obj\encoder\core\Debug/WelsEncCore.pch"
|
||||
AssemblerListingLocation=".\..\..\..\obj\encoder\core\Debug/"
|
||||
ObjectFile=".\..\..\..\obj\encoder\core\Debug/"
|
||||
ProgramDataBaseFileName=".\..\..\..\obj\encoder\core\Debug/"
|
||||
@@ -134,7 +133,6 @@
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\..\..\..\obj\encoder\core\Debug/WelsEncCore.pch"
|
||||
AssemblerListingLocation=".\..\..\..\obj\encoder\core\Debug/"
|
||||
ObjectFile=".\..\..\..\obj\encoder\core\Debug/"
|
||||
ProgramDataBaseFileName=".\..\..\..\obj\encoder\core\Debug/"
|
||||
@@ -213,7 +211,6 @@
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\..\..\..\obj\encoder\core\Release/WelsEncCore.pch"
|
||||
AssemblerListingLocation=".\..\..\..\obj\encoder\core\Release/"
|
||||
ObjectFile=".\..\..\..\obj\encoder\core\Release/"
|
||||
ProgramDataBaseFileName=".\..\..\..\obj\encoder\core\Release/"
|
||||
@@ -293,7 +290,6 @@
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\..\..\..\obj\encoder\core\Release/WelsEncCore.pch"
|
||||
AssemblerListingLocation=".\..\..\..\obj\encoder\core\Release/"
|
||||
ObjectFile=".\..\..\..\obj\encoder\core\Release/"
|
||||
ProgramDataBaseFileName=".\..\..\..\obj\encoder\core\Release/"
|
||||
|
||||
@@ -42,11 +42,6 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\..\..\..\..\..\bin\Debug/WelsEncPlus.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -56,7 +51,6 @@
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\..\..\..\obj\encoder\plus\Debug/WelsEncPlus.pch"
|
||||
AssemblerListingLocation=".\..\..\..\obj\encoder\plus\Debug/"
|
||||
ObjectFile=".\..\..\..\obj\encoder\plus\Debug/"
|
||||
ProgramDataBaseFileName=".\..\..\..\obj\encoder\plus\Debug/"
|
||||
@@ -79,7 +73,6 @@
|
||||
AdditionalDependencies="$(OutDir)\welsecore.lib $(OutDir)\welsvp.lib"
|
||||
OutputFile="$(OutDir)\welsenc.dll"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\..\..\..\libs"
|
||||
ModuleDefinitionFile="..\..\..\encoder\plus\src\wels_enc_export.def"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)\welsenc.pdb"
|
||||
@@ -137,11 +130,6 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
TargetEnvironment="3"
|
||||
TypeLibraryName=".\..\..\..\..\..\bin\Debug/WelsEncPlus.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -151,7 +139,6 @@
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\..\..\..\obj\encoder\plus\Debug/WelsEncPlus.pch"
|
||||
AssemblerListingLocation=".\..\..\..\obj\encoder\plus\Debug/"
|
||||
ObjectFile=".\..\..\..\obj\encoder\plus\Debug/"
|
||||
ProgramDataBaseFileName=".\..\..\..\obj\encoder\plus\Debug/"
|
||||
@@ -174,7 +161,6 @@
|
||||
AdditionalDependencies="$(OutDir)\welsecore.lib $(OutDir)\welsvp.lib"
|
||||
OutputFile="$(OutDir)\welsenc.dll"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\..\..\..\libs"
|
||||
ModuleDefinitionFile="..\..\..\encoder\plus\src\wels_enc_export.def"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)\welsenc.pdb"
|
||||
@@ -233,24 +219,17 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\..\..\..\..\..\bin\Release/WelsEncPlus.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
InlineFunctionExpansion="2"
|
||||
FavorSizeOrSpeed="1"
|
||||
EnableFiberSafeOptimizations="true"
|
||||
AdditionalIncludeDirectories="..\..\..\encoder\plus\inc;..\..\..\encoder\core\inc;..\..\..\api\svc;..\..\..\common\inc;..\..\..\processing\interface"
|
||||
PreprocessorDefinitions="NDEBUG;_USRDLL;X86_ASM"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\..\..\..\obj\encoder\plus\Release/WelsEncPlus.pch"
|
||||
AssemblerListingLocation=".\..\..\..\obj\encoder\plus\Release/"
|
||||
ObjectFile=".\..\..\..\obj\encoder\plus\Release/"
|
||||
ProgramDataBaseFileName=".\..\..\..\obj\encoder\plus\Release/"
|
||||
@@ -273,7 +252,6 @@
|
||||
AdditionalDependencies="$(OutDir)\welsecore.lib $(OutDir)\welsvp.lib"
|
||||
OutputFile="$(OutDir)\welsenc.dll"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\..\..\..\libs"
|
||||
ModuleDefinitionFile="..\..\..\encoder\plus\src\wels_enc_export.def"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)\welsenc.pdb"
|
||||
@@ -333,24 +311,17 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
TargetEnvironment="3"
|
||||
TypeLibraryName=".\..\..\..\..\..\bin\Release/WelsEncPlus.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
InlineFunctionExpansion="2"
|
||||
FavorSizeOrSpeed="1"
|
||||
EnableFiberSafeOptimizations="true"
|
||||
AdditionalIncludeDirectories="..\..\..\encoder\plus\inc;..\..\..\encoder\core\inc;..\..\..\api\svc;..\..\..\common\inc;..\..\..\processing\interface"
|
||||
PreprocessorDefinitions="NDEBUG;_USRDLL;X86_ASM"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\..\..\..\obj\encoder\plus\Release/WelsEncPlus.pch"
|
||||
AssemblerListingLocation=".\..\..\..\obj\encoder\plus\Release/"
|
||||
ObjectFile=".\..\..\..\obj\encoder\plus\Release/"
|
||||
ProgramDataBaseFileName=".\..\..\..\obj\encoder\plus\Release/"
|
||||
@@ -373,7 +344,6 @@
|
||||
AdditionalDependencies="$(OutDir)\welsecore.lib $(OutDir)\welsvp.lib"
|
||||
OutputFile="$(OutDir)\welsenc.dll"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\..\..\..\libs"
|
||||
ModuleDefinitionFile="..\..\..\encoder\plus\src\wels_enc_export.def"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)\welsenc.pdb"
|
||||
|
||||
@@ -42,8 +42,6 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\..\..\..\..\..\bin\Debug/encConsole.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -53,7 +51,6 @@
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\..\..\..\obj\encConsole\Debug/encConsole.pch"
|
||||
AssemblerListingLocation=".\..\..\..\obj\encConsole\Debug/"
|
||||
ObjectFile=".\..\..\..\obj\encConsole\Debug/"
|
||||
ProgramDataBaseFileName=".\..\..\..\obj\encConsole\Debug/"
|
||||
@@ -76,7 +73,6 @@
|
||||
AdditionalDependencies="$(OutDir)\welsenc.lib"
|
||||
OutputFile="$(OutDir)\encConsole.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\..\..\bin"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)\encConsole.pdb"
|
||||
GenerateMapFile="true"
|
||||
@@ -133,9 +129,6 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
TypeLibraryName=".\..\..\..\..\..\bin\Debug/encConsole.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -145,7 +138,6 @@
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\..\..\..\obj\encConsole\Debug/encConsole.pch"
|
||||
AssemblerListingLocation=".\..\..\..\obj\encConsole\Debug/"
|
||||
ObjectFile=".\..\..\..\obj\encConsole\Debug/"
|
||||
ProgramDataBaseFileName=".\..\..\..\obj\encConsole\Debug/"
|
||||
@@ -168,7 +160,6 @@
|
||||
AdditionalDependencies="$(OutDir)\welsenc.lib"
|
||||
OutputFile="$(OutDir)\encConsole.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\..\..\bin"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)\encConsole.pdb"
|
||||
GenerateMapFile="true"
|
||||
@@ -225,8 +216,6 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\..\..\..\..\..\bin\Release/encConsole.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -237,7 +226,6 @@
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\..\..\..\obj\encConsole\Release/encConsole.pch"
|
||||
AssemblerListingLocation=".\..\..\..\obj\encConsole\Release/"
|
||||
ObjectFile=".\..\..\..\obj\encConsole\Release/"
|
||||
ProgramDataBaseFileName=".\..\..\..\obj\encConsole\Release/"
|
||||
@@ -260,7 +248,6 @@
|
||||
AdditionalDependencies="$(OutDir)\welsenc.lib"
|
||||
OutputFile="$(OutDir)\encConsole.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\..\..\bin"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)\encConsole.pdb"
|
||||
GenerateMapFile="false"
|
||||
@@ -317,9 +304,6 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
TypeLibraryName=".\..\..\..\..\..\bin\Release/encConsole.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
@@ -330,7 +314,6 @@
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\..\..\..\obj\encConsole\Release/encConsole.pch"
|
||||
AssemblerListingLocation=".\..\..\..\obj\encConsole\Release/"
|
||||
ObjectFile=".\..\..\..\obj\encConsole\Release/"
|
||||
ProgramDataBaseFileName=".\..\..\..\obj\encConsole\Release/"
|
||||
@@ -353,7 +336,6 @@
|
||||
AdditionalDependencies="$(OutDir)\welsenc.lib"
|
||||
OutputFile="$(OutDir)\encConsole.exe"
|
||||
LinkIncremental="1"
|
||||
AdditionalLibraryDirectories="..\..\..\bin"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)\encConsole.pdb"
|
||||
GenerateMapFile="false"
|
||||
|
||||
@@ -67,11 +67,4 @@ ret
|
||||
mov \arg0\().8b, \arg1\().8b
|
||||
.endm
|
||||
|
||||
.macro ext.16b arg0, arg1, arg2, arg3
|
||||
ext \arg0\().16b, \arg1\().16b, \arg2\().16b, \arg3
|
||||
.endm
|
||||
|
||||
.macro ext.8b arg0, arg1, arg2, arg3
|
||||
ext \arg0\().8b, \arg1\().8b, \arg2\().8b, \arg3
|
||||
.endm
|
||||
#endif
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
ld1 {v1.s} [3], [x6]
|
||||
|
||||
bs_nzc_check_jump0:
|
||||
ext.16b v1, v1, v0, #12
|
||||
ext v1.16b, v1.16b, v0.16b, #12
|
||||
add $3.16b, v0.16b, v1.16b
|
||||
|
||||
// Arrange the input data --- LEFT
|
||||
@@ -233,7 +233,7 @@ bs_nzc_check_jump1:
|
||||
zip1 v0.16b, v0.16b, v2.16b
|
||||
ins v2.d[0], v0.d[1]
|
||||
zip1 v0.16b, v0.16b, v2.16b
|
||||
ext.16b v1, v1, v0, #12
|
||||
ext v1.16b, v1.16b, v0.16b, #12
|
||||
add $4.16b, v0.16b, v1.16b
|
||||
.endm
|
||||
|
||||
@@ -470,7 +470,7 @@ bs_mv_check_jump1:
|
||||
ld1 {v1.s} [3], [x6]
|
||||
|
||||
bs_nzc_check_jump0:
|
||||
ext.16b v1, v1, v0, #12
|
||||
ext v1.16b, v1.16b, v0.16b, #12
|
||||
add \arg3\().16b, v0.16b, v1.16b
|
||||
|
||||
// Arrange the input data --- LEFT
|
||||
@@ -491,7 +491,7 @@ bs_nzc_check_jump1:
|
||||
zip1 v0.16b, v0.16b, v2.16b
|
||||
ins v2.d[0], v0.d[1]
|
||||
zip1 v0.16b, v0.16b, v2.16b
|
||||
ext.16b v1, v1, v0, #12
|
||||
ext v1.16b, v1.16b, v0.16b, #12
|
||||
add \arg4\().16b, v0.16b, v1.16b
|
||||
.endm
|
||||
|
||||
|
||||
@@ -197,8 +197,8 @@ filter_para: .short 0, 1, -5, 20, 0, 0, 0, 0
|
||||
|
||||
.macro UNPACK_FILTER_SINGLE_TAG_16BITS // v0, v1, v22, v23
|
||||
// { // each 16bits; input: d_dst, d_src[0:5], para, working, working, d(low part of d_dst)
|
||||
ext.16b $3, $1, $1, #14 // X[0][1][2][3][4][5]O
|
||||
ext.16b $4, $3, $3, #8 // [3][4][5]OX[0][1][2]
|
||||
ext $3.16b, $1.16b, $1.16b, #14 // X[0][1][2][3][4][5]O
|
||||
ext $4.16b, $3.16b, $3.16b, #8 // [3][4][5]OX[0][1][2]
|
||||
rev64 $4.8h, $4.8h // X[5][4][3][2][1][0]O
|
||||
add $3.8h, $3.8h, $4.8h // each 16bits, *[50][41][32][23][14][05]*
|
||||
smull $3.4s, $3.4h, $2.4h // 0+1*[50]-5*[41]+20[32]
|
||||
@@ -413,8 +413,8 @@ WELS_ASM_AARCH64_FUNC_BEGIN McHorVer20WidthEq8_AArch64_neon
|
||||
movi v0.8h, #20, lsl #0
|
||||
movi v1.8h, #5, lsl #0
|
||||
w8_h_mc_luma_loop:
|
||||
ld1 {v2.8b, v3.8b}, [x0], x1 //only use 13(8+5); v2=src[-2]
|
||||
trn1 v2.2d, v2.2d, v3.2d
|
||||
ld1 {v2.16b}, [x0], x1 //only use 13(8+5); v2=src[-2]
|
||||
|
||||
//prfm pldl1strm, [x0]
|
||||
ext v5.16b, v2.16b, v4.16b, #1 //v5=src[-1]
|
||||
ext v6.16b, v2.16b, v4.16b, #2 //v6=src[0]
|
||||
@@ -492,8 +492,8 @@ WELS_ASM_AARCH64_FUNC_BEGIN McHorVer10WidthEq8_AArch64_neon
|
||||
movi v0.8h, #20, lsl #0
|
||||
movi v1.8h, #5, lsl #0
|
||||
w8_xy_10_mc_luma_loop:
|
||||
ld1 {v2.8b, v3.8b}, [x0], x1 //only use 13(8+5); v2=src[-2]
|
||||
trn1 v2.2d, v2.2d, v3.2d
|
||||
ld1 {v2.16b}, [x0], x1 //only use 13(8+5); v2=src[-2]
|
||||
|
||||
//prfm pldl1strm, [x0]
|
||||
ext v5.16b, v2.16b, v4.16b, #1 //v5=src[-1]
|
||||
ext v6.16b, v2.16b, v4.16b, #2 //v6=src[0]
|
||||
@@ -572,8 +572,8 @@ WELS_ASM_AARCH64_FUNC_BEGIN McHorVer30WidthEq8_AArch64_neon
|
||||
movi v0.8h, #20, lsl #0
|
||||
movi v1.8h, #5, lsl #0
|
||||
w8_xy_30_mc_luma_loop:
|
||||
ld1 {v2.8b, v3.8b}, [x0], x1 //only use 13(8+5); v2=src[-2]
|
||||
trn1 v2.2d, v2.2d, v3.2d
|
||||
ld1 {v2.16b}, [x0], x1 //only use 13(8+5); v2=src[-2]
|
||||
|
||||
//prfm pldl1strm, [x0]
|
||||
ext v5.16b, v2.16b, v4.16b, #1 //v5=src[-1]
|
||||
ext v6.16b, v2.16b, v4.16b, #2 //v6=src[0]
|
||||
@@ -1713,12 +1713,12 @@ WELS_ASM_AARCH64_FUNC_END
|
||||
WELS_ASM_AARCH64_FUNC_BEGIN McChromaWidthEq8_AArch64_neon
|
||||
ld4r {v4.8b, v5.8b, v6.8b, v7.8b}, [x4] //load A/B/C/D
|
||||
ld1 {v0.16b}, [x0], x1 // src[x]
|
||||
ext.16b v1, v0, v0, #1 // src[x+1]
|
||||
ext v1.16b, v0.16b, v0.16b, #1 // src[x+1]
|
||||
w8_mc_chroma_loop:
|
||||
ld1 {v2.16b}, [x0], x1 // src[x+stride]
|
||||
ext.16b v3, v2, v2, #1 // src[x+stride+1]
|
||||
ext v3.16b, v2.16b, v2.16b, #1 // src[x+stride+1]
|
||||
ld1 {v18.16b}, [x0], x1 // src[x+2*stride]
|
||||
ext.16b v19, v18, v18, #1 // src[x+2*stride+1]
|
||||
ext v19.16b, v18.16b, v18.16b, #1 // src[x+2*stride+1]
|
||||
|
||||
umull v16.8h, v0.8b, v4.8b
|
||||
umlal v16.8h, v1.8b, v5.8b
|
||||
@@ -1744,12 +1744,12 @@ WELS_ASM_AARCH64_FUNC_END
|
||||
WELS_ASM_AARCH64_FUNC_BEGIN McChromaWidthEq4_AArch64_neon
|
||||
ld4r {v4.8b, v5.8b, v6.8b, v7.8b}, [x4] //load A/B/C/D
|
||||
ld1 {v0.8b}, [x0], x1 // src[x]
|
||||
ext.8b v1, v0, v0, #1 // src[x+1]
|
||||
ext v1.8b, v0.8b, v0.8b, #1 // src[x+1]
|
||||
w4_mc_chroma_loop:
|
||||
ld1 {v2.8b}, [x0], x1 // src[x+stride]
|
||||
ext.8b v3, v2, v2, #1 // src[x+stride+1]
|
||||
ext v3.8b, v2.8b, v2.8b, #1 // src[x+stride+1]
|
||||
ld1 {v18.8b}, [x0], x1 // src[x+2*stride]
|
||||
ext.8b v19, v18, v18, #1 // src[x+2*stride+1]
|
||||
ext v19.8b, v18.8b, v18.8b, #1 // src[x+2*stride+1]
|
||||
|
||||
zip1 v0.4s, v0.4s, v2.4s
|
||||
zip1 v1.4s, v1.4s, v3.4s
|
||||
@@ -1779,20 +1779,20 @@ WELS_ASM_AARCH64_FUNC_BEGIN McHorVer20Width17_AArch64_neon
|
||||
movi v1.8h, #5, lsl #0
|
||||
ldr q22, filter_para
|
||||
w17_h_mc_luma_loop:
|
||||
ld1 {v2.8b, v3.8b, v4.8b}, [x0], x1 //only use 22(17+5); v2=src[-2]
|
||||
trn1 v2.2d, v2.2d, v3.2d
|
||||
ld1 {v2.16b, v3.16b}, [x0], x1 //only use 22(17+5); v2=src[-2]
|
||||
|
||||
//prfm pldl1strm, [x0]
|
||||
ext v5.16b, v2.16b, v4.16b, #1 //v5=src[-1]
|
||||
ext v6.16b, v2.16b, v4.16b, #2 //v6=src[0]
|
||||
ext v7.16b, v2.16b, v4.16b, #3 //v7=src[1]
|
||||
ext v16.16b, v2.16b, v4.16b, #4 //v16=src[2]
|
||||
ext v17.16b, v2.16b, v4.16b, #5 //v17=src[3]
|
||||
ext v5.16b, v2.16b, v3.16b, #1 //v5=src[-1]
|
||||
ext v6.16b, v2.16b, v3.16b, #2 //v6=src[0]
|
||||
ext v7.16b, v2.16b, v3.16b, #3 //v7=src[1]
|
||||
ext v16.16b, v2.16b, v3.16b, #4 //v16=src[2]
|
||||
ext v17.16b, v2.16b, v3.16b, #5 //v17=src[3]
|
||||
|
||||
FILTER_6TAG_8BITS1 v2, v5, v6, v7, v16, v17, v20, v0, v1
|
||||
FILTER_6TAG_8BITS2 v2, v5, v6, v7, v16, v17, v20, v0, v1
|
||||
st1 {v20.16b}, [x2], x5 //write 16Byte
|
||||
|
||||
ext.8b v21, v4, v4, #7 // [0][1][2][3][4][5]XY-->O[0][1][2][3][4][5]X
|
||||
ext v21.8b, v3.8b, v3.8b, #7 // [0][1][2][3][4][5]XY-->O[0][1][2][3][4][5]X
|
||||
FILTER_SINGLE_TAG_8BITS v21, v22, v23, h21
|
||||
st1 {v21.b}[0], [x2], x3 //write 16th Byte
|
||||
|
||||
@@ -1808,8 +1808,8 @@ WELS_ASM_AARCH64_FUNC_BEGIN McHorVer20Width9_AArch64_neon
|
||||
movi v1.8h, #5, lsl #0
|
||||
ldr q22, filter_para
|
||||
w9_h_mc_luma_loop:
|
||||
ld1 {v2.8b, v3.8b}, [x0], x1 //only use 14(9+5); v2=src[-2]
|
||||
trn1 v2.2d, v2.2d, v3.2d
|
||||
ld1 {v2.16b}, [x0], x1 //only use 14(9+5); v2=src[-2]
|
||||
mov v3.d[0], v2.d[1]
|
||||
//prfm pldl1strm, [x0]
|
||||
ext v5.16b, v2.16b, v4.16b, #1 //v5=src[-1]
|
||||
ext v6.16b, v2.16b, v4.16b, #2 //v6=src[0]
|
||||
@@ -1820,7 +1820,7 @@ w9_h_mc_luma_loop:
|
||||
FILTER_6TAG_8BITS1 v2, v5, v6, v7, v16, v17, v20, v0, v1
|
||||
st1 {v20.8b}, [x2], x5 //write 8Byte
|
||||
|
||||
ext.8b v21, v3, v3, #7 // [0][1][2][3][4][5]XY-->O[0][1][2][3][4][5]X
|
||||
ext v21.8b, v3.8b, v3.8b, #7 // [0][1][2][3][4][5]XY-->O[0][1][2][3][4][5]X
|
||||
FILTER_SINGLE_TAG_8BITS v21, v22, v23, h21
|
||||
st1 {v21.b}[0], [x2], x3 //write 9th Byte
|
||||
|
||||
|
||||
@@ -99,6 +99,7 @@ typedef struct tagFilesSet {
|
||||
string strSeqFile; // for cmd lines
|
||||
string strLayerCfgFile[MAX_DEPENDENCY_LAYER];
|
||||
char sRecFileName[MAX_DEPENDENCY_LAYER][MAX_FNAME_LEN];
|
||||
uint32_t uiFrameToBeCoded;
|
||||
} SFilesSet;
|
||||
|
||||
|
||||
@@ -224,7 +225,7 @@ int ParseConfig (CReadConfig& cRdCfg, SSourcePicture* pSrcPic, SEncParamExt& pSv
|
||||
} else if (strTag[0].compare ("MaxFrameRate") == 0) {
|
||||
pSvcParam.fMaxFrameRate = (float)atof (strTag[1].c_str());
|
||||
} else if (strTag[0].compare ("FramesToBeEncoded") == 0) {
|
||||
pSvcParam.uiFrameToBeCoded = atoi (strTag[1].c_str());
|
||||
sFileSet.uiFrameToBeCoded = atoi (strTag[1].c_str());
|
||||
} else if (strTag[0].compare ("TemporalLayerNum") == 0) {
|
||||
pSvcParam.iTemporalLayerNum = atoi (strTag[1].c_str());
|
||||
} else if (strTag[0].compare ("IntraPeriod") == 0) {
|
||||
@@ -403,7 +404,7 @@ int ParseCommandLine (int argc, char** argv, SSourcePicture* pSrcPic, SEncParamE
|
||||
pSrcPic->iPicHeight = atoi (argv[n++]);
|
||||
|
||||
else if (!strcmp (pCommand, "-frms") && (n < argc))
|
||||
pSvcParam.uiFrameToBeCoded = atoi (argv[n++]);
|
||||
sFileSet.uiFrameToBeCoded = atoi (argv[n++]);
|
||||
|
||||
else if (!strcmp (pCommand, "-numtl") && (n < argc))
|
||||
pSvcParam.iTemporalLayerNum = atoi (argv[n++]);
|
||||
@@ -581,11 +582,10 @@ int FillSpecificParameters (SEncParamExt& sParam) {
|
||||
sParam.bEnableFrameSkip = 1; // frame skipping
|
||||
sParam.bEnableLongTermReference = 0; // long term reference control
|
||||
sParam.iLtrMarkPeriod = 30;
|
||||
sParam.iInputCsp = videoFormatI420; // color space of input sequence
|
||||
sParam.uiIntraPeriod = 320; // period of Intra frame
|
||||
sParam.bEnableSpsPpsIdAddition = 1;
|
||||
sParam.bPrefixNalAddingCtrl = 0;
|
||||
|
||||
sParam.iComplexityMode = MEDIUM_COMPLEXITY;
|
||||
int iIndexLayer = 0;
|
||||
sParam.sSpatialLayers[iIndexLayer].uiProfileIdc = PRO_BASELINE;
|
||||
sParam.sSpatialLayers[iIndexLayer].iVideoWidth = 160;
|
||||
@@ -736,7 +736,7 @@ int ProcessEncoding (ISVCEncoder* pPtrEnc, int argc, char** argv, bool bConfigFi
|
||||
sSvcParam.iPicWidth = (!sSvcParam.iPicWidth) ? iSourceWidth : sSvcParam.iPicWidth;
|
||||
sSvcParam.iPicHeight = (!sSvcParam.iPicHeight) ? iSourceHeight : sSvcParam.iPicHeight;
|
||||
|
||||
iTotalFrameMax = (int32_t)sSvcParam.uiFrameToBeCoded;
|
||||
iTotalFrameMax = (int32_t)fs.uiFrameToBeCoded;
|
||||
|
||||
if (cmResultSuccess != pPtrEnc->InitializeExt (&sSvcParam)) { // SVC encoder initialization
|
||||
fprintf (stderr, "SVC encoder Initialize failed\n");
|
||||
@@ -789,8 +789,8 @@ int ProcessEncoding (ISVCEncoder* pPtrEnc, int argc, char** argv, bool bConfigFi
|
||||
}
|
||||
|
||||
iFrameIdx = 0;
|
||||
while (iFrameIdx < iTotalFrameMax && (((int32_t)sSvcParam.uiFrameToBeCoded <= 0)
|
||||
|| (iFrameIdx < (int32_t)sSvcParam.uiFrameToBeCoded))) {
|
||||
while (iFrameIdx < iTotalFrameMax && (((int32_t)fs.uiFrameToBeCoded <= 0)
|
||||
|| (iFrameIdx < (int32_t)fs.uiFrameToBeCoded))) {
|
||||
|
||||
#ifdef ONLY_ENC_FRAMES_NUM
|
||||
// Only encoded some limited frames here
|
||||
|
||||
@@ -131,6 +131,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
|
||||
|
||||
pNalUnitHeader->uiForbiddenZeroBit = (uint8_t) (pNal[0] >> 7); // uiForbiddenZeroBit
|
||||
if (pNalUnitHeader->uiForbiddenZeroBit) { //2010.4.14
|
||||
pCtx->iErrorCode |= dsBitstreamError;
|
||||
return NULL; //uiForbiddenZeroBit should always equal to 0
|
||||
}
|
||||
|
||||
@@ -186,8 +187,6 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
|
||||
pCurNal = &pCtx->sPrefixNal;
|
||||
|
||||
if (iNalSize < NAL_UNIT_HEADER_EXT_SIZE) {
|
||||
pCtx->iErrorCode |= dsBitstreamError;
|
||||
|
||||
PAccessUnit pCurAu = pCtx->pAccessUnitList;
|
||||
uint32_t uiAvailNalNum = pCurAu->uiAvailUnitsNum;
|
||||
|
||||
@@ -198,6 +197,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
|
||||
}
|
||||
}
|
||||
pCurNal->sNalData.sPrefixNal.bPrefixNalCorrectFlag = false;
|
||||
pCtx->iErrorCode |= dsBitstreamError;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
|
||||
}
|
||||
}
|
||||
pCurNal->sNalData.sPrefixNal.bPrefixNalCorrectFlag = false;
|
||||
pCtx->iErrorCode |= dsInvalidArgument;
|
||||
pCtx->iErrorCode |= dsBitstreamError;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -260,14 +260,13 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
|
||||
|
||||
if (pNalUnitHeader->eNalUnitType == NAL_UNIT_CODED_SLICE_EXT) {
|
||||
if (iNalSize < NAL_UNIT_HEADER_EXT_SIZE) {
|
||||
pCtx->iErrorCode |= dsBitstreamError;
|
||||
|
||||
ForceClearCurrentNal (pCurAu);
|
||||
|
||||
if (uiAvailNalNum > 1) {
|
||||
pCurAu->uiEndPos = uiAvailNalNum - 2;
|
||||
pCtx->bAuReadyFlag = true;
|
||||
}
|
||||
pCtx->iErrorCode |= dsBitstreamError;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -281,13 +280,13 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
|
||||
WelsLog (pLogCtx, WELS_LOG_WARNING, "ParseNalHeader():bUseRefBasePicFlag (%d) != 0, MGS not supported!\n",
|
||||
pCurNal->sNalHeaderExt.bUseRefBasePicFlag);
|
||||
|
||||
pCtx->iErrorCode |= dsInvalidArgument;
|
||||
ForceClearCurrentNal (pCurAu);
|
||||
|
||||
if (uiAvailNalNum > 1) {
|
||||
pCurAu->uiEndPos = uiAvailNalNum - 2;
|
||||
pCtx->bAuReadyFlag = true;
|
||||
}
|
||||
pCtx->iErrorCode |= dsBitstreamError;
|
||||
return NULL;
|
||||
}
|
||||
pNal += NAL_UNIT_HEADER_EXT_SIZE;
|
||||
@@ -321,6 +320,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
|
||||
pCurAu->uiEndPos = uiAvailNalNum - 2;
|
||||
pCtx->bAuReadyFlag = true;
|
||||
}
|
||||
pCtx->iErrorCode |= dsBitstreamError;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -433,6 +433,7 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
|
||||
|
||||
if (NULL == DetectStartCodePrefix (kpBsBuf, &iOffset,
|
||||
kiBsLen)) { //CAN'T find the 00 00 01 start prefix from the source buffer
|
||||
pCtx->iErrorCode |= dsBitstreamError;
|
||||
return dsBitstreamError;
|
||||
}
|
||||
|
||||
|
||||
@@ -133,9 +133,8 @@ static void FillDefault (SEncParamExt& param) {
|
||||
param.iPicHeight = 0; // actual input picture height
|
||||
|
||||
param.fMaxFrameRate = MAX_FRAME_RATE; // maximal frame rate [Hz / fps]
|
||||
param.iInputCsp = videoFormatI420; // input sequence color space in default
|
||||
param.uiFrameToBeCoded = (uint32_t) - 1; // frame to be encoded (at input frame rate)
|
||||
|
||||
param.iComplexityMode = MEDIUM_COMPLEXITY;
|
||||
param.iTargetBitrate = 0; // overall target bitrate introduced in RC module
|
||||
param.iMaxBitrate = MAX_BIT_RATE;
|
||||
param.iMultipleThreadIdc = 1;
|
||||
@@ -203,7 +202,7 @@ void FillDefault() {
|
||||
iCountThreadsNum = 1; // # derived from disable_multiple_slice_idc (=0 or >1) means;
|
||||
|
||||
iDecompStages = 0; // GOP size dependency, unknown here and be revised later
|
||||
|
||||
iComplexityMode = MEDIUM_COMPLEXITY;
|
||||
memset (sDependencyLayers, 0, sizeof (SSpatialLayerInternal)*MAX_DEPENDENCY_LAYER);
|
||||
memset (sSpatialLayers, 0 , sizeof (SSpatialLayerConfig)*MAX_SPATIAL_LAYER_NUM);
|
||||
|
||||
@@ -223,7 +222,6 @@ void FillDefault() {
|
||||
|
||||
int32_t ParamBaseTranscode (const SEncParamBase& pCodingParam) {
|
||||
|
||||
iInputCsp = pCodingParam.iInputCsp; // color space of input sequence
|
||||
fMaxFrameRate = WELS_CLIP3 (pCodingParam.fMaxFrameRate, MIN_FRAME_RATE, MAX_FRAME_RATE);
|
||||
iTargetBitrate = pCodingParam.iTargetBitrate;
|
||||
iUsageType = pCodingParam.iUsageType;
|
||||
@@ -271,7 +269,6 @@ int32_t ParamBaseTranscode (const SEncParamBase& pCodingParam) {
|
||||
}
|
||||
void GetBaseParams (SEncParamBase* pCodingParam) {
|
||||
pCodingParam->iUsageType = iUsageType;
|
||||
pCodingParam->iInputCsp = iInputCsp;
|
||||
pCodingParam->iPicWidth = iPicWidth;
|
||||
pCodingParam->iPicHeight = iPicHeight;
|
||||
pCodingParam->iTargetBitrate = iTargetBitrate;
|
||||
@@ -281,12 +278,10 @@ void GetBaseParams (SEncParamBase* pCodingParam) {
|
||||
int32_t ParamTranscode (const SEncParamExt& pCodingParam) {
|
||||
float fParamMaxFrameRate = WELS_CLIP3 (pCodingParam.fMaxFrameRate, MIN_FRAME_RATE, MAX_FRAME_RATE);
|
||||
|
||||
iInputCsp = pCodingParam.iInputCsp; // color space of input sequence
|
||||
uiFrameToBeCoded = (uint32_t) -
|
||||
1; // frame to be encoded (at input frame rate), -1 dependents on length of input sequence
|
||||
iUsageType = pCodingParam.iUsageType;
|
||||
iPicWidth = pCodingParam.iPicWidth;
|
||||
iPicHeight = pCodingParam.iPicHeight;
|
||||
iComplexityMode = pCodingParam.iComplexityMode;
|
||||
|
||||
SUsedPicRect.iLeft = 0;
|
||||
SUsedPicRect.iTop = 0;
|
||||
@@ -297,7 +292,8 @@ int32_t ParamTranscode (const SEncParamExt& pCodingParam) {
|
||||
|
||||
/* Deblocking loop filter */
|
||||
iLoopFilterDisableIdc = pCodingParam.iLoopFilterDisableIdc; // 0: on, 1: off, 2: on except for slice boundaries,
|
||||
if (iLoopFilterDisableIdc == 0 && iMultipleThreadIdc != 1) // Loop filter requested to be enabled, with threading enabled
|
||||
if (iLoopFilterDisableIdc == 0
|
||||
&& iMultipleThreadIdc != 1) // Loop filter requested to be enabled, with threading enabled
|
||||
iLoopFilterDisableIdc = 2; // Disable loop filter on slice boundaries since that's not allowed with multithreading
|
||||
iLoopFilterAlphaC0Offset = pCodingParam.iLoopFilterAlphaC0Offset; // AlphaOffset: valid range [-6, 6], default 0
|
||||
iLoopFilterBetaOffset = pCodingParam.iLoopFilterBetaOffset; // BetaOffset: valid range [-6, 6], default 0
|
||||
|
||||
@@ -102,9 +102,7 @@ int32_t ParamValidation (SLogContext* pLogCtx, SWelsSvcCodingParam* pCfg) {
|
||||
WelsLog (pLogCtx, WELS_LOG_WARNING,
|
||||
"ParamValidation(), screen change detection should be turned on,change bEnableSceneChangeDetect as true\n");
|
||||
}
|
||||
//LTR logic needs more testing
|
||||
pCfg->bEnableLongTermReference = false;
|
||||
pCfg->iLTRRefNum = 0;
|
||||
|
||||
}
|
||||
if (pCfg->iSpatialLayerNum > 1) {
|
||||
int32_t iFinalWidth = pCfg->sSpatialLayers[pCfg->iSpatialLayerNum - 1].iVideoWidth;
|
||||
@@ -3712,13 +3710,16 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa
|
||||
|
||||
// we can not use direct struct based memcpy due some fields need keep unchanged as before
|
||||
pOldParam->fMaxFrameRate = pNewParam->fMaxFrameRate; // maximal frame rate [Hz / fps]
|
||||
pOldParam->iInputCsp = pNewParam->iInputCsp; // color space of input sequence
|
||||
pOldParam->iComplexityMode = pNewParam->iComplexityMode; // color space of input sequence
|
||||
pOldParam->uiIntraPeriod = pNewParam->uiIntraPeriod; // intra period (multiple of GOP size as desired)
|
||||
pOldParam->bEnableSpsPpsIdAddition = pNewParam->bEnableSpsPpsIdAddition;
|
||||
pOldParam->bPrefixNalAddingCtrl = pNewParam->bPrefixNalAddingCtrl;
|
||||
pOldParam->iNumRefFrame = pNewParam->iNumRefFrame; // number of reference frame used
|
||||
pOldParam->uiGopSize = pNewParam->uiGopSize;
|
||||
if (pOldParam->iTemporalLayerNum != pNewParam->iTemporalLayerNum) {
|
||||
pOldParam->iTemporalLayerNum = pNewParam->iTemporalLayerNum;
|
||||
(*ppCtx)->iCodingIndex = 0;
|
||||
}
|
||||
pOldParam->iDecompStages = pNewParam->iDecompStages;
|
||||
/* denoise control */
|
||||
pOldParam->bEnableDenoise = pNewParam->bEnableDenoise;
|
||||
|
||||
@@ -293,14 +293,6 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) {
|
||||
}
|
||||
#endif//REC_FRAME_COUNT
|
||||
|
||||
const int32_t iColorspace = pCfg->iInputCsp;
|
||||
if (videoFormatI420 != iColorspace) {
|
||||
WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid iInputCsp= %d.\n",
|
||||
iColorspace);
|
||||
Uninitialize();
|
||||
return cmInitParaError;
|
||||
}
|
||||
|
||||
// Check valid parameters
|
||||
const int32_t iNumOfLayers = pCfg->iSpatialLayerNum;
|
||||
if (iNumOfLayers < 1 || iNumOfLayers > MAX_DEPENDENCY_LAYER) {
|
||||
@@ -378,7 +370,6 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) {
|
||||
}
|
||||
|
||||
const int32_t kiDecStages = WELS_LOG2 (pCfg->uiGopSize);
|
||||
pCfg->iInputCsp = iColorspace;
|
||||
pCfg->iTemporalLayerNum = (int8_t) (1 + kiDecStages);
|
||||
pCfg->iLoopFilterAlphaC0Offset = WELS_CLIP3 (pCfg->iLoopFilterAlphaC0Offset, -6, 6);
|
||||
pCfg->iLoopFilterBetaOffset = WELS_CLIP3 (pCfg->iLoopFilterBetaOffset, -6, 6);
|
||||
@@ -393,7 +384,6 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) {
|
||||
return cmInitParaError;
|
||||
}
|
||||
|
||||
m_iCspInternal = iColorspace;
|
||||
m_bInitialFlag = true;
|
||||
|
||||
return cmResultSuccess;
|
||||
@@ -645,16 +635,12 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) {
|
||||
case ENCODER_OPTION_SVC_ENCODE_PARAM_EXT: { // SVC Encoding Parameter
|
||||
SEncParamExt sEncodingParam;
|
||||
SWelsSvcCodingParam sConfig;
|
||||
int32_t iInputColorspace = 0;
|
||||
int32_t iTargetWidth = 0;
|
||||
int32_t iTargetHeight = 0;
|
||||
|
||||
memcpy (&sEncodingParam, pOption, sizeof (SEncParamExt)); // confirmed_safe_unsafe_usage
|
||||
WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
|
||||
"ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, sEncodingParam.iInputCsp= 0x%x\n",
|
||||
sEncodingParam.iInputCsp);
|
||||
WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
|
||||
"coding_param->iPicWidth= %d;coding_param->iPicHeight= %d;coding_param->iTargetBitrate= %d; coding_param->iMaxBitrate= %d; coding_param->iRCMode= %d;coding_param->iPaddingFlag= %d;coding_param->iTemporalLayerNum= %d;coding_param->iSpatialLayerNum= %d;coding_param->fFrameRate= %.6ff;coding_param->iInputCsp= %d;coding_param->uiIntraPeriod= %d;coding_param->bEnableSpsPpsIdAddition = %d;coding_param->bPrefixNalAddingCtrl = %d;coding_param->bEnableDenoise= %d;coding_param->bEnableBackgroundDetection= %d;coding_param->bEnableAdaptiveQuant= %d;coding_param->bEnableAdaptiveQuant= %d;coding_param->bEnableLongTermReference= %d;coding_param->iLtrMarkPeriod= %d;\n",
|
||||
"coding_param->iPicWidth= %d;coding_param->iPicHeight= %d;coding_param->iTargetBitrate= %d; coding_param->iMaxBitrate= %d; coding_param->iRCMode= %d;coding_param->iPaddingFlag= %d;coding_param->iTemporalLayerNum= %d;coding_param->iSpatialLayerNum= %d;coding_param->fFrameRate= %.6ff;coding_param->uiIntraPeriod= %d;coding_param->bEnableSpsPpsIdAddition = %d;coding_param->bPrefixNalAddingCtrl = %d;coding_param->bEnableDenoise= %d;coding_param->bEnableBackgroundDetection= %d;coding_param->bEnableAdaptiveQuant= %d;coding_param->bEnableAdaptiveQuant= %d;coding_param->bEnableLongTermReference= %d;coding_param->iLtrMarkPeriod= %d;\n",
|
||||
sEncodingParam.iPicWidth,
|
||||
sEncodingParam.iPicHeight,
|
||||
sEncodingParam.iTargetBitrate,
|
||||
@@ -664,7 +650,6 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) {
|
||||
sEncodingParam.iTemporalLayerNum,
|
||||
sEncodingParam.iSpatialLayerNum,
|
||||
sEncodingParam.fMaxFrameRate,
|
||||
sEncodingParam.iInputCsp,
|
||||
sEncodingParam.uiIntraPeriod,
|
||||
sEncodingParam.bEnableSpsPpsIdAddition,
|
||||
sEncodingParam.bPrefixNalAddingCtrl,
|
||||
@@ -702,7 +687,6 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) {
|
||||
return cmInitParaError;
|
||||
}
|
||||
|
||||
iInputColorspace = sEncodingParam.iInputCsp;
|
||||
if (sConfig.ParamTranscode (sEncodingParam)) {
|
||||
return cmInitParaError;
|
||||
}
|
||||
@@ -711,11 +695,10 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) {
|
||||
}
|
||||
iTargetWidth = sConfig.iPicWidth;
|
||||
iTargetHeight = sConfig.iPicHeight;
|
||||
if (m_iCspInternal != iInputColorspace || m_iMaxPicWidth != iTargetWidth
|
||||
|| m_iMaxPicHeight != iTargetHeight) { // for color space due to changed
|
||||
if (m_iMaxPicWidth != iTargetWidth
|
||||
|| m_iMaxPicHeight != iTargetHeight) {
|
||||
m_iMaxPicWidth = iTargetWidth;
|
||||
m_iMaxPicHeight = iTargetHeight;
|
||||
m_iCspInternal = iInputColorspace;
|
||||
}
|
||||
#ifdef REC_FRAME_COUNT
|
||||
WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
|
||||
@@ -724,7 +707,6 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) {
|
||||
#endif//REC_FRAME_COUNT
|
||||
|
||||
/* New configuration available here */
|
||||
sConfig.iInputCsp = m_iCspInternal; // I420 in default designed for presentation in encoder used internal
|
||||
sConfig.DetermineTemporalSettings();
|
||||
|
||||
/* Check every field whether there is new request for memory block changed or else, Oct. 24, 2008 */
|
||||
@@ -953,6 +935,11 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) {
|
||||
m_pEncContext->iDropNumber = pValue->iDropNum;
|
||||
}
|
||||
break;
|
||||
case ENCODER_OPTION_COMPLEXITY: {
|
||||
int32_t iValue = * ((int32_t*)pOption);
|
||||
m_pEncContext->pSvcParam->iComplexityMode = (ECOMPLEXITY_MODE)iValue;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return cmInitParaError;
|
||||
}
|
||||
@@ -1055,6 +1042,10 @@ int CWelsH264SVCEncoder::GetOption (ENCODER_OPTION eOptionId, void* pOption) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ENCODER_OPTION_COMPLEXITY: {
|
||||
* ((int32_t*)pOption) = m_pEncContext->pSvcParam->iComplexityMode;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return cmInitParaError;
|
||||
}
|
||||
|
||||
@@ -56,7 +56,6 @@
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
AssemblerListingLocation=""
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
@@ -72,7 +71,6 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkLibraryDependencies="true"
|
||||
OutputFile="$(OutDir)\welsvp.dll"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile="../../src/common/WelsVP.def"
|
||||
@@ -140,7 +138,6 @@
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
AssemblerListingLocation=""
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
@@ -156,7 +153,6 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkLibraryDependencies="true"
|
||||
OutputFile="$(OutDir)\welsvp.dll"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile="../../src/common/WelsVP.def"
|
||||
@@ -220,15 +216,15 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
EnableIntrinsicFunctions="false"
|
||||
InlineFunctionExpansion="2"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories="../../../common/inc;../../interface;../../src/common"
|
||||
PreprocessorDefinitions="NDEBUG;_USRDLL;X86_ASM"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="false"
|
||||
UsePrecompiledHeader="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="0"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
@@ -251,8 +247,6 @@
|
||||
MapFileName=""
|
||||
MapExports="false"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
@@ -310,15 +304,15 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="3"
|
||||
EnableIntrinsicFunctions="false"
|
||||
InlineFunctionExpansion="2"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories="../../../common/inc;../../interface;../../src/common"
|
||||
PreprocessorDefinitions="NDEBUG;_USRDLL;X86_ASM"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="false"
|
||||
UsePrecompiledHeader="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="0"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
@@ -341,8 +335,6 @@
|
||||
MapFileName=""
|
||||
MapExports="false"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
|
||||
@@ -232,7 +232,6 @@ class OpenH264VideoEncoder : public GMPVideoEncoder {
|
||||
|
||||
// TODO(ekr@rtfm.com). Scary conversion from unsigned char to float below.
|
||||
param.fMaxFrameRate = static_cast<float> (codecSettings.mMaxFramerate);
|
||||
param.iInputCsp = videoFormatI420;
|
||||
|
||||
rv = encoder_->Initialize (¶m);
|
||||
if (rv) {
|
||||
|
||||
54
run_Test.sh
Executable file
54
run_Test.sh
Executable file
@@ -0,0 +1,54 @@
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
#usage:runMain ${TestType} ${TestBitStream}
|
||||
runMain()
|
||||
{
|
||||
local ParameterFlag=""
|
||||
if [ $# -eq 1 -a "$1" = "UnitTest" ]
|
||||
then
|
||||
let "ParameterFlag=0"
|
||||
elif [ $# -eq 2 -a "$1" = "BinaryCompare" ]
|
||||
then
|
||||
let "ParameterFlag=0"
|
||||
else
|
||||
let "ParameterFlag=1"
|
||||
fi
|
||||
|
||||
if [ ! ${ParameterFlag} -eq 0 ]
|
||||
then
|
||||
echo "usage: runMain UnitTest "
|
||||
echo " or runMain BinaryCompare \${TestBitStreamName} "
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
local TestType=$1
|
||||
local TestBitStream=$2
|
||||
|
||||
if [ "${TestType}" = "UnitTest" ]
|
||||
then
|
||||
make -B ENABLE64BIT=Yes BUILDTYPE=Release all plugin test
|
||||
make -B ENABLE64BIT=Yes BUILDTYPE=Debug all plugin test
|
||||
make -B ENABLE64BIT=No BUILDTYPE=Release all plugin test
|
||||
make -B ENABLE64BIT=No BUILDTYPE=Debug all plugin test
|
||||
elif [ "${TestType}" = "BinaryCompare" ]
|
||||
then
|
||||
echo ""
|
||||
echo " binary compare test, test bit stream is ${TestBitStream}"
|
||||
echo ""
|
||||
./test/encoder_binary_comparison/run_OneBitStream.sh ${TestBitStream}
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
TestType=$1
|
||||
TestBitStream=$2
|
||||
|
||||
runMain ${TestType} ${TestBitStream}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ static int InitWithParam (ISVCEncoder* encoder, EUsageType usageType, int width,
|
||||
param.iPicWidth = width;
|
||||
param.iPicHeight = height;
|
||||
param.iTargetBitrate = 5000000;
|
||||
param.iInputCsp = videoFormatI420;
|
||||
|
||||
return encoder->Initialize (¶m);
|
||||
} else {
|
||||
@@ -28,7 +27,6 @@ static int InitWithParam (ISVCEncoder* encoder, EUsageType usageType, int width,
|
||||
param.iPicWidth = width;
|
||||
param.iPicHeight = height;
|
||||
param.iTargetBitrate = 5000000;
|
||||
param.iInputCsp = videoFormatI420;
|
||||
param.bEnableDenoise = denoise;
|
||||
param.iSpatialLayerNum = layers;
|
||||
|
||||
|
||||
@@ -41,7 +41,6 @@ class EncoderInterfaceTest : public ::testing::Test {
|
||||
|
||||
void EncoderInterfaceTest::TemporalLayerSettingTest() {
|
||||
|
||||
pParamExt->iInputCsp = 23;
|
||||
pParamExt->iPicWidth = m_iWidth;
|
||||
pParamExt->iPicHeight = m_iHeight;
|
||||
pParamExt->iTargetBitrate = 60000;
|
||||
|
||||
4
test/encoder_binary_comparison/.gitignore
vendored
Normal file
4
test/encoder_binary_comparison/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
AllTestData
|
||||
Codec
|
||||
FinalResult
|
||||
build.log
|
||||
66
test/encoder_binary_comparison/AboutTest
Normal file
66
test/encoder_binary_comparison/AboutTest
Normal file
@@ -0,0 +1,66 @@
|
||||
|
||||
about
|
||||
#*******************************************************************************
|
||||
1.This file is about how to run encoder binary comparison test.
|
||||
Binary comparison is the comparison between target encoder and benchmark encoder.
|
||||
|
||||
2.As SHA1 string is unique for bit stream file. so in current test, we only compare
|
||||
the SHA1 string of bit stream. If the SHA1 string of target bit stream is the same
|
||||
with benchmark's, the related test case can be verified as pass status.
|
||||
|
||||
3.SHA1 table files for each test bit stream are pre-generated.
|
||||
For how to update SHA1 tables, please go to below part "how to update SHA1 table"
|
||||
|
||||
4.SHA1 tables can be found in folder ./SHA1Table/
|
||||
|
||||
5.Test bit streams are those xxx.264 files in folder openh264/res/
|
||||
--If you want to change the test bit stream on travis test,
|
||||
please go to part "for travis test"
|
||||
--If you want to run test locally, please to go part "for local test"
|
||||
|
||||
|
||||
how to update SHA1 table
|
||||
#*******************************************************************************
|
||||
If there is something change in bit stream due to your encoder design;
|
||||
you need to update the SHA1 tables in ./SHA1Table.As the SHA1 string is unique, once the
|
||||
bit stream change, the SHA1 string will also change.
|
||||
|
||||
If you want to update SHA1 table files in ./SHA1Tabel, please run below command under
|
||||
openh264/test/encoder_binary_test,
|
||||
./run_Main.sh UpdateSHA1Table
|
||||
|
||||
for travis test
|
||||
#*******************************************************************************
|
||||
Currently, travis only allow 5 jobs on parallel status, and 2 jobs are for
|
||||
unit test with g++ and clang compiler. So there will be only 3 jobs left for encoder
|
||||
binary comparison test, which means that 3 of 27 bit stream in ./res folder are chosen for test.
|
||||
|
||||
Actually, you can use all of test bit streams in ./res folder, but it will take
|
||||
a long time to wait for the test result. So we do not suggest to do so.
|
||||
If you want to test all cases for all test bit steams in ./res,you need to generate related
|
||||
SHA1 table files before you add those bit streams into below setting.
|
||||
|
||||
To change the test bit steam in travis, you can edit file .travis.yml.
|
||||
For example,if you want to add CVPCMNL1_SVA_C.264 as test bit stream, you can add on line and
|
||||
change the TestParameter value to CVPCMNL1_SVA_C.264
|
||||
- TASK=BinaryCompare; TestParameter=CVPCMNL1_SVA_C.264;
|
||||
|
||||
Below is the example for adding CVPCMNL1_SVA_C.264 into test list.
|
||||
****************************************************************************************
|
||||
env:
|
||||
- TASK=UnitTest; TestParameter=""
|
||||
- TASK=BinaryCompare; TestParameter=BA_MW_D.264;
|
||||
- TASK=BinaryCompare; TestParameter=MR2_MW_A.264;
|
||||
- TASK=BinaryCompare; TestParameter=CVPCMNL1_SVA_C.264;
|
||||
****************************************************************************************
|
||||
|
||||
for local test
|
||||
#*******************************************************************************
|
||||
If you want to run the test locally,you can run below command:
|
||||
./run_Main.sh LocalTest
|
||||
|
||||
All SHA1 tables in ./SHA1Table/ folder will be tested.
|
||||
And the final result can be found in folder ./FinalResult, which include:
|
||||
--console log for each test bit stream (XXXX.TestLog)
|
||||
--pass status for each case each bit stream (xxx_AllCaseOutput.csv)
|
||||
--pass status for each case each bit stream (xxx_unpassCaseOutput.csv)
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
408
test/encoder_binary_comparison/Scripts/run_BinarySHA1Comparison.sh
Executable file
408
test/encoder_binary_comparison/Scripts/run_BinarySHA1Comparison.sh
Executable file
@@ -0,0 +1,408 @@
|
||||
#!/bin/bash
|
||||
#*******************************************************************************
|
||||
# Encoder binary comparison test model
|
||||
# -- Compared with Benchmark version using SHA-1 string
|
||||
# -- Test bit stream under folder openh264/res
|
||||
# -- SHA-1 string of Benchmark version for all cases of all bit streams
|
||||
# under folder openh264/test/encoder_binary_comparion/SHA1Table
|
||||
# -- For more detail,please refer to file AboutTest¡£
|
||||
#
|
||||
#brief:
|
||||
# -- Test all cases in SHA1TableFile
|
||||
# 1) Generate SHA1 string for each case
|
||||
# 2) Compare with benchmark SHA1 string
|
||||
# 3) If the SHA1 string are the same with benchmark version, test case is marked as passed
|
||||
# 4) Otherwise, test case is marked as unpass! this may caused by:
|
||||
# --the design of encoder has been changed and the bit stream also change
|
||||
# --there may be some bugs in encoder and bit stream is not right
|
||||
# -- Usage: ./run_BinarySHA1Comparison.sh ${TestYUVName} ${AllCaseSHA1TaleFile}
|
||||
#
|
||||
# date: 10/06/2014 Created
|
||||
#*******************************************************************************
|
||||
#global variable definition
|
||||
#usage runGlobalVariableDef
|
||||
runGlobalVariableDef()
|
||||
{
|
||||
WorkingDirDir=""
|
||||
#test data space
|
||||
FinalResultPath=""
|
||||
IssueDataPath=""
|
||||
TempDataPath=""
|
||||
#for test sequence info
|
||||
TestSequenceName=""
|
||||
PicW=""
|
||||
PicH=""
|
||||
#test cfg file and test info output file
|
||||
ConfigureFile=""
|
||||
AllCaseFile=""
|
||||
#xxx.csv
|
||||
AllCasePassStatusFile=""
|
||||
#for encoder command
|
||||
declare -a EncoderCommandSet
|
||||
declare -a EncoderCommandName
|
||||
declare -a EncoderCommandValue
|
||||
#encoder parameters change based on the case info
|
||||
CaseInfo=""
|
||||
BitStreamFile=""
|
||||
DiffFlag=""
|
||||
#pass number
|
||||
TotalCaseNum=""
|
||||
PassCaseNum=""
|
||||
UnpassCaseNum=""
|
||||
}
|
||||
#called by runGlobalVariableInitial
|
||||
#usage runEncoderCommandInital
|
||||
runEncoderCommandInital()
|
||||
{
|
||||
EncoderCommandSet=(-frms \
|
||||
-numtl \
|
||||
-scrsig \
|
||||
-rc \
|
||||
-tarb \
|
||||
"-lqp 0" \
|
||||
-iper \
|
||||
"-slcmd 0" \
|
||||
"-slcnum 0" \
|
||||
-thread \
|
||||
-ltr \
|
||||
-db \
|
||||
-nalsize \
|
||||
-denois \
|
||||
-scene \
|
||||
-bgd \
|
||||
-aq)
|
||||
EncoderCommandName=(FrEcoded \
|
||||
NumTempLayer \
|
||||
ContentSig \
|
||||
RC \
|
||||
BitRate \
|
||||
QP \
|
||||
IntraPeriod \
|
||||
SlcMd \
|
||||
SlcMum \
|
||||
ThrMum \
|
||||
LTR \
|
||||
LFilterIDC \
|
||||
MacNalSize \
|
||||
DenoiseFlag \
|
||||
SceneChangeFlag \
|
||||
BackgroundFlag \
|
||||
AQFlag)
|
||||
EncoderCommandValue=(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
|
||||
NumParameter=${#EncoderCommandSet[@]}
|
||||
}
|
||||
runGlobalVariableInitial()
|
||||
{
|
||||
#TestSpaceDir=../AllTestData CurrentDir=../AllTestData/TestSetXXX/***.264 eg ../AllTestData/TestSetCIF/BA1_MWD.264
|
||||
CurrentDir=`pwd`
|
||||
#test data space
|
||||
FinalResultPath="${CurrentDir}/result"
|
||||
IssueDataPath="${CurrentDir}/issue"
|
||||
TempDataPath="TempData"
|
||||
TestSequencePath="${CurrentDir}"
|
||||
#get YUV detail info $picW $picH $FPS
|
||||
declare -a aYUVInfo
|
||||
aYUVInfo=(`./run_ParseYUVInfo.sh ${TestSequenceName}`)
|
||||
PicW=${aYUVInfo[0]}
|
||||
PicH=${aYUVInfo[1]}
|
||||
#test cfg file and test info output file
|
||||
ConfigureFile=welsenc.cfg
|
||||
AllCasePassStatusFile="${FinalResultPath}/${TestSequenceName}_AllCaseOutput.csv"
|
||||
UnpassCaseFile="${FinalResultPath}/${TestSequenceName}_unpassCaseOutput.csv"
|
||||
UpdateSHA1TableFile="${FinalResultPath}/${TestSequenceName}_UpdateSHA1Table.csv"
|
||||
echo "BitMatched Status, \
|
||||
SHA-1-Target, SHA-1-Benchmark, \
|
||||
MD5-Target, MD5-Benchmark, \
|
||||
Bitstream-Target,Bitstream-Benchmark, \
|
||||
YUV-Target,YUV-Benchmark, \
|
||||
-frms, -numtl, -scrsig, -rc, \
|
||||
-tarb, -lqp 0, -iper, \
|
||||
-slcmd 0,-slcnum 0, -thread, \
|
||||
-ltr, -db, -nalsize,-denois, \
|
||||
-scene, -bgd, -aq">${AllCasePassStatusFile}
|
||||
|
||||
echo "BitMatched Status, \
|
||||
SHA-1-Target, SHA-1-Benchmark, \
|
||||
MD5-Target, MD5-Benchmark, \
|
||||
Bitstream-Target,Bitstream-Benchmark,\
|
||||
YUV-Target,YUV-Benchmark, \
|
||||
-frms, -numtl, -scrsig, -rc, \
|
||||
-tarb, -lqp 0, -iper, \
|
||||
-slcmd 0,-slcnum 0, -thread, \
|
||||
-ltr, -db, -nalsize,-denois, \
|
||||
-scene, -bgd, -aq">${UnpassCaseFile}
|
||||
|
||||
echo "SHA-1 Value, \
|
||||
MD5String, BitStreamSize, YUVSize, \
|
||||
-frms, -numtl, -scrsig, -rc, \
|
||||
-tarb, -lqp 0, -iper, \
|
||||
-slcmd 0,-slcnum 0, -thread, \
|
||||
-ltr, -db, -MaxNalSize,-denois, \
|
||||
-scene, -bgd, -aq">${UpdateSHA1TableFile}
|
||||
#intial Commandline parameters
|
||||
runEncoderCommandInital
|
||||
let "TotalCaseNum=0"
|
||||
let "PassCaseNum=0"
|
||||
let "UnpassCaseNum=0"
|
||||
EncoderCommand=""
|
||||
EncoderLogFile="${TempDataPath}/Encoder.log"
|
||||
TargetSHA1=""
|
||||
TargetMD5=""
|
||||
TargetYUVSize=""
|
||||
TargetBitstreamSize=""
|
||||
BenchmarkSHA1=""
|
||||
BenchmarkMD5=""
|
||||
BenchmarkYUVSize=""
|
||||
BenchmarkBitstreamSize=""
|
||||
}
|
||||
#***********************************************************
|
||||
#called by runAllCaseTest
|
||||
# parse case info --encoder preprocess
|
||||
#usage runParseCaseInfo $CaseData
|
||||
runParseCaseInfo()
|
||||
{
|
||||
if [ $# -lt 1 ]
|
||||
then
|
||||
echo "runParseCaseInfo \$CaseData"
|
||||
return 1
|
||||
fi
|
||||
local TempData=""
|
||||
local BitstreamPrefix=""
|
||||
local CaseData=$@
|
||||
BenchmarkSHA1=`echo $CaseData |awk 'BEGIN {FS="[,\r]"} {print $1} ' `
|
||||
BenchmarkMD5=`echo $CaseData |awk 'BEGIN {FS="[,\r]"} {print $2} ' `
|
||||
BenchmarkYUVSize=`echo $CaseData |awk 'BEGIN {FS="[,\r]"} {print $4} ' `
|
||||
BenchmarkBitstreamSize=`echo $CaseData |awk 'BEGIN {FS="[,\r]"} {print $3} ' `
|
||||
TempData=`echo $CaseData |awk 'BEGIN {FS="[,\r]"} {for(i=5;i<=NF;i++) printf(" %s",$i)} ' `
|
||||
EncoderCommandValue=(${TempData})
|
||||
for((i=0; i<$NumParameter; i++))
|
||||
do
|
||||
BitstreamPrefix=${BitstreamPrefix}_${EncoderCommandName[$i]}_${EncoderCommandValue[$i]}
|
||||
done
|
||||
BitstreamTarget=${TempDataPath}/${TestSequenceName}_${BitstreamPrefix}_codec_target.264
|
||||
echo ""
|
||||
echo "BitstreamPrefix is ${BitstreamPrefix}"
|
||||
echo ""
|
||||
}
|
||||
#called by runAllCaseTest
|
||||
#usage runEncodeOneCase
|
||||
runEncodeOneCase()
|
||||
{
|
||||
BitStreamFile=${BitstreamTarget}
|
||||
CaseCommand=" ${ConfigureFile} \
|
||||
-numl 1 \
|
||||
-lconfig 0 layer2.cfg \
|
||||
-sw ${PicW} -sh ${PicH} \
|
||||
-dw 0 ${PicW} -dh 0 ${PicH} \
|
||||
-frout 0 30 \
|
||||
-ltarb 0 ${EncoderCommandValue[4]} \
|
||||
${EncoderCommandSet[0]} ${EncoderCommandValue[0]} \
|
||||
${EncoderCommandSet[1]} ${EncoderCommandValue[1]} \
|
||||
${EncoderCommandSet[2]} ${EncoderCommandValue[2]} \
|
||||
${EncoderCommandSet[3]} ${EncoderCommandValue[3]} \
|
||||
${EncoderCommandSet[4]} ${EncoderCommandValue[4]} \
|
||||
${EncoderCommandSet[5]} ${EncoderCommandValue[5]} \
|
||||
${EncoderCommandSet[6]} ${EncoderCommandValue[6]} \
|
||||
${EncoderCommandSet[7]} ${EncoderCommandValue[7]} \
|
||||
${EncoderCommandSet[8]} ${EncoderCommandValue[8]} \
|
||||
${EncoderCommandSet[9]} ${EncoderCommandValue[9]} \
|
||||
${EncoderCommandSet[10]} ${EncoderCommandValue[10]} \
|
||||
${EncoderCommandSet[11]} ${EncoderCommandValue[11]} \
|
||||
${EncoderCommandSet[12]} ${EncoderCommandValue[12]} \
|
||||
${EncoderCommandSet[13]} ${EncoderCommandValue[13]} \
|
||||
${EncoderCommandSet[14]} ${EncoderCommandValue[14]} \
|
||||
${EncoderCommandSet[15]} ${EncoderCommandValue[15]} \
|
||||
${EncoderCommandSet[16]} ${EncoderCommandValue[16]}"
|
||||
echo ${EncoderCommandSet[@]}
|
||||
echo ${EncoderCommandValue[@]}
|
||||
echo ${EncoderCommandSet[11]}
|
||||
echo ${EncoderCommandValue[11]}
|
||||
echo ${EncoderCommandSet[12]}
|
||||
echo ${EncoderCommandValue[12]}
|
||||
EncoderCommand="./h264enc ${CaseCommand} -bf ${BitStreamFile} -org ${TestSequencePath}/${TestSequenceName} "
|
||||
echo ""
|
||||
echo "case line is :"
|
||||
echo " ${EncoderCommand}"
|
||||
echo -e "\n\n"
|
||||
./h264enc ${CaseCommand} \
|
||||
-bf ${BitStreamFile} \
|
||||
-org ${TestSequencePath}/${TestSequenceName} 2>${EncoderLogFile}
|
||||
}
|
||||
#usage? runGetFileSize $FileName
|
||||
runGetFileSize()
|
||||
{
|
||||
if [ $# -lt 1 ]
|
||||
then
|
||||
echo "usage runGetFileSize $FileName!"
|
||||
return 1
|
||||
fi
|
||||
local FileName=$1
|
||||
local FileSize=""
|
||||
local TempInfo=""
|
||||
TempInfo=`ls -l $FileName`
|
||||
FileSize=`echo $TempInfo | awk '{print $5}'`
|
||||
echo $FileSize
|
||||
}
|
||||
#called by runAllCaseTest
|
||||
#usage runJSVMVerify
|
||||
runBitStreamVerify()
|
||||
{
|
||||
echo ""
|
||||
echo "******************************************"
|
||||
echo "Bit streamSHA1 value comparison.... "
|
||||
#*******************************************
|
||||
if [ ! -s ${BitStreamFile} ]
|
||||
then
|
||||
let "UnpassCaseNum++"
|
||||
DiffFlag="2:unpassed! 0 bits--bit stream"
|
||||
return 1
|
||||
fi
|
||||
#*******************************************
|
||||
#*******************************************
|
||||
#SHA1(run_Test.sh)= fde74d9e8194d0cf28991a0481c7158a033ec920
|
||||
TargetSHA1=`openssl sha1 ${BitStreamFile}`
|
||||
TargetSHA1=`echo ${TargetSHA1} | awk '{print $2}' `
|
||||
TargetMD5=`openssl md5 ${BitStreamFile}`
|
||||
TargetMD5=`echo ${TargetMD5} | awk '{print $2}' `
|
||||
TargetYUVSize=`runGetFileSize ${TestSequencePath}/${TestSequenceName} `
|
||||
TargetBitstreamSize=`runGetFileSize ${BitStreamFile}`
|
||||
if [[ "${TargetSHA1}" =~ "${BenchmarkSHA1}" ]]
|
||||
then
|
||||
echo "bitstream pass! SHA1--${TargetSHA1} ----- ${BenchmarkSHA1}"
|
||||
echo "bitstream pass! MD5-- ${TargetMD5} ----- ${BenchmarkMD5}"
|
||||
echo "YUV size pass! size--${TargetYUVSize}--${BenchmarkYUVSize} "
|
||||
echo "BitStreamSize pass! size--${TargetBitstreamSize}--${BenchmarkBitstreamSize}"
|
||||
DiffFlag="0:passed!"
|
||||
let "PassCaseNum++"
|
||||
return 0
|
||||
else
|
||||
echo "!!! SHA1 string not match: ${TargetSHA1} ----- ${BenchmarkSHA1} "
|
||||
echo "bitstream pass! MD5-- ${TargetMD5} ----- ${BenchmarkMD5}"
|
||||
echo "YUV size pass! size--${TargetYUVSize}--${BenchmarkYUVSize} "
|
||||
echo "BitStreamSize pass! size--${TargetBitstreamSize}--${BenchmarkBitstreamSize}"
|
||||
DiffFlag="1:unpassed!"
|
||||
let "UnpassCaseNum++"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
#called by runAllCaseTest
|
||||
#delete temp data files and output single case test result to log file
|
||||
#usage runSingleCasePostAction $CaseData
|
||||
runSingleCasePostAction()
|
||||
{
|
||||
if [ $# -lt 1 ]
|
||||
then
|
||||
echo "no parameter!"
|
||||
return 1
|
||||
fi
|
||||
local CaseData=$@
|
||||
CaseInfo=`echo $CaseData | awk 'BEGIN {FS="[,\r]"} {for(i=5;i<=NF;i++) printf(" %s,",$i)} '`
|
||||
echo "${DiffFlag}, ${TargetSHA1}, ${BenchmarkSHA1}, {TargetMD5}, ${BenchmarkMD5}, \
|
||||
${TargetBitstreamSize} , ${BenchmarkBitstreamSize},\
|
||||
${TargetYUVSize}, ${BenchmarkYUVSize},\
|
||||
${CaseInfo}, ${EncoderCommand} " >>${AllCasePassStatusFile}
|
||||
|
||||
echo "${TargetSHA1}, ${TargetMD5},${TargetBitstreamSize}, ${TargetYUVSize},${CaseInfo}">>${UpdateSHA1TableFile}
|
||||
|
||||
./run_SafeDelete.sh ${BitstreamTarget} >>${AllCaseConsoleLogFile}
|
||||
}
|
||||
#usage runOutputPassNum
|
||||
runOutputPassNum()
|
||||
{
|
||||
# output file locate in ../result
|
||||
echo ""
|
||||
echo "***********************************************************"
|
||||
echo "${TestSequenceName}"
|
||||
echo "total case Num is : ${TotalCaseNum}"
|
||||
echo "pass case Num is : ${PassCaseNum}"
|
||||
echo "unpass case Num is : ${UnpassCaseNum} "
|
||||
echo "***********************************************************"
|
||||
echo ""
|
||||
}
|
||||
# run all test case based on XXXcase.csv file
|
||||
#usage runAllCaseTest
|
||||
runAllCaseTest()
|
||||
{
|
||||
local EncoderLogInfo=""
|
||||
while read CaseData
|
||||
do
|
||||
#get case parameter's value
|
||||
if [[ ! $CaseData =~ "SHA" ]]
|
||||
then
|
||||
echo "" >>${AllCaseConsoleLogFile}
|
||||
echo "" >>${AllCaseConsoleLogFile}
|
||||
echo "" >>${AllCaseConsoleLogFile}
|
||||
echo "********************case index is ${TotalCaseNum}**************************************" >>${AllCaseConsoleLogFile}
|
||||
runParseCaseInfo ${CaseData} >>${AllCaseConsoleLogFile}
|
||||
echo "" >>${AllCaseConsoleLogFile}
|
||||
runEncodeOneCase >>${AllCaseConsoleLogFile}
|
||||
cat ${EncoderLogFile}>>${AllCaseConsoleLogFile}
|
||||
runBitStreamVerify >>${AllCaseConsoleLogFile}
|
||||
let "DisplayFlag=TotalCaseNum%100"
|
||||
if [ ${DisplayFlag} -eq 0 ]
|
||||
then
|
||||
if [ "$DiffFlag" = "0:passed!" ]
|
||||
then
|
||||
echo -e "\033[32m OK! ${TestSequenceName} Case Index ${TotalCaseNum}:SHA-1(Current--Benchmark): ${TargetSHA1} ----- ${BenchmarkSHA1} \033[0m"
|
||||
echo -e "\033[32m ----MD5 (Current--Benchmark): ${TargetMD5}, ${BenchmarkMD5} \033[0m"
|
||||
echo -e "\033[32m ----BitstreamSize: ${TargetBitstreamSize}, ${BenchmarkBitstreamSize} YUVSize: ${TargetYUVSize}, ${BenchmarkYUVSize} \033[0m"
|
||||
fi
|
||||
fi
|
||||
#******************************************
|
||||
if [ ! "$DiffFlag" = "0:passed!" ]
|
||||
then
|
||||
echo -e "\033[31m Failed! ${TestSequenceName} Case Index ${TotalCaseNum}:SHA-1(Current--Benchmark): ${TargetSHA1} ----- ${BenchmarkSHA1} \033[0m"
|
||||
echo -e "\033[31m ----MD5 (Current--Benchmark): ${TargetMD5}, ${BenchmarkMD5} \033[0m"
|
||||
echo -e "\033[31m ----BitstreamSize: ${TargetBitstreamSize}, ${BenchmarkBitstreamSize} YUVSize: ${TargetYUVSize}, ${BenchmarkYUVSize} \033[0m"
|
||||
EncoderLogInfo=`cat ${EncoderLogFile}`
|
||||
echo -e "\033[31m ${EncoderLogInfo} \033[0m"
|
||||
echo "${DiffFlag}, ${TargetSHA1}, ${BenchmarkSHA1}, ${TargetMD5}, ${BenchmarkMD5}, \
|
||||
${TargetBitstreamSize} , ${BenchmarkBitstreamSize}, \
|
||||
${TargetYUVSize}, ${BenchmarkYUVSize}, \
|
||||
${CaseInfo}, ${EncoderCommand} ">>${UnpassCaseFile}
|
||||
fi
|
||||
runSingleCasePostAction ${CaseData}
|
||||
let "TotalCaseNum++"
|
||||
fi
|
||||
done <$AllCaseFile
|
||||
}
|
||||
#***********************************************************
|
||||
# usage: runMain $TestYUV $AllCaseFile
|
||||
runMain()
|
||||
{
|
||||
if [ ! $# -eq 2 ]
|
||||
then
|
||||
echo "usage: run_BinarySHA1Comparison.sh \$TestYUV \$AllCaseFile"
|
||||
return 1
|
||||
fi
|
||||
runGlobalVariableDef
|
||||
#for test sequence info
|
||||
TestSequenceName=$1
|
||||
AllCaseFile=$2
|
||||
runGlobalVariableInitial
|
||||
TestFolder=`echo $CurrentDir | awk 'BEGIN {FS="/"} { i=NF; print $i}'`
|
||||
AllCaseConsoleLogFile="${FinalResultPath}/${TestSequenceName}.TestLog"
|
||||
CaseSummaryFile="${FinalResultPath}/${TestSequenceName}.Summary"
|
||||
FlagFile=""
|
||||
#run all cases
|
||||
runAllCaseTest
|
||||
# output file locate in ./result
|
||||
echo "${TestSequenceName}, \
|
||||
${PassCaseNum} pass!, \
|
||||
${UnpassCaseNum} unpass!,\
|
||||
detail file located in ../AllTestData/${TestFolder}/result">${CaseSummaryFile}
|
||||
runOutputPassNum
|
||||
#generate All case Flag
|
||||
if [ ! ${UnpassCaseNum} -eq 0 ]
|
||||
then
|
||||
echo ""
|
||||
exit 1
|
||||
else
|
||||
echo ""
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
TestYUVName=$1
|
||||
AllCaseFile=$2
|
||||
runMain ${TestYUVName} ${AllCaseFile}
|
||||
|
||||
131
test/encoder_binary_comparison/Scripts/run_BitStreamToYUV.sh
Executable file
131
test/encoder_binary_comparison/Scripts/run_BitStreamToYUV.sh
Executable file
@@ -0,0 +1,131 @@
|
||||
#!/bin/bash
|
||||
#*******************************************************************************
|
||||
# Encoder binary comparison test model
|
||||
# -- Compared with benchmark version using SHA-1 string
|
||||
# -- Test bit stream under folder openh264/res
|
||||
# -- SHA-1 string of benchmark version for all cases of all bit streams
|
||||
# under folder openh264/test/encoder_binary_comparion/SHA1Table
|
||||
# -- For more detail,please refer to file AboutTest.
|
||||
#
|
||||
#brief:
|
||||
# -- Transform test bit stream into YUV as test sequence,
|
||||
# 1) Called by run_OneBitStream.sh before testing all cases
|
||||
# 2) eg:
|
||||
# -- input: ./run_BitStreamToYUV.sh TestABC.264
|
||||
# -- output: TestABC.264_382X288.yuv
|
||||
# -- Usage: run_BitStreamToYUV.sh ${BitStreamFile}
|
||||
#
|
||||
#
|
||||
# date: 10/06/2014 Created
|
||||
#*******************************************************************************
|
||||
#usage: run_ParseDecoderLog $Decoder_LogFile
|
||||
#eg: input: run_ParseDecoderLog test.264.log
|
||||
# output 1024 720
|
||||
run_ParseDecoderLog()
|
||||
{
|
||||
if [ ! $# -eq 1 ]
|
||||
then
|
||||
echo "usage: run_ParseDecoderLog \$Decoder_LogFile"
|
||||
return 1
|
||||
fi
|
||||
local LogFile=$1
|
||||
local Width=""
|
||||
local Height=""
|
||||
while read line
|
||||
do
|
||||
if [[ $line =~ "iWidth" ]]
|
||||
then
|
||||
Width=`echo $line | awk 'BEGIN {FS="[:\n]"} {print $2}'`
|
||||
fi
|
||||
if [[ $line =~ "height" ]]
|
||||
then
|
||||
Height=`echo $line | awk 'BEGIN {FS="[:\n]"} {print $2}'`
|
||||
fi
|
||||
done < ${LogFile}
|
||||
echo "${Width} ${Height}"
|
||||
}
|
||||
#usage: run_BitStream2YUV $BitstreamName $OutputYUVName $LogFile
|
||||
run_BitStream2YUV()
|
||||
{
|
||||
if [ ! $# -eq 3 ]
|
||||
then
|
||||
echo "usage: run_BitStream2YUV \$BitstreamName \$OutputYUVName \$LogFile "
|
||||
return 1
|
||||
fi
|
||||
local BitStreamName=$1
|
||||
local OutputYUVNAMe=$2
|
||||
local LogFile=$3
|
||||
|
||||
if [ ! -f ${BitStreamName} ]
|
||||
then
|
||||
echo "bit stream file does not exist!"
|
||||
echo "detected by run_BitStreamToYUV.sh"
|
||||
return 1
|
||||
fi
|
||||
#decode bitstream
|
||||
./h264dec ${BitStreamName} ${OutputYUVNAMe} 2> ${LogFile}
|
||||
|
||||
return 0
|
||||
}
|
||||
#usage: run_RegularizeYUVName $BitstreamName $OutputYUVName $LogFile
|
||||
run_RegularizeYUVName()
|
||||
{
|
||||
if [ ! $# -eq 3 ]
|
||||
then
|
||||
echo "usage: run_RegularizeYUVName \$BitstreamName \$OutputYUVName \$LogFile "
|
||||
return 1
|
||||
fi
|
||||
local BitStreamName=$1
|
||||
local OrignName=$2
|
||||
local LogFile=$3
|
||||
local RegularizedYUVName=""
|
||||
|
||||
declare -a aDecodedYUVInfo
|
||||
|
||||
aDecodedYUVInfo=(`run_ParseDecoderLog ${LogFile}`)
|
||||
|
||||
BitStreamName=`echo ${BitStreamName} | awk 'BEGIN {FS="/"} {print $NF}'`
|
||||
RegularizedYUVName="${BitStreamName}_${aDecodedYUVInfo[0]}x${aDecodedYUVInfo[1]}.yuv"
|
||||
mv -f ${OrignName} ${RegularizedYUVName}
|
||||
echo ""
|
||||
echo "file : ${OrignName} has been renamed as :${RegularizedYUVName}"
|
||||
echo ""
|
||||
|
||||
return 0
|
||||
}
|
||||
#usage: runMain ${BitStreamName}
|
||||
runMain()
|
||||
{
|
||||
if [ ! $# -eq 1 ]
|
||||
then
|
||||
echo "usage: runMain ${BitStreamName} "
|
||||
return 1
|
||||
fi
|
||||
|
||||
local BitStreameFile=$1
|
||||
local BitSteamName=`echo ${BitStreameFile} | awk 'BEGIN {FS="/"} {print $NF}'`
|
||||
local DecoderLogFile="${BitSteamName}_h264dec.log"
|
||||
local DecodedYUVName="${BitSteamName}_dec.yuv"
|
||||
local RegularizedName=""
|
||||
|
||||
#**********************
|
||||
#decoded test bit stream
|
||||
run_BitStream2YUV ${BitStreameFile} ${DecodedYUVName} ${DecoderLogFile}
|
||||
if [ ! $? -eq 0 ]
|
||||
then
|
||||
echo "bit stream decoded failed!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
#*********************
|
||||
#regularized YUV name
|
||||
run_RegularizeYUVName ${BitStreameFile} ${DecodedYUVName} ${DecoderLogFile}
|
||||
|
||||
return 0
|
||||
}
|
||||
BitStreamFile=$1
|
||||
runMain ${BitStreamFile}
|
||||
|
||||
|
||||
|
||||
67
test/encoder_binary_comparison/Scripts/run_ParseYUVInfo.sh
Executable file
67
test/encoder_binary_comparison/Scripts/run_ParseYUVInfo.sh
Executable file
@@ -0,0 +1,67 @@
|
||||
#!/bin/bash
|
||||
#*******************************************************************************
|
||||
# Encoder binary comparison test model
|
||||
# -- Compared with benchmark version using SHA-1 string
|
||||
# -- Test bit stream under folder openh264/res
|
||||
# -- SHA-1 string of benchmark version for all cases of all bit streams
|
||||
# under folder openh264/test/encoder_binary_comparion/SHA1Table
|
||||
# -- For more detail,please refer to file AboutTest.
|
||||
#
|
||||
#brief:
|
||||
# -- Parse sequence basic info such as picw pich and fps via name
|
||||
# -- Usage: run_ParseYUVInfo.sh ${TestSequenceName}
|
||||
#
|
||||
# date: 10/06/2014 Created
|
||||
#*******************************************************************************
|
||||
#usage runGetYUVInfo $TestSequenceName
|
||||
#eg. input: ABC_1920X1080_30fps_XXX.yuv output: 1920 1080 30
|
||||
#eg. input: ABC_1920X1080_XXX.yuv output: 1920 1080 0
|
||||
#eg. input: ABC_XXX.yuv output: 0 0 0
|
||||
runGetYUVInfo()
|
||||
{
|
||||
if [ ! $# -eq 1 ]
|
||||
then
|
||||
echo "runGetYUVInfo \$TestSequenceName"
|
||||
echo "detected by run_ParseYUVInfo.sh"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local SequenceName=$1
|
||||
local PicWidth="0"
|
||||
local PicHeight="0"
|
||||
local FPS="0"
|
||||
declare -a aPicInfo
|
||||
aPicInfo=(`echo ${SequenceName} | awk 'BEGIN {FS="[_.]"} {for(i=1;i<=NF;i++) printf("%s ",$i)}'`)
|
||||
local Iterm
|
||||
local Index=""
|
||||
local Pattern_01="[xX]"
|
||||
local Pattern_02="^[1-9][0-9]"
|
||||
local Pattern_03="[0-9][0-9]$"
|
||||
local Pattern_04="fps$"
|
||||
#get PicW PicH info
|
||||
let "Index=0"
|
||||
for Iterm in ${aPicInfo[@]}
|
||||
do
|
||||
if [[ $Iterm =~ $Pattern_01 ]] && [[ $Iterm =~ $Pattern_02 ]] && [[ $Iterm =~ $Pattern_03 ]]
|
||||
then
|
||||
PicWidth=`echo $Iterm | awk 'BEGIN {FS="[xX]"} {print $1}'`
|
||||
PicHeight=`echo $Iterm | awk 'BEGIN {FS="[xX]"} {print $2}'`
|
||||
break
|
||||
fi
|
||||
let "Index++"
|
||||
done
|
||||
#get fps info
|
||||
let "Index++"
|
||||
if [ $Index -le ${#aPicInfo[@]} ]
|
||||
then
|
||||
if [[ ${aPicInfo[$Index]} =~ ^[1-9] ]] || [[ ${aPicInfo[$Index]} =~ $Pattern_04 ]]
|
||||
then
|
||||
FPS=`echo ${aPicInfo[$Index]} | awk 'BEGIN {FS="[a-zA-Z]" } {print $1} '`
|
||||
fi
|
||||
fi
|
||||
echo "$PicWidth $PicHeight $FPS"
|
||||
}
|
||||
TestSequenceName=$1
|
||||
runGetYUVInfo ${TestSequenceName}
|
||||
|
||||
|
||||
249
test/encoder_binary_comparison/Scripts/run_SafeDelete.sh
Executable file
249
test/encoder_binary_comparison/Scripts/run_SafeDelete.sh
Executable file
@@ -0,0 +1,249 @@
|
||||
#!/bin/bash
|
||||
#*******************************************************************************
|
||||
# Encoder binary comparison test model
|
||||
# -- Compared with benchmark version using SHA-1 string
|
||||
# -- Test bit stream under folder openh264/res
|
||||
# -- SHA-1 string of benchmark version for all cases of all bit streams
|
||||
# under folder openh264/test/encoder_binary_comparion/SHA1Table
|
||||
# -- For more detail,please refer to file AboutTest.
|
||||
#
|
||||
#brief:
|
||||
# -- Usage: ./run_SafeDelere.sh $DeleteItermPath
|
||||
# eg: 1 ./run_SafeDelere.sh tempdata.info --->delete only one file
|
||||
# eg: 2 ./run_SafeDelere.sh ../TempDataFolder --->delete entire folder
|
||||
# ./run_SafeDelere.sh /opt/TempData/ABC --->delete entire folder ABC
|
||||
#
|
||||
# date: 10/06/2014 Created
|
||||
#*******************************************************************************
|
||||
#usage: runGetFileName $FilePath
|
||||
runGetFileName()
|
||||
{
|
||||
#parameter check!
|
||||
if [ ! $# -eq 1 ]
|
||||
then
|
||||
echo "usage: runGetFileName \$FilePath"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local PathInfo=$1
|
||||
local FileName=""
|
||||
|
||||
if [[ $PathInfo =~ ^"/" ]]
|
||||
then
|
||||
FileName=` echo ${PathInfo} | awk 'BEGIN {FS="/"}; {print $NF}'`
|
||||
echo "${FileName}"
|
||||
return 0
|
||||
elif [[ $PathInfo =~ ^".." ]]
|
||||
then
|
||||
FileName=` echo ${PathInfo} | awk 'BEGIN {FS="/"}; {print $NF}'`
|
||||
echo "${FileName}"
|
||||
return 0
|
||||
else
|
||||
FileName=${PathInfo}
|
||||
echo "${FileName}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
}
|
||||
#******************************************************************************************************
|
||||
#usage: runGetFileFullPath $FilePathInfo
|
||||
#eg: current path is /opt/VideoTest/openh264/ABC
|
||||
# runGetFileFullPath abc.txt --->/opt/VideoTest/openh264/ABC
|
||||
# runGetFileFullPath ../123.txt --->/opt/VideoTest/openh264
|
||||
# runGetFileFullPath /opt/VieoTest/456.txt --->/opt/VieoTest
|
||||
runGetFileFullPath()
|
||||
{
|
||||
#parameter check!
|
||||
if [ ! $# -eq 1 ]
|
||||
then
|
||||
echo "usage: runGetFileFullPath \$FilePathInfo "
|
||||
return 1
|
||||
fi
|
||||
|
||||
local PathInfo=$1
|
||||
local FullPath=""
|
||||
local CurrentDir=`pwd`
|
||||
|
||||
if [[ $PathInfo =~ ^"/" ]]
|
||||
then
|
||||
FullPath=`echo ${PathInfo} |awk 'BEGIN {FS="/"} {for (i=1;i<NF;i++) printf("%s/",$i)}'`
|
||||
cd ${FullPath}
|
||||
FullPath=`pwd`
|
||||
cd ${CurrentDir}
|
||||
echo "${FullPath}"
|
||||
return 0
|
||||
elif [[ $PathInfo =~ ^".." ]]
|
||||
then
|
||||
FullPath=`echo ${PathInfo} |awk 'BEGIN {FS="/"} {for (i=1;i<NF;i++) printf("%s/",$i)}'`
|
||||
cd ${FullPath}
|
||||
FullPath=`pwd`
|
||||
cd ${CurrentDir}
|
||||
echo "${FullPath}"
|
||||
return 0
|
||||
else
|
||||
FullPath=${CurrentDir}
|
||||
echo "${FullPath}"
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
#******************************************************************************************************
|
||||
#usage: runGetFolderFullPath $FolderPathInfo
|
||||
#eg: current path is /opt/VideoTest/openh264/ABC
|
||||
# runGetFolderFullPat SubFolder --->/opt/VideoTest/openh264/ABC/ SubFolder
|
||||
# runGetFolderFullPat ../EFG --->/opt/VideoTest/openh264/EFG
|
||||
# runGetFolderFullPat /opt/VieoTest/MyFolder --->/opt/VieoTest/MyFolder
|
||||
runGetFolderFullPath()
|
||||
{
|
||||
#parameter check!
|
||||
if [ ! $# -eq 1 ]
|
||||
then
|
||||
echo "usage: runGetFolderFullPath \$FolderPathInfo "
|
||||
return 1
|
||||
fi
|
||||
|
||||
local PathInfo=$1
|
||||
local FullPath=""
|
||||
local CurrentDir=`pwd`
|
||||
|
||||
if [[ $PathInfo =~ ^"/" ]]
|
||||
then
|
||||
FullPath=${PathInfo}
|
||||
cd ${FullPath}
|
||||
FullPath=`pwd`
|
||||
cd ${CurrentDir}
|
||||
echo "${FullPath}"
|
||||
return 0
|
||||
elif [[ $PathInfo =~ ^".." ]]
|
||||
then
|
||||
cd ${PathInfo}
|
||||
FullPath=`pwd`
|
||||
cd ${CurrentDir}
|
||||
echo "${FullPath}"
|
||||
return 0
|
||||
else
|
||||
FullPath="${CurrentDir}/${PathInfo}"
|
||||
cd ${FullPath}
|
||||
FullPath=`pwd`
|
||||
cd ${CurrentDir}
|
||||
echo "${FullPath}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
}
|
||||
#******************************************************************************************************
|
||||
#usage: runUserNameCheck $whoami
|
||||
runUserNameCheck()
|
||||
{
|
||||
#parameter check!
|
||||
if [ ! $# -eq 1 ]
|
||||
then
|
||||
echo "usage: runUserNameCheck \$whoami"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local UserName=$1
|
||||
|
||||
if [ ${UserName} = "root" ]
|
||||
then
|
||||
echo ""
|
||||
echo "*********************************************"
|
||||
echo "delete files under root is not allowed"
|
||||
echo "detected by run_SafeDelere.sh"
|
||||
return 1
|
||||
else
|
||||
echo ""
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
#******************************************************************************************************
|
||||
#usage: runFolderLocationCheck $FullPath
|
||||
runFolderLocationCheck()
|
||||
{
|
||||
#parameter check!
|
||||
if [ ! $# -eq 1 ]
|
||||
then
|
||||
echo "usage: runFolderLocationCheck \$FullPath"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local Location=$1
|
||||
local FileDirDepth=`echo ${Location} | awk 'BEGIN {FS="/"} {print NF}'`
|
||||
|
||||
#for other non-project folder data protection
|
||||
#eg /opt/VideoTest/DeletedItem depth=4
|
||||
if [ $FileDirDepth -lt 5 ]
|
||||
then
|
||||
echo ""
|
||||
echo "*********************************************"
|
||||
echo "FileDepth is $FileDirDepth, and it is less thab the minimum depth(5)"
|
||||
echo "unsafe delete! try to delete non-project related files: $FileDir"
|
||||
echo "detected by run_SafeDelere.sh"
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
#******************************************************************************************************
|
||||
#usage runSafeDelete $Pathinfo
|
||||
runSafeDelete()
|
||||
{
|
||||
#parameter check!
|
||||
if [ ! $# -eq 1 ]
|
||||
then
|
||||
echo "usage runSafeDelete \FileFullPath"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local PathInfo=$1
|
||||
local UserName=`whoami`
|
||||
local FullPath=""
|
||||
local DeleteIterm=""
|
||||
local FileName=""
|
||||
|
||||
#user validity check
|
||||
runUserNameCheck ${UserName}
|
||||
if [ ! $? -eq 0 ]
|
||||
then
|
||||
return 1
|
||||
fi
|
||||
|
||||
#get full path
|
||||
if [ -d $PathInfo ]
|
||||
then
|
||||
FullPath=`runGetFolderFullPath ${PathInfo} `
|
||||
elif [ -f $PathInfo ]
|
||||
then
|
||||
FullPath=`runGetFileFullPath ${PathInfo} `
|
||||
else
|
||||
echo "delete iterm does not exist"
|
||||
echo "detected by run_SafeDelere.sh"
|
||||
return 1
|
||||
fi
|
||||
|
||||
#location validity check
|
||||
runFolderLocationCheck ${FullPath}
|
||||
if [ ! $? -eq 0 ]
|
||||
then
|
||||
return 1
|
||||
fi
|
||||
|
||||
#delete file/folder
|
||||
if [ -d $PathInfo ]
|
||||
then
|
||||
DeleteIterm=${FullPath}
|
||||
echo "deleted folder is: $DeleteIterm"
|
||||
rm -rf ${DeleteIterm}
|
||||
elif [ -f $PathInfo ]
|
||||
then
|
||||
FileName=`runGetFileName ${PathInfo}`
|
||||
DeleteIterm="${FullPath}/${FileName}"
|
||||
echo "deleted file is: $DeleteIterm"
|
||||
rm ${DeleteIterm}
|
||||
fi
|
||||
echo ""
|
||||
|
||||
}
|
||||
PathInfo=$1
|
||||
runSafeDelete $PathInfo
|
||||
|
||||
|
||||
154
test/encoder_binary_comparison/run_Main.sh
Executable file
154
test/encoder_binary_comparison/run_Main.sh
Executable file
@@ -0,0 +1,154 @@
|
||||
#!/bin/bash
|
||||
|
||||
#*******************************************************************************
|
||||
#Encoder Binary comparison test model
|
||||
# -- Compared with benchmark version using SHA-1 string
|
||||
# -- Test bit stream under folder openh264/res
|
||||
# -- SHA-1 string of benchmark version for all cases of all bit streams
|
||||
# under folder openh264/test/encoder_binary_comparion/SHA1Table
|
||||
# -- For more detail,please refer to file AboutTest.
|
||||
#
|
||||
#brief:
|
||||
# -- This file is for local test under Linux/Unix OS
|
||||
# -- Start point of the test model,
|
||||
# -- For local test, please run below command:
|
||||
# ./run_Main.sh LocalTest
|
||||
# And wait minutes for the test result.
|
||||
# Final test result, you can refer to test output files under folder
|
||||
# openh264/test/encoder_binary_comparison/FinalResult.
|
||||
# -- If there is something change in encoder design,and found that the bit stream
|
||||
# also change,you need to update the SHA1 table files in ./SHA1Table.
|
||||
# For update the SHA1 tables, please run below command:
|
||||
# ./run_Main.sh UpdateSHA1Table
|
||||
# There will be some mismatched warning info, please ignore it.
|
||||
# Wait for minutes,the up-to-date will be copied to ./SHA1Table.
|
||||
# date: 10/06/2014 Created
|
||||
#*******************************************************************************
|
||||
#usage: runTestTypeCheck ${TestType}
|
||||
runTestTypeCheck()
|
||||
{
|
||||
if [ ! $# -eq 1 ]
|
||||
then
|
||||
echo "usage: runTestTypeCheck \${TestType}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local TestType=$1
|
||||
|
||||
echo "TestType is ${TestType}"
|
||||
if [ "${TestType}" = "LocalTest" ]
|
||||
then
|
||||
return 0
|
||||
elif [ "${TestType}" = "UpdateSHA1Table" ]
|
||||
then
|
||||
return 0
|
||||
else
|
||||
echo "usage: --./run_Main.sh LocalTest"
|
||||
echo " or --./run_Main.sh UpdateSHA1Table"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
#delete temp files/folders
|
||||
runLocalTestPostAction()
|
||||
{
|
||||
./Scripts/run_SafeDelete.sh ${AllTestDataFolder} >>${DeletedLog}
|
||||
./Scripts/run_SafeDelete.sh ./Codec >>${DeletedLog}
|
||||
|
||||
echo -e "\n\n\n"
|
||||
echo -e "\033[32m *************************************************************** \033[0m"
|
||||
echo -e "\033[32m Local test completed, \033[0m"
|
||||
if [ ${Flag} -eq 0 ]
|
||||
then
|
||||
echo -e "\033[32m --all cases pass!! ----bit stream: ${StreamName} \033[0m"
|
||||
else
|
||||
echo -e "\033[31m --not all cases passed .....\033[0m"
|
||||
fi
|
||||
echo ""
|
||||
echo -e "\033[32m for more detail, please refer to xxx.log files and xxx.csv files in ./FinalResult \033[0m"
|
||||
echo -e "\033[32m *************************************************************** \033[0m"
|
||||
echo ""
|
||||
}
|
||||
#copy up-to-date SHA1 table files to ./SHA1Table
|
||||
#and delete temp files/folders
|
||||
runUpdateSHA1TablePostAction()
|
||||
{
|
||||
local BitStreamName=""
|
||||
local SHA1TableName=""
|
||||
local FileName=""
|
||||
|
||||
for file in ${FinalResultFolder}/*
|
||||
do
|
||||
FileName=`echo $file | awk 'BEGIN {FS="/"} {print $NF}'`
|
||||
if [[ "$FileName" =~ UpdateSHA1Table.csv$ ]]
|
||||
then
|
||||
BitStreamName=`echo $FileName | awk 'BEGIN {FS=".264"} {print $1}'`
|
||||
SHA1TableName=${BitStreamName}.264_AllCase_SHA1_Table.csv
|
||||
./Scripts/run_SafeDelete.sh ${SHA1TableFolder}/${SHA1TableName} >>${DeletedLog}
|
||||
cp $file ${SHA1TableFolder}/${SHA1TableName}
|
||||
fi
|
||||
done
|
||||
|
||||
./Scripts/run_SafeDelete.sh ${AllTestDataFolder}>>${DeletedLog}
|
||||
./Scripts/run_SafeDelete.sh ${FinalResultFolder}>>${DeletedLog}
|
||||
./Scripts/run_SafeDelete.sh ./Codec>>${DeletedLog}
|
||||
echo -e "\n\n\n"
|
||||
echo -e "\033[32m *************************************************************** \033[0m"
|
||||
echo -e "\033[32m all SHA1 tables in ./${SHA1TableFolder} have been updated \033[0m"
|
||||
echo -e "\n"
|
||||
echo -e "\033[32m *************************************************************** \033[0m"
|
||||
echo -e "\n\n"
|
||||
|
||||
}
|
||||
#usage: --./run_Main.sh LocalTest
|
||||
# or --./run_Main.sh UpdateSHA1Table
|
||||
runMain()
|
||||
{
|
||||
if [ ! $# -eq 1 ]
|
||||
then
|
||||
echo "usage: --./run_Main.sh LocalTest"
|
||||
echo " or --./run_Main.sh UpdateSHA1Table"
|
||||
exit 1
|
||||
fi
|
||||
local TestType=$1
|
||||
local BitStreamName=""
|
||||
Flag=""
|
||||
SHA1TableFolder="SHA1Table"
|
||||
FinalResultFolder="FinalResult"
|
||||
AllTestDataFolder="AllTestData"
|
||||
DeletedLog="Delete.log"
|
||||
runTestTypeCheck ${TestType}
|
||||
|
||||
# 32 -->32 bits release version;64 -->64 bits release version
|
||||
./run_PrepareAllTestData.sh 32
|
||||
if [ ! $? -eq 0 ]
|
||||
then
|
||||
echo "failed to prepare test space for all test data!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#test all cases
|
||||
let "Flag=0"
|
||||
for Bitsream in ./SHA1Table/*.csv
|
||||
do
|
||||
BitStreamName=`echo ${Bitsream} | awk 'BEGIN {FS="/"} {print $NF} ' `
|
||||
BitStreamName=`echo ${BitStreamName} | awk 'BEGIN {FS="_AllCase"} {print $1} ' `
|
||||
echo -e "\n\n\n"
|
||||
./run_OneBitStream.sh ${BitStreamName}
|
||||
if [ ! $? -eq 0 ]
|
||||
then
|
||||
let "Flag=1"
|
||||
fi
|
||||
done
|
||||
#post action
|
||||
if [ ${TestType} = "LocalTest" ]
|
||||
then
|
||||
runLocalTestPostAction
|
||||
elif [ ${TestType} = "UpdateSHA1Table" ]
|
||||
then
|
||||
runUpdateSHA1TablePostAction
|
||||
fi
|
||||
|
||||
}
|
||||
TestType=$1
|
||||
runMain ${TestType}
|
||||
|
||||
195
test/encoder_binary_comparison/run_OneBitStream.sh
Executable file
195
test/encoder_binary_comparison/run_OneBitStream.sh
Executable file
@@ -0,0 +1,195 @@
|
||||
#!/bin/bash
|
||||
#*******************************************************************************
|
||||
# Encoder binary comparison test model
|
||||
# -- Compared with benchmark version using SHA-1 string
|
||||
# -- Test bit stream under folder openh264/res
|
||||
# -- SHA-1 string of benchmark version for all cases of all bit streams
|
||||
# under folder openh264/test/encoder_binary_comparion/SHA1Table
|
||||
# -- For more detail,please refer to file AboutTest.
|
||||
#
|
||||
#brief:
|
||||
# -- Usage: run_OneBitStream.sh $BitSteamName
|
||||
# -- WorkingDir
|
||||
# 1) For local test: WorkingDir=openh264/test/encoder_binary_comparison
|
||||
# 2) For travis test: WorkingDir=openh264
|
||||
# There will be an auto detection for working directory
|
||||
# -- Before using this script, need to run below command:
|
||||
# ./run_PrepareAllTestData.sh 32(or 64)
|
||||
# cd $WorkingDir
|
||||
#
|
||||
# date: 10/06/2014 Created
|
||||
#*******************************************************************************
|
||||
#uasge: runGetCurrentYUVName $BitStreamToYUV.log
|
||||
runGetCurrentYUVName()
|
||||
{
|
||||
if [ ! $# -eq 1 ]
|
||||
then
|
||||
echo "usage: runGetCurrentYUVName \$BitStreamToYUV.log"
|
||||
echo "detected by run_OneBitStream.sh"
|
||||
return 1
|
||||
fi
|
||||
local BitStreamToYUVLog=$1
|
||||
local YUVName=""
|
||||
while read line
|
||||
do
|
||||
if [[ "$line" =~ "renamed as" ]]
|
||||
then
|
||||
YUVName=`echo $line | awk 'BEGIN {FS=":"} {print $3}'`
|
||||
fi
|
||||
done <${BitStreamToYUVLog}
|
||||
echo ${YUVName}
|
||||
}
|
||||
#usage: runSHA1TableCheck ${SHA1FileName}
|
||||
runSHA1TableCheck()
|
||||
{
|
||||
if [ ! $# -eq 1 ]
|
||||
then
|
||||
echo "usage: runSHA1TableCheck \${SHA1FileName}"
|
||||
return 1
|
||||
fi
|
||||
local SHA1File=$1
|
||||
if [ ! -e "${SHA1File}" ]
|
||||
then
|
||||
echo "SHA1 table does not exist: ${SHA1File} "
|
||||
echo "SHA1 table should be named as \${StreamName}_AllCase_SHA1_Table.csv"
|
||||
exit 0
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
#usage: usage: runBitStreamCheck \$BitStreame
|
||||
runBitStreamCheck()
|
||||
{
|
||||
if [ ! $# -eq 1 ]
|
||||
then
|
||||
echo "usage: runBitStreamCheck \$BitStreame"
|
||||
return 1
|
||||
fi
|
||||
local BitStream=$1
|
||||
local BitSreamName=`echo ${BitStream} | awk 'BEGIN {FS="/"} {print $NF}'`
|
||||
echo "bit stream is $BitSreamName"
|
||||
if [ ! -e ${BitStream} ]
|
||||
then
|
||||
echo -e "\033[31m bit stream does not exist: $BitSreamName \033[0m"
|
||||
echo -e "\033[31m please double check under /openh264/res folder \033[0m"
|
||||
echo -e "\033[31m -----detected by run_OneBitStream.sh \033[0m"
|
||||
exit 0
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
#usage: runTestSpaceCheck ${BitStreamTestDir}
|
||||
runTestSpaceCheck()
|
||||
{
|
||||
if [ ! $# -eq 1 ]
|
||||
then
|
||||
echo "usage: runMain \${BitStreamTestDir} "
|
||||
echo "detected by run_OneBitStream.sh"
|
||||
return 1
|
||||
fi
|
||||
local BitStreamTestDir=$1
|
||||
if [ ! -d ${BitStreamTestDir} ]
|
||||
then
|
||||
echo ""
|
||||
echo -e "\033[31m ----Test space for bitsream does not exist!--- ${BitStreamTestDir} \033[0m"
|
||||
echo -e "\033[31m ---- before running this test locally, please follow step below: \033[0m"
|
||||
echo -e "\033[31m ---- 1)cd test/encoder_binary_comparison/ \033[0m"
|
||||
echo -e "\033[31m ---- 2)run script file: ./run_PrepareAllTestData.sh \033[0m"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
#usage: usage: runMain \$BitStreamName
|
||||
runMain()
|
||||
{
|
||||
if [ ! $# -eq 1 ]
|
||||
then
|
||||
echo "usage: runMain \$BitStreamName "
|
||||
echo "detected by run_OneBitStream.sh"
|
||||
return 1
|
||||
fi
|
||||
local BitStreamName=$1
|
||||
local TestYUVName=""
|
||||
local StreamName=""
|
||||
local BitStreamToYUVLog="Bit2YUV.log"
|
||||
local SHA1Table="${BitStreamName}_AllCase_SHA1_Table.csv"
|
||||
#dir info
|
||||
local WorkingDir=`pwd`
|
||||
local EncoderTestDir=""
|
||||
local BitStreamTestDir=""
|
||||
local FinalResultDir=""
|
||||
local StreamFileFullPath=""
|
||||
local BitSreamDir=""
|
||||
if [[ "${WorkingDir}" =~ "test/encoder_binary_comparison" ]]
|
||||
then
|
||||
#for local test: working dir is openh264/test/encoder_binary_comparison
|
||||
EncoderTestDir=${WorkingDir}
|
||||
BitStreamTestDir="${EncoderTestDir}/AllTestData/${BitStreamName}"
|
||||
FinalResultDir="${EncoderTestDir}/FinalResult"
|
||||
BitSreamDir="../../res"
|
||||
else
|
||||
#for travis test: working dir is openh264/
|
||||
EncoderTestDir=${WorkingDir}/test/encoder_binary_comparison
|
||||
BitStreamTestDir="${EncoderTestDir}/AllTestData/${BitStreamName}"
|
||||
FinalResultDir="${EncoderTestDir}/FinalResult"
|
||||
BitSreamDir="${WorkingDir}/res"
|
||||
fi
|
||||
cd ${BitSreamDir}
|
||||
StreamFileFullPath=`pwd`
|
||||
StreamFileFullPath=${StreamFileFullPath}/${BitStreamName}
|
||||
cd ${WorkingDir}
|
||||
runBitStreamCheck ${StreamFileFullPath}
|
||||
runTestSpaceCheck ${BitStreamTestDir}
|
||||
#go to Bitstream test space
|
||||
cd ${BitStreamTestDir}
|
||||
runSHA1TableCheck ${SHA1Table}
|
||||
#bit stream to YUV
|
||||
./run_BitStreamToYUV.sh ${StreamFileFullPath}>${BitStreamToYUVLog}
|
||||
if [ ! $? -eq 0 ]
|
||||
then
|
||||
echo "failed to translate bit stream to yuv !"
|
||||
exit 1
|
||||
fi
|
||||
#parse basic info
|
||||
TestYUVName=`runGetCurrentYUVName ${BitStreamToYUVLog} `
|
||||
TestYUVName=`echo ${TestYUVName} | awk 'BEGIN {FS="/"} {print $NF} ' `
|
||||
StreamName=`echo ${StreamFileFullPath} | awk 'BEGIN {FS="/"} {print $NF} ' `
|
||||
echo ""
|
||||
echo "TestYUVName is ${TestYUVName}"
|
||||
echo "StreamName is ${StreamName} "
|
||||
echo "SHA1Table is ${SHA1Table}"
|
||||
echo ""
|
||||
#binary comparison
|
||||
./run_BinarySHA1Comparison.sh ${TestYUVName} ${SHA1Table}
|
||||
if [ ! $? -eq 0 ]
|
||||
then
|
||||
echo ""
|
||||
echo -e "\033[31m not all cases passed .....\033[0m"
|
||||
echo -e "\033[31m this may caused by: \033[0m"
|
||||
echo -e "\033[31m --1) you changed encoder algorithm which changed the final bit stream \033[0m"
|
||||
echo -e "\033[31m if so, you need to update the SHA1 table in folder ./test/encoder_binary_comparison/SHA1Table \033[0m"
|
||||
echo -e "\033[31m --2) the decoder has been changed and since the test YUV is generated by h264dec,the input YUV changed,so bit stream will also change \033[0m"
|
||||
echo -e "\033[31m if so, you need to update the SHA1 table in folder ./test/encoder_binary_comparison/SHA1Table \033[0m"
|
||||
echo -e "\033[31m for how to update, please refer to doc: ./test/encoder_binary_comparison/AboutTest \033[0m"
|
||||
echo -e "\033[31m --3) there may be something wrong in you code change (encoder or decoder) \033[0m"
|
||||
echo -e "\033[31m if so, please fix bug in your code \033[0m"
|
||||
cp ./result/* ${FinalResultDir}
|
||||
cd ${WorkingDir}
|
||||
#delete the test data
|
||||
echo ""
|
||||
echo "deleting temp data,entire folder will be deleted........ "
|
||||
${EncoderTestDir}/Scripts/run_SafeDelete.sh ${BitStreamTestDir}
|
||||
exit 1
|
||||
else
|
||||
echo -e "\033[32m all cases passed!! ----bit stream: ${StreamName} \033[0m"
|
||||
cp ./result/* ${FinalResultDir}
|
||||
cd ${WorkingDir}
|
||||
#delete the test data
|
||||
echo ""
|
||||
echo "deleting temp data,entire folder will be deleted........ "
|
||||
${EncoderTestDir}/Scripts/run_SafeDelete.sh ${BitStreamTestDir}
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
BitSteamName=$1
|
||||
runMain $BitSteamName
|
||||
|
||||
189
test/encoder_binary_comparison/run_PrepareAllTestData.sh
Executable file
189
test/encoder_binary_comparison/run_PrepareAllTestData.sh
Executable file
@@ -0,0 +1,189 @@
|
||||
#!/bin/bash
|
||||
#*******************************************************************************
|
||||
# Encoder binary comparison test model
|
||||
# -- Compared with benchmark version using SHA-1 string
|
||||
# -- Test bit stream under folder openh264/res
|
||||
# -- SHA-1 string of benchmark version for all cases of all bit streams
|
||||
# under folder openh264/test/encoder_binary_comparion/SHA1Table
|
||||
# -- For more detail,please refer to file AboutTest.
|
||||
#
|
||||
#brief:
|
||||
# -- Prepare test space for all test bit streams
|
||||
# 1) update codec
|
||||
# 2) update configure files
|
||||
# 3) create test space for all test bit streams
|
||||
# -- Usage: run_PrepareAllTestFolder.sh \
|
||||
# $AllTestDataFolder \
|
||||
# $TestBitStreamFolder \
|
||||
# $CodecFolder \
|
||||
# $ScriptFolder \
|
||||
# $SHA1TableFolder#
|
||||
# -- WorkingDir=openh264/test/encoder_binary_comparison
|
||||
# -- Before using this script, need to
|
||||
# cd $WorkingDir
|
||||
#
|
||||
# date: 10/06/2014 Created
|
||||
#*******************************************************************************
|
||||
#build codec
|
||||
runBuildCodec()
|
||||
{
|
||||
if [ ! $# -eq 1 ]
|
||||
then
|
||||
echo "usage: runBuildCodec \64/32 #bits"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local BitType=$1
|
||||
local MakeFileDir="../.."
|
||||
local CurrentDir=`pwd`
|
||||
|
||||
echo "bit type is ${BitType}"
|
||||
#***************************
|
||||
#build codec
|
||||
cd ${MakeFileDir}
|
||||
if [ "${BitType}" -eq 64 ]
|
||||
then
|
||||
make clean
|
||||
make -B ENABLE64BIT=Yes h264dec h264enc
|
||||
elif [ "${BitType}" -eq 32 ]
|
||||
then
|
||||
make clean
|
||||
make -B ENABLE64BIT=No h264dec h264enc
|
||||
else
|
||||
echo "usage: runBuildCodec \64/32 #bits"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd ${CurrentDir}
|
||||
|
||||
echo ""
|
||||
if [ ! -e ${MakeFileDir}/h264enc ]
|
||||
then
|
||||
echo "h264 Encoder build failed"
|
||||
return 1
|
||||
elif [ ! -e ${MakeFileDir}/h264dec ]
|
||||
then
|
||||
echo "h264 Decoder build failed"
|
||||
return 1
|
||||
else
|
||||
echo "codec build succeed!"
|
||||
return 0
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
|
||||
#copy codec related files to TestSpace's codec folder
|
||||
runCopyFiles()
|
||||
{
|
||||
local CodecFolder="Codec"
|
||||
local MakeFileDir="../.."
|
||||
local ConfigureFileDir="../../testbin"
|
||||
|
||||
#copy codec and configure files
|
||||
cp -p ${MakeFileDir}/h264enc ${CodecFolder}/
|
||||
cp -p ${MakeFileDir}/h264dec ${CodecFolder}/
|
||||
cp -p ${ConfigureFileDir}/layer2.cfg ${CodecFolder}/
|
||||
cp -p ${ConfigureFileDir}/welsenc.cfg ${CodecFolder}/
|
||||
return 0
|
||||
}
|
||||
#usage: runPrepareAllFolder $AllTestDataFolder $CodecFolder $ScriptFolder $SHA1TableFolder
|
||||
runPrepareAllFolder()
|
||||
{
|
||||
#parameter check!
|
||||
if [ ! $# -eq 4 ]
|
||||
then
|
||||
echo "usage: runPrepareAllFolder \$AllTestDataFolder \$CodecFolder \$ScriptFolder \$SHA1TableFolder"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local AllTestDataFolder=$1
|
||||
local CodecFolder=$2
|
||||
local ScriptFolder=$3
|
||||
local SHA1TableFolder=$4
|
||||
local SHA1TableName=""
|
||||
local SubFolder=""
|
||||
local IssueFolder="issue"
|
||||
local TempDataFolder="TempData"
|
||||
local ResultFolder="result"
|
||||
|
||||
if [ -d $AllTestDataFolder ]
|
||||
then
|
||||
./${ScriptFolder}/run_SafeDelete.sh $AllTestDataFolder
|
||||
fi
|
||||
|
||||
for Bitsream in ${SHA1TableFolder}/*.csv
|
||||
do
|
||||
StreamName=`echo ${Bitsream} | awk 'BEGIN {FS="/"} {print $NF} ' `
|
||||
StreamName=`echo ${StreamName} | awk 'BEGIN {FS="_AllCase"} {print $1} ' `
|
||||
SubFolder="${AllTestDataFolder}/${StreamName}"
|
||||
SHA1TableName="${StreamName}_AllCase_SHA1_Table.csv"
|
||||
echo "BitSream is ${StreamName}"
|
||||
echo "sub folder is ${SubFolder}"
|
||||
echo ""
|
||||
mkdir -p ${SubFolder}
|
||||
mkdir -p ${SubFolder}/${IssueFolder}
|
||||
mkdir -p ${SubFolder}/${TempDataFolder}
|
||||
mkdir -p ${SubFolder}/${ResultFolder}
|
||||
cp ${CodecFolder}/* ${SubFolder}
|
||||
cp ${ScriptFolder}/* ${SubFolder}
|
||||
if [ -e ${SHA1TableFolder}/${SHA1TableName} ]
|
||||
then
|
||||
cp ${SHA1TableFolder}/${SHA1TableName} ${SubFolder}
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
}
|
||||
#usage: run_PrepareAllTestFolder.sh ${BitType}
|
||||
runMain()
|
||||
{
|
||||
#parameter check!
|
||||
if [ ! $# -eq 1 ]
|
||||
then
|
||||
echo "usage: run_PrepareAllTestFolder.sh \${BitType}"
|
||||
exit 1
|
||||
fi
|
||||
local BitType=$1
|
||||
local AllTestDataFolder="./AllTestData"
|
||||
local CodecFolder="./Codec"
|
||||
local ScriptFolder="./Scripts"
|
||||
local SHA1TableFolder="./SHA1Table"
|
||||
|
||||
if [ -d ./Codec ]
|
||||
then
|
||||
./Scripts/run_SafeDelete.sh ./Codec
|
||||
fi
|
||||
|
||||
if [ -d ./FinalResult ]
|
||||
then
|
||||
./Scripts/run_SafeDelete.sh ./FinalResult
|
||||
fi
|
||||
mkdir Codec
|
||||
mkdir FinalResult
|
||||
|
||||
echo ""
|
||||
echo "building codec.........."
|
||||
runBuildCodec ${BitType}>build.log
|
||||
if [ ! $? -eq 0 ]
|
||||
then
|
||||
echo "codec build failed ..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
runCopyFiles
|
||||
echo ""
|
||||
echo "preparing All test data folders...."
|
||||
echo ""
|
||||
runPrepareAllFolder $AllTestDataFolder $CodecFolder $ScriptFolder $SHA1TableFolder
|
||||
echo ""
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
BitType=$1
|
||||
|
||||
runMain ${BitType}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user