[FFmpeg-devel] [PATCH/DRAFT] MonkeyAudio Demuxer/Decoder

Uoti Urpala uoti.urpala
Mon Jun 25 17:07:06 CEST 2007


On Mon, 2007-06-25 at 15:28 +0200, Michael Niedermayer wrote:
> On Mon, Jun 25, 2007 at 02:59:31PM +0300, Kostya wrote:
> [...]
> > [...] 
> > > > > +
> > > > > +static inline void vector_add (int16_t* v1, int16_t* v2, int order)
> > > > > +{
> > > > > +  int or = 1;
> > > > > +  if (order > 32)
> > > > > +    or = (order >> 5);
> > > > > +
> > > > > +  while (or--)
> > > > > +  {
> > > > > +    int i;
> > > > > +
> > > > > +    for (i = 0; i < 16; i++)
> > > > > +      *v1++ += *v2++;
> > > > > +
> > > > > +    if (order > 16)
> > > > > +      for (i = 0; i < 16; i++)
> > > > > +        *v1++ += *v2++;
> > > > > +  }
> > > > > +}
> > > 
> > > > and this whole function is just
> > > > for (i = 0; i < order; i++)
> > > >     *v1++ += *v2++;
> > > 
> > > I've tested it and it's not :-(
> > 
> > it does this fixed number of times:
> > order <= 16: 16 times;
> > order <= 32: 32 times;
> > order > 32: (order >> 5) * 32 times or order & ~31 times. 
> 
> this function isnt called with any order which is not a multiple of 16 
> or at least i thouhght so when i wrote my suggestion about simplifying
> it

Values greater than 32 are rounded down to the nearest multiple of 32,
so (2n+1)*16 becomes (2n)*16.





More information about the ffmpeg-devel mailing list