Browse code

regtest: separate flags for encoding and decoding

This separates encoding and decoding flags, and passes them together
with the related file argument instead of all at the start of the
command line.

Signed-off-by: Mans Rullgard <mans@mansr.com>

Mans Rullgard authored on 2011/05/07 21:57:21
Showing 4 changed files
... ...
@@ -61,7 +61,7 @@ do_video_decoding
61 61
 
62 62
 # mpeg2 encoding interlaced
63 63
 file=${outfile}mpeg2reuse.mpg
64
-do_ffmpeg $file -sameq -me_threshold 256 -mb_threshold 1024 -i ${target_path}/${outfile}mpeg2thread.mpg -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 4
64
+do_ffmpeg $file $DEC_OPTS -me_threshold 256 -i ${target_path}/${outfile}mpeg2thread.mpg $ENC_OPTS -sameq -me_threshold 256 -mb_threshold 1024 -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 4
65 65
 do_video_decoding
66 66
 fi
67 67
 
... ...
@@ -14,15 +14,15 @@ eval do_$test=y
14 14
 do_lavf()
15 15
 {
16 16
     file=${outfile}lavf.$1
17
-    do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src $2
18
-    do_ffmpeg_crc $file -i $target_path/$file $3
17
+    do_ffmpeg $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $DEC_OPTS -f s16le -i $pcm_src $ENC_OPTS -t 1 -qscale 10 $2
18
+    do_ffmpeg_crc $file $DEC_OPTS -i $target_path/$file $3
19 19
 }
20 20
 
21 21
 do_streamed_images()
22 22
 {
23 23
     file=${outfile}${1}pipe.$1
24
-    do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f image2pipe
25
-    do_ffmpeg_crc $file -f image2pipe -i $target_path/$file
24
+    do_ffmpeg $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src -f image2pipe $ENC_OPTS -t 1 -qscale 10
25
+    do_ffmpeg_crc $file $DEC_OPTS -f image2pipe -i $target_path/$file
26 26
 }
27 27
 
28 28
 do_image_formats()
... ...
@@ -30,17 +30,17 @@ do_image_formats()
30 30
     outfile="$datadir/images/$1/"
31 31
     mkdir -p "$outfile"
32 32
     file=${outfile}%02d.$1
33
-    run_ffmpeg -t 0.5 -y -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src $2 $3 -flags +bitexact -sws_flags +accurate_rnd+bitexact $target_path/$file
33
+    run_ffmpeg $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $2 $ENC_OPTS $3 -t 0.5 -y -qscale 10 $target_path/$file
34 34
     do_md5sum ${outfile}02.$1 >> $logfile
35
-    do_ffmpeg_crc $file $3 -i $target_path/$file
35
+    do_ffmpeg_crc $file $DEC_OPTS $3 -i $target_path/$file
36 36
     wc -c ${outfile}02.$1 >> $logfile
37 37
 }
38 38
 
39 39
 do_audio_only()
40 40
 {
41 41
     file=${outfile}lavf.$1
42
-    do_ffmpeg $file -t 1 -qscale 10 $2 -f s16le -i $pcm_src $3
43
-    do_ffmpeg_crc $file -i $target_path/$file
42
+    do_ffmpeg $file $DEC_OPTS $2 -f s16le -i $pcm_src $ENC_OPTS -t 1 -qscale 10 $3
43
+    do_ffmpeg_crc $file $DEC_OPTS -i $target_path/$file
44 44
 }
45 45
 
46 46
 rm -f "$logfile"
... ...
@@ -56,7 +56,7 @@ fi
56 56
 
57 57
 if [ -n "$do_rm" ] ; then
58 58
 file=${outfile}lavf.rm
59
-do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec ac3_fixed
59
+do_ffmpeg $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $DEC_OPTS -f s16le -i $pcm_src $ENC_OPTS -t 1 -qscale 10 -acodec ac3_fixed
60 60
 # broken
61 61
 #do_ffmpeg_crc $file -i $target_path/$file
62 62
 fi
... ...
@@ -127,13 +127,13 @@ fi
127 127
 
128 128
 if [ -n "$do_gif" ] ; then
129 129
 file=${outfile}lavf.gif
130
-do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -pix_fmt rgb24
131
-do_ffmpeg_crc $file -i $target_path/$file -pix_fmt rgb24
130
+do_ffmpeg $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -t 1 -qscale 10 -pix_fmt rgb24
131
+do_ffmpeg_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt rgb24
132 132
 fi
