Commit fdc013da authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos

Support gray16 png encoding.

parent ed10ca4c
...@@ -260,6 +260,10 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, ...@@ -260,6 +260,10 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
bit_depth = 8; bit_depth = 8;
color_type = PNG_COLOR_TYPE_RGB; color_type = PNG_COLOR_TYPE_RGB;
break; break;
case PIX_FMT_GRAY16BE:
bit_depth = 16;
color_type = PNG_COLOR_TYPE_GRAY;
break;
case PIX_FMT_GRAY8: case PIX_FMT_GRAY8:
bit_depth = 8; bit_depth = 8;
color_type = PNG_COLOR_TYPE_GRAY; color_type = PNG_COLOR_TYPE_GRAY;
...@@ -447,6 +451,6 @@ AVCodec ff_png_encoder = { ...@@ -447,6 +451,6 @@ AVCodec ff_png_encoder = {
.priv_data_size = sizeof(PNGEncContext), .priv_data_size = sizeof(PNGEncContext),
.init = png_enc_init, .init = png_enc_init,
.encode = encode_frame, .encode = encode_frame,
.pix_fmts= (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB32, PIX_FMT_PAL8, PIX_FMT_GRAY8, PIX_FMT_GRAY8A, PIX_FMT_MONOBLACK, PIX_FMT_NONE}, .pix_fmts= (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB32, 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"), .long_name= NULL_IF_CONFIG_SMALL("PNG image"),
}; };
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