static void reconstruct_stereo_16(int32_t *buffer[MAX_CHANNELS],

                                  int16_t *buffer_out,

                                  int numchannels, int numsamples,

                                  uint8_t interlacing_shift,

                                  uint8_t interlacing_leftweight)

{

    int i;

    if (numsamples <= 0)

        return;



    /* weighted interlacing */

    if (interlacing_leftweight) {

        for (i = 0; i < numsamples; i++) {

            int32_t a, b;



            a = buffer[0][i];

            b = buffer[1][i];



            a -= (b * interlacing_leftweight) >> interlacing_shift;

            b += a;



            buffer_out[i*numchannels] = b;

            buffer_out[i*numchannels + 1] = a;

        }



        return;

    }



    /* otherwise basic interlacing took place */

    for (i = 0; i < numsamples; i++) {

        int16_t left, right;



        left = buffer[0][i];

        right = buffer[1][i];



        buffer_out[i*numchannels] = left;

        buffer_out[i*numchannels + 1] = right;

    }

}

static void reconstruct_stereo_16(int32_t *buffer[MAX_CHANNELS],

                                  int16_t *buffer_out,

                                  int numchannels, int numsamples,

                                  uint8_t interlacing_shift,

                                  uint8_t interlacing_leftweight)

{

    int i;

    if (numsamples <= 0)

        return;



    

    if (interlacing_leftweight) {

        for (i = 0; i < numsamples; i++) {

            int32_t a, b;



            a = buffer[0][i];

            b = buffer[1][i];



            a -= (b * interlacing_leftweight) >> interlacing_shift;

            b += a;



            buffer_out[i*numchannels] = b;

            buffer_out[i*numchannels + 1] = a;

        }



        return;

    }



    

    for (i = 0; i < numsamples; i++) {

        int16_t left, right;



        left = buffer[0][i];

        right = buffer[1][i];



        buffer_out[i*numchannels] = left;

        buffer_out[i*numchannels + 1] = right;

    }

}

static void FUNC_0(int32_t *VAR_0[MAX_CHANNELS],

                                  int16_t *VAR_1,

                                  int VAR_2, int VAR_3,

                                  uint8_t VAR_4,

                                  uint8_t VAR_5)

{

    int VAR_6;

    if (VAR_3 <= 0)

        return;



    

    if (VAR_5) {

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

            int32_t a, b;



            a = VAR_0[0][VAR_6];

            b = VAR_0[1][VAR_6];



            a -= (b * VAR_5) >> VAR_4;

            b += a;



            VAR_1[VAR_6*VAR_2] = b;

            VAR_1[VAR_6*VAR_2 + 1] = a;

        }



        return;

    }



    

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

        int16_t left, right;



        left = VAR_0[0][VAR_6];

        right = VAR_0[1][VAR_6];



        VAR_1[VAR_6*VAR_2] = left;

        VAR_1[VAR_6*VAR_2 + 1] = right;

    }

}

static void FUNC_0(int32_t *VAR_0[MAX_CHANNELS],
int16_t *VAR_1,
int VAR_2, int VAR_3,
uint8_t VAR_4,
uint8_t VAR_5)
{ int VAR_6; if (VAR_3 <= 0)
return; if (VAR_5) { for (VAR_6 = 0; VAR_6 < VAR_3; VAR_6++) { int32_t a, b; a = VAR_0[0][VAR_6]; b = VAR_0[1][VAR_6]; a -= (b * VAR_5) >> VAR_4; b += a; VAR_1[VAR_6*VAR_2] = b; VAR_1[VAR_6*VAR_2 + 1] = a; } return; } for (VAR_6 = 0; VAR_6 < VAR_3; VAR_6++) { int16_t left, right; left = VAR_0[0][VAR_6]; right = VAR_0[1][VAR_6]; VAR_1[VAR_6*VAR_2] = left; VAR_1[VAR_6*VAR_2 + 1] = right; } }