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