changeset 14:1906e659edd0

fix undef. behaviour
author Peter Meerwald <pmeerw@cosy.sbg.ac.at>
date Mon, 30 Jun 2008 15:46:32 +0200
parents cbecc570129d
children ad1d224896c5
files Meerwald/dwt.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Meerwald/dwt.c	Mon Jun 30 15:43:16 2008 +0200
+++ b/Meerwald/dwt.c	Mon Jun 30 15:46:32 2008 +0200
@@ -156,13 +156,15 @@
           filter[k] = tf[j--] / 2.0;
           break;
         case FILTERG:
-          filter[k] = (double) (((i & 0x01) * 2) - 1) * tf[i++] / 2.0;
+          filter[k] = (double) (((i & 0x01) * 2) - 1) * tf[i] / 2.0;
+          i++;
           break;
         case FILTERHi:
           filter[k] = tf[j--];
           break;
         case FILTERGi:
-          filter[k] = (double) (((i & 0x01) * 2) - 1) * tf[i++];
+          filter[k] = (double) (((i & 0x01) * 2) - 1) * tf[i];
+          i++;
           break;
         default:
           return -1;
@@ -278,7 +280,8 @@
     switch (which) {
         case FILTERG:
         case FILTERGi:
-          filter[k] = (double) ((((i+1) & 0x01) * 2) - 1) * tf[i++];
+          filter[k] = (double) ((((i+1) & 0x01) * 2) - 1) * tf[i];
+          i++;
           break;
         case FILTERH:
         case FILTERHi:

Repositories maintained by Peter Meerwald, pmeerw@pmeerw.net.