Hi,
Two questions: I am trying to rotate chroma in YUV colour space by separating each of the components and applying the following formula.
int Ut = ((U-128) * cos(hue[H]) + (V-128) * sin(hue[H])) + 128;
int Vt = ((V-128) * cos(hue[H]) - (U-128) * sin(hue[H])) + 128;
...where hue[H] is an array of rotation angles between 0.0 and 360.0.
This seems to work OK but is dog slow. Is there a way to speed this up by converting to integer only calculation and doing away with cosine and sinus?
Second, when doing conversion between YUV and RGB, it seems that luma is also affected after rotation. To demonstrate what I mean, I am randomly rotating each line's chroma. The process is:
Convert from RGB to YUV > rotate chroma > convert to RGB.
Top left is the original image, the two images on the right are U and V and the bottom left is the luma. As you can see, it seems to have some artefacts from rotation. Is there a way to avoid this?
Thanks
CJ