提交 81a61ccf 编写于 作者: Z ZhaoPengyuan

gralloc:rgb_to_yv12

find u/v index error in rgb_to_yv12
上级 7e15d287
......@@ -96,8 +96,8 @@ void rgb565_to_yv12(char *dest, char *src, int width, int height, int left, int
yv12_y[i] = clamp_rgb((77 * R + 150 * G + 29 * B) >> 8);
bool ieven = (i & 1) == 0;
if (jeven && ieven) {
yv12_u[i] = clamp_rgb(((-43 * R - 85 * G + 128 * B) >> 8) + 128);
yv12_v[i] = clamp_rgb(((128 * R - 107 * G - 21 * B) >> 8) + 128);
yv12_u[i/2] = clamp_rgb(((-43 * R - 85 * G + 128 * B) >> 8) + 128);
yv12_v[i/2] = clamp_rgb(((128 * R - 107 * G - 21 * B) >> 8) + 128);
}
}
}
......@@ -132,8 +132,8 @@ void rgb888_to_yv12(char *dest, char *src, int width, int height, int left, int
yv12_y[i] = clamp_rgb((77 * R + 150 * G + 29 * B) >> 8);
bool ieven = (i & 1) == 0;
if (jeven && ieven) {
yv12_u[i] = clamp_rgb(((-43 * R - 85 * G + 128 * B) >> 8) + 128);
yv12_v[i] = clamp_rgb(((128 * R - 107 * G - 21 * B) >> 8) + 128);
yv12_u[i/2] = clamp_rgb(((-43 * R - 85 * G + 128 * B) >> 8) + 128);
yv12_v[i/2] = clamp_rgb(((128 * R - 107 * G - 21 * B) >> 8) + 128);
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册