From e2bd03a14a4e3366df0b1ee8e284a97165be1f3c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
Date: Tue, 30 Jun 2015 22:35:44 +0300
Subject: [PATCH] fate: Avoid unnecessary pixel format conversions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Most of the fate-dds-* and fate-txd-* tests already
output into the same pixel format regardless of
platform endianness, so there's no need to force
conversion to another format.

This fixes the tests fate-txd-16bpp, fate-txd-odd,
fate-dds-rgb16, fate-dds-rgb24 and fate-dds-xrgb on
big endian, where the tests seem to fail due to issues
with certain conversion codepaths in swscale.

Those conversion codepaths should of course be fixed, but
the individual decoder tests should use as little extra
conversion steps as possible.

Signed-off-by: Martin Storsjö <martin@martin.st>
---
 tests/fate/image.mak     |  4 +++-
 tests/fate/video.mak     |  4 ++--
 tests/ref/fate/dds-rgb16 |  2 +-
 tests/ref/fate/dds-rgb24 |  2 +-
 tests/ref/fate/dds-uyvy  |  2 +-
 tests/ref/fate/dds-xbgr  |  2 +-
 tests/ref/fate/dds-y     |  2 +-
 tests/ref/fate/dds-ya    |  2 +-
 tests/ref/fate/dds-yuyv  |  2 +-
 tests/ref/fate/txd-16bpp | 22 +++++++++++-----------
 tests/ref/fate/txd-odd   |  2 +-
 11 files changed, 24 insertions(+), 22 deletions(-)

diff --git a/tests/fate/image.mak b/tests/fate/image.mak
index 5b8eb02ce76..272e023f4db 100644
--- a/tests/fate/image.mak
+++ b/tests/fate/image.mak
@@ -32,9 +32,11 @@ fate-bmpparser: CMD = framecrc -f image2pipe -i $(TARGET_SAMPLES)/bmp/libav_4x_c
 
 define FATE_IMGSUITE_DDS
 FATE_DDS += fate-dds-$(1)
-fate-dds-$(1): CMD = framecrc -i $(TARGET_SAMPLES)/dds/libav_$(1).dds -sws_flags +accurate_rnd+bitexact -pix_fmt rgba
+fate-dds-$(1): CMD = framecrc -i $(TARGET_SAMPLES)/dds/libav_$(1).dds $(DDS_OPTS_$(1))
 endef
 
+DDS_OPTS_pal     = -sws_flags +accurate_rnd+bitexact -pix_fmt rgba
+DDS_OPTS_pal-ati = -sws_flags +accurate_rnd+bitexact -pix_fmt rgba
 DDS_FMT = argb argb-aexp dx10-bc1 dx10-bc1a dx10-bc2 dx10-bc3 dx10-bc4 dx10-bc5 dxt1 dxt1a dxt1-normalmap dxt2 dxt3 dxt4 dxt5 dxt5-aexp dxt5-normalmap dxt5-normalmap-ati dxt5-rbxg dxt5-rgxb dxt5-rxbg dxt5-rxgb dxt5-xgbr dxt5-xgxr dxt5-xrbg dxt5-ycocg dxt5-ycocg-scaled pal pal-ati rgb16 rgb24 rgtc1s rgtc1u rgtc2s rgtc2u rgtc2u-xy uyvy xbgr xrgb y ya ycocg yuyv
 $(foreach FMT,$(DDS_FMT),$(eval $(call FATE_IMGSUITE_DDS,$(FMT))))
 
diff --git a/tests/fate/video.mak b/tests/fate/video.mak
index 016df7c437d..f1d8f2a9c6b 100644
--- a/tests/fate/video.mak
+++ b/tests/fate/video.mak
@@ -282,10 +282,10 @@ FATE_SAMPLES_AVCONV-$(call DEMDEC, TMV, TMV) += fate-tmv
 fate-tmv: CMD = framecrc -i $(TARGET_SAMPLES)/tmv/pop-partial.tmv -pix_fmt rgb24
 
 FATE_TXD += fate-txd-16bpp
-fate-txd-16bpp: CMD = framecrc -i $(TARGET_SAMPLES)/txd/misc.txd -pix_fmt bgra -an
+fate-txd-16bpp: CMD = framecrc -i $(TARGET_SAMPLES)/txd/misc.txd -an
 
 FATE_TXD += fate-txd-odd
-fate-txd-odd: CMD = framecrc -i $(TARGET_SAMPLES)/txd/odd.txd -pix_fmt bgra -an
+fate-txd-odd: CMD = framecrc -i $(TARGET_SAMPLES)/txd/odd.txd -an
 
 FATE_TXD += fate-txd-pal8
 fate-txd-pal8: CMD = framecrc -i $(TARGET_SAMPLES)/txd/outro.txd -pix_fmt rgb24 -an
diff --git a/tests/ref/fate/dds-rgb16 b/tests/ref/fate/dds-rgb16
index 688d3b96010..40a9938f34a 100644
--- a/tests/ref/fate/dds-rgb16
+++ b/tests/ref/fate/dds-rgb16
@@ -1,2 +1,2 @@
 #tb 0: 1/25
