Skip to content
Snippets Groups Projects
Commit fac2a6fa authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos
Browse files

Support 16bit gray pam encoding.

parent 2f21c507
No related branches found
No related tags found
No related merge requests found
...@@ -62,6 +62,12 @@ static int pam_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, ...@@ -62,6 +62,12 @@ static int pam_encode_frame(AVCodecContext *avctx, unsigned char *outbuf,
maxval = 255; maxval = 255;
tuple_type = "GRAYSCALE"; tuple_type = "GRAYSCALE";
break; break;
case PIX_FMT_GRAY16BE:
n = w * 2;
depth = 1;
maxval = 0xFFFF;
tuple_type = "GRAYSCALE";
break;
case PIX_FMT_GRAY8A: case PIX_FMT_GRAY8A:
n = w * 2; n = w * 2;
depth = 2; depth = 2;
...@@ -128,6 +134,6 @@ AVCodec ff_pam_encoder = { ...@@ -128,6 +134,6 @@ AVCodec ff_pam_encoder = {
.priv_data_size = sizeof(PNMContext), .priv_data_size = sizeof(PNMContext),
.init = ff_pnm_init, .init = ff_pnm_init,
.encode = pam_encode_frame, .encode = pam_encode_frame,
.pix_fmts = (const enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_RGB32, 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_GRAY8, PIX_FMT_GRAY8A, PIX_FMT_GRAY16BE, PIX_FMT_MONOBLACK, PIX_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"), .long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"),
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment