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

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

20 21
set -e

F
Fabrice Bellard 已提交
22 23 24
datadir="./data"

logfile="$datadir/ffmpeg.regression"
25
outfile="$datadir/a-"
F
Fabrice Bellard 已提交
26

27 28 29 30 31
# tests to do
if [ "$1" = "mpeg4" ] ; then
    do_mpeg4=y
elif [ "$1" = "mpeg" ] ; then
    do_mpeg=y
32
    do_mpeg2=y
F
Fabrice Bellard 已提交
33 34
elif [ "$1" = "ac3" ] ; then
    do_ac3=y
35 36
elif [ "$1" = "huffyuv" ] ; then
    do_huffyuv=y
M
Michael Niedermayer 已提交
37 38
elif [ "$1" = "mpeg2thread" ] ; then
    do_mpeg2thread=y
M
Michael Niedermayer 已提交
39 40
elif [ "$1" = "snow" ] ; then
    do_snow=y
M
Michael Niedermayer 已提交
41 42
elif [ "$1" = "snowll" ] ; then
    do_snowll=y
F
Fabrice Bellard 已提交
43 44
elif [ "$1" = "libavtest" ] ; then
    do_libav=y
F
Fabrice Bellard 已提交
45
    logfile="$datadir/libav.regression"
46
    outfile="$datadir/b-"
47 48
else
    do_mpeg=y
M
Michael Niedermayer 已提交
49
    do_mpeg2=y
50
    do_mpeg2thread=y
51
    do_msmpeg4v2=y
52
    do_msmpeg4=y
53
    do_wmv1=y
54
    do_wmv2=y
M
Michael Niedermayer 已提交
55
    do_h261=y
56
    do_h263=y
M
Michael Niedermayer 已提交
57
    do_h263p=y
58
    do_mpeg4=y
59
    do_mp4psp=y
60
    do_huffyuv=y
61
    do_mjpeg=y
62
    do_ljpeg=y
M
Michael Niedermayer 已提交
63
    do_jpegls=y
64
    do_rv10=y
M
Michael Niedermayer 已提交
65
    do_rv20=y
66 67
    do_mp2=y
    do_ac3=y
M
Michael Niedermayer 已提交
68
    do_g726=y
69 70
    do_adpcm_ima_wav=y
    do_adpcm_ms=y
M
Michael Niedermayer 已提交
71
    do_flac=y
72 73
    do_rc=y
    do_mpeg4adv=y
74
    do_mpeg4thread=y
75
    do_mpeg4nr=y
76
    do_mpeg1b=y
M
Michael Niedermayer 已提交
77
    do_asv1=y
M
Michael Niedermayer 已提交
78
    do_asv2=y
M
Michael Niedermayer 已提交
79
    do_flv=y
M
Michael Niedermayer 已提交
80
    do_ffv1=y
81
    do_error=y
M
Michael Niedermayer 已提交
82
    do_svq1=y
M
Michael Niedermayer 已提交
83
    do_snow=y
M
Michael Niedermayer 已提交
84
    do_snowll=y
85
    do_adpcm_yam=y
M
Michael Niedermayer 已提交
86
    do_dv=y
D
Daniel Maas 已提交
87
    do_dv50=y
88 89 90 91
fi


# various files
M
Mark Hills 已提交
92
ffmpeg="../ffmpeg_g"
93
tiny_psnr="./tiny_psnr"
94
reffile="$2"
F
Fabrice Bellard 已提交
95
benchfile="$datadir/ffmpeg.bench"
96
raw_src="$3/%02d.pgm"
F
Fabrice Bellard 已提交
97
raw_dst="$datadir/out.yuv"
98
raw_ref="$datadir/ref.yuv"
99
pcm_src="asynth1.sw"
F
Fabrice Bellard 已提交
100
pcm_dst="$datadir/out.wav"
101
pcm_ref="$datadir/ref.wav"
102 103 104 105 106 107 108
if [ X"`echo | md5sum 2> /dev/null`" != X ]; then
    do_md5sum() { md5sum -b $1; }
