Revision 9a5771e9 tests/regression.sh

View differences:

tests/regression.sh
7 7

  
8 8
set -e
9 9

  
10
target_exec=$5
11
target_path=$6
12

  
10 13
datadir="./tests/data"
14
target_datadir="${target_path}/${datadir}"
11 15

  
12 16
test="${1#regtest-}"
13 17
this="$test.$2"
......
17 21
eval do_$test=y
18 22

  
19 23
# various files
20
ffmpeg="./ffmpeg_g"
24
ffmpeg="$target_exec ${target_path}/ffmpeg_g"
21 25
tiny_psnr="tests/tiny_psnr"
22 26
benchfile="$datadir/$this.bench"
23 27
bench="$datadir/$this.bench.tmp"
24 28
bench2="$datadir/$this.bench2.tmp"
25
raw_src="$3/%02d.pgm"
29
raw_src="${target_path}/$3/%02d.pgm"
26 30
raw_dst="$datadir/$this.out.yuv"
27 31
raw_ref="$datadir/$2.ref.yuv"
28
pcm_src="tests/asynth1.sw"
32
pcm_src="${target_path}/tests/asynth1.sw"
29 33
pcm_dst="$datadir/$this.out.wav"
30 34
pcm_ref="$datadir/$2.ref.wav"
31 35
crcfile="$datadir/$this.crc"
36
target_crcfile="$target_datadir/$this.crc"
32 37

  
33 38
if [ X"`echo | md5sum 2> /dev/null`" != X ]; then
34 39
    do_md5sum() { md5sum -b $1; }
