diff mbox series

[FFmpeg-devel,1/2] avutil/pixdesc: add alpha component information to pixfmts with reserved but undefined alpha bits

Message ID 20241017163137.34012-1-jamrial@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/2] avutil/pixdesc: add alpha component information to pixfmts with reserved but undefined alpha bits | expand

Commit Message

James Almer Oct. 17, 2024, 4:31 p.m. UTC
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>
---
 libavutil/pixdesc.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index d73c3f0d58..d231e7383c 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -2628,6 +2628,7 @@  static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
             { 0, 4, 2, 0, 8 },        /* Y */
             { 0, 4, 1, 0, 8 },        /* U */
             { 0, 4, 0, 0, 8 },        /* V */
+            { 0, 4, 3, 0, 8 },        /* X */
         },
     },
     [AV_PIX_FMT_RGBF16BE] = {
@@ -2715,6 +2716,7 @@  static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
             { 0, 4, 1, 2, 10 },       /* Y */
             { 0, 4, 0, 0, 10 },       /* U */
             { 0, 4, 2, 4, 10 },       /* V */
+            { 0, 4, 3, 6,  2 },       /* X */
         },
     },
     [AV_PIX_FMT_XV30BE] = {
@@ -2726,6 +2728,7 @@  static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
             { 0, 32, 10, 0, 10 },       /* Y */
             { 0, 32,  0, 0, 10 },       /* U */
             { 0, 32, 20, 0, 10 },       /* V */
+            { 0, 32, 30, 0,  2 },       /* X */
         },
         .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_BITSTREAM,
     },
@@ -2738,6 +2741,7 @@  static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
             { 0, 8, 2, 4, 12 },       /* Y */
             { 0, 8, 0, 4, 12 },       /* U */
             { 0, 8, 4, 4, 12 },       /* V */
+            { 0, 8, 6, 4, 12 },       /* X */
         },
     },
     [AV_PIX_FMT_XV36BE] = {
@@ -2749,6 +2753,7 @@  static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
             { 0, 8, 2, 4, 12 },       /* Y */
             { 0, 8, 0, 4, 12 },       /* U */
             { 0, 8, 4, 4, 12 },       /* V */
+            { 0, 8, 6, 4, 12 },       /* X */
         },
         .flags = AV_PIX_FMT_FLAG_BE,
     },
@@ -2761,6 +2766,7 @@  static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
             { 0, 4, 1, 4, 10 },       /* Y */
             { 0, 4, 0, 2, 10 },       /* U */
             { 0, 4, 2, 6, 10 },       /* V */
+            { 0, 4, 0, 0,  2 },       /* X */
         },
     },
     [AV_PIX_FMT_V30XBE] = {
@@ -2772,6 +2778,7 @@  static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
             { 0, 32, 12, 0, 10 },     /* Y */
             { 0, 32,  2, 0, 10 },     /* U */
             { 0, 32, 22, 0, 10 },     /* V */
+            { 0, 32,  0, 0,  2 },     /* X */
         },
         .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_BITSTREAM,
     },