Mercurial > libavcodec.hg
diff pnm.c @ 9002:eb98d61af310 libavcodec
Support 48-bit RGB PPM image.
| author | pross |
|---|---|
| date | Sun, 22 Feb 2009 00:56:55 +0000 |
| parents | 04423b2f6e0b |
| children | de31b10455cc |
line wrap: on
line diff
--- a/pnm.c Sun Feb 22 00:55:49 2009 +0000 +++ b/pnm.c Sun Feb 22 00:56:55 2009 +0000 @@ -138,8 +138,11 @@ avctx->pix_fmt = PIX_FMT_GRAY16BE; if (s->maxval != 65535) avctx->pix_fmt = PIX_FMT_GRAY16; + } if (avctx->pix_fmt == PIX_FMT_RGB24) { + if (s->maxval > 255) + avctx->pix_fmt = PIX_FMT_RGB48BE; } else { - av_log(avctx, AV_LOG_ERROR, "16-bit components are only supported for grayscale\n"); + av_log(avctx, AV_LOG_ERROR, "Unsupported pixel format\n"); avctx->pix_fmt = PIX_FMT_NONE; return -1; }
