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

Michael Niedermayer michaelni
Sat Aug 16 22:08:51 CEST 2008


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.

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- 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/20080816/e3284937/attachment.pgp>



More information about the ffmpeg-devel mailing list