static void decode_sigpass(Jpeg2000T1Context *t1, int width, int height,

                           int bpno, int bandno,

                           int vert_causal_ctx_csty_symbol)

{

    int mask = 3 << (bpno - 1), y0, x, y;



    for (y0 = 0; y0 < height; y0 += 4)

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

            for (y = y0; y < height && y < y0 + 4; y++) {

                int flags_mask = -1;

                if (vert_causal_ctx_csty_symbol && y == y0 + 3)

                    flags_mask &= ~(JPEG2000_T1_SIG_S | JPEG2000_T1_SIG_SW | JPEG2000_T1_SIG_SE | JPEG2000_T1_SGN_S);

                if ((t1->flags[y+1][x+1] & JPEG2000_T1_SIG_NB & flags_mask)

                && !(t1->flags[y+1][x+1] & (JPEG2000_T1_SIG | JPEG2000_T1_VIS))) {

                    if (ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + ff_jpeg2000_getsigctxno(t1->flags[y+1][x+1] & flags_mask, bandno))) {

                        int xorbit, ctxno = ff_jpeg2000_getsgnctxno(t1->flags[y+1][x+1] & flags_mask, &xorbit);

                        if (t1->mqc.raw)

                             t1->data[y][x] = ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + ctxno) ? -mask : mask;

                        else

                             t1->data[y][x] = (ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + ctxno) ^ xorbit) ?

                                               -mask : mask;



                        ff_jpeg2000_set_significance(t1, x, y,

                                                     t1->data[y][x] < 0);

                    }

                    t1->flags[y + 1][x + 1] |= JPEG2000_T1_VIS;

                }

            }

}

static void decode_sigpass(Jpeg2000T1Context *t1, int width, int height,

                           int bpno, int bandno,

                           int vert_causal_ctx_csty_symbol)

{

    int mask = 3 << (bpno - 1), y0, x, y;



    for (y0 = 0; y0 < height; y0 += 4)

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

            for (y = y0; y < height && y < y0 + 4; y++) {

                int flags_mask = -1;

                if (vert_causal_ctx_csty_symbol && y == y0 + 3)

                    flags_mask &= ~(JPEG2000_T1_SIG_S | JPEG2000_T1_SIG_SW | JPEG2000_T1_SIG_SE | JPEG2000_T1_SGN_S);

                if ((t1->flags[y+1][x+1] & JPEG2000_T1_SIG_NB & flags_mask)

                && !(t1->flags[y+1][x+1] & (JPEG2000_T1_SIG | JPEG2000_T1_VIS))) {

                    if (ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + ff_jpeg2000_getsigctxno(t1->flags[y+1][x+1] & flags_mask, bandno))) {

                        int xorbit, ctxno = ff_jpeg2000_getsgnctxno(t1->flags[y+1][x+1] & flags_mask, &xorbit);

                        if (t1->mqc.raw)

                             t1->data[y][x] = ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + ctxno) ? -mask : mask;

                        else

                             t1->data[y][x] = (ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + ctxno) ^ xorbit) ?

                                               -mask : mask;



                        ff_jpeg2000_set_significance(t1, x, y,

                                                     t1->data[y][x] < 0);

                    }

                    t1->flags[y + 1][x + 1] |= JPEG2000_T1_VIS;

                }

            }

}

static void FUNC_0(Jpeg2000T1Context *VAR_0, int VAR_1, int VAR_2,

                           int VAR_3, int VAR_4,

                           int VAR_5)

