diff --git a/tests/Makefile b/tests/Makefile index 3d88a5ddd6..ae48db8586 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -89,11 +89,11 @@ include $(SRC_PATH)/$(APITESTSDIR)/Makefile include $(SRC_PATH)/tests/fate/acodec.mak include $(SRC_PATH)/tests/fate/vcodec.mak -include $(SRC_PATH)/tests/fate/avformat.mak include $(SRC_PATH)/tests/fate/lavf-audio.mak include $(SRC_PATH)/tests/fate/lavf-container.mak include $(SRC_PATH)/tests/fate/lavf-image.mak include $(SRC_PATH)/tests/fate/lavf-image2pipe.mak +include $(SRC_PATH)/tests/fate/lavf-video.mak include $(SRC_PATH)/tests/fate/seek.mak include $(SRC_PATH)/tests/fate/aac.mak @@ -170,6 +170,7 @@ include $(SRC_PATH)/tests/fate/qt.mak include $(SRC_PATH)/tests/fate/qtrle.mak include $(SRC_PATH)/tests/fate/real.mak include $(SRC_PATH)/tests/fate/screen.mak +include $(SRC_PATH)/tests/fate/segment.mak include $(SRC_PATH)/tests/fate/source.mak include $(SRC_PATH)/tests/fate/speedhq.mak include $(SRC_PATH)/tests/fate/subtitles.mak diff --git a/tests/fate-run.sh b/tests/fate-run.sh index 7e6d2b1a7e..4c77b2dc1b 100755 --- a/tests/fate-run.sh +++ b/tests/fate-run.sh @@ -340,16 +340,12 @@ lavf_image2pipe(){ 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(){ +lavf_video(){ t="${test#lavf-}" - ref=${base}/ref/lavf/$t - ${base}/lavf-regression.sh $t lavf tests/vsynth1 "$target_exec" "$target_path" "$threads" "$thread_type" "$cpuflags" "$target_samples" + outdir="tests/data/lavf" + file=${outdir}/lavf.$t + do_avconv $file $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src "$ENC_OPTS -metadata title=lavftest" -t 1 -qscale 10 $1 $2 + do_avconv_crc $file $DEC_OPTS -i $target_path/$file $1 } refcmp_metadata(){ diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak index 0975af2612..ac68cde3f9 100644 --- a/tests/fate/ffmpeg.mak +++ b/tests/fate/ffmpeg.mak @@ -93,6 +93,10 @@ fate-copy-trac2211-avi: $(TARGET_SAMPLES)/h264/bbc2.sample.h264 fate-copy-trac2211-avi: CMD = transcode "h264 -r 14" $(TARGET_SAMPLES)/h264/bbc2.sample.h264\ avi "-c:a copy -c:v copy" +FATE_STREAMCOPY-$(call ALLYES, APNG_DEMUXER APNG_MUXER) += fate-copy-apng +fate-copy-apng: fate-lavf-apng +fate-copy-apng: CMD = transcode apng "$(TARGET_PATH)/tests/data/lavf/lavf.apng" apng "-c:v copy" + FATE_STREAMCOPY-$(call DEMMUX, OGG, OGG) += fate-limited_input_seek fate-limited_input_seek-copyts fate-limited_input_seek: $(TARGET_SAMPLES)/vorbis/moog_small.ogg fate-limited_input_seek: CMD = md5 -ss 1.5 -t 1.3 -i $(TARGET_SAMPLES)/vorbis/moog_small.ogg -c:a copy -fflags +bitexact -f ogg diff --git a/tests/fate/lavf-video.mak b/tests/fate/lavf-video.mak new file mode 100644 index 0000000000..7a70ac90ce --- /dev/null +++ b/tests/fate/lavf-video.mak @@ -0,0 +1,29 @@ +FATE_LAVF_VIDEO-$(call ENCDEC, APNG, APNG) += apng +FATE_LAVF_VIDEO-$(call ENCDEC, APNG, APNG) += apng.png +FATE_LAVF_VIDEO-$(call ENCDEC, FITS, FITS) += gray.fits +FATE_LAVF_VIDEO-$(call ENCDEC, FITS, FITS) += gray16be.fits +FATE_LAVF_VIDEO-$(call ENCDEC, FITS, FITS) += gbrp.fits +FATE_LAVF_VIDEO-$(call ENCDEC, FITS, FITS) += gbrap.fits +FATE_LAVF_VIDEO-$(call ENCDEC, FITS, FITS) += gbrp16be.fits +FATE_LAVF_VIDEO-$(call ENCDEC, FITS, FITS) += gbrap16be.fits +FATE_LAVF_VIDEO-$(call ENCDEC, GIF, FITS) += gif +FATE_LAVF_VIDEO-$(CONFIG_YUV4MPEGPIPE_MUXER) += y4m + +FATE_LAVF_VIDEO = $(FATE_LAVF_VIDEO-yes:%=fate-lavf-%) + +$(FATE_LAVF_VIDEO): CMD = lavf_video +$(FATE_LAVF_VIDEO): REF = $(SRC_PATH)/tests/ref/lavf/$(@:fate-lavf-%=%) +$(FATE_LAVF_VIDEO): $(VREF) + +fate-lavf-apng: CMD = lavf_video "-pix_fmt rgb24" +fate-lavf-apng.png: CMD = lavf_video "-pix_fmt rgb24" "-frames:v 1 -f apng" +fate-lavf-gray.fits: CMD = lavf_video "-pix_fmt gray" +fate-lavf-gray16be.fits: CMD = lavf_video "-pix_fmt gray16be" +fate-lavf-gbrp.fits: CMD = lavf_video "-pix_fmt gbrp" +fate-lavf-gbrap.fits: CMD = lavf_video "-pix_fmt gbrap" +fate-lavf-gbrp16be.fits: CMD = lavf_video "-pix_fmt gbrp16be" +fate-lavf-gbrap16be.fits: CMD = lavf_video "-pix_fmt gbrap16be" +fate-lavf-gif: CMD = lavf_video "-pix_fmt rgb24" + +FATE_AVCONV += $(FATE_LAVF_VIDEO) +fate-lavf-video fate-lavf: $(FATE_LAVF_VIDEO) diff --git a/tests/fate/seek.mak b/tests/fate/seek.mak index d466498723..a15c9e919a 100644 --- a/tests/fate/seek.mak +++ b/tests/fate/seek.mak @@ -200,7 +200,7 @@ FATE_SEEK_LAVF-$(call ENCDEC2, MPEG2VIDEO, MP2, MPEGTS) += ts FATE_SEEK_LAVF-$(call ENCDEC, PCM_U8, VOC) += voc FATE_SEEK_LAVF-$(call ENCDEC, PCM_S16LE, WAV) += wav FATE_SEEK_LAVF-$(call ENCDEC, MP2, WTV) += wtv -FATE_SEEK_LAVF-$(CONFIG_YUV4MPEGPIPE_MUXER) += yuv4mpeg +FATE_SEEK_LAVF-$(CONFIG_YUV4MPEGPIPE_MUXER) += y4m fate-seek-lavf-aiff: SRC = lavf/lavf.aiff fate-seek-lavf-al: SRC = lavf/lavf.al @@ -241,7 +241,7 @@ fate-seek-lavf-ts: SRC = lavf/lavf.ts fate-seek-lavf-voc: SRC = lavf/lavf.voc fate-seek-lavf-wav: SRC = lavf/lavf.wav fate-seek-lavf-wtv: SRC = lavf/lavf.wtv -fate-seek-lavf-yuv4mpeg: SRC = lavf/lavf.y4m +fate-seek-lavf-y4m: SRC = lavf/lavf.y4m FATE_SEEK += $(FATE_SEEK_LAVF-yes:%=fate-seek-lavf-%) diff --git a/tests/fate/avformat.mak b/tests/fate/segment.mak similarity index 86% rename from tests/fate/avformat.mak rename to tests/fate/segment.mak index 5dfd0fada4..ddefbed3bd 100644 --- a/tests/fate/avformat.mak +++ b/tests/fate/segment.mak @@ -1,17 +1,3 @@ -FATE_LAVF-$(call ENCDEC, APNG, APNG) += apng -FATE_LAVF-$(call ENCDEC, FITS, FITS) += fits -FATE_LAVF-$(call ENCDEC, GIF, IMAGE2) += gif -FATE_LAVF-$(CONFIG_YUV4MPEGPIPE_MUXER) += yuv4mpeg - -FATE_LAVF += $(FATE_LAVF-yes:%=fate-lavf-%) - -$(FATE_LAVF): $(AREF) $(VREF) -$(FATE_LAVF): CMD = lavftest -$(FATE_LAVF): CMP = - -FATE_AVCONV += $(FATE_LAVF) -fate-lavf: $(FATE_LAVF) - tests/data/mp4-to-ts.m3u8: TAG = GEN tests/data/mp4-to-ts.m3u8: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \ diff --git a/tests/lavf-regression.sh b/tests/lavf-regression.sh deleted file mode 100755 index cad96c1927..0000000000 --- a/tests/lavf-regression.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -# -# automatic regression test for libavformat -# -# -#set -x - -set -e - -. $(dirname $0)/regression-funcs.sh - -eval do_$test=y - -ENC_OPTS="$ENC_OPTS -metadata title=lavftest" - -# streamed images -# mjpeg -#file=${outfile}lavf.mjpeg -#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_gif" ] ; then -file=${outfile}lavf.gif -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 - -if [ -n "$do_yuv4mpeg" ] ; then -file=${outfile}lavf.y4m -do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -t 1 -qscale 10 -do_avconv_crc $file -i $target_path/$file -fi - -if [ -n "$do_fits" ] ; then -pix_fmts="gray gray16be gbrp gbrap gbrp16be gbrap16be" -for pix_fmt in $pix_fmts ; do - file=${outfile}${pix_fmt}lavf.fits - do_avconv $file $DEC_OPTS -f image2 -vcodec pgmyuv -i $raw_src $ENC_OPTS -pix_fmt $pix_fmt - do_avconv_crc $file $DEC_OPTS -i $target_path/$file -pix_fmt $pix_fmt -done -fi diff --git a/tests/ref/fate/copy-apng b/tests/ref/fate/copy-apng new file mode 100644 index 0000000000..3057573cee --- /dev/null +++ b/tests/ref/fate/copy-apng @@ -0,0 +1,32 @@ +a4c46fad7716ad094eb3c78b74ca0244 *tests/data/fate/copy-apng.apng +6209864 tests/data/fate/copy-apng.apng +#tb 0: 1/25 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 352x288 +#sar 0: 0/1 +0, 0, 0, 1, 304128, 0x348bb7a0 +0, 1, 1, 1, 304128, 0xaf9634d7 +0, 2, 2, 1, 304128, 0x81161fd3 +0, 3, 3, 1, 304128, 0x6839b383 +0, 4, 4, 1, 304128, 0xa55299b8 +0, 5, 5, 1, 304128, 0x66fb65b3 +0, 6, 6, 1, 304128, 0xe6be2a99 +0, 7, 7, 1, 304128, 0xfb33cb55 +0, 8, 8, 1, 304128, 0x51ab3d74 +0, 9, 9, 1, 304128, 0x67dc44ee +0, 10, 10, 1, 304128, 0x2eac3b50 +0, 11, 11, 1, 304128, 0xd4a4c377 +0, 12, 12, 1, 304128, 0x1eefe29c +0, 13, 13, 1, 304128, 0x3a84d488 +0, 14, 14, 1, 304128, 0x70d3b165 +0, 15, 15, 1, 304128, 0x578e58d4 +0, 16, 16, 1, 304128, 0x08bba87e +0, 17, 17, 1, 304128, 0xccc86c47 +0, 18, 18, 1, 304128, 0x70bf9aa2 +0, 19, 19, 1, 304128, 0x3fc3d5b5 +0, 20, 20, 1, 304128, 0xef52590b +0, 21, 21, 1, 304128, 0x4f7adde0 +0, 22, 22, 1, 304128, 0xc076ef54 +0, 23, 23, 1, 304128, 0xed2bba2d +0, 24, 24, 1, 304128, 0x6fce6367 diff --git a/tests/ref/lavf/apng b/tests/ref/lavf/apng index 8e9e5e6b73..95f1fbee6f 100644 --- a/tests/ref/lavf/apng +++ b/tests/ref/lavf/apng @@ -1,9 +1,3 @@ -a4c46fad7716ad094eb3c78b74ca0244 *./tests/data/lavf/lavf.apng -6209864 ./tests/data/lavf/lavf.apng -./tests/data/lavf/lavf.apng CRC=0x87b3c15f -a4c46fad7716ad094eb3c78b74ca0244 *./tests/data/lavf/lavf.copy.apng -6209864 ./tests/data/lavf/lavf.copy.apng -./tests/data/lavf/lavf.copy.apng CRC=0x87b3c15f -c5900fdd1b2fc30b985793f5226fd0c4 *./tests/data/lavf/lavf.png -248854 ./tests/data/lavf/lavf.png -./tests/data/lavf/lavf.png CRC=0xd8c7b7a1 +a4c46fad7716ad094eb3c78b74ca0244 *tests/data/lavf/lavf.apng +6209864 tests/data/lavf/lavf.apng +tests/data/lavf/lavf.apng CRC=0x87b3c15f diff --git a/tests/ref/lavf/apng.png b/tests/ref/lavf/apng.png new file mode 100644 index 0000000000..b42f5a8db8 --- /dev/null +++ b/tests/ref/lavf/apng.png @@ -0,0 +1,3 @@ +c5900fdd1b2fc30b985793f5226fd0c4 *tests/data/lavf/lavf.apng.png +248854 tests/data/lavf/lavf.apng.png +tests/data/lavf/lavf.apng.png CRC=0xd8c7b7a1 diff --git a/tests/ref/lavf/gbrap.fits b/tests/ref/lavf/gbrap.fits new file mode 100644 index 0000000000..57c71e179d --- /dev/null +++ b/tests/ref/lavf/gbrap.fits @@ -0,0 +1,3 @@ +28eb102547b82acca57ef097a6c639d8 *tests/data/lavf/lavf.gbrap.fits +10224000 tests/data/lavf/lavf.gbrap.fits +tests/data/lavf/lavf.gbrap.fits CRC=0x883af247 diff --git a/tests/ref/lavf/gbrap16be.fits b/tests/ref/lavf/gbrap16be.fits new file mode 100644 index 0000000000..030a6d90ed --- /dev/null +++ b/tests/ref/lavf/gbrap16be.fits @@ -0,0 +1,3 @@ +ff5fb24a67aeabd4f56088ca8b03d8b0 *tests/data/lavf/lavf.gbrap16be.fits +20376000 tests/data/lavf/lavf.gbrap16be.fits +tests/data/lavf/lavf.gbrap16be.fits CRC=0xa981271b diff --git a/tests/ref/lavf/gbrp.fits b/tests/ref/lavf/gbrp.fits new file mode 100644 index 0000000000..2b60ddb336 --- /dev/null +++ b/tests/ref/lavf/gbrp.fits @@ -0,0 +1,3 @@ +dae49b5f6eb58981ba91e3e108355717 *tests/data/lavf/lavf.gbrp.fits +7704000 tests/data/lavf/lavf.gbrp.fits +tests/data/lavf/lavf.gbrp.fits CRC=0x80745c5e diff --git a/tests/ref/lavf/gbrp16be.fits b/tests/ref/lavf/gbrp16be.fits new file mode 100644 index 0000000000..9aa9db60a2 --- /dev/null +++ b/tests/ref/lavf/gbrp16be.fits @@ -0,0 +1,3 @@ +693ea80c33eb9b348db27a0bc4a5cc8a *tests/data/lavf/lavf.gbrp16be.fits +15336000 tests/data/lavf/lavf.gbrp16be.fits +tests/data/lavf/lavf.gbrp16be.fits CRC=0x9573fb2b diff --git a/tests/ref/lavf/gif b/tests/ref/lavf/gif index d2e2f11e9d..fc94b9df3d 100644 --- a/tests/ref/lavf/gif +++ b/tests/ref/lavf/gif @@ -1,3 +1,3 @@ -e35f5ea283bbcb249818e0078ec72664 *./tests/data/lavf/lavf.gif -2011766 ./tests/data/lavf/lavf.gif -./tests/data/lavf/lavf.gif CRC=0x2429faff +e35f5ea283bbcb249818e0078ec72664 *tests/data/lavf/lavf.gif +2011766 tests/data/lavf/lavf.gif +tests/data/lavf/lavf.gif CRC=0x2429faff diff --git a/tests/ref/lavf/gray.fits b/tests/ref/lavf/gray.fits new file mode 100644 index 0000000000..ce6783b7c1 --- /dev/null +++ b/tests/ref/lavf/gray.fits @@ -0,0 +1,3 @@ +d76b46a5a336b56f73451817cdf3897c *tests/data/lavf/lavf.gray.fits +2664000 tests/data/lavf/lavf.gray.fits +tests/data/lavf/lavf.gray.fits CRC=0x7aa0122f diff --git a/tests/ref/lavf/gray16be.fits b/tests/ref/lavf/gray16be.fits new file mode 100644 index 0000000000..078d6c8678 --- /dev/null +++ b/tests/ref/lavf/gray16be.fits @@ -0,0 +1,3 @@ +15e85a553bbd07783f92377ed369308b *tests/data/lavf/lavf.gray16be.fits +5184000 tests/data/lavf/lavf.gray16be.fits +tests/data/lavf/lavf.gray16be.fits CRC=0x8b840cff diff --git a/tests/ref/lavf/y4m b/tests/ref/lavf/y4m new file mode 100644 index 0000000000..82c7087673 --- /dev/null +++ b/tests/ref/lavf/y4m @@ -0,0 +1,3 @@ +ec8178cb152f9cdbfd9cb724d977db2e *tests/data/lavf/lavf.y4m +3801808 tests/data/lavf/lavf.y4m +tests/data/lavf/lavf.y4m CRC=0x0a941f26 diff --git a/tests/ref/lavf/yuv4mpeg b/tests/ref/lavf/yuv4mpeg deleted file mode 100644 index 367b37621d..0000000000 --- a/tests/ref/lavf/yuv4mpeg +++ /dev/null @@ -1,3 +0,0 @@ -ec8178cb152f9cdbfd9cb724d977db2e *./tests/data/lavf/lavf.y4m -3801808 ./tests/data/lavf/lavf.y4m -./tests/data/lavf/lavf.y4m CRC=0x0a941f26 diff --git a/tests/ref/seek/lavf-yuv4mpeg b/tests/ref/seek/lavf-y4m similarity index 100% rename from tests/ref/seek/lavf-yuv4mpeg rename to tests/ref/seek/lavf-y4m diff --git a/tests/regression-funcs.sh b/tests/regression-funcs.sh deleted file mode 100755 index c88828c4a9..0000000000 --- a/tests/regression-funcs.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/sh -# -# common regression functions for ffmpeg -# -# - -test="${1#regtest-}" -test_ref=$2 -raw_src_dir=$3 -target_exec=$4 -target_path=$5 -threads=${6:-1} -cpuflags=${8:-all} -target_samples=$9 - -datadir="./tests/data" -target_datadir="${target_path}/${datadir}" - -this="$test.$test_ref" -outfile="$datadir/$test_ref/" - - # various files -ffmpeg="$target_exec ${target_path}/ffmpeg${PROGSUF}" -raw_src="${target_path}/$raw_src_dir/%02d.pgm" -raw_dst="$datadir/$this.out.yuv" -pcm_src="$target_datadir/asynth1.sw" -pcm_src_1ch="$target_datadir/asynth-16000-1.wav" -pcm_ref_1ch="$datadir/$test_ref-16000-1.ref.wav" -crcfile="$datadir/$this.crc" -target_crcfile="$target_datadir/$this.crc" - -cleanfiles="$raw_dst $crcfile" -trap 'rm -f -- $cleanfiles' EXIT - -[ "${V-0}" -gt 0 ] && echov=echov || echov=: - -echov(){ - echo "$@" >&3 -} - -. $(dirname $0)/md5.sh - -AVCONV_OPTS="-nostdin -nostats -y -cpuflags $cpuflags" -COMMON_OPTS="-flags +bitexact -idct simple -sws_flags +accurate_rnd+bitexact -fflags +bitexact" -DEC_OPTS="$COMMON_OPTS -threads $threads" -ENC_OPTS="$COMMON_OPTS -threads $threads -dct fastint" - -run_avconv() -{ - $echov $ffmpeg $AVCONV_OPTS $* - $ffmpeg $AVCONV_OPTS $* -} - -do_avconv() -{ - f="$1" - shift - set -- $* ${target_path}/$f - run_avconv $* - do_md5sum $f - echo $(wc -c $f) -} - -do_avconv_nomd5() -{ - f="$1" - shift - set -- $* ${target_path}/$f - run_avconv $* - if [ $f = $raw_dst ] ; then - $tiny_psnr $f $raw_ref - elif [ $f = $pcm_dst ] ; then - $tiny_psnr $f $pcm_ref 2 - else - echo $(wc -c $f) - fi -} - -do_avconv_crc() -{ - f="$1" - shift - run_avconv $* -f crc "$target_crcfile" - echo "$f $(cat $crcfile)" -}