Merge pull request #980 from szukw000/changes-for-ppc64-converttif
[openjpeg.git] / src / bin / jp2 / opj_compress.c
index 2ef1c6be608a36a3479173cd8388466c95ffd42e..494b366a7211d7cd3796b55299568e3b8a2a29bd 100644 (file)
@@ -1618,9 +1618,12 @@ static int parse_cmdline_encoder(int argc, char **argv,
         return 1;
     }               /* mod fixed_quality */
 
+
     /* if no rate entered, lossless by default */
+    /* Note: post v2.2.0, this is no longer necessary, but for released */
+    /* versions at the time of writing, this is needed to avoid crashes */
     if (parameters->tcp_numlayers == 0) {
-        parameters->tcp_rates[0] = 0;   /* MOD antonin : losslessbug */
+        parameters->tcp_rates[0] = 0;
         parameters->tcp_numlayers++;
         parameters->cp_disto_alloc = 1;
     }
@@ -1694,7 +1697,8 @@ OPJ_FLOAT64 opj_clock(void)
     /* cout << "freq = " << ((double) freq.QuadPart) << endl; */
     /* t is the high resolution performance counter (see MSDN) */
     QueryPerformanceCounter(& t) ;
-    return freq.QuadPart ? (t.QuadPart / (OPJ_FLOAT64) freq.QuadPart) : 0 ;
+    return freq.QuadPart ? ((OPJ_FLOAT64) t.QuadPart / (OPJ_FLOAT64) freq.QuadPart)
+           : 0 ;
 #else
     /* Unix or Linux: use resource usage */
     struct rusage t;