aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-09-06 19:02:14 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-09-06 19:50:01 +0200
commit0c9cba24b7c1ef80078c500b44a6bc4788e8fd5b (patch)
tree993ba090e36e532d8cbff25a73b796e321b2968c
parentdcabb3d6081b129c1abcfa04e428fda6a510ffa6 (diff)
downloadffmpeg-0c9cba24b7c1ef80078c500b44a6bc4788e8fd5b.tar.gz
pngdec: implement 4bpp interlaced
Fixes Ticket435 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/pngdec.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 245d39bac4..b6770ddbd4 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -83,6 +83,20 @@ static void png_put_interlaced_row(uint8_t *dst, int width,
src_x++;
}
break;
+ case 4:
+ src_x = 0;
+ for(x = 0; x < width; x++) {
+ int j2 = 4*(x&1);
+ j = (x & 7);
+ if ((dsp_mask << j) & 0x80) {
+ b = (src[src_x >> 1] >> (4 - 4*(src_x & 1))) & 15;
+ dst[x >> 1] &= 0xFF0F>>j2;
+ dst[x >> 1] |= b << (4 - j2);
+ }
+ if ((mask << j) & 0x80)
+ src_x++;
+ }
+ break;
default:
bpp = bits_per_pixel >> 3;
d = dst;