Optimizations, mostly minor things; just picking the lowest-hanging fruit.
authorMonty <xiphmont@xiph.org>
Mon, 19 Jun 2000 10:05:57 +0000 (10:05 +0000)
committerMonty <xiphmont@xiph.org>
Mon, 19 Jun 2000 10:05:57 +0000 (10:05 +0000)
Monty

svn path=/trunk/vorbis/; revision=459

configure
configure.in
examples/Makefile.in
examples/vorbisfile_example.c [new file with mode: 0644]
include/vorbis/modes.h
lib/floor0.c
lib/psy.c
vorbis.spec

index 7a3937f..106fe63 100755 (executable)
--- a/configure
+++ b/configure
@@ -911,6 +911,35 @@ else
   echo "$ac_t""no" 1>&6
 fi
 
+# Extract the first word of "install", so it can be a program name with args.
+set dummy install; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:918: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_INSTALL'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$INSTALL"; then
+  ac_cv_prog_INSTALL="$INSTALL" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_INSTALL="install"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+INSTALL="$ac_cv_prog_INSTALL"
+if test -n "$INSTALL"; then
+  echo "$ac_t""$INSTALL" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
 
 if test -z "$GCC"; then
        case $host in 
@@ -935,8 +964,8 @@ else
        case $host in 
        *-*-linux*)
                DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
-               OPT="-O20 -ffast-math -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
-               PROFILE="-pg -g -O20 -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char";;
+               OPT="-O20 -ffast-math -D_REENTRANT -fsigned-char"
+               PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char";;
        sparc-sun-*)
                DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char -mv8"
                OPT="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8"
@@ -949,7 +978,7 @@ else
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:953: checking how to run the C preprocessor" >&5
+echo "configure:982: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -964,13 +993,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 968 "configure"
+#line 997 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:974: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1003: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -981,13 +1010,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 985 "configure"
+#line 1014 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:991: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1020: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -998,13 +1027,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 1002 "configure"
+#line 1031 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1008: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1037: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1029,12 +1058,12 @@ fi
 echo "$ac_t""$CPP" 1>&6
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1033: checking for ANSI C header files" >&5
+echo "configure:1062: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1038 "configure"
+#line 1067 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1042,7 +1071,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1046: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1075: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1059,7 +1088,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1063 "configure"
+#line 1092 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1077,7 +1106,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1081 "configure"
+#line 1110 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1098,7 +1127,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 1102 "configure"
+#line 1131 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1109,7 +1138,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:1113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1137,7 +1166,7 @@ CFLAGS=""
 
 
 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:1141: checking for pthread_create in -lpthread" >&5
+echo "configure:1170: checking for pthread_create in -lpthread" >&5
 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1145,7 +1174,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1149 "configure"
+#line 1178 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1156,7 +1185,7 @@ int main() {
 pthread_create()
 ; return 0; }
 EOF
