summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-04-12 22:14:55 +0200
committerwm4 <wm4@nowhere>2020-04-13 15:56:27 +0200
commita8b84c9a1a8cfe6e08d8de183133f96511d9a32a (patch)
tree365d1f0a2a3dc8fb480327f6a39fd5ef68318d8f /test
parentc99d95ac17364c46bc161867d1102361f05a6cc5 (diff)
downloadmpv-a8b84c9a1a8cfe6e08d8de183133f96511d9a32a.tar.bz2
mpv-a8b84c9a1a8cfe6e08d8de183133f96511d9a32a.tar.xz
zimg: add support for big endian input and output
One of the extremely annoying dumb things in ffmpeg is that most pixel formats are available as little endian and big endian variants. (The sane way would be having native endian formats only.) Usually, most of the real codecs use native formats only, while non-native formats are used by fringe raw codecs only. But the PNG encoders and decoders unfortunately use big endian formats, and since PNG it such a popular format, this causes problems for us. In particular, the current zimg wrapper will refuse to work (and mpv will fall back to sws) when writing non-8 bit PNGs. So add non-native endian support to zimg. This is done in a fairly "generic" way (which means lots of potential for bugs). If input is a "regular" format (and just byte-swapped), the rest happens automatically, which happens to cover all interesting formats. Some things could be more efficient; for example, unpacking is done on the data before it's passed to the unpacker. You could make endian swapping part of the actual unpacking process, which might be slightly faster. You could avoid copying twice in some cases (such as when there's no actual repacker, or if alignment needs to be corrected). But I don't really care. It's reasonably fast for the normal case. Not entirely sure whether this is correct. Some (but not many) formats are covered by the tests, some I tested manually. Some I can't even test, because libswscale doesn't support them (like nv20*).
Diffstat (limited to 'test')
-rw-r--r--test/ref/repack_zimg.log4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ref/repack_zimg.log b/test/ref/repack_zimg.log
index de2dd610e2..2f5a7e98f8 100644
--- a/test/ref/repack_zimg.log
+++ b/test/ref/repack_zimg.log
@@ -5,10 +5,14 @@ argb using gbrap
bgr0 using gbrp
bgr24 using gbrp
bgr48 using gbrp16
+bgr48be using gbrp16
bgra using gbrap
bgra64 using gbrap16
+bgra64be using gbrap16
rgb0 using gbrp
rgb24 using gbrp
rgb48 using gbrp16
+rgb48be using gbrp16
rgba using gbrap
rgba64 using gbrap16
+rgba64be using gbrap16