summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/vdpau
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/vdpau
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/vdpau')
-rw-r--r--src/gallium/state_trackers/vdpau/mixer.c14
-rw-r--r--src/gallium/state_trackers/vdpau/vdpau_private.h8
2 files changed, 12 insertions, 10 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