[FFmpeg-devel] [PATCH 1/2] pixdesc: mark AV_PIX_FMT_PAL8 as having alpha
wm4
nfxjfg at googlemail.com
Mon Feb 9 22:33:53 CET 2015
Otherwise, you could lose the alpha when handling pixel formats in an
opaque manner (i.e. when you don't special-case PAL8).
The special case for av_get_pix_fmt_loss()/av_find_best_pix_fmt_of_2()
is now redundant and can be removed.
---
Fate still passes.
---
libavutil/pixdesc.c | 4 ++--
libavutil/pixfmt.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 648d014..ecca850 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -288,7 +288,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.comp = {
{ 0, 0, 1, 0, 7 },
},
- .flags = AV_PIX_FMT_FLAG_PAL,
+ .flags = AV_PIX_FMT_FLAG_PAL | AV_PIX_FMT_FLAG_ALPHA,
},
[AV_PIX_FMT_YUVJ420P] = {
.name = "yuvj420p",
@@ -2145,7 +2145,7 @@ enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt)
#define FF_COLOR_YUV_JPEG 3 /**< YUV color space. 0 <= Y <= 255, 0 <= U, V <= 255 */
#define pixdesc_has_alpha(pixdesc) \
- ((pixdesc)->nb_components == 2 || (pixdesc)->nb_components == 4 || (pixdesc)->flags & AV_PIX_FMT_FLAG_PAL)
+ ((pixdesc)->nb_components == 2 || (pixdesc)->nb_components == 4)
static int get_color_type(const AVPixFmtDescriptor *desc) {
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 5d443ce..980be78 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -48,7 +48,7 @@
* image data is stored in AVFrame.data[0]. The palette is transported in
* AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is
* formatted the same as in AV_PIX_FMT_RGB32 described above (i.e., it is
- * also endian-specific). Note also that the individual RGB palette
+ * also endian-specific). Note also that the individual ARGB palette
* components stored in AVFrame.data[1] should be in the range 0..255.
* This is important as many custom PAL8 video codecs that were designed
* to run on the IBM VGA graphics adapter use 6-bit palette components.
--
2.1.4
More information about the ffmpeg-devel
mailing list