[MPlayer-dev-eng] [PATCH] A new ASS renderer
Xidorn Quan
quanxunzhen at gmail.com
Sun Sep 23 02:44:32 CEST 2012
On Sun, Sep 23, 2012 at 3:05 AM, Clément Bœsch <ubitux at gmail.com> wrote:
> On Sat, Sep 22, 2012 at 09:01:40PM +0200, Reimar Döffinger wrote:
> > 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)?
>
> I'd unfortunately say that ASS performance is relevant when rendering
> complex karaoke or stuff like that, where the subtitles change all the
> time.
Yes, it will make things worse for what you mentioned. But I find
that the performance for renderer filters becomes trival for those
cases because the process which generates eosd images will consume
a lot more CPU than the renderers.
In fact, in my test, for subtitles with few effects, the process
generates eosd images has become the slowest part of the filter
when SSE4 is enabled.
More information about the MPlayer-dev-eng
mailing list