From caee8748da5c25b928f699bfa9f1ac4a5f3ae0ce Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 17 May 2020 14:57:13 +0200 Subject: video: clean up some imgfmt related stuff Remove the vaguely defined plane_bits and component_bits fields from struct mp_imgfmt_desc. Add weird replacements for existing uses. Remove the bytes[] field, replace uses with bpp[]. Fix some potential alignment issues in existing code. As a compromise, split mp_image_pixel_ptr() into 2 functions, because I think it's a bad idea to implicitly round, but for some callers being slightly less strict is convenient. This shouldn't really change anything. In fact, it's a 100% useless change. I'm just cleaning up what I started almost 8 years ago (see commit 00653a3eb052). With this I've decided to keep mp_imgfmt_desc, just removing the weird parts, and keeping the saner parts. --- sub/draw_bmp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sub') diff --git a/sub/draw_bmp.c b/sub/draw_bmp.c index b208ec6ad5..f7f8982051 100644 --- a/sub/draw_bmp.c +++ b/sub/draw_bmp.c @@ -138,10 +138,10 @@ static void blend_slice(struct mp_draw_sub_cache *p) int h = (1 << vid->fmt.chroma_ys) - (1 << ys) + 1; int cw = mp_chroma_div_up(vid->w, xs); for (int y = 0; y < h; y++) { - p->blend_line(mp_image_pixel_ptr(vid, plane, 0, y), - mp_image_pixel_ptr(ov, plane, 0, y), - xs || ys ? mp_image_pixel_ptr(ca, 0, 0, y) - : mp_image_pixel_ptr(ov, ov->num_planes - 1, 0, y), + p->blend_line(mp_image_pixel_ptr_ny(vid, plane, 0, y), + mp_image_pixel_ptr_ny(ov, plane, 0, y), + xs || ys ? mp_image_pixel_ptr_ny(ca, 0, 0, y) + : mp_image_pixel_ptr_ny(ov, ov->num_planes - 1, 0, y), cw); } } -- cgit v1.2.3