avutil/pixdesc: add AV_PIX_FMT_FLAG_ALPHA to AV_PIX_FMT_PAL8

Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
Marton Balint 2018-04-19 23:00:47 +02:00
parent 4c501bafc0
commit 56b081da57
6 changed files with 7 additions and 17 deletions

View 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.

View 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;
}

View 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++) {

View 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.

View 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;
}

View 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, \