Statistics
| Branch: | Revision:

ffmpeg / tests / codec-regression.sh @ 2189dbc4

History | View | Annotate | Download (15.1 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
do_lavf()
15
{
16
    file=${outfile}lavf.$1
17
    do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src $2
18
    do_ffmpeg_crc $file -i $target_path/$file $3
19
}
20

    
21
do_streamed_images()
22
{
23
    file=${outfile}${1}pipe.$1
24
    do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f image2pipe
25
    do_ffmpeg_crc $file -f image2pipe -i $target_path/$file
26
}
27

    
28
do_image_formats()
29
{
30
    file=${outfile}lavf%02d.$1
31
    echo $ffmpeg -t 0.5 -y -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src $2 $3 -flags +bitexact -sws_flags +accurate_rnd+bitexact $target_path/$file
32
    $ffmpeg -t 0.5 -y -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src $2 $3 -flags +bitexact -sws_flags +accurate_rnd+bitexact $target_path/$file
33
    do_md5sum ${outfile}lavf02.$1 >> $logfile
34
    do_ffmpeg_crc $file $3 -i $target_path/$file
35
    wc -c ${outfile}lavf02.$1 >> $logfile
36
}
37

    
38
do_audio_only()
39
{
40
    file=${outfile}lavf.$1
41
    do_ffmpeg $file -t 1 -qscale 10 -f s16le -i $pcm_src
42
    do_ffmpeg_crc $file -i $target_path/$file
43
}
44

    
45
rm -f "$logfile"
46
rm -f "$benchfile"
47

    
48
# generate reference for quality check
49
if [ -n "$do_ref" ]; then
50
do_ffmpeg_nocheck $raw_ref -f image2 -vcodec pgmyuv -i $raw_src -an -f rawvideo $target_path/$raw_ref
51
do_ffmpeg_nocheck $pcm_ref -ab 128k -ac 2 -ar 44100 -f s16le -i $pcm_src -f wav $target_path/$pcm_ref
52
fi
53

    
54
if [ -n "$do_mpeg" ] ; then
55
# mpeg1
56
do_video_encoding mpeg1.mpg "-qscale 10" "-f mpeg1video"
57
do_video_decoding
58
fi
59

    
60
if [ -n "$do_mpeg2" ] ; then
61
# mpeg2
62
do_video_encoding mpeg2.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video"
63
do_video_decoding
64

    
65
# mpeg2 encoding intra vlc qprd
66
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"
67
do_video_decoding
68

    
69
#mpeg2 4:2:2 encoding
70
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"
71
do_video_decoding
72

    
73
# mpeg2
74
do_video_encoding mpeg2.mpg "-qscale 10" "-vcodec mpeg2video -idct int -dct int -f mpeg1video"
75
do_video_decoding "-idct int"
76

    
77
# mpeg2 encoding interlaced
78
do_video_encoding mpeg2i.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -flags +ildct+ilme"
79
do_video_decoding
80
fi
81

    
82
if [ -n "$do_mpeg2thread" ] ; then
83
# mpeg2 encoding interlaced
84
do_video_encoding mpeg2thread.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 2"
85
do_video_decoding
86

    
87
# mpeg2 encoding interlaced using intra vlc
88
do_video_encoding mpeg2threadivlc.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -flags2 +ivlc -threads 2"
89
do_video_decoding
90

    
91
# mpeg2 encoding interlaced
92
file=${outfile}mpeg2reuse.mpg
93
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
94
do_video_decoding
95
fi
96

    
97
if [ -n "$do_msmpeg4v2" ] ; then
98
do_video_encoding msmpeg4v2.avi "-qscale 10" "-an -vcodec msmpeg4v2"
99
do_video_decoding
100
fi
101

    
102
if [ -n "$do_msmpeg4" ] ; then
103
do_video_encoding msmpeg4.avi "-qscale 10" "-an -vcodec msmpeg4"
104
do_video_decoding
105
fi
106

    
107
if [ -n "$do_wmv1" ] ; then
108
do_video_encoding wmv1.avi "-qscale 10" "-an -vcodec wmv1"
109
do_video_decoding
110
fi
111

    
112
if [ -n "$do_wmv2" ] ; then
113
do_video_encoding wmv2.avi "-qscale 10" "-an -vcodec wmv2"
114
do_video_decoding
115
fi
116

    
117
if [ -n "$do_h261" ] ; then
118
do_video_encoding h261.avi "-qscale 11" "-s 352x288 -an -vcodec h261"
119
do_video_decoding
120
fi
121

    
122
if [ -n "$do_h263" ] ; then
123
do_video_encoding h263.avi "-qscale 10" "-s 352x288 -an -vcodec h263"
124
do_video_decoding
125
fi
126

    
127
if [ -n "$do_h263p" ] ; then
128
do_video_encoding h263p.avi "-qscale 2 -flags +umv+aiv+aic" "-s 352x288 -an -vcodec h263p -ps 300"
129
do_video_decoding
130
fi
131

    
132
if [ -n "$do_mpeg4" ] ; then
133
do_video_encoding odivx.mp4 "-flags +mv4 -mbd bits -qscale 10" "-an -vcodec mpeg4"
134
do_video_decoding
135
fi
136

    
137
if [ -n "$do_huffyuv" ] ; then
138
do_video_encoding huffyuv.avi "" "-an -vcodec huffyuv -pix_fmt yuv422p -sws_flags neighbor+bitexact"
139
do_video_decoding "" "-strict -2 -pix_fmt yuv420p -sws_flags neighbor+bitexact"
140
fi
141

    
142
if [ -n "$do_rc" ] ; then
143
do_video_encoding mpeg4-rc.avi "-b 400k -bf 2" "-an -vcodec mpeg4"
144
do_video_decoding
145
fi
146

    
147
if [ -n "$do_mpeg4adv" ] ; then
148
do_video_encoding mpeg4-adv.avi "-qscale 9 -flags +mv4+part+aic -trellis 1 -mbd bits -ps 200" "-an -vcodec mpeg4"
149
do_video_decoding
150

    
151
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"
152
do_video_decoding
153

    
154
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"
155
do_video_decoding
156

    
157
do_video_encoding mpeg4-Q.avi "-qscale 7 -flags +mv4+qpel -mbd 2 -bf 2 -cmp 1 -subcmp 2" "-an -vcodec mpeg4"
158
do_video_decoding
159
fi
160

    
161
if [ -n "$do_mpeg4thread" ] ; then
162
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"
163
do_video_decoding
164
fi
165

    
166
if [ -n "$do_error" ] ; then
167
do_video_encoding error-mpeg4-adv.avi "-qscale 7 -flags +mv4+part+aic -mbd rd -ps 250 -error 10" "-an -vcodec mpeg4"
168
do_video_decoding
169
fi
170

    
171
if [ -n "$do_mpeg4nr" ] ; then
172
do_video_encoding mpeg4-nr.avi "-qscale 8 -flags +mv4 -mbd rd -nr 200" "-an -vcodec mpeg4"
173
do_video_decoding
174
fi
175

    
176
if [ -n "$do_mpeg1b" ] ; then
177
do_video_encoding mpeg1b.mpg "-qscale 8 -bf 3 -ps 200" "-an -vcodec mpeg1video -f mpeg1video"
178
do_video_decoding
179
fi
180

    
181
if [ -n "$do_mjpeg" ] ; then
182
do_video_encoding mjpeg.avi "-qscale 10" "-an -vcodec mjpeg -pix_fmt yuvj420p"
183
do_video_decoding "" "-pix_fmt yuv420p"
184
fi
185

    
186
if [ -n "$do_ljpeg" ] ; then
187
do_video_encoding ljpeg.avi "" "-an -vcodec ljpeg -strict -1"
188
do_video_decoding
189
fi
190

    
191
if [ -n "$do_jpegls" ] ; then
192
do_video_encoding jpegls.avi "" "-an -vcodec jpegls -vtag MJPG -sws_flags neighbor+full_chroma_int+accurate_rnd+bitexact"
193
do_video_decoding "" "-pix_fmt yuv420p  -sws_flags area+bitexact"
194
fi
195

    
196
if [ -n "$do_rv10" ] ; then
197
do_video_encoding rv10.rm "-qscale 10" "-an"
198
do_video_decoding
199
fi
200

    
201
if [ -n "$do_rv20" ] ; then
202
do_video_encoding rv20.rm "-qscale 10" "-vcodec rv20 -an"
203
do_video_decoding
204
fi
205

    
206
if [ -n "$do_asv1" ] ; then
207
do_video_encoding asv1.avi "-qscale 10" "-an -vcodec asv1"
208
do_video_decoding
209
fi
210

    
211
if [ -n "$do_asv2" ] ; then
212
do_video_encoding asv2.avi "-qscale 10" "-an -vcodec asv2"
213
do_video_decoding
214
fi
215

    
216
if [ -n "$do_flv" ] ; then
217
do_video_encoding flv.flv "-qscale 10" "-an -vcodec flv"
218
do_video_decoding
219
fi
220

    
221
if [ -n "$do_ffv1" ] ; then
222
do_video_encoding ffv1.avi "-strict -2" "-an -vcodec ffv1"
223
do_video_decoding
224
fi
225

    
226
if [ -n "$do_snow" ] ; then
227
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"
228
do_video_decoding "" "-s 352x288"
229
fi
230

    
231
if [ -n "$do_snowll" ] ; then
232
do_video_encoding snow53.avi "-strict -2" "-an -vcodec snow -qscale .001 -pred 1 -flags +mv4+qpel"
233
do_video_decoding
234
fi
235

    
236
if [ -n "$do_dv" ] ; then
237
do_video_encoding dv.dv "-dct int" "-s pal -an"
238
do_video_decoding "" "-s cif"
239

    
240
do_video_encoding dv411.dv "-dct int" "-s pal -an -pix_fmt yuv411p -sws_flags area+accurate_rnd+bitexact"
241
do_video_decoding "" "-s cif -sws_flags area+accurate_rnd+bitexact"
242
fi
243

    
244
if [ -n "$do_dv50" ] ; then
245
do_video_encoding dv50.dv "-dct int" "-s pal -pix_fmt yuv422p -an -sws_flags neighbor+bitexact"
246
do_video_decoding "" "-s cif -pix_fmt yuv420p -sws_flags neighbor+bitexact"
247
fi
248

    
249
if [ -n "$do_dnxhd_1080i" ] ; then
250
# FIXME: interlaced raw DNxHD decoding is broken
251
do_video_encoding dnxhd-1080i.mov "" "-vcodec dnxhd -flags +ildct -s hd1080 -b 120Mb -pix_fmt yuv422p -an"
252
do_video_decoding "-r 25" "-s cif -pix_fmt yuv420p"
253
fi
254

    
255
if [ -n "$do_dnxhd_720p" ] ; then
256
do_video_encoding dnxhd-720p.dnxhd "" "-s hd720 -b 90Mb -pix_fmt yuv422p -an"
257
do_video_decoding "-r 25" "-s cif -pix_fmt yuv420p"
258
fi
259

    
260
if [ -n "$do_dnxhd_720p_rd" ] ; then
261
do_video_encoding dnxhd-720p-rd.dnxhd "" "-threads 4 -mbd rd -s hd720 -b 90Mb -pix_fmt yuv422p -an"
262
do_video_decoding "-r 25" "-s cif -pix_fmt yuv420p"
263
fi
264

    
265
if [ -n "$do_svq1" ] ; then
266
do_video_encoding svq1.mov "" "-an -vcodec svq1 -qscale 3 -pix_fmt yuv410p"
267
do_video_decoding "" "-pix_fmt yuv420p"
268
fi
269

    
270
if [ -n "$do_flashsv" ] ; then
271
do_video_encoding flashsv.flv "" "-an -vcodec flashsv -sws_flags neighbor+full_chroma_int+accurate_rnd+bitexact"
272
do_video_decoding "" "-pix_fmt yuv420p -sws_flags area+accurate_rnd+bitexact"
273
fi
274

    
275
if [ -n "$do_mp2" ] ; then
276
do_audio_encoding mp2.mp2 "-ar 44100"
277
do_audio_decoding
278
$tiny_psnr $pcm_dst $pcm_ref 2 1924 >> $logfile
279
fi
280

    
281
if [ -n "$do_ac3" ] ; then
282
do_audio_encoding ac3.rm "" -vn
283
# binaries configured with --disable-sse decode ac3 differently
284
#do_audio_decoding
285
#$tiny_psnr $pcm_dst $pcm_ref 2 1024 >> $logfile
286
fi
287

    
288
if [ -n "$do_g726" ] ; then
289
do_audio_encoding g726.wav "-ar 44100" "-ab 32k -ac 1 -ar 8000 -acodec g726"
290
do_audio_decoding
291
fi
292

    
293
if [ -n "$do_adpcm_ima_wav" ] ; then
294
do_audio_encoding adpcm_ima.wav "-ar 44100" "-acodec adpcm_ima_wav"
295
do_audio_decoding
296
fi
297

    
298
if [ -n "$do_adpcm_ima_qt" ] ; then
299
do_audio_encoding adpcm_qt.aiff "-ar 44100" "-acodec adpcm_ima_qt"
300
do_audio_decoding
301
fi
302

    
303
if [ -n "$do_adpcm_ms" ] ; then
304
do_audio_encoding adpcm_ms.wav "-ar 44100" "-acodec adpcm_ms"
305
do_audio_decoding
306
fi
307

    
308
if [ -n "$do_adpcm_yam" ] ; then
309
do_audio_encoding adpcm_yam.wav "-ar 44100" "-acodec adpcm_yamaha"
310
do_audio_decoding
311
fi
312

    
313
if [ -n "$do_adpcm_swf" ] ; then
314
do_audio_encoding adpcm_swf.flv "-ar 44100" "-acodec adpcm_swf"
315
do_audio_decoding
316
fi
317

    
318
if [ -n "$do_alac" ] ; then
319
do_audio_encoding alac.m4a "-ar 44100" "-acodec alac -compression_level 1"
320
do_audio_decoding
321
fi
322

    
323
if [ -n "$do_flac" ] ; then
324
do_audio_encoding flac.flac "-ar 44100" "-acodec flac -compression_level 2"
325
do_audio_decoding
326
fi
327

    
328
if [ -n "$do_wma" ] ; then
329
# wmav1
330
do_audio_encoding wmav1.asf "-ar 44100" "-acodec wmav1"
331
do_ffmpeg_nomd5 $pcm_dst -i $target_path/$file -f wav
332
$tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
333
# wmav2
334
do_audio_encoding wmav2.asf "-ar 44100" "-acodec wmav2"
335
do_ffmpeg_nomd5 $pcm_dst -i $target_path/$file -f wav
336
$tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
337
fi
338

    
339
#if [ -n "$do_vorbis" ] ; then
340
# vorbis
341
#disabled because it is broken
342
#do_audio_encoding vorbis.asf "-ar 44100" "-acodec vorbis"
343
#do_audio_decoding
344
#fi
345

    
346
do_audio_enc_dec() {
347
    do_audio_encoding $3.$1 "" "$4 -sample_fmt $2 -acodec $3"
348
    do_audio_decoding
349
}
350

    
351
if [ -n "$do_pcm" ] ; then
352
do_audio_enc_dec wav s16 pcm_alaw
353
do_audio_enc_dec wav s16 pcm_mulaw
354
do_audio_enc_dec mov u8 pcm_s8
355
do_audio_enc_dec wav u8 pcm_u8
356
do_audio_enc_dec mov s16 pcm_s16be
357
do_audio_enc_dec wav s16 pcm_s16le
358
do_audio_enc_dec mkv s16 pcm_s16be
359
do_audio_enc_dec mkv s16 pcm_s16le
360
do_audio_enc_dec mov s32 pcm_s24be
361
do_audio_enc_dec wav s32 pcm_s24le
362
#do_audio_enc_dec ??? s32 pcm_u24be #no compatible muxer or demuxer
363
#do_audio_enc_dec ??? s32 pcm_u24le #no compatible muxer or demuxer
364
do_audio_enc_dec mov s32 pcm_s32be
365
do_audio_enc_dec wav s32 pcm_s32le
366
#do_audio_enc_dec ??? s32 pcm_u32be #no compatible muxer or demuxer
367
#do_audio_enc_dec ??? s32 pcm_u32le #no compatible muxer or demuxer
368
do_audio_enc_dec au  flt pcm_f32be
369
do_audio_enc_dec wav flt pcm_f32le
370
do_audio_enc_dec au  dbl pcm_f64be
371
do_audio_enc_dec wav dbl pcm_f64le
372
do_audio_enc_dec wav s16 pcm_zork
373
do_audio_enc_dec 302 s16 pcm_s24daud "-ac 6 -ar 96000"
374
fi
375

    
376
# libavformat testing
377

    
378
if [ -n "$do_avi" ] ; then
379
do_lavf avi
380
fi
381

    
382
if [ -n "$do_asf" ] ; then
383
do_lavf asf "-acodec mp2" "-r 25"
384
fi
385

    
386
if [ -n "$do_rm" ] ; then
387
file=${outfile}lavf.rm
388
do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src
389
# broken
390
#do_ffmpeg_crc $file -i $target_path/$file
391
fi
392

    
393
if [ -n "$do_mpg" ] ; then
394
do_lavf mpg
395
fi
396

    
397
if [ -n "$do_mxf" ] ; then
398
do_lavf mxf "-ar 48000 -bf 2 -timecode_frame_start 264363"
399
do_lavf mxf_d10 "-ar 48000 -ac 2 -r 25 -s 720x576 -padtop 32 -vcodec mpeg2video -intra -flags +ildct+low_delay -dc 10 -flags2 +ivlc+non_linear_q -qscale 1 -ps 1 -qmin 1 -rc_max_vbv_use 1 -rc_min_vbv_use 1 -pix_fmt yuv422p -minrate 30000k -maxrate 30000k -b 30000k -bufsize 1200000 -top 1 -rc_init_occupancy 1200000 -qmax 12 -f mxf_d10"
400
fi
401

    
402
if [ -n "$do_ts" ] ; then
403
do_lavf ts
404
fi
405

    
406
if [ -n "$do_swf" ] ; then
407
do_lavf swf -an
408
fi
409

    
410
if [ -n "$do_ffm" ] ; then
411
do_lavf ffm
412
fi
413

    
414
if [ -n "$do_flv_fmt" ] ; then
415
do_lavf flv -an
416
fi
417

    
418
if [ -n "$do_mov" ] ; then
419
do_lavf mov "-acodec pcm_alaw"
420
fi
421

    
422
if [ -n "$do_dv_fmt" ] ; then
423
do_lavf dv "-ar 48000 -r 25 -s pal -ac 2"
424
fi
425

    
426
if [ -n "$do_gxf" ] ; then
427
do_lavf gxf "-ar 48000 -r 25 -s pal -ac 1"
428
fi
429

    
430
if [ -n "$do_nut" ] ; then
431
do_lavf nut "-acodec mp2"
432
fi
433

    
434
if [ -n "$do_mkv" ] ; then
435
do_lavf mkv
436
fi
437

    
438

    
439
# streamed images
440
# mjpeg
441
#file=${outfile}lavf.mjpeg
442
#do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src
443
#do_ffmpeg_crc $file -i $target_path/$file
444

    
445
if [ -n "$do_pbmpipe" ] ; then
446
do_streamed_images pbm
447
fi
448

    
449
if [ -n "$do_pgmpipe" ] ; then
450
do_streamed_images pgm
451
fi
452

    
453
if [ -n "$do_ppmpipe" ] ; then
454
do_streamed_images ppm
455
fi
456

    
457
if [ -n "$do_gif" ] ; then
458
file=${outfile}lavf.gif
459
do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -pix_fmt rgb24
460
#do_ffmpeg_crc $file -i $target_path/$file
461
fi
462

    
463
if [ -n "$do_yuv4mpeg" ] ; then
464
file=${outfile}lavf.y4m
465
do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src
466
#do_ffmpeg_crc $file -i $target_path/$file
467
fi
468

    
469
# image formats
470

    
471
if [ -n "$do_pgm" ] ; then
472
do_image_formats pgm
473
fi
474

    
475
if [ -n "$do_ppm" ] ; then
476
do_image_formats ppm
477
fi
478

    
479
if [ -n "$do_bmp" ] ; then
480
do_image_formats bmp
481
fi
482

    
483
if [ -n "$do_tga" ] ; then
484
do_image_formats tga
485
fi
486

    
487
if [ -n "$do_tiff" ] ; then
488
do_image_formats tiff "-pix_fmt rgb24"
489
fi
490

    
491
if [ -n "$do_sgi" ] ; then
492
do_image_formats sgi
493
fi
494

    
495
if [ -n "$do_jpg" ] ; then
496
do_image_formats jpg "-flags +bitexact -dct fastint -idct simple -pix_fmt yuvj420p" "-f image2"
497
fi
498

    
499
if [ -n "$do_pcx" ] ; then
500
do_image_formats pcx
501
fi
502

    
503
# audio only
504

    
505
if [ -n "$do_wav" ] ; then
506
do_audio_only wav
507
fi
508

    
509
if [ -n "$do_alaw" ] ; then
510
do_audio_only al
511
fi
512

    
513
if [ -n "$do_mulaw" ] ; then
514
do_audio_only ul
515
fi
516

    
517
if [ -n "$do_au" ] ; then
518
do_audio_only au
519
fi
520

    
521
if [ -n "$do_mmf" ] ; then
522
do_audio_only mmf
523
fi
524

    
525
if [ -n "$do_aiff" ] ; then
526
do_audio_only aif
527
fi
528

    
529
if [ -n "$do_voc" ] ; then
530
do_audio_only voc
531
fi
532

    
533
if [ -n "$do_ogg" ] ; then
534
do_audio_only ogg
535
fi
536

    
537
# pix_fmt conversions
538

    
539
if [ -n "$do_pixfmt" ] ; then
540
conversions="yuv420p yuv422p yuv444p yuyv422 yuv410p yuv411p yuvj420p \
541
             yuvj422p yuvj444p rgb24 bgr24 rgb32 rgb565 rgb555 gray monow \
542
             monob yuv440p yuvj440p"
543
for pix_fmt in $conversions ; do
544
    file=${outfile}lavf-${pix_fmt}.yuv
545
    do_ffmpeg_nocheck $file -r 1 -t 1 -f image2 -vcodec pgmyuv -i $raw_src \
546
                            -f rawvideo -s 352x288 -pix_fmt $pix_fmt $target_path/$raw_dst
547
    do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $target_path/$raw_dst \
548
                    -f rawvideo -s 352x288 -pix_fmt yuv444p
549
done
550
fi
551

    
552
# libavfilter testing
553

    
554
do_lavfi() {
555
    test_name=$1
556
    eval test=\$do_$test_name
557
    vfilters=$2
558

    
559
    if [ -n "$test" ] ; then
560
        do_video_encoding ${test_name}.avi "" "-vcodec rawvideo -vfilters $vfilters"
561
    fi
562
}
563

    
564
# example tests:
565
# do_lavfi "crop" "crop=100:100:-1:-1"
566
# do_lavfi "crop_scale" "crop=100:100,scale=200:-1"
567
# do_lavfi "scale" "scale=200:200"
568

    
569
# TODO: add tests for
570
# direct rendering,
571
# slices
572
# chains with feedback loops
573

    
574
rm -f "$bench" "$bench2"