summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorhandbrake <[email protected]>2012-12-18 08:40:09 +0000
committerhandbrake <[email protected]>2012-12-18 08:40:09 +0000
commitab39134445f79f1684a3d8ab814085e04ade27d7 (patch)
treeba9acefd8f4c0ac688841c919ae0957fb401f08e /test
parent927dba2dc03a33953239480ae307a239e73a7452 (diff)
add hardware decoder support for H264(vob/m2ts), mpeg2(vob/m2ts), VC1(WMV3/m2ts) decoding
modify the GUI for adding some user options about enable/disable OpenCL or GPU add some test case for tesing our modifications. git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/opencl@5100 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'test')
-rw-r--r--test/module.defs4
-rw-r--r--test/test case/handbrake_test.txt80
-rw-r--r--test/test case/readme.txt43
-rw-r--r--test/test case/run_handbrake.py126
-rw-r--r--test/test case/sample_testresults.csv52
-rw-r--r--test/test.c54
6 files changed, 352 insertions, 7 deletions
diff --git a/test/module.defs b/test/module.defs
index f057db3cc..246b62a94 100644
--- a/test/module.defs
+++ b/test/module.defs
@@ -44,6 +44,10 @@ else ifeq (1-mingw,$(BUILD.cross)-$(BUILD.system))
ifeq ($(HAS.dlfcn),1)
TEST.GCC.l += dl
endif
+ifeq (1,$(FEATURE.opencl))
+ TEST.GCC.l += OpenCL
+ TEST.GCC.D += USE_OPENCL
+endif
TEST.GCC.l += pthreadGC2 iconv ws2_32
TEST.GCC.D += PTW32_STATIC_LIB
TEST.GCC.args.extra.exe++ += -static
diff --git a/test/test case/handbrake_test.txt b/test/test case/handbrake_test.txt
new file mode 100644
index 000000000..47fb0dd8e
--- /dev/null
+++ b/test/test case/handbrake_test.txt
@@ -0,0 +1,80 @@
+#- automated python test script
+#-
+#- replace the input filename with "infile", replace the output filename with "outfile.m4v"
+#- the python script will replace these with the proper testing input and output file names
+#-
+#- --start-at frame:0 --stop-at frame:stopframe will be inserted by script, so omit it from the command line here
+#- the names are used as test names and file names
+
+# universal
+-i "infile" -t 1 -o "outfile.m4v" -f mp4 -w 720 --loose-anamorphic -e x264 -q 20 --vfr -a 1,1 -E faac,ffac3 -B 160,0 -6 dpl2,auto -R Auto,Auto -D 0,0 --gain=0,0 --audio-copy-mask none --audio-fallback ffac3 --markers="C:\Users\jgallmeier\AppData\Local\Temp\Blueangels-1-1-chapters.csv" -x cabac=0:ref=2:me=umh:bframes=0:weightp=0:8x8dct=0:trellis=0:subq=6 --verbose=1
+
+# iPod
+-i "infile" -t 1 -o "outfile.m4v" -f mp4 -I -w 320 -l 240 -e x264 -b 700 --vfr -a 1 -E faac -B 160 -6 dpl2 -R Auto -D 0 --gain=0 --audio-copy-mask none --audio-fallback ffac3 --markers="C:\Users\jgallmeier\AppData\Local\Temp\Blueangels-1-1-chapters.csv" -x level=30:bframes=0:weightp=0:cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 --verbose=1
+
+
+# iPhone_iPod_Touch
+ -i "infile" -t 1 -o "outfile.m4v" -f mp4 -w 480 -l 320 -e x264 -q 20 --vfr -a 1 -E faac -B 128 -6 dpl2 -R Auto -D 0 --gain=0 --audio-copy-mask none --audio-fallback ffac3 --markers="C:\Users\jgallmeier\AppData\Local\Temp\Blueangels-1-1-chapters.csv" -x cabac=0:ref=2:me=umh:bframes=0:weightp=0:subq=6:8x8dct=0:trellis=0 --verbose=1
+
+
+# iPhone_4
+ -i "infile" -t 1 -o "outfile.m4v" -f mp4 -4 -w 960 --loose-anamorphic -e x264 -q 20 -r 29.97 --pfr -a 1 -E faac -B 160 -6 dpl2 -R Auto -D 0 --gain=0 --audio-copy-mask none --audio-fallback ffac3 --markers="C:\Users\jgallmeier\AppData\Local\Temp\Blueangels-1-1-chapters.csv" --verbose=1
+
+
+# iPad
+
+-i "infile" -t 1 -o "outfile.m4v" -f mp4 -4 -w 1024 --loose-anamorphic -e x264 -q 20 -r 29.97 --pfr -a 1 -E faac -B 160 -6 dpl2 -R Auto -D 0 --gain=0 --audio-copy-mask none --audio-fallback ffac3 --markers="C:\Users\jgallmeier\AppData\Local\Temp\Blueangels-1-1-chapters.csv" --verbose=1
+
+
+# Apple_TV
+
+ -i "infile" -t 1 -o "outfile.m4v" -f mp4 -4 -w 960 --loose-anamorphic -e x264 -q 20 --vfr -a 1,1 -E faac,ffac3 -B 160,0 -6 dpl2,auto -R Auto,Auto -D 0,0 --gain=0,0 --audio-copy-mask none --audio-fallback ffac3 --markers="C:\Users\jgallmeier\AppData\Local\Temp\Blueangels-1-1-chapters.csv" -x cabac=0:ref=2:me=umh:b-pyramid=none:b-adapt=2:weightb=0:trellis=0:weightp=0:vbv-maxrate=9500:vbv-bufsize=9500 --verbose=1
+
+# Apple_TV_2
+-i "infile" -t 1 -o "outfile.m4v" -f mp4 -4 -w 1280 --loose-anamorphic -e x264 -q 20 -r 29.97 --pfr -a 1,1 -E faac,ffac3 -B 160,0 -6 dpl2,auto -R Auto,Auto -D 0,0 --gain=0,0 --audio-copy-mask none --audio-fallback ffac3 --markers="C:\Users\jgallmeier\AppData\Local\Temp\Blueangels-1-1-chapters.csv" --verbose=1
+
+
+# Android_Mid
+-i "infile" -t 1 -o "outfile.m4v" -f mp4 -w 480 -l 270 -e x264 -q 22 -r 29.97 --pfr -a 1 -E faac -B 128 -6 dpl2 -R Auto -D 0 --gain=0 --audio-copy-mask none --audio-fallback ffac3 -x cabac=0:ref=2:me=umh:bframes=0:weightp=0:subq=6:8x8dct=0:trellis=0 --verbose=1
+
+
+# Android_High
+ -i "infile" -t 1 -o "outfile.mp4" -f mp4 -w 720 --loose-anamorphic -e x264 -q 22 -r 29.97 --pfr -a 1 -E faac -B 128 -6 dpl2 -R Auto -D 0 --gain=0 --audio-copy-mask none --audio-fallback ffac3 -x weightp=0:cabac=0 --verbose=1
+
+
+# Normal_1080p_to_1080p_fixed_qp
+-i "infile" -t 1 -o "outfile.m4v" -f mp4 --strict-anamorphic -e x264 -q 20 --vfr -a 1 -E faac -B 160 -6 dpl2 -R Auto -D 0 --gain=0 --audio-copy-mask none --audio-fallback ffac3 --markers="C:\Users\jgallmeier\AppData\Local\Temp\Blueangels-1-1-chapters.csv" -x ref=1:weightp=1:subq=2:rc-lookahead=10:trellis=0:8x8dct=0 --verbose=1
+
+
+# Normal_1080p_to_720p_fixed_qp
+-i "infile" -t 1 -o "outfile.m4v" -f mp4 -w 1280 -l 720 --custom-anamorphic --display-width 1282 --keep-display-aspect -e x264 -q 20 --vfr -a 1 -E faac -B 160 -6 dpl2 -R Auto -D 0 --gain=0 --audio-copy-mask none --audio-fallback ffac3 --markers="C:\Users\jgallmeier\AppData\Local\Temp\Blueangels-1-1-chapters.csv" -x ref=1:weightp=1:subq=2:rc-lookahead=10:trellis=0:8x8dct=0 --verbose=1
+
+
+
+# Normal_1080p_to_1080p_13_mbps
+-i "infile" -t 1 -o "outfile.m4v" -f mp4 --strict-anamorphic -e x264 -b 13000 --vfr -a 1 -E faac -B 160 -6 dpl2 -R Auto -D 0 --gain=0 --audio-copy-mask none --audio-fallback ffac3 --markers="C:\Users\jgallmeier\AppData\Local\Temp\Blueangels-1-1-chapters.csv" -x ref=1:weightp=1:subq=2:rc-lookahead=10:trellis=0:8x8dct=0 --verbose=1
+
+
+# Normal_1080p_to_720p_6_mbps
+ -i "infile" -t 1 -c 1 -o "outfile.m4v" -f mp4 -w 1280 -l 720 --custom-anamorphic --display-width 1282 --keep-display-aspect -e x264 -b 6000 --vfr -a 1 -E faac -B 160 -6 dpl2 -R Auto -D 0 --gain=0 --audio-copy-mask none --audio-fallback ffac3 --markers="C:\Users\jgallmeier\AppData\Local\Temp\Blueangels-1-1-chapters.csv" -x ref=1:weightp=1:subq=2:rc-lookahead=10:trellis=0:8x8dct=0 --verbose=1
+
+# high_1080p_to_1080p_fixed_qp
+-i "infile" -t 1 -o "high_1080p.m4v" -f mp4 -4 --detelecine --decomb -w 1920 --loose-anamorphic -e x264 -q 20 --vfr -a 1,1 -E faac,ffac3 -B 160,0 -6 dpl2,auto -R Auto,Auto -D 0,0 --gain=0,0 --audio-copy-mask none --audio-fallback ffac3 --markers="C:\Users\jgallmeier\AppData\Local\Temp\Blueangels-1-1-chapters.csv" -x b-adapt=2:rc-lookahead=50 --verbose=1
+
+
+# high_1080p_to_720p_fixed qp
+ -i "infile" -t 1 -o "outfile.m4v" -f mp4 -4 --detelecine --decomb -w 1280 -l 720 --custom-anamorphic --display-width 1282 --keep-display-aspect -e x264 -q 20 --vfr -a 1,1 -E faac,ffac3 -B 160,0 -6 dpl2,auto -R Auto,Auto -D 0,0 --gain=0,0 --audio-copy-mask none --audio-fallback ffac3 --markers="C:\Users\jgallmeier\AppData\Local\Temp\Blueangels-1-1-chapters.csv" -x b-adapt=2:rc-lookahead=50 --verbose=1
+
+
+# high_1080p_to_1080p_13_mbps
+ -i "infile" -t 1 -o "outfile.m4v" -f mp4 -4 --detelecine --decomb -w 1920 --loose-anamorphic -e x264 -b 13000 --vfr -a 1,1 -E faac,ffac3 -B 160,0 -6 dpl2,auto -R Auto,Auto -D 0,0 --gain=0,0 --audio-copy-mask none --audio-fallback ffac3 --markers="C:\Users\jgallmeier\AppData\Local\Temp\Blueangels-1-1-chapters.csv" -x b-adapt=2:rc-lookahead=50 --verbose=1
+
+
+# high_1080p_to_720p_6mbps
+-i "infile" -t 1 -o "outfile.m4v" -f mp4 -4 --detelecine --decomb -w 1280 -l 720 --custom-anamorphic --display-width 1282 --keep-display-aspect -e x264 -b 6000 --vfr -a 1,1 -E faac,ffac3 -B 160,0 -6 dpl2,auto -R Auto,Auto -D 0,0 --gain=0,0 --audio-copy-mask none --audio-fallback ffac3 --markers="C:\Users\jgallmeier\AppData\Local\Temp\Blueangels-1-1-chapters.csv" -x b-adapt=2:rc-lookahead=50 --verbose=1
+
+# strange_resolution
+-i "infile" -t 1 -o "outfile.m4v" -f mp4 -w 480 -l 1078 -e x264 -q 20 --vfr -a 1 -E faac -B 128 -6 dpl2 -R Auto -D 0 --gain=0 --audio-copy-mask none --audio-fallback ffac3 --markers="C:\Users\jgallmeier\AppData\Local\Temp\Blueangels-1-1-chapters.csv" -x cabac=0:ref=2:me=umh:bframes=0:weightp=0:subq=6:8x8dct=0:trellis=0 --verbose=1
+
+
+#-end of script
diff --git a/test/test case/readme.txt b/test/test case/readme.txt
new file mode 100644
index 000000000..8c182e26c
--- /dev/null
+++ b/test/test case/readme.txt
@@ -0,0 +1,43 @@
+Handbrake automation scripts
+
+this script is written in Python (2.7). It should work with any open source python distribution.
+I prefer to use enthought.com's free version of Python.
+
+To use this script:
+1) copy handbrake_test.txt to the handbrakecli.exe directory
+2) copy run_handbrake.py to the handbrakecli.exe directory
+3) copy the input video files to the handbrakecli.exe directory
+4) in a command window, go to the handbrakecli.exe directory
+5) type:run_handbrake.py and hit return
+
+you should see the command lines and % complete in the command window. Output files are located in the ./output directory.
+there will be a separate output video file, log file (the handbrake output), and a testresults.csv file
+
+When the test is complete, import the testresults.csv into an Excel spreadsheet.
+
+Common Problems:
+
+you will see zero fps and psnr if handbrakecli.exe exists with a failure. Common problems are missing video files from the current directory.
+
+
+
+Notes:
+
+The run_handbrake.py is a text file python script. The top of the file contains configuration parameters such as
+the input video files to use, etc. change these at will.
+
+The handbrake_test.txt is a "script" file that contains the individual tests to run. The format is:
+
+#- is a comment
+
+# name of test (also used as output log file name, so don't use strange characters here
+
+-i this is the handbrakecli.exe options line
+
+
+blank lines are ignored.
+
+To enable UVD decoding, add -P -U to each execution line in handbrake_test.txt.
+Example:
+# universal
+-i "infile" -t 1 -o "outfile.m4v" -P -U -f mp4 -w 720 --loose-anamorphic -e x264 -q 20 --vfr -a 1,1 -E faac,ffac3 -B 160,0 -6 dpl2,auto -R Auto,Auto -D 0,0 --gain=0,0 --audio-copy-mask none --audio-fallback ffac3 --markers="C:\Users\jgallmeier\AppData\Local\Temp\Blueangels-1-1-chapters.csv" -x cabac=0:ref=2:me=umh:bframes=0:weightp=0:8x8dct=0:trellis=0:subq=6 --verbose=1
diff --git a/test/test case/run_handbrake.py b/test/test case/run_handbrake.py
new file mode 100644
index 000000000..5efb0ac63
--- /dev/null
+++ b/test/test case/run_handbrake.py
@@ -0,0 +1,126 @@
+#!/usr/bin/python
+
+import sys, string, os, subprocess, time
+from multiprocessing import Process
+
+
+##### This script uses as input a 'script file'
+##### each line of the script file is a handbrakecli.exe options line (without the handbrakecli.exe)
+##### this is read in, each line is executed and the output results are parsed, pulling out fps, and Global PSNR
+
+inputscript = 'handbrake_test.txt'
+
+
+#### input image files
+
+###inputimagefiles = ['x264.avi']
+inputimagefiles = ['blueangels_20m.m2ps','blueangels.m2ts','BigBuckBunny.VOB']
+#### output directory
+outdir = 'output/'
+
+#### output CSV file
+outcsv = 'testresults.csv'
+
+#### limit to the number of frames processed
+endframe = 2000
+
+
+def run_handbrake(execline, testname):
+ #os.chdir(handbrakedir)
+ #process = subprocess.Popen(execline, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
+ proc = subprocess.Popen(execline, bufsize=-1, stderr=subprocess.PIPE, shell=True)
+
+ [sout, serr] = proc.communicate()
+
+ # stdout has the percentage complete for the given task
+ # stderr has all of the output for data collection
+
+ lines = serr.splitlines();
+
+ psnr = 0.0
+ for line in lines:
+ if line.find("PSNR Mean") > 0:
+ if line.find("kb/s") > 0:
+ x = line.find("Global:")
+ psnr = float(line[x+7:x+7+6])
+
+
+
+ # find fps
+ fps = 0.0
+ for line in lines:
+ if line.find("work: average") > 0:
+ if line.find("fps") > 0:
+ x = line.find("job is")
+ y = line.find("fps")
+ fps = float(line[x+6:y])
+
+
+ print "fps = " + str(fps) + ", PSNR = " + str(psnr)
+
+ logFILE = open(outdir + testname + '.log', "w")
+ logFILE.write(serr)
+ logFILE.close()
+
+ #if process.returncode == None: process.wait()
+
+ return [psnr, fps]
+
+
+
+########## main entry point #######
+def mytask():
+
+ if os.path.exists(outdir) == False:
+ print 'Creating output directory: ' + outdir
+ os.makedirs(outdir)
+ else:
+ print 'Output directory exists'
+
+ scriptFILE = open(inputscript, "r")
+
+ script = scriptFILE.read()
+
+ outFILE = open(outdir + outcsv, "w")
+
+ script_dict = [s for s in script.splitlines() if s]
+
+ # get the order of the tests
+ testname = list()
+ for line in script_dict:
+ if line.startswith('# '):
+ testname.append(line[1:])
+
+ # test code
+ #for item in testname:
+ # print item
+
+ outFILE.write("input file, handbrake preset, fps, psnr\n")
+
+ for inimg in inputimagefiles:
+ i = iter(testname)
+ [filename, part, fileext] = inimg.partition('.')
+ for line in script_dict:
+ if line.startswith('#') == 0:
+ test = i.next()
+ ex = line.replace("infile", inimg)
+ ex = ex.replace("outfile", outdir+fileext + '_' + test.lstrip())
+ ex = "handbrakecli.exe " + ex
+ print "-------------" + test + "----------------"
+ print ex
+ [psnr, fps] = run_handbrake(ex, fileext+ '_' + test.lstrip())
+ outstr = inimg + "," + test + "," + str(fps) + "," + str(psnr) + "\n"
+ outFILE.write(outstr)
+ outFILE.flush()
+ os.fsync(outFILE.fileno())
+ time.sleep(30)
+ print outstr
+
+ outFILE.close()
+ print "done"
+
+if __name__ == '__main__':
+ p = Process(target = mytask)
+ p.start()
+ p.join()
+
diff --git a/test/test case/sample_testresults.csv b/test/test case/sample_testresults.csv
new file mode 100644
index 000000000..f2d7acd47
--- /dev/null
+++ b/test/test case/sample_testresults.csv
@@ -0,0 +1,52 @@
+input file, handbrake preset, fps, psnr
+blueangels_20m.m2ps, universal,51.249393,43.329
+blueangels_20m.m2ps, iPod,104.499466,43.39
+blueangels_20m.m2ps, iPhone_iPod_Touch,82.94838,42.932
+blueangels_20m.m2ps, iPhone_4,27.005239,43.781
+blueangels_20m.m2ps, iPad,24.081524,43.829
+blueangels_20m.m2ps, Apple_TV,26.035112,43.496
+blueangels_20m.m2ps, Apple_TV_2,15.095184,44.122
+blueangels_20m.m2ps, Android_Mid,85.799118,41.523
+blueangels_20m.m2ps, Android_High,51.151642,42.586
+blueangels_20m.m2ps, Normal_1080p_to_1080p_fixed_qp,24.162228,44.721
+blueangels_20m.m2ps, Normal_1080p_to_720p_fixed_qp,43.044079,43.631
+blueangels_20m.m2ps, Normal_1080p_to_1080p_13_mbps,23.51717,45.031
+blueangels_20m.m2ps, Normal_1080p_to_720p_6_mbps,39.531132,44.304
+blueangels_20m.m2ps, high_1080p_to_1080p_fixed_qp,5.44732,45.031
+blueangels_20m.m2ps, high_1080p_to_720p_fixed qp,11.749803,43.892
+blueangels_20m.m2ps, high_1080p_to_1080p_13_mbps,5.319024,45.168
+blueangels_20m.m2ps, high_1080p_to_720p_6mbps,11.092562,44.167
+blueangels_20m.m2ps, strange_resolution,35.530605,44.236
+blueangels.m2ts, universal,38.152428,43.238
+blueangels.m2ts, iPod,58.110367,43.381
+blueangels.m2ts, iPhone_iPod_Touch,51.766876,42.914
+blueangels.m2ts, iPhone_4,21.514906,43.562
+blueangels.m2ts, iPad,19.358091,43.586
+blueangels.m2ts, Apple_TV,21.262102,43.3
+blueangels.m2ts, Apple_TV_2,12.826241,43.734
+blueangels.m2ts, Android_Mid,51.420086,41.512
+blueangels.m2ts, Android_High,36.581734,42.514
+blueangels.m2ts, Normal_1080p_to_1080p_fixed_qp,19.23077,43.986
+blueangels.m2ts, Normal_1080p_to_720p_fixed_qp,31.648577,43.284
+blueangels.m2ts, Normal_1080p_to_1080p_13_mbps,18.489985,44.288
+blueangels.m2ts, Normal_1080p_to_720p_6_mbps,30.822269,43.864
+blueangels.m2ts, high_1080p_to_1080p_fixed_qp,5.114225,44.334
+blueangels.m2ts, high_1080p_to_720p_fixed qp,10.028431,43.695
+blueangels.m2ts, high_1080p_to_1080p_13_mbps,5.020767,44.382
+blueangels.m2ts, high_1080p_to_720p_6mbps,9.411227,44.107
+blueangels.m2ts, strange_resolution,27.356098,44.088
+BigBuckBunny.VOB, universal,74.327034,43.579
+BigBuckBunny.VOB, iPod,212.377899,43.668
+BigBuckBunny.VOB, iPhone_iPod_Touch,133.710114,43.028
+BigBuckBunny.VOB, iPhone_4,33.673248,44.976
+BigBuckBunny.VOB, iPad,29.014545,45.052
+BigBuckBunny.VOB, Apple_TV,35.109959,44.672
+BigBuckBunny.VOB, Apple_TV_2,18.789587,45.661
+BigBuckBunny.VOB, Android_Mid,167.233826,41.377
+BigBuckBunny.VOB, Android_High,71.774277,42.81
+BigBuckBunny.VOB, Normal_1080p_to_1080p_fixed_qp,173.294464,42.192
+BigBuckBunny.VOB, Normal_1080p_to_720p_fixed_qp,67.47831,43.995
+BigBuckBunny.VOB, Normal_1080p_to_1080p_13_mbps,91.628754,53.538
+BigBuckBunny.VOB, Normal_1080p_to_720p_6_mbps,50.870552,46.778
+BigBuckBunny.VOB, high_1080p_to_1080p_fixed_qp,7.289626,47.018
+BigBuckBunny.VOB, high_1080p_to_720p_fixed qp,18.983526,45.495
diff --git a/test/test.c b/test/test.c
index 472fabd54..a4ced522d 100644
--- a/test/test.c
+++ b/test/test.c
@@ -22,6 +22,7 @@
#include "hb.h"
#include "lang.h"
#include "parsecsv.h"
+#include "openclwrapper.h"
#if defined( __APPLE_CC__ )
#import <CoreServices/CoreServices.h>
@@ -139,6 +140,8 @@ static int start_at_frame = 0;
static int64_t stop_at_pts = 0;
static int stop_at_frame = 0;
static uint64_t min_title_duration = 10;
+static int use_opencl = 0;
+static int use_uvd = 0;
/* Exit cleanly on Ctrl-C */
static volatile int die = 0;
@@ -209,7 +212,9 @@ int main( int argc, char ** argv )
/* Init libhb */
h = hb_init( debug, update );
hb_dvd_set_dvdnav( dvdnav );
-
+#ifdef USE_OPENCL
+ hb_get_opencl_env();
+#endif
/* Show version */
fprintf( stderr, "%s - %s - %s\n",
HB_PROJECT_TITLE, HB_PROJECT_BUILD_TITLE, HB_PROJECT_URL_WEBSITE );
@@ -250,6 +255,7 @@ int main( int argc, char ** argv )
titleindex = 0;
}
+ hb_set_gui_info(&hb_gui, use_uvd, use_opencl, titleindex);
hb_scan( h, input, titleindex, preview_count, store_previews, min_title_duration * 90000LL );
/* Wait... */
@@ -422,6 +428,10 @@ static void PrintTitleInfo( hb_title_t * title, int feature )
(float) title->rate / title->rate_base );
fprintf( stderr, " + autocrop: %d/%d/%d/%d\n", title->crop[0],
title->crop[1], title->crop[2], title->crop[3] );
+
+ fprintf( stderr, " + support opencl: %d \n", title->opencl_support);
+ fprintf( stderr, " + support uvd: %d\n", title->uvd_support);
+
fprintf( stderr, " + chapters:\n" );
for( i = 0; i < hb_list_count( title->list_chapter ); i++ )
{
@@ -1388,6 +1398,10 @@ static int HandleEvents( hb_handle_t * h )
job->maxWidth = maxWidth;
if (maxHeight)
job->maxHeight = maxHeight;
+ if (use_uvd)
+ {
+ job->use_uvd = use_uvd;
+ }
switch( anamorphic_mode )
{
@@ -1560,7 +1574,13 @@ static int HandleEvents( hb_handle_t * h )
filter_str = hb_strdup_printf("%d:%d:%d:%d:%d:%d",
job->width, job->height,
job->crop[0], job->crop[1], job->crop[2], job->crop[3] );
- filter = hb_filter_init( HB_FILTER_CROP_SCALE );
+
+#ifdef USE_OPENCL
+ if ( use_opencl )
+ filter = hb_filter_init( HB_FILTER_CROP_SCALE_ACCL );
+ else
+#endif
+ filter = hb_filter_init( HB_FILTER_CROP_SCALE );
hb_add_filter( job, filter, filter_str );
free( filter_str );
@@ -2485,7 +2505,11 @@ static int HandleEvents( hb_handle_t * h )
job->frame_to_start = start_at_frame;
subtitle_scan = 0;
}
-
+#ifdef USE_OPENCL
+ job->use_opencl = use_opencl;
+#else
+ job->use_opencl = 0;
+#endif
if( subtitle_scan )
{
/*
@@ -2662,6 +2686,7 @@ static void ShowHelp()
" -z, --preset-list See a list of available built-in presets\n"
" --no-dvdnav Do not use dvdnav for reading DVDs\n"
" (experimental, enabled by default for testing)\n"
+ " --no-opencl Disable use of OpenCL\n"
"\n"
"### Source Options-----------------------------------------------------------\n\n"
@@ -2695,6 +2720,8 @@ static void ShowHelp()
" 4 GB. Note: Breaks iPod, PS3 compatibility.\n"""
" -O, --optimize Optimize mp4 files for HTTP streaming\n"
" -I, --ipod-atom Mark mp4 files so 5.5G iPods will accept them\n"
+ " -P, --opencl-support Use OpenCL\n"
+ " -U, --UVD-support Use UVD hardware\n"
"\n"
@@ -3188,7 +3215,8 @@ static int ParseOptions( int argc, char ** argv )
#define X264_PRESET 284
#define X264_TUNE 285
#define H264_LEVEL 286
- #define NORMALIZE_MIX 287
+ #define NO_OPENCL 287
+ #define NORMALIZE_MIX 288
for( ;; )
{
@@ -3197,14 +3225,17 @@ static int ParseOptions( int argc, char ** argv )
{ "help", no_argument, NULL, 'h' },
{ "update", no_argument, NULL, 'u' },
{ "verbose", optional_argument, NULL, 'v' },
- { "no-dvdnav", no_argument, NULL, DVDNAV },
-
+ { "no-dvdnav", no_argument, NULL, DVDNAV },
+ { "no-opencl", no_argument, NULL, NO_OPENCL },
+
{ "format", required_argument, NULL, 'f' },
{ "input", required_argument, NULL, 'i' },
{ "output", required_argument, NULL, 'o' },
{ "large-file", no_argument, NULL, '4' },
{ "optimize", no_argument, NULL, 'O' },
{ "ipod-atom", no_argument, NULL, 'I' },
+ { "use-opencl", no_argument, NULL, 'P' },
+ { "use-uvd", no_argument, NULL, 'U' },
{ "title", required_argument, NULL, 't' },
{ "min-duration",required_argument, NULL, MIN_DURATION },
@@ -3293,7 +3324,7 @@ static int ParseOptions( int argc, char ** argv )
cur_optind = optind;
c = getopt_long( argc, argv,
- "hv::uC:f:4i:Io:t:c:m::M:a:A:6:s:UF::N:e:E:Q:C:"
+ "hv::uC:f:4i:Io:PUt:c:m::M:a:A:6:s:F::N:e:E:Q:C:"
"2dD:7895gOw:l:n:b:q:S:B:r:R:x:TY:X:Z:z",
long_options, &option_index );
if( c < 0 )
@@ -3364,6 +3395,12 @@ static int ParseOptions( int argc, char ** argv )
case 'I':
ipod_atom = 1;
break;
+ case 'P':
+ use_opencl = 1;
+ break;
+ case 'U':
+ use_uvd = 1;
+ break;
case 't':
titleindex = atoi( optarg );
@@ -3395,6 +3432,9 @@ static int ParseOptions( int argc, char ** argv )
}
break;
}
+ case NO_OPENCL:
+ use_opencl = 0;
+ break;
case ANGLE:
angle = atoi( optarg );
break;