mpv/video
wm4 f7f947f960 zimg: add support for some RGB fringe formats
This covers 8 and 16 bit packed RGB formats. It doesn't really help with
any actual use-cases, other than giving the finger to libswscale.

One problem is with different color depths. For example, rgb565 provides
1 bit more resolution to the green channel. zimg can only dither to a
uniform depth. I tried dithering to the highest depth and shifting away
1 bit for the lower channels, but that looked ugly (or I messed up
somewhere), so instead it dithers to the lowest depth, and adjusts the
value range if needed. Testing with bgr4_byte (extreme case with 1/2/1
depths), it looks more "grainy" (ordered dithering artifacts) than
libswscale, but it also looks cleaner and smoother. It doesn't have
libswscale's weird red-shift. So I call it a success.

Big endian formats need to be handled explicitly; the generic big endian
swapper code assumes byte-aligned components.

Unpacking is done with shifts and 3 LUTs. This is symmetric to the
packer. Using a generated palette might be better, but I preferred to
keep the symmetry, and not having to mess with a generated palette and
the pal8 code.

This uses FFmepg pixfmts constants directly. I would have preferred
keeping zimg completely separate. But neither do I want to add an IMGFMT
alias for every of these formats, nor do I want to extend our imgfmt
code such that it can provide a complete description of each packed RGB
format (similar to FFmpeg pixdesc).

It also appears that FFmpeg pixdesc as well as the FFmpeg pixfmt doxygen
have an error regarding RGB8: the R/B bit depths are swapped. libswscale
appears to be handling them differently. Not completely sure, as this is
the only packed format case with R/B havuing different depths (instead
of G, the middle component, where things are symmetric).
2020-04-13 15:56:52 +02:00
..
decode options: make imgfmt options always accept "no" 2020-04-09 11:20:45 +02:00
filter vf_format: add gross mechanism for forcing scaler for testing 2020-04-13 15:56:27 +02:00
out vo_gpu: d3d11: also utilize config cache for d3d11-specific options 2020-04-12 21:18:50 +03:00
csputils.c options: change option macros and all option declarations 2020-03-18 19:52:01 +01:00
csputils.h
cuda.c video: cuda: add explicit context creation for copy hwaccels 2019-12-29 14:32:47 -08:00
d3d.c
d3d.h
fmt-conversion.c video: drop NV24 alias 2020-02-18 18:03:42 +01:00
fmt-conversion.h
hwdec.c video: cuda: add explicit context creation for copy hwaccels 2019-12-29 14:32:47 -08:00
hwdec.h video: cuda: add explicit context creation for copy hwaccels 2019-12-29 14:32:47 -08:00
image_loader.c
image_loader.h
image_writer.c options: change option macros and all option declarations 2020-03-18 19:52:01 +01:00
image_writer.h
img_format.c zimg: add support for big endian input and output 2020-04-13 15:56:27 +02:00
img_format.h zimg: add support for big endian input and output 2020-04-13 15:56:27 +02:00
mp_image.c Remove remains of Libav compatibility 2020-02-16 15:14:55 +01:00
mp_image.h
mp_image_pool.c
mp_image_pool.h
sws_utils.c vf_format: add gross mechanism for forcing scaler for testing 2020-04-13 15:56:27 +02:00
sws_utils.h vf_format: add gross mechanism for forcing scaler for testing 2020-04-13 15:56:27 +02:00
vaapi.c options: change option macros and all option declarations 2020-03-18 19:52:01 +01:00
vaapi.h
vdpau.c
vdpau.h
vdpau_functions.inc
vdpau_mixer.c
vdpau_mixer.h
zimg.c zimg: add support for some RGB fringe formats 2020-04-13 15:56:52 +02:00
zimg.h