Lines Matching refs:p_tree

133 opj_tgt_tree_t *opj_tgt_init(opj_tgt_tree_t * p_tree,OPJ_UINT32 p_num_leafs_h, OPJ_UINT32 p_num_lea…  in opj_tgt_init()  argument
146 if (! p_tree){ in opj_tgt_init()
150 if ((p_tree->numleafsh != p_num_leafs_h) || (p_tree->numleafsv != p_num_leafs_v)) { in opj_tgt_init()
151 p_tree->numleafsh = p_num_leafs_h; in opj_tgt_init()
152 p_tree->numleafsv = p_num_leafs_v; in opj_tgt_init()
157 p_tree->numnodes = 0; in opj_tgt_init()
163 p_tree->numnodes += n; in opj_tgt_init()
169 if (p_tree->numnodes == 0) { in opj_tgt_init()
170 opj_tgt_destroy(p_tree); in opj_tgt_init()
173 l_node_size = p_tree->numnodes * (OPJ_UINT32)sizeof(opj_tgt_node_t); in opj_tgt_init()
175 if (l_node_size > p_tree->nodes_size) { in opj_tgt_init()
176 … opj_tgt_node_t* new_nodes = (opj_tgt_node_t*) opj_realloc(p_tree->nodes, l_node_size); in opj_tgt_init()
179 opj_tgt_destroy(p_tree); in opj_tgt_init()
182 p_tree->nodes = new_nodes; in opj_tgt_init()
183 … memset(((char *) p_tree->nodes) + p_tree->nodes_size, 0 , l_node_size - p_tree->nodes_size); in opj_tgt_init()
184 p_tree->nodes_size = l_node_size; in opj_tgt_init()
186 l_node = p_tree->nodes; in opj_tgt_init()
187 l_parent_node = &p_tree->nodes[p_tree->numleafsh * p_tree->numleafsv]; in opj_tgt_init()
215 opj_tgt_reset(p_tree); in opj_tgt_init()
217 return p_tree; in opj_tgt_init()
220 void opj_tgt_destroy(opj_tgt_tree_t *p_tree) in opj_tgt_destroy() argument
222 if (! p_tree) { in opj_tgt_destroy()
226 if (p_tree->nodes) { in opj_tgt_destroy()
227 opj_free(p_tree->nodes); in opj_tgt_destroy()
228 p_tree->nodes = 00; in opj_tgt_destroy()
230 opj_free(p_tree); in opj_tgt_destroy()
233 void opj_tgt_reset(opj_tgt_tree_t *p_tree) { in opj_tgt_reset() argument
237 if (! p_tree) { in opj_tgt_reset()
241 l_current_node = p_tree->nodes; in opj_tgt_reset()
242 for (i = 0; i < p_tree->numnodes; ++i) in opj_tgt_reset()