xinxinlx / openjpeg

Automatically exported from code.google.com/p/openjpeg
Other
0 stars 0 forks source link

tagtree initialization not optimal #232

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In the tgt (tagtree) sources there are basically two functions that allow 
setting up a new tagtree. One creates a new memory structure, while the other 
reinitializes an existing tree. Now, the init function only does so if the 
number of leafs stays identical. I understand that the original intention was 
to limit the amount of mallocs at runtime. However, when I compare the two 
functions I also see a lot (that's relative of course) of code duplication, and 
moreover the init function needs to do some extra work in order to reinitialize 
the existing structure. I would like to test for speed and efficiency whether 
it might not be better just to throw away the old tree and always use the 
create function instead. This would avoid duplicate code.

Original issue reported on code.google.com by antonin on 16 Jul 2013 at 1:03

GoogleCodeExporter commented 9 years ago
(from Tim Bruylants)

Original comment by antonin on 16 Jul 2013 at 1:13