Commit 871e2f4f authored by ami_stuff's avatar ami_stuff Committed by Carl Eugen Hoyos

Support 16bpp grayscale pam decoding.

Fixes ticket #881.
parent 02026d08
......@@ -111,10 +111,13 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
avctx->height = h;
s->maxval = maxval;
if (depth == 1) {
if (maxval == 1)
if (maxval == 1) {
avctx->pix_fmt = PIX_FMT_MONOWHITE;
else
} else if (maxval == 255) {
avctx->pix_fmt = PIX_FMT_GRAY8;
} else {
avctx->pix_fmt = PIX_FMT_GRAY16BE;
}
} else if (depth == 3) {
if (maxval < 256) {
avctx->pix_fmt = PIX_FMT_RGB24;
......
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