From: James Almer Date: Thu, 14 Mar 2019 17:04:55 +0000 (-0300) Subject: Merge commit 'a70eac7a9b193e8434b5bed90bd72aa4cb688363' X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=d0c43e32427ec1efac364be0987a6aafa695527f;p=ffmpeg Merge commit 'a70eac7a9b193e8434b5bed90bd72aa4cb688363' * commit 'a70eac7a9b193e8434b5bed90bd72aa4cb688363': tests: Convert image2pipe tests to non-legacy test scripts Merged-by: James Almer --- d0c43e32427ec1efac364be0987a6aafa695527f diff --cc tests/fate-run.sh index f1a1e34c367,0221e5c1dce..2d5dbf2f47d --- a/tests/fate-run.sh +++ b/tests/fate-run.sh @@@ -209,46 -152,51 +209,93 @@@ enc_dec() tests/tiny_psnr $srcfile $decfile $cmp_unit $cmp_shift } +transcode(){ + src_fmt=$1 + srcfile=$2 + enc_fmt=$3 + enc_opt=$4 + final_decode=$5 + encfile="${outdir}/${test}.${enc_fmt}" + test "$7" = -keep || cleanfiles="$cleanfiles $encfile" + tsrcfile=$(target_path $srcfile) + tencfile=$(target_path $encfile) + ffmpeg -f $src_fmt $DEC_OPTS -i $tsrcfile $ENC_OPTS $enc_opt $FLAGS \ + -f $enc_fmt -y $tencfile || return + do_md5sum $encfile + echo $(wc -c $encfile) + ffmpeg $DEC_OPTS -i $encfile $ENC_OPTS $FLAGS $final_decode \ + -f framecrc - || return +} + +stream_remux(){ + src_fmt=$1 + srcfile=$2 + enc_fmt=$3 + stream_maps=$4 + final_decode=$5 + encfile="${outdir}/${test}.${enc_fmt}" + test "$7" = -keep || cleanfiles="$cleanfiles $encfile" + tsrcfile=$(target_path $srcfile) + tencfile=$(target_path $encfile) + ffmpeg -f $src_fmt -i $tsrcfile $stream_maps -codec copy $FLAGS \ + -f $enc_fmt -y $tencfile || return + ffmpeg $DEC_OPTS -i $encfile $ENC_OPTS $FLAGS $final_decode \ + -f framecrc - || return +} + + # FIXME: There is a certain duplication between the avconv-related helper + # functions above and below that should be refactored. -avconv2="$target_exec ${target_path}/avconv" ++ffmpeg2="$target_exec ${target_path}/ffmpeg" + raw_src="${target_path}/tests/vsynth1/%02d.pgm" + crcfile="tests/data/$test.lavf.crc" + target_crcfile="${target_path}/$crcfile" + ++[ "${V-0}" -gt 0 ] && echov=echov || echov=: ++ + echov(){ + echo "$@" >&3 + } + -AVCONV_OPTS="-nostats -y -cpuflags $cpuflags -threads $threads" ++AVCONV_OPTS="-nostdin -nostats -y -cpuflags $cpuflags -threads $threads" + DEC_OPTS="-flags +bitexact -idct simple -sws_flags +accurate_rnd+bitexact -fflags +bitexact" -ENC_OPTS="$DEC_OPTS -threads 1 -dct fastint" ++ENC_OPTS="$DEC_OPTS -threads $threads -dct fastint" + + run_avconv(){ - $echov $avconv2 $AVCONV_OPTS $* - $avconv2 $AVCONV_OPTS $* ++ $echov $ffmpeg2 $AVCONV_OPTS $* ++ $ffmpeg2 $AVCONV_OPTS $* + } + + do_avconv(){ + f="$1" + shift + set -- $* ${target_path}/$f + run_avconv $* + do_md5sum $f + echo $(wc -c $f) + } + + do_avconv_crc(){ + f="$1" + shift + run_avconv $* -f crc "$target_crcfile" + echo "$f $(cat $crcfile)" + } + + lavf_image2pipe(){ + t="${test#lavf-}" + t="${t%pipe}" + outdir="tests/data/lavf" + file=${outdir}/${t}pipe.$t - do_avconv $file $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src -f image2pipe $ENC_OPTS -t 1 -qscale 10 ++ do_avconv $file $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src -f image2pipe "$ENC_OPTS -metadata title=lavftest" -t 1 -qscale 10 + do_avconv_crc $file $DEC_OPTS -f image2pipe -i $target_path/$file + } + +lavffatetest(){ + t="${test#lavf-fate-}" + ref=${base}/ref/lavf-fate/$t + ${base}/lavf-regression.sh $t lavf-fate tests/vsynth1 "$target_exec" "$target_path" "$threads" "$thread_type" "$cpuflags" "$target_samples" +} + lavftest(){ t="${test#lavf-}" ref=${base}/ref/lavf/$t diff --cc tests/lavf-regression.sh index c5b6734815b,fecc36c0fdf..baf2dc76a52 --- a/tests/lavf-regression.sh +++ b/tests/lavf-regression.sh @@@ -29,23 -19,6 +29,16 @@@ do_lavf( do_avconv_crc $file $DEC_OPTS -i $target_path/$file $4 } +do_lavf_timecode_nodrop() { do_lavf $1 "" "$2 -timecode 02:56:14:13"; } +do_lavf_timecode_drop() { do_lavf $1 "" "$2 -timecode 02:56:14.13 -r 30000/1001"; } + +do_lavf_timecode() +{ + do_lavf_timecode_nodrop "$@" + do_lavf_timecode_drop "$@" + do_lavf $1 "" "$2" +} + - do_streamed_images() - { - file=${outfile}${1}pipe.$1 - do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src -f image2pipe $ENC_OPTS -t 1 -qscale 10 - do_avconv_crc $file $DEC_OPTS -f image2pipe -i $target_path/$file - } - do_image_formats() { outfile="$datadir/images/$1/" @@@ -199,36 -99,12 +192,24 @@@ f # streamed images # mjpeg #file=${outfile}lavf.mjpeg -#do_avconv $file -t 1 -qscale 10 -f image2 -c:v pgmyuv -i $raw_src +#do_avconv $file -t 1 -qscale 10 -f image2 -vcodec pgmyuv -i $raw_src #do_avconv_crc $file -i $target_path/$file - if [ -n "$do_pbmpipe" ] ; then - do_streamed_images pbm - fi - - if [ -n "$do_pgmpipe" ] ; then - do_streamed_images pgm - fi - - if [ -n "$do_ppmpipe" ] ; then - do_streamed_images ppm - fi - if [ -n "$do_gif" ] ; then file=${outfile}lavf.gif -do_avconv $file $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src $ENC_OPTS -t 1 -qscale 10 -pix_fmt rgb24 +do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -t 1 -qscale 10 -pix_fmt rgb24 +do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt rgb24 +fi + +if [ -n "$do_apng" ] ; then +file=${outfile}lavf.apng +do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -t 1 -pix_fmt rgb24 +do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt rgb24 +file_copy=${outfile}lavf.copy.apng +do_avconv $file_copy $DEC_OPTS -i $file $ENC_OPTS -c copy +do_avconv_crc $file_copy $DEC_OPTS -i $target_path/$file_copy +file=${outfile}lavf.png +do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -pix_fmt rgb24 -frames:v 1 -f apng do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt rgb24 fi diff --cc tests/ref/lavf/pbmpipe index 284f90b16b6,ab7d302b4da..5cfb9b5e77e --- a/tests/ref/lavf/pbmpipe +++ b/tests/ref/lavf/pbmpipe @@@ -1,3 -1,3 +1,3 @@@ - 8b974da7f48f9e6d5ae327b4444a71fb *./tests/data/lavf/pbmpipe.pbm - 317075 ./tests/data/lavf/pbmpipe.pbm - ./tests/data/lavf/pbmpipe.pbm CRC=0xfc010c66 -8ced96f5b6b7362358199ae993b4ceb7 *tests/data/lavf/pbmpipe.pbm ++8b974da7f48f9e6d5ae327b4444a71fb *tests/data/lavf/pbmpipe.pbm + 317075 tests/data/lavf/pbmpipe.pbm -tests/data/lavf/pbmpipe.pbm CRC=0xfae0a1ba ++tests/data/lavf/pbmpipe.pbm CRC=0xfc010c66 diff --cc tests/ref/lavf/pgmpipe index da6f9a6d3a9,d854897492e..1077a9514ac --- a/tests/ref/lavf/pgmpipe +++ b/tests/ref/lavf/pgmpipe @@@ -1,3 -1,3 +1,3 @@@ - c34e37ea49237c2d1ea81a5944328e59 *./tests/data/lavf/pgmpipe.pgm - 2534775 ./tests/data/lavf/pgmpipe.pgm - ./tests/data/lavf/pgmpipe.pgm CRC=0x7aa0122f -04e66c8e9e064c8310bd657ee559bd70 *tests/data/lavf/pgmpipe.pgm ++c34e37ea49237c2d1ea81a5944328e59 *tests/data/lavf/pgmpipe.pgm + 2534775 tests/data/lavf/pgmpipe.pgm -tests/data/lavf/pgmpipe.pgm CRC=0xadf48ba9 ++tests/data/lavf/pgmpipe.pgm CRC=0x7aa0122f