[FFmpeg-cvslog] pixdesc: put components always in the same order.

Nicolas George git at videolan.org
Wed Mar 21 19:36:40 CET 2012


ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Sun Mar 18 09:57:02 2012 +0100| [38c3b68e3ab0835ae63faf28eac41ab1d8e9aafd] | committer: Nicolas George

pixdesc: put components always in the same order.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=38c3b68e3ab0835ae63faf28eac41ab1d8e9aafd
---

 libavutil/avutil.h  |    2 +-
 libavutil/pixdesc.c |   94 +++++++++++++++++++++++++-------------------------
 libavutil/pixdesc.h |    9 +++--
 3 files changed, 54 insertions(+), 51 deletions(-)

diff --git a/libavutil/avutil.h b/libavutil/avutil.h
index db3bc5c..3bb33ed 100644
--- a/libavutil/avutil.h
+++ b/libavutil/avutil.h
@@ -153,7 +153,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR 51
-#define LIBAVUTIL_VERSION_MINOR 43
+#define LIBAVUTIL_VERSION_MINOR 44
 #define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 668d822..233b217 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -158,9 +158,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w = 0,
         .log2_chroma_h = 0,
         .comp = {
-            { 0, 2, 1, 0, 7 },        /* B */
-            { 0, 2, 2, 0, 7 },        /* G */
             { 0, 2, 3, 0, 7 },        /* R */
+            { 0, 2, 2, 0, 7 },        /* G */
+            { 0, 2, 1, 0, 7 },        /* B */
         },
         .flags = PIX_FMT_RGB,
     },
@@ -323,9 +323,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w = 0,
         .log2_chroma_h = 0,
         .comp = {
-            { 0, 0, 1, 6, 1 },        /* B */
-            { 0, 0, 1, 3, 2 },        /* G */
             { 0, 0, 1, 0, 2 },        /* R */
+            { 0, 0, 1, 3, 2 },        /* G */
+            { 0, 0, 1, 6, 1 },        /* B */
         },
         .flags = PIX_FMT_RGB | PIX_FMT_PSEUDOPAL,
     },
@@ -335,9 +335,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w = 0,
         .log2_chroma_h = 0,
         .comp = {
-            { 0, 3, 1, 0, 0 },        /* B */
-            { 0, 3, 2, 0, 1 },        /* G */
             { 0, 3, 4, 0, 0 },        /* R */
+            { 0, 3, 2, 0, 1 },        /* G */
+            { 0, 3, 1, 0, 0 },        /* B */
         },
         .flags = PIX_FMT_BITSTREAM | PIX_FMT_RGB,
     },
@@ -347,9 +347,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w = 0,
         .log2_chroma_h = 0,
         .comp = {
-            { 0, 0, 1, 3, 0 },        /* B */
-            { 0, 0, 1, 1, 1 },        /* G */
             { 0, 0, 1, 0, 0 },        /* R */
+            { 0, 0, 1, 1, 1 },        /* G */
+            { 0, 0, 1, 3, 0 },        /* B */
         },
         .flags = PIX_FMT_RGB | PIX_FMT_PSEUDOPAL,
     },
@@ -408,8 +408,8 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_h = 1,
         .comp = {
             { 0, 0, 1, 0, 7 },        /* Y */
-            { 1, 1, 1, 0, 7 },        /* V */
             { 1, 1, 2, 0, 7 },        /* U */
+            { 1, 1, 1, 0, 7 },        /* V */
         },
         .flags = PIX_FMT_PLANAR,
     },
@@ -419,10 +419,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w = 0,
         .log2_chroma_h = 0,
         .comp = {
-            { 0, 3, 1, 0, 7 },        /* A */
             { 0, 3, 2, 0, 7 },        /* R */
             { 0, 3, 3, 0, 7 },        /* G */
             { 0, 3, 4, 0, 7 },        /* B */
+            { 0, 3, 1, 0, 7 },        /* A */
         },
         .flags = PIX_FMT_RGB,
     },