elif [ -x /sbin/md5 ]; then
    do_md5sum() { /sbin/md5 -r $1 | sed 's# \**\./# *./#'; }
else
    do_md5sum() { echo No md5sum program found; }
fi
F
Fabrice Bellard 已提交
109 110 111

# create the data directory if it does not exists
mkdir -p $datadir
112

D
Diego Biurrun 已提交
113 114
FFMPEG_OPTS="-y -flags +bitexact -dct fastint -idct simple"

115
do_ffmpeg()
116 117 118
{
    f="$1"
    shift
D
Diego Biurrun 已提交
119 120
    echo $ffmpeg $FFMPEG_OPTS $*
    $ffmpeg $FFMPEG_OPTS -benchmark $* > $datadir/bench.tmp 2> /tmp/ffmpeg$$
121
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
122
    rm -f /tmp/ffmpeg$$
123
    do_md5sum $f >> $logfile
124 125
    if [ $f = $raw_dst ] ; then
        $tiny_psnr $f $raw_ref >> $logfile
126
    elif [ $f = $pcm_dst ] ; then
127
        $tiny_psnr $f $pcm_ref 2 >> $logfile
128 129
    else
        wc -c $f >> $logfile
130
    fi
131
    expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
F
Fabrice Bellard 已提交
132
    echo `cat $datadir/bench2.tmp` $f >> $benchfile
133 134
}

135
do_ffmpeg_crc()
F
Fabrice Bellard 已提交
136 137 138
{
    f="$1"
    shift
D
Diego Biurrun 已提交
139 140
    echo $ffmpeg $FFMPEG_OPTS $* -f crc $datadir/ffmpeg.crc
    $ffmpeg $FFMPEG_OPTS $* -f crc $datadir/ffmpeg.crc > /tmp/ffmpeg$$ 2>&1
141
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:|ffmpeg version|  configuration|  built)" /tmp/ffmpeg$$ || true
142
    rm -f /tmp/ffmpeg$$
143
    echo "$f `cat $datadir/ffmpeg.crc`" >> $logfile
F
Fabrice Bellard 已提交
144
}
145

146 147 148 149
do_ffmpeg_nocheck()
{
    f="$1"
    shift
D
Diego Biurrun 已提交
150 151
    echo $ffmpeg $FFMPEG_OPTS $*
    $ffmpeg $FFMPEG_OPTS -benchmark $* > $datadir/bench.tmp 2> /tmp/ffmpeg$$
152
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
153
    rm -f /tmp/ffmpeg$$
154 155 156 157
    expr "`cat $datadir/bench.tmp`" : '.*utime=\(.*s\)' > $datadir/bench2.tmp
    echo `cat $datadir/bench2.tmp` $f >> $benchfile
}

158 159 160 161 162 163 164 165 166 167
do_video_decoding()
{
    do_ffmpeg $raw_dst -y -i $file -f rawvideo $@ $raw_dst
}

do_video_encoding()
{
    do_ffmpeg $file -y $1 -f pgmyuv -i $raw_src $2 $file
}

168 169 170 171 172 173 174 175 176 177 178
do_audio_encoding()
{
    file=${outfile}$1
    do_ffmpeg $file -y -ab 128 -ac 2 -f s16le -i $pcm_src $3 $file
}

do_audio_decoding()
{
    do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
}

D
Diego Biurrun 已提交
179 180 181 182 183 184 185 186
do_libav()
{
    file=${outfile}libav.$1
    do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $2 $file
    do_ffmpeg_crc $file -i $file $3

}

187 188 189 190 191 192 193
do_streamed_images()
{
    file=${outfile}libav.$1
    do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
    do_ffmpeg_crc $file -f image2pipe -i $file
}

