Improve colors for nv12

This commit is contained in:
loki
2021-05-08 12:03:58 +02:00
parent 67df04e0a2
commit 513942c888
3 changed files with 40 additions and 12 deletions
+6 -1
View File
@@ -10,6 +10,8 @@ cbuffer ColorMatrix : register(b0) {
float4 color_vec_y;
float4 color_vec_u;
float4 color_vec_v;
float2 range_y;
float2 range_uv;
};
//--------------------------------------------------------------------------------------
@@ -24,5 +26,8 @@ float2 main_ps(FragTexWide input) : SV_Target
float u = dot(color_vec_u.xyz, rgb) + color_vec_u.w;
float v = dot(color_vec_v.xyz, rgb) + color_vec_v.w;
return float2(u, v);
u = u * range_uv.x + range_uv.y;
v = v * range_uv.x + range_uv.y;
return float2(u, v * 224.0f/256.0f + 0.0625);
}