[FFmpeg-devel] [PATCH] png parser
Kostya
kostya.shishkov
Wed Jun 24 18:11:30 CEST 2009
On Wed, Jun 24, 2009 at 05:54:17PM +0200, Peter Holik wrote:
> Michael Niedermayer schrieb:
> > On Tue, Jun 23, 2009 at 08:51:12AM +0200, Peter Holik wrote:
> >> Michael Niedermayer schrieb:
[...]
> >
> > could you explain why this is not just looking like lets say mpeg4:
> >
> > if(!vop_found){
> > for(i=0; i<buf_size; i++){
> > state= (state<<8) | buf[i];
> > if(state == 0x1B6){
> > i++;
> > vop_found=1;
> > break;
> > }
> > }
> > }
>
> png signature is 8 Bytes
Why not use 32-bit state variable? If it equals to the first part
('.PNG') then read additional 32-bit variable from buffer. If it matches
second part of PNG signature then end operation, otherwise assign that
variable to state, skip 3 bytes and continue search.
[...]
>
> cu Peter
More information about the ffmpeg-devel
mailing list