D
Diego Biurrun 已提交
194 195 196 197 198 199 200 201
do_image_formats()
{
    file=${outfile}libav%02d.$1
    $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $2 $3 $file
    do_ffmpeg_crc $file $3 -i $file

}

202 203 204 205 206 207 208
do_audio_only()
{
    file=${outfile}libav.$1
    do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
    do_ffmpeg_crc $file -i $file
}

209 210 211
echo "ffmpeg regression test" > $logfile
echo "ffmpeg benchmarks" > $benchfile

212 213 214
###################################
# generate reference for quality check
do_ffmpeg_nocheck $raw_ref -y -f pgmyuv -i $raw_src -an -f rawvideo $raw_ref
215
do_ffmpeg_nocheck $pcm_ref -y -ab 128 -ac 2 -ar 44100 -f s16le -i $pcm_src -f wav $pcm_ref
216

217 218 219 220
###################################
if [ -n "$do_mpeg" ] ; then
# mpeg1 encoding
file=${outfile}mpeg1.mpg
221
do_video_encoding "-qscale 10" "-f mpeg1video"
222 223

# mpeg1 decoding
224
do_video_decoding
M
Michael Niedermayer 已提交
225 226 227 228 229
fi

###################################
if [ -n "$do_mpeg2" ] ; then
# mpeg2 encoding
230
file=${outfile}mpeg2.mpg
231
do_video_encoding "-qscale 10" "-vcodec mpeg2video -f mpeg1video"
232 233

# mpeg2 decoding
234
do_video_decoding
235

236 237
# mpeg2 encoding using intra vlc
file=${outfile}mpeg2ivlc.mpg
238
do_video_encoding "-qscale 10" "-vcodec mpeg2video -f mpeg1video -flags2 +ivlc"
239 240

# mpeg2 decoding
241
do_video_decoding
242

M
Michael Niedermayer 已提交
243 244
# mpeg2 encoding
file=${outfile}mpeg2.mpg
245
do_video_encoding "-qscale 10" "-vcodec mpeg2video -idct int -dct int -f mpeg1video"
M
Michael Niedermayer 已提交
246 247

# mpeg2 decoding
248
do_ffmpeg $raw_dst -y -idct int -i $file -f rawvideo $raw_dst
M
Michael Niedermayer 已提交
249

250 251
# mpeg2 encoding interlaced
file=${outfile}mpeg2i.mpg
252
do_video_encoding "-qscale 10" "-vcodec mpeg2video -f mpeg1video -flags +ildct+ilme"
253 254

# mpeg2 decoding
255
do_video_decoding
256 257
fi

258 259 260 261
###################################
if [ -n "$do_mpeg2thread" ] ; then
# mpeg2 encoding interlaced
file=${outfile}mpeg2thread.mpg
262
do_video_encoding "-qscale 10" "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 2"
263 264

# mpeg2 decoding
265
do_video_decoding
266 267 268

# mpeg2 encoding interlaced using intra vlc
file=${outfile}mpeg2threadivlc.mpg
269
do_video_encoding "-qscale 10" "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -flags2 +ivlc -threads 2"
270

M
Michael Niedermayer 已提交
271
# mpeg2 decoding
272
do_video_decoding
M
Michael Niedermayer 已提交
273 274 275

# mpeg2 encoding interlaced
file=${outfile}mpeg2reuse.mpg
276
do_ffmpeg $file -y -sameq -me_threshold 256 -mb_threshold 1024 -i ${outfile}mpeg2thread.mpg -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 4 $file
M
Michael Niedermayer 已提交
277

278
# mpeg2 decoding
279
do_video_decoding
280 281
fi

282 283 284 285
###################################
if [ -n "$do_msmpeg4v2" ] ; then
# msmpeg4 encoding
file=${outfile}msmpeg4v2.avi
286
do_video_encoding "-qscale 10" "-an -vcodec msmpeg4v2"
287 288

