diff options
author | wm4 <wm4@nowhere> | 2015-04-09 21:11:20 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-04-09 21:11:20 +0200 |
commit | be259be15c762abe4aa67dd0c932c389105cabd4 (patch) | |
tree | 2bb26986602a66d8d91c9227274fff7c183f027e /sub | |
parent | d737939f1f8cd2a3c53c6963c0af1cea029c454a (diff) | |
download | mpv-be259be15c762abe4aa67dd0c932c389105cabd4.tar.bz2 mpv-be259be15c762abe4aa67dd0c932c389105cabd4.tar.xz |
mp_image: get rid of chroma_width/height fields
They are redundant. They were used by draw_bmp.c only, and only in a
special code path that 1. used fixed image formats, and 2. had image
sized perfectly aligned to chroma boundaries (so computing the chroma
width/height is trivial).
Diffstat (limited to 'sub')
-rw-r--r-- | sub/draw_bmp.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sub/draw_bmp.c b/sub/draw_bmp.c index d9cb0522df..228d8a2dde 100644 --- a/sub/draw_bmp.c +++ b/sub/draw_bmp.c @@ -481,9 +481,9 @@ static struct mp_image *chroma_up(struct mp_draw_sub_cache *cache, int imgfmt, // The whole point is not having swscale copy the Y plane struct mp_image t_dst = *temp; mp_image_setfmt(&t_dst, IMGFMT_Y8); - mp_image_set_size(&t_dst, temp->chroma_width, temp->chroma_height); + mp_image_set_size(&t_dst, temp->w, temp->h); struct mp_image t_src = t_dst; - mp_image_set_size(&t_src, src->chroma_width, src->chroma_height); + mp_image_set_size(&t_src, src->w >> 1, src->h >> 1); for (int c = 0; c < 2; c++) { t_dst.planes[0] = temp->planes[1 + c]; t_dst.stride[0] = temp->stride[1 + c]; @@ -511,10 +511,9 @@ static void chroma_down(struct mp_image *old_src, struct mp_image *temp) assert(temp->planes[0] == old_src->planes[0]); struct mp_image t_dst = *temp; mp_image_setfmt(&t_dst, IMGFMT_Y8); - mp_image_set_size(&t_dst, old_src->chroma_width, - old_src->chroma_height); + mp_image_set_size(&t_dst, old_src->w >> 1, old_src->h >> 1); struct mp_image t_src = t_dst; - mp_image_set_size(&t_src, temp->chroma_width, temp->chroma_height); + mp_image_set_size(&t_src, temp->w, temp->h); for (int c = 0; c < 2; c++) { t_dst.planes[0] = old_src->planes[1 + c]; t_dst.stride[0] = old_src->stride[1 + c]; |