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
f7a1e165
Commit
f7a1e165
authored
Oct 07, 2009
by
Jean-Marc Valin
Browse files
Renamed mix_pitch_and_residual() to normalise_residual(), after minor
simplification.
parent
f6dc1eba
Changes
2
Hide whitespace changes
Inline
Side-by-side
libcelt/bands.c
View file @
f7a1e165
...
@@ -315,7 +315,7 @@ void apply_pitch(const CELTMode *m, celt_sig_t *X, const celt_sig_t *P, int gain
...
@@ -315,7 +315,7 @@ void apply_pitch(const CELTMode *m, celt_sig_t *X, const celt_sig_t *P, int gain
celt_word16_t
gg
=
gain
;
celt_word16_t
gg
=
gain
;
for
(
j
=
0
;
j
<
len
;
j
++
)
for
(
j
=
0
;
j
<
len
;
j
++
)
{
{
X
[
j
+
c
*
N
]
+=
SHL
(
MULT16_32_Q15
(
gg
,
P
[
j
+
c
*
N
]),
1
);
X
[
j
+
c
*
N
]
+=
SHL
32
(
MULT16_32_Q15
(
gg
,
P
[
j
+
c
*
N
]),
1
);
gg
=
ADD16
(
gg
,
delta
);
gg
=
ADD16
(
gg
,
delta
);
}
}
}
}
...
...
libcelt/vq.c
View file @
f7a1e165
...
@@ -99,7 +99,7 @@ static void exp_rotation(celt_norm_t *X, int len, int dir, int stride, int K)
...
@@ -99,7 +99,7 @@ static void exp_rotation(celt_norm_t *X, int len, int dir, int stride, int K)
/** Takes the pitch vector and the decoded residual vector, computes the gain
/** Takes the pitch vector and the decoded residual vector, computes the gain
that will give ||p+g*y||=1 and mixes the residual with the pitch. */
that will give ||p+g*y||=1 and mixes the residual with the pitch. */
static
void
mix_pitch_and
_residual
(
int
*
restrict
iy
,
celt_norm_t
*
restrict
X
,
int
N
,
int
K
,
celt_word32_t
Ryy
)
static
void
normalise
_residual
(
int
*
restrict
iy
,
celt_norm_t
*
restrict
X
,
int
N
,
int
K
,
celt_word32_t
Ryy
)
{
{
int
i
;
int
i
;
celt_word32_t
g
;
celt_word32_t
g
;
...
@@ -108,7 +108,7 @@ static void mix_pitch_and_residual(int * restrict iy, celt_norm_t * restrict X,
...
@@ -108,7 +108,7 @@ static void mix_pitch_and_residual(int * restrict iy, celt_norm_t * restrict X,
i
=
0
;
i
=
0
;
do
do
X
[
i
]
=
MULT16_
32_P15
(
g
,
SHL32
(
EXTEND32
(
iy
[
i
]),
1
4
)
);
X
[
i
]
=
SHR16
(
MULT16_
16_16
(
g
,
iy
[
i
]),
1
);
while
(
++
i
<
N
);
while
(
++
i
<
N
);
}
}
...
@@ -270,7 +270,7 @@ void alg_quant(celt_norm_t *X, int N, int K, int spread, ec_enc *enc)
...
@@ -270,7 +270,7 @@ void alg_quant(celt_norm_t *X, int N, int K, int spread, ec_enc *enc)
/* Recompute the gain in one pass to reduce the encoder-decoder mismatch
/* Recompute the gain in one pass to reduce the encoder-decoder mismatch
due to the recursive computation used in quantisation. */
due to the recursive computation used in quantisation. */
mix_pitch_and
_residual
(
iy
,
X
,
N
,
K
,
EXTRACT16
(
SHR32
(
yy
,
2
*
yshift
)));
normalise
_residual
(
iy
,
X
,
N
,
K
,
EXTRACT16
(
SHR32
(
yy
,
2
*
yshift
)));
if
(
spread
)
if
(
spread
)
exp_rotation
(
X
,
N
,
-
1
,
spread
,
K
);
exp_rotation
(
X
,
N
,
-
1
,
spread
,
K
);
RESTORE_STACK
;
RESTORE_STACK
;
...
@@ -293,7 +293,7 @@ void alg_unquant(celt_norm_t *X, int N, int K, int spread, ec_dec *dec)
...
@@ -293,7 +293,7 @@ void alg_unquant(celt_norm_t *X, int N, int K, int spread, ec_dec *dec)
do
{
do
{
Ryy
=
MAC16_16
(
Ryy
,
iy
[
i
],
iy
[
i
]);
Ryy
=
MAC16_16
(
Ryy
,
iy
[
i
],
iy
[
i
]);
}
while
(
++
i
<
N
);
}
while
(
++
i
<
N
);
mix_pitch_and
_residual
(
iy
,
X
,
N
,
K
,
Ryy
);
normalise
_residual
(
iy
,
X
,
N
,
K
,
Ryy
);
if
(
spread
)
if
(
spread
)
exp_rotation
(
X
,
N
,
-
1
,
spread
,
K
);
exp_rotation
(
X
,
N
,
-
1
,
spread
,
K
);
RESTORE_STACK
;
RESTORE_STACK
;
...
...
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