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