diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2012-01-15 21:57:02 +0100 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2012-01-15 21:57:02 +0100 |
commit | fdc013da7863190b9416d45830a9ad6d7fb854c2 (patch) | |
tree | 78a2c886a3b1a2421d4c69fe84482a44b3cc8447 | |
parent | ed10ca4c764cad4a3b7798b19600910efee9947d (diff) | |
download | ffmpeg-fdc013da7863190b9416d45830a9ad6d7fb854c2.tar.gz |
Support gray16 png encoding.
-rw-r--r-- | libavcodec/pngenc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index 20edb4a125..0de3aa247d 100644 --- a/libavcodec/pngenc.c +++ b/libavcodec/pngenc.c @@ -260,6 +260,10 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, bit_depth = 8; color_type = PNG_COLOR_TYPE_RGB; break; + case PIX_FMT_GRAY16BE: + bit_depth = 16; + color_type = PNG_COLOR_TYPE_GRAY; + break; case PIX_FMT_GRAY8: bit_depth = 8; color_type = PNG_COLOR_TYPE_GRAY; @@ -447,6 +451,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_GRAY8A, 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_GRAY16BE, PIX_FMT_MONOBLACK, PIX_FMT_NONE}, .long_name= NULL_IF_CONFIG_SMALL("PNG image"), }; |