4xm: remove unneeded check for remaining unused data.
[libav.git] / tests / codec-regression.sh
CommitLineData
51133a7d
FB
1#!/bin/sh
2#
6291d7e4 3# automatic regression test for avconv
51133a7d
FB
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
6291d7e4 16do_avconv $raw_ref -f image2 -vcodec pgmyuv -i $raw_src -an -f rawvideo
c676895f
MR
17fi
18if [ -n "$do_aref" ]; then
64db1a82 19do_avconv $pcm_ref -b 128k -ac 2 -ar 44100 -f s16le -i $pcm_src -f wav
4383ed5c 20fi
67cbe681 21
7d18d17a
PM
22if [ -n "$do_cljr" ] ; then
23do_video_encoding cljr.avi "-an -vcodec cljr"
24do_video_decoding
25fi
26
51133a7d 27if [ -n "$do_mpeg" ] ; then
0fc3a831 28# mpeg1
2728fd90 29do_video_encoding mpeg1.mpg "-qscale 10 -f mpeg1video"
1de61a18 30do_video_decoding
922bc38d
MN
31fi
32
922bc38d 33if [ -n "$do_mpeg2" ] ; then
0fc3a831 34# mpeg2
2728fd90 35do_video_encoding mpeg2.mpg "-qscale 10 -vcodec mpeg2video -f mpeg1video"
1de61a18 36do_video_decoding
3fe5fc93 37fi
83dddc4a 38
3fe5fc93 39if [ -n "$do_mpeg2_ivlc_qprd" ]; then
49f1ac5a 40# mpeg2 encoding intra vlc qprd
2728fd90 41do_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 42do_video_decoding
3fe5fc93 43fi
307eb248 44
3fe5fc93 45if [ -n "$do_mpeg2_422" ]; then
2cce68f8 46#mpeg2 4:2:2 encoding
2728fd90 47do_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 48do_video_decoding
3fe5fc93 49fi
2cce68f8 50
3fe5fc93 51if [ -n "$do_mpeg2_idct_int" ]; then
0fc3a831 52# mpeg2
3fe5fc93 53do_video_encoding mpeg2_idct_int.mpg "-qscale 10 -vcodec mpeg2video -idct int -dct int -f mpeg1video"
5e5ac8e0 54do_video_decoding "-idct int"
3fe5fc93 55fi
6486ad57 56
3fe5fc93 57if [ -n "$do_mpeg2_ilace" ]; then
83dddc4a 58# mpeg2 encoding interlaced
2728fd90 59do_video_encoding mpeg2i.mpg "-qscale 10 -vcodec mpeg2video -f mpeg1video -flags +ildct+ilme"
1de61a18 60do_video_decoding
51133a7d
FB
61fi
62
9c3d33d6
MN
63if [ -n "$do_mpeg2thread" ] ; then
64# mpeg2 encoding interlaced
2728fd90 65do_video_encoding mpeg2thread.mpg "-qscale 10 -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 2"
1de61a18 66do_video_decoding
3fe5fc93 67fi
307eb248 68
3fe5fc93 69if [ -n "$do_mpeg2thread_ilace" ]; then
307eb248 70# mpeg2 encoding interlaced using intra vlc
2728fd90 71do_video_encoding mpeg2threadivlc.mpg "-qscale 10 -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -flags2 +ivlc -threads 2"
1de61a18 72do_video_decoding
9c3d33d6
MN
73fi
74
6ebd933b 75if [ -n "$do_msmpeg4v2" ] ; then
2728fd90 76do_video_encoding msmpeg4v2.avi "-qscale 10 -an -vcodec msmpeg4v2"
1de61a18 77do_video_decoding
6ebd933b
MN
78fi
79
51133a7d 80if [ -n "$do_msmpeg4" ] ; then
2728fd90 81do_video_encoding msmpeg4.avi "-qscale 10 -an -vcodec msmpeg4"
1de61a18 82do_video_decoding
51133a7d
FB
83fi
84
6ebd933b 85if [ -n "$do_wmv1" ] ; then
2728fd90 86do_video_encoding wmv1.avi "-qscale 10 -an -vcodec wmv1"
1de61a18 87do_video_decoding
6ebd933b
MN
88fi
89
e23d5712 90if [ -n "$do_wmv2" ] ; then
2728fd90 91do_video_encoding wmv2.avi "-qscale 10 -an -vcodec wmv2"
1de61a18 92do_video_decoding
e23d5712
MN
93fi
94
61b262a9 95if [ -n "$do_h261" ] ; then
2728fd90 96do_video_encoding h261.avi "-qscale 11 -s 352x288 -an -vcodec h261"
1de61a18 97do_video_decoding
61b262a9
MN
98fi
99
51133a7d 100if [ -n "$do_h263" ] ; then
2728fd90 101do_video_encoding h263.avi "-qscale 10 -s 352x288 -an -vcodec h263"
1de61a18 102do_video_decoding
6e2d5f1a
MN
103fi
104
6e2d5f1a 105if [ -n "$do_h263p" ] ; then
2728fd90 106do_video_encoding h263p.avi "-qscale 2 -flags +umv+aiv+aic -s 352x288 -an -vcodec h263p -ps 300"
1de61a18 107do_video_decoding
51133a7d
FB
108fi
109
51133a7d 110if [ -n "$do_mpeg4" ] ; then
2728fd90 111do_video_encoding odivx.mp4 "-flags +mv4 -mbd bits -qscale 10 -an -vcodec mpeg4"
aeeb0cac 112do_video_decoding
51133a7d
FB
113fi
114
e629ab68 115if [ -n "$do_huffyuv" ] ; then
2728fd90 116do_video_encoding huffyuv.avi "-an -vcodec huffyuv -pix_fmt yuv422p -sws_flags neighbor+bitexact"
3e3c638e 117do_video_decoding "" "-strict -2 -pix_fmt yuv420p -sws_flags neighbor+bitexact"
e629ab68
RD
118fi
119
1dbb6d90 120if [ -n "$do_rc" ] ; then
2728fd90 121do_video_encoding mpeg4-rc.avi "-b 400k -bf 2 -an -vcodec mpeg4"
aeeb0cac 122do_video_decoding
1dbb6d90
MN
123fi
124
1dbb6d90 125if [ -n "$do_mpeg4adv" ] ; then
2728fd90 126do_video_encoding mpeg4-adv.avi "-qscale 9 -flags +mv4+part+aic -trellis 1 -mbd bits -ps 200 -an -vcodec mpeg4"
1de61a18 127do_video_decoding
3fe5fc93 128fi
2d1e5071 129
3fe5fc93 130if [ -n "$do_mpeg4_qprd" ]; then
2728fd90 131do_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 132do_video_decoding
3fe5fc93 133fi
2d1e5071 134
3fe5fc93 135if [ -n "$do_mpeg4_adap" ]; then
2728fd90 136do_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 137do_video_decoding
3fe5fc93 138fi
1dbb6d90 139
3fe5fc93 140if [ -n "$do_mpeg4_qpel" ]; then
2728fd90 141do_video_encoding mpeg4-Q.avi "-qscale 7 -flags +mv4+qpel -mbd 2 -bf 2 -cmp 1 -subcmp 2 -an -vcodec mpeg4"
1de61a18 142do_video_decoding
aab9cdcf
MN
143fi
144
45ddd8b0 145if [ -n "$do_mpeg4thread" ] ; then
2728fd90 146do_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 147do_video_decoding
9c3d33d6
MN
148fi
149
7ebfc0ea 150if [ -n "$do_error" ] ; then
2728fd90 151do_video_encoding error-mpeg4-adv.avi "-qscale 7 -flags +mv4+part+aic -mbd rd -ps 250 -error 10 -an -vcodec mpeg4"
1de61a18 152do_video_decoding
7ebfc0ea
MN
153fi
154
be408b67 155if [ -n "$do_mpeg4nr" ] ; then
2728fd90 156do_video_encoding mpeg4-nr.avi "-qscale 8 -flags +mv4 -mbd rd -nr 200 -an -vcodec mpeg4"
1de61a18 157do_video_decoding
be408b67
MN
158fi
159
cfadadec 160if [ -n "$do_mpeg1b" ] ; then
2728fd90 161do_video_encoding mpeg1b.mpg "-qscale 8 -bf 3 -ps 200 -an -vcodec mpeg1video -f mpeg1video"
1de61a18 162do_video_decoding
cfadadec
MN
163fi
164
51133a7d 165if [ -n "$do_mjpeg" ] ; then
2728fd90 166do_video_encoding mjpeg.avi "-qscale 9 -an -vcodec mjpeg -pix_fmt yuvj420p"
5e5ac8e0 167do_video_decoding "" "-pix_fmt yuv420p"
51133a7d
FB
168fi
169
3b37408b 170if [ -n "$do_ljpeg" ] ; then
2728fd90 171do_video_encoding ljpeg.avi "-an -vcodec ljpeg -strict -1"
1de61a18 172do_video_decoding
3b37408b
MN
173fi
174
b4e021e8 175if [ -n "$do_jpegls" ] ; then
2728fd90 176do_video_encoding jpegls.avi "-an -vcodec jpegls -vtag MJPG -sws_flags neighbor+full_chroma_int+accurate_rnd+bitexact"
3e3c638e 177do_video_decoding "" "-pix_fmt yuv420p -sws_flags area+bitexact"
b4e021e8
MN
178fi
179
51133a7d 180if [ -n "$do_rv10" ] ; then
2728fd90 181do_video_encoding rv10.rm "-qscale 10 -an"
1de61a18 182do_video_decoding
51133a7d
FB
183fi
184
c50cd09d 185if [ -n "$do_rv20" ] ; then
2728fd90 186do_video_encoding rv20.rm "-qscale 10 -vcodec rv20 -an"
1de61a18 187do_video_decoding
c50cd09d
MN
188fi
189
9ca9fce1 190if [ -n "$do_asv1" ] ; then
2728fd90 191do_video_encoding asv1.avi "-qscale 10 -an -vcodec asv1"
1de61a18 192do_video_decoding
9ca9fce1
MN
193fi
194
8d876a43 195if [ -n "$do_asv2" ] ; then
2728fd90 196do_video_encoding asv2.avi "-qscale 10 -an -vcodec asv2"
1de61a18 197do_video_decoding
8d876a43
MN
198fi
199
bbdd42d3 200if [ -n "$do_flv" ] ; then
2728fd90 201do_video_encoding flv.flv "-qscale 10 -an -vcodec flv"
1de61a18 202do_video_decoding
bbdd42d3
MN
203fi
204
f3203047 205if [ -n "$do_ffv1" ] ; then
2728fd90 206do_video_encoding ffv1.avi "-strict -2 -an -vcodec ffv1"
1de61a18 207do_video_decoding
d13eef3d
MN
208fi
209
d13eef3d 210if [ -n "$do_snow" ] ; then
2728fd90 211do_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 212do_video_decoding "" "-s 352x288"
e03c822a 213fi
d13eef3d 214
e03c822a 215if [ -n "$do_snowll" ] ; then
2728fd90 216do_video_encoding snow53.avi "-strict -2 -an -vcodec snow -qscale .001 -pred 1 -flags +mv4+qpel"
1de61a18 217do_video_decoding
f3203047
MN
218fi
219
8fce2707 220if [ -n "$do_dv" ] ; then
2728fd90 221do_video_encoding dv.dv "-dct int -s pal -an"
5e5ac8e0 222do_video_decoding "" "-s cif"
3fe5fc93 223fi
77c3fb90 224
3fe5fc93 225if [ -n "$do_dv_411" ]; then
2728fd90 226do_video_encoding dv411.dv "-dct int -s pal -an -pix_fmt yuv411p -sws_flags area+accurate_rnd+bitexact"
3e3c638e 227do_video_decoding "" "-s cif -sws_flags area+accurate_rnd+bitexact"
8fce2707
MN
228fi
229
0b297700 230if [ -n "$do_dv50" ] ; then
2728fd90 231do_video_encoding dv50.dv "-dct int -s pal -pix_fmt yuv422p -an -sws_flags neighbor+bitexact"
3e3c638e 232do_video_decoding "" "-s cif -pix_fmt yuv420p -sws_flags neighbor+bitexact"
0b297700
DM
233fi
234
96fdb624 235if [ -n "$do_dnxhd_1080i" ] ; then
60820866 236# FIXME: interlaced raw DNxHD decoding is broken
2728fd90 237do_video_encoding dnxhd-1080i.mov "-vcodec dnxhd -flags +ildct -s hd1080 -b 120M -pix_fmt yuv422p -vframes 5 -an"
7cbc2e60 238do_video_decoding "" "-s cif -pix_fmt yuv420p"
96fdb624 239fi
60820866 240
96fdb624 241if [ -n "$do_dnxhd_720p" ] ; then
2728fd90 242do_video_encoding dnxhd-720p.dnxhd "-s hd720 -b 90M -pix_fmt yuv422p -vframes 5 -an"
7cbc2e60 243do_video_decoding "" "-s cif -pix_fmt yuv420p"
96fdb624 244fi
3fdd8276 245
96fdb624 246if [ -n "$do_dnxhd_720p_rd" ] ; then
2728fd90 247do_video_encoding dnxhd-720p-rd.dnxhd "-threads 4 -mbd rd -s hd720 -b 90M -pix_fmt yuv422p -vframes 5 -an"
7cbc2e60 248do_video_decoding "" "-s cif -pix_fmt yuv420p"
a5083f66
RD
249fi
250
4555874a
MR
251if [ -n "$do_dnxhd_720p_10bit" ] ; then
252do_video_encoding dnxhd-720p-10bit.dnxhd "-s hd720 -b 90M -pix_fmt yuv422p10 -vframes 5 -an"
253do_video_decoding "" "-s cif -pix_fmt yuv420p"
254fi
255
b86bd1f1 256if [ -n "$do_svq1" ] ; then
2728fd90 257do_video_encoding svq1.mov "-an -vcodec svq1 -qscale 3 -pix_fmt yuv410p"
5e5ac8e0 258do_video_decoding "" "-pix_fmt yuv420p"
b86bd1f1
MN
259fi
260
d2f8f410 261if [ -n "$do_flashsv" ] ; then
2728fd90 262do_video_encoding flashsv.flv "-an -vcodec flashsv -sws_flags neighbor+full_chroma_int+accurate_rnd+bitexact"
3e3c638e 263do_video_decoding "" "-pix_fmt yuv420p -sws_flags area+accurate_rnd+bitexact"
d2f8f410
MN
264fi
265
ae5e8caa 266if [ -n "$do_roq" ] ; then
2728fd90 267do_video_encoding roqav.roq "-vframes 5"
ae5e8caa
RD
268do_video_decoding "" "-pix_fmt yuv420p"
269fi
270
82c76cee 271if [ -n "$do_qtrle" ] ; then
2728fd90 272do_video_encoding qtrle.mov "-an -vcodec qtrle"
646739a0 273do_video_decoding "" "-pix_fmt yuv420p"
82c76cee
VS
274fi
275
59b847d3 276if [ -n "$do_rgb" ] ; then
2728fd90 277do_video_encoding rgb.avi "-an -vcodec rawvideo -pix_fmt bgr24"
59b847d3
MN
278do_video_decoding "" "-pix_fmt yuv420p"
279fi
280
281if [ -n "$do_yuv" ] ; then
2728fd90 282do_video_encoding yuv.avi "-an -vcodec rawvideo -pix_fmt yuv420p"
59b847d3
MN
283do_video_decoding "" "-pix_fmt yuv420p"
284fi
285
51133a7d 286if [ -n "$do_mp2" ] ; then
2728fd90 287do_audio_encoding mp2.mp2
fb132953 288do_audio_decoding
ea57502c 289$tiny_psnr $pcm_dst $pcm_ref 2 1924
51133a7d
FB
290fi
291
6fd96d1a 292if [ -n "$do_ac3_fixed" ] ; then
2728fd90 293do_audio_encoding ac3.rm "-vn -acodec ac3_fixed"
f77dddfc 294# binaries configured with --disable-sse decode ac3 differently
ede935a1 295#do_audio_decoding
ea57502c 296#$tiny_psnr $pcm_dst $pcm_ref 2 1024
51133a7d
FB
297fi
298
714cd7e7
MS
299if [ -n "$do_g722" ] ; then
300do_audio_encoding g722.wav "-b 64k -ac 1 -ar 16000 -acodec g722"
301do_audio_decoding
302fi
303
311be1fb 304if [ -n "$do_g726" ] ; then
64db1a82 305do_audio_encoding g726.wav "-b 32k -ac 1 -ar 8000 -acodec g726"
fb132953 306do_audio_decoding
311be1fb
MN
307fi
308
f02ab814 309if [ -n "$do_adpcm_ima_wav" ] ; then
2728fd90 310do_audio_encoding adpcm_ima.wav "-acodec adpcm_ima_wav"
fb132953 311do_audio_decoding
f02ab814
MN
312fi
313
9dc92a38 314if [ -n "$do_adpcm_ima_qt" ] ; then
2728fd90 315do_audio_encoding adpcm_qt.aiff "-acodec adpcm_ima_qt"
9dc92a38
KS
316do_audio_decoding
317fi
318
f02ab814 319if [ -n "$do_adpcm_ms" ] ; then
2728fd90 320do_audio_encoding adpcm_ms.wav "-acodec adpcm_ms"
fb132953 321do_audio_decoding
f02ab814
MN
322fi
323
d8cbeba1 324if [ -n "$do_adpcm_yam" ] ; then
2728fd90 325do_audio_encoding adpcm_yam.wav "-acodec adpcm_yamaha"
fb132953 326do_audio_decoding
d8cbeba1
MN
327fi
328
b529ab37 329if [ -n "$do_adpcm_swf" ] ; then
2728fd90 330do_audio_encoding adpcm_swf.flv "-acodec adpcm_swf"
b529ab37
BL
331do_audio_decoding
332fi
333
9797ce58 334if [ -n "$do_alac" ] ; then
2728fd90 335do_audio_encoding alac.m4a "-acodec alac -compression_level 1"
9797ce58
JR
336do_audio_decoding
337fi
338
aeb2904e 339if [ -n "$do_flac" ] ; then
2728fd90 340do_audio_encoding flac.flac "-acodec flac -compression_level 2"
fb132953 341do_audio_decoding
aeb2904e
MN
342fi
343
4b294c18 344if [ -n "$do_wmav1" ] ; then
2728fd90 345do_audio_encoding wmav1.asf "-acodec wmav1"
6cd9d0f7 346do_avconv_nomd5 $pcm_dst $DEC_OPTS -i $target_path/$file -f wav
ea57502c 347$tiny_psnr $pcm_dst $pcm_ref 2 8192
4b294c18
MR
348fi
349if [ -n "$do_wmav2" ] ; then
2728fd90 350do_audio_encoding wmav2.asf "-acodec wmav2"
6cd9d0f7 351do_avconv_nomd5 $pcm_dst $DEC_OPTS -i $target_path/$file -f wav
ea57502c 352$tiny_psnr $pcm_dst $pcm_ref 2 8192
6d3d8dae
MN
353fi
354
0786943a 355#if [ -n "$do_vorbis" ] ; then
3160138f 356# vorbis
90b5b51e 357#disabled because it is broken
2728fd90 358#do_audio_encoding vorbis.asf "-acodec vorbis"
0786943a
MN
359#do_audio_decoding
360#fi
6d3d8dae 361
4f5c72e8 362do_audio_enc_dec() {
2728fd90 363 do_audio_encoding $3.$1 "$4 -sample_fmt $2 -acodec $3"
4f5c72e8
PR
364 do_audio_decoding
365}
366
ca124013 367if [ -n "$do_pcm_alaw" ] ; then
4f5c72e8 368do_audio_enc_dec wav s16 pcm_alaw
ca124013
JR
369fi
370if [ -n "$do_pcm_mulaw" ] ; then
4f5c72e8 371do_audio_enc_dec wav s16 pcm_mulaw
ca124013
JR
372fi
373if [ -n "$do_pcm_s8" ] ; then
5e8ecfde 374do_audio_enc_dec mov u8 pcm_s8
ca124013
JR
375fi
376if [ -n "$do_pcm_u8" ] ; then
5e8ecfde 377do_audio_enc_dec wav u8 pcm_u8
ca124013
JR
378fi
379if [ -n "$do_pcm_s16be" ] ; then
4f5c72e8 380do_audio_enc_dec mov s16 pcm_s16be
ca124013
JR
381fi
382if [ -n "$do_pcm_s16le" ] ; then
4f5c72e8 383do_audio_enc_dec wav s16 pcm_s16le
ca124013
JR
384fi
385if [ -n "$do_pcm_s24be" ] ; then
5e8ecfde 386do_audio_enc_dec mov s32 pcm_s24be
ca124013
JR
387fi
388if [ -n "$do_pcm_s24le" ] ; then
5e8ecfde 389do_audio_enc_dec wav s32 pcm_s24le
ca124013
JR
390fi
391# no compatible muxer or demuxer
392# if [ -n "$do_pcm_u24be" ] ; then
393# do_audio_enc_dec ??? u32 pcm_u24be
394# fi
395# if [ -n "$do_pcm_u24le" ] ; then
396# do_audio_enc_dec ??? u32 pcm_u24le
397# fi
398if [ -n "$do_pcm_s32be" ] ; then
5e8ecfde 399do_audio_enc_dec mov s32 pcm_s32be
ca124013
JR
400fi
401if [ -n "$do_pcm_s32le" ] ; then
5e8ecfde 402do_audio_enc_dec wav s32 pcm_s32le
ca124013
JR
403fi
404# no compatible muxer or demuxer
405# if [ -n "$do_pcm_u32be" ] ; then
406# do_audio_enc_dec ??? u32 pcm_u32be
407# fi
408# if [ -n "$do_pcm_u32le" ] ; then
409# do_audio_enc_dec ??? u32 pcm_u32le
410# fi
411if [ -n "$do_pcm_f32be" ] ; then
4f5c72e8 412do_audio_enc_dec au flt pcm_f32be
ca124013
JR
413fi
414if [ -n "$do_pcm_f32le" ] ; then
6f18fe8c 415do_audio_enc_dec wav flt pcm_f32le
ca124013
JR
416fi
417if [ -n "$do_pcm_f64be" ] ; then
6f18fe8c 418do_audio_enc_dec au dbl pcm_f64be
ca124013
JR
419fi
420if [ -n "$do_pcm_f64le" ] ; then
6f18fe8c 421do_audio_enc_dec wav dbl pcm_f64le
ca124013
JR
422fi
423if [ -n "$do_pcm_s24daud" ] ; then
4f5c72e8
PR
424do_audio_enc_dec 302 s16 pcm_s24daud "-ac 6 -ar 96000"
425fi