summaryrefslogtreecommitdiff
path: root/libavcodec/pngenc.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2012-01-15 22:04:25 +0000
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-03-16 23:29:51 +0100
commitcccac7654f3f6b82967bc6ae08b35ae8b4fbe1a9 (patch)
tree9ab0ad3962fe17acd145587c916b3b01861d2b6e /libavcodec/pngenc.c
parentc598b569fb3d1f4b6c4868fe64f6989254df5186 (diff)
png: Support rgb48 and rgba64 encoding
Diffstat (limited to 'libavcodec/pngenc.c')
-rw-r--r--libavcodec/pngenc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index ccc5f7dada..a6015ff5b9 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -245,6 +245,14 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
is_progressive = !!(avctx->flags & CODEC_FLAG_INTERLACED_DCT);
switch (avctx->pix_fmt) {
+ case AV_PIX_FMT_RGBA64BE:
+ bit_depth = 16;
+ color_type = PNG_COLOR_TYPE_RGB_ALPHA;
+ break;
+ case AV_PIX_FMT_RGB48BE:
+ bit_depth = 16;
+ color_type = PNG_COLOR_TYPE_RGB;
+ break;
case AV_PIX_FMT_RGB32:
bit_depth = 8;
color_type = PNG_COLOR_TYPE_RGB_ALPHA;
@@ -482,7 +490,7 @@ AVCodec ff_png_encoder = {
.encode2 = encode_frame,
.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB32, AV_PIX_FMT_PAL8, AV_PIX_FMT_GRAY8,
- AV_PIX_FMT_GRAY16BE,
+ AV_PIX_FMT_RGBA64BE, AV_PIX_FMT_RGB48BE, AV_PIX_FMT_GRAY16BE,
AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_NONE
},
};