Browse Source

png: allow encoding 16-bit grayscale

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
tags/n2.1
Ian Taylor Luca Barbato 12 years ago
parent
commit
46dee21a32
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavcodec/pngenc.c

+ 5
- 0
libavcodec/pngenc.c View File

@@ -255,6 +255,10 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
bit_depth = 8;
color_type = PNG_COLOR_TYPE_RGB;
break;
case AV_PIX_FMT_GRAY16BE:
bit_depth = 16;
color_type = PNG_COLOR_TYPE_GRAY;
break;
case AV_PIX_FMT_GRAY8:
bit_depth = 8;
color_type = PNG_COLOR_TYPE_GRAY;
@@ -460,6 +464,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_MONOBLACK, AV_PIX_FMT_NONE
},
.long_name = NULL_IF_CONFIG_SMALL("PNG (Portable Network Graphics) image"),


Loading…
Cancel
Save