Statistics
| Branch: | Revision:

ffmpeg / tests / regression.sh @ 9dc92a38

History | View | Annotate | Download (14.8 KB)

1 51133a7d Fabrice Bellard
#!/bin/sh
2
#
3
# automatic regression test for ffmpeg
4
#
5
#
6
#set -x
7 d9d7653e Michael Niedermayer
8 51133a7d Fabrice Bellard
set -e
9
10 4fbd52f0 Diego Biurrun
datadir="./tests/data"
11 5bcfd1ad Fabrice Bellard
12 4383ed5c Måns Rullgård
test="${1#regtest-}"
13
this="$test.$2"
14
logfile="$datadir/$this.regression"
15 2009721d Måns Rullgård
outfile="$datadir/$4-"
16 89d5dfd5 Fabrice Bellard
17 4383ed5c Måns Rullgård
eval do_$test=y
18
19 51133a7d Fabrice Bellard
# various files
20 4fbd52f0 Diego Biurrun
ffmpeg="./ffmpeg_g"
21
tiny_psnr="tests/tiny_psnr"
22 4383ed5c Måns Rullgård
benchfile="$datadir/$this.bench"
23
bench="$datadir/$this.bench.tmp"
24
bench2="$datadir/$this.bench2.tmp"
25 528bbdde Sam Hocevar
raw_src="$3/%02d.pgm"
26 4383ed5c Måns Rullgård
raw_dst="$datadir/$this.out.yuv"
27
raw_ref="$datadir/$2.ref.yuv"
28 4fbd52f0 Diego Biurrun
pcm_src="tests/asynth1.sw"
29 4383ed5c Måns Rullgård
pcm_dst="$datadir/$this.out.wav"
30
pcm_ref="$datadir/$2.ref.wav"
31 2009721d Måns Rullgård
crcfile="$datadir/$this.crc"
32
33 853d659d John Dalgliesh
if [ X"`echo | md5sum 2> /dev/null`" != X ]; then
34
    do_md5sum() { md5sum -b $1; }
35
elif [ -x /sbin/md5 ]; then
36
    do_md5sum() { /sbin/md5 -r $1 | sed 's# \**\./# *./#'; }
37
else
38
    do_md5sum() { echo No md5sum program found; }
39
fi
40 5bcfd1ad Fabrice Bellard
41 d9c211ee Diego Biurrun
# create the data directory if it does not exist
42 5bcfd1ad Fabrice Bellard
mkdir -p $datadir
43 51133a7d Fabrice Bellard
44 f6ac2667 Benoit Fouet
FFMPEG_OPTS="-y -flags +bitexact -dct fastint -idct simple"
45 bcea9605 Diego Biurrun
46 3f027ca7 Felix Bünemann
do_ffmpeg()
47 51133a7d Fabrice Bellard
{
48 9e32e071 Diego Biurrun
    f="$1"
49 51133a7d Fabrice Bellard
    shift
50 bcea9605 Diego Biurrun
    echo $ffmpeg $FFMPEG_OPTS $*
51 8deb894f Diego Biurrun
    $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
52 37a00782 Michael Niedermayer
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
53 e31c1c30 Philip Gladstone
    rm -f /tmp/ffmpeg$$
54 9e32e071 Diego Biurrun
    do_md5sum $f >> $logfile
55
    if [ $f = $raw_dst ] ; then
56
        $tiny_psnr $f $raw_ref >> $logfile
57
    elif [ $f = $pcm_dst ] ; then
58
        $tiny_psnr $f $pcm_ref 2 >> $logfile
59 039e7889 Michael Niedermayer
    else
60 9e32e071 Diego Biurrun
        wc -c $f >> $logfile
61 67cbe681 Michael Niedermayer
    fi
62 8deb894f Diego Biurrun
    expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
63 9e32e071 Diego Biurrun
    echo `cat $bench2` $f >> $benchfile
64 51133a7d Fabrice Bellard
}
65
66 d9076fe7 Michael Niedermayer
do_ffmpeg_nomd5()
67
{
68
    f="$1"
69
    shift
70
    echo $ffmpeg $FFMPEG_OPTS $*
71
    $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
72
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
73
    rm -f /tmp/ffmpeg$$
74
    if [ $f = $raw_dst ] ; then
75
        $tiny_psnr $f $raw_ref >> $logfile
76
    elif [ $f = $pcm_dst ] ; then
77
        $tiny_psnr $f $pcm_ref 2 >> $logfile
78
    else
79
        wc -c $f >> $logfile
80
    fi
81
    expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
82
    echo `cat $bench2` $f >> $benchfile
83
}
84
85 3f027ca7 Felix Bünemann
do_ffmpeg_crc()
86 89d5dfd5 Fabrice Bellard
{
87 9e32e071 Diego Biurrun
    f="$1"
88 89d5dfd5 Fabrice Bellard
    shift
89 2009721d Måns Rullgård
    echo $ffmpeg $FFMPEG_OPTS $* -f crc "$crcfile"
90
    $ffmpeg $FFMPEG_OPTS $* -f crc "$crcfile" > /tmp/ffmpeg$$ 2>&1
91 37a00782 Michael Niedermayer
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:|ffmpeg version|  configuration|  built)" /tmp/ffmpeg$$ || true
92 115329f1 Diego Biurrun
    rm -f /tmp/ffmpeg$$
