[MPlayer-dev-eng] Documenting and extending the subtitles system

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Tue Feb 24 09:33:29 CET 2009


On Tue, Feb 24, 2009 at 12:36:41AM +0100, Nicolas George wrote:
> > I think you can do full-colour rendering with what is already there
> > though, even if it would be quite tricky (I did not actually research
> > this yet though).
> 
> The ass_image_t has only one global field for the color, so apart from
> splitting the overlay into one object per color, which is an awful waste, I
> do not see how.

If it was one object per colour that would not be particularly wasteful
and IMO not work the effort.
But with full alpha-blending you would actually need 8 steps, namely
with the colours
black, red, green, blue, cyan, magenta, yellow, white
and the coefficients (those stored in the bitmap, r, g, b, a stand for
the desired overall blending value and assuming I did not miscalculate):
a8 = FFMIN3(ar, ag, ab);
a7 = FFMIN(ar, ag) - a8;
a6 = FFMIN(ar, ab) - a8;
a5 = FFMIN(ag, ab) - a8;
a4 = FFMAX(0, ab - FFMAX(ar, ag));
a3 = FFMAX(0, ag - FFMAX(ar, ab));
a2 = FFMAX(0, ar - FFMAX(ag, ab));
a1 = 1 - (1 - a) / ((1 - a8) * (1 - a7) * (1 - a6) * (1 - a5) * (1 - a4) * (1 - a3) * (1 - a2))



More information about the MPlayer-dev-eng mailing list