Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Opus
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
Opus
Commits
9d2d0510
Commit
9d2d0510
authored
14 years ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
Using tell() rather than log2_frac() to compute qalloc
parent
d9f6ec3f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libcelt/bands.c
+4
-4
4 additions, 4 deletions
libcelt/bands.c
with
4 additions
and
4 deletions
libcelt/bands.c
+
4
−
4
View file @
9d2d0510
...
...
@@ -626,11 +626,11 @@ static void quant_band(int encode, const CELTMode *m, int i, celt_norm *X, celt_
int
mbits
,
sbits
,
delta
;
int
qalloc
;
int
offset
;
celt_int32
tell
;
/* Decide on the resolution to give to the split parameter theta */
offset
=
((
m
->
logN
[
i
]
+
(
LM
<<
BITRES
))
>>
1
)
-
(
stereo
?
QTHETA_OFFSET_STEREO
:
QTHETA_OFFSET
);
qn
=
compute_qn
(
N
,
b
,
offset
,
stereo
);
qalloc
=
0
;
if
(
stereo
&&
i
>=
intensity
)
qn
=
1
;
if
(
encode
)
...
...
@@ -641,6 +641,7 @@ static void quant_band(int encode, const CELTMode *m, int i, celt_norm *X, celt_
2) they are orthogonal. */
itheta
=
stereo_itheta
(
X
,
Y
,
stereo
,
N
);
}
tell
=
encode
?
ec_enc_tell
(
ec
,
BITRES
)
:
ec_dec_tell
(
ec
,
BITRES
);
if
(
qn
!=
1
)
{
if
(
encode
)
...
...
@@ -654,7 +655,6 @@ static void quant_band(int encode, const CELTMode *m, int i, celt_norm *X, celt_
ec_enc_uint
((
ec_enc
*
)
ec
,
itheta
,
qn
+
1
);
else
itheta
=
ec_dec_uint
((
ec_dec
*
)
ec
,
qn
+
1
);
qalloc
=
log2_frac
(
qn
+
1
,
BITRES
);
}
else
{
int
fs
=
1
,
ft
;
ft
=
((
qn
>>
1
)
+
1
)
*
((
qn
>>
1
)
+
1
);
...
...
@@ -688,7 +688,6 @@ static void quant_band(int encode, const CELTMode *m, int i, celt_norm *X, celt_
ec_dec_update
((
ec_dec
*
)
ec
,
fl
,
fl
+
fs
,
ft
);
}
qalloc
=
log2_frac
(
ft
,
BITRES
)
-
log2_frac
(
fs
,
BITRES
)
+
1
;
}
itheta
=
(
celt_int32
)
itheta
*
16384
/
qn
;
if
(
encode
&&
stereo
)
...
...
@@ -713,11 +712,12 @@ static void quant_band(int encode, const CELTMode *m, int i, celt_norm *X, celt_
ec_enc_bit_logp
(
ec
,
inv
,
2
);
else
inv
=
ec_dec_bit_logp
(
ec
,
2
);
qalloc
=
inv
?
16
:
4
;
}
else
inv
=
0
;
itheta
=
0
;
}
qalloc
=
(
encode
?
ec_enc_tell
(
ec
,
BITRES
)
:
ec_dec_tell
(
ec
,
BITRES
))
-
tell
;
if
(
itheta
==
0
)
{
...
...
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