mpv/video
wm4 c1a961ad78 draw_bmp: rewrite
draw_bmp.c is the software blender for subtitles and OSD. It's used by
encoding mode (burning subtitles), and some VOs, like vo_drm, vo_x11,
vo_xv, and possibly more.

This changes the algorithm from upsampling the video to 4:4:4 and then
blending to downsampling the OSD and then blending directly to video.
This has far-reaching consequences for its internals, and results in an
effective rewrite.

Since I wanted to avoid un-premultiplying, all blending is done with
premultiplied alpha. That's actually the sane thing to do. The old code
just didn't do it, because it's very weird in YUV fixed point.
Essentially, you'd have to compensate for the chroma centering constant
by subtracting src_alpha/255*128. This seemed so hairy (especially with
correct rounding and high bit depths involved) that I went for using
float.

I think it turned out mostly OK, although it's more complex and less
maintainable than before. reinit() is certainly a bit too long. While it
should be possible to optimize the RGB path more (for example by
blending directly instead of doing the stupid float conversion), this is
probably slower. vo_xv users probably lose in this, because it takes the
slowest path (due to subsampling requirements and using YUV).

Why this rewrite? Nobody knows. I simply forgot the reason. But you'll
have it anyway. Whether or not this would have required a full rewrite,
at least it supports target alpha now (you can for example hard sub
transparent PNGs, if you ever wanted to use mpv for this).

Remove the check in vf_sub. The new draw_bmp.c is not as reliant on
libswscale anymore (mostly uses repack.c now), and osd.c shows an
error message on missing support instead now.

Formats with chroma subsampling of 4 are not supported, because FFmpeg
doesn't provide pixfmt definitions for alpha variants. We could provide
those ourselves (relatively trivial), but why bother.
2020-05-09 18:02:57 +02:00
..
decode options: make imgfmt options always accept "no" 2020-04-09 11:20:45 +02:00
filter draw_bmp: rewrite 2020-05-09 18:02:57 +02:00
out vo_gpu: fix green shit with float yuv input 2020-05-09 18:02:57 +02:00
csputils.c csputils: add function for getting uint/float transformation 2020-05-09 18:02:57 +02:00
csputils.h csputils: add function for getting uint/float transformation 2020-05-09 18:02:57 +02:00
cuda.c video: cuda: add explicit context creation for copy hwaccels 2019-12-29 14:32:47 -08:00
d3d.c video: remove mp_image_params.hw_flags field 2019-10-17 22:43:14 +02:00
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 screenshot, vo_image: use global swscale/zimg parameters 2019-10-31 15:44:09 +01:00
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 screenshot, vo_image: use global swscale/zimg parameters 2019-10-31 15:44:09 +01:00
img_format.c video: add yuv float formats 2020-05-09 18:02:57 +02:00
img_format.h video: add yuv float formats 2020-05-09 18:02:57 +02:00
mp_image.c video: add yuv float formats 2020-05-09 18:02:57 +02:00
mp_image.h mp_image: add some helpers 2020-05-06 15:27:25 +02:00
mp_image_pool.c mp_image_pool: expose a function for reporting hw download format 2019-10-02 21:07:14 +02:00
mp_image_pool.h mp_image_pool: expose a function for reporting hw download format 2019-10-02 21:07:14 +02:00
repack.c repack: add support for converting from/to float formats 2020-05-09 18:02:57 +02:00
repack.h repack: add support for converting from/to float formats 2020-05-09 18:02:57 +02:00
sws_utils.c sws_utils: allow setting zimg options directly 2020-05-09 18:02:57 +02:00
sws_utils.h sws_utils: allow setting zimg options directly 2020-05-09 18:02:57 +02:00
vaapi.c options: change option macros and all option declarations 2020-03-18 19:52:01 +01:00
vaapi.h vo_gpu: hwdec_vaapi: Suppress format errors when probing 2019-07-08 01:57:02 +02:00
vdpau.c hwdec: remove unused fields 2017-12-21 19:31:36 +01:00
vdpau.h vd_lavc, vdpau, vaapi: restore emulated API avoidance 2017-12-02 04:53:51 +01:00
vdpau_functions.inc
vdpau_mixer.c
vdpau_mixer.h
zimg.c video: separate repacking code from zimg and make it independent 2020-05-09 18:02:57 +02:00
zimg.h sws_utils: allow setting zimg options directly 2020-05-09 18:02:57 +02:00