fate: remove output redirections from old regtest scripts
[libav.git] / tests / codec-regression.sh
CommitLineData
51133a7d
FB
1#!/bin/sh
2#
3# automatic regression test for ffmpeg
4#
5#
6#set -x
d9d7653e 7
51133a7d
FB
8set -e
9
2189dbc4 10. $(dirname $0)/regression-funcs.sh
89d5dfd5 11
4383ed5c
MR
12eval do_$test=y
13
67cbe681 14# generate reference for quality check
c676895f 15if [ -n "$do_vref" ]; then
70378ea1 16do_ffmpeg $raw_ref -f image2 -vcodec pgmyuv -i $raw_src -an -f rawvideo
c676895f
MR
17fi
18if [ -n "$do_aref" ]; then
70378ea1 19do_ffmpeg $pcm_ref -ab 128k -ac 2 -ar 44100 -f s16le -i $pcm_src -f wav
4383ed5c 20fi
67cbe681 21
51133a7d 22if [ -n "$do_mpeg" ] ; then
0fc3a831 23# mpeg1
2728fd90 24do_video_encoding mpeg1.mpg "-qscale 10 -f mpeg1video"
1de61a18 25do_video_decoding
922bc38d
MN
26fi
27
922bc38d 28if [ -n "$do_mpeg2" ] ; then
0fc3a831 29# mpeg2
2728fd90 30do_video_encoding mpeg2.mpg "-qscale 10 -vcodec mpeg2video -f mpeg1video"
1de61a18 31do_video_decoding
83dddc4a 32
49f1ac5a 33# mpeg2 encoding intra vlc qprd
2728fd90 34do_video_encoding mpeg2ivlc-qprd.mpg "-vb 500k -bf 2 -trellis 1 -flags +qprd+mv0 -flags2 +ivlc -cmp 2 -subcmp 2 -mbd rd -vcodec mpeg2video -f mpeg2video"
1de61a18 35do_video_decoding
307eb248 36
2cce68f8 37#mpeg2 4:2:2 encoding
2728fd90 38do_video_encoding mpeg2_422.mpg "-vb 1000k -bf 2 -trellis 1 -flags +qprd+mv0+ildct+ilme -flags2 +ivlc -mbd rd -vcodec mpeg2video -pix_fmt yuv422p -f mpeg2video"
2cce68f8
BC
39do_video_decoding
40
0fc3a831 41# mpeg2
2728fd90 42do_video_encoding mpeg2.mpg "-qscale 10 -vcodec mpeg2video -idct int -dct int -f mpeg1video"
5e5ac8e0 43do_video_decoding "-idct int"
6486ad57 44
83dddc4a 45# mpeg2 encoding interlaced
2728fd90 46do_video_encoding mpeg2i.mpg "-qscale 10 -vcodec mpeg2video -f mpeg1video -flags +ildct+ilme"
1de61a18 47do_video_decoding
51133a7d
FB
48fi
49
9c3d33d6
MN
50if [ -n "$do_mpeg2thread" ] ; then
51# mpeg2 encoding interlaced
2728fd90 52do_video_encoding mpeg2thread.mpg "-qscale 10 -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 2"
1de61a18 53do_video_decoding
307eb248
BC
54
55# mpeg2 encoding interlaced using intra vlc
2728fd90 56do_video_encoding mpeg2threadivlc.mpg "-qscale 10 -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -flags2 +ivlc -threads 2"
1de61a18 57do_video_decoding
7f8038ce
MN
58
59# mpeg2 encoding interlaced
60file=${outfile}mpeg2reuse.mpg
eeadaa6b 61do_ffmpeg $file $DEC_OPTS -me_threshold 256 -i ${target_path}/${outfile}mpeg2thread.mpg $ENC_OPTS -sameq -me_threshold 256 -mb_threshold 1024 -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 4
1de61a18 62do_video_decoding
9c3d33d6
MN
63fi
64
6ebd933b 65if [ -n "$do_msmpeg4v2" ] ; then
2728fd90 66do_video_encoding msmpeg4v2.avi "-qscale 10 -an -vcodec msmpeg4v2"
1de61a18 67do_video_decoding
6ebd933b
MN
68fi
69
51133a7d 70if [ -n "$do_msmpeg4" ] ; then
2728fd90 71do_video_encoding msmpeg4.avi "-qscale 10 -an -vcodec msmpeg4"
1de61a18 72do_video_decoding
51133a7d
FB
73fi
74
6ebd933b 75if [ -n "$do_wmv1" ] ; then
2728fd90 76do_video_encoding wmv1.avi "-qscale 10 -an -vcodec wmv1"
1de61a18 77do_video_decoding
6ebd933b
MN
78fi
79
e23d5712 80if [ -n "$do_wmv2" ] ; then
2728fd90 81do_video_encoding wmv2.avi "-qscale 10 -an -vcodec wmv2"
1de61a18 82do_video_decoding
e23d5712
MN
83fi
84
61b262a9 85if [ -n "$do_h261" ] ; then
2728fd90 86do_video_encoding h261.avi "-qscale 11 -s 352x288 -an -vcodec h261"
1de61a18 87do_video_decoding
61b262a9
MN
88fi
89
51133a7d 90if [ -n "$do_h263" ] ; then
2728fd90 91do_video_encoding h263.avi "-qscale 10 -s 352x288 -an -vcodec h263"
1de61a18 92do_video_decoding
6e2d5f1a
MN
93fi
94
6e2d5f1a 95if [ -n "$do_h263p" ] ; then
2728fd90 96do_video_encoding h263p.avi "-qscale 2 -flags +umv+aiv+aic -s 352x288 -an -vcodec h263p -ps 300"
1de61a18 97do_video_decoding
51133a7d
FB
98fi
99
51133a7d 100if [ -n "$do_mpeg4" ] ; then
2728fd90 101do_video_encoding odivx.mp4 "-flags +mv4 -mbd bits -qscale 10 -an -vcodec mpeg4"
aeeb0cac 102do_video_decoding
51133a7d
FB
103fi
104
e629ab68 105if [ -n "$do_huffyuv" ] ; then
2728fd90 106do_video_encoding huffyuv.avi "-an -vcodec huffyuv -pix_fmt yuv422p -sws_flags neighbor+bitexact"
3e3c638e 107do_video_decoding "" "-strict -2 -pix_fmt yuv420p -sws_flags neighbor+bitexact"
e629ab68
RD
108fi
109
1dbb6d90 110if [ -n "$do_rc" ] ; then
2728fd90 111do_video_encoding mpeg4-rc.avi "-b 400k -bf 2 -an -vcodec mpeg4"
aeeb0cac 112do_video_decoding
1dbb6d90
MN
113fi
114
1dbb6d90 115if [ -n "$do_mpeg4adv" ] ; then
2728fd90 116do_video_encoding mpeg4-adv.avi "-qscale 9 -flags +mv4+part+aic -trellis 1 -mbd bits -ps 200 -an -vcodec mpeg4"
1de61a18 117do_video_decoding
2d1e5071 118
2728fd90 119do_video_encoding mpeg4-qprd.avi "-b 450k -bf 2 -trellis 1 -flags +mv4+qprd+mv0 -cmp 2 -subcmp 2 -mbd rd -an -vcodec mpeg4"
2d1e5071
MN
120do_video_decoding
121
2728fd90 122do_video_encoding mpeg4-adap.avi "-b 550k -bf 2 -flags +mv4+mv0 -trellis 1 -cmp 1 -subcmp 2 -mbd rd -scplx_mask 0.3 -an -vcodec mpeg4"
2d1e5071 123do_video_decoding
1dbb6d90 124
2728fd90 125do_video_encoding mpeg4-Q.avi "-qscale 7 -flags +mv4+qpel -mbd 2 -bf 2 -cmp 1 -subcmp 2 -an -vcodec mpeg4"
1de61a18 126do_video_decoding
aab9cdcf
MN
127fi
128
45ddd8b0 129if [ -n "$do_mpeg4thread" ] ; then
2728fd90 130do_video_encoding mpeg4-thread.avi "-b 500k -flags +mv4+part+aic -trellis 1 -mbd bits -ps 200 -bf 2 -an -vcodec mpeg4 -threads 2"
1de61a18 131do_video_decoding
9c3d33d6
MN
132fi
133
7ebfc0ea 134if [ -n "$do_error" ] ; then
2728fd90 135do_video_encoding error-mpeg4-adv.avi "-qscale 7 -flags +mv4+part+aic -mbd rd -ps 250 -error 10 -an -vcodec mpeg4"
1de61a18 136do_video_decoding
7ebfc0ea
MN
137fi
138
be408b67 139if [ -n "$do_mpeg4nr" ] ; then
2728fd90 140do_video_encoding mpeg4-nr.avi "-qscale 8 -flags +mv4 -mbd rd -nr 200 -an -vcodec mpeg4"
1de61a18 141do_video_decoding
be408b67
MN
142fi
143
cfadadec 144if [ -n "$do_mpeg1b" ] ; then
2728fd90 145do_video_encoding mpeg1b.mpg "-qscale 8 -bf 3 -ps 200 -an -vcodec mpeg1video -f mpeg1video"
1de61a18 146do_video_decoding
cfadadec
MN
147fi
148
51133a7d 149if [ -n "$do_mjpeg" ] ; then
2728fd90 150do_video_encoding mjpeg.avi "-qscale 9 -an -vcodec mjpeg -pix_fmt yuvj420p"
5e5ac8e0 151do_video_decoding "" "-pix_fmt yuv420p"
51133a7d
FB
152fi
153
3b37408b 154if [ -n "$do_ljpeg" ] ; then
2728fd90 155do_video_encoding ljpeg.avi "-an -vcodec ljpeg -strict -1"
1de61a18 156do_video_decoding
3b37408b
MN
157fi
158
b4e021e8 159if [ -n "$do_jpegls" ] ; then
2728fd90 160do_video_encoding jpegls.avi "-an -vcodec jpegls -vtag MJPG -sws_flags neighbor+full_chroma_int+accurate_rnd+bitexact"
3e3c638e 161do_video_decoding "" "-pix_fmt yuv420p -sws_flags area+bitexact"
b4e021e8
MN
162fi
163
51133a7d 164if [ -n "$do_rv10" ] ; then
2728fd90 165do_video_encoding rv10.rm "-qscale 10 -an"
1de61a18 166do_video_decoding
51133a7d
FB
167fi
168
c50cd09d 169if [ -n "$do_rv20" ] ; then
2728fd90 170do_video_encoding rv20.rm "-qscale 10 -vcodec rv20 -an"
1de61a18 171do_video_decoding
c50cd09d
MN
172fi
173
9ca9fce1 174if [ -n "$do_asv1" ] ; then
2728fd90 175do_video_encoding asv1.avi "-qscale 10 -an -vcodec asv1"
1de61a18 176do_video_decoding
9ca9fce1
MN
177fi
178
8d876a43 179if [ -n "$do_asv2" ] ; then
2728fd90 180do_video_encoding asv2.avi "-qscale 10 -an -vcodec asv2"
1de61a18 181do_video_decoding
8d876a43
MN
182fi
183
bbdd42d3 184if [ -n "$do_flv" ] ; then
2728fd90 185do_video_encoding flv.flv "-qscale 10 -an -vcodec flv"
1de61a18 186do_video_decoding
bbdd42d3
MN
187fi
188
f3203047 189if [ -n "$do_ffv1" ] ; then
2728fd90 190do_video_encoding ffv1.avi "-strict -2 -an -vcodec ffv1"
1de61a18 191do_video_decoding
d13eef3d
MN
192fi
193
d13eef3d 194if [ -n "$do_snow" ] ; then
2728fd90 195do_video_encoding snow.avi "-strict -2 -an -vcodec snow -qscale 2 -flags +qpel -me_method iter -dia_size 2 -cmp 12 -subcmp 12 -s 128x64"
5e5ac8e0 196do_video_decoding "" "-s 352x288"
e03c822a 197fi
d13eef3d 198
e03c822a 199if [ -n "$do_snowll" ] ; then
2728fd90 200do_video_encoding snow53.avi "-strict -2 -an -vcodec snow -qscale .001 -pred 1 -flags +mv4+qpel"
1de61a18 201do_video_decoding
f3203047
MN
202fi
203
8fce2707 204if [ -n "$do_dv" ] ; then
2728fd90 205do_video_encoding dv.dv "-dct int -s pal -an"
5e5ac8e0 206do_video_decoding "" "-s cif"
77c3fb90 207
2728fd90 208do_video_encoding dv411.dv "-dct int -s pal -an -pix_fmt yuv411p -sws_flags area+accurate_rnd+bitexact"
3e3c638e 209do_video_decoding "" "-s cif -sws_flags area+accurate_rnd+bitexact"
8fce2707
MN
210fi
211
0b297700 212if [ -n "$do_dv50" ] ; then
2728fd90 213do_video_encoding dv50.dv "-dct int -s pal -pix_fmt yuv422p -an -sws_flags neighbor+bitexact"
3e3c638e 214do_video_decoding "" "-s cif -pix_fmt yuv420p -sws_flags neighbor+bitexact"
0b297700
DM
215fi
216
96fdb624 217if [ -n "$do_dnxhd_1080i" ] ; then
60820866 218# FIXME: interlaced raw DNxHD decoding is broken
2728fd90 219do_video_encoding dnxhd-1080i.mov "-vcodec dnxhd -flags +ildct -s hd1080 -b 120M -pix_fmt yuv422p -vframes 5 -an"
7cbc2e60 220do_video_decoding "" "-s cif -pix_fmt yuv420p"
96fdb624 221fi
60820866 222
96fdb624 223if [ -n "$do_dnxhd_720p" ] ; then
2728fd90 224do_video_encoding dnxhd-720p.dnxhd "-s hd720 -b 90M -pix_fmt yuv422p -vframes 5 -an"
7cbc2e60 225do_video_decoding "" "-s cif -pix_fmt yuv420p"
96fdb624 226fi
3fdd8276 227
96fdb624 228if [ -n "$do_dnxhd_720p_rd" ] ; then
2728fd90 229do_video_encoding dnxhd-720p-rd.dnxhd "-threads 4 -mbd rd -s hd720 -b 90M -pix_fmt yuv422p -vframes 5 -an"
7cbc2e60 230do_video_decoding "" "-s cif -pix_fmt yuv420p"
a5083f66
RD
231fi
232
b86bd1f1 233if [ -n "$do_svq1" ] ; then
2728fd90 234do_video_encoding svq1.mov "-an -vcodec svq1 -qscale 3 -pix_fmt yuv410p"
5e5ac8e0 235do_video_decoding "" "-pix_fmt yuv420p"
b86bd1f1
MN
236fi
237
d2f8f410 238if [ -n "$do_flashsv" ] ; then
2728fd90 239do_video_encoding flashsv.flv "-an -vcodec flashsv -sws_flags neighbor+full_chroma_int+accurate_rnd+bitexact"
3e3c638e 240do_video_decoding "" "-pix_fmt yuv420p -sws_flags area+accurate_rnd+bitexact"
d2f8f410
MN
241fi
242
ae5e8caa 243if [ -n "$do_roq" ] ; then
2728fd90 244do_video_encoding roqav.roq "-vframes 5"
ae5e8caa
RD
245do_video_decoding "" "-pix_fmt yuv420p"
246fi
247
82c76cee 248if [ -n "$do_qtrle" ] ; then
2728fd90 249do_video_encoding qtrle.mov "-an -vcodec qtrle"
646739a0 250do_video_decoding "" "-pix_fmt yuv420p"
82c76cee
VS
251fi
252
59b847d3 253if [ -n "$do_rgb" ] ; then
2728fd90 254do_video_encoding rgb.avi "-an -vcodec rawvideo -pix_fmt bgr24"
59b847d3
MN
255do_video_decoding "" "-pix_fmt yuv420p"
256fi
257
258if [ -n "$do_yuv" ] ; then
2728fd90 259do_video_encoding yuv.avi "-an -vcodec rawvideo -pix_fmt yuv420p"
59b847d3
MN
260do_video_decoding "" "-pix_fmt yuv420p"
261fi
262
51133a7d 263if [ -n "$do_mp2" ] ; then
2728fd90 264do_audio_encoding mp2.mp2
fb132953 265do_audio_decoding
ea57502c 266$tiny_psnr $pcm_dst $pcm_ref 2 1924
51133a7d
FB
267fi
268
6fd96d1a 269if [ -n "$do_ac3_fixed" ] ; then
2728fd90 270do_audio_encoding ac3.rm "-vn -acodec ac3_fixed"
f77dddfc 271# binaries configured with --disable-sse decode ac3 differently
ede935a1 272#do_audio_decoding
ea57502c 273#$tiny_psnr $pcm_dst $pcm_ref 2 1024
51133a7d
FB
274fi
275
311be1fb 276if [ -n "$do_g726" ] ; then
2728fd90 277do_audio_encoding g726.wav "-ab 32k -ac 1 -ar 8000 -acodec g726"
fb132953 278do_audio_decoding
311be1fb
MN
279fi
280
f02ab814 281if [ -n "$do_adpcm_ima_wav" ] ; then
2728fd90 282do_audio_encoding adpcm_ima.wav "-acodec adpcm_ima_wav"
fb132953 283do_audio_decoding
f02ab814
MN
284fi
285
9dc92a38 286if [ -n "$do_adpcm_ima_qt" ] ; then
2728fd90 287do_audio_encoding adpcm_qt.aiff "-acodec adpcm_ima_qt"
9dc92a38
KS
288do_audio_decoding
289fi
290
f02ab814 291if [ -n "$do_adpcm_ms" ] ; then
2728fd90 292do_audio_encoding adpcm_ms.wav "-acodec adpcm_ms"
fb132953 293do_audio_decoding
f02ab814
MN
294fi
295
d8cbeba1 296if [ -n "$do_adpcm_yam" ] ; then
2728fd90 297do_audio_encoding adpcm_yam.wav "-acodec adpcm_yamaha"
fb132953 298do_audio_decoding
d8cbeba1
MN
299fi
300
b529ab37 301if [ -n "$do_adpcm_swf" ] ; then
2728fd90 302do_audio_encoding adpcm_swf.flv "-acodec adpcm_swf"
b529ab37
BL
303do_audio_decoding
304fi
305
9797ce58 306if [ -n "$do_alac" ] ; then
2728fd90 307do_audio_encoding alac.m4a "-acodec alac -compression_level 1"
9797ce58
JR
308do_audio_decoding
309fi
310
aeb2904e 311if [ -n "$do_flac" ] ; then
2728fd90 312do_audio_encoding flac.flac "-acodec flac -compression_level 2"
fb132953 313do_audio_decoding
aeb2904e
MN
314fi
315
4b294c18 316if [ -n "$do_wmav1" ] ; then
2728fd90 317do_audio_encoding wmav1.asf "-acodec wmav1"
ecfc5e0b 318do_ffmpeg_nomd5 $pcm_dst $DEC_OPTS -i $target_path/$file -f wav
ea57502c 319$tiny_psnr $pcm_dst $pcm_ref 2 8192
4b294c18
MR
320fi
321if [ -n "$do_wmav2" ] ; then
2728fd90 322do_audio_encoding wmav2.asf "-acodec wmav2"
ecfc5e0b 323do_ffmpeg_nomd5 $pcm_dst $DEC_OPTS -i $target_path/$file -f wav
ea57502c 324$tiny_psnr $pcm_dst $pcm_ref 2 8192
6d3d8dae
MN
325fi
326
0786943a 327#if [ -n "$do_vorbis" ] ; then
3160138f 328# vorbis
90b5b51e 329#disabled because it is broken
2728fd90 330#do_audio_encoding vorbis.asf "-acodec vorbis"
0786943a
MN
331#do_audio_decoding
332#fi
6d3d8dae 333
4f5c72e8 334do_audio_enc_dec() {
2728fd90 335 do_audio_encoding $3.$1 "$4 -sample_fmt $2 -acodec $3"
4f5c72e8
PR
336 do_audio_decoding
337}
338
339if [ -n "$do_pcm" ] ; then
340do_audio_enc_dec wav s16 pcm_alaw
341do_audio_enc_dec wav s16 pcm_mulaw
5e8ecfde
PR
342do_audio_enc_dec mov u8 pcm_s8
343do_audio_enc_dec wav u8 pcm_u8
4f5c72e8
PR
344do_audio_enc_dec mov s16 pcm_s16be
345do_audio_enc_dec wav s16 pcm_s16le
38511b9a
AJ
346do_audio_enc_dec mkv s16 pcm_s16be
347do_audio_enc_dec mkv s16 pcm_s16le
5e8ecfde
PR
348do_audio_enc_dec mov s32 pcm_s24be
349do_audio_enc_dec wav s32 pcm_s24le
350#do_audio_enc_dec ??? s32 pcm_u24be #no compatible muxer or demuxer
351#do_audio_enc_dec ??? s32 pcm_u24le #no compatible muxer or demuxer
352do_audio_enc_dec mov s32 pcm_s32be
353do_audio_enc_dec wav s32 pcm_s32le
354#do_audio_enc_dec ??? s32 pcm_u32be #no compatible muxer or demuxer
355#do_audio_enc_dec ??? s32 pcm_u32le #no compatible muxer or demuxer
4f5c72e8 356do_audio_enc_dec au flt pcm_f32be
6f18fe8c
PR
357do_audio_enc_dec wav flt pcm_f32le
358do_audio_enc_dec au dbl pcm_f64be
359do_audio_enc_dec wav dbl pcm_f64le
4f5c72e8
PR
360do_audio_enc_dec wav s16 pcm_zork
361do_audio_enc_dec 302 s16 pcm_s24daud "-ac 6 -ar 96000"
362fi