[x265] [PATCH] Add regression scripts

mahesh at multicorewareinc.com mahesh at multicorewareinc.com
Wed Jul 24 01:22:08 CEST 2013


# HG changeset patch
# User maheshpittala
# Date 1374621718 25200
# Node ID 5240be3b9f238628b63d540a0fc7c7d112681257
# Parent  0239116446a083fd8cec8f9e09059f587295821f
Add regression scripts

diff -r 0239116446a0 -r 5240be3b9f23 build/regression/BuildandRun.bat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/regression/BuildandRun.bat	Tue Jul 23 16:21:58 2013 -0700
@@ -0,0 +1,58 @@
+ at echo off
+
+cd ..\"%buildconfig%"
+call:makesolution 8bit "ENABLE_PPA:BOOL=ON"
+call:makesolution 16bit "HIGH_BIT_DEPTH:BOOL=ON"
+EXIT /B
+
+:makesolution
+
+set build_folder=%~1
+set cmake_option=%~2
+if exist %build_folder% rd /s /q %build_folder%
+mkdir %build_folder%
+cd %build_folder%
+
+cmake  -D ENABLE_TESTS:BOOL=ON -D %cmake_option% -G "%generator%" ..\..\..\source
+
+if exist x265.sln (
+
+ call %vcvars%
+ MSBuild /property:Configuration="Release" x265.sln >> buildlog_release.txt	
+ if %errorlevel% equ 1 (
+  echo %generator% %build_folder% build failed in release mode refer the build log  >> "%LOG%"
+  exit 1
+ )
+ if not exist Release\x265.exe echo build Application with %build_folder% failed for %generator%  refer the build log >> "%LOG%"	
+ 
+ MSBuild /property:Configuration="Debug" x265.sln >> buildlog_debug.txt		
+ if %errorlevel% equ 1 (
+  echo %generator% %build_folder% build failed in debug mode refer the build log  >> "%LOG%"
+  exit 1
+ )
+ if not exist Debug\x265.exe echo build Application with %build_folder% failed for %generator%  refer the build log >> "%LOG%"
+) else (
+echo %build_folder% solution is not created for %generator% >> "%LOG%"
+)
+
+
+if exist Release\x265.exe (
+		
+ Release\x265.exe  %video1%.y4m -f %frames% --wpp --tu-intra-depth 1 --tu-inter-depth 2 --no-tskip --max-merge 1 --threads 4 --no-rdoq --hash 1 -o str1.out -r rec1.yuv >> %build_folder%.txt 2>&1
+ Release\x265.exe  %video2%.y4m -f %frames% --wpp --tu-intra-depth 1 --tu-inter-depth 2 --no-tskip --max-merge 1 --threads 4 --no-rdoq --hash 1 -o str2.out -r rec2.yuv >> %build_folder%.txt 2>&1
+ Release\x265.exe  %video3%.y4m -f %frames% --wpp --tu-intra-depth 1 --tu-inter-depth 2 --no-tskip --max-merge 1 --threads 4 --no-rdoq --hash 1 -o str3.out -r rec3.yuv >> %build_folder%.txt 2>&1
+ Debug\x265.exe  %video1%.y4m -f %frames% --wpp --tu-intra-depth 1 --tu-inter-depth 2 --no-tskip --max-merge 1 --threads 4 --no-rdoq --hash 1 -o str4.out -r rec4.yuv >> %build_folder%.txt 2>&1
+
+ %decoder% -b str1.out -o str1.yuv >> "%workingdir%"\decoder_out_%build_folder%.txt
+ %decoder% -b str2.out -o str2.yuv >> "%workingdir%"\decoder_out_%build_folder%.txt
+ %decoder% -b str3.out -o str3.yuv >> "%workingdir%"\decoder_out_%build_folder%.txt
+
+ FC  /b rec1.yuv str1.yuv > NULL || echo Reconstructed frames mismatch for %video1% >> "%workingdir%"\DiffBin.txt
+ FC  /b rec2.yuv str2.yuv > NULL || echo Reconstructed frames mismatch for %video2% >> "%workingdir%"\DiffBin.txt
+ FC  /b rec3.yuv str3.yuv > NULL || echo Reconstructed frames mismatch for %video3% >> "%workingdir%"\DiffBin.txt
+)
+
+if exist test\Release\TestBench.exe (
+ test\Release\TestBench.exe >> testbench.txt || echo %generator% %build_folder% Testbench failed >> "%LOG%"
+)
+ cd ..\
diff -r 0239116446a0 -r 5240be3b9f23 build/regression/Main.bat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/regression/Main.bat	Tue Jul 23 16:21:58 2013 -0700
@@ -0,0 +1,29 @@
+ at echo off
+
+for /f "tokens=1,2,3,4,5,6,7,8 delims==" %%a in (config.txt) do (
+if %%a==repository set repository=%%b
+if %%a==FramesToCheck_BinMismatch set frames=%%b
+if %%a==FramesToRun_PSNRperformance set frames1=%%b
+if %%a==decoder set decoder=%%b
+if %%a==drpsnr set drpsnr=%%b
+if %%a==video1 set video1=%%b
+if %%a==video2 set video2=%%b
+if %%a==video3 set video3=%%b
+)
+
+set save_path=%path%
+set workingdir=%CD%
+
+if exist "%workingdir%"\regression.log del "%workingdir%"\regression.log
+set LOG="%workingdir%"\regression.log
+
+hg pull -u "%repository%"
+if %errorlevel% equ 1 (
+ echo "Pull failed" >> "%LOG%"
+ exit 1
+)
+hg summary >> "%LOG%"
+
+call compilers.bat
+call %workingdir%\PSNR_Performance.bat
+start python %workingdir%\Send_Mail.py
diff -r 0239116446a0 -r 5240be3b9f23 build/regression/PSNR_Performance.bat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/regression/PSNR_Performance.bat	Tue Jul 23 16:21:58 2013 -0700
@@ -0,0 +1,30 @@
+cd %workingdir%\..\vc11-x86_64\8bit\Release
+FOR /F "delims=EOF" %%i IN (%workingdir%\commandlines.txt) do (
+
+call:encoder %video1% --no-rdo "%%i" 1920 1080
+call:encoder %video2% --no-rdo "%%i" 1920 1080
+call:encoder %video3% --no-rdo "%%i" 1280 720
+
+call:encoder %video1% --rdo "%%i" 1920 1080
+call:encoder %video2% --rdo "%%i" 1920 1080
+call:encoder %video3% --rdo "%%i" 1280 720 
+
+)
+EXIT /B
+
+:encoder
+set inputvideo=%~1
+set option=%~2
+set cmdl=%~3
+set width=%~4
+set height=%~5
+
+echo input video %inputvideo%
+echo option %option% 
+
+ @echo x265.exe  %inputvideo%.y4m %cmdl% -f %frames1% --csv %option% -o script.out -r script.rec >> "%workingdir%"\encoder_output%option%.csv
+ x265.exe  %inputvideo%.y4m %cmdl% %option% -f %frames1% -o script.out -r script.rec >> "%workingdir%"\encoder_output%option%.csv 2>&1
+ @echo %inputvideo% %cmdl% %option%  >> "%workingdir%"\decoder_output%option%.txt
+ %decoder% -b script.out -o script.yuv >> "%workingdir%"\decoder_output%option%.txt
+ @echo %inputvideo% %cmdl% %option%  >> "%workingdir%"\dr_psnr_output%option%.txt
+ %drpsnr% -r %inputvideo%.yuv -c script.yuv -w %width% -h %height% -e %frames1% >> "%workingdir%"\dr_psnr_output%option%.txt
diff -r 0239116446a0 -r 5240be3b9f23 build/regression/Send_Mail.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/regression/Send_Mail.py	Tue Jul 23 16:21:58 2013 -0700
@@ -0,0 +1,53 @@
+#!/usr/bin/python
+
+import os, re
+import sys
+import smtplib
+import socket
+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=os.getenv("SMTP_USER","sender at email.com")
+password=os.getenv("SMTP_PASSWD","mypassword")
+recipient='receiver at email.com'
+subject = 'Performance Results from Regression Test'
+message = 'PFA'
+directory=os.getcwd()
+
+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)
+    try:
+      session.sendmail(sender, recipient, msg.as_string())
+      print('your message has been sent')
+    except:
+      e=sys.exc_info()[0]
+      print('Unable to send email',e) 
+    session.quit()
+if __name__ == '__main__':
+    main()
diff -r 0239116446a0 -r 5240be3b9f23 build/regression/commandlines.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/regression/commandlines.txt	Tue Jul 23 16:21:58 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
+--bframes 1 --hash 1
diff -r 0239116446a0 -r 5240be3b9f23 build/regression/compilers.bat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/regression/compilers.bat	Tue Jul 23 16:21:58 2013 -0700
@@ -0,0 +1,21 @@
+ at echo off
+
+call:buildconfigs "%VS110COMNTOOLS%" vc11-x86_64 "Visual Studio 11 Win64"
+call:buildconfigs "%VS110COMNTOOLS%" vc11-x86 "Visual Studio 11"
+call:buildconfigs "%VS100COMNTOOLS%" vc10-x86_64 "Visual Studio 10 Win64"
+call:buildconfigs "%VS100COMNTOOLS%" vc10-x86 "Visual Studio 10"
+call:buildconfigs "%VS90COMNTOOLS%" vc9-x86_64 "Visual Studio 9 2008 Win64"
+call:buildconfigs "%VS90COMNTOOLS%" vc9-x86 "Visual Studio 9 2008 Win64"
+EXIT /B
+
+:buildconfigs
+
+set compiler=%~1
+set buildconfig=%~2
+set generator=%~3
+
+echo running %generator% >> "%LOG%"
+set vcvars="%compiler%\..\..\VC\vcvarsall.bat"
+call %workingdir%\BuildandRun.bat
+set path=""
+set path=%save_path%
diff -r 0239116446a0 -r 5240be3b9f23 build/regression/config.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/regression/config.txt	Tue Jul 23 16:21:58 2013 -0700
@@ -0,0 +1,8 @@
+repository=https://maheshpittala@bitbucket.org/multicoreware/xhevc
+FramesToCheck_BinMismatch=1
+FramesToRun_PSNRperformance=30
+decoder=D:\\TAppDecoder.exe
+drpsnr=D:\\dr_psnr.exe
+video1=D:\\BasketballDrive_1920x1080_50
+video2=D:\\Kimono1_1920x1080_24
+video3=D:\\FourPeople_1280x720_60
-------------- next part --------------
A non-text attachment was scrubbed...
Name: RepoHEVC.patch
Type: text/x-patch
Size: 9532 bytes
Desc: not available
URL: <http://mailman.videolan.org/private/x265-devel/attachments/20130723/6f89f294/attachment.bin>


More information about the x265-devel mailing list