aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-09-06 15:48:01 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-09-06 15:48:01 +0200
commit2d4102fc13f7c754701156ef4403d02fa0a2cc82 (patch)
tree590728240cbe5a128e2de559d7b762bc501398cf /libavcodec
parentdc43ad6d1a857229bb71e755a44a9765321908e1 (diff)
downloadffmpeg-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.c13
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];