[xiph-cvs] r6489 - trunk/speex/libspeex
jm at xiph.org
jm at xiph.org
Fri Apr 2 13:16:44 PST 2004
Author: jm
Date: 2004-04-02 16:16:43 -0500 (Fri, 02 Apr 2004)
New Revision: 6489
Modified:
trunk/speex/libspeex/lsp.c
trunk/speex/libspeex/vq.c
Log:
Changed some constants to single-precision
<p>Modified: trunk/speex/libspeex/lsp.c
===================================================================
--- trunk/speex/libspeex/lsp.c 2004-04-02 21:09:18 UTC (rev 6488)
+++ trunk/speex/libspeex/lsp.c 2004-04-02 21:16:43 UTC (rev 6489)
@@ -517,8 +517,8 @@
n2 = n1 + 1;
n3 = n2 + 1;
n4 = n3 + 1;
- xout1 = xin1 - 2*x_freq[i2] * *n1 + *n2;
- xout2 = xin2 - 2*x_freq[i2+1] * *n3 + *n4;
+ xout1 = xin1 - 2.f*x_freq[i2] * *n1 + *n2;
+ xout2 = xin2 - 2.f*x_freq[i2+1] * *n3 + *n4;
*n2 = *n1;
*n4 = *n3;
*n1 = xin1;
@@ -528,7 +528,7 @@
}
xout1 = xin1 + *(n4+1);
xout2 = xin2 - *(n4+2);
- ak[j] = (xout1 + xout2)*0.5;
+ ak[j] = (xout1 + xout2)*0.5f;
*(n4+1) = xin1;
*(n4+2) = xin2;
@@ -591,7 +591,7 @@
lsp[i]=lsp[i-1]+LSP_SCALING*margin;
if (lsp[i]>lsp[i+1]-LSP_SCALING*margin)
- lsp[i]= .5* (lsp[i] + lsp[i+1]-LSP_SCALING*margin);
+ lsp[i]= .5f* (lsp[i] + lsp[i+1]-LSP_SCALING*margin);
}
}
@@ -599,7 +599,7 @@
void lsp_interpolate(spx_lsp_t *old_lsp, spx_lsp_t *new_lsp, spx_lsp_t *interp_lsp, int len, int subframe, int nb_subframes)
{
int i;
- float tmp = (1.0 + subframe)/nb_subframes;
+ float tmp = (1.0f + subframe)/nb_subframes;
for (i=0;i<len;i++)
{
interp_lsp[i] = (1-tmp)*old_lsp[i] + tmp*new_lsp[i];
Modified: trunk/speex/libspeex/vq.c
===================================================================
--- trunk/speex/libspeex/vq.c 2004-04-02 21:09:18 UTC (rev 6488)
+++ trunk/speex/libspeex/vq.c 2004-04-02 21:16:43 UTC (rev 6489)
@@ -89,7 +89,7 @@
__m128 half;
used = 0;
dist = PUSH(stack, entries, float);
- half = _mm_set_ps1(.5);
+ half = _mm_set_ps1(.5f);
in = PUSH(stack, len, __m128);
for (i=0;i<len;i++)
in[i] = _mm_set_ps1(_in[i]);
@@ -132,7 +132,7 @@
#ifdef FIXED_POINT
dist=SUB32(SHR(E[i],1),dist);
#else
- dist=.5*E[i]-dist;
+ dist=.5f*E[i]-dist;
#endif
if (i<N || dist<best_dist[N-1])
{
@@ -162,7 +162,7 @@
__m128 half;
used = 0;
dist = PUSH(stack, entries, float);
- half = _mm_set_ps1(.5);
+ half = _mm_set_ps1(.5f);
in = PUSH(stack, len, __m128);
for (i=0;i<len;i++)
in[i] = _mm_set_ps1(_in[i]);
@@ -184,7 +184,7 @@
{
sign=1;
}
- dist[i] += .5*((float*)E)[i];
+ dist[i] += .5f*((float*)E)[i];
if (i<N || dist[i]<best_dist[N-1])
{
for (k=N-1; (k >= 1) && (k > used || dist[i] < best_dist[k-1]); k--)
@@ -224,7 +224,7 @@
#ifdef FIXED_POINT
dist = ADD32(dist,SHR(E[i],1));
#else
- dist = ADD32(dist,.5*E[i]);
+ dist = ADD32(dist,.5f*E[i]);
#endif
if (i<N || dist<best_dist[N-1])
{
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list