Quoting Claudio KLaN Ciccani:
> +static void Bop_yuy2_Sto_Aop( GenefxState *gfxs )
> +{
> +     int   w;
> +     int   i;
> +     int   l     = 0;
> +     int   cr    = 0;
> +     __u8 *D     = gfxs->Aop;
> +     __u8 *S     = gfxs->Bop;
> +     int   SperD = gfxs->SperD;
> +
> +     for (w = 0; w < gfxs->length; w++) {
> +      i  = (l >> 16) * 2;
> +      *D = S[i]; /* blit luma */
> +
> +      l += SperD;
> +
> +      if (!(w & 1)) { /* blit chroma */
> +            i      = (cr >> 16) * 4;
> +        *(D+1) = S[i+1];
> +        *(D+3) = S[i+3];
> +
> +        cr += SperD;
> +      }
> +
> +      D += 2;
> +     }
> +}

You should read and write 32 bit at once, otherwise you have
a big performance impact on most non-x86 and you have to
add extra code for big/little endian.

-- 
Best regards,
  Denis Oliver Kropp

.------------------------------------------.
| DirectFB - Hardware accelerated graphics |
| http://www.directfb.org/                 |
"------------------------------------------"

                            Convergence GmbH


Reply via email to