aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorNayan Deshmukh <[email protected]>2016-06-08 14:52:48 +0530
committerChristian König <[email protected]>2016-06-09 14:23:07 +0200
commitf24eb5a17830b8137045a626dbd55e75ed5e708d (patch)
tree18b9b2d2c5ab3b25ea7181bc467cf4b6a3aa66b3 /src/gallium/state_trackers
parent037ce5d7343829a69ec9c7361a0964bc1366b019 (diff)
vl: Apply luma key filter before CSC conversion
Apply the luma key filter to the YCbCr values during the CSC conversion in video buffer shader. The initial values of max and min luma are set to opposite values to disable the filter initially and will be set when enabling it. Add extra parmeters min and max luma for the luma key filter in vl_compositor_set_csc_matrix in va, xvmc. Setting them to opposite value 1.f and 0.f respectively won't effect the CSC conversion v2: -Squash 1,2 and 3 into one patch to avoid breaking build of other components. (Christian) -use ureg_swizzle. (Christian) -change name of the variables. (Christian) v3: -Squash all patches in one to avoid breaking of build. (Emil) -wrap functions properly. (Emil) -use 0.0f and 1.0f instead of 0.f and 1.f respectively. (Emil) v4: -Divide it in two patches one which introduces the functionality and assigs dummy values to the changed functions and second which implements the lumakey filter. (Christian) -use ureg_scalar instead ureg_swizzle. (Christian) Signed-off-by: Nayan Deshmukh <[email protected]> Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/va/context.c2
-rw-r--r--src/gallium/state_trackers/vdpau/mixer.c4
-rw-r--r--src/gallium/state_trackers/vdpau/output.c4
-rw-r--r--src/gallium/state_trackers/xvmc/attributes.c2
-rw-r--r--src/gallium/state_trackers/xvmc/context.c2
5 files changed, 7 insertions, 7 deletions
diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c
index 51abd87cc4e..402fbb23497 100644
--- a/src/gallium/state_trackers/va/context.c
+++ b/src/gallium/state_trackers/va/context.c
@@ -159,7 +159,7 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx)
vl_compositor_init_state(&drv->cstate, drv->pipe);
vl_csc_get_matrix(VL_CSC_COLOR_STANDARD_BT_601, NULL, true, &drv->csc);
- vl_compositor_set_csc_matrix(&drv->cstate, (const vl_csc_matrix *)&drv->csc);
+ vl_compositor_set_csc_matrix(&drv->cstate, (const vl_csc_matrix *)&drv->csc, 1.0f, 0.0f);
pipe_mutex_init(drv->mutex);
ctx->pDriverData = (void *)drv;
diff --git a/src/gallium/state_trackers/vdpau/mixer.c b/src/gallium/state_trackers/vdpau/mixer.c
index dec79ff95e2..1070e96679f 100644
--- a/src/gallium/state_trackers/vdpau/mixer.c
+++ b/src/gallium/state_trackers/vdpau/mixer.c
@@ -69,7 +69,7 @@ vlVdpVideoMixerCreate(VdpDevice device,
vl_csc_get_matrix(VL_CSC_COLOR_STANDARD_BT_601, NULL, true, &vmixer->csc);
if (!debug_get_bool_option("G3DVL_NO_CSC", FALSE))
- vl_compositor_set_csc_matrix(&vmixer->cstate, (const vl_csc_matrix *)&vmixer->csc);
+ vl_compositor_set_csc_matrix(&vmixer->cstate, (const vl_csc_matrix *)&vmixer->csc, 1.0f, 0.0f);
*mixer = vlAddDataHTAB(vmixer);
if (*mixer == 0) {
@@ -671,7 +671,7 @@ vlVdpVideoMixerSetAttributeValues(VdpVideoMixer mixer,
else
memcpy(vmixer->csc, vdp_csc, sizeof(vl_csc_matrix));
if (!debug_get_bool_option("G3DVL_NO_CSC", FALSE))
- vl_compositor_set_csc_matrix(&vmixer->cstate, (const vl_csc_matrix *)&vmixer->csc);
+ vl_compositor_set_csc_matrix(&vmixer->cstate, (const vl_csc_matrix *)&vmixer->csc, 1.0f, 0.0f);
break;
case VDP_VIDEO_MIXER_ATTRIBUTE_NOISE_REDUCTION_LEVEL:
diff --git a/src/gallium/state_trackers/vdpau/output.c b/src/gallium/state_trackers/vdpau/output.c
index 2192f71544e..8a064e849b6 100644
--- a/src/gallium/state_trackers/vdpau/output.c
+++ b/src/gallium/state_trackers/vdpau/output.c
@@ -492,9 +492,9 @@ vlVdpOutputSurfacePutBitsYCbCr(VdpOutputSurface surface,
if (!csc_matrix) {
vl_csc_matrix csc;
vl_csc_get_matrix(VL_CSC_COLOR_STANDARD_BT_601, NULL, 1, &csc);
- vl_compositor_set_csc_matrix(cstate, (const vl_csc_matrix*)&csc);
+ vl_compositor_set_csc_matrix(cstate, (const vl_csc_matrix*)&csc, 1.0f, 0.0f);
} else {
- vl_compositor_set_csc_matrix(cstate, csc_matrix);
+ vl_compositor_set_csc_matrix(cstate, csc_matrix, 1.0f, 0.0f);
}
vl_compositor_clear_layers(cstate);
diff --git a/src/gallium/state_trackers/xvmc/attributes.c b/src/gallium/state_trackers/xvmc/attributes.c
index 2d8f00ba769..375705669b0 100644
--- a/src/gallium/state_trackers/xvmc/attributes.c
+++ b/src/gallium/state_trackers/xvmc/attributes.c
@@ -110,7 +110,7 @@ Status XvMCSetAttribute(Display *dpy, XvMCContext *context, Atom attribute, int
context_priv->color_standard,
&context_priv->procamp, true, &csc
);
- vl_compositor_set_csc_matrix(&context_priv->cstate, (const vl_csc_matrix *)&csc);
+ vl_compositor_set_csc_matrix(&context_priv->cstate, (const vl_csc_matrix *)&csc, 1.0f, 0.0f);
XVMC_MSG(XVMC_TRACE, "[XvMC] Set attribute %s to value %d.\n", attr, value);
diff --git a/src/gallium/state_trackers/xvmc/context.c b/src/gallium/state_trackers/xvmc/context.c
index a6991ab8d61..e9014c8bf53 100644
--- a/src/gallium/state_trackers/xvmc/context.c
+++ b/src/gallium/state_trackers/xvmc/context.c
@@ -293,7 +293,7 @@ Status XvMCCreateContext(Display *dpy, XvPortID port, int surface_type_id,
context_priv->color_standard,
&context_priv->procamp, true, &csc
);
- vl_compositor_set_csc_matrix(&context_priv->cstate, (const vl_csc_matrix *)&csc);
+ vl_compositor_set_csc_matrix(&context_priv->cstate, (const vl_csc_matrix *)&csc, 1.0f, 0.0f);
context_priv->vscreen = vscreen;
context_priv->pipe = pipe;