[FFmpeg-devel] [PATCH] Musepack SV8 demuxer and decoder

Michael Niedermayer michaelni
Mon Nov 5 02:10:06 CET 2007


On Sun, Nov 04, 2007 at 04:47:46PM +0200, Kostya wrote:
> On Sun, Nov 04, 2007 at 12:35:37PM +0100, Michael Niedermayer wrote:
> > Hi
> > 
> > On Sun, Nov 04, 2007 at 02:12:04PM +0200, Kostya wrote:
> > > On Sun, Nov 04, 2007 at 12:58:22AM +0100, Michael Niedermayer wrote:
> > [...]
> > > > [...]
> > > > > +    if(keyframe){
> > > > > +        c->buf_size = buf_size;
> > > > > +        c->bits = av_realloc(c->bits, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
> > > > > +        memcpy(c->bits, buf, buf_size);
> > > > > +        init_get_bits(gb, c->bits, buf_size * 8);
> > > > > +        memset(c->Q, 0, sizeof(c->Q));
> > > > > +    c->last_bits_used = 0;
> > > > > +    }
> > > > 
> > > > please remove this realloc() and memcpy() mess and decode the individual
> > > > frames which your decoder receives from the parser
> > > 
> > > I fear it would be overkill as parser needs to effectively duplicate decode_frame().
> > > MPC SV8 stores several frames in one packet, first of them is keyframe, they should
> > > be parsed as single bitstream with no byte paddings. Also there is no way to determine
> > > frame length without decoding it and using correct information from previous frame
> > > to decode current frame.
> > 
> > still theres no sense or need for realloc() and memcpy()
> 
> Removed

[...]
> +        c->bits = av_realloc(c->bits, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
> +        memcpy(c->bits, buf, buf_size);

doesnt seem so

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

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- 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/20071105/99ba5756/attachment.pgp>



More information about the ffmpeg-devel mailing list