Merge commit '896fe15dbb7b78de495c4a7dd75e7faec66778da'
authorJames Almer <jamrial@gmail.com>
Thu, 14 Mar 2019 17:31:48 +0000 (14:31 -0300)
committerJames Almer <jamrial@gmail.com>
Thu, 14 Mar 2019 17:31:48 +0000 (14:31 -0300)
* commit '896fe15dbb7b78de495c4a7dd75e7faec66778da':
  tests: Convert lavf pixfmt conversion tests to non-legacy test scripts

Merged-by: James Almer <jamrial@gmail.com>
13 files changed:
1  2 
tests/Makefile
tests/fate-run.sh
tests/fate/avformat.mak
tests/fate/pixfmt.mak
tests/lavf-regression.sh
tests/ref/pixfmt/bgr24
tests/ref/pixfmt/gray
tests/ref/pixfmt/monob
tests/ref/pixfmt/monow
tests/ref/pixfmt/rgb24
tests/ref/pixfmt/rgb32
tests/ref/pixfmt/rgb555
tests/ref/pixfmt/rgb565

diff --cc tests/Makefile
@@@ -156,12 -107,9 +156,13 @@@ include $(SRC_PATH)/tests/fate/mov.ma
  include $(SRC_PATH)/tests/fate/mp3.mak
  include $(SRC_PATH)/tests/fate/mpc.mak
  include $(SRC_PATH)/tests/fate/mpeg4.mak
 +include $(SRC_PATH)/tests/fate/mpegps.mak
 +include $(SRC_PATH)/tests/fate/mpegts.mak
 +include $(SRC_PATH)/tests/fate/mxf.mak
  include $(SRC_PATH)/tests/fate/opus.mak
  include $(SRC_PATH)/tests/fate/pcm.mak
+ include $(SRC_PATH)/tests/fate/pixfmt.mak
 +include $(SRC_PATH)/tests/fate/pixlet.mak
  include $(SRC_PATH)/tests/fate/probe.mak
  include $(SRC_PATH)/tests/fate/prores.mak
  include $(SRC_PATH)/tests/fate/qt.mak
@@@ -319,18 -220,20 +319,29 @@@ lavffatetest()
  lavftest(){
      t="${test#lavf-}"
      ref=${base}/ref/lavf/$t
 -    ${base}/lavf-regression.sh $t lavf tests/vsynth1 "$target_exec" "$target_path" "$threads" "$thread_type" "$cpuflags"
 +    ${base}/lavf-regression.sh $t lavf tests/vsynth1 "$target_exec" "$target_path" "$threads" "$thread_type" "$cpuflags" "$target_samples"
 +}
 +
 +refcmp_metadata(){
 +    refcmp=$1
 +    pixfmt=$2
 +    fuzz=${3:-0.001}
 +    ffmpeg $FLAGS $ENC_OPTS \
 +        -lavfi "testsrc2=size=300x200:rate=1:duration=5,format=${pixfmt},split[ref][tmp];[tmp]avgblur=4[enc];[enc][ref]${refcmp},metadata=print:file=-" \
 +        -f null /dev/null | awk -v ref=${ref} -v fuzz=${fuzz} -f ${base}/refcmp-metadata.awk -
  }
  
