Compare commits

...

2 Commits

Author SHA1 Message Date
Antonin Descampe bdb4bfaf05 Merge branch 'master' into fix-bypass-restart 2016-05-04 00:29:25 +02:00
Antonin Descampe 51a51bdd03 update #612 #770 #674
RESTART mode is now working, BYPASS still broken but much better
2016-05-04 00:27:22 +02:00
1 changed files with 2 additions and 2 deletions

View File

@ -1662,7 +1662,7 @@ static void opj_t1_encode_cblk(opj_t1_t *t1,
bpno--;
}
if (pass->term && bpno > 0) {
if (pass->term) {
type = ((bpno < ((OPJ_INT32) (cblk->numbps) - 4)) && (passtype < 2) && (cblksty & J2K_CCP_CBLKSTY_LAZY)) ? T1_TYPE_RAW : T1_TYPE_MQ;
if (type == T1_TYPE_RAW)
opj_mqc_bypass_init_enc(mqc);
@ -1691,7 +1691,7 @@ static void opj_t1_encode_cblk(opj_t1_t *t1,
if (pass->rate > opj_mqc_numbytes(mqc))
pass->rate = opj_mqc_numbytes(mqc);
/*Preventing generation of FF as last data byte of a pass*/
if((pass->rate>1) && (cblk->data[pass->rate - 1] == 0xFF)){
if(!(cblksty & J2K_CCP_CBLKSTY_LAZY) && (pass->rate>1) && (cblk->data[pass->rate - 1] == 0xFF)){
pass->rate--;
}
pass->len = pass->rate - (passno == 0 ? 0 : cblk->passes[passno - 1].rate);