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
fe0b8e8d
Commit
fe0b8e8d
authored
16 years ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
infrastructure changes for upcoming stereo improvements
parent
21f26661
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
+10
-1
10 additions, 1 deletion
libcelt/bands.c
libcelt/bands.h
+2
-0
2 additions, 0 deletions
libcelt/bands.h
libcelt/modes.c
+1
-1
1 addition, 1 deletion
libcelt/modes.c
libcelt/rate.c
+5
-5
5 additions, 5 deletions
libcelt/rate.c
libcelt/rate.h
+1
-1
1 addition, 1 deletion
libcelt/rate.h
with
19 additions
and
8 deletions
libcelt/bands.c
+
10
−
1
View file @
fe0b8e8d
...
...
@@ -289,7 +289,6 @@ void pitch_quant_bands(const CELTMode *m, celt_norm_t * restrict P, const celt_p
P
[
i
]
=
0
;
}
/* Quantisation of the residual */
void
quant_bands
(
const
CELTMode
*
m
,
celt_norm_t
*
restrict
X
,
celt_norm_t
*
P
,
celt_mask_t
*
W
,
int
total_bits
,
ec_enc
*
enc
)
{
...
...
@@ -409,6 +408,16 @@ void unquant_bands(const CELTMode *m, celt_norm_t * restrict X, celt_norm_t *P,
}
#ifndef DISABLE_STEREO
void
stereo_decision
(
const
CELTMode
*
m
,
celt_norm_t
*
restrict
X
,
int
*
stereo_mode
,
int
len
)
{
int
i
;
for
(
i
=
0
;
i
<
len
-
5
;
i
++
)
stereo_mode
[
i
]
=
0
;
for
(;
i
<
len
;
i
++
)
stereo_mode
[
i
]
=
1
;
}
void
stereo_mix
(
const
CELTMode
*
m
,
celt_norm_t
*
X
,
const
celt_ener_t
*
bank
,
int
dir
)
{
int
i
;
...
...
This diff is collapsed.
Click to expand it.
libcelt/bands.h
+
2
−
0
View file @
fe0b8e8d
...
...
@@ -97,6 +97,8 @@ void quant_bands(const CELTMode *m, celt_norm_t * restrict X, celt_norm_t *P, ce
*/
void
unquant_bands
(
const
CELTMode
*
m
,
celt_norm_t
*
restrict
X
,
celt_norm_t
*
P
,
int
total_bits
,
ec_dec
*
dec
);
void
stereo_decision
(
const
CELTMode
*
m
,
celt_norm_t
*
restrict
X
,
int
*
stereo_mode
,
int
len
);
void
stereo_mix
(
const
CELTMode
*
m
,
celt_norm_t
*
X
,
const
celt_ener_t
*
bank
,
int
dir
);
#endif
/* BANDS_H */
This diff is collapsed.
Click to expand it.
libcelt/modes.c
+
1
−
1
View file @
fe0b8e8d
...
...
@@ -364,7 +364,7 @@ CELTMode EXPORT *celt_mode_create(celt_int32_t Fs, int channels, int frame_size,
#endif
mode
->
window
=
window
;
compute_alloc_cache
(
mode
);
mode
->
bits
=
(
const
celt_int16_t
**
)
compute_alloc_cache
(
mode
,
mode
->
nbChannels
);
#ifndef SHORTCUTS
psydecay_init
(
&
mode
->
psy
,
MAX_PERIOD
/
2
,
mode
->
Fs
);
...
...
This diff is collapsed.
Click to expand it.
libcelt/rate.c
+
5
−
5
View file @
fe0b8e8d
...
...
@@ -97,19 +97,19 @@ static int log2_frac64(ec_uint64 val, int frac)
return
L
;
}
void
compute_alloc_cache
(
CELTMode
*
m
)
celt_int16_t
**
compute_alloc_cache
(
CELTMode
*
m
,
int
C
)
{
int
i
,
prevN
,
BC
;
int
i
,
prevN
;
celt_int16_t
**
bits
;
const
celt_int16_t
*
eBands
=
m
->
eBands
;
bits
=
celt_alloc
(
m
->
nbEBands
*
sizeof
(
celt_int16_t
*
));
B
C
=
m
->
nbChannels
;
C
=
m
->
nbChannels
;
prevN
=
-
1
;
for
(
i
=
0
;
i
<
m
->
nbEBands
;
i
++
)
{
int
N
=
B
C
*
(
eBands
[
i
+
1
]
-
eBands
[
i
]);
int
N
=
C
*
(
eBands
[
i
+
1
]
-
eBands
[
i
]);
if
(
N
==
prevN
&&
eBands
[
i
]
<
m
->
pitchEnd
)
{
bits
[
i
]
=
bits
[
i
-
1
];
...
...
@@ -150,7 +150,7 @@ void compute_alloc_cache(CELTMode *m)
RESTORE_STACK
;
}
}
m
->
bits
=
(
const
celt_int16_t
*
const
*
)
bits
;
return
bits
;
}
#endif
/* !STATIC_MODES */
...
...
This diff is collapsed.
Click to expand it.
libcelt/rate.h
+
1
−
1
View file @
fe0b8e8d
...
...
@@ -36,7 +36,7 @@
#define LOG_MAX_PULSES 6
/** Computes a cache of the pulses->bits mapping in each band */
void
compute_alloc_cache
(
CELTMode
*
m
);
celt_int16_t
**
compute_alloc_cache
(
CELTMode
*
m
,
int
C
);
/** Compute the pulse allocation, i.e. how many pulses will go 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