mlpdec: Simplify check for substream_parity_present.
[libav.git] / tests / regression.sh
CommitLineData
51133a7d
FB
1#!/bin/sh
2#
3# automatic regression test for ffmpeg
4#
5#
6#set -x
d9d7653e 7
51133a7d
FB
8set -e
9
9a5771e9
MR
10target_exec=$5
11target_path=$6
12
4fbd52f0 13datadir="./tests/data"
9a5771e9 14target_datadir="${target_path}/${datadir}"
5bcfd1ad 15
4383ed5c
MR
16test="${1#regtest-}"
17this="$test.$2"
18logfile="$datadir/$this.regression"
2009721d 19outfile="$datadir/$4-"
89d5dfd5 20
4383ed5c
MR
21eval do_$test=y
22
51133a7d 23# various files
9a5771e9 24ffmpeg="$target_exec ${target_path}/ffmpeg_g"
4fbd52f0 25tiny_psnr="tests/tiny_psnr"
4383ed5c
MR
26benchfile="$datadir/$this.bench"
27bench="$datadir/$this.bench.tmp"
28bench2="$datadir/$this.bench2.tmp"
9a5771e9 29raw_src="${target_path}/$3/%02d.pgm"
4383ed5c
MR
30raw_dst="$datadir/$this.out.yuv"
31raw_ref="$datadir/$2.ref.yuv"
9a5771e9 32pcm_src="${target_path}/tests/asynth1.sw"
4383ed5c
MR
33pcm_dst="$datadir/$this.out.wav"
34pcm_ref="$datadir/$2.ref.wav"
2009721d 35crcfile="$datadir/$this.crc"
9a5771e9 36target_crcfile="$target_datadir/$this.crc"
2009721d 37
853d659d
JD
38if [ X"`echo | md5sum 2> /dev/null`" != X ]; then
39 do_md5sum() { md5sum -b $1; }
de40eb8d
RD
40elif [ X"`echo | md5 2> /dev/null`" != X ]; then
41 do_md5sum() { md5 -r $1 | sed 's# \**\./# *./#'; }
853d659d
JD
42elif [ -x /sbin/md5 ]; then
43 do_md5sum() { /sbin/md5 -r $1 | sed 's# \**\./# *./#'; }
44else
45 do_md5sum() { echo No md5sum program found; }
46fi
5bcfd1ad 47
d9c211ee 48# create the data directory if it does not exist
5bcfd1ad 49mkdir -p $datadir
51133a7d 50
3e3c638e 51FFMPEG_OPTS="-y -flags +bitexact -dct fastint -idct simple -sws_flags +accurate_rnd+bitexact"
bcea9605 52
3f027ca7 53do_ffmpeg()
51133a7d 54{
9e32e071 55 f="$1"
51133a7d 56 shift
9a5771e9 57 set -- $* ${target_path}/$f
bcea9605 58 echo $ffmpeg $FFMPEG_OPTS $*
8deb894f 59 $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
37a00782 60 egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration|video:)" /tmp/ffmpeg$$ || true
e31c1c30 61 rm -f /tmp/ffmpeg$$
9e32e071
DB
62 do_md5sum $f >> $logfile
63 if [ $f = $raw_dst ] ; then
64 $tiny_psnr $f $raw_ref >> $logfile
65 elif [ $f = $pcm_dst ] ; then
66 $tiny_psnr $f $pcm_ref 2 >> $logfile
039e7889 67 else
9e32e071 68 wc -c $f >> $logfile
67cbe681 69 fi
8deb894f 70 expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
9e32e071 71 echo `cat $bench2` $f >> $benchfile
51133a7d
FB
72}
73
d9076fe7
MN
74do_ffmpeg_nomd5()
75{
76 f="$1"
77 shift
9a5771e9 78 set -- $* ${target_path}/$f
d9076fe7
MN
79 echo $ffmpeg $FFMPEG_OPTS $*
80 $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
81 egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration|video:)" /tmp/ffmpeg$$ || true
82 rm -f /tmp/ffmpeg$$
83 if [ $f = $raw_dst ] ; then
84 $tiny_psnr $f $raw_ref >> $logfile
85 elif [ $f = $pcm_dst ] ; then
86 $tiny_psnr $f $pcm_ref 2 >> $logfile
87 else
88 wc -c $f >> $logfile
89 fi
90 expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
91 echo `cat $bench2` $f >> $benchfile
92}
93
3f027ca7 94do_ffmpeg_crc()
89d5dfd5 95{
9e32e071 96 f="$1"
89d5dfd5 97 shift
9a5771e9
MR
98 echo $ffmpeg $FFMPEG_OPTS $* -f crc "$target_crcfile"
99 $ffmpeg $FFMPEG_OPTS $* -f crc "$target_crcfile" > /tmp/ffmpeg$$ 2>&1
37a00782 100 egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration|video:|ffmpeg version| configuration| built)" /tmp/ffmpeg$$ || true
115329f1 101 rm -f /tmp/ffmpeg$$
2009721d
MR
102 echo "$f `cat $crcfile`" >> $logfile
103 rm -f "$crcfile"
89d5dfd5 104}
51133a7d 105
67cbe681
MN
106do_ffmpeg_nocheck()
107{
9e32e071 108 f="$1"
67cbe681 109 shift
bcea9605 110 echo $ffmpeg $FFMPEG_OPTS $*
8deb894f 111 $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
37a00782 112 egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration|video:)" /tmp/ffmpeg$$ || true
affd55a1 113 rm -f /tmp/ffmpeg$$
8deb894f 114 expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
9e32e071 115 echo `cat $bench2` $f >> $benchfile
67cbe681
MN
116}
117
1de61a18
DB
118do_video_decoding()
119{
9a5771e9 120 do_ffmpeg $raw_dst $1 -i $target_path/$file -f rawvideo $2
4383ed5c 121 rm -f $raw_dst
1de61a18
DB
122}
123
124do_video_encoding()
125{
1e1b182d 126 file=${outfile}$1
9a5771e9 127 do_ffmpeg $file $2 -f image2 -vcodec pgmyuv -i $raw_src $3
1de61a18
DB
128}
129
fb132953
DB
130do_audio_encoding()
131{
132 file=${outfile}$1
9a5771e9 133 do_ffmpeg $file -ab 128k -ac 2 -f s16le -i $pcm_src $3
fb132953
DB
134}
135
136do_audio_decoding()
137{
9a5771e9 138 do_ffmpeg $pcm_dst -i $target_path/$file -sample_fmt s16 -f wav
fb132953
DB
139}
140
36aed9e5
DB
141do_libav()
142{
143 file=${outfile}libav.$1
9a5771e9
MR
144 do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src $2
145 do_ffmpeg_crc $file -i $target_path/$file $3
36aed9e5
DB
146}
147
d449d1bc
DB
148do_streamed_images()
149{
2009721d 150 file=${outfile}${1}pipe.$1
9a5771e9
MR
151 do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f image2pipe
152 do_ffmpeg_crc $file -f image2pipe -i $target_path/$file
d449d1bc
DB
153}
154
f8aa7645
DB
155do_image_formats()
156{
157 file=${outfile}libav%02d.$1
9a5771e9 158 $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
199c6e3c 159 do_md5sum ${outfile}libav02.$1 >> $logfile
9a5771e9 160 do_ffmpeg_crc $file $3 -i $target_path/$file
3a71577f 161 wc -c ${outfile}libav02.$1 >> $logfile
f8aa7645
DB
162}
163
e587a0a5
DB
164do_audio_only()
165{
166 file=${outfile}libav.$1
9a5771e9
MR
167 do_ffmpeg $file -t 1 -qscale 10 -f s16le -i $pcm_src
168 do_ffmpeg_crc $file -i $target_path/$file
e587a0a5
DB
169}
170
4383ed5c
MR
171rm -f "$logfile"
172rm -f "$benchfile"
51133a7d 173
67cbe681 174# generate reference for quality check
4383ed5c 175if [ -n "$do_ref" ]; then
9a5771e9
MR
176do_ffmpeg_nocheck $raw_ref -f image2 -vcodec pgmyuv -i $raw_src -an -f rawvideo $target_path/$raw_ref
177do_ffmpeg_nocheck $pcm_ref -ab 128k -ac 2 -ar 44100 -f s16le -i $pcm_src -f wav $target_path/$pcm_ref
4383ed5c 178fi
67cbe681 179
51133a7d 180if [ -n "$do_mpeg" ] ; then
0fc3a831 181# mpeg1
5b67e4f8 182do_video_encoding mpeg1.mpg "-qscale 10" "-f mpeg1video"
1de61a18 183do_video_decoding
922bc38d
MN
184fi
185
922bc38d 186if [ -n "$do_mpeg2" ] ; then
0fc3a831 187# mpeg2
5b67e4f8 188do_video_encoding mpeg2.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video"
1de61a18 189do_video_decoding
83dddc4a 190
49f1ac5a 191# mpeg2 encoding intra vlc qprd
dd1c8f3e 192do_video_encoding mpeg2ivlc-qprd.mpg "-vb 500k -bf 2 -trellis 1 -flags +qprd+mv0 -flags2 +ivlc -cmp 2 -subcmp 2 -mbd rd" "-vcodec mpeg2video -f mpeg2video"
1de61a18 193do_video_decoding
307eb248 194
2cce68f8 195#mpeg2 4:2:2 encoding
b91758de 196do_video_encoding mpeg2_422.mpg "-vb 1000k -bf 2 -trellis 1 -flags +qprd+mv0+ildct+ilme -flags2 +ivlc -mbd rd" "-vcodec mpeg2video -pix_fmt yuv422p -f mpeg2video"
2cce68f8
BC
197do_video_decoding
198
0fc3a831 199# mpeg2
5b67e4f8 200do_video_encoding mpeg2.mpg "-qscale 10" "-vcodec mpeg2video -idct int -dct int -f mpeg1video"
5e5ac8e0 201do_video_decoding "-idct int"
6486ad57 202
83dddc4a 203# mpeg2 encoding interlaced
5b67e4f8 204do_video_encoding mpeg2i.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -flags +ildct+ilme"
1de61a18 205do_video_decoding
51133a7d
FB
206fi
207
9c3d33d6
MN
208if [ -n "$do_mpeg2thread" ] ; then
209# mpeg2 encoding interlaced
5b67e4f8 210do_video_encoding mpeg2thread.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 2"
1de61a18 211do_video_decoding
307eb248
BC
212
213# mpeg2 encoding interlaced using intra vlc
5b67e4f8 214do_video_encoding mpeg2threadivlc.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -flags2 +ivlc -threads 2"
1de61a18 215do_video_decoding
7f8038ce
MN
216
217# mpeg2 encoding interlaced
218file=${outfile}mpeg2reuse.mpg
9a5771e9 219do_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
1de61a18 220do_video_decoding
9c3d33d6
MN
221fi
222
6ebd933b 223if [ -n "$do_msmpeg4v2" ] ; then
5b67e4f8 224do_video_encoding msmpeg4v2.avi "-qscale 10" "-an -vcodec msmpeg4v2"
1de61a18 225do_video_decoding
6ebd933b
MN
226fi
227
51133a7d 228if [ -n "$do_msmpeg4" ] ; then
5b67e4f8 229do_video_encoding msmpeg4.avi "-qscale 10" "-an -vcodec msmpeg4"
1de61a18 230do_video_decoding
51133a7d
FB
231fi
232
6ebd933b 233if [ -n "$do_wmv1" ] ; then
5b67e4f8 234do_video_encoding wmv1.avi "-qscale 10" "-an -vcodec wmv1"
1de61a18 235do_video_decoding
6ebd933b
MN
236fi
237
e23d5712 238if [ -n "$do_wmv2" ] ; then
5b67e4f8 239do_video_encoding wmv2.avi "-qscale 10" "-an -vcodec wmv2"
1de61a18 240do_video_decoding
e23d5712
MN
241fi
242
61b262a9 243if [ -n "$do_h261" ] ; then
5b67e4f8 244do_video_encoding h261.avi "-qscale 11" "-s 352x288 -an -vcodec h261"
1de61a18 245do_video_decoding
61b262a9
MN
246fi
247
51133a7d 248if [ -n "$do_h263" ] ; then
5b67e4f8 249do_video_encoding h263.avi "-qscale 10" "-s 352x288 -an -vcodec h263"
1de61a18 250do_video_decoding
6e2d5f1a
MN
251fi
252
6e2d5f1a 253if [ -n "$do_h263p" ] ; then
5b67e4f8 254do_video_encoding h263p.avi "-qscale 2 -flags +umv+aiv+aic" "-s 352x288 -an -vcodec h263p -ps 300"
1de61a18 255do_video_decoding
51133a7d
FB
256fi
257
51133a7d 258if [ -n "$do_mpeg4" ] ; then
5b67e4f8 259do_video_encoding odivx.mp4 "-flags +mv4 -mbd bits -qscale 10" "-an -vcodec mpeg4"
aeeb0cac 260do_video_decoding
51133a7d
FB
261fi
262
e629ab68 263if [ -n "$do_huffyuv" ] ; then
3e3c638e
MN
264do_video_encoding huffyuv.avi "" "-an -vcodec huffyuv -pix_fmt yuv422p -sws_flags neighbor+bitexact"
265do_video_decoding "" "-strict -2 -pix_fmt yuv420p -sws_flags neighbor+bitexact"
e629ab68
RD
266fi
267
1dbb6d90 268if [ -n "$do_rc" ] ; then
5b67e4f8 269do_video_encoding mpeg4-rc.avi "-b 400k -bf 2" "-an -vcodec mpeg4"
aeeb0cac 270do_video_decoding
1dbb6d90
MN
271fi
272
1dbb6d90 273if [ -n "$do_mpeg4adv" ] ; then
dd1c8f3e 274do_video_encoding mpeg4-adv.avi "-qscale 9 -flags +mv4+part+aic -trellis 1 -mbd bits -ps 200" "-an -vcodec mpeg4"
1de61a18 275do_video_decoding
2d1e5071 276
dd1c8f3e 277do_video_encoding mpeg4-qprd.avi "-b 450k -bf 2 -trellis 1 -flags +mv4+qprd+mv0 -cmp 2 -subcmp 2 -mbd rd" "-an -vcodec mpeg4"
2d1e5071
MN
278do_video_decoding
279
dd1c8f3e 280do_video_encoding mpeg4-adap.avi "-b 550k -bf 2 -flags +mv4+mv0 -trellis 1 -cmp 1 -subcmp 2 -mbd rd -scplx_mask 0.3" "-an -vcodec mpeg4"
2d1e5071 281do_video_decoding
1dbb6d90 282
5b67e4f8 283do_video_encoding mpeg4-Q.avi "-qscale 7 -flags +mv4+qpel -mbd 2 -bf 2 -cmp 1 -subcmp 2" "-an -vcodec mpeg4"
1de61a18 284do_video_decoding
aab9cdcf
MN
285fi
286
45ddd8b0 287if [ -n "$do_mpeg4thread" ] ; then
dd1c8f3e 288do_video_encoding mpeg4-thread.avi "-b 500k -flags +mv4+part+aic -trellis 1 -mbd bits -ps 200 -bf 2" "-an -vcodec mpeg4 -threads 2"
1de61a18 289do_video_decoding
9c3d33d6
MN
290fi
291
7ebfc0ea 292if [ -n "$do_error" ] ; then
5b67e4f8 293do_video_encoding error-mpeg4-adv.avi "-qscale 7 -flags +mv4+part+aic -mbd rd -ps 250 -error 10" "-an -vcodec mpeg4"
1de61a18 294do_video_decoding
7ebfc0ea
MN
295fi
296
be408b67 297if [ -n "$do_mpeg4nr" ] ; then
5b67e4f8 298do_video_encoding mpeg4-nr.avi "-qscale 8 -flags +mv4 -mbd rd -nr 200" "-an -vcodec mpeg4"
1de61a18 299do_video_decoding
be408b67
MN
300fi
301
cfadadec 302if [ -n "$do_mpeg1b" ] ; then
5b67e4f8 303do_video_encoding mpeg1b.mpg "-qscale 8 -bf 3 -ps 200" "-an -vcodec mpeg1video -f mpeg1video"
1de61a18 304do_video_decoding
cfadadec
MN
305fi
306
51133a7d 307if [ -n "$do_mjpeg" ] ; then
5b67e4f8 308do_video_encoding mjpeg.avi "-qscale 10" "-an -vcodec mjpeg -pix_fmt yuvj420p"
5e5ac8e0 309do_video_decoding "" "-pix_fmt yuv420p"
51133a7d
FB
310fi
311
3b37408b 312if [ -n "$do_ljpeg" ] ; then
5b67e4f8 313do_video_encoding ljpeg.avi "" "-an -vcodec ljpeg -strict -1"
1de61a18 314do_video_decoding
3b37408b
MN
315fi
316
b4e021e8 317if [ -n "$do_jpegls" ] ; then
3e3c638e
MN
318do_video_encoding jpegls.avi "" "-an -vcodec jpegls -vtag MJPG -sws_flags neighbor+full_chroma_int+accurate_rnd+bitexact"
319do_video_decoding "" "-pix_fmt yuv420p -sws_flags area+bitexact"
b4e021e8
MN
320fi
321
51133a7d 322if [ -n "$do_rv10" ] ; then
5b67e4f8 323do_video_encoding rv10.rm "-qscale 10" "-an"
1de61a18 324do_video_decoding
51133a7d
FB
325fi
326
c50cd09d 327if [ -n "$do_rv20" ] ; then
5b67e4f8 328do_video_encoding rv20.rm "-qscale 10" "-vcodec rv20 -an"
1de61a18 329do_video_decoding
c50cd09d
MN
330fi
331
9ca9fce1 332if [ -n "$do_asv1" ] ; then
5b67e4f8 333do_video_encoding asv1.avi "-qscale 10" "-an -vcodec asv1"
1de61a18 334do_video_decoding
9ca9fce1
MN
335fi
336
8d876a43 337if [ -n "$do_asv2" ] ; then
5b67e4f8 338do_video_encoding asv2.avi "-qscale 10" "-an -vcodec asv2"
1de61a18 339do_video_decoding
8d876a43
MN
340fi
341
bbdd42d3 342if [ -n "$do_flv" ] ; then
5b67e4f8 343do_video_encoding flv.flv "-qscale 10" "-an -vcodec flv"
1de61a18 344do_video_decoding
bbdd42d3
MN
345fi
346
f3203047 347if [ -n "$do_ffv1" ] ; then
5b67e4f8 348do_video_encoding ffv1.avi "-strict -2" "-an -vcodec ffv1"
1de61a18 349do_video_decoding
d13eef3d
MN
350fi
351
d13eef3d 352if [ -n "$do_snow" ] ; then
dd1c8f3e 353do_video_encoding snow.avi "-strict -2" "-an -vcodec snow -qscale 2 -flags +qpel -me_method iter -dia_size 2 -cmp 12 -subcmp 12 -s 128x64"
5e5ac8e0 354do_video_decoding "" "-s 352x288"
e03c822a 355fi
d13eef3d 356
e03c822a 357if [ -n "$do_snowll" ] ; then
5b67e4f8 358do_video_encoding snow53.avi "-strict -2" "-an -vcodec snow -qscale .001 -pred 1 -flags +mv4+qpel"
1de61a18 359do_video_decoding
f3203047
MN
360fi
361
8fce2707 362if [ -n "$do_dv" ] ; then
5b67e4f8 363do_video_encoding dv.dv "-dct int" "-s pal -an"
5e5ac8e0 364do_video_decoding "" "-s cif"
77c3fb90 365
3e3c638e
MN
366do_video_encoding dv411.dv "-dct int" "-s pal -an -pix_fmt yuv411p -sws_flags area+accurate_rnd+bitexact"
367do_video_decoding "" "-s cif -sws_flags area+accurate_rnd+bitexact"
8fce2707
MN
368fi
369
0b297700 370if [ -n "$do_dv50" ] ; then
3e3c638e
MN
371do_video_encoding dv50.dv "-dct int" "-s pal -pix_fmt yuv422p -an -sws_flags neighbor+bitexact"
372do_video_decoding "" "-s cif -pix_fmt yuv420p -sws_flags neighbor+bitexact"
0b297700
DM
373fi
374
b86bd1f1 375if [ -n "$do_svq1" ] ; then
5b67e4f8 376do_video_encoding svq1.mov "" "-an -vcodec svq1 -qscale 3 -pix_fmt yuv410p"
5e5ac8e0 377do_video_decoding "" "-pix_fmt yuv420p"
b86bd1f1
MN
378fi
379
d2f8f410 380if [ -n "$do_flashsv" ] ; then
3e3c638e
MN
381do_video_encoding flashsv.flv "" "-an -vcodec flashsv -sws_flags neighbor+full_chroma_int+accurate_rnd+bitexact"
382do_video_decoding "" "-pix_fmt yuv420p -sws_flags area+accurate_rnd+bitexact"
d2f8f410
MN
383fi
384
51133a7d 385if [ -n "$do_mp2" ] ; then
fb132953 386do_audio_encoding mp2.mp2 "-ar 44100"
fb132953 387do_audio_decoding
976709ee 388$tiny_psnr $pcm_dst $pcm_ref 2 1924 >> $logfile
51133a7d
FB
389fi
390
51133a7d 391if [ -n "$do_ac3" ] ; then
fb132953 392do_audio_encoding ac3.rm "" -vn
ede935a1
CEH
393# gcc 2.95.3 compiled binaries decode ac3 differently because of missing SSE support
394#do_audio_decoding
395#$tiny_psnr $pcm_dst $pcm_ref 2 1024 >> $logfile
51133a7d
FB
396fi
397
311be1fb 398if [ -n "$do_g726" ] ; then
066a81a8 399do_audio_encoding g726.wav "-ar 44100" "-ab 32k -ac 1 -ar 8000 -acodec g726"
fb132953 400do_audio_decoding
311be1fb
MN
401fi
402
f02ab814 403if [ -n "$do_adpcm_ima_wav" ] ; then
fb132953 404do_audio_encoding adpcm_ima.wav "-ar 44100" "-acodec adpcm_ima_wav"
fb132953 405do_audio_decoding
f02ab814
MN
406fi
407
9dc92a38
KS
408if [ -n "$do_adpcm_ima_qt" ] ; then
409do_audio_encoding adpcm_qt.aiff "-ar 44100" "-acodec adpcm_ima_qt"
410do_audio_decoding
411fi
412
f02ab814 413if [ -n "$do_adpcm_ms" ] ; then
fb132953 414do_audio_encoding adpcm_ms.wav "-ar 44100" "-acodec adpcm_ms"
fb132953 415do_audio_decoding
f02ab814
MN
416fi
417
d8cbeba1 418if [ -n "$do_adpcm_yam" ] ; then
fb132953 419do_audio_encoding adpcm_yam.wav "-ar 44100" "-acodec adpcm_yamaha"
fb132953 420do_audio_decoding
d8cbeba1
MN
421fi
422
b529ab37 423if [ -n "$do_adpcm_swf" ] ; then
b529ab37
BL
424do_audio_encoding adpcm_swf.flv "-ar 44100" "-acodec adpcm_swf"
425do_audio_decoding
426fi
427
aeb2904e 428if [ -n "$do_flac" ] ; then
fb132953 429do_audio_encoding flac.flac "-ar 44100" "-acodec flac -compression_level 2"
fb132953 430do_audio_decoding
aeb2904e
MN
431fi
432
6d3d8dae
MN
433if [ -n "$do_wma" ] ; then
434# wmav1
435do_audio_encoding wmav1.asf "-ar 44100" "-acodec wmav1"
9a5771e9 436do_ffmpeg_nomd5 $pcm_dst -i $target_path/$file -f wav
6d3d8dae
MN
437$tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
438# wmav2
439do_audio_encoding wmav2.asf "-ar 44100" "-acodec wmav2"
9a5771e9 440do_ffmpeg_nomd5 $pcm_dst -i $target_path/$file -f wav
6d3d8dae
MN
441$tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
442fi
443
0786943a 444#if [ -n "$do_vorbis" ] ; then
3160138f 445# vorbis
90b5b51e 446#disabled because it is broken
0786943a
MN
447#do_audio_encoding vorbis.asf "-ar 44100" "-acodec vorbis"
448#do_audio_decoding
449#fi
6d3d8dae 450
4f5c72e8
PR
451do_audio_enc_dec() {
452 do_audio_encoding $3.$1 "" "$4 -sample_fmt $2 -acodec $3"
453 do_audio_decoding
454}
455
456if [ -n "$do_pcm" ] ; then
457do_audio_enc_dec wav s16 pcm_alaw
458do_audio_enc_dec wav s16 pcm_mulaw
5e8ecfde
PR
459do_audio_enc_dec mov u8 pcm_s8
460do_audio_enc_dec wav u8 pcm_u8
4f5c72e8
PR
461do_audio_enc_dec mov s16 pcm_s16be
462do_audio_enc_dec wav s16 pcm_s16le
38511b9a
AJ
463do_audio_enc_dec mkv s16 pcm_s16be
464do_audio_enc_dec mkv s16 pcm_s16le
5e8ecfde
PR
465do_audio_enc_dec mov s32 pcm_s24be
466do_audio_enc_dec wav s32 pcm_s24le
467#do_audio_enc_dec ??? s32 pcm_u24be #no compatible muxer or demuxer
468#do_audio_enc_dec ??? s32 pcm_u24le #no compatible muxer or demuxer
469do_audio_enc_dec mov s32 pcm_s32be
470do_audio_enc_dec wav s32 pcm_s32le
471#do_audio_enc_dec ??? s32 pcm_u32be #no compatible muxer or demuxer
472#do_audio_enc_dec ??? s32 pcm_u32le #no compatible muxer or demuxer
4f5c72e8 473do_audio_enc_dec au flt pcm_f32be
6f18fe8c
PR
474do_audio_enc_dec wav flt pcm_f32le
475do_audio_enc_dec au dbl pcm_f64be
476do_audio_enc_dec wav dbl pcm_f64le
4f5c72e8
PR
477do_audio_enc_dec wav s16 pcm_zork
478do_audio_enc_dec 302 s16 pcm_s24daud "-ac 6 -ar 96000"
479fi
480
2a048239 481# libavformat testing
89d5dfd5 482
2009721d 483if [ -n "$do_avi" ] ; then
36aed9e5 484do_libav avi
2009721d 485fi
89d5dfd5 486
2009721d 487if [ -n "$do_asf" ] ; then
36aed9e5 488do_libav asf "-acodec mp2" "-r 25"
2009721d 489fi
89d5dfd5 490
2009721d 491if [ -n "$do_rm" ] ; then
89d5dfd5 492file=${outfile}libav.rm
9a5771e9 493do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src
89d5dfd5 494# broken
9a5771e9 495#do_ffmpeg_crc $file -i $target_path/$file
2009721d 496fi
89d5dfd5 497
2009721d 498if [ -n "$do_mpg" ] ; then
36aed9e5 499do_libav mpg
2009721d 500fi
89d5dfd5 501
b686d0ab
BC
502if [ -n "$do_mxf" ] ; then
503do_libav mxf "-ar 48000 -bf 2 -timecode_frame_start 264363"
fc34a08d 504do_libav mxf_d10 "-ar 48000 -ac 2 -r 25 -s 720x576 -padtop 32 -vcodec mpeg2video -intra -flags +ildct+low_delay -dc 10 -flags2 +ivlc+non_linear_q -qscale 1 -ps 1 -qmin 1 -rc_max_vbv_use 1 -rc_min_vbv_use 1 -pix_fmt yuv422p -minrate 30000k -maxrate 30000k -b 30000k -bufsize 1200000 -top 1 -rc_init_occupancy 1200000 -qmax 12 -f mxf_d10"
b686d0ab
BC
505fi
506
2009721d 507if [ -n "$do_ts" ] ; then
36aed9e5 508do_libav ts
2009721d 509fi
d05c15cb 510
2009721d 511if [ -n "$do_swf" ] ; then
662fd26c 512do_libav swf -an
2009721d 513fi
89d5dfd5 514
2009721d 515if [ -n "$do_ffm" ] ; then
36aed9e5 516do_libav ffm
2009721d 517fi
89d5dfd5 518
2009721d 519if [ -n "$do_flv_fmt" ] ; then
36aed9e5 520do_libav flv -an
2009721d 521fi
bbdd42d3 522
2009721d 523if [ -n "$do_mov" ] ; then
36aed9e5 524do_libav mov "-acodec pcm_alaw"
2009721d 525fi
c280f2d7 526
2009721d 527if [ -n "$do_dv_fmt" ] ; then
36aed9e5 528do_libav dv "-ar 48000 -r 25 -s pal -ac 2"
2009721d 529fi
a811de6e 530
2009721d 531if [ -n "$do_gxf" ] ; then
36aed9e5 532do_libav gxf "-ar 48000 -r 25 -s pal -ac 1"
2009721d 533fi
a850fd18 534
2009721d 535if [ -n "$do_nut" ] ; then
f38e2b13 536do_libav nut "-acodec mp2"
2009721d 537fi
f38e2b13 538
2009721d 539if [ -n "$do_mkv" ] ; then
46491f13 540do_libav mkv
2009721d 541fi
46491f13 542
f38e2b13 543
89d5dfd5
FB
544# streamed images
545# mjpeg
affd55a1 546#file=${outfile}libav.mjpeg
9a5771e9
MR
547#do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src
548#do_ffmpeg_crc $file -i $target_path/$file
89d5dfd5 549
2009721d 550if [ -n "$do_pbmpipe" ] ; then
d449d1bc 551do_streamed_images pbm
2009721d 552fi
7481e919 553
2009721d 554if [ -n "$do_pgmpipe" ] ; then
d449d1bc 555do_streamed_images pgm
2009721d 556fi
89d5dfd5 557
2009721d 558if [ -n "$do_ppmpipe" ] ; then
d449d1bc 559do_streamed_images ppm
2009721d 560fi
89d5dfd5 561
2009721d 562if [ -n "$do_gif" ] ; then
89d5dfd5 563file=${outfile}libav.gif
9a5771e9
MR
564do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -pix_fmt rgb24
565#do_ffmpeg_crc $file -i $target_path/$file
2009721d 566fi
7481e919 567
2009721d 568if [ -n "$do_yuv4mpeg" ] ; then
8cf71ead 569file=${outfile}libav.y4m
9a5771e9
MR
570do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src
571#do_ffmpeg_crc $file -i $target_path/$file
2009721d 572fi
89d5dfd5 573
89d5dfd5 574# image formats
2009721d
MR
575
576if [ -n "$do_pgm" ] ; then
f8aa7645 577do_image_formats pgm
2009721d 578fi
89d5dfd5 579
2009721d 580if [ -n "$do_ppm" ] ; then
f8aa7645 581do_image_formats ppm
2009721d 582fi
89d5dfd5 583
2009721d 584if [ -n "$do_bmp" ] ; then
1e358f03 585do_image_formats bmp
2009721d 586fi
1e358f03 587
2009721d 588if [ -n "$do_tga" ] ; then
1e358f03 589do_image_formats tga
2009721d 590fi
1e358f03 591
2009721d 592if [ -n "$do_tiff" ] ; then
f4d47d6b 593do_image_formats tiff "-pix_fmt rgb24"
2009721d 594fi
90b4e393 595
2009721d 596if [ -n "$do_sgi" ] ; then
90b4e393 597do_image_formats sgi
2009721d 598fi
90b4e393 599
2009721d 600if [ -n "$do_jpg" ] ; then
f8aa7645 601do_image_formats jpg "-flags +bitexact -dct fastint -idct simple -pix_fmt yuvj420p" "-f image2"
2009721d 602fi
d0c30ca5 603
effcedf7
DV
604if [ -n "$do_pcx" ] ; then
605do_image_formats pcx
606fi
607
89d5dfd5
FB
608# audio only
609
2009721d 610if [ -n "$do_wav" ] ; then
e587a0a5 611do_audio_only wav
2009721d 612fi
89d5dfd5 613
2009721d 614if [ -n "$do_alaw" ] ; then
e587a0a5 615do_audio_only al
2009721d 616fi
89d5dfd5 617
2009721d 618if [ -n "$do_mulaw" ] ; then
e587a0a5 619do_audio_only ul
2009721d 620fi
89d5dfd5 621
2009721d 622if [ -n "$do_au" ] ; then
e587a0a5 623do_audio_only au
2009721d 624fi
89d5dfd5 625
2009721d 626if [ -n "$do_mmf" ] ; then
e587a0a5 627do_audio_only mmf
2009721d 628fi
d8cbeba1 629
2009721d 630if [ -n "$do_aiff" ] ; then
e587a0a5 631do_audio_only aif
2009721d 632fi
f11288da 633
2009721d 634if [ -n "$do_voc" ] ; then
e587a0a5 635do_audio_only voc
2009721d 636fi
ea395e8c 637
2009721d 638if [ -n "$do_ogg" ] ; then
5118cae6 639do_audio_only ogg
2009721d 640fi
5118cae6 641
affd55a1 642# pix_fmt conversions
2009721d
MR
643
644if [ -n "$do_pixfmt" ] ; then
dc8918ad
BC
645conversions="yuv420p yuv422p yuv444p yuyv422 yuv410p yuv411p yuvj420p \
646 yuvj422p yuvj444p rgb24 bgr24 rgb32 rgb565 rgb555 gray monow \
3e3c638e 647 monob yuv440p yuvj440p"
affd55a1
RS
648for pix_fmt in $conversions ; do
649 file=${outfile}libav-${pix_fmt}.yuv
bddbd7d3 650 do_ffmpeg_nocheck $file -r 1 -t 1 -f image2 -vcodec pgmyuv -i $raw_src \
9a5771e9
MR
651 -f rawvideo -s 352x288 -pix_fmt $pix_fmt $target_path/$raw_dst
652 do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $target_path/$raw_dst \
653 -f rawvideo -s 352x288 -pix_fmt yuv444p
affd55a1 654done
2009721d 655fi
51133a7d 656
4383ed5c 657rm -f "$bench" "$bench2"