PeteyMi / openjpeg

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

unnecessary switch between int32 and uint32 #230

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
From Tim Bruylants : 

The code seems to switch between uint32 to int32 in cases where this is 
absolutely not allowed, or unnecessary. It is my believe that one should always 
try to use signed values, except in those cases where it is required to use 
unsigned. Sadly enough, JPEG 2000 Part 1 defines the image grid as uint32 
values, so here you would need to use the unsigned values. 

Places in code I know might be mistaken are for example in image.c: 
opj_image_comp_header_update

The types of values such as l_x0 for example should be unsigned. I know that 
probably things might work out due to wrapping, but I'm unsure.

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

GoogleCodeExporter commented 9 years ago
Well given that SIz marker for both Profile-0 & Profile-1 wants vert and horiz 
to be smaller than 2^31 I do not see a clear need for unsigned integer.

Original comment by mathieu.malaterre on 16 Jul 2013 at 1:11