[FFmpeg-devel] [PATCH] SIFF demuxer and decoder

Michael Niedermayer michaelni
Mon Oct 22 03:29:21 CEST 2007


Hi

On Sun, Oct 21, 2007 at 08:23:30AM +0300, Kostya wrote:
> On Sat, Oct 20, 2007 at 09:42:45PM +0200, Michael Niedermayer wrote:
> > Hi
> > 
> > On Fri, Oct 19, 2007 at 11:29:47AM +0300, Kostya wrote:
> > [...]
> > 
> > > +static int vb_decode_framedata(VBDecContext *c, uint8_t *buf, int offset)
> > > +{
> > > +    uint8_t *prev, *cur;
> > > +    int blk, blocks, t, blk2;
> > > +    int blocktypes = 0;
> > > +    int x, y, a, b;
> > > +    int pattype, pattern;
> > > +    const int width = c->avctx->width;
> > > +    uint8_t *pstart = c->prev_frame;
> > > +    uint8_t *pend = c->prev_frame + width*c->avctx->height;
> > > +    
> > > +    prev = c->prev_frame + offset;
> > > +    cur = c->frame;
> > > +    
> > > +    blocks = (c->avctx->width >> 2) * (c->avctx->height >> 2);
> > > +    blk2 = 0;
> > > +    for(blk = 0; blk < blocks; blk++){
> > > +        if(!(blk & 3))
> > > +            blocktypes = bytestream_get_byte(&buf);
> > > +        switch(blocktypes & 0xC0){
> > > +        case 0x00: //skip
> > > +            for(y = 0; y < 4; y++)
> > > +                if(check_line(prev + y*width, pstart, pend))
> > > +                    memcpy(cur + y*width, prev + y*width, 4);
> > > +                else
> > > +                    memset(cur + y*width, 0, 4);
> > > +            break;
> > 
> > it should be enough to check the top-left and bottom-right pixels
> > the same applies to the other cases
> 
> Tried that. It leads to artiacts in some files as block is only partially out of bounds.

missdesigned_codec++

and patch looks ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071022/42af055c/attachment.pgp>



More information about the ffmpeg-devel mailing list