# msmpeg4v2 decoding
289
do_video_decoding
290 291
fi

292 293 294 295
###################################
if [ -n "$do_msmpeg4" ] ; then
# msmpeg4 encoding
file=${outfile}msmpeg4.avi
296
do_video_encoding "-qscale 10" "-an -vcodec msmpeg4"
297 298

# msmpeg4 decoding
299
do_video_decoding
300 301
fi

302 303 304 305
###################################
if [ -n "$do_wmv1" ] ; then
# wmv1 encoding
file=${outfile}wmv1.avi
306
do_video_encoding "-qscale 10" "-an -vcodec wmv1"
307 308

# wmv1 decoding
309
do_video_decoding
310 311
fi

312 313 314 315
###################################
if [ -n "$do_wmv2" ] ; then
# wmv2 encoding
file=${outfile}wmv2.avi
316
do_video_encoding "-qscale 10" "-an -vcodec wmv2"
317 318

# wmv2 decoding
319
do_video_decoding
320 321
fi

M
Michael Niedermayer 已提交
322 323 324 325
###################################
if [ -n "$do_h261" ] ; then
# h261 encoding
file=${outfile}h261.avi
326
do_video_encoding "-qscale 11" "-s 352x288 -an -vcodec h261"
M
Michael Niedermayer 已提交
327 328

# h261 decoding
329
do_video_decoding
M
Michael Niedermayer 已提交
330 331
fi

332 333 334 335
###################################
if [ -n "$do_h263" ] ; then
# h263 encoding
file=${outfile}h263.avi
336
do_video_encoding "-qscale 10" "-s 352x288 -an -vcodec h263"
337

M
Michael Niedermayer 已提交
338
# h263 decoding
339
do_video_decoding
M
Michael Niedermayer 已提交
340 341 342 343 344 345
fi

###################################
if [ -n "$do_h263p" ] ; then
# h263p encoding
file=${outfile}h263p.avi
346
do_video_encoding "-qscale 2 -flags +umv+aiv+aic" "-s 352x288 -an -vcodec h263p -ps 300"
M
Michael Niedermayer 已提交
347

348
# h263p decoding
349
do_video_decoding
350 351 352 353 354
fi

###################################
if [ -n "$do_mpeg4" ] ; then
# mpeg4
355
file=${outfile}odivx.mp4
356
do_video_encoding "-flags +mv4 -mbd bits -qscale 10" "-an -vcodec mpeg4"
357 358

# mpeg4 decoding
359
do_video_decoding
360 361
fi

362 363 364 365
###################################
if [ -n "$do_huffyuv" ] ; then
# huffyuv
file=${outfile}huffyuv.avi
366
do_video_encoding "" "-an -vcodec huffyuv -pix_fmt yuv422p"
367 368

# huffyuv decoding
369
do_video_decoding -strict -2 -pix_fmt yuv420p
370 371
fi

372 373 374 375
###################################
if [ -n "$do_rc" ] ; then
# mpeg4 rate control
file=${outfile}mpeg4-rc.avi
376
do_video_encoding "-b 400k -bf 2" "-an -vcodec mpeg4"
377 378

# mpeg4 rate control decoding
379
do_video_decoding
380 381 382 383 384 385
fi

###################################
if [ -n "$do_mpeg4adv" ] ; then
# mpeg4
file=${outfile}mpeg4-adv.avi
386
do_video_encoding "-qscale 9 -flags +mv4+part+aic+trell -mbd bits -ps 200" "-an -vcodec mpeg4"
387 388

# mpeg4 decoding
389
do_video_decoding
390 391
fi

392 393 394 395
###################################
if [ -n "$do_mpeg4thread" ] ; then
# mpeg4
file=${outfile}mpeg4-thread.avi
396
do_video_encoding "-b 500k -flags +mv4+part+aic+trell -mbd bits -ps 200 -bf 2" "-an -vcodec mpeg4 -threads 2"
397 398

