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