summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-06-17 16:20:37 +0200
committerwm4 <wm4@nowhere>2020-06-17 19:43:09 +0200
commit1ffa83ea92f6413e5e74e31ccd47ed5ac49efd9f (patch)
tree0acc7c9fe2536f188fdb30842f4e63e6bb73c6ae
parent6ff20c71ab93139d150a26612e2ef90168f71dfb (diff)
downloadmpv-1ffa83ea92f6413e5e74e31ccd47ed5ac49efd9f.tar.bz2
mpv-1ffa83ea92f6413e5e74e31ccd47ed5ac49efd9f.tar.xz
test: update to new ffmpeg pixfmts
Mainly, X2RGB10BE is added. Add our own unpack test for this format. Also, swscale seems to have added support for GBRPF conversion.
-rw-r--r--test/ref/draw_bmp.txt1
-rw-r--r--test/ref/img_formats.txt13
-rw-r--r--test/ref/repack.txt2
-rw-r--r--test/ref/zimg_formats.txt11
-rw-r--r--test/repack.c3
5 files changed, 25 insertions, 5 deletions
diff --git a/test/ref/draw_bmp.txt b/test/ref/draw_bmp.txt
index aa0c3a0a80..105b0cc5f0 100644
--- a/test/ref/draw_bmp.txt
+++ b/test/ref/draw_bmp.txt
@@ -123,6 +123,7 @@ vdpau = no
vdpau_output= no
videotoolbox= no
vulkan = no
+x2rgb10be = align=1:1 ov=unknown, ov_f=gbrapf32, v_f=gbrpf32, a=unknown, ca=unknown, ca_f=unknown
xvmc = no
xyz12 = align=1:1 ov=gbrap , ov_f=gbrapf32, v_f=gbrpf32, a=unknown, ca=unknown, ca_f=unknown
xyz12be = align=1:1 ov=gbrap , ov_f=gbrapf32, v_f=gbrpf32, a=unknown, ca=unknown, ca_f=unknown
diff --git a/test/ref/img_formats.txt b/test/ref/img_formats.txt
index fead5fdfa9..2b1cca1522 100644
--- a/test/ref/img_formats.txt
+++ b/test/ref/img_formats.txt
@@ -1051,6 +1051,10 @@ rgb30: fcsp=rgb ctype=uint
planes=1, chroma=0:0 align=1:1
{32/[0:0] }
0: 32bits {20:10} {10:10} {0:10} {}
+ AVD: name=x2rgb10le chroma=0:0 flags=0x20 [rgb]
+ 0: p=0 st=4 o=2 sh=4 d=10
+ 1: p=0 st=4 o=1 sh=2 d=10
+ 2: p=0 st=4 o=0 sh=0 d=10
rgb4: [GENERIC] fcsp=rgb ctype=uint
Basic desc: [rgb][le][be][uint]
planes=1, chroma=0:0 align=2:1
@@ -1240,6 +1244,15 @@ vulkan: [GENERIC] ctype=unknown
planes=0, chroma=0:0 align=1:1
{}
AVD: name=vulkan chroma=0:0 flags=0x8 [hw]
+x2rgb10be: [GENERIC] fcsp=rgb ctype=uint
+ Basic desc: [ba][rgb][be][uint]
+ planes=1, chroma=0:0 align=1:1
+ {32/[0:0] }
+ 0: 32bits endian_bytes=4 {20:10} {10:10} {0:10} {}
+ AVD: name=x2rgb10be chroma=0:0 flags=0x21 [be][rgb]
+ 0: p=0 st=4 o=0 sh=4 d=10
+ 1: p=0 st=4 o=1 sh=2 d=10
+ 2: p=0 st=4 o=2 sh=0 d=10
xvmc: [GENERIC] ctype=unknown
Basic desc: [le][be][hw]
planes=0, chroma=0:0 align=1:1
diff --git a/test/ref/repack.txt b/test/ref/repack.txt
index 6f0f5b281d..b9199eb102 100644
--- a/test/ref/repack.txt
+++ b/test/ref/repack.txt
@@ -209,6 +209,8 @@ vdpau => no
vdpau_output => no
videotoolbox => no
vulkan => no
+x2rgb10be => [pa] [un] gbrp10 | a=1:1 [tu] [tp]
+x2rgb10be => [pa] [un] gbrpf32 | a=1:1 [planar-f32]
xvmc => no
xyz12 => [pa] [un] gbrp16 | a=1:1 [tu] [tp]
xyz12 => [pa] [un] gbrpf32 | a=1:1 [planar-f32]
diff --git a/test/ref/zimg_formats.txt b/test/ref/zimg_formats.txt
index a80ff8936e..1fa2f7cfc7 100644
--- a/test/ref/zimg_formats.txt
+++ b/test/ref/zimg_formats.txt
@@ -44,8 +44,8 @@
gbrap12be Zin Zout SWSin SWSout |
gbrap16 Zin Zout SWSin SWSout |
gbrap16be Zin Zout SWSin SWSout |
- gbrapf32 Zin Zout |
- gbrapf32be Zin Zout |
+ gbrapf32 Zin Zout SWSin SWSout |
+ gbrapf32be Zin Zout SWSin SWSout |
gbrp Zin Zout SWSin SWSout |
gbrp1 Zin Zout |
gbrp10 Zin Zout SWSin SWSout |
@@ -63,8 +63,8 @@
gbrp6 Zin Zout |
gbrp9 Zin Zout SWSin SWSout |
gbrp9be Zin Zout SWSin SWSout |
- gbrpf32 Zin Zout |
- gbrpf32be Zin Zout |
+ gbrpf32 Zin Zout SWSin SWSout |
+ gbrpf32be Zin Zout SWSin SWSout |
gray Zin Zout SWSin SWSout |
gray10 Zin Zout SWSin SWSout |
gray10be Zin Zout SWSin SWSout |
@@ -99,7 +99,7 @@
qsv |
rgb0 Zin Zout SWSin SWSout |
rgb24 Zin Zout SWSin SWSout |
- rgb30 Zin Zout |
+ rgb30 Zin Zout SWSin SWSout |
rgb4 SWSout |
rgb444 Zin Zout SWSin SWSout |
rgb444be Zin Zout SWSin SWSout |
@@ -123,6 +123,7 @@
vdpau_output |
videotoolbox |
vulkan |
+ x2rgb10be Zin Zout |
xvmc |
xyz12 Zin Zout SWSin SWSout |
xyz12be Zin Zout SWSin SWSout |
diff --git a/test/repack.c b/test/repack.c
index f4b5c9c12a..6bdd51a57b 100644
--- a/test/repack.c
+++ b/test/repack.c
@@ -29,6 +29,7 @@ struct entry {
#define P16(...) (const uint16_t[]){__VA_ARGS__}
#define P32(...) (const uint32_t[]){__VA_ARGS__}
#define SW16(v) ((((v) & 0xFF) << 8) | ((v) >> 8))
+#define SW32(v) ((SW16((v) & 0xFFFFu) << 16) | (SW16(((v) | 0u) >> 16)))
// Warning: only entries that match existing conversions are tested.
static const struct entry repack_tests[] = {
@@ -129,6 +130,8 @@ static const struct entry repack_tests[] = {
.flags = REPACK_CREATE_EXPAND_8BIT},
{1, 1, IMGFMT_RGB30, {P32((3 << 20) | (2 << 10) | 1)},
-AV_PIX_FMT_GBRP10, {P16(2), P16(1), P16(3)}},
+ {1, 1, -AV_PIX_FMT_X2RGB10BE, {P32(SW32((3 << 20) | (2 << 10) | 1))},
+ -AV_PIX_FMT_GBRP10, {P16(2), P16(1), P16(3)}},
{8, 1, -AV_PIX_FMT_MONOWHITE, {P8(0xAA)},
IMGFMT_Y1, {P8(0, 1, 0, 1, 0, 1, 0, 1)}},
{8, 1, -AV_PIX_FMT_MONOBLACK, {P8(0xAA)},