@@ -445,10 +445,10 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w = 0,
         .log2_chroma_h = 0,
         .comp = {
-            { 0, 3, 1, 0, 7 },        /* A */
-            { 0, 3, 2, 0, 7 },        /* B */
-            { 0, 3, 3, 0, 7 },        /* G */
             { 0, 3, 4, 0, 7 },        /* R */
+            { 0, 3, 3, 0, 7 },        /* G */
+            { 0, 3, 2, 0, 7 },        /* B */
+            { 0, 3, 1, 0, 7 },        /* A */
         },
         .flags = PIX_FMT_RGB,
     },
@@ -458,9 +458,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w = 0,
         .log2_chroma_h = 0,
         .comp = {
-            { 0, 3, 1, 0, 7 },        /* B */
-            { 0, 3, 2, 0, 7 },        /* G */
             { 0, 3, 3, 0, 7 },        /* R */
+            { 0, 3, 2, 0, 7 },        /* G */
+            { 0, 3, 1, 0, 7 },        /* B */
             { 0, 3, 4, 0, 7 },        /* A */
         },
         .flags = PIX_FMT_RGB,
@@ -496,9 +496,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w= 0,
         .log2_chroma_h= 0,
         .comp = {
-            { 0, 3, 2, 0, 7 },        /* B */
-            { 0, 3, 3, 0, 7 },        /* G */
             { 0, 3, 4, 0, 7 },        /* R */
+            { 0, 3, 3, 0, 7 },        /* G */
+            { 0, 3, 2, 0, 7 },        /* B */
         },
         .flags = PIX_FMT_RGB,
     },
@@ -508,9 +508,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w= 0,
         .log2_chroma_h= 0,
         .comp = {
-            { 0, 3, 1, 0, 7 },        /* B */
-            { 0, 3, 2, 0, 7 },        /* G */
             { 0, 3, 3, 0, 7 },        /* R */
+            { 0, 3, 2, 0, 7 },        /* G */
+            { 0, 3, 1, 0, 7 },        /* B */
             { 0, 3, 4, 0, 7 },        /* A */
         },
         .flags = PIX_FMT_RGB,
@@ -666,7 +666,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
             { 0, 7, 1, 0, 15 },       /* R */
             { 0, 7, 3, 0, 15 },       /* G */
             { 0, 7, 5, 0, 15 },       /* B */
-            { 0, 7, 7, 0, 15 },       /* B */
+            { 0, 7, 7, 0, 15 },       /* A */
         },
         .flags = PIX_FMT_RGB,
     },
@@ -748,9 +748,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w = 0,
         .log2_chroma_h = 0,
         .comp = {
-            { 0, 5, 1, 0, 15 },       /* B */
-            { 0, 5, 3, 0, 15 },       /* G */
             { 0, 5, 5, 0, 15 },       /* R */
+            { 0, 5, 3, 0, 15 },       /* G */
+            { 0, 5, 1, 0, 15 },       /* B */
         },
         .flags = PIX_FMT_BE | PIX_FMT_RGB,
     },
@@ -760,9 +760,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w = 0,
         .log2_chroma_h = 0,
         .comp = {
-            { 0, 5, 1, 0, 15 },       /* B */
-            { 0, 5, 3, 0, 15 },       /* G */
             { 0, 5, 5, 0, 15 },       /* R */
+            { 0, 5, 3, 0, 15 },       /* G */
+            { 0, 5, 1, 0, 15 },       /* B */
         },
         .flags = PIX_FMT_RGB,
     },
@@ -772,9 +772,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w= 0,
         .log2_chroma_h= 0,
         .comp = {
-            { 0, 7, 1, 0, 15 },       /* B */
-            { 0, 7, 3, 0, 15 },       /* G */
             { 0, 7, 5, 0, 15 },       /* R */
+            { 0, 7, 3, 0, 15 },       /* G */
+            { 0, 7, 1, 0, 15 },       /* B */
             { 0, 7, 7, 0, 15 },       /* A */
         },
         .flags = PIX_FMT_BE,
