From c57304a591d46df490e1584b1a3c9cda1ff91b44 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 30 Jun 2016 21:38:50 +0200 Subject: sub: pack libass bitmaps directly in sd_ass.c and osd_libass.c Change all producer of libass images to packing the bitmaps into a single larger bitmap directly when they're output. This is supposed to help working towards refcounted sub bitmaps. This will reduce performance for VOs like vo_xv, but not for vo_opengl. vo_opengl simply will pick up the pre-packed sub bitmaps, and skip packing them again. vo_xv will copy and pack the sub bitmaps unnecessarily - but if we want sub bitmap refcounting, they'd have to be copied anyway. The packing code cannot be removed yet from vo_opengl, because there are certain corner cases that still produce unpackad other sub bitmaps. Actual refcounting will also require more work. --- sub/ass_mp.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sub/ass_mp.h') diff --git a/sub/ass_mp.h b/sub/ass_mp.h index 20f0ebe9bd..50397bdc6b 100644 --- a/sub/ass_mp.h +++ b/sub/ass_mp.h @@ -49,9 +49,11 @@ void mp_ass_configure_fonts(ASS_Renderer *priv, struct osd_style_opts *opts, struct mpv_global *global, struct mp_log *log); ASS_Library *mp_ass_init(struct mpv_global *global, struct mp_log *log); -struct sub_bitmap; struct sub_bitmaps; -void mp_ass_render_frame(ASS_Renderer *renderer, ASS_Track *track, double time, - struct sub_bitmaps *res); +struct mp_ass_packer; +struct mp_ass_packer *mp_ass_packer_alloc(void *ta_parent); +void mp_ass_packer_pack(struct mp_ass_packer *p, ASS_Image **image_lists, + int num_image_lists, bool changed, + int preferred_osd_format, struct sub_bitmaps *out); #endif /* MPLAYER_ASS_MP_H */ -- cgit v1.2.3