# mpeg4 decoding
399
do_video_decoding
400 401 402 403 404 405
fi

###################################
if [ -n "$do_mpeg4adv" ] ; then
# mpeg4
file=${outfile}mpeg4-Q.avi
406
do_video_encoding "-qscale 7 -flags +mv4+qpel -mbd 2 -bf 2 -cmp 1 -subcmp 2" "-an -vcodec mpeg4"
407 408

# mpeg4 decoding
409
do_video_decoding
410 411
fi

412 413 414 415
###################################
if [ -n "$do_mp4psp" ] ; then
# mp4 PSP style
file=${outfile}mpeg4-PSP.mp4
416
do_ffmpeg $file -y -b 768k -s 320x240 -f psp -ar 24000 -ab 32 -i $raw_src $file
417 418
fi

419 420 421 422
###################################
if [ -n "$do_error" ] ; then
# damaged mpeg4
file=${outfile}error-mpeg4-adv.avi
423
do_video_encoding "-qscale 7 -flags +mv4+part+aic -mbd rd -ps 250 -error 10" "-an -vcodec mpeg4"
424 425

# damaged mpeg4 decoding
426
do_video_decoding
427 428
fi

429 430 431
###################################
if [ -n "$do_mpeg4nr" ] ; then
# noise reduction
432
file=${outfile}mpeg4-nr.avi
433
do_video_encoding "-qscale 8 -flags +mv4 -mbd rd -nr 200" "-an -vcodec mpeg4"
434 435

# mpeg4 decoding
436
do_video_decoding
437 438
fi

439 440 441 442
###################################
if [ -n "$do_mpeg1b" ] ; then
# mpeg1
file=${outfile}mpeg1b.mpg
443
do_video_encoding "-qscale 8 -bf 3 -ps 200" "-an -vcodec mpeg1video -f mpeg1video"
444 445

# mpeg1 decoding
446
do_video_decoding
447 448
fi

449 450 451 452
###################################
if [ -n "$do_mjpeg" ] ; then
# mjpeg
file=${outfile}mjpeg.avi
453
do_video_encoding "-qscale 10" "-an -vcodec mjpeg -pix_fmt yuvj420p"
454 455

# mjpeg decoding
456
do_video_decoding -pix_fmt yuv420p
457 458 459
fi

###################################
460 461 462
if [ -n "$do_ljpeg" ] ; then
# ljpeg
file=${outfile}ljpeg.avi
463
do_video_encoding "" "-an -vcodec ljpeg -strict -1"
464 465

# ljpeg decoding
466
do_video_decoding
467 468
fi

M
Michael Niedermayer 已提交
469 470 471 472
###################################
if [ -n "$do_jpegls" ] ; then
# jpeg ls
file=${outfile}jpegls.avi
473
do_video_encoding "" "-an -vcodec jpegls -vtag MJPG"
M
Michael Niedermayer 已提交
474 475

# jpeg ls decoding
476
do_video_decoding -pix_fmt yuv420p
M
Michael Niedermayer 已提交
477 478
fi

479
###################################
480 481 482
if [ -n "$do_rv10" ] ; then
# rv10 encoding
file=${outfile}rv10.rm
483
do_video_encoding "-qscale 10" "-an"
484 485

# rv10 decoding
486
do_video_decoding
487 488
fi

M
Michael Niedermayer 已提交
489 490 491 492
###################################
if [ -n "$do_rv20" ] ; then
# rv20 encoding
file=${outfile}rv20.rm
493
do_video_encoding "-qscale 10" "-vcodec rv20 -an"
M
Michael Niedermayer 已提交
494 495

# rv20 decoding
496
do_video_decoding
M
Michael Niedermayer 已提交
497 498
fi

