[FFmpeg-devel] [PATCH] Common fixed-point ACELP routines (1/3) - math

Michael Niedermayer michaelni
Fri Apr 25 18:01:49 CEST 2008


On Fri, Apr 25, 2008 at 10:41:27PM +0700, Vladimir Voroshilov wrote:
> Michael Niedermayer wrote: 
> > On Fri, Apr 25, 2008 at 07:14:18PM +0700, Vladimir Voroshilov wrote:
> > > Michael Niedermayer wrote: 
> > > > On Fri, Apr 25, 2008 at 02:20:46PM +0700, Vladimir Voroshilov wrote:
> > > 
> > > [...]
> > > 
> > > > > +/**
> > > > > + * \brief Calculates sum of array elements multiplications
> > > > > + * \param speech array with input data
> > > > > + * \param cycles number elements to proceed
> > > > > + * \param offset offset for calculation sum of s[i]*s[i+offset]
> > > > > + * \param shift right shift by this value will be done before multiplication
> > > > > + *
> > > > > + * \return sum of multiplications
> > > > > + *
> > > > > + * \note array must be at least length+offset long!
> > > >                                    ^^^^^^
> > > > its called cycles in the function, and yes i agree length is a better name
> > > > 
> > > > 
> > > > > + */
> > > > > +static int sum_of_squares(const int16_t* speech, int cycles, int offset, int shift)
> > > > > +{
> > > > > +    const int16_t* speech_end;
> > > > > +    int sum = 0;
> > > > > +
> > > > 
> > > > > +    shift <<= 1;
> > > > 
> > > > I would prefer if this is done outside of the function, doing it inside
> > > > means only even shift values can be used.
> > > v> 
> > > 
> > > All above fixed.
> > 
> > looks ok
> 
> So can be committed right now as is (with acelp_math name) ?

yes


> 
> What about such log message:
> "Fixed-point implementation of ff_cos, ff_log2, ff_exp2.
> Also implemented routine for calculating sum(a[i] * a[i-offset]>>shift)"

yes

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

It is not what we do, but why we do it that matters.
-------------- 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/20080425/0144cdd8/attachment.pgp>



More information about the ffmpeg-devel mailing list