diff --git a/libcelt/bands.c b/libcelt/bands.c index 165ab2a9..6b44bb31 100644 --- a/libcelt/bands.c +++ b/libcelt/bands.c @@ -126,7 +126,7 @@ void normalise_bands(const CELTMode *m, const celt_sig_t *freq, celt_norm_t *X, shift = celt_zlog2(bank[i*C+c])-13; E = VSHR32(bank[i*C+c], shift); if (E>0) - g = DIV32_16(QCONST32(1.f,28),MULT16_16_Q14(E,sqrtC_1[C-1])); + g = EXTRACT16(celt_div(QCONST32(1.f,28),MULT16_16_Q14(E,sqrtC_1[C-1]))); else g = 0; for (j=B*eBands[i];j>8; @@ -149,7 +149,7 @@ static void quant_energy_mono(const CELTMode *m, celt_ener_t *eBands, celt_word1 if (q2 > frac[i]-1) q2 = frac[i]-1; ec_enc_uint(enc, q2, frac[i]); - offset = DIV32_16(SHL16(q2,8)+QCONST16(.5,8),frac[i])-QCONST16(.5f,8); + offset = EXTRACT16(celt_div(SHL16(q2,8)+QCONST16(.5,8),frac[i])-QCONST16(.5f,8)); oldEBands[i] += PSHR32(MULT16_16(DB_SCALING*6,offset),8); /*printf ("%f ", error[i] - offset);*/ } @@ -199,7 +199,7 @@ static void unquant_energy_mono(const CELTMode *m, celt_ener_t *eBands, celt_wor if (ec_dec_tell(dec, 0) - bits +EC_ILOG(frac[i])> budget) break; q2 = ec_dec_uint(dec, frac[i]); - offset = DIV32_16(SHL16(q2,8)+QCONST16(.5,8),frac[i])-QCONST16(.5f,8); + offset = EXTRACT16(celt_div(SHL16(q2,8)+QCONST16(.5,8),frac[i])-QCONST16(.5f,8)); oldEBands[i] += PSHR32(MULT16_16(DB_SCALING*6,offset),8); } for (i=0;inbEBands;i++) diff --git a/libcelt/vq.c b/libcelt/vq.c index 3da9d33c..e9a53bad 100644 --- a/libcelt/vq.c +++ b/libcelt/vq.c @@ -378,7 +378,7 @@ void intra_prediction(celt_norm_t *x, celt_mask_t *W, int N, int K, celt_norm_t xy = MAC16_16(xy, x[j], Y[i+N-j-1]); yy = MAC16_16(yy, Y[i+N-j-1], Y[i+N-j-1]); } - score = DIV32(MULT16_16(ROUND16(xy,14),ROUND16(xy,14)), ROUND16(yy,14)); + score = celt_div(MULT16_16(ROUND16(xy,14),ROUND16(xy,14)), ROUND16(yy,14)); if (score > best_score) { best_score = score;