regression.sh 15.8 KB
Newer Older
1 2 3 4 5 6
#!/bin/sh
#
# automatic regression test for ffmpeg
#
#
#set -x
D
Diego Biurrun 已提交
7
# Even in the 21st century some diffs do not support -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

D
Diego Biurrun 已提交
27
# tests to run
28 29 30 31
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 97
bench="$datadir/bench.tmp"
bench2="$datadir/bench2.tmp"
98
raw_src="$3/%02d.pgm"
F
Fabrice Bellard 已提交
99
raw_dst="$datadir/out.yuv"
100
raw_ref="$datadir/ref.yuv"
101
pcm_src="asynth1.sw"
F
Fabrice Bellard 已提交
102
pcm_dst="$datadir/out.wav"
103
pcm_ref="$datadir/ref.wav"
104 105 106 107 108 109 110
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 已提交
111

D
Diego Biurrun 已提交
112
# create the data directory if it does not exist
F
Fabrice Bellard 已提交
113
mkdir -p $datadir
114

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

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

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

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

160 161
do_video_decoding()
{
162
    do_ffmpeg $raw_dst -y $1 -i $file -f rawvideo $2 $raw_dst
163 164 165 166
}

do_video_encoding()
{
167
    file=${outfile}$1
168
    do_ffmpeg $file -y $2 -f $3 -i $raw_src $4 $file
169 170
}

171 172 173 174 175 176 177 178 179 180 181
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 已提交
182 183 184 185 186 187 188 189
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

}

190 191 192 193 194 195 196
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 已提交
197 198 199 200 201 202 203 204
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

}

205 206 207 208 209 210 211
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
}

212 213 214
echo "ffmpeg regression test" > $logfile
echo "ffmpeg benchmarks" > $benchfile

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

220 221
###################################
if [ -n "$do_mpeg" ] ; then
D
Diego Biurrun 已提交
222
# mpeg1
223
do_video_encoding mpeg1.mpg "-qscale 10" pgmyuv "-f mpeg1video"
224
do_video_decoding
M
Michael Niedermayer 已提交
225 226 227 228
fi

###################################
if [ -n "$do_mpeg2" ] ; then
D
Diego Biurrun 已提交
229
# mpeg2
230
do_video_encoding mpeg2.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video"
231
do_video_decoding
232

233 234
# mpeg2 encoding intra vlc qprd
do_video_encoding mpeg2ivlc-qprd.mpg "-b 500k -bf 2 -flags +trell+qprd+mv0 -flags2 +ivlc -cmp 2 -subcmp 2 -mbd rd" pgmyuv "-vcodec mpeg2video -f mpeg2video"
235 236

# mpeg2 decoding
237
do_video_decoding
238

D
Diego Biurrun 已提交
239
# mpeg2
240
do_video_encoding mpeg2.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -idct int -dct int -f mpeg1video"
241
do_video_decoding "-idct int"
M
Michael Niedermayer 已提交
242

243
# mpeg2 encoding interlaced
244
do_video_encoding mpeg2i.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video -flags +ildct+ilme"
245 246

# mpeg2 decoding
247
do_video_decoding
248 249
fi

250 251 252
###################################
if [ -n "$do_mpeg2thread" ] ; then
# mpeg2 encoding interlaced
253
do_video_encoding mpeg2thread.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 2"
254 255

# mpeg2 decoding
256
do_video_decoding
257 258

# mpeg2 encoding interlaced using intra vlc
259
do_video_encoding mpeg2threadivlc.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -flags2 +ivlc -threads 2"
260

M
Michael Niedermayer 已提交
261
# mpeg2 decoding
262
do_video_decoding
M
Michael Niedermayer 已提交
263 264 265

# mpeg2 encoding interlaced
file=${outfile}mpeg2reuse.mpg
266
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 已提交
267

268
# mpeg2 decoding
269
do_video_decoding
270 271
fi

272 273
###################################
if [ -n "$do_msmpeg4v2" ] ; then
D
Diego Biurrun 已提交
274
# msmpeg4
275
do_video_encoding msmpeg4v2.avi "-qscale 10" pgmyuv "-an -vcodec msmpeg4v2"
276
do_video_decoding
277 278
fi

