[FFmpeg-cvslog] Support 16bpp grayscale pam decoding.
ami_stuff
git at videolan.org
Thu Jan 5 20:59:08 CET 2012
ffmpeg | branch: master | ami_stuff <ami_stuff at o2.pl> | Thu Jan 5 20:57:49 2012 +0100| [871e2f4fac18230abe4d7154d90cb5cba1479692] | committer: Carl Eugen Hoyos
Support 16bpp grayscale pam decoding.
Fixes ticket #881.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=871e2f4fac18230abe4d7154d90cb5cba1479692
---
libavcodec/pnm.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/libavcodec/pnm.c b/libavcodec/pnm.c
index 680034a..06ab701 100644
--- a/libavcodec/pnm.c
+++ b/libavcodec/pnm.c
@@ -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;
More information about the ffmpeg-cvslog
mailing list