Statistics
| Branch: | Revision:

ffmpeg / tests / codec-regression.sh @ 77f66963

History | View | Annotate | Download (10.2 KB)

1
#!/bin/sh
2
#
3
# automatic regression test for ffmpeg
4
#
5
#
6
#set -x
7

    
8
set -e
9

    
10
. $(dirname $0)/regression-funcs.sh
11

    
12
eval do_$test=y
13

    
14
rm -f "$logfile"
15
rm -f "$benchfile"
16

    
17
# generate reference for quality check
18
if [ -n "$do_ref" ]; then
19
do_ffmpeg_nocheck $raw_ref -f image2 -vcodec pgmyuv -i $raw_src -an -f rawvideo $target_path/$raw_ref
20
do_ffmpeg_nocheck $pcm_ref -ab 128k -ac 2 -ar 44100 -f s16le -i $pcm_src -f wav $target_path/$pcm_ref
21
fi
22

    
23
if [ -n "$do_mpeg" ] ; then
24
# mpeg1
25
do_video_encoding mpeg1.mpg "-qscale 10" "-f mpeg1video"
26
do_video_decoding
27
fi
28

    
29
if [ -n "$do_mpeg2" ] ; then
30
# mpeg2
31
do_video_encoding mpeg2.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video"
32
do_video_decoding
33

    
34
# mpeg2 encoding intra vlc qprd
35
do_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"
36
do_video_decoding
37

    
38
#mpeg2 4:2:2 encoding
39
do_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"
40
do_video_decoding
41

    
42
# mpeg2
43
do_video_encoding mpeg2.mpg "-qscale 10" "-vcodec mpeg2video -idct int -dct int -f mpeg1video"
44
do_video_decoding "-idct int"
45

    
46
# mpeg2 encoding interlaced
47
do_video_encoding mpeg2i.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -flags +ildct+ilme"
48
do_video_decoding
49
fi
50

    
51
if [ -n "$do_mpeg2thread" ] ; then
52
# mpeg2 encoding interlaced
53
do_video_encoding mpeg2thread.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 2"
54
do_video_decoding
55

    
56
# mpeg2 encoding interlaced using intra vlc
57
do_video_encoding mpeg2threadivlc.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -flags2 +ivlc -threads 2"
58
do_video_decoding
59

    
60
# mpeg2 encoding interlaced
61
file=${outfile}mpeg2reuse.mpg
62
do_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
63
do_video_decoding
64
fi
65

    
66
if [ -n "$do_msmpeg4v2" ] ; then
67
do_video_encoding msmpeg4v2.avi "-qscale 10" "-an -vcodec msmpeg4v2"
68
do_video_decoding
69
fi
70

    
71
if [ -n "$do_msmpeg4" ] ; then
72
do_video_encoding msmpeg4.avi "-qscale 10" "-an -vcodec msmpeg4"
73
do_video_decoding
74
fi
75

    
76
if [ -n "$do_wmv1" ] ; then
77
do_video_encoding wmv1.avi "-qscale 10" "-an -vcodec wmv1"
78
do_video_decoding
79
fi
80

    
81
if [ -n "$do_wmv2" ] ; then
82
do_video_encoding wmv2.avi "-qscale 10" "-an -vcodec wmv2"
83
do_video_decoding
84
fi
85

    
86
if [ -n "$do_h261" ] ; then
87
do_video_encoding h261.avi "-qscale 11" "-s 352x288 -an -vcodec h261"
88
do_video_decoding
89
fi
90

    
91
if [ -n "$do_h263" ] ; then
92
do_video_encoding h263.avi "-qscale 10" "-s 352x288 -an -vcodec h263"
93
do_video_decoding
94
fi
95

    
96
if [ -n "$do_h263p" ] ; then
97
do_video_encoding h263p.avi "-qscale 2 -flags +umv+aiv+aic" "-s 352x288 -an -vcodec h263p -ps 300"
98
do_video_decoding
99
fi
100

    
101
if [ -n "$do_mpeg4" ] ; then
102
do_video_encoding odivx.mp4 "-flags +mv4 -mbd bits -qscale 10" "-an -vcodec mpeg4"
103
do_video_decoding
104
fi
105

    
106
if [ -n "$do_huffyuv" ] ; then
107
do_video_encoding huffyuv.avi "" "-an -vcodec huffyuv -pix_fmt yuv422p -sws_flags neighbor+bitexact"
108
do_video_decoding "" "-strict -2 -pix_fmt yuv420p -sws_flags neighbor+bitexact"
109
fi
110

    
111
if [ -n "$do_rc" ] ; then
112
do_video_encoding mpeg4-rc.avi "-b 400k -bf 2" "-an -vcodec mpeg4"
113
do_video_decoding
114
fi
115

    
116
if [ -n "$do_mpeg4adv" ] ; then
117
do_video_encoding mpeg4-adv.avi "-qscale 9 -flags +mv4+part+aic -trellis 1 -mbd bits -ps 200" "-an -vcodec mpeg4"
118
do_video_decoding
119

    
120
do_video_encoding mpeg4-qprd.avi "-b 450k -bf 2 -trellis 1 -flags +mv4+qprd+mv0 -cmp 2 -subcmp 2 -mbd rd" "-an -vcodec mpeg4"
121
do_video_decoding
122

    
123
do_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"
124
do_video_decoding
125

    
126
do_video_encoding mpeg4-Q.avi "-qscale 7 -flags +mv4+qpel -mbd 2 -bf 2 -cmp 1 -subcmp 2" "-an -vcodec mpeg4"
127
do_video_decoding
128
fi
129

    
130
if [ -n "$do_mpeg4thread" ] ; then
131
do_video_encoding mpeg4-thread.avi "-b 500k -flags +mv4+part+aic -trellis 1 -mbd bits -ps 200 -bf 2" "-an -vcodec mpeg4 -threads 2"
132
do_video_decoding
133
fi
134

    
135
if [ -n "$do_error" ] ; then
136
do_video_encoding error-mpeg4-adv.avi "-qscale 7 -flags +mv4+part+aic -mbd rd -ps 250 -error 10" "-an -vcodec mpeg4"
137
do_video_decoding
138
fi
139

    
140
if [ -n "$do_mpeg4nr" ] ; then
141
do_video_encoding mpeg4-nr.avi "-qscale 8 -flags +mv4 -mbd rd -nr 200" "-an -vcodec mpeg4"
142
do_video_decoding
143
fi
144

    
145
if [ -n "$do_mpeg1b" ] ; then
146
do_video_encoding mpeg1b.mpg "-qscale 8 -bf 3 -ps 200" "-an -vcodec mpeg1video -f mpeg1video"
147
do_video_decoding
148
fi
149

    
150
if [ -n "$do_mjpeg" ] ; then
151
do_video_encoding mjpeg.avi "-qscale 10" "-an -vcodec mjpeg -pix_fmt yuvj420p"
152
do_video_decoding "" "-pix_fmt yuv420p"
153
fi
154

    
155
if [ -n "$do_ljpeg" ] ; then
156
do_video_encoding ljpeg.avi "" "-an -vcodec ljpeg -strict -1"
157
do_video_decoding
158
fi
159

    
160
if [ -n "$do_jpegls" ] ; then
161
do_video_encoding jpegls.avi "" "-an -vcodec jpegls -vtag MJPG -sws_flags neighbor+full_chroma_int+accurate_rnd+bitexact"
162
do_video_decoding "" "-pix_fmt yuv420p  -sws_flags area+bitexact"
163
fi
164

    
165
if [ -n "$do_rv10" ] ; then
166
do_video_encoding rv10.rm "-qscale 10" "-an"
167
do_video_decoding
168
fi
169

    
170
if [ -n "$do_rv20" ] ; then
171
do_video_encoding rv20.rm "-qscale 10" "-vcodec rv20 -an"
172
do_video_decoding
173
fi
174

    
175
if [ -n "$do_asv1" ] ; then
176
do_video_encoding asv1.avi "-qscale 10" "-an -vcodec asv1"
177
do_video_decoding
178
fi
179

    
180
if [ -n "$do_asv2" ] ; then
181
do_video_encoding asv2.avi "-qscale 10" "-an -vcodec asv2"
182
do_video_decoding
183
fi
184

    
185
if [ -n "$do_flv" ] ; then
186
do_video_encoding flv.flv "-qscale 10" "-an -vcodec flv"
187
do_video_decoding
188
fi
189

    
190
if [ -n "$do_ffv1" ] ; then
191
do_video_encoding ffv1.avi "-strict -2" "-an -vcodec ffv1"
192
do_video_decoding
193
fi
194

    
195
if [ -n "$do_snow" ] ; then
196
do_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"
197
do_video_decoding "" "-s 352x288"
198
fi
199

    
200
if [ -n "$do_snowll" ] ; then
201
do_video_encoding snow53.avi "-strict -2" "-an -vcodec snow -qscale .001 -pred 1 -flags +mv4+qpel"
202
do_video_decoding
203
fi
204

    
205
if [ -n "$do_dv" ] ; then
206
do_video_encoding dv.dv "-dct int" "-s pal -an"
207
do_video_decoding "" "-s cif"
208

    
209
do_video_encoding dv411.dv "-dct int" "-s pal -an -pix_fmt yuv411p -sws_flags area+accurate_rnd+bitexact"
210
do_video_decoding "" "-s cif -sws_flags area+accurate_rnd+bitexact"
211
fi
212

    
213
if [ -n "$do_dv50" ] ; then
214
do_video_encoding dv50.dv "-dct int" "-s pal -pix_fmt yuv422p -an -sws_flags neighbor+bitexact"
215
do_video_decoding "" "-s cif -pix_fmt yuv420p -sws_flags neighbor+bitexact"
216
fi
217

    
218
if [ -n "$do_dnxhd_1080i" ] ; then
219
# FIXME: interlaced raw DNxHD decoding is broken
220
do_video_encoding dnxhd-1080i.mov "" "-vcodec dnxhd -flags +ildct -s hd1080 -b 120Mb -pix_fmt yuv422p -an"
221
do_video_decoding "-r 25" "-s cif -pix_fmt yuv420p"
222
fi
223

    
224
if [ -n "$do_dnxhd_720p" ] ; then
225
do_video_encoding dnxhd-720p.dnxhd "" "-s hd720 -b 90Mb -pix_fmt yuv422p -an"
226
do_video_decoding "-r 25" "-s cif -pix_fmt yuv420p"
227
fi
228

    
229
if [ -n "$do_dnxhd_720p_rd" ] ; then
230
do_video_encoding dnxhd-720p-rd.dnxhd "" "-threads 4 -mbd rd -s hd720 -b 90Mb -pix_fmt yuv422p -an"
231
do_video_decoding "-r 25" "-s cif -pix_fmt yuv420p"
232
fi
233

    
234
if [ -n "$do_svq1" ] ; then
235
do_video_encoding svq1.mov "" "-an -vcodec svq1 -qscale 3 -pix_fmt yuv410p"
236
do_video_decoding "" "-pix_fmt yuv420p"
237
fi
238

    
239
if [ -n "$do_flashsv" ] ; then
240
do_video_encoding flashsv.flv "" "-an -vcodec flashsv -sws_flags neighbor+full_chroma_int+accurate_rnd+bitexact"
241
do_video_decoding "" "-pix_fmt yuv420p -sws_flags area+accurate_rnd+bitexact"
242
fi
243

    
244
if [ -n "$do_mp2" ] ; then
245
do_audio_encoding mp2.mp2 "-ar 44100"
246
do_audio_decoding
247
$tiny_psnr $pcm_dst $pcm_ref 2 1924 >> $logfile
248
fi
249

    
250
if [ -n "$do_ac3" ] ; then
251
do_audio_encoding ac3.rm "" -vn
252
# binaries configured with --disable-sse decode ac3 differently
253
#do_audio_decoding
254
#$tiny_psnr $pcm_dst $pcm_ref 2 1024 >> $logfile
255
fi
256

    
257
if [ -n "$do_g726" ] ; then
258
do_audio_encoding g726.wav "-ar 44100" "-ab 32k -ac 1 -ar 8000 -acodec g726"
259
do_audio_decoding
260
fi
261

    
262
if [ -n "$do_adpcm_ima_wav" ] ; then
263
do_audio_encoding adpcm_ima.wav "-ar 44100" "-acodec adpcm_ima_wav"
264
do_audio_decoding
265
fi
266

    
267
if [ -n "$do_adpcm_ima_qt" ] ; then
268
do_audio_encoding adpcm_qt.aiff "-ar 44100" "-acodec adpcm_ima_qt"
269
do_audio_decoding
270
fi
271

    
272
if [ -n "$do_adpcm_ms" ] ; then
273
do_audio_encoding adpcm_ms.wav "-ar 44100" "-acodec adpcm_ms"
274
do_audio_decoding
275
fi
276

    
277
if [ -n "$do_adpcm_yam" ] ; then
278
do_audio_encoding adpcm_yam.wav "-ar 44100" "-acodec adpcm_yamaha"
279
do_audio_decoding
280
fi
281

    
282
if [ -n "$do_adpcm_swf" ] ; then
283
do_audio_encoding adpcm_swf.flv "-ar 44100" "-acodec adpcm_swf"
284
do_audio_decoding
285
fi
286

    
287
if [ -n "$do_alac" ] ; then
288
do_audio_encoding alac.m4a "-ar 44100" "-acodec alac -compression_level 1"
289
do_audio_decoding
290
fi
291

    
292
if [ -n "$do_flac" ] ; then
293
do_audio_encoding flac.flac "-ar 44100" "-acodec flac -compression_level 2"
294
do_audio_decoding
295
fi
296

    
297
if [ -n "$do_wma" ] ; then
298
# wmav1
299
do_audio_encoding wmav1.asf "-ar 44100" "-acodec wmav1"
300
do_ffmpeg_nomd5 $pcm_dst -i $target_path/$file -f wav
301
$tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
302
# wmav2
303
do_audio_encoding wmav2.asf "-ar 44100" "-acodec wmav2"
304
do_ffmpeg_nomd5 $pcm_dst -i $target_path/$file -f wav
305
$tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
306
fi
307

    
308
#if [ -n "$do_vorbis" ] ; then
309
# vorbis
310
#disabled because it is broken
311
#do_audio_encoding vorbis.asf "-ar 44100" "-acodec vorbis"
312
#do_audio_decoding
313
#fi
314

    
315
do_audio_enc_dec() {
316
    do_audio_encoding $3.$1 "" "$4 -sample_fmt $2 -acodec $3"
317
    do_audio_decoding
318
}
319

    
320
if [ -n "$do_pcm" ] ; then
321
do_audio_enc_dec wav s16 pcm_alaw
322
do_audio_enc_dec wav s16 pcm_mulaw
323
do_audio_enc_dec mov u8 pcm_s8
324
do_audio_enc_dec wav u8 pcm_u8
325
do_audio_enc_dec mov s16 pcm_s16be
326
do_audio_enc_dec wav s16 pcm_s16le
327
do_audio_enc_dec mkv s16 pcm_s16be
328
do_audio_enc_dec mkv s16 pcm_s16le
329
do_audio_enc_dec mov s32 pcm_s24be
330
do_audio_enc_dec wav s32 pcm_s24le
331
#do_audio_enc_dec ??? s32 pcm_u24be #no compatible muxer or demuxer
332
#do_audio_enc_dec ??? s32 pcm_u24le #no compatible muxer or demuxer
333
do_audio_enc_dec mov s32 pcm_s32be
334
do_audio_enc_dec wav s32 pcm_s32le
335
#do_audio_enc_dec ??? s32 pcm_u32be #no compatible muxer or demuxer
336
#do_audio_enc_dec ??? s32 pcm_u32le #no compatible muxer or demuxer
337
do_audio_enc_dec au  flt pcm_f32be
338
do_audio_enc_dec wav flt pcm_f32le
339
do_audio_enc_dec au  dbl pcm_f64be
340
do_audio_enc_dec wav dbl pcm_f64le
341
do_audio_enc_dec wav s16 pcm_zork
342
do_audio_enc_dec 302 s16 pcm_s24daud "-ac 6 -ar 96000"
343
fi
344

    
345
rm -f "$bench" "$bench2"