static int16_t *precalc_coefs(double dist25, int depth)

{

    int i;

    double gamma, simil, C;

    int16_t *ct = av_malloc((512<<LUT_BITS)*sizeof(int16_t));

    if (!ct)

        return NULL;



    gamma = log(0.25) / log(1.0 - FFMIN(dist25,252.0)/255.0 - 0.00001);



    for (i = -255<<LUT_BITS; i <= 255<<LUT_BITS; i++) {

        double f = ((i<<(9-LUT_BITS)) + (1<<(8-LUT_BITS)) - 1) / 512.0; // midpoint of the bin

        simil = 1.0 - FFABS(f) / 255.0;

        C = pow(simil, gamma) * 256.0 * f;

        ct[(256<<LUT_BITS)+i] = lrint(C);

    }



    ct[0] = !!dist25;

    return ct;

}

static int16_t *precalc_coefs(double dist25, int depth)

{

    int i;

    double gamma, simil, C;

    int16_t *ct = av_malloc((512<<LUT_BITS)*sizeof(int16_t));

    if (!ct)

        return NULL;



    gamma = log(0.25) / log(1.0 - FFMIN(dist25,252.0)/255.0 - 0.00001);



    for (i = -255<<LUT_BITS; i <= 255<<LUT_BITS; i++) {

        double f = ((i<<(9-LUT_BITS)) + (1<<(8-LUT_BITS)) - 1) / 512.0; 

        simil = 1.0 - FFABS(f) / 255.0;

        C = pow(simil, gamma) * 256.0 * f;

        ct[(256<<LUT_BITS)+i] = lrint(C);

    }



    ct[0] = !!dist25;

    return ct;

}

static int16_t *FUNC_0(double dist25, int depth)

{

    int VAR_0;

    double VAR_1, VAR_2, VAR_3;

    int16_t *ct = av_malloc((512<<LUT_BITS)*sizeof(int16_t));

    if (!ct)

        return NULL;



    VAR_1 = log(0.25) / log(1.0 - FFMIN(dist25,252.0)/255.0 - 0.00001);



    for (VAR_0 = -255<<LUT_BITS; VAR_0 <= 255<<LUT_BITS; VAR_0++) {

        double f = ((VAR_0<<(9-LUT_BITS)) + (1<<(8-LUT_BITS)) - 1) / 512.0; 

        VAR_2 = 1.0 - FFABS(f) / 255.0;

        VAR_3 = pow(VAR_2, VAR_1) * 256.0 * f;

        ct[(256<<LUT_BITS)+VAR_0] = lrint(VAR_3);

    }



    ct[0] = !!dist25;

    return ct;

}

static int16_t *FUNC_0(double dist25, int depth)
{ int VAR_0; double VAR_1, VAR_2, VAR_3; int16_t *ct = av_malloc((512<<LUT_BITS)*sizeof(int16_t)); if (!ct)
return NULL; VAR_1 = log(0.25) / log(1.0 - FFMIN(dist25,252.0)/255.0 - 0.00001); for (VAR_0 = -255<<LUT_BITS; VAR_0 <= 255<<LUT_BITS; VAR_0++) { double f = ((VAR_0<<(9-LUT_BITS)) + (1<<(8-LUT_BITS)) - 1) / 512.0; VAR_2 = 1.0 - FFABS(f) / 255.0; VAR_3 = pow(VAR_2, VAR_1) * 256.0 * f; ct[(256<<LUT_BITS)+VAR_0] = lrint(VAR_3); } ct[0] = !!dist25; return ct; }