On Fri, Jul 19, 2013 at 09:29:12PM +0200, Vitor Sessak wrote:
> Hello!
> 
> On Fri, Jul 19, 2013 at 9:22 AM, Kostya Shishkov
> <[email protected]>wrote:
> 
> > ---
> > It's good enough for the only file I care about but maybe it's useful for
> > the
> > others too.
> >
> > The source can benefit from heavy diegoing (because it's mostly TwinVQ
> > decoder
> > bits that were tweaked to be close to the reference decoder, or the ones
> > that
> > had to be duplicated because of the different bitstream reader).
> >
> 
> Cool!
> 
> I have just one comment right now, I'll post a full review soon:
> 
> 
> > +/**
> > + * Sum to data a periodic peak of a given period, width and shape.
> > + *
> > + * @param period the period of the peak divised by 400.0
> > + */
> > +static void add_peak(float period, int width, const float *shape,
> > +                     float ppc_gain, float *speech, int len)
> > +{
> > +    int i, j;
> > +
> > +    const float *shape_end = shape + len;
> > +    int center;
> > +
> > +    // First peak centered around zero
> > +    for (i = 0; i < width/2; i++)
> > +        speech[i] += ppc_gain * *shape++;
> > +
> > +    for (i = 1; i < ROUNDED_DIV(len,width) ; i++) {
> > +        center = (int)(i * period + 0.5);
> > +        for (j = width/-2; j < (width-1)/2+1; j++)
> > +            speech[j+center] += ppc_gain * *shape++;
> > +    }
> > +
> > +    // For the last block, be careful not to go beyond the end of the
> > buffer
> > +    center = (int)(i * period + 0.5);
> > +    for (j = -width/2; j < (width - 1)/2 + 1 && shape < shape_end; j++)
> > +        speech[j+center] += ppc_gain * *shape++;
> > +}
> >
> This function looks very similar to the twinvq one (besides that the
> period is not multiplied by 400). Did you try to reuse it?

Of course, but here it needs floating-point period (and for mono source it's
derived as exponent that does not involve 400 at all).
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to