[GEM-dev] Re: meanwhile, in gempixutil...

james tittle tigital at mac.com
Tue Feb 22 19:26:45 CET 2005


...and we have a winner!  Ok, I'll commit this stuff 
(fromYV12(short*)), but should we add this clamping to the other 
functions (ie. fromUYVY, fromYUY2, fromYVYU)?

thanx georg!  Now onto altivec...this file is gonna be huge!

jamie

On Feb 22, 2005, at 10:20 AM, Georg Holzmann wrote:

> Hallo!
>
>> the problem is (i believe), that YUV does not use the whole range from
>> 0..255 but something like 16..245 (or whatever: i didn't write it down
>> and now i cannot find it); i didn't add any clipping for this (which 
>> was
>> very stupid) because of performance reasons.
> It fixed this for me some months ago, but didn't send it to the list
> (because I also changed the colors r and b because they were swapped 
> with my
> webcam ...)
>
> e.g.: GemPixUtil.cpp, line 599:
>
>   case GL_RGBA:
>   case GL_BGRA_EXT:   //  <- this is the confusing:
> 		      //   RGBA and BGRA is the same !!!
>     {
>
> 	...
> 	
> 	  // 1st row - 1st pixel
> 	  y=*py1++;
> 	  yy=y<<8;
> 	  //*pixels1++ = (yy + ub     ) >> 8; // r
> 	  *pixels1++ = CLAMP( (yy +      vr) >> 8 ); // r
> 	  *pixels1++ = CLAMP( (yy - ug - vg) >> 8 ); // g
> 	  //*pixels1++ = (yy +      vr) >> 8; // b
> 	  *pixels1++ = CLAMP( (yy + ub     ) >> 8 ); // b
> 	  *pixels1++ = 255; // a
> 	
> 	...
>
>     }
>
> so i think you only have to CLAMP the values (at least for me it 
> worked much
> better this way)





More information about the GEM-dev mailing list