M
Michael Niedermayer 已提交
499 500 501 502
###################################
if [ -n "$do_asv1" ] ; then
# asv1 encoding
file=${outfile}asv1.avi
503
do_video_encoding "-qscale 10" "-an -vcodec asv1"
M
Michael Niedermayer 已提交
504 505

# asv1 decoding
506
do_video_decoding
M
Michael Niedermayer 已提交
507 508
fi

M
Michael Niedermayer 已提交
509 510 511 512
###################################
if [ -n "$do_asv2" ] ; then
# asv2 encoding
file=${outfile}asv2.avi
513
do_video_encoding "-qscale 10" "-an -vcodec asv2"
M
Michael Niedermayer 已提交
514 515

# asv2 decoding
516
do_video_decoding
M
Michael Niedermayer 已提交
517 518
fi

M
Michael Niedermayer 已提交
519 520 521 522
###################################
if [ -n "$do_flv" ] ; then
# flv encoding
file=${outfile}flv.flv
523
do_video_encoding "-qscale 10" "-an -vcodec flv"
M
Michael Niedermayer 已提交
524 525

# flv decoding
526
do_video_decoding
M
Michael Niedermayer 已提交
527 528
fi

M
Michael Niedermayer 已提交
529 530 531 532
###################################
if [ -n "$do_ffv1" ] ; then
# ffv1 encoding
file=${outfile}ffv1.avi
533
do_video_encoding "-strict -2" "-an -vcodec ffv1"
M
Michael Niedermayer 已提交
534 535

# ffv1 decoding
536
do_video_decoding
M
Michael Niedermayer 已提交
537 538 539 540 541 542
fi

###################################
if [ -n "$do_snow" ] ; then
# snow encoding
file=${outfile}snow.avi
543
do_video_encoding "-strict -2" "-an -vcodec snow -qscale 2 -flags +qpel -me iter -dia_size 2 -cmp 12 -subcmp 12 -s 128x64"
M
Michael Niedermayer 已提交
544 545

# snow decoding
546
do_video_decoding -s 352x288
M
Michael Niedermayer 已提交
547
fi
M
Michael Niedermayer 已提交
548

M
Michael Niedermayer 已提交
549 550
###################################
if [ -n "$do_snowll" ] ; then
M
Michael Niedermayer 已提交
551 552
# snow encoding
file=${outfile}snow53.avi
553
do_video_encoding "-strict -2" "-an -vcodec snow -qscale .001 -pred 1 -flags +mv4+qpel"
M
Michael Niedermayer 已提交
554 555

# snow decoding
556
do_video_decoding
M
Michael Niedermayer 已提交
557 558
fi

M
Michael Niedermayer 已提交
559 560 561 562
###################################
if [ -n "$do_dv" ] ; then
# dv encoding
file=${outfile}dv.dv
563
do_video_encoding "-dct int" "-s pal -an"
M
Michael Niedermayer 已提交
564 565

# dv decoding
566
do_video_decoding -s cif
M
Michael Niedermayer 已提交
567 568
fi

D
Daniel Maas 已提交
569 570 571 572
###################################
if [ -n "$do_dv50" ] ; then
# dv50 encoding
file=${outfile}dv.dv
573
do_video_encoding "-dct int" "-s pal -pix_fmt yuv422p -an"
D
Daniel Maas 已提交
574 575

# dv50 decoding
576
do_video_decoding -s cif -pix_fmt yuv420p
D
Daniel Maas 已提交
577 578 579
fi


M
Michael Niedermayer 已提交
580 581 582 583
###################################
if [ -n "$do_svq1" ] ; then
# svq1 encoding
file=${outfile}svq1.mov
584
do_video_encoding "" "-an -vcodec svq1 -qscale 3 -pix_fmt yuv410p"
M
Michael Niedermayer 已提交
585 586

# svq1 decoding
587
do_video_decoding -pix_fmt yuv420p
M
Michael Niedermayer 已提交
588 589
fi

