--- /dev/null
+aclocal.m4
+config.h.in
+Makefile.in
+Makefile
+config.status
+libtool
+config.cache
+config.log
+configure
+*.gz
+.libs
+.deps
+*.ogg
+++ /dev/null
-
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations
-below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-^L
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it
-becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-^L
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control
-compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-\f
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-^L
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-^L
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-^L
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-^L
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply, and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License
-may add an explicit geographical distribution limitation excluding those
-countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-^L
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-^L
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms
-of the ordinary General Public License).
-
- To apply these terms, attach the following notices to the library.
-It is safest to attach them to the start of each source file to most
-effectively convey the exclusion of warranty; and each file should
-have at least the "copyright" line and a pointer to where the full
-notice is found.
-
-
- <one line to give the library's name and a brief idea of what it
-does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-Also add information on how to contact you by electronic and paper
-mail.
-
-You should also get your employer (if you work as a programmer) or
-your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James
-Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
--- /dev/null
+## Process this file with automake to produce Makefile.in
+
+AUTOMAKE_OPTIONS = foreign dist-zip
+
+SUBDIRS = lib include doc examples
+
+EXTRA_DIST = README COPYING todo.txt libvorbis.spec
+
+debug:
+ $(MAKE) all CFLAGS="@DEBUG@"
+
+profile:
+ $(MAKE) all CFLAGS="@PROFILE@"
+++ /dev/null
-# vorbis makefile configured for use with gcc on any platform
-
-# $Id: Makefile.in,v 1.11 2000/08/24 01:10:02 kcarnold Exp $
-
-###############################################################################
-# #
-# To build a production vorbis (preferrably using gmake), just type 'make'. #
-# To build with debugging or profiling information, use 'make debug' or #
-# 'make profile' respectively. 'make clean' is a good idea between builds #
-# with different target names, or before a final build. #
-# #
-###############################################################################
-
-
-# DO NOT EDIT BELOW! ##########################################################
-# (unless, of course, you know what you are doing :) ##########################
-
-@SET_MAKE@
-
-SUBDIRS = lib examples # vorbis-tools cmdline xmms vq huff kmpg
-
-# configure changes items in these, so get distclean to remove them.
-DCLEAN_DIRS = vorbis-tools cmdline xmms vq huff kmpg
-
-all debug profile selftest target clean:
- echo $(MAKECMDGOALS)
- @for dir in $(SUBDIRS); do (cd $$dir && $(MAKE) $(MFLAGS) $(MAKECMDGOALS)) || exit 1; done
- -rm -f *~
-
-distclean:
- @for dir in $(SUBDIRS) $(DCLEAN_DIRS); do (cd $$dir && $(MAKE) $(MFLAGS) $(MAKECMDGOALS)) || exit 1; done
- -rm -f Makefile config.*
-
* *
* 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 GNU LESSER/LIBRARY 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 *
* *
********************************************************************
+NEW AND IMPORTANT:
+
+If you're used to the source distribution from the first two beta
+relaeases, things are now rearranged a bit. Specifically, the
+'vorbis' CVS module contains only the libvorbis and libvorbisfile
+libraries. Because Ogg bitstreams are to be used by other Ogg codecs,
+Ogg framing and streaming functionality is now in libogg (the 'ogg'
+CVS module). Vorbis utilities are in 'vorbis-tools' and various
+player plugins are in 'vorbis-plugins'. For now, you'll need to check
+out these other modules seperately.
+
+Secondly, the Ogg/Vorbis build systems now use automake. Instead of
+'./configure;make', the proper build sequence (in each module) is
+'./autogen.sh;make'.
+
WHAT'S HERE:
-This source distribution includes libvorbis, a full-featured example
+This source distribution includes libvorbis and an example
encoder/player to demonstrate use of libvorbis and documentation on
the Ogg Vorbis audio coding format.
the public domain OggSquish Vorbis audio encoding
format.
-./cmdline A full-featured command line encoder/decoder/player
- utility ('vorbis') that demonstrates programmatic use
- of libvorbis.
+./include Library API headers and codebooks
+
+./debian Rules/spec files for building Debian .deb packages
+
+./doc Vorbis specification documents
+
+./examples Example code illustrating programmatic use of libogg,
+ libvorbis, libvorbisfile and libvorbisenc
-./docs Vorbis specification documents
+./mac Codewarrior project files and build tweaks for MacOS.
+
+
+./vq Internal utilities for training/building new LSP/residue
+ and auxiliary codebooks.
WHAT IS VORBIS:
software entity may make full use of the format without royalty or
patent concerns.
-This package contains libvorbis, an LGPLed software implementation of
+This package contains:
+
+.) libvorbis, an LGPLed software implementation of
the Vorbis specification by the Xiphophorus company
-(http://www.xiph.org/), vorbisfile, an LGPLed convenience library
+(http://www.xiph.org/)
+
+.) libvorbisfile, an LGPLed convenience library
built on Vorbis designed to simplify common uses and a number of GPL
-example programs, utilities and player plugins.
+example programs
+
+.) libvorbisenc, an LGPL library that provides a simple, programmatic
+encoding setup interface
+
+.) example code making use of libogg, libvorbis, libvorbisfile and
+libvorbisenc
CONTACT:
A standard build should consist of nothing more than:
-./configure
+./autogen.sh
make
and as root if desired :
make install
-This will install the ogg vorbis commandline encoder/player ('ogg')
-into /usr/local/bin, the ogg player and libvorbis manpages into
-/usr/local/man/ and libvorbis.a into /usr/local/lib.
+This will install the vorbis libraries (static and shared) into
+/usr/local/lib, includes into /usr/local/include and API manpages
+(once we write some) into /usr/local/man.
-Monty <monty@xiph.org>, <xiphmont@mit.edu>
+Monty <monty@xiph.org>
-$Id: README,v 1.4 2000/05/12 21:42:04 xiphmont Exp $
+$Id: README,v 1.5 2000/10/12 03:12:36 xiphmont Exp $
--- /dev/null
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+# (basically ripped directly from enlightenment's autogen.sh)
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+cd "$srcdir"
+DIE=0
+
+(autoconf --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have autoconf installed to compile libvorbis."
+ echo "Download the appropriate package for your distribution,"
+ echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+ DIE=1
+}
+
+(automake --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have automake installed to compile libvorbis."
+ echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+}
+
+if test "$DIE" -eq 1; then
+ exit 1
+fi
+
+if test -z "$*"; then
+ echo "I am going to run ./configure with no arguments - if you wish "
+ echo "to pass any to it, please specify them on the $0 command line."
+fi
+
+echo "Generating configuration files for libvorbis, please wait...."
+
+echo " aclocal $ACLOCAL_FLAGS"
+aclocal $ACLOCAL_FLAGS
+echo " autoheader"
+autoheader
+echo " automake --add-missing"
+automake --add-missing
+echo " autoconf"
+autoconf
+
+$srcdir/configure "$@" && echo
ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
+ac_help="$ac_help
+ --enable-shared[=PKGS] build shared libraries [default=yes]"
+ac_help="$ac_help
+ --enable-static[=PKGS] build static libraries [default=yes]"
+ac_help="$ac_help
+ --enable-fast-install[=PKGS] optimize for fast installation [default=yes]"
+ac_help="$ac_help
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]"
+ac_help="$ac_help
+ --disable-libtool-lock avoid locking (might break parallel builds)"
+ac_help="$ac_help
+ --with-ogg=DIR Set where the Ogg library is located"
# Initialize some variables set by options.
# The variables have the same names as the options, with
fi
-#AC_CONFIG_HEADER(config.h)
-
-cp configure.guess config.guess
-cp configure.sub config.sub
-
ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
ac_config_sub=$ac_aux_dir/config.sub
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:568: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
+ for ac_dir in $PATH; do
+ # Account for people who put trailing slashes in PATH elements.
+ case "$ac_dir/" in
+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ if test -f $ac_dir/$ac_prog; then
+ if test $ac_prog = install &&
+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ else
+ ac_cv_path_install="$ac_dir/$ac_prog -c"
+ break 2
+ fi
+ fi
+ done
+ ;;
+ esac
+ done
+ IFS="$ac_save_IFS"
-# Make sure we can run config.sub.
-if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
-else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL="$ac_cv_path_install"
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
+echo "configure:621: checking whether build environment is sane" >&5
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftestfile`
+ fi
+ if test "$*" != "X $srcdir/configure conftestfile" \
+ && test "$*" != "X conftestfile $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { echo "configure: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" 1>&2; exit 1; }
+ fi
+
+ test "$2" = conftestfile
+ )
+then
+ # Ok.
+ :
+else
+ { echo "configure: error: newly created file is older than distributed files!
+Check your system clock" 1>&2; exit 1; }
+fi
+rm -f conftest*
+echo "$ac_t""yes" 1>&6
+if test "$program_transform_name" = s,x,x,; then
+ program_transform_name=
+else
+ # Double any \ or $. echo might interpret backslashes.
+ cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+ program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+ rm -f conftestsed
+fi
+test "$program_prefix" != NONE &&
+ program_transform_name="s,^,${program_prefix},; $program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
+
+# sed with no file args requires a program.
+test "$program_transform_name" = "" && program_transform_name="s,x,x,"
-echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:556: checking host system type" >&5
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:678: 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
+else
+ cat > conftestmake <<\EOF
+all:
+ @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ SET_MAKE=
+else
+ echo "$ac_t""no" 1>&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
-host_alias=$host
-case "$host_alias" in
-NONE)
- case $nonopt in
- NONE)
- if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
- else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
- fi ;;
- *) host_alias=$nonopt ;;
- esac ;;
-esac
-host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
-host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$host" 1>&6
+PACKAGE=libvorbis
+VERSION=1.0.0
-case $host in
- *-*-irix*)
- if test -z "$CC"; then
- CC=cc
- fi
- echo $ac_n "checking for ALwritesamps in -laudio""... $ac_c" 1>&6
-echo "configure:583: checking for ALwritesamps in -laudio" >&5
-ac_lib_var=`echo audio'_'ALwritesamps | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-laudio $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 591 "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
- builtin and then its argument prototype would still apply. */
-char ALwritesamps();
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
+fi
+cat >> confdefs.h <<EOF
+#define PACKAGE "$PACKAGE"
+EOF
-int main() {
-ALwritesamps()
-; return 0; }
+cat >> confdefs.h <<EOF
+#define VERSION "$VERSION"
EOF
-if { (eval echo configure:602: \"$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"
+
+
+
+missing_dir=`cd $ac_aux_dir && pwd`
+echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
+echo "configure:724: checking for working aclocal" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (aclocal --version) < /dev/null > /dev/null 2>&1; then
+ ACLOCAL=aclocal
+ echo "$ac_t""found" 1>&6
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
+ ACLOCAL="$missing_dir/missing aclocal"
+ echo "$ac_t""missing" 1>&6
fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
+echo "configure:737: checking for working autoconf" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (autoconf --version) < /dev/null > /dev/null 2>&1; then
+ AUTOCONF=autoconf
+ echo "$ac_t""found" 1>&6
+else
+ AUTOCONF="$missing_dir/missing autoconf"
+ echo "$ac_t""missing" 1>&6
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo audio | sed -e 's/[^a-zA-Z0-9_]/_/g' \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
- LIBS="-laudio $LIBS"
+echo $ac_n "checking for working automake""... $ac_c" 1>&6
+echo "configure:750: checking for working automake" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (automake --version) < /dev/null > /dev/null 2>&1; then
+ AUTOMAKE=automake
+ echo "$ac_t""found" 1>&6
+else
+ AUTOMAKE="$missing_dir/missing automake"
+ echo "$ac_t""missing" 1>&6
+fi
+echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
+echo "configure:763: checking for working autoheader" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (autoheader --version) < /dev/null > /dev/null 2>&1; then
+ AUTOHEADER=autoheader
+ echo "$ac_t""found" 1>&6
else
- echo "$ac_t""no" 1>&6
+ AUTOHEADER="$missing_dir/missing autoheader"
+ echo "$ac_t""missing" 1>&6
fi
- ;;
-# BeOS does not use -lm
-# *-*-beos)
-# LIBS=""
-# ;;
-# added better check below
+echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
+echo "configure:776: checking for working makeinfo" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf. Sigh.
+if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
+ MAKEINFO=makeinfo
+ echo "$ac_t""found" 1>&6
+else
+ MAKEINFO="$missing_dir/missing makeinfo"
+ echo "$ac_t""missing" 1>&6
+fi
+
+
+
+
+V_LIB_CURRENT=0
+V_LIB_REVISION=0
+V_LIB_AGE=0
+VF_LIB_CURRENT=0
+VF_LIB_REVISION=0
+VF_LIB_AGE=0
+
+
+
+
+
+
-esac
cflags_save="$CFLAGS"
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:642: checking for $ac_word" >&5
+echo "configure:809: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:672: checking for $ac_word" >&5
+echo "configure:839: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:723: checking for $ac_word" >&5
+echo "configure:890: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:755: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:922: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
cat > conftest.$ac_ext << EOF
-#line 766 "configure"
+#line 933 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:797: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:964: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:802: checking whether we are using GNU C" >&5
+echo "configure:969: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:811: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:978: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:830: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:997: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
else
ac_cv_prog_cc_g=no
fi
-rm -f conftest*
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+
+CFLAGS="$cflags_save"
+
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_shared=yes ;;
+no) enable_shared=no ;;
+*)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_shared=yes
+fi
+
+# Check whether --enable-static or --disable-static was given.
+if test "${enable_static+set}" = set; then
+ enableval="$enable_static"
+ p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_static=yes ;;
+no) enable_static=no ;;
+*)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_static=yes
+fi
+
+# Check whether --enable-fast-install or --disable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+ enableval="$enable_fast_install"
+ p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_fast_install=yes ;;
+no) enable_fast_install=no ;;
+*)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac
+else
+ enable_fast_install=yes
+fi
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:1106: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:1127: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+# Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1147: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # 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_RANLIB="ranlib"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+ withval="$with_gnu_ld"
+ test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$ac_cv_prog_gcc" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
+echo "configure:1186: checking for ld used by GCC" >&5
+ ac_prog=`($CC -print-prog-name=ld) 2>&5`
+ case "$ac_prog" in
+ # Accept absolute paths.
+ [\\/]* | [A-Za-z]:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the path of ld
+ ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
+echo "configure:1210: checking for GNU ld" >&5
+else
+ echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
+echo "configure:1213: checking for non-GNU ld" >&5
+fi
+if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ ac_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ test "$with_gnu_ld" != no && break
+ else
+ test "$with_gnu_ld" != yes && break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ ac_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$ac_cv_path_LD"
+if test -n "$LD"; then
+ echo "$ac_t""$LD" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
+echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
+echo "configure:1248: checking if the linker ($LD) is GNU ld" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+ ac_cv_prog_gnu_ld=yes
+else
+ ac_cv_prog_gnu_ld=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
+
+
+echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
+echo "configure:1264: checking for BSD-compatible nm" >&5
+if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ ac_cv_path_NM="$NM"
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+ for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -B"
+ break
+ elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -p"
+ break
+ else
+ ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+fi
+fi
+
+NM="$ac_cv_path_NM"
+echo "$ac_t""$NM" 1>&6
+
+echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+echo "configure:1300: checking whether ln -s works" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ rm -f conftestdata
+if ln -s X conftestdata 2>/dev/null
+then
+ rm -f conftestdata
+ ac_cv_prog_LN_S="ln -s"
+else
+ ac_cv_prog_LN_S=ln
+fi
+fi
+LN_S="$ac_cv_prog_LN_S"
+if test "$ac_cv_prog_LN_S" = "ln -s"; then
+ echo "$ac_t""yes" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+case "$target" in
+NONE) lt_target="$host" ;;
+*) lt_target="$target" ;;
+esac
+
+# Check for any special flags to pass to ltconfig.
+libtool_flags="--cache-file=$cache_file"
+test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+ enableval="$enable_libtool_lock"
+ :
+fi
+
+test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
+test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case "$lt_target" in
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line 1349 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:1350: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
+echo "configure:1371: checking whether the C compiler needs -belf" >&5
+if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1376 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:1383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ lt_cv_cc_needs_belf=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ lt_cv_cc_needs_belf=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+
+
+esac
+
+
+# Save cache, so that ltconfig can load it
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+
+# Actually configure libtool. ac_aux_dir is where install-sh is found.
+CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
+DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
+|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
+
+# Reload cache, that may have been modified by ltconfig
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+
+
+
+# Check whether --with-ogg or --without-ogg was given.
+if test "${with_ogg+set}" = set; then
+ withval="$with_ogg"
+ :
+fi
+
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:1501: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+
+if test -z "$GCC"; then
+ case $host in
+ *-*-irix*)
+ if test -z "$CC"; then
+ CC=cc
+ fi
+ DEBUG="-g -signed"
+ CFLAGS="-O2 -w -signed"
+ PROFILE="-p -g3 -O2 -signed" ;;
+ sparc-sun-solaris*)
+ DEBUG="-v -g"
+ CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
+ PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc" ;;
+ *)
+ DEBUG="-g"
+ CFLAGS="-O"
+ PROFILE="-g -p" ;;
+ esac
else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-# because AC_PROG_CC likes to set -g
-CFLAGS="$cflags_save"
+ case $host in
+ *86-*-linux*)
+ DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
+ CFLAGS="-O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char"
+# PROFILE="-Wall -W -pg -O20 -ffast-math -D_REENTRANT -fsigned-char -fno-inline -static"
+ PROFILE="-Wall -W -pg -O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char -fno-inline -static"
+
+ # glibc < 2.1.3 has a serious FP bug in the math inline header
+ # that will cripple Vorbis. Look to see if the magic FP stack
+ # clobber is missing in the mathinline header, thus indicating
+ # the buggy version
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:865: checking how to run the C preprocessor" >&5
+ echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:1555: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 880 "configure"
+#line 1570 "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:886: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1576: \"$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*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 897 "configure"
+#line 1587 "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:903: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1593: \"$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*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 914 "configure"
+#line 1604 "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:920: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1610: \"$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
:
fi
echo "$ac_t""$CPP" 1>&6
-# Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:947: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # 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_RANLIB="ranlib"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
-fi
-fi
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-# Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:977: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$AR"; then
- ac_cv_prog_AR="$AR" # 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_AR="ar"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-AR="$ac_cv_prog_AR"
-if test -n "$AR"; then
- echo "$ac_t""$AR" 1>&6
-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:1006: 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
-
-
-#not everyone uses libm (eg, BeOS)
-#AC_CHECK_LIB(m, cos, LIBS="-lm"; AC_DEFINE(HAVE_LIBM), LIBS="")
-# We no longer use config.h
-echo $ac_n "checking for cos in -lm""... $ac_c" 1>&6
-echo "configure:1037: checking for cos in -lm" >&5
-ac_lib_var=`echo m'_'cos | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1045 "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
- builtin and then its argument prototype would still apply. */
-char cos();
-
-int main() {
-cos()
-; return 0; }
-EOF
-if { (eval echo configure:1056: \"$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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- LIBS="-lm"
-else
- echo "$ac_t""no" 1>&6
-LIBS=""
-fi
-
-
-if test -z "$GCC"; then
- case $host in
- *-*-irix*)
- DEBUG="-g -signed"
- OPT="-O2 -w -signed"
- PROFILE="-p -g3 -O2 -signed" ;;
- sparc-sun-solaris*)
- DEBUG="-v -g"
- OPT="-xO4 -fast -w -fsimple -native -xcg92"
- PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc" ;;
- *)
- DEBUG="-g"
- OPT="-O"
- PROFILE="-g -p" ;;
- esac
-else
-
- case $host in
- *86-*-linux*)
- DEBUG="-g -Wall -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"
-
- # glibc < 2.1.3 has a serious FP bug in the math inline header
- # that will cripple Vorbis. Look to see if the magic FP stack
- # clobber is missing in the mathinline header, thus indicating
- # the buggy version
-
- cat > conftest.$ac_ext <<EOF
-#line 1107 "configure"
+#line 1635 "configure"
#include "confdefs.h"
#define __LIBC_INTERNAL_MATH_INLINES 1
if test ${bad} = "maybe" ;then
cat > conftest.$ac_ext <<EOF
-#line 1127 "configure"
+#line 1655 "configure"
#include "confdefs.h"
#define __LIBC_INTERNAL_MATH_INLINES 1
echo "configure: warning: ********************************************************" 1>&2
echo "configure: warning: " 1>&2
- OPT=${OPT}" -D__NO_MATH_INLINES"
+ CFLAGS=${OPT}" -D__NO_MATH_INLINES"
PROFILE=${PROFILE}" -D__NO_MATH_INLINES"
fi;;
*-*-linux*)
DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
- OPT="-O20 -ffast-math -D_REENTRANT -fsigned-char"
+ CFLAGS="-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"
+ CFLAGS="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8"
PROFILE="-pg -g -O20 -D__NO_MATH_INLINES -fsigned-char -mv8" ;;
*)
DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char"
- OPT="-O20 -D__NO_MATH_INLINES -fsigned-char"
+ CFLAGS="-O20 -D__NO_MATH_INLINES -fsigned-char"
PROFILE="-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char" ;;
esac
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1183: checking for ANSI C header files" >&5
+echo "configure:1711: 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 1188 "configure"
+#line 1716 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1196: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1724: \"$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*
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 1213 "configure"
+#line 1741 "configure"
#include "confdefs.h"
#include <string.h>
EOF
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 1231 "configure"
+#line 1759 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
:
else
cat > conftest.$ac_ext <<EOF
-#line 1252 "configure"
+#line 1780 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
exit (0); }
EOF
-if { (eval echo configure:1263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
# pthread_lib="-lpthread"; AC_DEFINE(HAVE_LIBPTHREAD), :)
# We no longer use config.h
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:1292: checking for pthread_create in -lpthread" >&5
+echo "configure:1820: 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
ac_save_LIBS="$LIBS"
LIBS="-lpthread $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1300 "configure"
+#line 1828 "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
pthread_create()
; return 0; }
EOF
-if { (eval echo configure:1311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1839: \"$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
# behind the times on type madness
echo $ac_n "checking for int16_t""... $ac_c" 1>&6
-echo "configure:1380: checking for int16_t" >&5
+echo "configure:1908: checking for int16_t" >&5
if eval "test \"`echo '$''{'has_int16_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
else
cat > conftest.$ac_ext <<EOF
-#line 1389 "configure"
+#line 1917 "configure"
#include "confdefs.h"
#ifdef __BEOS__
int main() {return 0;}
EOF
-if { (eval echo configure:1400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
has_int16_t=yes
else
echo "$ac_t""$has_int16_t" 1>&6
echo $ac_n "checking for int32_t""... $ac_c" 1>&6
-echo "configure:1417: checking for int32_t" >&5
+echo "configure:1945: checking for int32_t" >&5
if eval "test \"`echo '$''{'has_int32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
else
cat > conftest.$ac_ext <<EOF
-#line 1426 "configure"
+#line 1954 "configure"
#include "confdefs.h"
#ifdef __BEOS__
int main() {return 0;}
EOF
-if { (eval echo configure:1437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
has_int32_t=yes
else
echo "$ac_t""$has_int32_t" 1>&6
echo $ac_n "checking for uint32_t""... $ac_c" 1>&6
-echo "configure:1454: checking for uint32_t" >&5
+echo "configure:1982: checking for uint32_t" >&5
if eval "test \"`echo '$''{'has_uint32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
else
cat > conftest.$ac_ext <<EOF
-#line 1463 "configure"
+#line 1991 "configure"
#include "confdefs.h"
#ifdef __BEOS__
int main() {return 0;}
EOF
-if { (eval echo configure:1474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
has_uint32_t=yes
else
echo "$ac_t""$has_uint32_t" 1>&6
echo $ac_n "checking for u_int32_t""... $ac_c" 1>&6
-echo "configure:1491: checking for u_int32_t" >&5
+echo "configure:2019: checking for u_int32_t" >&5
if eval "test \"`echo '$''{'has_u_int32_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
else
cat > conftest.$ac_ext <<EOF
-#line 1500 "configure"
+#line 2028 "configure"
#include "confdefs.h"
#ifdef __BEOS__
int main() {return 0;}
EOF
-if { (eval echo configure:1511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
has_u_int32_t=yes
else
echo "$ac_t""$has_u_int32_t" 1>&6
echo $ac_n "checking for int64_t""... $ac_c" 1>&6
-echo "configure:1528: checking for int64_t" >&5
+echo "configure:2056: checking for int64_t" >&5
if eval "test \"`echo '$''{'has_int64_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
else
cat > conftest.$ac_ext <<EOF
-#line 1537 "configure"
+#line 2065 "configure"
#include "confdefs.h"
#ifdef __BEOS__
int main() {return 0;}
EOF
-if { (eval echo configure:1548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
has_int64_t=yes
else
echo "$ac_t""$has_int64_t" 1>&6
echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:1565: checking size of short" >&5
+echo "configure:2093: 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
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1573 "configure"
+#line 2101 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
exit(0);
}
EOF
-if { (eval echo configure:1584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2112: \"$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
echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:1604: checking size of int" >&5
+echo "configure:2132: 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
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1612 "configure"
+#line 2140 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
exit(0);
}
EOF
-if { (eval echo configure:1623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2151: \"$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
echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:1643: checking size of long" >&5
+echo "configure:2171: 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
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1651 "configure"
+#line 2179 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
exit(0);
}
EOF
-if { (eval echo configure:1662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2190: \"$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
echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:1682: checking size of long long" >&5
+echo "configure:2210: 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
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1690 "configure"
+#line 2218 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
exit(0);
}
EOF
-if { (eval echo configure:1701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2229: \"$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
esac
fi
-if test x$has_int32_t = "xyes" ; then
- SIZE32="int32_t"
-else
- case 4 in
- $ac_cv_sizeof_short) SIZE32="short";;
- $ac_cv_sizeof_int) SIZE32="int";;
- $ac_cv_sizeof_long) SIZE32="long";;
- esac
-fi
-if test x$has_uint32_t = "xyes" ; then
- USIZE32="uint32_t"
+ac_safe=`echo "memory.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for memory.h""... $ac_c" 1>&6
+echo "configure:2262: checking for memory.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
- if test x$has_u_int32_t = "xyes" ; then
- USIZE32="u_int32_t"
- else
- case 4 in
- $ac_cv_sizeof_short) USIZE32="unsigned short";;
- $ac_cv_sizeof_int) USIZE32="unsigned int";;
- $ac_cv_sizeof_long) USIZE32="unsigned long";;
- esac
- fi
-fi
-
-if test x$has_int64_t = "xyes" ; then
- SIZE64="int64_t"
+ cat > conftest.$ac_ext <<EOF
+#line 2267 "configure"
+#include "confdefs.h"
+#include <memory.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2272: \"$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*
+ eval "ac_cv_header_$ac_safe=yes"
else
-case 8 in
- $ac_cv_sizeof_int) SIZE64="int";;
- $ac_cv_sizeof_long) SIZE64="long";;
- $ac_cv_sizeof_long_long) SIZE64="long long";;
-esac
-fi
-
-if test -z "$SIZE16"; then
- { echo "configure: error: No 16 bit type found on this platform!" 1>&2; exit 1; }
-fi
-if test -z "$SIZE32"; then
- { echo "configure: error: No 32 bit type found on this platform!" 1>&2; exit 1; }
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
fi
-if test -z "$USIZE32"; then
- { echo "configure: error: No unsigned 32 bit type found on this platform!" 1>&2; exit 1; }
+rm -f conftest*
fi
-if test -z "$SIZE64"; then
- echo "configure: warning: No 64 bit type found on this platform!" 1>&2
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ CFLAGS="$CFLAGS -DUSE_MEMORY_H"
+else
+ echo "$ac_t""no" 1>&6
+:
fi
-
-#AC_CHECK_HEADER(alloca.h,AC_DEFINE(USE_ALLOCA_H),:)
-#AC_CHECK_HEADER(memory.h,AC_DEFINE(USE_MEMORY_H),:)
-# We no longer use config.h
-ac_safe=`echo "alloca.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for alloca.h""... $ac_c" 1>&6
-echo "configure:1783: checking for alloca.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+
+
+
+
+
+echo $ac_n "checking for cos in -lm""... $ac_c" 1>&6
+echo "configure:2299: checking for cos in -lm" >&5
+ac_lib_var=`echo m'_'cos | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1788 "configure"
+ ac_save_LIBS="$LIBS"
+LIBS="-lm $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2307 "configure"
#include "confdefs.h"
-#include <alloca.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char cos();
+
+int main() {
+cos()
+; return 0; }
EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1793: \"$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
+if { (eval echo configure:2318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
+ eval "ac_cv_lib_$ac_lib_var=yes"
else
- echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
+LIBS="$ac_save_LIBS"
+
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- CFLAGS="$CFLAGS -DUSE_ALLOCA_H"
+ LIBS="-lm"
else
echo "$ac_t""no" 1>&6
-:
+LIBS=""
fi
-ac_safe=`echo "memory.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for memory.h""... $ac_c" 1>&6
-echo "configure:1817: checking for memory.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
+echo "configure:2340: 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
else
- cat > conftest.$ac_ext <<EOF
-#line 1822 "configure"
+ ac_save_LIBS="$LIBS"
+LIBS="-lpthread $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2348 "configure"
#include "confdefs.h"
-#include <memory.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char pthread_create();
+
+int main() {
+pthread_create()
+; return 0; }
EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1827: \"$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
+if { (eval echo configure:2359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
+ eval "ac_cv_lib_$ac_lib_var=yes"
else
- echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
+LIBS="$ac_save_LIBS"
+
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- CFLAGS="$CFLAGS -DUSE_MEMORY_H"
+ pthread_lib="-lpthread"
else
echo "$ac_t""no" 1>&6
:
fi
-echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1851: checking for working const" >&5
-if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
+if test -n $with_ogg; then
+ CFLAGS="$CFLAGS -I$with_ogg/include -L$with_ogg/lib"
+fi
+echo $ac_n "checking for oggpack_read in -logg""... $ac_c" 1>&6
+echo "configure:2385: checking for oggpack_read in -logg" >&5
+ac_lib_var=`echo ogg'_'oggpack_read | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1856 "configure"
+ ac_save_LIBS="$LIBS"
+LIBS="-logg $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2393 "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
+ builtin and then its argument prototype would still apply. */
+char oggpack_read();
int main() {
-
-/* Ultrix mips cc rejects this. */
-typedef int charset[2]; const charset x;
-/* SunOS 4.1.1 cc rejects this. */
-char const *const *ccp;
-char **p;
-/* NEC SVR4.0.2 mips cc rejects this. */
-struct point {int x, y;};
-static struct point const zero = {0,0};
-/* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in an arm
- of an if-expression whose if-part is not a constant expression */
-const char *g = "string";
-ccp = &g + (g ? g-g : 0);
-/* HPUX 7.0 cc rejects these. */
-++ccp;
-p = (char**) ccp;
-ccp = (char const *const *) p;
-{ /* SCO 3.2v4 cc rejects this. */
- char *t;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
-}
-{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
-}
-{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
-}
-{ /* AIX XL C 1.02.0.0 rejects this saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
-}
-{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
-}
-
+oggpack_read()
; return 0; }
EOF
-if { (eval echo configure:1905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- ac_cv_c_const=yes
+ eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- ac_cv_c_const=no
+ eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LIBS="$LIBS -logg"
+else
+ echo "$ac_t""no" 1>&6
+{ echo "configure: error: You must have libogg to compile vorbis!!!" 1>&2; exit 1; }
fi
-echo "$ac_t""$ac_cv_c_const" 1>&6
-if test $ac_cv_c_const = no; then
- cat >> confdefs.h <<\EOF
-#define const
-EOF
-fi
-echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1926: checking whether time.h and sys/time.h may both be included" >&5
-if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+# for constant arguments. Useless!
+echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
+echo "configure:2430: checking for working alloca.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1931 "configure"
+#line 2435 "configure"
#include "confdefs.h"
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
+#include <alloca.h>
int main() {
-struct tm *tp;
+void *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:1940: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- ac_cv_header_time=yes
+ ac_cv_header_alloca_h=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- ac_cv_header_time=no
+ ac_cv_header_alloca_h=no
fi
rm -f conftest*
fi
-echo "$ac_t""$ac_cv_header_time" 1>&6
-if test $ac_cv_header_time = yes; then
+echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
+if test $ac_cv_header_alloca_h = yes; then
cat >> confdefs.h <<\EOF
-#define TIME_WITH_SYS_TIME 1
+#define HAVE_ALLOCA_H 1
EOF
fi
-echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:1961: 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 "checking for alloca""... $ac_c" 1>&6
+echo "configure:2463: checking for alloca" >&5
+if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1966 "configure"
+#line 2468 "configure"
#include "confdefs.h"
-#include <sys/types.h>
-#include <time.h>
+
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+#else
+# ifdef _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+# else
+# if HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+char *alloca ();
+# endif
+# endif
+# endif
+# endif
+#endif
+
int main() {
-struct tm *tp; tp->tm_sec;
+char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:1974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
- ac_cv_struct_tm=time.h
+ ac_cv_func_alloca_works=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- ac_cv_struct_tm=sys/time.h
+ ac_cv_func_alloca_works=no
fi
rm -f conftest*
fi
-echo "$ac_t""$ac_cv_struct_tm" 1>&6
-if test $ac_cv_struct_tm = sys/time.h; then
+echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
+if test $ac_cv_func_alloca_works = yes; then
cat >> confdefs.h <<\EOF
-#define TM_IN_SYS_TIME 1
+#define HAVE_ALLOCA 1
EOF
fi
-
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1996: 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
-else
- cat > conftestmake <<\EOF
-all:
- @echo 'ac_maketemp="${MAKE}"'
-EOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
- eval ac_cv_prog_make_${ac_make}_set=yes
-else
- eval ac_cv_prog_make_${ac_make}_set=no
-fi
-rm -f conftestmake
-fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- SET_MAKE=
-else
- echo "$ac_t""no" 1>&6
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:2023: 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
- if test "$cross_compiling" = yes; then
- ac_cv_func_memcmp_clean=no
-else
- cat > conftest.$ac_ext <<EOF
-#line 2031 "configure"
-#include "confdefs.h"
-
-main()
-{
- char c0 = 0x40, c1 = 0x80, c2 = 0x81;
- exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
-}
-
+if test $ac_cv_func_alloca_works = no; then
+ # The SVR3 libPW and SVR4 libucb both contain incompatible functions
+ # that cause trouble. Some versions do not even contain alloca or
+ # contain a buggy version. If you still want to use their alloca,
+ # use ar to extract alloca.o from them instead of compiling alloca.c.
+ ALLOCA=alloca.${ac_objext}
+ cat >> confdefs.h <<\EOF
+#define C_ALLOCA 1
EOF
-if { (eval echo configure:2041: \"$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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_func_memcmp_clean=no
-fi
-rm -fr conftest*
-fi
-
-fi
-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:2059: checking return type of signal handlers" >&5
-if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
+echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
+echo "configure:2528: checking whether alloca needs Cray hooks" >&5
+if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2064 "configure"
+#line 2533 "configure"
#include "confdefs.h"
-#include <sys/types.h>
-#include <signal.h>
-#ifdef signal
-#undef signal
-#endif
-#ifdef __cplusplus
-extern "C" void (*signal (int, void (*)(int)))(int);
+#if defined(CRAY) && ! defined(CRAY2)
+webecray
#else
-void (*signal ()) ();
+wenotbecray
#endif
-int main() {
-int i;
-; return 0; }
EOF
-if { (eval echo configure:2081: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "webecray" >/dev/null 2>&1; then
rm -rf conftest*
- ac_cv_type_signal=void
+ ac_cv_os_cray=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
rm -rf conftest*
- ac_cv_type_signal=int
+ ac_cv_os_cray=no
fi
rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_type_signal" 1>&6
-cat >> confdefs.h <<EOF
-#define RETSIGTYPE $ac_cv_type_signal
-EOF
+fi
-for ac_func in gettimeofday select strcspn strerror strspn sigaction
-do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2102: checking for $ac_func" >&5
+echo "$ac_t""$ac_cv_os_cray" 1>&6
+if test $ac_cv_os_cray = yes; then
+for ac_func in _getb67 GETB67 getb67; do
+ echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2558: 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 2107 "configure"
+#line 2563 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:2130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2586: \"$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
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
+#define CRAY_STACKSEG_END $ac_func
EOF
-
+
+ break
else
echo "$ac_t""no" 1>&6
fi
+
done
+fi
+
+echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
+echo "configure:2613: checking stack direction for C alloca" >&5
+if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_c_stack_direction=0
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2621 "configure"
+#include "confdefs.h"
+find_stack_direction ()
+{
+ static char *addr = 0;
+ auto char dummy;
+ if (addr == 0)
+ {
+ addr = &dummy;
+ return find_stack_direction ();
+ }
+ else
+ return (&dummy > addr) ? 1 : -1;
+}
+main ()
+{
+ exit (find_stack_direction() < 0);
+}
+EOF
+if { (eval echo configure:2640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_c_stack_direction=1
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_c_stack_direction=-1
+fi
+rm -fr conftest*
+fi
+fi
+
+echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
+cat >> confdefs.h <<EOF
+#define STACK_DIRECTION $ac_cv_c_stack_direction
+EOF
+fi
+echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
+echo "configure:2662: 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
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_memcmp_clean=no
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2670 "configure"
+#include "confdefs.h"
+main()
+{
+ char c0 = 0x40, c1 = 0x80, c2 = 0x81;
+ exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
+}
+EOF
+if { (eval echo configure:2680: \"$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
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_func_memcmp_clean=no
+fi
+rm -fr conftest*
+fi
+fi
+echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
+test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
-#AC_SUBST(XOGG)
-#AC_SUBST(LIBGTKDIR)
-subdirs="vorbis-tools/libao"
trap '' 1 2 15
done
ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
-trap 'rm -fr `echo "Makefile lib/Makefile examples/Makefile include/vorbis/os_types.h\
- vorbis-tools/Makefile\
- vq/Makefile huff/Makefile cmdline/Makefile xmms/Makefile kmpg/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "Makefile lib/Makefile doc/Makefile include/Makefile include/vorbis/Makefile include/vorbis/book/Makefile examples/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@PACKAGE@%$PACKAGE%g
+s%@VERSION@%$VERSION%g
+s%@ACLOCAL@%$ACLOCAL%g
+s%@AUTOCONF@%$AUTOCONF%g
+s%@AUTOMAKE@%$AUTOMAKE%g
+s%@AUTOHEADER@%$AUTOHEADER%g
+s%@MAKEINFO@%$MAKEINFO%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@V_LIB_CURRENT@%$V_LIB_CURRENT%g
+s%@V_LIB_REVISION@%$V_LIB_REVISION%g
+s%@V_LIB_AGE@%$V_LIB_AGE%g
+s%@VF_LIB_CURRENT@%$VF_LIB_CURRENT%g
+s%@VF_LIB_REVISION@%$VF_LIB_REVISION%g
+s%@VF_LIB_AGE@%$VF_LIB_AGE%g
+s%@CC@%$CC%g
s%@host@%$host%g
s%@host_alias@%$host_alias%g
s%@host_cpu@%$host_cpu%g
s%@host_vendor@%$host_vendor%g
s%@host_os@%$host_os%g
-s%@CC@%$CC%g
-s%@CPP@%$CPP%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
s%@RANLIB@%$RANLIB%g
-s%@AR@%$AR%g
-s%@INSTALL@%$INSTALL%g
-s%@SET_MAKE@%$SET_MAKE%g
+s%@LN_S@%$LN_S%g
+s%@LIBTOOL@%$LIBTOOL%g
+s%@CPP@%$CPP%g
+s%@ALLOCA@%$ALLOCA%g
s%@LIBOBJS@%$LIBOBJS%g
-s%@SIZE16@%$SIZE16%g
-s%@SIZE32@%$SIZE32%g
-s%@USIZE32@%$USIZE32%g
-s%@SIZE64@%$SIZE64%g
-s%@OPT@%$OPT%g
s%@DEBUG@%$DEBUG%g
s%@PROFILE@%$PROFILE%g
s%@pthread_lib@%$pthread_lib%g
-s%@subdirs@%$subdirs%g
CEOF
EOF
cat >> $CONFIG_STATUS <<EOF
-CONFIG_FILES=\${CONFIG_FILES-"Makefile lib/Makefile examples/Makefile include/vorbis/os_types.h\
- vorbis-tools/Makefile\
- vq/Makefile huff/Makefile cmdline/Makefile xmms/Makefile kmpg/Makefile"}
+CONFIG_FILES=\${CONFIG_FILES-"Makefile lib/Makefile doc/Makefile include/Makefile include/vorbis/Makefile include/vorbis/book/Makefile examples/Makefile"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
top_srcdir="$ac_dots$ac_given_srcdir" ;;
esac
+ case "$ac_given_INSTALL" in
+ [/$]*) INSTALL="$ac_given_INSTALL" ;;
+ *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+ esac
echo creating "$ac_file"
rm -f "$ac_file"
s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
fi; done
rm -f conftest.s*
rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
-if test "$no_recursion" != yes; then
-
- # Remove --cache-file and --srcdir arguments so they do not pile up.
- ac_sub_configure_args=
- ac_prev=
- for ac_arg in $ac_configure_args; do
- if test -n "$ac_prev"; then
- ac_prev=
- continue
- fi
- case "$ac_arg" in
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- ;;
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- ;;
- *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
- esac
- done
-
- for ac_config_dir in vorbis-tools/libao; do
-
- # Do not complain, so a configure script can configure whichever
- # parts of a large source tree are present.
- if test ! -d $srcdir/$ac_config_dir; then
- continue
- fi
-
- echo configuring in $ac_config_dir
-
- case "$srcdir" in
- .) ;;
- *)
- if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
- else
- { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; }
- fi
- ;;
- esac
-
- ac_popdir=`pwd`
- cd $ac_config_dir
-
- # A "../" for each directory in /$ac_config_dir.
- ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
-
- case "$srcdir" in
- .) # No --srcdir option. We are building in place.
- ac_sub_srcdir=$srcdir ;;
- /*) # Absolute path.
- ac_sub_srcdir=$srcdir/$ac_config_dir ;;
- *) # Relative path.
- ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
- esac
-
- # Check for guested configure; otherwise get Cygnus style configure.
- if test -f $ac_sub_srcdir/configure; then
- ac_sub_configure=$ac_sub_srcdir/configure
- elif test -f $ac_sub_srcdir/configure.in; then
- ac_sub_configure=$ac_configure
- else
- echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2
- ac_sub_configure=
- fi
-
- # The recursion is here.
- if test -n "$ac_sub_configure"; then
-
- # Make the cache file name correct relative to the subdirectory.
- case "$cache_file" in
- /*) ac_sub_cache_file=$cache_file ;;
- *) # Relative path.
- ac_sub_cache_file="$ac_dots$cache_file" ;;
- esac
-
- echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
- # The eval makes quoting arguments work.
- if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
- then :
- else
- { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
- fi
- fi
-
- cd $ac_popdir
- done
-fi
-
-
+++ /dev/null
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
-#
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Written by Per Bothner <bothner@cygnus.com>.
-# The master version of this file is at the FSF in /home/gd/gnu/lib.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
-#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit system type (host/target name).
-#
-# Only a few systems have been added to this list; please add others
-# (but try to keep the structure clean).
-#
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 8/24/94.)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- alpha:OSF1:*:*)
- if test $UNAME_RELEASE = "V4.0"; then
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- fi
- # A Vn.n version is a released version.
- # A Tn.n version is a released field test version.
- # A Xn.n version is an unreleased experimental baselevel.
- # 1.2 uses "1.2" for uname -r.
- cat <<EOF >dummy.s
- .globl main
- .ent main
-main:
- .frame \$30,0,\$26,0
- .prologue 0
- .long 0x47e03d80 # implver $0
- lda \$2,259
- .long 0x47e20c21 # amask $2,$1
- srl \$1,8,\$2
- sll \$2,2,\$2
- sll \$0,3,\$0
- addl \$1,\$0,\$0
- addl \$2,\$0,\$0
- ret \$31,(\$26),1
- .end main
-EOF
- ${CC-cc} dummy.s -o dummy 2>/dev/null
- if test "$?" = 0 ; then
- ./dummy
- case "$?" in
- 7)
- UNAME_MACHINE="alpha"
- ;;
- 15)
- UNAME_MACHINE="alphaev5"
- ;;
- 14)
- UNAME_MACHINE="alphaev56"
- ;;
- 10)
- UNAME_MACHINE="alphapca56"
- ;;
- 16)
- UNAME_MACHINE="alphaev6"
- ;;
- esac
- fi
- rm -f dummy.s dummy
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
- exit 0 ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit 0 ;;
- Amiga*:UNIX_System_V:4.0:*)
- echo m68k-cbm-sysv4
- exit 0;;
- amiga:NetBSD:*:*)
- echo m68k-cbm-netbsd${UNAME_RELEASE}
- exit 0 ;;
- amiga:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- *:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit 0 ;;
- arc64:OpenBSD:*:*)
- echo mips64el-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- arc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- hkmips:OpenBSD:*:*)
- echo mips-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- pmax:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sgi:OpenBSD:*:*)
- echo mips-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- wgrisc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit 0;;
- arm32:NetBSD:*:*)
- echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- exit 0 ;;
- SR2?01:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit 0;;
- Pyramid*:OSx*:*:*|MIS*:OSx*:*:*|MIS*:SMP_DC-OSx*:*:*)
- # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit 0 ;;
- NILE:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit 0 ;;
- sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- i86pc:SunOS:5.*:*)
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:6*:*)
- # According to config.sub, this is the proper way to canonicalize
- # SunOS6. Hard to guess exactly what SunOS6 will be like, but
- # it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
- Series*|S4*)
- UNAME_RELEASE=`uname -v`
- ;;
- esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit 0 ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit 0 ;;
- sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
- sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
- ;;
- sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
- ;;
- esac
- exit 0 ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit 0 ;;
- atari*:NetBSD:*:*)
- echo m68k-atari-netbsd${UNAME_RELEASE}
- exit 0 ;;
- atari*:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sun3*:NetBSD:*:*)
- echo m68k-sun-netbsd${UNAME_RELEASE}
- exit 0 ;;
- sun3*:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mac68k:NetBSD:*:*)
- echo m68k-apple-netbsd${UNAME_RELEASE}
- exit 0 ;;
- mac68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme88k:OpenBSD:*:*)
- echo m88k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit 0 ;;
- macppc:NetBSD:*:*)
- echo powerpc-apple-netbsd${UNAME_RELEASE}
- exit 0 ;;
- RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit 0 ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
- 2020:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit 0 ;;
- mips:*:*:UMIPS | mips:*:*:RISCos)
- sed 's/^ //' << EOF >dummy.c
- int main (argc, argv) int argc; char **argv; {
- #if defined (host_mips) && defined (MIPSEB)
- #if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
- #endif
- #endif
- exit (-1);
- }
-EOF
- ${CC-cc} dummy.c -o dummy \
- && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
- && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
- echo mips-mips-riscos${UNAME_RELEASE}
- exit 0 ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit 0 ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit 0 ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit 0 ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit 0 ;;
- AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
- -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
- echo m88k-dg-dgux${UNAME_RELEASE}
- else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
- fi
- else echo i586-dg-dgux${UNAME_RELEASE}
- fi
- exit 0 ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit 0 ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit 0 ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit 0 ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit 0 ;;
- *:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit 0 ;;
- ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i?86:AIX:*:*)
- echo i386-ibm-aix
- exit 0 ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- sed 's/^ //' << EOF >dummy.c
- #include <sys/systemcfg.h>
-
- main()
- {
- if (!__power_pc())
- exit(1);
- puts("powerpc-ibm-aix3.2.5");
- exit(0);
- }
-EOF
- ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
- echo rs6000-ibm-aix3.2.5
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
- else
- echo rs6000-ibm-aix3.2
- fi
- exit 0 ;;
- *:AIX:*:4)
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
- if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
- fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=4.${UNAME_RELEASE}
- fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit 0 ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit 0 ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit 0 ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit 0 ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit 0 ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit 0 ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit 0 ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit 0 ;;
- 9000/[34678]??:HP-UX:*:*)
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/6?? | 9000/7?? | 9000/80[24] | 9000/8?[13679] | 9000/892 )
- sed 's/^ //' << EOF >dummy.c
- #include <stdlib.h>
- #include <unistd.h>
-
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
-EOF
- (${CC-cc} dummy.c -o dummy 2>/dev/null ) && HP_ARCH=`./dummy`
- rm -f dummy.c dummy
- esac
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit 0 ;;
- 3050*:HI-UX:*:*)
- sed 's/^ //' << EOF >dummy.c
- #include <unistd.h>
- int
- main ()
- {
- long cpu = sysconf (_SC_CPU_VERSION);
- /* The order matters, because CPU_IS_HP_MC68K erroneously returns
- true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
- results, however. */
- if (CPU_IS_PA_RISC (cpu))
- {
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
- default: puts ("hppa-hitachi-hiuxwe2"); break;
- }
- }
- else if (CPU_IS_HP_MC68K (cpu))
- puts ("m68k-hitachi-hiuxwe2");
- else puts ("unknown-hitachi-hiuxwe2");
- exit (0);
- }
-EOF
- ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
- echo unknown-hitachi-hiuxwe2
- exit 0 ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit 0 ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit 0 ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit 0 ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit 0 ;;
- i?86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
- else
- echo ${UNAME_MACHINE}-unknown-osf1
- fi
- exit 0 ;;
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit 0 ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit 0 ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit 0 ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit 0 ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit 0 ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit 0 ;;
- CRAY*X-MP:*:*:*)
- echo xmp-cray-unicos
- exit 0 ;;
- CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE}
- exit 0 ;;
- CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
- | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
- exit 0 ;;
- CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE}
- exit 0 ;;
- CRAY-2:*:*:*)
- echo cray2-cray-unicos
- exit 0 ;;
- F300:UNIX_System_V:*:*)
- FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit 0 ;;
- F301:UNIX_System_V:*:*)
- echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
- exit 0 ;;
- hp3[0-9][05]:NetBSD:*:*)
- echo m68k-hp-netbsd${UNAME_RELEASE}
- exit 0 ;;
- hp300:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
- i?86:BSD/386:*:* | *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit 0 ;;
- *:FreeBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit 0 ;;
- *:NetBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- exit 0 ;;
- *:OpenBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- exit 0 ;;
- i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit 0 ;;
- i*:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit 0 ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit 0 ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- *:GNU:*:*)
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit 0 ;;
- *:Linux:*:*)
- # uname on the ARM produces all sorts of strangeness, and we need to
- # filter it out.
- case "$UNAME_MACHINE" in
- arm* | sa110*) UNAME_MACHINE="arm" ;;
- esac
-
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us.
- ld_help_string=`ld --help 2>&1`
- ld_supported_emulations=`echo $ld_help_string \
- | sed -ne '/supported emulations:/!d
- s/[ ][ ]*/ /g
- s/.*supported emulations: *//
- s/ .*//
- p'`
- case "$ld_supported_emulations" in
- i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
- i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
- sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
- armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
- m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
- elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;;
- esac
-
- if test "${UNAME_MACHINE}" = "alpha" ; then
- sed 's/^ //' <<EOF >dummy.s
- .globl main
- .ent main
- main:
- .frame \$30,0,\$26,0
- .prologue 0
- .long 0x47e03d80 # implver $0
- lda \$2,259
- .long 0x47e20c21 # amask $2,$1
- srl \$1,8,\$2
- sll \$2,2,\$2
- sll \$0,3,\$0
- addl \$1,\$0,\$0
- addl \$2,\$0,\$0
- ret \$31,(\$26),1
- .end main
-EOF
- LIBC=""
- ${CC-cc} dummy.s -o dummy 2>/dev/null
- if test "$?" = 0 ; then
- ./dummy
- case "$?" in
- 7)
- UNAME_MACHINE="alpha"
- ;;
- 15)
- UNAME_MACHINE="alphaev5"
- ;;
- 14)
- UNAME_MACHINE="alphaev56"
- ;;
- 10)
- UNAME_MACHINE="alphapca56"
- ;;
- 16)
- UNAME_MACHINE="alphaev6"
- ;;
- esac
-
- objdump --private-headers dummy | \
- grep ld.so.1 > /dev/null
- if test "$?" = 0 ; then
- LIBC="libc1"
- fi
- fi
- rm -f dummy.s dummy
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
- elif test "${UNAME_MACHINE}" = "mips" ; then
- cat >dummy.c <<EOF
-main(argc, argv)
- int argc;
- char *argv[];
-{
-#ifdef __MIPSEB__
- printf ("%s-unknown-linux-gnu\n", argv[1]);
-#endif
-#ifdef __MIPSEL__
- printf ("%sel-unknown-linux-gnu\n", argv[1]);
-#endif
- return 0;
-}
-EOF
- ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
- else
- # Either a pre-BFD a.out linker (linux-gnuoldld)
- # or one that does not give us useful --help.
- # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
- # If ld does not provide *any* "supported emulations:"
- # that means it is gnuoldld.
- echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
- test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
-
- case "${UNAME_MACHINE}" in
- i?86)
- VENDOR=pc;
- ;;
- *)
- VENDOR=unknown;
- ;;
- esac
- # Determine whether the default compiler is a.out or elf
- cat >dummy.c <<EOF
-#include <features.h>
-main(argc, argv)
- int argc;
- char *argv[];
-{
-#ifdef __ELF__
-# ifdef __GLIBC__
-# if __GLIBC__ >= 2
- printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
-# else
- printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
-# endif
-# else
- printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
-# endif
-#else
- printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
-#endif
- return 0;
-}
-EOF
- ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
- rm -f dummy.c dummy
- fi ;;
-# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
-# are messed up and put the nodename in both sysname and nodename.
- i?86:DYNIX/ptx:4*:*)
- echo i386-sequent-sysv4
- exit 0 ;;
- i?86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
- # I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit 0 ;;
- i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
- else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
- fi
- exit 0 ;;
- i?86:*:3.2:*)
- if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
- elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
- (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
- else
- echo ${UNAME_MACHINE}-pc-sysv32
- fi
- exit 0 ;;
- i?86:UnixWare:*:*)
- if /bin/uname -X 2>/dev/null >/dev/null ; then
- (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- fi
- echo ${UNAME_MACHINE}-unixware-${UNAME_RELEASE}-${UNAME_VERSION}
- exit 0 ;;
- pc:*:*:*)
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i386.
- echo i386-pc-msdosdjgpp
- exit 0 ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit 0 ;;
- paragon:*:*:*)
- echo i860-intel-osf1
- exit 0 ;;
- i860:*:4.*:*) # i860-SVR4
- if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
- else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
- fi
- exit 0 ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit 0 ;;
- M68*:*:R3V[567]*:*)
- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
- 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
- OS_REL=''
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4.3${OS_REL} && exit 0
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4 && exit 0 ;;
- m68*:LynxOS:2.*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit 0 ;;
- i?86:LynxOS:2.*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit 0 ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit 0 ;;
- *:SINIX-*:*:*)
- if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
- else
- echo ns32k-sni-sysv
- fi
- exit 0 ;;
- PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit 0 ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes@openmarket.com>.
- # How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit 0 ;;
- *:*:*:FTX*)
- # From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit 0 ;;
- mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit 0 ;;
- news*:NEWS-OS:*:6*)
- echo mips-sony-newsos6
- exit 0 ;;
- R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
- else
- echo mips-unknown-sysv${UNAME_RELEASE}
- fi
- exit 0 ;;
- BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit 0 ;;
- BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit 0 ;;
- BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit 0 ;;
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-cat >dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-#if !defined (ultrix)
- printf ("vax-dec-bsd\n"); exit (0);
-#else
- printf ("vax-dec-ultrix\n"); exit (0);
-#endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
-rm -f dummy.c dummy
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit 0 ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit 0 ;;
- c34*)
- echo c34-convex-bsd
- exit 0 ;;
- c38*)
- echo c38-convex-bsd
- exit 0 ;;
- c4*)
- echo c4-convex-bsd
- exit 0 ;;
- esac
-fi
-
-#echo '(Unable to guess system type)' 1>&2
-
-exit 1
-# $Id: configure.in,v 1.23 2000/08/31 03:28:43 xiphmont Exp $
+dnl Process this file with autoconf to produce a configure script
-AC_INIT(lib/mdct.c)
-#AC_CONFIG_HEADER(config.h)
-
-cp configure.guess config.guess
-cp configure.sub config.sub
-
-AC_CANONICAL_HOST
-
-dnl If we're on IRIX, we wanna use cc even if gcc is there (unless the user
-dnl has overriden us)...
-case $host in
- *-*-irix*)
- if test -z "$CC"; then
- CC=cc
- fi
- AC_CHECK_LIB(audio, ALwritesamps)
- ;;
-# BeOS does not use -lm
-# *-*-beos)
-# LIBS=""
-# ;;
-# added better check below
-
-esac
+dnl ------------------------------------------------
+dnl Initialization and Versioning
+dnl ------------------------------------------------
+AC_INIT(lib/mdct.c)
+AM_INIT_AUTOMAKE(libvorbis,1.0.0)
+
+dnl Library versioning
+
+V_LIB_CURRENT=0
+V_LIB_REVISION=0
+V_LIB_AGE=0
+VF_LIB_CURRENT=0
+VF_LIB_REVISION=0
+VF_LIB_AGE=0
+AC_SUBST(V_LIB_CURRENT)
+AC_SUBST(V_LIB_REVISION)
+AC_SUBST(V_LIB_AGE)
+AC_SUBST(VF_LIB_CURRENT)
+AC_SUBST(VF_LIB_REVISION)
+AC_SUBST(VF_LIB_AGE)
+
+dnl --------------------------------------------------
+dnl Check for programs
+dnl --------------------------------------------------
+
+dnl save $CFLAGS since AC_PROG_CC likes to insert "-g -O2"
+dnl if $CFLAGS is blank
cflags_save="$CFLAGS"
AC_PROG_CC
-# because AC_PROG_CC likes to set -g
CFLAGS="$cflags_save"
-AC_PROG_CPP
-AC_PROG_RANLIB
-AC_CHECK_PROG(AR,ar,ar)
-AC_CHECK_PROG(INSTALL,install,install)
+AM_PROG_LIBTOOL
-#not everyone uses libm (eg, BeOS)
-#AC_CHECK_LIB(m, cos, LIBS="-lm"; AC_DEFINE(HAVE_LIBM), LIBS="")
-# We no longer use config.h
-AC_CHECK_LIB(m, cos, LIBS="-lm", LIBS="")
+dnl --------------------------------------------------
+dnl Additional arguments
+dnl --------------------------------------------------
+
+AC_ARG_WITH(ogg, [ --with-ogg=DIR Set where the Ogg library is located])
+
+dnl --------------------------------------------------
+dnl Set build flags based on environment
+dnl --------------------------------------------------
+
+AC_CANONICAL_HOST
dnl Set some target options
if test -z "$GCC"; then
case $host in
*-*-irix*)
+ dnl If we're on IRIX, we wanna use cc even if gcc
+ dnl is there (unless the user has overriden us)...
+ if test -z "$CC"; then
+ CC=cc
+ fi
DEBUG="-g -signed"
- OPT="-O2 -w -signed"
+ CFLAGS="-O2 -w -signed"
PROFILE="-p -g3 -O2 -signed" ;;
sparc-sun-solaris*)
DEBUG="-v -g"
- OPT="-xO4 -fast -w -fsimple -native -xcg92"
+ CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc" ;;
*)
DEBUG="-g"
- OPT="-O"
+ CFLAGS="-O"
PROFILE="-g -p" ;;
esac
else
case $host in
*86-*-linux*)
DEBUG="-g -Wall -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"
-
+ CFLAGS="-O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char"
+# PROFILE="-Wall -W -pg -O20 -ffast-math -D_REENTRANT -fsigned-char -fno-inline -static"
+ PROFILE="-Wall -W -pg -O20 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char -fno-inline -static"
+
# glibc < 2.1.3 has a serious FP bug in the math inline header
# that will cripple Vorbis. Look to see if the magic FP stack
# clobber is missing in the mathinline header, thus indicating
AC_MSG_WARN([********************************************************])
AC_MSG_WARN([ ])
- OPT=${OPT}" -D__NO_MATH_INLINES"
+ CFLAGS=${OPT}" -D__NO_MATH_INLINES"
PROFILE=${PROFILE}" -D__NO_MATH_INLINES"
fi;;
*-*-linux*)
DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
- OPT="-O20 -ffast-math -D_REENTRANT -fsigned-char"
+ CFLAGS="-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"
+ CFLAGS="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8"
PROFILE="-pg -g -O20 -D__NO_MATH_INLINES -fsigned-char -mv8" ;;
*)
DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char"
- OPT="-O20 -D__NO_MATH_INLINES -fsigned-char"
+ CFLAGS="-O20 -D__NO_MATH_INLINES -fsigned-char"
PROFILE="-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char" ;;
esac
fi
esac
fi
-if test x$has_int32_t = "xyes" ; then
- SIZE32="int32_t"
-else
- case 4 in
- $ac_cv_sizeof_short) SIZE32="short";;
- $ac_cv_sizeof_int) SIZE32="int";;
- $ac_cv_sizeof_long) SIZE32="long";;
- esac
-fi
+dnl --------------------------------------------------
+dnl Check for headers
+dnl --------------------------------------------------
-if test x$has_uint32_t = "xyes" ; then
- USIZE32="uint32_t"
-else
- if test x$has_u_int32_t = "xyes" ; then
- USIZE32="u_int32_t"
- else
- case 4 in
- $ac_cv_sizeof_short) USIZE32="unsigned short";;
- $ac_cv_sizeof_int) USIZE32="unsigned int";;
- $ac_cv_sizeof_long) USIZE32="unsigned long";;
- esac
- fi
-fi
+AC_CHECK_HEADER(memory.h,CFLAGS="$CFLAGS -DUSE_MEMORY_H",:)
-if test x$has_int64_t = "xyes" ; then
- SIZE64="int64_t"
-else
-case 8 in
- $ac_cv_sizeof_int) SIZE64="int";;
- $ac_cv_sizeof_long) SIZE64="long";;
- $ac_cv_sizeof_long_long) SIZE64="long long";;
-esac
-fi
+dnl --------------------------------------------------
+dnl Check for typedefs, structures, etc
+dnl --------------------------------------------------
-if test -z "$SIZE16"; then
- AC_MSG_ERROR(No 16 bit type found on this platform!)
-fi
-if test -z "$SIZE32"; then
- AC_MSG_ERROR(No 32 bit type found on this platform!)
-fi
-if test -z "$USIZE32"; then
- AC_MSG_ERROR(No unsigned 32 bit type found on this platform!)
-fi
-if test -z "$SIZE64"; then
- AC_MSG_WARN(No 64 bit type found on this platform!)
-fi
-
-#AC_CHECK_HEADER(alloca.h,AC_DEFINE(USE_ALLOCA_H),:)
-#AC_CHECK_HEADER(memory.h,AC_DEFINE(USE_MEMORY_H),:)
-# We no longer use config.h
-AC_CHECK_HEADER(alloca.h,CFLAGS="$CFLAGS -DUSE_ALLOCA_H",:)
-AC_CHECK_HEADER(memory.h,CFLAGS="$CFLAGS -DUSE_MEMORY_H",:)
+dnl none
+
+dnl --------------------------------------------------
+dnl Check for libraries
+dnl --------------------------------------------------
+
+AC_CHECK_LIB(m, cos, LIBS="-lm", LIBS="")
+AC_CHECK_LIB(pthread, pthread_create, pthread_lib="-lpthread", :)
-AC_C_CONST
-AC_HEADER_TIME
-AC_STRUCT_TM
+dnl Check for libogg
+if test -n $with_ogg; then
+ CFLAGS="$CFLAGS -I$with_ogg/include -L$with_ogg/lib"
+fi
+AC_CHECK_LIB(ogg, oggpack_read, LIBS="$LIBS -logg", AC_MSG_ERROR([You must have libogg to compile vorbis!!!]))
-AC_PROG_MAKE_SET
+dnl --------------------------------------------------
+dnl Check for library functions
+dnl --------------------------------------------------
+
+AC_FUNC_ALLOCA
AC_FUNC_MEMCMP
-AC_TYPE_SIGNAL
-AC_CHECK_FUNCS(gettimeofday select strcspn strerror strspn sigaction)
-
-AC_SUBST(SIZE16)
-AC_SUBST(SIZE32)
-AC_SUBST(USIZE32)
-AC_SUBST(SIZE64)
-AC_SUBST(OPT)
+
+dnl --------------------------------------------------
+dnl Do substitutions
+dnl --------------------------------------------------
+
AC_SUBST(LIBS)
AC_SUBST(DEBUG)
AC_SUBST(PROFILE)
AC_SUBST(CC)
-AC_SUBST(RANLIB)
-#AC_SUBST(XOGG)
-#AC_SUBST(LIBGTKDIR)
AC_SUBST(pthread_lib)
-AC_CONFIG_SUBDIRS(vorbis-tools/libao)
-
-AC_OUTPUT(Makefile lib/Makefile examples/Makefile include/vorbis/os_types.h\
- vorbis-tools/Makefile\
- vq/Makefile huff/Makefile cmdline/Makefile xmms/Makefile kmpg/Makefile)
-
+AC_OUTPUT(Makefile lib/Makefile doc/Makefile include/Makefile include/vorbis/Makefile include/vorbis/book/Makefile examples/Makefile)
+++ /dev/null
-#! /bin/sh
-# Configuration validation subroutine script, version 1.1.
-# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc.
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-if [ x$1 = x ]
-then
- echo Configuration name missing. 1>&2
- echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
- echo "or $0 ALIAS" 1>&2
- echo where ALIAS is a recognized configuration type. 1>&2
- exit 1
-fi
-
-# First pass through any local machine types.
-case $1 in
- *local*)
- echo $1
- exit 0
- ;;
- *)
- ;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- linux-gnu*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple)
- os=
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco5)
- os=sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
- ;;
- -psos*)
- os=-psos
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
- | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
- | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \
- | alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
- | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
- | mips64 | mipsel | mips64el | mips64orion | mips64orionel \
- | mipstx39 | mipstx39el \
- | sparc | sparclet | sparclite | sparc64 | v850)
- basic_machine=$basic_machine-unknown
- ;;
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i[34567]86)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
- | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
- | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
- | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
- | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \
- | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
- | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
- | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
- | sparc64-* | mips64-* | mipsel-* \
- | mips64el-* | mips64orion-* | mips64orionel-* \
- | mipstx39-* | mipstx39el-* \
- | f301-*)
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-cbm
- ;;
- amigaos | amigados)
- basic_machine=m68k-cbm
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-cbm
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- cray2)
- basic_machine=cray2-cray
- os=-unicos
- ;;
- [ctj]90-cray)
- basic_machine=c90-cray
- os=-unicos
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- os=-mvs
- ;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
- i[34567]86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i[34567]86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i[34567]86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i[34567]86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- mipsel*-linux*)
- basic_machine=mipsel-unknown
- os=-linux-gnu
- ;;
- mips*-linux*)
- basic_machine=mips-unknown
- os=-linux-gnu
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pentium | p5 | k5 | nexen)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | k6 | 6x86)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | nexen-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | k6-* | 6x86-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=rs6000-ibm
- ;;
- ppc) basic_machine=powerpc-unknown
- ;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- xmp)
- basic_machine=xmp-cray
- os=-unicos
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- mips)
- if [ x$os = x-linux-gnu ]; then
- basic_machine=mips-unknown
- else
- basic_machine=mips-mips
- fi
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sparc)
- basic_machine=sparc-sun
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- *)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -svr4*)
- os=-sysv4
- ;;
- -unixware*)
- os=-sysv4.2uw
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
- | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -uxpv* | -beos*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
- ;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -ns2 )
- os=-nextstep2
- ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
- ;;
- -sinix*)
- os=-sysv4
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -xenix)
- os=-xenix
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-semi)
- os=-aout
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- m68*-apollo)
- os=-domain
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- *-be)
- os=-beos
- ;;
- *-ibm)
- os=-aix
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigaos
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-next )
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-siemens)
- os=-sysv4
- ;;
- *-masscomp)
- os=-rtu
- ;;
- f301-fujitsu)
- os=-uxpv
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -aix*)
- vendor=ibm
- ;;
- -hpux*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -vxsim* | -vxworks*)
- vendor=wrs
- ;;
- -aux*)
- vendor=apple
- ;;
- esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo $basic_machine$os
+## Process this with automake to create Makefile.in
+
+AUTOMAKE_OPTIONS = foreign
+
+docdir = $(prefix)/doc/$(PACKAGE)-$(VERSION)
+
+doc_DATA = v-comment.html vorbisword2.png white-ogg.png programming.html\
+ vorbis.html wait.png white-xifish.png
+
+EXTRA_DIST = $(doc_DATA)
--- /dev/null
+Makefile
+Makefile.in
+.libs
+.deps
+encoder_example
+decoder_example
+chaining_example
+vorbisfile_example
--- /dev/null
+## Process this file with automake to produce Makefile.in
+
+AUTOMAKE_OPTIONS = foreign
+
+INCLUDES = -I$(top_srcdir)/include
+
+noinst_PROGRAMS = decoder_example encoder_example chaining_example\
+ vorbisfile_example
+
+LDADD = $(top_srcdir)/lib/.libs/libvorbis.a
+
+decoder_example_SOURCES = decoder_example.c
+encoder_example_SOURCES = encoder_example.c
+chaining_example_SOURCES = chaining_example.c
+chaining_example_LDADD = $(top_srcdir)/lib/.libs/libvorbisfile.a $(top_srcdir)/lib/.libs/libvorbis.a
+vorbisfile_example_SOURCES = vorbisfile_example.c
+vorbisfile_example_LDADD = $(top_srcdir)/lib/.libs/libvorbisfile.a $(top_srcdir)/lib/.libs/libvorbis.a
+
+debug:
+ $(MAKE) all CFLAGS="@DEBUG@"
+
+profile:
+ $(MAKE) all CFLAGS="@PROFILE@"
+++ /dev/null
-# vorbis makefile configured for use with gcc on any platform
-
-# $Id: Makefile.in,v 1.13 2000/08/15 11:53:18 xiphmont Exp $
-
-###############################################################################
-# #
-# To build a production vorbis (preferrably using gmake), just type 'make'. #
-# To build with debugging or profiling information, use 'make debug' or #
-# 'make profile' respectively. 'make clean' is a good idea between builds #
-# with different target names, or before a final build. #
-# #
-###############################################################################
-
-
-# DO NOT EDIT BELOW! ##########################################################
-# (unless, of course, you know what you are doing :) ##########################
-
-@SET_MAKE@
-FLAGS=-I. -I../include @CFLAGS@
-OPT=@OPT@ $(FLAGS)
-DEBUG=@DEBUG@ $(FLAGS)
-PROFILE=@PROFILE@ $(FLAGS)
-CC=@CC@
-LD=@CC@
-LDFLAGS=@LDFLAGS@ $(FLAGS)
-AR=@AR@
-RANLIB=@RANLIB@
-LIBS=@LIBS@
-
-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 \
- vorbisfile_example.o seeking_test.o
-BINFILES = encoder_example decoder_example chaining_example \
- vorbisfile_example seeking_test
-
-all:
- $(MAKE) target CFLAGS="$(OPT)"
-
-debug:
- $(MAKE) target CFLAGS="$(DEBUG)"
-
-profile:
- $(MAKE) target CFLAGS="$(PROFILE)"
-
-target: $(BINFILES)
-
-encoder_example.o: ../include/vorbis/modes.h
-
-encoder_example: $(OFILES) ../lib/libvorbis.a
- $(CC) $(CFLAGS) $(LDFLAGS) encoder_example.o ../lib/libvorbis.a -o \
- encoder_example $(LIBS)
-
-decoder_example: $(OFILES) ../lib/libvorbis.a
- $(CC) $(CFLAGS) $(LDFLAGS) decoder_example.o ../lib/libvorbis.a -o \
- decoder_example $(LIBS)
-
-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 \
- ../lib/vorbisfile.a ../lib/libvorbis.a \
- -o seeking_test $(LIBS)
-
-selftest:
-
-$(OFILES): $(HFILES)
-
-.c.o:
- $(CC) $(CFLAGS) -c $<
-
-clean:
- -rm -f *.o *.a test* *~ *.out ogg config.* \
- encoder_example decoder_example chaining_example \
- vorbisfile_example seeking_test
-
-distclean: clean
- -rm -f Makefile
-
********************************************************************
function: illustrate simple use of chained bitstream and vorbisfile.a
- last mod: $Id: chaining_example.c,v 1.5 2000/06/14 10:13:35 xiphmont Exp $
+ last mod: $Id: chaining_example.c,v 1.6 2000/10/12 03:12:39 xiphmont Exp $
********************************************************************/
-#include "vorbis/codec.h"
-#include "vorbis/vorbisfile.h"
-#include "../lib/misc.h"
+#include <vorbis/codec.h>
+#include <vorbis/vorbisfile.h>
int main(){
OggVorbis_File ov;
********************************************************************
function: simple example decoder
- last mod: $Id: decoder_example.c,v 1.12 2000/08/30 06:09:21 xiphmont Exp $
+ last mod: $Id: decoder_example.c,v 1.13 2000/10/12 03:12:39 xiphmont Exp $
********************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include "vorbis/codec.h"
+#include <vorbis/codec.h>
#ifdef _WIN32 /* We need the following two to set stdin/stdout to binary */
#include <io.h>
/* no reason to complain; already complained above */
}else{
/* we have a packet. Decode it */
- double **pcm;
+ float **pcm;
int samples;
if(vorbis_synthesis(&vb,&op)==0) /* test for success! */
vorbis_synthesis_blockin(&vd,&vb);
/*
- **pcm is a multichannel double vector. In stereo, for
+ **pcm is a multichannel float vector. In stereo, for
example, pcm[0] is left, and pcm[1] is right. samples is
the size of each channel. Convert the float values
(-1.<=range<=1.) to whatever PCM format and write it out */
int clipflag=0;
int bout=(samples<convsize?samples:convsize);
- /* convert doubles to 16 bit signed ints (host order) and
+ /* convert floats to 16 bit signed ints (host order) and
interleave */
for(i=0;i<vi.channels;i++){
ogg_int16_t *ptr=convbuffer+i;
- double *mono=pcm[i];
+ float *mono=pcm[i];
for(j=0;j<bout;j++){
+#if 1
int val=mono[j]*32767.;
+#else /* optional dither */
+ int val=mono[j]*32767.+drand48()-0.5;
+#endif
/* might as well guard against clipping */
if(val>32767){
val=32767;
********************************************************************
function: simple example encoder
- last mod: $Id: encoder_example.c,v 1.13 2000/08/15 14:01:02 xiphmont Exp $
+ last mod: $Id: encoder_example.c,v 1.14 2000/10/12 03:12:39 xiphmont Exp $
********************************************************************/
#include <stdlib.h>
#include <time.h>
#include <math.h>
-#include "vorbis/mode_C.h"
+#include <vorbis/mode_C.h>
#ifdef _WIN32 /* We need the following two to set stdin/stdout to binary */
#include <io.h>
ogg_stream_packetin(&os,&header_comm);
ogg_stream_packetin(&os,&header_code);
- /* no need to write out here. We'll get to that in the main loop */
+ /* We don't have to write out here, but doing so makes streaming
+ * much easier, so we do, flushing ALL pages. This ensures the actual
+ * audio data will start on a new page
+ */
+ while(!eos){
+ int result=ogg_stream_flush(&os,&og);
+ if(result==0)break;
+ fwrite(og.header,1,og.header_len,stdout);
+ fwrite(og.body,1,og.body_len,stdout);
+ }
+
}
while(!eos){
/* data to encode */
/* expose the buffer to submit data */
- double **buffer=vorbis_analysis_buffer(&vd,READ);
+ float **buffer=vorbis_analysis_buffer(&vd,READ);
/* uninterleave samples */
for(i=0;i<bytes/4;i++){
********************************************************************
function: illustrate seeking, and test it too
- last mod: $Id: seeking_example.c,v 1.3 2000/07/07 06:16:24 xiphmont Exp $
+ last mod: $Id: seeking_example.c,v 1.4 2000/10/12 03:12:39 xiphmont Exp $
********************************************************************/
********************************************************************
function: simple example decoder using vorbisfile
- last mod: $Id: vorbisfile_example.c,v 1.1 2000/06/19 10:05:57 xiphmont Exp $
+ last mod: $Id: vorbisfile_example.c,v 1.2 2000/10/12 03:12:39 xiphmont Exp $
********************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include "vorbis/codec.h"
-#include "vorbis/vorbisfile.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>
--- /dev/null
+Makefile
+Makefile.in
--- /dev/null
+## Process this file with automake to produce Makefile.in
+
+AUTOMAKE_OPTIONS = foreign
+
+SUBDIRS = vorbis
--- /dev/null
+Makefile
+Makefile.in
--- /dev/null
+## Process this file with automake to produce Makefile.in
+
+AUTOMAKE_OPTIONS = foreign
+
+includedir = $(prefix)/include/vorbis
+
+include_HEADERS = backends.h codec.h mode_B.h mode_D.h modes.h\
+ codebook.h mode_A.h mode_C.h mode_E.h vorbisfile.h
+
+SUBDIRS = book
+
function: libvorbis backend and mapping structures; needed for
static mode headers
- last mod: $Id: backends.h,v 1.11 2000/07/12 09:36:17 xiphmont Exp $
+ last mod: $Id: backends.h,v 1.12 2000/10/12 03:12:40 xiphmont Exp $
********************************************************************/
void (*free_info) (vorbis_info_time *);
void (*free_look) (vorbis_look_time *);
int (*forward) (struct vorbis_block *,vorbis_look_time *,
- double *,double *);
+ float *,float *);
int (*inverse) (struct vorbis_block *,vorbis_look_time *,
- double *,double *);
+ float *,float *);
} vorbis_func_time;
typedef struct{
void (*free_info) (vorbis_info_floor *);
void (*free_look) (vorbis_look_floor *);
int (*forward) (struct vorbis_block *,vorbis_look_floor *,
- double *,double *);
+ float *,float *);
int (*inverse) (struct vorbis_block *,vorbis_look_floor *,
- double *);
+ float *);
} vorbis_func_floor;
typedef struct{
void (*free_info) (vorbis_info_residue *);
void (*free_look) (vorbis_look_residue *);
int (*forward) (struct vorbis_block *,vorbis_look_residue *,
- double **,int);
+ float **,int);
int (*inverse) (struct vorbis_block *,vorbis_look_residue *,
- double **,int);
+ float **,int);
} vorbis_func_residue;
typedef struct vorbis_info_residue0{
int booklist[256]; /* list of second stage books */
/* encode-only heuristic settings */
- double entmax[64]; /* book entropy threshholds*/
- double ampmax[64]; /* book amp threshholds*/
+ float entmax[64]; /* book entropy threshholds*/
+ float ampmax[64]; /* book amp threshholds*/
int subgrp[64]; /* book heuristic subgroup size */
int blimit[64]; /* subgroup position limits */
--- /dev/null
+Makefile
+Makefile.in
--- /dev/null
+## Process this file with automake to produce Makefile.in
+
+AUTOMAKE_OPTIONS = foreign
+
+includedir = $(prefix)/include/vorbis/book
+
+include_HEADERS = lsp12_0.vqh res0_1024a_192_5.vqh res0_128a_192_4.vqh \
+ lsp30_0.vqh res0_1024a_256_1.vqh res0_128a_192_5.vqh \
+ res0_1024a_128_1.vqh res0_1024a_256_2.vqh res0_128a_256_1.vqh \
+ res0_1024a_128_2.vqh res0_1024a_256_3.vqh res0_128a_256_2.vqh \
+ res0_1024a_128_3.vqh res0_1024a_256_4.vqh res0_128a_256_3.vqh \
+ res0_1024a_128_4.vqh res0_1024a_256_5.vqh res0_128a_256_4.vqh \
+ res0_1024a_128_5.vqh res0_1024a_350_1.vqh res0_128a_256_5.vqh \
+ res0_1024a_128_6.vqh res0_1024a_350_2.vqh res0_128a_350_1.vqh \
+ res0_1024a_128_7.vqh res0_1024a_350_3.vqh res0_128a_350_2.vqh \
+ res0_1024a_128_8.vqh res0_1024a_350_4.vqh res0_128a_350_3.vqh \
+ res0_1024a_128_9.vqh res0_1024a_350_5.vqh res0_128a_350_4.vqh \
+ res0_1024a_160_1.vqh res0_128a_128_1.vqh res0_128a_350_5.vqh \
+ res0_1024a_160_2.vqh res0_128a_128_2.vqh resaux0_1024a_128.vqh \
+ res0_1024a_160_3.vqh res0_128a_128_3.vqh resaux0_1024a_160.vqh \
+ res0_1024a_160_4.vqh res0_128a_128_4.vqh resaux0_1024a_192.vqh \
+ res0_1024a_160_5.vqh res0_128a_128_5.vqh resaux0_1024a_256.vqh \
+ res0_1024a_160_6.vqh res0_128a_160_1.vqh resaux0_1024a_350.vqh \
+ res0_1024a_160_7.vqh res0_128a_160_2.vqh resaux0_128a_128.vqh \
+ res0_1024a_160_8.vqh res0_128a_160_3.vqh resaux0_128a_160.vqh \
+ res0_1024a_160_9.vqh res0_128a_160_4.vqh resaux0_128a_192.vqh \
+ res0_1024a_192_1.vqh res0_128a_160_5.vqh resaux0_128a_256.vqh \
+ res0_1024a_192_2.vqh res0_128a_192_1.vqh resaux0_128a_350.vqh \
+ res0_1024a_192_3.vqh res0_128a_192_2.vqh res0_1024a_192_4.vqh \
+ res0_128a_192_3.vqh
14,
};
-static double _vq_quantthresh_res0_1024a_128_1[] = {
+static float _vq_quantthresh_res0_1024a_128_1[] = {
-0.5, 0.5,
};
9,
};
-static double _vq_quantthresh_res0_1024a_128_2[] = {
+static float _vq_quantthresh_res0_1024a_128_2[] = {
-0.5, 0.5,
};
21,
};
-static double _vq_quantthresh_res0_1024a_128_3[] = {
+static float _vq_quantthresh_res0_1024a_128_3[] = {
-1.5, -0.5, 0.5, 1.5,
};
17,
};
-static double _vq_quantthresh_res0_1024a_128_4[] = {
+static float _vq_quantthresh_res0_1024a_128_4[] = {
-1.5, -0.5, 0.5, 1.5,
};
0,
};
-static double _vq_quantthresh_res0_1024a_128_5[] = {
+static float _vq_quantthresh_res0_1024a_128_5[] = {
-2.5, -1.5, -0.5, 0.5, 1.5, 2.5,
};
0,
};
-static double _vq_quantthresh_res0_1024a_128_6[] = {
+static float _vq_quantthresh_res0_1024a_128_6[] = {
-2.5, -1.5, -0.5, 0.5, 1.5, 2.5,
};
13,14,14,15,11,13,14,14,15,
};
-static double _vq_quantthresh_res0_1024a_128_7[] = {
+static float _vq_quantthresh_res0_1024a_128_7[] = {
-5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5,
3.5, 5,
};
12,
};
-static double _vq_quantthresh_res0_1024a_128_8[] = {
+static float _vq_quantthresh_res0_1024a_128_8[] = {
-9.5, -7, -5, -3.5, -2.5, -1.5, -0.5, 0.5,
1.5, 2.5, 3.5, 5, 7, 9.5,
};
0,
};
-static double _vq_quantthresh_res0_1024a_128_9[] = {
+static float _vq_quantthresh_res0_1024a_128_9[] = {
-38.5, -27.5, -19.5, -13.5, -9.5, -7, -5, -3.5,
-2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5, 5,
7, 9.5, 13.5, 19.5, 27.5, 38.5,
15,
};
-static double _vq_quantthresh_res0_1024a_160_1[] = {
+static float _vq_quantthresh_res0_1024a_160_1[] = {
-0.5, 0.5,
};
9,
};
-static double _vq_quantthresh_res0_1024a_160_2[] = {
+static float _vq_quantthresh_res0_1024a_160_2[] = {
-0.5, 0.5,
};
20,
};
-static double _vq_quantthresh_res0_1024a_160_3[] = {
+static float _vq_quantthresh_res0_1024a_160_3[] = {
-1.5, -0.5, 0.5, 1.5,
};
16,
};
-static double _vq_quantthresh_res0_1024a_160_4[] = {
+static float _vq_quantthresh_res0_1024a_160_4[] = {
-1.5, -0.5, 0.5, 1.5,
};
0,
};
-static double _vq_quantthresh_res0_1024a_160_5[] = {
+static float _vq_quantthresh_res0_1024a_160_5[] = {
-2.5, -1.5, -0.5, 0.5, 1.5, 2.5,
};
18,
};
-static double _vq_quantthresh_res0_1024a_160_6[] = {
+static float _vq_quantthresh_res0_1024a_160_6[] = {
-2.5, -1.5, -0.5, 0.5, 1.5, 2.5,
};
11,13,13,14,10,11,12,13,14,
};
-static double _vq_quantthresh_res0_1024a_160_7[] = {
+static float _vq_quantthresh_res0_1024a_160_7[] = {
-5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5,
3.5, 5,
};
13,
};
-static double _vq_quantthresh_res0_1024a_160_8[] = {
+static float _vq_quantthresh_res0_1024a_160_8[] = {
-9.5, -7, -5, -3.5, -2.5, -1.5, -0.5, 0.5,
1.5, 2.5, 3.5, 5, 7, 9.5,
};
0,
};
-static double _vq_quantthresh_res0_1024a_160_9[] = {
+static float _vq_quantthresh_res0_1024a_160_9[] = {
-38.5, -27.5, -19.5, -13.5, -9.5, -7, -5, -3.5,
-2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5, 5,
7, 9.5, 13.5, 19.5, 27.5, 38.5,
11,
};
-static double _vq_quantthresh_res0_1024a_192_1[] = {
+static float _vq_quantthresh_res0_1024a_192_1[] = {
-0.5, 0.5,
};
14,
};
-static double _vq_quantthresh_res0_1024a_192_2[] = {
+static float _vq_quantthresh_res0_1024a_192_2[] = {
-1.5, -0.5, 0.5, 1.5,
};
19,
};
-static double _vq_quantthresh_res0_1024a_192_3[] = {
+static float _vq_quantthresh_res0_1024a_192_3[] = {
-2.5, -1.5, -0.5, 0.5, 1.5, 2.5,
};
11,
};
-static double _vq_quantthresh_res0_1024a_192_4[] = {
+static float _vq_quantthresh_res0_1024a_192_4[] = {
-3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5,
};
0,
};
-static double _vq_quantthresh_res0_1024a_192_5[] = {
+static float _vq_quantthresh_res0_1024a_192_5[] = {
-38.5, -27.5, -19.5, -13.5, -9.5, -7, -5, -3.5,
-2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5, 5,
7, 9.5, 13.5, 19.5, 27.5, 38.5,
16,
};
-static double _vq_quantthresh_res0_1024a_256_1[] = {
+static float _vq_quantthresh_res0_1024a_256_1[] = {
-1.5, -0.5, 0.5, 1.5,
};
10,10,11,11, 9,10,10,11,11,
};
-static double _vq_quantthresh_res0_1024a_256_2[] = {
+static float _vq_quantthresh_res0_1024a_256_2[] = {
-5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5,
3.5, 5,
};
12,
};
-static double _vq_quantthresh_res0_1024a_256_3[] = {
+static float _vq_quantthresh_res0_1024a_256_3[] = {
-9.5, -7, -5, -3.5, -2.5, -1.5, -0.5, 0.5,
1.5, 2.5, 3.5, 5, 7, 9.5,
};
12,13,14,14,14,14,14,15,17,
};
-static double _vq_quantthresh_res0_1024a_256_4[] = {
+static float _vq_quantthresh_res0_1024a_256_4[] = {
-19.5, -13.5, -9.5, -7, -5, -3.5, -2.5, -1.5,
-0.5, 0.5, 1.5, 2.5, 3.5, 5, 7, 9.5,
13.5, 19.5,
15, 0, 0, 0,16,16, 0,16,16,
};
-static double _vq_quantthresh_res0_1024a_256_5[] = {
+static float _vq_quantthresh_res0_1024a_256_5[] = {
-75.5, -54, -38.5, -27.5, -19.5, -13.5, -9.5, -7,
-5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5,
3.5, 5, 7, 9.5, 13.5, 19.5, 27.5, 38.5,
14,
};
-static double _vq_quantthresh_res0_1024a_350_1[] = {
+static float _vq_quantthresh_res0_1024a_350_1[] = {
-1.5, -0.5, 0.5, 1.5,
};
9, 9, 9,10, 8, 9, 9, 9,10,
};
-static double _vq_quantthresh_res0_1024a_350_2[] = {
+static float _vq_quantthresh_res0_1024a_350_2[] = {
-5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5,
3.5, 5,
};
12,
};
-static double _vq_quantthresh_res0_1024a_350_3[] = {
+static float _vq_quantthresh_res0_1024a_350_3[] = {
-9.5, -7, -5, -3.5, -2.5, -1.5, -0.5, 0.5,
1.5, 2.5, 3.5, 5, 7, 9.5,
};
11,12,12,12,12,13,13,13,15,
};
-static double _vq_quantthresh_res0_1024a_350_4[] = {
+static float _vq_quantthresh_res0_1024a_350_4[] = {
-19.5, -13.5, -9.5, -7, -5, -3.5, -2.5, -1.5,
-0.5, 0.5, 1.5, 2.5, 3.5, 5, 7, 9.5,
13.5, 19.5,
13,13,14,14,15,15,16,16,12,
};
-static double _vq_quantthresh_res0_1024a_350_5[] = {
+static float _vq_quantthresh_res0_1024a_350_5[] = {
-75.5, -54, -38.5, -27.5, -19.5, -13.5, -9.5, -7,
-5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5,
3.5, 5, 7, 9.5, 13.5, 19.5, 27.5, 38.5,
12,
};
-static double _vq_quantthresh_res0_128a_128_1[] = {
+static float _vq_quantthresh_res0_128a_128_1[] = {
-0.5, 0.5,
};
0,
};
-static double _vq_quantthresh_res0_128a_128_2[] = {
+static float _vq_quantthresh_res0_128a_128_2[] = {
-1.5, -0.5, 0.5, 1.5,
};
0,
};
-static double _vq_quantthresh_res0_128a_128_3[] = {
+static float _vq_quantthresh_res0_128a_128_3[] = {
-2.5, -1.5, -0.5, 0.5, 1.5, 2.5,
};
14,
};
-static double _vq_quantthresh_res0_128a_128_4[] = {
+static float _vq_quantthresh_res0_128a_128_4[] = {
-3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5,
};
0,
};
-static double _vq_quantthresh_res0_128a_128_5[] = {
+static float _vq_quantthresh_res0_128a_128_5[] = {
-38.5, -27.5, -19.5, -13.5, -9.5, -7, -5, -3.5,
-2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5, 5,
7, 9.5, 13.5, 19.5, 27.5, 38.5,
9,
};
-static double _vq_quantthresh_res0_128a_160_1[] = {
+static float _vq_quantthresh_res0_128a_160_1[] = {
-0.5, 0.5,
};
17,
};
-static double _vq_quantthresh_res0_128a_160_2[] = {
+static float _vq_quantthresh_res0_128a_160_2[] = {
-1.5, -0.5, 0.5, 1.5,
};
0,
};
-static double _vq_quantthresh_res0_128a_160_3[] = {
+static float _vq_quantthresh_res0_128a_160_3[] = {
-2.5, -1.5, -0.5, 0.5, 1.5, 2.5,
};
13,
};
-static double _vq_quantthresh_res0_128a_160_4[] = {
+static float _vq_quantthresh_res0_128a_160_4[] = {
-3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5,
};
0,
};
-static double _vq_quantthresh_res0_128a_160_5[] = {
+static float _vq_quantthresh_res0_128a_160_5[] = {
-38.5, -27.5, -19.5, -13.5, -9.5, -7, -5, -3.5,
-2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5, 5,
7, 9.5, 13.5, 19.5, 27.5, 38.5,
8,
};
-static double _vq_quantthresh_res0_128a_192_1[] = {
+static float _vq_quantthresh_res0_128a_192_1[] = {
-0.5, 0.5,
};
16,
};
-static double _vq_quantthresh_res0_128a_192_2[] = {
+static float _vq_quantthresh_res0_128a_192_2[] = {
-1.5, -0.5, 0.5, 1.5,
};
0,
};
-static double _vq_quantthresh_res0_128a_192_3[] = {
+static float _vq_quantthresh_res0_128a_192_3[] = {
-2.5, -1.5, -0.5, 0.5, 1.5, 2.5,
};
12,
};
-static double _vq_quantthresh_res0_128a_192_4[] = {
+static float _vq_quantthresh_res0_128a_192_4[] = {
-3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5,
};
0,
};
-static double _vq_quantthresh_res0_128a_192_5[] = {
+static float _vq_quantthresh_res0_128a_192_5[] = {
-38.5, -27.5, -19.5, -13.5, -9.5, -7, -5, -3.5,
-2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5, 5,
7, 9.5, 13.5, 19.5, 27.5, 38.5,
14,
};
-static double _vq_quantthresh_res0_128a_256_1[] = {
+static float _vq_quantthresh_res0_128a_256_1[] = {
-1.5, -0.5, 0.5, 1.5,
};
11,11,11,12,10,11,11,11,12,
};
-static double _vq_quantthresh_res0_128a_256_2[] = {
+static float _vq_quantthresh_res0_128a_256_2[] = {
-5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5,
3.5, 5,
};
10,
};
-static double _vq_quantthresh_res0_128a_256_3[] = {
+static float _vq_quantthresh_res0_128a_256_3[] = {
-9.5, -7, -5, -3.5, -2.5, -1.5, -0.5, 0.5,
1.5, 2.5, 3.5, 5, 7, 9.5,
};
12,13,13,12,12,12,13,13,16,
};
-static double _vq_quantthresh_res0_128a_256_4[] = {
+static float _vq_quantthresh_res0_128a_256_4[] = {
-19.5, -13.5, -9.5, -7, -5, -3.5, -2.5, -1.5,
-0.5, 0.5, 1.5, 2.5, 3.5, 5, 7, 9.5,
13.5, 19.5,
14, 0, 0, 0, 0, 0, 0, 0, 0,
};
-static double _vq_quantthresh_res0_128a_256_5[] = {
+static float _vq_quantthresh_res0_128a_256_5[] = {
-75.5, -54, -38.5, -27.5, -19.5, -13.5, -9.5, -7,
-5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5,
3.5, 5, 7, 9.5, 13.5, 19.5, 27.5, 38.5,
0,
};
-static double _vq_quantthresh_res0_128a_350_1[] = {
+static float _vq_quantthresh_res0_128a_350_1[] = {
-1.5, -0.5, 0.5, 1.5,
};
9, 9, 9, 9, 8, 8, 9, 8, 9,
};
-static double _vq_quantthresh_res0_128a_350_2[] = {
+static float _vq_quantthresh_res0_128a_350_2[] = {
-5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5,
3.5, 5,
};
10,
};
-static double _vq_quantthresh_res0_128a_350_3[] = {
+static float _vq_quantthresh_res0_128a_350_3[] = {
-9.5, -7, -5, -3.5, -2.5, -1.5, -0.5, 0.5,
1.5, 2.5, 3.5, 5, 7, 9.5,
};
12,12,12,12,12,12,12,12,13,
};
-static double _vq_quantthresh_res0_128a_350_4[] = {
+static float _vq_quantthresh_res0_128a_350_4[] = {
-19.5, -13.5, -9.5, -7, -5, -3.5, -2.5, -1.5,
-0.5, 0.5, 1.5, 2.5, 3.5, 5, 7, 9.5,
13.5, 19.5,
16,15,15,14,17,16, 0, 0, 0,
};
-static double _vq_quantthresh_res0_128a_350_5[] = {
+static float _vq_quantthresh_res0_128a_350_5[] = {
-75.5, -54, -38.5, -27.5, -19.5, -13.5, -9.5, -7,
-5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5,
3.5, 5, 7, 9.5, 13.5, 19.5, 27.5, 38.5,
********************************************************************
function: codebook types
- last mod: $Id: codebook.h,v 1.6 2000/07/17 12:55:35 xiphmont Exp $
+ last mod: $Id: codebook.h,v 1.7 2000/10/12 03:12:41 xiphmont Exp $
********************************************************************/
/* assumes a maptype of 1; encode side only, so that's OK */
typedef struct encode_aux_threshmatch{
- double *quantthresh;
+ float *quantthresh;
long *quantmap;
int quantvals;
int threshvals;
} encode_aux_threshmatch;
typedef struct encode_aux_pigeonhole{
- double min;
- double del;
+ float min;
+ float del;
int mapentries;
int quantvals;
} encode_aux_pigeonhole;
typedef struct decode_aux{
+ long *tab;
+ int *tabl;
+ int tabn;
+
long *ptr0;
long *ptr1;
long aux; /* number of tree entries */
long entries; /* codebook entries */
const static_codebook *c;
- double *valuelist; /* list of dim*entries actual entry values */
+ float *valuelist; /* list of dim*entries actual entry values */
long *codelist; /* list of bitstream codewords for each entry */
struct decode_aux *decode_tree;
********************************************************************
function: libvorbis codec headers
- last mod: $Id: codec.h,v 1.29 2000/08/30 07:09:46 xiphmont Exp $
+ last mod: $Id: codec.h,v 1.30 2000/10/12 03:12:41 xiphmont Exp $
********************************************************************/
#define MAX_BARK 27
-#include "os_types.h"
+#include <ogg/ogg.h>
#include "vorbis/codebook.h"
-#include "vorbis/internal.h"
typedef void vorbis_look_transform;
typedef void vorbis_info_time;
int smoothp;
int noisecullp;
- double noisecull_barkwidth;
+ float noisecull_barkwidth;
- double ath_adjatt;
- double ath_maxatt;
+ float ath_adjatt;
+ float ath_maxatt;
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */
/* x: 63 88 125 175 250 350 500 700 1k 1.4k 2k 2.8k 4k 5.6k 8k 11.5k 16k Hz */
/* y: 0 10 20 30 40 50 60 70 80 90 100 dB */
int tonemaskp;
- double toneatt[P_BANDS][P_LEVELS];
+ float toneatt[P_BANDS][P_LEVELS];
int peakattp;
- double peakatt[P_BANDS][P_LEVELS];
+ float peakatt[P_BANDS][P_LEVELS];
int noisemaskp;
- double noiseatt[P_BANDS][P_LEVELS];
+ float noiseatt[P_BANDS][P_LEVELS];
- double max_curve_dB;
+ float max_curve_dB;
/* decay setup */
- double attack_coeff;
- double decay_coeff;
+ float attack_coeff;
+ float decay_coeff;
} vorbis_info_psy;
/* vorbis_info contains all the setup information specific to the
/* for block long/sort tuning; encode only */
int envelopesa;
- double preecho_thresh;
- double preecho_clamp;
- double preecho_minenergy;
+ float preecho_thresh;
+ float preecho_clamp;
+ float preecho_minenergy;
} vorbis_info;
-/* ogg_page is used to encapsulate the data in one Ogg bitstream page *****/
-
-typedef struct {
- unsigned char *header;
- long header_len;
- unsigned char *body;
- long body_len;
-} ogg_page;
-
-/* ogg_stream_state contains the current encode/decode state of a logical
- Ogg bitstream **********************************************************/
-
-typedef struct {
- unsigned char *body_data; /* bytes from packet bodies */
- long body_storage; /* storage elements allocated */
- long body_fill; /* elements stored; fill mark */
- long body_returned; /* elements of fill returned */
-
-
- int *lacing_vals; /* The values that will go to the segment table */
- ogg_int64_t *pcm_vals; /* pcm_pos values for headers. Not compact
- this way, but it is simple coupled to the
- lacing fifo */
- long lacing_storage;
- long lacing_fill;
- long lacing_packet;
- long lacing_returned;
-
- unsigned char header[282]; /* working space for header encode */
- int header_fill;
-
- int e_o_s; /* set when we have buffered the last packet in the
- logical bitstream */
- int b_o_s; /* set after we've written the initial page
- of a logical bitstream */
- long serialno;
- int pageno;
- ogg_int64_t packetno; /* sequence number for decode; the framing
- knows where there's a hole in the data,
- but we need coupling so that the codec
- (which is in a seperate abstraction
- layer) also knows about the gap */
- ogg_int64_t pcmpos;
-
-} ogg_stream_state;
-
-/* ogg_packet is used to encapsulate the data and metadata belonging
- to a single raw Ogg/Vorbis packet *************************************/
-
-typedef struct {
- unsigned char *packet;
- long bytes;
- long b_o_s;
- long e_o_s;
-
- ogg_int64_t frameno;
- ogg_int64_t packetno; /* sequence number for decode; the framing
- knows where there's a hole in the data,
- but we need coupling so that the codec
- (which is in a seperate abstraction
- layer) also knows about the gap */
-
-} ogg_packet;
-
-typedef struct {
- unsigned char *data;
- int storage;
- int fill;
- int returned;
-
- int unsynced;
- int headerbytes;
- int bodybytes;
-} ogg_sync_state;
-
/* vorbis_dsp_state buffers the current vorbis audio
analysis/synthesis state. The DSP state belongs to a specific
logical bitstream ****************************************************/
vorbis_info *vi;
int modebits;
- double **pcm;
- double **pcmret;
+ float **pcm;
+ float **pcmret;
int pcm_storage;
int pcm_current;
int pcm_returned;
long nW;
long centerW;
- ogg_int64_t frameno;
+ ogg_int64_t granulepos;
ogg_int64_t sequence;
ogg_int64_t glue_bits;
/* local lookup storage */
void *ve; /* envelope lookup */
- double **window[2][2][2]; /* block, leadin, leadout, type */
+ float **window[2][2][2]; /* block, leadin, leadout, type */
vorbis_look_transform **transform[2]; /* block, type */
codebook *fullbooks;
/* backend lookups are tied to the mode, not the backend or naked mapping */
typedef struct vorbis_block{
/* necessary stream state for linking to the framing abstraction */
- double **pcm; /* this is a pointer into local storage */
+ float **pcm; /* this is a pointer into local storage */
oggpack_buffer opb;
long lW;
int mode;
int eofflag;
- ogg_int64_t frameno;
+ ogg_int64_t granulepos;
ogg_int64_t sequence;
vorbis_dsp_state *vd; /* For read-only access of configuration */
packetization aren't necessary as they're provided by the transport
and the streaming layer is not used */
-/* OggSquish BITSREAM PRIMITIVES: encoding **************************/
-
-extern int ogg_stream_packetin(ogg_stream_state *os, ogg_packet *op);
-extern int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og);
-extern int ogg_stream_flush(ogg_stream_state *os, ogg_page *og);
-
-/* OggSquish BITSREAM PRIMITIVES: decoding **************************/
-
-extern int ogg_sync_init(ogg_sync_state *oy);
-extern int ogg_sync_clear(ogg_sync_state *oy);
-extern int ogg_sync_destroy(ogg_sync_state *oy);
-extern int ogg_sync_reset(ogg_sync_state *oy);
-
-extern char *ogg_sync_buffer(ogg_sync_state *oy, long size);
-extern int ogg_sync_wrote(ogg_sync_state *oy, long bytes);
-extern long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og);
-extern int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og);
-extern int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og);
-extern int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op);
-
-/* OggSquish BITSREAM PRIMITIVES: general ***************************/
-
-extern int ogg_stream_init(ogg_stream_state *os,int serialno);
-extern int ogg_stream_clear(ogg_stream_state *os);
-extern int ogg_stream_reset(ogg_stream_state *os);
-extern int ogg_stream_destroy(ogg_stream_state *os);
-extern int ogg_stream_eof(ogg_stream_state *os);
-
-extern int ogg_page_version(ogg_page *og);
-extern int ogg_page_continued(ogg_page *og);
-extern int ogg_page_bos(ogg_page *og);
-extern int ogg_page_eos(ogg_page *og);
-extern ogg_int64_t ogg_page_frameno(ogg_page *og);
-extern int ogg_page_serialno(ogg_page *og);
-extern int ogg_page_pageno(ogg_page *og);
-
/* Vorbis PRIMITIVES: general ***************************************/
extern void vorbis_info_init(vorbis_info *vi);
ogg_packet *op,
ogg_packet *op_comm,
ogg_packet *op_code);
-extern double **vorbis_analysis_buffer(vorbis_dsp_state *v,int vals);
+extern float **vorbis_analysis_buffer(vorbis_dsp_state *v,int vals);
extern int vorbis_analysis_wrote(vorbis_dsp_state *v,int vals);
extern int vorbis_analysis_blockout(vorbis_dsp_state *v,vorbis_block *vb);
extern int vorbis_analysis(vorbis_block *vb,ogg_packet *op);
extern int vorbis_synthesis_init(vorbis_dsp_state *v,vorbis_info *vi);
extern int vorbis_synthesis(vorbis_block *vb,ogg_packet *op);
extern int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb);
-extern int vorbis_synthesis_pcmout(vorbis_dsp_state *v,double ***pcm);
+extern int vorbis_synthesis_pcmout(vorbis_dsp_state *v,float ***pcm);
extern int vorbis_synthesis_read(vorbis_dsp_state *v,int samples);
#ifdef __cplusplus
********************************************************************
function: predefined encoding modes
- last mod: $Id: mode_D.h,v 1.4 2000/09/01 07:49:52 msmith Exp $
+ last mod: $Id: mode_D.h,v 1.5 2000/10/12 03:12:41 xiphmont Exp $
********************************************************************/
********************************************************************
function: predefined encoding modes
- last mod: $Id: mode_E.h,v 1.2 2000/09/01 07:49:53 msmith Exp $
+ last mod: $Id: mode_E.h,v 1.3 2000/10/12 03:12:41 xiphmont Exp $
********************************************************************/
+++ /dev/null
-#ifndef _OS_TYPES_H
-#define _OS_TYPES_H
-/********************************************************************
- * *
- * 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: #ifdef jail to whip a few platforms into the UNIX ideal.
- last mod: $Id: os_types.h.in,v 1.3 2000/08/30 07:09:46 xiphmont Exp $
-
- ********************************************************************/
-
-#if defined (_WIN32)
-#if !defined(__GNUC__)
-
-/* MSVC/Borland */
-typedef __int64 ogg_int64_t;
-typedef __int32 ogg_int32_t;
-typedef unsigned __int32 ogg_uint32_t;
-typedef __int16 ogg_int16_t;
-
-#else
-
-/* Cygwin */
-#include <_G_config.h>
-typedef _G_int64_t ogg_int64_t;
-typedef _G_int32_t ogg_int32_t;
-typedef unsigned _G_int32_t ogg_uint32_t;
-typedef _G_int16_t ogg_int16_t;
-#endif
-#else
-
-#ifdef __BEOS__
-/* Be */
-#include <inttypes.h>
-#endif
-
-#include <sys/types.h>
-
-/* filled in by configure */
-typedef @SIZE16@ ogg_int16_t;
-typedef @SIZE32@ ogg_int32_t;
-typedef @USIZE32@ ogg_uint32_t;
-typedef @SIZE64@ ogg_int64_t;
-
-#endif
-
-#endif
-
********************************************************************
function: stdio-based convenience library for opening/seeking/decoding
- last mod: $Id: vorbisfile.h,v 1.7 2000/08/30 06:09:21 xiphmont Exp $
+ last mod: $Id: vorbisfile.h,v 1.8 2000/10/12 03:12:41 xiphmont Exp $
********************************************************************/
--- /dev/null
+*.la
+*.lo
+.libs
+.deps
+Makefile
+Makefile.in
--- /dev/null
+## Process this file with automake to produce Makefile.in
+
+AUTOMAKE_OPTIONS = foreign
+
+INCLUDES = -I$(top_srcdir)/include
+
+lib_LTLIBRARIES = libvorbis.la libvorbisfile.la
+
+libvorbis_la_SOURCES = mdct.c smallft.c block.c envelope.c window.c lsp.c lpc.c\
+ analysis.c synthesis.c psy.c info.c time0.c floor0.c\
+ res0.c mapping0.c registry.c codebook.c sharedbook.c\
+ iir.c\
+ envelope.h lpc.h lsp.h bookinternal.h misc.h psy.h\
+ masking.h sharedbook.h iir.h os.h
+libvorbis_la_LDFLAGS = -version-info @V_LIB_CURRENT@:@V_LIB_REVISION@:@V_LIB_AGE@
+
+libvorbisfile_la_SOURCES = vorbisfile.c
+libvorbisfile_la_LDFLAGS = -version-info @VF_LIB_CURRENT@:@VF_LIB_REVISION@:@VF_LIB_AGE@
+
+debug:
+ $(MAKE) all CFLAGS="@DEBUG@"
+
+profile:
+ $(MAKE) all CFLAGS="@PROFILE@"
-# vorbis makefile configured for use with gcc on any platform
-# $Id: Makefile.in,v 1.34 2000/08/30 06:09:21 xiphmont Exp $
-
-###############################################################################
-# #
-# To build a production vorbis (preferrably using gmake), just type 'make'. #
-# To build with debugging or profiling information, use 'make debug' or #
-# 'make profile' respectively. 'make clean' is a good idea between builds #
-# with different target names, or before a final build. #
-# #
-###############################################################################
-
-
-# DO NOT EDIT BELOW! ##########################################################
-# (unless, of course, you know what you are doing :) ##########################
-
-@SET_MAKE@
-FLAGS=-I. -I../include @CFLAGS@
-OPT=@OPT@ $(FLAGS)
-DEBUG=@DEBUG@ $(FLAGS)
-PROFILE=@PROFILE@ $(FLAGS)
-CC=@CC@
-LD=@CC@
-LDFLAGS=@LDFLAGS@ $(FLAGS)
-AR=@AR@
-RANLIB=@RANLIB@
-LIBS=@LIBS@
-
-HFILES = ../include/vorbis/codec.h \
- ../include/vorbis/internal.h ../include/vorbis/backends.h \
- ../include/vorbis/codebook.h \
- bitwise.h envelope.h lpc.h lsp.h bookinternal.h misc.h\
- psy.h smallft.h window.h scales.h os.h mdct.h registry.h\
- masking.h sharedbook.h iir.h
-LFILES = framing.o mdct.o smallft.o block.o envelope.o window.o\
- lsp.o lpc.o analysis.o synthesis.o psy.o info.o bitwise.o\
- time0.o floor0.o res0.o mapping0.o registry.o\
- codebook.o sharedbook.o iir.o
-VF_HFILES = ../include/vorbis/vorbisfile.h ../include/vorbis/codec.h \
- ../include/vorbis/internal.h ../include/vorbis/codebook.h \
- os.h misc.h
-VF_LFILES = vorbisfile.o
-
-PSY_FILES = mdct.o psy.o lpc.o smallft.o window.o psytune.o floor0.o \
- bitwise.o lsp.o codebook.o sharedbook.o
-
-all:
- $(MAKE) target CFLAGS="$(OPT)"
-
-debug:
- $(MAKE) target CFLAGS="$(DEBUG)"
-
-analysis:
- $(MAKE) target CFLAGS="$(DEBUG) -DANALYSIS"
-
-profile:
- $(MAKE) target CFLAGS="$(PROFILE)"
-
-target: libvorbis.a vorbisfile.a psytune
-
-selftest:
- $(MAKE) clean
- $(CC) $(DEBUG) $(LDFLAGS) -D_V_SELFTEST framing.c -o test_framing
- $(CC) $(DEBUG) $(LDFLAGS) -D_V_SELFTEST bitwise.c\
- -o test_bitwise $(LIBS)
- $(CC) $(DEBUG) $(LDFLAGS) -c bitwise.c
- $(CC) $(DEBUG) $(LDFLAGS) -D_V_SELFTEST sharedbook.c\
- -o test_sharedbook $(LIBS)
- $(CC) $(DEBUG) $(LDFLAGS) -c sharedbook.c
- $(CC) $(DEBUG) $(LDFLAGS) -D_V_SELFTEST codebook.c \
- sharedbook.o bitwise.o -o test_codebook $(LIBS)
- @echo
- @./test_framing
- @./test_bitwise
- @./test_sharedbook
- @./test_codebook
-
-libvorbis.a: $(LFILES)
- $(AR) -r libvorbis.a $(LFILES)
- $(RANLIB) libvorbis.a
-
-vorbisfile.a: $(VF_LFILES)
- $(AR) -r vorbisfile.a $(VF_LFILES)
- $(RANLIB) vorbisfile.a
-
-psytune: $(PSY_FILES)
- $(CC) $(CFLAGS) $(LDFLAGS) $(PSY_FILES) -o $@ $(LIBS)
-
-$(LFILES): $(HFILES)
-$(VF_LFILES): $(VF_HFILES)
-
-.c.o:
- $(CC) $(CFLAGS) -c $<
-
-clean:
- -rm -f *.o *.a test* *~ *.out ogg config.* tone psytune
-
-distclean: clean
- -rm -f Makefile
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_alias = @host_alias@
+host_triplet = @host@
+AS = @AS@
+CC = @CC@
+DEBUG = @DEBUG@
+DLLTOOL = @DLLTOOL@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+MAKEINFO = @MAKEINFO@
+OBJDUMP = @OBJDUMP@
+PACKAGE = @PACKAGE@
+PROFILE = @PROFILE@
+RANLIB = @RANLIB@
+VERSION = @VERSION@
+VF_LIB_AGE = @VF_LIB_AGE@
+VF_LIB_CURRENT = @VF_LIB_CURRENT@
+VF_LIB_REVISION = @VF_LIB_REVISION@
+V_LIB_AGE = @V_LIB_AGE@
+V_LIB_CURRENT = @V_LIB_CURRENT@
+V_LIB_REVISION = @V_LIB_REVISION@
+pthread_lib = @pthread_lib@
+
+AUTOMAKE_OPTIONS = foreign
+
+INCLUDES = -I$(top_srcdir)/include
+
+lib_LTLIBRARIES = libvorbis.la libvorbisfile.la
+
+libvorbis_la_SOURCES = mdct.c smallft.c block.c envelope.c window.c lsp.c lpc.c analysis.c synthesis.c psy.c info.c time0.c floor0.c res0.c mapping0.c registry.c codebook.c sharedbook.c iir.c envelope.h lpc.h lsp.h bookinternal.h misc.h psy.h masking.h sharedbook.h iir.h os.h
+
+libvorbis_la_LDFLAGS = -version-info @V_LIB_CURRENT@:@V_LIB_REVISION@:@V_LIB_AGE@
+
+libvorbisfile_la_SOURCES = vorbisfile.c
+libvorbisfile_la_LDFLAGS = -version-info @VF_LIB_CURRENT@:@VF_LIB_REVISION@:@VF_LIB_AGE@
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(lib_LTLIBRARIES)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir)
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+libvorbis_la_LIBADD =
+libvorbis_la_OBJECTS = mdct.lo smallft.lo block.lo envelope.lo \
+window.lo lsp.lo lpc.lo analysis.lo synthesis.lo psy.lo info.lo \
+time0.lo floor0.lo res0.lo mapping0.lo registry.lo codebook.lo \
+sharedbook.lo iir.lo
+libvorbisfile_la_LIBADD =
+libvorbisfile_la_OBJECTS = vorbisfile.lo
+CFLAGS = @CFLAGS@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+DIST_COMMON = Makefile.am Makefile.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = tar
+GZIP_ENV = --best
+DEP_FILES = .deps/analysis.P .deps/block.P .deps/codebook.P \
+.deps/envelope.P .deps/floor0.P .deps/iir.P .deps/info.P .deps/lpc.P \
+.deps/lsp.P .deps/mapping0.P .deps/mdct.P .deps/psy.P .deps/registry.P \
+.deps/res0.P .deps/sharedbook.P .deps/smallft.P .deps/synthesis.P \
+.deps/time0.P .deps/vorbisfile.P .deps/window.P
+SOURCES = $(libvorbis_la_SOURCES) $(libvorbisfile_la_SOURCES)
+OBJECTS = $(libvorbis_la_OBJECTS) $(libvorbisfile_la_OBJECTS)
+
+all: all-redirect
+.SUFFIXES:
+.SUFFIXES: .S .c .lo .o .s
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+
+mostlyclean-libLTLIBRARIES:
+
+clean-libLTLIBRARIES:
+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+
+distclean-libLTLIBRARIES:
+
+maintainer-clean-libLTLIBRARIES:
+
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(libdir)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \
+ $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \
+ else :; fi; \
+ done
+
+uninstall-libLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
+ done
+
+.s.o:
+ $(COMPILE) -c $<
+
+.S.o:
+ $(COMPILE) -c $<
+
+mostlyclean-compile:
+ -rm -f *.o core *.core
+
+clean-compile:
+
+distclean-compile:
+ -rm -f *.tab.c
+
+maintainer-clean-compile:
+
+.s.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.S.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+
+maintainer-clean-libtool:
+
+libvorbis.la: $(libvorbis_la_OBJECTS) $(libvorbis_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(libvorbis_la_LDFLAGS) $(libvorbis_la_OBJECTS) $(libvorbis_la_LIBADD) $(LIBS)
+
+libvorbisfile.la: $(libvorbisfile_la_OBJECTS) $(libvorbisfile_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(libvorbisfile_la_LDFLAGS) $(libvorbisfile_la_OBJECTS) $(libvorbisfile_la_LIBADD) $(LIBS)
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = lib
+
+distdir: $(DISTFILES)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(top_distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign lib/Makefile
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+
+DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
+
+-include $(DEP_FILES)
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+ -rm -rf .deps
+
+maintainer-clean-depend:
+
+%.o: %.c
+ @echo '$(COMPILE) -c $<'; \
+ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-cp .deps/$(*F).pp .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm .deps/$(*F).pp
+
+%.lo: %.c
+ @echo '$(LTCOMPILE) -c $<'; \
+ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
+ < .deps/$(*F).pp > .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm -f .deps/$(*F).pp
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am: install-libLTLIBRARIES
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am: uninstall-libLTLIBRARIES
+uninstall: uninstall-am
+all-am: Makefile $(LTLIBRARIES)
+all-redirect: all-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(libdir)
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-libLTLIBRARIES mostlyclean-compile \
+ mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
+ mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am: clean-libLTLIBRARIES clean-compile clean-libtool clean-tags \
+ clean-depend clean-generic mostlyclean-am
+
+clean: clean-am
+
+distclean-am: distclean-libLTLIBRARIES distclean-compile \
+ distclean-libtool distclean-tags distclean-depend \
+ distclean-generic clean-am
+ -rm -f libtool
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-libLTLIBRARIES \
+ maintainer-clean-compile maintainer-clean-libtool \
+ maintainer-clean-tags maintainer-clean-depend \
+ maintainer-clean-generic distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+
+.PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \
+clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \
+uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \
+distclean-compile clean-compile maintainer-clean-compile \
+mostlyclean-libtool distclean-libtool clean-libtool \
+maintainer-clean-libtool tags mostlyclean-tags distclean-tags \
+clean-tags maintainer-clean-tags distdir mostlyclean-depend \
+distclean-depend clean-depend maintainer-clean-depend info-am info \
+dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+install-exec install-data-am install-data install-am install \
+uninstall-am uninstall all-redirect all-am all installdirs \
+mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+debug:
+ $(MAKE) all CFLAGS="@DEBUG@"
+
+profile:
+ $(MAKE) all CFLAGS="@PROFILE@"
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
********************************************************************
function: single-block PCM analysis mode dispatch
- last mod: $Id: analysis.c,v 1.33 2000/08/15 09:09:42 xiphmont Exp $
+ last mod: $Id: analysis.c,v 1.34 2000/10/12 03:12:52 xiphmont Exp $
********************************************************************/
#include <stdio.h>
#include <string.h>
#include <math.h>
+#include <ogg/ogg.h>
#include "vorbis/codec.h"
-#include "bitwise.h"
#include "registry.h"
#include "scales.h"
#include "os.h"
vb->res_bits=0;
/* first things first. Make sure encode is ready */
- _oggpack_reset(&vb->opb);
+ oggpack_reset(&vb->opb);
/* Encode the packet type */
- _oggpack_write(&vb->opb,0,1);
+ oggpack_write(&vb->opb,0,1);
/* currently lazy. Short block dispatches to 0, long to 1. */
vb->mode=mode;
/* Encode frame mode, pre,post windowsize, then dispatch */
- _oggpack_write(&vb->opb,mode,vd->modebits);
+ oggpack_write(&vb->opb,mode,vd->modebits);
if(vb->W){
- _oggpack_write(&vb->opb,vb->lW,1);
- _oggpack_write(&vb->opb,vb->nW,1);
- /*fprintf(stderr,"*");
- }else{
- fprintf(stderr,".");*/
- }
+ oggpack_write(&vb->opb,vb->lW,1);
+ oggpack_write(&vb->opb,vb->nW,1);
+ /*fprintf(stderr,"*");*/
+ }/*else{
+ fprintf(stderr,".");
+ }*/
if(_mapping_P[type]->forward(vb,vd->mode[mode]))
return(-1);
/* set up the packet wrapper */
- op->packet=_oggpack_buffer(&vb->opb);
- op->bytes=_oggpack_bytes(&vb->opb);
+ op->packet=oggpack_get_buffer(&vb->opb);
+ op->bytes=oggpack_bytes(&vb->opb);
op->b_o_s=0;
op->e_o_s=vb->eofflag;
- op->frameno=vb->frameno;
+ op->granulepos=vb->granulepos;
op->packetno=vb->sequence; /* for sake of completeness */
return(0);
}
/* there was no great place to put this.... */
-void _analysis_output(char *base,int i,double *v,int n,int bark,int dB){
+void _analysis_output(char *base,int i,float *v,int n,int bark,int dB){
#ifdef ANALYSIS
int j;
FILE *of;
+++ /dev/null
-/********************************************************************
- * *
- * 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: packing variable sized words into an octet stream
- last mod: $Id: bitwise.c,v 1.12 2000/07/07 01:41:43 xiphmont Exp $
-
- ********************************************************************/
-
-/* We're 'LSb' endian; if we write a word but read individual bits,
- then we'll read the lsb first */
-
-#include <string.h>
-#include <stdlib.h>
-#include "bitwise.h"
-#include "misc.h"
-#include "os.h"
-
-#define BUFFER_INCREMENT 256
-
-static unsigned long mask[]=
-{0x00000000,0x00000001,0x00000003,0x00000007,0x0000000f,
- 0x0000001f,0x0000003f,0x0000007f,0x000000ff,0x000001ff,
- 0x000003ff,0x000007ff,0x00000fff,0x00001fff,0x00003fff,
- 0x00007fff,0x0000ffff,0x0001ffff,0x0003ffff,0x0007ffff,
- 0x000fffff,0x001fffff,0x003fffff,0x007fffff,0x00ffffff,
- 0x01ffffff,0x03ffffff,0x07ffffff,0x0fffffff,0x1fffffff,
- 0x3fffffff,0x7fffffff,0xffffffff };
-
-void _oggpack_writeinit(oggpack_buffer *b){
- memset(b,0,sizeof(oggpack_buffer));
- b->ptr=b->buffer=malloc(BUFFER_INCREMENT);
- b->buffer[0]='\0';
- b->storage=BUFFER_INCREMENT;
-}
-
-void _oggpack_reset(oggpack_buffer *b){
- b->ptr=b->buffer;
- b->buffer[0]=0;
- b->endbit=b->endbyte=0;
-}
-
-void _oggpack_writeclear(oggpack_buffer *b){
- free(b->buffer);
- memset(b,0,sizeof(oggpack_buffer));
-}
-
-void _oggpack_readinit(oggpack_buffer *b,unsigned char *buf,int bytes){
- memset(b,0,sizeof(oggpack_buffer));
- b->buffer=b->ptr=buf;
- b->storage=bytes;
-}
-
-/* Takes only up to 32 bits. */
-void _oggpack_write(oggpack_buffer *b,unsigned long value,int bits){
- if(b->endbyte+4>=b->storage){
- b->buffer=realloc(b->buffer,b->storage+BUFFER_INCREMENT);
- b->storage+=BUFFER_INCREMENT;
- b->ptr=b->buffer+b->endbyte;
- }
-
- value&=mask[bits];
- bits+=b->endbit;
-
- b->ptr[0]|=value<<b->endbit;
-
- if(bits>=8){
- b->ptr[1]=value>>(8-b->endbit);
- if(bits>=16){
- b->ptr[2]=value>>(16-b->endbit);
- if(bits>=24){
- b->ptr[3]=value>>(24-b->endbit);
- if(bits>=32){
- if(b->endbit)
- b->ptr[4]=value>>(32-b->endbit);
- else
- b->ptr[4]=0;
- }
- }
- }
- }
-
- b->endbyte+=bits/8;
- b->ptr+=bits/8;
- b->endbit=bits&7;
-}
-
-/* Read in bits without advancing the bitptr; bits <= 32 */
-long _oggpack_look(oggpack_buffer *b,int bits){
- unsigned long ret;
- unsigned long m=mask[bits];
-
- bits+=b->endbit;
-
- if(b->endbyte+4>=b->storage){
- /* not the main path */
- if(b->endbyte+(bits-1)/8>=b->storage)return(-1);
- }
-
- ret=b->ptr[0]>>b->endbit;
- if(bits>8){
- ret|=b->ptr[1]<<(8-b->endbit);
- if(bits>16){
- ret|=b->ptr[2]<<(16-b->endbit);
- if(bits>24){
- ret|=b->ptr[3]<<(24-b->endbit);
- if(bits>32 && b->endbit)
- ret|=b->ptr[4]<<(32-b->endbit);
- }
- }
- }
- return(m&ret);
-}
-
-long _oggpack_look1(oggpack_buffer *b){
- if(b->endbyte>=b->storage)return(-1);
- return((b->ptr[0]>>b->endbit)&1);
-}
-
-void _oggpack_adv(oggpack_buffer *b,int bits){
- bits+=b->endbit;
- b->ptr+=bits/8;
- b->endbyte+=bits/8;
- b->endbit=bits&7;
-}
-
-void _oggpack_adv1(oggpack_buffer *b){
- if(++(b->endbit)>7){
- b->endbit=0;
- b->ptr++;
- b->endbyte++;
- }
-}
-
-/* bits <= 32 */
-long _oggpack_read(oggpack_buffer *b,int bits){
- unsigned long ret;
- unsigned long m=mask[bits];
-
- bits+=b->endbit;
-
- if(b->endbyte+4>=b->storage){
- /* not the main path */
- ret=-1;
- if(b->endbyte+(bits-1)/8>=b->storage)goto overflow;
- }
-
- ret=b->ptr[0]>>b->endbit;
- if(bits>8){
- ret|=b->ptr[1]<<(8-b->endbit);
- if(bits>16){
- ret|=b->ptr[2]<<(16-b->endbit);
- if(bits>24){
- ret|=b->ptr[3]<<(24-b->endbit);
- if(bits>32 && b->endbit){
- ret|=b->ptr[4]<<(32-b->endbit);
- }
- }
- }
- }
- ret&=m;
-
- overflow:
-
- b->ptr+=bits/8;
- b->endbyte+=bits/8;
- b->endbit=bits&7;
- return(ret);
-}
-
-long _oggpack_read1(oggpack_buffer *b){
- unsigned long ret;
-
- if(b->endbyte>=b->storage){
- /* not the main path */
- ret=-1;
- goto overflow;
- }
-
- ret=(b->ptr[0]>>b->endbit)&1;
-
- overflow:
-
- b->endbit++;
- if(b->endbit>7){
- b->endbit=0;
- b->ptr++;
- b->endbyte++;
- }
- return(ret);
-}
-
-long _oggpack_bytes(oggpack_buffer *b){
- return(b->endbyte+(b->endbit+7)/8);
-}
-
-long _oggpack_bits(oggpack_buffer *b){
- return(b->endbyte*8+b->endbit);
-}
-
-unsigned char *_oggpack_buffer(oggpack_buffer *b){
- return(b->buffer);
-}
-
-/* Self test of the bitwise routines; everything else is based on
- them, so they damned well better be solid. */
-
-#ifdef _V_SELFTEST
-#include <stdio.h>
-
-static int ilog(unsigned int v){
- int ret=0;
- while(v){
- ret++;
- v>>=1;
- }
- return(ret);
-}
-
-oggpack_buffer o;
-oggpack_buffer r;
-
-void report(char *in){
- fprintf(stderr,"%s",in);
- exit(1);
-}
-
-void cliptest(unsigned long *b,int vals,int bits,int *comp,int compsize){
- long bytes,i;
- unsigned char *buffer;
-
- _oggpack_reset(&o);
- for(i=0;i<vals;i++)
- _oggpack_write(&o,b[i],bits?bits:ilog(b[i]));
- buffer=_oggpack_buffer(&o);
- bytes=_oggpack_bytes(&o);
- if(bytes!=compsize)report("wrong number of bytes!\n");
- for(i=0;i<bytes;i++)if(buffer[i]!=comp[i]){
- for(i=0;i<bytes;i++)fprintf(stderr,"%x %x\n",(int)buffer[i],(int)comp[i]);
- report("wrote incorrect value!\n");
- }
- _oggpack_readinit(&r,buffer,bytes);
- for(i=0;i<vals;i++){
- int tbit=bits?bits:ilog(b[i]);
- if(_oggpack_look(&r,tbit)==-1)
- report("out of data!\n");
- if(_oggpack_look(&r,tbit)!=(b[i]&mask[tbit]))
- report("looked at incorrect value!\n");
- if(tbit==1)
- if(_oggpack_look1(&r)!=(b[i]&mask[tbit]))
- report("looked at single bit incorrect value!\n");
- if(tbit==1){
- if(_oggpack_read1(&r)!=(b[i]&mask[tbit]))
- report("read incorrect single bit value!\n");
- }else{
- if(_oggpack_read(&r,tbit)!=(b[i]&mask[tbit]))
- report("read incorrect value!\n");
- }
- }
- if(_oggpack_bytes(&r)!=bytes)report("leftover bytes after read!\n");
-}
-
-int main(void){
- unsigned char *buffer;
- long bytes,i;
- static unsigned long testbuffer1[]=
- {18,12,103948,4325,543,76,432,52,3,65,4,56,32,42,34,21,1,23,32,546,456,7,
- 567,56,8,8,55,3,52,342,341,4,265,7,67,86,2199,21,7,1,5,1,4};
- int test1size=43;
-
- static unsigned long testbuffer2[]=
- {216531625L,1237861823,56732452,131,3212421,12325343,34547562,12313212,
- 1233432,534,5,346435231,14436467,7869299,76326614,167548585,
- 85525151,0,12321,1,349528352};
- int test2size=21;
-
- static unsigned long large[]=
- {2136531625L,2137861823,56732452,131,3212421,12325343,34547562,12313212,
- 1233432,534,5,2146435231,14436467,7869299,76326614,167548585,
- 85525151,0,12321,1,2146528352};
-
- static unsigned long testbuffer3[]=
- {1,0,14,0,1,0,12,0,1,0,0,0,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,1,1,1,1,0,0,1,
- 0,1,30,1,1,1,0,0,1,0,0,0,12,0,11,0,1,0,0,1};
- int test3size=56;
-
- int onesize=33;
- static int one[]={146,25,44,151,195,15,153,176,233,131,196,65,85,172,47,40,
- 34,242,223,136,35,222,211,86,171,50,225,135,214,75,172,
- 223,4};
-
- int twosize=6;
- static int two[]={61,255,255,251,231,29};
-
- int threesize=54;
- static int three[]={169,2,232,252,91,132,156,36,89,13,123,176,144,32,254,
- 142,224,85,59,121,144,79,124,23,67,90,90,216,79,23,83,
- 58,135,196,61,55,129,183,54,101,100,170,37,127,126,10,
- 100,52,4,14,18,86,77,1};
-
- int foursize=38;
- static int four[]={18,6,163,252,97,194,104,131,32,1,7,82,137,42,129,11,72,
- 132,60,220,112,8,196,109,64,179,86,9,137,195,208,122,169,
- 28,2,133,0,1};
-
- int fivesize=45;
- static int five[]={169,2,126,139,144,172,30,4,80,72,240,59,130,218,73,62,
- 241,24,210,44,4,20,0,248,116,49,135,100,110,130,181,169,
- 84,75,159,2,1,0,132,192,8,0,0,18,22};
-
- int sixsize=7;
- static int six[]={17,177,170,242,169,19,148};
-
- /* Test read/write together */
- /* Later we test against pregenerated bitstreams */
- _oggpack_writeinit(&o);
-
- fprintf(stderr,"\nSmall preclipped packing: ");
- cliptest(testbuffer1,test1size,0,one,onesize);
- fprintf(stderr,"ok.");
-
- fprintf(stderr,"\nNull bit call: ");
- cliptest(testbuffer3,test3size,0,two,twosize);
- fprintf(stderr,"ok.");
-
- fprintf(stderr,"\nLarge preclipped packing: ");
- cliptest(testbuffer2,test2size,0,three,threesize);
- fprintf(stderr,"ok.");
-
- fprintf(stderr,"\n32 bit preclipped packing: ");
- _oggpack_reset(&o);
- for(i=0;i<test2size;i++)
- _oggpack_write(&o,large[i],32);
- buffer=_oggpack_buffer(&o);
- bytes=_oggpack_bytes(&o);
- _oggpack_readinit(&r,buffer,bytes);
- for(i=0;i<test2size;i++){
- if(_oggpack_look(&r,32)==-1)report("out of data. failed!");
- if(_oggpack_look(&r,32)!=large[i]){
- fprintf(stderr,"%ld != %ld (%lx!=%lx):",_oggpack_look(&r,32),large[i],
- _oggpack_look(&r,32),large[i]);
- report("read incorrect value!\n");
- }
- _oggpack_adv(&r,32);
- }
- if(_oggpack_bytes(&r)!=bytes)report("leftover bytes after read!\n");
- fprintf(stderr,"ok.");
-
- fprintf(stderr,"\nSmall unclipped packing: ");
- cliptest(testbuffer1,test1size,7,four,foursize);
- fprintf(stderr,"ok.");
-
- fprintf(stderr,"\nLarge unclipped packing: ");
- cliptest(testbuffer2,test2size,17,five,fivesize);
- fprintf(stderr,"ok.");
-
- fprintf(stderr,"\nSingle bit unclicpped packing: ");
- cliptest(testbuffer3,test3size,1,six,sixsize);
- fprintf(stderr,"ok.");
-
- fprintf(stderr,"\nTesting read past end: ");
- _oggpack_readinit(&r,"\0\0\0\0\0\0\0\0",8);
- for(i=0;i<64;i++){
- if(_oggpack_read(&r,1)!=0){
- fprintf(stderr,"failed; got -1 prematurely.\n");
- exit(1);
- }
- }
- if(_oggpack_look(&r,1)!=-1 ||
- _oggpack_read(&r,1)!=-1){
- fprintf(stderr,"failed; read past end without -1.\n");
- exit(1);
- }
- _oggpack_readinit(&r,"\0\0\0\0\0\0\0\0",8);
- if(_oggpack_read(&r,30)!=0 || _oggpack_read(&r,16)!=0){
- fprintf(stderr,"failed 2; got -1 prematurely.\n");
- exit(1);
- }
-
- if(_oggpack_look(&r,18)!=0 ||
- _oggpack_look(&r,18)!=0){
- fprintf(stderr,"failed 3; got -1 prematurely.\n");
- exit(1);
- }
- if(_oggpack_look(&r,19)!=-1 ||
- _oggpack_look(&r,19)!=-1){
- fprintf(stderr,"failed; read past end without -1.\n");
- exit(1);
- }
- if(_oggpack_look(&r,32)!=-1 ||
- _oggpack_look(&r,32)!=-1){
- fprintf(stderr,"failed; read past end without -1.\n");
- exit(1);
- }
- fprintf(stderr,"ok.\n\n");
-
-
- return(0);
-}
-#endif
-#undef BUFFER_INCREMENT
+++ /dev/null
-/********************************************************************
- * *
- * 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: packing variable sized words into an octet stream
- last mod: $Id: bitwise.h,v 1.6 2000/07/07 01:41:43 xiphmont Exp $
-
- ********************************************************************/
-
-#ifndef _V_BITW_H_
-#define _V_BITW_H_
-
-#include "vorbis/codec.h"
-
-extern void _oggpack_writeinit(oggpack_buffer *b);
-extern void _oggpack_reset(oggpack_buffer *b);
-extern void _oggpack_writeclear(oggpack_buffer *b);
-extern void _oggpack_readinit(oggpack_buffer *b,unsigned char *buf,int bytes);
-extern void _oggpack_write(oggpack_buffer *b,unsigned long value,int bits);
-extern long _oggpack_look(oggpack_buffer *b,int bits);
-extern long _oggpack_look1(oggpack_buffer *b);
-extern void _oggpack_adv(oggpack_buffer *b,int bits);
-extern void _oggpack_adv1(oggpack_buffer *b);
-extern long _oggpack_read(oggpack_buffer *b,int bits);
-extern long _oggpack_read1(oggpack_buffer *b);
-extern long _oggpack_bytes(oggpack_buffer *b);
-extern long _oggpack_bits(oggpack_buffer *b);
-extern unsigned char *_oggpack_buffer(oggpack_buffer *b);
-
-#endif
********************************************************************
function: PCM data vector blocking, windowing and dis/reassembly
- last mod: $Id: block.c,v 1.38 2000/08/27 07:59:19 msmith Exp $
+ last mod: $Id: block.c,v 1.39 2000/10/12 03:12:52 xiphmont Exp $
Handle windowing, overlap-add, etc of the PCM vectors. This is made
more amusing by Vorbis' current two allowed block sizes.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <ogg/ogg.h>
#include "vorbis/codec.h"
#include "window.h"
#include "envelope.h"
#include "mdct.h"
#include "lpc.h"
-#include "bitwise.h"
#include "registry.h"
#include "sharedbook.h"
#include "bookinternal.h"
vb->localalloc=0;
vb->localstore=NULL;
if(v->analysisp)
- _oggpack_writeinit(&vb->opb);
+ oggpack_writeinit(&vb->opb);
return(0);
}
int vorbis_block_clear(vorbis_block *vb){
if(vb->vd)
if(vb->vd->analysisp)
- _oggpack_writeclear(&vb->opb);
+ oggpack_writeclear(&vb->opb);
_vorbis_block_ripcord(vb);
if(vb->localstore)free(vb->localstore);
mdct_init(v->transform[0][0],vi->blocksizes[0]);
mdct_init(v->transform[1][0],vi->blocksizes[1]);
- v->window[0][0][0]=calloc(VI_WINDOWB,sizeof(double *));
+ v->window[0][0][0]=calloc(VI_WINDOWB,sizeof(float *));
v->window[0][0][1]=v->window[0][0][0];
v->window[0][1][0]=v->window[0][0][0];
v->window[0][1][1]=v->window[0][0][0];
- v->window[1][0][0]=calloc(VI_WINDOWB,sizeof(double *));
- v->window[1][0][1]=calloc(VI_WINDOWB,sizeof(double *));
- v->window[1][1][0]=calloc(VI_WINDOWB,sizeof(double *));
- v->window[1][1][1]=calloc(VI_WINDOWB,sizeof(double *));
+ v->window[1][0][0]=calloc(VI_WINDOWB,sizeof(float *));
+ v->window[1][0][1]=calloc(VI_WINDOWB,sizeof(float *));
+ v->window[1][1][0]=calloc(VI_WINDOWB,sizeof(float *));
+ v->window[1][1][1]=calloc(VI_WINDOWB,sizeof(float *));
for(i=0;i<VI_WINDOWB;i++){
v->window[0][0][0][i]=
v->pcm_storage=8192; /* we'll assume later that we have
a minimum of twice the blocksize of
accumulated samples in analysis */
- v->pcm=malloc(vi->channels*sizeof(double *));
- v->pcmret=malloc(vi->channels*sizeof(double *));
+ v->pcm=malloc(vi->channels*sizeof(float *));
+ v->pcmret=malloc(vi->channels*sizeof(float *));
{
int i;
for(i=0;i<vi->channels;i++)
- v->pcm[i]=calloc(v->pcm_storage,sizeof(double));
+ v->pcm[i]=calloc(v->pcm_storage,sizeof(float));
}
/* all 1 (large block) or 0 (small block) */
}
}
-double **vorbis_analysis_buffer(vorbis_dsp_state *v, int vals){
+float **vorbis_analysis_buffer(vorbis_dsp_state *v, int vals){
int i;
vorbis_info *vi=v->vi;
v->pcm_storage=v->pcm_current+vals*2;
for(i=0;i<vi->channels;i++){
- v->pcm[i]=realloc(v->pcm[i],v->pcm_storage*sizeof(double));
+ v->pcm[i]=realloc(v->pcm[i],v->pcm_storage*sizeof(float));
}
}
static void _preextrapolate_helper(vorbis_dsp_state *v){
int i;
int order=32;
- double *lpc=alloca(order*sizeof(double));
- double *work=alloca(v->pcm_current*sizeof(double));
+ float *lpc=alloca(order*sizeof(float));
+ float *work=alloca(v->pcm_current*sizeof(float));
long j;
v->preextrapolate=1;
if(vals<=0){
int order=32;
int i;
- double *lpc=alloca(order*sizeof(double));
+ float *lpc=alloca(order*sizeof(float));
/* if it wasn't done earlier (very short sample) */
if(!v->preextrapolate)
guarding the overlap, but bulletproof in case that
assumtion goes away). zeroes will do. */
memset(v->pcm[i]+v->eofflag,0,
- (v->pcm_current-v->eofflag)*sizeof(double));
+ (v->pcm_current-v->eofflag)*sizeof(float));
}
}
}
vb->vd=v;
vb->sequence=v->sequence;
- vb->frameno=v->frameno;
+ vb->granulepos=v->granulepos;
vb->pcmend=vi->blocksizes[v->W];
/* copy the vectors; this uses the local storage in vb */
{
- vb->pcm=_vorbis_block_alloc(vb,sizeof(double *)*vi->channels);
+ vb->pcm=_vorbis_block_alloc(vb,sizeof(float *)*vi->channels);
for(i=0;i<vi->channels;i++){
- vb->pcm[i]=_vorbis_block_alloc(vb,vb->pcmend*sizeof(double));
- memcpy(vb->pcm[i],v->pcm[i]+beginW,vi->blocksizes[v->W]*sizeof(double));
+ vb->pcm[i]=_vorbis_block_alloc(vb,vb->pcmend*sizeof(float));
+ memcpy(vb->pcm[i],v->pcm[i]+beginW,vi->blocksizes[v->W]*sizeof(float));
}
}
for(i=0;i<vi->channels;i++)
memmove(v->pcm[i],v->pcm[i]+movementW,
- v->pcm_current*sizeof(double));
+ v->pcm_current*sizeof(float));
v->lW=v->W;
v->eofflag-=movementW;
/* do not add padding to end of stream! */
if(v->centerW>=v->eofflag){
- v->frameno+=movementW-(v->centerW-v->eofflag);
+ v->granulepos+=movementW-(v->centerW-v->eofflag);
}else{
- v->frameno+=movementW;
+ v->granulepos+=movementW;
}
}else{
- v->frameno+=movementW;
+ v->granulepos+=movementW;
}
}
/* Adjust centerW to allow an easier mechanism for determining output */
v->pcm_returned=v->centerW;
v->centerW-= vi->blocksizes[v->W]/4+vi->blocksizes[v->lW]/4;
- v->frameno=-1;
+ v->granulepos=-1;
v->sequence=-1;
return(0);
}
-/* Unike in analysis, the window is only partially applied for each
+/* Unlike in analysis, the window is only partially applied for each
block. The time domain envelope is not yet handled at the point of
calling (as it relies on the previous block). */
int i;
for(i=0;i<vi->channels;i++)
memmove(v->pcm[i],v->pcm[i]+shiftPCM,
- v->pcm_current*sizeof(double));
+ v->pcm_current*sizeof(float));
}
}
v->floor_bits+=vb->floor_bits;
v->res_bits+=vb->res_bits;
- if(v->sequence+1 != vb->sequence)v->frameno=-1; /* out of sequence;
+ if(v->sequence+1 != vb->sequence)v->granulepos=-1; /* out of sequence;
lose count */
v->sequence=vb->sequence;
v->pcm_storage=endW+vi->blocksizes[1];
for(i=0;i<vi->channels;i++)
- v->pcm[i]=realloc(v->pcm[i],v->pcm_storage*sizeof(double));
+ v->pcm[i]=realloc(v->pcm[i],v->pcm_storage*sizeof(float));
}
/* overlap/add PCM */
}
for(j=0;j<vi->channels;j++){
- double *pcm=v->pcm[j]+beginW;
-
+ float *pcm=v->pcm[j]+beginW;
+ float *p=vb->pcm[j];
+
/* the overlap/add section */
for(i=beginSl;i<endSl;i++)
- pcm[i]+=vb->pcm[j][i];
+ pcm[i]+=p[i];
/* the remaining section */
for(;i<sizeW;i++)
- pcm[i]=vb->pcm[j][i];
+ pcm[i]=p[i];
}
/* track the frame number... This is for convenience, but also
making sure our last packet doesn't end with added padding. If
the last packet is partial, the number of samples we'll have to
- return will be past the vb->frameno.
+ return will be past the vb->granulepos.
This is not foolproof! It will be confused if we begin
decoding at the last page after a seek or hole. In that case,
is. For this reason, vorbisfile will always try to make sure
it reads the last two marked pages in proper sequence */
- if(v->frameno==-1)
- v->frameno=vb->frameno;
+ if(v->granulepos==-1)
+ v->granulepos=vb->granulepos;
else{
- v->frameno+=(centerW-v->centerW);
- if(vb->frameno!=-1 && v->frameno!=vb->frameno){
- if(v->frameno>vb->frameno && vb->eofflag){
+ v->granulepos+=(centerW-v->centerW);
+ if(vb->granulepos!=-1 && v->granulepos!=vb->granulepos){
+ if(v->granulepos>vb->granulepos && vb->eofflag){
/* partial last frame. Strip the padding off */
- centerW-=(v->frameno-vb->frameno);
+ centerW-=(v->granulepos-vb->granulepos);
}/* else{ Shouldn't happen *unless* the bitstream is out of
spec. Either way, believe the bitstream } */
- v->frameno=vb->frameno;
+ v->granulepos=vb->granulepos;
}
}
}
/* pcm==NULL indicates we just want the pending samples, no more */
-int vorbis_synthesis_pcmout(vorbis_dsp_state *v,double ***pcm){
+int vorbis_synthesis_pcmout(vorbis_dsp_state *v,float ***pcm){
vorbis_info *vi=v->vi;
if(v->pcm_returned<v->centerW){
if(pcm){
********************************************************************
function: basic codebook pack/unpack/code/decode operations
- last mod: $Id: bookinternal.h,v 1.8 2000/06/14 01:38:31 xiphmont Exp $
+ last mod: $Id: bookinternal.h,v 1.9 2000/10/12 03:12:52 xiphmont Exp $
********************************************************************/
#ifndef _V_INT_CODEBOOK_H_
#define _V_INT_CODEBOOK_H_
+#include <ogg/ogg.h>
#include "vorbis/codebook.h"
-#include "bitwise.h"
extern int vorbis_staticbook_pack(const static_codebook *c,oggpack_buffer *b);
extern int vorbis_staticbook_unpack(oggpack_buffer *b,static_codebook *c);
extern int vorbis_book_encode(codebook *book, int a, oggpack_buffer *b);
-extern int vorbis_book_errorv(codebook *book, double *a);
-extern int vorbis_book_encodev(codebook *book, int best,double *a,
+extern int vorbis_book_errorv(codebook *book, float *a);
+extern int vorbis_book_encodev(codebook *book, int best,float *a,
oggpack_buffer *b);
-extern int vorbis_book_encodevs(codebook *book, double *a, oggpack_buffer *b,
+extern int vorbis_book_encodevs(codebook *book, float *a, oggpack_buffer *b,
int step,int stagetype);
extern long vorbis_book_decode(codebook *book, oggpack_buffer *b);
-extern long vorbis_book_decodevs(codebook *book, double *a, oggpack_buffer *b,
+extern long vorbis_book_decodevs(codebook *book, float *a, oggpack_buffer *b,
int step,int stagetype);
+extern long s_vorbis_book_decodevs(codebook *book, float *a, oggpack_buffer *b,
+ int step,int stagetype);
#endif
********************************************************************
function: basic codebook pack/unpack/code/decode operations
- last mod: $Id: codebook.c,v 1.17 2000/07/07 01:37:00 xiphmont Exp $
+ last mod: $Id: codebook.c,v 1.18 2000/10/12 03:12:52 xiphmont Exp $
********************************************************************/
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#include <ogg/ogg.h>
#include "vorbis/codec.h"
#include "vorbis/codebook.h"
-#include "bitwise.h"
#include "scales.h"
#include "sharedbook.h"
#include "bookinternal.h"
int ordered=0;
/* first the basic parameters */
- _oggpack_write(opb,0x564342,24);
- _oggpack_write(opb,c->dim,16);
- _oggpack_write(opb,c->entries,24);
+ oggpack_write(opb,0x564342,24);
+ oggpack_write(opb,c->dim,16);
+ oggpack_write(opb,c->entries,24);
/* pack the codewords. There are two packings; length ordered and
length random. Decide between the two now. */
deterministically */
long count=0;
- _oggpack_write(opb,1,1); /* ordered */
- _oggpack_write(opb,c->lengthlist[0]-1,5); /* 1 to 32 */
+ oggpack_write(opb,1,1); /* ordered */
+ oggpack_write(opb,c->lengthlist[0]-1,5); /* 1 to 32 */
for(i=1;i<c->entries;i++){
long this=c->lengthlist[i];
long last=c->lengthlist[i-1];
if(this>last){
for(j=last;j<this;j++){
- _oggpack_write(opb,i-count,_ilog(c->entries-count));
+ oggpack_write(opb,i-count,_ilog(c->entries-count));
count=i;
}
}
}
- _oggpack_write(opb,i-count,_ilog(c->entries-count));
+ oggpack_write(opb,i-count,_ilog(c->entries-count));
}else{
/* length random. Again, we don't code the codeword itself, just
the length. This time, though, we have to encode each length */
- _oggpack_write(opb,0,1); /* unordered */
+ oggpack_write(opb,0,1); /* unordered */
/* algortihmic mapping has use for 'unused entries', which we tag
here. The algorithmic mapping happens as usual, but the unused
if(c->lengthlist[i]==0)break;
if(i==c->entries){
- _oggpack_write(opb,0,1); /* no unused entries */
+ oggpack_write(opb,0,1); /* no unused entries */
for(i=0;i<c->entries;i++)
- _oggpack_write(opb,c->lengthlist[i]-1,5);
+ oggpack_write(opb,c->lengthlist[i]-1,5);
}else{
- _oggpack_write(opb,1,1); /* we have unused entries; thus we tag */
+ oggpack_write(opb,1,1); /* we have unused entries; thus we tag */
for(i=0;i<c->entries;i++){
if(c->lengthlist[i]==0){
- _oggpack_write(opb,0,1);
+ oggpack_write(opb,0,1);
}else{
- _oggpack_write(opb,1,1);
- _oggpack_write(opb,c->lengthlist[i]-1,5);
+ oggpack_write(opb,1,1);
+ oggpack_write(opb,c->lengthlist[i]-1,5);
}
}
}
/* is the entry number the desired return value, or do we have a
mapping? If we have a mapping, what type? */
- _oggpack_write(opb,c->maptype,4);
+ oggpack_write(opb,c->maptype,4);
switch(c->maptype){
case 0:
/* no mapping */
}
/* values that define the dequantization */
- _oggpack_write(opb,c->q_min,32);
- _oggpack_write(opb,c->q_delta,32);
- _oggpack_write(opb,c->q_quant-1,4);
- _oggpack_write(opb,c->q_sequencep,1);
+ oggpack_write(opb,c->q_min,32);
+ oggpack_write(opb,c->q_delta,32);
+ oggpack_write(opb,c->q_quant-1,4);
+ oggpack_write(opb,c->q_sequencep,1);
{
int quantvals;
/* quantized values */
for(i=0;i<quantvals;i++)
- _oggpack_write(opb,labs(c->quantlist[i]),c->q_quant);
+ oggpack_write(opb,labs(c->quantlist[i]),c->q_quant);
}
break;
memset(s,0,sizeof(static_codebook));
/* make sure alignment is correct */
- if(_oggpack_read(opb,24)!=0x564342)goto _eofout;
+ if(oggpack_read(opb,24)!=0x564342)goto _eofout;
/* first the basic parameters */
- s->dim=_oggpack_read(opb,16);
- s->entries=_oggpack_read(opb,24);
+ s->dim=oggpack_read(opb,16);
+ s->entries=oggpack_read(opb,24);
if(s->entries==-1)goto _eofout;
/* codeword ordering.... length ordered or unordered? */
- switch(_oggpack_read(opb,1)){
+ switch(oggpack_read(opb,1)){
case 0:
/* unordered */
s->lengthlist=malloc(sizeof(long)*s->entries);
/* allocated but unused entries? */
- if(_oggpack_read(opb,1)){
+ if(oggpack_read(opb,1)){
/* yes, unused entries */
for(i=0;i<s->entries;i++){
- if(_oggpack_read(opb,1)){
- long num=_oggpack_read(opb,5);
+ if(oggpack_read(opb,1)){
+ long num=oggpack_read(opb,5);
if(num==-1)goto _eofout;
s->lengthlist[i]=num+1;
}else
}else{
/* all entries used; no tagging */
for(i=0;i<s->entries;i++){
- long num=_oggpack_read(opb,5);
+ long num=oggpack_read(opb,5);
if(num==-1)goto _eofout;
s->lengthlist[i]=num+1;
}
case 1:
/* ordered */
{
- long length=_oggpack_read(opb,5)+1;
+ long length=oggpack_read(opb,5)+1;
s->lengthlist=malloc(sizeof(long)*s->entries);
for(i=0;i<s->entries;){
- long num=_oggpack_read(opb,_ilog(s->entries-i));
+ long num=oggpack_read(opb,_ilog(s->entries-i));
if(num==-1)goto _eofout;
for(j=0;j<num;j++,i++)
s->lengthlist[i]=length;
}
/* Do we have a mapping to unpack? */
- switch((s->maptype=_oggpack_read(opb,4))){
+ switch((s->maptype=oggpack_read(opb,4))){
case 0:
/* no mapping */
break;
/* implicitly populated value mapping */
/* explicitly populated value mapping */
- s->q_min=_oggpack_read(opb,32);
- s->q_delta=_oggpack_read(opb,32);
- s->q_quant=_oggpack_read(opb,4)+1;
- s->q_sequencep=_oggpack_read(opb,1);
+ s->q_min=oggpack_read(opb,32);
+ s->q_delta=oggpack_read(opb,32);
+ s->q_quant=oggpack_read(opb,4)+1;
+ s->q_sequencep=oggpack_read(opb,1);
{
int quantvals;
}
/* quantized values */
- s->quantlist=malloc(sizeof(double)*quantvals);
+ s->quantlist=malloc(sizeof(float)*quantvals);
for(i=0;i<quantvals;i++)
- s->quantlist[i]=_oggpack_read(opb,s->q_quant);
+ s->quantlist[i]=oggpack_read(opb,s->q_quant);
if(s->quantlist[quantvals-1]==-1)goto _eofout;
}
/* returns the number of bits ************************************************/
int vorbis_book_encode(codebook *book, int a, oggpack_buffer *b){
- _oggpack_write(b,book->codelist[a],book->c->lengthlist[a]);
+ oggpack_write(b,book->codelist[a],book->c->lengthlist[a]);
return(book->c->lengthlist[a]);
}
Residue0 encoding interleaves, uses multiple stages, and each stage
peels of a specific amount of resolution from a lattice (thus we want
-to match by threshhold, not nearest match). Residue doesn't *have* to
+to match by threshold, not nearest match). Residue doesn't *have* to
be encoded that way, but to change it, one will need to add more
infrastructure on the encode side (decode side is specced and simpler) */
/* floor0 LSP (single stage, non interleaved, nearest match) */
/* returns entry number and *modifies a* to the quantization value *****/
-int vorbis_book_errorv(codebook *book,double *a){
+int vorbis_book_errorv(codebook *book,float *a){
int dim=book->dim,k;
int best=_best(book,a,1);
for(k=0;k<dim;k++)
}
/* returns the number of bits and *modifies a* to the quantization value *****/
-int vorbis_book_encodev(codebook *book,int best,double *a,oggpack_buffer *b){
+int vorbis_book_encodev(codebook *book,int best,float *a,oggpack_buffer *b){
int k,dim=book->dim;
for(k=0;k<dim;k++)
a[k]=(book->valuelist+best*dim)[k];
/* res0 (multistage, interleave, lattice) */
/* returns the number of bits and *modifies a* to the remainder value ********/
-int vorbis_book_encodevs(codebook *book,double *a,oggpack_buffer *b,
+int vorbis_book_encodevs(codebook *book,float *a,oggpack_buffer *b,
int step,int addmul){
int best=vorbis_book_besterror(book,a,step,addmul);
Cascades may be additive or multiplicitive; this is not inherent in
the codebook, but set in the code using the codebook. Like
interleaving, it's easiest to do it here.
- stage==0 -> declarative (set the value)
- stage==1 -> additive
- stage==2 -> multiplicitive */
+ addmul==0 -> declarative (set the value)
+ addmul==1 -> additive
+ addmul==2 -> multiplicitive */
/* returns the entry number or -1 on eof *************************************/
long vorbis_book_decode(codebook *book, oggpack_buffer *b){
long ptr=0;
decode_aux *t=book->decode_tree;
+ int lok = oggpack_look(b, t->tabn);
+
+ if (lok >= 0) {
+ ptr = t->tab[lok];
+ oggpack_adv(b, t->tabl[lok]);
+ if (ptr <= 0)
+ return -ptr;
+ }
+
do{
- switch(_oggpack_read1(b)){
+ switch(oggpack_read1(b)){
case 0:
ptr=t->ptr0[ptr];
break;
}
/* returns the entry number or -1 on eof *************************************/
-long vorbis_book_decodevs(codebook *book,double *a,oggpack_buffer *b,
+long vorbis_book_decodevs(codebook *book,float *a,oggpack_buffer *b,
int step,int addmul){
long entry=vorbis_book_decode(book,b);
int i,o;
+ float *t;
if(entry==-1)return(-1);
+ t = book->valuelist+entry*book->dim;
+ switch(addmul){
+ case -1:
+ for(i=0,o=0;i<book->dim-3;i+=4,o+=4*step) {
+ a[o]=t[i];
+ a[o+step]=t[i+1];
+ a[o+2*step]=t[i+2];
+ a[o+3*step]=t[i+3];
+ }
+ for(;i<book->dim;i++,o+=step)
+ a[o]=t[i];
+ break;
+ case 0:
+ for(i=0,o=0;i<book->dim-3;i+=4,o+=4*step) {
+ a[o]+=t[i];
+ a[o+step]+=t[i+1];
+ a[o+2*step]+=t[i+2];
+ a[o+3*step]+=t[i+3];
+ }
+ for(;i<book->dim;i++,o+=step)
+ a[o]+=t[i];
+ break;
+ case 1:
+ for(i=0,o=0;i<book->dim-3;i+=4,o+=4*step) {
+ a[o]*=t[i];
+ a[o+step]*=t[i+1];
+ a[o+2*step]*=t[i+2];
+ a[o+3*step]*=t[i+3];
+ }
+ for(;i<book->dim;i++,o+=step)
+ a[o]*=t[i];
+ break;
+ }
+ return(entry);
+}
+
+/* returns 0 on OK or -1 on eof *************************************/
+long s_vorbis_book_decodevs(codebook *book,float *a,oggpack_buffer *b,
+ int step,int addmul){
+ long *entry = alloca(sizeof(long)*step);
+ float **t = alloca(sizeof(float)*step);
+ int i,j,o;
+
+ for (i = 0; i < step; i++) {
+ entry[i]=vorbis_book_decode(book,b);
+ if(entry[i]==-1)return(-1);
+ t[i] = book->valuelist+entry[i]*book->dim;
+ }
switch(addmul){
case -1:
for(i=0,o=0;i<book->dim;i++,o+=step)
- a[o]=(book->valuelist+entry*book->dim)[i];
+ for (j=0;j<step;j++)
+ a[o+j]=t[j][i];
break;
case 0:
for(i=0,o=0;i<book->dim;i++,o+=step)
- a[o]+=(book->valuelist+entry*book->dim)[i];
+ for (j=0;j<step;j++)
+ a[o+j]+=t[j][i];
break;
case 1:
for(i=0,o=0;i<book->dim;i++,o+=step)
- a[o]*=(book->valuelist+entry*book->dim)[i];
+ for (j=0;j<step;j++)
+ a[o+j]*=t[j][i];
break;
}
- return(entry);
+ return(0);
}
#ifdef _V_SELFTEST
#include "vorbis/book/res0a_13.vqh"
#define TESTSIZE 40
-double test1[TESTSIZE]={
+float test1[TESTSIZE]={
0.105939,
0.215373,
0.429117,
0.708603,
};
-double test3[TESTSIZE]={
+float test3[TESTSIZE]={
0,1,-2,3,4,-5,6,7,8,9,
8,-2,7,-1,4,6,8,3,1,-9,
10,11,12,13,14,15,26,17,18,19,
static_codebook *testlist[]={&_vq_book_lsp20_0,
&_vq_book_res0a_13,NULL};
-double *testvec[]={test1,test3};
+float *testvec[]={test1,test3};
int main(){
oggpack_buffer write;
oggpack_buffer read;
long ptr=0,i;
- _oggpack_writeinit(&write);
+ oggpack_writeinit(&write);
fprintf(stderr,"Testing codebook abstraction...:\n");
while(testlist[ptr]){
codebook c;
static_codebook s;
- double *qv=alloca(sizeof(double)*TESTSIZE);
- double *iv=alloca(sizeof(double)*TESTSIZE);
- memcpy(qv,testvec[ptr],sizeof(double)*TESTSIZE);
- memset(iv,0,sizeof(double)*TESTSIZE);
+ float *qv=alloca(sizeof(float)*TESTSIZE);
+ float *iv=alloca(sizeof(float)*TESTSIZE);
+ memcpy(qv,testvec[ptr],sizeof(float)*TESTSIZE);
+ memset(iv,0,sizeof(float)*TESTSIZE);
fprintf(stderr,"\tpacking/coding %ld... ",ptr);
/* pack the codebook, write the testvector */
- _oggpack_reset(&write);
+ oggpack_reset(&write);
vorbis_book_init_encode(&c,testlist[ptr]); /* get it into memory
we can write */
vorbis_staticbook_pack(testlist[ptr],&write);
- fprintf(stderr,"Codebook size %ld bytes... ",_oggpack_bytes(&write));
+ fprintf(stderr,"Codebook size %ld bytes... ",oggpack_bytes(&write));
for(i=0;i<TESTSIZE;i+=c.dim){
int best=_best(&c,qv+i,1);
vorbis_book_encodev(&c,best,qv+i,&write);
fprintf(stderr,"\tunpacking/decoding %ld... ",ptr);
/* transfer the write data to a read buffer and unpack/read */
- _oggpack_readinit(&read,_oggpack_buffer(&write),_oggpack_bytes(&write));
+ oggpack_readinit(&read,oggpack_get_buffer(&write),oggpack_bytes(&write));
if(vorbis_staticbook_unpack(&read,&s)){
fprintf(stderr,"Error unpacking codebook.\n");
exit(1);
********************************************************************
function: PCM data envelope analysis and manipulation
- last mod: $Id: envelope.c,v 1.22 2000/08/31 08:01:34 xiphmont Exp $
+ last mod: $Id: envelope.c,v 1.23 2000/10/12 03:12:52 xiphmont Exp $
Preecho calculation.
#include <string.h>
#include <stdio.h>
#include <math.h>
+#include <ogg/ogg.h>
#include "vorbis/codec.h"
#include "os.h"
#include "scales.h"
#include "envelope.h"
-#include "bitwise.h"
#include "misc.h"
/* We use a Chebyshev bandbass for the preecho trigger bandpass; it's
#if 0
static int cheb_bandpass_stages=10;
-static double cheb_bandpass_gain=5.589612458e+01;
-static double cheb_bandpass_B[]={-1.,0.,5.,0.,-10.,0.,10.,0.,-5.,0.,1};
-static double cheb_bandpass_A[]={
+static float cheb_bandpass_gain=5.589612458e+01;
+static float cheb_bandpass_B[]={-1.,0.,5.,0.,-10.,0.,10.,0.,-5.,0.,1};
+static float cheb_bandpass_A[]={
-0.1917409386,
0.0078657069,
-0.7126903444,
#endif
static int cheb_highpass_stages=10;
-static double cheb_highpass_gain= 5.291963434e+01;
+static float cheb_highpass_gain= 5.291963434e+01;
/* z^-stage, z^-stage+1... */
-static double cheb_highpass_B[]={1,-10,45,-120,210,-252,210,-120,45,-10,1};
-static double cheb_highpass_A[]={
+static float cheb_highpass_B[]={1,-10,45,-120,210,-252,210,-120,45,-10,1};
+static float cheb_highpass_A[]={
-0.1247628029,
0.1334086523,
-0.3997715614,
e->winlength=window;
e->minenergy=fromdB(vi->preecho_minenergy);
e->iir=calloc(ch,sizeof(IIR_state));
- e->filtered=calloc(ch,sizeof(double *));
+ e->filtered=calloc(ch,sizeof(float *));
e->ch=ch;
e->storage=128;
for(i=0;i<ch;i++){
IIR_init(e->iir+i,cheb_highpass_stages,cheb_highpass_gain,
cheb_highpass_A,cheb_highpass_B);
- e->filtered[i]=calloc(e->storage,sizeof(double));
+ e->filtered[i]=calloc(e->storage,sizeof(float));
}
drft_init(&e->drft,window);
- e->window=malloc(e->winlength*sizeof(double));
+ e->window=malloc(e->winlength*sizeof(float));
/* We just use a straight sin(x) window for this */
for(i=0;i<e->winlength;i++)
e->window[i]=sin((i+.5)/e->winlength*M_PI);
memset(e,0,sizeof(envelope_lookup));
}
-static double _ve_deltai(envelope_lookup *ve,IIR_state *iir,
- double *pre,double *post){
+static float _ve_deltai(envelope_lookup *ve,IIR_state *iir,
+ float *pre,float *post){
long n2=ve->winlength*2;
long n=ve->winlength;
- double *workA=alloca(sizeof(double)*n2),A=0.;
- double *workB=alloca(sizeof(double)*n2),B=0.;
+ float *workA=alloca(sizeof(float)*n2),A=0.;
+ float *workB=alloca(sizeof(float)*n2),B=0.;
long i;
- /*_analysis_output("A",frameno,pre,n,0,0);
- _analysis_output("B",frameno,post,n,0,0);*/
+ /*_analysis_output("A",granulepos,pre,n,0,0);
+ _analysis_output("B",granulepos,post,n,0,0);*/
for(i=0;i<n;i++){
workA[i]=pre[i]*ve->window[i];
workB[i]=post[i]*ve->window[i];
}
- /*_analysis_output("Awin",frameno,workA,n,0,0);
- _analysis_output("Bwin",frameno,workB,n,0,0);*/
+ /*_analysis_output("Awin",granulepos,workA,n,0,0);
+ _analysis_output("Bwin",granulepos,workB,n,0,0);*/
drft_forward(&ve->drft,workA);
drft_forward(&ve->drft,workB);
basing blocks on quantization noise that outweighs the signal
itself (for low power signals) */
{
- double min=ve->minenergy;
+ float min=ve->minenergy;
for(i=0;i<n;i++){
if(fabs(workA[i])<min)workA[i]=min;
if(fabs(workB[i])<min)workB[i]=min;
}
}
- /*_analysis_output("Afft",frameno,workA,n,0,0);
- _analysis_output("Bfft",frameno,workB,n,0,0);*/
+ /*_analysis_output("Afft",granulepos,workA,n,0,0);
+ _analysis_output("Bfft",granulepos,workB,n,0,0);*/
for(i=0;i<n;i++){
A+=workA[i]*workA[i];
if(v->pcm_storage>ve->storage){
ve->storage=v->pcm_storage;
for(i=0;i<ve->ch;i++)
- ve->filtered[i]=realloc(ve->filtered[i],ve->storage*sizeof(double));
+ ve->filtered[i]=realloc(ve->filtered[i],ve->storage*sizeof(float));
}
/* catch up the highpass to match the pcm */
for(i=0;i<ve->ch;i++){
- double *filtered=ve->filtered[i];
- double *pcm=v->pcm[i];
+ float *filtered=ve->filtered[i];
+ float *pcm=v->pcm[i];
IIR_state *iir=ve->iir+i;
for(j=ve->current;j<v->pcm_current;j++)
while(j+ve->winlength<=v->pcm_current){
for(i=0;i<ve->ch;i++){
- double *filtered=ve->filtered[i]+j;
+ float *filtered=ve->filtered[i]+j;
IIR_state *iir=ve->iir+i;
- double m=_ve_deltai(ve,iir,filtered-ve->winlength,filtered);
+ float m=_ve_deltai(ve,iir,filtered-ve->winlength,filtered);
if(m>vi->preecho_thresh){
- /*frameno++;*/
+ /*granulepos++;*/
return(0);
}
- /*frameno++;*/
+ /*granulepos++;*/
}
j+=vi->blocksizes[0]/2;
int i;
for(i=0;i<e->ch;i++)
memmove(e->filtered[i],e->filtered[i]+shift,(e->current-shift)*
- sizeof(double));
+ sizeof(float));
e->current-=shift;
}
********************************************************************
function: PCM data envelope analysis and manipulation
- last mod: $Id: envelope.h,v 1.9 2000/08/15 09:09:42 xiphmont Exp $
+ last mod: $Id: envelope.h,v 1.10 2000/10/12 03:12:52 xiphmont Exp $
********************************************************************/
int ch;
int winlength;
int searchstep;
- double minenergy;
+ float minenergy;
IIR_state *iir;
- double **filtered;
+ float **filtered;
long storage;
long current;
drft_lookup drft;
- double *window;
+ float *window;
} envelope_lookup;
extern void _ve_envelope_init(envelope_lookup *e,vorbis_info *vi);
********************************************************************
function: floor backend 0 implementation
- last mod: $Id: floor0.c,v 1.24 2000/08/31 08:01:34 xiphmont Exp $
+ last mod: $Id: floor0.c,v 1.25 2000/10/12 03:12:52 xiphmont Exp $
********************************************************************/
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#include <ogg/ogg.h>
#include "vorbis/codec.h"
-#include "bitwise.h"
#include "registry.h"
#include "lpc.h"
#include "lsp.h"
vorbis_info_floor0 *vi;
lpc_lookup lpclook;
- double *lsp_look;
+ float *lsp_look;
} vorbis_look_floor0;
/* infrastructure for finding fit */
static long _f0_fit(codebook *book,
- double *orig,
- double *workfit,
+ float *orig,
+ float *workfit,
int cursor){
int dim=book->dim;
- double norm,base=0.;
+ float norm,base=0.;
int i,best=0;
- double *lsp=workfit+cursor;
+ float *lsp=workfit+cursor;
if(cursor)base=workfit[cursor-1];
norm=orig[cursor+dim-1]-base;
lsp[i]=(orig[i+cursor]-base);
best=_best(book,lsp,1);
- memcpy(lsp,book->valuelist+best*dim,dim*sizeof(double));
+ memcpy(lsp,book->valuelist+best*dim,dim*sizeof(float));
for(i=0;i<dim;i++)
lsp[i]+=base;
return(best);
/***********************************************/
-static void free_info(vorbis_info_floor *i){
+static void floor0_free_info(vorbis_info_floor *i){
if(i){
memset(i,0,sizeof(vorbis_info_floor0));
free(i);
}
}
-static void free_look(vorbis_look_floor *i){
+static void floor0_free_look(vorbis_look_floor *i){
vorbis_look_floor0 *look=(vorbis_look_floor0 *)i;
if(i){
if(look->linearmap)free(look->linearmap);
}
}
-static void pack (vorbis_info_floor *i,oggpack_buffer *opb){
+static void floor0_pack (vorbis_info_floor *i,oggpack_buffer *opb){
vorbis_info_floor0 *info=(vorbis_info_floor0 *)i;
int j;
- _oggpack_write(opb,info->order,8);
- _oggpack_write(opb,info->rate,16);
- _oggpack_write(opb,info->barkmap,16);
- _oggpack_write(opb,info->ampbits,6);
- _oggpack_write(opb,info->ampdB,8);
- _oggpack_write(opb,info->numbooks-1,4);
+ oggpack_write(opb,info->order,8);
+ oggpack_write(opb,info->rate,16);
+ oggpack_write(opb,info->barkmap,16);
+ oggpack_write(opb,info->ampbits,6);
+ oggpack_write(opb,info->ampdB,8);
+ oggpack_write(opb,info->numbooks-1,4);
for(j=0;j<info->numbooks;j++)
- _oggpack_write(opb,info->books[j],8);
+ oggpack_write(opb,info->books[j],8);
}
-static vorbis_info_floor *unpack (vorbis_info *vi,oggpack_buffer *opb){
+static vorbis_info_floor *floor0_unpack (vorbis_info *vi,oggpack_buffer *opb){
int j;
vorbis_info_floor0 *info=malloc(sizeof(vorbis_info_floor0));
- info->order=_oggpack_read(opb,8);
- info->rate=_oggpack_read(opb,16);
- info->barkmap=_oggpack_read(opb,16);
- info->ampbits=_oggpack_read(opb,6);
- info->ampdB=_oggpack_read(opb,8);
- info->numbooks=_oggpack_read(opb,4)+1;
+ info->order=oggpack_read(opb,8);
+ info->rate=oggpack_read(opb,16);
+ info->barkmap=oggpack_read(opb,16);
+ info->ampbits=oggpack_read(opb,6);
+ info->ampdB=oggpack_read(opb,8);
+ info->numbooks=oggpack_read(opb,4)+1;
if(info->order<1)goto err_out;
if(info->rate<1)goto err_out;
if(info->numbooks<1)goto err_out;
for(j=0;j<info->numbooks;j++){
- info->books[j]=_oggpack_read(opb,8);
+ info->books[j]=oggpack_read(opb,8);
if(info->books[j]<0 || info->books[j]>=vi->books)goto err_out;
}
return(info);
err_out:
- free_info(info);
+ floor0_free_info(info);
return(NULL);
}
Note that the scale depends on the sampling rate as well as the
linear block and mapping sizes */
-static vorbis_look_floor *look (vorbis_dsp_state *vd,vorbis_info_mode *mi,
+static vorbis_look_floor *floor0_look (vorbis_dsp_state *vd,vorbis_info_mode *mi,
vorbis_info_floor *i){
int j;
- double scale;
+ float scale;
vorbis_info *vi=vd->vi;
vorbis_info_floor0 *info=(vorbis_info_floor0 *)i;
vorbis_look_floor0 *look=calloc(1,sizeof(vorbis_look_floor0));
the encoder may do what it wishes in filling them. They're
necessary in some mapping combinations to keep the scale spacing
accurate */
- look->linearmap=malloc(look->n*sizeof(int));
+ look->linearmap=malloc((look->n+1)*sizeof(int));
for(j=0;j<look->n;j++){
int val=floor( toBARK((info->rate/2.)/look->n*j)
*scale); /* bark numbers represent band edges */
if(val>look->ln)val=look->ln; /* guard against the approximation */
look->linearmap[j]=val;
}
+ look->linearmap[j]=-1;
- look->lsp_look=malloc(look->ln*sizeof(double));
+ look->lsp_look=malloc(look->ln*sizeof(float));
for(j=0;j<look->ln;j++)
look->lsp_look[j]=2*cos(M_PI/look->ln*j);
/* less efficient than the decode side (written for clarity). We're
not bottlenecked here anyway */
-double _curve_to_lpc(double *curve,double *lpc,
- vorbis_look_floor0 *l,long frameno){
+float _curve_to_lpc(float *curve,float *lpc,
+ vorbis_look_floor0 *l){
/* map the input curve to a bark-scale curve for encoding */
int mapped=l->ln;
- double *work=alloca(sizeof(double)*mapped);
+ float *work=alloca(sizeof(float)*mapped);
int i,j,last=0;
int bark=0;
- memset(work,0,sizeof(double)*mapped);
+ memset(work,0,sizeof(float)*mapped);
/* Only the decode side is behavior-specced; for now in the encoder,
we select the maximum value of each band as representative (this
/* we'll always have a bin zero, so we don't need to guard init */
long span=bark-last;
for(j=1;j<span;j++){
- double del=(double)j/span;
+ float del=(float)j/span;
work[j+last]=work[bark]*del+work[last]*(1.-del);
}
}
for(i=bark+1;i<mapped;i++)
work[i]=work[i-1];
-#if 0
- { /******************/
- FILE *of;
- char buffer[80];
- int i;
-
- sprintf(buffer,"Fmask_%d.m",frameno);
- of=fopen(buffer,"w");
- for(i=0;i<mapped;i++)
- fprintf(of,"%g\n",work[i]);
- fclose(of);
- }
-#endif
-
return vorbis_lpc_from_curve(work,lpc,&(l->lpclook));
}
/* generate the whole freq response curve of an LSP IIR filter */
-
-void _lsp_to_curve(double *curve,double *lsp,double amp,
- vorbis_look_floor0 *l,char *name,long frameno){
- /* l->m+1 must be less than l->ln, but guard in case we get a bad stream */
- double *lcurve=alloca(sizeof(double)*l->ln);
- int i;
-
- if(amp==0){
- memset(curve,0,sizeof(double)*l->n);
- return;
- }
- vorbis_lsp_to_curve(lcurve,l->ln,lsp,l->m,amp,l->lsp_look);
-
- for(i=0;i<l->n;i++)curve[i]=lcurve[l->linearmap[i]];
-
-}
-
-static long seq=0;
-static int forward(vorbis_block *vb,vorbis_look_floor *i,
- double *in,double *out){
+static int floor0_forward(vorbis_block *vb,vorbis_look_floor *i,
+ float *in,float *out){
long j;
vorbis_look_floor0 *look=(vorbis_look_floor0 *)i;
vorbis_info_floor0 *info=look->vi;
- double *work=alloca((look->ln+look->n)*sizeof(double));
- double amp;
+ float *work=alloca((look->ln+look->n)*sizeof(float));
+ float amp;
long bits=0;
#ifdef TRAIN_LSP
/* use 'out' as temp storage */
/* Convert our floor to a set of lpc coefficients */
- amp=sqrt(_curve_to_lpc(work,out,look,seq));
+ amp=sqrt(_curve_to_lpc(work,out,look));
/* amp is in the range (0. to ampdB]. Encode that range using
ampbits bits */
if(val<0)val=0; /* likely */
if(val>maxval)val=maxval; /* not bloody likely */
- _oggpack_write(&vb->opb,val,info->ampbits);
+ oggpack_write(&vb->opb,val,info->ampbits);
if(val>0)
amp=(float)val/maxval*info->ampdB;
else
/* the spec supports using one of a number of codebooks. Right
now, encode using this lib supports only one */
codebook *b=vb->vd->fullbooks+info->books[0];
- _oggpack_write(&vb->opb,0,_ilog(info->numbooks));
+ oggpack_write(&vb->opb,0,_ilog(info->numbooks));
/* LSP <-> LPC is orthogonal and LSP quantizes more stably */
vorbis_lpc_to_lsp(out,out,look->m);
#if 1
#ifdef TRAIN_LSP
{
- double last=0.;
+ float last=0.;
for(j=0;j<look->m;j++){
fprintf(of,"%.12g, ",out[j]-last);
last=out[j];
#ifdef ANALYSIS
{
- double last=0;
+ float last=0;
for(j=0;j<look->m;j++){
out[j]=work[j]-last;
last=work[j];
}
}
- _analysis_output("lsp",seq,out,look->m,0,0);
#endif
#endif
/* take the coefficients back to a spectral envelope curve */
- _lsp_to_curve(out,work,amp,look,"Ffloor",seq++);
- for(j=0;j<look->n;j++)out[j]= fromdB(out[j]-info->ampdB);
+ vorbis_lsp_to_curve(out,look->linearmap,look->n,look->ln,
+ work,look->m,amp,info->ampdB);
return(1);
}
- memset(out,0,sizeof(double)*look->n);
- seq++;
+ memset(out,0,sizeof(float)*look->n);
return(0);
}
-static int inverse(vorbis_block *vb,vorbis_look_floor *i,double *out){
+static int floor0_inverse(vorbis_block *vb,vorbis_look_floor *i,float *out){
vorbis_look_floor0 *look=(vorbis_look_floor0 *)i;
vorbis_info_floor0 *info=look->vi;
int j,k;
- int ampraw=_oggpack_read(&vb->opb,info->ampbits);
+ int ampraw=oggpack_read(&vb->opb,info->ampbits);
if(ampraw>0){ /* also handles the -1 out of data case */
long maxval=(1<<info->ampbits)-1;
- double amp=(float)ampraw/maxval*info->ampdB;
- int booknum=_oggpack_read(&vb->opb,_ilog(info->numbooks));
+ float amp=(float)ampraw/maxval*info->ampdB;
+ int booknum=oggpack_read(&vb->opb,_ilog(info->numbooks));
+ float *lsp=alloca(sizeof(float)*look->m);
if(booknum!=-1){
codebook *b=vb->vd->fullbooks+info->books[booknum];
- double last=0.;
+ float last=0.;
memset(out,0,sizeof(double)*look->m);
for(j=0;j<look->m;j+=b->dim)
- if(vorbis_book_decodevs(b,out+j,&vb->opb,1,-1)==-1)goto eop;
+ if(vorbis_book_decodevs(b,lsp+j,&vb->opb,1,-1)==-1)goto eop;
for(j=0;j<look->m;){
- for(k=0;k<b->dim;k++,j++)out[j]+=last;
- last=out[j-1];
+ for(k=0;k<b->dim;k++,j++)lsp[j]+=last;
+ last=lsp[j-1];
}
/* take the coefficients back to a spectral envelope curve */
- _lsp_to_curve(out,out,amp,look,"",0);
-
- for(j=0;j<look->n;j++)out[j]=fromdB(out[j]-info->ampdB);
+ vorbis_lsp_to_curve(out,look->linearmap,look->n,look->ln,
+ lsp,look->m,amp,info->ampdB);
return(1);
}
}
eop:
- memset(out,0,sizeof(double)*look->n);
+ memset(out,0,sizeof(float)*look->n);
return(0);
}
/* export hooks */
vorbis_func_floor floor0_exportbundle={
- &pack,&unpack,&look,&free_info,&free_look,&forward,&inverse
+ &floor0_pack,&floor0_unpack,&floor0_look,&floor0_free_info,
+ &floor0_free_look,&floor0_forward,&floor0_inverse
};
********************************************************************
function: Direct Form I, II IIR filters, plus some specializations
- last mod: $Id: iir.c,v 1.1 2000/07/12 09:36:18 xiphmont Exp $
+ last mod: $Id: iir.c,v 1.2 2000/10/12 03:12:52 xiphmont Exp $
********************************************************************/
#include <math.h>
#include "iir.h"
-void IIR_init(IIR_state *s,int stages,double gain, double *A, double *B){
+void IIR_init(IIR_state *s,int stages,float gain, float *A, float *B){
memset(s,0,sizeof(IIR_state));
s->stages=stages;
s->gain=gain;
- s->coeff_A=malloc(stages*sizeof(double));
- s->coeff_B=malloc((stages+1)*sizeof(double));
- s->z_A=calloc(stages*2,sizeof(double));
- s->z_B=calloc(stages*2,sizeof(double));
+ s->coeff_A=malloc(stages*sizeof(float));
+ s->coeff_B=malloc((stages+1)*sizeof(float));
+ s->z_A=calloc(stages*2,sizeof(float));
+ s->z_B=calloc(stages*2,sizeof(float));
- memcpy(s->coeff_A,A,stages*sizeof(double));
- memcpy(s->coeff_B,B,(stages+1)*sizeof(double));
+ memcpy(s->coeff_A,A,stages*sizeof(float));
+ memcpy(s->coeff_B,B,(stages+1)*sizeof(float));
}
void IIR_clear(IIR_state *s){
}
}
-double IIR_filter(IIR_state *s,double in){
+float IIR_filter(IIR_state *s,float in){
int stages=s->stages,i;
- double newA;
- double newB=0;
- double *zA=s->z_A+s->ring;
+ float newA;
+ float newB=0;
+ float *zA=s->z_A+s->ring;
newA=in/=s->gain;
for(i=0;i<stages;i++){
/* this assumes the symmetrical structure of the feed-forward stage of
a Chebyshev bandpass to save multiplies */
-double IIR_filter_ChebBand(IIR_state *s,double in){
+float IIR_filter_ChebBand(IIR_state *s,float in){
int stages=s->stages,i;
- double newA;
- double newB=0;
- double *zA=s->z_A+s->ring;
+ float newA;
+ float newB=0;
+ float *zA=s->z_A+s->ring;
newA=in/=s->gain;
#ifdef _V_SELFTEST
/* z^-stage, z^-stage+1... */
-static double cheb_bandpass_B[]={-1.,0.,5.,0.,-10.,0.,10.,0.,-5.,0.,1};
-static double cheb_bandpass_A[]={-0.6665900311,
+static float cheb_bandpass_B[]={-1.,0.,5.,0.,-10.,0.,10.,0.,-5.,0.,1};
+static float cheb_bandpass_A[]={-0.6665900311,
1.0070146601,
-3.1262875409,
3.5017171569,
-3.9134284363,
1.3997338886};
-static double data[128]={
+static float data[128]={
0.0426331,
0.0384521,
0.0345764,
static float xv[NZEROS+1], yv[NPOLES+1];
-static double filterloop(double next){
+static float filterloop(float next){
xv[0] = xv[1]; xv[1] = xv[2]; xv[2] = xv[3]; xv[3] = xv[4]; xv[4] = xv[5];
xv[5] = xv[6]; xv[6] = xv[7]; xv[7] = xv[8]; xv[8] = xv[9]; xv[9] = xv[10];
xv[10] = next / GAIN;
/* run the pregenerated Chebyshev filter, then our own distillation
through the generic and specialized code */
- double *work=malloc(128*sizeof(double));
+ float *work=malloc(128*sizeof(float));
IIR_state iir;
int i;
********************************************************************
function: Direct Form I, II IIR filters, plus some specializations
- last mod: $Id: iir.h,v 1.1 2000/07/12 09:36:18 xiphmont Exp $
+ last mod: $Id: iir.h,v 1.2 2000/10/12 03:12:52 xiphmont Exp $
********************************************************************/
typedef struct {
int stages;
- double *coeff_A;
- double *coeff_B;
- double *z_A;
- double *z_B;
+ float *coeff_A;
+ float *coeff_B;
+ float *z_A;
+ float *z_B;
int ring;
- double gain;
+ float gain;
} IIR_state;
-void IIR_init(IIR_state *s,int stages,double gain, double *A, double *B);
+void IIR_init(IIR_state *s,int stages,float gain, float *A, float *B);
void IIR_clear(IIR_state *s);
-double IIR_filter(IIR_state *s,double in);
-double IIR_filter_ChebBand(IIR_state *s,double in);
+float IIR_filter(IIR_state *s,float in);
+float IIR_filter_ChebBand(IIR_state *s,float in);
#endif
********************************************************************
function: maintain the info structure, info <-> header packets
- last mod: $Id: info.c,v 1.30 2000/08/15 09:09:43 xiphmont Exp $
+ last mod: $Id: info.c,v 1.31 2000/10/12 03:12:52 xiphmont Exp $
********************************************************************/
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
+#include <ogg/ogg.h>
#include "vorbis/codec.h"
#include "vorbis/backends.h"
-#include "bitwise.h"
#include "sharedbook.h"
#include "bookinternal.h"
#include "registry.h"
static void _v_writestring(oggpack_buffer *o,char *s){
while(*s){
- _oggpack_write(o,*s++,8);
+ oggpack_write(o,*s++,8);
}
}
static void _v_readstring(oggpack_buffer *o,char *buf,int bytes){
while(bytes--){
- *buf++=_oggpack_read(o,8);
+ *buf++=oggpack_read(o,8);
}
}
/* Header packing/unpacking ********************************************/
static int _vorbis_unpack_info(vorbis_info *vi,oggpack_buffer *opb){
- vi->version=_oggpack_read(opb,32);
+ vi->version=oggpack_read(opb,32);
if(vi->version!=0)return(-1);
- vi->channels=_oggpack_read(opb,8);
- vi->rate=_oggpack_read(opb,32);
+ vi->channels=oggpack_read(opb,8);
+ vi->rate=oggpack_read(opb,32);
- vi->bitrate_upper=_oggpack_read(opb,32);
- vi->bitrate_nominal=_oggpack_read(opb,32);
- vi->bitrate_lower=_oggpack_read(opb,32);
+ vi->bitrate_upper=oggpack_read(opb,32);
+ vi->bitrate_nominal=oggpack_read(opb,32);
+ vi->bitrate_lower=oggpack_read(opb,32);
- vi->blocksizes[0]=1<<_oggpack_read(opb,4);
- vi->blocksizes[1]=1<<_oggpack_read(opb,4);
+ vi->blocksizes[0]=1<<oggpack_read(opb,4);
+ vi->blocksizes[1]=1<<oggpack_read(opb,4);
if(vi->rate<1)goto err_out;
if(vi->channels<1)goto err_out;
if(vi->blocksizes[0]<8)goto err_out;
if(vi->blocksizes[1]<vi->blocksizes[0])goto err_out;
- if(_oggpack_read(opb,1)!=1)goto err_out; /* EOP check */
+ if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */
return(0);
err_out:
static int _vorbis_unpack_comment(vorbis_comment *vc,oggpack_buffer *opb){
int i;
- int vendorlen=_oggpack_read(opb,32);
+ int vendorlen=oggpack_read(opb,32);
if(vendorlen<0)goto err_out;
vc->vendor=calloc(vendorlen+1,1);
_v_readstring(opb,vc->vendor,vendorlen);
- vc->comments=_oggpack_read(opb,32);
+ vc->comments=oggpack_read(opb,32);
if(vc->comments<0)goto err_out;
vc->user_comments=calloc(vc->comments+1,sizeof(char **));
vc->comment_lengths=calloc(vc->comments+1, sizeof(int));
for(i=0;i<vc->comments;i++){
- int len=_oggpack_read(opb,32);
+ int len=oggpack_read(opb,32);
if(len<0)goto err_out;
vc->comment_lengths[i]=len;
vc->user_comments[i]=calloc(len+1,1);
_v_readstring(opb,vc->user_comments[i],len);
}
- if(_oggpack_read(opb,1)!=1)goto err_out; /* EOP check */
+ if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */
return(0);
err_out:
int i;
/* codebooks */
- vi->books=_oggpack_read(opb,8)+1;
+ vi->books=oggpack_read(opb,8)+1;
/*vi->book_param=calloc(vi->books,sizeof(static_codebook *));*/
for(i=0;i<vi->books;i++){
vi->book_param[i]=calloc(1,sizeof(static_codebook));
}
/* time backend settings */
- vi->times=_oggpack_read(opb,6)+1;
+ vi->times=oggpack_read(opb,6)+1;
/*vi->time_type=malloc(vi->times*sizeof(int));*/
/*vi->time_param=calloc(vi->times,sizeof(void *));*/
for(i=0;i<vi->times;i++){
- vi->time_type[i]=_oggpack_read(opb,16);
+ vi->time_type[i]=oggpack_read(opb,16);
if(vi->time_type[i]<0 || vi->time_type[i]>=VI_TIMEB)goto err_out;
vi->time_param[i]=_time_P[vi->time_type[i]]->unpack(vi,opb);
if(!vi->time_param[i])goto err_out;
}
/* floor backend settings */
- vi->floors=_oggpack_read(opb,6)+1;
+ vi->floors=oggpack_read(opb,6)+1;
/*vi->floor_type=malloc(vi->floors*sizeof(int));*/
/*vi->floor_param=calloc(vi->floors,sizeof(void *));*/
for(i=0;i<vi->floors;i++){
- vi->floor_type[i]=_oggpack_read(opb,16);
+ vi->floor_type[i]=oggpack_read(opb,16);
if(vi->floor_type[i]<0 || vi->floor_type[i]>=VI_FLOORB)goto err_out;
vi->floor_param[i]=_floor_P[vi->floor_type[i]]->unpack(vi,opb);
if(!vi->floor_param[i])goto err_out;
}
/* residue backend settings */
- vi->residues=_oggpack_read(opb,6)+1;
+ vi->residues=oggpack_read(opb,6)+1;
/*vi->residue_type=malloc(vi->residues*sizeof(int));*/
/*vi->residue_param=calloc(vi->residues,sizeof(void *));*/
for(i=0;i<vi->residues;i++){
- vi->residue_type[i]=_oggpack_read(opb,16);
+ vi->residue_type[i]=oggpack_read(opb,16);
if(vi->residue_type[i]<0 || vi->residue_type[i]>=VI_RESB)goto err_out;
vi->residue_param[i]=_residue_P[vi->residue_type[i]]->unpack(vi,opb);
if(!vi->residue_param[i])goto err_out;
}
/* map backend settings */
- vi->maps=_oggpack_read(opb,6)+1;
+ vi->maps=oggpack_read(opb,6)+1;
/*vi->map_type=malloc(vi->maps*sizeof(int));*/
/*vi->map_param=calloc(vi->maps,sizeof(void *));*/
for(i=0;i<vi->maps;i++){
- vi->map_type[i]=_oggpack_read(opb,16);
+ vi->map_type[i]=oggpack_read(opb,16);
if(vi->map_type[i]<0 || vi->map_type[i]>=VI_MAPB)goto err_out;
vi->map_param[i]=_mapping_P[vi->map_type[i]]->unpack(vi,opb);
if(!vi->map_param[i])goto err_out;
}
/* mode settings */
- vi->modes=_oggpack_read(opb,6)+1;
+ vi->modes=oggpack_read(opb,6)+1;
/*vi->mode_param=calloc(vi->modes,sizeof(void *));*/
for(i=0;i<vi->modes;i++){
vi->mode_param[i]=calloc(1,sizeof(vorbis_info_mode));
- vi->mode_param[i]->blockflag=_oggpack_read(opb,1);
- vi->mode_param[i]->windowtype=_oggpack_read(opb,16);
- vi->mode_param[i]->transformtype=_oggpack_read(opb,16);
- vi->mode_param[i]->mapping=_oggpack_read(opb,8);
+ vi->mode_param[i]->blockflag=oggpack_read(opb,1);
+ vi->mode_param[i]->windowtype=oggpack_read(opb,16);
+ vi->mode_param[i]->transformtype=oggpack_read(opb,16);
+ vi->mode_param[i]->mapping=oggpack_read(opb,8);
if(vi->mode_param[i]->windowtype>=VI_WINDOWB)goto err_out;
if(vi->mode_param[i]->transformtype>=VI_WINDOWB)goto err_out;
if(vi->mode_param[i]->mapping>=vi->maps)goto err_out;
}
- if(_oggpack_read(opb,1)!=1)goto err_out; /* top level EOP check */
+ if(oggpack_read(opb,1)!=1)goto err_out; /* top level EOP check */
return(0);
err_out:
oggpack_buffer opb;
if(op){
- _oggpack_readinit(&opb,op->packet,op->bytes);
+ oggpack_readinit(&opb,op->packet,op->bytes);
/* Which of the three types of header is this? */
/* Also verify header-ness, vorbis */
{
char buffer[6];
- int packtype=_oggpack_read(&opb,8);
+ int packtype=oggpack_read(&opb,8);
memset(buffer,0,6);
_v_readstring(&opb,buffer,6);
if(memcmp(buffer,"vorbis",6)){
static int _vorbis_pack_info(oggpack_buffer *opb,vorbis_info *vi){
/* preamble */
- _oggpack_write(opb,0x01,8);
+ oggpack_write(opb,0x01,8);
_v_writestring(opb,"vorbis");
/* basic information about the stream */
- _oggpack_write(opb,0x00,32);
- _oggpack_write(opb,vi->channels,8);
- _oggpack_write(opb,vi->rate,32);
+ oggpack_write(opb,0x00,32);
+ oggpack_write(opb,vi->channels,8);
+ oggpack_write(opb,vi->rate,32);
- _oggpack_write(opb,vi->bitrate_upper,32);
- _oggpack_write(opb,vi->bitrate_nominal,32);
- _oggpack_write(opb,vi->bitrate_lower,32);
+ oggpack_write(opb,vi->bitrate_upper,32);
+ oggpack_write(opb,vi->bitrate_nominal,32);
+ oggpack_write(opb,vi->bitrate_lower,32);
- _oggpack_write(opb,ilog2(vi->blocksizes[0]),4);
- _oggpack_write(opb,ilog2(vi->blocksizes[1]),4);
- _oggpack_write(opb,1,1);
+ oggpack_write(opb,ilog2(vi->blocksizes[0]),4);
+ oggpack_write(opb,ilog2(vi->blocksizes[1]),4);
+ oggpack_write(opb,1,1);
return(0);
}
char temp[]="Xiphophorus libVorbis I 20000508";
/* preamble */
- _oggpack_write(opb,0x03,8);
+ oggpack_write(opb,0x03,8);
_v_writestring(opb,"vorbis");
/* vendor */
- _oggpack_write(opb,strlen(temp),32);
+ oggpack_write(opb,strlen(temp),32);
_v_writestring(opb,temp);
/* comments */
- _oggpack_write(opb,vc->comments,32);
+ oggpack_write(opb,vc->comments,32);
if(vc->comments){
int i;
for(i=0;i<vc->comments;i++){
if(vc->user_comments[i]){
- _oggpack_write(opb,vc->comment_lengths[i],32);
+ oggpack_write(opb,vc->comment_lengths[i],32);
_v_writestring(opb,vc->user_comments[i]);
}else{
- _oggpack_write(opb,0,32);
+ oggpack_write(opb,0,32);
}
}
}
- _oggpack_write(opb,1,1);
+ oggpack_write(opb,1,1);
return(0);
}
static int _vorbis_pack_books(oggpack_buffer *opb,vorbis_info *vi){
int i;
- _oggpack_write(opb,0x05,8);
+ oggpack_write(opb,0x05,8);
_v_writestring(opb,"vorbis");
/* books */
- _oggpack_write(opb,vi->books-1,8);
+ oggpack_write(opb,vi->books-1,8);
for(i=0;i<vi->books;i++)
if(vorbis_staticbook_pack(vi->book_param[i],opb))goto err_out;
/* times */
- _oggpack_write(opb,vi->times-1,6);
+ oggpack_write(opb,vi->times-1,6);
for(i=0;i<vi->times;i++){
- _oggpack_write(opb,vi->time_type[i],16);
+ oggpack_write(opb,vi->time_type[i],16);
_time_P[vi->time_type[i]]->pack(vi->time_param[i],opb);
}
/* floors */
- _oggpack_write(opb,vi->floors-1,6);
+ oggpack_write(opb,vi->floors-1,6);
for(i=0;i<vi->floors;i++){
- _oggpack_write(opb,vi->floor_type[i],16);
+ oggpack_write(opb,vi->floor_type[i],16);
_floor_P[vi->floor_type[i]]->pack(vi->floor_param[i],opb);
}
/* residues */
- _oggpack_write(opb,vi->residues-1,6);
+ oggpack_write(opb,vi->residues-1,6);
for(i=0;i<vi->residues;i++){
- _oggpack_write(opb,vi->residue_type[i],16);
+ oggpack_write(opb,vi->residue_type[i],16);
_residue_P[vi->residue_type[i]]->pack(vi->residue_param[i],opb);
}
/* maps */
- _oggpack_write(opb,vi->maps-1,6);
+ oggpack_write(opb,vi->maps-1,6);
for(i=0;i<vi->maps;i++){
- _oggpack_write(opb,vi->map_type[i],16);
+ oggpack_write(opb,vi->map_type[i],16);
_mapping_P[vi->map_type[i]]->pack(vi,vi->map_param[i],opb);
}
/* modes */
- _oggpack_write(opb,vi->modes-1,6);
+ oggpack_write(opb,vi->modes-1,6);
for(i=0;i<vi->modes;i++){
- _oggpack_write(opb,vi->mode_param[i]->blockflag,1);
- _oggpack_write(opb,vi->mode_param[i]->windowtype,16);
- _oggpack_write(opb,vi->mode_param[i]->transformtype,16);
- _oggpack_write(opb,vi->mode_param[i]->mapping,8);
+ oggpack_write(opb,vi->mode_param[i]->blockflag,1);
+ oggpack_write(opb,vi->mode_param[i]->windowtype,16);
+ oggpack_write(opb,vi->mode_param[i]->transformtype,16);
+ oggpack_write(opb,vi->mode_param[i]->mapping,8);
}
- _oggpack_write(opb,1,1);
+ oggpack_write(opb,1,1);
return(0);
err_out:
/* first header packet **********************************************/
- _oggpack_writeinit(&opb);
+ oggpack_writeinit(&opb);
if(_vorbis_pack_info(&opb,vi))goto err_out;
/* build the packet */
if(v->header)free(v->header);
- v->header=malloc(_oggpack_bytes(&opb));
- memcpy(v->header,opb.buffer,_oggpack_bytes(&opb));
+ v->header=malloc(oggpack_bytes(&opb));
+ memcpy(v->header,opb.buffer,oggpack_bytes(&opb));
op->packet=v->header;
- op->bytes=_oggpack_bytes(&opb);
+ op->bytes=oggpack_bytes(&opb);
op->b_o_s=1;
op->e_o_s=0;
- op->frameno=0;
+ op->granulepos=0;
/* second header packet (comments) **********************************/
- _oggpack_reset(&opb);
+ oggpack_reset(&opb);
if(_vorbis_pack_comment(&opb,vc))goto err_out;
if(v->header1)free(v->header1);
- v->header1=malloc(_oggpack_bytes(&opb));
- memcpy(v->header1,opb.buffer,_oggpack_bytes(&opb));
+ v->header1=malloc(oggpack_bytes(&opb));
+ memcpy(v->header1,opb.buffer,oggpack_bytes(&opb));
op_comm->packet=v->header1;
- op_comm->bytes=_oggpack_bytes(&opb);
+ op_comm->bytes=oggpack_bytes(&opb);
op_comm->b_o_s=0;
op_comm->e_o_s=0;
- op_comm->frameno=0;
+ op_comm->granulepos=0;
/* third header packet (modes/codebooks) ****************************/
- _oggpack_reset(&opb);
+ oggpack_reset(&opb);
if(_vorbis_pack_books(&opb,vi))goto err_out;
if(v->header2)free(v->header2);
- v->header2=malloc(_oggpack_bytes(&opb));
- memcpy(v->header2,opb.buffer,_oggpack_bytes(&opb));
+ v->header2=malloc(oggpack_bytes(&opb));
+ memcpy(v->header2,opb.buffer,oggpack_bytes(&opb));
op_code->packet=v->header2;
- op_code->bytes=_oggpack_bytes(&opb);
+ op_code->bytes=oggpack_bytes(&opb);
op_code->b_o_s=0;
op_code->e_o_s=0;
- op_code->frameno=0;
+ op_code->granulepos=0;
- _oggpack_writeclear(&opb);
+ oggpack_writeclear(&opb);
return(0);
err_out:
- _oggpack_writeclear(&opb);
+ oggpack_writeclear(&opb);
memset(op,0,sizeof(ogg_packet));
memset(op_comm,0,sizeof(ogg_packet));
memset(op_code,0,sizeof(ogg_packet));
--- /dev/null
+/********************************************************************
+ * *
+ * 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: lookup based functions
+ last mod: $Id: lookup.c,v 1.2 2000/10/12 03:12:53 xiphmont Exp $
+
+ ********************************************************************/
+
+#include <math.h>
+#include "lookup.h"
+#include "lookup_data.h"
+
+#ifdef FLOAT_LOOKUP
+
+/* interpolated lookup based cos function, domain 0 to PI only */
+float vorbis_coslook(float a){
+ float d=a*(.31830989*(float)COS_LOOKUP_SZ);
+ int i=d;
+ return COS_LOOKUP[i]+ (d-i)*(COS_LOOKUP[i+1]-COS_LOOKUP[i]);
+}
+
+/* interpolated 1./sqrt(p) where .5 <= p < 1. */
+float vorbis_invsqlook(float a){
+ float d=a*(2.*(float)INVSQ_LOOKUP_SZ)-(float)INVSQ_LOOKUP_SZ;
+ int i=d;
+ return INVSQ_LOOKUP[i]+ (d-i)*(INVSQ_LOOKUP[i+1]-INVSQ_LOOKUP[i]);
+}
+
+/* interpolated 1./sqrt(p) where .5 <= p < 1. */
+float vorbis_invsq2explook(int a){
+ return INVSQ2EXP_LOOKUP[a-INVSQ2EXP_LOOKUP_MIN];
+}
+
+#include <stdio.h>
+/* interpolated lookup based fromdB function, domain -140dB to 0dB only */
+float vorbis_fromdBlook(float a){
+ int i=a*((float)(-(1<<FROMdB2_SHIFT)));
+ return (i<0)?1.:
+ ((i>=(FROMdB_LOOKUP_SZ<<FROMdB_SHIFT))?0.:
+ FROMdB_LOOKUP[i>>FROMdB_SHIFT]*FROMdB2_LOOKUP[i&FROMdB2_MASK]);
+}
+
+#endif
+
+#ifdef INT_LOOKUP
+/* interpolated 1./sqrt(p) where .5 <= a < 1. (.100000... to .111111...) in
+ 16.16 format
+
+ returns in m.8 format */
+long vorbis_invsqlook_i(long a,long e){
+ long i=(a&0x7fff)>>(INVSQ_LOOKUP_I_SHIFT-1);
+ long d=(a&INVSQ_LOOKUP_I_MASK)<<(16-INVSQ_LOOKUP_I_SHIFT); /* 0.16 */
+ long val=INVSQ_LOOKUP_I[i]- /* 1.16 */
+ (((INVSQ_LOOKUP_I[i]-INVSQ_LOOKUP_I[i+1])* /* 0.16 */
+ d)>>16); /* result 1.16 */
+
+ e+=32;
+ if(e&1)val=(val*5792)>>13; /* multiply val by 1/sqrt(2) */
+ e=(e>>1)-8;
+
+ return(val>>e);
+}
+
+/* interpolated lookup based fromdB function, domain -140dB to 0dB only */
+/* a is in n.12 format */
+float vorbis_fromdBlook_i(long a){
+ int i=(-a)>>(12-FROMdB2_SHIFT);
+ return (i<0)?1.:
+ ((i>=(FROMdB_LOOKUP_SZ<<FROMdB_SHIFT))?0.:
+ FROMdB_LOOKUP[i>>FROMdB_SHIFT]*FROMdB2_LOOKUP[i&FROMdB2_MASK]);
+}
+
+/* interpolated lookup based cos function, domain 0 to PI only */
+/* a is in 0.16 format, where 0==0, 2^^16-1==PI, return 0.14 */
+long vorbis_coslook_i(long a){
+ int i=a>>COS_LOOKUP_I_SHIFT;
+ int d=a&COS_LOOKUP_I_MASK;
+ return COS_LOOKUP_I[i]- ((d*(COS_LOOKUP_I[i]-COS_LOOKUP_I[i+1]))>>
+ COS_LOOKUP_I_SHIFT);
+}
+
+#endif
* *
********************************************************************
- function: libvorbis codec internal types. These structures are
- 'visible', but generally uninteresting to the developer
- last mod: $Id: internal.h,v 1.7 2000/07/12 09:36:17 xiphmont Exp $
+ function: lookup based functions
+ last mod: $Id: lookup.h,v 1.2 2000/10/12 03:12:53 xiphmont Exp $
********************************************************************/
-#ifndef _vorbis_internal_h_
-#define _vorbis_internal_h_
-
-/* structures for various internal data abstractions ********************/
-
-typedef struct {
- long endbyte;
- int endbit;
-
- unsigned char *buffer;
- unsigned char *ptr;
- long storage;
-
-} oggpack_buffer;
+#ifndef _V_LOOKUP_H_
+#ifdef FLOAT_LOOKUP
+extern float vorbis_coslook(float a);
+extern float vorbis_invsqlook(float a);
+extern float vorbis_invsq2explook(int a);
+extern float vorbis_fromdBlook(float a);
#endif
+#ifdef INT_LOOKUP
+extern long vorbis_invsqlook_i(long a,long e);
+extern long vorbis_coslook_i(long a);
+extern float vorbis_fromdBlook_i(long a);
+#endif
-
-
-
-
+#endif
--- /dev/null
+/********************************************************************
+ * *
+ * 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: lookup data; generated by lookups.pl; edit there
+ last mod: $Id: lookup_data.h,v 1.2 2000/10/12 03:12:53 xiphmont Exp $
+
+ ********************************************************************/
+
+#ifndef _V_LOOKUP_DATA_H_
+
+#ifdef FLOAT_LOOKUP
+#define COS_LOOKUP_SZ 128
+static float COS_LOOKUP[COS_LOOKUP_SZ+1]={
+ +1.0000000000000,+0.9996988186962,+0.9987954562052,+0.9972904566787,
+ +0.9951847266722,+0.9924795345987,+0.9891765099648,+0.9852776423889,
+ +0.9807852804032,+0.9757021300385,+0.9700312531945,+0.9637760657954,
+ +0.9569403357322,+0.9495281805930,+0.9415440651830,+0.9329927988347,
+ +0.9238795325113,+0.9142097557035,+0.9039892931234,+0.8932243011955,
+ +0.8819212643484,+0.8700869911087,+0.8577286100003,+0.8448535652497,
+ +0.8314696123025,+0.8175848131516,+0.8032075314806,+0.7883464276266,
+ +0.7730104533627,+0.7572088465065,+0.7409511253550,+0.7242470829515,
+ +0.7071067811865,+0.6895405447371,+0.6715589548470,+0.6531728429538,
+ +0.6343932841636,+0.6152315905806,+0.5956993044924,+0.5758081914178,
+ +0.5555702330196,+0.5349976198871,+0.5141027441932,+0.4928981922298,
+ +0.4713967368260,+0.4496113296546,+0.4275550934303,+0.4052413140050,
+ +0.3826834323651,+0.3598950365350,+0.3368898533922,+0.3136817403989,
+ +0.2902846772545,+0.2667127574749,+0.2429801799033,+0.2191012401569,
+ +0.1950903220161,+0.1709618887603,+0.1467304744554,+0.1224106751992,
+ +0.0980171403296,+0.0735645635997,+0.0490676743274,+0.0245412285229,
+ +0.0000000000000,-0.0245412285229,-0.0490676743274,-0.0735645635997,
+ -0.0980171403296,-0.1224106751992,-0.1467304744554,-0.1709618887603,
+ -0.1950903220161,-0.2191012401569,-0.2429801799033,-0.2667127574749,
+ -0.2902846772545,-0.3136817403989,-0.3368898533922,-0.3598950365350,
+ -0.3826834323651,-0.4052413140050,-0.4275550934303,-0.4496113296546,
+ -0.4713967368260,-0.4928981922298,-0.5141027441932,-0.5349976198871,
+ -0.5555702330196,-0.5758081914178,-0.5956993044924,-0.6152315905806,
+ -0.6343932841636,-0.6531728429538,-0.6715589548470,-0.6895405447371,
+ -0.7071067811865,-0.7242470829515,-0.7409511253550,-0.7572088465065,
+ -0.7730104533627,-0.7883464276266,-0.8032075314806,-0.8175848131516,
+ -0.8314696123025,-0.8448535652497,-0.8577286100003,-0.8700869911087,
+ -0.8819212643484,-0.8932243011955,-0.9039892931234,-0.9142097557035,
+ -0.9238795325113,-0.9329927988347,-0.9415440651830,-0.9495281805930,
+ -0.9569403357322,-0.9637760657954,-0.9700312531945,-0.9757021300385,
+ -0.9807852804032,-0.9852776423889,-0.9891765099648,-0.9924795345987,
+ -0.9951847266722,-0.9972904566787,-0.9987954562052,-0.9996988186962,
+ -1.0000000000000,
+};
+
+#define INVSQ_LOOKUP_SZ 32
+static float INVSQ_LOOKUP[INVSQ_LOOKUP_SZ+1]={
+ 1.414213562373,1.392621247646,1.371988681140,1.352246807566,
+ 1.333333333333,1.315191898443,1.297771369046,1.281025230441,
+ 1.264911064067,1.249390095109,1.234426799697,1.219988562661,
+ 1.206045378311,1.192569588000,1.179535649239,1.166919931983,
+ 1.154700538379,1.142857142857,1.131370849898,1.120224067222,
+ 1.109400392450,1.098884511590,1.088662107904,1.078719779941,
+ 1.069044967650,1.059625885652,1.050451462878,1.041511287847,
+ 1.032795558989,1.024295039463,1.016001016002,1.007905261358,
+ 1.000000000000,
+};
+
+#define INVSQ2EXP_LOOKUP_MIN -32
+#define INVSQ2EXP_LOOKUP_MAX 32
+static float INVSQ2EXP_LOOKUP[INVSQ2EXP_LOOKUP_MAX-\
+ INVSQ2EXP_LOOKUP_MIN+1]={
+ 65536, 46340.95001, 32768, 23170.47501,
+ 16384, 11585.2375, 8192, 5792.618751,
+ 4096, 2896.309376, 2048, 1448.154688,
+ 1024, 724.0773439, 512, 362.038672,
+ 256, 181.019336, 128, 90.50966799,
+ 64, 45.254834, 32, 22.627417,
+ 16, 11.3137085, 8, 5.656854249,
+ 4, 2.828427125, 2, 1.414213562,
+ 1, 0.7071067812, 0.5, 0.3535533906,
+ 0.25, 0.1767766953, 0.125, 0.08838834765,
+ 0.0625, 0.04419417382, 0.03125, 0.02209708691,
+ 0.015625, 0.01104854346, 0.0078125, 0.005524271728,
+ 0.00390625, 0.002762135864, 0.001953125, 0.001381067932,
+ 0.0009765625, 0.000690533966, 0.00048828125, 0.000345266983,
+ 0.000244140625,0.0001726334915,0.0001220703125,8.631674575e-05,
+ 6.103515625e-05,4.315837288e-05,3.051757812e-05,2.157918644e-05,
+ 1.525878906e-05,
+};
+
+#endif
+
+#define FROMdB_LOOKUP_SZ 35
+#define FROMdB2_LOOKUP_SZ 32
+#define FROMdB_SHIFT 5
+#define FROMdB2_SHIFT 3
+#define FROMdB2_MASK 31
+static float FROMdB_LOOKUP[FROMdB_LOOKUP_SZ]={
+ 1, 0.6309573445, 0.3981071706, 0.2511886432,
+ 0.1584893192, 0.1, 0.06309573445, 0.03981071706,
+ 0.02511886432, 0.01584893192, 0.01, 0.006309573445,
+ 0.003981071706, 0.002511886432, 0.001584893192, 0.001,
+ 0.0006309573445,0.0003981071706,0.0002511886432,0.0001584893192,
+ 0.0001,6.309573445e-05,3.981071706e-05,2.511886432e-05,
+ 1.584893192e-05, 1e-05,6.309573445e-06,3.981071706e-06,
+ 2.511886432e-06,1.584893192e-06, 1e-06,6.309573445e-07,
+ 3.981071706e-07,2.511886432e-07,1.584893192e-07,
+};
+
+static float FROMdB2_LOOKUP[FROMdB2_LOOKUP_SZ]={
+ 0.9928302478, 0.9786445908, 0.9646616199, 0.9508784391,
+ 0.9372921937, 0.92390007, 0.9106992942, 0.8976871324,
+ 0.8848608897, 0.8722179097, 0.8597555737, 0.8474713009,
+ 0.835362547, 0.8234268041, 0.8116616003, 0.8000644989,
+ 0.7886330981, 0.7773650302, 0.7662579617, 0.755309592,
+ 0.7445176537, 0.7338799116, 0.7233941627, 0.7130582353,
+ 0.7028699885, 0.6928273125, 0.6829281272, 0.6731703824,
+ 0.6635520573, 0.6540711597, 0.6447257262, 0.6355138211,
+};
+
+#ifdef INT_LOOKUP
+
+#define INVSQ_LOOKUP_I_SHIFT 10
+#define INVSQ_LOOKUP_I_MASK 1023
+static long INVSQ_LOOKUP_I[64+1]={
+ 92682, 91966, 91267, 90583,
+ 89915, 89261, 88621, 87995,
+ 87381, 86781, 86192, 85616,
+ 85051, 84497, 83953, 83420,
+ 82897, 82384, 81880, 81385,
+ 80899, 80422, 79953, 79492,
+ 79039, 78594, 78156, 77726,
+ 77302, 76885, 76475, 76072,
+ 75674, 75283, 74898, 74519,
+ 74146, 73778, 73415, 73058,
+ 72706, 72359, 72016, 71679,
+ 71347, 71019, 70695, 70376,
+ 70061, 69750, 69444, 69141,
+ 68842, 68548, 68256, 67969,
+ 67685, 67405, 67128, 66855,
+ 66585, 66318, 66054, 65794,
+ 65536,
+};
+
+#define COS_LOOKUP_I_SHIFT 9
+#define COS_LOOKUP_I_MASK 511
+#define COS_LOOKUP_I_SZ 128
+static long COS_LOOKUP_I[COS_LOOKUP_I_SZ+1]={
+ 16384, 16379, 16364, 16340,
+ 16305, 16261, 16207, 16143,
+ 16069, 15986, 15893, 15791,
+ 15679, 15557, 15426, 15286,
+ 15137, 14978, 14811, 14635,
+ 14449, 14256, 14053, 13842,
+ 13623, 13395, 13160, 12916,
+ 12665, 12406, 12140, 11866,
+ 11585, 11297, 11003, 10702,
+ 10394, 10080, 9760, 9434,
+ 9102, 8765, 8423, 8076,
+ 7723, 7366, 7005, 6639,
+ 6270, 5897, 5520, 5139,
+ 4756, 4370, 3981, 3590,
+ 3196, 2801, 2404, 2006,
+ 1606, 1205, 804, 402,
+ 0, -401, -803, -1204,
+ -1605, -2005, -2403, -2800,
+ -3195, -3589, -3980, -4369,
+ -4755, -5138, -5519, -5896,
+ -6269, -6638, -7004, -7365,
+ -7722, -8075, -8422, -8764,
+ -9101, -9433, -9759, -10079,
+ -10393, -10701, -11002, -11296,
+ -11584, -11865, -12139, -12405,
+ -12664, -12915, -13159, -13394,
+ -13622, -13841, -14052, -14255,
+ -14448, -14634, -14810, -14977,
+ -15136, -15285, -15425, -15556,
+ -15678, -15790, -15892, -15985,
+ -16068, -16142, -16206, -16260,
+ -16304, -16339, -16363, -16378,
+ -16383,
+};
+
+#endif
+
+#endif
--- /dev/null
+#!/usr/bin/perl
+print <<'EOD';
+/********************************************************************
+ * *
+ * 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: lookup data; generated by lookups.pl; edit there
+ last mod: $Id: lookups.pl,v 1.2 2000/10/12 03:12:53 xiphmont Exp $
+
+ ********************************************************************/
+
+#ifndef _V_LOOKUP_DATA_H_
+
+#ifdef FLOAT_LOOKUP
+EOD
+
+$cos_sz=128;
+$invsq_sz=32;
+$invsq2exp_min=-32;
+$invsq2exp_max=32;
+
+$fromdB_sz=35;
+$fromdB_shift=5;
+$fromdB2_shift=3;
+
+$invsq_i_shift=10;
+$cos_i_shift=9;
+$delta_shift=6;
+
+print "#define COS_LOOKUP_SZ $cos_sz\n";
+print "static float COS_LOOKUP[COS_LOOKUP_SZ+1]={\n";
+
+for($i=0;$i<=$cos_sz;){
+ print "\t";
+ for($j=0;$j<4 && $i<=$cos_sz;$j++){
+ printf "%+.13f,", cos(3.14159265358979323846*($i++)/$cos_sz) ;
+ }
+ print "\n";
+}
+print "};\n\n";
+
+print "#define INVSQ_LOOKUP_SZ $invsq_sz\n";
+print "static float INVSQ_LOOKUP[INVSQ_LOOKUP_SZ+1]={\n";
+
+for($i=0;$i<=$invsq_sz;){
+ print "\t";
+ for($j=0;$j<4 && $i<=$invsq_sz;$j++){
+ my$indexmap=$i++/$invsq_sz*.5+.5;
+ printf "%.12f,", 1./sqrt($indexmap);
+ }
+ print "\n";
+}
+print "};\n\n";
+
+print "#define INVSQ2EXP_LOOKUP_MIN $invsq2exp_min\n";
+print "#define INVSQ2EXP_LOOKUP_MAX $invsq2exp_max\n";
+print "static float INVSQ2EXP_LOOKUP[INVSQ2EXP_LOOKUP_MAX-\\\n".
+ " INVSQ2EXP_LOOKUP_MIN+1]={\n";
+
+for($i=$invsq2exp_min;$i<=$invsq2exp_max;){
+ print "\t";
+ for($j=0;$j<4 && $i<=$invsq2exp_max;$j++){
+ printf "%15.10g,", 2**($i++*-.5);
+ }
+ print "\n";
+}
+print "};\n\n#endif\n\n";
+
+
+# 0 to -140 dB
+$fromdB2_sz=1<<$fromdB_shift;
+$fromdB_gran=1<<($fromdB_shift-$fromdB2_shift);
+print "#define FROMdB_LOOKUP_SZ $fromdB_sz\n";
+print "#define FROMdB2_LOOKUP_SZ $fromdB2_sz\n";
+print "#define FROMdB_SHIFT $fromdB_shift\n";
+print "#define FROMdB2_SHIFT $fromdB2_shift\n";
+print "#define FROMdB2_MASK ".((1<<$fromdB_shift)-1)."\n";
+
+print "static float FROMdB_LOOKUP[FROMdB_LOOKUP_SZ]={\n";
+
+for($i=0;$i<$fromdB_sz;){
+ print "\t";
+ for($j=0;$j<4 && $i<$fromdB_sz;$j++){
+ printf "%15.10g,", 10**(.05*(-$fromdB_gran*$i++));
+ }
+ print "\n";
+}
+print "};\n\n";
+
+print "static float FROMdB2_LOOKUP[FROMdB2_LOOKUP_SZ]={\n";
+
+for($i=0;$i<$fromdB2_sz;){
+ print "\t";
+ for($j=0;$j<4 && $i<$fromdB_sz;$j++){
+ printf "%15.10g,", 10**(.05*(-$fromdB_gran/$fromdB2_sz*(.5+$i++)));
+ }
+ print "\n";
+}
+print "};\n\n#ifdef INT_LOOKUP\n\n";
+
+
+$iisz=0x10000>>$invsq_i_shift;
+print "#define INVSQ_LOOKUP_I_SHIFT $invsq_i_shift\n";
+print "#define INVSQ_LOOKUP_I_MASK ".(0x0ffff>>(16-$invsq_i_shift))."\n";
+print "static long INVSQ_LOOKUP_I[$iisz+1]={\n";
+for($i=0;$i<=$iisz;){
+ print "\t";
+ for($j=0;$j<4 && $i<=$iisz;$j++){
+ my$indexmap=$i++/$iisz*.5+.5;
+ printf "%8d,", int(1./sqrt($indexmap)*65536.+.5);
+ }
+ print "\n";
+}
+print "};\n\n";
+
+$cisz=0x10000>>$cos_i_shift;
+print "#define COS_LOOKUP_I_SHIFT $cos_i_shift\n";
+print "#define COS_LOOKUP_I_MASK ".(0x0ffff>>(16-$cos_i_shift))."\n";
+print "#define COS_LOOKUP_I_SZ $cisz\n";
+print "static long COS_LOOKUP_I[COS_LOOKUP_I_SZ+1]={\n";
+
+for($i=0;$i<=$cisz;){
+ print "\t";
+ for($j=0;$j<4 && $i<=$cisz;$j++){
+ printf "%8d,", int(cos(3.14159265358979323846*($i++)/$cos_sz)*16384.+.5) ;
+ }
+ print "\n";
+}
+print "};\n\n";
+
+
+print "#endif\n\n#endif\n";
+
+
********************************************************************
function: LPC low level routines
- last mod: $Id: lpc.c,v 1.25 2000/08/23 10:16:57 xiphmont Exp $
+ last mod: $Id: lpc.c,v 1.26 2000/10/12 03:12:53 xiphmont Exp $
********************************************************************/
/* Input : n elements of time doamin data
Output: m lpc coefficients, excitation energy */
-double vorbis_lpc_from_data(double *data,double *lpc,int n,int m){
- double *aut=alloca(sizeof(double)*(m+1));
- double error;
+float vorbis_lpc_from_data(float *data,float *lpc,int n,int m){
+ float *aut=alloca(sizeof(float)*(m+1));
+ float error;
int i,j;
/* autocorrelation, p+1 lag coefficients */
j=m+1;
while(j--){
- double d=0;
+ float d=0;
for(i=j;i<n;i++)d+=data[i]*data[i-j];
aut[j]=d;
}
error=aut[0];
if(error==0){
- memset(lpc,0,m*sizeof(double));
+ memset(lpc,0,m*sizeof(float));
return 0;
}
for(i=0;i<m;i++){
- double r=-aut[i+1];
+ float r=-aut[i+1];
/* Sum up this iteration's reflection coefficient; note that in
Vorbis we don't save it. If anyone wants to recycle this code
lpc[i]=r;
for(j=0;j<i/2;j++){
- double tmp=lpc[j];
+ float tmp=lpc[j];
lpc[j]+=r*lpc[i-1-j];
lpc[i-1-j]+=r*tmp;
}
/* Input : n element envelope spectral curve
Output: m lpc coefficients, excitation energy */
-double vorbis_lpc_from_curve(double *curve,double *lpc,lpc_lookup *l){
+float vorbis_lpc_from_curve(float *curve,float *lpc,lpc_lookup *l){
int n=l->ln;
int m=l->m;
- double *work=alloca(sizeof(double)*(n+n));
- double fscale=.5/n;
+ float *work=alloca(sizeof(float)*(n+n));
+ float fscale=.5/n;
int i,j;
/* input is a real curve. make it complex-real */
most of the power in the edges. */
for(i=0,j=n/2;i<n/2;){
- double temp=work[i];
+ float temp=work[i];
work[i++]=work[j];
work[j++]=temp;
}
}
}
-void vorbis_lpc_predict(double *coeff,double *prime,int m,
- double *data,long n){
+void vorbis_lpc_predict(float *coeff,float *prime,int m,
+ float *data,long n){
/* in: coeff[0...m-1] LPC coefficients
prime[0...m-1] initial values (allocated size of n+m-1)
out: data[0...n-1] data samples */
long i,j,o,p;
- double y;
- double *work=alloca(sizeof(double)*(m+n));
+ float y;
+ float *work=alloca(sizeof(float)*(m+n));
if(!prime)
for(i=0;i<m;i++)
data[i]=work[o]=y;
}
}
+
+
+
+
+
********************************************************************
function: LPC low level routines
- last mod: $Id: lpc.h,v 1.13 2000/08/23 10:16:57 xiphmont Exp $
+ last mod: $Id: lpc.h,v 1.14 2000/10/12 03:12:53 xiphmont Exp $
********************************************************************/
extern void lpc_clear(lpc_lookup *l);
/* simple linear scale LPC code */
-extern double vorbis_lpc_from_data(double *data,double *lpc,int n,int m);
-extern double vorbis_lpc_from_curve(double *curve,double *lpc,lpc_lookup *l);
-
-extern void vorbis_lpc_predict(double *coeff,double *prime,int m,
- double *data,long n);
+extern float vorbis_lpc_from_data(float *data,float *lpc,int n,int m);
+extern float vorbis_lpc_from_curve(float *curve,float *lpc,lpc_lookup *l);
+extern void vorbis_lpc_predict(float *coeff,float *prime,int m,
+ float *data,long n);
#endif
********************************************************************
function: LSP (also called LSF) conversion routines
- last mod: $Id: lsp.c,v 1.9 2000/08/19 11:46:28 xiphmont Exp $
+ last mod: $Id: lsp.c,v 1.10 2000/10/12 03:12:53 xiphmont Exp $
The LSP generation code is taken (with minimal modification) from
"On the Computation of the LSP Frequencies" by Joseph Rothweiler
LPC f response) which in turn should be impossible in our use of
the code. If this *does* happen anyway, it's a bug in the floor
finder; find the cause of the confusion (probably a single bin
- spike or accidental near-double-limit resolution problems) and
+ spike or accidental near-float-limit resolution problems) and
correct it. */
#include <math.h>
#include "lsp.h"
#include "os.h"
#include "misc.h"
+#include "lookup.h"
+#include "scales.h"
-void vorbis_lsp_to_curve(double *curve,int n,double *lsp,int m,double amp,
- double *w){
- int i,j,k;
- double *coslsp=alloca(m*sizeof(double));
- for(i=0;i<m;i++)coslsp[i]=2*cos(lsp[i]);
-
- for(k=0;k<n;k++){
- double p=.70710678118654752440;
- double q=.70710678118654752440;
- for(j=0;j<m;){
- p*= *w-coslsp[j++];
- q*= *w-coslsp[j++];
+/* three possible LSP to f curve functions; the exact computation
+ (float), a lookup based float implementation, and an integer
+ implementation. The float lookup is likely the optimal choice on
+ any machine with an FPU. The integer implementation is *not* fixed
+ point (due to the need for a large dynamic range and thus a
+ seperately tracked exponent) and thus much more complex than the
+ relatively simple float implementations. It's mostly for future
+ work on a fully fixed point implementation for processors like the
+ ARM family. */
+
+/* undefine both for the 'old' but more precise implementation */
+#define FLOAT_LOOKUP
+#undef INT_LOOKUP
+
+#ifdef FLOAT_LOOKUP
+#include "lookup.c" /* catch this in the build system; we #include for
+ compilers (like gcc) that can't inline across
+ modules */
+
+/* side effect: changes *lsp to cosines of lsp */
+void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln,float *lsp,int m,
+ float amp,float ampoffset){
+ int i;
+ float wdel=M_PI/ln;
+ for(i=0;i<m;i++)lsp[i]=vorbis_coslook(lsp[i]);
+
+ i=0;
+ while(i<n){
+ int j,k=map[i];
+ int qexp;
+ float p=.7071067812;
+ float q=.7071067812;
+ float w=vorbis_coslook(wdel*k);
+
+ for(j=0;j<m;j+=2) p *= lsp[j]-w;
+ for(j=1;j<m;j+=2) q *= lsp[j]-w;
+
+ q=frexp(p*p*(1.+w)+q*q*(1.-w),&qexp);
+ q=vorbis_fromdBlook(amp*
+ vorbis_invsqlook(q)*
+ vorbis_invsq2explook(qexp+m)-
+ ampoffset);
+
+ curve[i++]=q;
+ while(map[i]==k)curve[i++]=q;
+ }
+}
+
+#else
+
+#ifdef INT_LOOKUP
+#include "lookup.c" /* catch this in the build system; we #include for
+ compilers (like gcc) that can't inline across
+ modules */
+
+static int MLOOP_1[64]={
+ 0,10,11,11, 12,12,12,12, 13,13,13,13, 13,13,13,13,
+ 14,14,14,14, 14,14,14,14, 14,14,14,14, 14,14,14,14,
+ 15,15,15,15, 15,15,15,15, 15,15,15,15, 15,15,15,15,
+ 15,15,15,15, 15,15,15,15, 15,15,15,15, 15,15,15,15,
+};
+
+static int MLOOP_2[64]={
+ 0,4,5,5, 6,6,6,6, 7,7,7,7, 7,7,7,7,
+ 8,8,8,8, 8,8,8,8, 8,8,8,8, 8,8,8,8,
+ 9,9,9,9, 9,9,9,9, 9,9,9,9, 9,9,9,9,
+ 9,9,9,9, 9,9,9,9, 9,9,9,9, 9,9,9,9,
+};
+
+static int MLOOP_3[8]={0,1,2,2,3,3,3,3};
+
+
+/* side effect: changes *lsp to cosines of lsp */
+void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln,float *lsp,int m,
+ float amp,float ampoffset){
+
+ /* 0 <= m < 256 */
+
+ /* set up for using all int later */
+ int i;
+ int ampoffseti=rint(ampoffset*4096.);
+ int ampi=rint(amp*16.);
+ long *ilsp=alloca(m*sizeof(long));
+ for(i=0;i<m;i++)ilsp[i]=vorbis_coslook_i(lsp[i]/M_PI*65536.+.5);
+
+ i=0;
+ while(i<n){
+ int j,k=map[i];
+ unsigned long pi=46341; /* 2**-.5 in 0.16 */
+ unsigned long qi=46341;
+ int qexp=0,shift;
+ long wi=vorbis_coslook_i(k*65536/ln);
+
+ pi*=labs(ilsp[0]-wi);
+ qi*=labs(ilsp[1]-wi);
+
+ for(j=2;j<m;j+=2){
+ if(!(shift=MLOOP_1[(pi|qi)>>25]))
+ if(!(shift=MLOOP_2[(pi|qi)>>19]))
+ shift=MLOOP_3[(pi|qi)>>16];
+ pi=(pi>>shift)*labs(ilsp[j]-wi);
+ qi=(qi>>shift)*labs(ilsp[j+1]-wi);
+ qexp+=shift;
}
- curve[k]=amp/sqrt(p*p*(1.+ *w*.5)+q*q*(1.- *w*.5));
- w++;
+ if(!(shift=MLOOP_1[(pi|qi)>>25]))
+ if(!(shift=MLOOP_2[(pi|qi)>>19]))
+ shift=MLOOP_3[(pi|qi)>>16];
+ pi>>=shift;
+ qi>>=shift;
+ qexp+=shift-7*m;
+
+ /* pi,qi normalized collectively, both tracked using qexp */
+
+ /* p*=p(1-w), q*=q(1+w), let normalization drift because it isn't
+ worth tracking step by step */
+
+ pi=((pi*pi)>>16);
+ qi=((qi*qi)>>16);
+ qexp=qexp*2+m;
+
+ qi*=(1<<14)-wi;
+ pi*=(1<<14)+wi;
+
+ qi=(qi+pi)>>14;
+
+ /* we've let the normalization drift because it wasn't important;
+ however, for the lookup, things must be normalized again. We
+ need at most one right shift or a number of left shifts */
+
+ if(qi&0xffff0000){ /* checks for 1.xxxxxxxxxxxxxxxx */
+ qi>>=1; qexp++;
+ }else
+ while(qi && !(qi&0x8000)){ /* checks for 0.0xxxxxxxxxxxxxxx or less*/
+ qi<<=1; qexp--;
+ }
+
+ amp=vorbis_fromdBlook_i(ampi* /* n.4 */
+ vorbis_invsqlook_i(qi,qexp)-
+ /* m.8, m+n<=8 */
+ ampoffseti); /* 8.12[0] */
+
+ curve[i]=amp;
+ while(map[++i]==k)curve[i]=amp;
+ }
+}
+
+#else
+
+/* old, nonoptimized but simple version for any poor sap who needs to
+ figure out what the hell this code does, or wants the other tiny
+ fraction of a dB precision */
+
+/* side effect: changes *lsp to cosines of lsp */
+void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln,float *lsp,int m,
+ float amp,float ampoffset){
+ int i;
+ float wdel=M_PI/ln;
+ for(i=0;i<m;i++)lsp[i]=2*cos(lsp[i]);
+
+ i=0;
+ while(i<n){
+ int j,k=map[i];
+ float p=.5;
+ float q=.5;
+ float w=2*cos(wdel*k);
+ for(j=0;j<m;j+=2){
+ p *= w-lsp[j];
+ q *= w-lsp[j+1];
+ }
+ p*=p*(2.+w);
+ q*=q*(2.-w);
+ q=fromdB(amp/sqrt(p+q)-ampoffset);
+
+ curve[i]=q;
+ while(map[++i]==k)curve[i]=q;
}
}
-static void cheby(double *g, int ord) {
+#endif
+#endif
+
+static void cheby(float *g, int ord) {
int i, j;
g[0] *= 0.5;
}
static int comp(const void *a,const void *b){
- if(*(double *)a<*(double *)b)
+ if(*(float *)a<*(float *)b)
return(1);
else
return(-1);
}
-/* CACM algorithm 283. */
-static void cacm283(double *a,int ord,double *r){
- int i, k;
- double val, p, delta, error;
- double rooti;
+/* This is one of those 'mathemeticians should not write code' kind of
+ cases. Newton's method of polishing roots is straightforward
+ enough... except in those cases where it just fails in the real
+ world. In our case below, we're worried about a local mini/maxima
+ shooting a root estimation off to infinity, or the new estimation
+ chaotically oscillating about convergence (shouldn't actually be a
+ problem in our usage.
+
+ Maehly's modification (zero suppression, to prevent two tenative
+ roots from collapsing to the same actual root) similarly can
+ temporarily shoot a root off toward infinity. It would come
+ back... if it were not for the fact that machine representation has
+ limited dynamic range and resolution. This too is guarded by
+ limiting delta.
- for(i=0; i<ord;i++) r[i] = 2.0 * (i+0.5) / ord - 1.0;
+ Last problem is convergence criteria; we don't know what a 'double'
+ is on our hardware/compiler, and the convergence limit is bounded
+ by roundoff noise. So, we hack convergence:
+
+ Require at most 1e-6 mean squared error for all zeroes. When
+ converging, start the clock ticking at 1e-6; limit our polishing to
+ as many more iterations as took us to get this far, 100 max.
+
+ Past max iters, quit when MSE is no longer decreasing *or* we go
+ below ~1e-20 MSE, whichever happens first. */
+
+static void Newton_Raphson_Maehly(float *a,int ord,float *r){
+ int i, k, count=0, maxiter=0;
+ double error=1.,besterror=1.;
+ double *root=alloca(ord*sizeof(double));
+
+ for(i=0; i<ord;i++) root[i] = 2.0 * (i+0.5) / ord - 1.0;
- for(error=1 ; error > 1.e-12; ) {
- error = 0;
- for( i=0; i<ord; i++) { /* Update each point. */
- rooti = r[i];
- val = a[ord];
- p = a[ord];
+ while(error>1.e-20){
+ error=0;
+
+ for(i=0; i<ord; i++) { /* Update each point. */
+ double ac=0.,pp=0.,delta;
+ double rooti=root[i];
+ double p=a[ord];
for(k=ord-1; k>= 0; k--) {
- val = val * rooti + a[k];
- if (k != i) p *= rooti - r[k];
+
+ pp= pp* rooti + p;
+ p = p * rooti+ a[k];
+ if (k != i) ac += 1./(rooti - root[k]);
}
- delta = val/p;
- r[i] -= delta;
+ ac=p*ac;
+
+ delta = p/(pp-ac);
+
+ /* don't allow the correction to scream off into infinity if we
+ happened to polish right at a local mini/maximum */
+ if(delta<-3)delta=-3;
+ if(delta>3.)delta=3.; /* 3 is not a random choice; it's large
+ enough to make sure the first pass
+ can't accidentally limit two poles to
+ the same value in a fatal nonelastic
+ collision. */
+
+ root[i] -= delta;
error += delta*delta;
}
+
+ if(maxiter && count>maxiter && error>=besterror)break;
+
+ /* anything to help out the polisher; converge using doubles */
+ if(!count || error<besterror){
+ for(i=0; i<ord; i++) r[i]=root[i];
+ besterror=error;
+ if(error<1.e-6){ /* rough minimum criteria */
+ maxiter=count*2+10;
+ if(maxiter>100)maxiter=100;
+ }
+ }
+
+ count++;
}
-
+
/* Replaced the original bubble sort with a real sort. With your
help, we can eliminate the bubble sort in our lifetime. --Monty */
- qsort(r,ord,sizeof(double),comp);
+ qsort(r,ord,sizeof(float),comp);
}
/* Convert lpc coefficients to lsp coefficients */
-void vorbis_lpc_to_lsp(double *lpc,double *lsp,int m){
+void vorbis_lpc_to_lsp(float *lpc,float *lsp,int m){
int order2=m/2;
- double *g1=alloca(sizeof(double)*(order2+1));
- double *g2=alloca(sizeof(double)*(order2+1));
- double *g1r=alloca(sizeof(double)*(order2+1));
- double *g2r=alloca(sizeof(double)*(order2+1));
+ float *g1=alloca(sizeof(float)*(order2+1));
+ float *g2=alloca(sizeof(float)*(order2+1));
+ float *g1r=alloca(sizeof(float)*(order2+1));
+ float *g2r=alloca(sizeof(float)*(order2+1));
int i;
/* Compute the lengths of the x polynomials. */
/* Find the roots of the 2 even polynomials.*/
- cacm283(g1,order2,g1r);
- cacm283(g2,order2,g2r);
+ Newton_Raphson_Maehly(g1,order2,g1r);
+ Newton_Raphson_Maehly(g2,order2,g2r);
for(i=0;i<m;i+=2){
lsp[i] = acos(g1r[i/2]);
********************************************************************
function: LSP (also called LSF) conversion routines
- last mod: $Id: lsp.h,v 1.4 2000/08/19 11:46:28 xiphmont Exp $
+ last mod: $Id: lsp.h,v 1.5 2000/10/12 03:12:53 xiphmont Exp $
********************************************************************/
#ifndef _V_LSP_H_
#define _V_LSP_H_
-extern void vorbis_lpc_to_lsp(double *lpc,double *lsp,int m);
-extern void vorbis_lsp_to_curve(double *curve,int n,
- double *lsp,int m,double amp,
- double *w);
+extern void vorbis_lpc_to_lsp(float *lpc,float *lsp,int m);
+
+extern void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln,
+ float *lsp,int m,
+ float amp,float ampoffset);
#endif
********************************************************************
function: channel mapping 0 implementation
- last mod: $Id: mapping0.c,v 1.15 2000/08/15 09:09:43 xiphmont Exp $
+ last mod: $Id: mapping0.c,v 1.16 2000/10/12 03:12:53 xiphmont Exp $
********************************************************************/
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#include <ogg/ogg.h>
#include "vorbis/codec.h"
#include "vorbis/backends.h"
-#include "bitwise.h"
#include "bookinternal.h"
#include "registry.h"
#include "psy.h"
vorbis_func_residue **residue_func;
int ch;
- double **decay;
+ float **decay;
long lastframe; /* if a different mode is called, we need to
invalidate decay */
} vorbis_look_mapping0;
-static void free_info(vorbis_info_mapping *i){
+static void mapping0_free_info(vorbis_info_mapping *i){
if(i){
memset(i,0,sizeof(vorbis_info_mapping0));
free(i);
}
}
-static void free_look(vorbis_look_mapping *look){
+static void mapping0_free_look(vorbis_look_mapping *look){
int i;
vorbis_look_mapping0 *l=(vorbis_look_mapping0 *)look;
if(l){
}
}
-static vorbis_look_mapping *look(vorbis_dsp_state *vd,vorbis_info_mode *vm,
+static vorbis_look_mapping *mapping0_look(vorbis_dsp_state *vd,vorbis_info_mode *vm,
vorbis_info_mapping *m){
int i;
vorbis_info *vi=vd->vi;
look->ch=vi->channels;
if(vi->psys){
- look->decay=calloc(vi->channels,sizeof(double *));
+ look->decay=calloc(vi->channels,sizeof(float *));
for(i=0;i<vi->channels;i++)
- look->decay[i]=calloc(vi->blocksizes[vm->blockflag]/2,sizeof(double));
+ look->decay[i]=calloc(vi->blocksizes[vm->blockflag]/2,sizeof(float));
}
return(look);
}
-static void pack(vorbis_info *vi,vorbis_info_mapping *vm,oggpack_buffer *opb){
+static void mapping0_pack(vorbis_info *vi,vorbis_info_mapping *vm,oggpack_buffer *opb){
int i;
vorbis_info_mapping0 *info=(vorbis_info_mapping0 *)vm;
- _oggpack_write(opb,info->submaps-1,4);
+ oggpack_write(opb,info->submaps-1,4);
/* we don't write the channel submappings if we only have one... */
if(info->submaps>1){
for(i=0;i<vi->channels;i++)
- _oggpack_write(opb,info->chmuxlist[i],4);
+ oggpack_write(opb,info->chmuxlist[i],4);
}
for(i=0;i<info->submaps;i++){
- _oggpack_write(opb,info->timesubmap[i],8);
- _oggpack_write(opb,info->floorsubmap[i],8);
- _oggpack_write(opb,info->residuesubmap[i],8);
+ oggpack_write(opb,info->timesubmap[i],8);
+ oggpack_write(opb,info->floorsubmap[i],8);
+ oggpack_write(opb,info->residuesubmap[i],8);
}
}
/* also responsible for range checking */
-static vorbis_info_mapping *unpack(vorbis_info *vi,oggpack_buffer *opb){
+static vorbis_info_mapping *mapping0_unpack(vorbis_info *vi,oggpack_buffer *opb){
int i;
vorbis_info_mapping0 *info=calloc(1,sizeof(vorbis_info_mapping0));
memset(info,0,sizeof(vorbis_info_mapping0));
- info->submaps=_oggpack_read(opb,4)+1;
+ info->submaps=oggpack_read(opb,4)+1;
if(info->submaps>1){
for(i=0;i<vi->channels;i++){
- info->chmuxlist[i]=_oggpack_read(opb,4);
+ info->chmuxlist[i]=oggpack_read(opb,4);
if(info->chmuxlist[i]>=info->submaps)goto err_out;
}
}
for(i=0;i<info->submaps;i++){
- info->timesubmap[i]=_oggpack_read(opb,8);
+ info->timesubmap[i]=oggpack_read(opb,8);
if(info->timesubmap[i]>=vi->times)goto err_out;
- info->floorsubmap[i]=_oggpack_read(opb,8);
+ info->floorsubmap[i]=oggpack_read(opb,8);
if(info->floorsubmap[i]>=vi->floors)goto err_out;
- info->residuesubmap[i]=_oggpack_read(opb,8);
+ info->residuesubmap[i]=oggpack_read(opb,8);
if(info->residuesubmap[i]>=vi->residues)goto err_out;
}
return info;
err_out:
- free_info(info);
+ mapping0_free_info(info);
return(NULL);
}
-#include <stdio.h>
#include "os.h"
#include "lpc.h"
#include "lsp.h"
#include "envelope.h"
#include "mdct.h"
#include "psy.h"
-#include "bitwise.h"
-#include "spectrum.h"
#include "scales.h"
/* no time mapping implementation for now */
static long seq=0;
-static int forward(vorbis_block *vb,vorbis_look_mapping *l){
+static int mapping0_forward(vorbis_block *vb,vorbis_look_mapping *l){
vorbis_dsp_state *vd=vb->vd;
vorbis_info *vi=vd->vi;
vorbis_look_mapping0 *look=(vorbis_look_mapping0 *)l;
vorbis_info_mode *mode=look->mode;
int n=vb->pcmend;
int i,j;
- double *window=vd->window[vb->W][vb->lW][vb->nW][mode->windowtype];
+ float *window=vd->window[vb->W][vb->lW][vb->nW][mode->windowtype];
- double **pcmbundle=alloca(sizeof(double *)*vi->channels);
+ float **pcmbundle=alloca(sizeof(float *)*vi->channels);
int *nonzero=alloca(sizeof(int)*vi->channels);
/* time domain pre-window: NONE IMPLEMENTED */
/* window the PCM data: takes PCM vector, vb; modifies PCM vector */
for(i=0;i<vi->channels;i++){
- double *pcm=vb->pcm[i];
+ float *pcm=vb->pcm[i];
for(j=0;j<n;j++)
pcm[j]*=window[j];
}
/* transform the PCM data; takes PCM vector, vb; modifies PCM vector */
/* only MDCT right now.... */
for(i=0;i<vi->channels;i++){
- double *pcm=vb->pcm[i];
+ float *pcm=vb->pcm[i];
mdct_forward(vd->transform[vb->W][0],pcm,pcm);
}
{
- double *floor=_vorbis_block_alloc(vb,n*sizeof(double)/2);
+ float *floor=_vorbis_block_alloc(vb,n*sizeof(float)/2);
for(i=0;i<vi->channels;i++){
- double *pcm=vb->pcm[i];
- double *decay=look->decay[i];
+ float *pcm=vb->pcm[i];
+ float *decay=look->decay[i];
int submap=info->chmuxlist[i];
/* if some other mode/mapping was called last frame, our decay
accumulator is out of date. Clear it. */
if(look->lastframe+1 != vb->sequence)
- memset(decay,0,n*sizeof(double)/2);
+ memset(decay,0,n*sizeof(float)/2);
/* perform psychoacoustics; do masking */
_vp_compute_mask(look->psy_look+submap,pcm,floor,decay);
return(0);
}
-static int inverse(vorbis_block *vb,vorbis_look_mapping *l){
+static int mapping0_inverse(vorbis_block *vb,vorbis_look_mapping *l){
vorbis_dsp_state *vd=vb->vd;
vorbis_info *vi=vd->vi;
vorbis_look_mapping0 *look=(vorbis_look_mapping0 *)l;
int i,j;
long n=vb->pcmend=vi->blocksizes[vb->W];
- double *window=vd->window[vb->W][vb->lW][vb->nW][mode->windowtype];
- double **pcmbundle=alloca(sizeof(double *)*vi->channels);
+ float *window=vd->window[vb->W][vb->lW][vb->nW][mode->windowtype];
+ float **pcmbundle=alloca(sizeof(float *)*vi->channels);
int *nonzero=alloca(sizeof(int)*vi->channels);
/* time domain information decode (note that applying the
/* recover the spectral envelope; store it in the PCM vector for now */
for(i=0;i<vi->channels;i++){
- double *pcm=vb->pcm[i];
+ float *pcm=vb->pcm[i];
int submap=info->chmuxlist[i];
nonzero[i]=look->floor_func[submap]->
inverse(vb,look->floor_look[submap],pcm);
/* transform the PCM data; takes PCM vector, vb; modifies PCM vector */
/* only MDCT right now.... */
for(i=0;i<vi->channels;i++){
- double *pcm=vb->pcm[i];
+ float *pcm=vb->pcm[i];
_analysis_output("out",seq+i,pcm,n/2,0,1);
mdct_backward(vd->transform[vb->W][0],pcm,pcm);
}
/* window the data */
for(i=0;i<vi->channels;i++){
- double *pcm=vb->pcm[i];
+ float *pcm=vb->pcm[i];
if(nonzero[i])
for(j=0;j<n;j++)
pcm[j]*=window[j];
/* export hooks */
vorbis_func_mapping mapping0_exportbundle={
- &pack,&unpack,&look,&free_info,&free_look,&forward,&inverse
+ &mapping0_pack,&mapping0_unpack,&mapping0_look,&mapping0_free_info,
+ &mapping0_free_look,&mapping0_forward,&mapping0_inverse
};
********************************************************************
function: masking curve data for psychoacoustics
- last mod: $Id: masking.h,v 1.4 2000/08/15 09:09:43 xiphmont Exp $
+ last mod: $Id: masking.h,v 1.5 2000/10/12 03:12:53 xiphmont Exp $
********************************************************************/
#define _V_MASKING_H_
/* Not really an ATH, more a bottom curve to limit LSP dynamic range */
-double ATH_Bark_dB[]={
+float ATH_Bark_dB[]={
15, 15, 15, 15, 11, 10, 8, 7, 7, 7,
6, 2, 0, 0, -3, -5, -6, -6, -4.5, 2.5,
10, 15, 15, 15, 15, 15, 15};
#define EHMER_OFFSET 16
#define EHMER_MAX 56
-double tone_125_40dB_SL[EHMER_MAX]={
+float tone_125_40dB_SL[EHMER_MAX]={
30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 29, 27, 26, 25, 23, 21,
20, 18, 16, 14, 12, 11, 9, 7, 5, 3, 2, 0, -2, -4, -6, -8,
-10, -12, -14, -16, -18, -20, -23, -25, -28,-30,-34,-37,-40,-44,-48,-52,
-900,-900,-900,-900,-900,-900,-900,-900};
-double tone_125_60dB_SL[EHMER_MAX]={
+float tone_125_60dB_SL[EHMER_MAX]={
50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 49, 47, 46, 45, 43, 41,
40, 38, 36, 34, 32, 31, 29, 27, 25, 23, 22, 20, 18, 16, 14, 12,
10, 8, 6, 4, 2, 0, -3, -5, -8,-10,-14,-17,-20,-24,-28,-32,
-900,-900,-900,-900,-900,-900,-900,-900};
-double tone_125_80dB_SL[EHMER_MAX]={
+float tone_125_80dB_SL[EHMER_MAX]={
70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 69, 67, 66, 65, 63, 61,
60, 58, 56, 54, 52, 51, 49, 47, 45, 43, 42, 40, 38, 36, 34, 32,
30, 28, 26, 24, 22, 20, 17, 15, 12, 10, 6, 3, 0, -4, -8,-12,
-900,-900,-900,-900,-900,-900,-900,-900};
-double tone_125_100dB_SL[EHMER_MAX]={
+float tone_125_100dB_SL[EHMER_MAX]={
85, 85, 85, 85, 85, 85, 85, 85, 85, 84, 84, 83, 82, 81, 80, 79,
78, 77, 75, 74, 73, 72, 71, 70, 69, 68, 67, 65, 64, 63, 62, 60,
58, 57, 55, 54, 52, 50, 48, 46, 44, 42, 40, 38, 36, 34, 31, 29,
27, 24, 22, 20, 18, 15, 13, 11};
-double tone_250_40dB_SL[EHMER_MAX]={
+float tone_250_40dB_SL[EHMER_MAX]={
-900,-900,-900,-900,-900,-900,-900,-900, -19, -13, -7, -1, 4, 9, 15, 20,
22, 23, 22, 19, 18, 18, 16, 13, 9, 7, 3, 1, -1, -3, -6, -8,
-10, -13, -16, -19, -21, -24, -28, -32, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900};
-double tone_250_60dB_SL[EHMER_MAX]={
+float tone_250_60dB_SL[EHMER_MAX]={
-900,-900,-900,-900,-900,-900,-900, -10, -5, 1, 7, 13, 19, 25, 30, 33,
36, 39, 38, 37, 38, 39, 39, 40, 38, 36, 35, 34, 33, 31, 29, 28,
28, 28, 25, 20, 14, 10, 5, 0, -5,-10,-15,-20,-25,-30,-35,-40,
-900,-900,-900,-900,-900,-900,-900,-900};
-double tone_250_80dB_SL[EHMER_MAX]={
+float tone_250_80dB_SL[EHMER_MAX]={
-900,-900,-900,-900,-900,-900,-900, -10, 10, 17, 24, 30, 37, 41, 48, 49,
50, 53, 54, 53, 53, 54, 55, 57, 57, 57, 58, 59, 60, 58, 57, 58,
59, 58, 57, 54, 52, 50, 49, 47, 46, 47, 46, 44, 43, 42, 41, 40,
38, 32, 27, 22, 17, 11, 6, 0};
/* no data, just interpolated from 80 */
-double tone_250_100dB_SL[EHMER_MAX]={
+float tone_250_100dB_SL[EHMER_MAX]={
-900,-900,-900,-900,-900,-900,-900, -10, 15, 25, 34, 40, 50, 56, 60, 70,
70, 73, 74, 73, 73, 74, 75, 77, 77, 77, 78, 79, 80, 78, 77, 78,
79, 78, 77, 74, 72, 70, 69, 67, 66, 67, 66, 64, 63, 62, 61, 60,
58, 52, 47, 42, 37, 31, 26, 20};
-double tone_500_40dB_SL[EHMER_MAX]={
+float tone_500_40dB_SL[EHMER_MAX]={
-900,-900,-900,-900,-900,-900,-900, -40, -26, -20, -14, -8, -2, 4, 10, 17,
23, 16, 12, 9, 6, 3, 0, -3, -7, -10, -13, -16, -20, -23, -26, -30,
-900,-900,-900,-900,-900,-900,-900,-900, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900};
-double tone_500_60dB_SL[EHMER_MAX]={
+float tone_500_60dB_SL[EHMER_MAX]={
-900,-900,-900,-900,-900,-900,-900,-900, -18, -12, -6, 0, 6, 13, 20, 30,
39, 34, 31, 29, 29, 27, 24, 21, 18, 16, 13, 8, 6, 3, 1, -1,
-5, -2, -5, -8, -12, -15, -18, -22, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900};
-double tone_500_80dB_SL[EHMER_MAX]={
+float tone_500_80dB_SL[EHMER_MAX]={
-900,-900,-900,-900,-900,-900,-900,-900, -22,-16,-10, 0, 10, 20, 32, 43,
53, 52, 52, 50, 49, 50, 52, 55, 55, 54, 51, 49, 46, 44, 44, 42,
38, 34, 32, 29, 29, 28, 25, 23, 20, 16, 10, 7, 4, 2, -1, -4,
-7, -10, -15, -20, -25, -30, -35, -40};
-double tone_500_100dB_SL[EHMER_MAX]={
+float tone_500_100dB_SL[EHMER_MAX]={
-900,-900,-900,-900,-900,-900,-900, -10, -7, 2, 10, 19, 27, 35, 55, 56,
62, 61, 60, 58, 57, 57, 59, 63, 65, 66, 62, 60, 57, 57, 58, 58,
57, 56, 56, 56, 57, 57, 56, 57, 57, 54, 47, 41, 37, 28, 21, 16,
10, 3, -3, -8, -13, -18, -23, -28};
-double tone_1000_40dB_SL[EHMER_MAX]={
+float tone_1000_40dB_SL[EHMER_MAX]={
-900,-900,-900,-900,-900,-900,-900,-900, -55, -40, -30, -20, -10, 0, 9, 20,
27, 20, 13, 14, 13, 5, -1, -6, -11, -20, -30,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900};
-double tone_1000_60dB_SL[EHMER_MAX]={
+float tone_1000_60dB_SL[EHMER_MAX]={
-900,-900,-900,-900,-900,-900,-900, -43, -33,-23,-13, -3, 7, 17, 25, 37,
42, 33, 25, 25, 23, 18, 13, 9, 4, -1, -7,-13,-18, -23, -28, -33,
-900,-900,-900,-900,-900,-900,-900,-900, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900};
-double tone_1000_80dB_SL[EHMER_MAX]={
+float tone_1000_80dB_SL[EHMER_MAX]={
-900,-900,-900,-900,-900,-900,-900, -35, -25,-14, -4, 6, 16, 27, 33, 50,
59, 57, 47, 41, 40, 43, 47, 48, 47, 42, 39, 37, 37, 36, 35, 32,
30, 27, 21, 15, 5, -2, -10, -18, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900};
-double tone_1000_100dB_SL[EHMER_MAX]={
+float tone_1000_100dB_SL[EHMER_MAX]={
-900,-900,-900,-900,-900,-900, -40, -30, -20,-10, 0, 10, 23, 33, 45, 60,
70, 72, 55, 49, 43, 40, 44, 54, 59, 58, 49, 43, 52, 57, 57, 58,
58, 54, 49, 47, 42, 39, 33, 28, 20, 15, 5, 0, -5,-15,-20,-25,
-900,-900,-900,-900,-900,-900,-900,-900};
-double tone_2000_40dB_SL[EHMER_MAX]={
+float tone_2000_40dB_SL[EHMER_MAX]={
-900,-900,-900,-900,-900,-900,-900,-900, -40, -30, -21, -12, -3, 5, 12, 20,
24, 21, 14, 5, -5, -15, -25, -35, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900};
-double tone_2000_60dB_SL[EHMER_MAX]={
+float tone_2000_60dB_SL[EHMER_MAX]={
-900,-900,-900,-900,-900,-900,-900,-900, -40, -30, -21, -12, -2, 8, 19, 31,
38, 34, 24, 17, 14, 13, 11, 7, 3, -2, -6, -10, -14, -20, -26, -32,
-900,-900,-900,-900,-900,-900,-900,-900, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900};
-double tone_2000_80dB_SL[EHMER_MAX]={
+float tone_2000_80dB_SL[EHMER_MAX]={
-900,-900,-900,-900,-900,-900,-900,-900, -40, -30, -21, -12, -2, 13, 28, 40,
51, 51, 43, 35, 28, 29, 35, 37, 37, 35, 31, 28, 25, 22, 19, 15,
11, 8, 6, 2, -6, -14, -22, -30, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900};
-double tone_2000_100dB_SL[EHMER_MAX]={
+float tone_2000_100dB_SL[EHMER_MAX]={
-900,-900,-900,-900,-900,-900,-900,-900, -40, -30, -21, -10, 6, 25, 42, 60,
66, 60, 53, 43, 35, 31, 34, 47, 58, 51, 43, 45, 54, 59, 59, 56,
54, 51, 40, 29, 20, 11, 2, -8, -17, -26, -35,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900};
-double tone_4000_40dB_SL[EHMER_MAX]={
+float tone_4000_40dB_SL[EHMER_MAX]={
-900,-900,-900,-900,-900,-900,-900,-900, -40, -30, -21, -12, 0, 3, 10, 18,
24, 21, 14, 5, -5, -15, -25, -35, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900};
-double tone_4000_60dB_SL[EHMER_MAX]={
+float tone_4000_60dB_SL[EHMER_MAX]={
-900,-900,-900,-900,-900,-900,-900,-900, -40, -30, -21, -12, -2, 8, 19, 31,
38, 33, 28, 23, 19, 14, 11, 8, 3, -2, -7, -12, -17, -22, -27, -37,
-900,-900,-900,-900,-900,-900,-900,-900, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900};
-double tone_4000_80dB_SL[EHMER_MAX]={
+float tone_4000_80dB_SL[EHMER_MAX]={
-900,-900,-900,-900,-900,-900,-900,-900, -60, -50, -40, -29, -12, 5, 19, 37,
51, 49, 40, 35, 36, 36, 36, 33, 32, 24, 18, 8, -3, -12, -20, -29,
-900,-900,-900,-900,-900,-900,-900,-900, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900};
-double tone_4000_100dB_SL[EHMER_MAX]={
+float tone_4000_100dB_SL[EHMER_MAX]={
-20, -12, -8, -4, 0, 4, 8, 11, 15, 22, 26, 28, 32, 36, 43, 52,
62, 59, 50, 48, 50, 50, 45, 36, 45, 30, 20, 10, 0, -10, -19, -28,
-37,-900,-900,-900,-900,-900,-900,-900, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900};
-double tone_8000_40dB_SL[EHMER_MAX]={
+float tone_8000_40dB_SL[EHMER_MAX]={
-900,-900,-900,-900,-900,-900,-900, -50, -41, -30, -21, -12, 0, 3, 10, 18,
23, 20, 16, 15, 16, 18, 21, 23, 25, 27, 29, 32, 35, 38, 41, 44,
47, 50, 55, 60, 85,-900,-900,-900, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900};
-double tone_8000_60dB_SL[EHMER_MAX]={
+float tone_8000_60dB_SL[EHMER_MAX]={
-900,-900,-900,-900,-900,-900,-900, -10, -21, -18, -14, -10, 0, 3, 15, 30,
43, 40, 36, 35, 36, 38, 41, 43, 45, 47, 49, 52, 55, 58, 61, 64,
67, 70, 75, 80,-900,-900,-900,-900, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900};
-double tone_8000_80dB_SL[EHMER_MAX]={
+float tone_8000_80dB_SL[EHMER_MAX]={
-900,-900,-900,-900,-900,-900,-900, -10, -1, 2, 6, 10, 13, 19, 25, 35,
63, 60, 56, 55, 56, 58, 61, 63, 65, 70, 75, 80, 85, 90, 95, 100,
100, 100, 100, 100,-900,-900,-900,-900, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900};
-double tone_8000_100dB_SL[EHMER_MAX]={
+float tone_8000_100dB_SL[EHMER_MAX]={
-18, -12, -7, -3, 0, 2, 6, 9, 12, 19, 22, 21, 19, 21, 40, 40,
80, 60, 35, 25, 15, 5, -5, -15, -25, -35,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900};
#if 0 /* not used for the time being */
-double noise_500_60dB_SL[EHMER_MAX]={
+float noise_500_60dB_SL[EHMER_MAX]={
-900,-900,-900,-900,-900, -20, -11, -2, 7, 16, 25, 34, 43, 52, 61, 66,
69, 68, 58, 50, 44, 38, 32, 28, 25, 24, 20, 18, 17, 12, 10, 8,
5, 0, -5, -8, -12, -15, -18, -22, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900};
-double noise_500_80dB_SL[EHMER_MAX]={
+float noise_500_80dB_SL[EHMER_MAX]={
-900,-900,-900, -20, -10, -1, 8, 17, 26, 35, 44, 53, 62, 70, 79, 83,
85, 85, 81, 77, 74, 71, 68, 63, 61, 59, 56, 55, 54, 52, 48, 47,
45, 46, 45, 43, 40, 37, 33, 32, 35, 32, 30, 29, 20, 10, 0, -10,
-20, -30,-900,-900,-900,-900,-900,-900};
-double noise_1000_60dB_SL[EHMER_MAX]={
+float noise_1000_60dB_SL[EHMER_MAX]={
-900,-900,-900,-900, -24, -15, -6, 3, 12, 21, 28, 34, 40, 48, 57, 60,
61, 56, 54, 45, 36, 27, 21, 19, 17, 13, 10, 0, -10, -20, -20,-900,
-900,-900,-900,-900,-900,-900,-900,-900, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900};
-double noise_1000_80dB_SL[EHMER_MAX]={
+float noise_1000_80dB_SL[EHMER_MAX]={
-900, -26, -17, -8, 1, 10, 19, 28, 37, 41, 46, 51, 58, 68, 74, 81,
80, 81, 70, 66, 58, 61, 59, 55, 54, 53, 52, 49, 48, 42, 38, 38,
39, 34, 30, 27, 20, 10, 0, -10, -20, -30,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900};
-double noise_2000_60dB_SL[EHMER_MAX]={
+float noise_2000_60dB_SL[EHMER_MAX]={
-900,-900,-900, -34, -25, -16, -7, 2, 11, 18, 23, 30, 35, 42, 51, 58,
58, 57, 50, 40,-900,-900,-900,-900, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900};
-double noise_2000_80dB_SL[EHMER_MAX]={
+float noise_2000_80dB_SL[EHMER_MAX]={
-900, -26, -17, -8, 1, 10, 19, 28, 33, 38, 43, 48, 53, 62, 70, 77,
77, 75, 70, 67, 68, 66, 62, 61, 60, 59, 52, 47, 39, 35, 34, 35,
35, 33, 30, 27, 20, 10, 0, -10, -20, -30,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900};
-double noise_4000_60dB_SL[EHMER_MAX]={
+float noise_4000_60dB_SL[EHMER_MAX]={
-900,-900,-900, -34, -25, -16, -7, 2, 11, 20, 25, 31, 37, 45, 56, 62,
64, 61,-900,-900,-900,-900,-900,-900, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900, -900,-900,-900,-900,-900,-900,-900,-900,
-900,-900,-900,-900,-900,-900,-900,-900};
-double noise_4000_80dB_SL[EHMER_MAX]={
+float noise_4000_80dB_SL[EHMER_MAX]={
-900, -26, -17, -8, 1, 10, 19, 26, 33, 39, 45, 50, 55, 65, 75, 82,
84, 81, 78, 72, 70, 69, 66, 61, 50, 48, 46, 40, 35, 30, 25, 20,
15, 10, 5, 0, -10, -20, -30,-900, -900,-900,-900,-900,-900,-900,-900,-900,
function: normalized modified discrete cosine transform
power of two length transform only [16 <= n ]
- last mod: $Id: mdct.c,v 1.16 2000/03/10 13:21:18 xiphmont Exp $
+ last mod: $Id: mdct.c,v 1.17 2000/10/12 03:12:53 xiphmont Exp $
Algorithm adapted from _The use of multirate filter banks for coding
of high quality digital audio_, by T. Sporer, K. Brandenburg and
void mdct_init(mdct_lookup *lookup,int n){
int *bitrev=malloc(sizeof(int)*(n/4));
- double *trig=malloc(sizeof(double)*(n+n/4));
- double *AE=trig;
- double *AO=trig+1;
- double *BE=AE+n/2;
- double *BO=BE+1;
- double *CE=BE+n/2;
- double *CO=CE+1;
+ float *trig=malloc(sizeof(float)*(n+n/4));
+ float *AE=trig;
+ float *AO=trig+1;
+ float *BE=AE+n/2;
+ float *BO=BE+1;
+ float *CE=BE+n/2;
+ float *CO=CE+1;
int i;
int log2n=lookup->log2n=rint(log(n)/log(2));
}
}
-static double *_mdct_kernel(double *x, double *w,
+static float *_mdct_kernel(float *x, float *w,
int n, int n2, int n4, int n8,
mdct_lookup *init){
int i;
/* step 2 */
{
- double *xA=x+n4;
- double *xB=x;
- double *w2=w+n4;
- double *A=init->trig+n2;
+ float *xA=x+n4;
+ float *xB=x;
+ float *w2=w+n4;
+ float *A=init->trig+n2;
for(i=0;i<n4;){
- double x0=*xA - *xB;
- double x1;
+ float x0=*xA - *xB;
+ float x1;
w2[i]= *xA++ + *xB++;
int k0=n>>(i+2);
int k1=1<<(i+3);
int wbase=n2-2;
- double *A=init->trig;
- double *temp;
+ float *A=init->trig;
+ float *temp;
for(r=0;r<(k0>>2);r++){
int w1=wbase;
int w2=w1-(k0>>1);
- double AEv= A[0],wA;
- double AOv= A[1],wB;
+ float AEv= A[0],wA;
+ float AOv= A[1],wB;
wbase-=2;
k0++;
/* step 4, 5, 6, 7 */
{
- double *C=init->trig+n;
+ float *C=init->trig+n;
int *bit=init->bitrev;
- double *x1=x;
- double *x2=x+n2-1;
+ float *x1=x;
+ float *x2=x+n2-1;
for(i=0;i<n8;i++){
int t1=*bit++;
int t2=*bit++;
- double wA=w[t1]-w[t2+1];
- double wB=w[t1-1]+w[t2];
- double wC=w[t1]+w[t2+1];
- double wD=w[t1-1]-w[t2];
+ float wA=w[t1]-w[t2+1];
+ float wB=w[t1-1]+w[t2];
+ float wC=w[t1]+w[t2+1];
+ float wD=w[t1-1]-w[t2];
- double wACE=wA* *C;
- double wBCE=wB* *C++;
- double wACO=wA* *C;
- double wBCO=wB* *C++;
+ float wACE=wA* *C;
+ float wBCE=wB* *C++;
+ float wACO=wA* *C;
+ float wBCO=wB* *C++;
*x1++=( wC+wACO+wBCE)*.5;
*x2--=(-wD+wBCO-wACE)*.5;
return(x);
}
-void mdct_forward(mdct_lookup *init, double *in, double *out){
+void mdct_forward(mdct_lookup *init, float *in, float *out){
int n=init->n;
- double *x=alloca(sizeof(double)*(n/2));
- double *w=alloca(sizeof(double)*(n/2));
- double *xx;
+ float *x=alloca(sizeof(float)*(n/2));
+ float *w=alloca(sizeof(float)*(n/2));
+ float *xx;
int n2=n>>1;
int n4=n>>2;
int n8=n>>3;
/* window + rotate + step 1 */
{
- double tempA,tempB;
+ float tempA,tempB;
int in1=n2+n4-4;
int in2=in1+5;
- double *A=init->trig+n2;
+ float *A=init->trig+n2;
i=0;
/* step 8 */
{
- double *B=init->trig+n2;
- double *out2=out+n2;
- double scale=4./n;
+ float *B=init->trig+n2;
+ float *out2=out+n2;
+ float scale=4./n;
for(i=0;i<n4;i++){
out[i] =(xx[0]*B[0]+xx[1]*B[1])*scale;
*(--out2)=(xx[0]*B[1]-xx[1]*B[0])*scale;
}
}
-void mdct_backward(mdct_lookup *init, double *in, double *out){
+void mdct_backward(mdct_lookup *init, float *in, float *out){
int n=init->n;
- double *x=alloca(sizeof(double)*(n/2));
- double *w=alloca(sizeof(double)*(n/2));
- double *xx;
+ float *x=alloca(sizeof(float)*(n/2));
+ float *w=alloca(sizeof(float)*(n/2));
+ float *xx;
int n2=n>>1;
int n4=n>>2;
int n8=n>>3;
/* rotate + step 1 */
{
- double *inO=in+1;
- double *xO= x;
- double *A=init->trig+n2;
+ float *inO=in+1;
+ float *xO= x;
+ float *A=init->trig+n2;
for(i=0;i<n8;i++){
A-=2;
/* step 8 */
{
- double *B=init->trig+n2;
+ float *B=init->trig+n2;
int o1=n4,o2=o1-1;
int o3=n4+n2,o4=o3-1;
for(i=0;i<n4;i++){
- double temp1= (*xx * B[1] - *(xx+1) * B[0]);
- double temp2=-(*xx * B[0] + *(xx+1) * B[1]);
+ float temp1= (*xx * B[1] - *(xx+1) * B[0]);
+ float temp2=-(*xx * B[0] + *(xx+1) * B[1]);
out[o1]=-temp1;
out[o2]= temp1;
********************************************************************
function: modified discrete cosine transform prototypes
- last mod: $Id: mdct.h,v 1.11 2000/06/18 12:33:47 xiphmont Exp $
+ last mod: $Id: mdct.h,v 1.12 2000/10/12 03:12:53 xiphmont Exp $
********************************************************************/
int n;
int log2n;
- double *trig;
+ float *trig;
int *bitrev;
} mdct_lookup;
extern void mdct_init(mdct_lookup *lookup,int n);
extern void mdct_clear(mdct_lookup *l);
-extern void mdct_forward(mdct_lookup *init, double *in, double *out);
-extern void mdct_backward(mdct_lookup *init, double *in, double *out);
+extern void mdct_forward(mdct_lookup *init, float *in, float *out);
+extern void mdct_backward(mdct_lookup *init, float *in, float *out);
#endif
********************************************************************
function: miscellaneous prototypes
- last mod: $Id: misc.h,v 1.4 2000/05/08 20:49:49 xiphmont Exp $
+ last mod: $Id: misc.h,v 1.5 2000/10/12 03:12:53 xiphmont Exp $
********************************************************************/
extern void *_vorbis_block_alloc(vorbis_block *vb,long bytes);
extern void _vorbis_block_ripcord(vorbis_block *vb);
-extern void _analysis_output(char *base,int i,double *v,int n,int bark,int dB);
+extern void _analysis_output(char *base,int i,float *v,int n,int bark,int dB);
#ifdef DEBUG_LEAKS
extern void *_VDBG_malloc(void *ptr,long bytes,char *file,long line);
********************************************************************
function: #ifdef jail to whip a few platforms into the UNIX ideal.
- last mod: $Id: os.h,v 1.9 2000/08/23 06:38:49 xiphmont Exp $
+ last mod: $Id: os.h,v 1.10 2000/10/12 03:12:53 xiphmont Exp $
********************************************************************/
#endif
-#ifdef USE_ALLOCA_H
+#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
# define max(x,y) ((x)<(y)?(y):(x))
#endif
-#include "../include/vorbis/os_types.h"
-
#endif /* _OS_H */
-
-
-
********************************************************************
function: psychoacoustics not including preecho
- last mod: $Id: psy.c,v 1.28 2000/09/07 13:23:44 msmith Exp $
+ last mod: $Id: psy.c,v 1.29 2000/10/12 03:12:53 xiphmont Exp $
********************************************************************/
/* Set up decibel threshhold slopes on a Bark frequency scale */
/* ATH is the only bit left on a Bark scale. No reason to change it
right now */
-static void set_curve(double *ref,double *c,int n, double crate){
+static void set_curve(float *ref,float *c,int n, float crate){
int i,j=0;
for(i=0;i<MAX_BARK-1;i++){
int endpos=rint(fromBARK(i+1)*2*n/crate);
- double base=ref[i];
+ float base=ref[i];
if(j<endpos){
- double delta=(ref[i+1]-base)/(endpos-j);
+ float delta=(ref[i+1]-base)/(endpos-j);
for(;j<endpos && j<n;j++){
c[j]=base;
base+=delta;
}
}
-static void min_curve(double *c,
- double *c2){
+static void min_curve(float *c,
+ float *c2){
int i;
for(i=0;i<EHMER_MAX;i++)if(c2[i]<c[i])c[i]=c2[i];
}
-static void max_curve(double *c,
- double *c2){
+static void max_curve(float *c,
+ float *c2){
int i;
for(i=0;i<EHMER_MAX;i++)if(c2[i]>c[i])c[i]=c2[i];
}
-static void attenuate_curve(double *c,double att){
+static void attenuate_curve(float *c,float att){
int i;
for(i=0;i<EHMER_MAX;i++)
c[i]+=att;
}
-static void linear_curve(double *c){
+static void linear_curve(float *c){
int i;
for(i=0;i<EHMER_MAX;i++)
if(c[i]<=-200.)
c[i]=fromdB(c[i]);
}
-static void interp_curve(double *c,double *c1,double *c2,double del){
+static void interp_curve(float *c,float *c1,float *c2,float del){
int i;
for(i=0;i<EHMER_MAX;i++)
c[i]=c2[i]*del+c1[i]*(1.-del);
}
-static void setup_curve(double **c,
+static void setup_curve(float **c,
int band,
- double *curveatt_dB){
+ float *curveatt_dB){
int i,j;
- double ath[EHMER_MAX];
- double tempc[P_LEVELS][EHMER_MAX];
+ float ath[EHMER_MAX];
+ float tempc[P_LEVELS][EHMER_MAX];
- memcpy(c[0],c[4],sizeof(double)*EHMER_MAX);
- memcpy(c[2],c[4],sizeof(double)*EHMER_MAX);
+ memcpy(c[0],c[4],sizeof(float)*EHMER_MAX);
+ memcpy(c[2],c[4],sizeof(float)*EHMER_MAX);
/* we add back in the ATH to avoid low level curves falling off to
-infinity and unneccessarily cutting off high level curves in the
mask too little than too much, so be pessimal. */
for(i=0;i<EHMER_MAX;i++){
- double oc_min=band*.5-1+(i-EHMER_OFFSET)*.125;
- double oc_max=band*.5-1+(i-EHMER_OFFSET+1)*.125;
- double bark=toBARK(fromOC(oc_min));
+ float oc_min=band*.5-1+(i-EHMER_OFFSET)*.125;
+ float oc_max=band*.5-1+(i-EHMER_OFFSET+1)*.125;
+ float bark=toBARK(fromOC(oc_min));
int ibark=floor(bark);
- double del=bark-ibark;
- double ath_min,ath_max;
+ float del=bark-ibark;
+ float ath_min,ath_max;
if(ibark<26)
ath_min=ATH_Bark_dB[ibark]*(1.-del)+ATH_Bark_dB[ibark+1]*del;
/* make temp curves with the ATH overlayed */
for(i=0;i<P_LEVELS;i++){
attenuate_curve(c[i],curveatt_dB[i]);
- memcpy(tempc[i],ath,EHMER_MAX*sizeof(double));
+ memcpy(tempc[i],ath,EHMER_MAX*sizeof(float));
attenuate_curve(tempc[i],-i*10.);
max_curve(tempc[i],c[i]);
}
void _vp_psy_init(vorbis_look_psy *p,vorbis_info_psy *vi,int n,long rate){
long i,j;
memset(p,0,sizeof(vorbis_look_psy));
- p->ath=malloc(n*sizeof(double));
+ p->ath=malloc(n*sizeof(float));
p->octave=malloc(n*sizeof(int));
- p->bark=malloc(n*sizeof(double));
+ p->bark=malloc(n*sizeof(float));
p->vi=vi;
p->n=n;
p->octave[i]=oc;
}
- p->tonecurves=malloc(P_BANDS*sizeof(double **));
- p->noiseatt=malloc(P_BANDS*sizeof(double **));
- p->peakatt=malloc(P_BANDS*sizeof(double *));
+ p->tonecurves=malloc(P_BANDS*sizeof(float **));
+ p->noiseatt=malloc(P_BANDS*sizeof(float **));
+ p->peakatt=malloc(P_BANDS*sizeof(float *));
for(i=0;i<P_BANDS;i++){
- p->tonecurves[i]=malloc(P_LEVELS*sizeof(double *));
- p->noiseatt[i]=malloc(P_LEVELS*sizeof(double));
- p->peakatt[i]=malloc(P_LEVELS*sizeof(double));
+ p->tonecurves[i]=malloc(P_LEVELS*sizeof(float *));
+ p->noiseatt[i]=malloc(P_LEVELS*sizeof(float));
+ p->peakatt[i]=malloc(P_LEVELS*sizeof(float));
}
for(i=0;i<P_BANDS;i++)
for(j=0;j<P_LEVELS;j++){
- p->tonecurves[i][j]=malloc(EHMER_MAX*sizeof(double));
+ p->tonecurves[i][j]=malloc(EHMER_MAX*sizeof(float));
}
/* OK, yeah, this was a silly way to do it */
- memcpy(p->tonecurves[0][4],tone_125_40dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[0][6],tone_125_60dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[0][8],tone_125_80dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[0][10],tone_125_100dB_SL,sizeof(double)*EHMER_MAX);
-
- memcpy(p->tonecurves[2][4],tone_125_40dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[2][6],tone_125_60dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[2][8],tone_125_80dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[2][10],tone_125_100dB_SL,sizeof(double)*EHMER_MAX);
-
- memcpy(p->tonecurves[4][4],tone_250_40dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[4][6],tone_250_60dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[4][8],tone_250_80dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[4][10],tone_250_100dB_SL,sizeof(double)*EHMER_MAX);
-
- memcpy(p->tonecurves[6][4],tone_500_40dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[6][6],tone_500_60dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[6][8],tone_500_80dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[6][10],tone_500_100dB_SL,sizeof(double)*EHMER_MAX);
-
- memcpy(p->tonecurves[8][4],tone_1000_40dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[8][6],tone_1000_60dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[8][8],tone_1000_80dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[8][10],tone_1000_100dB_SL,sizeof(double)*EHMER_MAX);
-
- memcpy(p->tonecurves[10][4],tone_2000_40dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[10][6],tone_2000_60dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[10][8],tone_2000_80dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[10][10],tone_2000_100dB_SL,sizeof(double)*EHMER_MAX);
-
- memcpy(p->tonecurves[12][4],tone_4000_40dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[12][6],tone_4000_60dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[12][8],tone_4000_80dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[12][10],tone_4000_100dB_SL,sizeof(double)*EHMER_MAX);
-
- memcpy(p->tonecurves[14][4],tone_8000_40dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[14][6],tone_8000_60dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[14][8],tone_8000_80dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[14][10],tone_8000_100dB_SL,sizeof(double)*EHMER_MAX);
-
- memcpy(p->tonecurves[16][4],tone_8000_40dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[16][6],tone_8000_60dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[16][8],tone_8000_80dB_SL,sizeof(double)*EHMER_MAX);
- memcpy(p->tonecurves[16][10],tone_8000_100dB_SL,sizeof(double)*EHMER_MAX);
+ memcpy(p->tonecurves[0][4],tone_125_40dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[0][6],tone_125_60dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[0][8],tone_125_80dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[0][10],tone_125_100dB_SL,sizeof(float)*EHMER_MAX);
+
+ memcpy(p->tonecurves[2][4],tone_125_40dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[2][6],tone_125_60dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[2][8],tone_125_80dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[2][10],tone_125_100dB_SL,sizeof(float)*EHMER_MAX);
+
+ memcpy(p->tonecurves[4][4],tone_250_40dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[4][6],tone_250_60dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[4][8],tone_250_80dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[4][10],tone_250_100dB_SL,sizeof(float)*EHMER_MAX);
+
+ memcpy(p->tonecurves[6][4],tone_500_40dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[6][6],tone_500_60dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[6][8],tone_500_80dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[6][10],tone_500_100dB_SL,sizeof(float)*EHMER_MAX);
+
+ memcpy(p->tonecurves[8][4],tone_1000_40dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[8][6],tone_1000_60dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[8][8],tone_1000_80dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[8][10],tone_1000_100dB_SL,sizeof(float)*EHMER_MAX);
+
+ memcpy(p->tonecurves[10][4],tone_2000_40dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[10][6],tone_2000_60dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[10][8],tone_2000_80dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[10][10],tone_2000_100dB_SL,sizeof(float)*EHMER_MAX);
+
+ memcpy(p->tonecurves[12][4],tone_4000_40dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[12][6],tone_4000_60dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[12][8],tone_4000_80dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[12][10],tone_4000_100dB_SL,sizeof(float)*EHMER_MAX);
+
+ memcpy(p->tonecurves[14][4],tone_8000_40dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[14][6],tone_8000_60dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[14][8],tone_8000_80dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[14][10],tone_8000_100dB_SL,sizeof(float)*EHMER_MAX);
+
+ memcpy(p->tonecurves[16][4],tone_8000_40dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[16][6],tone_8000_60dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[16][8],tone_8000_80dB_SL,sizeof(float)*EHMER_MAX);
+ memcpy(p->tonecurves[16][10],tone_8000_100dB_SL,sizeof(float)*EHMER_MAX);
/* interpolate curves between */
for(i=1;i<P_BANDS;i+=2)
for(j=4;j<P_LEVELS;j+=2){
- memcpy(p->tonecurves[i][j],p->tonecurves[i-1][j],EHMER_MAX*sizeof(double));
+ memcpy(p->tonecurves[i][j],p->tonecurves[i-1][j],EHMER_MAX*sizeof(float));
/*interp_curve(p->tonecurves[i][j],
p->tonecurves[i-1][j],
p->tonecurves[i+1][j],.5);*/
}
}
-static void compute_decay_fixed(vorbis_look_psy *p,double *f, double *decay, int n){
+static void compute_decay_fixed(vorbis_look_psy *p,float *f, float *decay, int n){
/* handle decay */
int i;
- double decscale=fromdB(p->vi->decay_coeff*n);
- double attscale=1./fromdB(p->vi->attack_coeff);
+ float decscale=fromdB(p->vi->decay_coeff*n);
+ float attscale=1./fromdB(p->vi->attack_coeff);
for(i=10;i<n;i++){
- double pre=decay[i];
+ float pre=decay[i];
if(decay[i]){
- double val=decay[i]*decscale;
- double att=fabs(f[i]/val);
+ float val=decay[i]*decscale;
+ float att=fabs(f[i]/val);
if(att>attscale)
decay[i]=fabs(f[i]/attscale);
88752,96785,105545,115097,
125515};
-static int seed_curve(double *flr,
- double **curves,
- double amp,double specmax,
- int x,int n,double specatt,
+static int seed_curve(float *flr,
+ float **curves,
+ float amp,float specmax,
+ int x,int n,float specatt,
int maxEH){
int i;
- double *curve;
+ float *curve;
/* make this attenuation adjustable */
int choice=(int)((todB(amp)-specmax+specatt)/10.+.5);
if(curve[i]>0.)break;
for(;i>=0;i--){
- double lin=curve[i];
+ float lin=curve[i];
if(lin>0.){
- double *fp=flr+((x*_eights[i])>>12);
+ float *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){
+static void seed_peak(float *flr,
+ float *att,
+ float amp,float specmax,
+ int x,int n,float specatt){
int prevx=(x*_eights[16])>>12;
/* make this attenuation adjustable */
if(choice>=P_LEVELS)choice=P_LEVELS-1;
if(prevx<n){
- double lin=att[choice];
+ float lin=att[choice];
if(lin){
lin*=amp;
if(flr[prevx]<lin)flr[prevx]=lin;
}
static void seed_generic(vorbis_look_psy *p,
- double ***curves,
- double *f,
- double *flr,
- double *seeds,
- double specmax){
+ float ***curves,
+ float *f,
+ float *flr,
+ float *seeds,
+ float specmax){
vorbis_info_psy *vi=p->vi;
long n=p->n,i;
int maxEH=EHMER_MAX-1;
}
static void seed_att(vorbis_look_psy *p,
- double **att,
- double *f,
- double *flr,
- double specmax){
+ float **att,
+ float *f,
+ float *flr,
+ float specmax){
vorbis_info_psy *vi=p->vi;
long n=p->n,i;
}
static void seed_point(vorbis_look_psy *p,
- double **att,
- double *f,
- double *flr,
- double specmax){
+ float **att,
+ float *f,
+ float *flr,
+ float specmax){
vorbis_info_psy *vi=p->vi;
long n=p->n,i;
for(i=0;i<n;i++){
/* make this attenuation adjustable */
int choice=rint((todB(f[i])-specmax+vi->max_curve_dB)/10.+.5);
- double lin;
+ float lin;
if(choice<0)choice=0;
if(choice>=P_LEVELS)choice=P_LEVELS-1;
lin=att[p->octave[i]][choice]*f[i];
}
/* bleaugh, this is more complicated than it needs to be */
-static void max_seeds(vorbis_look_psy *p,double *seeds,double *flr){
+static void max_seeds(vorbis_look_psy *p,float *seeds,float *flr){
long n=p->n,i,j;
long *posstack=alloca(n*sizeof(long));
- double *ampstack=alloca(n*sizeof(double));
+ float *ampstack=alloca(n*sizeof(float));
long stack=0;
for(i=0;i<n;i++){
had in Grad Skool... I didn't solve it at the time ;-) */
}
-static void bark_noise(long n,double *b,double *f,double *noise){
+static void bark_noise(long n,float *b,float *f,float *noise){
long i=1,lo=0,hi=2;
- double acc=0.,val,del=0.;
+ float acc=0.,val,del=0.;
- double *norm=alloca(n*sizeof(double));
+ float *norm=alloca(n*sizeof(float));
- memset(noise,0,n*sizeof(double));
- memset(norm,0,n*sizeof(double));
+ memset(noise,0,n*sizeof(float));
+ memset(norm,0,n*sizeof(float));
while(hi<n){
- val=todB(f[i]*f[i])+400.;
+ val=todB_nn(f[i]*f[i])+400.;
del=1./(i-lo);
noise[lo]+=val*del;
noise[i]-=val*del;
long hii=hi-i;
for(;i<n;i++){
- val=todB(f[i]*f[i])+400.;
+ val=todB_nn(f[i]*f[i])+400.;
del=1./(hii);
noise[i]-=val*del;
norm[i]-=del;
norm[i]-=del;
}
for(i=1,lo=n-ilo;lo<n;lo++,i++){
- val=todB(f[n-i]*f[n-i])+400.;
+ val=todB_nn(f[n-i]*f[n-i])+400.;
del=1./ilo;
noise[lo]+=val*del;
norm[lo]+=del;
noise[i]=0.;
norm[i]=0;
}else{
- double v=acc/val-400;
+ float v=acc/val-400;
noise[i]=sqrt(fromdB(v));
}
}
}
-void _vp_compute_mask(vorbis_look_psy *p,double *f,
- double *flr,
- double *decay){
- double *smooth=alloca(sizeof(double)*p->n);
+void _vp_compute_mask(vorbis_look_psy *p,float *f,
+ float *flr,
+ float *decay){
+ float *smooth=alloca(sizeof(float)*p->n);
int i,n=p->n;
- double specmax=0.;
+ float specmax=0.;
- double *seed=alloca(sizeof(double)*p->n);
- double *seed2=alloca(sizeof(double)*p->n);
+ float *seed=alloca(sizeof(float)*p->n);
+ float *seed2=alloca(sizeof(float)*p->n);
- memset(flr,0,n*sizeof(double));
+ memset(flr,0,n*sizeof(float));
/* noise masking */
if(p->vi->noisemaskp){
- memset(seed,0,n*sizeof(double));
+ memset(seed,0,n*sizeof(float));
bark_noise(n,p->bark,f,seed);
seed_point(p,p->noiseatt,seed,flr,specmax);
/* compute power^.5 of three neighboring bins to smooth for peaks
that get split twixt bins/peaks that nail the bin. This evens
out treatment as we're not doing additive masking any longer. */
- double acc=smooth[0]*smooth[0]+smooth[1]*smooth[1];
- double prev=smooth[0];
+ float acc=smooth[0]*smooth[0]+smooth[1]*smooth[1];
+ float prev=smooth[0];
smooth[0]=sqrt(acc);
for(i=1;i<n-1;i++){
- double this=smooth[i];
+ float this=smooth[i];
acc+=smooth[i+1]*smooth[i+1];
if(acc<0)acc=0; /* it can happen due to finite precision */
smooth[i]=sqrt(acc);
acc-=prev*prev;
prev=this;
}
- if(acc<0)acc=0; /* in case it happens on the final iteration */
+ if(acc<0)acc=0; /* in case it happens on the final iteration */
smooth[n-1]=sqrt(acc);
}
/* set the ATH (floating below specmax by a specified att) */
if(p->vi->athp){
- double att=specmax+p->vi->ath_adjatt;
+ float att=specmax+p->vi->ath_adjatt;
if(att<p->vi->ath_maxatt)att=p->vi->ath_maxatt;
att=fromdB(att);
for(i=0;i<n;i++){
- double av=p->ath[i]*att;
+ float av=p->ath[i]*att;
if(av>flr[i])flr[i]=av;
}
}
/* peak attenuation ******/
if(p->vi->peakattp){
- memset(seed,0,n*sizeof(double));
+ memset(seed,0,n*sizeof(float));
seed_att(p,p->peakatt,smooth,seed,specmax);
max_seeds(p,seed,flr);
}
/* tone masking */
if(p->vi->tonemaskp){
- memset(seed,0,n*sizeof(double));
- memset(seed2,0,n*sizeof(double));
+ memset(seed,0,n*sizeof(float));
+ memset(seed2,0,n*sizeof(float));
seed_generic(p,p->tonecurves,smooth,flr,seed2,specmax);
max_seeds(p,seed2,seed2);
it than to just tack it on */
for(i=0;i<n;i++)if(2.*f[i]>flr[i] || -2.*f[i]>flr[i])break;
- if(i==n)memset(flr,0,sizeof(double)*n);
+ if(i==n)memset(flr,0,sizeof(float)*n);
}
/* this applies the floor and (optionally) tries to preserve noise
energy in low resolution portions of the spectrum */
/* f and flr are *linear* scale, not dB */
-void _vp_apply_floor(vorbis_look_psy *p,double *f, double *flr){
- double *work=alloca(p->n*sizeof(double));
+void _vp_apply_floor(vorbis_look_psy *p,float *f, float *flr){
+ float *work=alloca(p->n*sizeof(float));
int j;
/* subtract the floor */
work[j]=f[j]/flr[j];
}
- memcpy(f,work,p->n*sizeof(double));
+ memcpy(f,work,p->n*sizeof(float));
}
********************************************************************
function: random psychoacoustics (not including preecho)
- last mod: $Id: psy.h,v 1.14 2000/08/15 09:09:43 xiphmont Exp $
+ last mod: $Id: psy.h,v 1.15 2000/10/12 03:12:53 xiphmont Exp $
********************************************************************/
int n;
struct vorbis_info_psy *vi;
- double ***tonecurves;
- double **peakatt;
- double **noiseatt;
+ float ***tonecurves;
+ float **peakatt;
+ float **noiseatt;
- double *ath;
+ float *ath;
int *octave;
- double *bark;
+ float *bark;
} vorbis_look_psy;
extern void _vp_psy_clear(vorbis_look_psy *p);
extern void *_vi_psy_dup(void *source);
extern void _vi_psy_free(vorbis_info_psy *i);
-extern void _vp_compute_mask(vorbis_look_psy *p,double *f,
- double *floor,
- double *decay);
-extern void _vp_apply_floor(vorbis_look_psy *p,double *f,double *flr);
+extern void _vp_compute_mask(vorbis_look_psy *p,float *f,
+ float *floor,
+ float *decay);
+extern void _vp_apply_floor(vorbis_look_psy *p,float *f,float *flr);
#endif
function: simple utility that runs audio through the psychoacoustics
without encoding
- last mod: $Id: psytune.c,v 1.6 2000/08/19 11:46:28 xiphmont Exp $
+ last mod: $Id: psytune.c,v 1.7 2000/10/12 03:12:53 xiphmont Exp $
********************************************************************/
#include "window.h"
#include "scales.h"
#include "lpc.h"
+#include "lsp.h"
static vorbis_info_psy _psy_set0={
1,/*athp*/
};
static int noisy=0;
-void analysis(char *base,int i,double *v,int n,int bark,int dB){
+void analysis(char *base,int i,float *v,int n,int bark,int dB){
if(noisy){
int j;
FILE *of;
if(bark)
fprintf(of,"%g ",toBARK(22050.*j/n));
else
- fprintf(of,"%g ",(double)j);
+ fprintf(of,"%g ",(float)j);
if(dB){
fprintf(of,"%g\n",todB(fabs(v[j])));
lpc_lookup lpclook;
} vorbis_look_floor0;
-extern double _curve_to_lpc(double *curve,double *lpc,vorbis_look_floor0 *l,
- long frameno);
-extern void _lsp_to_curve(double *curve,double *lpc,double amp,
- vorbis_look_floor0 *l,char *name,long frameno);
-
-long frameno=0;
+long granulepos=0;
/* hacked from floor0.c */
static void floorinit(vorbis_look_floor0 *look,int n,int m,int ln){
int j;
- double scale;
+ float scale;
look->m=m;
look->n=n;
look->ln=ln;
int main(int argc,char *argv[]){
int eos=0;
- double nonz=0.;
- double acc=0.;
- double tot=0.;
+ float nonz=0.;
+ float acc=0.;
+ float tot=0.;
int framesize=2048;
int order=32;
int map=256;
- double *pcm[2],*out[2],*window,*decay[2],*lpc,*floor;
+ float *pcm[2],*out[2],*window,*decay[2],*lpc,*floor;
signed char *buffer,*buffer2;
mdct_lookup m_look;
vorbis_look_psy p_look;
argv++;
}
- pcm[0]=malloc(framesize*sizeof(double));
- pcm[1]=malloc(framesize*sizeof(double));
- out[0]=calloc(framesize/2,sizeof(double));
- out[1]=calloc(framesize/2,sizeof(double));
- decay[0]=calloc(framesize/2,sizeof(double));
- decay[1]=calloc(framesize/2,sizeof(double));
- floor=malloc(framesize*sizeof(double));
- lpc=malloc(order*sizeof(double));
+ pcm[0]=malloc(framesize*sizeof(float));
+ pcm[1]=malloc(framesize*sizeof(float));
+ out[0]=calloc(framesize/2,sizeof(float));
+ out[1]=calloc(framesize/2,sizeof(float));
+ decay[0]=calloc(framesize/2,sizeof(float));
+ decay[1]=calloc(framesize/2,sizeof(float));
+ floor=malloc(framesize*sizeof(float));
+ lpc=malloc(order*sizeof(float));
buffer=malloc(framesize*4);
buffer2=buffer+framesize*2;
window=_vorbis_window(0,framesize,framesize/2,framesize/2);
}
for(i=0;i<2;i++){
- double amp;
+ float amp;
- analysis("pre",frameno,pcm[i],framesize,0,0);
+ analysis("pre",granulepos,pcm[i],framesize,0,0);
/* do the psychacoustics */
for(j=0;j<framesize;j++)
mdct_forward(&m_look,pcm[i],pcm[i]);
- analysis("mdct",frameno,pcm[i],framesize/2,1,1);
+ analysis("mdct",granulepos,pcm[i],framesize/2,1,1);
_vp_compute_mask(&p_look,pcm[i],floor,decay[i]);
- analysis("prefloor",frameno,floor,framesize/2,1,1);
+ analysis("floor",frameno,floor,framesize/2,1,1);
analysis("decay",frameno,decay[i],framesize/2,1,1);
- for(j=0;j<framesize/2;j++)floor[j]=todB(floor[j])+150;
- amp=_curve_to_lpc(floor,lpc,&floorlook,frameno);
- vorbis_lpc_to_lsp(lpc,lpc,order);
- _lsp_to_curve(floor,lpc,sqrt(amp),&floorlook,"Ffloor",frameno);
- for(j=0;j<framesize/2;j++)floor[j]=fromdB(floor[j]-150);
- analysis("floor",frameno,floor,framesize/2,1,1);
-
_vp_apply_floor(&p_look,pcm[i],floor);
/*r(j=0;j<framesize/2;j++)
if(fabs(pcm[i][j])<1.)pcm[i][j]=0;*/
- analysis("quant",frameno,pcm[i],framesize/2,1,1);
+ analysis("quant",granulepos,pcm[i],framesize/2,1,1);
/* re-add floor */
for(j=0;j<framesize/2;j++){
- double val=rint(pcm[i][j]);
+ float val=rint(pcm[i][j]);
tot++;
if(val){
nonz++;
}
}
- analysis("final",frameno,pcm[i],framesize/2,1,1);
+ analysis("final",granulepos,pcm[i],framesize/2,1,1);
/* take it back to time */
mdct_backward(&m_look,pcm[i],pcm[i]);
for(j=0;j<framesize/2;j++)
out[i][j]+=pcm[i][j]*window[j];
- frameno++;
+ granulepos++;
}
/* write data. Use the part of buffer we're about to shift out */
for(i=0;i<2;i++){
- char *ptr=buffer+i*2;
- double *mono=out[i];
+ char *ptr=buffer+i*2;
+ float *mono=out[i];
for(j=0;j<framesize/2;j++){
int val=mono[j]*32767.;
/* might as well guard against clipping */
********************************************************************
function: residue backend 0 implementation
- last mod: $Id: res0.c,v 1.17 2000/08/15 09:09:43 xiphmont Exp $
+ last mod: $Id: res0.c,v 1.18 2000/10/12 03:12:53 xiphmont Exp $
********************************************************************/
#include <string.h>
#include <math.h>
#include <stdio.h>
+#include <ogg/ogg.h>
#include "vorbis/codec.h"
-#include "bitwise.h"
#include "registry.h"
#include "bookinternal.h"
#include "sharedbook.h"
int **decodemap;
} vorbis_look_residue0;
-void free_info(vorbis_info_residue *i){
+void res0_free_info(vorbis_info_residue *i){
if(i){
memset(i,0,sizeof(vorbis_info_residue0));
free(i);
}
}
-void free_look(vorbis_look_residue *i){
+void res0_free_look(vorbis_look_residue *i){
int j;
if(i){
vorbis_look_residue0 *look=(vorbis_look_residue0 *)i;
}
}
-void pack(vorbis_info_residue *vr,oggpack_buffer *opb){
+void res0_pack(vorbis_info_residue *vr,oggpack_buffer *opb){
vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr;
int j,acc=0;
- _oggpack_write(opb,info->begin,24);
- _oggpack_write(opb,info->end,24);
+ oggpack_write(opb,info->begin,24);
+ oggpack_write(opb,info->end,24);
- _oggpack_write(opb,info->grouping-1,24); /* residue vectors to group and
+ oggpack_write(opb,info->grouping-1,24); /* residue vectors to group and
code with a partitioned book */
- _oggpack_write(opb,info->partitions-1,6); /* possible partition choices */
- _oggpack_write(opb,info->groupbook,8); /* group huffman book */
+ oggpack_write(opb,info->partitions-1,6); /* possible partition choices */
+ oggpack_write(opb,info->groupbook,8); /* group huffman book */
for(j=0;j<info->partitions;j++){
- _oggpack_write(opb,info->secondstages[j],4); /* zero *is* a valid choice */
+ oggpack_write(opb,info->secondstages[j],4); /* zero *is* a valid choice */
acc+=info->secondstages[j];
}
for(j=0;j<acc;j++)
- _oggpack_write(opb,info->booklist[j],8);
+ oggpack_write(opb,info->booklist[j],8);
}
/* vorbis_info is for range checking */
-vorbis_info_residue *unpack(vorbis_info *vi,oggpack_buffer *opb){
+vorbis_info_residue *res0_unpack(vorbis_info *vi,oggpack_buffer *opb){
int j,acc=0;
vorbis_info_residue0 *info=calloc(1,sizeof(vorbis_info_residue0));
- info->begin=_oggpack_read(opb,24);
- info->end=_oggpack_read(opb,24);
- info->grouping=_oggpack_read(opb,24)+1;
- info->partitions=_oggpack_read(opb,6)+1;
- info->groupbook=_oggpack_read(opb,8);
+ info->begin=oggpack_read(opb,24);
+ info->end=oggpack_read(opb,24);
+ info->grouping=oggpack_read(opb,24)+1;
+ info->partitions=oggpack_read(opb,6)+1;
+ info->groupbook=oggpack_read(opb,8);
for(j=0;j<info->partitions;j++){
- int cascade=info->secondstages[j]=_oggpack_read(opb,4);
+ int cascade=info->secondstages[j]=oggpack_read(opb,4);
if(cascade>1)goto errout; /* temporary! when cascading gets
reworked and actually used, we don't
want old code to DTWT */
acc+=cascade;
}
for(j=0;j<acc;j++)
- info->booklist[j]=_oggpack_read(opb,8);
+ info->booklist[j]=oggpack_read(opb,8);
if(info->groupbook>=vi->books)goto errout;
for(j=0;j<acc;j++)
return(info);
errout:
- free_info(info);
+ res0_free_info(info);
return(NULL);
}
-vorbis_look_residue *look (vorbis_dsp_state *vd,vorbis_info_mode *vm,
+vorbis_look_residue *res0_look (vorbis_dsp_state *vd,vorbis_info_mode *vm,
vorbis_info_residue *vr){
vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr;
vorbis_look_residue0 *look=calloc(1,sizeof(vorbis_look_residue0));
/* does not guard against invalid settings; eg, a subn of 16 and a
subgroup request of 32. Max subn of 128 */
-static int _testhack(double *vec,int n,vorbis_look_residue0 *look,
+static int _testhack(float *vec,int n,vorbis_look_residue0 *look,
int auxparts,int auxpartnum){
vorbis_info_residue0 *info=look->info;
int i,j=0;
- double max,localmax=0.;
- double temp[128];
- double entropy[8];
+ float max,localmax=0.;
+ float temp[128];
+ float entropy[8];
/* setup */
for(i=0;i<n;i++)temp[i]=fabs(vec[i]);
return(i);
}
-static int _encodepart(oggpack_buffer *opb,double *vec, int n,
+static int _encodepart(oggpack_buffer *opb,float *vec, int n,
int stages, codebook **books,int mode,int part){
int i,j,bits=0;
return(bits);
}
-static int _decodepart(oggpack_buffer *opb,double *work,double *vec, int n,
+static int _decodepart(oggpack_buffer *opb,float *work,float *vec, int n,
int stages, codebook **books){
- int i,j;
+ int i;
- memset(work,0,sizeof(double)*n);
- for(j=0;j<stages;j++){
- int dim=books[j]->dim;
+ memset(work,0,sizeof(float)*n);
+ for(i=0;i<stages;i++){
+ int dim=books[i]->dim;
int step=n/dim;
- for(i=0;i<step;i++)
- if(vorbis_book_decodevs(books[j],work+i,opb,step,0)==-1)
- return(-1);
+ if(s_vorbis_book_decodevs(books[i],work,opb,step,0)==-1)
+ return(-1);
}
for(i=0;i<n;i++)
return(0);
}
-int forward(vorbis_block *vb,vorbis_look_residue *vl,
- double **in,int ch){
+int res0_forward(vorbis_block *vb,vorbis_look_residue *vl,
+ float **in,int ch){
long i,j,k,l;
vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
vorbis_info_residue0 *info=look->info;
/* we code the partition words for each channel, then the residual
words for a partition per channel until we've written all the
residual words for that partition word. Then write the next
- parition channel words... */
+ partition channel words... */
for(i=info->begin,l=0;i<info->end;){
/* first we encode a partition codeword for each channel */
}
/* a truncated packet here just means 'stop working'; it's not an error */
-int inverse(vorbis_block *vb,vorbis_look_residue *vl,double **in,int ch){
+int res0_inverse(vorbis_block *vb,vorbis_look_residue *vl,float **in,int ch){
long i,j,k,l,transend=vb->pcmend/2;
vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
vorbis_info_residue0 *info=look->info;
int partvals=n/samples_per_partition;
int partwords=(partvals+partitions_per_word-1)/partitions_per_word;
int **partword=alloca(ch*sizeof(long *));
- double *work=alloca(sizeof(double)*samples_per_partition);
+ float *work=alloca(sizeof(float)*samples_per_partition);
partvals=partwords*partitions_per_word;
/* make sure we're zeroed up to the start */
for(j=0;j<ch;j++)
- memset(in[j],0,sizeof(double)*info->begin);
+ memset(in[j],0,sizeof(float)*info->begin);
for(i=info->begin,l=0;i<info->end;){
/* fetch the partition word for each channel */
eopbreak:
if(i<transend){
for(j=0;j<ch;j++)
- memset(in[j]+i,0,sizeof(double)*(transend-i));
+ memset(in[j]+i,0,sizeof(float)*(transend-i));
}
return(0);
errout:
for(j=0;j<ch;j++)
- memset(in[j],0,sizeof(double)*transend);
+ memset(in[j],0,sizeof(float)*transend);
return(0);
}
vorbis_func_residue residue0_exportbundle={
- &pack,
- &unpack,
- &look,
- &free_info,
- &free_look,
- &forward,
- &inverse
+ &res0_pack,
+ &res0_unpack,
+ &res0_look,
+ &res0_free_info,
+ &res0_free_look,
+ &res0_forward,
+ &res0_inverse
};
********************************************************************
function: linear scale -> dB, Bark and Mel scales
- last mod: $Id: scales.h,v 1.5 2000/06/14 01:38:32 xiphmont Exp $
+ last mod: $Id: scales.h,v 1.6 2000/10/12 03:12:54 xiphmont Exp $
********************************************************************/
/* 20log10(x) */
#define DYNAMIC_RANGE_dB 200.
-#define todB(x) ((x)==0?-9.e40:log(fabs(x))*8.6858896)
+#define todB(x) ((x)==0?-9.e38:log(fabs(x))*8.6858896)
+#define todB_nn(x) ((x)==0?-9.e38:log(x)*8.6858896)
#define fromdB(x) (exp((x)*.11512925))
********************************************************************
function: basic shared codebook operations
- last mod: $Id: sharedbook.c,v 1.8 2000/08/31 08:01:34 xiphmont Exp $
+ last mod: $Id: sharedbook.c,v 1.9 2000/10/12 03:12:54 xiphmont Exp $
********************************************************************/
#include <stdlib.h>
#include <math.h>
#include <string.h>
+#include <ogg/ogg.h>
#include "os.h"
#include "vorbis/codec.h"
#include "vorbis/codebook.h"
-#include "bitwise.h"
#include "scales.h"
#include "sharedbook.h"
#define VQ_FEXP_BIAS 768 /* bias toward values smaller than 1. */
/* doesn't currently guard under/overflow */
-long _float32_pack(double val){
+long _float32_pack(float val){
int sign=0;
long exp;
long mant;
return(sign|exp|mant);
}
-double _float32_unpack(long val){
- double mant=val&0x1fffff;
- double sign=val&0x80000000;
- double exp =(val&0x7fe00000)>>VQ_FMAN;
+float _float32_unpack(long val){
+ float mant=val&0x1fffff;
+ float sign=val&0x80000000;
+ float exp =(val&0x7fe00000)>>VQ_FMAN;
if(sign)mant= -mant;
return(ldexp(mant,exp-(VQ_FMAN-1)-VQ_FEXP_BIAS));
}
/* build the decode helper tree from the codewords */
decode_aux *_make_decode_tree(codebook *c){
const static_codebook *s=c->c;
- long top=0,i,j;
+ long top=0,i,j,n;
decode_aux *t=malloc(sizeof(decode_aux));
long *ptr0=t->ptr0=calloc(c->entries*2,sizeof(long));
long *ptr1=t->ptr1=calloc(c->entries*2,sizeof(long));
}
}
free(codelist);
+
+ t->tabn = _ilog(c->entries)-4; /* this is magic */
+ if(t->tabn<5)t->tabn=5;
+ n = 1<<t->tabn;
+ t->tab = malloc(n*sizeof(long));
+ t->tabl = malloc(n*sizeof(int));
+ for (i = 0; i < n; i++) {
+ long p = 0;
+ for (j = 0; j < t->tabn && (p > 0 || j == 0); j++) {
+ if (i & (1 << j))
+ p = ptr1[p];
+ else
+ p = ptr0[p];
+ }
+ /* now j == length, and p == -code */
+ t->tab[i] = p;
+ t->tabl[i] = j;
+ }
+
return(t);
}
generated algorithmically (each column of the vector counts through
the values in the quant vector). in map type 2, all the values came
in in an explicit list. Both value lists must be unpacked */
-double *_book_unquantize(const static_codebook *b){
+float *_book_unquantize(const static_codebook *b){
long j,k;
if(b->maptype==1 || b->maptype==2){
int quantvals;
- double mindel=_float32_unpack(b->q_min);
- double delta=_float32_unpack(b->q_delta);
- double *r=calloc(b->entries*b->dim,sizeof(double));
+ float mindel=_float32_unpack(b->q_min);
+ float delta=_float32_unpack(b->q_delta);
+ float *r=calloc(b->entries*b->dim,sizeof(float));
/* maptype 1 and 2 both use a quantized value vector, but
different sizes */
that */
quantvals=_book_maptype1_quantvals(b);
for(j=0;j<b->entries;j++){
- double last=0.;
+ float last=0.;
int indexdiv=1;
for(k=0;k<b->dim;k++){
int index= (j/indexdiv)%quantvals;
- double val=b->quantlist[index];
+ float val=b->quantlist[index];
val=fabs(val)*delta+mindel+last;
if(b->q_sequencep)last=val;
r[j*b->dim+k]=val;
break;
case 2:
for(j=0;j<b->entries;j++){
- double last=0.;
+ float last=0.;
for(k=0;k<b->dim;k++){
- double val=b->quantlist[j*b->dim+k];
+ float val=b->quantlist[j*b->dim+k];
val=fabs(val)*delta+mindel+last;
if(b->q_sequencep)last=val;
r[j*b->dim+k]=val;
return(-1);
}
-static double _dist(int el,double *ref, double *b,int step){
+static float _dist(int el,float *ref, float *b,int step){
int i;
- double acc=0.;
+ float acc=0.;
for(i=0;i<el;i++){
- double val=(ref[i]-b[i*step]);
+ float val=(ref[i]-b[i*step]);
acc+=val*val;
}
return(acc);
}
#include <stdio.h>
-int _best(codebook *book, double *a, int step){
+int _best(codebook *book, float *a, int step){
encode_aux_nearestmatch *nt=book->c->nearest_tree;
encode_aux_threshmatch *tt=book->c->thresh_tree;
encode_aux_pigeonhole *pt=book->c->pigeon_tree;
int dim=book->dim;
int ptr=0,k,o;
/*int savebest=-1;
- double saverr;*/
+ float saverr;*/
/* do we have a threshhold encode hint? */
if(tt){
if(pt){
const static_codebook *c=book->c;
int i,besti=-1;
- double best;
+ float best;
int entry=0;
/* dealing with sequentialness is a pain in the ass */
if(c->q_sequencep){
int pv;
long mul=1;
- double qlast=0;
+ float qlast=0;
for(k=0,o=0;k<dim;k++,o+=step){
pv=(int)((a[o]-qlast-pt->min)/pt->del);
if(pv<0 || pv>=pt->mapentries)break;
/* search the abbreviated list */
long *list=pt->fitlist+pt->fitmap[entry];
for(i=0;i<pt->fitlength[entry];i++){
- double this=_dist(dim,book->valuelist+list[i]*dim,a,step);
+ float this=_dist(dim,book->valuelist+list[i]*dim,a,step);
if(besti==-1 || this<best){
best=this;
besti=list[i];
if(nt){
/* optimized using the decision tree */
while(1){
- double c=0.;
- double *p=book->valuelist+nt->p[ptr];
- double *q=book->valuelist+nt->q[ptr];
+ float c=0.;
+ float *p=book->valuelist+nt->p[ptr];
+ float *q=book->valuelist+nt->q[ptr];
for(k=0,o=0;k<dim;k++,o+=step)
c+=(p[k]-q[k])*(a[o]-(p[k]+q[k])*.5);
{
const static_codebook *c=book->c;
int i,besti=-1;
- double best;
- double *e=book->valuelist;
+ float best;
+ float *e=book->valuelist;
for(i=0;i<book->entries;i++){
if(c->lengthlist[i]>0){
- double this=_dist(dim,e,a,step);
+ float this=_dist(dim,e,a,step);
if(besti==-1 || this<best){
best=this;
besti=i;
}
/* returns the entry number and *modifies a* to the remainder value ********/
-int vorbis_book_besterror(codebook *book,double *a,int step,int addmul){
+int vorbis_book_besterror(codebook *book,float *a,int step,int addmul){
int dim=book->dim,i,o;
int best=_best(book,a,step);
switch(addmul){
break;
case 1:
for(i=0,o=0;i<dim;i++,o+=step){
- double val=(book->valuelist+best*dim)[i];
+ float val=(book->valuelist+best*dim)[i];
if(val==0){
a[o]=0;
}else{
NULL,
NULL,NULL
};
-static double *test1_result=NULL;
+static float *test1_result=NULL;
/* linear, full mapping, nonsequential */
static_codebook test2={
full_quantlist1,
NULL,NULL
};
-static double test2_result[]={-3,-2,-1,0, 1,2,3,4, 5,0,3,-2};
+static float test2_result[]={-3,-2,-1,0, 1,2,3,4, 5,0,3,-2};
/* linear, full mapping, sequential */
static_codebook test3={
full_quantlist1,
NULL,NULL
};
-static double test3_result[]={-3,-5,-6,-6, 1,3,6,10, 5,5,8,6};
+static float test3_result[]={-3,-5,-6,-6, 1,3,6,10, 5,5,8,6};
/* linear, algorithmic mapping, nonsequential */
static_codebook test4={
partial_quantlist1,
NULL,NULL
};
-static double test4_result[]={-3,-3,-3, 4,-3,-3, -1,-3,-3,
+static float test4_result[]={-3,-3,-3, 4,-3,-3, -1,-3,-3,
-3, 4,-3, 4, 4,-3, -1, 4,-3,
-3,-1,-3, 4,-1,-3, -1,-1,-3,
-3,-3, 4, 4,-3, 4, -1,-3, 4,
partial_quantlist1,
NULL,NULL
};
-static double test5_result[]={-3,-6,-9, 4, 1,-2, -1,-4,-7,
+static float test5_result[]={-3,-6,-9, 4, 1,-2, -1,-4,-7,
-3, 1,-2, 4, 8, 5, -1, 3, 0,
-3,-4,-7, 4, 3, 0, -1,-2,-5,
-3,-6,-2, 4, 1, 5, -1,-4, 0,
-3, 1, 0, 4, 8, 7, -1, 3, 2,
-3,-4,-5, 4, 3, 2, -1,-2,-3};
-void run_test(static_codebook *b,double *comp){
- double *out=_book_unquantize(b);
+void run_test(static_codebook *b,float *comp){
+ float *out=_book_unquantize(b);
int i;
if(comp){
********************************************************************
function: basic shared codebook operations
- last mod: $Id: sharedbook.h,v 1.2 2000/05/08 20:49:50 xiphmont Exp $
+ last mod: $Id: sharedbook.h,v 1.3 2000/10/12 03:12:54 xiphmont Exp $
********************************************************************/
extern int vorbis_book_init_decode(codebook *dest,const static_codebook *source);
extern void vorbis_book_clear(codebook *b);
-extern double *_book_unquantize(const static_codebook *b);
-extern double *_book_logdist(const static_codebook *b,double *vals);
-extern double _float32_unpack(long val);
-extern long _float32_pack(double val);
-extern int _best(codebook *book, double *a, int step);
+extern float *_book_unquantize(const static_codebook *b);
+extern float *_book_logdist(const static_codebook *b,float *vals);
+extern float _float32_unpack(long val);
+extern long _float32_pack(float val);
+extern int _best(codebook *book, float *a, int step);
extern int _ilog(unsigned int v);
extern long _book_maptype1_quantvals(const static_codebook *b);
-extern int vorbis_book_besterror(codebook *book,double *a,int step,int addmul);
+extern int vorbis_book_besterror(codebook *book,float *a,int step,int addmul);
extern long vorbis_book_codeword(codebook *book,int entry);
extern long vorbis_book_codelen(codebook *book,int entry);
********************************************************************
function: *unnormalized* fft transform
- last mod: $Id: smallft.c,v 1.8 2000/03/10 13:21:18 xiphmont Exp $
+ last mod: $Id: smallft.c,v 1.9 2000/10/12 03:12:54 xiphmont Exp $
********************************************************************/
#include "smallft.h"
#include "misc.h"
-static void drfti1(int n, double *wa, int *ifac){
+static void drfti1(int n, float *wa, int *ifac){
static int ntryh[4] = { 4,2,3,5 };
- static double tpi = 6.28318530717958647692528676655900577;
- double arg,argh,argld,fi;
+ static float tpi = 6.28318530717958647692528676655900577;
+ float arg,argh,argld,fi;
int ntry=0,i,j=-1;
int k1, l1, l2, ib;
int ld, ii, ip, is, nq, nr;
for (j=0;j<ipm;j++){
ld+=l1;
i=is;
- argld=(double)ld*argh;
+ argld=(float)ld*argh;
fi=0.;
for (ii=2;ii<ido;ii+=2){
fi+=1.;
}
}
-static void fdrffti(int n, double *wsave, int *ifac){
+static void fdrffti(int n, float *wsave, int *ifac){
if (n == 1) return;
drfti1(n, wsave+n, ifac);
}
-static void dradf2(int ido,int l1,double *cc,double *ch,double *wa1){
+static void dradf2(int ido,int l1,float *cc,float *ch,float *wa1){
int i,k;
- double ti2,tr2;
+ float ti2,tr2;
int t0,t1,t2,t3,t4,t5,t6;
t1=0;
}
}
-static void dradf4(int ido,int l1,double *cc,double *ch,double *wa1,
- double *wa2,double *wa3){
- static double hsqt2 = .70710678118654752440084436210485;
+static void dradf4(int ido,int l1,float *cc,float *ch,float *wa1,
+ float *wa2,float *wa3){
+ static float hsqt2 = .70710678118654752440084436210485;
int i,k,t0,t1,t2,t3,t4,t5,t6;
- double ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4;
+ float ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4;
t0=l1*ido;
t1=t0;
}
}
-static void dradfg(int ido,int ip,int l1,int idl1,double *cc,double *c1,
- double *c2,double *ch,double *ch2,double *wa){
+static void dradfg(int ido,int ip,int l1,int idl1,float *cc,float *c1,
+ float *c2,float *ch,float *ch2,float *wa){
- static double tpi=6.28318530717958647692528676655900577;
+ static float tpi=6.28318530717958647692528676655900577;
int idij,ipph,i,j,k,l,ic,ik,is;
int t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
- double dc2,ai1,ai2,ar1,ar2,ds2;
+ float dc2,ai1,ai2,ar1,ar2,ds2;
int nbd;
- double dcp,arg,dsp,ar1h,ar2h;
+ float dcp,arg,dsp,ar1h,ar2h;
int idp2,ipp2;
- arg=tpi/(double)ip;
+ arg=tpi/(float)ip;
dcp=cos(arg);
dsp=sin(arg);
ipph=(ip+1)>>1;
}
}
-static void drftf1(int n,double *c,double *ch,double *wa,int *ifac){
+static void drftf1(int n,float *c,float *ch,float *wa,int *ifac){
int i,k1,l1,l2;
int na,kh,nf;
int ip,iw,ido,idl1,ix2,ix3;
for(i=0;i<n;i++)c[i]=ch[i];
}
-static void dradb2(int ido,int l1,double *cc,double *ch,double *wa1){
+static void dradb2(int ido,int l1,float *cc,float *ch,float *wa1){
int i,k,t0,t1,t2,t3,t4,t5,t6;
- double ti2,tr2;
+ float ti2,tr2;
t0=l1*ido;
}
}
-static void dradb3(int ido,int l1,double *cc,double *ch,double *wa1,
- double *wa2){
- static double taur = -.5;
- static double taui = .86602540378443864676372317075293618;
+static void dradb3(int ido,int l1,float *cc,float *ch,float *wa1,
+ float *wa2){
+ static float taur = -.5;
+ static float taui = .86602540378443864676372317075293618;
int i,k,t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
- double ci2,ci3,di2,di3,cr2,cr3,dr2,dr3,ti2,tr2;
+ float ci2,ci3,di2,di3,cr2,cr3,dr2,dr3,ti2,tr2;
t0=l1*ido;
t1=0;
}
}
-static void dradb4(int ido,int l1,double *cc,double *ch,double *wa1,
- double *wa2,double *wa3){
- static double sqrt2=1.4142135623730950488016887242097;
+static void dradb4(int ido,int l1,float *cc,float *ch,float *wa1,
+ float *wa2,float *wa3){
+ static float sqrt2=1.4142135623730950488016887242097;
int i,k,t0,t1,t2,t3,t4,t5,t6,t7,t8;
- double ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4;
+ float ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4;
t0=l1*ido;
t1=0;
}
}
-static void dradbg(int ido,int ip,int l1,int idl1,double *cc,double *c1,
- double *c2,double *ch,double *ch2,double *wa){
- static double tpi=6.28318530717958647692528676655900577;
+static void dradbg(int ido,int ip,int l1,int idl1,float *cc,float *c1,
+ float *c2,float *ch,float *ch2,float *wa){
+ static float tpi=6.28318530717958647692528676655900577;
int idij,ipph,i,j,k,l,ik,is,t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,
t11,t12;
- double dc2,ai1,ai2,ar1,ar2,ds2;
+ float dc2,ai1,ai2,ar1,ar2,ds2;
int nbd;
- double dcp,arg,dsp,ar1h,ar2h;
+ float dcp,arg,dsp,ar1h,ar2h;
int ipp2;
t10=ip*ido;
t0=l1*ido;
- arg=tpi/(double)ip;
+ arg=tpi/(float)ip;
dcp=cos(arg);
dsp=sin(arg);
nbd=(ido-1)>>1;
}
}
-static void drftb1(int n, double *c, double *ch, double *wa, int *ifac){
+static void drftb1(int n, float *c, float *ch, float *wa, int *ifac){
int i,k1,l1,l2;
int na;
int nf,ip,iw,ix2,ix3,ido,idl1;
for(i=0;i<n;i++)c[i]=ch[i];
}
-void drft_forward(drft_lookup *l,double *data){
+void drft_forward(drft_lookup *l,float *data){
if(l->n==1)return;
drftf1(l->n,data,l->trigcache,l->trigcache+l->n,l->splitcache);
}
-void drft_backward(drft_lookup *l,double *data){
+void drft_backward(drft_lookup *l,float *data){
if (l->n==1)return;
drftb1(l->n,data,l->trigcache,l->trigcache+l->n,l->splitcache);
}
void drft_init(drft_lookup *l,int n){
l->n=n;
- l->trigcache=calloc(3*n,sizeof(double));
+ l->trigcache=calloc(3*n,sizeof(float));
l->splitcache=calloc(32,sizeof(int));
fdrffti(n, l->trigcache, l->splitcache);
}
********************************************************************
function: fft transform
- last mod: $Id: smallft.h,v 1.6 2000/01/22 13:28:32 xiphmont Exp $
+ last mod: $Id: smallft.h,v 1.7 2000/10/12 03:12:54 xiphmont Exp $
********************************************************************/
typedef struct {
int n;
- double *trigcache;
+ float *trigcache;
int *splitcache;
} drft_lookup;
-extern void drft_forward(drft_lookup *l,double *data);
-extern void drft_backward(drft_lookup *l,double *data);
+extern void drft_forward(drft_lookup *l,float *data);
+extern void drft_backward(drft_lookup *l,float *data);
extern void drft_init(drft_lookup *l,int n);
extern void drft_clear(drft_lookup *l);
+++ /dev/null
-/********************************************************************
- * *
- * 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: spectrum envelope and residue code/decode
- last mod: $Id: spectrum.h,v 1.4 2000/01/04 09:05:04 xiphmont Exp $
-
- ********************************************************************/
-
-#ifndef _V_SPECT_H_
-#define _V_SPECT_H_
-
-extern int _vs_spectrum_encode(vorbis_block *vb,double amp,double *lsp);
-extern int _vs_spectrum_decode(vorbis_block *vb,double *amp,double *lsp);
-extern void _vs_residue_quantize(double *data,double *curve,
- vorbis_info *vi,int n);
-extern int _vs_residue_encode(vorbis_block *vb,double *data);
-extern int _vs_residue_decode(vorbis_block *vb,double *data);
-
-extern void _vs_residue_train(vorbis_block *vb,double *data,double *curve,
- int n);
-
-#endif
********************************************************************
function: single-block PCM synthesis
- last mod: $Id: synthesis.c,v 1.17 2000/07/07 00:53:10 xiphmont Exp $
+ last mod: $Id: synthesis.c,v 1.18 2000/10/12 03:12:54 xiphmont Exp $
********************************************************************/
#include <stdio.h>
+#include <ogg/ogg.h>
#include "vorbis/codec.h"
#include "registry.h"
-#include "bitwise.h"
#include "misc.h"
#include "os.h"
/* first things first. Make sure decode is ready */
_vorbis_block_ripcord(vb);
- _oggpack_readinit(opb,op->packet,op->bytes);
+ oggpack_readinit(opb,op->packet,op->bytes);
/* Check the packet type */
- if(_oggpack_read(opb,1)!=0){
+ if(oggpack_read(opb,1)!=0){
/* Oops. This is not an audio data packet */
return(-1);
}
/* read our mode and pre/post windowsize */
- mode=_oggpack_read(opb,vd->modebits);
+ mode=oggpack_read(opb,vd->modebits);
if(mode==-1)return(-1);
vb->mode=mode;
vb->W=vi->mode_param[mode]->blockflag;
if(vb->W){
- vb->lW=_oggpack_read(opb,1);
- vb->nW=_oggpack_read(opb,1);
+ vb->lW=oggpack_read(opb,1);
+ vb->nW=oggpack_read(opb,1);
if(vb->nW==-1) return(-1);
}else{
vb->lW=0;
}
/* more setup */
- vb->frameno=op->frameno;
+ vb->granulepos=op->granulepos;
vb->sequence=op->packetno-3; /* first block is third packet */
vb->eofflag=op->e_o_s;
/* alloc pcm passback storage */
vb->pcmend=vi->blocksizes[vb->W];
- vb->pcm=_vorbis_block_alloc(vb,sizeof(double *)*vi->channels);
+ vb->pcm=_vorbis_block_alloc(vb,sizeof(float *)*vi->channels);
for(i=0;i<vi->channels;i++)
- vb->pcm[i]=_vorbis_block_alloc(vb,vb->pcmend*sizeof(double));
+ vb->pcm[i]=_vorbis_block_alloc(vb,vb->pcmend*sizeof(float));
/* unpack_header enforces range checking */
type=vi->map_type[vi->mode_param[mode]->mapping];
********************************************************************
function: time backend 0 (dummy)
- last mod: $Id: time0.c,v 1.5 2000/03/10 13:21:18 xiphmont Exp $
+ last mod: $Id: time0.c,v 1.6 2000/10/12 03:12:54 xiphmont Exp $
********************************************************************/
#include "registry.h"
#include "misc.h"
-static void pack (vorbis_info_time *i,oggpack_buffer *opb){
+static void time0_pack (vorbis_info_time *i,oggpack_buffer *opb){
}
-static vorbis_info_time *unpack (vorbis_info *vi,oggpack_buffer *opb){
+static vorbis_info_time *time0_unpack (vorbis_info *vi,oggpack_buffer *opb){
return "";
}
-static vorbis_look_time *look (vorbis_dsp_state *vd,vorbis_info_mode *mi,
+static vorbis_look_time *time0_look (vorbis_dsp_state *vd,vorbis_info_mode *mi,
vorbis_info_time *i){
return "";
}
-static void free_info(vorbis_info_time *i){
+static void time0_free_info(vorbis_info_time *i){
}
-static void free_look(vorbis_look_time *i){
+static void time0_free_look(vorbis_look_time *i){
}
-static int forward(vorbis_block *vb,vorbis_look_time *i,
- double *in,double *out){
+static int time0_forward(vorbis_block *vb,vorbis_look_time *i,
+ float *in,float *out){
return(0);
}
-static int inverse(vorbis_block *vb,vorbis_look_time *i,
- double *in,double *out){
+static int time0_inverse(vorbis_block *vb,vorbis_look_time *i,
+ float *in,float *out){
return(0);
}
/* export hooks */
vorbis_func_time time0_exportbundle={
- &pack,&unpack,&look,&free_info,&free_look,&forward,&inverse
+ &time0_pack,&time0_unpack,&time0_look,&time0_free_info,
+ &time0_free_look,&time0_forward,&time0_inverse
};
--- /dev/null
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+
+void usage(){
+ fprintf(stderr,"tone <frequency_Hz> [<amplitude>]\n");
+ exit(1);
+}
+
+int main (int argc,char *argv[]){
+ int i;
+ double f;
+ double amp=32767.;
+
+ if(argc<2)usage();
+ f=atof(argv[1]);
+ if(argc>=3)amp=atof(argv[2])*32767.;
+
+ for(i=0;i<44100*10;i++){
+ long val=rint(amp*sin(i/44100.*f*2*M_PI));
+ if(val>32767.)val=32767.;
+ if(val<-32768.)val=-32768.;
+
+ fprintf(stdout,"%c%c%c%c",
+ (char)(val&0xff),
+ (char)((val>>8)&0xff),
+ (char)(val&0xff),
+ (char)((val>>8)&0xff));
+ }
+ return(0);
+}
+
********************************************************************
function: stdio-based convenience library for opening/seeking/decoding
- last mod: $Id: vorbisfile.c,v 1.28 2000/08/30 06:09:21 xiphmont Exp $
+ last mod: $Id: vorbisfile.c,v 1.29 2000/10/12 03:12:54 xiphmont Exp $
********************************************************************/
/* uses the local ogg_stream storage in vf; this is important for
non-streaming input sources */
static int _fetch_headers(OggVorbis_File *vf,vorbis_info *vi,vorbis_comment *vc,
- long *serialno){
+ long *serialno,ogg_page *og_ptr){
ogg_page og;
ogg_packet op;
int i,ret;
-
- ret=_get_next_page(vf,&og,CHUNKSIZE);
- if(ret==-1){
- fprintf(stderr,"Did not find initial header for bitstream.\n");
- return -1;
- }
- if(serialno)*serialno=ogg_page_serialno(&og);
- ogg_stream_init(&vf->os,ogg_page_serialno(&og));
+ if(!og_ptr){
+ ret=_get_next_page(vf,&og,CHUNKSIZE);
+ if(ret==-1){
+ fprintf(stderr,"Did not find initial header for bitstream.\n");
+ return -1;
+ }
+ og_ptr=&og;
+ }
+
+ if(serialno)*serialno=ogg_page_serialno(og_ptr);
+ ogg_stream_init(&vf->os,ogg_page_serialno(og_ptr));
/* extract the initial header from the first page and verify that the
Ogg bitstream is in fact Vorbis data */
i=0;
while(i<3){
- ogg_stream_pagein(&vf->os,&og);
+ ogg_stream_pagein(&vf->os,og_ptr);
while(i<3){
int result=ogg_stream_packetout(&vf->os,&op);
if(result==0)break;
i++;
}
if(i<3)
- if(_get_next_page(vf,&og,1)<0){
+ if(_get_next_page(vf,og_ptr,1)<0){
fprintf(stderr,"Missing header in logical bitstream.\n");
goto bail_header;
}
/* seek to the location of the initial header */
_seek_helper(vf,vf->offsets[i]);
- if(_fetch_headers(vf,vf->vi+i,vf->vc+i,NULL)==-1){
+ if(_fetch_headers(vf,vf->vi+i,vf->vc+i,NULL,NULL)==-1){
fprintf(stderr,"Error opening logical bitstream #%d.\n\n",i+1);
vf->dataoffsets[i]=-1;
}else{
vorbis_comment_clear(vf->vc+i);
break;
}
- if(ogg_page_frameno(&og)!=-1){
+ if(ogg_page_granulepos(&og)!=-1){
vf->serialnos[i]=ogg_page_serialno(&og);
- vf->pcmlengths[i]=ogg_page_frameno(&og);
+ vf->pcmlengths[i]=ogg_page_granulepos(&og);
break;
}
}
static int _make_decode_ready(OggVorbis_File *vf){
if(vf->decode_ready)exit(1);
- vorbis_synthesis_init(&vf->vd,vf->vi);
+ if(vf->seekable){
+ vorbis_synthesis_init(&vf->vd,vf->vi+vf->current_link);
+ }else{
+ vorbis_synthesis_init(&vf->vd,vf->vi);
+ }
vorbis_block_init(&vf->vd,&vf->vb);
vf->decode_ready=1;
return(0);
ogg_page og;
/* is this even vorbis...? */
- ret=_fetch_headers(vf,&initial_i,&initial_c,&serialno);
+ ret=_fetch_headers(vf,&initial_i,&initial_c,&serialno,NULL);
dataoffset=vf->offset;
ogg_stream_clear(&vf->os);
if(ret==-1)return(-1);
vf->vc=calloc(vf->links,sizeof(vorbis_info));
/* Try to fetch the headers, maintaining all the storage */
- if(_fetch_headers(vf,vf->vi,vf->vc,&vf->current_serialno)==-1)return(-1);
+ if(_fetch_headers(vf,vf->vi,vf->vc,&vf->current_serialno,NULL)==-1)return(-1);
_make_decode_ready(vf);
return 0;
if(vf->decode_ready){
ogg_packet op;
int result=ogg_stream_packetout(&vf->os,&op);
- ogg_int64_t frameno;
+ ogg_int64_t granulepos;
/* if(result==-1)return(-1); hole in the data. For now, swallow
and go. We'll need to add a real
error code in a bit. */
if(result>0){
/* got a packet. process it */
- frameno=op.frameno;
+ granulepos=op.granulepos;
if(!vorbis_synthesis(&vf->vb,&op)){ /* lazy check for lazy
header handling. The
header packets aren't
}
/* update the pcm offset. */
- if(frameno!=-1 && !op.e_o_s){
+ if(granulepos!=-1 && !op.e_o_s){
int link=(vf->seekable?vf->current_link:0);
int i,samples;
As an aside, this trick is inaccurate if we begin
reading anew right at the last page; the end-of-stream
- frameno declares the last frame in the stream, and the
+ granulepos declares the last frame in the stream, and the
last packet of the last page may be a partial frame.
- So, we need a previous frameno from an in-sequence page
+ So, we need a previous granulepos from an in-sequence page
to have a reference point. Thus the !op.e_o_s clause
above */
samples=vorbis_synthesis_pcmout(&vf->vd,NULL);
- frameno-=samples;
+ granulepos-=samples;
for(i=0;i<link;i++)
- frameno+=vf->pcmlengths[i];
- vf->pcm_offset=frameno;
+ granulepos+=vf->pcmlengths[i];
+ vf->pcm_offset=granulepos;
}
return(1);
}
/* we're streaming */
/* fetch the three header packets, build the info struct */
- _fetch_headers(vf,vf->vi,vf->vc,&vf->current_serialno);
+ _fetch_headers(vf,vf->vi,vf->vc,&vf->current_serialno,&og);
vf->current_link++;
link=0;
}
/* we need to make sure the pcm_offset is set. We use the
_fetch_packet helper to process one packet with readp set, then
call it until it returns '0' with readp not set (the last packet
- from a page has the 'frameno' field set, and that's how the
+ from a page has the 'granulepos' field set, and that's how the
helper updates the offset */
switch(_process_packet(vf,1)){
if(ret==-1){
end=bisect;
}else{
- ogg_int64_t frameno=ogg_page_frameno(&og);
- if(frameno<target){
- best=ret; /* raw offset of packet with frameno */
+ ogg_int64_t granulepos=ogg_page_granulepos(&og);
+ if(granulepos<target){
+ best=ret; /* raw offset of packet with granulepos */
begin=vf->offset; /* raw offset of next packet */
}else{
end=bisect;
/* discard samples until we reach the desired position. Crossing a
logical bitstream boundary with abandon is OK. */
while(vf->pcm_offset<pos){
- double **pcm;
+ float **pcm;
long target=pos-vf->pcm_offset;
long samples=vorbis_synthesis_pcmout(&vf->vd,&pcm);
while(1){
if(vf->decode_ready){
- double **pcm;
+ float **pcm;
long samples=vorbis_synthesis_pcmout(&vf->vd,&pcm);
if(samples){
/* yay! proceed to pack data into the byte buffer */
if(host_endian==bigendianp){
if(sgned){
for(i=0;i<channels;i++) { /* It's faster in this order */
- double *src=pcm[i];
+ float *src=pcm[i];
short *dest=((short *)buffer)+i;
for(j=0;j<samples;j++) {
val=(int)(src[j]*32768. + 0.5);
}
}else{
for(i=0;i<channels;i++) {
- double *src=pcm[i];
+ float *src=pcm[i];
short *dest=((short *)buffer)+i;
for(j=0;j<samples;j++) {
val=(int)(src[j]*32768. + 0.5);
********************************************************************
function: window functions
- last mod: $Id: window.c,v 1.7 2000/03/10 13:21:18 xiphmont Exp $
+ last mod: $Id: window.c,v 1.8 2000/10/12 03:12:54 xiphmont Exp $
********************************************************************/
#include "os.h"
#include "misc.h"
-double *_vorbis_window(int type, int window,int left,int right){
- double *ret=calloc(window,sizeof(double));
+float *_vorbis_window(int type, int window,int left,int right){
+ float *ret=calloc(window,sizeof(float));
switch(type){
case 0:
int i;
for(i=0;i<left;i++){
- double x=(i+.5)/left*M_PI/2.;
+ float x=(i+.5)/left*M_PI/2.;
x=sin(x);
x*=x;
x*=M_PI/2.;
ret[i]=1.;
for(i=0;i<right;i++){
- double x=(right-i-.5)/right*M_PI/2.;
+ float x=(right-i-.5)/right*M_PI/2.;
x=sin(x);
x*=x;
x*=M_PI/2.;
********************************************************************
function: window functions
- last mod: $Id: window.h,v 1.3 2000/01/22 13:28:37 xiphmont Exp $
+ last mod: $Id: window.h,v 1.4 2000/10/12 03:12:54 xiphmont Exp $
********************************************************************/
#define _V_WINDOW_
#define VI_WINDOWB 1
-extern double *_vorbis_window(int type,int window,int left,int right);
+extern float *_vorbis_window(int type,int window,int left,int right);
#endif
********************************************************************
function: utility functions for loading .vqh and .vqd files
- last mod: $Id: bookutil.c,v 1.16 2000/08/15 09:09:44 xiphmont Exp $
+ last mod: $Id: bookutil.c,v 1.17 2000/10/12 03:13:01 xiphmont Exp $
********************************************************************/
/* read the next numerical value from the given file */
static char *value_line_buff=NULL;
-int get_line_value(FILE *in,double *value){
+int get_line_value(FILE *in,float *value){
char *next;
if(!value_line_buff)return(-1);
}
}
-int get_next_value(FILE *in,double *value){
+int get_next_value(FILE *in,float *value){
while(1){
if(get_line_value(in,value)){
value_line_buff=get_line(in);
}
int get_next_ivalue(FILE *in,long *ivalue){
- double value;
+ float value;
int ret=get_next_value(in,&value);
*ivalue=value;
return(ret);
}
-static double sequence_base=0.;
+static float sequence_base=0.;
static int v_sofar=0;
void reset_next_value(void){
value_line_buff=NULL;
}
-int get_vector(codebook *b,FILE *in,int start, int n,double *a){
+int get_vector(codebook *b,FILE *in,int start, int n,float *a){
int i;
const static_codebook *c=b->c;
break;
if(i==c->dim){
- double temp=a[c->dim-1];
+ float temp=a[c->dim-1];
for(i=0;i<c->dim;i++)a[i]-=sequence_base;
if(c->q_sequencep)sequence_base=temp;
v_sofar++;
exit(1);
}
/* load quantthresh */
- find_seek_to(in,"static double _vq_quantthresh_");
+ find_seek_to(in,"static float _vq_quantthresh_");
reset_next_value();
- t->quantthresh=malloc(sizeof(double)*t->threshvals);
+ t->quantthresh=malloc(sizeof(float)*t->threshvals);
for(i=0;i<t->threshvals-1;i++)
if(get_next_value(in,t->quantthresh+i)){
fprintf(stderr,"out of data 1 while reading codebook %s\n",filename);
if(t){
/* quantthresh */
- fprintf(out,"static double _vq_quantthresh_%s[] = {\n",name);
+ fprintf(out,"static float _vq_quantthresh_%s[] = {\n",name);
for(j=0;j<t->threshvals-1;){
fprintf(out,"\t");
for(k=0;k<8 && j<t->threshvals-1;k++,j++)
********************************************************************
function: utility functions for loading .vqh and .vqd files
- last mod: $Id: bookutil.h,v 1.6 2000/07/12 09:36:18 xiphmont Exp $
+ last mod: $Id: bookutil.h,v 1.7 2000/10/12 03:13:01 xiphmont Exp $
********************************************************************/
extern char *get_line(FILE *in);
extern char *setup_line(FILE *in);
-extern int get_line_value(FILE *in,double *value);
-extern int get_next_value(FILE *in,double *value);
+extern int get_line_value(FILE *in,float *value);
+extern int get_next_value(FILE *in,float *value);
extern int get_next_ivalue(FILE *in,long *ivalue);
extern void reset_next_value(void);
-extern int get_vector(codebook *b,FILE *in,int start,int num,double *a);
+extern int get_vector(codebook *b,FILE *in,int start,int num,float *a);
extern char *find_seek_to(FILE *in,char *s);
extern codebook *codebook_load(char *filename);
********************************************************************
function: utility main for building codebooks from training sets
- last mod: $Id: build.c,v 1.14 2000/06/14 01:38:32 xiphmont Exp $
+ last mod: $Id: build.c,v 1.15 2000/10/12 03:13:01 xiphmont Exp $
********************************************************************/
i=0;
quantlist=malloc(sizeof(long)*v.elements*v.entries);
for(j=0;j<entries;j++){
- double a;
+ float a;
for(k=0;k<dim;k++){
line=rline(in,out);
sscanf(line,"%lf",&a);
/* training points */
{
- double *b=alloca(sizeof(double)*(dim+aux));
+ float *b=alloca(sizeof(float)*(dim+aux));
i=0;
v.entries=0; /* hack to avoid reseeding */
while(1){
********************************************************************
function: function call to do simple data cascading
- last mod: $Id: cascade.c,v 1.6 2000/05/08 20:49:50 xiphmont Exp $
+ last mod: $Id: cascade.c,v 1.7 2000/10/12 03:13:01 xiphmont Exp $
********************************************************************/
/* set up metrics */
-double count=0.;
+float count=0.;
void process_preprocess(codebook **bs,char *basename){
fprintf(stderr,"Done. \n");
}
-double process_one(codebook *b,double *a,int dim,int step,int addmul,
- double base){
+float process_one(codebook *b,float *a,int dim,int step,int addmul,
+ float base){
int j;
if(b->c->q_sequencep){
- double temp;
+ float temp;
for(j=0;j<dim;j++){
temp=a[j*step];
a[j*step]-=base;
return base;
}
-void process_vector(codebook **bs,int *addmul,int inter,double *a,int n){
+void process_vector(codebook **bs,int *addmul,int inter,float *a,int n){
int i,bi=0;
int booknum=0;
while(*bs){
- double base=0.;
+ float base=0.;
codebook *b=*bs;
int dim=b->dim;
********************************************************************
function: generic euclidian distance metric for VQ codebooks
- last mod: $Id: genericdata.c,v 1.5 2000/05/08 20:49:50 xiphmont Exp $
+ last mod: $Id: genericdata.c,v 1.6 2000/10/12 03:13:01 xiphmont Exp $
********************************************************************/
vqgen_quantize(v,q);
}
-double *vqext_weight(vqgen *v,double *p){
+float *vqext_weight(vqgen *v,float *p){
/*noop*/
return(p);
}
/* candidate,actual */
-double vqext_metric(vqgen *v,double *e, double *p){
+float vqext_metric(vqgen *v,float *e, float *p){
int i;
- double acc=0.;
+ float acc=0.;
for(i=0;i<v->elements;i++){
- double val=p[i]-e[i];
+ float val=p[i]-e[i];
acc+=val*val;
}
return sqrt(acc/v->elements);
}
-void vqext_addpoint_adj(vqgen *v,double *b,int start,int dim,int cols,int num){
+void vqext_addpoint_adj(vqgen *v,float *b,int start,int dim,int cols,int num){
vqgen_addpoint(v,b+start,NULL);
}
********************************************************************
function: hufftree builder
- last mod: $Id: huffbuild.c,v 1.4 2000/07/12 09:36:17 xiphmont Exp $
+ last mod: $Id: huffbuild.c,v 1.5 2000/10/12 03:13:01 xiphmont Exp $
********************************************************************/
********************************************************************
function: utility main for building codebooks from lattice descriptions
- last mod: $Id: latticebuild.c,v 1.5 2000/08/15 09:09:44 xiphmont Exp $
+ last mod: $Id: latticebuild.c,v 1.6 2000/10/12 03:13:01 xiphmont Exp $
********************************************************************/
int main(int argc,char *argv[]){
codebook b;
static_codebook c;
- double *quantlist;
+ float *quantlist;
long *hits;
int entries=-1,dim=-1,quantvals=-1,addmul=-1,sequencep=0;
/* gen a real quant list from the more easily human-grokked input */
{
- double min=quantlist[0];
- double mindel=-1;
+ float min=quantlist[0];
+ float mindel=-1;
int fac=1;
for(j=1;j<quantvals;j++)if(quantlist[j]<min)min=quantlist[j];
for(j=0;j<quantvals;j++)
j=0;
while(j<quantvals){
for(j=0;j<quantvals;j++){
- double test=(quantlist[j]-min)/(mindel/fac);
+ float test=(quantlist[j]-min)/(mindel/fac);
if( fabs(rint(test)-test)>.000001) break;
}
if(j<quantvals)fac++;
********************************************************************
function: utility main for building thresh/pigeonhole encode hints
- last mod: $Id: latticehint.c,v 1.2 2000/08/15 09:09:44 xiphmont Exp $
+ last mod: $Id: latticehint.c,v 1.3 2000/10/12 03:13:01 xiphmont Exp $
********************************************************************/
}
static void setvals(int dim,encode_aux_pigeonhole *p,
- long *temptrack,double *tempmin,double *tempmax,
+ long *temptrack,float *tempmin,float *tempmax,
int seqp){
int i;
- double last=0.;
+ float last=0.;
for(i=0;i<dim;i++){
tempmin[i]=(temptrack[i])*p->del+p->min+last;
tempmax[i]=tempmin[i]+p->del;
quantize outside the pigeonmap are dropped and brute-forced. So we
can ignore the <0 and >=n boundary cases in min/max error */
-static double minerror(int dim,double *a,encode_aux_pigeonhole *p,
- long *temptrack,double *tempmin,double *tempmax){
+static float minerror(int dim,float *a,encode_aux_pigeonhole *p,
+ long *temptrack,float *tempmin,float *tempmax){
int i;
- double err=0.;
+ float err=0.;
for(i=0;i<dim;i++){
- double eval=0.;
+ float eval=0.;
if(a[i]<tempmin[i]){
eval=tempmin[i]-a[i];
}else if(a[i]>tempmax[i]){
return(err);
}
-static double maxerror(int dim,double *a,encode_aux_pigeonhole *p,
- long *temptrack,double *tempmin,double *tempmax){
+static float maxerror(int dim,float *a,encode_aux_pigeonhole *p,
+ long *temptrack,float *tempmin,float *tempmax){
int i;
- double err=0.,eval;
+ float err=0.,eval;
for(i=0;i<dim;i++){
if(a[i]<tempmin[i]){
eval=tempmax[i]-a[i];
}else if(a[i]>tempmax[i]){
eval=a[i]-tempmin[i];
}else{
- double t1=a[i]-tempmin[i];
+ float t1=a[i]-tempmin[i];
eval=tempmax[i]-a[i];
if(t1>eval)eval=t1;
}
codebook *b;
static_codebook *c;
int entries=-1,dim=-1;
- double min,del;
+ float min,del;
char *name;
long i,j;
long dB=0;
fprintf(stderr,"Adding threshold hint to %s...\n",name);
/* simplest possible threshold hint only */
- t->quantthresh=calloc(quantvals-1,sizeof(double));
+ t->quantthresh=calloc(quantvals-1,sizeof(float));
t->quantmap=calloc(quantvals,sizeof(int));
t->threshvals=quantvals;
t->quantvals=quantvals;
/* ok, gen the map and thresholds */
for(i=0;i<quantvals;i++)t->quantmap[i]=quantsort[i]-c->quantlist;
for(i=0;i<quantvals-1;i++){
- double v1=*(quantsort[i])*del+min;
- double v2=*(quantsort[i+1])*del+min;
+ float v1=*(quantsort[i])*del+min;
+ float v2=*(quantsort[i+1])*del+min;
if(dB){
if(fabs(v1)<.01)v1=(v1+v2)*.5;
if(fabs(v2)<.01)v2=(v1+v2)*.5;
long **tempstack;
long *tempcount;
long *temptrack;
- double *tempmin;
- double *tempmax;
+ float *tempmin;
+ float *tempmax;
long totalstack=0;
long pigeons;
long subpigeons;
exact pigeonhole grouping is an optimization issue, not a
correctness issue */
for(i=0;i<p->mapentries;i++){
- double thisval=del*i+min; /* middle of the quant zone */
+ float thisval=del*i+min; /* middle of the quant zone */
int quant=0;
- double err=fabs(c->quantlist[0]*del+min-thisval);
+ float err=fabs(c->quantlist[0]*del+min-thisval);
for(j=1;j<quantvals;j++){
- double thiserr=fabs(c->quantlist[j]*del+min-thisval);
+ float thiserr=fabs(c->quantlist[j]*del+min-thisval);
if(thiserr<err){
quant=j/factor;
err=thiserr;
for(i=0;i<dim;i++)subpigeons*=p->mapentries;
for(i=0;i<dim;i++)pigeons*=p->quantvals;
temptrack=calloc(dim,sizeof(long));
- tempmin=calloc(dim,sizeof(double));
- tempmax=calloc(dim,sizeof(double));
+ tempmin=calloc(dim,sizeof(float));
+ tempmax=calloc(dim,sizeof(float));
tempstack=calloc(pigeons,sizeof(long *));
tempcount=calloc(pigeons,sizeof(long));
while(1){
- double errorpost=-1;
+ float errorpost=-1;
char buffer[80];
/* map our current pigeonhole to a 'big pigeonhole' so we know
maximum error. Record that error */
for(i=0;i<entries;i++){
if(c->lengthlist[i]>0){
- double this=maxerror(dim,b->valuelist+i*dim,p,
+ float this=maxerror(dim,b->valuelist+i*dim,p,
temptrack,tempmin,tempmax);
if(errorpost==-1 || this<errorpost)errorpost=this;
spinnit(buffer,subpigeons);
improbable is determined by c->lengthlist; we assume that
pigeonholing is in sync with the codeword cells, which it is */
/*for(i=0;i<entries;i++){
- double probability= 1./(1<<c->lengthlist[i]);
+ float probability= 1./(1<<c->lengthlist[i]);
if(c->lengthlist[i]==0 || probability*entries<cutoff){
totalstack-=tempcount[i];
tempcount[i]=0;
********************************************************************
function: utility for paring low hit count cells from lattice codebook
- last mod: $Id: latticepare.c,v 1.4 2000/07/12 09:36:18 xiphmont Exp $
+ last mod: $Id: latticepare.c,v 1.5 2000/10/12 03:13:01 xiphmont Exp $
********************************************************************/
produces a new output book on stdout
*/
-static double _dist(int el,double *a, double *b){
+static float _dist(int el,float *a, float *b){
int i;
- double acc=0.;
+ float acc=0.;
for(i=0;i<el;i++){
- double val=(a[i]-b[i]);
+ float val=(a[i]-b[i]);
acc+=val*val;
}
return(acc);
}
-static double *pointlist;
+static float *pointlist;
static long points=0;
-void add_vector(codebook *b,double *vec,long n){
+void add_vector(codebook *b,float *vec,long n){
int dim=b->dim,i,j;
int step=n/dim;
for(i=0;i<step;i++){
}
}
-static int bestm(codebook *b,double *vec){
+static int bestm(codebook *b,float *vec){
encode_aux_threshmatch *tt=b->c->thresh_tree;
int dim=b->dim;
int i,k,o;
return(best);
}
-static int closest(codebook *b,double *vec,int current){
+static int closest(codebook *b,float *vec,int current){
encode_aux_threshmatch *tt=b->c->thresh_tree;
int dim=b->dim;
int i,k,o;
- double bestmetric=0;
+ float bestmetric=0;
int bestentry=-1;
int best=bestm(b,vec);
for(i=0;i<b->entries;i++){
if(b->c->lengthlist[i]>0 && i!=best && i!=current){
- double thismetric=_dist(dim, vec, b->valuelist+i*dim);
+ float thismetric=_dist(dim, vec, b->valuelist+i*dim);
if(bestentry==-1 || thismetric<bestmetric){
bestentry=i;
bestmetric=thismetric;
return(bestentry);
}
-static double _heuristic(codebook *b,double *ppt,int secondbest){
- double *secondcell=b->valuelist+secondbest*b->dim;
+static float _heuristic(codebook *b,float *ppt,int secondbest){
+ float *secondcell=b->valuelist+secondbest*b->dim;
int best=bestm(b,ppt);
- double *firstcell=b->valuelist+best*b->dim;
- double error=_dist(b->dim,firstcell,secondcell);
- double *zero=alloca(b->dim*sizeof(double));
- double fromzero;
+ float *firstcell=b->valuelist+best*b->dim;
+ float error=_dist(b->dim,firstcell,secondcell);
+ float *zero=alloca(b->dim*sizeof(float));
+ float fromzero;
- memset(zero,0,b->dim*sizeof(double));
+ memset(zero,0,b->dim*sizeof(float));
fromzero=sqrt(_dist(b->dim,firstcell,zero));
return(error/fromzero);
int cols;
long lines=0;
char *line;
- double *vec;
+ float *vec;
FILE *in=fopen(name,"r");
if(!in){
fprintf(stderr,"Could not open input file %s\n",name);
while(*temp==' ')temp++;
}
}
- vec=alloca(cols*sizeof(double));
+ vec=alloca(cols*sizeof(float));
/* count, then load, to avoid fragmenting the hell out of
memory */
while(line){
if((lines&0xff)==0)spinnit("counting samples...",lines*cols);
line=setup_line(in);
}
- pointlist=malloc((cols*lines+entries*dim)*sizeof(double));
+ pointlist=malloc((cols*lines+entries*dim)*sizeof(float));
rewind(in);
line=setup_line(in);
long *cellcount=calloc(entries,sizeof(long));
long *cellcount2=calloc(entries,sizeof(long));
- double *cellerror=calloc(entries,sizeof(double));
- double *cellerrormax=calloc(entries,sizeof(double));
+ float *cellerror=calloc(entries,sizeof(float));
+ float *cellerrormax=calloc(entries,sizeof(float));
long cellsleft=entries;
for(i=0;i<points;i++)membership[i]=-1;
for(i=0;i<entries;i++)firsthead[i]=-1;
for(i=0;i<points;i++){
/* assign vectors to the nearest cell. Also keep track of second
nearest for error statistics */
- double *ppt=pointlist+i*dim;
+ float *ppt=pointlist+i*dim;
int firstentry=closest(b,ppt,-1);
int secondentry=closest(b,ppt,firstentry);
- double firstmetric=_dist(dim,b->valuelist+dim*firstentry,ppt);
- double secondmetric=_dist(dim,b->valuelist+dim*secondentry,ppt);
+ float firstmetric=_dist(dim,b->valuelist+dim*firstentry,ppt);
+ float secondmetric=_dist(dim,b->valuelist+dim*secondentry,ppt);
if(!(i&0xff))spinnit("initializing... ",points-i);
/* do the automatic cull request */
while(cellsleft>target){
int bestcell=-1;
- double besterror=0;
- double besterror2=0;
+ float besterror=0;
+ float besterror2=0;
long head=-1;
char spinbuf[80];
sprintf(spinbuf,"cells left to eliminate: %ld : ",cellsleft-target);
firsthead[bestcell]=-1;
while(head!=-1){
/* head is a point number */
- double *ppt=pointlist+head*dim;
+ float *ppt=pointlist+head*dim;
int firstentry=closest(b,ppt,-1);
int secondentry=closest(b,ppt,firstentry);
- double firstmetric=_dist(dim,b->valuelist+dim*firstentry,ppt);
- double secondmetric=_dist(dim,b->valuelist+dim*secondentry,ppt);
+ float firstmetric=_dist(dim,b->valuelist+dim*firstentry,ppt);
+ float secondmetric=_dist(dim,b->valuelist+dim*secondentry,ppt);
long next=membership[head];
if(head<points-entries){
head=secondhead[bestcell];
secondhead[bestcell]=-1;
while(head!=-1){
- double *ppt=pointlist+head*dim;
+ float *ppt=pointlist+head*dim;
/* who are we assigned to now? */
int firstentry=closest(b,ppt,-1);
/* what is the new second closest match? */
int secondentry=closest(b,ppt,firstentry);
/* old second closest is the cell being disbanded */
- double oldsecondmetric=_dist(dim,b->valuelist+dim*bestcell,ppt);
+ float oldsecondmetric=_dist(dim,b->valuelist+dim*bestcell,ppt);
/* new second closest error */
- double secondmetric=_dist(dim,b->valuelist+dim*secondentry,ppt);
+ float secondmetric=_dist(dim,b->valuelist+dim*secondentry,ppt);
long next=secondary[head];
if(head<points-entries){
for(i=0;i<entries;i++)entryindex[i]=1;
for(i=0;i<points-entries;i++){
int best=_best(b,pointlist+i*dim,1);
- double *a=pointlist+i*dim;
+ float *a=pointlist+i*dim;
if(!(i&0xff))spinnit("counting hits...",i);
if(best==-1){
fprintf(stderr,"\nINTERNAL ERROR; a point count not be matched to a\n"
function: utility main for setting entropy encoding parameters
for lattice codebooks
- last mod: $Id: latticetune.c,v 1.2 2000/08/15 09:09:44 xiphmont Exp $
+ last mod: $Id: latticetune.c,v 1.3 2000/10/12 03:13:02 xiphmont Exp $
********************************************************************/
long step;
long lines=0;
long cols=-1;
- double *vec;
+ float *vec;
line=setup_line(in);
while(line){
int code;
while(*temp>32)temp++;
while(*temp==' ')temp++;
}
- vec=alloca(sizeof(double)*cols);
+ vec=alloca(sizeof(float)*cols);
step=cols/dim;
}
********************************************************************
function: metrics and quantization code for LSP VQ codebooks
- last mod: $Id: lspdata.c,v 1.12 2000/05/08 20:49:50 xiphmont Exp $
+ last mod: $Id: lspdata.c,v 1.13 2000/10/12 03:13:02 xiphmont Exp $
********************************************************************/
quant_meta q={0,0,0,1}; /* set sequence data */
int vqext_aux=1;
-double global_maxdel=M_PI;
-double global_mindel=M_PI;
+float global_maxdel=M_PI;
+float global_mindel=M_PI;
#if 0
void vqext_quantize(vqgen *v,quant_meta *q){
- double delta,mindel;
- double maxquant=((1<<q->quant)-1);
+ float delta,mindel;
+ float maxquant=((1<<q->quant)-1);
int j,k;
/* first find the basic delta amount from the maximum span to be
delta=_float32_unpack(q->delta);
for(j=0;j<v->entries;j++){
- double last=0;
+ float last=0;
for(k=0;k<v->elements;k++){
- double val=_now(v,j)[k];
- double now=rint((val-last-mindel)/delta);
+ float val=_now(v,j)[k];
+ float now=rint((val-last-mindel)/delta);
_now(v,j)[k]=now;
if(now<0){
}
#endif
-double *weight=NULL;
+float *weight=NULL;
#if 0
/* LSP training metric. We weight error proportional to distance
*between* LSP vector values. The idea of this metric is not to set
#define FUDGE (global_maxdel-weight[i])
-double *vqext_weight(vqgen *v,double *p){
+float *vqext_weight(vqgen *v,float *p){
int i;
int el=v->elements;
- double lastp=0.;
+ float lastp=0.;
for(i=0;i<el;i++){
- double predist=(p[i]-lastp);
- double postdist=(p[i+1]-p[i]);
+ float predist=(p[i]-lastp);
+ float postdist=(p[i+1]-p[i]);
weight[i]=(predist<postdist?predist:postdist);
lastp=p[i];
}
}
#else
#define FUDGE 1.
-double *vqext_weight(vqgen *v,double *p){
+float *vqext_weight(vqgen *v,float *p){
return p;
}
#endif
/* candidate,actual */
-double vqext_metric(vqgen *v,double *e, double *p){
+float vqext_metric(vqgen *v,float *e, float *p){
int i;
int el=v->elements;
- double acc=0.;
+ float acc=0.;
for(i=0;i<el;i++){
- double val=(p[i]-e[i])*FUDGE;
+ float val=(p[i]-e[i])*FUDGE;
acc+=val*val;
}
return sqrt(acc/v->elements);
trailing space */
/* assume vqext_aux==1 */
-void vqext_addpoint_adj(vqgen *v,double *b,int start,int dim,int cols,int num){
- double *a=alloca(sizeof(double)*(dim+1)); /* +aux */
- double base=0;
+void vqext_addpoint_adj(vqgen *v,float *b,int start,int dim,int cols,int num){
+ float *a=alloca(sizeof(float)*(dim+1)); /* +aux */
+ float base=0;
int i;
if(start>0)base=b[start-1];
global_maxdel=0.;
global_mindel=M_PI;
for(j=0;j<v->points;j++){
- double last=0.;
+ float last=0.;
for(k=0;k<v->elements+v->aux;k++){
- double p=_point(v,j)[k];
+ float p=_point(v,j)[k];
if(p-last>global_maxdel)global_maxdel=p-last;
if(p-last<global_mindel)global_mindel=p-last;
last=p;
}
}
- weight=malloc(sizeof(double)*v->elements);
+ weight=malloc(sizeof(float)*v->elements);
}
********************************************************************
function: function calls to collect codebook metrics
- last mod: $Id: metrics.c,v 1.8 2000/06/14 01:38:32 xiphmont Exp $
+ last mod: $Id: metrics.c,v 1.9 2000/10/12 03:13:02 xiphmont Exp $
********************************************************************/
/* set up metrics */
-double meanamplitude_acc=0.;
-double meanamplitudesq_acc=0.;
-double meanerror_acc=0.;
-double meanerrorsq_acc=0.;
+float meanamplitude_acc=0.;
+float meanamplitudesq_acc=0.;
+float meanerror_acc=0.;
+float meanerrorsq_acc=0.;
-double **histogram=NULL;
-double **histogram_error=NULL;
-double **histogram_errorsq=NULL;
-double **histogram_hi=NULL;
-double **histogram_lo=NULL;
-double bits=0.;
-double count=0.;
+float **histogram=NULL;
+float **histogram_error=NULL;
+float **histogram_errorsq=NULL;
+float **histogram_hi=NULL;
+float **histogram_lo=NULL;
+float bits=0.;
+float count=0.;
-static double *_now(codebook *c, int i){
+static float *_now(codebook *c, int i){
return c->valuelist+i*c->c->dim;
}
while(bs[books])books++;
if(books){
- histogram=calloc(books,sizeof(double *));
- histogram_error=calloc(books,sizeof(double *));
- histogram_errorsq=calloc(books,sizeof(double *));
- histogram_hi=calloc(books,sizeof(double *));
- histogram_lo=calloc(books,sizeof(double *));
+ histogram=calloc(books,sizeof(float *));
+ histogram_error=calloc(books,sizeof(float *));
+ histogram_errorsq=calloc(books,sizeof(float *));
+ histogram_hi=calloc(books,sizeof(float *));
+ histogram_lo=calloc(books,sizeof(float *));
}else{
fprintf(stderr,"Specify at least one codebook\n");
exit(1);
for(i=0;i<books;i++){
codebook *b=bs[i];
- histogram[i]=calloc(b->entries,sizeof(double));
- histogram_error[i]=calloc(b->entries*b->dim,sizeof(double));
- histogram_errorsq[i]=calloc(b->entries*b->dim,sizeof(double));
- histogram_hi[i]=calloc(b->entries*b->dim,sizeof(double));
- histogram_lo[i]=calloc(b->entries*b->dim,sizeof(double));
+ histogram[i]=calloc(b->entries,sizeof(float));
+ histogram_error[i]=calloc(b->entries*b->dim,sizeof(float));
+ histogram_errorsq[i]=calloc(b->entries*b->dim,sizeof(float));
+ histogram_hi[i]=calloc(b->entries*b->dim,sizeof(float));
+ histogram_lo[i]=calloc(b->entries*b->dim,sizeof(float));
}
}
-static double _dist(int el,double *a, double *b){
+static float _dist(int el,float *a, float *b){
int i;
- double acc=0.;
+ float acc=0.;
for(i=0;i<el;i++){
- double val=(a[i]-b[i]);
+ float val=(a[i]-b[i]);
acc+=val*val;
}
return acc;
void cell_spacing(codebook *c){
int j,k;
- double min=-1,max=-1,mean=0.,meansq=0.;
+ float min=-1,max=-1,mean=0.,meansq=0.;
long total=0;
/* minimum, maximum, mean, ms cell spacing */
for(j=0;j<c->c->entries;j++){
if(c->c->lengthlist[j]>0){
- double localmin=-1.;
+ float localmin=-1.;
for(k=0;k<c->c->entries;k++){
if(c->c->lengthlist[k]>0){
- double this=_dist(c->c->dim,_now(c,j),_now(c,k));
+ float this=_dist(c->c->dim,_now(c,j),_now(c,k));
if(j!=k &&
(localmin==-1 || this<localmin))
localmin=this;
}
}
-double process_one(codebook *b,int book,double *a,int dim,int step,int addmul,
- double base){
+float process_one(codebook *b,int book,float *a,int dim,int step,int addmul,
+ float base){
int j,entry;
- double amplitude=0.;
+ float amplitude=0.;
if(book==0){
- double last=base;
+ float last=base;
for(j=0;j<dim;j++){
amplitude=a[j*step]-(b->c->q_sequencep?last:0);
meanamplitude_acc+=fabs(amplitude);
}
if(b->c->q_sequencep){
- double temp;
+ float temp;
for(j=0;j<dim;j++){
temp=a[j*step];
a[j*step]-=base;
bits+=vorbis_book_codelen(b,entry);
for(j=0;j<dim;j++){
- double error=a[j*step];
+ float error=a[j*step];
if(book==books-1){
meanerror_acc+=fabs(error);
}
-void process_vector(codebook **bs,int *addmul,int inter,double *a,int n){
+void process_vector(codebook **bs,int *addmul,int inter,float *a,int n){
int bi;
int i;
for(bi=0;bi<books;bi++){
codebook *b=bs[bi];
int dim=b->dim;
- double base=0.;
+ float base=0.;
if(inter){
for(i=0;i<n/dim;i++)
********************************************************************
function: metrics and quantization code for residue VQ codebooks
- last mod: $Id: residuedata.c,v 1.3 2000/05/08 20:49:51 xiphmont Exp $
+ last mod: $Id: residuedata.c,v 1.4 2000/10/12 03:13:02 xiphmont Exp $
********************************************************************/
quant_meta q={0,0,0,0}; /* set sequence data */
int vqext_aux=0;
-static double *quant_save=NULL;
+static float *quant_save=NULL;
-double *vqext_weight(vqgen *v,double *p){
+float *vqext_weight(vqgen *v,float *p){
return p;
}
int j,k;
long dim=v->elements;
long n=v->entries;
- double max=-1;
- double *test=alloca(sizeof(double)*dim);
+ float max=-1;
+ float *test=alloca(sizeof(float)*dim);
int moved=0;
/* allow movement only to unoccupied coordinates on the coarse grid */
for(j=0;j<n;j++){
for(k=0;k<dim;k++){
- double val=_now(v,j)[k];
- double norm=rint(fabs(val)/scalequant);
+ float val=_now(v,j)[k];
+ float norm=rint(fabs(val)/scalequant);
if(norm>max)max=norm;
test[k]=norm;
}
/* allow move only if unoccupied */
if(quant_save){
for(k=0;k<n;k++)
- if(j!=k && memcmp(test,quant_save+dim*k,dim*sizeof(double))==0)
+ if(j!=k && memcmp(test,quant_save+dim*k,dim*sizeof(float))==0)
break;
if(k==n){
- if(memcmp(test,quant_save+dim*j,dim*sizeof(double)))
+ if(memcmp(test,quant_save+dim*j,dim*sizeof(float)))
moved++;
- memcpy(quant_save+dim*j,test,sizeof(double)*dim);
+ memcpy(quant_save+dim*j,test,sizeof(float)*dim);
}
}else{
- memcpy(_now(v,j),test,sizeof(double)*dim);
+ memcpy(_now(v,j),test,sizeof(float)*dim);
}
}
q->quant=_ilog(max);
if(quant_save){
- memcpy(_now(v,0),quant_save,sizeof(double)*dim*n);
+ memcpy(_now(v,0),quant_save,sizeof(float)*dim*n);
fprintf(stderr,"cells shifted this iteration: %d\n",moved);
}
}
/* candidate,actual */
-double vqext_metric(vqgen *v,double *e, double *p){
+float vqext_metric(vqgen *v,float *e, float *p){
int i;
- double acc=0.;
+ float acc=0.;
for(i=0;i<v->elements;i++){
- double val=p[i]-e[i];
+ float val=p[i]-e[i];
acc+=val*val;
}
return sqrt(acc);
/* We don't interleave here; we assume that the interleave is provided
for us by residuesplit in vorbis/huff/ */
-void vqext_addpoint_adj(vqgen *v,double *b,int start,int dim,int cols,int num){
+void vqext_addpoint_adj(vqgen *v,float *b,int start,int dim,int cols,int num){
vqgen_addpoint(v,b+start,NULL);
}
residuals (which causes lots & lots of dupes) */
void vqext_preprocess(vqgen *v){
long i,j,k,l;
- double *test=alloca(sizeof(double)*v->elements);
+ float *test=alloca(sizeof(float)*v->elements);
scalequant=q.quant;
vqext_quantize(v,&q);
/* if there are any dupes, reseed */
for(k=0;k<v->entries;k++){
for(l=0;l<k;l++){
- if(memcmp(_now(v,k),_now(v,l),sizeof(double)*v->elements)==0)
+ if(memcmp(_now(v,k),_now(v,l),sizeof(float)*v->elements)==0)
break;
}
if(l<k)break;
for(i=0,j=0;i<v->points && j<v->entries;i++){
for(k=0;k<v->elements;k++){
- double val=_point(v,i)[k];
+ float val=_point(v,i)[k];
test[k]=rint(val/scalequant)*scalequant;
}
if(k==v->elements)break;
}
if(l==j){
- memcpy(_now(v,j),test,v->elements*sizeof(double));
+ memcpy(_now(v,j),test,v->elements*sizeof(float));
j++;
}
}
}
}
vqext_quantize(v,&q);
- quant_save=malloc(sizeof(double)*v->elements*v->entries);
- memcpy(quant_save,_now(v,0),sizeof(double)*v->elements*v->entries);
+ quant_save=malloc(sizeof(float)*v->elements*v->entries);
+ memcpy(quant_save,_now(v,0),sizeof(float)*v->elements*v->entries);
vqgen_unquantize(v,&q);
}
********************************************************************
function: residue backend 0 partitioner/classifier
- last mod: $Id: residuesplit.c,v 1.4 2000/08/15 09:09:32 xiphmont Exp $
+ last mod: $Id: residuesplit.c,v 1.5 2000/10/12 03:13:02 xiphmont Exp $
********************************************************************/
/* does not guard against invalid settings; eg, a subn of 16 and a
subgroup request of 32. Max subn of 128 */
-static void _testhack(double *vec,int n,double *entropy){
+static void _testhack(float *vec,int n,float *entropy){
int i,j=0;
- double max=0.;
- double temp[128];
+ float max=0.;
+ float temp[128];
/* setup */
for(i=0;i<n;i++)temp[i]=fabs(vec[i]);
/* This is currently a bit specific to/hardwired for mapping 0; things
will need to change in the future when we get real multichannel
mappings */
-int quantaux(double *res,int n,double *ebound,double *mbound,int *subgrp,int parts, int subn){
+int quantaux(float *res,int n,float *ebound,float *mbound,int *subgrp,int parts, int subn){
long i,j;
- double entropy[8];
+ float entropy[8];
int aux;
for(i=0;i<=n-subn;i+=subn){
- double max=0.;
+ float max=0.;
_testhack(res+i,subn,entropy);
for(j=0;j<subn;j++)
return(0);
}
-static int getline(FILE *in,double *vec,int begin,int n){
+static int getline(FILE *in,float *vec,int begin,int n){
int i,next=0;
reset_next_value();
char *base;
int i,parts,begin,n,subn,*subgrp;
FILE *res;
- double *ebound,*mbound,*vec;
+ float *ebound,*mbound,*vec;
long c=0;
if(argc<5)usage();
/* how many parts?... */
parts=argc-3;
- ebound=malloc(sizeof(double)*parts);
- mbound=malloc(sizeof(double)*parts);
+ ebound=malloc(sizeof(float)*parts);
+ mbound=malloc(sizeof(float)*parts);
subgrp=malloc(sizeof(int)*parts);
for(i=0;i<parts-1;i++){
}
}
- vec=malloc(sizeof(double)*n);
+ vec=malloc(sizeof(float)*n);
/* get the input line by line and process it */
while(!feof(res)){
if(getline(res,vec,begin,n))
********************************************************************
function: utility main for loading and operating on codebooks
- last mod: $Id: run.c,v 1.10 2000/05/08 20:49:51 xiphmont Exp $
+ last mod: $Id: run.c,v 1.11 2000/10/12 03:13:02 xiphmont Exp $
********************************************************************/
extern void process_preprocess(codebook **b,char *basename);
extern void process_postprocess(codebook **b,char *basename);
-extern void process_vector(codebook **b,int *addmul, int inter,double *a,int n);
+extern void process_vector(codebook **b,int *addmul, int inter,float *a,int n);
extern void process_usage(void);
int main(int argc,char *argv[]){
int cols;
long lines=0;
char *line;
- double *vec;
+ float *vec;
FILE *in=fopen(name,"r");
if(!in){
fprintf(stderr,"Could not open input file %s\n",name);
while(*temp==' ')temp++;
}
}
- vec=alloca(cols*sizeof(double));
+ vec=alloca(cols*sizeof(float));
while(line){
lines++;
for(j=0;j<cols;j++)
int cols;
char *line;
long lines=0;
- double *vec;
+ float *vec;
if(!input){
process_preprocess(b,basename);
input++;
while(*temp==' ')temp++;
}
}
- vec=alloca(cols*sizeof(double));
+ vec=alloca(cols*sizeof(float));
while(line){
lines++;
for(j=0;j<cols;j++)
********************************************************************
function: utility main for training codebooks
- last mod: $Id: train.c,v 1.18 2000/06/14 01:38:32 xiphmont Exp $
+ last mod: $Id: train.c,v 1.19 2000/10/12 03:13:02 xiphmont Exp $
********************************************************************/
int entries=-1,dim=-1;
int start=0,num=-1;
- double desired=.05,mindist=0.;
+ float desired=.05,mindist=0.;
int iter=1000;
int biasp=1;
int centroid=0;
if(in){
/* we wish to suck in a preexisting book and continue to train it */
- double a;
+ float a;
line=rline(in,out,1);
if(strcmp(line,vqext_booktype)){
v.seeded=1;
{
- double *b=alloca((dim+vqext_aux)*sizeof(double));
+ float *b=alloca((dim+vqext_aux)*sizeof(float));
i=0;
while(1){
for(k=0;k<dim+vqext_aux;k++){
}
{
int i;
- double b[cols];
+ float b[cols];
if(start+num*dim>cols){
fprintf(stderr,"ran out of columns reading %s\n",file);
exit(1);
signal(SIGINT,setexit);
for(i=0;i<iter && !exiting;i++){
- double result;
+ float result;
if(i!=0){
vqgen_unquantize(&v,&q);
vqgen_cellmetric(&v);
********************************************************************
function: prototypes for extermal metrics specific to data type
- last mod: $Id: vqext.h,v 1.9 2000/05/08 20:49:51 xiphmont Exp $
+ last mod: $Id: vqext.h,v 1.10 2000/10/12 03:13:02 xiphmont Exp $
********************************************************************/
extern quant_meta q;
extern int vqext_aux;
-extern double vqext_metric(vqgen *v,double *e, double *p);
-extern double *vqext_weight(vqgen *v,double *p);
-extern void vqext_addpoint_adj(vqgen *v,double *b,int start,int dim,int cols,int num);
+extern float vqext_metric(vqgen *v,float *e, float *p);
+extern float *vqext_weight(vqgen *v,float *p);
+extern void vqext_addpoint_adj(vqgen *v,float *b,int start,int dim,int cols,int num);
extern void vqext_preprocess(vqgen *v);
extern void vqext_quantize(vqgen *v,quant_meta *);
********************************************************************
function: train a VQ codebook
- last mod: $Id: vqgen.c,v 1.33 2000/07/17 12:55:37 xiphmont Exp $
+ last mod: $Id: vqgen.c,v 1.34 2000/10/12 03:13:02 xiphmont Exp $
********************************************************************/
#define vN(data,i) (data+v->elements*i)
/* default metric; squared 'distance' from desired value. */
-double _dist(vqgen *v,double *a, double *b){
+float _dist(vqgen *v,float *a, float *b){
int i;
int el=v->elements;
- double acc=0.;
+ float acc=0.;
for(i=0;i<el;i++){
- double val=(a[i]-b[i]);
+ float val=(a[i]-b[i]);
acc+=val*val;
}
return sqrt(acc);
}
-double *_weight_null(vqgen *v,double *a){
+float *_weight_null(vqgen *v,float *a){
return a;
}
void _vqgen_seed(vqgen *v){
long i;
for(i=0;i<v->entries;i++)
- memcpy(_now(v,i),_point(v,i),sizeof(double)*v->elements);
+ memcpy(_now(v,i),_point(v,i),sizeof(float)*v->elements);
v->seeded=1;
}
int directdsort(const void *a, const void *b){
- double av=*((double *)a);
- double bv=*((double *)b);
+ float av=*((float *)a);
+ float bv=*((float *)b);
if(av>bv)return(-1);
return(1);
}
void vqgen_cellmetric(vqgen *v){
int j,k;
- double min=-1.,max=-1.,mean=0.,acc=0.;
+ float min=-1.,max=-1.,mean=0.,acc=0.;
long dup=0,unused=0;
#ifdef NOISY
int i;
char buff[80];
- double spacings[v->entries];
+ float spacings[v->entries];
int count=0;
FILE *cells;
sprintf(buff,"cellspace%d.m",v->it);
/* minimum, maximum, cell spacing */
for(j=0;j<v->entries;j++){
- double localmin=-1.;
+ float localmin=-1.;
for(k=0;k<v->entries;k++){
if(j!=k){
- double this=_dist(v,_now(v,j),_now(v,k));
+ float this=_dist(v,_now(v,j),_now(v,k));
if(this>0){
if(v->assigned[k] && (localmin==-1 || this<localmin))
localmin=this;
min,mean/acc,max,unused,dup);
#ifdef NOISY
- qsort(spacings,count,sizeof(double),directdsort);
+ qsort(spacings,count,sizeof(float),directdsort);
for(i=0;i<count;i++)
fprintf(cells,"%g\n",spacings[i]);
fclose(cells);
void vqgen_quantize(vqgen *v,quant_meta *q){
- double maxdel;
- double mindel;
+ float maxdel;
+ float mindel;
- double delta;
- double maxquant=((1<<q->quant)-1);
+ float delta;
+ float maxquant=((1<<q->quant)-1);
int j,k;
mindel=maxdel=_now(v,0)[0];
for(j=0;j<v->entries;j++){
- double last=0.;
+ float last=0.;
for(k=0;k<v->elements;k++){
if(mindel>_now(v,j)[k]-last)mindel=_now(v,j)[k]-last;
if(maxdel<_now(v,j)[k]-last)maxdel=_now(v,j)[k]-last;
delta=_float32_unpack(q->delta);
for(j=0;j<v->entries;j++){
- double last=0;
+ float last=0;
for(k=0;k<v->elements;k++){
- double val=_now(v,j)[k];
- double now=rint((val-last-mindel)/delta);
+ float val=_now(v,j)[k];
+ float now=rint((val-last-mindel)/delta);
_now(v,j)[k]=now;
if(now<0){
scales; we just make sure they're properly offset. */
void vqgen_unquantize(vqgen *v,quant_meta *q){
long j,k;
- double mindel=_float32_unpack(q->min);
- double delta=_float32_unpack(q->delta);
+ float mindel=_float32_unpack(q->min);
+ float delta=_float32_unpack(q->delta);
for(j=0;j<v->entries;j++){
- double last=0.;
+ float last=0.;
for(k=0;k<v->elements;k++){
- double now=_now(v,j)[k];
+ float now=_now(v,j)[k];
now=fabs(now)*delta+last+mindel;
if(q->sequencep)last=now;
_now(v,j)[k]=now;
}
}
-void vqgen_init(vqgen *v,int elements,int aux,int entries,double mindist,
- double (*metric)(vqgen *,double *, double *),
- double *(*weight)(vqgen *,double *),int centroid){
+void vqgen_init(vqgen *v,int elements,int aux,int entries,float mindist,
+ float (*metric)(vqgen *,float *, float *),
+ float *(*weight)(vqgen *,float *),int centroid){
memset(v,0,sizeof(vqgen));
v->centroid=centroid;
v->aux=aux;
v->mindist=mindist;
v->allocated=32768;
- v->pointlist=malloc(v->allocated*(v->elements+v->aux)*sizeof(double));
+ v->pointlist=malloc(v->allocated*(v->elements+v->aux)*sizeof(float));
v->entries=entries;
- v->entrylist=malloc(v->entries*v->elements*sizeof(double));
+ v->entrylist=malloc(v->entries*v->elements*sizeof(float));
v->assigned=malloc(v->entries*sizeof(long));
- v->bias=calloc(v->entries,sizeof(double));
- v->max=calloc(v->entries,sizeof(double));
+ v->bias=calloc(v->entries,sizeof(float));
+ v->max=calloc(v->entries,sizeof(float));
if(metric)
v->metric_func=metric;
else
}
-void vqgen_addpoint(vqgen *v, double *p,double *a){
+void vqgen_addpoint(vqgen *v, float *p,float *a){
int k;
for(k=0;k<v->elements;k++)
fprintf(v->asciipoints,"%.12g\n",p[k]);
if(v->points>=v->allocated){
v->allocated*=2;
v->pointlist=realloc(v->pointlist,v->allocated*(v->elements+v->aux)*
- sizeof(double));
+ sizeof(float));
}
- memcpy(_point(v,v->points),p,sizeof(double)*v->elements);
- if(v->aux)memcpy(_point(v,v->points)+v->elements,a,sizeof(double)*v->aux);
+ memcpy(_point(v,v->points),p,sizeof(float)*v->elements);
+ if(v->aux)memcpy(_point(v,v->points)+v->elements,a,sizeof(float)*v->aux);
/* quantize to the density mesh if it's selected */
if(v->mindist>0.){
long i,march=1;
/* sort to make uniqueness detection trivial */
- sortsize=(v->elements+v->aux)*sizeof(double);
+ sortsize=(v->elements+v->aux)*sizeof(float);
qsort(v->pointlist,v->points,sortsize,meshcomp);
/* now march through and eliminate dupes */
v->sorted=1;
}
-double vqgen_iterate(vqgen *v,int biasp){
+float vqgen_iterate(vqgen *v,int biasp){
long i,j,k;
- double fdesired;
+ float fdesired;
long desired;
long desired2;
- double asserror=0.;
- double meterror=0.;
- double *new;
- double *new2;
+ float asserror=0.;
+ float meterror=0.;
+ float *new;
+ float *new2;
long *nearcount;
- double *nearbias;
+ float *nearbias;
#ifdef NOISY
char buff[80];
FILE *assig;
if(!v->sorted)vqgen_sortmesh(v);
if(!v->seeded)_vqgen_seed(v);
- fdesired=(double)v->points/v->entries;
+ fdesired=(float)v->points/v->entries;
desired=fdesired;
desired2=desired*2;
- new=malloc(sizeof(double)*v->entries*v->elements);
- new2=malloc(sizeof(double)*v->entries*v->elements);
+ new=malloc(sizeof(float)*v->entries*v->elements);
+ new2=malloc(sizeof(float)*v->entries*v->elements);
nearcount=malloc(v->entries*sizeof(long));
- nearbias=malloc(v->entries*desired2*sizeof(double));
+ nearbias=malloc(v->entries*desired2*sizeof(float));
/* fill in nearest points for entry biasing */
- /*memset(v->bias,0,sizeof(double)*v->entries);*/
+ /*memset(v->bias,0,sizeof(float)*v->entries);*/
memset(nearcount,0,sizeof(long)*v->entries);
memset(v->assigned,0,sizeof(long)*v->entries);
if(biasp){
for(i=0;i<v->points;i++){
- double *ppt=v->weight_func(v,_point(v,i));
- double firstmetric=v->metric_func(v,_now(v,0),ppt)+v->bias[0];
- double secondmetric=v->metric_func(v,_now(v,1),ppt)+v->bias[1];
+ float *ppt=v->weight_func(v,_point(v,i));
+ float firstmetric=v->metric_func(v,_now(v,0),ppt)+v->bias[0];
+ float secondmetric=v->metric_func(v,_now(v,1),ppt)+v->bias[1];
long firstentry=0;
long secondentry=1;
if(!(i&0xff))spinnit("biasing... ",v->points+v->points+v->entries-i);
if(firstmetric>secondmetric){
- double temp=firstmetric;
+ float temp=firstmetric;
firstmetric=secondmetric;
secondmetric=temp;
firstentry=1;
}
for(j=2;j<v->entries;j++){
- double thismetric=v->metric_func(v,_now(v,j),ppt)+v->bias[j];
+ float thismetric=v->metric_func(v,_now(v,j),ppt)+v->bias[j];
if(thismetric<secondmetric){
if(thismetric<firstmetric){
secondmetric=firstmetric;
j=firstentry;
for(j=0;j<v->entries;j++){
- double thismetric,localmetric;
- double *nearbiasptr=nearbias+desired2*j;
+ float thismetric,localmetric;
+ float *nearbiasptr=nearbias+desired2*j;
long k=nearcount[j];
localmetric=v->metric_func(v,_now(v,j),ppt);
k++;
if(k==desired){
spinnit("biasing... ",v->points+v->points+v->entries-i);
- qsort(nearbiasptr,desired,sizeof(double),directdsort);
+ qsort(nearbiasptr,desired,sizeof(float),directdsort);
}
}else if(thismetric>nearbiasptr[desired-1]){
k++;
if(k==desired2){
spinnit("biasing... ",v->points+v->points+v->entries-i);
- qsort(nearbiasptr,desired2,sizeof(double),directdsort);
+ qsort(nearbiasptr,desired2,sizeof(float),directdsort);
k=desired;
}
}
/* inflate/deflate */
for(i=0;i<v->entries;i++){
- double *nearbiasptr=nearbias+desired2*i;
+ float *nearbiasptr=nearbias+desired2*i;
spinnit("biasing... ",v->points+v->entries-i);
/* due to the delayed sorting, we likely need to finish it off....*/
if(nearcount[i]>desired)
- qsort(nearbiasptr,nearcount[i],sizeof(double),directdsort);
+ qsort(nearbiasptr,nearcount[i],sizeof(float),directdsort);
v->bias[i]=nearbiasptr[desired-1];
}
}else{
- memset(v->bias,0,v->entries*sizeof(double));
+ memset(v->bias,0,v->entries*sizeof(float));
}
/* Now assign with new bias and find new midpoints */
for(i=0;i<v->points;i++){
- double *ppt=v->weight_func(v,_point(v,i));
- double firstmetric=v->metric_func(v,_now(v,0),ppt)+v->bias[0];
+ float *ppt=v->weight_func(v,_point(v,i));
+ float firstmetric=v->metric_func(v,_now(v,0),ppt)+v->bias[0];
long firstentry=0;
if(!(i&0xff))spinnit("centering... ",v->points-i);
for(j=0;j<v->entries;j++){
- double thismetric=v->metric_func(v,_now(v,j),ppt)+v->bias[j];
+ float thismetric=v->metric_func(v,_now(v,j),ppt)+v->bias[j];
if(thismetric<firstmetric){
firstmetric=thismetric;
firstentry=j;
********************************************************************
function: build a VQ codebook
- last mod: $Id: vqgen.h,v 1.14 2000/06/14 01:38:32 xiphmont Exp $
+ last mod: $Id: vqgen.h,v 1.15 2000/10/12 03:13:02 xiphmont Exp $
********************************************************************/
int elements;
int aux;
- double mindist;
+ float mindist;
int centroid;
/* point cache */
- double *pointlist;
+ float *pointlist;
long points;
long allocated;
/* entries */
- double *entrylist;
+ float *entrylist;
long *assigned;
- double *bias;
+ float *bias;
long entries;
- double *max;
+ float *max;
- double (*metric_func) (struct vqgen *v,double *entry,double *point);
- double *(*weight_func) (struct vqgen *v,double *point);
+ float (*metric_func) (struct vqgen *v,float *entry,float *point);
+ float *(*weight_func) (struct vqgen *v,float *point);
FILE *asciipoints;
} vqgen;
int sequencep; /* bitflag */
} quant_meta;
-static inline double *_point(vqgen *v,long ptr){
+static inline float *_point(vqgen *v,long ptr){
return v->pointlist+((v->elements+v->aux)*ptr);
}
-static inline double *_aux(vqgen *v,long ptr){
+static inline float *_aux(vqgen *v,long ptr){
return _point(v,ptr)+v->aux;
}
-static inline double *_now(vqgen *v,long ptr){
+static inline float *_now(vqgen *v,long ptr){
return v->entrylist+(v->elements*ptr);
}
extern void vqgen_init(vqgen *v,
- int elements,int aux,int entries,double mindist,
- double (*metric)(vqgen *,double *, double *),
- double *(*weight)(vqgen *,double *),int centroid);
-extern void vqgen_addpoint(vqgen *v, double *p,double *aux);
+ int elements,int aux,int entries,float mindist,
+ float (*metric)(vqgen *,float *, float *),
+ float *(*weight)(vqgen *,float *),int centroid);
+extern void vqgen_addpoint(vqgen *v, float *p,float *aux);
-extern double vqgen_iterate(vqgen *v,int biasp);
+extern float vqgen_iterate(vqgen *v,int biasp);
extern void vqgen_unquantize(vqgen *v,quant_meta *q);
extern void vqgen_quantize(vqgen *v,quant_meta *q);
extern void vqgen_cellmetric(vqgen *v);
********************************************************************
function: build a VQ codebook and the encoding decision 'tree'
- last mod: $Id: vqsplit.c,v 1.19 2000/05/08 20:49:51 xiphmont Exp $
+ last mod: $Id: vqsplit.c,v 1.20 2000/10/12 03:13:02 xiphmont Exp $
********************************************************************/
return(av-bv);
}
-static double _Ndist(int el,double *a, double *b){
+static float _Ndist(int el,float *a, float *b){
int i;
- double acc=0.;
+ float acc=0.;
for(i=0;i<el;i++){
- double val=(a[i]-b[i]);
+ float val=(a[i]-b[i]);
acc+=val*val;
}
return sqrt(acc);
/* goes through the split, but just counts it and returns a metric*/
-int vqsp_count(double *entrylist,double *pointlist,int dim,
+int vqsp_count(float *entrylist,float *pointlist,int dim,
long *membership,long *reventry,
long *entryindex,long entries,
long *pointindex,long points,int splitp,
both? */
for(i=0;i<points;i++){
- double *ppt=_Npoint(pointindex[i]);
+ float *ppt=_Npoint(pointindex[i]);
long firstentry=membership[pointindex[i]];
if(firstentry==besti){
continue;
}
{
- double distA=_Ndist(dim,ppt,_Nnow(besti));
- double distB=_Ndist(dim,ppt,_Nnow(bestj));
+ float distA=_Ndist(dim,ppt,_Nnow(besti));
+ float distB=_Ndist(dim,ppt,_Nnow(bestj));
if(distA<distB){
entryA[reventry[firstentry]]=1;
if(splitp)temppointsA[pointsA++]=pointindex[i];
return(pointsA);
}
-int lp_split(double *pointlist,long totalpoints,
+int lp_split(float *pointlist,long totalpoints,
codebook *b,
long *entryindex,long entries,
long *pointindex,long points,
even a midpoint division won't disturb the basic properties) */
int dim=b->dim;
- double *entrylist=b->valuelist;
+ float *entrylist=b->valuelist;
long ret;
long *entryA=calloc(entries,sizeof(long));
long *entryB=calloc(entries,sizeof(long));
/* more than one way to do this part. For small sets, we can brute
force it. */
- if(entries<8 || (double)points*entries*entries<16.*1024*1024){
+ if(entries<8 || (float)points*entries*entries<16.*1024*1024){
/* try every pair possibility */
- double best=0;
- double this;
+ float best=0;
+ float this;
for(i=0;i<entries-1;i++){
for(j=i+1;j<entries;j++){
spinnit(spinbuf,entries-i);
}
}
}else{
- double *p=alloca(dim*sizeof(double));
- double *q=alloca(dim*sizeof(double));
- double best=0.;
+ float *p=alloca(dim*sizeof(float));
+ float *q=alloca(dim*sizeof(float));
+ float best=0.;
/* try COG/normal and furthest pairs */
/* meanpoint */
center */
for(i=0;i<entries;i++){
- double *ppi=_Nnow(entryindex[i]);
- double ref_best=0.;
- double ref_j=-1;
- double this;
+ float *ppi=_Nnow(entryindex[i]);
+ float ref_best=0.;
+ float ref_j=-1;
+ float this;
spinnit(spinbuf,entries-i);
for(k=0;k<dim;k++)
for(j=0;j<entries;j++){
if(j!=i){
- double this=_Ndist(dim,q,_Nnow(entryindex[j]));
+ float this=_Ndist(dim,q,_Nnow(entryindex[j]));
if(ref_j==-1 || this<=ref_best){ /* <=, not <; very important */
ref_best=this;
ref_j=entryindex[j];
if(_Ndist(v->elements,_now(v,i),_now(v,j))==0.){
fprintf(stderr,"found a duplicate entry! removing...\n");
v->entries--;
- memcpy(_now(v,i),_now(v,v->entries),sizeof(double)*v->elements);
+ memcpy(_now(v,i),_now(v,v->entries),sizeof(float)*v->elements);
memcpy(quantlist+i*v->elements,quantlist+v->entries*v->elements,
sizeof(long)*v->elements);
break;
{
v->assigned=calloc(v->entries,sizeof(long));
for(i=0;i<v->points;i++){
- double *ppt=_point(v,i);
- double firstmetric=_Ndist(v->elements,_now(v,0),ppt);
+ float *ppt=_point(v,i);
+ float firstmetric=_Ndist(v->elements,_now(v,0),ppt);
long firstentry=0;
if(!(i&0xff))spinnit("checking... ",v->points-i);
for(j=0;j<v->entries;j++){
- double thismetric=_Ndist(v->elements,_now(v,j),ppt);
+ float thismetric=_Ndist(v->elements,_now(v,j),ppt);
if(thismetric<firstmetric){
firstmetric=thismetric;
firstentry=j;
if(v->assigned[j]==0){
fprintf(stderr,"found an unused entry! removing...\n");
v->entries--;
- memcpy(_now(v,j),_now(v,v->entries),sizeof(double)*v->elements);
+ memcpy(_now(v,j),_now(v,v->entries),sizeof(float)*v->elements);
v->assigned[j]=v->assigned[v->elements];
memcpy(quantlist+j*v->elements,quantlist+v->entries*v->elements,
sizeof(long)*v->elements);
for(i=0;i<v->points;i++)membership[i]=-1;
for(i=0;i<v->points;i++){
- double *ppt=_point(v,i);
+ float *ppt=_point(v,i);
long firstentry=0;
- double firstmetric=_Ndist(v->elements,_now(v,0),ppt);
+ float firstmetric=_Ndist(v->elements,_now(v,0),ppt);
if(!(i&0xff))spinnit("assigning... ",v->points-i);
for(j=1;j<v->entries;j++){
if(v->assigned[j]!=-1){
- double thismetric=_Ndist(v->elements,_now(v,j),ppt);
+ float thismetric=_Ndist(v->elements,_now(v,j),ppt);
if(thismetric<=firstmetric){
firstmetric=thismetric;
firstentry=j;
/* map lengthlist and vallist with index */
c->lengthlist=calloc(c->entries,sizeof(long));
- b->valuelist=malloc(sizeof(double)*c->entries*c->dim);
+ b->valuelist=malloc(sizeof(float)*c->entries*c->dim);
c->quantlist=malloc(sizeof(long)*c->entries*c->dim);
for(i=0;i<c->entries;i++){
long e=index[i];
********************************************************************
function: build a VQ codebook decision tree
- last mod: $Id: vqsplit.h,v 1.2 2000/05/08 20:49:51 xiphmont Exp $
+ last mod: $Id: vqsplit.h,v 1.3 2000/10/12 03:13:02 xiphmont Exp $
********************************************************************/
#include "vorbis/codebook.h"
extern void vqsp_book(vqgen *v,codebook *b,long *quantlist);
-extern int vqenc_entry(codebook *b,double *val);
-extern int lp_split(double *pointlist,long totalpoints,
+extern int vqenc_entry(codebook *b,float *val);
+extern int lp_split(float *pointlist,long totalpoints,
codebook *b,
long *entryindex,long entries,
long *pointindex,long points,