[FFmpeg-cvslog] pngdec: implement 4bpp interlaced

Michael Niedermayer git at videolan.org
Tue Sep 6 19:51:21 CEST 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Sep  6 19:02:14 2011 +0200| [0c9cba24b7c1ef80078c500b44a6bc4788e8fd5b] | committer: Michael Niedermayer

pngdec: implement 4bpp interlaced
Fixes Ticket435

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0c9cba24b7c1ef80078c500b44a6bc4788e8fd5b
---

 libavcodec/pngdec.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 245d39b..b6770dd 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;



More information about the ffmpeg-cvslog mailing list