279 280
###################################
if [ -n "$do_msmpeg4" ] ; then
D
Diego Biurrun 已提交
281
# msmpeg4
282
do_video_encoding msmpeg4.avi "-qscale 10" pgmyuv "-an -vcodec msmpeg4"
283
do_video_decoding
284 285
fi

286 287
###################################
if [ -n "$do_wmv1" ] ; then
D
Diego Biurrun 已提交
288
# wmv1
289
do_video_encoding wmv1.avi "-qscale 10" pgmyuv "-an -vcodec wmv1"
290
do_video_decoding
291 292
fi

293 294
###################################
if [ -n "$do_wmv2" ] ; then
D
Diego Biurrun 已提交
295
# wmv2
296
do_video_encoding wmv2.avi "-qscale 10" pgmyuv "-an -vcodec wmv2"
297
do_video_decoding
298 299
fi

M
Michael Niedermayer 已提交
300 301
###################################
if [ -n "$do_h261" ] ; then
D
Diego Biurrun 已提交
302
# h261
303
do_video_encoding h261.avi "-qscale 11" pgmyuv "-s 352x288 -an -vcodec h261"
304
do_video_decoding
M
Michael Niedermayer 已提交
305 306
fi

307 308
###################################
if [ -n "$do_h263" ] ; then
D
Diego Biurrun 已提交
309
# h263
310
do_video_encoding h263.avi "-qscale 10" pgmyuv "-s 352x288 -an -vcodec h263"
311
do_video_decoding
M
Michael Niedermayer 已提交
312 313 314 315
fi

###################################
if [ -n "$do_h263p" ] ; then
D
Diego Biurrun 已提交
316
# h263p
317
do_video_encoding h263p.avi "-qscale 2 -flags +umv+aiv+aic" pgmyuv "-s 352x288 -an -vcodec h263p -ps 300"
318
do_video_decoding
319 320 321 322 323
fi

###################################
if [ -n "$do_mpeg4" ] ; then
# mpeg4
D
Diego Biurrun 已提交
324 325
do_video_encoding odivx.mp4 "-flags +mv4 -mbd bits -qscale 10" pgmyuv "-an -vcodec mpeg4" + decoding

326 327 328

fi

329 330 331
###################################
if [ -n "$do_huffyuv" ] ; then
# huffyuv
332
do_video_encoding huffyuv.avi "" pgmyuv "-an -vcodec huffyuv -pix_fmt yuv422p"
333
do_video_decoding "" "-strict -2 -pix_fmt yuv420p"
334 335
fi

336 337 338
###################################
if [ -n "$do_rc" ] ; then
# mpeg4 rate control
D
Diego Biurrun 已提交
339 340
do_video_encoding mpeg4-rc.avi "-b 400k -bf 2" pgmyuv "-an -vcodec mpeg4" + decoding

341 342 343 344 345 346

fi

###################################
if [ -n "$do_mpeg4adv" ] ; then
# mpeg4
347
do_video_encoding mpeg4-adv.avi "-qscale 9 -flags +mv4+part+aic+trell -mbd bits -ps 200" pgmyuv "-an -vcodec mpeg4"
348 349 350 351 352 353 354 355
do_video_decoding

# mpeg4
do_video_encoding mpeg4-qprd.avi "-b 450k -bf 2 -flags +mv4+trell+qprd+mv0 -cmp 2 -subcmp 2 -mbd rd" pgmyuv "-an -vcodec mpeg4"
do_video_decoding

# mpeg4
do_video_encoding mpeg4-adap.avi "-b 550k -bf 2 -flags +mv4+trell+mv0 -cmp 1 -subcmp 2 -mbd rd -scplx_mask 0.3" pgmyuv "-an -vcodec mpeg4"
356
do_video_decoding
357 358
fi

359 360 361
###################################
if [ -n "$do_mpeg4thread" ] ; then
# mpeg4
362
do_video_encoding mpeg4-thread.avi "-b 500k -flags +mv4+part+aic+trell -mbd bits -ps 200 -bf 2" pgmyuv "-an -vcodec mpeg4 -threads 2"
363
do_video_decoding
364 365 366 367 368
fi

