diff --git a/src/lib/openjp2/t1.c b/src/lib/openjp2/t1.c index 277261d7..e1097bf5 100644 --- a/src/lib/openjp2/t1.c +++ b/src/lib/openjp2/t1.c @@ -1650,13 +1650,13 @@ static OPJ_BOOL opj_t1_decode_cblk(opj_t1_t *t1, opj_raw_t *raw = t1->raw; /* RAW component */ opj_mqc_t *mqc = t1->mqc; /* MQC component */ - mqc->lut_ctxno_zc_orient = lut_ctxno_zc + orient * 256; - OPJ_INT32 bpno_plus_one; OPJ_UINT32 passtype; OPJ_UINT32 segno, passno; OPJ_BYTE type = T1_TYPE_MQ; /* BYPASS mode */ + mqc->lut_ctxno_zc_orient = lut_ctxno_zc + orient * 256; + if(!opj_t1_allocate_buffers( t1, (OPJ_UINT32)(cblk->x1 - cblk->x0), @@ -1903,7 +1903,6 @@ static void opj_t1_encode_cblk(opj_t1_t *t1, OPJ_FLOAT64 cumwmsedec = 0.0; opj_mqc_t *mqc = t1->mqc; /* MQC component */ - mqc->lut_ctxno_zc_orient = lut_ctxno_zc + orient * 256; OPJ_UINT32 passno; OPJ_INT32 bpno; @@ -1914,6 +1913,8 @@ static void opj_t1_encode_cblk(opj_t1_t *t1, OPJ_BYTE type = T1_TYPE_MQ; OPJ_FLOAT64 tempwmsedec; + mqc->lut_ctxno_zc_orient = lut_ctxno_zc + orient * 256; + max = 0; for (i = 0; i < t1->w; ++i) { for (j = 0; j < t1->h; ++j) {