http://bugs.cinelerra.org/show_bug.cgi?id=470





------- Comment #4 from [EMAIL PROTECTED]  2008-03-25 21:02 +2 -------
It took me quite a while to track this down. Given two tracks, 1 at the
bottom and 2 at the top with fade values f1 and f2, resp. Then the resulting
RGB values are:

1. with the software renderer:

    RGB = max(f1, f2) * ((1-f2)*RGB1 + f2*RGB2)

2. with the OpenGL renderer:

    RGB = (1-f2)*f1*RGB1 + f2*RGB2

There is a bug in the software renderer which does not apply f1 to RGB1, i.e.
it does not blend the bottom track with black background, hence, the resulting
image contains the image of the bottom track even if its fade value is zero.
The OpenGL renderer gets this right.

But there is a bug in the OpenGL renderer, too. It is only visible if there
are more than 2 tracks: It computes the alpha value of the normal blend
operation differently from the software renderer. This alpha value is only
looked at if more tracks are blended into the result of the bottom most
tracks and those tracks are not both completely opaque. Then blended alpha
of the two bottom most tracks is:

1. With the software renderer:

    f = max(f1, f2)

2. With the OpenGL renderer:

    f = (1-f2)*f1 + f2*f2

Both are sub-optimal. Usually, the blended alpha is computed as:

    f = (1-f2)*f1 + f2

according to various sources, e.g.
http://en.wikipedia.org/wiki/Alpha_compositing
(Porter-Duff algorithm).


-- 
Configure bugmail: http://bugs.cinelerra.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

_______________________________________________
Cinelerra mailing list
[email protected]
https://init.linpro.no/mailman/skolelinux.no/listinfo/cinelerra

Reply via email to