aboutsummaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorCarl Eugen Hoyos2012-01-17 00:37:20 +0100
committerCarl Eugen Hoyos2012-01-17 00:42:17 +0100
commit328e79329af80977451b501a2880f016ba0801e2 (patch)
tree1993aa346e2eff43c479759e3d4edabfba585c6c /libavcodec
parentdc2f652ae4ca4e4093b6a90d82b09e0545b84c7f (diff)
Support gray8a pam decoding.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/pnm.c3
-rw-r--r--libavcodec/pnmdec.c5
2 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/pnm.c b/libavcodec/pnm.c
index fa43c8d6e9..1defbc20e6 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 dc64f9b70e..ee15126889 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;