Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

FEAPIExamplePluginLoudness/zplVecLib.h

Go to the documentation of this file.
00001 
00002 //     /*! \file zplVecLib.h: \brief interface of the zplVecLib . */
00003 //
00004 //        Copyright (c) 2004-2006  
00005 //        zplane.development
00006 //        Flohrer Lerch Schwerdtfeger GbR
00007 //        All rights reserved.
00008 //
00009 //    This program is free software; you can redistribute it and/or modify
00010 //    it under the terms of the GNU General Public License as published by
00011 //    the Free Software Foundation; either version 2 of the License, or
00012 //    (at your option) any later version.
00013 //
00014 //    This program is distributed in the hope that it will be useful,
00015 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 //    GNU General Public License for more details.
00018 //
00019 //    You should have received a copy of the GNU General Public License
00020 //    along with this program; if not, write to the Free Software
00021 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 //
00024 
00025 #if !defined(__libzplVecLib_HEADER_INCLUDED__)
00026 #define __libzplVecLib_HEADER_INCLUDED__
00027 
00028 
00029 
00030 #ifdef WIN32
00031 typedef float zCOMPLEX;
00032 #define ZCDECL __cdecl
00033 #elif defined(_MACH)
00034 typedef float zCOMPLEX;
00035 #define ZCDECL
00036 #else
00037 #error  "undefined system"
00038 #endif
00039 #if defined (NDEBUG) || (GP_DEBUG == 0)
00040     #define ZASSERT(exp)    ((void)0)
00041 #else
00042     #include <assert.h>
00043     #define ZASSERT(exp)    assert(!(exp))
00044 #endif
00045 
00046 #include "RingBuffer.h"
00047 
00048 
00049 
00057 void zplVecLibDispatcher ();
00058 
00059 
00067 extern float*   (ZCDECL *zplfMalloc)      (int       iNumOfFloats);
00068 
00076 extern void       (ZCDECL *zplfFree)        (float   *&ppfBuffer);
00077 
00086 extern void       (ZCDECL *zplfSetZero)     (float   *pfBuffer, int iLengthAsPowOf4);
00087 
00088 
00099 extern void       (ZCDECL *zplfRealFindMax)   (float    *pfSrc, float    *pfMax, int    *piIdx, int    iLengthAsPowOf4);
00100 
00110 extern void       (ZCDECL *zplfRealAdd_I)   (float   *pfSrcDest, float    *pfSrc, int    iLengthAsPowOf4);
00111 
00121 extern void       (ZCDECL *zplfRealAddC_I)   (float   *pfSrcDest, float    fValue, int    iLengthAsPowOf4);
00122 
00132 extern void       (ZCDECL *zplfRealSub_I)   (float   *pfSrcDest, float    *pfSrc, int    iLengthAsPowOf4);
00133 
00143 extern void       (ZCDECL *zplfRealMul_I)   (float   *pfSrcDest, float    *pfSrc, int    iLengthAsPowOf4);
00144 
00154 extern void       (ZCDECL *zplfRealMulC_I)  (float   *pfSrcDest, float    fScaleFactor, int    iLengthAsPowOf4);
00155 
00165 extern void       (ZCDECL *zplfRealDiv_I)   (float   *pfNomSrcDest, float    *pfDenomSrc, int    iLengthAsPowOf4);
00166 
00177 extern void       (ZCDECL *zplfRealMac_I)   (float   *pfSrcDest, float    *pfSrc1, float   *pfSrc2, int   iLengthAsPowOf4);
00178 
00187 extern void       (ZCDECL *zplfRealAbs_I)   (float   *pfSrcDest, int iLengthAsPowOf4);
00188 
00197 extern float    (ZCDECL *zplfRealSum)   (float   *pfSrc, int iLengthAsPowOf4);
00198 
00199 
00209 extern void       (ZCDECL *zplfCompAdd_I)   (zCOMPLEX   *pfSrcDest, zCOMPLEX    *pfSrc,  int iRealLengthAsPowOf4);
00210 
00220 extern void       (ZCDECL *zplfCompMul_I)   (zCOMPLEX   *pfSrcDest, zCOMPLEX    *pfSrc,  int iRealLengthAsPowOf4);
00221 
00231 extern void       (ZCDECL *zplfCompDiv_I)   (zCOMPLEX   *pfNomSrcDest, zCOMPLEX    *pfDenomSrc, int    iRealLengthAsPowOf4);
00232 
00243 extern void       (ZCDECL *zplfCompMac_I)   (zCOMPLEX   *pfSrcDest, zCOMPLEX    *pfSrc1, float   *pfSrc2, int   iRealLengthAsPowOf4);
00244 
00254 extern void       (ZCDECL *zplfCompAbs)     (float   *pfDest,    zCOMPLEX    *pfSrc1, int iRealLengthAsPowOf4);
00255 
00256 
00257 class CzplfFFT_If
00258 {
00259 public:
00260 
00261     
00263     enum _Fft_Windows_
00264     {
00265         _RECT,      
00266         _HANNING,   
00267         _HAMMING,   
00268         _BLACKMAN,  
00269         _BARTLETT,  
00270         _WELCH      
00271     };
00272 
00273 
00274 
00283     virtual void           zplfFFT         (zCOMPLEX *pfDest, float *pfSrc) = 0;
00284 
00293     virtual void           zplfIFFT        (float *pfDest, zCOMPLEX *pfSrc) = 0;
00294 
00295 
00303     int zplfGetWindow                      (float *pfWindow);
00304 
00305 protected:
00306     int      m_eLastError;
00307 
00308     void       CalculateWindow (_Fft_Windows_ eWindowType);
00309     unsigned int     Log2 (int iValueAsPowOf2);
00310     virtual int      BuildFFTTables () = 0;
00311     virtual void       FreeFFTTables () = 0;
00312 
00313     int        m_iFFTLength,
00314                 m_iBlockLength;
00315 
00316     float    *m_pfWindow;
00317 };
00318 
00319 
00330 extern int       (ZCDECL *zplfFFTCreateInstance)  (CzplfFFT_If*& pCFFT, int iBlockLength, int iZeroPadFactor, CzplfFFT_If::_Fft_Windows_ eWindowType);
00331 
00339 extern int       (ZCDECL *zplfFFTDestroyInstance) (CzplfFFT_If*& pCFFT);
00340 
00341 
00342 extern int        (ZCDECL *zplfZeroCrossings)     (float   *pfSrc, int        iRealLengthAsPowOf4);
00343 
00344 
00345 #endif // #if !defined(__libzplVecLib_HEADER_INCLUDED__)
00346 
00347 
00348 

Generated on Fri Mar 23 10:28:54 2007 for FEAPI Plugin Documentation by  doxygen 1.3.9.1