Statistics
| Branch: | Revision:

ffmpeg / tests / regression.sh @ ea2b716f

History | View | Annotate | Download (14.4 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 bddbd7d3 Ramiro Polla
    do_ffmpeg $raw_dst $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 bddbd7d3 Ramiro Polla
    do_ffmpeg $file $2 -f image2 -vcodec pgmyuv -i $raw_src $3 $file
119 1de61a18 Diego Biurrun
}
120
121 fb132953 Diego Biurrun
do_audio_encoding()
122
{
123
    file=${outfile}$1
124 bddbd7d3 Ramiro Polla
    do_ffmpeg $file -ab 128k -ac 2 -f s16le -i $pcm_src $3 $file
125 fb132953 Diego Biurrun
}
126
127
do_audio_decoding()
128
{
129 bddbd7d3 Ramiro Polla
    do_ffmpeg $pcm_dst -i $file -f wav $pcm_dst
130 fb132953 Diego Biurrun
}
131
132 36aed9e5 Diego Biurrun
do_libav()
133
{
134
    file=${outfile}libav.$1
135 bddbd7d3 Ramiro Polla
    do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src $2 $file
136 36aed9e5 Diego Biurrun
    do_ffmpeg_crc $file -i $file $3
137
}
138
139 d449d1bc Diego Biurrun
do_streamed_images()
140
{
141 2009721d Måns Rullgård
    file=${outfile}${1}pipe.$1
142 bddbd7d3 Ramiro Polla
    do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f image2pipe $file
143 d449d1bc Diego Biurrun
    do_ffmpeg_crc $file -f image2pipe -i $file
144
}
145
146 f8aa7645 Diego Biurrun
do_image_formats()
147
{
148
    file=${outfile}libav%02d.$1
149 88b5db9f Måns Rullgård
    $ffmpeg -t 0.5 -y -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src $2 $3 -flags +bitexact $file
150 199c6e3c Michael Niedermayer
    do_md5sum ${outfile}libav02.$1 >> $logfile
151 3a71577f Baptiste Coudurier
    do_ffmpeg_crc $file $3 -i $file
152
    wc -c ${outfile}libav02.$1 >> $logfile
153 f8aa7645 Diego Biurrun
}
154
155 e587a0a5 Diego Biurrun
do_audio_only()
156
{
157
    file=${outfile}libav.$1
158 bddbd7d3 Ramiro Polla
    do_ffmpeg $file -t 1 -qscale 10 -f s16le -i $pcm_src $file
159 e587a0a5 Diego Biurrun
    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 bddbd7d3 Ramiro Polla
do_ffmpeg_nocheck $raw_ref -f image2 -vcodec pgmyuv -i $raw_src -an -f rawvideo $raw_ref
168
do_ffmpeg_nocheck $pcm_ref -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 5b67e4f8 Måns Rullgård
do_video_encoding mpeg1.mpg "-qscale 10" "-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 5b67e4f8 Måns Rullgård
do_video_encoding mpeg2.mpg "-qscale 10" "-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 5b67e4f8 Måns Rullgård
do_video_encoding mpeg2ivlc-qprd.mpg "-vb 500k -bf 2 -flags +trell+qprd+mv0 -flags2 +ivlc -cmp 2 -subcmp 2 -mbd rd" "-vcodec mpeg2video -f mpeg2video"
184 1de61a18 Diego Biurrun
do_video_decoding
185 307eb248 Baptiste Coudurier
186 0fc3a831 Diego Biurrun
# mpeg2
187 5b67e4f8 Måns Rullgård
do_video_encoding mpeg2.mpg "-qscale 10" "-vcodec mpeg2video -idct int -dct int -f mpeg1video"
188 5e5ac8e0 Diego Biurrun
do_video_decoding "-idct int"
189 6486ad57 Michael Niedermayer
190 83dddc4a Fabrice Bellard
# mpeg2 encoding interlaced
191 5b67e4f8 Måns Rullgård
do_video_encoding mpeg2i.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -flags +ildct+ilme"
192 1de61a18 Diego Biurrun
do_video_decoding
193 51133a7d Fabrice Bellard
fi
194
195 9c3d33d6 Michael Niedermayer
if [ -n "$do_mpeg2thread" ] ; then
196
# mpeg2 encoding interlaced
197 5b67e4f8 Måns Rullgård
do_video_encoding mpeg2thread.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 2"
198 1de61a18 Diego Biurrun
do_video_decoding
199 307eb248 Baptiste Coudurier
200
# mpeg2 encoding interlaced using intra vlc
201 5b67e4f8 Måns Rullgård
do_video_encoding mpeg2threadivlc.mpg "-qscale 10" "-vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -flags2 +ivlc -threads 2"
202 1de61a18 Diego Biurrun
do_video_decoding
203 7f8038ce Michael Niedermayer
204
# mpeg2 encoding interlaced
205
file=${outfile}mpeg2reuse.mpg
206 bddbd7d3 Ramiro Polla
do_ffmpeg $file -sameq -me_threshold 256 -mb_threshold 1024 -i ${outfile}mpeg2thread.mpg -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 4 $file
207 1de61a18 Diego Biurrun
do_video_decoding
208 9c3d33d6 Michael Niedermayer
fi
209
210 6ebd933b Michael Niedermayer
if [ -n "$do_msmpeg4v2" ] ; then
211 5b67e4f8 Måns Rullgård
do_video_encoding msmpeg4v2.avi "-qscale 10" "-an -vcodec msmpeg4v2"
212 1de61a18 Diego Biurrun
do_video_decoding
213 6ebd933b Michael Niedermayer
fi
214
215 51133a7d Fabrice Bellard
if [ -n "$do_msmpeg4" ] ; then
216 5b67e4f8 Måns Rullgård
do_video_encoding msmpeg4.avi "-qscale 10" "-an -vcodec msmpeg4"
217 1de61a18 Diego Biurrun
do_video_decoding
218 51133a7d Fabrice Bellard
fi
219
220 6ebd933b Michael Niedermayer
if [ -n "$do_wmv1" ] ; then
221 5b67e4f8 Måns Rullgård
do_video_encoding wmv1.avi "-qscale 10" "-an -vcodec wmv1"
222 1de61a18 Diego Biurrun
do_video_decoding
223 6ebd933b Michael Niedermayer
fi
224
225 e23d5712 Michael Niedermayer
if [ -n "$do_wmv2" ] ; then
226 5b67e4f8 Måns Rullgård
do_video_encoding wmv2.avi "-qscale 10" "-an -vcodec wmv2"
227 1de61a18 Diego Biurrun
do_video_decoding
228 e23d5712 Michael Niedermayer
fi
229
230 61b262a9 Michael Niedermayer
if [ -n "$do_h261" ] ; then
231 5b67e4f8 Måns Rullgård
do_video_encoding h261.avi "-qscale 11" "-s 352x288 -an -vcodec h261"
232 1de61a18 Diego Biurrun
do_video_decoding
233 61b262a9 Michael Niedermayer
fi
234
235 51133a7d Fabrice Bellard
if [ -n "$do_h263" ] ; then
236 5b67e4f8 Måns Rullgård
do_video_encoding h263.avi "-qscale 10" "-s 352x288 -an -vcodec h263"
237 1de61a18 Diego Biurrun
do_video_decoding
238 6e2d5f1a Michael Niedermayer
fi
239
240
if [ -n "$do_h263p" ] ; then
241 5b67e4f8 Måns Rullgård
do_video_encoding h263p.avi "-qscale 2 -flags +umv+aiv+aic" "-s 352x288 -an -vcodec h263p -ps 300"
242 1de61a18 Diego Biurrun
do_video_decoding
243 51133a7d Fabrice Bellard
fi
244
245
if [ -n "$do_mpeg4" ] ; then
246 5b67e4f8 Måns Rullgård
do_video_encoding odivx.mp4 "-flags +mv4 -mbd bits -qscale 10" "-an -vcodec mpeg4"
247 aeeb0cac Diego Biurrun
do_video_decoding
248 51133a7d Fabrice Bellard
fi
249
250 e629ab68 Romain Dolbeau
if [ -n "$do_huffyuv" ] ; then
251 5b67e4f8 Måns Rullgård
do_video_encoding huffyuv.avi "" "-an -vcodec huffyuv -pix_fmt yuv422p"
252 5e5ac8e0 Diego Biurrun
do_video_decoding "" "-strict -2 -pix_fmt yuv420p"
253 e629ab68 Romain Dolbeau
fi
254
255 1dbb6d90 Michael Niedermayer
if [ -n "$do_rc" ] ; then
256 5b67e4f8 Måns Rullgård
do_video_encoding mpeg4-rc.avi "-b 400k -bf 2" "-an -vcodec mpeg4"
257 aeeb0cac Diego Biurrun
do_video_decoding
258 1dbb6d90 Michael Niedermayer
fi
259
260
if [ -n "$do_mpeg4adv" ] ; then
261 5b67e4f8 Måns Rullgård
do_video_encoding mpeg4-adv.avi "-qscale 9 -flags +mv4+part+aic+trell -mbd bits -ps 200" "-an -vcodec mpeg4"
262 1de61a18 Diego Biurrun
do_video_decoding
263 2d1e5071 Michael Niedermayer
264 5b67e4f8 Måns Rullgård
do_video_encoding mpeg4-qprd.avi "-b 450k -bf 2 -flags +mv4+trell+qprd+mv0 -cmp 2 -subcmp 2 -mbd rd" "-an -vcodec mpeg4"
265 2d1e5071 Michael Niedermayer
do_video_decoding
266
267 5b67e4f8 Måns Rullgård
do_video_encoding mpeg4-adap.avi "-b 550k -bf 2 -flags +mv4+trell+mv0 -cmp 1 -subcmp 2 -mbd rd -scplx_mask 0.3" "-an -vcodec mpeg4"
268 2d1e5071 Michael Niedermayer
do_video_decoding
269 1dbb6d90 Michael Niedermayer
270 5b67e4f8 Måns Rullgård
do_video_encoding mpeg4-Q.avi "-qscale 7 -flags +mv4+qpel -mbd 2 -bf 2 -cmp 1 -subcmp 2" "-an -vcodec mpeg4"
271 1de61a18 Diego Biurrun
do_video_decoding
272 aab9cdcf Michael Niedermayer
fi
273
274 45ddd8b0 Måns Rullgård
if [ -n "$do_mpeg4thread" ] ; then
275 5b67e4f8 Måns Rullgård
do_video_encoding mpeg4-thread.avi "-b 500k -flags +mv4+part+aic+trell -mbd bits -ps 200 -bf 2" "-an -vcodec mpeg4 -threads 2"
276 1de61a18 Diego Biurrun
do_video_decoding
277 9c3d33d6 Michael Niedermayer
fi
278
279 7ebfc0ea Michael Niedermayer
if [ -n "$do_error" ] ; then
280 5b67e4f8 Måns Rullgård
do_video_encoding error-mpeg4-adv.avi "-qscale 7 -flags +mv4+part+aic -mbd rd -ps 250 -error 10" "-an -vcodec mpeg4"
281 1de61a18 Diego Biurrun
do_video_decoding
282 7ebfc0ea Michael Niedermayer
fi
283
284 be408b67 Michael Niedermayer
if [ -n "$do_mpeg4nr" ] ; then
285 5b67e4f8 Måns Rullgård
do_video_encoding mpeg4-nr.avi "-qscale 8 -flags +mv4 -mbd rd -nr 200" "-an -vcodec mpeg4"
286 1de61a18 Diego Biurrun
do_video_decoding
287 be408b67 Michael Niedermayer
fi
288
289 cfadadec Michael Niedermayer
if [ -n "$do_mpeg1b" ] ; then
290 5b67e4f8 Måns Rullgård
do_video_encoding mpeg1b.mpg "-qscale 8 -bf 3 -ps 200" "-an -vcodec mpeg1video -f mpeg1video"
291 1de61a18 Diego Biurrun
do_video_decoding
292 cfadadec Michael Niedermayer
fi
293
294 51133a7d Fabrice Bellard
if [ -n "$do_mjpeg" ] ; then
295 5b67e4f8 Måns Rullgård
do_video_encoding mjpeg.avi "-qscale 10" "-an -vcodec mjpeg -pix_fmt yuvj420p"
296 5e5ac8e0 Diego Biurrun
do_video_decoding "" "-pix_fmt yuv420p"
297 51133a7d Fabrice Bellard
fi
298
299 3b37408b Michael Niedermayer
if [ -n "$do_ljpeg" ] ; then
300 5b67e4f8 Måns Rullgård
do_video_encoding ljpeg.avi "" "-an -vcodec ljpeg -strict -1"
301 1de61a18 Diego Biurrun
do_video_decoding
302 3b37408b Michael Niedermayer
fi
303
304 b4e021e8 Michael Niedermayer
if [ -n "$do_jpegls" ] ; then
305 5b67e4f8 Måns Rullgård
do_video_encoding jpegls.avi "" "-an -vcodec jpegls -vtag MJPG"
306 5e5ac8e0 Diego Biurrun
do_video_decoding "" "-pix_fmt yuv420p"
307 b4e021e8 Michael Niedermayer
fi
308
309 51133a7d Fabrice Bellard
if [ -n "$do_rv10" ] ; then
310 5b67e4f8 Måns Rullgård
do_video_encoding rv10.rm "-qscale 10" "-an"
311 1de61a18 Diego Biurrun
do_video_decoding
312 51133a7d Fabrice Bellard
fi
313
314 c50cd09d Michael Niedermayer
if [ -n "$do_rv20" ] ; then
315 5b67e4f8 Måns Rullgård
do_video_encoding rv20.rm "-qscale 10" "-vcodec rv20 -an"
316 1de61a18 Diego Biurrun
do_video_decoding
317 c50cd09d Michael Niedermayer
fi
318
319 9ca9fce1 Michael Niedermayer
if [ -n "$do_asv1" ] ; then
320 5b67e4f8 Måns Rullgård
do_video_encoding asv1.avi "-qscale 10" "-an -vcodec asv1"
321 1de61a18 Diego Biurrun
do_video_decoding
322 9ca9fce1 Michael Niedermayer
fi
323
324 8d876a43 Michael Niedermayer
if [ -n "$do_asv2" ] ; then
325 5b67e4f8 Måns Rullgård
do_video_encoding asv2.avi "-qscale 10" "-an -vcodec asv2"
326 1de61a18 Diego Biurrun
do_video_decoding
327 8d876a43 Michael Niedermayer
fi
328
329 bbdd42d3 Michael Niedermayer
if [ -n "$do_flv" ] ; then
330 5b67e4f8 Måns Rullgård
do_video_encoding flv.flv "-qscale 10" "-an -vcodec flv"
331 1de61a18 Diego Biurrun
do_video_decoding
332 bbdd42d3 Michael Niedermayer
fi
333
334 f3203047 Michael Niedermayer
if [ -n "$do_ffv1" ] ; then
335 5b67e4f8 Måns Rullgård
do_video_encoding ffv1.avi "-strict -2" "-an -vcodec ffv1"
336 1de61a18 Diego Biurrun
do_video_decoding
337 d13eef3d Michael Niedermayer
fi
338
339
if [ -n "$do_snow" ] ; then
340 5b67e4f8 Måns Rullgård
do_video_encoding snow.avi "-strict -2" "-an -vcodec snow -qscale 2 -flags +qpel -me iter -dia_size 2 -cmp 12 -subcmp 12 -s 128x64"
341 5e5ac8e0 Diego Biurrun
do_video_decoding "" "-s 352x288"
342 e03c822a Michael Niedermayer
fi
343 d13eef3d Michael Niedermayer
344 e03c822a Michael Niedermayer
if [ -n "$do_snowll" ] ; then
345 5b67e4f8 Måns Rullgård
do_video_encoding snow53.avi "-strict -2" "-an -vcodec snow -qscale .001 -pred 1 -flags +mv4+qpel"
346 1de61a18 Diego Biurrun
do_video_decoding
347 f3203047 Michael Niedermayer
fi
348
349 8fce2707 Michael Niedermayer
if [ -n "$do_dv" ] ; then
350 5b67e4f8 Måns Rullgård
do_video_encoding dv.dv "-dct int" "-s pal -an"
351 5e5ac8e0 Diego Biurrun
do_video_decoding "" "-s cif"
352 8fce2707 Michael Niedermayer
fi
353
354 0b297700 Daniel Maas
if [ -n "$do_dv50" ] ; then
355 5b67e4f8 Måns Rullgård
do_video_encoding dv50.dv "-dct int" "-s pal -pix_fmt yuv422p -an"
356 5e5ac8e0 Diego Biurrun
do_video_decoding "" "-s cif -pix_fmt yuv420p"
357 0b297700 Daniel Maas
fi
358
359 b86bd1f1 Michael Niedermayer
if [ -n "$do_svq1" ] ; then
360 5b67e4f8 Måns Rullgård
do_video_encoding svq1.mov "" "-an -vcodec svq1 -qscale 3 -pix_fmt yuv410p"
361 5e5ac8e0 Diego Biurrun
do_video_decoding "" "-pix_fmt yuv420p"
362 b86bd1f1 Michael Niedermayer
fi
363
364 d2f8f410 Michael Niedermayer
if [ -n "$do_flashsv" ] ; then
365 5b67e4f8 Måns Rullgård
do_video_encoding flashsv.flv "" "-an -vcodec flashsv "
366 d2f8f410 Michael Niedermayer
do_video_decoding "" "-pix_fmt yuv420p"
367
fi
368
369 51133a7d Fabrice Bellard
if [ -n "$do_mp2" ] ; then
370 fb132953 Diego Biurrun
do_audio_encoding mp2.mp2 "-ar 44100"
371
do_audio_decoding
372 976709ee Michael Niedermayer
$tiny_psnr $pcm_dst $pcm_ref 2 1924 >> $logfile
373 51133a7d Fabrice Bellard
fi
374
375
if [ -n "$do_ac3" ] ; then
376 fb132953 Diego Biurrun
do_audio_encoding ac3.rm "" -vn
377
#do_audio_decoding
378 51133a7d Fabrice Bellard
fi
379
380 311be1fb Michael Niedermayer
if [ -n "$do_g726" ] ; then
381 066a81a8 Benoit Fouet
do_audio_encoding g726.wav "-ar 44100" "-ab 32k -ac 1 -ar 8000 -acodec g726"
382 fb132953 Diego Biurrun
do_audio_decoding
383 311be1fb Michael Niedermayer
fi
384
385 f02ab814 Michael Niedermayer
if [ -n "$do_adpcm_ima_wav" ] ; then
386 fb132953 Diego Biurrun
do_audio_encoding adpcm_ima.wav "-ar 44100" "-acodec adpcm_ima_wav"
387
do_audio_decoding
388 f02ab814 Michael Niedermayer
fi
389
390 9dc92a38 Kostya Shishkov
if [ -n "$do_adpcm_ima_qt" ] ; then
391
do_audio_encoding adpcm_qt.aiff "-ar 44100" "-acodec adpcm_ima_qt"
392
do_audio_decoding
393
fi
394
395 f02ab814 Michael Niedermayer
if [ -n "$do_adpcm_ms" ] ; then
396 fb132953 Diego Biurrun
do_audio_encoding adpcm_ms.wav "-ar 44100" "-acodec adpcm_ms"
397
do_audio_decoding
398 f02ab814 Michael Niedermayer
fi
399
400 d8cbeba1 Michael Niedermayer
if [ -n "$do_adpcm_yam" ] ; then
401 fb132953 Diego Biurrun
do_audio_encoding adpcm_yam.wav "-ar 44100" "-acodec adpcm_yamaha"
402
do_audio_decoding
403 d8cbeba1 Michael Niedermayer
fi
404
405 b529ab37 Benjamin Larsson
if [ -n "$do_adpcm_swf" ] ; then
406
do_audio_encoding adpcm_swf.flv "-ar 44100" "-acodec adpcm_swf"
407
do_audio_decoding
408
fi
409
410 aeb2904e Michael Niedermayer
if [ -n "$do_flac" ] ; then
411 fb132953 Diego Biurrun
do_audio_encoding flac.flac "-ar 44100" "-acodec flac -compression_level 2"
412
do_audio_decoding
413 aeb2904e Michael Niedermayer
fi
414
415 6d3d8dae Michael Niedermayer
if [ -n "$do_wma" ] ; then
416
# wmav1
417
do_audio_encoding wmav1.asf "-ar 44100" "-acodec wmav1"
418 bddbd7d3 Ramiro Polla
do_ffmpeg_nomd5 $pcm_dst -i $file -f wav $pcm_dst
419 6d3d8dae Michael Niedermayer
$tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
420
# wmav2
421
do_audio_encoding wmav2.asf "-ar 44100" "-acodec wmav2"
422 bddbd7d3 Ramiro Polla
do_ffmpeg_nomd5 $pcm_dst -i $file -f wav $pcm_dst
423 6d3d8dae Michael Niedermayer
$tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
424
fi
425
426 0786943a Michael Niedermayer
#if [ -n "$do_vorbis" ] ; then
427 3160138f Michael Niedermayer
# vorbis
428 90b5b51e Diego Biurrun
#disabled because it is broken
429 0786943a Michael Niedermayer
#do_audio_encoding vorbis.asf "-ar 44100" "-acodec vorbis"
430
#do_audio_decoding
431
#fi
432 6d3d8dae Michael Niedermayer
433 2a048239 Diego Biurrun
# libavformat testing
434 89d5dfd5 Fabrice Bellard
435 2009721d Måns Rullgård
if [ -n "$do_avi" ] ; then
436 36aed9e5 Diego Biurrun
do_libav avi
437 2009721d Måns Rullgård
fi
438 89d5dfd5 Fabrice Bellard
439 2009721d Måns Rullgård
if [ -n "$do_asf" ] ; then
440 36aed9e5 Diego Biurrun
do_libav asf "-acodec mp2" "-r 25"
441 2009721d Måns Rullgård
fi
442 89d5dfd5 Fabrice Bellard
443 2009721d Måns Rullgård
if [ -n "$do_rm" ] ; then
444 89d5dfd5 Fabrice Bellard
file=${outfile}libav.rm
445 bddbd7d3 Ramiro Polla
do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src $file
446 89d5dfd5 Fabrice Bellard
# broken
447
#do_ffmpeg_crc $file -i $file
448 2009721d Måns Rullgård
fi
449 89d5dfd5 Fabrice Bellard
450 2009721d Måns Rullgård
if [ -n "$do_mpg" ] ; then
451 36aed9e5 Diego Biurrun
do_libav mpg
452 2009721d Måns Rullgård
fi
453 89d5dfd5 Fabrice Bellard
454 2009721d Måns Rullgård
if [ -n "$do_ts" ] ; then
455 36aed9e5 Diego Biurrun
do_libav ts
456 2009721d Måns Rullgård
fi
457 d05c15cb Michael Niedermayer
458 2009721d Måns Rullgård
if [ -n "$do_swf" ] ; then
459 662fd26c Baptiste Coudurier
do_libav swf -an
460 2009721d Måns Rullgård
fi
461 89d5dfd5 Fabrice Bellard
462 2009721d Måns Rullgård
if [ -n "$do_ffm" ] ; then
463 36aed9e5 Diego Biurrun
do_libav ffm
464 2009721d Måns Rullgård
fi
465 89d5dfd5 Fabrice Bellard
466 2009721d Måns Rullgård
if [ -n "$do_flv_fmt" ] ; then
467 36aed9e5 Diego Biurrun
do_libav flv -an
468 2009721d Måns Rullgård
fi
469 bbdd42d3 Michael Niedermayer
470 2009721d Måns Rullgård
if [ -n "$do_mov" ] ; then
471 36aed9e5 Diego Biurrun
do_libav mov "-acodec pcm_alaw"
472 2009721d Måns Rullgård
fi
473 c280f2d7 Michael Niedermayer
474 2009721d Måns Rullgård
if [ -n "$do_dv_fmt" ] ; then
475 36aed9e5 Diego Biurrun
do_libav dv "-ar 48000 -r 25 -s pal -ac 2"
476 2009721d Måns Rullgård
fi
477 a811de6e Michael Niedermayer
478 2009721d Måns Rullgård
if [ -n "$do_gxf" ] ; then
479 36aed9e5 Diego Biurrun
do_libav gxf "-ar 48000 -r 25 -s pal -ac 1"
480 2009721d Måns Rullgård
fi
481 a850fd18 Baptiste Coudurier
482 2009721d Måns Rullgård
if [ -n "$do_nut" ] ; then
483 f38e2b13 Michael Niedermayer
do_libav nut "-acodec mp2"
484 2009721d Måns Rullgård
fi
485 f38e2b13 Michael Niedermayer
486 2009721d Måns Rullgård
if [ -n "$do_mkv" ] ; then
487 46491f13 David Conrad
do_libav mkv
488 2009721d Måns Rullgård
fi
489 46491f13 David Conrad
490 f38e2b13 Michael Niedermayer
491 89d5dfd5 Fabrice Bellard
# streamed images
492
# mjpeg
493 affd55a1 Roman Shaposhnik
#file=${outfile}libav.mjpeg
494 bddbd7d3 Ramiro Polla
#do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src $file
495 affd55a1 Roman Shaposhnik
#do_ffmpeg_crc $file -i $file
496 89d5dfd5 Fabrice Bellard
497 2009721d Måns Rullgård
if [ -n "$do_pbmpipe" ] ; then
498 d449d1bc Diego Biurrun
do_streamed_images pbm
499 2009721d Måns Rullgård
fi
500 7481e919 Fabrice Bellard
501 2009721d Måns Rullgård
if [ -n "$do_pgmpipe" ] ; then
502 d449d1bc Diego Biurrun
do_streamed_images pgm
503 2009721d Måns Rullgård
fi
504 89d5dfd5 Fabrice Bellard
505 2009721d Måns Rullgård
if [ -n "$do_ppmpipe" ] ; then
506 d449d1bc Diego Biurrun
do_streamed_images ppm
507 2009721d Måns Rullgård
fi
508 89d5dfd5 Fabrice Bellard
509 2009721d Måns Rullgård
if [ -n "$do_gif" ] ; then
510 89d5dfd5 Fabrice Bellard
file=${outfile}libav.gif
511 bddbd7d3 Ramiro Polla
do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -pix_fmt rgb24 $file
512 7481e919 Fabrice Bellard
#do_ffmpeg_crc $file -i $file
513 2009721d Måns Rullgård
fi
514 7481e919 Fabrice Bellard
515 2009721d Måns Rullgård
if [ -n "$do_yuv4mpeg" ] ; then
516 8cf71ead Roine Gustafsson
file=${outfile}libav.y4m
517 bddbd7d3 Ramiro Polla
do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src $file
518 7481e919 Fabrice Bellard
#do_ffmpeg_crc $file -i $file
519 2009721d Måns Rullgård
fi
520 89d5dfd5 Fabrice Bellard
521
# image formats
522 2009721d Måns Rullgård
523
if [ -n "$do_pgm" ] ; then
524 f8aa7645 Diego Biurrun
do_image_formats pgm
525 2009721d Måns Rullgård
fi
526 89d5dfd5 Fabrice Bellard
527 2009721d Måns Rullgård
if [ -n "$do_ppm" ] ; then
528 f8aa7645 Diego Biurrun
do_image_formats ppm
529 2009721d Måns Rullgård
fi
530 89d5dfd5 Fabrice Bellard
531 2009721d Måns Rullgård
if [ -n "$do_bmp" ] ; then
532 1e358f03 Michael Niedermayer
do_image_formats bmp
533 2009721d Måns Rullgård
fi
534 1e358f03 Michael Niedermayer
535 2009721d Måns Rullgård
if [ -n "$do_tga" ] ; then
536 1e358f03 Michael Niedermayer
do_image_formats tga
537 2009721d Måns Rullgård
fi
538 1e358f03 Michael Niedermayer
539 2009721d Måns Rullgård
if [ -n "$do_tiff" ] ; then
540 f4d47d6b Kamil Nowosad
do_image_formats tiff "-pix_fmt rgb24"
541 2009721d Måns Rullgård
fi
542 90b4e393 Michael Niedermayer
543 2009721d Måns Rullgård
if [ -n "$do_sgi" ] ; then
544 90b4e393 Michael Niedermayer
do_image_formats sgi
545 2009721d Måns Rullgård
fi
546 90b4e393 Michael Niedermayer
547 2009721d Måns Rullgård
if [ -n "$do_jpg" ] ; then
548 f8aa7645 Diego Biurrun
do_image_formats jpg "-flags +bitexact -dct fastint -idct simple -pix_fmt yuvj420p" "-f image2"
549 2009721d Måns Rullgård
fi
550 d0c30ca5 Fabrice Bellard
551 89d5dfd5 Fabrice Bellard
# audio only
552
553 2009721d Måns Rullgård
if [ -n "$do_wav" ] ; then
554 e587a0a5 Diego Biurrun
do_audio_only wav
555 2009721d Måns Rullgård
fi
556 89d5dfd5 Fabrice Bellard
557 2009721d Måns Rullgård
if [ -n "$do_alaw" ] ; then
558 e587a0a5 Diego Biurrun
do_audio_only al
559 2009721d Måns Rullgård
fi
560 89d5dfd5 Fabrice Bellard
561 2009721d Måns Rullgård
if [ -n "$do_mulaw" ] ; then
562 e587a0a5 Diego Biurrun
do_audio_only ul
563 2009721d Måns Rullgård
fi
564 89d5dfd5 Fabrice Bellard
565 2009721d Måns Rullgård
if [ -n "$do_au" ] ; then
566 e587a0a5 Diego Biurrun
do_audio_only au
567 2009721d Måns Rullgård
fi
568 89d5dfd5 Fabrice Bellard
569 2009721d Måns Rullgård
if [ -n "$do_mmf" ] ; then
570 e587a0a5 Diego Biurrun
do_audio_only mmf
571 2009721d Måns Rullgård
fi
572 d8cbeba1 Michael Niedermayer
573 2009721d Måns Rullgård
if [ -n "$do_aiff" ] ; then
574 e587a0a5 Diego Biurrun
do_audio_only aif
575 2009721d Måns Rullgård
fi
576 f11288da Michael Niedermayer
577 2009721d Måns Rullgård
if [ -n "$do_voc" ] ; then
578 e587a0a5 Diego Biurrun
do_audio_only voc
579 2009721d Måns Rullgård
fi
580 ea395e8c Aurelien Jacobs
581 2009721d Måns Rullgård
if [ -n "$do_ogg" ] ; then
582 5118cae6 Baptiste Coudurier
do_audio_only ogg
583 2009721d Måns Rullgård
fi
584 5118cae6 Baptiste Coudurier
585 affd55a1 Roman Shaposhnik
# pix_fmt conversions
586 2009721d Måns Rullgård
587
if [ -n "$do_pixfmt" ] ; then
588 dc8918ad Baptiste Coudurier
conversions="yuv420p yuv422p yuv444p yuyv422 yuv410p yuv411p yuvj420p \
589
             yuvj422p yuvj444p rgb24 bgr24 rgb32 rgb565 rgb555 gray monow \
590 6b8bcd3e Andreas Öman
             monob pal8 yuv440p yuvj440p"
591 affd55a1 Roman Shaposhnik
for pix_fmt in $conversions ; do
592
    file=${outfile}libav-${pix_fmt}.yuv
593 bddbd7d3 Ramiro Polla
    do_ffmpeg_nocheck $file -r 1 -t 1 -f image2 -vcodec pgmyuv -i $raw_src \
594 affd55a1 Roman Shaposhnik
                            -f rawvideo -s 352x288 -pix_fmt $pix_fmt $raw_dst
595
    do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $raw_dst \
596
                    -f rawvideo -s 352x288 -pix_fmt yuv444p $file
597
done
598 2009721d Måns Rullgård
fi
599 51133a7d Fabrice Bellard
600 4383ed5c Måns Rullgård
rm -f "$bench" "$bench2"