@@ -785,9 +785,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w= 0,
         .log2_chroma_h= 0,
         .comp = {
-            { 0, 7, 1, 0, 15 },       /* B */
-            { 0, 7, 3, 0, 15 },       /* G */
             { 0, 7, 5, 0, 15 },       /* R */
+            { 0, 7, 3, 0, 15 },       /* G */
+            { 0, 7, 1, 0, 15 },       /* B */
             { 0, 7, 7, 0, 15 },       /* A */
         },
     },
@@ -797,9 +797,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w = 0,
         .log2_chroma_h = 0,
         .comp = {
-            { 0, 1, 0, 3, 4 },        /* B */
-            { 0, 1, 1, 5, 5 },        /* G */
             { 0, 1, 1, 0, 4 },        /* R */
+            { 0, 1, 1, 5, 5 },        /* G */
+            { 0, 1, 0, 3, 4 },        /* B */
         },
         .flags = PIX_FMT_BE | PIX_FMT_RGB,
     },
@@ -809,9 +809,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w = 0,
         .log2_chroma_h = 0,
         .comp = {
-            { 0, 1, 2, 3, 4 },        /* B */
-            { 0, 1, 1, 5, 5 },        /* G */
             { 0, 1, 1, 0, 4 },        /* R */
+            { 0, 1, 1, 5, 5 },        /* G */
+            { 0, 1, 2, 3, 4 },        /* B */
         },
         .flags = PIX_FMT_RGB,
     },
@@ -821,9 +821,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w = 0,
         .log2_chroma_h = 0,
         .comp = {
-            { 0, 1, 0, 2, 4 },       /* B */
-            { 0, 1, 1, 5, 4 },       /* G */
             { 0, 1, 1, 0, 4 },       /* R */
+            { 0, 1, 1, 5, 4 },       /* G */
+            { 0, 1, 0, 2, 4 },       /* B */
         },
         .flags = PIX_FMT_BE | PIX_FMT_RGB,
      },
@@ -833,9 +833,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w = 0,
         .log2_chroma_h = 0,
         .comp = {
-            { 0, 1, 2, 2, 4 },        /* B */
-            { 0, 1, 1, 5, 4 },        /* G */
             { 0, 1, 1, 0, 4 },        /* R */
+            { 0, 1, 1, 5, 4 },        /* G */
+            { 0, 1, 2, 2, 4 },        /* B */
         },
         .flags = PIX_FMT_RGB,
     },
@@ -845,9 +845,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w = 0,
         .log2_chroma_h = 0,
         .comp = {
-            { 0, 1, 0, 0, 3 },       /* B */
-            { 0, 1, 1, 4, 3 },       /* G */
             { 0, 1, 1, 0, 3 },       /* R */
+            { 0, 1, 1, 4, 3 },       /* G */
+            { 0, 1, 0, 0, 3 },       /* B */
         },
         .flags = PIX_FMT_BE | PIX_FMT_RGB,
      },
@@ -857,9 +857,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w = 0,
         .log2_chroma_h = 0,
         .comp = {
-            { 0, 1, 2, 0, 3 },        /* B */
-            { 0, 1, 1, 4, 3 },        /* G */
             { 0, 1, 1, 0, 3 },        /* R */
+            { 0, 1, 1, 4, 3 },        /* G */
+            { 0, 1, 2, 0, 3 },        /* B */
         },
         .flags = PIX_FMT_RGB,
     },
@@ -1123,9 +1123,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w = 0,
         .log2_chroma_h = 0,
         .comp = {
+            { 2, 0, 1, 0, 7 },        /* R */
             { 0, 0, 1, 0, 7 },        /* G */
             { 1, 0, 1, 0, 7 },        /* B */
-            { 2, 0, 1, 0, 7 },        /* R */
         },
         .flags = PIX_FMT_PLANAR | PIX_FMT_RGB,
     },
