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

Kostya kostya.shishkov
Sat Mar 21 11:22:39 CET 2009


On Thu, Mar 19, 2009 at 04:56:50PM +0100, Gwenole Beauchesne wrote:
> Le 18 mars 09 ? 19:10, Kostya a ?crit :
> 
> >>>[...]
> >>>>@@ -4277,8 +4279,16 @@ 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 ((CONFIG_VC1_VDPAU_DECODER || CONFIG_WMV3_VDPAU_DECODER)
> >>>>-        &&s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
> >>>>+    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 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);
> >>>>    else {
> >>>>        ff_er_frame_start(s);
> >>>
> >>>No need to swap conditions here.
> >>
> >>What do you mean? The conditions are still in the same order:  
> >>CONFIG_*
> >>then hw caps.
> >
> >I mean putting if(avctx->hwaccel){} before VDPAU chunk. If you don't  
> >have some
> >technical reasons to do so please insert it between VDPAU and C  
> >decoding.
> 
> New patch herein attached.

ok




More information about the ffmpeg-devel mailing list