[FFmpeg-devel] [PATCH] Common ACELP code & G.729 [3/7] - vectors operations

Michael Niedermayer michaelni
Sat May 17 20:14:35 CEST 2008


On Sat, May 17, 2008 at 10:25:05PM +0700, Vladimir Voroshilov wrote:
> 2008/5/14 Michael Niedermayer <michaelni at gmx.at>:
> > On Wed, May 14, 2008 at 12:08:01AM +0700, Vladimir Voroshilov wrote:
> >> 2008/5/12 Michael Niedermayer <michaelni at gmx.at>:
> >> > On Sun, May 11, 2008 at 09:46:04PM +0700, Vladimir Voroshilov wrote:
> >> >  > 2008/5/9 Vladimir Voroshilov <voroshil at gmail.com>:
> 
> [...]
> 
> >> >  > > Hm. I hope, this version is better..
> >> >
> >> >  there are still 2 seperate functions and now there are even wraper functions
> >> >  this is not better IMHO.
> >> >  see my example above, is there a problem with it?
> >>
> >> Already implemented yours routine.
> >> Now i should remove those wrappers,
> >> make common routine non-static and
> >> use it in main loop, right?
> >
> > yes
> >
> >
> >>
> >> >  > +/**
> >> >  > + * low-pass FIR (Finite Impulse Response) filter coefficients
> >> >  > + *
> >> >  > + *   A similar filter is named b30 in G.729.
> >> >  > + *
> 
> [...]
> 
> >> >  Maybe the generic interpolation should be in a seperate file.
> >>
> >> Move it back to acelp_filters together with corresponding lookup tables?
> >
> > yes, it seems o fit better there
> 
> Attached patch is version with  removed interpolation filter.
[...]

> +void ff_acelp_4pulses_13_21_bits(
> +        int16_t* fc_v,
> +        int fc_index,
> +        int pulses_signs,
> +        int bits)
> +{
> +    int mask = (1 << bits) - 1;
> +    int i, index;
> +
> +    for(i=0; i<3; i++)
> +    {
> +        index = i + 5 * (fc_index & mask);
> +        fc_v[ index ] += (pulses_signs & 1) ? 8191 : -8192; // +/-1 in (2.13)
> +
> +        fc_index >>= bits;
> +        pulses_signs >>= 1;
> +    }
> +
> +    index = 3 + (fc_index & 1) + 5 * ((fc_index>>1) & mask);
> +    fc_v[ index ] += (pulses_signs & 1) ? 8191 : -8192;
> +}
> +
> +void ff_acelp_fc_2pulses_9bits_g729d(
> +        int16_t* fc_v,
> +        int fc_index,
> +        int pulses_signs)
> +{
> +    int index;
> +
> +    index = ((5 * gray_decode[fc_index & 15]) >> 1) + 1;
> +    fc_v[ index ] += (pulses_signs & 1) ? 8191 : -8192; // +/-1 in (2.13)
> +
> +    pulses_signs >>= 1;
> +    fc_index >>= 4;
> +
> +    index = fc_2pulses_9bits_track2[gray_decode[fc_index & 31]];
> +    fc_v[ index ] += (pulses_signs & 1) ? 8191 : -8192; // +/-1 in (2.13)
> +}

duplicate

My suggestion for the third time:

> >  > >>     for(i=0; i<pulse_count; i++){
> >  > >>         index = i + tab[fc_index & mask]; 
> >  > >>         fc_v[ index ] += (pulses_signs & 1) ? 8191 : -8192;
> >  > >>
> >  > >>         fc_index >>= bits;
> >  > >>         pulses_signs >>= 1;
> >  > >>     }
> >  > >>
> >  > >>     index = tab2[fc_index];
> >  > >>     fc_v[ index ] += pulses_signs ? 8191 : -8192;

Or is there some reason why you do not use this? So far you didnt say
why not IIRC.

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- 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/20080517/bf997ba9/attachment.pgp>



More information about the ffmpeg-devel mailing list