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