Browse Source

Support 16bpp grayscale pam decoding.

Fixes ticket #881.
tags/n0.10
ami_stuff Carl Eugen Hoyos 14 years ago
parent
commit
871e2f4fac
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      libavcodec/pnm.c

+ 5
- 2
libavcodec/pnm.c 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;


Loading…
Cancel
Save