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
6f1cbca5
Commit
6f1cbca5
authored
14 years ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
More cleanup
parent
663c0492
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libcelt/bands.c
+7
-3
7 additions, 3 deletions
libcelt/bands.c
libcelt/vq.c
+6
-5
6 additions, 5 deletions
libcelt/vq.c
libcelt/vq.h
+2
-2
2 additions, 2 deletions
libcelt/vq.h
with
15 additions
and
10 deletions
libcelt/bands.c
+
7
−
3
View file @
6f1cbca5
...
...
@@ -363,7 +363,7 @@ static void stereo_band_mix(const CELTMode *m, celt_norm *X, celt_norm *Y, const
}
}
/* Decide whether we should spread the pulses in the current frame */
int
folding_decision
(
const
CELTMode
*
m
,
celt_norm
*
X
,
celt_word16
*
average
,
int
*
last_decision
,
int
end
,
int
_C
,
int
M
)
{
int
i
,
c
,
N0
;
...
...
@@ -803,6 +803,7 @@ static void quant_band(int encode, const CELTMode *m, int i, celt_norm *X, celt_
if
(
lowband
&&
!
stereo
)
next_lowband2
=
lowband
+
N
;
/* >32-bit split case */
/* Only stereo needs to pass on lowband_out. Otherwise, it's handled at the end */
if
(
stereo
)
next_lowband_out1
=
lowband_out
;
else
...
...
@@ -829,9 +830,9 @@ static void quant_band(int encode, const CELTMode *m, int i, celt_norm *X, celt_
/* Finally do the actual quantization */
if
(
encode
)
alg_quant
(
X
,
N
,
q
,
spread
?
B
:
0
,
lowband
,
resynth
,
(
ec_enc
*
)
ec
,
seed
);
alg_quant
(
X
,
N
,
q
,
spread
,
B
,
lowband
,
resynth
,
(
ec_enc
*
)
ec
,
seed
);
else
alg_unquant
(
X
,
N
,
q
,
spread
?
B
:
0
,
lowband
,
(
ec_dec
*
)
ec
,
seed
);
alg_unquant
(
X
,
N
,
q
,
spread
,
B
,
lowband
,
(
ec_dec
*
)
ec
,
seed
);
}
/* This code is used by the decoder and by the resynthesis-enabled encoder */
...
...
@@ -898,6 +899,8 @@ static void quant_band(int encode, const CELTMode *m, int i, celt_norm *X, celt_
if
(
stereo
)
{
stereo_band_mix
(
m
,
X
,
Y
,
bandE
,
0
,
i
,
-
1
,
N
);
/* We only need to renormalize because quantization may not
have preserved orthogonality of mid and side */
renormalise_vector
(
X
,
Q15ONE
,
N
,
1
);
renormalise_vector
(
Y
,
Q15ONE
,
N
,
1
);
}
...
...
@@ -953,6 +956,7 @@ void quant_all_bands(int encode, const CELTMode *m, int start, int end, celt_nor
else
tell
=
ec_dec_tell
((
ec_dec
*
)
ec
,
BITRES
);
/* Compute how many bits we want to allocate to this band */
if
(
i
!=
start
)
balance
-=
tell
;
remaining_bits
=
(
total_bits
<<
BITRES
)
-
tell
-
1
;
...
...
This diff is collapsed.
Click to expand it.
libcelt/vq.c
+
6
−
5
View file @
6f1cbca5
...
...
@@ -154,7 +154,7 @@ static void normalise_residual(int * restrict iy, celt_norm * restrict X, int N,
while
(
++
i
<
N
);
}
void
alg_quant
(
celt_norm
*
X
,
int
N
,
int
K
,
int
spread
,
celt_norm
*
lowband
,
int
resynth
,
ec_enc
*
enc
,
celt_int32
*
seed
)
void
alg_quant
(
celt_norm
*
X
,
int
N
,
int
K
,
int
spread
,
int
B
,
celt_norm
*
lowband
,
int
resynth
,
ec_enc
*
enc
,
celt_int32
*
seed
)
{
VARDECL
(
celt_norm
,
y
);
VARDECL
(
int
,
iy
);
...
...
@@ -198,7 +198,7 @@ void alg_quant(celt_norm *X, int N, int K, int spread, celt_norm *lowband, int r
N_1
=
512
/
N
;
if
(
spread
)
exp_rotation
(
X
,
N
,
1
,
spread
,
K
);
exp_rotation
(
X
,
N
,
1
,
B
,
K
);
sum
=
0
;
j
=
0
;
do
{
...
...
@@ -332,7 +332,7 @@ void alg_quant(celt_norm *X, int N, int K, int spread, celt_norm *lowband, int r
{
normalise_residual
(
iy
,
X
,
N
,
K
,
EXTRACT16
(
SHR32
(
yy
,
2
*
yshift
)));
if
(
spread
)
exp_rotation
(
X
,
N
,
-
1
,
spread
,
K
);
exp_rotation
(
X
,
N
,
-
1
,
B
,
K
);
}
RESTORE_STACK
;
}
...
...
@@ -340,12 +340,13 @@ void alg_quant(celt_norm *X, int N, int K, int spread, celt_norm *lowband, int r
/** Decode pulse vector and combine the result with the pitch vector to produce
the final normalised signal in the current band. */
void
alg_unquant
(
celt_norm
*
X
,
int
N
,
int
K
,
int
spread
,
celt_norm
*
lowband
,
ec_dec
*
dec
,
celt_int32
*
seed
)
void
alg_unquant
(
celt_norm
*
X
,
int
N
,
int
K
,
int
spread
,
int
B
,
celt_norm
*
lowband
,
ec_dec
*
dec
,
celt_int32
*
seed
)
{
int
i
;
celt_word32
Ryy
;
VARDECL
(
int
,
iy
);
SAVE_STACK
;
if
(
K
==
0
)
{
if
(
lowband
!=
NULL
)
...
...
@@ -373,7 +374,7 @@ void alg_unquant(celt_norm *X, int N, int K, int spread, celt_norm *lowband, ec_
}
while
(
++
i
<
N
);
normalise_residual
(
iy
,
X
,
N
,
K
,
Ryy
);
if
(
spread
)
exp_rotation
(
X
,
N
,
-
1
,
spread
,
K
);
exp_rotation
(
X
,
N
,
-
1
,
B
,
K
);
RESTORE_STACK
;
}
...
...
This diff is collapsed.
Click to expand it.
libcelt/vq.h
+
2
−
2
View file @
6f1cbca5
...
...
@@ -51,7 +51,7 @@
* @param p Pitch vector (it is assumed that p+x is a unit vector)
* @param enc Entropy encoder state
*/
void
alg_quant
(
celt_norm
*
X
,
int
N
,
int
K
,
int
spread
,
celt_norm
*
lowband
,
int
resynth
,
ec_enc
*
enc
,
celt_int32
*
seed
);
void
alg_quant
(
celt_norm
*
X
,
int
N
,
int
K
,
int
spread
,
int
B
,
celt_norm
*
lowband
,
int
resynth
,
ec_enc
*
enc
,
celt_int32
*
seed
);
/** Algebraic pulse decoder
* @param x Decoded normalised spectrum (returned)
...
...
@@ -60,7 +60,7 @@ void alg_quant(celt_norm *X, int N, int K, int spread, celt_norm *lowband, int r
* @param p Pitch vector (automatically added to x)
* @param dec Entropy decoder state
*/
void
alg_unquant
(
celt_norm
*
X
,
int
N
,
int
K
,
int
spread
,
celt_norm
*
lowband
,
ec_dec
*
dec
,
celt_int32
*
seed
);
void
alg_unquant
(
celt_norm
*
X
,
int
N
,
int
K
,
int
spread
,
int
B
,
celt_norm
*
lowband
,
ec_dec
*
dec
,
celt_int32
*
seed
);
celt_word16
renormalise_vector
(
celt_norm
*
X
,
celt_word16
value
,
int
N
,
int
stride
);
...
...
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