1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-07 22:57:42 +00:00
mpv/test
wm4 a8b84c9a1a 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*).
2020-04-13 15:56:27 +02:00
..
ref zimg: add support for big endian input and output 2020-04-13 15:56:27 +02:00
chmap.c test: merge test_helpers.c and index.c 2019-11-08 20:34:07 +01:00
gl_video.c test: merge test_helpers.c and index.c 2019-11-08 20:34:07 +01:00
img_format.c test: add tests for zimg RGB repacking 2019-11-09 01:55:13 +01:00
input-gamepad.conf input: add gamepad support through SDL2 2019-10-23 09:40:30 +02:00
json.c test: merge test_helpers.c and index.c 2019-11-08 20:34:07 +01:00
linked_list.c test: merge test_helpers.c and index.c 2019-11-08 20:34:07 +01:00
paths.c path: add mp_path_is_absolute() 2020-02-06 14:14:35 +01:00
scale_sws.c test: add tests for zimg RGB repacking 2019-11-09 01:55:13 +01:00
scale_test.c test: add tests for zimg RGB repacking 2019-11-09 01:55:13 +01:00
scale_test.h test: add tests for zimg RGB repacking 2019-11-09 01:55:13 +01:00
scale_zimg.c test: add tests for zimg RGB repacking 2019-11-09 01:55:13 +01:00
subtimes.js command: add sub-start & sub-end properties 2019-09-22 09:19:45 +02:00
tests.c test: add some path handling tests 2020-02-06 13:50:41 +01:00
tests.h test: add some path handling tests 2020-02-06 13:50:41 +01:00