[FFmpeg-devel] [PATCH] Make decoding alpha optional for some codecs.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Fri Sep 20 08:05:09 CEST 2013


"Reimar Döffinger" <Reimar.Doeffinger at gmx.de> wrote:
>On 20.09.2013, at 00:50, "Don Moir" <donmoir at comcast.net> wrote:
>
>> ----- Original Message ----- From: "compn" <tempn at twmi.rr.com>
>> To: <ffmpeg-devel at ffmpeg.org>
>> Sent: Thursday, September 19, 2013 6:26 PM
>> Subject: Re: [FFmpeg-devel] [PATCH] Make decoding alpha optional for
>some codecs.
>> 
>> 
>>> On Thu, 19 Sep 2013 18:05:21 -0400, Don Moir wrote:
>>>> You could get lucky and some might look ok, but then alpha can give
>a smooth anti-aliasing effect and that would be lost. So effort
>>>> is add clutter to save some CPU cycles at the possible expense of a
>bad display.
>>> 
>>> since ffplay doesnt handle alpha now, do your videos look bad in
>ffplay?
>>> i mean, not decoding alpha vs decoding alpha, does it make any
>>> difference when you dont display alpha anyways?
>> 
>> I pretty much don't use ffplay for anything. In my own app, alpha
>makes a great deal of difference, used as overlays and even when video
>is over black, the smoothness with alpha is very apparent. It's like
>take a alpha png and remove the alpha. Looks bad. stair stepped
>
>I just realize there is a possible issue with the whole argument, and
>if you mostly look at intermediate data you might get the wrong
>impression.
>You assume that the color values need to be multiplied with alpha.
>However except for intermediates that makes no sense.
>The color values should be pre-multiplied with alpha after processing,
>since it makes the features more natural and avoid sharp edges, which
>improves visual quality. It also means you will not waste bandwidth
>storing data that will be blended away anyway, and it saves you one
>multiplication when displaying.
>In this case, just discarding alpha will actually display an image that
>looks exactly like against black background.
>Now the interesting question would be whether flashplayer does it like
>that, which would explain why I could never actually see these
>issues...

It does: http://blogs.adobe.com/aftereffects/2009/06/flash-flv-alpha-channels-strai.html
Note that another benefit is that it allows additional effects like highlights by setting alpha to 1 but encoding a grey colour value.
This is an effect not possible with non-premultiplied alpha.




More information about the ffmpeg-devel mailing list