Correction: ...> because the G multiplier above is 1. > So in the end you need more multiplications?Sorry, R and B are subtracted by a amount of G bevor, so G could be correct calculated!
Image Compression Using Fourier Transforms
Started by ●April 23, 2009
Reply by ●May 26, 20092009-05-26
Reply by ●May 30, 20092009-05-30
> Y = 0.299 * R + 0.587 * G + 0.114 * B > U = (B - Y) * 0.493 > V = (R - Y) * 0.877 > > than YCbCr could be made this way, only by changing the factors > for U and V to become Cb and Cr, with 5 multiplications?That is not lossless.
Reply by ●May 30, 20092009-05-30
Mihai Cartoaje schrieb:>> Y = 0.299 * R + 0.587 * G + 0.114 * B >> U = (B - Y) * 0.493 >> V = (R - Y) * 0.877 >> >> than YCbCr could be made this way, only by changing the factors >> for U and V to become Cb and Cr, with 5 multiplications? > > That is not lossless.What do you mean with losless? You can add values (beside the right scaling) to the color components to fit in every window you decide. You get every time losses in case of rounding errors. Btw the inverse transform from YUV to RGB needs only 4 multiplications. But i dont wanted to degrade your code, because a general way to do a 3x3 matrix transform with only 5 multiplications sounds very good to me. Jens
Reply by ●June 17, 20092009-06-17
I wrote,> I posted a comparison between YIQ and YCbCr at,I corrected an error and redid the comparison: http://groups.google.com/group/media-player/browse_thread/thread/4e0d4c83bba85be8
Reply by ●July 26, 20092009-07-26
> What do you mean with losless? > You can add values (beside the right scaling) to the color components > to fit in every window you decide. > You get every time losses in case of rounding errors.It is lossless because the rounding errors are reversed at reconstruction. This is the reconstruction algorithm for the above color transform that is similar to JPEG YCbCr: B -= round(-0.171 * R) R -= round(-0.167 * B) B -= round(-0.171 * R) G -= round(Kb * B + Kr * R) B += G R += G