[FFmpeg-devel] [PATCH] Add x86-optimized versions of exponent_min().

Måns Rullgård mans
Thu Feb 10 00:37:00 CET 2011


Justin Ruggles <justin.ruggles at gmail.com> writes:

> @@ -604,7 +580,7 @@ static void encode_exponents(AC3EncodeContext *s)
>      for (ch = 0; ch < s->channels; ch++) {
>          exp          = s->blocks[0].exp[ch];
>          exp_strategy = s->exp_strategy[ch];
> -        nb_coefs     = s->nb_coefs[ch];
> +        nb_coefs     = FFALIGN(s->nb_coefs[ch], 16); // align for ac3_exponent_min()

Is this a good idea?  Wouldn't it be better to pass the actual value to
the function, but allow the implementation to round it up.  The buffer
is already suitably padded.

>          blk = 0;
>          while (blk < AC3_MAX_BLOCKS) {
> @@ -616,7 +592,7 @@ static void encode_exponents(AC3EncodeContext *s)
>              num_reuse_blocks = blk1 - blk - 1;
>
>              /* for the EXP_REUSE case we select the min of the exponents */
> -            exponent_min(exp, num_reuse_blocks, nb_coefs);
> +            s->ac3dsp.ac3_exponent_min(exp, num_reuse_blocks, nb_coefs);
>
>              encode_exponents_blk_ch(exp, nb_coefs, exp_strategy[blk]);
>

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list