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

Don Moir donmoir at comcast.net
Fri Sep 20 00:05:21 CEST 2013


----- Original Message ----- 
From: "Reimar Döffinger" <Reimar.Doeffinger at gmx.de>
To: "FFmpeg development discussions and patches" <ffmpeg-devel at ffmpeg.org>
Sent: Thursday, September 19, 2013 5:56 PM
Subject: Re: [FFmpeg-devel] [PATCH] Make decoding alpha optional for some codecs.


> On Thu, Sep 19, 2013 at 05:37:29PM -0400, Don Moir wrote:
>> >>> and basically every video player. E.g. quicktime displays full
>> >>> transparency in Prores4444 as black and so does FCP.
>> >>
>> >>You have to decode the alpha to use the alpha mask any picture content
>> >>which is under transparent regions.
>> >>
>> >>You cannot display the video correctly without multiplying the alpha
>> >>with the video content - unless the alpha is 100% across the whole
>> >>picture, which you don't know until you've decoded the alpha..
>>
>> >Well, as you said yourself later strictly speaking you can't
>> >decode it without the proper background image.
>> >And there can be some value to see just the color part,
>> >even if in some cases it looks quite bad.
>> >For quite a few of the flash videos they look just fine
>> >after throwing away alpha.
>> >I admit that you are right in principle, but for a lot
>> >of players discarding alpha will not make anything worse,
>> >and for players that multiply the color with alpha an
>> >option to discard the alpha becomes even more valuable IMHO,
>> >since it can save even more processing in cases where
>> >"correctness" (in quotation marks because 100% correct needs the
>> >intended background after all and players usually don't have that)
>> >isn't critical.
>>
>> If you have say an ARGB value of  0,255,0,0  alpha value 0, and red
>> value of 255, and assuming black background, what does disrecarding
>> the alpha value mean?  Does it mean the value is now a solid red of
>> 255 or does it mean value is black ?
>
> Solid red. (and there obviously is no "background" color)
>
>> If alpha is completely
>> disregarded display will be terrible and mostly useless.
>
> I don't know what kind of material you work with.
> For the ones I could find they looked all completely normal.
> Yes, you might have bad luck and come over the one that is
> unwatchable without it (though on the other hand, if the video
> has significant areas of low alpha, it will look mostly black
> and probably not be worth watching either way), but that's also true for
> options like skiploopfilter that I remember as being quite popular.

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. 



More information about the ffmpeg-devel mailing list