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
ce02e1b4
Commit
ce02e1b4
authored
May 23, 2009
by
Jean-Marc Valin
Browse files
Setting ft=32768 instead of 32767 so that implementations can use shifts and
thus save a few divisions.
parent
d1d74056
Changes
1
Hide whitespace changes
Inline
Side-by-side
libcelt/laplace.c
View file @
ce02e1b4
...
...
@@ -37,13 +37,14 @@
int
ec_laplace_get_start_freq
(
int
decay
)
{
return
(((
ec_uint32
)
3276
7
)
*
(
16384
-
decay
))
/
(
16384
+
decay
);
return
(((
ec_uint32
)
3276
8
)
*
(
16384
-
decay
))
/
(
16384
+
decay
);
}
void
ec_laplace_encode_start
(
ec_enc
*
enc
,
int
*
value
,
int
decay
,
int
fs
)
{
int
i
;
int
fl
,
ft
;
int
fl
;
unsigned
int
ft
;
int
s
=
0
;
int
val
=
*
value
;
if
(
val
<
0
)
...
...
@@ -51,7 +52,7 @@ void ec_laplace_encode_start(ec_enc *enc, int *value, int decay, int fs)
s
=
1
;
val
=
-
val
;
}
ft
=
3276
7
;
ft
=
3276
8
;
fl
=
-
fs
;
for
(
i
=
0
;
i
<
val
;
i
++
)
{
...
...
@@ -90,9 +91,10 @@ void ec_laplace_encode(ec_enc *enc, int *value, int decay)
int
ec_laplace_decode_start
(
ec_dec
*
dec
,
int
decay
,
int
fs
)
{
int
val
=
0
;
int
fl
,
fh
,
ft
,
fm
;
int
fl
,
fh
,
fm
;
unsigned
int
ft
;
fl
=
0
;
ft
=
3276
7
;
ft
=
3276
8
;
fh
=
fs
;
fm
=
ec_decode
(
dec
,
ft
);
/*DEBUG*/
...
...
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