-0,          0,          0,        1,    32768, 0x7991785d
+0,          0,          0,        1,    16384, 0xc8910265
diff --git a/tests/ref/fate/dds-rgb24 b/tests/ref/fate/dds-rgb24
index bc7724d1071..3eeb1eb04c1 100644
--- a/tests/ref/fate/dds-rgb24
+++ b/tests/ref/fate/dds-rgb24
@@ -1,2 +1,2 @@
 #tb 0: 1/25
-0,          0,          0,        1,    32768, 0xcf0f7833
+0,          0,          0,        1,    24576, 0xef0f9653
diff --git a/tests/ref/fate/dds-uyvy b/tests/ref/fate/dds-uyvy
index 6ea3f2e30bb..2bcbaa04555 100644
--- a/tests/ref/fate/dds-uyvy
+++ b/tests/ref/fate/dds-uyvy
@@ -1,2 +1,2 @@
 #tb 0: 1/25
-0,          0,          0,        1,    16384, 0xd579a59e
+0,          0,          0,        1,     8192, 0x3c658750
diff --git a/tests/ref/fate/dds-xbgr b/tests/ref/fate/dds-xbgr
index 63e5225f896..eb7a0246dbc 100644
--- a/tests/ref/fate/dds-xbgr
+++ b/tests/ref/fate/dds-xbgr
@@ -1,2 +1,2 @@
 #tb 0: 1/25
-0,          0,          0,        1,    16384, 0x702f6a28
+0,          0,          0,        1,    16384, 0x70336a28
diff --git a/tests/ref/fate/dds-y b/tests/ref/fate/dds-y
index 5b2f11b523a..ae62091b65f 100644
--- a/tests/ref/fate/dds-y
+++ b/tests/ref/fate/dds-y
@@ -1,2 +1,2 @@
 #tb 0: 1/25
-0,          0,          0,        1,    32768, 0xc51add1c
+0,          0,          0,        1,     8192, 0x56eca90f
diff --git a/tests/ref/fate/dds-ya b/tests/ref/fate/dds-ya
index 70eedcc7534..d6527c638d7 100644
--- a/tests/ref/fate/dds-ya
+++ b/tests/ref/fate/dds-ya
@@ -1,2 +1,2 @@
 #tb 0: 1/25
-0,          0,          0,        1,    56320, 0xca81315f
+0,          0,          0,        1,    28160, 0xd3981fcb
diff --git a/tests/ref/fate/dds-yuyv b/tests/ref/fate/dds-yuyv
index 6ea3f2e30bb..e65c9507da5 100644
--- a/tests/ref/fate/dds-yuyv
+++ b/tests/ref/fate/dds-yuyv
@@ -1,2 +1,2 @@
 #tb 0: 1/25
-0,          0,          0,        1,    16384, 0xd579a59e
+0,          0,          0,        1,     8192, 0xc1108750
diff --git a/tests/ref/fate/txd-16bpp b/tests/ref/fate/txd-16bpp
index 10787415c76..33943f90efd 100644
--- a/tests/ref/fate/txd-16bpp
+++ b/tests/ref/fate/txd-16bpp
@@ -1,12 +1,12 @@
 #tb 0: 1/5
-0,          0,          0,        1,    16384, 0x4c7bb4cb
-0,          1,          1,        1,    16384, 0x914e14b4
-0,          2,          2,        1,    16384, 0x81e293cb
-0,          3,          3,        1,    16384, 0xf733ed43
-0,          4,          4,        1,    16384, 0x739a6c21
-0,          5,          5,        1,    16384, 0x47f9184a
-0,          6,          6,        1,    16384, 0x329f9d3e
-0,          7,          7,        1,    16384, 0x231ffd9c
-0,          8,          8,        1,    16384, 0xe7c2c4c6
-0,          9,          9,        1,    16384, 0x880d8ffb
-0,         10,         10,        1,    16384, 0xf83238d2
+0,          0,          0,        1,    16384, 0x4d39b4cb
+0,          1,          1,        1,    16384, 0x2a8d14b4
+0,          2,          2,        1,    16384, 0xe26793cb
+0,          3,          3,        1,    16384, 0x62b5ed43
+0,          4,          4,        1,    16384, 0x5ae86c21
+0,          5,          5,        1,    16384, 0x416d184a
+0,          6,          6,        1,    16384, 0x33f59d3e
+0,          7,          7,        1,    16384, 0x3d0ffd9c
+0,          8,          8,        1,    16384, 0x35bac4c6
+0,          9,          9,        1,    16384, 0xa1cd8ffb
+0,         10,         10,        1,    16384, 0xf7dc38d2
diff --git a/tests/ref/fate/txd-odd b/tests/ref/fate/txd-odd
index 15b9ed3b634..fe7c615e4f0 100644
--- a/tests/ref/fate/txd-odd
+++ b/tests/ref/fate/txd-odd
@@ -1,2 +1,2 @@
 #tb 0: 1/5
-0,          0,          0,        1,   385452, 0xb22514d6
+0,          0,          0,        1,   385452, 0x055a14d6
-- 
GitLab