Lines Matching refs:p_tree
136 opj_tgt_tree_t *opj_tgt_init(opj_tgt_tree_t * p_tree, OPJ_UINT32 p_num_leafs_h, in opj_tgt_init() argument
150 if (! p_tree) { in opj_tgt_init()
154 if ((p_tree->numleafsh != p_num_leafs_h) || in opj_tgt_init()
155 (p_tree->numleafsv != p_num_leafs_v)) { in opj_tgt_init()
156 p_tree->numleafsh = p_num_leafs_h; in opj_tgt_init()
157 p_tree->numleafsv = p_num_leafs_v; in opj_tgt_init()
162 p_tree->numnodes = 0; in opj_tgt_init()
167 p_tree->numnodes += n; in opj_tgt_init()
172 if (p_tree->numnodes == 0) { in opj_tgt_init()
173 opj_tgt_destroy(p_tree); in opj_tgt_init()
176 l_node_size = p_tree->numnodes * (OPJ_UINT32)sizeof(opj_tgt_node_t); in opj_tgt_init()
178 if (l_node_size > p_tree->nodes_size) { in opj_tgt_init()
179 opj_tgt_node_t* new_nodes = (opj_tgt_node_t*) opj_realloc(p_tree->nodes, in opj_tgt_init()
184 opj_tgt_destroy(p_tree); in opj_tgt_init()
187 p_tree->nodes = new_nodes; in opj_tgt_init()
188 memset(((char *) p_tree->nodes) + p_tree->nodes_size, 0, in opj_tgt_init()
189 l_node_size - p_tree->nodes_size); in opj_tgt_init()
190 p_tree->nodes_size = l_node_size; in opj_tgt_init()
192 l_node = p_tree->nodes; in opj_tgt_init()
193 l_parent_node = &p_tree->nodes[p_tree->numleafsh * p_tree->numleafsv]; in opj_tgt_init()
218 opj_tgt_reset(p_tree); in opj_tgt_init()
220 return p_tree; in opj_tgt_init()
223 void opj_tgt_destroy(opj_tgt_tree_t *p_tree) in opj_tgt_destroy() argument
225 if (! p_tree) { in opj_tgt_destroy()
229 if (p_tree->nodes) { in opj_tgt_destroy()
230 opj_free(p_tree->nodes); in opj_tgt_destroy()
231 p_tree->nodes = 00; in opj_tgt_destroy()
233 opj_free(p_tree); in opj_tgt_destroy()
236 void opj_tgt_reset(opj_tgt_tree_t *p_tree) in opj_tgt_reset() argument
241 if (! p_tree) { in opj_tgt_reset()
245 l_current_node = p_tree->nodes; in opj_tgt_reset()
246 for (i = 0; i < p_tree->numnodes; ++i) { in opj_tgt_reset()