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
69653888
Commit
69653888
authored
13 years ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
Implements CELT_SET_LOSS_PERC
parent
fdd86753
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/celt.c
+15
-0
15 additions, 0 deletions
libcelt/celt.c
libcelt/celt.h
+3
-0
3 additions, 0 deletions
libcelt/celt.h
with
18 additions
and
0 deletions
libcelt/celt.c
+
15
−
0
View file @
69653888
...
...
@@ -144,6 +144,7 @@ struct CELTEncoder {
int
vbr
;
int
signalling
;
int
constrained_vbr
;
/* If zero, VBR can do whatever it likes with the rate */
int
loss_rate
;
/* Everything beyond this point gets cleared on a reset */
#define ENCODER_RESET_START rng
...
...
@@ -1142,6 +1143,12 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, i
if
(
pitch_index
>
COMBFILTER_MAXPERIOD
-
2
)
pitch_index
=
COMBFILTER_MAXPERIOD
-
2
;
gain1
=
MULT16_16_Q15
(
QCONST16
(.
7
f
,
15
),
gain1
);
if
(
st
->
loss_rate
>
2
)
gain1
=
HALF32
(
gain1
);
if
(
st
->
loss_rate
>
4
)
gain1
=
HALF32
(
gain1
);
if
(
st
->
loss_rate
>
8
)
gain1
=
0
;
prefilter_tapset
=
st
->
tapset_decision
;
}
else
{
gain1
=
0
;
...
...
@@ -1787,6 +1794,14 @@ int celt_encoder_ctl(CELTEncoder * restrict st, int request, ...)
st
->
force_intra
=
value
==
0
;
}
break
;
case
CELT_SET_LOSS_PERC_REQUEST
:
{
int
value
=
va_arg
(
ap
,
celt_int32
);
if
(
value
<
0
||
value
>
100
)
goto
bad_arg
;
st
->
loss_rate
=
value
;
}
break
;
case
CELT_SET_VBR_CONSTRAINT_REQUEST
:
{
celt_int32
value
=
va_arg
(
ap
,
celt_int32
);
...
...
This diff is collapsed.
Click to expand it.
libcelt/celt.h
+
3
−
0
View file @
69653888
...
...
@@ -112,6 +112,9 @@ extern "C" {
#define CELT_SET_CHANNELS_REQUEST 18
#define CELT_SET_CHANNELS(x) CELT_SET_CHANNELS_REQUEST, _celt_check_int(x)
#define CELT_SET_LOSS_PERC_REQUEST 20
#define CELT_SET_LOSS_PERC(x) CELT_SET_LOSS_PERC_REQUEST, _celt_check_int(x)
/* Internal */
#define CELT_SET_START_BAND_REQUEST 10000
#define CELT_SET_START_BAND(x) CELT_SET_START_BAND_REQUEST, _celt_check_int(x)
...
...
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