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