diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2012-01-15 22:04:25 +0100 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2012-01-15 22:04:25 +0100 |
commit | f94ce3bcab67369b18976f6cf8e69ae132805213 (patch) | |
tree | a900518970039c5b7f65810d609600b39722b675 /libavcodec | |
parent | 107f55cb01d2333541b8887194c487a6c6bc1ba1 (diff) | |
download | ffmpeg-f94ce3bcab67369b18976f6cf8e69ae132805213.tar.gz |
Support rgb48 and rgba64 png encoding.
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/pngenc.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index 573e95cc89..5933bbb38a 100644 --- a/libavcodec/pngenc.c +++ b/libavcodec/pngenc.c @@ -234,6 +234,14 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, is_progressive = !!(avctx->flags & CODEC_FLAG_INTERLACED_DCT); switch(avctx->pix_fmt) { + case PIX_FMT_RGBA64BE: + bit_depth = 16; + color_type = PNG_COLOR_TYPE_RGB_ALPHA; + break; + case PIX_FMT_RGB48BE: + bit_depth = 16; + color_type = PNG_COLOR_TYPE_RGB; + break; case PIX_FMT_RGBA: bit_depth = 8; color_type = PNG_COLOR_TYPE_RGB_ALPHA; @@ -418,6 +426,11 @@ 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_RGBA, PIX_FMT_PAL8, PIX_FMT_GRAY8, PIX_FMT_GRAY8A, PIX_FMT_GRAY16BE, PIX_FMT_MONOBLACK, PIX_FMT_NONE}, + .pix_fmts= (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGBA, + PIX_FMT_RGB48BE, PIX_FMT_RGBA64BE, + 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"), }; |