###################################
if [ -n "$do_mpeg4adv" ] ; then
# mpeg4
369
do_video_encoding mpeg4-Q.avi "-qscale 7 -flags +mv4+qpel -mbd 2 -bf 2 -cmp 1 -subcmp 2" pgmyuv "-an -vcodec mpeg4"
370
do_video_decoding
371 372
fi

373 374 375
###################################
if [ -n "$do_mp4psp" ] ; then
# mp4 PSP style
376
do_video_encoding mpeg4-PSP.mp4 "-b 768k -s 320x240" psp "-ar 24000 -ab 32 -i $raw_src"
377 378
fi

379 380 381
###################################
if [ -n "$do_error" ] ; then
# damaged mpeg4
382
do_video_encoding error-mpeg4-adv.avi "-qscale 7 -flags +mv4+part+aic -mbd rd -ps 250 -error 10" pgmyuv "-an -vcodec mpeg4"
383
do_video_decoding
384 385
fi

386 387 388
###################################
if [ -n "$do_mpeg4nr" ] ; then
# noise reduction
389
do_video_encoding mpeg4-nr.avi "-qscale 8 -flags +mv4 -mbd rd -nr 200" pgmyuv "-an -vcodec mpeg4"
390
do_video_decoding
391 392
fi

393 394 395
###################################
if [ -n "$do_mpeg1b" ] ; then
# mpeg1
396
do_video_encoding mpeg1b.mpg "-qscale 8 -bf 3 -ps 200" pgmyuv "-an -vcodec mpeg1video -f mpeg1video"
397
do_video_decoding
398 399
fi

400 401 402
###################################
if [ -n "$do_mjpeg" ] ; then
# mjpeg
403
do_video_encoding mjpeg.avi "-qscale 10" pgmyuv "-an -vcodec mjpeg -pix_fmt yuvj420p"
404
do_video_decoding "" "-pix_fmt yuv420p"
405 406 407
fi

###################################
408 409
if [ -n "$do_ljpeg" ] ; then
# ljpeg
410
do_video_encoding ljpeg.avi "" pgmyuv "-an -vcodec ljpeg -strict -1"
411
do_video_decoding
412 413
fi

M
Michael Niedermayer 已提交
414 415 416
###################################
if [ -n "$do_jpegls" ] ; then
# jpeg ls
417
do_video_encoding jpegls.avi "" pgmyuv "-an -vcodec jpegls -vtag MJPG"
418
do_video_decoding "" "-pix_fmt yuv420p"
M
Michael Niedermayer 已提交
419 420
fi

421
###################################
422 423
if [ -n "$do_rv10" ] ; then
# rv10 encoding
424
do_video_encoding rv10.rm "-qscale 10" pgmyuv "-an"
425
do_video_decoding
426 427
fi

M
Michael Niedermayer 已提交
428 429 430
###################################
if [ -n "$do_rv20" ] ; then
# rv20 encoding
431
do_video_encoding rv20.rm "-qscale 10" pgmyuv "-vcodec rv20 -an"
432
do_video_decoding
M
Michael Niedermayer 已提交
433 434
fi

M
Michael Niedermayer 已提交
435 436 437
###################################
if [ -n "$do_asv1" ] ; then
# asv1 encoding
438
do_video_encoding asv1.avi "-qscale 10" pgmyuv "-an -vcodec asv1"
439
do_video_decoding
M
Michael Niedermayer 已提交
440 441
fi

M
Michael Niedermayer 已提交
442 443 444
###################################
if [ -n "$do_asv2" ] ; then
# asv2 encoding
445
do_video_encoding asv2.avi "-qscale 10" pgmyuv "-an -vcodec asv2"
446
do_video_decoding
M
Michael Niedermayer 已提交
447 448
fi

M
Michael Niedermayer 已提交
449 450 451
###################################
if [ -n "$do_flv" ] ; then
# flv encoding
452
do_video_encoding flv.flv "-qscale 10" pgmyuv "-an -vcodec flv"
453
do_video_decoding
M
Michael Niedermayer 已提交
454 455
fi

M
Michael Niedermayer 已提交
456 457 458
###################################
if [ -n "$do_ffv1" ] ; then
# ffv1 encoding
459
do_video_encoding ffv1.avi "-strict -2" pgmyuv "-an -vcodec ffv1"
460
do_video_decoding
M
Michael Niedermayer 已提交
461 462 463 464
fi

