Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Mark Harris
Opus
Commits
2ca6df03
Commit
2ca6df03
authored
Jun 08, 2016
by
Jean-Marc Valin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor TF cleanup (tf_sum was useless), plus comments
parent
f705e9b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
celt/celt.c
celt/celt.c
+9
-4
celt/celt_encoder.c
celt/celt_encoder.c
+2
-7
No files found.
celt/celt.c
View file @
2ca6df03
...
...
@@ -244,11 +244,16 @@ void comb_filter(opus_val32 *y, opus_val32 *x, int T0, int T1, int N,
}
#endif
/* OVERRIDE_comb_filter */
/* TF change table. Positive values mean better frequency resolution (longer
effective window), whereas negative values mean better time resolution
(shorter effective window). The second index is computed as:
4*isTransient + 2*tf_select + per_band_flag */
const
signed
char
tf_select_table
[
4
][
8
]
=
{
{
0
,
-
1
,
0
,
-
1
,
0
,
-
1
,
0
,
-
1
},
{
0
,
-
1
,
0
,
-
2
,
1
,
0
,
1
,
-
1
},
{
0
,
-
2
,
0
,
-
3
,
2
,
0
,
1
,
-
1
},
{
0
,
-
2
,
0
,
-
3
,
3
,
0
,
1
,
-
1
},
/*isTransient=0 isTransient=1 */
{
0
,
-
1
,
0
,
-
1
,
0
,
-
1
,
0
,
-
1
},
/* 2.5 ms */
{
0
,
-
1
,
0
,
-
2
,
1
,
0
,
1
,
-
1
},
/* 5 ms */
{
0
,
-
2
,
0
,
-
3
,
2
,
0
,
1
,
-
1
},
/* 10 ms */
{
0
,
-
2
,
0
,
-
3
,
3
,
0
,
1
,
-
1
},
/* 20 ms */
};
...
...
celt/celt_encoder.c
View file @
2ca6df03
...
...
@@ -550,7 +550,7 @@ static opus_val32 l1_metric(const celt_norm *tmp, int N, int LM, opus_val16 bias
static
int
tf_analysis
(
const
CELTMode
*
m
,
int
len
,
int
isTransient
,
int
*
tf_res
,
int
lambda
,
celt_norm
*
X
,
int
N0
,
int
LM
,
int
*
tf_sum
,
opus_val16
tf_estimate
,
int
tf_chan
)
opus_val16
tf_estimate
,
int
tf_chan
)
{
int
i
;
VARDECL
(
int
,
metric
);
...
...
@@ -575,7 +575,6 @@ static int tf_analysis(const CELTMode *m, int len, int isTransient,
ALLOC
(
path0
,
len
,
int
);
ALLOC
(
path1
,
len
,
int
);
*
tf_sum
=
0
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
int
k
,
N
;
...
...
@@ -630,7 +629,6 @@ static int tf_analysis(const CELTMode *m, int len, int isTransient,
metric
[
i
]
=
2
*
best_level
;
else
metric
[
i
]
=
-
2
*
best_level
;
*
tf_sum
+=
(
isTransient
?
LM
:
0
)
-
metric
[
i
]
/
2
;
/* For bands that can't be split to -1, set the metric to the half-way point to avoid
biasing the decision */
if
(
narrow
&&
(
metric
[
i
]
==
0
||
metric
[
i
]
==-
2
*
LM
))
...
...
@@ -1334,7 +1332,6 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm,
int
end
;
int
effEnd
;
int
codedBands
;
int
tf_sum
;
int
alloc_trim
;
int
pitch_index
=
COMBFILTER_MINPERIOD
;
opus_val16
gain1
=
0
;
...
...
@@ -1769,18 +1766,16 @@ int celt_encode_with_ec(CELTEncoder * OPUS_RESTRICT st, const opus_val16 * pcm,
else
lambda
=
3
;
lambda
*=
2
;
tf_select
=
tf_analysis
(
mode
,
effEnd
,
isTransient
,
tf_res
,
lambda
,
X
,
N
,
LM
,
&
tf_sum
,
tf_estimate
,
tf_chan
);
tf_select
=
tf_analysis
(
mode
,
effEnd
,
isTransient
,
tf_res
,
lambda
,
X
,
N
,
LM
,
tf_estimate
,
tf_chan
);
for
(
i
=
effEnd
;
i
<
end
;
i
++
)
tf_res
[
i
]
=
tf_res
[
effEnd
-
1
];
}
else
if
(
hybrid
&&
effectiveBytes
<
15
)
{
/* For low bitrate hybrid, we force temporal resolution to 5 ms rather than 2.5 ms. */
tf_sum
=
0
;
for
(
i
=
0
;
i
<
end
;
i
++
)
tf_res
[
i
]
=
0
;
tf_select
=
isTransient
;
}
else
{
tf_sum
=
0
;
for
(
i
=
0
;
i
<
end
;
i
++
)
tf_res
[
i
]
=
isTransient
;
tf_select
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment