diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-09-06 18:46:42 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-09-06 19:50:01 +0200 |
commit | dcabb3d6081b129c1abcfa04e428fda6a510ffa6 (patch) | |
tree | d5c890c80f033f06b4c2c7a2dd14981ced13b685 /libavcodec/pngdec.c | |
parent | 4f7dfe12eaffe2ec2399cc52ce9a8cb9f8fdb741 (diff) | |
download | ffmpeg-dcabb3d6081b129c1abcfa04e428fda6a510ffa6.tar.gz |
pngdec: implement 2 bpp interlaced.
Fixes Ticket434
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pngdec.c')
-rw-r--r-- | libavcodec/pngdec.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 5abdb90dee..245d39bac4 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -69,6 +69,20 @@ static void png_put_interlaced_row(uint8_t *dst, int width, src_x++; } break; + case 2: + src_x = 0; + for(x = 0; x < width; x++) { + int j2 = 2*(x&3); + j = (x & 7); + if ((dsp_mask << j) & 0x80) { + b = (src[src_x >> 2] >> (6 - 2*(src_x & 3))) & 3; + dst[x >> 2] &= 0xFF3F>>j2; + dst[x >> 2] |= b << (6 - j2); + } + if ((mask << j) & 0x80) + src_x++; + } + break; default: bpp = bits_per_pixel >> 3; d = dst; |