[FFmpeg-devel] [PATCH 0/2] VDA decoder for ffmpeg

Xidorn Quan quanxunzhen at gmail.com
Tue Aug 21 10:02:05 CEST 2012

On Tue, Aug 21, 2012 at 3:00 PM, Reimar Döffinger
<Reimar.Doeffinger at gmx.de>wrote:

> Thanks, I really like the feature, but why can't you instantiate a full
> H.264 decoder with VDA HWAccel like an external application would instead
> of reimplementing lots of the header parsing?

I have considered the solution you said, and obviously, life would
be a lot more simple if the decoder be implemented that way. But for
two reasons I decided not to use it:

1. Origin H.264 decoder never guarantees that HWAccel will be used.

   For some cases, the decoder doesn't call get_format, and we will
   have no chance to ask it to use HWAccel. If it happens,
   the h264_vda decoder will automatically fall back to software
   decoding without any warning or something like this.

   I don't think it is a proper behavior for this decoder. It should
   either succeed to initialize and then use VDA to decode, or fail
   if it can't and let caller to fall back itself.

   In fact, sometimes, VDA can decode a video but H.264 decoder
   refuses to use it and do decoding itself.

2. It's a trivial reason that, the VDA HWAccel will always copy
   frame data to its own buffer before decoding, it wastes CPU time.
   It can be more efficient in an independent decoder.

More information about the ffmpeg-devel mailing list