[FFmpeg-devel] [PATCH] Patches to fix issue453 in libdiracschroedinger

Anuradha Suraparaju anuradha
Thu Jun 5 03:12:59 CEST 2008


On Tue, 2008-06-03 at 23:48 +0200, Michael Niedermayer wrote:
> On Sun, Jun 01, 2008 at 06:03:12PM +1000, Anuradha Suraparaju wrote:
> > Hi, 
> > 
> > I have addressed most of the issues mentioned in your email in the new
> > patches. 
> [...]
> 
> > > [...]
> > > > Index: libavcodec/dirac_parser.c
> > > > ===================================================================
> > > > --- libavcodec/dirac_parser.c	(revision 13233)
> > > > +++ libavcodec/dirac_parser.c	(working copy)
> > > > @@ -62,16 +62,12 @@
> > > >      ParseContext *pc = s->priv_data;
> > > >      int next;
> > > >  
> > > > -    if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
> > > > -        next = buf_size;
> > > > -    }else{
> > > > -        next = find_frame_end(pc, buf, buf_size);
> > > > +    next = find_frame_end(pc, buf, buf_size);
> > > >  
> > > > -        if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
> > > > -            *poutbuf = NULL;
> > > > -            *poutbuf_size = 0;
> > > > -            return buf_size;
> > > > -        }
> > > > +    if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
> > > > +        *poutbuf = NULL;
> > > > +        *poutbuf_size = 0;
> > > > +        return buf_size;
> > > >      }
> > > >  
> > > >      *poutbuf = buf;
> > > 
> > > The current code in dirac_parser.c looks correct to me, this change should
> > > not be needed.
> > > PARSER_FLAG_COMPLETE_FRAMES is supposed to mean "complete" in the ffmpeg
> > > sense.
> > > 
> > 
> > As I mentioned in another email, libschroedinger requires that packet
> > sent to it be Dirac byte stream parse units. If a packet contains more
> > than one parse-unit the second gets ignored. Hence the change I made is
> > required.
> 
> What ffmpeg calls complete frames is what a parser should output, hence
> if PARSER_FLAG_COMPLETE_FRAMES is set there is no spliting to do for a
> parser.
> 
> If i understand the current code correctly the parser does not behave that
> way and the decoder would not work if it did.
> If true -vcodec copy will likely not work with dirac currently
> 

OK. Point taken. This means that I will have to modify
libschroedingerdec.c to sub-parse individual Dirac byte-stream parse
units from the "complete" ffmpeg frames sent to it. This is because the
Schroedinger decoder API accepts only Dirac bytestreams parse-units.

libdiracdec.c will not need modifications because the Dirac decoder
library stores any bytestream chunks sent to it and parses them
internally for parse-units.

Do you want me to resend the entire patch or will you just drop the
dirac_parser.c differences from the current patch?

I will also send a patch to libschroedingerdec.c 

> [...]

Regards,

Anuradha





More information about the ffmpeg-devel mailing list