Statistics
| Branch: | Revision:

ffmpeg / tests / regression.sh @ 7f8038ce

History | View | Annotate | Download (16.9 KB)

1
#!/bin/sh
2
#
3
# automatic regression test for ffmpeg
4
#
5
#
6
#set -x
7
# Even in the 21st century some diffs are not supporting -u.
8
diff -u $0 $0 > /dev/null 2>&1
9
if [ $? -eq 0 ]; then
10
  diff_cmd="diff -u"
11
else
12
  diff_cmd="diff"
13
fi
14

    
15
diff -w $0 $0 > /dev/null 2>&1
16
if [ $? -eq 0 ]; then
17
  diff_cmd="$diff_cmd -w"
18
fi
19

    
20
set -e
21

    
22
datadir="./data"
23

    
24
logfile="$datadir/ffmpeg.regression"
25
outfile="$datadir/a-"
26

    
27
# tests to do
28
if [ "$1" = "mpeg4" ] ; then
29
    do_mpeg4=y
30
elif [ "$1" = "mpeg" ] ; then
31
    do_mpeg=y
32
    do_mpeg2=y
33
elif [ "$1" = "ac3" ] ; then
34
    do_ac3=y
35
elif [ "$1" = "huffyuv" ] ; then
36
    do_huffyuv=y
37
elif [ "$1" = "mpeg2thread" ] ; then
38
    do_mpeg2thread=y
39
elif [ "$1" = "libavtest" ] ; then
40
    do_libav=y
41
    logfile="$datadir/libav.regression"
42
    outfile="$datadir/b-"
43
else
44
    do_mpeg=y
45
    do_mpeg2=y
46
    do_mpeg2thread=y
47
    do_msmpeg4v2=y
48
    do_msmpeg4=y
49
    do_wmv1=y
50
    do_wmv2=y
51
    do_h261=y
52
    do_h263=y
53
    do_h263p=y
54
    do_mpeg4=y
55
    do_huffyuv=y
56
    do_mjpeg=y
57
    do_ljpeg=y
58
    do_rv10=y
59
    do_mp2=y
60
    do_ac3=y
61
    do_g726=y
62
    do_adpcm_ima_wav=y
63
    do_adpcm_ms=y
64
    do_rc=y
65
    do_mpeg4adv=y
66
    do_mpeg4thread=y
67
    do_mpeg4nr=y
68
    do_mpeg1b=y
69
    do_asv1=y
70
    do_asv2=y
71
    do_flv=y
72
    do_ffv1=y
73
    do_error=y
74
    do_svq1=y
75
fi
76

    
77

    
78
# various files
79
ffmpeg="../ffmpeg_g"
80
tiny_psnr="./tiny_psnr"
81
reffile="$2"
82
benchfile="$datadir/ffmpeg.bench"
83
raw_src="$3/%d.pgm"
84
raw_dst="$datadir/out.yuv"
85
raw_ref="$datadir/ref.yuv"
86
pcm_src="asynth1.sw"
87
pcm_dst="$datadir/out.wav"
88
if [ X"`echo | md5sum 2> /dev/null`" != X ]; then
89
    do_md5sum() { md5sum -b $1; }
90
elif [ -x /sbin/md5 ]; then
91
    do_md5sum() { /sbin/md5 -r $1 | sed 's# \**\./# *./#'; }
92
else
93
    do_md5sum() { echo No md5sum program found; }
94
fi
95

    
96
# create the data directory if it does not exists
97
mkdir -p $datadir
98

    
99
do_ffmpeg()
100
{
101
    f="$1"
102
    shift
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$$
105
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
106
    rm -f /tmp/ffmpeg$$
107
    do_md5sum $f >> $logfile
108
    if [ $f = $raw_dst ] ; then
109
        $tiny_psnr $f $raw_ref >> $logfile
110
    else
111
        wc -c $f >> $logfile
112
    fi
113
    expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
114
    echo `cat $datadir/bench2.tmp` $f >> $benchfile
115
}
116

    
117
do_ffmpeg_crc()
118
{
119
    f="$1"
120
    shift
121
    echo $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $* -f crc $datadir/ffmpeg.crc
122
    $ffmpeg -y -bitexact -dct_algo 1 -idct_algo 2 $* -f crc $datadir/ffmpeg.crc > /tmp/ffmpeg$$ 2>&1
123
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:|ffmpeg version|  configuration|  built)" /tmp/ffmpeg$$ || true
124
    rm -f /tmp/ffmpeg$$ 
125
    echo "$f `cat $datadir/ffmpeg.crc`" >> $logfile
