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