133 133
 
134 134
 if [ -n "$do_yuv4mpeg" ] ; then
135 135
 file=${outfile}lavf.y4m
136
-do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src
136
+do_ffmpeg $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -t 1 -qscale 10
137 137
 #do_ffmpeg_crc $file -i $target_path/$file
138 138
 fi
139 139
 
... ...
@@ -227,9 +227,9 @@ conversions="yuv420p yuv422p yuv444p yuyv422 yuv410p yuv411p yuvj420p \
227 227
              monob yuv440p yuvj440p"
228 228
 for pix_fmt in $conversions ; do
229 229
     file=${outfile}${pix_fmt}.yuv
230
-    do_ffmpeg_nocheck $file -r 1 -t 1 -f image2 -vcodec pgmyuv -i $raw_src \
231
-                            -f rawvideo -s 352x288 -pix_fmt $pix_fmt $target_path/$raw_dst
232
-    do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $target_path/$raw_dst \
233
-                    -f rawvideo -s 352x288 -pix_fmt yuv444p
230
+    do_ffmpeg_nocheck $file $DEC_OPTS -r 1 -t 1 -f image2 -vcodec pgmyuv -i $raw_src \
231
+                            $ENC_OPTS -f rawvideo -s 352x288 -pix_fmt $pix_fmt $target_path/$raw_dst
232
+    do_ffmpeg $file $DEC_OPTS -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $target_path/$raw_dst \
233
+                    $ENC_OPTS -f rawvideo -s 352x288 -pix_fmt yuv444p
234 234
 done
235 235
 fi
... ...
@@ -19,8 +19,8 @@ do_video_filter() {
19 19
     filters=$2
20 20
     shift 2
21 21
     printf '%-20s' $label >>$logfile
22
-    run_ffmpeg -f image2 -vcodec pgmyuv -i $raw_src    \
23
-        -vf "$filters" -vcodec rawvideo $* -f nut md5: >>$logfile
22
+    run_ffmpeg $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src    \
23
+        $ENC_OPTS -vf "$filters" -vcodec rawvideo $* -f nut md5: >>$logfile
24 24
 }
25 25
 
26 26
 do_lavfi() {
... ...
@@ -53,7 +53,10 @@ echov(){
53 53
 
54 54
 . $(dirname $0)/md5.sh
55 55
 
56
-FFMPEG_OPTS="-v 0 -threads $threads -y -flags +bitexact -dct fastint -idct simple -sws_flags +accurate_rnd+bitexact"
56
+FFMPEG_OPTS="-v 0 -y"
57
+COMMON_OPTS="-flags +bitexact -idct simple -sws_flags +accurate_rnd+bitexact"
58
+DEC_OPTS="$COMMON_OPTS -threads $threads"
59
+ENC_OPTS="$COMMON_OPTS -dct fastint"
57 60
 
58 61
 run_ffmpeg()
59 62
 {
... ...
@@ -115,22 +118,22 @@ do_ffmpeg_nocheck()
115 115
 
116 116
 do_video_decoding()
117 117
 {
118
-    do_ffmpeg $raw_dst $1 -i $target_path/$file -f rawvideo $2
118
+    do_ffmpeg $raw_dst $DEC_OPTS $1 -i $target_path/$file -f rawvideo $ENC_OPTS $2
119 119
 }
120 120
 
121 121
 do_video_encoding()
122 122
 {
123 123
     file=${outfile}$1
124
-    do_ffmpeg $file -f image2 -vcodec pgmyuv -i $raw_src $2
124
+    do_ffmpeg $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS $2
125 125
 }
126 126
 
127 127
 do_audio_encoding()
128 128
 {
129 129
     file=${outfile}$1
130
-    do_ffmpeg $file -ab 128k -ac 2 -f s16le -i $pcm_src $2
130
+    do_ffmpeg $file $DEC_OPTS -ac 2 -f s16le -i $pcm_src -ab 128k $ENC_OPTS $2
131 131
 }
132 132
 
133 133
 do_audio_decoding()
134 134
 {
135
-    do_ffmpeg $pcm_dst -i $target_path/$file -sample_fmt s16 -f wav
135
+    do_ffmpeg $pcm_dst $DEC_OPTS -i $target_path/$file -sample_fmt s16 -f wav
136 136
 }