590 591 592
###################################
if [ -n "$do_mp2" ] ; then
# mp2 encoding
593
do_audio_encoding mp2.mp2 "-ar 44100"
594 595

# mp2 decoding
596
do_audio_decoding
597
$tiny_psnr $pcm_dst $pcm_ref 2 1924 >> $logfile
598 599 600 601 602
fi

###################################
if [ -n "$do_ac3" ] ; then
# ac3 encoding
603
do_audio_encoding ac3.rm "" -vn
604 605

# ac3 decoding
606
#do_audio_decoding
607 608
fi

M
Michael Niedermayer 已提交
609 610 611
###################################
if [ -n "$do_g726" ] ; then
# g726 encoding
612
do_audio_encoding g726.wav "-ar 44100" "-ab 32 -ac 1 -ar 8000 -acodec g726"
M
Michael Niedermayer 已提交
613 614

# g726 decoding
615
do_audio_decoding
M
Michael Niedermayer 已提交
616 617
fi

618 619 620
###################################
if [ -n "$do_adpcm_ima_wav" ] ; then
# encoding
621
do_audio_encoding adpcm_ima.wav "-ar 44100" "-acodec adpcm_ima_wav"
622 623

# decoding
624
do_audio_decoding
625 626 627 628 629
fi

###################################
if [ -n "$do_adpcm_ms" ] ; then
# encoding
630
do_audio_encoding adpcm_ms.wav "-ar 44100" "-acodec adpcm_ms"
631 632

# decoding
633
do_audio_decoding
634 635
fi

636 637 638
###################################
if [ -n "$do_adpcm_yam" ] ; then
# encoding
639
do_audio_encoding adpcm_yam.wav "-ar 44100" "-acodec adpcm_yamaha"
640 641

# decoding
642
do_audio_decoding
643 644
fi

M
Michael Niedermayer 已提交
645 646 647
###################################
if [ -n "$do_flac" ] ; then
# encoding
648
do_audio_encoding flac.flac "-ar 44100" "-acodec flac -compression_level 2"
M
Michael Niedermayer 已提交
649 650

# decoding
651
do_audio_decoding
M
Michael Niedermayer 已提交
652 653
fi

F
Fabrice Bellard 已提交
654 655 656 657 658 659 660
###################################
# libav testing
###################################

if [ -n "$do_libav" ] ; then

# avi
D
Diego Biurrun 已提交
661
do_libav avi
F
Fabrice Bellard 已提交
662 663

# asf
D
Diego Biurrun 已提交
664
do_libav asf "-acodec mp2" "-r 25"
F
Fabrice Bellard 已提交
665 666 667 668 669 670 671 672

# rm
file=${outfile}libav.rm
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
# broken
#do_ffmpeg_crc $file -i $file

# mpegps
D
Diego Biurrun 已提交
673
do_libav mpg
F
Fabrice Bellard 已提交
674

M
Michael Niedermayer 已提交
675
# mpegts
D
Diego Biurrun 已提交
676
do_libav ts
M
Michael Niedermayer 已提交
677

F
Fabrice Bellard 已提交
678
# swf (decode audio only)
D
Diego Biurrun 已提交
679
do_libav swf "-acodec mp2"
F
Fabrice Bellard 已提交
680 681

# ffm
D
Diego Biurrun 已提交
682
do_libav ffm
F
Fabrice Bellard 已提交
683

M
Michael Niedermayer 已提交
684
# flv
D
Diego Biurrun 已提交
685
do_libav flv -an
M
Michael Niedermayer 已提交
686

M
Michael Niedermayer 已提交
687
# mov
D
Diego Biurrun 已提交
688
do_libav mov "-acodec pcm_alaw"
M
Michael Niedermayer 已提交
689 690

# nut
D
Diego Biurrun 已提交
691
#do_libav nut "-acodec mp2"
M
Michael Niedermayer 已提交
692