###################################
if [ -n "$do_snow" ] ; then
D
Diego Biurrun 已提交
465
# snow
466
do_video_encoding snow.avi "-strict -2" pgmyuv "-an -vcodec snow -qscale 2 -flags +qpel -me iter -dia_size 2 -cmp 12 -subcmp 12 -s 128x64"
467
do_video_decoding "" "-s 352x288"
M
Michael Niedermayer 已提交
468
fi
M
Michael Niedermayer 已提交
469

M
Michael Niedermayer 已提交
470 471
###################################
if [ -n "$do_snowll" ] ; then
D
Diego Biurrun 已提交
472
# snow
473
do_video_encoding snow53.avi "-strict -2" pgmyuv "-an -vcodec snow -qscale .001 -pred 1 -flags +mv4+qpel"
474
do_video_decoding
M
Michael Niedermayer 已提交
475 476
fi

M
Michael Niedermayer 已提交
477 478
###################################
if [ -n "$do_dv" ] ; then
D
Diego Biurrun 已提交
479
# dv
480
do_video_encoding dv.dv "-dct int" pgmyuv "-s pal -an"
481
do_video_decoding "" "-s cif"
M
Michael Niedermayer 已提交
482 483
fi

D
Daniel Maas 已提交
484 485
###################################
if [ -n "$do_dv50" ] ; then
D
Diego Biurrun 已提交
486
# dv50
487
do_video_encoding dv.dv "-dct int" pgmyuv "-s pal -pix_fmt yuv422p -an"
488
do_video_decoding "" "-s cif -pix_fmt yuv420p"
D
Daniel Maas 已提交
489 490 491
fi


M
Michael Niedermayer 已提交
492 493
###################################
if [ -n "$do_svq1" ] ; then
D
Diego Biurrun 已提交
494
# svq1
495
do_video_encoding svq1.mov "" pgmyuv "-an -vcodec svq1 -qscale 3 -pix_fmt yuv410p"
496
do_video_decoding "" "-pix_fmt yuv420p"
M
Michael Niedermayer 已提交
497 498
fi

499 500
###################################
if [ -n "$do_mp2" ] ; then
D
Diego Biurrun 已提交
501
# mp2
502 503
do_audio_encoding mp2.mp2 "-ar 44100"
do_audio_decoding
504
$tiny_psnr $pcm_dst $pcm_ref 2 1924 >> $logfile
505 506 507 508
fi

###################################
if [ -n "$do_ac3" ] ; then
D
Diego Biurrun 已提交
509
# ac3
510 511
do_audio_encoding ac3.rm "" -vn
#do_audio_decoding
512 513
fi

M
Michael Niedermayer 已提交
514 515
###################################
if [ -n "$do_g726" ] ; then
D
Diego Biurrun 已提交
516
# g726
517 518
do_audio_encoding g726.wav "-ar 44100" "-ab 32 -ac 1 -ar 8000 -acodec g726"
do_audio_decoding
M
Michael Niedermayer 已提交
519 520
fi

521 522
###################################
if [ -n "$do_adpcm_ima_wav" ] ; then
D
Diego Biurrun 已提交
523
# adpcm ima
524 525
do_audio_encoding adpcm_ima.wav "-ar 44100" "-acodec adpcm_ima_wav"
do_audio_decoding
526 527 528 529
fi

###################################
if [ -n "$do_adpcm_ms" ] ; then
D
Diego Biurrun 已提交
530
# adpcm ms
531 532
do_audio_encoding adpcm_ms.wav "-ar 44100" "-acodec adpcm_ms"
do_audio_decoding
533 534
fi

535 536
###################################
if [ -n "$do_adpcm_yam" ] ; then
D
Diego Biurrun 已提交
537
# adpcm yamaha
538 539
do_audio_encoding adpcm_yam.wav "-ar 44100" "-acodec adpcm_yamaha"
do_audio_decoding
540 541
fi

M
Michael Niedermayer 已提交
542 543
###################################
if [ -n "$do_flac" ] ; then
D
Diego Biurrun 已提交
544
# flac
545 546
do_audio_encoding flac.flac "-ar 44100" "-acodec flac -compression_level 2"
do_audio_decoding
M
Michael Niedermayer 已提交
547 548
fi