{

    int VAR_6 = 3 << (VAR_3 - 1), VAR_7, VAR_8, VAR_9;



    for (VAR_7 = 0; VAR_7 < VAR_2; VAR_7 += 4)

        for (VAR_8 = 0; VAR_8 < VAR_1; VAR_8++)

            for (VAR_9 = VAR_7; VAR_9 < VAR_2 && VAR_9 < VAR_7 + 4; VAR_9++) {

                int VAR_10 = -1;

                if (VAR_5 && VAR_9 == VAR_7 + 3)

                    VAR_10 &= ~(JPEG2000_T1_SIG_S | JPEG2000_T1_SIG_SW | JPEG2000_T1_SIG_SE | JPEG2000_T1_SGN_S);

                if ((VAR_0->flags[VAR_9+1][VAR_8+1] & JPEG2000_T1_SIG_NB & VAR_10)

                && !(VAR_0->flags[VAR_9+1][VAR_8+1] & (JPEG2000_T1_SIG | JPEG2000_T1_VIS))) {

                    if (ff_mqc_decode(&VAR_0->mqc, VAR_0->mqc.cx_states + ff_jpeg2000_getsigctxno(VAR_0->flags[VAR_9+1][VAR_8+1] & VAR_10, VAR_4))) {

                        int VAR_11, VAR_12 = ff_jpeg2000_getsgnctxno(VAR_0->flags[VAR_9+1][VAR_8+1] & VAR_10, &VAR_11);

                        if (VAR_0->mqc.raw)

                             VAR_0->data[VAR_9][VAR_8] = ff_mqc_decode(&VAR_0->mqc, VAR_0->mqc.cx_states + VAR_12) ? -VAR_6 : VAR_6;

                        else

                             VAR_0->data[VAR_9][VAR_8] = (ff_mqc_decode(&VAR_0->mqc, VAR_0->mqc.cx_states + VAR_12) ^ VAR_11) ?

                                               -VAR_6 : VAR_6;



                        ff_jpeg2000_set_significance(VAR_0, VAR_8, VAR_9,

                                                     VAR_0->data[VAR_9][VAR_8] < 0);

                    }

                    VAR_0->flags[VAR_9 + 1][VAR_8 + 1] |= JPEG2000_T1_VIS;

                }

            }

}

static void FUNC_0(Jpeg2000T1Context *VAR_0, int VAR_1, int VAR_2,
int VAR_3, int VAR_4,
int VAR_5)
{ int VAR_6 = 3 << (VAR_3 - 1), VAR_7, VAR_8, VAR_9; for (VAR_7 = 0; VAR_7 < VAR_2; VAR_7 += 4) for (VAR_8 = 0; VAR_8 < VAR_1; VAR_8++) for (VAR_9 = VAR_7; VAR_9 < VAR_2 && VAR_9 < VAR_7 + 4; VAR_9++) { int VAR_10 = -1; if (VAR_5 && VAR_9 == VAR_7 + 3)
VAR_10 &= ~(JPEG2000_T1_SIG_S | JPEG2000_T1_SIG_SW | JPEG2000_T1_SIG_SE | JPEG2000_T1_SGN_S); if ((VAR_0->flags[VAR_9+1][VAR_8+1] & JPEG2000_T1_SIG_NB & VAR_10)
&& !(VAR_0->flags[VAR_9+1][VAR_8+1] & (JPEG2000_T1_SIG | JPEG2000_T1_VIS))) { if (ff_mqc_decode(&VAR_0->mqc, VAR_0->mqc.cx_states + ff_jpeg2000_getsigctxno(VAR_0->flags[VAR_9+1][VAR_8+1] & VAR_10, VAR_4))) { int VAR_11, VAR_12 = ff_jpeg2000_getsgnctxno(VAR_0->flags[VAR_9+1][VAR_8+1] & VAR_10, &VAR_11); if (VAR_0->mqc.raw)
VAR_0->data[VAR_9][VAR_8] = ff_mqc_decode(&VAR_0->mqc, VAR_0->mqc.cx_states + VAR_12) ? -VAR_6 : VAR_6; else
VAR_0->data[VAR_9][VAR_8] = (ff_mqc_decode(&VAR_0->mqc, VAR_0->mqc.cx_states + VAR_12) ^ VAR_11) ?
-VAR_6 : VAR_6; ff_jpeg2000_set_significance(VAR_0, VAR_8, VAR_9,
VAR_0->data[VAR_9][VAR_8] < 0); } VAR_0->flags[VAR_9 + 1][VAR_8 + 1] |= JPEG2000_T1_VIS; } } }