summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhao Yakui <yakui.zhao@intel.com>2013-11-22 13:39:34 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2013-12-03 12:09:38 +0800
commit1a6e3ece55509df544b7a5e4bb9ef05ecb4afed4 (patch)
tree654626ccb901a2cb79a8c1187cde21b1873a9ca9
parentef157465d77b8cb56fb8b1388e7bcf065b05b2ae (diff)
downloadlibva-intel-driver-1a6e3ece55509df544b7a5e4bb9ef05ecb4afed4.tar.gz
libva-intel-driver-1a6e3ece55509df544b7a5e4bb9ef05ecb4afed4.tar.bz2
libva-intel-driver-1a6e3ece55509df544b7a5e4bb9ef05ecb4afed4.zip
Support the smpte240m color standard for conversion from YUV to RGB
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> (cherry picked from commit 34627c96f331f7a344270c3d51b634f5f166073e)
-rw-r--r--src/i965_render.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/i965_render.c b/src/i965_render.c
index 5be8a96..92270cb 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -323,6 +323,12 @@ static float yuv_to_rgb_bt709[3][4] = {
{1.164, 2.112, 0, -0.50196,},
};
+static float yuv_to_rgb_smpte_240[3][4] = {
+{1.164, 0, 1.794, -0.06275,},
+{1.164, -0.258, -0.5425, -0.50196,},
+{1.164, 2.078, 0, -0.50196,},
+};
+
static void
i965_render_vs_unit(VADriverContextP ctx)
{
@@ -1119,6 +1125,8 @@ i965_render_upload_constants(VADriverContextP ctx,
yuv_to_rgb = (float *)constant_buffer + 8;
if (color_flag == VA_SRC_BT709)
memcpy(yuv_to_rgb, yuv_to_rgb_bt709, sizeof(yuv_to_rgb_bt709));
+ else if (color_flag == VA_SRC_SMPTE_240)
+ memcpy(yuv_to_rgb, yuv_to_rgb_smpte_240, sizeof(yuv_to_rgb_smpte_240));
else
memcpy(yuv_to_rgb, yuv_to_rgb_bt601, sizeof(yuv_to_rgb_bt601));