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
01b54b99
Commit
01b54b99
authored
14 years ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
Completely removed the old allocation table.
Also made the new table an unsigned char array.
parent
c51e98ba
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libcelt/modes.c
+3
-23
3 additions, 23 deletions
libcelt/modes.c
libcelt/modes.h
+1
-1
1 addition, 1 deletion
libcelt/modes.h
with
4 additions
and
24 deletions
libcelt/modes.c
+
3
−
23
View file @
01b54b99
...
...
@@ -92,33 +92,13 @@ static const celt_int16 bark_freq[BARK_BANDS+1] = {
/* This allocation table is per critical band. When creating a mode, the bits get added together
into the codec bands, which are sometimes larger than one critical band at low frequency */
#ifdef STDIN_TUNING
int
BITALLOC_SIZE
;
int
*
band_allocation
;
#else
#define BITALLOC_SIZE 12
static
const
unsigned
char
band_allocation
[
BARK_BANDS
*
BITALLOC_SIZE
]
=
/* 0 100 200 300 400 510 630 770 920 1k 1.2 1.5 1.7 2k 2.3 2.7 3.1 3.7 4.4 5.3 6.4 7.7 9.5 12k 15k */
{
4
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
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28
,
30
,
35
,
42
,
46
,
50
,
55
,
60
,
62
,
62
,
72
,
82
,
62
,
/*10*/
9
,
9
,
9
,
10
,
12
,
13
,
15
,
18
,
22
,
30
,
32
,
35
,
40
,
45
,
55
,
62
,
66
,
70
,
85
,
90
,
92
,
92
,
92
,
102
,
92
,
/*11*/
};
#endif
static
const
celt_int16
eband5ms
[]
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
10
,
12
,
14
,
16
,
20
,
24
,
28
,
34
,
40
,
48
,
60
,
78
,
100
};
static
const
celt_int16
alloc_5ms
[]
=
{
static
const
unsigned
char
alloc_5ms
[]
=
{
10
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
10
,
3
,
8
,
2
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
10
,
6
,
8
,
6
,
5
,
4
,
3
,
2
,
7
,
10
,
11
,
9
,
7
,
3
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
...
...
@@ -203,11 +183,11 @@ static celt_int16 *compute_ebands(celt_int32 Fs, int frame_size, int res, int *n
static
void
compute_allocation_table
(
CELTMode
*
mode
,
int
res
)
{
int
i
,
j
,
nBark
;
celt_int16
*
allocVectors
;
unsigned
char
*
allocVectors
;
int
maxBands
=
sizeof
(
eband5ms
)
/
sizeof
(
eband5ms
[
0
])
-
1
;
mode
->
nbAllocVectors
=
BITALLOC_SIZE
;
allocVectors
=
celt_alloc
(
sizeof
(
celt_int16
)
*
(
BITALLOC_SIZE
*
mode
->
nbEBands
));
allocVectors
=
celt_alloc
(
sizeof
(
unsigned
char
)
*
(
BITALLOC_SIZE
*
mode
->
nbEBands
));
if
(
allocVectors
==
NULL
)
return
;
...
...
This diff is collapsed.
Click to expand it.
libcelt/modes.h
+
1
−
1
View file @
01b54b99
...
...
@@ -91,7 +91,7 @@ struct CELTMode {
celt_word16
ePredCoef
;
/**< Prediction coefficient for the energy encoding */
int
nbAllocVectors
;
/**< Number of lines in the matrix below */
const
celt_int16
*
allocVectors
;
/**< Number of bits in each band for several rates */
const
unsigned
char
*
allocVectors
;
/**< Number of bits in each band for several rates */
const
celt_int16
*
const
**
bits
;
const
celt_int16
*
const
*
(
_bits
[
MAX_CONFIG_SIZES
]);
/**< Cache for pulses->bits mapping in each band */
...
...
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