+ pixfmt_conversion(){
+     conversion="${test#pixfmt-}"
+     outdir="tests/data/pixfmt"
+     raw_dst="$outdir/$conversion.out.yuv"
+     file=${outdir}/${conversion}.yuv
+     run_avconv $DEC_OPTS -r 1 -f image2 -c:v pgmyuv -i $raw_src \
+                $ENC_OPTS -f rawvideo -t 1 -s 352x288 -pix_fmt $conversion $target_path/$raw_dst
+     do_avconv $file $DEC_OPTS -f rawvideo -s 352x288 -pix_fmt $conversion -i $target_path/$raw_dst \
+               $ENC_OPTS -f rawvideo -s 352x288 -pix_fmt yuv444p
+ }
  video_filter(){
      filters=$1
      shift
Simple merge
index 0000000,469aebd..46fd888
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,28 +1,28 @@@
 -FATE_PIXFMT =           bgr24           \
++FATE_PIXFMT-$(CONFIG_SCALE_FILTER) =           bgr24           \
+                         gray            \
+                         monob           \
+                         monow           \
+                         rgb24           \
+                         rgb32           \
+                         rgb555          \
+                         rgb565          \
+                         yuv410p         \
+                         yuv411p         \
+                         yuv420p         \
+                         yuv422p         \
+                         yuv440p         \
+                         yuv444p         \
+                         yuvj420p        \
+                         yuvj422p        \
+                         yuvj440p        \
+                         yuvj444p        \
+                         yuyv422         \
 -FATE_PIXFMT := $(FATE_PIXFMT:%=fate-pixfmt-%)
++FATE_PIXFMT := $(FATE_PIXFMT-yes:%=fate-pixfmt-%)
+ $(FATE_PIXFMT): CMD = pixfmt_conversion
+ $(FATE_PIXFMT): REF = $(SRC_PATH)/tests/ref/pixfmt/$(@:fate-pixfmt-%=%)
+ $(FATE_PIXFMT): $(VREF)
+ FATE_AVCONV += $(FATE_PIXFMT)
+ fate-pixfmt:   $(FATE_PIXFMT)
@@@ -193,35 -92,6 +193,19 @@@ f
  
  if [ -n "$do_yuv4mpeg" ] ; then
  file=${outfile}lavf.y4m
 -do_avconv $file $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src $ENC_OPTS -t 1 -qscale 10
 +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
- # pix_fmt conversions
- if [ -n "$do_pixfmt" ] ; then
- outfile="$datadir/pixfmt/"
- conversions="yuv420p yuv422p yuv444p yuyv422 yuv410p yuv411p yuvj420p \
-              yuvj422p yuvj444p rgb24 bgr24 rgb32 rgb565 rgb555 gray monow \
-              monob yuv440p yuvj440p"
- for pix_fmt in $conversions ; do
-     file=${outfile}${pix_fmt}.yuv
-     run_avconv $DEC_OPTS -r 1 -f image2 -vcodec pgmyuv -i $raw_src \
-                $ENC_OPTS -f rawvideo -t 1 -s 352x288 -pix_fmt $pix_fmt $target_path/$raw_dst
-     do_avconv $file $DEC_OPTS -f rawvideo -s 352x288 -pix_fmt $pix_fmt -i $target_path/$raw_dst \
-                     $ENC_OPTS -f rawvideo -s 352x288 -pix_fmt yuv444p
- done
- 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
 +
 +if [ -n "$do_smjpeg" ] ; then
 +do_lavf smjpeg "" "-f smjpeg"
 +fi
index 0000000,ac723db..43af80b
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,2 +1,2 @@@
 -c6e0f9b5817f484b175c1ec4ffb4e9c9 *tests/data/pixfmt/bgr24.yuv
++6bb61113e7b70eb09dbcec356122a0e2 *tests/data/pixfmt/bgr24.yuv
+ 304128 tests/data/pixfmt/bgr24.yuv
index 0000000,bc38438..fe5e546
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,2 +1,2 @@@
 -6be306b0cce5f8e6c271ea17fef9745b *tests/data/pixfmt/gray.yuv
++1e080c12bd9755c41ecb8e19b756f406 *tests/data/pixfmt/gray.yuv
+ 304128 tests/data/pixfmt/gray.yuv
index 0000000,010739a..002dda1
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,2 +1,2 @@@
 -31398104d2349dd48328a6862bc6711f *tests/data/pixfmt/monob.yuv
++d87cf0c2e7a13cc693fe6ece22461c83 *tests/data/pixfmt/monob.yuv
+ 304128 tests/data/pixfmt/monob.yuv
index 0000000,1b5143a..485f256
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,2 +1,2 @@@
 -31398104d2349dd48328a6862bc6711f *tests/data/pixfmt/monow.yuv
++d87cf0c2e7a13cc693fe6ece22461c83 *tests/data/pixfmt/monow.yuv
+ 304128 tests/data/pixfmt/monow.yuv
index 0000000,c0d0026..b386113
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,2 +1,2 @@@
 -c6e0f9b5817f484b175c1ec4ffb4e9c9 *tests/data/pixfmt/rgb24.yuv
++6bb61113e7b70eb09dbcec356122a0e2 *tests/data/pixfmt/rgb24.yuv
+ 304128 tests/data/pixfmt/rgb24.yuv
index 0000000,b1a4ab1..741e60a
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,2 +1,2 @@@
 -c6e0f9b5817f484b175c1ec4ffb4e9c9 *tests/data/pixfmt/rgb32.yuv
++6bb61113e7b70eb09dbcec356122a0e2 *tests/data/pixfmt/rgb32.yuv
+ 304128 tests/data/pixfmt/rgb32.yuv
index 0000000,a22a271..eecc974
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,2 +1,2 @@@
 -c894c3bd8d2631ed1964500b90a0c350 *tests/data/pixfmt/rgb555.yuv
++0df2a477af1415a1b8fbf2a3e552bc39 *tests/data/pixfmt/rgb555.yuv
+ 304128 tests/data/pixfmt/rgb555.yuv
index 0000000,b81bb04..b249f4a
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,2 +1,2 @@@
 -66d39d464bd89ded2a124897f0a75ade *tests/data/pixfmt/rgb565.yuv
++efa7c0337cc00c796c6df615223716f1 *tests/data/pixfmt/rgb565.yuv
+ 304128 tests/data/pixfmt/rgb565.yuv