Fix threshold calculation
authorMatthieu Darbois <mayeut@users.noreply.github.com>
Thu, 10 Sep 2015 13:10:14 +0000 (15:10 +0200)
committerMatthieu Darbois <mayeut@users.noreply.github.com>
Thu, 10 Sep 2015 13:10:14 +0000 (15:10 +0200)
It doesn't change the outcome of the test suite, that's weird...

src/lib/openjp2/tcd.c

index df9272ff1fce827e6335f5a467bcf8d7be28b2f6..d227e388f1e82259ba65c18606b226ceb0a257bb 100644 (file)
@@ -565,7 +565,7 @@ OPJ_BOOL opj_tcd_rateallocate(  opj_tcd_t *tcd,
                         opj_t2_destroy(t2);
                 } else {
                         success = OPJ_TRUE;
-                        goodthresh = min - DBL_MAX; /* do not rely on float equality for lossless transform */
+                        goodthresh = min - DBL_EPSILON; /* do not rely on float equality for lossless transform */
                 }
 
                 if (!success) {