// Inverting the matrix gives us what we need to go from YCbCr back to RGB.
Matrix3d ycbcr_to_rgb = rgb_to_ycbcr.inverse();
// Inverting the matrix gives us what we need to go from YCbCr back to RGB.
Matrix3d ycbcr_to_rgb = rgb_to_ycbcr.inverse();
string frag_shader;
frag_shader = output_glsl_mat3("PREFIX(inv_ycbcr_matrix)", ycbcr_to_rgb);
frag_shader += output_glsl_vec3("PREFIX(offset)", offset[0], offset[1], offset[2]);
string frag_shader;
frag_shader = output_glsl_mat3("PREFIX(inv_ycbcr_matrix)", ycbcr_to_rgb);
frag_shader += output_glsl_vec3("PREFIX(offset)", offset[0], offset[1], offset[2]);
float cb_offset_x = compute_chroma_offset(
ycbcr_format.cb_x_position, ycbcr_format.chroma_subsampling_x, widths[1]);
float cb_offset_x = compute_chroma_offset(
ycbcr_format.cb_x_position, ycbcr_format.chroma_subsampling_x, widths[1]);