请教个问题;
在6657中想用DSP_VLIB库中的VLIB_convertUYVYint_to_RGBpl函数,但是不知道该函数对应的公式,或者数据对应不对;
1. 例子代码给的参数为:
UYVY数据
static uint8_t staticRefIn[64] =
{
151, 57, 116, 170, 9, 247, 208, 140, 150, 60, 88, 77, 4, 6, 162, 6,
31, 143, 178, 3, 135, 91, 54, 154, 193, 161, 20, 162, 137, 150, 128, 224,
214, 113, 9, 28, 53, 211, 98, 217, 149, 233, 231, 127, 115, 203, 177, 42,
62, 155, 3, 103, 127, 16, 135, 131, 211, 158, 9, 2, 106, 227, 249, 255
};
参数:
static int16_t coeff[5] = { 0x2000, 0x2BDD, -0x0AC5, -0x1658, 0x3770 };
调用函数:
VLIB_convertUYVYint_to_RGBpl(staticRefIn, 16, 16, 2, coeff, staticRefOutR, staticRefOutG, staticRefOutB);
计算出的结果如下:
uint8_t staticRefOutR[32] =
{
24, 137, 255, 233, 0, 6, 36, 36, 195, 55, 0, 36, 0, 0, 134, 208,
0, 0, 153, 159, 255, 252, 254, 93, 0, 0, 9, 124, 0, 0, 255, 255
};
uint8_t staticRefOutG[32] =
{
41, 154, 215, 108, 64, 81, 7, 7, 124, 0, 124, 187, 198, 199, 130, 204,
151, 66, 241, 247, 138, 32, 157, 0, 248, 196, 0, 110, 197, 41, 133, 161
};
uint8_t staticRefOutB[32] =
{
80, 193, 24, 0, 82, 99, 0, 0, 0, 0, 87, 150, 255, 255, 149, 223, 245,
160, 65, 71, 253, 147, 164, 3, 24, 0, 0, 113, 255, 129, 172, 200
};
2. 但是用如下公式计算出来的结果相差很大
R= Y+ 1.402 *(V-128);
G= Y – 0.344* (U-128) – 0.714 *(V-128);
B= Y+ 1.772*(U-128);
用如下参数也不对
R= Y+ 1.3707 *(V-128);
G= Y – 0.336* (U-128) – 0.698001 *(V-128);
B= Y+ 1.732*(U-128);
Shine:
请参考附件YUV to RGB源码。VLIB_convertUYVYint_to_RGBpl_c.c