[FFmpeg-devel] [PATCH] Common ACELP routines (2/3) - filters
Vladimir Voroshilov
voroshil
Sun Apr 27 16:33:36 CEST 2008
On Sun, Apr 27, 2008 at 8:57 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Sun, Apr 27, 2008 at 12:02:01PM +0700, Vladimir Voroshilov wrote:
> > On Sun, Apr 27, 2008 at 5:08 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> > >
> > > On Sun, Apr 27, 2008 at 03:12:39AM +0700, Vladimir Voroshilov wrote:
> >
> > [...]
> >
> > > > +void ff_acelp_convolve_circ(
> > > > + int16_t* fc_out,
> > > > + const int16_t* fc_in,
> > > > + const int16_t* filter,
> > >
> > > > + int subframe_size)
> > > > +{
> > > > + int i, k;
> > > > +
> > > > + memset(fc_out, 0, subframe_size * sizeof(int16_t));
> > > > +
> > > > + for(i=0; i<subframe_size; i++)
> > > > + {
> > > > + if(fc_in[i])
> > > > + {
> > > > + for(k=0; k<i; k++)
> > > > + fc_out[k] += (fc_in[i] * filter[subframe_size + k - i]) >> 15;
> > > > +
> > > > + for(k=i; k<subframe_size; k++)
> > > > + fc_out[k] += (fc_in[i] * filter[k - i]) >> 15;
> > > > + }
> > > > + }
> > > > +}
> > >
> > > where is this used? I cant find it in g729dec_18.diff
> >
> > You already asked me few mails ago.
> > This routines is used for AMR and G.729D
> > You agreed to keep it here.
>
> Id like to see the code using it. Its hard to comment code which is
> "incomplete"
I've attached G729 vs G.729D patch.
If you need SVN vs G.729D (40kb, only g729dec) just say me.
Should i also post current version of remaining parts (core,
postfilter, tables, etc) ?
> > > [...]
> > > > +void ff_acelp_weighted_filter(
> > > > + int16_t *out,
> > > > + const int16_t* in,
> > > > + int16_t weight,
> > > > + int filter_length)
> > > > +{
> > > > + int weight_pow = 1 << 15;
> > > > + int n;
> > > > +
> > > > + for(n=0; n<filter_length; n++)
> > > > + {
> > >
> > > > + // (0.15) * (3.12) -> (3.12) with rounding
> > >
> > > please write the comment in the same order as the calculation:
> > > (3.12) = (0.15) * (3.12) or whatever
> >
> > Here and in another places (like recently committed lsp.c) such comment
> > describes right side of expression only and "->" in it means change of the
> > fixed-point base (right shift in this particular case)
> > Comment should be read as "multiply (0.15) by (3.12) and then scale
> > result to (3.12)"
> >
> > Thus comment and calculation order corresponds each other, imho.
>
> a= b * c
> b * c -> a
> no they are ordered differently a,b,c vs. b,c,a
Ok.
I'll also send separate patch for already committed parts.
--
Regards,
Vladimir Voroshilov mailto:voroshil at gmail.com
JID: voroshil at gmail.com, voroshil at jabber.ru
ICQ: 95587719
-------------- next part --------------
A non-text attachment was scrubbed...
Name: acelp_filt_38.diff
Type: text/x-diff
Size: 12282 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080427/3b4f0802/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: g729_g729d_38.diff
Type: text/x-diff
Size: 16993 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080427/3b4f0802/attachment-0001.diff>
More information about the ffmpeg-devel
mailing list