From d42d60bc1e0a1c3b472b21d3cd203279879f7d95 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 6 Jan 2015 16:49:53 +0100 Subject: csputils: replace float[3][4] with a struct Not being able to use the 3x3 part of the matrix was annoying, so split it into a float[3][3] matrix and a separate float[3] constant vector. --- video/vdpau_mixer.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'video/vdpau_mixer.c') diff --git a/video/vdpau_mixer.c b/video/vdpau_mixer.c index 182e1fd40a..d3a4a02457 100644 --- a/video/vdpau_mixer.c +++ b/video/vdpau_mixer.c @@ -192,14 +192,19 @@ static int create_vdp_mixer(struct mp_vdpau_mixer *mixer) if (!opts->chroma_deint) SET_VIDEO_ATTR(SKIP_CHROMA_DEINTERLACE, uint8_t, 1); - // VdpCSCMatrix happens to be compatible with mpv's CSC matrix type - // both are float[3][4] + struct mp_cmat yuv2rgb; VdpCSCMatrix matrix; struct mp_csp_params cparams = MP_CSP_PARAMS_DEFAULTS; mp_csp_set_image_params(&cparams, &mixer->image_params); mp_csp_copy_equalizer_values(&cparams, &mixer->video_eq); - mp_get_yuv2rgb_coeffs(&cparams, matrix); + mp_get_yuv2rgb_coeffs(&cparams, &yuv2rgb); + + for (int r = 0; r < 3; r++) { + for (int c = 0; c < 3; c++) + matrix[r][c] = yuv2rgb.m[r][c]; + matrix[r][3] = yuv2rgb.c[r]; + } set_video_attribute(mixer, VDP_VIDEO_MIXER_ATTRIBUTE_CSC_MATRIX, &matrix, "CSC matrix"); -- cgit v1.2.3