summaryrefslogtreecommitdiffstats
path: root/sub/draw_bmp.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-06 16:49:53 +0100
committerwm4 <wm4@nowhere>2015-01-06 16:51:06 +0100
commitd42d60bc1e0a1c3b472b21d3cd203279879f7d95 (patch)
tree5e3cc92bc64309acae00dc67312b56cc5873822c /sub/draw_bmp.c
parent5410a5b2c55b5c7d9889451c1d6e56c697325a2c (diff)
downloadmpv-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 'sub/draw_bmp.c')
-rw-r--r--sub/draw_bmp.c8
1 files changed, 4 insertions, 4 deletions
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;