Support 16bpp grayscale pam decoding.

Fixes ticket #881.
This commit is contained in:
ami_stuff 2012-01-05 20:57:49 +01:00 committed by Carl Eugen Hoyos
parent 02026d08a9
commit 871e2f4fac
1 changed files with 5 additions and 2 deletions

View File

@ -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;