Support 64bit pam decoding.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Mon, 16 Jan 2012 23:38:54 +0000 (00:38 +0100)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Mon, 16 Jan 2012 23:42:17 +0000 (00:42 +0100)
libavcodec/pnm.c
libavcodec/pnmdec.c

index 1defbc2..212ec06 100644 (file)
@@ -131,8 +131,7 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
             if (maxval < 256) {
                 avctx->pix_fmt = PIX_FMT_RGB32;
             } else {
-                av_log(avctx, AV_LOG_ERROR, "Unsupported bit depth\n");
-                return -1;
+                avctx->pix_fmt = PIX_FMT_RGBA64BE;
             }
         } else {
             return -1;
index ee15126..4060c4e 100644 (file)
@@ -58,6 +58,11 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data,
     switch (avctx->pix_fmt) {
     default:
         return -1;
+    case PIX_FMT_RGBA64BE:
+        n = avctx->width * 8;
+        components=4;
+        sample_len=16;
+        goto do_read;
     case PIX_FMT_RGB48BE:
         n = avctx->width * 6;
         components=3;