[FFmpeg-devel] [PATCH] VP8 decoder

Michael Niedermayer michaelni
Tue Jun 22 16:32:10 CEST 2010


On Tue, Jun 22, 2010 at 10:02:29AM -0400, Ronald S. Bultje wrote:
[...]
> @@ -393,6 +443,21 @@
>      src[1+3*stride]=(l1 + 2*l2 + l3 + 2)>>2;
>  }
>  
> +static void pred4x4_tm_vp8_c(uint8_t *src, const uint8_t *topright, int stride){
> +    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
> +    int tl = src[-1-stride];
> +    uint8_t *top = src-stride;
> +    int y;
> +
> +    for (y = 0; y < 4; y++) {
> +        src[0] = cm[src[-1] + top[0] - tl];
> +        src[1] = cm[src[-1] + top[1] - tl];
> +        src[2] = cm[src[-1] + top[2] - tl];
> +        src[3] = cm[src[-1] + top[3] - tl];

&cm[src[-1] - tl]



> +        src += stride;
> +    }
> +}
> +
>  static void pred16x16_vertical_c(uint8_t *src, int stride){
>      int i;
>      const uint32_t a= ((uint32_t*)(src-stride))[0];

> @@ -539,6 +604,21 @@
>      pred16x16_plane_compat_c(src, stride, 0, 1);
>  }
>  
> +static void pred16x16_tm_vp8_c(uint8_t *src, int stride){
> +    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
> +    int tl = src[-1-stride];
> +    uint8_t *top = src-stride;
> +    int x, y;
> +
> +    for (y = 0; y < 16; y++) {
> +        int l = src[-1];
> +        uint8_t *cm_in = &cm[l - tl];

- tl could be factored out of the loop into cm


> +        for (x = 0; x < 16; x++)
> +            src[x] = cm_in[top[x]];
> +        src += stride;
> +    }
> +}
> +
>  static void pred8x8_vertical_c(uint8_t *src, int stride){
>      int i;
>      const uint32_t a= ((uint32_t*)(src-stride))[0];
> @@ -745,6 +825,25 @@
>    }
>  }
>  
> +static void pred8x8_tm_vp8_c(uint8_t *src, int stride){
> +    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
> +    int tl = src[-1-stride];
> +    uint8_t *top = src-stride;
> +    int y;
> +
> +    for (y = 0; y < 8; y++) {
> +        src[0] = cm[src[-1] + top[0] - tl];
> +        src[1] = cm[src[-1] + top[1] - tl];
> +        src[2] = cm[src[-1] + top[2] - tl];
> +        src[3] = cm[src[-1] + top[3] - tl];
> +        src[4] = cm[src[-1] + top[4] - tl];
> +        src[5] = cm[src[-1] + top[5] - tl];
> +        src[6] = cm[src[-1] + top[6] - tl];
> +        src[7] = cm[src[-1] + top[7] - tl];
> +        src += stride;
> +    }
> +}

similar things

also maybe some of teh if() could at some point in the future be reorganized
they look a bit convoluted

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

> ... defining _GNU_SOURCE...
For the love of all that is holy, and some that is not, don't do that.
-- Luca & Mans
-------------- 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/20100622/610434d3/attachment.pgp>



More information about the ffmpeg-devel mailing list