diff options
author | wm4 <wm4@nowhere> | 2015-01-06 16:49:53 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-01-06 16:51:06 +0100 |
commit | d42d60bc1e0a1c3b472b21d3cd203279879f7d95 (patch) | |
tree | 5e3cc92bc64309acae00dc67312b56cc5873822c /video/vdpau_mixer.c | |
parent | 5410a5b2c55b5c7d9889451c1d6e56c697325a2c (diff) | |
download | mpv-d42d60bc1e0a1c3b472b21d3cd203279879f7d95.tar.bz2 mpv-d42d60bc1e0a1c3b472b21d3cd203279879f7d95.tar.xz |
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.
Diffstat (limited to 'video/vdpau_mixer.c')
-rw-r--r-- | video/vdpau_mixer.c | 11 |
1 files changed, 8 insertions, 3 deletions
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"); |