[FFmpeg-cvslog] Support gray8a pam decoding.

Carl Eugen Hoyos git at videolan.org
Tue Jan 17 00:42:15 CET 2012


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Tue Jan 17 00:37:20 2012 +0100| [328e79329af80977451b501a2880f016ba0801e2] | committer: Carl Eugen Hoyos

Support gray8a pam decoding.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=328e79329af80977451b501a2880f016ba0801e2
---

 libavcodec/pnm.c    |    3 +++
 libavcodec/pnmdec.c |    5 +++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/libavcodec/pnm.c b/libavcodec/pnm.c
index fa43c8d..1defbc2 100644
--- a/libavcodec/pnm.c
+++ b/libavcodec/pnm.c
@@ -118,6 +118,9 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
             } else {
                 avctx->pix_fmt = PIX_FMT_GRAY16BE;
             }
+        } else if (depth == 2) {
+            if (maxval == 255)
+                avctx->pix_fmt = PIX_FMT_GRAY8A;
         } else if (depth == 3) {
             if (maxval < 256) {
             avctx->pix_fmt = PIX_FMT_RGB24;
diff --git a/libavcodec/pnmdec.c b/libavcodec/pnmdec.c
index dc64f9b..ee15126 100644
--- a/libavcodec/pnmdec.c
+++ b/libavcodec/pnmdec.c
@@ -75,6 +75,11 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data,
         if (s->maxval < 255)
             upgrade = 1;
         goto do_read;
+    case PIX_FMT_GRAY8A:
+        n = avctx->width * 2;
+        components=2;
+        sample_len=8;
+        goto do_read;
     case PIX_FMT_GRAY16BE:
     case PIX_FMT_GRAY16LE:
         n = avctx->width * 2;



More information about the ffmpeg-cvslog mailing list