[FFmpeg-cvslog] png: Support rgb48 and rgba64 encoding

Carl Eugen Hoyos git at videolan.org
Mon Mar 17 15:38:56 CET 2014


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Sun Jan 15 22:04:25 2012 +0000| [cccac7654f3f6b82967bc6ae08b35ae8b4fbe1a9] | committer: Vittorio Giovara

png: Support rgb48 and rgba64 encoding

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cccac7654f3f6b82967bc6ae08b35ae8b4fbe1a9
---

 libavcodec/pngenc.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index ccc5f7d..a6015ff 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
     },
 };



More information about the ffmpeg-cvslog mailing list