Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Opus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexander Traud
Opus
Commits
571e861d
Commit
571e861d
authored
17 years ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
more exp_rotation() cleanup
parent
559e8ff6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libcelt/bands.c
+37
-34
37 additions, 34 deletions
libcelt/bands.c
with
37 additions
and
34 deletions
libcelt/bands.c
+
37
−
34
View file @
571e861d
...
...
@@ -37,53 +37,56 @@
/* Applies a series of rotations so that pulses are spread like a two-sided
exponential */
static
void
exp_rotation
(
float
*
X
,
int
len
,
float
theta
,
int
dir
)
static
void
exp_rotation
(
float
*
X
,
int
len
,
float
theta
,
int
dir
,
int
stride
,
int
iter
)
{
int
i
,
k
,
stride
=
2
;
int
i
,
k
;
float
c
,
s
;
c
=
cos
(
theta
);
s
=
sin
(
theta
);
if
(
dir
>
0
)
{
for
(
i
=
0
;
i
<
len
-
2
;
i
++
)
for
(
k
=
0
;
k
<
iter
;
k
++
)
{
float
x1
,
x2
;
x1
=
X
[
i
];
x2
=
X
[
i
+
2
];
X
[
i
]
=
c
*
x1
-
s
*
x2
;
X
[
i
+
2
]
=
c
*
x2
+
s
*
x1
;
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
;
}
}
for
(
i
=
len
-
5
;
i
>=
0
;
i
--
)
{
float
x1
,
x2
;
x1
=
X
[
i
];
x2
=
X
[
i
+
2
];
X
[
i
]
=
c
*
x1
-
s
*
x2
;
X
[
i
+
2
]
=
c
*
x2
+
s
*
x1
;
}
}
else
{
for
(
i
=
0
;
i
<
len
-
4
;
i
++
)
for
(
k
=
0
;
k
<
iter
;
k
++
)
{
float
x1
,
x2
;
x1
=
X
[
i
];
x2
=
X
[
i
+
2
];
X
[
i
]
=
c
*
x1
+
s
*
x2
;
X
[
i
+
2
]
=
c
*
x2
-
s
*
x1
;
}
for
(
i
=
len
-
3
;
i
>=
0
;
i
--
)
{
float
x1
,
x2
;
x1
=
X
[
i
];
x2
=
X
[
i
+
2
];
X
[
i
]
=
c
*
x1
+
s
*
x2
;
X
[
i
+
2
]
=
c
*
x2
-
s
*
x1
;
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
;
}
}
}
}
/* Compute the energy in each of the bands */
void
compute_band_energies
(
const
CELTMode
*
m
,
float
*
X
,
float
*
bank
)
{
...
...
@@ -264,7 +267,7 @@ void band_rotation(const CELTMode *m, float *X, int dir)
{
float
theta
;
theta
=
pow
(.
1
f
,
1
.
f
*
abs
(
m
->
nbPulses
[
i
])
/
(
B
*
(
eBands
[
i
+
1
]
-
eBands
[
i
])));
exp_rotation
(
X
+
B
*
eBands
[
i
],
B
*
(
eBands
[
i
+
1
]
-
eBands
[
i
]),
theta
,
dir
);
exp_rotation
(
X
+
B
*
eBands
[
i
],
B
*
(
eBands
[
i
+
1
]
-
eBands
[
i
]),
theta
,
dir
,
2
,
1
);
}
//printf ("\n");
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment