avutil/pixdesc: add AV_PIX_FMT_FLAG_XYZ

There are already several places in the codebase that match desc->name
against "xyz", and many downstream clients replicate this behavior.
I have no idea why this is not just a flag.

Motivated by my desire to add yet another check for XYZ to the codebase,
and I'd rather not keep copy/pasting a string comparison hack.
This commit is contained in:
Niklas Haas
2023-10-31 15:46:07 +01:00
parent 96dfc4481b
commit 57c16323f2
4 changed files with 12 additions and 4 deletions

View File

@ -1977,8 +1977,8 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{ 0, 6, 0, 4, 12 }, /* X */
{ 0, 6, 2, 4, 12 }, /* Y */
{ 0, 6, 4, 4, 12 }, /* Z */
},
/*.flags = -- not used*/
},
.flags = AV_PIX_FMT_FLAG_XYZ,
},
[AV_PIX_FMT_XYZ12BE] = {
.name = "xyz12be",
@ -1990,7 +1990,7 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
{ 0, 6, 2, 4, 12 }, /* Y */
{ 0, 6, 4, 4, 12 }, /* Z */
},
.flags = AV_PIX_FMT_FLAG_BE,
.flags = AV_PIX_FMT_FLAG_XYZ | AV_PIX_FMT_FLAG_BE,
},
#define BAYER8_DESC_COMMON \