[FFmpeg-devel] [PATCH] vc1.c: add support for HWAccel (take 2)

Gwenole Beauchesne gbeauchesne
Wed Mar 18 18:06:31 CET 2009


Hi,

On Tue, 10 Mar 2009, Kostya wrote:

>> @@ -4277,6 +4279,15 @@ static int vc1_decode_frame(AVCodecContext *avctx,
>>      s->me.qpel_put= s->dsp.put_qpel_pixels_tab;
>>      s->me.qpel_avg= s->dsp.avg_qpel_pixels_tab;
>>
>> +    if (avctx->hwaccel) {
>> +        if (avctx->hwaccel->start_frame(avctx, buf, buf_size) < 0)
>> +            return -1;
>> +        if (avctx->hwaccel->decode_slice(avctx, buf_start, (buf + buf_size) - buf_start) < 0)
>> +            return -1;
>> +        if (avctx->hwaccel->end_frame(avctx) < 0)
>> +            return -1;
>> +    }
>> +    else
>
> <don't forget proper indent here>

Well, that was an "optimization" to get a smaller patch (only '+') and 
reduce the next one when removing VDPAU with only '-'s instead. ;-) 
Anyway, reindented correctly as you can see in the attachment.

>>      if ((CONFIG_VC1_VDPAU_DECODER || CONFIG_WMV3_VDPAU_DECODER)
>>          &&s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
>>          ff_vdpau_vc1_decode_picture(s, buf_start, (buf + buf_size) - buf_start);
>
> Those two chunks make me a bit uneasy and not because of your changes.
>
> Patch OK in the case you swear to convert VDPAU to hwaccel architecture
> (I don't like to have too many special cases).

I am sorry but I can't swear anything because (i) AVHWAccel is not really 
a "special" case, it's the new default HW acceleration framework, (ii) you 
can't swear either that all VA API bits can get in by the end of the week, 
(iii) this is independent from vc1.c, (iv) what if I did not actually have 
the HW to work on VDPAU support in the first place? Blind coding? Well, 
this process can work with patient enough testers, according to reports I 
got for my initial VAAPI-to-VDPAU bridge code for VC-1. ;-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg.hwaccel.vc1.3.patch
Type: text/x-diff
Size: 2673 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090318/4762c24b/attachment.patch>



More information about the ffmpeg-devel mailing list