Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mark Harris
Opus
Commits
e8b6830f
Commit
e8b6830f
authored
Feb 24, 2008
by
Jean-Marc Valin
Browse files
minor tweak to FFT
parent
d911bc4d
Changes
2
Hide whitespace changes
Inline
Side-by-side
libcelt/_kiss_fft_guts.h
View file @
e8b6830f
...
...
@@ -103,6 +103,13 @@ struct kiss_fft_state{
do{ (c).r = S_MUL( (c).r , s ) ;\
(c).i = S_MUL( (c).i , s ) ; }while(0)
# define DIVSCALAR(x,k) \
(x) = S_MUL( x, (TWID_MAX-((k)>>1))/(k)+1 )
# define C_FIXDIV(c,div) \
do { DIVSCALAR( (c).r , div); \
DIVSCALAR( (c).i , div); }while (0)
#else
/* MIXED_PRECISION */
# define sround4( x ) (kiss_fft_scalar)( ( (x) + ((SAMPPROD)1<<(FRACBITS-1)) ) >> (FRACBITS+2) )
...
...
@@ -123,8 +130,6 @@ struct kiss_fft_state{
do{ (c).r = sround( smul( (c).r , s ) ) ;\
(c).i = sround( smul( (c).i , s ) ) ; }while(0)
#endif
/* !MIXED_PRECISION */
# define DIVSCALAR(x,k) \
(x) = sround( smul( x, SAMP_MAX/k ) )
...
...
@@ -132,6 +137,8 @@ struct kiss_fft_state{
do { DIVSCALAR( (c).r , div); \
DIVSCALAR( (c).i , div); }while (0)
#endif
/* !MIXED_PRECISION */
#define L1 32767
...
...
tests/dft-test.c
View file @
e8b6830f
...
...
@@ -66,8 +66,8 @@ void test1d(int nfft,int isinverse)
#ifdef DOUBLE_PRECISION
for
(
k
=
0
;
k
<
nfft
;
++
k
)
{
in
[
k
].
r
*=
65536
;
in
[
k
].
i
*=
65536
;
in
[
k
].
r
*=
32768
;
in
[
k
].
i
*=
32768
;
}
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment