diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-09-06 15:48:01 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-09-06 15:48:01 +0200 |
commit | 2d4102fc13f7c754701156ef4403d02fa0a2cc82 (patch) | |
tree | 590728240cbe5a128e2de559d7b762bc501398cf /libavcodec | |
parent | dc43ad6d1a857229bb71e755a44a9765321908e1 (diff) | |
download | ffmpeg-2d4102fc13f7c754701156ef4403d02fa0a2cc82.tar.gz |
pngdec: Implement 2bpp
Fixes Ticket433
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/pngdec.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 7ac20aef43..4fe288464a 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -579,6 +579,19 @@ static int decode_frame(AVCodecContext *avctx, } exit_loop: + if(s->bits_per_pixel == 2){ + int i, j; + uint8_t *pd = s->current_picture->data[0]; + for(j=0; j < s->height; j++) { + for(i=s->width/4-1; i>=0; i--) { + pd[4*i+3]= pd[i] &3; + pd[4*i+2]= (pd[i]>>2)&3; + pd[4*i+1]= (pd[i]>>4)&3; + pd[4*i+0]= pd[i]>>6; + } + pd += s->image_linesize; + } + } if(s->bits_per_pixel == 4){ int i, j; uint8_t *pd = s->current_picture->data[0]; |