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. --- sub/draw_bmp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sub/draw_bmp.c') diff --git a/sub/draw_bmp.c b/sub/draw_bmp.c index 5e2ed41cd9..c5c0dddd29 100644 --- a/sub/draw_bmp.c +++ b/sub/draw_bmp.c @@ -294,11 +294,11 @@ static void draw_ass(struct mp_draw_sub_cache *cache, struct mp_rect bb, cspar.int_bits_in = bits; cspar.int_bits_out = 8; - float yuv2rgb[3][4], rgb2yuv[3][4]; + struct mp_cmat yuv2rgb, rgb2yuv; bool need_conv = temp->flags & MP_IMGFLAG_YUV; if (need_conv) { - mp_get_yuv2rgb_coeffs(&cspar, yuv2rgb); - mp_invert_yuv2rgb(rgb2yuv, yuv2rgb); + mp_get_yuv2rgb_coeffs(&cspar, &yuv2rgb); + mp_invert_yuv2rgb(&rgb2yuv, &yuv2rgb); } for (int i = 0; i < sbs->num_parts; ++i) { @@ -315,7 +315,7 @@ static void draw_ass(struct mp_draw_sub_cache *cache, struct mp_rect bb, int a = 255 - (sb->libass.color & 0xFF); int color_yuv[3] = {r, g, b}; if (need_conv) { - mp_map_int_color(rgb2yuv, bits, color_yuv); + mp_map_int_color(&rgb2yuv, bits, color_yuv); } else { color_yuv[0] = g; color_yuv[1] = b; -- cgit v1.2.3