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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Alexander Traud
Opus
Commits
ec836da2
Commit
ec836da2
authored
15 years ago
by
Gregory Maxwell
Committed by
Jean-Marc Valin
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Reduce rounding in the mode allocator and remove a scaling loop.
This breaks the bitstream.
parent
74f4e9f3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libcelt/modes.c
+10
-17
10 additions, 17 deletions
libcelt/modes.c
with
10 additions
and
17 deletions
libcelt/modes.c
+
10
−
17
View file @
ec836da2
...
...
@@ -206,7 +206,7 @@ static void compute_pbands(CELTMode *mode, int res)
static
void
compute_allocation_table
(
CELTMode
*
mode
,
int
res
)
{
int
i
,
j
,
eband
,
nBark
;
int
i
,
j
,
nBark
;
celt_int16_t
*
allocVectors
,
*
allocEnergy
;
const
int
C
=
CHANNELS
(
mode
);
...
...
@@ -221,38 +221,31 @@ static void compute_allocation_table(CELTMode *mode, int res)
/* Compute per-codec-band allocation from per-critical-band matrix */
for
(
i
=
0
;
i
<
BITALLOC_SIZE
;
i
++
)
{
eband
=
0
;
celt_int32_t
current
=
0
;
int
eband
=
0
;
for
(
j
=
0
;
j
<
nBark
;
j
++
)
{
int
edge
,
low
;
celt_int32_t
alloc
;
edge
=
mode
->
eBands
[
eband
+
1
]
*
res
;
alloc
=
band_allocation
[
i
*
BARK_BANDS
+
j
];
alloc
=
alloc
*
C
*
mode
->
mdctSize
/
4
;
alloc
=
alloc
*
C
*
mode
->
mdctSize
;
if
(
edge
<
bark_freq
[
j
+
1
])
{
int
num
,
den
;
num
=
alloc
*
(
edge
-
bark_freq
[
j
]);
den
=
bark_freq
[
j
+
1
]
-
bark_freq
[
j
];
low
=
(
num
+
den
/
2
)
/
den
;
allocVectors
[
i
*
mode
->
nbEBands
+
eband
]
+=
low
;
allocVectors
[
i
*
mode
->
nbEBands
+
eband
]
=
(
current
+
low
+
128
)
/
256
;
current
=
0
;
eband
++
;
allocVectors
[
i
*
mode
->
nbEBands
+
eband
]
+=
alloc
-
low
;
current
+=
alloc
-
low
;
}
else
{
allocVectors
[
i
*
mode
->
nbEBands
+
eband
]
+=
alloc
;
}
current
+=
alloc
;
}
}
allocVectors
[
i
*
mode
->
nbEBands
+
eband
]
=
(
current
+
128
)
/
256
;
}
for
(
i
=
0
;
i
<
mode
->
nbAllocVectors
;
i
++
)
{
for
(
j
=
0
;
j
<
mode
->
nbEBands
;
j
++
)
allocVectors
[
i
*
mode
->
nbEBands
+
j
]
=
(
allocVectors
[
i
*
mode
->
nbEBands
+
j
]
+
32
)
/
64
;
}
/*for (i=0;i<mode->nbAllocVectors;i++)
{
for (j=0;j<mode->nbEBands;j++)
allocVectors[i*mode->nbEBands+j] += C;
}*/
mode
->
allocVectors
=
allocVectors
;
}
...
...
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