[Freeswitch-svn] [commit] r7883 - freeswitch/trunk/src/mod/formats/mod_shout
Freeswitch SVN
anthm at freeswitch.org
Wed Mar 12 12:06:02 EDT 2008
Author: anthm
Date: Wed Mar 12 12:06:02 2008
New Revision: 7883
Modified:
freeswitch/trunk/src/mod/formats/mod_shout/Makefile
freeswitch/trunk/src/mod/formats/mod_shout/layer3.c
Log:
sigh
Modified: freeswitch/trunk/src/mod/formats/mod_shout/Makefile
==============================================================================
--- freeswitch/trunk/src/mod/formats/mod_shout/Makefile (original)
+++ freeswitch/trunk/src/mod/formats/mod_shout/Makefile Wed Mar 12 12:06:02 2008
@@ -40,7 +40,7 @@
$(GETLIB) $(SHOUT).tar.gz
$(SHOUT_DIR)/Makefile: $(SHOUT_DIR)
- cd $(SHOUT_DIR) && ./configure $(DEFAULT_ARGS) --with-speex=no
+ cd $(SHOUT_DIR) && ./configure $(DEFAULT_ARGS) --with-speex=no --without-vorbis
$(TOUCH_TARGET)
$(SHOUTLA): $(SHOUT_DIR)/Makefile
Modified: freeswitch/trunk/src/mod/formats/mod_shout/layer3.c
==============================================================================
--- freeswitch/trunk/src/mod/formats/mod_shout/layer3.c (original)
+++ freeswitch/trunk/src/mod/formats/mod_shout/layer3.c Wed Mar 12 12:06:02 2008
@@ -14,7 +14,7 @@
#define MPEG1
/* These should all be constants setup once using init_layer3_const */
-static real ispow[8207];
+static real __ispow[8207];
static real aa_ca[8], aa_cs[8];
static real COS1[12][6];
static real win[4][36];
@@ -33,6 +33,14 @@
};
+static inline real find_pow(int i)
+{
+
+ return (i > 0 && i < 8207) ? __ispow[i] : 1;
+
+}
+
+
struct bandInfoStruct bandInfo[9] = {
/* MPEG 1.0 */
@@ -104,7 +112,7 @@
gainpow2[i + 256] = pow((double) 2.0, -0.25 * (double) (i + 210));
for (i = 0; i < 8207; i++)
- ispow[i] = pow((double) i, (double) 4.0 / 3.0);
+ __ispow[i] = pow((double) i, (double) 4.0 / 3.0);
for (i = 0; i < 8; i++) {
static double Ci[8] = { -0.6, -0.535, -0.33, -0.185, -0.095, -0.041, -0.0142, -0.0037 };
@@ -681,20 +689,21 @@
x = y >> 4;
y &= 0xf;
}
+
if (x == 15) {
max[lwin] = cb;
part2remain -= h->linbits + 1;
x += getbits(mp, h->linbits);
if (get1bit(mp))
- *xrpnt = -ispow[x] * v;
+ *xrpnt = find_pow(x) * -1 * v;
else
- *xrpnt = ispow[x] * v;
+ *xrpnt = find_pow(x) * v;
} else if (x) {
max[lwin] = cb;
if (get1bit(mp))
- *xrpnt = -ispow[x] * v;
+ *xrpnt = find_pow(x) * -1 * v;
else
- *xrpnt = ispow[x] * v;
+ *xrpnt = find_pow(x) * v;
part2remain--;
} else
*xrpnt = 0.0;
@@ -704,15 +713,15 @@
part2remain -= h->linbits + 1;
y += getbits(mp, h->linbits);
if (get1bit(mp))
- *xrpnt = -ispow[y] * v;
+ *xrpnt = find_pow(y) * -1 * v;
else
- *xrpnt = ispow[y] * v;
+ *xrpnt = find_pow(y) * v;
} else if (y) {
max[lwin] = cb;
if (get1bit(mp))
- *xrpnt = -ispow[y] * v;
+ *xrpnt = find_pow(y) * -1 * v;
else
- *xrpnt = ispow[y] * v;
+ *xrpnt = find_pow(y) * v;
part2remain--;
} else
*xrpnt = 0.0;
@@ -859,15 +868,15 @@
part2remain -= h->linbits + 1;
x += getbits(mp, h->linbits);
if (get1bit(mp))
- *xrpnt++ = -ispow[x] * v;
+ *xrpnt++ = find_pow(x) * -1 * v;
else
- *xrpnt++ = ispow[x] * v;
+ *xrpnt++ = find_pow(x) * v;
} else if (x) {
max = cb;
if (get1bit(mp))
- *xrpnt++ = -ispow[x] * v;
+ *xrpnt++ = find_pow(x) * -1 * v;
else
- *xrpnt++ = ispow[x] * v;
+ *xrpnt++ = find_pow(x) * v;
part2remain--;
} else
*xrpnt++ = 0.0;
@@ -877,15 +886,15 @@
part2remain -= h->linbits + 1;
y += getbits(mp, h->linbits);
if (get1bit(mp))
- *xrpnt++ = -ispow[y] * v;
+ *xrpnt++ = find_pow(y) * -1 * v;
else
- *xrpnt++ = ispow[y] * v;
+ *xrpnt++ = find_pow(y) * v;
} else if (y) {
max = cb;
if (get1bit(mp))
- *xrpnt++ = -ispow[y] * v;
+ *xrpnt++ = find_pow(y) * -1 * v;
else
- *xrpnt++ = ispow[y] * v;
+ *xrpnt++ = find_pow(y) * v;
part2remain--;
} else
*xrpnt++ = 0.0;
@@ -1049,22 +1058,22 @@
part2remain -= h->linbits + 1;
x += getbits(mp, h->linbits);
if (get1bit(mp)) {
- real a = ispow[x] * v;
+ real a = find_pow(x) * v;
*xrpnt = *xr0pnt + a;
*xr0pnt -= a;
} else {
- real a = ispow[x] * v;
+ real a = find_pow(x) * v;
*xrpnt = *xr0pnt - a;
*xr0pnt += a;
}
} else if (x) {
max[lwin] = cb;
if (get1bit(mp)) {
- real a = ispow[x] * v;
+ real a = find_pow(x) * v;
*xrpnt = *xr0pnt + a;
*xr0pnt -= a;
} else {
- real a = ispow[x] * v;
+ real a = find_pow(x) * v;
*xrpnt = *xr0pnt - a;
*xr0pnt += a;
}
@@ -1079,22 +1088,22 @@
part2remain -= h->linbits + 1;
y += getbits(mp, h->linbits);
if (get1bit(mp)) {
- real a = ispow[y] * v;
+ real a = find_pow(y) * v;
*xrpnt = *xr0pnt + a;
*xr0pnt -= a;
} else {
- real a = ispow[y] * v;
+ real a = find_pow(y) * v;
*xrpnt = *xr0pnt - a;
*xr0pnt += a;
}
} else if (y) {
max[lwin] = cb;
if (get1bit(mp)) {
- real a = ispow[y] * v;
+ real a = find_pow(y) * v;
*xrpnt = *xr0pnt + a;
*xr0pnt -= a;
} else {
- real a = ispow[y] * v;
+ real a = find_pow(y) * v;
*xrpnt = *xr0pnt - a;
*xr0pnt += a;
}
@@ -1231,22 +1240,22 @@
part2remain -= h->linbits + 1;
x += getbits(mp, h->linbits);
if (get1bit(mp)) {
- real a = ispow[x] * v;
+ real a = find_pow(x) * v;
*xrpnt++ = *xr0pnt + a;
*xr0pnt++ -= a;
} else {
- real a = ispow[x] * v;
+ real a = find_pow(x) * v;
*xrpnt++ = *xr0pnt - a;
*xr0pnt++ += a;
}
} else if (x) {
max = cb;
if (get1bit(mp)) {
- real a = ispow[x] * v;
+ real a = find_pow(x) * v;
*xrpnt++ = *xr0pnt + a;
*xr0pnt++ -= a;
} else {
- real a = ispow[x] * v;
+ real a = find_pow(x) * v;
*xrpnt++ = *xr0pnt - a;
*xr0pnt++ += a;
}
@@ -1259,22 +1268,22 @@
part2remain -= h->linbits + 1;
y += getbits(mp, h->linbits);
if (get1bit(mp)) {
- real a = ispow[y] * v;
+ real a = find_pow(y) * v;
*xrpnt++ = *xr0pnt + a;
*xr0pnt++ -= a;
} else {
- real a = ispow[y] * v;
+ real a = find_pow(y) * v;
*xrpnt++ = *xr0pnt - a;
*xr0pnt++ += a;
}
} else if (y) {
max = cb;
if (get1bit(mp)) {
- real a = ispow[y] * v;
+ real a = find_pow(y) * v;
*xrpnt++ = *xr0pnt + a;
*xr0pnt++ -= a;
} else {
- real a = ispow[y] * v;
+ real a = find_pow(y) * v;
*xrpnt++ = *xr0pnt - a;
*xr0pnt++ += a;
}
More information about the Freeswitch-svn
mailing list