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
1ca07225
Commit
1ca07225
authored
Feb 27, 2008
by
Jean-Marc Valin
Browse files
fixed-point: mix_pitch_and_residual() check-point #3
parent
b50c541d
Changes
1
Hide whitespace changes
Inline
Side-by-side
libcelt/vq.c
View file @
1ca07225
...
...
@@ -69,7 +69,7 @@ static void mix_pitch_and_residual(int *iy, celt_norm_t *X, int N, int K, celt_n
float
g
;
VARDECL
(
celt_norm_t
*
y
);
#ifdef FIXED_POINT
int
yshift
=
1
5
-
EC_ILOG
(
K
);
int
yshift
=
1
4
-
EC_ILOG
(
K
);
#endif
ALLOC
(
y
,
N
,
celt_norm_t
);
...
...
@@ -98,7 +98,8 @@ static void mix_pitch_and_residual(int *iy, celt_norm_t *X, int N, int K, celt_n
for
(
i
=
0
;
i
<
N
;
i
++
)
Ryy
=
MAC16_16
(
Ryy
,
y
[
i
],
y
[
i
]);
g
=
(
sqrt
(
NORM_SCALING_1
*
NORM_SCALING_1
*
Ryp
*
Ryp
+
Ryy
-
NORM_SCALING_1
*
NORM_SCALING_1
*
Ryy
*
Rpp
)
-
NORM_SCALING_1
*
Ryp
)
/
Ryy
;
/* g = (sqrt(Ryp^2 + Ryy - Rpp*Ryy)-Ryp)/Ryy */
g
=
(
sqrt
(
MULT16_16
(
PSHR32
(
Ryp
,
14
),
PSHR32
(
Ryp
,
14
))
+
Ryy
-
MULT16_16
(
PSHR32
(
Ryy
,
14
),
PSHR32
(
Rpp
,
14
)))
-
PSHR32
(
Ryp
,
14
))
/
Ryy
;
for
(
i
=
0
;
i
<
N
;
i
++
)
X
[
i
]
=
P
[
i
]
+
NORM_SCALING
*
g
*
y
[
i
];
...
...
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