overflow fix
[libav.git] / tests / regression.sh
CommitLineData
51133a7d
FB
1#!/bin/sh
2#
3# automatic regression test for ffmpeg
4#
5#
6#set -x
6e023978
RS
7# Even in the 21st century some diffs are not supporting -u.
8diff -u $0 $0 > /dev/null 2>&1
9if [ $? -eq 0 ]; then
10 diff_cmd="diff -u"
11else
12 diff_cmd="diff"
13fi
14
d9d7653e
MN
15diff -w $0 $0 > /dev/null 2>&1
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
51133a7d
FB
27# tests to do
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
89d5dfd5
FB
37elif [ "$1" = "libavtest" ] ; then
38 do_libav=y
5bcfd1ad 39 logfile="$datadir/libav.regression"
a12eea30 40 outfile="$datadir/b-"
51133a7d
FB
41else
42 do_mpeg=y
922bc38d 43 do_mpeg2=y
9c3d33d6 44 do_mpeg2thread=y
6ebd933b 45 do_msmpeg4v2=y
51133a7d 46 do_msmpeg4=y
6ebd933b 47 do_wmv1=y
e23d5712 48 do_wmv2=y
61b262a9 49 do_h261=y
51133a7d 50 do_h263=y
6e2d5f1a 51 do_h263p=y
51133a7d 52 do_mpeg4=y
e23d5712 53 do_huffyuv=y
51133a7d 54 do_mjpeg=y
3b37408b 55 do_ljpeg=y
64a7a8af 56 do_rv10=y
51133a7d
FB
57 do_mp2=y
58 do_ac3=y
311be1fb 59 do_g726=y
f02ab814
MN
60 do_adpcm_ima_wav=y
61 do_adpcm_ms=y
1dbb6d90
MN
62 do_rc=y
63 do_mpeg4adv=y
9c3d33d6 64 do_mpeg4thread=y
be408b67 65 do_mpeg4nr=y
cfadadec 66 do_mpeg1b=y
9ca9fce1 67 do_asv1=y
8d876a43 68 do_asv2=y
bbdd42d3 69 do_flv=y
f3203047 70 do_ffv1=y
7ebfc0ea 71 do_error=y
b86bd1f1 72 do_svq1=y
51133a7d
FB
73fi
74
75
76# various files
3aca208a 77ffmpeg="../ffmpeg_g"
67cbe681 78tiny_psnr="./tiny_psnr"
51133a7d 79reffile="$2"
5bcfd1ad 80benchfile="$datadir/ffmpeg.bench"
6afd3b92 81raw_src="$3/%d.pgm"
5bcfd1ad 82raw_dst="$datadir/out.yuv"
67cbe681 83raw_ref="$datadir/ref.yuv"
51133a7d 84pcm_src="asynth1.sw"
5bcfd1ad 85pcm_dst="$datadir/out.wav"
853d659d
JD
86if [ X"`echo | md5sum 2> /dev/null`" != X ]; then
87 do_md5sum() { md5sum -b $1; }
88elif [ -x /sbin/md5 ]; then
89 do_md5sum() { /sbin/md5 -r $1 | sed 's# \**\./# *./#'; }
90else
91 do_md5sum() { echo No md5sum program found; }
92fi
5bcfd1ad
FB
93
94# create the data directory if it does not exists
95mkdir -p $datadir
51133a7d 96
3f027ca7 97do_ffmpeg()
51133a7d
FB
98{
99 f="$1"
100 shift
affd55a1
RS
101 echo $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $*
102 $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 -benchmark $* > $datadir/bench.tmp 2> /tmp/ffmpeg$$
37a00782 103 egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration|video:)" /tmp/ffmpeg$$ || true
e31c1c30 104 rm -f /tmp/ffmpeg$$
853d659d 105 do_md5sum $f >> $logfile
67cbe681
MN
106 if [ $f = $raw_dst ] ; then
107 $tiny_psnr $f $raw_ref >> $logfile
039e7889
MN
108 else
109 wc -c $f >> $logfile
67cbe681 110 fi
90cee0c3 111 expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
5bcfd1ad 112 echo `cat $datadir/bench2.tmp` $f >> $benchfile
51133a7d
FB
113}
114
3f027ca7 115do_ffmpeg_crc()
89d5dfd5
FB
116{
117 f="$1"
118 shift
2ad1516a 119 echo $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $* -f crc $datadir/ffmpeg.crc
affd55a1 120 $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $* -f crc $datadir/ffmpeg.crc > /tmp/ffmpeg$$ 2>&1
37a00782 121 egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration|video:|ffmpeg version| configuration| built)" /tmp/ffmpeg$$ || true
affd55a1
RS
122 rm -f /tmp/ffmpeg$$
123 echo "$f `cat $datadir/ffmpeg.crc`" >> $logfile
89d5dfd5 124}
51133a7d 125
67cbe681
MN
126do_ffmpeg_nocheck()
127{
128 f="$1"
129 shift
affd55a1
RS
130 echo $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $*
131 $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 -benchmark $* > $datadir/bench.tmp 2> /tmp/ffmpeg$$
37a00782 132 egrep -v "^(Stream|Press|Input|Output|frame| Stream| Duration|video:)" /tmp/ffmpeg$$ || true
affd55a1 133 rm -f /tmp/ffmpeg$$
67cbe681
MN
134 expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
135 echo `cat $datadir/bench2.tmp` $f >> $benchfile
136}
137
51133a7d
FB
138echo "ffmpeg regression test" > $logfile
139echo "ffmpeg benchmarks" > $benchfile
140
141###################################
67cbe681
MN
142# generate reference for quality check
143do_ffmpeg_nocheck $raw_ref -y -f pgmyuv -i $raw_src -an -f rawvideo $raw_ref
144
145###################################
51133a7d
FB
146if [ -n "$do_mpeg" ] ; then
147# mpeg1 encoding
148file=${outfile}mpeg1.mpg
89d5dfd5 149do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -f mpeg1video $file
51133a7d
FB
150
151# mpeg1 decoding
89d5dfd5 152do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
922bc38d
MN
153fi
154
155###################################
156if [ -n "$do_mpeg2" ] ; then
157# mpeg2 encoding
83dddc4a
FB
158file=${outfile}mpeg2.mpg
159do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video $file
160
161# mpeg2 decoding
162do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
163
6486ad57
MN
164# mpeg2 encoding
165file=${outfile}mpeg2.mpg
166do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -idct_algo 1 -dct_algo 2 -f mpeg1video $file
167
168# mpeg2 decoding
169do_ffmpeg $raw_dst -y -idct_algo 1 -i $file -f rawvideo $raw_dst
170
83dddc4a
FB
171# mpeg2 encoding interlaced
172file=${outfile}mpeg2i.mpg
69768b77 173do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video -ildct -ilme $file
51133a7d
FB
174
175# mpeg2 decoding
922bc38d 176do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
51133a7d
FB
177fi
178
179###################################
9c3d33d6
MN
180if [ -n "$do_mpeg2thread" ] ; then
181# mpeg2 encoding interlaced
182file=${outfile}mpeg2thread.mpg
183do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video -bf 2 -ildct -ilme -threads 2 $file
184
185# mpeg2 decoding
186do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
187fi
188
189###################################
6ebd933b
MN
190if [ -n "$do_msmpeg4v2" ] ; then
191# msmpeg4 encoding
192file=${outfile}msmpeg4v2.avi
193do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec msmpeg4v2 $file
194
195# msmpeg4v2 decoding
196do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
197fi
198
199###################################
51133a7d
FB
200if [ -n "$do_msmpeg4" ] ; then
201# msmpeg4 encoding
202file=${outfile}msmpeg4.avi
203do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec msmpeg4 $file
204
205# msmpeg4 decoding
206do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
207fi
208
209###################################
6ebd933b
MN
210if [ -n "$do_wmv1" ] ; then
211# wmv1 encoding
212file=${outfile}wmv1.avi
213do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec wmv1 $file
214
215# wmv1 decoding
216do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
217fi
218
219###################################
e23d5712
MN
220if [ -n "$do_wmv2" ] ; then
221# wmv2 encoding
222file=${outfile}wmv2.avi
223do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec wmv2 $file
224
225# wmv2 decoding
226do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
227fi
228
229###################################
61b262a9
MN
230if [ -n "$do_h261" ] ; then
231# h261 encoding
232file=${outfile}h261.avi
233do_ffmpeg $file -y -qscale 11 -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h261 $file
234
235# h261 decoding
236do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
237fi
238
239###################################
51133a7d
FB
240if [ -n "$do_h263" ] ; then
241# h263 encoding
242file=${outfile}h263.avi
243do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h263 $file
244
6e2d5f1a
MN
245# h263 decoding
246do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
247fi
248
249###################################
250if [ -n "$do_h263p" ] ; then
251# h263p encoding
252file=${outfile}h263p.avi
d7d24282 253do_ffmpeg $file -y -qscale 2 -umv -aiv -aic -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h263p -ps 300 $file
6e2d5f1a 254
51133a7d
FB
255# h263p decoding
256do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
257fi
258
259###################################
260if [ -n "$do_mpeg4" ] ; then
261# mpeg4
28c70622 262file=${outfile}odivx.mp4
d3985de7 263do_ffmpeg $file -y -4mv -hq -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
51133a7d
FB
264
265# mpeg4 decoding
266do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
267fi
268
269###################################
e629ab68
RD
270if [ -n "$do_huffyuv" ] ; then
271# huffyuv
272file=${outfile}huffyuv.avi
273do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec huffyuv -strict -1 $file
274
275# huffyuv decoding
276do_ffmpeg $raw_dst -y -i $file -f rawvideo -strict -1 $raw_dst
277fi
278
279###################################
1dbb6d90
MN
280if [ -n "$do_rc" ] ; then
281# mpeg4 rate control
282file=${outfile}mpeg4-rc.avi
283do_ffmpeg $file -y -b 400 -bf 2 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
284
285# mpeg4 rate control decoding
286do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
287fi
288
289###################################
290if [ -n "$do_mpeg4adv" ] ; then
291# mpeg4
292file=${outfile}mpeg4-adv.avi
c0baa56a 293do_ffmpeg $file -y -qscale 9 -4mv -hq -part -ps 200 -aic -trell -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
1dbb6d90
MN
294
295# mpeg4 decoding
296do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
297fi
298
299###################################
9c3d33d6
MN
300if [ -n "$do_mpeg4thread" ] ; then
301# mpeg4
302file=${outfile}mpeg4-thread.avi
303do_ffmpeg $file -y -b 500 -4mv -hq -part -ps 200 -aic -trell -bf 2 -f pgmyuv -i $raw_src -an -vcodec mpeg4 -threads 2 $file
304
305# mpeg4 decoding
306do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
aab9cdcf
MN
307fi
308
309###################################
310if [ -n "$do_mpeg4adv" ] ; then
311# mpeg4
312file=${outfile}mpeg4-Q.avi
313do_ffmpeg $file -y -qscale 7 -4mv -mbd 2 -qpel -bf 2 -cmp 1 -subcmp 2 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
314
315# mpeg4 decoding
316do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
9c3d33d6
MN
317fi
318
319###################################
7ebfc0ea
MN
320if [ -n "$do_error" ] ; then
321# damaged mpeg4
322file=${outfile}error-mpeg4-adv.avi
323do_ffmpeg $file -y -qscale 7 -4mv -mbd 2 -part -ps 250 -error 10 -aic -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
324
325# damaged mpeg4 decoding
326do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
327fi
328
329###################################
be408b67
MN
330if [ -n "$do_mpeg4nr" ] ; then
331# noise reduction
9c3d33d6 332file=${outfile}mpeg4-nr.avi
be408b67
MN
333do_ffmpeg $file -y -qscale 8 -4mv -mbd 2 -nr 200 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
334
335# mpeg4 decoding
336do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
337fi
338
339###################################
cfadadec
MN
340if [ -n "$do_mpeg1b" ] ; then
341# mpeg1
342file=${outfile}mpeg1b.mpg
83dddc4a 343do_ffmpeg $file -y -qscale 8 -bf 3 -ps 200 -f pgmyuv -i $raw_src -an -vcodec mpeg1video -f mpeg1video $file
cfadadec
MN
344
345# mpeg1 decoding
346do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
347fi
348
349###################################
51133a7d
FB
350if [ -n "$do_mjpeg" ] ; then
351# mjpeg
352file=${outfile}mjpeg.avi
353do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mjpeg $file
354
355# mjpeg decoding
356do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
357fi
358
359###################################
3b37408b
MN
360if [ -n "$do_ljpeg" ] ; then
361# ljpeg
362file=${outfile}ljpeg.avi
363do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec ljpeg $file
364
365# ljpeg decoding
366do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
367fi
368
369###################################
51133a7d
FB
370if [ -n "$do_rv10" ] ; then
371# rv10 encoding
372file=${outfile}rv10.rm
373do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an $file
374
375# rv10 decoding
376do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
377fi
378
379###################################
9ca9fce1
MN
380if [ -n "$do_asv1" ] ; then
381# asv1 encoding
382file=${outfile}asv1.avi
383do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec asv1 $file
384
385# asv1 decoding
386do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
387fi
388
389###################################
8d876a43
MN
390if [ -n "$do_asv2" ] ; then
391# asv2 encoding
392file=${outfile}asv2.avi
393do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec asv2 $file
394
395# asv2 decoding
396do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
397fi
398
399###################################
bbdd42d3
MN
400if [ -n "$do_flv" ] ; then
401# flv encoding
402file=${outfile}flv.flv
403do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec flv $file
404
405# flv decoding
406do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
407fi
408
409###################################
f3203047
MN
410if [ -n "$do_ffv1" ] ; then
411# ffv1 encoding
412file=${outfile}ffv1.avi
413do_ffmpeg $file -y -strict -1 -f pgmyuv -i $raw_src -an -vcodec ffv1 $file
414
415# ffv1 decoding
416do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
417fi
418
419###################################
b86bd1f1
MN
420if [ -n "$do_svq1" ] ; then
421# svq1 encoding
422file=${outfile}svq1.mov
e6cf9be5 423do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec svq1 -qscale 3 -pix_fmt yuv410p $file
b86bd1f1
MN
424
425# svq1 decoding
426do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
427fi
428
429###################################
51133a7d
FB
430if [ -n "$do_mp2" ] ; then
431# mp2 encoding
432file=${outfile}mp2.mp2
433do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src $file
434
435# mp2 decoding
436do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
437fi
438
439###################################
440if [ -n "$do_ac3" ] ; then
441# ac3 encoding
442file=${outfile}ac3.rm
443do_ffmpeg $file -y -ab 128 -ac 2 -f s16le -i $pcm_src -vn $file
444
445# ac3 decoding
3c300082 446#do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
51133a7d
FB
447fi
448
89d5dfd5 449###################################
311be1fb
MN
450if [ -n "$do_g726" ] ; then
451# g726 encoding
452file=${outfile}g726.wav
453do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -ab 32 -ac 1 -ar 8000 -acodec g726 $file
454
455# g726 decoding
456do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
457fi
458
459###################################
f02ab814
MN
460if [ -n "$do_adpcm_ima_wav" ] ; then
461# encoding
462file=${outfile}adpcm_ima.wav
463do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ima_wav $file
464
465# decoding
466do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
467fi
468
469###################################
470if [ -n "$do_adpcm_ms" ] ; then
471# encoding
472file=${outfile}adpcm_ms.wav
473do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ms $file
474
475# decoding
476do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
477fi
478
479###################################
89d5dfd5
FB
480# libav testing
481###################################
482
483if [ -n "$do_libav" ] ; then
484
485# avi
486file=${outfile}libav.avi
487do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
488do_ffmpeg_crc $file -i $file
489
490# asf
491file=${outfile}libav.asf
ba30abcb 492do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
e928649b 493do_ffmpeg_crc $file -i $file -r 25
89d5dfd5
FB
494
495# rm
496file=${outfile}libav.rm
497do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
498# broken
499#do_ffmpeg_crc $file -i $file
500
501# mpegps
502file=${outfile}libav.mpg
503do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
504do_ffmpeg_crc $file -i $file
505
506# swf (decode audio only)
507file=${outfile}libav.swf
2dd59ebd 508do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
d0c30ca5 509do_ffmpeg_crc $file -i $file
89d5dfd5
FB
510
511# ffm
74d69c07
MN
512file=${outfile}libav.ffm
513do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
514do_ffmpeg_crc $file -i $file
89d5dfd5 515
bbdd42d3
MN
516# flv
517file=${outfile}libav.flv
ba30abcb 518do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -an $file
bbdd42d3
MN
519do_ffmpeg_crc $file -i $file
520
c280f2d7 521# mov
2dd59ebd
MN
522file=${outfile}libav.mov
523do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec pcm_alaw $file
524do_ffmpeg_crc $file -i $file
c280f2d7
MN
525
526# nut
527file=${outfile}libav.nut
ba30abcb 528do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
c280f2d7
MN
529do_ffmpeg_crc $file -i $file
530
a811de6e 531# dv
3ea1ce21
RS
532file=${outfile}libav.dv
533do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -ar 48000 -r 25 -s pal -ac 2 $file
534do_ffmpeg_crc $file -i $file
a811de6e 535
c280f2d7 536# XXX: need mpegts tests (add bitstreams or add output capability in ffmpeg)
89d5dfd5
FB
537
538####################
539# streamed images
540# mjpeg
affd55a1
RS
541#file=${outfile}libav.mjpeg
542#do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
543#do_ffmpeg_crc $file -i $file
89d5dfd5 544
7481e919
FB
545# pbmpipe
546file=${outfile}libav.pbm
87c5fbc3
MN
547do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
548do_ffmpeg_crc $file -f image2pipe -i $file
7481e919 549
89d5dfd5 550# pgmpipe
7481e919 551file=${outfile}libav.pgm
87c5fbc3
MN
552do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
553do_ffmpeg_crc $file -f image2pipe -i $file
89d5dfd5
FB
554
555# ppmpipe
7481e919 556file=${outfile}libav.ppm
87c5fbc3
MN
557do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
558do_ffmpeg_crc $file -f image2pipe -i $file
89d5dfd5
FB
559
560# gif
561file=${outfile}libav.gif
7481e919
FB
562do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
563#do_ffmpeg_crc $file -i $file
564
565# yuv4mpeg
566file=${outfile}libav.yuv4mpeg
567do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
568#do_ffmpeg_crc $file -i $file
89d5dfd5
FB
569
570####################
571# image formats
572# pgm (we do not do md5 on image files yet)
573file=${outfile}libav%d.pgm
574$ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
575do_ffmpeg_crc $file -i $file
576
577# ppm (we do not do md5 on image files yet)
578file=${outfile}libav%d.ppm
579$ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
580do_ffmpeg_crc $file -i $file
581
d0c30ca5 582# jpeg (we do not do md5 on image files yet)
72f89c4c
MN
583file=${outfile}libav%d.jpg
584$ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src -f image2 $file
585do_ffmpeg_crc $file -f image2 -i $file
d0c30ca5 586
89d5dfd5
FB
587####################
588# audio only
589
590# wav
591file=${outfile}libav.wav
592do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
593do_ffmpeg_crc $file -i $file
594
595# alaw
596file=${outfile}libav.al
597do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
598do_ffmpeg_crc $file -i $file
599
600# mulaw
601file=${outfile}libav.ul
602do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
603do_ffmpeg_crc $file -i $file
604
605# au
606file=${outfile}libav.au
607do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
608do_ffmpeg_crc $file -i $file
609
affd55a1
RS
610####################
611# pix_fmt conversions
612conversions="yuv420p yuv422p yuv444p yuv422 yuv410p yuv411p yuvj420p \
613 yuvj422p yuvj444p rgb24 bgr24 rgba32 rgb565 rgb555 gray monow \
614 monob pal8"
615for pix_fmt in $conversions ; do
616 file=${outfile}libav-${pix_fmt}.yuv
617 do_ffmpeg_nocheck $file -r 1 -t 1 -y -f pgmyuv -i $raw_src \
618 -f rawvideo -s 352x288 -pix_fmt $pix_fmt $raw_dst
619 do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $raw_dst \
620 -f rawvideo -s 352x288 -pix_fmt yuv444p $file
621done
622
89d5dfd5
FB
623fi
624
625
51133a7d 626
6e023978 627if $diff_cmd $logfile $reffile ; then
51133a7d
FB
628 echo
629 echo Regression test succeeded.
630 exit 0
631else
632 echo
633 echo Regression test: Error.
634 exit 1
635fi