-
Notifications
You must be signed in to change notification settings - Fork 0
/
makebat.py
executable file
·91 lines (86 loc) · 3.01 KB
/
makebat.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/usr/bin/python
# coding: utf-8
# テスト実行用のバッチファイルを作成する。
#
# 使用例:
# mkdir test
# ./makebat.py > test/bat.sh
# cp ~/h265/bin/TAppEncoderStatic test/
# cd test/
# sh bat.sh
# エンコーダー
encoder = "./TAppEncoderStatic"
# Q値
#Q = range(22, 40, 5)
Q = (22,27,32,37,42,47)
# 設定ファイル
config = ('encoder_lowdelay_P_main','encoder_randomaccess_main')
sequencelist = ('classCif',)# "classHD")
testname = ('anchor',)
import os
outdir = "./RESULT/"
if not os.path.exists(outdir):
os.makedirs(outdir)
#settings
intraperiod = -1
recfile = "rec"
# リストの読み込み
sequence = []
for tst in testname:
refile = "%s_result.txt" % tst
if os.path.exists(refile):
os.remove(refile)
for cfg in config:
outdir = "./RESULT/% s/" % cfg
if not os.path.exists(outdir):
os.makedirs(outdir)
for seqset in sequencelist:
outdir = "./RESULT/% s/" % cfg
outdir += "% s/" % seqset
if not os.path.exists(outdir):
os.makedirs(outdir)
if seqset is 'class720p':
width = 1280
height = 720
framerate = 60
framenum = 150
yuvdir = "/share/Video/1280_720p_420/"
elif seqset is 'classHD':
width = 1920
height = 1080
framerate = 60
framenum = 150
yuvdir = "/share/Video/1920_1080p_420/"
else:
width = 352
height = 288
framerate = 24
framenum = 150
yuvdir = "/share/Video/cif/"
seqset += ".txt"
for line in open(seqset):
sequence = line.split()
for q in Q:
# ファイル名
name = os.path.splitext(sequence[0])[0]
name += "_%s" % tst
name += "_Q%02d" % q
#print " ".join((
# encoder,
# "-c %s.cfg" % cfg,
# "-i %s" % os.path.join(yuvdir, sequence[0]),
# "-b %s.bin" % os.path.join(outdir, name),
# "-wdt %s" % width,
# "-hgt %s" % height,
# "-fr %s" % framerate,
# "-f %s" % framenum,
# "-q %s" % q,
# "-ip %s" % intraperiod,
# "> %s.log" % os.path.join(outdir, name)
# #"-o %s.yuv" % recfile,
# #"--TargetBitrate=%s" %q,
# ))
print " ".join((
"grep ' a' %s.log" % os.path.join(outdir, name),
" >> %s" % refile
))