[sldev] [VWR] The OpenJPEG lossless decode bug

Robin Cornelius robin.cornelius at gmail.com
Fri Dec 7 02:02:18 PST 2007


On Dec 5, 2007 9:50 PM, Callum Lerwick <seg at haxxed.com> wrote:

> --- linden.orig/indra/llimage/llimagej2c.cpp    2007-11-07 20:18:06.000000000 -0600
> +++ linden.patched/indra/llimage/llimagej2c.cpp 2007-12-05 13:14:53.000000000 -0600
> @@ -310,7 +310,7 @@
>  //static
>  S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 rate)
>  {
> -       if (rate <= 0.f) rate = .125f;
> +       if (rate <= 0.f) rate = 0.5f;
>         while (discard_level > 0)
>         {
>                 if (w < 1 || h < 1)
>
> Success! (sorta) I no longer see corrupted textures. Right now I am
> staring at a perfect ant, in the SW corner of Hippotropolis.

Cool, many thanks, nice work.

Forgive me for being very stupid, but what effect does this now have
on the previous patch of :-

+       if(gSavedSettings.getBOOL("OpenJPEGEncodeLossless")){
+               parameters.tcp_numlayers = 1;
+               parameters.tcp_rates[0] = 0.0f;
+       }else{
+               parameters.tcp_numlayers = 6;
+               parameters.tcp_rates[0] = 1280.0f;
+               parameters.tcp_rates[1] = 640.0f;
+               parameters.tcp_rates[2] = 320.0f;
+               parameters.tcp_rates[3] = 160.0f;
+               parameters.tcp_rates[4] = 80.0f;
+               parameters.tcp_rates[5] = 40.0f;
+               parameters.irreversible = 1;
+               if(raw_image.getComponents() >= 3){
+                       parameters.tcp_mct = 1;
+               }
+       }

I can't remember what the purpose of this was, is it still needed now?
Or can you just leave it applied but use the "OpenJPEGEncodeLossless"
to turn on/off lossless and have success?

Thanks for helping someone having a stupid day :-)

Robin


More information about the SLDev mailing list