IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11725


Ignore:
Timestamp:
Feb 8, 2007, 3:26:31 PM (19 years ago)
Author:
Paul Price
Message:

Moving FFT test into tap_psImageFFT2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/imageops/tap_psImageConvolve2.c

    r11703 r11725  
    6060int main(int argc, char *argv[])
    6161{
    62     plan_tests(16);
     62    plan_tests(10);
    6363
    6464    diag("psImageConvolve tests");
    6565
    6666    {
    67         // Direct convolution
     67        // Direct convolution: 5 tests
    6868        psMemId id = psMemGetId();
    6969
     
    8888
    8989    {
    90         // FFT forward, then back --- do I get what I started with?
    91         psMemId id = psMemGetId();
    92 
    93         psImage *old = generateImage();
    94         psImage *fftReal = NULL, *fftImag = NULL;
    95         bool result = psImageForwardFFT(&fftReal, &fftImag, old);
    96         ok(result, "forward fft result");
    97         skip_start(!result, 3, "forward fft failed");
    98         ok(fftReal->type.type == PS_TYPE_F32 && fftImag->type.type == PS_TYPE_F32, "forward fft types");
    99         psImage *new = NULL;
    100         result = psImageBackwardFFT(&new, fftReal, fftImag, old->numCols);
    101         ok(result, "backward fft result");
    102         skip_start(!result, 2, "backward fft failed");
    103         ok(new->type.type == PS_TYPE_F32, "backward fft type");
    104         bool correct = true;
    105         for (int y = 0; y < old->numRows; y++) {
    106             for (int x = 0; x < old->numCols; x++) {
    107                 if (fabs(new->data.F32[y][x] / IMAGE_SIZE / IMAGE_SIZE - old->data.F32[y][x]) > TOL) {
    108                     correct = false;
    109                 }
    110             }
    111         }
    112         ok(correct, "new matches old");
    113         psFree(new);
    114         skip_end();
    115         skip_end();
    116 
    117         psFree(fftReal);
    118         psFree(fftImag);
    119         psFree(old);
    120         ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
    121 
    122     }
    123 
    124     {
    125         // FFT convolution
     90        // FFT convolution: 5 tests
    12691        psMemId id = psMemGetId();
    12792
Note: See TracChangeset for help on using the changeset viewer.