ylb11 / openjpeg

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

OpenJpeg fails to encode components with different precision properly #459

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
OpenJpeg fails to encode components with different precision properly.

issue203-32x32-bgr16.bmp & issue203-127x64-bgr16.bmp are not encoded properly. 
The image color are off, with or without mct.

It seems to happen only when the first component is not the one with highest 
precision.

bmpmask16toimage in convertbmp.c can easily be modified to produce different 
combinations.

i.e. to get 5bits precisions on all components (from this bgr565 images) would 
modify it as follow :
    bmp_mask_get_shift_and_prec(blueMask,  &blueShift,  &bluePrec);
    bmp_mask_get_shift_and_prec(alphaMask, &alphaShift, &alphaPrec);

+   greenPrec -= 1;
+   greenShift += 1;

    image->comps[0].bpp = redPrec;
    image->comps[0].prec = redPrec;

Original issue reported on code.google.com by m.darb...@gmail.com on 22 Dec 2014 at 6:34

GoogleCodeExporter commented 9 years ago
This is related to QCC marker not being written.

All code related to QCC/COC is between #ifdef 0

Any idea why ?
I could make a patch but it seems someone did this for a good reason & it would 
be good to know it before starting anything.

Original comment by m.darb...@gmail.com on 24 Dec 2014 at 11:20

GoogleCodeExporter commented 9 years ago
With QCC in the file, all goes well.

What I suspect is that one doesn't want COC/QCC markers written when not 
necessary & simply disabled it for now. Maybe I'm wrong...

Original comment by m.darb...@gmail.com on 24 Dec 2014 at 11:22