0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00
mpv/sub
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
..
ass_mp.c osd: make the OSD and sub font more customizable 2012-11-20 18:00:15 +01:00
ass_mp.h osd: make the OSD and sub font more customizable 2012-11-20 18:00:15 +01:00
dec_sub.c Rename directories, move files (step 2 of 2) 2012-11-12 20:08:18 +01:00
dec_sub.h VO, sub: refactor 2012-10-24 21:56:34 +02:00
draw_bmp.c draw_bmp: add RGB rendering to fix image quality issues 2012-11-22 15:26:38 +01:00
draw_bmp.h vo_xv: don't require frame stepping to remove OSD or subs 2012-11-21 19:56:59 +01:00
find_sub.c Rename directories, move files (step 2 of 2) 2012-11-12 20:08:18 +01:00
find_subfiles.c Rename directories, move files (step 2 of 2) 2012-11-12 20:08:18 +01:00
find_subfiles.h subs: options: add -sub-paths 2011-04-20 04:22:52 +03:00
img_convert.c Rename directories, move files (step 2 of 2) 2012-11-12 20:08:18 +01:00
img_convert.h Remove things related to old OSD 2012-10-24 21:56:33 +02:00
osd_dummy.c sub: allow rendering OSD in ASS image format directly, simplify 2012-10-16 07:26:30 +02:00
osd_font.pfb osd: osd_font.h -> osd_font.pfb 2012-07-28 23:36:08 +02:00
osd_libass.c osd: make the OSD and sub font more customizable 2012-11-20 18:00:15 +01:00
sd_ass.c sd_ass: fix ASS subtitles coming from demux_lavf 2012-11-16 22:54:22 +01:00
sd_lavc.c Rename directories, move files (step 2 of 2) 2012-11-12 20:08:18 +01:00
sd.h VO, sub: refactor 2012-10-24 21:56:34 +02:00
spudec.c Fix potential bugs and issues, general cleanups 2012-11-20 18:00:14 +01:00
spudec.h options: remove --ffactor switch 2012-10-24 21:56:35 +02:00
sub.c vo_xv: don't require frame stepping to remove OSD or subs 2012-11-21 19:56:59 +01:00
sub.h vo_xv: don't require frame stepping to remove OSD or subs 2012-11-21 19:56:59 +01:00
subassconvert.c Rename directories, move files (step 2 of 2) 2012-11-12 20:08:18 +01:00
subassconvert.h subtitles: style support for common SubRip tags and MicroDVD 2011-01-18 15:17:28 +02:00
subreader.c subreader: do not skip the first char of ASS fields. 2012-11-21 20:00:52 +01:00
subreader.h subreader: replace sub_free() by talloc destructor 2012-11-16 21:21:15 +01:00
vobsub.c Fix potential bugs and issues, general cleanups 2012-11-20 18:00:14 +01:00
vobsub.h Remove dead code 2012-08-01 17:07:35 +02:00