-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathd_encodeTestBench.sh
executable file
·127 lines (90 loc) · 3.01 KB
/
d_encodeTestBench.sh
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Number of Sequences
noSeq=$1 #Send it as the first var we raya7 demaa3'ak
# Used to loop on the list of arguments from the top file
index=1
# Index of the given argument by the top shell file
argIndex=0
# Index of the YUV array
yuvIndex=1 #Start from 1 because you already started from 1
# Index of the CFG array
cfgIndex=1 #Start from 1 because you already started from 1
# Index of the Qp array
qpIndex=1 #Start from 1 because you already started from 1
#echo "Listing args with \"\$@\":"
printf "\n"
echo "Encoder TestBench: Populating lists will start"
# ./d_codeTestBench.sh (0) $noSeq @ (1) "${yuv_file[@]}" @ (2) "${cfg_file[@]}"
# @ (3) "${Qp[@]}" @ (4) $noCases @ (5) noQp
# Parse the arguments to get the array of YUVs, Sequence CFGs
for arg in "$@"
do
# Found a seperator --> Found a new arg
if [ "$arg" == "@" ] ; then
let "argIndex+=1"
fi
# Filter the 2nd argument (YUV_Array) sent and populate it in the list
if [ "$argIndex" == 1 ] && [ "$arg" != "@" ] ; then
# echo "Arg #$index = $arg"
yuv_file[$yuvIndex]=$arg
# echo ${yuv_file[$yuvIndex]}
let "yuvIndex+=1"
fi
# Filter the 3rd argument (CFG_Array) sent and populate it in the list
if [ "$argIndex" == 2 ] && [ "$arg" != "@" ] ; then
cfg_file[$cfgIndex]=$arg
# echo ${cfg_file[$cfgIndex]}
let "cfgIndex+=1"
fi
# Filter the 3rd argument (Qp_Array) sent and populate it in the list
if [ "$argIndex" == 3 ] && [ "$arg" != "@" ] ; then
Qp[$qpIndex]=$arg
# echo ${Qp[$qpIndex]}
let "qpIndex+=1"
fi
# Get the number of cases
if [ "$argIndex" == 4 ] && [ "$arg" != "@" ] ; then
noCases=$arg
# echo $noCases
fi
# Get the number of Qp values
if [ "$argIndex" == 5 ] && [ "$arg" != "@" ] ; then
noQp=$arg
# echo $noQp
fi
# Get the GOP structure type
# if [ "$argIndex" == 6 ] && [ "$arg" != "@" ] ; then
# gop_str_type=$arg
# echo $gop_str_type
# fi
done # $@ sees arguments as separate words.
# Please note that I won't take the encoder CFG files because I will run
# all available cases for Encoder CFGs in a loop (for each GOP_STR_TYPE)
echo "Encoder TestBench: Populating lists done"
#echo "Arg list seen as separate words."
echo "Encoder TestBench: Running for every sequence will start"
# For every YUV, CFG sequence file --> Run all cases
for (( i = 1; i <= noSeq; i++ ))
do
current_cfg=${cfg_file[$i]}
current_yuv=${yuv_file[$i]}
#echo $current_yuv
#echo $current_cfg
# Run for all cases
for (( caseId = 1; caseId <= noCases; caseId++ ))
do
current_enc_cfg=encoder_$caseId
# DEBUG:
#current_enc_cfg="encoder_case2"
printf "\n"
echo "---"
#echo "Start Case" $caseId "for" $current_yuv " sequence"
echo "Start Case" $caseId "Out of" $noCases "for" $current_yuv " sequence"
./d_maxBoundRun.sh $noSeq @ $current_yuv @ $current_cfg @ "${Qp[@]}" \
@ $noCases @ $noQp @ $caseId @ $current_enc_cfg
echo "Done with Case" $caseId "for" $current_yuv " sequence"
echo "***********************"
printf "\n"
done
done
# DEBUG: BreakPoint
# read -e bla