On Tue,  4 Mar 2014 00:42:09 +0100, Janne Grunau <janne-li...@jannau.net> wrote:
> Not hooked up to FATE due to fear of random failures due to float
> instability.
> 
> float_dsp-test: use 16 * 3 * 5 as length
> ---
>  libavutil/Makefile    |   1 +
>  libavutil/float_dsp.c | 274 
> ++++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 275 insertions(+)
> 
> diff --git a/libavutil/Makefile b/libavutil/Makefile
> index f663f18..5869e67 100644
> --- a/libavutil/Makefile
> +++ b/libavutil/Makefile
> @@ -122,6 +122,7 @@ TESTPROGS = adler32                                       
>               \
>              des                                                         \
>              eval                                                        \
>              fifo                                                        \
> +            float_dsp                                                   \
>              hmac                                                        \
>              lfg                                                         \
>              lls                                                         \
> diff --git a/libavutil/float_dsp.c b/libavutil/float_dsp.c
> index 3707e06..22c3c15 100644
> --- a/libavutil/float_dsp.c
> +++ b/libavutil/float_dsp.c
> @@ -132,3 +132,277 @@ av_cold void avpriv_float_dsp_init(AVFloatDSPContext 
> *fdsp, int bit_exact)
>      ff_float_dsp_init_x86(fdsp);
>  #endif
>  }
> +
> +#ifdef TEST
> +
> +#include <float.h>
> +#include <math.h>
> +#include <stdint.h>
> +#include <string.h>
> +
> +#include "cpu.h"
> +#include "lfg.h"
> +#include "log.h"
> +#include "mem.h"
> +#include "random_seed.h"
> +
> +#define LEN 240
> +
> +static void fill_float_array(AVLFG *lfg, float *a, int len)
> +{
> +        int i;
> +        double bmg[2], stddev = 10.0, mean = 0.0;
> +
> +        for (i = 0; i < len; i += 2) {
> +            av_bmg_get(lfg, bmg);
> +            a[i]     = bmg[0] * stddev + mean;
> +            a[i + 1] = bmg[1] * stddev + mean;
> +        }

Other than the excessive indentation here and below, the patch looks sane enough
to me

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to