aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/pnmdec.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2012-01-19 23:08:12 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2012-01-19 23:31:21 +0100
commitb614c147672aa3c1d38596c587a0921987cf94b7 (patch)
tree2567c75254ae830fb1d5af8eb94008e53e6e38a7 /libavcodec/pnmdec.c
parent34aadeaa2c2ae2e84abde3cca0a8b1392b8294ac (diff)
downloadandroid_external_ffmpeg-b614c147672aa3c1d38596c587a0921987cf94b7.tar.gz
android_external_ffmpeg-b614c147672aa3c1d38596c587a0921987cf94b7.tar.bz2
android_external_ffmpeg-b614c147672aa3c1d38596c587a0921987cf94b7.zip
Simplify 32bit pam decoding.
Reviewed-by: Paul B Mahol
Diffstat (limited to 'libavcodec/pnmdec.c')
-rw-r--r--libavcodec/pnmdec.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/libavcodec/pnmdec.c b/libavcodec/pnmdec.c
index 324ec3fe83..e6c91ef996 100644
--- a/libavcodec/pnmdec.c
+++ b/libavcodec/pnmdec.c
@@ -67,6 +67,11 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data,
components=3;
sample_len=16;
goto do_read;
+ case PIX_FMT_RGBA:
+ n = avctx->width * 4;
+ components=4;
+ sample_len=8;
+ goto do_read;
case PIX_FMT_RGB24:
n = avctx->width * 3;
components=3;
@@ -177,24 +182,6 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data,
}
}
break;
- case PIX_FMT_RGB32:
- ptr = p->data[0];
- linesize = p->linesize[0];
- if (s->bytestream + avctx->width * avctx->height * 4 > s->bytestream_end)
- return -1;
- for (i = 0; i < avctx->height; i++) {
- int j, r, g, b, a;
-
- for (j = 0; j < avctx->width; j++) {
- r = *s->bytestream++;
- g = *s->bytestream++;
- b = *s->bytestream++;
- a = *s->bytestream++;
- ((uint32_t *)ptr)[j] = (a << 24) | (r << 16) | (g << 8) | b;
- }
- ptr += linesize;
- }
- break;
}
*picture = *(AVFrame*)&s->picture;
*data_size = sizeof(AVPicture);