我正在使用来自这个问题的公式:
uint8_t *rgbBuffer = malloc(imageWidth * imageHeight * 3);
// .. iterate over height and width
// from ITU-R BT.601, rounded to integers
rgbOutput[0] = (298 * (y - 16) + 409 * cr - 223) >> 8;
rgbOutput[1] = (298 * (y - 16) + 100 * cb + 208 * cr + 136) >> 8;
rgbOutput[2] = (298 * (y - 16) + 516 * cb - 277) >> 8;
我认为这是基于维基百科文章中的ITU-R_BT.601公式。
但我认为这个公式还不太对,因为输出的图像看起来像这样:
我该如何修复这个公式?
uint8_t *rgbBuffer = malloc(imageWidth * imageHeight * 3);
我会添加到问题中。 - Robert