[FFmpeg-devel] [PATCH] vf_overlay: add support to RGBA packed input and output
Michael Niedermayer
michaelni at gmx.at
Sun Oct 30 15:38:41 CET 2011
On Sun, Oct 30, 2011 at 01:29:26AM +0200, Stefano Sabatini wrote:
> On date Saturday 2011-10-29 17:27:16 +0100, Mark Himsley encoded:
> > On 29/10/2011 16:26, Michael Niedermayer wrote:
> > >On Sat, Oct 29, 2011 at 04:47:41PM +0200, Stefano Sabatini wrote:
> >
> > >>Regarding the second patch, I kept Mark's code but after some time
> > >>spent tinkering on it I couldn't figure out the meaning of the
> > >>equation:
> > >
> > >> d[da] = ( (d[da]<< 8) + (256 - d[da]) * s[sa] )>> 8;
> > >
> > >correcter:
> > >d += ((255 - d) * s + 128) / 255;
> > >
> > >and /255 can be done by multiplication and shift
> >
> > Sure, Michael is right.
>
> What I was asking, was an explanation of the formula, I would naively
> expect something like:
> main_alpha = (1-alpha) * main_alpha + alpha * overlay_alpha
>
> like for the other components.
>
> Now the equation I see is something along the lines of an obfuscated
> version of:
> main_alpha += (1-main_alpha) * overlay_alpha
>
> Can you give explanation of it?
>
> And patch updated (waiting feedback for the RGB path patch).
iam fine with the patches once the computations are exact/correct
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111030/35c9aa74/attachment.asc>
More information about the ffmpeg-devel
mailing list