[FFmpeg-devel] [PATCH] use bytestream functions more in adpcm.c

Reimar Döffinger Reimar.Doeffinger
Sat Jul 12 16:20:38 CEST 2008


Hello,
On Sat, Jul 12, 2008 at 02:45:57PM +0100, M?ns Rullg?rd wrote:
> Reimar D?ffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de> writes:
> > seems there is some ancient and horribly obfuscated code in there.
> > Attached patch replaces most (all?) of them.
> > Regression tests succeed, but I only manually tested on MS ADPCM sample.
> > Btw. is that file indeed unmaintained?
> >
> > Greetings,
> > Reimar D?ffinger
> >
> > Index: libavcodec/adpcm.c
> > ===================================================================
> > --- libavcodec/adpcm.c	(revision 14175)
> > +++ libavcodec/adpcm.c	(working copy)
> > @@ -972,8 +972,7 @@
> >
> >          for(i=0; i<avctx->channels; i++){
> >              cs = &(c->status[i]);
> > -            cs->predictor = *samples++ = (int16_t)(src[0] + (src[1]<<8));
> > -            src+=2;
> > +            cs->predictor = *samples++ = (int16_t)bytestream_get_le16(&src);
> 
> Useless cast.

I let myself gladly be corrected, but I am quite certain that at least
some of the are required to make the compiler do the sign extension.




More information about the ffmpeg-devel mailing list