126
}
127

    
128
do_ffmpeg_nocheck()
129
{
130
    f="$1"
131
    shift
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$$
134
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
135
    rm -f /tmp/ffmpeg$$
136
    expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
137
    echo `cat $datadir/bench2.tmp` $f >> $benchfile
138
}
139

    
140
echo "ffmpeg regression test" > $logfile
141
echo "ffmpeg benchmarks" > $benchfile
142

    
143
###################################
144
# generate reference for quality check
145
do_ffmpeg_nocheck $raw_ref -y -f pgmyuv -i $raw_src -an -f rawvideo $raw_ref
146

    
147
###################################
148
if [ -n "$do_mpeg" ] ; then
149
# mpeg1 encoding
150
file=${outfile}mpeg1.mpg
151
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -f mpeg1video $file 
152

    
153
# mpeg1 decoding
154
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
155
fi
156

    
157
###################################
158
if [ -n "$do_mpeg2" ] ; then
159
# mpeg2 encoding
160
file=${outfile}mpeg2.mpg
161
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video $file 
162

    
163
# mpeg2 decoding
164
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
165

    
166
# mpeg2 encoding
167
file=${outfile}mpeg2.mpg
168
do_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
171
do_ffmpeg $raw_dst -y -idct_algo 1 -i $file -f rawvideo $raw_dst
172

    
173
# mpeg2 encoding interlaced
174
file=${outfile}mpeg2i.mpg
175
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -vcodec mpeg2video -f mpeg1video -ildct -ilme $file 
176

    
177
# mpeg2 decoding
178
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
179
fi
180

    
181
###################################
182
if [ -n "$do_mpeg2thread" ] ; then
183
# mpeg2 encoding interlaced
184
file=${outfile}mpeg2thread.mpg
185
do_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
188
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
189

    
190
# mpeg2 encoding interlaced
191
file=${outfile}mpeg2reuse.mpg
192
do_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
195
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst
196
fi
197

    
198
###################################
199
if [ -n "$do_msmpeg4v2" ] ; then
200
# msmpeg4 encoding
201
file=${outfile}msmpeg4v2.avi
202
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec msmpeg4v2 $file
203

    
204
# msmpeg4v2 decoding
205
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
206
fi
207

    
208
###################################
209
if [ -n "$do_msmpeg4" ] ; then
210
# msmpeg4 encoding
211
file=${outfile}msmpeg4.avi
212
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec msmpeg4 $file
213

    
214
# msmpeg4 decoding
215
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
216
fi
217

    
218
###################################
219
if [ -n "$do_wmv1" ] ; then
220
# wmv1 encoding
221
file=${outfile}wmv1.avi
222
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec wmv1 $file
223

    
224
# wmv1 decoding
225
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
226
fi
227

    
228
###################################
229
if [ -n "$do_wmv2" ] ; then
230
# wmv2 encoding
231
file=${outfile}wmv2.avi
232
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec wmv2 $file
233

    
234
# wmv2 decoding
235
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
236
fi
237

    
238
###################################
239
if [ -n "$do_h261" ] ; then
240
# h261 encoding
241
file=${outfile}h261.avi
242
do_ffmpeg $file -y -qscale 11 -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h261 $file
243

    
244
# h261 decoding
245
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
246
fi
247

    
248
###################################
249
if [ -n "$do_h263" ] ; then
250
# h263 encoding
251
file=${outfile}h263.avi
252
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h263 $file
253

    
254
# h263 decoding
255
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
256
fi
257

    
258
###################################
259
if [ -n "$do_h263p" ] ; then
260
# h263p encoding
261
file=${outfile}h263p.avi
262
do_ffmpeg $file -y -qscale 2 -umv -aiv -aic -f pgmyuv -i $raw_src -s 352x288 -an -vcodec h263p -ps 300 $file
263

    
264
# h263p decoding
265
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
266
fi
267

    
268
###################################
269
if [ -n "$do_mpeg4" ] ; then
270
# mpeg4
271
file=${outfile}odivx.mp4
272
do_ffmpeg $file -y -4mv -hq -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
273

    
274
# mpeg4 decoding
275
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
276
fi
277

    
278
###################################
279
if [ -n "$do_huffyuv" ] ; then
280
# huffyuv
281
file=${outfile}huffyuv.avi
282
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec huffyuv -strict -1 $file
283

    
284
# huffyuv decoding
285
do_ffmpeg $raw_dst -y -i $file -f rawvideo -strict -1 $raw_dst
286
fi
287

    
288
###################################
289
if [ -n "$do_rc" ] ; then
290
# mpeg4 rate control
291
file=${outfile}mpeg4-rc.avi
292
do_ffmpeg $file -y -b 400 -bf 2 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
293

    
294
# mpeg4 rate control decoding
295
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
296
fi
297

    
298
###################################
299
if [ -n "$do_mpeg4adv" ] ; then
300
# mpeg4
301
file=${outfile}mpeg4-adv.avi
302
do_ffmpeg $file -y -qscale 9 -4mv -hq -part -ps 200 -aic -trell -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
303

    
304
# mpeg4 decoding
305
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
306
fi
307

    
308
###################################
309
if [ -n "$do_mpeg4thread" ] ; then
310
# mpeg4
311
file=${outfile}mpeg4-thread.avi
312
do_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
315
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
316
fi
317

    
318
###################################
319
if [ -n "$do_mpeg4adv" ] ; then
320
# mpeg4
321
file=${outfile}mpeg4-Q.avi
322
do_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
325
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
326
fi
327

    
328
###################################
329
if [ -n "$do_error" ] ; then
330
# damaged mpeg4
331
file=${outfile}error-mpeg4-adv.avi
332
do_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
335
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
336
fi
337

    
338
###################################
339
if [ -n "$do_mpeg4nr" ] ; then
340
# noise reduction
341
file=${outfile}mpeg4-nr.avi
342
do_ffmpeg $file -y -qscale 8 -4mv -mbd 2 -nr 200 -f pgmyuv -i $raw_src -an -vcodec mpeg4 $file
343

    
344
# mpeg4 decoding
345
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
346
fi
347

    
348
###################################
349
if [ -n "$do_mpeg1b" ] ; then
350
# mpeg1
351
file=${outfile}mpeg1b.mpg
352
do_ffmpeg $file -y -qscale 8 -bf 3 -ps 200 -f pgmyuv -i $raw_src -an -vcodec mpeg1video -f mpeg1video $file
353

    
354
# mpeg1 decoding
355
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
356
fi
357

    
358
###################################
359
if [ -n "$do_mjpeg" ] ; then
360
# mjpeg
361
file=${outfile}mjpeg.avi
362
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec mjpeg $file
363

    
364
# mjpeg decoding
365
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
366
fi
367

    
368
###################################
369
if [ -n "$do_ljpeg" ] ; then
370
# ljpeg
371
file=${outfile}ljpeg.avi
372
do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec ljpeg $file
373

    
374
# ljpeg decoding
375
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
376
fi
377

    
378
###################################
379
if [ -n "$do_rv10" ] ; then
380
# rv10 encoding
381
file=${outfile}rv10.rm
382
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an $file 
383

    
384
# rv10 decoding
385
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
386
fi
387

    
388
###################################
389
if [ -n "$do_asv1" ] ; then
390
# asv1 encoding
391
file=${outfile}asv1.avi
392
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec asv1 $file
393

    
394
# asv1 decoding
395
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
396
fi
397

    
398
###################################
399
if [ -n "$do_asv2" ] ; then
400
# asv2 encoding
401
file=${outfile}asv2.avi
402
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec asv2 $file
403

    
404
# asv2 decoding
405
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
406
fi
407

    
408
###################################
409
if [ -n "$do_flv" ] ; then
410
# flv encoding
411
file=${outfile}flv.flv
412
do_ffmpeg $file -y -qscale 10 -f pgmyuv -i $raw_src -an -vcodec flv $file
413

    
414
# flv decoding
415
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
416
fi
417

    
418
###################################
419
if [ -n "$do_ffv1" ] ; then
420
# ffv1 encoding
421
file=${outfile}ffv1.avi
422
do_ffmpeg $file -y -strict -1 -f pgmyuv -i $raw_src -an -vcodec ffv1 $file
423

    
424
# ffv1 decoding
425
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
426
fi
427

    
428
###################################
429
if [ -n "$do_svq1" ] ; then
430
# svq1 encoding
431
file=${outfile}svq1.mov
432
do_ffmpeg $file -y -f pgmyuv -i $raw_src -an -vcodec svq1 -qscale 3 -pix_fmt yuv410p $file
433

    
434
# svq1 decoding
435
do_ffmpeg $raw_dst -y -i $file -f rawvideo $raw_dst 
436
fi
437

    
438
###################################
439
if [ -n "$do_mp2" ] ; then
440
# mp2 encoding
441
file=${outfile}mp2.mp2
442
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src $file 
443

    
444
# mp2 decoding
445
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst 
446
fi
447

    
448
###################################
449
if [ -n "$do_ac3" ] ; then
450
# ac3 encoding
451
file=${outfile}ac3.rm
452
do_ffmpeg $file -y -ab 128 -ac 2 -f s16le  -i $pcm_src -vn $file 
453

    
454
# ac3 decoding
455
#do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst 
456
fi
457

    
458
###################################
459
if [ -n "$do_g726" ] ; then
460
# g726 encoding
461
file=${outfile}g726.wav
462
do_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
465
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst 
466
fi
467

    
468
###################################
469
if [ -n "$do_adpcm_ima_wav" ] ; then
470
# encoding
471
file=${outfile}adpcm_ima.wav
472
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ima_wav $file 
473

    
474
# decoding
475
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst 
476
fi
477

    
478
###################################
479
if [ -n "$do_adpcm_ms" ] ; then
480
# encoding
481
file=${outfile}adpcm_ms.wav
482
do_ffmpeg $file -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -acodec adpcm_ms $file 
483

    
484
# decoding
485
do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst 
486
fi
487

    
488
###################################
489
# libav testing
490
###################################
491

    
492
if [ -n "$do_libav" ] ; then
493

    
494
# avi
495
file=${outfile}libav.avi
496
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
497
do_ffmpeg_crc $file -i $file
498

    
499
# asf
500
file=${outfile}libav.asf
501
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
502
do_ffmpeg_crc $file -i $file -r 25
503

    
504
# rm
505
file=${outfile}libav.rm
506
do_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
511
file=${outfile}libav.mpg
512
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
513
do_ffmpeg_crc $file -i $file
514

    
515
# swf (decode audio only)
516
file=${outfile}libav.swf
517
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
518
do_ffmpeg_crc $file -i $file
519

    
520
# ffm
521
file=${outfile}libav.ffm
522
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
523
do_ffmpeg_crc $file -i $file
524

    
525
# flv
526
file=${outfile}libav.flv
527
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -an $file
528
do_ffmpeg_crc $file -i $file
529

    
530
# mov
531
file=${outfile}libav.mov
532
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec pcm_alaw $file
533
do_ffmpeg_crc $file -i $file
534

    
535
# nut
536
file=${outfile}libav.nut
537
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src -acodec mp2 $file
538
do_ffmpeg_crc $file -i $file
539

    
540
# dv
541
file=${outfile}libav.dv
542
do_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
543
do_ffmpeg_crc $file -i $file
544

    
545
# XXX: need mpegts tests (add bitstreams or add output capability in ffmpeg)
546

    
547
####################
548
# streamed images
549
# mjpeg
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
553

    
554
# pbmpipe
555
file=${outfile}libav.pbm
556
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
557
do_ffmpeg_crc $file -f image2pipe -i $file
558

    
559
# pgmpipe
560
file=${outfile}libav.pgm
561
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
562
do_ffmpeg_crc $file -f image2pipe -i $file
563

    
564
# ppmpipe
565
file=${outfile}libav.ppm
566
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
567
do_ffmpeg_crc $file -f image2pipe -i $file
568

    
569
# gif
570
file=${outfile}libav.gif
571
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
572
#do_ffmpeg_crc $file -i $file
573

    
574
# yuv4mpeg
575
file=${outfile}libav.yuv4mpeg
576
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
577
#do_ffmpeg_crc $file -i $file
578

    
579
####################
580
# image formats
581
# pgm (we do not do md5 on image files yet)
582
file=${outfile}libav%d.pgm
583
$ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
584
do_ffmpeg_crc $file -i $file
585

    
586
# ppm (we do not do md5 on image files yet)
587
file=${outfile}libav%d.ppm
588
$ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $file
589
do_ffmpeg_crc $file -i $file
590

    
591
# jpeg (we do not do md5 on image files yet)
592
file=${outfile}libav%d.jpg
593
$ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src -f image2 $file
594
do_ffmpeg_crc $file -f image2 -i $file
595

    
596
####################
597
# audio only
598

    
599
# wav
600
file=${outfile}libav.wav
601
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
602
do_ffmpeg_crc $file -i $file
603

    
604
# alaw
605
file=${outfile}libav.al
606
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
607
do_ffmpeg_crc $file -i $file
608

    
609
# mulaw
610
file=${outfile}libav.ul
611
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
612
do_ffmpeg_crc $file -i $file
613

    
614
# au
615
file=${outfile}libav.au
616
do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
617
do_ffmpeg_crc $file -i $file
618

    
619
####################
620
# pix_fmt conversions
621
conversions="yuv420p yuv422p yuv444p yuv422 yuv410p yuv411p yuvj420p \
622
             yuvj422p yuvj444p rgb24 bgr24 rgba32 rgb565 rgb555 gray monow \
623
	     monob pal8"
624
for 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
630
done
631

    
632
fi
633

    
634

    
635

    
636
if $diff_cmd $logfile $reffile ; then
637
    echo 
638
    echo Regression test succeeded.
639
    exit 0
640
else
641
    echo 
642
    echo Regression test: Error.
643
    exit 1
644
fi