[x265] [PATCH] cleaned up redundant lines in Regression test
Steve Borho
steve at borho.org
Thu Jul 18 19:35:03 CEST 2013
On Thu, Jul 18, 2013 at 9:31 PM, <mahesh at multicorewareinc.com> wrote:
> # HG changeset patch
> # User maheshpittala
> # Date 1374201082 25200
> # Node ID 6778dd6b17ccc352bea7239d1be568a22dbaad5d
> # Parent dacf6c061e81c595bdeacae581efcd10e46f3c66
> cleaned up redundant lines in Regression test
>
The commit message should be something like "add regression tests" because
that is what this commit will eventually do.
> diff -r dacf6c061e81 -r 6778dd6b17cc
> source/encoder/BuildEncoderApplications.bat
> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
> +++ b/source/encoder/BuildEncoderApplications.bat Thu Jul 18
> 19:31:22 2013 -0700
> @@ -0,0 +1,57 @@
>
These don't belong in the source/ folder. They should go in a build/
folder. Let's call these three files:
build/regression/buildAndTestSingle.bat
build/regression/buildAllConfigs.bat
build/regression/buildAllCompilers.bat
+ at echo off
> +
> +cd "%builddir%"
> +call:makesolution 8bit_PPA Debug ENABLE_TESTS:BOOL=ON ENABLE_PPA:BOOL=ON
> +call:makesolution 16bit_PPA Debug HIGH_BIT_DEPTH:BOOL=ON
> +call:makesolution 8bit Release HIGH_BIT_DEPTH:BOOL=OFF
> +call:makesolution 16bit Release HIGH_BIT_DEPTH:BOOL=ON
>
This is much better. You shouldn't need to pass Debug or Release to this
function. The function should build every solution for Release and Debug.
ENABLE_TESTS=ON should be the default, the function should do this
implicitly.
> +:makesolution
> +
> +set build_folder=%~1
> +set build_mode=%~2
> +set cmake_option1=%~3
> +set cmake_option2=%~4
>
If the option arguments were quoted, you wouldn't need to care about how
many there were, ie:
call:makesolution 16bit "-DHIGH_BIT_DEPTH:BOOL=ON"
then in the function:
cmake -G %makefile% %cmake_options% -D ENABLE_TESTS:BOOL=ON..\..\..\source
> +mkdir %build_folder%
> +cd %build_folder%
> +
> +cmake -G %makefile% -D %cmake_option1% -D %cmake_option2% ..\..\..\source
>
The %makefile% variable should be named %generator%
> +
> +if exist %solution% (
> +
> + call %vcvars%
> + MSBuild /property:Configuration="%build_mode%" x265.sln >>
> BuildLog.txt
>
please use lower case filenames: buildlog.txt
> MSBuild /property:Configuration=Release x265.sln >> buildlog.txt
>
MSBuild /property:Configuration=Debug x265.sln >> buildlog.txt
>
+
> + if %errorlevel% equ 1 (
> + echo Build with %build_folder% unsuccessfull for
> %makefile% refer the build log >> "%LOG%"
>
unsuccessful has one l. failed would be shorter:
Build of %build_folder% failed for %makefile% refer to the build log >>
"%LOG%"
> + exit 1
> + )
>
white-space alignment is still wrong, and replace tabs with spaces
if (expr) {
actions
}
else {
more actions
}
continue
> + echo Build with %build_folder% successfull for %makefile%
> >> "%LOG%"
> +
> + if exist %build_mode%\x265.exe (
> + echo build Application with %build_folder% successfull for
> %makefile% >> "%LOG%"
> + ) else (
> + echo build Application with %build_folder% unsuccessfull
> for %makefile% refer the Build log >> "%LOG%"
> + )
> +) else (
> +echo %build_folder% solution is not created for %makefile% >> "%LOG%"
> +)
> +
> +if exist x265.exe (
> + x265.exe %video1% -f %frames% --hash 1 -o str.out -r rec.yuv >>
> %build_folder%.txt 2>&1
> + x265.exe %video2% -f %frames% --hash 1 -o str1.out -r rec1.yuv >>
> %build_folder%.txt 2>&1
> + x265.exe %video3% -f %frames% --hash 1 -o str2.out -r rec2.yuv >>
> %build_folder%.txt 2>&1
> + ..\..\..\..\..\TAppDecoder.exe -b str.out -o str.yuv >>
> "%currentworkingdir%"\decoder_out_%build_folder%.txt
> + ..\..\..\..\..\TAppDecoder.exe -b str1.out -o str1.yuv >>
> "%currentworkingdir%"\decoder_out_%build_folder%.txt
> + ..\..\..\..\..\TAppDecoder.exe -b str2.out -o str2.yuv >>
> "%currentworkingdir%"\decoder_out_%build_folder%.txt
> + FC rec.yuv str.yuv >> DiffBin.txt
> + FC rec1.yuv str1.yuv >> DiffBin.txt
> + FC rec2.yuv str2.yuv >> DiffBin.txt
> +)
>
Hard-code Release here for %build_mode%
> +if exist test\%build_mode%\TestBench.exe (
> + echo %CD% >> "%currentworkingdir%"\TestLog.txt
> + test\%build_mode%\TestBench.exe >>
> "%currentworkingdir%"\TestLog.txt
> +)
> +cd ../
> \ No newline at end of file
> diff -r dacf6c061e81 -r 6778dd6b17cc
> source/encoder/CreateRegressionPackage.bat
> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
> +++ b/source/encoder/CreateRegressionPackage.bat Thu Jul 18
> 19:31:22 2013 -0700
> @@ -0,0 +1,74 @@
> + at echo off
> +
> +::Build the solution and applications for VS 11
> +
> +set path=""
> +set INCLUDE=""
> +set LIB=""
> +set LIBPATH=""
>
Why set these variables twice? the first set looks completely redundant.
The mixed upper and lower case is untidy.
> +
> +set "path=%save_path%"
> +set "INCLUDE=%save_include%"
> +set "LIB=%save_lib%"
> +set "LIBPATH=%save_libpath%"
> +
> +if not "%VS110COMNTOOLS%" == "" (
> + echo Regression Test - VS 11 Compiler found >> "%LOG%"
> + set builddir="%currentworkingdir%"\build\vc11-x86_64
> + set Builddir="%currentworkingdir%"\build\vc11-x86_64
>
two variables that differ only by case? ugh, please cleanup
> + set makefile="Visual Studio 11 Win64"
> + set vcvars="%VS110COMNTOOLS%\..\..\VC\vcvarsall.bat"
> + call "%workingdir%BuildEncoderApplications.bat"
> +
> + set builddir="%currentworkingdir%"\build\vc11-x86
> + set makefile="Visual Studio 11"
> + call "%workingdir%BuildEncoderApplications.bat"
> +)
> +
> +::Build the solution and applications for VS 10
> +
> +set path=""
> +set INCLUDE=""
> +set LIB=""
> +set LIBPATH=""
> +
> +set "path=%save_path%"
> +set "INCLUDE=%save_include%"
> +set "LIB=%save_lib%"
> +set "LIBPATH=%save_libpath%"
> +
> +if not "%VS100COMNTOOLS%" == "" (
> + echo Regression Test - VS 10 Compiler found >> "%LOG%"
> + set builddir="%currentworkingdir%"\build\vc10-x86_64
> + set makefile="Visual Studio 10 Win64"
> + set vcvars="%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat"
> + call "%workingdir%BuildEncoderApplications.bat"
> +
> + set builddir="%currentworkingdir%"\build\vc10-x86
> + set makefile="Visual Studio 10"
> + call "%workingdir%BuildEncoderApplications.bat"
>
%cwd% is more concise than %workingdir%
> +)
> +
> +::Build the solution and applications for VS 09
>
VC9 is the more typical name
> +
> +set path=""
> +set INCLUDE=""
> +set LIB=""
> +set LIBPATH=""
> +
> +set "path=%save_path%"
> +set "INCLUDE=%save_include%"
> +set "LIB=%save_lib%"
> +set "LIBPATH=%save_libpath%"
> +
> +if not "%%VS90COMNTOOLS%" == "" (
> + echo Regression Test - VS 09 Compiler found >> "%LOG%"
> + set builddir="%currentworkingdir%"\build\vc9-x86_64
> + set makefile="Visual Studio 9 2008 Win64"
> + set vcvars="%%VS90COMNTOOLS%%\..\..\VC\vcvarsall.bat"
> + call "%workingdir%BuildEncoderApplications.bat"
> +
> + set builddir="%currentworkingdir%"\build\vc9-x86
> + set makefile="Visual Studio 9 2008"
> + call "%workingdir%BuildEncoderApplications.bat"
> +)
> \ No newline at end of file
> diff -r dacf6c061e81 -r 6778dd6b17cc source/encoder/Main.bat
> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
> +++ b/source/encoder/Main.bat Thu Jul 18 19:31:22 2013 -0700
> @@ -0,0 +1,48 @@
> + at echo off
> +
> +for /f "tokens=1,2,3,4,5,6 delims==" %%a in (config.txt) do (
> +if %%a==FramesToCheck_BinMismatch set frames=%%b
> +if %%a==FramesToRun_PSNRperformance set frames1=%%b
> +if %%a==workingdir set workingdir=%%b
> +if %%a==testdir set testdir=%%b
> +if %%a==repository set repository=%%b
> +if %%a==video1 set video1=%%b
> +if %%a==video2 set video2=%%b
> +if %%a==video3 set video3=%%b
> +)
> +
> +set "save_path=%path%"
> +set "save_include=%INCLUDE%"
> +set "save_lib=%LIB%"
> +set "save_libpath=%LIBPATH%"
> +set solution="x265.sln"
> +set HG=hg
> +set currentworkingdir=%workingdir%RegressionTest
> +set Buildbat="BuildEncoderApplications.bat"
> +
> +if exist "%currentworkingdir%" rd /s /q %currentworkingdir%
> +mkdir "%currentworkingdir%"
> +cd /d "%currentworkingdir%"
> +set LOG="%currentworkingdir%"\RegressionTester.log
> +
> +if %errorlevel% equ 1 (
> + echo Working directory not created >> "%LOG%"
> + exit 1
> +)
> +echo Working directory created >> "%LOG%"
> +
> +"%HG%" init
> +"%HG%" pull "%repository%"
> +"%HG%" update >> "%LOG%"
> +"%HG%" summary >> "%LOG%"
> +
> +if %errorlevel% equ 1 (
> + echo Pull unsuccessfull >> "%LOG%"
> + exit 1
> +)
> +echo Pull successfull >> "%LOG%"
> +
> +call "%workingdir%CreateRegressionPackage.bat"
> +call "%workingdir%Performance.bat"
> +start python "%workingdir%performance_XL.py"
> +start python "%workingdir%Send_Mail.py"
>
Please put the PSNR_Performance files into a separate patch. This patch is
too long to meaningfully review.
> diff -r dacf6c061e81 -r 6778dd6b17cc source/encoder/PSNR_Performance.bat
> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
> +++ b/source/encoder/PSNR_Performance.bat Thu Jul 18 19:31:22 2013
> -0700
> @@ -0,0 +1,54 @@
> +cd %Builddir%\8bit\Release
> +
> +
> +FOR /F "delims=EOF" %%i IN (D:\\cmdd.txt) do (
> +
> + at echo x265.exe %video1%.y4m %%i --no-rdo -f %frames1% -o script.out -r
> script.rec >> "%workingdir%encoder_output_%video1%_no_rdo.txt"
> + x265.exe D:\\BasketballDrive_1920x1080_50.y4m %%i --no-rdo -f
> %frames1% -o script.out -r script.rec >>
> "%workingdir%encoder_output_%video1%_no_rdo.txt" 2>&1
> + @echo %%i --no-rdo >>
> "%workingdir%decoder_output_%video1%_no_rdo.txt"
> + "%workingdir%TAppDecoder.exe" -b script.out -o script.yuv >>
> "%workingdir%decoder_output_%video1%_no_rdo.txt"
> + @echo %%i --no-rdo >>
> "%workingdir%dr_psnr_output_%video1%_no_rdo.txt"
> + "%workingdir%dr_psnr.exe" -r
> "%workingdir%BasketballDrive_1920x1080_50.yuv" -c script.yuv -w 1920 -h
> 1080 -e %frames1% >> "%workingdir%dr_psnr_output_%video1%_no_rdo.txt"
> +
> + at echo x265.exe %video1%.y4m %%i --rdo -f %frames1% -o script.out -r
> script.rec >> "%workingdir%encoder_output_%video1%_rdo.txt"
> + x265.exe D:\\BasketballDrive_1920x1080_50.y4m %%i --rdo -f
> %frames1% -o script.out -r script.rec >>
> "%workingdir%encoder_output_%video1%_rdo.txt" 2>&1
> + @echo %%i --rdo >> "%workingdir%decoder_output_%video1%_rdo.txt"
> + "%workingdir%TAppDecoder.exe" -b script.out -o script.yuv >>
> "%workingdir%decoder_output_%video1%_rdo.txt"
> + @echo %%i --rdo >> "%workingdir%dr_psnr_output_%video1%_rdo.txt"
> + "%workingdir%dr_psnr.exe" -r
> "%workingdir%BasketballDrive_1920x1080_50.yuv" -c script.yuv -w 1920 -h
> 1080 -e %frames1% >> "%workingdir%dr_psnr_output_%video1%_rdo.txt"
> +
> +
> +
> +
> + at echo x265.exe %video2%.y4m %%i --no-rdo -f %frames1% -o script.out -r
> script.rec >> "%workingdir%encoder_output_%video2%_no_rdo.txt"
> + x265.exe D:\\Kimono1_1920x1080_24.y4m %%i --no-rdo -f %frames1%
> -o script.out -r script.rec >>
> "%workingdir%encoder_output_%video2%_no_rdo.txt" 2>&1
> + @echo %%i --no-rdo >>
> "%workingdir%decoder_output_%video2%_no_rdo.txt"
> + "%workingdir%TAppDecoder.exe" -b script.out -o script.yuv >>
> "%workingdir%decoder_output_%video2%_no_rdo.txt"
> + @echo %%i --no-rdo >>
> "%workingdir%dr_psnr_output_%video2%_no_rdo.txt"
> + "%workingdir%dr_psnr.exe" -r
> "%workingdir%Kimono1_1920x1080_24.yuv" -c script.yuv -w 1920 -h 1080 -e
> %frames1% >> "%workingdir%dr_psnr_output_%video2%_no_rdo.txt"
> +
> + at echo x265.exe %video2%.y4m %%i --rdo -f %frames1% -o script.out -r
> script.rec >> "%workingdir%encoder_output_%video2%_rdo.txt"
> + x265.exe D:\\Kimono1_1920x1080_24.y4m %%i --rdo -f %frames1%
> -o script.out -r script.rec >>
> "%workingdir%encoder_output_%video2%_rdo.txt" 2>&1
> + @echo %%i --rdo >> "%workingdir%decoder_output_%video2%_rdo.txt"
> + "%workingdir%TAppDecoder.exe" -b script.out -o script.yuv >>
> "%workingdir%decoder_output_%video2%_rdo.txt"
> + @echo %%i --rdo >> "%workingdir%dr_psnr_output_%video2%_rdo.txt"
> + "%workingdir%dr_psnr.exe" -r
> "%workingdir%Kimono1_1920x1080_24.yuv" -c script.yuv -w 1920 -h 1080 -e
> %frames1% >> "%workingdir%dr_psnr_output_%video2%_rdo.txt"
> +
> +
> +
> +
> + @echo x265.exe %video3%.y4m %%i --no-rdo -f %frames1% -o
> script.out -r script.rec >> "%workingdir%encoder_output_%video3%_no_rdo.txt"
> + x265.exe D:\\FourPeople_1280x720_60.y4m %%i --no-rdo -f
> %frames1% -o script.out -r script.rec >>
> "%workingdir%encoder_output_%video3%_no_rdo.txt" 2>&1
> + @echo %%i --no-rdo >>
> "%workingdir%decoder_output_%video3%_no_rdo.txt"
> + "%workingdir%TAppDecoder.exe" -b script.out -o script.yuv >>
> "%workingdir%decoder_output_%video3%_no_rdo.txt"
> + @echo %%i --no-rdo >>
> "%workingdir%dr_psnr_output_%video3%_no_rdo.txt"
> + "%workingdir%dr_psnr.exe" -r
> "%workingdir%FourPeople_1280x720_60.yuv" -c script.yuv -w 1920 -h 1080 -e
> %frames1% >> "%workingdir%dr_psnr_output_%video3%_no_rdo.txt"
> +
> + at echo x265.exe %video3%.y4m %%i --rdo -f %frames1% -o script.out -r
> script.rec >> "%workingdir%encoder_output_%video3%_rdo.txt"
> + x265.exe "%workingdir%FourPeople_1280x720_60.y4m" %%i --rdo
> -f %frames1% -o script.out -r script.rec >>
> "%workingdir%encoder_output_%video3%_rdo.txt" 2>&1
> + @echo %%i --rdo >> "%workingdir%decoder_output_%video3%_rdo.txt"
> + "%workingdir%TAppDecoder.exe" -b script.out -o script.yuv >>
> "%workingdir%decoder_output_%video3%_rdo.txt"
> + @echo %%i --rdo >> "%workingdir%dr_psnr_output_%video3%_rdo.txt"
> + "%workingdir%dr_psnr.exe" -r
> "%workingdir%FourPeople_1280x720_60.yuv" -c script.yuv -w 1920 -h 1080 -e
> %frames1% >> "%workingdir%dr_psnr_output_%video3%_rdo.txt"
> +
> +)
> diff -r dacf6c061e81 -r 6778dd6b17cc source/encoder/Send_Mail.py
> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
> +++ b/source/encoder/Send_Mail.py Thu Jul 18 19:31:22 2013 -0700
> @@ -0,0 +1,50 @@
> +#script to send performance result file to xhevc at muticorewareinc.com
> +
> +#!/usr/bin/python
> +import os, re
> +import sys
> +import smtplib
> +from email.mime.image import MIMEImage
> +from email.mime.multipart import MIMEMultipart
> +from email.mime.text import MIMEText
> +
> +SMTP_SERVER = 'smtp.gmail.com'
> +SMTP_PORT = 587
> +sender = 'user at multicorewareinc.com'
> +password = "password"
> +recipient = 'xhevc at multicorewareinc.com'
> +subject = 'Performance Results from Regression Test'
> +message = 'PFA'
> +directory="D:/"
> +
> +def main():
> + msg = MIMEMultipart()
> + msg['Subject'] = 'Performance Results'
> + msg['To'] = recipient
> + msg['From'] = sender
> +
> + files = os.listdir(directory)
> + txtsearch = re.compile(".csv", re.IGNORECASE)
> + files = filter(txtsearch.search, files)
> + for filename in files:
> + path = os.path.join(directory, filename)
> + if not os.path.isfile(path):
> + continue
> + text = MIMEImage(open(path, 'rb').read(), _subtype="csv")
> + text.add_header('Content-Disposition', 'attachment',
> filename=filename)
> + msg.attach(text)
> +
> + part = MIMEText('text', "plain")
> + part.set_payload(message)
> + msg.attach(part)
> +
> + session = smtplib.SMTP(SMTP_SERVER, SMTP_PORT)
> + session.ehlo()
> + session.starttls()
> + session.ehlo
> + session.login(sender, password)
> +
> + session.sendmail(sender, recipient, msg.as_string())
> + session.quit()
> +if __name__ == '__main__':
> + main()
> diff -r dacf6c061e81 -r 6778dd6b17cc source/encoder/commandLine.txt
> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
> +++ b/source/encoder/commandLine.txt Thu Jul 18 19:31:22 2013 -0700
> @@ -0,0 +1,16 @@
> +--wpp --tu-intra-depth 1 --tu-inter-depth 2 --no-tskip --max-merge 1
> --threads 4 --hash 1
> +--rect --max-merge 1 --wpp --no-rdoq --hash 1
> +--wpp --tu-intra-depth 1 --tu-inter-depth 2 --no-tskip --max-merge 1
> --threads 4 --no-rdoq --hash 1
> +--hash 1
> +--rect --max-merge 1 --hash 1
> +--rect --max-merge 1 --wpp --hash 1
> +--rect --max-merge 1 --cpuid 1 --hash 1
> +--rect --max-merge 1 --cpuid 1 --wpp --hash 1
> +--no-rect --no-amp --hash 1
> +--no-rect --no-amp --max-merge 1 --hash 1
> +--no-rect --no-amp --max-merge 1 --wpp --hash 1
> +--max-merge 1 --wpp --no-rdoq --hash 1
> +--rect --amp --hash 1
> +--sao --hash 1
> +--keyint 1 --hash 1
> +--keyint 32 --hash 1
> \ No newline at end of file
> diff -r dacf6c061e81 -r 6778dd6b17cc source/encoder/config.txt
> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
> +++ b/source/encoder/config.txt Thu Jul 18 19:31:22 2013 -0700
> @@ -0,0 +1,8 @@
> +FramesToCheck_BinMismatch=3
> +FramesToRun_PSNRperformance=30
> +workingdir=D:\\
> +testdir=TestEncoder
> +repository=https://maheshpittala@bitbucket.org/multicoreware/xhevc
> +video1=D:\\BasketballDrive_1920x1080_50
> +video2=D:\\Kimono1_1920x1080_24
> +video3=D:\\FourPeople_1280x720_60
> \ No newline at end of file
> diff -r dacf6c061e81 -r 6778dd6b17cc source/encoder/performance_XL.py
> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
> +++ b/source/encoder/performance_XL.py Thu Jul 18 19:31:22 2013 -0700
> @@ -0,0 +1,158 @@
> +#Script for Reading encoded and PSNR results from log files
> +
> +#!/usr/bin/python
> +import os
> +import re
> +searchquery1 = 'encoded'
> +searchquery2 = ' Global'
> +inputs_var=0
> +cmd_var=0
> +inc=0
> +
> +os.remove("Performance_Results.csv")
> +enc_nordo =
> ['encoder_output_BasketballDrive_1920x1080_50_no_rdo.txt','encoder_output_FourPeople_1280x720_60_no_rdo.txt','encoder_output_Kimono1_1920x1080_24_no_rdo.txt']
> +psnr_nordo
> =['dr_psnr_output_BasketballDrive_1920x1080_50_no_rdo.txt','dr_psnr_output_FourPeople_1280x720_60_no_rdo.txt','dr_psnr_output_Kimono1_1920x1080_24_no_rdo.txt']
> +enc_rdo =
> ['encoder_output_BasketballDrive_1920x1080_50_rdo.txt','encoder_output_FourPeople_1280x720_60_rdo.txt','encoder_output_Kimono1_1920x1080_24_rdo.txt']
> +psnr_rdo =
> ['dr_psnr_output_BasketballDrive_1920x1080_50_rdo.txt','dr_psnr_output_FourPeople_1280x720_60_rdo.txt','dr_psnr_output_Kimono1_1920x1080_24_rdo.txt']
> +
> +cmdlines = [' --wpp --tu-intra-depth 1 --tu-inter-depth 2 --no-tskip
> --max-merge 1 --threads 4 ',' --rect --max-merge 1 --wpp --no-rdoq','--wpp
> --tu-intra-depth 1 --tu-inter-depth 2 --no-tskip --max-merge 1 --threads 4
> --no-rdoq',' default ',' --rect --max-merge 1 ',' --rect --max-merge 1
> --wpp ',' --rect --max-merge 1 --cpuid 1 ', ' --rect --max-merge 1 --cpuid
> 1 --wpp ',' --no-rect --no-amp ','--no-rect --no-amp --max-merge 1 ','
> --no-rect --no-amp --max-merge 1 --wpp','--max-merge 1 --wpp --no-rdoq ','
> --rect --amp' ,' --sao ',' --keyint 1 ',' --keyint 32 ']
> +inputs = [' 1.BasketballDrive_1920x1080_50.y4m', '
> 2.FourPeople_1280x720_60.y4m', ' 3.Kimono1_1920x1080_24.y4m']
> +
> +log = open('Performance_Results.csv','w')
> +print (",,,,,,,,,, NO_RDO,,,,,,,,,, RDO ", file = log)
> +
> +print (" COMMAND LINE,,,,,,, , TOTAL TIME(seconds),
> SPEED(fps), BITRATE(kb/s), FRAMES, PSNR(Y)_Global, PSNR(U),
> PSNR(V), avg, , TOTAL TIME(seconds), SPEED(fps),
> BITRATE(kb/s), FRAMES, PSNR(Y)_Global, PSNR(U), PSNR(V), avg",
> file = log)
> +print (" ", file = log)
> +
> +for enc in enc_nordo:
> + print ("%s" %(inputs[inputs_var]), file = log)
> + print (" ", file = log)
> + psnr=psnr_nordo[inputs_var]
> +
> + out1 = open('output1.txt', 'a')
> + print ("encoder output for nordo...", file = out1)
> + out1.close()
> + out2 = open('output2.txt', 'a')
> + print ("dr_psnr output for nordo...", file = out2)
> + out3 = open('output3.txt', 'a')
> + print ("encoder output for rdo...", file = out3)
> + out3.close()
> + out4 = open('output4.txt', 'a')
> + print ("dr_psnr output for rdo...", file = out4)
> + out4.close()
> +
> + #encoder output for nordo
> + f1 = open(enc, 'r')
> + out1 = open('output1.txt', 'a')
> + line1 = f1.readlines()
> + for i, line in enumerate(line1):
> + if line.startswith(searchquery1):
> + for char in line:
> + line = re.sub('[(]','',line)
> + line = re.sub('[s]','',line)
> + out1.write(line)
> + f1.close ()
> + out1.close()
> +
> + #dr_psnr output for nordo
> + f2 = open(psnr, 'r')
> + out2 = open('output2.txt', 'a')
> + line2 = f2.readlines()
> + for i, line in enumerate(line2):
> + if line.startswith(searchquery2):
> + out2.write(line)
> + f2.close ()
> + out2.close()
> +
> + #encoder output for rdo
> + f3 = open(enc_rdo[inc], 'r')
> + out3 = open('output3.txt', 'a')
> + line3 = f3.readlines()
> + for i, line in enumerate(line3):
> + if line.startswith(searchquery1):
> + for char in line:
> + line = re.sub('[(]','',line)
> + line = re.sub('[s]','',line)
> + out3.write(line)
> + f3.close ()
> + out3.close()
> +
> + #dr_psnr output for rdo
> + f4 = open(psnr_rdo[inc], 'r')
> + out4 = open('output4.txt', 'a')
> + line4 = f4.readlines()
> + for i, line in enumerate(line4):
> + if line.startswith(searchquery2):
> + out4.write(line)
> + f4.close ()
> + out4.close()
> +
> + out1 = open('output1.txt')
> + out2 = open('output2.txt')
> + out3 = open('output3.txt')
> + out4 = open('output4.txt')
> +
> + log = open('Performance_Results.csv','a')
> + eof1 = out1.readline()
> + eof2 = out2.readline()
> + eof3 = out3.readline()
> + eof4 = out4.readline()
> +
> + #for a in eof1:
> + num_lines = sum(1 for line in open('output1.txt'))
> +
> + for index in range(num_lines-1):
> + #for b in eof2:
> + eof1 = out1.readline()
> + eof2 = out2.readline()
> + eof3 = out3.readline()
> + eof4 = out4.readline()
> +
> + col1 = eof1.split()
> + print (col1)
> + col2 = eof2.split()
> + print (col2)
> + col3 = eof3.split()
> + print (col3)
> + col4 = eof4.split()
> + print (col4)
> +
> + time = col1[4]
> + time1 = col3[4]
> +
> + speed = col1[5]
> + speed1 = col3[5]
> +
> + bitrate = float(col1[7])
> + bitrate1 = float(col3[7])
> +
> + frames = int(col1[1])
> + frames1 = int(col3[1])
> +
> + psnr_y = float(col2[1])
> + psnr_u = float(col2[2])
> + psnr_v = float(col2[3])
> + avg_psnr = (float)((psnr_y+psnr_u+psnr_v)/3)
> +
> + psnr_y1 = float(col4[1])
> + psnr_u1 = float(col4[2])
> + psnr_v1 = float(col4[3])
> + avg_psnr1 = (float)((psnr_y1+psnr_u1+psnr_v1)/3)
> +
> + print
> ("%s,,,,,,,,%s,%s,%f,%d,%f,%f,%f,%f,,%s,%s,%f,%d,%f,%f,%f,%f"
> %(cmdlines[cmd_var],time,speed,bitrate,frames,psnr_y,psnr_u,psnr_v,avg_psnr,time1,speed1,bitrate1,frames1,psnr_y1,psnr_u1,psnr_v1,avg_psnr1),
> file = log)
> + cmd_var=cmd_var+1
> +
> +
> + out1.close()
> + out2.close()
> + out3.close()
> + out4.close()
> + os.remove("output1.txt")
> + os.remove("output2.txt")
> + os.remove("output3.txt")
> + os.remove("output4.txt")
> + inputs_var=inputs_var+1
> + cmd_var=0
> + inc=inc+1
> + print (" ", file = log)
> +log.close()
>
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> http://mailman.videolan.org/listinfo/x265-devel
>
>
--
Steve Borho
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/private/x265-devel/attachments/20130718/000b0701/attachment-0001.html>
More information about the x265-devel
mailing list