[FFmpeg-devel] [PATCH] SIFF demuxer and decoder
Kostya
kostya.shishkov
Mon Oct 22 07:56:38 CEST 2007
On Mon, Oct 22, 2007 at 03:29:21AM +0200, Michael Niedermayer wrote:
> 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++
well, I'd like to set capabilities = CODEC_CAP_MISDESIGNED but could not find it in avcodec.h
> and patch looks ok
committed
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
More information about the ffmpeg-devel
mailing list