The following calculation is used for the conversion:
- r = clipz((y-oy)*cy + crv*(v-128))
- g = clipz((y-oy)*cy + cgv*(v-128) + cgu*(u-128))
- b = clipz((y-oy)*cy + cbu*(u-128))
+ r = clipz((y - oy) * cy + crv * (v - 128))
+ g = clipz((y - oy) * cy + cgv * (v - 128) + cgu * (u - 128))
+ b = clipz((y - oy) * cy + cbu * (u - 128))
-y,u,v are prescaled by a factor of 4 i.e. left-shifted to gain precision.
+y, u, v are prescaled by a factor of 4 i.e. left-shifted to gain precision.
New factorization to eliminate the truncation error which was
2) Scale operands up by a factor of 4 not 8 because Blackfin
multiplies include a shift.
-3) Compute into the accumulators cy*yx0, cy*yx1.
+3) Compute into the accumulators cy * yx0, cy * yx1.
4) Compute each of the linear equations:
r = clipz((y - oy) * cy + crv * (v - 128))
Where coeffs have the following layout in memory.
-uint32_t oy,oc,zero,cy,crv,rmask,cbu,bmask,cgu,cgv;
+uint32_t oy, oc, zero, cy, crv, rmask, cbu, bmask, cgu, cgv;
coeffs is a pointer to oy.