[trunk] resets code-blocks reused for other tiles than the first one (fixes issue 418)
This commit is contained in:
parent
ad4fad0965
commit
d72940c56b
|
@ -970,15 +970,14 @@ OPJ_BOOL FUNCTION ( opj_tcd_t *p_tcd, \
|
||||||
OPJ_INT32 cblkxend = cblkxstart + (1 << cblkwidthexpn); \
|
OPJ_INT32 cblkxend = cblkxstart + (1 << cblkwidthexpn); \
|
||||||
OPJ_INT32 cblkyend = cblkystart + (1 << cblkheightexpn); \
|
OPJ_INT32 cblkyend = cblkystart + (1 << cblkheightexpn); \
|
||||||
\
|
\
|
||||||
|
if (! FUNCTION_ELEMENT(l_code_block)) { \
|
||||||
|
return OPJ_FALSE; \
|
||||||
|
} \
|
||||||
/* code-block size (global) */ \
|
/* code-block size (global) */ \
|
||||||
l_code_block->x0 = opj_int_max(cblkxstart, l_current_precinct->x0); \
|
l_code_block->x0 = opj_int_max(cblkxstart, l_current_precinct->x0); \
|
||||||
l_code_block->y0 = opj_int_max(cblkystart, l_current_precinct->y0); \
|
l_code_block->y0 = opj_int_max(cblkystart, l_current_precinct->y0); \
|
||||||
l_code_block->x1 = opj_int_min(cblkxend, l_current_precinct->x1); \
|
l_code_block->x1 = opj_int_min(cblkxend, l_current_precinct->x1); \
|
||||||
l_code_block->y1 = opj_int_min(cblkyend, l_current_precinct->y1); \
|
l_code_block->y1 = opj_int_min(cblkyend, l_current_precinct->y1); \
|
||||||
\
|
|
||||||
if (! FUNCTION_ELEMENT(l_code_block)) { \
|
|
||||||
return OPJ_FALSE; \
|
|
||||||
} \
|
|
||||||
++l_code_block; \
|
++l_code_block; \
|
||||||
} \
|
} \
|
||||||
++l_current_precinct; \
|
++l_current_precinct; \
|
||||||
|
@ -1054,9 +1053,19 @@ OPJ_BOOL opj_tcd_code_block_dec_allocate (opj_tcd_cblk_dec_t * p_code_block)
|
||||||
|
|
||||||
p_code_block->m_current_max_segs = OPJ_J2K_DEFAULT_NB_SEGS;
|
p_code_block->m_current_max_segs = OPJ_J2K_DEFAULT_NB_SEGS;
|
||||||
/*fprintf(stderr, "m_current_max_segs of code_block->data = %d\n", p_code_block->m_current_max_segs);*/
|
/*fprintf(stderr, "m_current_max_segs of code_block->data = %d\n", p_code_block->m_current_max_segs);*/
|
||||||
|
} else {
|
||||||
|
/* sanitize */
|
||||||
|
OPJ_BYTE* l_data = p_code_block->data;
|
||||||
|
OPJ_UINT32 l_data_max_size = p_code_block->data_max_size;
|
||||||
|
opj_tcd_seg_t * l_segs = p_code_block->segs;
|
||||||
|
OPJ_UINT32 l_current_max_segs = p_code_block->m_current_max_segs;
|
||||||
|
|
||||||
|
memset(p_code_block, 0, sizeof(opj_tcd_cblk_dec_t));
|
||||||
|
p_code_block->data = l_data;
|
||||||
|
p_code_block->data_max_size = l_data_max_size;
|
||||||
|
p_code_block->segs = l_segs;
|
||||||
|
p_code_block->m_current_max_segs = l_current_max_segs;
|
||||||
}
|
}
|
||||||
/* TODO */
|
|
||||||
/*p_code_block->numsegs = 0; */
|
|
||||||
|
|
||||||
return OPJ_TRUE;
|
return OPJ_TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue