From 0ef39c9cc4c615c4fbb04a2b1946476da5fcde85 Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Fri, 28 May 2010 17:50:34 -0400 Subject: [PATCH] Simplifications to the tf_res RD code --- libcelt/celt.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/libcelt/celt.c b/libcelt/celt.c index 28f41a8a..c6188372 100644 --- a/libcelt/celt.c +++ b/libcelt/celt.c @@ -544,7 +544,7 @@ static void mdct_shape(const CELTMode *mode, celt_norm *X, int start, static void tf_encode(celt_word16 *bandLogE, celt_word16 *oldBandE, int len, int C, int isTransient, int *tf_res, ec_enc *enc) { int i, curr; - celt_word16 thresh1, thresh2; + celt_word16 threshold; VARDECL(celt_word16, metric); VARDECL(celt_word16, cost0); VARDECL(celt_word16, cost1); @@ -567,11 +567,9 @@ static void tf_encode(celt_word16 *bandLogE, celt_word16 *oldBandE, int len, int if (isTransient) { - thresh1 = QCONST16(1.5f,DB_SHIFT); - thresh2 = QCONST16(.5f,DB_SHIFT); + threshold = QCONST16(1.f,DB_SHIFT); } else { - thresh1 = QCONST16(1.5f,DB_SHIFT); - thresh2 = QCONST16(.8f,DB_SHIFT); + threshold = QCONST16(.5f,DB_SHIFT); } cost0[0] = 0; cost1[0] = lambda; @@ -579,11 +577,8 @@ static void tf_encode(celt_word16 *bandLogE, celt_word16 *oldBandE, int len, int for (i=1;ithresh1) - cost0[i] = 1; - else if (metric[i]