Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mark Harris
Opus
Commits
06c67dbc
Commit
06c67dbc
authored
Feb 13, 2008
by
Jean-Marc Valin
Browse files
Simplified exp_spreading by unifying both directions. Have to admit I don't
fully understand why that works!
parent
5215623d
Changes
1
Hide whitespace changes
Inline
Side-by-side
libcelt/bands.c
View file @
06c67dbc
...
...
@@ -43,47 +43,24 @@ static void exp_rotation(float *X, int len, float theta, int dir, int stride, in
int
i
,
k
;
float
c
,
s
;
c
=
cos
(
theta
);
s
=
sin
(
theta
);
if
(
dir
>
0
)
s
=
dir
*
sin
(
theta
);
for
(
k
=
0
;
k
<
iter
;
k
++
)
{
for
(
k
=
0
;
k
<
iter
;
k
++
)
for
(
i
=
0
;
i
<
len
-
stride
;
i
++
)
{
for
(
i
=
0
;
i
<
len
-
stride
;
i
++
)
{
float
x1
,
x2
;
x1
=
X
[
i
];
x2
=
X
[
i
+
stride
];
X
[
i
]
=
c
*
x1
-
s
*
x2
;
X
[
i
+
stride
]
=
c
*
x2
+
s
*
x1
;
}
for
(
i
=
len
-
2
*
stride
-
1
;
i
>=
0
;
i
--
)
{
float
x1
,
x2
;
x1
=
X
[
i
];
x2
=
X
[
i
+
stride
];
X
[
i
]
=
c
*
x1
-
s
*
x2
;
X
[
i
+
stride
]
=
c
*
x2
+
s
*
x1
;
}
float
x1
,
x2
;
x1
=
X
[
i
];
x2
=
X
[
i
+
stride
];
X
[
i
]
=
c
*
x1
-
s
*
x2
;
X
[
i
+
stride
]
=
c
*
x2
+
s
*
x1
;
}
}
else
{
for
(
k
=
0
;
k
<
iter
;
k
++
)
for
(
i
=
len
-
2
*
stride
-
1
;
i
>=
0
;
i
--
)
{
for
(
i
=
0
;
i
<
len
-
2
*
stride
;
i
++
)
{
float
x1
,
x2
;
x1
=
X
[
i
];
x2
=
X
[
i
+
stride
];
X
[
i
]
=
c
*
x1
+
s
*
x2
;
X
[
i
+
stride
]
=
c
*
x2
-
s
*
x1
;
}
for
(
i
=
len
-
stride
-
1
;
i
>=
0
;
i
--
)
{
float
x1
,
x2
;
x1
=
X
[
i
];
x2
=
X
[
i
+
stride
];
X
[
i
]
=
c
*
x1
+
s
*
x2
;
X
[
i
+
stride
]
=
c
*
x2
-
s
*
x1
;
}
float
x1
,
x2
;
x1
=
X
[
i
];
x2
=
X
[
i
+
stride
];
X
[
i
]
=
c
*
x1
-
s
*
x2
;
X
[
i
+
stride
]
=
c
*
x2
+
s
*
x1
;
}
}
}
...
...
Write
Preview
Supports
Markdown
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