summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2018-01-18 17:20:56 -0500
committerJean-Marc Valin <jmvalin@jmvalin.ca>2018-01-18 17:20:56 -0500
commit3218bae7904f1bb6155eb62d40896e1f607d82f8 (patch)
tree4d4b8fe569b41d471ec49a5d856acedc29d35af4
parentf3cca9455827a1776f22f95a0213595a0555ee22 (diff)
downloadopus-3218bae7904f1bb6155eb62d40896e1f607d82f8.tar.gz
cleanup
-rw-r--r--celt/celt_encoder.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/celt/celt_encoder.c b/celt/celt_encoder.c
index 74f1396b..cf538365 100644
--- a/celt/celt_encoder.c
+++ b/celt/celt_encoder.c
@@ -640,9 +640,27 @@ static int tf_analysis(const CELTMode *m, const opus_val16 *band_transient, int
ALLOC(path0, len, int);
ALLOC(path1, len, int);
+ if (1)
+ {
+ for (i=0;i<len;i++)
+ {
+ int offset = 10 -0*(i-10);
+ if (band_transient[i] > 270 + offset)
+ metric[i] = -2;
+ else if (band_transient[i] > 140 + offset)
+ metric[i] = 0;
+ else if (band_transient[i] > 110 + offset)
+ metric[i] = 2;
+ else if (band_transient[i] > 90 + offset)
+ metric[i] = 4;
+ else
+ metric[i] = 6;
+ if (!isTransient) metric[i] -= 2*LM;
+ /*printf("%f ", band_transient[i]);*/
+ }
+ } else {
for (i=0;i<len;i++)
{
-#if 1
int k, N;
int narrow;
opus_val32 L1, best_L1;
@@ -699,25 +717,10 @@ static int tf_analysis(const CELTMode *m, const opus_val16 *band_transient, int
biasing the decision */
if (narrow && (metric[i]==0 || metric[i]==-2*LM))
metric[i]-=1;
-#endif
-#if 1
- int offset = 10 -0*(i-10);
- if (band_transient[i] > 270 + offset)
- metric[i] = -2;
- else if (band_transient[i] > 140 + offset)
- metric[i] = 0;
- else if (band_transient[i] > 110 + offset)
- metric[i] = 2;
- else if (band_transient[i] > 90 + offset)
- metric[i] = 4;
- else
- metric[i] = 6;
- if (!isTransient) metric[i] -= 2*LM;
-#endif
- //printf("%d ", metric[i]/2 + (!isTransient)*LM);
- //printf("%f ", band_transient[i]);
+ /*printf("%d ", metric[i]/2 + (!isTransient)*LM);*/
+ }
}
- //printf("\n");
+ /*printf("\n");*/
/* Search for the optimal tf resolution, including tf_select */
tf_select = 0;
for (sel=0;sel<2;sel++)