93 2009721d Måns Rullgård
    echo "$f `cat $crcfile`" >> $logfile
94
    rm -f "$crcfile"
95 89d5dfd5 Fabrice Bellard
}
96 51133a7d Fabrice Bellard
97 67cbe681 Michael Niedermayer
do_ffmpeg_nocheck()
98
{
99 9e32e071 Diego Biurrun
    f="$1"
100 67cbe681 Michael Niedermayer
    shift
101 bcea9605 Diego Biurrun
    echo $ffmpeg $FFMPEG_OPTS $*
102 8deb894f Diego Biurrun
    $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
103 37a00782 Michael Niedermayer
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
104 affd55a1 Roman Shaposhnik
    rm -f /tmp/ffmpeg$$
105 8deb894f Diego Biurrun
    expr "`cat $bench`" : '.*utime=\(.*s\)' > $bench2
106 9e32e071 Diego Biurrun
    echo `cat $bench2` $f >> $benchfile
107 67cbe681 Michael Niedermayer
}
108
109 1de61a18 Diego Biurrun
do_video_decoding()
110
{
111 5e5ac8e0 Diego Biurrun
    do_ffmpeg $raw_dst -y $1 -i $file -f rawvideo $2 $raw_dst
112 4383ed5c Måns Rullgård
    rm -f $raw_dst
113 1de61a18 Diego Biurrun
}
114
115
do_video_encoding()
116
{
117 1e1b182d Diego Biurrun
    file=${outfile}$1
118 a2377bb0 Diego Biurrun
    do_ffmpeg $file -y $2 -f $3 -i $raw_src $4 $file
119 1de61a18 Diego Biurrun
}
120
121 fb132953 Diego Biurrun
do_audio_encoding()
122
{
123
    file=${outfile}$1
124 066a81a8 Benoit Fouet
    do_ffmpeg $file -y -ab 128k -ac 2 -f s16le -i $pcm_src $3 $file
125 fb132953 Diego Biurrun
}
126
127
do_audio_decoding()
128
{
129
    do_ffmpeg $pcm_dst -y -i $file -f wav $pcm_dst
130
}
131
132 36aed9e5 Diego Biurrun
do_libav()
133
{
134
    file=${outfile}libav.$1
135
    do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $2 $file
136
    do_ffmpeg_crc $file -i $file $3
137
138
}
139
140 d449d1bc Diego Biurrun
do_streamed_images()
141
{
142 2009721d Måns Rullgård
    file=${outfile}${1}pipe.$1
143 d449d1bc Diego Biurrun
    do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f image2pipe $file
144
    do_ffmpeg_crc $file -f image2pipe -i $file
145
}
146
147 f8aa7645 Diego Biurrun
do_image_formats()
148
{
149
    file=${outfile}libav%02d.$1
150 c28baf06 Michael Niedermayer
    $ffmpeg -t 0.5 -y -qscale 10 -f pgmyuv -i $raw_src $2 $3 -flags +bitexact $file
151 f8aa7645 Diego Biurrun
    do_ffmpeg_crc $file $3 -i $file
152 199c6e3c Michael Niedermayer
    do_md5sum ${outfile}libav02.$1 >> $logfile
153 f8aa7645 Diego Biurrun
}
154
155 e587a0a5 Diego Biurrun
do_audio_only()
156
{
157
    file=${outfile}libav.$1
158
    do_ffmpeg $file -t 1 -y -qscale 10 -f s16le -i $pcm_src $file
159
    do_ffmpeg_crc $file -i $file
160
}
161
162 4383ed5c Måns Rullgård
rm -f "$logfile"
163
rm -f "$benchfile"
164 51133a7d Fabrice Bellard
165 67cbe681 Michael Niedermayer
# generate reference for quality check
166 4383ed5c Måns Rullgård
if [ -n "$do_ref" ]; then
167 67cbe681 Michael Niedermayer
do_ffmpeg_nocheck $raw_ref -y -f pgmyuv -i $raw_src -an -f rawvideo $raw_ref
168 066a81a8 Benoit Fouet
do_ffmpeg_nocheck $pcm_ref -y -ab 128k -ac 2 -ar 44100 -f s16le -i $pcm_src -f wav $pcm_ref
169 4383ed5c Måns Rullgård
fi
170 67cbe681 Michael Niedermayer
171 51133a7d Fabrice Bellard
if [ -n "$do_mpeg" ] ; then
172 0fc3a831 Diego Biurrun
# mpeg1
173 a2377bb0 Diego Biurrun
do_video_encoding mpeg1.mpg "-qscale 10" pgmyuv "-f mpeg1video"
174 1de61a18 Diego Biurrun
do_video_decoding
175 922bc38d Michael Niedermayer
fi
176
177
if [ -n "$do_mpeg2" ] ; then
178 0fc3a831 Diego Biurrun
# mpeg2
179 a2377bb0 Diego Biurrun
do_video_encoding mpeg2.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video"
180 1de61a18 Diego Biurrun
do_video_decoding
181 83dddc4a Fabrice Bellard
182 49f1ac5a Baptiste Coudurier
# mpeg2 encoding intra vlc qprd
183 066a81a8 Benoit Fouet
do_video_encoding mpeg2ivlc-qprd.mpg "-vb 500k -bf 2 -flags +trell+qprd+mv0 -flags2 +ivlc -cmp 2 -subcmp 2 -mbd rd" pgmyuv "-vcodec mpeg2video -f mpeg2video"
184 307eb248 Baptiste Coudurier
185
# mpeg2 decoding
186 1de61a18 Diego Biurrun
do_video_decoding
187 307eb248 Baptiste Coudurier
188 0fc3a831 Diego Biurrun
# mpeg2
189 a2377bb0 Diego Biurrun
do_video_encoding mpeg2.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -idct int -dct int -f mpeg1video"
190 5e5ac8e0 Diego Biurrun
do_video_decoding "-idct int"
191 6486ad57 Michael Niedermayer
192 83dddc4a Fabrice Bellard
# mpeg2 encoding interlaced
193 a2377bb0 Diego Biurrun
do_video_encoding mpeg2i.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video -flags +ildct+ilme"
194 51133a7d Fabrice Bellard
195
# mpeg2 decoding
196 1de61a18 Diego Biurrun
do_video_decoding
197 51133a7d Fabrice Bellard
fi
198
199 9c3d33d6 Michael Niedermayer
if [ -n "$do_mpeg2thread" ] ; then
200
# mpeg2 encoding interlaced
201 a2377bb0 Diego Biurrun
do_video_encoding mpeg2thread.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 2"
202 307eb248 Baptiste Coudurier
203
# mpeg2 decoding
204 1de61a18 Diego Biurrun
do_video_decoding
205 307eb248 Baptiste Coudurier
206
# mpeg2 encoding interlaced using intra vlc
207 a2377bb0 Diego Biurrun
do_video_encoding mpeg2threadivlc.mpg "-qscale 10" pgmyuv "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -flags2 +ivlc -threads 2"
208 9c3d33d6 Michael Niedermayer
209
# mpeg2 decoding
210 1de61a18 Diego Biurrun
do_video_decoding
211 7f8038ce Michael Niedermayer
212
# mpeg2 encoding interlaced
213
file=${outfile}mpeg2reuse.mpg
214 115329f1 Diego Biurrun
do_ffmpeg $file -y -sameq -me_threshold 256 -mb_threshold 1024 -i ${outfile}mpeg2thread.mpg -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 4 $file
215 7f8038ce Michael Niedermayer
216
# mpeg2 decoding
217 1de61a18 Diego Biurrun
do_video_decoding
218 9c3d33d6 Michael Niedermayer
fi
219
220 6ebd933b Michael Niedermayer
if [ -n "$do_msmpeg4v2" ] ; then
221 a2377bb0 Diego Biurrun
do_video_encoding msmpeg4v2.avi "-qscale 10" pgmyuv "-an -vcodec msmpeg4v2"
222 1de61a18 Diego Biurrun
do_video_decoding
223 6ebd933b Michael Niedermayer
fi
224
225 51133a7d Fabrice Bellard
if [ -n "$do_msmpeg4" ] ; then
226 a2377bb0 Diego Biurrun
do_video_encoding msmpeg4.avi "-qscale 10" pgmyuv "-an -vcodec msmpeg4"
227 1de61a18 Diego Biurrun
do_video_decoding
228 51133a7d Fabrice Bellard
fi
229
230 6ebd933b Michael Niedermayer
if [ -n "$do_wmv1" ] ; then
231 a2377bb0 Diego Biurrun
do_video_encoding wmv1.avi "-qscale 10" pgmyuv "-an -vcodec wmv1"
232 1de61a18 Diego Biurrun
do_video_decoding
233 6ebd933b Michael Niedermayer
fi
234
235 e23d5712 Michael Niedermayer
if [ -n "$do_wmv2" ] ; then
236 a2377bb0 Diego Biurrun
do_video_encoding wmv2.avi "-qscale 10" pgmyuv "-an -vcodec wmv2"
237 1de61a18 Diego Biurrun
do_video_decoding
238 e23d5712 Michael Niedermayer
fi
239
240 61b262a9 Michael Niedermayer
if [ -n "$do_h261" ] ; then
241 a2377bb0 Diego Biurrun
do_video_encoding h261.avi "-qscale 11" pgmyuv "-s 352x288 -an -vcodec h261"
242 1de61a18 Diego Biurrun
do_video_decoding
243 61b262a9 Michael Niedermayer
fi
244
245 51133a7d Fabrice Bellard
if [ -n "$do_h263" ] ; then
246 a2377bb0 Diego Biurrun
do_video_encoding h263.avi "-qscale 10" pgmyuv "-s 352x288 -an -vcodec h263"
247 1de61a18 Diego Biurrun
do_video_decoding
248 6e2d5f1a Michael Niedermayer
fi
249
250
if [ -n "$do_h263p" ] ; then
251 a2377bb0 Diego Biurrun
do_video_encoding h263p.avi "-qscale 2 -flags +umv+aiv+aic" pgmyuv "-s 352x288 -an -vcodec h263p -ps 300"
252 1de61a18 Diego Biurrun
do_video_decoding
253 51133a7d Fabrice Bellard
fi
254
255
if [ -n "$do_mpeg4" ] ; then
256 aeeb0cac Diego Biurrun
do_video_encoding odivx.mp4 "-flags +mv4 -mbd bits -qscale 10" pgmyuv "-an -vcodec mpeg4"
257
do_video_decoding
258 51133a7d Fabrice Bellard
fi
259
260 e629ab68 Romain Dolbeau
if [ -n "$do_huffyuv" ] ; then
261 a2377bb0 Diego Biurrun
do_video_encoding huffyuv.avi "" pgmyuv "-an -vcodec huffyuv -pix_fmt yuv422p"
262 5e5ac8e0 Diego Biurrun
do_video_decoding "" "-strict -2 -pix_fmt yuv420p"
263 e629ab68 Romain Dolbeau
fi
264
265 1dbb6d90 Michael Niedermayer
if [ -n "$do_rc" ] ; then
266 aeeb0cac Diego Biurrun
do_video_encoding mpeg4-rc.avi "-b 400k -bf 2" pgmyuv "-an -vcodec mpeg4"
267
do_video_decoding
268 1dbb6d90 Michael Niedermayer
fi
269
270
if [ -n "$do_mpeg4adv" ] ; then
271 a2377bb0 Diego Biurrun
do_video_encoding mpeg4-adv.avi "-qscale 9 -flags +mv4+part+aic+trell -mbd bits -ps 200" pgmyuv "-an -vcodec mpeg4"
272 1de61a18 Diego Biurrun
do_video_decoding
273 2d1e5071 Michael Niedermayer
274
do_video_encoding mpeg4-qprd.avi "-b 450k -bf 2 -flags +mv4+trell+qprd+mv0 -cmp 2 -subcmp 2 -mbd rd" pgmyuv "-an -vcodec mpeg4"
275
do_video_decoding
276
277
do_video_encoding mpeg4-adap.avi "-b 550k -bf 2 -flags +mv4+trell+mv0 -cmp 1 -subcmp 2 -mbd rd -scplx_mask 0.3" pgmyuv "-an -vcodec mpeg4"
278
do_video_decoding
279 1dbb6d90 Michael Niedermayer
280 45ddd8b0 Måns Rullgård
do_video_encoding mpeg4-Q.avi "-qscale 7 -flags +mv4+qpel -mbd 2 -bf 2 -cmp 1 -subcmp 2" pgmyuv "-an -vcodec mpeg4"
281 1de61a18 Diego Biurrun
do_video_decoding
282 aab9cdcf Michael Niedermayer
fi
283
284 45ddd8b0 Måns Rullgård
if [ -n "$do_mpeg4thread" ] ; then
285
do_video_encoding mpeg4-thread.avi "-b 500k -flags +mv4+part+aic+trell -mbd bits -ps 200 -bf 2" pgmyuv "-an -vcodec mpeg4 -threads 2"
286 1de61a18 Diego Biurrun
do_video_decoding
287 9c3d33d6 Michael Niedermayer
fi
288
289 dcfdb046 Benjamin Larsson
if [ -n "$do_mp4psp" ] ; then
290 066a81a8 Benoit Fouet
do_video_encoding mpeg4-PSP.mp4 "-vb 768k -s 320x240" psp "-ar 24000 -ab 32k -i $raw_src"
291 dcfdb046 Benjamin Larsson
fi
292
293 7ebfc0ea Michael Niedermayer
if [ -n "$do_error" ] ; then
294 a2377bb0 Diego Biurrun
do_video_encoding error-mpeg4-adv.avi "-qscale 7 -flags +mv4+part+aic -mbd rd -ps 250 -error 10" pgmyuv "-an -vcodec mpeg4"
295 1de61a18 Diego Biurrun
do_video_decoding
296 7ebfc0ea Michael Niedermayer
fi
297
298 be408b67 Michael Niedermayer
if [ -n "$do_mpeg4nr" ] ; then
299 a2377bb0 Diego Biurrun
do_video_encoding mpeg4-nr.avi "-qscale 8 -flags +mv4 -mbd rd -nr 200" pgmyuv "-an -vcodec mpeg4"
300 1de61a18 Diego Biurrun
do_video_decoding
301 be408b67 Michael Niedermayer
fi
302
303 cfadadec Michael Niedermayer
if [ -n "$do_mpeg1b" ] ; then
304 a2377bb0 Diego Biurrun
do_video_encoding mpeg1b.mpg "-qscale 8 -bf 3 -ps 200" pgmyuv "-an -vcodec mpeg1video -f mpeg1video"
305 1de61a18 Diego Biurrun
do_video_decoding
306 cfadadec Michael Niedermayer
fi
307
308 51133a7d Fabrice Bellard
if [ -n "$do_mjpeg" ] ; then
309 a2377bb0 Diego Biurrun
do_video_encoding mjpeg.avi "-qscale 10" pgmyuv "-an -vcodec mjpeg -pix_fmt yuvj420p"
310 5e5ac8e0 Diego Biurrun
do_video_decoding "" "-pix_fmt yuv420p"
311 51133a7d Fabrice Bellard
fi
312
313 3b37408b Michael Niedermayer
if [ -n "$do_ljpeg" ] ; then
314 a2377bb0 Diego Biurrun
do_video_encoding ljpeg.avi "" pgmyuv "-an -vcodec ljpeg -strict -1"
315 1de61a18 Diego Biurrun
do_video_decoding
316 3b37408b Michael Niedermayer
fi
317
318 b4e021e8 Michael Niedermayer
if [ -n "$do_jpegls" ] ; then
319 a2377bb0 Diego Biurrun
do_video_encoding jpegls.avi "" pgmyuv "-an -vcodec jpegls -vtag MJPG"
320 5e5ac8e0 Diego Biurrun
do_video_decoding "" "-pix_fmt yuv420p"
321 b4e021e8 Michael Niedermayer
fi
322
323 51133a7d Fabrice Bellard
if [ -n "$do_rv10" ] ; then
324 a2377bb0 Diego Biurrun
do_video_encoding rv10.rm "-qscale 10" pgmyuv "-an"
325 1de61a18 Diego Biurrun
do_video_decoding
326 51133a7d Fabrice Bellard
fi
327
328 c50cd09d Michael Niedermayer
if [ -n "$do_rv20" ] ; then
329 a2377bb0 Diego Biurrun
do_video_encoding rv20.rm "-qscale 10" pgmyuv "-vcodec rv20 -an"
330 1de61a18 Diego Biurrun
do_video_decoding
331 c50cd09d Michael Niedermayer
fi
332
333 9ca9fce1 Michael Niedermayer
if [ -n "$do_asv1" ] ; then
334 a2377bb0 Diego Biurrun
do_video_encoding asv1.avi "-qscale 10" pgmyuv "-an -vcodec asv1"
335 1de61a18 Diego Biurrun
do_video_decoding
336 9ca9fce1 Michael Niedermayer
fi
337
338 8d876a43 Michael Niedermayer
if [ -n "$do_asv2" ] ; then
339 a2377bb0 Diego Biurrun
do_video_encoding asv2.avi "-qscale 10" pgmyuv "-an -vcodec asv2"
340 1de61a18 Diego Biurrun
do_video_decoding
341 8d876a43 Michael Niedermayer
fi
342
343 bbdd42d3 Michael Niedermayer
if [ -n "$do_flv" ] ; then
344 a2377bb0 Diego Biurrun
do_video_encoding flv.flv "-qscale 10" pgmyuv "-an -vcodec flv"
345 1de61a18 Diego Biurrun
do_video_decoding
346 bbdd42d3 Michael Niedermayer
fi
347
348 f3203047 Michael Niedermayer
if [ -n "$do_ffv1" ] ; then
349 a2377bb0 Diego Biurrun
do_video_encoding ffv1.avi "-strict -2" pgmyuv "-an -vcodec ffv1"
350 1de61a18 Diego Biurrun
do_video_decoding
351 d13eef3d Michael Niedermayer
fi
352
353
if [ -n "$do_snow" ] ; then
354 a2377bb0 Diego Biurrun
do_video_encoding snow.avi "-strict -2" pgmyuv "-an -vcodec snow -qscale 2 -flags +qpel -me iter -dia_size 2 -cmp 12 -subcmp 12 -s 128x64"
355 5e5ac8e0 Diego Biurrun
do_video_decoding "" "-s 352x288"
356 e03c822a Michael Niedermayer
fi
357 d13eef3d Michael Niedermayer
358 e03c822a Michael Niedermayer
if [ -n "$do_snowll" ] ; then
359 a2377bb0 Diego Biurrun
do_video_encoding snow53.avi "-strict -2" pgmyuv "-an -vcodec snow -qscale .001 -pred 1 -flags +mv4+qpel"
360 1de61a18 Diego Biurrun
do_video_decoding
361 f3203047 Michael Niedermayer
fi
362
363 8fce2707 Michael Niedermayer
if [ -n "$do_dv" ] ; then
364 a2377bb0 Diego Biurrun
do_video_encoding dv.dv "-dct int" pgmyuv "-s pal -an"
365 5e5ac8e0 Diego Biurrun
do_video_decoding "" "-s cif"
366 8fce2707 Michael Niedermayer
fi
367
368 0b297700 Daniel Maas
if [ -n "$do_dv50" ] ; then
369 a8fa959a Måns Rullgård
do_video_encoding dv50.dv "-dct int" pgmyuv "-s pal -pix_fmt yuv422p -an"
370 5e5ac8e0 Diego Biurrun
do_video_decoding "" "-s cif -pix_fmt yuv420p"
371 0b297700 Daniel Maas
fi
372
373 b86bd1f1 Michael Niedermayer
if [ -n "$do_svq1" ] ; then
374 a2377bb0 Diego Biurrun
do_video_encoding svq1.mov "" pgmyuv "-an -vcodec svq1 -qscale 3 -pix_fmt yuv410p"
375 5e5ac8e0 Diego Biurrun
do_video_decoding "" "-pix_fmt yuv420p"
376 b86bd1f1 Michael Niedermayer
fi
377
378 d2f8f410 Michael Niedermayer
if [ -n "$do_flashsv" ] ; then
379
do_video_encoding flashsv.flv "" pgmyuv "-an -vcodec flashsv "
380
do_video_decoding "" "-pix_fmt yuv420p"
381
fi
382
383 51133a7d Fabrice Bellard
if [ -n "$do_mp2" ] ; then
384 fb132953 Diego Biurrun
do_audio_encoding mp2.mp2 "-ar 44100"
385
do_audio_decoding
386 976709ee Michael Niedermayer
$tiny_psnr $pcm_dst $pcm_ref 2 1924 >> $logfile
387 51133a7d Fabrice Bellard
fi
388
389
if [ -n "$do_ac3" ] ; then
390 fb132953 Diego Biurrun
do_audio_encoding ac3.rm "" -vn
391
#do_audio_decoding
392 51133a7d Fabrice Bellard
fi
393
394 311be1fb Michael Niedermayer
if [ -n "$do_g726" ] ; then
395 066a81a8 Benoit Fouet
do_audio_encoding g726.wav "-ar 44100" "-ab 32k -ac 1 -ar 8000 -acodec g726"
396 fb132953 Diego Biurrun
do_audio_decoding
397 311be1fb Michael Niedermayer
fi
398
399 f02ab814 Michael Niedermayer
if [ -n "$do_adpcm_ima_wav" ] ; then
400 fb132953 Diego Biurrun
do_audio_encoding adpcm_ima.wav "-ar 44100" "-acodec adpcm_ima_wav"
401
do_audio_decoding
402 f02ab814 Michael Niedermayer
fi
403
404 9dc92a38 Kostya Shishkov
if [ -n "$do_adpcm_ima_qt" ] ; then
405
do_audio_encoding adpcm_qt.aiff "-ar 44100" "-acodec adpcm_ima_qt"
406
do_audio_decoding
407
fi
408
409 f02ab814 Michael Niedermayer
if [ -n "$do_adpcm_ms" ] ; then
410 fb132953 Diego Biurrun
do_audio_encoding adpcm_ms.wav "-ar 44100" "-acodec adpcm_ms"
411
do_audio_decoding
412 f02ab814 Michael Niedermayer
fi
413
414 d8cbeba1 Michael Niedermayer
if [ -n "$do_adpcm_yam" ] ; then
415 fb132953 Diego Biurrun
do_audio_encoding adpcm_yam.wav "-ar 44100" "-acodec adpcm_yamaha"
416
do_audio_decoding
417 d8cbeba1 Michael Niedermayer
fi
418
419 b529ab37 Benjamin Larsson
if [ -n "$do_adpcm_swf" ] ; then
420
do_audio_encoding adpcm_swf.flv "-ar 44100" "-acodec adpcm_swf"
421
do_audio_decoding
422
fi
423
424 aeb2904e Michael Niedermayer
if [ -n "$do_flac" ] ; then
425 fb132953 Diego Biurrun
do_audio_encoding flac.flac "-ar 44100" "-acodec flac -compression_level 2"
426
do_audio_decoding
427 aeb2904e Michael Niedermayer
fi
428
429 6d3d8dae Michael Niedermayer
if [ -n "$do_wma" ] ; then
430
# wmav1
431
do_audio_encoding wmav1.asf "-ar 44100" "-acodec wmav1"
432 d9076fe7 Michael Niedermayer
do_ffmpeg_nomd5 $pcm_dst -y -i $file -f wav $pcm_dst
433 6d3d8dae Michael Niedermayer
$tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
434
# wmav2
435
do_audio_encoding wmav2.asf "-ar 44100" "-acodec wmav2"
436 d9076fe7 Michael Niedermayer
do_ffmpeg_nomd5 $pcm_dst -y -i $file -f wav $pcm_dst
437 6d3d8dae Michael Niedermayer
$tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
438
fi
439
440 0786943a Michael Niedermayer
#if [ -n "$do_vorbis" ] ; then
441 3160138f Michael Niedermayer
# vorbis
442 90b5b51e Diego Biurrun
#disabled because it is broken
443 0786943a Michael Niedermayer
#do_audio_encoding vorbis.asf "-ar 44100" "-acodec vorbis"
444
#do_audio_decoding
445
#fi
446 6d3d8dae Michael Niedermayer
447 2a048239 Diego Biurrun
# libavformat testing
448 89d5dfd5 Fabrice Bellard
449 2009721d Måns Rullgård
if [ -n "$do_avi" ] ; then
450 36aed9e5 Diego Biurrun
do_libav avi
451 2009721d Måns Rullgård
fi
452 89d5dfd5 Fabrice Bellard
453 2009721d Måns Rullgård
if [ -n "$do_asf" ] ; then
454 36aed9e5 Diego Biurrun
do_libav asf "-acodec mp2" "-r 25"
455 2009721d Måns Rullgård
fi
456 89d5dfd5 Fabrice Bellard
457 2009721d Måns Rullgård
if [ -n "$do_rm" ] ; then
458 89d5dfd5 Fabrice Bellard
file=${outfile}libav.rm
459
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -f s16le -i $pcm_src $file
460
# broken
461
#do_ffmpeg_crc $file -i $file
462 2009721d Måns Rullgård
fi
463 89d5dfd5 Fabrice Bellard
464 2009721d Måns Rullgård
if [ -n "$do_mpg" ] ; then
465 36aed9e5 Diego Biurrun
do_libav mpg
466 2009721d Måns Rullgård
fi
467 89d5dfd5 Fabrice Bellard
468 2009721d Måns Rullgård
if [ -n "$do_ts" ] ; then
469 36aed9e5 Diego Biurrun
do_libav ts
470 2009721d Måns Rullgård
fi
471 d05c15cb Michael Niedermayer
472 2009721d Måns Rullgård
if [ -n "$do_swf" ] ; then
473 662fd26c Baptiste Coudurier
do_libav swf -an
474 2009721d Måns Rullgård
fi
475 89d5dfd5 Fabrice Bellard
476 2009721d Måns Rullgård
if [ -n "$do_ffm" ] ; then
477 36aed9e5 Diego Biurrun
do_libav ffm
478 2009721d Måns Rullgård
fi
479 89d5dfd5 Fabrice Bellard
480 2009721d Måns Rullgård
if [ -n "$do_flv_fmt" ] ; then
481 36aed9e5 Diego Biurrun
do_libav flv -an
482 2009721d Måns Rullgård
fi
483 bbdd42d3 Michael Niedermayer
484 2009721d Måns Rullgård
if [ -n "$do_mov" ] ; then
485 36aed9e5 Diego Biurrun
do_libav mov "-acodec pcm_alaw"
486 2009721d Måns Rullgård
fi
487 c280f2d7 Michael Niedermayer
488 2009721d Måns Rullgård
if [ -n "$do_dv_fmt" ] ; then
489 36aed9e5 Diego Biurrun
do_libav dv "-ar 48000 -r 25 -s pal -ac 2"
490 2009721d Måns Rullgård
fi
491 a811de6e Michael Niedermayer
492 2009721d Måns Rullgård
if [ -n "$do_gxf" ] ; then
493 36aed9e5 Diego Biurrun
do_libav gxf "-ar 48000 -r 25 -s pal -ac 1"
494 2009721d Måns Rullgård
fi
495 a850fd18 Baptiste Coudurier
496 2009721d Måns Rullgård
if [ -n "$do_nut" ] ; then
497 f38e2b13 Michael Niedermayer
do_libav nut "-acodec mp2"
498 2009721d Måns Rullgård
fi
499 f38e2b13 Michael Niedermayer
500 2009721d Måns Rullgård
if [ -n "$do_mkv" ] ; then
501 46491f13 David Conrad
do_libav mkv
502 2009721d Måns Rullgård
fi
503 46491f13 David Conrad
504 f38e2b13 Michael Niedermayer
505 89d5dfd5 Fabrice Bellard
# streamed images
506
# mjpeg
507 affd55a1 Roman Shaposhnik
#file=${outfile}libav.mjpeg
508
#do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
509
#do_ffmpeg_crc $file -i $file
510 89d5dfd5 Fabrice Bellard
511 2009721d Måns Rullgård
if [ -n "$do_pbmpipe" ] ; then
512 d449d1bc Diego Biurrun
do_streamed_images pbm
513 2009721d Måns Rullgård
fi
514 7481e919 Fabrice Bellard
515 2009721d Måns Rullgård
if [ -n "$do_pgmpipe" ] ; then
516 d449d1bc Diego Biurrun
do_streamed_images pgm
517 2009721d Måns Rullgård
fi
518 89d5dfd5 Fabrice Bellard
519 2009721d Måns Rullgård
if [ -n "$do_ppmpipe" ] ; then
520 d449d1bc Diego Biurrun
do_streamed_images ppm
521 2009721d Måns Rullgård
fi
522 89d5dfd5 Fabrice Bellard
523 2009721d Måns Rullgård
if [ -n "$do_gif" ] ; then
524 89d5dfd5 Fabrice Bellard
file=${outfile}libav.gif
525 20dd25ad Luca Abeni
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src -pix_fmt rgb24 $file
526 7481e919 Fabrice Bellard
#do_ffmpeg_crc $file -i $file
527 2009721d Måns Rullgård
fi
528 7481e919 Fabrice Bellard
529 2009721d Måns Rullgård
if [ -n "$do_yuv4mpeg" ] ; then
530 8cf71ead Roine Gustafsson
file=${outfile}libav.y4m
531 7481e919 Fabrice Bellard
do_ffmpeg $file -t 1 -y -qscale 10 -f pgmyuv -i $raw_src $file
532
#do_ffmpeg_crc $file -i $file
533 2009721d Måns Rullgård
fi
534 89d5dfd5 Fabrice Bellard
535
# image formats
536 2009721d Måns Rullgård
537
if [ -n "$do_pgm" ] ; then
538 f8aa7645 Diego Biurrun
do_image_formats pgm
539 2009721d Måns Rullgård
fi
540 89d5dfd5 Fabrice Bellard
541 2009721d Måns Rullgård
if [ -n "$do_ppm" ] ; then
542 f8aa7645 Diego Biurrun
do_image_formats ppm
543 2009721d Måns Rullgård
fi
544 89d5dfd5 Fabrice Bellard
545 2009721d Måns Rullgård
if [ -n "$do_bmp" ] ; then
546 1e358f03 Michael Niedermayer
do_image_formats bmp
547 2009721d Måns Rullgård
fi
548 1e358f03 Michael Niedermayer
549 2009721d Måns Rullgård
if [ -n "$do_tga" ] ; then
550 1e358f03 Michael Niedermayer
do_image_formats tga
551 2009721d Måns Rullgård
fi
552 1e358f03 Michael Niedermayer
553 2009721d Måns Rullgård
if [ -n "$do_tiff" ] ; then
554 f4d47d6b Kamil Nowosad
do_image_formats tiff "-pix_fmt rgb24"
555 2009721d Måns Rullgård
fi
556 90b4e393 Michael Niedermayer
557 2009721d Måns Rullgård
if [ -n "$do_sgi" ] ; then
558 90b4e393 Michael Niedermayer
do_image_formats sgi
559 2009721d Måns Rullgård
fi
560 90b4e393 Michael Niedermayer
561 2009721d Måns Rullgård
if [ -n "$do_jpg" ] ; then
562 f8aa7645 Diego Biurrun
do_image_formats jpg "-flags +bitexact -dct fastint -idct simple -pix_fmt yuvj420p" "-f image2"
563 2009721d Måns Rullgård
fi
564 d0c30ca5 Fabrice Bellard
565 89d5dfd5 Fabrice Bellard
# audio only
566
567 2009721d Måns Rullgård
if [ -n "$do_wav" ] ; then
568 e587a0a5 Diego Biurrun
do_audio_only wav
569 2009721d Måns Rullgård
fi
570 89d5dfd5 Fabrice Bellard
571 2009721d Måns Rullgård
if [ -n "$do_alaw" ] ; then
572 e587a0a5 Diego Biurrun
do_audio_only al
573 2009721d Måns Rullgård
fi
574 89d5dfd5 Fabrice Bellard
575 2009721d Måns Rullgård
if [ -n "$do_mulaw" ] ; then
576 e587a0a5 Diego Biurrun
do_audio_only ul
577 2009721d Måns Rullgård
fi
578 89d5dfd5 Fabrice Bellard
579 2009721d Måns Rullgård
if [ -n "$do_au" ] ; then
580 e587a0a5 Diego Biurrun
do_audio_only au
581 2009721d Måns Rullgård
fi
582 89d5dfd5 Fabrice Bellard
583 2009721d Måns Rullgård
if [ -n "$do_mmf" ] ; then
584 e587a0a5 Diego Biurrun
do_audio_only mmf
585 2009721d Måns Rullgård
fi
586 d8cbeba1 Michael Niedermayer
587 2009721d Måns Rullgård
if [ -n "$do_aiff" ] ; then
588 e587a0a5 Diego Biurrun
do_audio_only aif
589 2009721d Måns Rullgård
fi
590 f11288da Michael Niedermayer
591 2009721d Måns Rullgård
if [ -n "$do_voc" ] ; then
592 e587a0a5 Diego Biurrun
do_audio_only voc
593 2009721d Måns Rullgård
fi
594 ea395e8c Aurelien Jacobs
595 2009721d Måns Rullgård
if [ -n "$do_ogg" ] ; then
596 5118cae6 Baptiste Coudurier
do_audio_only ogg
597 2009721d Måns Rullgård
fi
598 5118cae6 Baptiste Coudurier
599 affd55a1 Roman Shaposhnik
# pix_fmt conversions
600 2009721d Måns Rullgård
601
if [ -n "$do_pixfmt" ] ; then
602 dc8918ad Baptiste Coudurier
conversions="yuv420p yuv422p yuv444p yuyv422 yuv410p yuv411p yuvj420p \
603
             yuvj422p yuvj444p rgb24 bgr24 rgb32 rgb565 rgb555 gray monow \
604 6b8bcd3e Andreas Öman
             monob pal8 yuv440p yuvj440p"
605 affd55a1 Roman Shaposhnik
for pix_fmt in $conversions ; do
606
    file=${outfile}libav-${pix_fmt}.yuv
607
    do_ffmpeg_nocheck $file -r 1 -t 1 -y -f pgmyuv -i $raw_src \
608
                            -f rawvideo -s 352x288 -pix_fmt $pix_fmt $raw_dst
609
    do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $raw_dst \
610
                    -f rawvideo -s 352x288 -pix_fmt yuv444p $file
611
done
612 2009721d Måns Rullgård
fi
613 51133a7d Fabrice Bellard
614 4383ed5c Måns Rullgård
rm -f "$bench" "$bench2"