-if { (eval echo configure:1160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1225,7 +1254,7 @@ dummy="__noconf"
 #fi
 
 echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:1229: checking size of short" >&5
+echo "configure:1258: checking size of short" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1233,7 +1262,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 1237 "configure"
+#line 1266 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1244,7 +1273,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:1248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_short=`cat conftestval`
 else
@@ -1264,7 +1293,7 @@ EOF
 
 
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:1268: checking size of int" >&5
+echo "configure:1297: checking size of int" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1272,7 +1301,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 1276 "configure"
+#line 1305 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1283,7 +1312,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:1287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_int=`cat conftestval`
 else
@@ -1303,7 +1332,7 @@ EOF
 
 
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:1307: checking size of long" >&5
+echo "configure:1336: checking size of long" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1311,7 +1340,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 1315 "configure"
+#line 1344 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1322,7 +1351,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:1326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_long=`cat conftestval`
 else
@@ -1342,7 +1371,7 @@ EOF
 
 
 echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:1346: checking size of long long" >&5
+echo "configure:1375: checking size of long long" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1350,7 +1379,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 1354 "configure"
+#line 1383 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1361,7 +1390,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:1365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_long_long=`cat conftestval`
 else
@@ -1399,12 +1428,12 @@ case 8 in
 esac
 
 echo $ac_n "checking for int16_t""... $ac_c" 1>&6
-echo "configure:1403: checking for int16_t" >&5
+echo "configure:1432: checking for int16_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_int16_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1408 "configure"
+#line 1437 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1432,12 +1461,12 @@ EOF
 fi
 
 echo $ac_n "checking for int32_t""... $ac_c" 1>&6
-echo "configure:1436: checking for int32_t" >&5
+echo "configure:1465: checking for int32_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_int32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1441 "configure"
+#line 1470 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1465,12 +1494,12 @@ EOF
 fi
 
 echo $ac_n "checking for int64_t""... $ac_c" 1>&6
-echo "configure:1469: checking for int64_t" >&5
+echo "configure:1498: checking for int64_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_int64_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1474 "configure"
+#line 1503 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1498,12 +1527,12 @@ EOF
 fi
 
 echo $ac_n "checking for u_int16_t""... $ac_c" 1>&6
-echo "configure:1502: checking for u_int16_t" >&5
+echo "configure:1531: checking for u_int16_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_u_int16_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1507 "configure"
+#line 1536 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1531,12 +1560,12 @@ EOF
 fi
 
 echo $ac_n "checking for u_int32_t""... $ac_c" 1>&6
-echo "configure:1535: checking for u_int32_t" >&5
+echo "configure:1564: checking for u_int32_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_u_int32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1540 "configure"
+#line 1569 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1564,12 +1593,12 @@ EOF
 fi
 
 echo $ac_n "checking for u_int64_t""... $ac_c" 1>&6
-echo "configure:1568: checking for u_int64_t" >&5
+echo "configure:1597: checking for u_int64_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_u_int64_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1573 "configure"
+#line 1602 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1608,12 +1637,12 @@ if test -z "$SIZE64"; then
 fi
        
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:1612: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:1641: checking for sys/wait.h that is POSIX.1 compatible" >&5
 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1617 "configure"
+#line 1646 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -1629,7 +1658,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:1633: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -1653,17 +1682,17 @@ for ac_hdr in fcntl.h limits.h sys/ioctl.h sys/time.h unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1657: checking for $ac_hdr" >&5
+echo "configure:1686: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1662 "configure"
+#line 1691 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1667: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1696: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1691,18 +1720,18 @@ done
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1695: checking for working const" >&5
+echo "configure:1724: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1700 "configure"
+#line 1729 "configure"
 #include "confdefs.h"
 
 int main() {
 
 /* Ultrix mips cc rejects this.  */
-typedef int charset[2]; const charset x;
+typedef int charset[2]; const charset x = {0,0};
 /* SunOS 4.1.1 cc rejects this.  */
 char const *const *ccp;
 char **p;
@@ -1745,7 +1774,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:1749: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1778: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -1766,12 +1795,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1770: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:1799: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1775 "configure"
+#line 1804 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -1780,7 +1809,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:1784: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1813: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -1801,12 +1830,12 @@ EOF
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:1805: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:1834: checking whether struct tm is in sys/time.h or time.h" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1810 "configure"
+#line 1839 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -1814,7 +1843,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:1818: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1847: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -1836,7 +1865,7 @@ fi
 
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1840: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1869: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1863,7 +1892,7 @@ else
 fi
 
 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:1867: checking for 8-bit clean memcmp" >&5
+echo "configure:1896: checking for 8-bit clean memcmp" >&5
 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1871,7 +1900,7 @@ else
   ac_cv_func_memcmp_clean=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 1875 "configure"
+#line 1904 "configure"
 #include "confdefs.h"
 
 main()
@@ -1881,7 +1910,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:1885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_memcmp_clean=yes
 else
@@ -1899,12 +1928,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1903: checking return type of signal handlers" >&5
+echo "configure:1932: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1908 "configure"
+#line 1937 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -1921,7 +1950,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:1925: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1954: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -1942,12 +1971,12 @@ EOF
 for ac_func in gettimeofday select strcspn strerror strspn sigaction
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1946: checking for $ac_func" >&5
+echo "configure:1975: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1951 "configure"
+#line 1980 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1970,7 +1999,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2158,6 +2187,7 @@ s%@host_os@%$host_os%g
 s%@CC@%$CC%g
 s%@RANLIB@%$RANLIB%g
 s%@AR@%$AR%g
+s%@INSTALL@%$INSTALL%g
 s%@CPP@%$CPP%g
 s%@SET_MAKE@%$SET_MAKE%g
 s%@LIBOBJS@%$LIBOBJS%g
index 00f9cb9..fd8232f 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: configure.in,v 1.12 2000/06/14 23:07:47 xiphmont Exp $
+# $Id: configure.in,v 1.13 2000/06/19 10:05:57 xiphmont Exp $
 
 AC_INIT(lib/mdct.c)
 #AC_CONFIG_HEADER(config.h)
@@ -24,6 +24,7 @@ if test -z "$CC"; then
 fi
 AC_PROG_RANLIB
 AC_CHECK_PROG(AR,ar,ar)
+AC_CHECK_PROG(INSTALL,install,install)
 
 dnl Set some target options
 if test -z "$GCC"; then
@@ -49,8 +50,8 @@ else
        case $host in 
        *-*-linux*)
                DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
-               OPT="-O20 -ffast-math -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
-               PROFILE="-pg -g -O20 -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char";;
+               OPT="-O20 -ffast-math -D_REENTRANT -fsigned-char"
+               PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char";;
        sparc-sun-*)
                DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char -mv8"
                OPT="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8"
index de522c2..1884a20 100644 (file)
@@ -1,6 +1,6 @@
 # vorbis makefile configured for use with gcc on any platform
 
-# $Id: Makefile.in,v 1.7 2000/05/08 20:49:42 xiphmont Exp $
+# $Id: Makefile.in,v 1.8 2000/06/19 10:05:57 xiphmont Exp $
 
 ###############################################################################
 #                                                                             #
@@ -31,9 +31,9 @@ HFILES =      ../include/vorbis/codec.h ../include/vorbis/vorbisfile.h \
                ../include/vorbis/internal.h ../include/vorbis/backends.h \
                ../include/vorbis/codebook.h
 OFILES =       encoder_example.o decoder_example.o chaining_example.o \
-               seeking_test.o
+               vorbisfile_example.o seeking_test.o
 BINFILES =      encoder_example decoder_example chaining_example \
-               seeking_test
+               vorbisfile_example seeking_test
 
 all:
        $(MAKE) target CFLAGS="$(OPT)"
@@ -60,6 +60,10 @@ chaining_example:    $(OFILES) ../lib/libvorbis.a ../lib/vorbisfile.a
        $(CC) $(CFLAGS) $(LDFLAGS) chaining_example.o \
                        ../lib/vorbisfile.a ../lib/libvorbis.a \
                        -o chaining_example $(LIBS)
+vorbisfile_example:    $(OFILES) ../lib/libvorbis.a ../lib/vorbisfile.a
+       $(CC) $(CFLAGS) $(LDFLAGS) vorbisfile_example.o \
+                       ../lib/vorbisfile.a ../lib/libvorbis.a \
+                       -o vorbisfile_example $(LIBS)
 
 seeking_test:  $(OFILES) ../lib/libvorbis.a ../lib/vorbisfile.a
        $(CC) $(CFLAGS) $(LDFLAGS) seeking_test.o \
diff --git a/examples/vorbisfile_example.c b/examples/vorbisfile_example.c
new file mode 100644 (file)
index 0000000..ff7d915
--- /dev/null
@@ -0,0 +1,91 @@
+/********************************************************************
+ *                                                                  *
+ * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE.  *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
+ * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE.    *
+ * PLEASE READ THESE TERMS DISTRIBUTING.                            *
+ *                                                                  *
+ * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-2000             *
+ * by Monty <monty@xiph.org> and The XIPHOPHORUS Company            *
+ * http://www.xiph.org/                                             *
+ *                                                                  *
+ ********************************************************************
+
+ function: simple example decoder using vorbisfile
+ last mod: $Id: vorbisfile_example.c,v 1.1 2000/06/19 10:05:57 xiphmont Exp $
+
+ ********************************************************************/
+
+/* Takes a vorbis bitstream from stdin and writes raw stereo PCM to
+   stdout using vorbisfile. Using vorbisfile is much simpler than
+   dealing with libvorbis. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "vorbis/codec.h"
+#include "vorbis/vorbisfile.h"
+
+#ifdef _WIN32 /* We need the following two to set stdin/stdout to binary */
+#include <io.h>
+#include <fcntl.h>
+#endif
+
+char pcmout[4096]; /* take 4k out of the data segment, not the stack */
+
+int main(int argc, char **argv){
+  OggVorbis_File vf;
+  int eof=0;
+  int current_section;
+
+#ifdef _WIN32 /* We need to set stdin/stdout to binary mode. Damn windows. */
+  /* Beware the evil ifdef. We avoid these where we can, but this one we 
+     cannot. Don't add any more, you'll probably go to hell if you do. */
+  _setmode( _fileno( stdin ), _O_BINARY );
+  _setmode( _fileno( stdout ), _O_BINARY );
+#endif
+
+  if(ov_open(stdin, &vf, NULL, 0) < 0) {
+      fprintf(stderr,"Input does not appear to be an Ogg bitstream.\n");
+      exit(1);
+  }
+
+  /* Throw the comments plus a few lines about the bitstream we're
+     decoding */
+  {
+    char **ptr=ov_comment(&vf,-1)->user_comments;
+    vorbis_info *vi=ov_info(&vf,-1);
+    while(*ptr){
+      fprintf(stderr,"%s\n",*ptr);
+      ++ptr;
+    }
+    fprintf(stderr,"\nBitstream is %d channel, %ldHz\n",vi->channels,vi->rate);
+    fprintf(stderr,"Encoded by: %s\n\n",ov_comment(&vf,-1)->vendor);
+  }
+  
+  while(!eof){
+    long ret=ov_read(&vf,pcmout,sizeof(pcmout),0,2,1,&current_section);
+    switch(ret){
+    case 0:
+      /* EOF */
+      eof=1;
+      break;
+    case -1:
+      /* error in the stream.  Not a problem, just reporting it in
+        case we (the app) cares.  In this case, we don't. */
+      break;
+    default:
+      /* we don't bother dealing with sample rate changes, etc, but
+        you'll have to*/
+      fwrite(pcmout,1,ret,stdout);
+      break;
+    }
+  }
+
+  /* cleanup */
+  ov_clear(&vf);
+    
+  fprintf(stderr,"Done.\n");
+  return(0);
+}
+
index 5597c3f..9d41c8d 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: predefined encoding modes
- last mod: $Id: modes.h,v 1.14 2000/06/19 06:34:10 xiphmont Exp $
+ last mod: $Id: modes.h,v 1.15 2000/06/19 10:05:57 xiphmont Exp $
 
  ********************************************************************/
 
index 0e1247f..83b0311 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: floor backend 0 implementation
- last mod: $Id: floor0.c,v 1.16 2000/06/15 09:18:34 xiphmont Exp $
+ last mod: $Id: floor0.c,v 1.17 2000/06/19 10:05:57 xiphmont Exp $
 
  ********************************************************************/
 
@@ -141,6 +141,7 @@ static vorbis_look_floor *look (vorbis_dsp_state *vd,vorbis_info_mode *mi,
     if(val>look->ln)val=look->ln; /* guard against the approximation */
     look->linearmap[j]=val;
   }
+
   return look;
 }
 
