mirror of
https://github.com/mpv-player/mpv
synced 2025-02-17 04:58:06 +00:00
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).
This commit is contained in:
parent
d737939f1f
commit
be259be15c
@ -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
|
// The whole point is not having swscale copy the Y plane
|
||||||
struct mp_image t_dst = *temp;
|
struct mp_image t_dst = *temp;
|
||||||
mp_image_setfmt(&t_dst, IMGFMT_Y8);
|
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;
|
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++) {
|
for (int c = 0; c < 2; c++) {
|
||||||
t_dst.planes[0] = temp->planes[1 + c];
|
t_dst.planes[0] = temp->planes[1 + c];
|
||||||
t_dst.stride[0] = temp->stride[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]);
|
assert(temp->planes[0] == old_src->planes[0]);
|
||||||
struct mp_image t_dst = *temp;
|
struct mp_image t_dst = *temp;
|
||||||
mp_image_setfmt(&t_dst, IMGFMT_Y8);
|
mp_image_setfmt(&t_dst, IMGFMT_Y8);
|
||||||
mp_image_set_size(&t_dst, old_src->chroma_width,
|
mp_image_set_size(&t_dst, old_src->w >> 1, old_src->h >> 1);
|
||||||
old_src->chroma_height);
|
|
||||||
struct mp_image t_src = t_dst;
|
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++) {
|
for (int c = 0; c < 2; c++) {
|
||||||
t_dst.planes[0] = old_src->planes[1 + c];
|
t_dst.planes[0] = old_src->planes[1 + c];
|
||||||
t_dst.stride[0] = old_src->stride[1 + c];
|
t_dst.stride[0] = old_src->stride[1 + c];
|
||||||
|
@ -96,8 +96,6 @@ typedef struct mp_image {
|
|||||||
int fields;
|
int fields;
|
||||||
|
|
||||||
/* redundant */
|
/* redundant */
|
||||||
int chroma_width;
|
|
||||||
int chroma_height;
|
|
||||||
int plane_w[MP_MAX_PLANES];
|
int plane_w[MP_MAX_PLANES];
|
||||||
int plane_h[MP_MAX_PLANES];
|
int plane_h[MP_MAX_PLANES];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user