From ae01e119cbbd9b8c4897dd842933b327a9d7eb20 Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Tue, 3 Aug 2010 21:43:41 -0400 Subject: [PATCH] Changing some constants to float --- libcelt/celt.c | 18 +++++++++--------- libcelt/pitch.c | 2 -- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/libcelt/celt.c b/libcelt/celt.c index 824b2aa9..1118fe97 100644 --- a/libcelt/celt.c +++ b/libcelt/celt.c @@ -59,10 +59,10 @@ static const celt_word16 transientWindow[16] = { 17896, 20868, 23687, 26258, 28492, 30314, 31662, 32489}; #else static const float transientWindow[16] = { - 0.0085135, 0.0337639, 0.0748914, 0.1304955, - 0.1986827, 0.2771308, 0.3631685, 0.4538658, - 0.5461342, 0.6368315, 0.7228692, 0.8013173, - 0.8695045, 0.9251086, 0.9662361, 0.9914865}; + 0.0085135f, 0.0337639f, 0.0748914f, 0.1304955f, + 0.1986827f, 0.2771308f, 0.3631685f, 0.4538658f, + 0.5461342f, 0.6368315f, 0.7228692f, 0.8013173f, + 0.8695045f, 0.9251086f, 0.9662361f, 0.9914865f}; #endif #define ENCODERVALID 0x4c434554 @@ -973,7 +973,7 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const celt_sig * pcm, c #ifdef FIXED_POINT max_decay = MIN32(QCONST16(16,DB_SHIFT), SHL32(EXTEND32(nbAvailableBytes),DB_SHIFT-3)); #else - max_decay = .125*nbAvailableBytes; + max_decay = MIN32(16.f, .125f*nbAvailableBytes); #endif quant_coarse_energy(st->mode, st->start, st->end, bandLogE, st->oldBandE, nbCompressedBytes*8, intra_ener, st->mode->prob, error, enc, C, LM, max_decay); /* Variable bitrate */ @@ -1150,7 +1150,7 @@ int celt_encode_with_ec_float(CELTEncoder * restrict st, const float * pcm, floa if (optional_resynthesis != NULL) { ret=celt_encode_with_ec(st,in,in,frame_size,compressed,nbCompressedBytes, enc); for (j=0;j0) { celt_word16 num; celt_word32 xcorr16; xcorr16 = EXTRACT16(VSHR32(xcorr[i], xshift)); num = MULT16_16_Q15(xcorr16,xcorr16); - score = num*1./Syy; if (MULT16_32_Q15(num,best_den[1]) > MULT16_32_Q15(best_num[1],Syy)) { if (MULT16_32_Q15(num,best_den[0]) > MULT16_32_Q15(best_num[0],Syy))