[FFmpeg-cvslog] Support gray8a png encoding.
Carl Eugen Hoyos
git at videolan.org
Sun Jan 15 22:15:53 CET 2012
ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Sun Jan 15 21:53:01 2012 +0100| [ed10ca4c764cad4a3b7798b19600910efee9947d] | committer: Carl Eugen Hoyos
Support gray8a png encoding.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ed10ca4c764cad4a3b7798b19600910efee9947d
---
libavcodec/pngenc.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index b35402e..20edb4a 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -264,6 +264,10 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
bit_depth = 8;
color_type = PNG_COLOR_TYPE_GRAY;
break;
+ case PIX_FMT_GRAY8A:
+ bit_depth = 8;
+ color_type = PNG_COLOR_TYPE_GRAY_ALPHA;
+ break;
case PIX_FMT_MONOBLACK:
bit_depth = 1;
color_type = PNG_COLOR_TYPE_GRAY;
@@ -443,6 +447,6 @@ AVCodec ff_png_encoder = {
.priv_data_size = sizeof(PNGEncContext),
.init = png_enc_init,
.encode = encode_frame,
- .pix_fmts= (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB32, PIX_FMT_PAL8, PIX_FMT_GRAY8, PIX_FMT_MONOBLACK, PIX_FMT_NONE},
+ .pix_fmts= (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB32, PIX_FMT_PAL8, PIX_FMT_GRAY8, PIX_FMT_GRAY8A, PIX_FMT_MONOBLACK, PIX_FMT_NONE},
.long_name= NULL_IF_CONFIG_SMALL("PNG image"),
};
More information about the ffmpeg-cvslog
mailing list