On 04/09/2013 06:57 PM, Christophe Gisquet wrote:
> This patch can be controversial, by assuming floats are IEEE-754 and
> particular behaviour of the FPU will get in the way.
> Timing on Arrandale and Win32 (thus, x87 FPU is used in the reference).
> 
> sbr_qmf_pre_shuffle_c: 115 to 76
> sbr_neg_odd_64_c: 84 to 55
> sbr_qmf_post_shuffle_c: 112 to 83
> ---
>  libavcodec/sbrdsp.c | 50 +++++++++++++++++++++++++++++++++-----------------
>  1 file changed, 33 insertions(+), 17 deletions(-)
[...]

I'm generally ok with the patch. I'm pretty sure Libav won't work on
non-IEEE-754 due to assumptions being made in other places as well. It
seems safe enough to me. Maybe others disagree though?

> @@ -135,11 +151,11 @@ static void sbr_autocorrelate_c(const float x[40][2], 
> float phi[3][2][2])
>      float real_sum1 = 0.f, imag_sum1 = 0.f, real_sum0 = 0.0f;
>      int   i;
>      for (i = 1; i < 38; i++) {
> -        real_sum0 += x[i][0] * x[i  ][0] + x[i][1] * x[i  ][1];
> -        real_sum1 += x[i][0] * x[i+1][0] + x[i][1] * x[i+1][1];
> -        imag_sum1 += x[i][0] * x[i+1][1] - x[i][1] * x[i+1][0];
> -        real_sum2 += x[i][0] * x[i+2][0] + x[i][1] * x[i+2][1];
> -        imag_sum2 += x[i][0] * x[i+2][1] - x[i][1] * x[i+2][0];
> +        real_sum0 += x[i][0] * x[i    ][0] + x[i][1] * x[i    ][1];
> +        real_sum1 += x[i][0] * x[i + 1][0] + x[i][1] * x[i + 1][1];
> +        imag_sum1 += x[i][0] * x[i + 1][1] - x[i][1] * x[i + 1][0];
> +        real_sum2 += x[i][0] * x[i + 2][0] + x[i][1] * x[i + 2][1];
> +        imag_sum2 += x[i][0] * x[i + 2][1] - x[i][1] * x[i + 2][0];
>      }
>      phi[2-2][1][0] = real_sum2;
>      phi[2-2][1][1] = imag_sum2;

But that hunk looks like unrelated cosmetics.

-Justin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to