]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/blob - tests/codec-regression.sh
PPC: 32-bit asm for MAC64 and MLS64
[frescor/ffmpeg.git] / tests / codec-regression.sh
1 #!/bin/sh
2 #
3 # automatic regression test for ffmpeg
4 #
5 #
6 #set -x
7
8 set -e
9
10 target_exec=$5
11 target_path=$6
12
13 datadir="./tests/data"
14 target_datadir="${target_path}/${datadir}"
15
16 test="${1#regtest-}"
17 this="$test.$2"
18 logfile="$datadir/$this.regression"
19 outfile="$datadir/$4-"
20
21 eval do_$test=y
22
23 # various files
24 ffmpeg="$target_exec ${target_path}/ffmpeg_g"
25 tiny_psnr="tests/tiny_psnr"
26 benchfile="$datadir/$this.bench"
27 bench="$datadir/$this.bench.tmp"
28 bench2="$datadir/$this.bench2.tmp"
29 raw_src="${target_path}/$3/%02d.pgm"
30 raw_dst="$datadir/$this.out.yuv"
31 raw_ref="$datadir/$2.ref.yuv"
32 pcm_src="$target_datadir/asynth1.sw"
33 pcm_dst="$datadir/$this.out.wav"
34 pcm_ref="$datadir/$2.ref.wav"
35 crcfile="$datadir/$this.crc"
36 target_crcfile="$target_datadir/$this.crc"
37
38 if [ X"`echo | md5sum 2> /dev/null`" != X ]; then
39     do_md5sum() { md5sum -b $1; }
40 elif [ X"`echo | md5 2> /dev/null`" != X ]; then
41     do_md5sum() { md5 -r $1 | sed 's# \**\./# *./#'; }
42 elif [ -x /sbin/md5 ]; then
43     do_md5sum() { /sbin/md5 -r $1 | sed 's# \**\./# *./#'; }
44 else
45     do_md5sum() { echo No md5sum program found; }
46 fi
47
48 FFMPEG_OPTS="-y -flags +bitexact -dct fastint -idct simple -sws_flags +accurate_rnd+bitexact"
49
50 do_ffmpeg()
51 {
52     f="$1"
53     shift
54     set -- $* ${target_path}/$f
55     echo $ffmpeg $FFMPEG_OPTS $*
56     $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
57     egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
58     rm -f /tmp/ffmpeg$$
59     do_md5sum $f >> $logfile
60     if [ $f = $raw_dst ] ; then
61         $tiny_psnr $f $raw_ref >> $logfile
62     elif [ $f = $pcm_dst ] ; then
63         $tiny_psnr $f $pcm_ref 2 >> $logfile
64     else
65         wc -c $f >> $logfile
66     fi
67     expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
68     echo `cat $bench2` $f >> $benchfile
69 }
70
71 do_ffmpeg_nomd5()
72 {
73     f="$1"
74     shift
75     set -- $* ${target_path}/$f
76     echo $ffmpeg $FFMPEG_OPTS $*
77     $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
78     egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
79     rm -f /tmp/ffmpeg$$
80     if [ $f = $raw_dst ] ; then
81         $tiny_psnr $f $raw_ref >> $logfile
82     elif [ $f = $pcm_dst ] ; then
83         $tiny_psnr $f $pcm_ref 2 >> $logfile
84     else
85         wc -c $f >> $logfile
86     fi
87     expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
88     echo `cat $bench2` $f >> $benchfile
89 }
90
91 do_ffmpeg_crc()
92 {
93     f="$1"
94     shift
95     echo $ffmpeg $FFMPEG_OPTS $* -f crc "$target_crcfile"
96     $ffmpeg $FFMPEG_OPTS $* -f crc "$target_crcfile" > /tmp/ffmpeg$$ 2>&1
97     egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:|ffmpeg version|  configuration|  built)" /tmp/ffmpeg$$ || true
98     rm -f /tmp/ffmpeg$$
99     echo "$f `cat $crcfile`" >> $logfile
100     rm -f "$crcfile"
101 }
102
103 do_ffmpeg_nocheck()
104 {
105     f="$1"
106     shift
107     echo $ffmpeg $FFMPEG_OPTS $*
108     $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
109     egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
110     rm -f /tmp/ffmpeg$$
111     expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
112     echo `cat $bench2` $f >> $benchfile
113 }
114
115 do_video_decoding()
116 {
117     do_ffmpeg $raw_dst $1 -i $target_path/$file -f rawvideo $2
118     rm -f $raw_dst
119 }
120
121 do_video_encoding()
122 {
123     file=${outfile}$1
124     do_ffmpeg $file $2 -f image2 -vcodec pgmyuv -i $raw_src $3
125 }
126
127 do_audio_encoding()
128 {
129     file=${outfile}$1
130     do_ffmpeg $file -ab 128k -ac 2 -f s16le -i $pcm_src $3
131 }
132
133 do_audio_decoding()
134 {
135     do_ffmpeg $pcm_dst -i $target_path/$file -sample_fmt s16 -f wav
136 }
137
138 do_lavf()
139 {
140     file=${outfile}lavf.$1
141     do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src $2
142     do_ffmpeg_crc $file -i $target_path/$file $3
143 }
144
145 do_streamed_images()
146 {
147     file=${outfile}${1}pipe.$1
148     do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f image2pipe
149     do_ffmpeg_crc $file -f image2pipe -i $target_path/$file
150 }
151
152 do_image_formats()
153 {
154     file=${outfile}lavf%02d.$1
155     $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
156     do_md5sum ${outfile}lavf02.$1 >> $logfile
157     do_ffmpeg_crc $file $3 -i $target_path/$file
158     wc -c ${outfile}lavf02.$1 >> $logfile
159 }
160
161 do_audio_only()
162 {
163     file=${outfile}lavf.$1
164     do_ffmpeg $file -t 1 -qscale 10 -f s16le -i $pcm_src
165     do_ffmpeg_crc $file -i $target_path/$file
166 }
167
168 rm -f "$logfile"
169 rm -f "$benchfile"
170
171 # generate reference for quality check
172 if [ -n "$do_ref" ]; then
173 do_ffmpeg_nocheck $raw_ref -f image2 -vcodec pgmyuv -i $raw_src -an -f rawvideo $target_path/$raw_ref
174 do_ffmpeg_nocheck $pcm_ref -ab 128k -ac 2 -ar 44100 -f s16le -i $pcm_src -f wav $target_path/$pcm_ref
175 fi
176
177 if [ -n "$do_mpeg" ] ; then
178 # mpeg1
179 do_video_encoding mpeg1.mpg "-qscale 10" "-f mpeg1video"
180 do_video_decoding
181 fi
182
183 if [ -n "$do_mpeg2" ] ; then
184 # mpeg2
185 do_video_encoding mpeg2.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video"
186 do_video_decoding
187
188 # mpeg2 encoding intra vlc qprd
189 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"
190 do_video_decoding
191
192 #mpeg2 4:2:2 encoding
193 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"
194 do_video_decoding
195
196 # mpeg2
197 do_video_encoding mpeg2.mpg "-qscale 10" "-vcodec mpeg2video -idct int -dct int -f mpeg1video"
198 do_video_decoding "-idct int"
199
200 # mpeg2 encoding interlaced
201 do_video_encoding mpeg2i.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -flags +ildct+ilme"
202 do_video_decoding
203 fi
204
205 if [ -n "$do_mpeg2thread" ] ; then
206 # mpeg2 encoding interlaced
207 do_video_encoding mpeg2thread.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 2"
208 do_video_decoding
209
210 # mpeg2 encoding interlaced using intra vlc
211 do_video_encoding mpeg2threadivlc.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -flags2 +ivlc -threads 2"
212 do_video_decoding
213
214 # mpeg2 encoding interlaced
215 file=${outfile}mpeg2reuse.mpg
216 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
217 do_video_decoding
218 fi
219
220 if [ -n "$do_msmpeg4v2" ] ; then
221 do_video_encoding msmpeg4v2.avi "-qscale 10" "-an -vcodec msmpeg4v2"
222 do_video_decoding
223 fi
224
225 if [ -n "$do_msmpeg4" ] ; then
226 do_video_encoding msmpeg4.avi "-qscale 10" "-an -vcodec msmpeg4"
227 do_video_decoding
228 fi
229
230 if [ -n "$do_wmv1" ] ; then
231 do_video_encoding wmv1.avi "-qscale 10" "-an -vcodec wmv1"
232 do_video_decoding
233 fi
234
235 if [ -n "$do_wmv2" ] ; then
236 do_video_encoding wmv2.avi "-qscale 10" "-an -vcodec wmv2"
237 do_video_decoding
238 fi
239
240 if [ -n "$do_h261" ] ; then
241 do_video_encoding h261.avi "-qscale 11" "-s 352x288 -an -vcodec h261"
242 do_video_decoding
243 fi
244
245 if [ -n "$do_h263" ] ; then
246 do_video_encoding h263.avi "-qscale 10" "-s 352x288 -an -vcodec h263"
247 do_video_decoding
248 fi
249
250 if [ -n "$do_h263p" ] ; then
251 do_video_encoding h263p.avi "-qscale 2 -flags +umv+aiv+aic" "-s 352x288 -an -vcodec h263p -ps 300"
252 do_video_decoding
253 fi
254
255 if [ -n "$do_mpeg4" ] ; then
256 do_video_encoding odivx.mp4 "-flags +mv4 -mbd bits -qscale 10" "-an -vcodec mpeg4"
257 do_video_decoding
258 fi
259
260 if [ -n "$do_huffyuv" ] ; then
261 do_video_encoding huffyuv.avi "" "-an -vcodec huffyuv -pix_fmt yuv422p -sws_flags neighbor+bitexact"
262 do_video_decoding "" "-strict -2 -pix_fmt yuv420p -sws_flags neighbor+bitexact"
263 fi
264
265 if [ -n "$do_rc" ] ; then
266 do_video_encoding mpeg4-rc.avi "-b 400k -bf 2" "-an -vcodec mpeg4"
267 do_video_decoding
268 fi
269
270 if [ -n "$do_mpeg4adv" ] ; then
271 do_video_encoding mpeg4-adv.avi "-qscale 9 -flags +mv4+part+aic -trellis 1 -mbd bits -ps 200" "-an -vcodec mpeg4"
272 do_video_decoding
273
274 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"
275 do_video_decoding
276
277 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"
278 do_video_decoding
279
280 do_video_encoding mpeg4-Q.avi "-qscale 7 -flags +mv4+qpel -mbd 2 -bf 2 -cmp 1 -subcmp 2" "-an -vcodec mpeg4"
281 do_video_decoding
282 fi
283
284 if [ -n "$do_mpeg4thread" ] ; then
285 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"
286 do_video_decoding
287 fi
288
289 if [ -n "$do_error" ] ; then
290 do_video_encoding error-mpeg4-adv.avi "-qscale 7 -flags +mv4+part+aic -mbd rd -ps 250 -error 10" "-an -vcodec mpeg4"
291 do_video_decoding
292 fi
293
294 if [ -n "$do_mpeg4nr" ] ; then
295 do_video_encoding mpeg4-nr.avi "-qscale 8 -flags +mv4 -mbd rd -nr 200" "-an -vcodec mpeg4"
296 do_video_decoding
297 fi
298
299 if [ -n "$do_mpeg1b" ] ; then
300 do_video_encoding mpeg1b.mpg "-qscale 8 -bf 3 -ps 200" "-an -vcodec mpeg1video -f mpeg1video"
301 do_video_decoding
302 fi
303
304 if [ -n "$do_mjpeg" ] ; then
305 do_video_encoding mjpeg.avi "-qscale 10" "-an -vcodec mjpeg -pix_fmt yuvj420p"
306 do_video_decoding "" "-pix_fmt yuv420p"
307 fi
308
309 if [ -n "$do_ljpeg" ] ; then
310 do_video_encoding ljpeg.avi "" "-an -vcodec ljpeg -strict -1"
311 do_video_decoding
312 fi
313
314 if [ -n "$do_jpegls" ] ; then
315 do_video_encoding jpegls.avi "" "-an -vcodec jpegls -vtag MJPG -sws_flags neighbor+full_chroma_int+accurate_rnd+bitexact"
316 do_video_decoding "" "-pix_fmt yuv420p  -sws_flags area+bitexact"
317 fi
318
319 if [ -n "$do_rv10" ] ; then
320 do_video_encoding rv10.rm "-qscale 10" "-an"
321 do_video_decoding
322 fi
323
324 if [ -n "$do_rv20" ] ; then
325 do_video_encoding rv20.rm "-qscale 10" "-vcodec rv20 -an"
326 do_video_decoding
327 fi
328
329 if [ -n "$do_asv1" ] ; then
330 do_video_encoding asv1.avi "-qscale 10" "-an -vcodec asv1"
331 do_video_decoding
332 fi
333
334 if [ -n "$do_asv2" ] ; then
335 do_video_encoding asv2.avi "-qscale 10" "-an -vcodec asv2"
336 do_video_decoding
337 fi
338
339 if [ -n "$do_flv" ] ; then
340 do_video_encoding flv.flv "-qscale 10" "-an -vcodec flv"
341 do_video_decoding
342 fi
343
344 if [ -n "$do_ffv1" ] ; then
345 do_video_encoding ffv1.avi "-strict -2" "-an -vcodec ffv1"
346 do_video_decoding
347 fi
348
349 if [ -n "$do_snow" ] ; then
350 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"
351 do_video_decoding "" "-s 352x288"
352 fi
353
354 if [ -n "$do_snowll" ] ; then
355 do_video_encoding snow53.avi "-strict -2" "-an -vcodec snow -qscale .001 -pred 1 -flags +mv4+qpel"
356 do_video_decoding
357 fi
358
359 if [ -n "$do_dv" ] ; then
360 do_video_encoding dv.dv "-dct int" "-s pal -an"
361 do_video_decoding "" "-s cif"
362
363 do_video_encoding dv411.dv "-dct int" "-s pal -an -pix_fmt yuv411p -sws_flags area+accurate_rnd+bitexact"
364 do_video_decoding "" "-s cif -sws_flags area+accurate_rnd+bitexact"
365 fi
366
367 if [ -n "$do_dv50" ] ; then
368 do_video_encoding dv50.dv "-dct int" "-s pal -pix_fmt yuv422p -an -sws_flags neighbor+bitexact"
369 do_video_decoding "" "-s cif -pix_fmt yuv420p -sws_flags neighbor+bitexact"
370 fi
371
372 if [ -n "$do_svq1" ] ; then
373 do_video_encoding svq1.mov "" "-an -vcodec svq1 -qscale 3 -pix_fmt yuv410p"
374 do_video_decoding "" "-pix_fmt yuv420p"
375 fi
376
377 if [ -n "$do_flashsv" ] ; then
378 do_video_encoding flashsv.flv "" "-an -vcodec flashsv -sws_flags neighbor+full_chroma_int+accurate_rnd+bitexact"
379 do_video_decoding "" "-pix_fmt yuv420p -sws_flags area+accurate_rnd+bitexact"
380 fi
381
382 if [ -n "$do_mp2" ] ; then
383 do_audio_encoding mp2.mp2 "-ar 44100"
384 do_audio_decoding
385 $tiny_psnr $pcm_dst $pcm_ref 2 1924 >> $logfile
386 fi
387
388 if [ -n "$do_ac3" ] ; then
389 do_audio_encoding ac3.rm "" -vn
390 # binaries configured with --disable-sse decode ac3 differently
391 #do_audio_decoding
392 #$tiny_psnr $pcm_dst $pcm_ref 2 1024 >> $logfile
393 fi
394
395 if [ -n "$do_g726" ] ; then
396 do_audio_encoding g726.wav "-ar 44100" "-ab 32k -ac 1 -ar 8000 -acodec g726"
397 do_audio_decoding
398 fi
399
400 if [ -n "$do_adpcm_ima_wav" ] ; then
401 do_audio_encoding adpcm_ima.wav "-ar 44100" "-acodec adpcm_ima_wav"
402 do_audio_decoding
403 fi
404
405 if [ -n "$do_adpcm_ima_qt" ] ; then
406 do_audio_encoding adpcm_qt.aiff "-ar 44100" "-acodec adpcm_ima_qt"
407 do_audio_decoding
408 fi
409
410 if [ -n "$do_adpcm_ms" ] ; then
411 do_audio_encoding adpcm_ms.wav "-ar 44100" "-acodec adpcm_ms"
412 do_audio_decoding
413 fi
414
415 if [ -n "$do_adpcm_yam" ] ; then
416 do_audio_encoding adpcm_yam.wav "-ar 44100" "-acodec adpcm_yamaha"
417 do_audio_decoding
418 fi
419
420 if [ -n "$do_adpcm_swf" ] ; then
421 do_audio_encoding adpcm_swf.flv "-ar 44100" "-acodec adpcm_swf"
422 do_audio_decoding
423 fi
424
425 if [ -n "$do_flac" ] ; then
426 do_audio_encoding flac.flac "-ar 44100" "-acodec flac -compression_level 2"
427 do_audio_decoding
428 fi
429
430 if [ -n "$do_wma" ] ; then
431 # wmav1
432 do_audio_encoding wmav1.asf "-ar 44100" "-acodec wmav1"
433 do_ffmpeg_nomd5 $pcm_dst -i $target_path/$file -f wav
434 $tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
435 # wmav2
436 do_audio_encoding wmav2.asf "-ar 44100" "-acodec wmav2"
437 do_ffmpeg_nomd5 $pcm_dst -i $target_path/$file -f wav
438 $tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
439 fi
440
441 #if [ -n "$do_vorbis" ] ; then
442 # vorbis
443 #disabled because it is broken
444 #do_audio_encoding vorbis.asf "-ar 44100" "-acodec vorbis"
445 #do_audio_decoding
446 #fi
447
448 do_audio_enc_dec() {
449     do_audio_encoding $3.$1 "" "$4 -sample_fmt $2 -acodec $3"
450     do_audio_decoding
451 }
452
453 if [ -n "$do_pcm" ] ; then
454 do_audio_enc_dec wav s16 pcm_alaw
455 do_audio_enc_dec wav s16 pcm_mulaw
456 do_audio_enc_dec mov u8 pcm_s8
457 do_audio_enc_dec wav u8 pcm_u8
458 do_audio_enc_dec mov s16 pcm_s16be
459 do_audio_enc_dec wav s16 pcm_s16le
460 do_audio_enc_dec mkv s16 pcm_s16be
461 do_audio_enc_dec mkv s16 pcm_s16le
462 do_audio_enc_dec mov s32 pcm_s24be
463 do_audio_enc_dec wav s32 pcm_s24le
464 #do_audio_enc_dec ??? s32 pcm_u24be #no compatible muxer or demuxer
465 #do_audio_enc_dec ??? s32 pcm_u24le #no compatible muxer or demuxer
466 do_audio_enc_dec mov s32 pcm_s32be
467 do_audio_enc_dec wav s32 pcm_s32le
468 #do_audio_enc_dec ??? s32 pcm_u32be #no compatible muxer or demuxer
469 #do_audio_enc_dec ??? s32 pcm_u32le #no compatible muxer or demuxer
470 do_audio_enc_dec au  flt pcm_f32be
471 do_audio_enc_dec wav flt pcm_f32le
472 do_audio_enc_dec au  dbl pcm_f64be
473 do_audio_enc_dec wav dbl pcm_f64le
474 do_audio_enc_dec wav s16 pcm_zork
475 do_audio_enc_dec 302 s16 pcm_s24daud "-ac 6 -ar 96000"
476 fi
477
478 # libavformat testing
479
480 if [ -n "$do_avi" ] ; then
481 do_lavf avi
482 fi
483
484 if [ -n "$do_asf" ] ; then
485 do_lavf asf "-acodec mp2" "-r 25"
486 fi
487
488 if [ -n "$do_rm" ] ; then
489 file=${outfile}lavf.rm
490 do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src
491 # broken
492 #do_ffmpeg_crc $file -i $target_path/$file
493 fi
494
495 if [ -n "$do_mpg" ] ; then
496 do_lavf mpg
497 fi
498
499 if [ -n "$do_mxf" ] ; then
500 do_lavf mxf "-ar 48000 -bf 2 -timecode_frame_start 264363"
501 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"
502 fi
503
504 if [ -n "$do_ts" ] ; then
505 do_lavf ts
506 fi
507
508 if [ -n "$do_swf" ] ; then
509 do_lavf swf -an
510 fi
511
512 if [ -n "$do_ffm" ] ; then
513 do_lavf ffm
514 fi
515
516 if [ -n "$do_flv_fmt" ] ; then
517 do_lavf flv -an
518 fi
519
520 if [ -n "$do_mov" ] ; then
521 do_lavf mov "-acodec pcm_alaw"
522 fi
523
524 if [ -n "$do_dv_fmt" ] ; then
525 do_lavf dv "-ar 48000 -r 25 -s pal -ac 2"
526 fi
527
528 if [ -n "$do_gxf" ] ; then
529 do_lavf gxf "-ar 48000 -r 25 -s pal -ac 1"
530 fi
531
532 if [ -n "$do_nut" ] ; then
533 do_lavf nut "-acodec mp2"
534 fi
535
536 if [ -n "$do_mkv" ] ; then
537 do_lavf mkv
538 fi
539
540
541 # streamed images
542 # mjpeg
543 #file=${outfile}lavf.mjpeg
544 #do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src
545 #do_ffmpeg_crc $file -i $target_path/$file
546
547 if [ -n "$do_pbmpipe" ] ; then
548 do_streamed_images pbm
549 fi
550
551 if [ -n "$do_pgmpipe" ] ; then
552 do_streamed_images pgm
553 fi
554
555 if [ -n "$do_ppmpipe" ] ; then
556 do_streamed_images ppm
557 fi
558
559 if [ -n "$do_gif" ] ; then
560 file=${outfile}lavf.gif
561 do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -pix_fmt rgb24
562 #do_ffmpeg_crc $file -i $target_path/$file
563 fi
564
565 if [ -n "$do_yuv4mpeg" ] ; then
566 file=${outfile}lavf.y4m
567 do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src
568 #do_ffmpeg_crc $file -i $target_path/$file
569 fi
570
571 # image formats
572
573 if [ -n "$do_pgm" ] ; then
574 do_image_formats pgm
575 fi
576
577 if [ -n "$do_ppm" ] ; then
578 do_image_formats ppm
579 fi
580
581 if [ -n "$do_bmp" ] ; then
582 do_image_formats bmp
583 fi
584
585 if [ -n "$do_tga" ] ; then
586 do_image_formats tga
587 fi
588
589 if [ -n "$do_tiff" ] ; then
590 do_image_formats tiff "-pix_fmt rgb24"
591 fi
592
593 if [ -n "$do_sgi" ] ; then
594 do_image_formats sgi
595 fi
596
597 if [ -n "$do_jpg" ] ; then
598 do_image_formats jpg "-flags +bitexact -dct fastint -idct simple -pix_fmt yuvj420p" "-f image2"
599 fi
600
601 if [ -n "$do_pcx" ] ; then
602 do_image_formats pcx
603 fi
604
605 # audio only
606
607 if [ -n "$do_wav" ] ; then
608 do_audio_only wav
609 fi
610
611 if [ -n "$do_alaw" ] ; then
612 do_audio_only al
613 fi
614
615 if [ -n "$do_mulaw" ] ; then
616 do_audio_only ul
617 fi
618
619 if [ -n "$do_au" ] ; then
620 do_audio_only au
621 fi
622
623 if [ -n "$do_mmf" ] ; then
624 do_audio_only mmf
625 fi
626
627 if [ -n "$do_aiff" ] ; then
628 do_audio_only aif
629 fi
630
631 if [ -n "$do_voc" ] ; then
632 do_audio_only voc
633 fi
634
635 if [ -n "$do_ogg" ] ; then
636 do_audio_only ogg
637 fi
638
639 # pix_fmt conversions
640
641 if [ -n "$do_pixfmt" ] ; then
642 conversions="yuv420p yuv422p yuv444p yuyv422 yuv410p yuv411p yuvj420p \
643              yuvj422p yuvj444p rgb24 bgr24 rgb32 rgb565 rgb555 gray monow \
644              monob yuv440p yuvj440p"
645 for pix_fmt in $conversions ; do
646     file=${outfile}lavf-${pix_fmt}.yuv
647     do_ffmpeg_nocheck $file -r 1 -t 1 -f image2 -vcodec pgmyuv -i $raw_src \
648                             -f rawvideo -s 352x288 -pix_fmt $pix_fmt $target_path/$raw_dst
649     do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $target_path/$raw_dst \
650                     -f rawvideo -s 352x288 -pix_fmt yuv444p
651 done
652 fi
653
654 rm -f "$bench" "$bench2"