summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorChristian König <[email protected]>2012-02-29 15:12:42 +0100
committerChristian König <[email protected]>2012-03-02 13:14:21 +0100
commit14766f820069ca987543918bce96410c481e5d20 (patch)
treefddc9d5ac54d9767c760cd6c93376c4dbc19c5b5 /src/gallium/state_trackers
parent74a4e9089488e7f341d21053bbf2d4aa52b99b70 (diff)
vl/csc: simplify matrix handling
A csc matrix is only 4x3 not 4x4, also define a VDPAU compatible type for it. Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/vdpau/mixer.c14
-rw-r--r--src/gallium/state_trackers/vdpau/vdpau_private.h8
-rw-r--r--src/gallium/state_trackers/xvmc/attributes.c6
-rw-r--r--src/gallium/state_trackers/xvmc/context.c6
4 files changed, 18 insertions, 16 deletions
diff --git a/src/gallium/state_trackers/vdpau/mixer.c b/src/gallium/state_trackers/vdpau/mixer.c
index 9a97501e456..d3b8946eb8e 100644
--- a/src/gallium/state_trackers/vdpau/mixer.c
+++ b/src/gallium/state_trackers/vdpau/mixer.c
@@ -64,9 +64,9 @@ vlVdpVideoMixerCreate(VdpDevice device,
vmixer->device = dev;
vl_compositor_init_state(&vmixer->cstate, dev->context);
- vl_csc_get_matrix(VL_CSC_COLOR_STANDARD_BT_601, NULL, true, vmixer->csc);
+ 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, vmixer->csc);
+ vl_compositor_set_csc_matrix(&vmixer->cstate, (const vl_csc_matrix *)&vmixer->csc);
*mixer = vlAddDataHTAB(vmixer);
if (*mixer == 0) {
@@ -553,11 +553,11 @@ vlVdpVideoMixerSetAttributeValues(VdpVideoMixer mixer,
vdp_csc = attribute_values[i];
vmixer->custom_csc = !!vdp_csc;
if (!vdp_csc)
- vl_csc_get_matrix(VL_CSC_COLOR_STANDARD_BT_601, NULL, 1, vmixer->csc);
+ vl_csc_get_matrix(VL_CSC_COLOR_STANDARD_BT_601, NULL, 1, &vmixer->csc);
else
- memcpy(vmixer->csc, vdp_csc, sizeof(float)*12);
+ 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, vmixer->csc);
+ vl_compositor_set_csc_matrix(&vmixer->cstate, (const vl_csc_matrix *)&vmixer->csc);
break;
case VDP_VIDEO_MIXER_ATTRIBUTE_NOISE_REDUCTION_LEVEL:
@@ -709,7 +709,6 @@ vlVdpGenerateCSCMatrix(VdpProcamp *procamp,
VdpColorStandard standard,
VdpCSCMatrix *csc_matrix)
{
- float matrix[16];
enum VL_CSC_COLOR_STANDARD vl_std;
struct vl_procamp camp;
@@ -729,7 +728,6 @@ vlVdpGenerateCSCMatrix(VdpProcamp *procamp,
camp.contrast = procamp->contrast;
camp.saturation = procamp->saturation;
camp.hue = procamp->hue;
- vl_csc_get_matrix(vl_std, &camp, 1, matrix);
- memcpy(csc_matrix, matrix, sizeof(float)*12);
+ vl_csc_get_matrix(vl_std, &camp, true, csc_matrix);
return VDP_STATUS_OK;
}
diff --git a/src/gallium/state_trackers/vdpau/vdpau_private.h b/src/gallium/state_trackers/vdpau/vdpau_private.h
index 1b617847d4a..1d776ab398e 100644
--- a/src/gallium/state_trackers/vdpau/vdpau_private.h
+++ b/src/gallium/state_trackers/vdpau/vdpau_private.h
@@ -38,7 +38,9 @@
#include "util/u_debug.h"
#include "util/u_rect.h"
+
#include "vl/vl_compositor.h"
+#include "vl/vl_csc.h"
#include "vl/vl_matrix_filter.h"
#include "vl/vl_median_filter.h"
@@ -322,9 +324,11 @@ typedef struct
unsigned video_width, video_height;
enum pipe_video_chroma_format chroma_format;
- unsigned max_layers, skip_chroma_deint, custom_csc;
+ unsigned max_layers, skip_chroma_deint;
float luma_key_min, luma_key_max;
- float csc[16];
+
+ bool custom_csc;
+ vl_csc_matrix csc;
} vlVdpVideoMixer;
typedef struct
diff --git a/src/gallium/state_trackers/xvmc/attributes.c b/src/gallium/state_trackers/xvmc/attributes.c
index da7b6493ba8..58bafb1343f 100644
--- a/src/gallium/state_trackers/xvmc/attributes.c
+++ b/src/gallium/state_trackers/xvmc/attributes.c
@@ -77,7 +77,7 @@ Status XvMCSetAttribute(Display *dpy, XvMCContext *context, Atom attribute, int
{
XvMCContextPrivate *context_priv;
const char *attr;
- float csc[16];
+ vl_csc_matrix csc;
assert(dpy);
@@ -108,9 +108,9 @@ Status XvMCSetAttribute(Display *dpy, XvMCContext *context, Atom attribute, int
vl_csc_get_matrix
(
context_priv->color_standard,
- &context_priv->procamp, true, csc
+ &context_priv->procamp, true, &csc
);
- vl_compositor_set_csc_matrix(&context_priv->cstate, csc);
+ vl_compositor_set_csc_matrix(&context_priv->cstate, (const vl_csc_matrix *)&csc);
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 c598cad7455..7b97a67d662 100644
--- a/src/gallium/state_trackers/xvmc/context.c
+++ b/src/gallium/state_trackers/xvmc/context.c
@@ -192,7 +192,7 @@ Status XvMCCreateContext(Display *dpy, XvPortID port, int surface_type_id,
struct vl_screen *vscreen;
struct pipe_context *pipe;
XvMCContextPrivate *context_priv;
- float csc[16];
+ vl_csc_matrix csc;
XVMC_MSG(XVMC_TRACE, "[XvMC] Creating context %p.\n", context);
@@ -289,9 +289,9 @@ Status XvMCCreateContext(Display *dpy, XvPortID port, int surface_type_id,
vl_csc_get_matrix
(
context_priv->color_standard,
- &context_priv->procamp, true, csc
+ &context_priv->procamp, true, &csc
);
- vl_compositor_set_csc_matrix(&context_priv->cstate, csc);
+ vl_compositor_set_csc_matrix(&context_priv->cstate, (const vl_csc_matrix *)&csc);
context_priv->vscreen = vscreen;
context_priv->pipe = pipe;