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