......
47 52
{
48 53
    f="$1"
49 54
    shift
55
    set -- $* ${target_path}/$f
50 56
    echo $ffmpeg $FFMPEG_OPTS $*
51 57
    $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
52 58
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
......
67 73
{
68 74
    f="$1"
69 75
    shift
76
    set -- $* ${target_path}/$f
70 77
    echo $ffmpeg $FFMPEG_OPTS $*
71 78
    $ffmpeg $FFMPEG_OPTS -benchmark $* > $bench 2> /tmp/ffmpeg$$
72 79
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:)" /tmp/ffmpeg$$ || true
......
86 93
{
87 94
    f="$1"
88 95
    shift
89
    echo $ffmpeg $FFMPEG_OPTS $* -f crc "$crcfile"
90
    $ffmpeg $FFMPEG_OPTS $* -f crc "$crcfile" > /tmp/ffmpeg$$ 2>&1
96
    echo $ffmpeg $FFMPEG_OPTS $* -f crc "$target_crcfile"
97
    $ffmpeg $FFMPEG_OPTS $* -f crc "$target_crcfile" > /tmp/ffmpeg$$ 2>&1
91 98
    egrep -v "^(Stream|Press|Input|Output|frame|  Stream|  Duration|video:|ffmpeg version|  configuration|  built)" /tmp/ffmpeg$$ || true
92 99
    rm -f /tmp/ffmpeg$$
93 100
    echo "$f `cat $crcfile`" >> $logfile
......
108 115

  
109 116
do_video_decoding()
110 117
{
111
    do_ffmpeg $raw_dst $1 -i $file -f rawvideo $2 $raw_dst
118
    do_ffmpeg $raw_dst $1 -i $target_path/$file -f rawvideo $2
112 119
    rm -f $raw_dst
113 120
}
114 121

  
115 122
do_video_encoding()
116 123
{
117 124
    file=${outfile}$1
118
    do_ffmpeg $file $2 -f image2 -vcodec pgmyuv -i $raw_src $3 $file
125
    do_ffmpeg $file $2 -f image2 -vcodec pgmyuv -i $raw_src $3
119 126
}
120 127

  
121 128
do_audio_encoding()
122 129
{
123 130
    file=${outfile}$1
124
    do_ffmpeg $file -ab 128k -ac 2 -f s16le -i $pcm_src $3 $file
131
    do_ffmpeg $file -ab 128k -ac 2 -f s16le -i $pcm_src $3
125 132
}
126 133

  
127 134
do_audio_decoding()
128 135
{
129
    do_ffmpeg $pcm_dst -i $file -sample_fmt s16 -f wav $pcm_dst
136
    do_ffmpeg $pcm_dst -i $target_path/$file -sample_fmt s16 -f wav
130 137
}
131 138

  
132 139
do_libav()
133 140
{
134 141
    file=${outfile}libav.$1
135
    do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src $2 $file
136
    do_ffmpeg_crc $file -i $file $3
142
    do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src $2
143
    do_ffmpeg_crc $file -i $target_path/$file $3
137 144
}
138 145

  
139 146
do_streamed_images()
140 147
{
141 148
    file=${outfile}${1}pipe.$1
142
    do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f image2pipe $file
143
    do_ffmpeg_crc $file -f image2pipe -i $file
149
    do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f image2pipe
150
    do_ffmpeg_crc $file -f image2pipe -i $target_path/$file
144 151
}
145 152

  
146 153
do_image_formats()
147 154
{
148 155
    file=${outfile}libav%02d.$1
149
    $ffmpeg -t 0.5 -y -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src $2 $3 -flags +bitexact -sws_flags +accurate_rnd+bitexact $file
156
    $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
150 157
    do_md5sum ${outfile}libav02.$1 >> $logfile
151
    do_ffmpeg_crc $file $3 -i $file
158
    do_ffmpeg_crc $file $3 -i $target_path/$file
152 159
    wc -c ${outfile}libav02.$1 >> $logfile
153 160
}
154 161

  
155 162
do_audio_only()
156 163
{
157 164
    file=${outfile}libav.$1
158
    do_ffmpeg $file -t 1 -qscale 10 -f s16le -i $pcm_src $file
159
    do_ffmpeg_crc $file -i $file
165
    do_ffmpeg $file -t 1 -qscale 10 -f s16le -i $pcm_src
166
    do_ffmpeg_crc $file -i $target_path/$file
160 167
}
161 168

  
162 169
rm -f "$logfile"
......
164 171

  
165 172
# generate reference for quality check
166 173
if [ -n "$do_ref" ]; then
167
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
174
do_ffmpeg_nocheck $raw_ref -f image2 -vcodec pgmyuv -i $raw_src -an -f rawvideo $target_path/$raw_ref
175
do_ffmpeg_nocheck $pcm_ref -ab 128k -ac 2 -ar 44100 -f s16le -i $pcm_src -f wav $target_path/$pcm_ref
169 176
fi
170 177

  
171 178
if [ -n "$do_mpeg" ] ; then
......
207 214

  
208 215
# mpeg2 encoding interlaced
209 216
file=${outfile}mpeg2reuse.mpg
210
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
217
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
211 218
do_video_decoding
212 219
fi
213 220

  
......
424 431
if [ -n "$do_wma" ] ; then
425 432
# wmav1
426 433
do_audio_encoding wmav1.asf "-ar 44100" "-acodec wmav1"
427
do_ffmpeg_nomd5 $pcm_dst -i $file -f wav $pcm_dst
434
do_ffmpeg_nomd5 $pcm_dst -i $target_path/$file -f wav
428 435
$tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
429 436
# wmav2
430 437
do_audio_encoding wmav2.asf "-ar 44100" "-acodec wmav2"
431
do_ffmpeg_nomd5 $pcm_dst -i $file -f wav $pcm_dst
438
do_ffmpeg_nomd5 $pcm_dst -i $target_path/$file -f wav
432 439
$tiny_psnr $pcm_dst $pcm_ref 2 8192 >> $logfile
433 440
fi
434 441

  
......
481 488

  
482 489
if [ -n "$do_rm" ] ; then
483 490
file=${outfile}libav.rm
484
do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src $file
491
do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -f s16le -i $pcm_src
485 492
# broken
486
#do_ffmpeg_crc $file -i $file
493
#do_ffmpeg_crc $file -i $target_path/$file
487 494
fi
488 495

  
489 496
if [ -n "$do_mpg" ] ; then
......
530 537
# streamed images
531 538
# mjpeg
532 539
#file=${outfile}libav.mjpeg
533
#do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src $file
534
#do_ffmpeg_crc $file -i $file
540
#do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src
541
#do_ffmpeg_crc $file -i $target_path/$file
535 542

  
536 543
if [ -n "$do_pbmpipe" ] ; then
537 544
do_streamed_images pbm
......
547 554

  
548 555
if [ -n "$do_gif" ] ; then
549 556
file=${outfile}libav.gif
550
do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -pix_fmt rgb24 $file
551
#do_ffmpeg_crc $file -i $file
557
do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src -pix_fmt rgb24
558
#do_ffmpeg_crc $file -i $target_path/$file
552 559
fi
553 560

  
554 561
if [ -n "$do_yuv4mpeg" ] ; then
555 562
file=${outfile}libav.y4m
556
do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src $file
557
#do_ffmpeg_crc $file -i $file
563
do_ffmpeg $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src
564
#do_ffmpeg_crc $file -i $target_path/$file
558 565
fi
559 566

  
560 567
# image formats
......
630 637
for pix_fmt in $conversions ; do
631 638
    file=${outfile}libav-${pix_fmt}.yuv
632 639
    do_ffmpeg_nocheck $file -r 1 -t 1 -f image2 -vcodec pgmyuv -i $raw_src \
633
                            -f rawvideo -s 352x288 -pix_fmt $pix_fmt $raw_dst
634
    do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $raw_dst \
635
                    -f rawvideo -s 352x288 -pix_fmt yuv444p $file
640
                            -f rawvideo -s 352x288 -pix_fmt $pix_fmt $target_path/$raw_dst
641
    do_ffmpeg $file -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $target_path/$raw_dst \
642
                    -f rawvideo -s 352x288 -pix_fmt yuv444p
636 643
done
637 644
fi
638 645

  

Also available in: Unified diff