@@ -1135,9 +1135,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w = 0,
         .log2_chroma_h = 0,
         .comp = {
+            { 2, 1, 1, 0, 8 },        /* R */
             { 0, 1, 1, 0, 8 },        /* G */
             { 1, 1, 1, 0, 8 },        /* B */
-            { 2, 1, 1, 0, 8 },        /* R */
         },
         .flags = PIX_FMT_PLANAR | PIX_FMT_RGB,
     },
@@ -1147,9 +1147,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w = 0,
         .log2_chroma_h = 0,
         .comp = {
+            { 2, 1, 1, 0, 8 },        /* R */
             { 0, 1, 1, 0, 8 },        /* G */
             { 1, 1, 1, 0, 8 },        /* B */
-            { 2, 1, 1, 0, 8 },        /* R */
         },
         .flags = PIX_FMT_BE | PIX_FMT_PLANAR | PIX_FMT_RGB,
     },
@@ -1159,9 +1159,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w = 0,
         .log2_chroma_h = 0,
         .comp = {
+            { 2, 1, 1, 0, 9 },        /* R */
             { 0, 1, 1, 0, 9 },        /* G */
             { 1, 1, 1, 0, 9 },        /* B */
-            { 2, 1, 1, 0, 9 },        /* R */
         },
         .flags = PIX_FMT_PLANAR | PIX_FMT_RGB,
     },
@@ -1171,9 +1171,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w = 0,
         .log2_chroma_h = 0,
         .comp = {
+            { 2, 1, 1, 0, 9 },        /* R */
             { 0, 1, 1, 0, 9 },        /* G */
             { 1, 1, 1, 0, 9 },        /* B */
-            { 2, 1, 1, 0, 9 },        /* R */
         },
         .flags = PIX_FMT_BE | PIX_FMT_PLANAR | PIX_FMT_RGB,
     },
@@ -1183,9 +1183,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w = 0,
         .log2_chroma_h = 0,
         .comp = {
+            { 2, 1, 1, 0, 15 },       /* R */
             { 0, 1, 1, 0, 15 },       /* G */
             { 1, 1, 1, 0, 15 },       /* B */
-            { 2, 1, 1, 0, 15 },       /* R */
         },
         .flags = PIX_FMT_PLANAR | PIX_FMT_RGB,
     },
@@ -1195,9 +1195,9 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
         .log2_chroma_w = 0,
         .log2_chroma_h = 0,
         .comp = {
+            { 2, 1, 1, 0, 15 },       /* R */
             { 0, 1, 1, 0, 15 },       /* G */
             { 1, 1, 1, 0, 15 },       /* B */
-            { 2, 1, 1, 0, 15 },       /* R */
         },
         .flags = PIX_FMT_BE | PIX_FMT_PLANAR | PIX_FMT_RGB,
     },
diff --git a/libavutil/pixdesc.h b/libavutil/pixdesc.h
index 0730f5b..f1a2dde 100644
--- a/libavutil/pixdesc.h
+++ b/libavutil/pixdesc.h
@@ -76,9 +76,12 @@ typedef struct AVPixFmtDescriptor{
     uint8_t flags;
 
     /**
-     * Parameters that describe how pixels are packed. If the format
-     * has chroma components, they must be stored in comp[1] and
-     * comp[2].
+     * Parameters that describe how pixels are packed.
+     * If the format has 2 or 4 components, then alpha is last.
+     * If the format has 1 or 2 components, then luma is 0.
+     * If the format has 3 or 4 components,
+     * if the RGB flag is set then 0 is red, 1 is green and 2 is blue;
+     * otherwise 0 is luma, 1 is chroma-U and 2 is chroma-V.
      */
     AVComponentDescriptor comp[4];
 }AVPixFmtDescriptor;



More information about the ffmpeg-cvslog mailing list