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
32034747
Commit
32034747
authored
17 years ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
Using restrict to make it clear there's no aliasing issues in the mdct.
parent
a536f772
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libcelt/celt.c
+11
-11
11 additions, 11 deletions
libcelt/celt.c
libcelt/mdct.c
+2
-2
2 additions, 2 deletions
libcelt/mdct.c
with
13 additions
and
13 deletions
libcelt/celt.c
+
11
−
11
View file @
32034747
...
...
@@ -156,7 +156,7 @@ static inline celt_int16_t SIG2INT16(celt_sig_t x)
}
/** Apply window and compute the MDCT for all sub-frames and all channels in a frame */
static
celt_word32_t
compute_mdcts
(
const
mdct_lookup
*
lookup
,
const
celt_word16_t
*
restrict
window
,
celt_sig_t
*
in
,
celt_sig_t
*
out
,
int
N
,
int
overlap
,
int
B
,
int
C
)
static
celt_word32_t
compute_mdcts
(
const
mdct_lookup
*
lookup
,
const
celt_word16_t
*
restrict
window
,
celt_sig_t
*
restrict
in
,
celt_sig_t
*
restrict
out
,
int
N
,
int
overlap
,
int
B
,
int
C
)
{
int
i
,
c
,
N4
;
celt_word32_t
E
=
0
;
...
...
@@ -171,12 +171,17 @@ static celt_word32_t compute_mdcts(const mdct_lookup *lookup, const celt_word16_
for
(
i
=
0
;
i
<
B
;
i
++
)
{
int
j
;
celt_word32_t
*
restrict
x1
,
*
restrict
x2
;
for
(
j
=
0
;
j
<
2
*
N
-
2
*
N4
;
j
++
)
x
[
j
+
N4
]
=
in
[
C
*
i
*
N
+
C
*
j
+
c
];
x1
=
x
+
N4
;
x2
=
x
+
2
*
N
-
N4
-
1
;
for
(
j
=
0
;
j
<
overlap
;
j
++
)
{
x
[
j
+
N4
]
=
MULT16_32_Q15
(
window
[
j
],
x
[
j
+
N4
]);
x
[
2
*
N
-
j
-
N4
-
1
]
=
MULT16_32_Q15
(
window
[
j
],
x
[
2
*
N
-
j
-
N4
-
1
]);
*
x1
=
MULT16_32_Q15
(
window
[
j
],
*
x1
);
*
x2
=
MULT16_32_Q15
(
window
[
j
],
*
x2
);
x1
++
;
x2
--
;
}
for
(
j
=
0
;
j
<
N4
;
j
++
)
{
...
...
@@ -196,7 +201,7 @@ static celt_word32_t compute_mdcts(const mdct_lookup *lookup, const celt_word16_
}
/** Compute the IMDCT and apply window for all sub-frames and all channels in a frame */
static
void
compute_inv_mdcts
(
const
mdct_lookup
*
lookup
,
const
celt_word16_t
*
restrict
window
,
celt_sig_t
*
X
,
celt_sig_t
*
out_mem
,
celt_sig_t
*
mdct_overlap
,
int
N
,
int
overlap
,
int
B
,
int
C
)
static
void
compute_inv_mdcts
(
const
mdct_lookup
*
lookup
,
const
celt_word16_t
*
restrict
window
,
celt_sig_t
*
X
,
celt_sig_t
*
restrict
out_mem
,
celt_sig_t
*
restrict
mdct_overlap
,
int
N
,
int
overlap
,
int
B
,
int
C
)
{
int
i
,
c
,
N4
;
VARDECL
(
celt_word32_t
,
x
);
...
...
@@ -217,16 +222,11 @@ static void compute_inv_mdcts(const mdct_lookup *lookup, const celt_word16_t * r
/* The first and last part would need to be set to zero if we actually
wanted to use them. */
for
(
j
=
0
;
j
<
overlap
;
j
++
)
{
x
[
j
+
N4
]
=
MULT16_32_Q15
(
window
[
j
],
x
[
j
+
N4
]);
x
[
2
*
N
-
j
-
N4
-
1
]
=
MULT16_32_Q15
(
window
[
j
],
x
[
2
*
N
-
j
-
N4
-
1
]);
}
out_mem
[
C
*
(
MAX_PERIOD
+
(
i
-
B
)
*
N
)
+
C
*
j
+
c
]
=
2
*
(
mdct_overlap
[
C
*
j
+
c
]
+
MULT16_32_Q15
(
window
[
j
],
x
[
j
+
N4
]));
for
(
j
=
0
;
j
<
overlap
;
j
++
)
out_mem
[
C
*
(
MAX_PERIOD
+
(
i
-
B
)
*
N
)
+
C
*
j
+
c
]
=
2
*
(
x
[
N4
+
j
]
+
mdct_overlap
[
C
*
j
+
c
]);
mdct_overlap
[
C
*
(
overlap
-
j
-
1
)
+
c
]
=
MULT16_32_Q15
(
window
[
j
],
x
[
2
*
N
-
j
-
N4
-
1
]);
for
(
j
=
0
;
j
<
2
*
N4
;
j
++
)
out_mem
[
C
*
(
MAX_PERIOD
+
(
i
-
B
)
*
N
)
+
C
*
(
j
+
overlap
)
+
c
]
=
2
*
x
[
j
+
N4
+
overlap
];
for
(
j
=
0
;
j
<
overlap
;
j
++
)
mdct_overlap
[
C
*
j
+
c
]
=
x
[
N
+
N4
+
j
];
}
}
RESTORE_STACK
;
...
...
This diff is collapsed.
Click to expand it.
libcelt/mdct.c
+
2
−
2
View file @
32034747
...
...
@@ -86,7 +86,7 @@ void mdct_clear(mdct_lookup *l)
celt_free
(
l
->
trig
);
}
void
mdct_forward
(
const
mdct_lookup
*
l
,
kiss_fft_scalar
*
in
,
kiss_fft_scalar
*
out
)
void
mdct_forward
(
const
mdct_lookup
*
l
,
kiss_fft_scalar
*
in
,
kiss_fft_scalar
*
restrict
out
)
{
int
i
;
int
N
,
N2
,
N4
;
...
...
@@ -131,7 +131,7 @@ void mdct_forward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar *ou
}
void
mdct_backward
(
const
mdct_lookup
*
l
,
kiss_fft_scalar
*
in
,
kiss_fft_scalar
*
out
)
void
mdct_backward
(
const
mdct_lookup
*
l
,
kiss_fft_scalar
*
in
,
kiss_fft_scalar
*
restrict
out
)
{
int
i
;
int
N
,
N2
,
N4
;
...
...
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