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
cc344fb8
Commit
cc344fb8
authored
11 years ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
Slightly improving the accuracy of the fixed-point MDCT downscale
Also simplifying the code
parent
e0c00e27
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
celt/mdct.c
+9
-13
9 additions, 13 deletions
celt/mdct.c
with
9 additions
and
13 deletions
celt/mdct.c
+
9
−
13
View file @
cc344fb8
...
...
@@ -119,15 +119,20 @@ void clt_mdct_forward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar
VARDECL
(
kiss_fft_cpx
,
f2
);
const
kiss_fft_state
*
st
=
l
->
kfft
[
shift
];
const
kiss_twiddle_scalar
*
trig
;
opus_val16
scale
;
#ifdef FIXED_POINT
/* FIXME: This should eventually just go in the state. */
opus_val16
scale
;
int
scale_shift
;
scale_shift
=
celt_ilog2
(
st
->
nfft
);
if
(
st
->
nfft
==
1
<<
scale_shift
)
scale
=
Q15ONE
;
else
scale
=
(
1073741824
+
st
->
nfft
/
2
)
/
st
->
nfft
>>
(
15
-
scale_shift
);
/* Allows us to scale with MULT16_32_Q16(), which is faster than
MULT16_32_Q15() on ARM. */
scale_shift
--
;
#else
scale
=
st
->
scale
;
#endif
SAVE_STACK
;
...
...
@@ -195,28 +200,19 @@ void clt_mdct_forward(const mdct_lookup *l, kiss_fft_scalar *in, kiss_fft_scalar
kiss_fft_scalar
re
,
im
,
yr
,
yi
;
t0
=
t
[
i
];
t1
=
t
[
N4
+
i
];
#ifdef FIXED_POINT
t0
=
MULT16_16_P15
(
t0
,
scale
);
t1
=
MULT16_16_P15
(
t1
,
scale
);
#else
t0
*=
st
->
scale
;
t1
*=
st
->
scale
;
#endif
re
=
*
yp
++
;
im
=
*
yp
++
;
yr
=
-
S_MUL
(
re
,
t0
)
+
S_MUL
(
im
,
t1
);
yi
=
-
S_MUL
(
im
,
t0
)
-
S_MUL
(
re
,
t1
);
yc
.
r
=
yr
;
yc
.
i
=
yi
;
#ifdef FIXED_POINT
yc
.
r
=
SHR32
(
yc
.
r
,
scale_shift
);
yc
.
i
=
SHR32
(
yc
.
i
,
scale_shift
);
#endif
yc
.
r
=
PSHR32
(
MULT16_32_Q16
(
scale
,
yc
.
r
),
scale_shift
);
yc
.
i
=
PSHR32
(
MULT16_32_Q16
(
scale
,
yc
.
i
),
scale_shift
);
f2
[
st
->
bitrev
[
i
]]
=
yc
;
}
}
/* N/4 complex FFT, down
-
scale
s by 4/N
*/
/* N/4 complex FFT,
does not
downscale
anymore
*/
opus_fft_impl
(
st
,
f2
);
/* Post-rotate */
...
...
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