[FFmpeg-devel] [PATCH] Common ACELP code & G.729 [3/7] - vectors operations
Vladimir Voroshilov
voroshil
Sat May 17 20:39:42 CEST 2008
2008/5/18 Michael Niedermayer <michaelni at gmx.at>:
> 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.
Did you see that second one is using gray decoding when first is not?
Or you mean restoring "5*i" tables, one with gray coding and one
without (you asked
me to remove such tables some time ago)
and pass them (as long as fc_2pulses_9bits_track2 table) via parameters?
--
Regards,
Vladimir Voroshilov mailto:voroshil at gmail.com
JID: voroshil at gmail.com, voroshil at jabber.ru
ICQ: 95587719
More information about the ffmpeg-devel
mailing list