@@ -439,7 +440,7 @@ static int inverse(vorbis_block *vb,vorbis_look_floor *i,double *out){
       vorbis_lsp_to_lpc(out,out,look->m); 
       _lpc_to_curve(out,out,amp,look,"",0);
       
-      for(j=0;j<look->n;j++)out[j]= fromdB(out[j]-info->ampdB);
+      for(j=0;j<look->n;j++)out[j]=fromdB(out[j]-info->ampdB);
       return(1);
     }
   }
index f70fa31..1646d6a 100644 (file)
--- a/lib/psy.c
+++ b/lib/psy.c
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: psychoacoustics not including preecho
- last mod: $Id: psy.c,v 1.22 2000/06/18 12:33:47 xiphmont Exp $
+ last mod: $Id: psy.c,v 1.23 2000/06/19 10:05:57 xiphmont Exp $
 
  ********************************************************************/
 
@@ -346,62 +346,59 @@ static void compute_decay(vorbis_look_psy *p,double *f, double *decay, int n){
   }
 }
 
-static double _eights[EHMER_MAX+1]={
-  .2394004745,.2610680627,.2846967347,.3104639837,
-  .3385633673,.3692059617,.4026219471,.4390623367,
-  .4788008625,.5221360312,.5693933667,.6209278553,
-  .6771266124,.7384117901,.8052437489,.8781245150,
-  .9576015522,1.0442718740,1.1387865279,1.2418554865,
-  1.3542529803,1.4768233137,1.6104872070,1.7562487129,
-  1.9152027587,2.0885433709,2.2775726445,2.4837105245,
-  2.7085054716,2.9536460940,3.2209738324,3.5124967917,
-  3.8304048259,4.1770859876,4.5551444666,4.9674201522,
-  5.4170099651,5.9072911215,6.4419465017,7.0249923150,
-  7.6608082685,8.3541704668,9.1102872884,9.9348385106,
-  10.8340179740,11.8145801099,12.8838906772,14.0499820932,
-  15.3216137706,16.7083379167,18.2205712869,19.8696734335,
-  21.6680320357,23.6291559533,25.7677767018,28.0999591127,
-  30.6432220084};
-
-static void seed_curve(double *flr,
-                        double **curves,
-                        double amp,double specmax,
-                        int x,int n,double specatt){
+static long _eights[EHMER_MAX+1]={
+  981,1069,1166,1272,
+  1387,1512,1649,1798,
+  1961,2139,2332,2543,
+  2774,3025,3298,3597,
+  3922,4277,4664,5087,
+  5547,6049,6597,7194,
+  7845,8555,9329,10173,
+  11094,12098,13193,14387,
+  15689,17109,18658,20347,
+  22188,24196,26386,28774,
+  31379,34219,37316,40693,
+  44376,48393,52772,57549,
+  62757,68437,74631,81386,
+  88752,96785,105545,115097,
+  125515};
+
+static int seed_curve(double *flr,
+                      double **curves,
+                      double amp,double specmax,
+                      int x,int n,double specatt,
+                      int maxEH){
   int i;
-  int prevx=x*_eights[0]+.5;
-  int nextx;
 
   /* make this attenuation adjustable */
   int choice=(int)((todB(amp)-specmax+specatt)/10.-1.5);
   choice=max(choice,0);
   choice=min(choice,8);
 
-  for(i=0;i<EHMER_MAX;i++){
-    if(prevx<n){
-      double lin=curves[choice][i];
-      nextx=x*_eights[i+1]+.5;
-      nextx=(nextx<n?nextx:n);
-      if(lin){
-       lin*=amp;       
-       if(prevx<0){
-         if(nextx>=0){
-           flr[0]=max(flr[0],lin);
-         }
-       }else{
-         flr[prevx]=max(flr[prevx],lin);
-       }
-      }
-      prevx=nextx;
-    }
-  }
+  for(i=maxEH;i>=0;i--)
+    if(((x*_eights[i])>>12)<n)break;
+  maxEH=i;
+
+  for(;i>=0;i--)
+    if(curves[choice][i]>0.)break;
+  
+  for(;i>=0;i--){
+    double lin=curves[choice][i];
+    if(lin>0.){
+      double *fp=flr+((x*_eights[i])>>12);
+      lin*=amp;        
+      if(*fp<lin)*fp=lin;
+    }else break;
+  }    
+  return(maxEH);
 }
 
 static void seed_peak(double *flr,
                      double *att,
                      double amp,double specmax,
                      int x,int n,double specatt){
-  int prevx=x*_eights[16];
-  int nextx=x*_eights[17];
+  int prevx=(x*_eights[16])>>12;
+  int nextx=(x*_eights[17])>>12;
 
   /* make this attenuation adjustable */
   int choice=rint((todB(amp)-specmax+specatt)/20.)-1;
@@ -430,13 +427,14 @@ static void seed_generic(vorbis_look_psy *p,
                         double specmax){
   vorbis_info_psy *vi=p->vi;
   long n=p->n,i;
-  
+  int maxEH=EHMER_MAX-1;
+
   /* prime the working vector with peak values */
   /* Use the 125 Hz curve up to 125 Hz and 8kHz curve after 8kHz. */
   for(i=0;i<n;i++)
     if(f[i]>flr[i])
-      seed_curve(flr,curves[p->octave[i]],f[i],
-                specmax,i,n,vi->max_curve_dB);
+      maxEH=seed_curve(flr,curves[p->octave[i]],f[i],
+                      specmax,i,n,vi->max_curve_dB,maxEH);
 }
 
 static void seed_att(vorbis_look_psy *p,
@@ -518,8 +516,8 @@ static void quarter_octave_noise(long n,double *f,double *noise){
   for(i=0;i<n;i++){
     /* not exactly correct, (the center frequency should be centered
        on a *log* scale), but not worth quibbling */
-    long newhi=i*_eights[17]+noiseBIAS;
-    long newlo=i*_eights[15]-noiseBIAS;
+    long newhi=((i*_eights[17])>>12)+noiseBIAS;
+    long newlo=((i*_eights[15])>>12)-noiseBIAS;
     if(newhi>n)newhi=n;
 
     for(;lo<newlo;lo++)
index e217ad4..9c528e3 100644 (file)
@@ -64,7 +64,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files devel
 %defattr(-,root,root)
-%doc README docs/*.{gif,html}
+%doc README docs/*.{png,html}
 /usr/include/vorbis/*
 /usr/lib/*