summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-04-23 12:47:13 +0200
committerwm4 <wm4@nowhere>2020-04-23 13:24:35 +0200
commit8767c468735f64cdbd4bbbbe83121c2b068255e7 (patch)
treed3a0867487b285bba400aba563e53368dbf5c6aa /test
parent3e84b48a6fb08065d2d880d83938227d5f8ebadd (diff)
downloadmpv-8767c468735f64cdbd4bbbbe83121c2b068255e7.tar.bz2
mpv-8767c468735f64cdbd4bbbbe83121c2b068255e7.tar.xz
img_format: add some mpv-only helper formats
Utterly useless, but the intention is to make dealing with corner case pixel formats (forced upon us by FFmpeg, very rarely) less of a pain. The zimg wrapper will use them. (It already supports these formats automatically, but it will help with its internals.) Y1 is considered RGB, even though gray formats are generally treated as YUV for various reasons. mpv will default all YUV formats to limited range internally, which makes no sense for a 1 bit format, so this is a problem. I wanted to avoid that mp_image_params_guess_csp() (which applies the default) explicitly checks for an image format, so although a bit janky, this seems to be a good solution, especially because I really don't give a shit about these formats, other than having to handle them. It's notable that AV_PIX_FMT_MONOBLACK (also 1 bit gray, just packed) already explicitly marked itself as RGB.
Diffstat (limited to 'test')
-rw-r--r--test/ref/img_formats.txt54
-rw-r--r--test/ref/zimg_formats.txt7
2 files changed, 61 insertions, 0 deletions
diff --git a/test/ref/img_formats.txt b/test/ref/img_formats.txt
index f2cd29012b..c0c4d8bb4d 100644
--- a/test/ref/img_formats.txt
+++ b/test/ref/img_formats.txt
@@ -440,6 +440,14 @@ gbrp: [GENERIC] fcsp=rgb ctype=uint
0: p=2 st=1 o=0 sh=0 d=8
1: p=0 st=1 o=0 sh=0 d=8
2: p=1 st=1 o=0 sh=0 d=8
+gbrp1: fcsp=rgb ctype=uint
+ Legacy desc: [ba][rgb][le]
+ planes=3, chroma=0:0 align=1:1 bits=1 cbits=1
+ {1/8/[0:0] 1/8/[0:0] 1/8/[0:0] 0/0/[0:0] }
+ Regular: planes=3 compbytes=1 bitpad=-7 chroma=1x1 ctype=uint
+ 0: {2}
+ 1: {3}
+ 2: {1}
gbrp10: [GENERIC] fcsp=rgb ctype=uint
Legacy desc: [ba][rgb][le]
planes=3, chroma=0:0 align=1:1 bits=10 cbits=10
@@ -520,6 +528,46 @@ gbrp16be: [GENERIC] fcsp=rgb ctype=uint
0: p=2 st=2 o=0 sh=0 d=16
1: p=0 st=2 o=0 sh=0 d=16
2: p=1 st=2 o=0 sh=0 d=16
+gbrp2: fcsp=rgb ctype=uint
+ Legacy desc: [ba][rgb][le]
+ planes=3, chroma=0:0 align=1:1 bits=2 cbits=2
+ {1/8/[0:0] 1/8/[0:0] 1/8/[0:0] 0/0/[0:0] }
+ Regular: planes=3 compbytes=1 bitpad=-6 chroma=1x1 ctype=uint
+ 0: {2}
+ 1: {3}
+ 2: {1}
+gbrp3: fcsp=rgb ctype=uint
+ Legacy desc: [ba][rgb][le]
+ planes=3, chroma=0:0 align=1:1 bits=3 cbits=3
+ {1/8/[0:0] 1/8/[0:0] 1/8/[0:0] 0/0/[0:0] }
+ Regular: planes=3 compbytes=1 bitpad=-5 chroma=1x1 ctype=uint
+ 0: {2}
+ 1: {3}
+ 2: {1}
+gbrp4: fcsp=rgb ctype=uint
+ Legacy desc: [ba][rgb][le]
+ planes=3, chroma=0:0 align=1:1 bits=4 cbits=4
+ {1/8/[0:0] 1/8/[0:0] 1/8/[0:0] 0/0/[0:0] }
+ Regular: planes=3 compbytes=1 bitpad=-4 chroma=1x1 ctype=uint
+ 0: {2}
+ 1: {3}
+ 2: {1}
+gbrp5: fcsp=rgb ctype=uint
+ Legacy desc: [ba][rgb][le]
+ planes=3, chroma=0:0 align=1:1 bits=5 cbits=5
+ {1/8/[0:0] 1/8/[0:0] 1/8/[0:0] 0/0/[0:0] }
+ Regular: planes=3 compbytes=1 bitpad=-3 chroma=1x1 ctype=uint
+ 0: {2}
+ 1: {3}
+ 2: {1}
+gbrp6: fcsp=rgb ctype=uint
+ Legacy desc: [ba][rgb][le]
+ planes=3, chroma=0:0 align=1:1 bits=6 cbits=6
+ {1/8/[0:0] 1/8/[0:0] 1/8/[0:0] 0/0/[0:0] }
+ Regular: planes=3 compbytes=1 bitpad=-2 chroma=1x1 ctype=uint
+ 0: {2}
+ 1: {3}
+ 2: {1}
gbrp9: [GENERIC] fcsp=rgb ctype=uint
Legacy desc: [ba][rgb][le]
planes=3, chroma=0:0 align=1:1 bits=9 cbits=9
@@ -1019,6 +1067,12 @@ xyz12be: [GENERIC] fcsp=xyz ctype=uint
0: p=0 st=6 o=0 sh=4 d=12
1: p=0 st=6 o=2 sh=4 d=12
2: p=0 st=6 o=4 sh=4 d=12
+y1: fcsp=rgb ctype=uint
+ Legacy desc: [ba][rgb][le]
+ planes=1, chroma=0:0 align=1:1 bits=1 cbits=1
+ {1/8/[0:0] 0/0/[0:0] 0/0/[0:0] 0/0/[0:0] }
+ Regular: planes=1 compbytes=1 bitpad=-7 chroma=1x1 ctype=uint
+ 0: {1}
y210: [GENERIC] ctype=uint
Legacy desc: [ba][yuv][le]
planes=1, chroma=1:0 align=2:1 bits=30 cbits=10
diff --git a/test/ref/zimg_formats.txt b/test/ref/zimg_formats.txt
index 26d260a70e..7c47d74081 100644
--- a/test/ref/zimg_formats.txt
+++ b/test/ref/zimg_formats.txt
@@ -47,6 +47,7 @@
gbrapf32 Zin Zout |
gbrapf32be Zin Zout |
gbrp Zin Zout SWSin SWSout |
+ gbrp1 Zin Zout |
gbrp10 Zin Zout SWSin SWSout |
gbrp10be Zin Zout SWSin SWSout |
gbrp12 Zin Zout SWSin SWSout |
@@ -55,6 +56,11 @@
gbrp14be Zin Zout SWSin SWSout |
gbrp16 Zin Zout SWSin SWSout |
gbrp16be Zin Zout SWSin SWSout |
+ gbrp2 Zin Zout |
+ gbrp3 Zin Zout |
+ gbrp4 Zin Zout |
+ gbrp5 Zin Zout |
+ gbrp6 Zin Zout |
gbrp9 Zin Zout SWSin SWSout |
gbrp9be Zin Zout SWSin SWSout |
gbrpf32 Zin Zout |
@@ -119,6 +125,7 @@
xvmc |
xyz12 Zin Zout SWSin SWSout |
xyz12be Zin Zout SWSin SWSout |
+ y1 Zin Zout |
y210 Zin Zout SWSin |
y210be Zin Zout |
ya16 Zin Zout SWSin SWSout |