static void fix_coding_method_array (int sb, int channels, sb_int8_array coding_method)

{

    int j,k;

    int ch;

    int run, case_val;

    int switchtable[23] = {0,5,1,5,5,5,5,5,2,5,5,5,5,5,5,5,3,5,5,5,5,5,4};



    for (ch = 0; ch < channels; ch++) {

        for (j = 0; j < 64; ) {

            if((coding_method[ch][sb][j] - 8) > 22) {

                run = 1;

                case_val = 8;

            } else {

                switch (switchtable[coding_method[ch][sb][j]]) {

                    case 0: run = 10; case_val = 10; break;

                    case 1: run = 1; case_val = 16; break;

                    case 2: run = 5; case_val = 24; break;

                    case 3: run = 3; case_val = 30; break;

                    case 4: run = 1; case_val = 30; break;

                    case 5: run = 1; case_val = 8; break;

                    default: run = 1; case_val = 8; break;

                }

            }

            for (k = 0; k < run; k++)

                if (j + k < 128)

                    if (coding_method[ch][sb + (j + k) / 64][(j + k) % 64] > coding_method[ch][sb][j])

                        if (k > 0) {

                           SAMPLES_NEEDED

                            //not debugged, almost never used

                            memset(&coding_method[ch][sb][j + k], case_val, k * sizeof(int8_t));

                            memset(&coding_method[ch][sb][j + k], case_val, 3 * sizeof(int8_t));

                        }

            j += run;

        }

    }

}

static void fix_coding_method_array (int sb, int channels, sb_int8_array coding_method)

{

    int j,k;

    int ch;

    int run, case_val;

    int switchtable[23] = {0,5,1,5,5,5,5,5,2,5,5,5,5,5,5,5,3,5,5,5,5,5,4};



    for (ch = 0; ch < channels; ch++) {

        for (j = 0; j < 64; ) {

            if((coding_method[ch][sb][j] - 8) > 22) {

                run = 1;

                case_val = 8;

            } else {

                switch (switchtable[coding_method[ch][sb][j]]) {

                    case 0: run = 10; case_val = 10; break;

                    case 1: run = 1; case_val = 16; break;

                    case 2: run = 5; case_val = 24; break;

                    case 3: run = 3; case_val = 30; break;

                    case 4: run = 1; case_val = 30; break;

                    case 5: run = 1; case_val = 8; break;

                    default: run = 1; case_val = 8; break;

                }

            }

            for (k = 0; k < run; k++)

                if (j + k < 128)

                    if (coding_method[ch][sb + (j + k) / 64][(j + k) % 64] > coding_method[ch][sb][j])

                        if (k > 0) {

                           SAMPLES_NEEDED

                            

                            memset(&coding_method[ch][sb][j + k], case_val, k * sizeof(int8_t));

                            memset(&coding_method[ch][sb][j + k], case_val, 3 * sizeof(int8_t));

                        }

            j += run;

        }

    }

}

                switch (switchtable[coding_method[ch][sb][j]]) {
static void FUNC_0 (int VAR_0, int VAR_1, sb_int8_array VAR_2)

{

    int VAR_3,VAR_4;

    int VAR_5;

    int VAR_6, VAR_7;

    int VAR_8[23] = {0,5,1,5,5,5,5,5,2,5,5,5,5,5,5,5,3,5,5,5,5,5,4};



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

        for (VAR_3 = 0; VAR_3 < 64; ) {

            if((VAR_2[VAR_5][VAR_0][VAR_3] - 8) > 22) {

                VAR_6 = 1;

                VAR_7 = 8;

            } else {

                switch (VAR_8[VAR_2[VAR_5][VAR_0][VAR_3]]) {

                    case 0: VAR_6 = 10; VAR_7 = 10; break;

                    case 1: VAR_6 = 1; VAR_7 = 16; break;

                    case 2: VAR_6 = 5; VAR_7 = 24; break;

                    case 3: VAR_6 = 3; VAR_7 = 30; break;

                    case 4: VAR_6 = 1; VAR_7 = 30; break;

                    case 5: VAR_6 = 1; VAR_7 = 8; break;

                    default: VAR_6 = 1; VAR_7 = 8; break;

                }

            }

            for (VAR_4 = 0; VAR_4 < VAR_6; VAR_4++)

                if (VAR_3 + VAR_4 < 128)

                    if (VAR_2[VAR_5][VAR_0 + (VAR_3 + VAR_4) / 64][(VAR_3 + VAR_4) % 64] > VAR_2[VAR_5][VAR_0][VAR_3])

                        if (VAR_4 > 0) {

                           SAMPLES_NEEDED

                            

                            memset(&VAR_2[VAR_5][VAR_0][VAR_3 + VAR_4], VAR_7, VAR_4 * sizeof(int8_t));

                            memset(&VAR_2[VAR_5][VAR_0][VAR_3 + VAR_4], VAR_7, 3 * sizeof(int8_t));

                        }

            VAR_3 += VAR_6;

        }

    }

}

static void FUNC_0 (int VAR_0, int VAR_1, sb_int8_array VAR_2)
{ int VAR_3,VAR_4; int VAR_5; int VAR_6, VAR_7; int VAR_8[23] = {0,5,1,5,5,5,5,5,2,5,5,5,5,5,5,5,3,5,5,5,5,5,4}; for (VAR_5 = 0; VAR_5 < VAR_1; VAR_5++) { for (VAR_3 = 0; VAR_3 < 64; ) { if((VAR_2[VAR_5][VAR_0][VAR_3] - 8) > 22) { VAR_6 = 1; VAR_7 = 8; } else { switch (VAR_8[VAR_2[VAR_5][VAR_0][VAR_3]]) { case 0: VAR_6 = 10; VAR_7 = 10; break; case 1: VAR_6 = 1; VAR_7 = 16; break; case 2: VAR_6 = 5; VAR_7 = 24; break; case 3: VAR_6 = 3; VAR_7 = 30; break; case 4: VAR_6 = 1; VAR_7 = 30; break; case 5: VAR_6 = 1; VAR_7 = 8; break; default: VAR_6 = 1; VAR_7 = 8; break; } } for (VAR_4 = 0; VAR_4 < VAR_6; VAR_4++) if (VAR_3 + VAR_4 < 128)
if (VAR_2[VAR_5][VAR_0 + (VAR_3 + VAR_4) / 64][(VAR_3 + VAR_4) % 64] > VAR_2[VAR_5][VAR_0][VAR_3])
if (VAR_4 > 0) { SAMPLES_NEEDED
memset(&VAR_2[VAR_5][VAR_0][VAR_3 + VAR_4], VAR_7, VAR_4 * sizeof(int8_t)); memset(&VAR_2[VAR_5][VAR_0][VAR_3 + VAR_4], VAR_7, 3 * sizeof(int8_t)); } VAR_3 += VAR_6; } } }