static void ssim_4x4x2_core(const uint8_t *main, int main_stride,

                            const uint8_t *ref, int ref_stride,

                            int sums[2][4])

{

    int x, y, z;



    for (z = 0; z < 2; z++) {

        uint32_t s1 = 0, s2 = 0, ss = 0, s12 = 0;



        for (y = 0; y < 4; y++) {

            for (x = 0; x < 4; x++) {

                int a = main[x + y * main_stride];

                int b = ref[x + y * ref_stride];



                s1  += a;

                s2  += b;

                ss  += a*a;

                ss  += b*b;

                s12 += a*b;

            }

        }



        sums[z][0] = s1;

        sums[z][1] = s2;

        sums[z][2] = ss;

        sums[z][3] = s12;

        main += 4;

        ref += 4;

    }

}

static void ssim_4x4x2_core(const uint8_t *main, int main_stride,

                            const uint8_t *ref, int ref_stride,

                            int sums[2][4])

{

    int x, y, z;



    for (z = 0; z < 2; z++) {

        uint32_t s1 = 0, s2 = 0, ss = 0, s12 = 0;



        for (y = 0; y < 4; y++) {

            for (x = 0; x < 4; x++) {

                int a = main[x + y * main_stride];

                int b = ref[x + y * ref_stride];



                s1  += a;

                s2  += b;

                ss  += a*a;

                ss  += b*b;

                s12 += a*b;

            }

        }



        sums[z][0] = s1;

        sums[z][1] = s2;

        sums[z][2] = ss;

        sums[z][3] = s12;

        main += 4;

        ref += 4;

    }

}

static void FUNC_0(const uint8_t *VAR_0, int VAR_1,

                            const uint8_t *VAR_2, int VAR_3,

                            int VAR_4[2][4])

{

    int VAR_5, VAR_6, VAR_7;



    for (VAR_7 = 0; VAR_7 < 2; VAR_7++) {

        uint32_t s1 = 0, s2 = 0, ss = 0, s12 = 0;



        for (VAR_6 = 0; VAR_6 < 4; VAR_6++) {

            for (VAR_5 = 0; VAR_5 < 4; VAR_5++) {

                int VAR_8 = VAR_0[VAR_5 + VAR_6 * VAR_1];

                int VAR_9 = VAR_2[VAR_5 + VAR_6 * VAR_3];



                s1  += VAR_8;

                s2  += VAR_9;

                ss  += VAR_8*VAR_8;

                ss  += VAR_9*VAR_9;

                s12 += VAR_8*VAR_9;

            }

        }



        VAR_4[VAR_7][0] = s1;

        VAR_4[VAR_7][1] = s2;

        VAR_4[VAR_7][2] = ss;

        VAR_4[VAR_7][3] = s12;

        VAR_0 += 4;

        VAR_2 += 4;

    }

}

static void FUNC_0(const uint8_t *VAR_0, int VAR_1,
const uint8_t *VAR_2, int VAR_3,
int VAR_4[2][4])
{ int VAR_5, VAR_6, VAR_7; for (VAR_7 = 0; VAR_7 < 2; VAR_7++) { uint32_t s1 = 0, s2 = 0, ss = 0, s12 = 0; for (VAR_6 = 0; VAR_6 < 4; VAR_6++) { for (VAR_5 = 0; VAR_5 < 4; VAR_5++) { int VAR_8 = VAR_0[VAR_5 + VAR_6 * VAR_1]; int VAR_9 = VAR_2[VAR_5 + VAR_6 * VAR_3]; s1  += VAR_8; s2  += VAR_9; ss  += VAR_8*VAR_8; ss  += VAR_9*VAR_9; s12 += VAR_8*VAR_9; } } VAR_4[VAR_7][0] = s1; VAR_4[VAR_7][1] = s2; VAR_4[VAR_7][2] = ss; VAR_4[VAR_7][3] = s12; VAR_0 += 4; VAR_2 += 4; } }