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