From 2ca6df03df62154c9b76220a94108b56e4dfb34b Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Wed, 8 Jun 2016 02:15:21 -0400 Subject: [PATCH] Minor TF cleanup (tf_sum was useless), plus comments --- celt/celt.c | 13 +++++++++---- celt/celt_encoder.c | 9 ++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/celt/celt.c b/celt/celt.c index b121c51a..2425ba3e 100644 --- a/celt/celt.c +++ b/celt/celt.c @@ -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 */ }; diff --git a/celt/celt_encoder.c b/celt/celt_encoder.c index 9486bd16..edb08e80 100644 --- a/celt/celt_encoder.c +++ b/celt/celt_encoder.c @@ -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