mirror of
https://github.com/mpv-player/mpv
synced 2025-02-16 04:07:08 +00:00
img_format: change meaning of MP_IMGFLAG_PLANAR
This used to mean that there is more than one plane. This is not very useful: IMGFMT_Y8 was not considered planar, but it's just a Y plane, and could be treated the same as actual planar formats. On the other hand, IMGFMT_NV12 is partially packed, and usually requires special handling, but was considered planar. Change its meaning. Now the flag is set if the format has a separate plane for each component. IMGFMT_Y8 is now planar, IMGFMT_NV12 is not. As an odd special case, IMGFMT_MONO (1 bit per pixel) is like a planar RGB format with a single plane.
This commit is contained in:
parent
4b8122faa7
commit
4950513ffe
@ -186,7 +186,7 @@ static struct mp_imgfmt_desc get_avutil_fmt(enum PixelFormat fmt)
|
||||
desc.flags |= MP_IMGFLAG_ALPHA;
|
||||
#endif
|
||||
|
||||
if (desc.num_planes > 1)
|
||||
if (desc.num_planes == pd->nb_components)
|
||||
desc.flags |= MP_IMGFLAG_PLANAR;
|
||||
|
||||
if (desc.flags & MP_IMGFLAG_YUV) {
|
||||
|
@ -35,7 +35,7 @@
|
||||
#define MP_IMGFLAG_BYTE_ALIGNED 0x1
|
||||
// set if (possibly) alpha is included (might be not definitive for packed RGB)
|
||||
#define MP_IMGFLAG_ALPHA 0x80
|
||||
// set if number of planes > 1
|
||||
// Uses one component per plane (set even if it's just one plane)
|
||||
#define MP_IMGFLAG_PLANAR 0x100
|
||||
// set if it's YUV colorspace
|
||||
#define MP_IMGFLAG_YUV 0x200
|
||||
|
Loading…
Reference in New Issue
Block a user