diff options
author | wm4 <wm4@nowhere> | 2019-11-03 23:18:35 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-11-03 23:18:35 +0100 |
commit | 98352362ea17075400818e9439f9740c4c19bbbc (patch) | |
tree | 578497dfdeb529a1e40c59ff726aa6d2dff74c7d /video/img_format.c | |
parent | cfd659538688916ac79df072a56d65d327c69470 (diff) | |
download | mpv-98352362ea17075400818e9439f9740c4c19bbbc.tar.bz2 mpv-98352362ea17075400818e9439f9740c4c19bbbc.tar.xz |
img_format: remove some unused format flags
They were used at some point, but then fell into disuse. In general,
these old flags are all a bit fuzzy, so it's a good idea to remove them
as much as possible.
The comment about MP_IMGFLAG_PAL isn't true anymore. The old meaning was
deprecated at some point, and the flag was removed from "pseudo
paletted" formats. I think mpv at one point changed its own flag from
AV_PIX_FMT_FLAG_PSEUDOPAL to AV_PIX_FMT_FLAG_PAL, when the former was
deprecated, and it became unnecessary to allocate a palette for
non-paletted formats. (The one who deprecated in FFmpeg was me, if you
wonder.)
MP_IMGFLAG_PLANAR was used in command.c, use a relatively similar flag
as replacement.
Diffstat (limited to 'video/img_format.c')
-rw-r--r-- | video/img_format.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/video/img_format.c b/video/img_format.c index 80838a82a2..ace8159ecf 100644 --- a/video/img_format.c +++ b/video/img_format.c @@ -199,7 +199,7 @@ struct mp_imgfmt_desc mp_imgfmt_get_desc(int mpfmt) if ((pd->flags & AV_PIX_FMT_FLAG_HWACCEL)) { desc.flags |= MP_IMGFLAG_HWACCEL; } else if (fmt == AV_PIX_FMT_XYZ12LE || fmt == AV_PIX_FMT_XYZ12BE) { - desc.flags |= MP_IMGFLAG_XYZ; + /* nothing */ } else if (!(pd->flags & AV_PIX_FMT_FLAG_RGB) && fmt != AV_PIX_FMT_MONOBLACK && fmt != AV_PIX_FMT_PAL8) @@ -215,9 +215,6 @@ struct mp_imgfmt_desc mp_imgfmt_get_desc(int mpfmt) if (mpfmt >= IMGFMT_RGB0_START && mpfmt <= IMGFMT_RGB0_END) desc.flags &= ~MP_IMGFLAG_ALPHA; - if (desc.num_planes == pd->nb_components) - desc.flags |= MP_IMGFLAG_PLANAR; - if (!(pd->flags & AV_PIX_FMT_FLAG_HWACCEL) && !(pd->flags & AV_PIX_FMT_FLAG_BITSTREAM)) { @@ -254,8 +251,6 @@ struct mp_imgfmt_desc mp_imgfmt_get_desc(int mpfmt) { desc.flags |= MP_IMGFLAG_YUV_NV; - if (fmt == AV_PIX_FMT_NV21) - desc.flags |= MP_IMGFLAG_YUV_NV_SWAP; } if (desc.flags & (MP_IMGFLAG_YUV_P | MP_IMGFLAG_RGB_P | MP_IMGFLAG_YUV_NV)) desc.component_bits += shift; @@ -564,13 +559,10 @@ int main(int argc, char **argv) #define FLAG(t, c) if (d.flags & (t)) printf("[%s]", c); FLAG(MP_IMGFLAG_BYTE_ALIGNED, "BA") FLAG(MP_IMGFLAG_ALPHA, "a") - FLAG(MP_IMGFLAG_PLANAR, "P") FLAG(MP_IMGFLAG_YUV_P, "YUVP") FLAG(MP_IMGFLAG_YUV_NV, "NV") - FLAG(MP_IMGFLAG_YUV_NV_SWAP, "NVSWAP") FLAG(MP_IMGFLAG_YUV, "yuv") FLAG(MP_IMGFLAG_RGB, "rgb") - FLAG(MP_IMGFLAG_XYZ, "xyz") FLAG(MP_IMGFLAG_LE, "le") FLAG(MP_IMGFLAG_BE, "be") FLAG(MP_IMGFLAG_PAL, "pal") |