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
630ee44a
Commit
630ee44a
authored
Oct 24, 2009
by
Jean-Marc Valin
Browse files
SMALL_FOOTPRINT preserves the special n=1 cwrs case
parent
c2f7dff5
Changes
1
Hide whitespace changes
Inline
Side-by-side
libcelt/cwrs.c
View file @
630ee44a
...
...
@@ -809,13 +809,13 @@ void get_required_bits(celt_int16 *_bits,int _n,int _maxk,int _frac){
static
inline
void
encode_pulses32
(
int
_n
,
int
_k
,
const
int
*
_y
,
ec_enc
*
_enc
){
celt_uint32
i
;
#ifndef SMALL_FOOTPRINT
switch
(
_n
){
case
1
:{
i
=
icwrs1
(
_y
,
&
_k
);
celt_assert
(
ncwrs1
(
_k
)
==
2
);
ec_enc_bits
(
_enc
,
i
,
1
);
}
break
;
#ifndef SMALL_FOOTPRINT
case
2
:{
i
=
icwrs2
(
_y
,
&
_k
);
ec_enc_uint
(
_enc
,
i
,
ncwrs2
(
_k
));
...
...
@@ -832,10 +832,8 @@ static inline void encode_pulses32(int _n,int _k,const int *_y,ec_enc *_enc){
i
=
icwrs5
(
_y
,
&
_k
);
ec_enc_uint
(
_enc
,
i
,
ncwrs5
(
_k
));
}
break
;
default:
#else
{
#endif
default:
{
VARDECL
(
celt_uint32
,
u
);
celt_uint32
nc
;
...
...
@@ -868,20 +866,18 @@ void encode_pulses(int *_y, int N, int K, ec_enc *enc)
}
static
inline
void
decode_pulses32
(
int
_n
,
int
_k
,
int
*
_y
,
ec_dec
*
_dec
){
#ifndef SMALL_FOOTPRINT
switch
(
_n
){
case
1
:{
celt_assert
(
ncwrs1
(
_k
)
==
2
);
cwrsi1
(
_k
,
ec_dec_bits
(
_dec
,
1
),
_y
);
}
break
;
#ifndef SMALL_FOOTPRINT
case
2
:
cwrsi2
(
_k
,
ec_dec_uint
(
_dec
,
ncwrs2
(
_k
)),
_y
);
break
;
case
3
:
cwrsi3
(
_k
,
ec_dec_uint
(
_dec
,
ncwrs3
(
_k
)),
_y
);
break
;
case
4
:
cwrsi4
(
_k
,
ec_dec_uint
(
_dec
,
ncwrs4
(
_k
)),
_y
);
break
;
case
5
:
cwrsi5
(
_k
,
ec_dec_uint
(
_dec
,
ncwrs5
(
_k
)),
_y
);
break
;
default:
#else
{
#endif
default:
{
VARDECL
(
celt_uint32
,
u
);
SAVE_STACK
;
...
...
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