[MPlayer-dev-eng] [PATCH] A new ASS renderer

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Sep 22 21:01:40 CEST 2012


On Sat, Sep 22, 2012 at 08:02:36PM +0800, Xidorn Quan wrote:
> The patch attached is a new ASS renderer which is optimized for
> subtitles with few effects. For me, this new renderer is nearly
> 2x faster on average than the current one for those subtitles.
> 
> I found that most subtitles keep unchanged across several frames,
> while vf_ass renders them over and over again for every images in it.
> 
> This new renderer renders that images to one image with alpha channal
> when subtitle changes, then it simply does pixel weighted addition for
> new frame and the image. The second step is very fast, cache-friendly
> and easy to be further optimized, for example, by using SIMD.
> 
> In this patch, I moved get_image, blank, and prepare_image from
> vf_ass.c to ass_common.c and color converting macros to ass_common.h
> so that I can reuse them in vf_ass2.
> 
> To use this new renderer, just add "-vf ass2" to the comand line.

I strongly dislike both having and having to maintain two solutions
to the same problem.
One solution would be to switch between the methods based on some
heuristics from e.g. the previous frames.
I also kind of wonder what the use case is, where does ASS rendering
speed make a relevant difference (while also none of the
hardware-accelerated implementations are used)?


More information about the MPlayer-dev-eng mailing list