diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2014-01-30 20:27:37 +0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2014-01-30 20:27:37 +0400 |
commit | ad7b28ff19f2074ddd171ddea07222db1414a5f0 (patch) | |
tree | b4510b2ee638f415d7de877d681c3c19947a8e60 /celt | |
parent | d9fb8a6651ea66f18f034fc70a51cfed17d3e12f (diff) |
Minor div optimization -- reducing denominators
Diffstat (limited to 'celt')
-rw-r--r-- | celt/bands.c | 2 | ||||
-rw-r--r-- | celt/rate.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/celt/bands.c b/celt/bands.c index 0acb25c4..30a5894e 100644 --- a/celt/bands.c +++ b/celt/bands.c @@ -282,7 +282,7 @@ void anti_collapse(const CELTMode *m, celt_norm *X_, unsigned char *collapse_mas N0 = m->eBands[i+1]-m->eBands[i]; /* depth in 1/8 bits */ celt_assert(pulses[i]>=0); - depth = celt_udiv(1+pulses[i], (m->eBands[i+1]-m->eBands[i])<<LM); + depth = celt_udiv(1+pulses[i], (m->eBands[i+1]-m->eBands[i]))>>LM; #ifdef FIXED_POINT thresh32 = SHR32(celt_exp2(-SHL16(depth, 10-BITRES)),1); diff --git a/celt/rate.c b/celt/rate.c index f2e49a53..f85c3ee6 100644 --- a/celt/rate.c +++ b/celt/rate.c @@ -466,7 +466,7 @@ static OPUS_INLINE int interp_bits2pulses(const CELTMode *m, int start, int end, /* Divide with rounding */ ebits[j] = IMAX(0, (bits[j] + offset + (den<<(BITRES-1)))); - ebits[j] = celt_udiv(ebits[j], den<<BITRES); + ebits[j] = celt_udiv(ebits[j], den)>>BITRES; /* Make sure not to bust */ if (C*ebits[j] > (bits[j]>>BITRES)) |