[FFmpeg-devel] [patch] support decoding png 1,2,4 bits

Julien Reichel Julien.Reichel
Thu Feb 14 14:38:02 CET 2008

Here is the modified, attached patch. 

> > +    if (src_bits==1){
> > +        for(j = 0;j < width; j+=8) {
> This will probably break badly if width is not divisible by 8?
My hypothesis whas that lines where allways padded to a multiple of 8
for allignement. So this would not break down, but the attached path
doesn't have the problem anymore.

> (v >> 5) & 1;
Used this syntax, it is nicer. Also compacted the patch.

> In addition if speed does not matter (much), just using the 
> bitstream reader would be much simpler as well (maybe 4 lines 
> of code to handle _all_ cases), though it would require src 
> to be padded, not idea if that is the case currently.
Well, I have no clue how to do that. But I'll be happy to try. Anyhow
patch was done, so here it is.

All the best,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pngdec.patch
Type: application/octet-stream
Size: 1824 bytes
Desc: pngdec.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080214/54a49d64/attachment.obj>

More information about the ffmpeg-devel mailing list