avutil/pixdesc: add alpha component information to pixfmts with reserved but undefined alpha bits

This can be useful to simplify certain processes that need to know how many
reserved bits there are and where they are placed, even if they are ultimately
unused, as will be shown in the next commit.
For any other case where the user simply looks at nb_components components, it
will make no difference.

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer
2024-10-17 13:29:02 -03:00
parent 72f8f76d45
commit 8f1de9ccd9
2 changed files with 18 additions and 4 deletions

View File

@@ -58,8 +58,7 @@ static void check_pixfmt_descriptors(void)
for (int j = 0; j < FF_ARRAY_ELEMS(d->comp); j++) {
const AVComponentDescriptor *c = &d->comp[j];
if (j >= d->nb_components) {
av_assert0(!c->plane && !c->step && !c->offset && !c->shift && !c->depth);
if (!c->depth) {
continue;
}
if (d->flags & AV_PIX_FMT_FLAG_BITSTREAM) {