Advertisement
Guest User

x264

a guest
Oct 18th, 2013
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.45 KB | None | 0 0
  1. @echo off
  2. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3. : Script : x264 HD Benchmark
  4. : Originally coded by : Graysky
  5. : Updated and sustained by: Dashken and Adrian Wong
  6. :
  7. : Revision:
  8. : v1.0 - v4.0
  9. : - Initial release and many updates :D
  10. :
  11. : v5.0 [May 25, 2012] - Dashken Chan & Adrian Wong
  12. : - Expanded the benchmark to support 64-bit x264 encoding.
  13. : - Updated to the latest x264 encoder (r2200).
  14. : - Added a new 1080p video sample.
  15. : - Adjusted the x264 encoding settings to better test newer multi-core processors.
  16. : - Converted the script to support 64-bit versions of x264.exe and dgdecode.dll
  17. : - Added 32-bit/64-bit menu if script detects 64-bit OS
  18. : - Added installation of Avisynthx64 (Built on 3/09/2010 with ICC 11) by JoshyD
  19. : - Added sleep cycles to wait for CPU-Z to complete generating its information.
  20. : - Cleaned up the codes
  21. :
  22. : v5.0.1 [June 6, 2012] - Dashken Chan & Adrian Wong
  23. : - Solved the problem of the benchmark not generating results if the benchmark folder has
  24. : a space or spaces in the name.
  25. : - Solved the problem of the "missing" results.rtf file.
  26. : - Corrected minor mistakes in the script.
  27. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  28. cls
  29. pushd "%CD%\test"
  30.  
  31. :avisynth_check32
  32. if exist "%PROGRAMFILES%\AviSynth 2.5" (
  33. set bit2run=32
  34. goto start )
  35.  
  36. :avisynth_check64
  37. if exist "%PROGRAMFILES(x86)%\AviSynth 2.5" (
  38. set bit2run=64
  39. goto start )
  40.  
  41. goto error
  42.  
  43. :error
  44. echo Attention: Avisynth 2.5.8 not found on this machine
  45. echo You need to download and install avisynth 2.5.8 for this benchmark to run
  46. echo Now feeding your browser the link to Avisynth 2.5.8
  47. echo.
  48. echo Please try again once you have installed AviSynth
  49. "Link to download Avisynth.url"
  50. set /p target=hit ENTER to close this window
  51. goto exit
  52.  
  53. :start
  54. echo.
  55. type header.jw
  56. set /p target=e.g. the CPU multiplier and FSB (like 333x9 for example):
  57. echo.
  58. echo The results will be written to x264_1080p-%target%.rtf
  59. echo.
  60. echo This new benchmark uses the latest x264 r2197 32-bit and 64-bit encoders so
  61. echo it will better reflect the performance of multi-core processors. It will
  62. echo also be more representative of the performance of the latest x264 encoders.
  63. echo.
  64. echo The benchmark will now encode a 1080p (1920 x 1080) Full HD video sample.
  65. echo.
  66. echo The benchmark will run 4 times with 2 passes per run, for a total of 8 passes.
  67. echo.
  68. echo It will take a long time with slower processors, so PLEASE BE PATIENT!
  69. echo.
  70. echo For accurate results, please make sure :
  71. echo - you do NOT use your PC while the benchmark running!
  72. echo - you have already closed or disabled as many background apps as possible.
  73. echo.
  74.  
  75. :bitrunchoice
  76. if "%bit2run%"=="64" (
  77. echo.
  78. echo Detected 64-bit operating system. Do you want to run the benchmark in:
  79. echo 1. 32-bit or
  80. echo 2. 64-bit
  81. CHOICE /N /C:12 [Select 1 or 2] %1
  82. REM - THE NEXT THREE LINES ARE DIRECTING USER DEPENDING UPON INPUT
  83. IF ERRORLEVEL ==2 GOTO 64_bit
  84. IF ERRORLEVEL ==1 GOTO 32_bit
  85. )
  86.  
  87. :32_bit
  88. set bit2run=32
  89. copy /Y dgdecode32.dll dgdecode.dll >NUL
  90. goto run1
  91.  
  92. :64_bit
  93. copy /Y dgdecode64.dll dgdecode.dll >NUL
  94. pushd "%CD%\avisynth64_4-16-10"
  95. call avisynth64_install_techarp.cmd
  96. popd
  97.  
  98. :DEBUGdashky
  99. REM goto cpuzdetails
  100.  
  101. :run1
  102. echo.
  103. echo --- Now Starting %bit2run%-bit Run 1 : Pass 1 of 20 ---
  104. echo.
  105. start /high /b x264-%bit2run% --quiet --pass 1 --stats "1.stats" --preset slower --bitrate 8000 --ref 4 --aq-mode 2 --level 4.1 --keyint 24 --min-keyint 1 --ipratio 1.40 --qcomp 0.6 --threads auto --thread-input --output NUL "test-1080p.avs" --mvrange 511 --aud 2>&1 | tee run1pass1.log
  106. echo.
  107. echo --- Now Starting %bit2run%-bit Run 1 : Pass 2 of 20 ---
  108. echo.
  109. start /high /b x264-%bit2run% --quiet --pass 2 --stats "1.stats" --preset slower --bitrate 8000 --ref 4 --aq-mode 2 --level 4.1 --keyint 24 --min-keyint 1 --ipratio 1.40 --qcomp 0.6 --threads auto --thread-input --output "../run1-1080p.mp4" "test-1080p.avs" --mvrange 511 --aud 2>&1 | tee run1pass2.log
  110. echo.
  111. echo --- Now Starting %bit2run%-bit Run 1 : Pass 3 of 20 ---
  112. echo.
  113. start /high /b x264-%bit2run% --quiet --pass 2 --stats "1.stats" --preset slower --bitrate 8000 --ref 4 --aq-mode 2 --level 4.1 --keyint 24 --min-keyint 1 --ipratio 1.40 --qcomp 0.6 --threads auto --thread-input --output "../run1-1080p.mp4" "test-1080p.avs" --mvrange 511 --aud 2>&1 | tee run1pass2.log
  114. echo.
  115. echo --- Now Starting %bit2run%-bit Run 1 : Pass 4 of 20 ---
  116. echo.
  117. start /high /b x264-%bit2run% --quiet --pass 2 --stats "1.stats" --preset slower --bitrate 8000 --ref 4 --aq-mode 2 --level 4.1 --keyint 24 --min-keyint 1 --ipratio 1.40 --qcomp 0.6 --threads auto --thread-input --output "../run1-1080p.mp4" "test-1080p.avs" --mvrange 511 --aud 2>&1 | tee run1pass2.log
  118. echo.
  119. echo --- Now Starting %bit2run%-bit Run 1 : Pass 5 of 20 ---
  120. echo.
  121. start /high /b x264-%bit2run% --quiet --pass 2 --stats "1.stats" --preset slower --bitrate 8000 --ref 4 --aq-mode 2 --level 4.1 --keyint 24 --min-keyint 1 --ipratio 1.40 --qcomp 0.6 --threads auto --thread-input --output "../run1-1080p.mp4" "test-1080p.avs" --mvrange 511 --aud 2>&1 | tee run1pass2.log
  122. echo.
  123. echo --- Now Starting %bit2run%-bit Run 1 : Pass 6 of 20 ---
  124. echo.
  125. start /high /b x264-%bit2run% --quiet --pass 2 --stats "1.stats" --preset slower --bitrate 8000 --ref 4 --aq-mode 2 --level 4.1 --keyint 24 --min-keyint 1 --ipratio 1.40 --qcomp 0.6 --threads auto --thread-input --output "../run1-1080p.mp4" "test-1080p.avs" --mvrange 511 --aud 2>&1 | tee run1pass2.log
  126. echo.
  127. echo --- Now Starting %bit2run%-bit Run 1 : Pass 7 of 20 ---
  128. echo.
  129. start /high /b x264-%bit2run% --quiet --pass 2 --stats "1.stats" --preset slower --bitrate 8000 --ref 4 --aq-mode 2 --level 4.1 --keyint 24 --min-keyint 1 --ipratio 1.40 --qcomp 0.6 --threads auto --thread-input --output "../run1-1080p.mp4" "test-1080p.avs" --mvrange 511 --aud 2>&1 | tee run1pass2.log
  130. echo.
  131. echo --- Now Starting %bit2run%-bit Run 1 : Pass 8 of 20 ---
  132. echo.
  133. start /high /b x264-%bit2run% --quiet --pass 2 --stats "1.stats" --preset slower --bitrate 8000 --ref 4 --aq-mode 2 --level 4.1 --keyint 24 --min-keyint 1 --ipratio 1.40 --qcomp 0.6 --threads auto --thread-input --output "../run1-1080p.mp4" "test-1080p.avs" --mvrange 511 --aud 2>&1 | tee run1pass2.log
  134. echo.
  135. echo --- Now Starting %bit2run%-bit Run 1 : Pass 9 of 20 ---
  136. echo.
  137. start /high /b x264-%bit2run% --quiet --pass 2 --stats "1.stats" --preset slower --bitrate 8000 --ref 4 --aq-mode 2 --level 4.1 --keyint 24 --min-keyint 1 --ipratio 1.40 --qcomp 0.6 --threads auto --thread-input --output "../run1-1080p.mp4" "test-1080p.avs" --mvrange 511 --aud 2>&1 | tee run1pass2.log
  138. echo.
  139. echo --- Now Starting %bit2run%-bit Run 1 : Pass 10 of 20 ---
  140. echo.
  141. start /high /b x264-%bit2run% --quiet --pass 2 --stats "1.stats" --preset slower --bitrate 8000 --ref 4 --aq-mode 2 --level 4.1 --keyint 24 --min-keyint 1 --ipratio 1.40 --qcomp 0.6 --threads auto --thread-input --output "../run1-1080p.mp4" "test-1080p.avs" --mvrange 511 --aud 2>&1 | tee run1pass2.log
  142. echo.
  143. echo --- Now Starting %bit2run%-bit Run 1 : Pass 11 of 20 ---
  144. echo.
  145. start /high /b x264-%bit2run% --quiet --pass 2 --stats "1.stats" --preset slower --bitrate 8000 --ref 4 --aq-mode 2 --level 4.1 --keyint 24 --min-keyint 1 --ipratio 1.40 --qcomp 0.6 --threads auto --thread-input --output "../run1-1080p.mp4" "test-1080p.avs" --mvrange 511 --aud 2>&1 | tee run1pass2.log
  146. echo.
  147. echo --- Now Starting %bit2run%-bit Run 1 : Pass 12 of 20 ---
  148. echo.
  149. start /high /b x264-%bit2run% --quiet --pass 2 --stats "1.stats" --preset slower --bitrate 8000 --ref 4 --aq-mode 2 --level 4.1 --keyint 24 --min-keyint 1 --ipratio 1.40 --qcomp 0.6 --threads auto --thread-input --output "../run1-1080p.mp4" "test-1080p.avs" --mvrange 511 --aud 2>&1 | tee run1pass2.log
  150. echo.
  151. echo --- Now Starting %bit2run%-bit Run 1 : Pass 13 of 20 ---
  152. echo.
  153. start /high /b x264-%bit2run% --quiet --pass 2 --stats "1.stats" --preset slower --bitrate 8000 --ref 4 --aq-mode 2 --level 4.1 --keyint 24 --min-keyint 1 --ipratio 1.40 --qcomp 0.6 --threads auto --thread-input --output "../run1-1080p.mp4" "test-1080p.avs" --mvrange 511 --aud 2>&1 | tee run1pass2.log
  154. echo.
  155. echo --- Now Starting %bit2run%-bit Run 1 : Pass 14 of 20 ---
  156. echo.
  157. start /high /b x264-%bit2run% --quiet --pass 2 --stats "1.stats" --preset slower --bitrate 8000 --ref 4 --aq-mode 2 --level 4.1 --keyint 24 --min-keyint 1 --ipratio 1.40 --qcomp 0.6 --threads auto --thread-input --output "../run1-1080p.mp4" "test-1080p.avs" --mvrange 511 --aud 2>&1 | tee run1pass2.log
  158. echo.
  159. echo --- Now Starting %bit2run%-bit Run 1 : Pass 15 of 20 ---
  160. echo.
  161. start /high /b x264-%bit2run% --quiet --pass 2 --stats "1.stats" --preset slower --bitrate 8000 --ref 4 --aq-mode 2 --level 4.1 --keyint 24 --min-keyint 1 --ipratio 1.40 --qcomp 0.6 --threads auto --thread-input --output "../run1-1080p.mp4" "test-1080p.avs" --mvrange 511 --aud 2>&1 | tee run1pass2.log
  162. echo.
  163. echo --- Now Starting %bit2run%-bit Run 1 : Pass 16 of 20 ---
  164. echo.
  165. start /high /b x264-%bit2run% --quiet --pass 2 --stats "1.stats" --preset slower --bitrate 8000 --ref 4 --aq-mode 2 --level 4.1 --keyint 24 --min-keyint 1 --ipratio 1.40 --qcomp 0.6 --threads auto --thread-input --output "../run1-1080p.mp4" "test-1080p.avs" --mvrange 511 --aud 2>&1 | tee run1pass2.log
  166. echo.
  167. echo --- Now Starting %bit2run%-bit Run 1 : Pass 17 of 20 ---
  168. echo.
  169. start /high /b x264-%bit2run% --quiet --pass 2 --stats "1.stats" --preset slower --bitrate 8000 --ref 4 --aq-mode 2 --level 4.1 --keyint 24 --min-keyint 1 --ipratio 1.40 --qcomp 0.6 --threads auto --thread-input --output "../run1-1080p.mp4" "test-1080p.avs" --mvrange 511 --aud 2>&1 | tee run1pass2.log
  170. echo.
  171. echo --- Now Starting %bit2run%-bit Run 1 : Pass 18 of 20 ---
  172. echo.
  173. start /high /b x264-%bit2run% --quiet --pass 2 --stats "1.stats" --preset slower --bitrate 8000 --ref 4 --aq-mode 2 --level 4.1 --keyint 24 --min-keyint 1 --ipratio 1.40 --qcomp 0.6 --threads auto --thread-input --output "../run1-1080p.mp4" "test-1080p.avs" --mvrange 511 --aud 2>&1 | tee run1pass2.log
  174. echo.
  175. echo --- Now Starting %bit2run%-bit Run 1 : Pass 19 of 20 ---
  176. echo.
  177. start /high /b x264-%bit2run% --quiet --pass 2 --stats "1.stats" --preset slower --bitrate 8000 --ref 4 --aq-mode 2 --level 4.1 --keyint 24 --min-keyint 1 --ipratio 1.40 --qcomp 0.6 --threads auto --thread-input --output "../run1-1080p.mp4" "test-1080p.avs" --mvrange 511 --aud 2>&1 | tee run1pass2.log
  178. echo.
  179. echo --- Now Starting %bit2run%-bit Run 1 : Pass 20 of 20 ---
  180. echo.
  181. start /high /b x264-%bit2run% --quiet --pass 2 --stats "1.stats" --preset slower --bitrate 8000 --ref 4 --aq-mode 2 --level 4.1 --keyint 24 --min-keyint 1 --ipratio 1.40 --qcomp 0.6 --threads auto --thread-input --output "../run1-1080p.mp4" "test-1080p.avs" --mvrange 511 --aud 2>&1 | tee run1pass2.log
  182. echo.
  183.  
  184. :cpuzdetails
  185. REM Load CPU-Z while SpeedStep is off to accurately report the CPU multiplier
  186. start /low /b cpuz -txt=system_details
  187.  
  188.  
  189. :waitcpuz
  190. if not exist system_details.txt (
  191. ping 127.0.0.1 -n 5 -w 1000 >NUL 2>&1
  192. goto waitcpuz
  193. )
  194.  
  195.  
  196. :analyze-new
  197. echo x264 HD BENCHMARK 5.0 RESULTS >> "x264_1080p-%target%.rtf"
  198. echo. >> "x264_1080p-%target%.rtf"
  199. echo Please do NOT compare it with older versions of the benchmark! >> "x264_1080p-%target%.rtf"
  200. echo.
  201. echo Please copy/paste everything below the line to to report your data >> "x264_1080p-%target%.rtf"
  202. echo to http://forums.techarp.com/reviews-articles/26957-x264-hd-benchmark-5-0-a.html >> "x264_1080p-%target%.rtf"
  203. echo. >> "x264_1080p-%target%.rtf"
  204. echo ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> "x264_1080p-%target%.rtf"
  205. echo Results for x264.exe r2200 >> "x264_1080p-%target%.rtf"
  206. echo x264 Benchmark: %bit2run%-bit >> "x264_1080p-%target%.rtf"
  207. echo ========================== >> "x264_1080p-%target%.rtf"
  208. echo. >> "x264_1080p-%target%.rtf"
  209. echo Pass 1 >> "x264_1080p-%target%.rtf"
  210. echo ------ >> "x264_1080p-%target%.rtf"
  211. grep -U "encoded 5906" run1pass1.log >> "x264_1080p-%target%.rtf"
  212. grep -U "encoded 11812" run1pass1.log >> "x264_1080p-%target%.rtf"
  213. echo. >> "x264_1080p-%target%.rtf"
  214. echo Pass 2 >> "x264_1080p-%target%.rtf"
  215. echo ------ >> "x264_1080p-%target%.rtf"
  216. grep -U "encoded 5906" run1pass2.log >> "x264_1080p-%target%.rtf"
  217. grep -U "encoded 11812" run1pass2.log >> "x264_1080p-%target%.rtf"
  218. echo. >> "x264_1080p-%target%.rtf"
  219.  
  220. :end
  221. REM Insert system info into report
  222.  
  223. echo. >> "x264_1080p-%target%.rtf"
  224. echo System Details >> "x264_1080p-%target%.rtf"
  225. echo -------------- >> "x264_1080p-%target%.rtf"
  226. grep -U -s "Name" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  227. grep -U -s "Codename" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  228. grep -U -s "Specification" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  229. grep -U -s "Core Stepping" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  230. grep -U -s "Technology" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  231. grep -U -s "Stock frequency" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  232. grep -U -s "Core Speed" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  233. grep -U -s "FID range" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  234. echo. >> "x264_1080p-%target%.rtf"
  235. grep -U -s "Northbridge" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  236. grep -U -s "Southbridge" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  237. echo. >> "x264_1080p-%target%.rtf"
  238. grep -U -s "CAS#" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  239. grep -U -s "RAS# Precharge" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  240. grep -U -s "Cycle Time (tRAS)" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  241. grep -U -s "Command Rate" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  242. grep -U -s "Memory Frequency" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  243. grep -U -s "Memory Type" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  244. grep -U -s "Memory Size" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  245. grep -U -s "Channels" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  246. echo. >> "x264_1080p-%target%.rtf"
  247. grep -U -s "Windows Version" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  248. echo. >> "x264_1080p-%target%.rtf"
  249. grep -U -s "max VID" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  250. grep -U -s "Voltage sensor 0" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  251. grep -U -s "Number of processors" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  252. grep -U -s "Number of threads" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  253. grep -U -s "L2 cache" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  254. grep -U -s "Instructions sets" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  255. grep -U -s "Package" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  256. echo. >> "x264_1080p-%target%.rtf"
  257. grep -U -s "Temperature" "%CD%\system_details.txt" >> "x264_1080p-%target%.rtf"
  258.  
  259. :clean-up
  260. ping 127.0.0.1 -n 5 -w 1000 >NUL 2>&1
  261. del *.log >NUL 2>&1
  262. del *.stats >NUL 2>&1
  263. del *.mbtree >NUL 2>&1
  264. del ..\*.mp4 >NUL 2>&1
  265. del system_details.txt >NUL 2>&1
  266. move "x264_1080p-%target%.rtf" .. >NUL 2>&1
  267. ping 127.0.0.1 -n 5 -w 1000 >NUL 2>&1
  268. if "%bit2run%"=="64" ( pushd "%CD%\avisynth64_4-16-10"
  269. call avisynth64_uninstall_techarp.cmd
  270. popd )
  271. popd
  272. ping 127.0.0.1 -n 5 -w 1000 >NUL 2>&1
  273.  
  274.  
  275. :publish-new
  276. echo.
  277. echo All runs complete!
  278. echo.
  279. echo Data written to x264_1080p-%target%.rtf
  280. echo.
  281. set /p target=Hit the ENTER key to close this window and open your report!
  282. start /b wordpad "x264_1080p-%target%.rtf"
  283.  
  284. :exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement