static float ssim_plane(uint8_t *main, int main_stride,

                        uint8_t *ref, int ref_stride,

                        int width, int height, void *temp)

{

    int z = 0;

    int x, y;

    float ssim = 0.0;

    int (*sum0)[4] = temp;

    int (*sum1)[4] = sum0 + (width >> 2) + 3;



    width >>= 2;

    height >>= 2;



    for (y = 1; y < height; y++) {

        for (; z <= y; z++) {

            FFSWAP(void*, sum0, sum1);

            for (x = 0; x < width; x+=2)

                ssim_4x4x2_core(&main[4 * (x + z * main_stride)], main_stride,

                                &ref[4 * (x + z * ref_stride)], ref_stride,

                                &sum0[x]);

        }



        ssim += ssim_endn(sum0, sum1, width - 1);

    }



    return ssim / ((height - 1) * (width - 1));

}

static float ssim_plane(uint8_t *main, int main_stride,

                        uint8_t *ref, int ref_stride,

                        int width, int height, void *temp)

{

    int z = 0;

    int x, y;

    float ssim = 0.0;

    int (*sum0)[4] = temp;

    int (*sum1)[4] = sum0 + (width >> 2) + 3;



    width >>= 2;

    height >>= 2;



    for (y = 1; y < height; y++) {

        for (; z <= y; z++) {

            FFSWAP(void*, sum0, sum1);

            for (x = 0; x < width; x+=2)

                ssim_4x4x2_core(&main[4 * (x + z * main_stride)], main_stride,

                                &ref[4 * (x + z * ref_stride)], ref_stride,

                                &sum0[x]);

        }



        ssim += ssim_endn(sum0, sum1, width - 1);

    }



    return ssim / ((height - 1) * (width - 1));

}

static float FUNC_0(uint8_t *VAR_0, int VAR_1,

                        uint8_t *VAR_2, int VAR_3,

                        int VAR_4, int VAR_5, void *VAR_6)

{

    int VAR_7 = 0;

    int VAR_8, VAR_9;

    float VAR_10 = 0.0;

    int (*VAR_11)[4] = VAR_6;

    int (*VAR_12)[4] = VAR_11 + (VAR_4 >> 2) + 3;



    VAR_4 >>= 2;

    VAR_5 >>= 2;



    for (VAR_9 = 1; VAR_9 < VAR_5; VAR_9++) {

        for (; VAR_7 <= VAR_9; VAR_7++) {

            FFSWAP(void*, VAR_11, VAR_12);

            for (VAR_8 = 0; VAR_8 < VAR_4; VAR_8+=2)

                ssim_4x4x2_core(&VAR_0[4 * (VAR_8 + VAR_7 * VAR_1)], VAR_1,

                                &VAR_2[4 * (VAR_8 + VAR_7 * VAR_3)], VAR_3,

                                &VAR_11[VAR_8]);

        }



        VAR_10 += ssim_endn(VAR_11, VAR_12, VAR_4 - 1);

    }



    return VAR_10 / ((VAR_5 - 1) * (VAR_4 - 1));

}

static float FUNC_0(uint8_t *VAR_0, int VAR_1,
uint8_t *VAR_2, int VAR_3,
int VAR_4, int VAR_5, void *VAR_6)
{ int VAR_7 = 0; int VAR_8, VAR_9; float VAR_10 = 0.0; int (*VAR_11)[4] = VAR_6; int (*VAR_12)[4] = VAR_11 + (VAR_4 >> 2) + 3; VAR_4 >>= 2; VAR_5 >>= 2; for (VAR_9 = 1; VAR_9 < VAR_5; VAR_9++) { for (; VAR_7 <= VAR_9; VAR_7++) { FFSWAP(void*, VAR_11, VAR_12); for (VAR_8 = 0; VAR_8 < VAR_4; VAR_8+=2) ssim_4x4x2_core(&VAR_0[4 * (VAR_8 + VAR_7 * VAR_1)], VAR_1,
&VAR_2[4 * (VAR_8 + VAR_7 * VAR_3)], VAR_3,
&VAR_11[VAR_8]); } VAR_10 += ssim_endn(VAR_11, VAR_12, VAR_4 - 1); } return VAR_10 / ((VAR_5 - 1) * (VAR_4 - 1)); }