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