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

Kostya kostya.shishkov
Tue Oct 16 06:19:10 CEST 2007


On Mon, Oct 15, 2007 at 11:42:31PM +0200, Michael Niedermayer wrote:
> On Mon, Oct 15, 2007 at 02:59:47PM +0300, Kostya wrote:
> > Here is demuxer and video decoder for SIFF format
> > based on description sent to me by anonymous
> > contributor.
> [...]
> > +typedef struct SIFFContext{
> > +    int frames;
> > +    int cur_frame;
> > +    int rate;
> > +    int block_align;
> 
> > +    int has_video;
> 
> isnt that always 1 ?

No, it can hold pure audio as well.
 
> [...]
> > +            if(c->has_audio){
> > +                c->blkdata = av_realloc(c->blkdata, size);
> > +                memcpy(c->blkdata, pkt->data, pkt->size);
> > +            }
> > +            flags = pkt->data[0];
> > +            c->next_audio = !!(flags & VB_HAS_AUDIO);
> > +        }else{
> > +            //parse block
> > +            flags = c->blkdata[0];
> > +            snddata = c->blkdata + 2 + ((flags & VB_HAS_GMC) ? 4 : 0);
> > +            size = AV_RL32(snddata) - 4;
> > +            if (av_new_packet(pkt, size) < 0)
> > +                return AVERROR(ENOMEM);
> > +            memcpy(pkt->data, snddata + 4, size);
> > +        }
> 
> this looks wrong, it passes the audio to the video decoder
> it also does a lot of unneeded memcpy()
> please clean this up
> video -> video stream
> audio -> audio stream
> and no memcpy

It's a bit problematic.
Frame structure:
 whole frame size
 flags
 if(flags & gmc)
  motion vector
 if(flags & audio)
  audio data
 if(flags & video)
  video data
 if(flags & palette)
  palette data

Can you suggest a way to do demuxing?

> [...]

I will deal with technical issues soon. 
 
> [...]
> -- 
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB




More information about the ffmpeg-devel mailing list