[FFmpeg-devel] [PATCH] HWAccel infrastructure (take 5)

Michael Niedermayer michaelni
Fri Feb 20 13:51:55 CET 2009


On Fri, Feb 20, 2009 at 09:51:37AM +0100, Gwenole Beauchesne wrote:
[...]
> @@ -1692,6 +1704,20 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
>  
>      s->mb_x=0;
>  
> +    if (avctx->hwaccel) {
> +        const uint8_t *buf_end, *buf_start = *buf - 4; /* include start_code */
> +        int start_code = -1;
> +        buf_end = ff_find_start_code(buf_start + 2, *buf + buf_size, &start_code);
> +        if (buf_end < *buf + buf_size)
> +            buf_end -= 4;
> +        s->resync_mb_x = s->mb_x;
> +        s->resync_mb_y = s->mb_y = mb_y;
> +        if (avctx->hwaccel->decode_slice(avctx, buf_start, buf_end - buf_start) < 0)
> +            return DECODE_SLICE_ERROR;
> +        *buf = buf_end;
> +        return DECODE_SLICE_OK;
> +    }
> +
>      for(;;) {
>          int code = get_vlc2(&s->gb, mbincr_vlc.table, MBINCR_VLC_BITS, 2);
>          if (code < 0){

i still think this is ugly implemented ...


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090220/4b68de72/attachment.pgp>



More information about the ffmpeg-devel mailing list