[FFmpeg-devel] [PATCH] Make ff_lpc_calc_coefs order estimation flexible by passing parameters

Jai Menon realityman
Sat Aug 16 22:40:28 CEST 2008


Hi,

On Sunday 17 Aug 2008 1:38:51 am Michael Niedermayer wrote:
> On Sun, Aug 17, 2008 at 01:21:52AM +0530, Jai Menon wrote:
> > Hi,
> >
> > On Sunday 17 Aug 2008 12:42:33 am Jai Menon wrote:
> > > Hi,
> > >
> > > On Sunday 17 Aug 2008 12:36:54 am Jai Menon wrote:
> > > > Hi,
> > > >
> > > > Attached patch allows for order estimation to be varied based on
> > > > external parameters.
> > >
> > > This will allow for order estimation between a specific range or
> > > interval, particularly useful for the alac encoder.
> >
> > Again, based on Ramiro's advice, a more detailed incremental patchset.
>
> [...]
>
> > @@ -195,10 +195,20 @@ int ff_lpc_calc_coefs(DSPContext *s,
> >          i = opt_order-1;
> >          quantize_lpc_coefs(lpc[i], i+1, precision, coefs[i], &shift[i],
> > max_shift, zero_shift); } else {
> > +        if(omethod == ORDER_METHOD_RANGE) {
> > +            int i = opt_order = param_list[0];
> > +            while(i < param_list[1]) {
> > +                if(ref[i] > ref[opt_order-1])
> > +                    opt_order = i + 1;
> > +                i++;
> > +            }
> > +            quantize_lpc_coefs(lpc[opt_order-1], opt_order, precision,
> > coefs[opt_order-1], &shift[opt_order-1], max_shift, zero_shift); +       
> > } else {
> >          for(i=0; i<max_order; i++) {
> >              quantize_lpc_coefs(lpc[i], i+1, precision, coefs[i],
> > &shift[i], max_shift, zero_shift); }
> >      }
> > +    }
> >
> >      return opt_order;
> >  }
>
> As the current omethods (If i understand the code correctly) are not
> limiting their search range. This is a bug, and it can either be fixed or
> left but i will not accept the addition of a new omethod because the
> existing ones are buggy.
>
> Besides max_order is passed as parameter already and we do not need a
> opaque parameter list, that is the addition of such list is rejected.
>

So should I just hardcode the selection among 4th and 6th orders (based on 
reflection coeffs) in a new order method solely for alac?

Regards,

Jai Menon




More information about the ffmpeg-devel mailing list