F
Fabrice Bellard 已提交
549 550 551 552 553 554 555
###################################
# libav testing
###################################

if [ -n "$do_libav" ] ; then

# avi
D
Diego Biurrun 已提交
556
do_libav avi
F
Fabrice Bellard 已提交
557 558

# asf
D
Diego Biurrun 已提交
559
do_libav asf "-acodec mp2" "-r 25"
F
Fabrice Bellard 已提交
560 561 562 563 564 565 566 567

# 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 已提交
568
do_libav mpg
F
Fabrice Bellard 已提交
569

M
Michael Niedermayer 已提交
570
# mpegts
D
Diego Biurrun 已提交
571
do_libav ts
M
Michael Niedermayer 已提交
572

573 574
# swf
do_libav swf -an
F
Fabrice Bellard 已提交
575 576

# ffm
D
Diego Biurrun 已提交
577
do_libav ffm
F
Fabrice Bellard 已提交
578

M
Michael Niedermayer 已提交
579
# flv
D
Diego Biurrun 已提交
580
do_libav flv -an
M
Michael Niedermayer 已提交
581

M
Michael Niedermayer 已提交
582
# mov
D
Diego Biurrun 已提交
583
do_libav mov "-acodec pcm_alaw"
M
Michael Niedermayer 已提交
584 585

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

M
Michael Niedermayer 已提交
588
# dv
D
Diego Biurrun 已提交
589
do_libav dv "-ar 48000 -r 25 -s pal -ac 2"
M
Michael Niedermayer 已提交
590

B
Baptiste Coudurier 已提交
591
# gxf
D
Diego Biurrun 已提交
592
do_libav gxf "-ar 48000 -r 25 -s pal -ac 1"
B
Baptiste Coudurier 已提交
593

F
Fabrice Bellard 已提交
594 595 596
####################
# streamed images
# mjpeg
597 598 599
#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 已提交
600

F
Fabrice Bellard 已提交
601
# pbmpipe
602
do_streamed_images pbm
F
Fabrice Bellard 已提交
603

F
Fabrice Bellard 已提交
604
# pgmpipe
605
do_streamed_images pgm
F
Fabrice Bellard 已提交
606 607

# ppmpipe
608
do_streamed_images ppm
F
Fabrice Bellard 已提交
609 610 611

# gif
file=${outfile}libav.gif
612
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -pix_fmt rgb24 $file
F
Fabrice Bellard 已提交
613 614 615
#do_ffmpeg_crc $file -i $file

# yuv4mpeg
616
file=${outfile}libav.y4m
F
Fabrice Bellard 已提交
617 618
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
#do_ffmpeg_crc $file -i $file
F
Fabrice Bellard 已提交
619 620 621 622

####################
# image formats
# pgm (we do not do md5 on image files yet)
D
Diego Biurrun 已提交
623
do_image_formats pgm
F
Fabrice Bellard 已提交
624 625

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

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

F
Fabrice Bellard 已提交
631 632 633 634
####################
# audio only

# wav
635
do_audio_only wav
F
Fabrice Bellard 已提交
636 637

# alaw
638
do_audio_only al
F
Fabrice Bellard 已提交
639 640

# mulaw
641
do_audio_only ul
F
Fabrice Bellard 已提交
642 643

# au
644
do_audio_only au
F
Fabrice Bellard 已提交
645

646
# mmf
647
do_audio_only mmf
648

649
# aiff
650
do_audio_only aif
651

A
Aurelien Jacobs 已提交
652
# voc
653
do_audio_only voc
A
Aurelien Jacobs 已提交
654

655 656 657 658
####################
# pix_fmt conversions
conversions="yuv420p yuv422p yuv444p yuv422 yuv410p yuv411p yuvj420p \
             yuvj422p yuvj444p rgb24 bgr24 rgba32 rgb565 rgb555 gray monow \
659
             monob pal8"
660 661 662 663 664 665 666 667
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 已提交
668 669 670
fi


671

M
Michael Niedermayer 已提交
672
if $diff_cmd "$logfile" "$reffile" ; then
673
    echo
674 675 676
    echo Regression test succeeded.
    exit 0
else
677
    echo
678 679 680
    echo Regression test: Error.
    exit 1
fi