[trunk] add j2k_pre_write_tile function in trunk from v2alpha

This commit is contained in:
Mickael Savinaud 2012-03-09 17:15:55 +00:00
parent fcfb8dd2ed
commit 04b057d22c
1 changed files with 36 additions and 3 deletions

View File

@ -199,6 +199,12 @@ opj_bool j2k_decode_tiles ( opj_j2k_v2_t *p_j2k,
opj_stream_private_t *p_stream, opj_stream_private_t *p_stream,
opj_event_mgr_t * p_manager); opj_event_mgr_t * p_manager);
static opj_bool j2k_pre_write_tile ( opj_j2k_v2_t * p_j2k,
OPJ_UINT32 p_tile_index,
opj_stream_private_t *p_stream,
opj_event_mgr_t * p_manager );
static opj_bool j2k_update_image_data (opj_tcd_v2_t * p_tcd, OPJ_BYTE * p_data, opj_image_t* p_output_image); static opj_bool j2k_update_image_data (opj_tcd_v2_t * p_tcd, OPJ_BYTE * p_data, opj_image_t* p_output_image);
@ -8628,3 +8634,30 @@ opj_bool j2k_start_compress(opj_j2k_v2_t *p_j2k,
return OPJ_TRUE; return OPJ_TRUE;
} }
/*
*
*/
opj_bool j2k_pre_write_tile ( opj_j2k_v2_t * p_j2k,
OPJ_UINT32 p_tile_index,
opj_stream_private_t *p_stream,
opj_event_mgr_t * p_manager )
{
if (p_tile_index != p_j2k->m_current_tile_number) {
opj_event_msg_v2(p_manager, EVT_ERROR, "The given tile index does not match." );
return OPJ_FALSE;
}
opj_event_msg_v2(p_manager, EVT_INFO, "tile number %d / %d\n", p_j2k->m_current_tile_number + 1, p_j2k->m_cp.tw * p_j2k->m_cp.th);
p_j2k->m_specific_param.m_encoder.m_current_tile_part_number = 0;
p_j2k->m_tcd->cur_totnum_tp = p_j2k->m_cp.tcps[p_tile_index].m_nb_tile_parts;
p_j2k->m_specific_param.m_encoder.m_current_poc_tile_part_number = 0;
/* initialisation before tile encoding */
if (! tcd_init_encode_tile(p_j2k->m_tcd, p_j2k->m_current_tile_number)) {
return OPJ_FALSE;
}
return OPJ_TRUE;
}