fixing RGB32->RGB16 on big endian patch by (Colin Leroy <colin at colino dot net>)
authorColin Leroy <colin@colino.net>
Wed, 23 Oct 2002 23:52:57 +0000 (23:52 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 23 Oct 2002 23:52:57 +0000 (23:52 +0000)
Originally committed as revision 7892 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc

postproc/rgb2rgb_template.c

index 44e764e66de2ae3982da6cfa5ad41b28edf00a45..887856d9c7b7270a27ffa40fab485294487c035b 100644 (file)
@@ -364,11 +364,20 @@ static inline void RENAME(rgb32to16)(const uint8_t *src, uint8_t *dst, unsigned
 #endif
        while(s < end)
        {
 #endif
        while(s < end)
        {
+#ifndef WORDS_BIGENDIAN
                const int b= *s++;
                const int g= *s++;
                const int r= *s++;
                const int b= *s++;
                const int g= *s++;
                const int r= *s++;
+#else
+               const int a= *s++; /*skip*/
+               const int r= *s++;
+               const int g= *s++;
+               const int b= *s++;
+#endif         
                *d++ = (b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8);
                *d++ = (b>>3) | ((g&0xFC)<<3) | ((r&0xF8)<<8);
+#ifndef WORDS_BIGENDIAN
                s++;
                s++;
+#endif
        }
 }
 
        }
 }