mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-20 01:50:30 +00:00
png: allow encoding 16-bit grayscale
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
parent
3ca5df36a5
commit
46dee21a32
@ -255,6 +255,10 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
bit_depth = 8;
|
bit_depth = 8;
|
||||||
color_type = PNG_COLOR_TYPE_RGB;
|
color_type = PNG_COLOR_TYPE_RGB;
|
||||||
break;
|
break;
|
||||||
|
case AV_PIX_FMT_GRAY16BE:
|
||||||
|
bit_depth = 16;
|
||||||
|
color_type = PNG_COLOR_TYPE_GRAY;
|
||||||
|
break;
|
||||||
case AV_PIX_FMT_GRAY8:
|
case AV_PIX_FMT_GRAY8:
|
||||||
bit_depth = 8;
|
bit_depth = 8;
|
||||||
color_type = PNG_COLOR_TYPE_GRAY;
|
color_type = PNG_COLOR_TYPE_GRAY;
|
||||||
@ -460,6 +464,7 @@ AVCodec ff_png_encoder = {
|
|||||||
.encode2 = encode_frame,
|
.encode2 = encode_frame,
|
||||||
.pix_fmts = (const enum AVPixelFormat[]){
|
.pix_fmts = (const enum AVPixelFormat[]){
|
||||||
AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB32, AV_PIX_FMT_PAL8, AV_PIX_FMT_GRAY8,
|
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
|
AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_NONE
|
||||||
},
|
},
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("PNG (Portable Network Graphics) image"),
|
.long_name = NULL_IF_CONFIG_SMALL("PNG (Portable Network Graphics) image"),
|
||||||
|
Loading…
Reference in New Issue
Block a user