[Ffmpeg-cvslog] r5543 - trunk/libavcodec/vc1.c

Michael Niedermayer michaelni
Thu Jun 29 13:56:06 CEST 2006


Hi

On Thu, Jun 29, 2006 at 01:05:34PM +0200, kostya wrote:
[...]
> +static void vc1_v_overlap(uint8_t* src, int stride)
> +{
> +    int i;
> +    int a, b, c, d;
> +    for(i = 0; i < 8; i++) {
> +        a = src[-2*stride];
> +        b = src[-stride];
> +        c = src[0];
> +        d = src[stride];
> +
> +        src[-2*stride] = (7*a + d) >> 3;
> +        src[-stride] = (-a + 7*b + c + d) >> 3;
> +        src[0] = (a + b + 7*c - d) >> 3;
> +        src[stride] = (a + 7*d) >> 3;
> +        src++;

hmm isnt there some rounding & maybe cliping missing?

and you could simplify this by: (this also adds the rounding)

e= (a - d + 4)>>3
src[-2*stride] = a - e
src[   stride] = d + e
e= (a - d + b - c + 3)>>3
src[-  stride] = b - e
src[        0] = c + e

of course i dont know if thats faster or not in practice


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-cvslog mailing list