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

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Sep 17 22:03:03 CEST 2013

On Tue, Sep 17, 2013 at 10:00:09PM +0200, Reimar Döffinger wrote:
> On Tue, Sep 17, 2013 at 07:47:30PM +0000, Paul B Mahol wrote:
> > On 9/17/13, Reimar Doeffinger <Reimar.Doeffinger at gmx.de> wrote:
> > > For codecs where decoding of a whole plane can simply
> > > be skipped, we should offer applications to not decode
> > > alpha for better performance.
> > > It also means applications do not need to implement support
> > > (even if it is rather simple) for YUVA formats in order to be
> > > able to play these files.
> > > Unfortunately a good way to test this via FFmpeg only is missing,
> > > suggestions welcome.
> > 
> > Why is there no similar intrusive, and of questionable usefulness,
> > patch that decodes only luma (Y) plane.
> Because most users have a color display.
> Very few players can display alpha (and if they could, a lot
> of users wouldn't want it to).
> Thus alpha is in a large number of use-cases completely useless to
> decode, including in particular ffplay.
> This is easily wasting over 30% CPU time and 40% memory bandwidth
> for no reason. We have a lot more obtrusive and ugly code for smaller
> savings!

And I forgot, luma and chroma usually is interleaved, so this kind
of optimization is not possible, or at least not as effective.
Also chroma is a lot less data, so the savings are smaller.
And lastly, we actually do have or had "gray" decode option to
do exactly that. I believe it was removed in some cases though
since it cost too much performance in the full decode case while
saving too little.

More information about the ffmpeg-devel mailing list