IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 13, 2008, 11:47:41 AM (18 years ago)
Author:
Paul Price
Message:

Simple dereferencing for tight loop to see if it makes any difference in warping time.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/imageops/psImageInterpolate.c

    r19354 r20104  
    77 *  @author Paul Price, IfA
    88 *
    9  *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2008-09-04 20:11:00 $
     9 *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2008-10-13 21:47:41 $
    1111 *
    1212 *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
     
    682682                  double xSumKernel2 = 0.0; /* Sum of kernel-squared in x */ \
    683683                  float xSumBad = 0.0; /* Sum of bad kernel-squared in x */ \
    684                   for (int i = iMin, xPix = xMin; i < iMax; i++, xPix++) { \
     684                  /* Dereferenced versions of inputs */ \
     685                  const ps##TYPE *imageData = &image->data.TYPE[yPix][xMin]; \
     686                  const ps##TYPE *varianceData = &variance->data.TYPE[yPix][xMin]; \
     687                  const psMaskType *maskData = &mask->data.PS_TYPE_MASK_DATA[yPix][xMin]; \
     688                  for (int i = iMin, xPix = xMin; i < iMax; \
     689                           i++, xPix++, imageData++, varianceData++, maskData++) { \
    685690                      float kernelValue = xKernel[i]; /* Value of kernel in x */ \
    686691                      double kernelValue2 = PS_SQR(kernelValue); /* Square of kernel in x */ \
    687                       if (mask->data.PS_TYPE_MASK_DATA[yPix][xPix] & maskVal) { \
     692                      if (*maskData & maskVal) { \
    688693                          xSumBad += kernelValue2; \
    689694                      } else { \
    690                           xSumImage += kernelValue * image->data.TYPE[yPix][xPix]; \
    691                           xSumVariance += kernelValue2 * variance->data.TYPE[yPix][xPix]; \
     695                          xSumImage += kernelValue * *imageData; \
     696                          xSumVariance += kernelValue2 * *varianceData; \
    692697                          xSumKernel += kernelValue; \
    693698                      } \
Note: See TracChangeset for help on using the changeset viewer.