diff options
author | Jacek Antonelli | 2008-08-15 23:45:01 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:01 -0500 |
commit | 28d8d4e7664bcd6c8369cc18832e42096af7cad2 (patch) | |
tree | 069020fe66339aff2ca4176370ff743b14713f2d /linden/indra/newview/llfft.h | |
parent | Second Life viewer sources 1.17.2.0 (diff) | |
download | meta-impy-28d8d4e7664bcd6c8369cc18832e42096af7cad2.zip meta-impy-28d8d4e7664bcd6c8369cc18832e42096af7cad2.tar.gz meta-impy-28d8d4e7664bcd6c8369cc18832e42096af7cad2.tar.bz2 meta-impy-28d8d4e7664bcd6c8369cc18832e42096af7cad2.tar.xz |
Second Life viewer sources 1.17.3.0
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llfft.h | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/linden/indra/newview/llfft.h b/linden/indra/newview/llfft.h deleted file mode 100644 index 07e868b..0000000 --- a/linden/indra/newview/llfft.h +++ /dev/null | |||
@@ -1,105 +0,0 @@ | |||
1 | /** | ||
2 | * @file llfft.h | ||
3 | * @brief FFT function definitions | ||
4 | * | ||
5 | * Copyright (c) 2003-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * Second Life Viewer Source Code | ||
8 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
9 | * to you under the terms of the GNU General Public License, version 2.0 | ||
10 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
11 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
12 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
13 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
14 | * | ||
15 | * There are special exceptions to the terms and conditions of the GPL as | ||
16 | * it is applied to this Source Code. View the full text of the exception | ||
17 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
18 | * online at http://secondlife.com/developers/opensource/flossexception | ||
19 | * | ||
20 | * By copying, modifying or distributing this software, you acknowledge | ||
21 | * that you have read and understood your obligations described above, | ||
22 | * and agree to abide by those obligations. | ||
23 | * | ||
24 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
25 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
26 | * COMPLETENESS OR PERFORMANCE. | ||
27 | */ | ||
28 | |||
29 | #ifndef LL_LLFFT_H | ||
30 | #define LL_LLFFT_H | ||
31 | |||
32 | /* | ||
33 | * Fast Fourier Transform | ||
34 | * | ||
35 | */ | ||
36 | |||
37 | //#include <stdio.h> | ||
38 | //#include <math.h> | ||
39 | |||
40 | #include "llmath.h" | ||
41 | |||
42 | #define FORWARD 0 | ||
43 | #define INVERSE 1 | ||
44 | |||
45 | typedef struct {F32 re; F32 im;} COMPLEX; | ||
46 | typedef struct {F64 re; F64 im;} DPCOMPLEX; | ||
47 | |||
48 | |||
49 | void FFT842(S32 in, S32 n, DPCOMPLEX *b); | ||
50 | void R2TX(S32 nthpo, DPCOMPLEX *c0, DPCOMPLEX *c1); | ||
51 | void R4TX(S32 nthpo, DPCOMPLEX *c0, DPCOMPLEX *c1, DPCOMPLEX *c2, DPCOMPLEX *c3); | ||
52 | void R8TX(S32 nxtlt, S32 nthpo, S32 lengt, DPCOMPLEX *cc0, DPCOMPLEX *cc1, DPCOMPLEX *cc2, | ||
53 | DPCOMPLEX *cc3, DPCOMPLEX *cc4, DPCOMPLEX *cc5, DPCOMPLEX *cc6, DPCOMPLEX *cc7); | ||
54 | S32 power_of_2(S32 n); | ||
55 | S32 fastlog2(S32 n); | ||
56 | |||
57 | class LLFFTPlan | ||
58 | { | ||
59 | private: | ||
60 | S32 mRows; | ||
61 | S32 mCols; | ||
62 | S32 mSize; | ||
63 | DPCOMPLEX* mBuff; | ||
64 | public: | ||
65 | LLFFTPlan() : mRows(0), mCols(0), mSize(0), mBuff(0) {} | ||
66 | LLFFTPlan(S32 rows, S32 cols) { init(rows, cols); } | ||
67 | ~LLFFTPlan() { destroy(); } | ||
68 | |||
69 | void init(S32 rows, S32 cols) | ||
70 | { | ||
71 | if(power_of_2(rows) && power_of_2(cols)) | ||
72 | { | ||
73 | mRows = rows; | ||
74 | mCols = cols; | ||
75 | mSize = mRows > mCols ? mRows : mCols; | ||
76 | mBuff = new DPCOMPLEX[mSize]; | ||
77 | } | ||
78 | } | ||
79 | void destroy() | ||
80 | { | ||
81 | delete [] mBuff; | ||
82 | mSize = 0; | ||
83 | } | ||
84 | |||
85 | BOOL valid() const { return mBuff != NULL; } | ||
86 | DPCOMPLEX* buffer() const { return mBuff; } | ||
87 | S32 rows() const { return mRows; } | ||
88 | S32 cols() const { return mCols; } | ||
89 | }; | ||
90 | |||
91 | S32 fft(const LLFFTPlan& plan, COMPLEX *array, S32 rows, S32 cols, S32 direction); | ||
92 | |||
93 | /* do forward transform. array must be COMPLEX */ | ||
94 | inline S32 forward_fft(const LLFFTPlan& plan, COMPLEX *array, S32 rows, S32 cols) | ||
95 | { | ||
96 | return fft(plan, array, rows, cols, FORWARD); | ||
97 | } | ||
98 | |||
99 | /* do inverse transform. array must be COMPLEX */ | ||
100 | inline S32 inverse_fft(const LLFFTPlan& plan, COMPLEX *array, S32 rows, S32 cols) | ||
101 | { | ||
102 | return fft(plan, array, rows, cols, INVERSE); | ||
103 | } | ||
104 | |||
105 | #endif | ||