00001 /**************************************************************** 00002 * Fulguro 00003 * Copyright (C) 2004 Christophe Clienti 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Lesser General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public 00016 * License along with this library; if not, write to the 00017 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00018 * Boston, MA 02111-1307, USA. 00019 ***************************************************************/ 00020 00021 00022 #include <stdio.h> 00023 #include <stdlib.h> 00024 #include <string.h> 00025 #include <flgrCoreDispatch.h> 00026 #include "flgrLinearArithFFT.h" 00027 00028 00029 /* void flgr2d_fft_arith_complex_mult_fgBIT(FLGR_FFTBuffer *bufdest, FLGR_FFTBuffer *bufz1, FLGR_FFTBuffer *bufz2) { */ 00030 /* flgr_no_define_type_function(FLGR_BIT); */ 00031 /* } */ 00032 /* void flgr2d_fft_arith_complex_mult_fgUINT8(FLGR_FFTBuffer *bufdest, FLGR_FFTBuffer *bufz1, FLGR_FFTBuffer *bufz2) { */ 00033 /* flgr_no_define_type_function(FLGR_UINT8); */ 00034 /* } */ 00035 /* void flgr2d_fft_arith_complex_mult_fgUINT16(FLGR_FFTBuffer *bufdest, FLGR_FFTBuffer *bufz1, FLGR_FFTBuffer *bufz2) { */ 00036 /* flgr_no_define_type_function(FLGR_UINT16); */ 00037 /* } */ 00038 /* void flgr2d_fft_arith_complex_mult_fgUINT32(FLGR_FFTBuffer *bufdest, FLGR_FFTBuffer *bufz1, FLGR_FFTBuffer *bufz2) { */ 00039 /* flgr_no_define_type_function(FLGR_UINT32); */ 00040 /* } */ 00041 /* void flgr2d_fft_arith_complex_mult_fgINT8(FLGR_FFTBuffer *bufdest, FLGR_FFTBuffer *bufz1, FLGR_FFTBuffer *bufz2) { */ 00042 /* flgr_no_define_type_function(FLGR_INT8); */ 00043 /* } */ 00044 /* void flgr2d_fft_arith_complex_mult_fgINT16(FLGR_FFTBuffer *bufdest, FLGR_FFTBuffer *bufz1, FLGR_FFTBuffer *bufz2) { */ 00045 /* flgr_no_define_type_function(FLGR_INT16); */ 00046 /* } */ 00047 /* void flgr2d_fft_arith_complex_mult_fgINT32(FLGR_FFTBuffer *bufdest, FLGR_FFTBuffer *bufz1, FLGR_FFTBuffer *bufz2) { */ 00048 /* flgr_no_define_type_function(FLGR_INT32); */ 00049 /* } */ 00050 00051 /* void flgr2d_fft_arith_complex_mult_fgFLOAT32(FLGR_FFTBuffer *bufdest, FLGR_FFTBuffer *bufz1, FLGR_FFTBuffer *bufz2) { */ 00052 /* fgFLOAT32 *pz1, *pz2, *pdest; */ 00053 /* int i,size = bufdest->nx*(bufdest->ny); */ 00054 00055 /* pz1 = (fgFLOAT32*) bufz1->array; */ 00056 /* pz2 = (fgFLOAT32*) bufz2->array; */ 00057 /* pdest = (fgFLOAT32*) bufdest->array; */ 00058 00059 /* for(i=0 ; i<2*size ; i+=2) { */ 00060 /* pdest[i]=(pz1[i]*pz2[i] - pz1[i+1]*pz2[i+1]); */ 00061 /* pdest[i+1]=(pz1[i]*pz2[i+1] + pz1[i+1]*pz2[i]); */ 00062 /* } */ 00063 00064 /* } */ 00065 00066 00067 /* void flgr2d_fft_arith_complex_mult_fgFLOAT64(FLGR_FFTBuffer *bufdest, FLGR_FFTBuffer *bufz1, FLGR_FFTBuffer *bufz2) { */ 00068 /* fgFLOAT64 *pz1, *pz2, *pdest; */ 00069 /* int i,size = bufdest->nx*(bufdest->ny); */ 00070 00071 /* pz1 = (fgFLOAT64*) bufz1->array; */ 00072 /* pz2 = (fgFLOAT64*) bufz2->array; */ 00073 /* pdest = (fgFLOAT64*) bufdest->array; */ 00074 00075 /* for(i=0 ; i<2*size ; i+=2) { */ 00076 /* pdest[i]=(pz1[i]*pz2[i] - pz1[i+1]*pz2[i+1]); */ 00077 /* pdest[i+1]=(pz1[i]*pz2[i+1] + pz1[i+1]*pz2[i]); */ 00078 /* } */ 00079 00080 /* } */ 00081 00082 /* FLGR_Ret flgr2d_fft_arith_complex_mult(FLGR_FFTBuffer *bufdest, FLGR_FFTBuffer *bufz1, FLGR_FFTBuffer *bufz2) { */ 00083 /* if((bufdest==NULL) || (bufz1==NULL) || (bufz2==NULL)){ */ 00084 /* POST_ERROR("Null objects!\n"); */ 00085 /* return FLGR_RET_NULL_OBJECT; */ 00086 /* } */ 00087 00088 /* if(bufdest->type != bufz1->type) { */ 00089 /* POST_ERROR("fft buffers type different\n"); */ 00090 /* return FLGR_RET_TYPE_DIFFERENT; */ 00091 /* } */ 00092 00093 /* if(bufdest->type != bufz2->type) { */ 00094 /* POST_ERROR("fft buffers type different\n"); */ 00095 /* return FLGR_RET_TYPE_DIFFERENT; */ 00096 /* } */ 00097 00098 /* if( (bufdest->nx != bufz1->nx) || (bufdest->ny != bufz1->ny) || */ 00099 /* (bufdest->nx != bufz2->nx) || (bufdest->ny != bufz2->ny)) { */ 00100 /* POST_ERROR("fft buffers size different\n"); */ 00101 /* return FLGR_RET_SIZE_ERROR; */ 00102 /* } */ 00103 00104 /* FLGR_DISPATCH_PROCEDURE(bufdest->type,flgr2d_fft_arith_complex_mult,bufdest,bufz1,bufz2); */ 00105 00106 /* return FLGR_RET_OK; */ 00107 00108 /* } */