Browse Source

Fix rgb15ToUV. Correct order of components and use one shift less.

Originally committed as revision 23279 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
tags/v0.5
Ivo van Poorten 18 years ago
parent
commit
f96829d2d0
1 changed files with 4 additions and 7 deletions
  1. +4
    -7
      libswscale/swscale_template.c

+ 4
- 7
libswscale/swscale_template.c View File

@@ -2265,14 +2265,11 @@ static inline void RENAME(rgb15ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1
int d0= ((uint32_t*)src1)[i];

int dl= (d0&0x03E07C1F);
int dh= ((d0>>5)&0x03E0F81F);

int dh2= (dh>>11) + (dh<<21);
int d= dh2 + dl;
int d= dl + (((d0>>16) + (d0<<16))&0x03E07C1F);

int g= d&0x7F;
int r= (d>>10)&0x7F;
int b= d>>21;
int r= d&0x3F;
int b= (d>>10)&0x3F;
int g= d>>21;
dstU[i]= ((RU*r + GU*g + BU*b)>>(RGB2YUV_SHIFT+1-3)) + 128;
dstV[i]= ((RV*r + GV*g + BV*b)>>(RGB2YUV_SHIFT+1-3)) + 128;
}


Loading…
Cancel
Save