Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CELT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiph.Org
CELT
Commits
2b08d7a2
Commit
2b08d7a2
authored
16 years ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
Removing the 64-bit part of the range coder.
parent
b6a3b0c4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
libcelt/bands.c
+2
-2
2 additions, 2 deletions
libcelt/bands.c
libcelt/entcode.c
+0
-27
0 additions, 27 deletions
libcelt/entcode.c
libcelt/entdec.c
+0
-40
0 additions, 40 deletions
libcelt/entdec.c
libcelt/entenc.c
+0
-25
0 additions, 25 deletions
libcelt/entenc.c
tests/ectest.c
+0
-24
0 additions, 24 deletions
tests/ectest.c
with
2 additions
and
118 deletions
libcelt/bands.c
+
2
−
2
View file @
2b08d7a2
...
...
@@ -355,7 +355,7 @@ void quant_bands(const CELTMode *m, celt_norm_t * restrict X, celt_norm_t *P, ce
int
tell
;
int
q
;
celt_word16_t
n
;
celt_int16_t
*
const
*
BPbits
;
const
celt_int16_t
*
const
*
BPbits
;
int
curr_balance
,
curr_bits
;
...
...
@@ -440,7 +440,7 @@ void unquant_bands(const CELTMode *m, celt_norm_t * restrict X, celt_norm_t *P,
int
tell
;
int
q
;
celt_word16_t
n
;
celt_int16_t
*
const
*
BPbits
;
const
celt_int16_t
*
const
*
BPbits
;
int
curr_balance
,
curr_bits
;
...
...
This diff is collapsed.
Click to expand it.
libcelt/entcode.c
+
0
−
27
View file @
2b08d7a2
...
...
@@ -37,30 +37,3 @@ int ec_ilog(ec_uint32 _v){
#endif
}
int
ec_ilog64
(
ec_uint64
_v
){
#if defined(EC_CLZ64)
return
EC_CLZ64_0
-
EC_CLZ64
(
_v
);
#else
ec_uint32
v
;
int
ret
;
int
m
;
ret
=!!
_v
;
m
=!!
(
_v
&
((
ec_uint64
)
0xFFFFFFFF
)
<<
32
)
<<
5
;
v
=
(
ec_uint32
)(
_v
>>
m
);
ret
|=
m
;
m
=!!
(
v
&
0xFFFF0000
)
<<
4
;
v
>>=
m
;
ret
|=
m
;
m
=!!
(
v
&
0xFF00
)
<<
3
;
v
>>=
m
;
ret
|=
m
;
m
=!!
(
v
&
0xF0
)
<<
2
;
v
>>=
m
;
ret
|=
m
;
m
=!!
(
v
&
0xC
)
<<
1
;
v
>>=
m
;
ret
|=
m
;
ret
+=!!
(
v
&
0x2
);
return
ret
;
#endif
}
This diff is collapsed.
Click to expand it.
libcelt/entdec.c
+
0
−
40
View file @
2b08d7a2
...
...
@@ -100,16 +100,6 @@ ec_uint32 ec_dec_bits(ec_dec *_this,int _ftb){
return
t
;
}
ec_uint64
ec_dec_bits64
(
ec_dec
*
_this
,
int
_ftb
){
ec_uint32
t
;
if
(
_ftb
>
32
){
t
=
ec_dec_bits
(
_this
,
_ftb
-
32
);
_ftb
=
32
;
}
else
t
=
0
;
return
(
ec_uint64
)
t
<<
32
|
ec_dec_bits
(
_this
,
_ftb
);
}
ec_uint32
ec_dec_uint
(
ec_dec
*
_this
,
ec_uint32
_ft
){
ec_uint32
t
;
unsigned
ft
;
...
...
@@ -139,33 +129,3 @@ ec_uint32 ec_dec_uint(ec_dec *_this,ec_uint32 _ft){
return
t
;
}
}
ec_uint64
ec_dec_uint64
(
ec_dec
*
_this
,
ec_uint64
_ft
){
ec_uint64
t
;
unsigned
ft
;
unsigned
s
;
int
ftb
;
t
=
0
;
_ft
--
;
ftb
=
EC_ILOG64
(
_ft
);
if
(
ftb
>
EC_UNIT_BITS
){
ftb
-=
EC_UNIT_BITS
;
ft
=
(
unsigned
)(
_ft
>>
ftb
)
+
1
;
s
=
ec_decode
(
_this
,
ft
);
ec_dec_update
(
_this
,
s
,
s
+
1
,
ft
);
t
=
t
<<
EC_UNIT_BITS
|
s
;
t
=
t
<<
ftb
|
ec_dec_bits64
(
_this
,
ftb
);
if
(
t
>
_ft
)
{
celt_notify
(
"uint decode error"
);
t
=
_ft
;
}
return
t
;
}
else
{
_ft
++
;
s
=
ec_decode
(
_this
,(
unsigned
)
_ft
);
ec_dec_update
(
_this
,
s
,
s
+
1
,(
unsigned
)
_ft
);
t
=
t
<<
ftb
|
s
;
return
t
;
}
}
This diff is collapsed.
Click to expand it.
libcelt/entenc.c
+
0
−
25
View file @
2b08d7a2
...
...
@@ -77,15 +77,6 @@ void ec_enc_bits(ec_enc *_this,ec_uint32 _fl,int _ftb){
ec_encode_bin
(
_this
,
fl
,
fl
+
1
,
_ftb
);
}
void
ec_enc_bits64
(
ec_enc
*
_this
,
ec_uint64
_fl
,
int
_ftb
){
if
(
_ftb
>
32
){
ec_enc_bits
(
_this
,(
ec_uint32
)(
_fl
>>
32
),
_ftb
-
32
);
_ftb
=
32
;
_fl
&=
0xFFFFFFFF
;
}
ec_enc_bits
(
_this
,(
ec_uint32
)
_fl
,
_ftb
);
}
void
ec_enc_uint
(
ec_enc
*
_this
,
ec_uint32
_fl
,
ec_uint32
_ft
){
unsigned
ft
;
unsigned
fl
;
...
...
@@ -103,19 +94,3 @@ void ec_enc_uint(ec_enc *_this,ec_uint32 _fl,ec_uint32 _ft){
}
}
void
ec_enc_uint64
(
ec_enc
*
_this
,
ec_uint64
_fl
,
ec_uint64
_ft
){
unsigned
ft
;
unsigned
fl
;
int
ftb
;
_ft
--
;
ftb
=
EC_ILOG64
(
_ft
)
&-!!
_ft
;
if
(
ftb
>
EC_UNIT_BITS
){
ftb
-=
EC_UNIT_BITS
;
ft
=
(
unsigned
)(
_ft
>>
ftb
)
+
1
;
fl
=
(
unsigned
)(
_fl
>>
ftb
);
ec_encode
(
_this
,
fl
,
fl
+
1
,
ft
);
ec_enc_bits64
(
_this
,
_fl
,
ftb
);
}
else
{
ec_encode
(
_this
,
_fl
,
_fl
+
1
,
_ft
+
1
);
}
}
This diff is collapsed.
Click to expand it.
tests/ectest.c
+
0
−
24
View file @
2b08d7a2
...
...
@@ -17,7 +17,6 @@ int main(int _argc,char **_argv){
ec_byte_buffer
buf
;
ec_enc
enc
;
ec_dec
dec
;
ec_uint64
sym64
;
long
nbits
;
long
nbits2
;
double
entropy
;
...
...
@@ -36,8 +35,6 @@ int main(int _argc,char **_argv){
for
(
i
=
0
;
i
<
ft
;
i
++
){
entropy
+=
log
(
ft
)
*
M_LOG2E
;
ec_enc_uint
(
&
enc
,
i
,
ft
);
entropy
+=
log
(
ft
)
*
M_LOG2E
+
30
;
ec_enc_uint64
(
&
enc
,(
ec_uint64
)
i
<<
30
|
i
,(
ec_uint64
)
ft
<<
30
);
}
}
/*Testing encoding of raw bit values.*/
...
...
@@ -52,15 +49,6 @@ int main(int _argc,char **_argv){
nbits2
-
nbits
,
ftb
);
ret
=-
1
;
}
entropy
+=
ftb
+
30
;
nbits
=
nbits2
;
ec_enc_bits64
(
&
enc
,(
ec_uint64
)
i
<<
30
|
i
,
ftb
+
30
);
nbits2
=
ec_enc_tell
(
&
enc
,
0
);
if
(
nbits2
-
nbits
!=
ftb
+
30
){
fprintf
(
stderr
,
"Used %li bits to encode %i bits directly.
\n
"
,
nbits2
-
nbits
,
ftb
+
30
);
ret
=-
1
;
}
}
}
nbits
=
ec_enc_tell
(
&
enc
,
4
);
...
...
@@ -78,12 +66,6 @@ int main(int _argc,char **_argv){
fprintf
(
stderr
,
"Decoded %i instead of %i with ft of %i.
\n
"
,
sym
,
i
,
ft
);
ret
=-
1
;
}
sym64
=
ec_dec_uint64
(
&
dec
,(
ec_uint64
)
ft
<<
30
);
if
(
sym64
!=
((
ec_uint64
)
i
<<
30
|
i
)){
fprintf
(
stderr
,
"Decoded %lu instead of %lu with ft of %lu.
\n
"
,
sym64
,
(
ec_uint64
)
i
<<
30
|
i
,(
ec_uint64
)
ft
<<
30
);
ret
=-
1
;
}
}
}
for
(
ftb
=
0
;
ftb
<
16
;
ftb
++
){
...
...
@@ -93,12 +75,6 @@ int main(int _argc,char **_argv){
fprintf
(
stderr
,
"Decoded %i instead of %i with ftb of %i.
\n
"
,
sym
,
i
,
ftb
);
ret
=-
1
;
}
sym64
=
ec_dec_bits64
(
&
dec
,
ftb
+
30
);
if
(
sym64
!=
((
ec_uint64
)
i
<<
30
|
i
)){
fprintf
(
stderr
,
"Decoded %lu instead of %lu with ftb of %i.
\n
"
,
sym64
,(
ec_uint64
)
i
<<
30
|
i
,
ftb
+
30
);
ret
=-
1
;
}
}
}
nbits2
=
ec_dec_tell
(
&
dec
,
4
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment