]> git.sesse.net Git - ffmpeg/commitdiff
avutil/pixdesc: add AV_PIX_FMT_FLAG_ALPHA to AV_PIX_FMT_PAL8
authorMarton Balint <cus@passwd.hu>
Thu, 19 Apr 2018 21:00:47 +0000 (23:00 +0200)
committerMarton Balint <cus@passwd.hu>
Mon, 30 Apr 2018 19:51:31 +0000 (21:51 +0200)
Signed-off-by: Marton Balint <cus@passwd.hu>
doc/APIchanges
libavcodec/tests/imgconvert.c
libavutil/pixdesc.c
libavutil/pixdesc.h
libavutil/tests/pixdesc.c
libavutil/version.h

index a216e5aa4dff2e0259542f45f79b74f70a549ce9..ede5b186aeee88dcf22193b4c07389215a4e2df7 100644 (file)
@@ -15,6 +15,9 @@ libavutil:     2017-10-21
 
 API changes, most recent first:
 
+2018-04-xx - xxxxxxxxxx - lavu 56.18.100 - pixdesc.h
+  Add AV_PIX_FMT_FLAG_ALPHA to AV_PIX_FMT_PAL8.
+
 2018-04-xx - xxxxxxxxxx - lavu 56.17.100 - opt.h
   Add AV_OPT_FLAG_DEPRECATED.
 
index c598d461d31a146d541261b42ea84ea5452e7e53..aefc324bf556e2bf01ba7ef6fcbc7651ba31be53 100644 (file)
@@ -39,10 +39,6 @@ int main(void){
             skip = 0;
         }
         av_log(NULL, AV_LOG_INFO, "pix fmt %s yuv_plan:%d avg_bpp:%d\n", desc->name, is_yuv_planar(desc), av_get_padded_bits_per_pixel(desc));
-        if ((!(desc->flags & AV_PIX_FMT_FLAG_ALPHA)) != (desc->nb_components != 2 && desc->nb_components != 4)) {
-            av_log(NULL, AV_LOG_ERROR, "Alpha flag mismatch\n");
-            err = 1;
-        }
     }
     return err;
 }
index 8ed52751c1a8bdd8affc63e9e336c7ebb4bae5bb..a8be7b66e60210c6641d70f5a02c6707d07e4154 100644 (file)
@@ -288,7 +288,7 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
         .comp = {
             { 0, 1, 0, 0, 8, 0, 7, 1 },
         },
-        .flags = AV_PIX_FMT_FLAG_PAL,
+        .flags = AV_PIX_FMT_FLAG_PAL | AV_PIX_FMT_FLAG_ALPHA,
     },
     [AV_PIX_FMT_YUVJ420P] = {
         .name = "yuvj420p",
@@ -2432,7 +2432,6 @@ void ff_check_pixfmt_descriptors(void){
         av_assert0(d->log2_chroma_h <= 3);
         av_assert0(d->nb_components <= 4);
         av_assert0(d->name && d->name[0]);
-        av_assert0((d->nb_components==4 || d->nb_components==2) == !!(d->flags & AV_PIX_FMT_FLAG_ALPHA));
         av_assert2(av_get_pix_fmt(d->name) == i);
 
         for (j=0; j<FF_ARRAY_ELEMS(d->comp); j++) {
index 1ab372782ae19529f8284c24a60897d07befc5e5..4f9c5a271fdea64325a8dbb7fe498c73c85a8195 100644 (file)
@@ -167,12 +167,8 @@ typedef struct AVPixFmtDescriptor {
 
 /**
  * The pixel format has an alpha channel. This is set on all formats that
- * support alpha in some way. The exception is AV_PIX_FMT_PAL8, which can
- * carry alpha as part of the palette. Details are explained in the
- * AVPixelFormat enum, and are also encoded in the corresponding
- * AVPixFmtDescriptor.
- *
- * The alpha is always straight, never pre-multiplied.
+ * support alpha in some way, including AV_PIX_FMT_PAL8. The alpha is always
+ * straight, never pre-multiplied.
  *
  * If a codec or a filter does not support alpha, it should set all alpha to
  * opaque, or use the equivalent pixel formats without alpha component, e.g.
index 7fbfeea96c2e96f2b16757118916f6a34f766811..34e2bea932c83cf37e5511158ced567f7cc8fec4 100644 (file)
@@ -37,10 +37,6 @@ int main(void){
             skip = 0;
         }
         av_log(NULL, AV_LOG_INFO, "pix fmt %s avg_bpp:%d colortype:%d\n", desc->name, av_get_padded_bits_per_pixel(desc), get_color_type(desc));
-        if ((!(desc->flags & AV_PIX_FMT_FLAG_ALPHA)) != (desc->nb_components != 2 && desc->nb_components != 4)) {
-            av_log(NULL, AV_LOG_ERROR, "Alpha flag mismatch\n");
-            err = 1;
-        }
     }
     return err;
 }
index b087c1548804e887c1158e57d74ae875920fd650..5185454d9b1057e7ef6d6cdd95ebaf8a57a260f3 100644 (file)
@@ -79,7 +79,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  56
-#define LIBAVUTIL_VERSION_MINOR  17
+#define LIBAVUTIL_VERSION_MINOR  18
 #define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \