ref: 60c316b4197609b75b85e5ae7225972e1df6f431
parent: fa1ca19934fe02078a4053d725b8343473f5a730
author: Gregory Maxwell <[email protected]>
date: Thu Nov 4 16:14:19 EDT 2010
Eliminate some promotions to double. A fair number of implicit promotions remain but they all involve math functions which exist only as double precision form in C89.
--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -212,7 +212,7 @@
mem1 = x - SHR32(y,1);
#else
mem0 = mem1 + y - 2*x;
- mem1 = x - .5*y;
+ mem1 = x - .5f*y;
#endif
tmp[i] = EXTRACT16(SHR(y,2));
}
@@ -617,13 +617,13 @@
}
sum = MULT16_16_Q15(QCONST16(1.f/8, 15), sum);
/*printf ("%f\n", sum);*/
- if (sum > QCONST16(.995,10))
+ if (sum > QCONST16(.995f,10))
trim_index-=3;
- else if (sum > QCONST16(.92,10))
+ else if (sum > QCONST16(.92f,10))
trim_index-=2;
- else if (sum > QCONST16(.8,10))
+ else if (sum > QCONST16(.8f,10))
trim_index-=1;
- else if (sum < QCONST16(.4,10))
+ else if (sum < QCONST16(.4f,10))
trim_index+=1;
}
#if 0
--- a/libcelt/plc.c
+++ b/libcelt/plc.c
@@ -83,7 +83,7 @@
if (error<SHR32(ac[0],10))
break;
#else
- if (error<.001*ac[0])
+ if (error<.001f*ac[0])
break;
#endif
}