[14/20] tests: Move lavf pixfmt conversion tests to fate-run.sh

Message ID 20180920084729.4523-15-diego@biurrun.de
State New
Headers show
Series
  • [01/20] tests: Use more consistent names for tests
Related show

Commit Message

Diego Biurrun Sept. 20, 2018, 8:47 a.m.
---
 tests/fate-run.sh        | 17 +++++++++++
 tests/fate/avformat.mak  |  3 ++
 tests/lavf-regression.sh | 17 -----------
 tests/ref/lavf/pixfmt    | 76 ++++++++++++++++++++++++------------------------
 4 files changed, 58 insertions(+), 55 deletions(-)

Patch

diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 875b410305..1da1f599c8 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -220,6 +220,23 @@  lavftest(){
     ${base}/lavf-regression.sh $t lavf tests/vsynth1 "$target_exec" "$target_path" "$threads" "$thread_type" "$cpuflags"
 }
 
+pixfmt(){
+    t="${test#lavf-}"
+    raw_dst="tests/data/$t.lavf.out.yuv"
+    outdir="tests/data/pixfmt"
+    mkdir -p "$outdir"
+    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=${outdir}/${pix_fmt}.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 $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
+}
+
 video_filter(){
     filters=$1
     shift
diff --git a/tests/fate/avformat.mak b/tests/fate/avformat.mak
index f35cdcdfea..59b46be54a 100644
--- a/tests/fate/avformat.mak
+++ b/tests/fate/avformat.mak
@@ -79,5 +79,8 @@  FATE_LAVF += fate-lavf-pixfmt
 $(FATE_LAVF): $(AREF) $(VREF)
 $(FATE_LAVF): CMD = lavftest
 
+fate-lavf-pixfmt: REF = $(SRC_PATH)/tests/ref/lavf/$(@:fate-lavf-%=%)
+fate-lavf-pixfmt: CMD = pixfmt
+
 FATE_AVCONV += $(FATE_LAVF) $(FATE_LAVF_AUDIO_ONLY) $(FATE_LAVF_IMAGES) $(FATE_LAVF_PIPE)
 fate-lavf:     $(FATE_LAVF) $(FATE_LAVF_AUDIO_ONLY) $(FATE_LAVF_IMAGES) $(FATE_LAVF_PIPE)
diff --git a/tests/lavf-regression.sh b/tests/lavf-regression.sh
index d9759af1ef..8dd4164a94 100755
--- a/tests/lavf-regression.sh
+++ b/tests/lavf-regression.sh
@@ -95,20 +95,3 @@  file=${outdir}lavf.$test
 do_avconv $file $DEC_OPTS -f image2 -c:v 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
-outdir="$datadir/pixfmt/"
-mkdir -p "$outdir"
-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=${outdir}${pix_fmt}.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 $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
diff --git a/tests/ref/lavf/pixfmt b/tests/ref/lavf/pixfmt
index 186dde5ed3..f13f3dfb23 100644
--- a/tests/ref/lavf/pixfmt
+++ b/tests/ref/lavf/pixfmt
@@ -1,38 +1,38 @@ 
-5641dba168ff665af1cdb4a91e1afdd6 *./tests/data/pixfmt/yuv420p.yuv
-304128 ./tests/data/pixfmt/yuv420p.yuv
-ac68f9fdd9d55efd0306d9b004038761 *./tests/data/pixfmt/yuv422p.yuv
-304128 ./tests/data/pixfmt/yuv422p.yuv
-5641dba168ff665af1cdb4a91e1afdd6 *./tests/data/pixfmt/yuv444p.yuv
-304128 ./tests/data/pixfmt/yuv444p.yuv
-ac68f9fdd9d55efd0306d9b004038761 *./tests/data/pixfmt/yuyv422.yuv
-304128 ./tests/data/pixfmt/yuyv422.yuv
-507c7e9f0c97660385df977469ca9e6d *./tests/data/pixfmt/yuv410p.yuv
-304128 ./tests/data/pixfmt/yuv410p.yuv
-8594ea0b8d7c2c964525b0801b5351de *./tests/data/pixfmt/yuv411p.yuv
-304128 ./tests/data/pixfmt/yuv411p.yuv
-e176bd14185788110e055f945de7f95f *./tests/data/pixfmt/yuvj420p.yuv
-304128 ./tests/data/pixfmt/yuvj420p.yuv
-472028e46a81c98d9b2477507def4723 *./tests/data/pixfmt/yuvj422p.yuv
-304128 ./tests/data/pixfmt/yuvj422p.yuv
-c10442da177c9f1d12be3c53be6fa12c *./tests/data/pixfmt/yuvj444p.yuv
-304128 ./tests/data/pixfmt/yuvj444p.yuv
-c6e0f9b5817f484b175c1ec4ffb4e9c9 *./tests/data/pixfmt/rgb24.yuv
-304128 ./tests/data/pixfmt/rgb24.yuv
-c6e0f9b5817f484b175c1ec4ffb4e9c9 *./tests/data/pixfmt/bgr24.yuv
-304128 ./tests/data/pixfmt/bgr24.yuv
-c6e0f9b5817f484b175c1ec4ffb4e9c9 *./tests/data/pixfmt/rgb32.yuv
-304128 ./tests/data/pixfmt/rgb32.yuv
-66d39d464bd89ded2a124897f0a75ade *./tests/data/pixfmt/rgb565.yuv
-304128 ./tests/data/pixfmt/rgb565.yuv
-c894c3bd8d2631ed1964500b90a0c350 *./tests/data/pixfmt/rgb555.yuv
-304128 ./tests/data/pixfmt/rgb555.yuv
-6be306b0cce5f8e6c271ea17fef9745b *./tests/data/pixfmt/gray.yuv
-304128 ./tests/data/pixfmt/gray.yuv
-31398104d2349dd48328a6862bc6711f *./tests/data/pixfmt/monow.yuv
-304128 ./tests/data/pixfmt/monow.yuv
-31398104d2349dd48328a6862bc6711f *./tests/data/pixfmt/monob.yuv
-304128 ./tests/data/pixfmt/monob.yuv
-00b85790df5740bab95e2559d81603a7 *./tests/data/pixfmt/yuv440p.yuv
-304128 ./tests/data/pixfmt/yuv440p.yuv
-4d8d402c45d913038d4b725396719111 *./tests/data/pixfmt/yuvj440p.yuv
-304128 ./tests/data/pixfmt/yuvj440p.yuv
+5641dba168ff665af1cdb4a91e1afdd6 *tests/data/pixfmt/yuv420p.yuv
+304128 tests/data/pixfmt/yuv420p.yuv
+ac68f9fdd9d55efd0306d9b004038761 *tests/data/pixfmt/yuv422p.yuv
+304128 tests/data/pixfmt/yuv422p.yuv
+5641dba168ff665af1cdb4a91e1afdd6 *tests/data/pixfmt/yuv444p.yuv
+304128 tests/data/pixfmt/yuv444p.yuv
+ac68f9fdd9d55efd0306d9b004038761 *tests/data/pixfmt/yuyv422.yuv
+304128 tests/data/pixfmt/yuyv422.yuv
+507c7e9f0c97660385df977469ca9e6d *tests/data/pixfmt/yuv410p.yuv
+304128 tests/data/pixfmt/yuv410p.yuv
+8594ea0b8d7c2c964525b0801b5351de *tests/data/pixfmt/yuv411p.yuv
+304128 tests/data/pixfmt/yuv411p.yuv
+e176bd14185788110e055f945de7f95f *tests/data/pixfmt/yuvj420p.yuv
+304128 tests/data/pixfmt/yuvj420p.yuv
+472028e46a81c98d9b2477507def4723 *tests/data/pixfmt/yuvj422p.yuv
+304128 tests/data/pixfmt/yuvj422p.yuv
+c10442da177c9f1d12be3c53be6fa12c *tests/data/pixfmt/yuvj444p.yuv
+304128 tests/data/pixfmt/yuvj444p.yuv
+c6e0f9b5817f484b175c1ec4ffb4e9c9 *tests/data/pixfmt/rgb24.yuv
+304128 tests/data/pixfmt/rgb24.yuv
+c6e0f9b5817f484b175c1ec4ffb4e9c9 *tests/data/pixfmt/bgr24.yuv
+304128 tests/data/pixfmt/bgr24.yuv
+c6e0f9b5817f484b175c1ec4ffb4e9c9 *tests/data/pixfmt/rgb32.yuv
+304128 tests/data/pixfmt/rgb32.yuv
+66d39d464bd89ded2a124897f0a75ade *tests/data/pixfmt/rgb565.yuv
+304128 tests/data/pixfmt/rgb565.yuv
+c894c3bd8d2631ed1964500b90a0c350 *tests/data/pixfmt/rgb555.yuv
+304128 tests/data/pixfmt/rgb555.yuv
+6be306b0cce5f8e6c271ea17fef9745b *tests/data/pixfmt/gray.yuv
+304128 tests/data/pixfmt/gray.yuv
+31398104d2349dd48328a6862bc6711f *tests/data/pixfmt/monow.yuv
+304128 tests/data/pixfmt/monow.yuv
+31398104d2349dd48328a6862bc6711f *tests/data/pixfmt/monob.yuv
+304128 tests/data/pixfmt/monob.yuv
+00b85790df5740bab95e2559d81603a7 *tests/data/pixfmt/yuv440p.yuv
+304128 tests/data/pixfmt/yuv440p.yuv
+4d8d402c45d913038d4b725396719111 *tests/data/pixfmt/yuvj440p.yuv
+304128 tests/data/pixfmt/yuvj440p.yuv