[FFmpeg-soc] [soc]: r5127 - als/alsdec.c

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Aug 15 14:45:52 CEST 2009


On Sat, Aug 15, 2009 at 02:36:35PM +0200, thilo.borgmann wrote:
> Author: thilo.borgmann
> Date: Sat Aug 15 14:36:35 2009
> New Revision: 5127
> 
> Log:
> Merge two loops to reduce code duplication. Benchmark shows up to 2%
> less dezicyles for a single loop.
> 
> Modified:
>    als/alsdec.c
> 
> Modified: als/alsdec.c
> ==============================================================================
> --- als/alsdec.c	Sat Aug 15 14:04:02 2009	(r5126)
> +++ als/alsdec.c	Sat Aug 15 14:36:35 2009	(r5127)
> @@ -642,23 +642,25 @@ static int read_block_data(ALSDecContext
>          if (ra_block) {
>              unsigned int progressive = FFMIN(block_length, opt_order);
>  
> -            for (smp = 0; smp < progressive; smp++) {
> -                y = 1 << 19;
> -
> -                for (sb = 0; sb < smp; sb++)
> -                    y += lpc_cof[sb] * raw_samples[smp - (sb + 1)];
> +            for (smp = 0; smp < block_length; smp++) {
> +                unsigned int max, convert;
>  
> -                raw_samples[smp] -= y >> 20;
> -                parcor_to_lpc(smp, quant_cof, lpc_cof);
> -            }
> +                if (smp < progressive) {
> +                    max     = smp;
> +                    convert = 1;
> +                } else {
> +                    max     = progressive;
> +                    convert = 0;
> +                }
>  
> -            for (; smp < block_length; smp++) {
>                  y = 1 << 19;
>  
> -                for (sb = 0; sb < progressive; sb++)
> +                for (sb = 0; sb < max; sb++)
>                      y += lpc_cof[sb] * raw_samples[smp - (sb + 1)];
>  
>                  raw_samples[smp] -= y >> 20;
> +                if (convert)
> +                    parcor_to_lpc(smp, quant_cof, lpc_cof);
>              }

Hmm...
tried
max = smp;
convert = 1;
outside the loop and inside
if (smp == progessive) {
max = progressive;
convert = 0;
}
?


More information about the FFmpeg-soc mailing list