1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-22 06:42:03 +00:00
mpv/video
wm4 86ad77d0db draw_bmp: add RGB rendering to fix image quality issues
As pointed out in commit ed01df, the quality loss due to frequent
conversion between RGB and YUV is too much when drawing OSD and
subtitles.

Fix this by staying in the same colorspace when drawing subtitles.
Render directly to RGB, without converting to YUV first.

The bad thing about packed RGB is that there are many pixel formats,
which would all require special code for blending. It's also completely
incompatible to planar YUV. Use planar RGB instead, which allows us to
reuse all code originally written for planar YUV. The only thing that
needs to be changed is the color conversion in the libass case. (In
exchange for simpler code, the image has to be copied, but this is
still much better than converting to YUV.)

Unfortunately, libswscale doesn't support planar RGB output. Add a hack
to sws_utils.c to handle conversion to planar RGB. In the common case,
when converting 32 bit per pixel RGB, calling swscale can be avoided
entirely.

The change in mp_image.c is needed to allocate GBRP images correctly.

(The issue with vo_x11 could be easily solved by always backing up the
same bounding box as the bitmap drawing RGB<->YUV conversion does, but
this commit is probably the better fix.)
2012-11-22 15:26:38 +01:00
..
decode options, vo_x11: remove -zoom option, make it default 2012-11-16 21:21:14 +01:00
filter screenshot: add subs even with vf_screenshot 2012-11-21 19:58:51 +01:00
out video: fix bogus uses of mp_image.w/width 2012-11-21 19:58:51 +01:00
csputils.c
csputils.h
fmt-conversion.c video: add IMGFMT_Y16/PIX_FMT_GRAY16 2012-11-14 11:50:02 +01:00
fmt-conversion.h
image_writer.c video: fix bogus uses of mp_image.w/width 2012-11-21 19:58:51 +01:00
image_writer.h
img_format.c video: add IMGFMT_Y16/PIX_FMT_GRAY16 2012-11-14 11:50:02 +01:00
img_format.h video: add IMGFMT_Y16/PIX_FMT_GRAY16 2012-11-14 11:50:02 +01:00
memcpy_pic.h
mp_image.c draw_bmp: add RGB rendering to fix image quality issues 2012-11-22 15:26:38 +01:00
mp_image.h
sws_utils.c draw_bmp: add RGB rendering to fix image quality issues 2012-11-22 15:26:38 +01:00
sws_utils.h
vfcap.h options, vo_x11: remove -zoom option, make it default 2012-11-16 21:21:14 +01:00