M
Michael Niedermayer 已提交
693
# dv
D
Diego Biurrun 已提交
694
do_libav dv "-ar 48000 -r 25 -s pal -ac 2"
M
Michael Niedermayer 已提交
695

B
Baptiste Coudurier 已提交
696
# gxf
D
Diego Biurrun 已提交
697
do_libav gxf "-ar 48000 -r 25 -s pal -ac 1"
B
Baptiste Coudurier 已提交
698

F
Fabrice Bellard 已提交
699 700 701
####################
# streamed images
# mjpeg
702 703 704
#file=${outfile}libav.mjpeg
#do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
#do_ffmpeg_crc $file -i $file
F
Fabrice Bellard 已提交
705

F
Fabrice Bellard 已提交
706
# pbmpipe
707
do_streamed_images pbm
F
Fabrice Bellard 已提交
708

F
Fabrice Bellard 已提交
709
# pgmpipe
710
do_streamed_images pgm
F
Fabrice Bellard 已提交
711 712

# ppmpipe
713
do_streamed_images ppm
F
Fabrice Bellard 已提交
714 715 716

# gif
file=${outfile}libav.gif
717
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -pix_fmt rgb24 $file
F
Fabrice Bellard 已提交
718 719 720
#do_ffmpeg_crc $file -i $file

# yuv4mpeg
721
file=${outfile}libav.y4m
F
Fabrice Bellard 已提交
722 723
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
#do_ffmpeg_crc $file -i $file
F
Fabrice Bellard 已提交
724 725 726 727

####################
# image formats
# pgm (we do not do md5 on image files yet)
D
Diego Biurrun 已提交
728
do_image_formats pgm
F
Fabrice Bellard 已提交
729 730

# ppm (we do not do md5 on image files yet)
D
Diego Biurrun 已提交
731
do_image_formats ppm
F
Fabrice Bellard 已提交
732

733
# jpeg (we do not do md5 on image files yet)
D
Diego Biurrun 已提交
734
do_image_formats jpg "-flags +bitexact -dct fastint -idct simple -pix_fmt yuvj420p" "-f image2"
735

F
Fabrice Bellard 已提交
736 737 738 739
####################
# audio only

# wav
740
do_audio_only wav
F
Fabrice Bellard 已提交
741 742

# alaw
743
do_audio_only al
F
Fabrice Bellard 已提交
744 745

# mulaw
746
do_audio_only ul
F
Fabrice Bellard 已提交
747 748

# au
749
do_audio_only au
F
Fabrice Bellard 已提交
750

751
# mmf
752
do_audio_only mmf
753

754
# aiff
755
do_audio_only aif
756

A
Aurelien Jacobs 已提交
757
# voc
758
do_audio_only voc
A
Aurelien Jacobs 已提交
759

760 761 762 763
####################
# pix_fmt conversions
conversions="yuv420p yuv422p yuv444p yuv422 yuv410p yuv411p yuvj420p \
             yuvj422p yuvj444p rgb24 bgr24 rgba32 rgb565 rgb555 gray monow \
764
             monob pal8"
765 766 767 768 769 770 771 772
for pix_fmt in $conversions ; do
    file=${outfile}libav-${pix_fmt}.yuv
    do_ffmpeg_nocheck $file -r 1 -t 1 -y -f pgmyuv -i $raw_src \
                            -f rawvideo -s 352x288 -pix_fmt $pix_fmt $raw_dst
    do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $raw_dst \
                    -f rawvideo -s 352x288 -pix_fmt yuv444p $file
done

F
Fabrice Bellard 已提交
773 774 775
fi


776

M
Michael Niedermayer 已提交
777
if $diff_cmd "$logfile" "$reffile" ; then
778
    echo
779 780 781
    echo Regression test succeeded.
    exit 0
else
782
    echo
783 784 785
    echo Regression test: Error.
    exit 1
fi