static void decorrelate_stereo_24(int32_t *buffer[MAX_CHANNELS],

                                  int32_t *buffer_out,

                                  int32_t *wasted_bits_buffer[MAX_CHANNELS],

                                  int wasted_bits,

                                  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;



            if (wasted_bits) {

                b  = (b  << wasted_bits) | wasted_bits_buffer[0][i];

                a  = (a  << wasted_bits) | wasted_bits_buffer[1][i];

            }



            buffer_out[i * numchannels]     = b << 8;

            buffer_out[i * numchannels + 1] = a << 8;

        }

    } else {

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

            int32_t left, right;



            left  = buffer[0][i];

            right = buffer[1][i];



            if (wasted_bits) {

                left   = (left   << wasted_bits) | wasted_bits_buffer[0][i];

                right  = (right  << wasted_bits) | wasted_bits_buffer[1][i];

            }



            buffer_out[i * numchannels]     = left  << 8;

            buffer_out[i * numchannels + 1] = right << 8;

        }

    }

}

static void decorrelate_stereo_24(int32_t *buffer[MAX_CHANNELS],

                                  int32_t *buffer_out,

                                  int32_t *wasted_bits_buffer[MAX_CHANNELS],

                                  int wasted_bits,

                                  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;



            if (wasted_bits) {

                b  = (b  << wasted_bits) | wasted_bits_buffer[0][i];

                a  = (a  << wasted_bits) | wasted_bits_buffer[1][i];

            }



            buffer_out[i * numchannels]     = b << 8;

            buffer_out[i * numchannels + 1] = a << 8;

        }

    } else {

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

            int32_t left, right;



            left  = buffer[0][i];

            right = buffer[1][i];



            if (wasted_bits) {

                left   = (left   << wasted_bits) | wasted_bits_buffer[0][i];

                right  = (right  << wasted_bits) | wasted_bits_buffer[1][i];

            }



            buffer_out[i * numchannels]     = left  << 8;

            buffer_out[i * numchannels + 1] = right << 8;

        }

    }

}

static void FUNC_0(int32_t *VAR_0[MAX_CHANNELS],

                                  int32_t *VAR_1,

                                  int32_t *VAR_2[MAX_CHANNELS],

                                  int VAR_3,

                                  int VAR_4, int VAR_5,

                                  uint8_t VAR_6,

                                  uint8_t VAR_7)

{

    int VAR_8;



    if (VAR_5 <= 0)

        return;



    

    if (VAR_7) {

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

            int32_t a, b;



            a = VAR_0[0][VAR_8];

            b = VAR_0[1][VAR_8];



            a -= (b * VAR_7) >> VAR_6;

            b += a;



            if (VAR_3) {

                b  = (b  << VAR_3) | VAR_2[0][VAR_8];

                a  = (a  << VAR_3) | VAR_2[1][VAR_8];

            }



            VAR_1[VAR_8 * VAR_4]     = b << 8;

            VAR_1[VAR_8 * VAR_4 + 1] = a << 8;

        }

    } else {

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

            int32_t left, right;



            left  = VAR_0[0][VAR_8];

            right = VAR_0[1][VAR_8];



            if (VAR_3) {

                left   = (left   << VAR_3) | VAR_2[0][VAR_8];

                right  = (right  << VAR_3) | VAR_2[1][VAR_8];

            }



            VAR_1[VAR_8 * VAR_4]     = left  << 8;

            VAR_1[VAR_8 * VAR_4 + 1] = right << 8;

        }

    }

}

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