From 56058a95e55c200828525f555baf47f91d81ccdd Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 17 Jun 2016 21:54:12 +0200 Subject: sub: fix --sub-gauss Implement it directly in sd_lavc.c as well. Blurring requires extending the size of the sub-images by the blur radius. Since we now want sub_bitmaps to be packed into a single image, and we don't want to repack for blurring, we add some extra padding to each sub-bitmap in the initial packing, and then extend their size later. This relies on the previous bitmap_packer commit, which always adds the padding in all cases. Since blurring is now done on parts of a large bitmap, the data pointers can become unaligned, depending on their position. To avoid shitty libswscale printing a dumb warning, allocate an extra image, so that the blurring pass is done on two newly allocated images. (I don't find this feature important enough to waste more time on it.) The previous refactor accidentally broke this feature due to a logic bug in osd.c. It didn't matter before it happened to break, and doesn't matter now since the code paths are different. --- sub/img_convert.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sub/img_convert.h') diff --git a/sub/img_convert.h b/sub/img_convert.h index d5baadced2..a0020df497 100644 --- a/sub/img_convert.h +++ b/sub/img_convert.h @@ -5,6 +5,7 @@ struct osd_conv_cache; struct sub_bitmaps; +struct sub_bitmap; struct mp_rect; struct osd_conv_cache *osd_conv_cache_new(void); @@ -13,8 +14,7 @@ struct osd_conv_cache *osd_conv_cache_new(void); // the converted image data into c, and change imgs to point to the data. bool osd_conv_ass_to_rgba(struct osd_conv_cache *c, struct sub_bitmaps *imgs); // Sub postprocessing -bool osd_conv_blur_rgba(struct osd_conv_cache *c, struct sub_bitmaps *imgs, - double gblur); +void mp_blur_rgba_sub_bitmap(struct sub_bitmap *d, double gblur); bool osd_scale_rgba(struct osd_conv_cache *c, struct sub_bitmaps *imgs); bool mp_sub_bitmaps_bb(struct sub_bitmaps *imgs, struct mp_rect *out_bb); -- cgit v1.2.3