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
d5f99308
Commit
d5f99308
authored
Dec 16, 2009
by
Jean-Marc Valin
Browse files
This fixes a bug in stereo PLC (offset wasn't changed between channels)
parent
5a0fae53
Changes
1
Hide whitespace changes
Inline
Side-by-side
libcelt/celt.c
View file @
d5f99308
...
...
@@ -646,11 +646,12 @@ int celt_encode_float(CELTEncoder * restrict st, const celt_sig * pcm, celt_sig
&&
norm_rate
<
50
;
if
(
has_pitch
)
{
/* FIXME: Should probably do a stack save/pop here */
VARDECL
(
celt_word16
,
x_lp
);
SAVE_STACK
;
ALLOC
(
x_lp
,
(
2
*
N
-
2
*
N4
)
>>
1
,
celt_word16
);
pitch_downsample
(
in
,
x_lp
,
2
*
N
-
2
*
N4
,
N
,
C
,
&
st
->
xmem
,
&
st
->
pitch_buf
[
MAX_PERIOD
>>
1
]);
pitch_search
(
st
->
mode
,
x_lp
,
st
->
pitch_buf
,
2
*
N
-
2
*
N4
,
MAX_PERIOD
-
(
2
*
N
-
2
*
N4
),
&
pitch_index
,
&
st
->
xmem
);
RESTORE_STACK
;
}
/* Deferred allocation after find_spectral_pitch() to reduce
...
...
@@ -1269,8 +1270,8 @@ static void celt_decode_lost(CELTDecoder * restrict st, celt_word16 * restrict p
fade
=
0
;
}
offset
=
MAX_PERIOD
-
pitch_index
;
#ifdef FIXED_POINT
offset
=
MAX_PERIOD
-
pitch_index
;
ALLOC
(
freq
,
C
*
N
,
celt_sig
);
/**< Interleaved signal MDCTs */
while
(
offset
+
len
>=
MAX_PERIOD
)
offset
-=
pitch_index
;
...
...
@@ -1290,6 +1291,7 @@ static void celt_decode_lost(CELTDecoder * restrict st, celt_word16 * restrict p
float
decay
=
1
;
celt_word32
mem
[
LPC_ORDER
]
=
{
0
};
offset
=
MAX_PERIOD
-
pitch_index
;
for
(
i
=
0
;
i
<
MAX_PERIOD
;
i
++
)
exc
[
i
]
=
st
->
out_mem
[
i
*
C
+
c
];
...
...
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