Below there's a modified version of the YUY2 scaling function that blits 32 bits at once.
I don't see differencies on my machine (Athlon-Xp 1,6 GHz), but ,if you think it's better,
I will commit this one (and use the same method for the UYVY function).



static void Bop_yuy2_Sto_Aop( GenefxState *gfxs ) { int w = gfxs->length >> 1; int ysc = 0; int crsc = 0; __u32 *D = (__u32*) gfxs->Aop; __u32 *S = (__u32*) gfxs->Bop; __u16 *S2 = (__u16*) gfxs->Bop; int SperD = gfxs->SperD; int SperD2 = gfxs->SperD << 1;

    while (w--) {
     register __u32 Dpix;

#ifdef WORDS_BIGENDIAN
     Dpix  = S[crsc>>16] & 0x00ff00ff;              /* chroma samples */
     Dpix |= *((__u8*) &S2[ysc>>16]) << 16;         /* first y sample */
     Dpix |= *((__u8*) &S2[(ysc+SperD)>>16]);       /* second y sample */
#else
     Dpix  = S[crsc>>16] & 0xff00ff00;              /* chroma samples */
     Dpix |= *((__u8*) &S2[ysc>>16]);               /* first y sample */
     Dpix |= *((__u8*) &S2[(ysc+SperD)>>16]) << 16; /* second y sample */
#endif

     *D++ = Dpix;

     ysc  += SperD2;
     crsc += SperD;
    }
}



Regards,
Claudio






Reply via email to