From eb27baf5ec17d15b96db6db93c400a14b07214be Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 20 May 2020 18:36:39 +0200 Subject: video: remove useless mp_imgfmt_desc.avformat field Had 1 user; easily replaced. --- video/img_format.c | 3 --- video/img_format.h | 1 - video/sws_utils.c | 3 ++- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/video/img_format.c b/video/img_format.c index 02aef4c272..592835fd9f 100644 --- a/video/img_format.c +++ b/video/img_format.c @@ -41,7 +41,6 @@ struct mp_imgfmt_entry { // - sets MP_IMGFLAG_HAS_COMPS|MP_IMGFLAG_NE if num_planes>0 // - sets MP_IMGFLAG_TYPE_UINT if no other type set // - sets id to mp_imgfmt_list[] implied format - // - sets avformat to AV_PIX_FMT_NONE struct mp_imgfmt_desc desc; }; @@ -395,7 +394,6 @@ static bool mp_imgfmt_get_desc_from_pixdesc(int mpfmt, struct mp_imgfmt_desc *ou struct mp_imgfmt_desc desc = { .id = mpfmt, - .avformat = fmt, .chroma_xs = pd->log2_chroma_w, .chroma_ys = pd->log2_chroma_h, }; @@ -507,7 +505,6 @@ static bool get_native_desc(int mpfmt, struct mp_imgfmt_desc *desc) // Fill in some fields mp_imgfmt_entry.desc is not required to set. desc->id = mpfmt; - desc->avformat = AV_PIX_FMT_NONE; for (int n = 0; n < MP_NUM_COMPONENTS; n++) { struct mp_imgfmt_comp_desc *cd = &desc->comps[n]; diff --git a/video/img_format.h b/video/img_format.h index 6b5420205f..96ac78f66e 100644 --- a/video/img_format.h +++ b/video/img_format.h @@ -118,7 +118,6 @@ struct mp_imgfmt_comp_desc { struct mp_imgfmt_desc { int id; // IMGFMT_* - int avformat; // AV_PIX_FMT_* (or AV_PIX_FMT_NONE) int flags; // MP_IMGFLAG_* bitfield int8_t num_planes; int8_t chroma_xs, chroma_ys; // chroma shift (i.e. log2 of chroma pixel size) diff --git a/video/sws_utils.c b/video/sws_utils.c index 800e4f34b3..ce07cdd132 100644 --- a/video/sws_utils.c +++ b/video/sws_utils.c @@ -393,9 +393,10 @@ static const int endian_swaps[][2] = { // might reduce the effective bit depth in some cases. struct mp_image *mp_img_swap_to_native(struct mp_image *img) { + int avfmt = imgfmt2pixfmt(img->imgfmt); int to = AV_PIX_FMT_NONE; for (int n = 0; endian_swaps[n][0] != AV_PIX_FMT_NONE; n++) { - if (endian_swaps[n][0] == img->fmt.avformat) + if (endian_swaps[n][0] == avfmt) to = endian_swaps[n][1]; } if (to == AV_PIX_FMT_NONE || !mp_image_make_writeable(img)) -- cgit v1.2.3