[x265] [PATCH] PSNR performance script

mahesh at multicorewareinc.com mahesh at multicorewareinc.com
Sat Jul 20 04:47:37 CEST 2013


# HG changeset patch
# User maheshpittala
# Date 1374288442 25200
# Node ID 1b6048d7e1d46c9b05f0f37c9d60a0fae8d6130d
# Parent  8f0e95ff94ee27772301ae6a4aeb047a6fa76a00
PSNR performance script

diff -r 8f0e95ff94ee -r 1b6048d7e1d4 source/PSNR_Performance.bat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/source/PSNR_Performance.bat	Fri Jul 19 19:47:22 2013 -0700
@@ -0,0 +1,50 @@
+cd %Builddir%\8bit\Release
+
+FOR /F "delims=EOF" %%i IN (%workingdir%\commandlines.txt) do (
+
+ @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  %video1%.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"
+ %decoder% -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"
+ %drpsnr% -r %video1%.yuv -c script.yuv -w 1920 -h 1080 -e %frames1% >> "%workingdir%dr_psnr_output_%video1%_no_rdo.txt"
+
+ @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"
+ %decoder% -b script.out -o script.yuv >> "%workingdir%decoder_output_%video1%_rdo.txt"
+ @echo %%i --rdo  >> "%workingdir%dr_psnr_output_%video1%_rdo.txt"
+ %drpsnr% -r %video1%.yuv -c script.yuv -w 1920 -h 1080 -e %frames1% >> "%workingdir%dr_psnr_output_%video1%_rdo.txt"
+
+
+	
+ @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"
+ %decoder% -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"
+ %drpsnr% -r %video2%.yuv -c script.yuv -w 1920 -h 1080 -e %frames1% >> "%workingdir%dr_psnr_output_%video2%_no_rdo.txt"
+
+ @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"
+ %decoder% -b script.out -o script.yuv >> "%workingdir%decoder_output_%video2%_rdo.txt"
+ @echo %%i --rdo  >> "%workingdir%dr_psnr_output_%video2%_rdo.txt"
+ %drpsnr% -r %video2%.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"
+ %decoder% -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"
+ %drpsnr% -r %video3%.yuv -c script.yuv -w 1920 -h 1080 -e %frames1% >> "%workingdir%dr_psnr_output_%video3%_no_rdo.txt"
+
+ @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"
+ %decoder% -b script.out -o script.yuv >> "%workingdir%decoder_output_%video3%_rdo.txt"
+ @echo %%i --rdo  >> "%workingdir%dr_psnr_output_%video3%_rdo.txt"
+ %drpsnr% -r %video3%.yuv -c script.yuv -w 1920 -h 1080 -e %frames1% >> "%workingdir%dr_psnr_output_%video3%_rdo.txt"
+)
diff -r 8f0e95ff94ee -r 1b6048d7e1d4 source/Send_Mail.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/source/Send_Mail.py	Fri Jul 19 19:47: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=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)
+ 
+    session.sendmail(sender, recipient, msg.as_string())
+    session.quit()
+if __name__ == '__main__':
+    main()
diff -r 8f0e95ff94ee -r 1b6048d7e1d4 source/commandlines.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/source/commandlines.txt	Fri Jul 19 19:47: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
diff -r 8f0e95ff94ee -r 1b6048d7e1d4 source/performance_XL.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/source/performance_XL.py	Fri Jul 19 19:47: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()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NEW_17J.patch
Type: text/x-patch
Size: 13416 bytes
Desc: not available
URL: <http://mailman.videolan.org/private/x265-devel/attachments/20130719/3f84d5de/attachment-0001.bin>


More information about the x265-devel mailing list