+
+ rgb_to_yuv_matrix[0] = r_to_y;
+ rgb_to_yuv_matrix[1] = g_to_y;
+ rgb_to_yuv_matrix[2] = b_to_y;
+ rgb_to_yuv_matrix[3] = r_to_u;
+ rgb_to_yuv_matrix[4] = g_to_u;
+ rgb_to_yuv_matrix[5] = b_to_u;
+ rgb_to_yuv_matrix[6] = r_to_v;
+ rgb_to_yuv_matrix[7] = g_to_v;
+ rgb_to_yuv_matrix[8] = b_to_v;
+
+ float yscale = 1.f / yrangef;
+ yuv_to_rgb_matrix[0] = yscale;
+ yuv_to_rgb_matrix[1] = 0;
+ yuv_to_rgb_matrix[2] = v_to_r;
+ yuv_to_rgb_matrix[3] = yscale;
+ yuv_to_rgb_matrix[4] = u_to_g;
+ yuv_to_rgb_matrix[5] = v_to_g;
+ yuv_to_rgb_matrix[6] = yscale;
+ yuv_to_rgb_matrix[7] = u_to_b;
+ yuv_to_rgb_matrix[8] = 0;