Commit cccac765 authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos Committed by Vittorio Giovara
Browse files

png: Support rgb48 and rgba64 encoding

parent c598b569
......@@ -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
},
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment