mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-07-05 22:50:23 +00:00
Replaced libsamplerate with resampler from Opus tools and deleted libresample (which was unused).
This commit is contained in:
parent
ee03158465
commit
d87657bde3
|
@ -30,12 +30,14 @@ License Website: http://www.gnu.org/licenses/licenses.html#GPL
|
|||
License File: license_gnu_gpl_3.txt
|
||||
Location in QB64 distribution: internal/c/c_compiler/
|
||||
|
||||
Software/Library Name: Secret Rabbit Code (libsamplerate)
|
||||
Website: http://www.mega-nerd.com/SRC/
|
||||
License: GPL 2
|
||||
License Website: http://www.gnu.org/licenses/licenses.html#GPL
|
||||
License File: license_gnu_gpl_2.txt
|
||||
Software/Library Name: Opus Tools
|
||||
Website: http://www.opus-codec.org/
|
||||
License: BSD 2-clause license
|
||||
License Website: http://opensource.org/licenses/BSD-2-Clause
|
||||
License File: license_opus.txt
|
||||
Location in QB64 distribution: internal/c/parts/audio/conversion/
|
||||
Note that Opusinfo, which is included in the Opus Tools download, is licensed under the GPL but QB64 does not use those files (hence the appended GPL in the licence file).
|
||||
They are distributed in the download/ folder as source only, for the sake of keeping the original download package whole.
|
||||
|
||||
Software/Library Name: mpglibdll
|
||||
Website(s):
|
||||
|
|
371
LICENSE/license_opus.txt
Normal file
371
LICENSE/license_opus.txt
Normal file
|
@ -0,0 +1,371 @@
|
|||
|
||||
Opus-tools, with the exception of opusinfo.[ch] is available under
|
||||
the following two clause BSD-style license:
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
|
||||
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
Opusinfo is a fork of ogginfo from the vorbis-tools package
|
||||
(http://www.xiph.org). It is available under the GPL:
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 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.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, 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 or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
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 give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
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.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
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 Program, 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 Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) 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; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, 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 executable. However, as a
|
||||
special exception, the source code 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.
|
||||
|
||||
If distribution of executable or 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 counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program 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.
|
||||
|
||||
5. 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 Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program 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 to
|
||||
this License.
|
||||
|
||||
7. 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 Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program 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 Program.
|
||||
|
||||
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.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program 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.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the 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 Program
|
||||
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 Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, 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
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. 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 PROGRAM 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 PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. 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 program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program 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
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
|
@ -17933,11 +17933,9 @@ double func_sqr(double value){
|
|||
|
||||
#ifdef QB64_BACKSLASH_FILESYSTEM
|
||||
#include "parts\\audio\\conversion\\src.c"
|
||||
#include "parts\\audio\\libresample\\src.c"
|
||||
#include "parts\\audio\\decode\\src.c"
|
||||
#else
|
||||
#include "parts/audio/conversion/src.c"
|
||||
#include "parts/audio/libresample/src.c"
|
||||
#include "parts/audio/decode/src.c"
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Erik de Castro Lopo <erikd@mega-nerd.com>
|
|
@ -1,143 +0,0 @@
|
|||
#! /bin/sh
|
||||
# Wrapper for compilers which do not understand `-c -o'.
|
||||
|
||||
scriptversion=2009-04-28.21; # UTC
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software
|
||||
# Foundation, Inc.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||
#
|
||||
# This program 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, 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# 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.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Wrapper for compilers which do not understand `-c -o'.
|
||||
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
|
||||
arguments, and rename the output as expected.
|
||||
|
||||
If you are trying to build a whole package this is not the
|
||||
right script to run: please start by reading the file `INSTALL'.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "compile $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
ofile=
|
||||
cfile=
|
||||
eat=
|
||||
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as `compile cc -o foo foo.c'.
|
||||
# So we strip `-o arg' only if arg is an object.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.obj)
|
||||
ofile=$2
|
||||
;;
|
||||
*)
|
||||
set x "$@" -o "$2"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*.c)
|
||||
cfile=$1
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if test -z "$ofile" || test -z "$cfile"; then
|
||||
# If no `-o' option was seen then we might have been invoked from a
|
||||
# pattern rule where we don't need one. That is ok -- this is a
|
||||
# normal compilation that the losing compiler can handle. If no
|
||||
# `.c' file was seen then we are probably linking. That is also
|
||||
# ok.
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
# Name of file we expect compiler to create.
|
||||
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
|
||||
|
||||
# Create the lock directory.
|
||||
# Note: use `[/\\:.-]' here to ensure that we don't use the same name
|
||||
# that we are using for the .o file. Also, base the name on the expected
|
||||
# object file name, since that is what matters with a parallel build.
|
||||
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
|
||||
while true; do
|
||||
if mkdir "$lockdir" >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
# FIXME: race condition here if user kills between mkdir and trap.
|
||||
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
||||
|
||||
# Run the compile.
|
||||
"$@"
|
||||
ret=$?
|
||||
|
||||
if test -f "$cofile"; then
|
||||
mv "$cofile" "$ofile"
|
||||
elif test -f "${cofile}bj"; then
|
||||
mv "${cofile}bj" "$ofile"
|
||||
fi
|
||||
|
||||
rmdir "$lockdir"
|
||||
exit $ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
|
@ -1,376 +0,0 @@
|
|||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
|
||||
scriptversion=2009-04-28.21; # UTC
|
||||
|
||||
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
|
||||
# 2008, 2009 Free Software Foundation, Inc.
|
||||
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# This program 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, 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# 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.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run=:
|
||||
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
|
||||
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
|
||||
|
||||
# In the cases where this matters, `missing' is being run in the
|
||||
# srcdir already.
|
||||
if test -f configure.ac; then
|
||||
configure_ac=configure.ac
|
||||
else
|
||||
configure_ac=configure.in
|
||||
fi
|
||||
|
||||
msg="missing on your system"
|
||||
|
||||
case $1 in
|
||||
--run)
|
||||
# Try to run requested program, and just exit if it succeeds.
|
||||
run=
|
||||
shift
|
||||
"$@" && exit 0
|
||||
# Exit code 63 means version mismatch. This often happens
|
||||
# when the user try to use an ancient version of a tool on
|
||||
# a file that requires a minimum version. In this case we
|
||||
# we should proceed has if the program had been absent, or
|
||||
# if --run hadn't been passed.
|
||||
if test $? = 63; then
|
||||
run=:
|
||||
msg="probably too old"
|
||||
fi
|
||||
;;
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||
error status if there is no known handling for PROGRAM.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
--run try to run the given command, and emulate it if it fails
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
autom4te touch the output file, or create a stub one
|
||||
automake touch all \`Makefile.in' files
|
||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create \`lex.yy.c', if possible, from existing .c
|
||||
help2man touch the output file
|
||||
lex create \`lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
tar try tar, gnutar, gtar, then tar without non-portable flags
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
|
||||
Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
|
||||
\`g' are ignored when checking the name.
|
||||
|
||||
Send bug reports to <bug-automake@gnu.org>."
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||
echo "missing $scriptversion (GNU Automake)"
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: Unknown \`$1' option"
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# normalize program name to check for.
|
||||
program=`echo "$1" | sed '
|
||||
s/^gnu-//; t
|
||||
s/^gnu//; t
|
||||
s/^g//; t'`
|
||||
|
||||
# Now exit if we have it, but it failed. Also exit now if we
|
||||
# don't have it and --version was passed (most likely to detect
|
||||
# the program). This is about non-GNU programs, so use $1 not
|
||||
# $program.
|
||||
case $1 in
|
||||
lex*|yacc*)
|
||||
# Not GNU programs, they don't have --version.
|
||||
;;
|
||||
|
||||
tar*)
|
||||
if test -n "$run"; then
|
||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
# Could not run --version or --help. This is probably someone
|
||||
# running `$TOOL --version' or `$TOOL --help' to check whether
|
||||
# $TOOL exists and not knowing $TOOL uses missing.
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# If it does not exist, or fails to run (possibly an outdated version),
|
||||
# try to emulate it.
|
||||
case $program in
|
||||
aclocal*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`${configure_ac}'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case $f in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
autom4te*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, but is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them.
|
||||
You can get \`$1' as part of \`Autoconf' from any GNU
|
||||
archive site."
|
||||
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo "#! /bin/sh"
|
||||
echo "# Created by GNU Automake missing as a replacement of"
|
||||
echo "# $ $@"
|
||||
echo "exit 0"
|
||||
chmod +x $file
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
bison*|yacc*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' $msg. You should only need it if
|
||||
you modified a \`.y' file. You may need the \`Bison' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Bison' from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if test $# -ne 1; then
|
||||
eval LASTARG="\${$#}"
|
||||
case $LASTARG in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test ! -f y.tab.h; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if test ! -f y.tab.c; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex*|flex*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.l' file. You may need the \`Flex' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Flex' from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if test $# -ne 1; then
|
||||
eval LASTARG="\${$#}"
|
||||
case $LASTARG in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if test -f "$SRCFILE"; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test ! -f lex.yy.c; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
help2man*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a dependency of a manual page. You may need the
|
||||
\`Help2man' package in order for those modifications to take
|
||||
effect. You can get \`Help2man' from any GNU archive site."
|
||||
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo ".ab help2man is required to generate this page"
|
||||
exit $?
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
# The file to touch is that specified with -o ...
|
||||
file=`echo "$*" | sed -n "$sed_output"`
|
||||
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
|
||||
if test -z "$file"; then
|
||||
# ... or it is the one specified with @setfilename ...
|
||||
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '
|
||||
/^@setfilename/{
|
||||
s/.* \([^ ]*\) *$/\1/
|
||||
p
|
||||
q
|
||||
}' $infile`
|
||||
# ... or it is derived from the source name (dir/f.texi becomes f.info)
|
||||
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
|
||||
fi
|
||||
# If the file does not exist, the user really needs makeinfo;
|
||||
# let's fail without touching anything.
|
||||
test -f $file || exit 1
|
||||
touch $file
|
||||
;;
|
||||
|
||||
tar*)
|
||||
shift
|
||||
|
||||
# We have already tried tar in the generic part.
|
||||
# Look for gnutar/gtar before invocation to avoid ugly error
|
||||
# messages.
|
||||
if (gnutar --version > /dev/null 2>&1); then
|
||||
gnutar "$@" && exit 0
|
||||
fi
|
||||
if (gtar --version > /dev/null 2>&1); then
|
||||
gtar "$@" && exit 0
|
||||
fi
|
||||
firstarg="$1"
|
||||
if shift; then
|
||||
case $firstarg in
|
||||
*o*)
|
||||
firstarg=`echo "$firstarg" | sed s/o//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
case $firstarg in
|
||||
*h*)
|
||||
firstarg=`echo "$firstarg" | sed s/h//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
||||
You may want to install GNU tar or Free paxutils, or check the
|
||||
command line arguments."
|
||||
exit 1
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequisites for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
File diff suppressed because it is too large
Load diff
|
@ -1,117 +0,0 @@
|
|||
Install Instructions for libsamplerate
|
||||
======================================
|
||||
|
||||
The following instructions explain how to install libsamplerate under
|
||||
Linux and other Unix like systems including Mac OSX. (For windows,
|
||||
see http://www.mega-nerd.com/SRC/win32.html).
|
||||
|
||||
Preliminaries
|
||||
-------------
|
||||
1) Included with libsamplerate is a command line program named
|
||||
sndfile-resample which uses libnsdile:
|
||||
|
||||
http://www.mega-nerd.com/libsndfile/
|
||||
|
||||
for file I/O. If you want to use sndfile-resample you need to
|
||||
ensure that libsndfile is correctly installed first. If it is, the
|
||||
command "pkg-config --cflags --libs sndfile" should print out
|
||||
something like this:
|
||||
|
||||
-lsndfile
|
||||
|
||||
If pkg-config doesn't exist you will need need to install it. If
|
||||
pkg-config cannot find libsndfile you may need install it. If you
|
||||
install from from a Linux distribution package, make sure you also
|
||||
install the libsndfile-devel package which contains the header files.
|
||||
|
||||
If libsndfile is installed, you may need to set the PKG_CONFIG_PATH
|
||||
environment variable. If libsndfile is installed in /usr/local/lib,
|
||||
you will need to set PKG_CONFIG_PATH using:
|
||||
|
||||
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
|
||||
|
||||
Pkg-config should now work. If it doesn't you need to fix it if you
|
||||
want to use sndfile-resample.
|
||||
|
||||
2) The included tests suite for libsamplerate needs libfftw3 which is
|
||||
available here:
|
||||
|
||||
http://www.fftw.org/
|
||||
|
||||
If FFTW3 is not available, libsamplerate should still compile and
|
||||
install without problems but the test suite will not be as
|
||||
comprehensive as it normally is.
|
||||
|
||||
Building
|
||||
--------
|
||||
Building and verifying libsamplerate is a four or five step process.
|
||||
|
||||
1) The first step is to run configure
|
||||
|
||||
./configure
|
||||
|
||||
which should print out something like the following:
|
||||
|
||||
checking build system type...
|
||||
...
|
||||
...
|
||||
-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=-
|
||||
|
||||
Configuration summary :
|
||||
|
||||
Version : ..................... X.Y.Z
|
||||
Enable debugging : ............ no
|
||||
|
||||
Tools :
|
||||
|
||||
Compiler is GCC : ............. yes
|
||||
GCC major version : ........... 3
|
||||
|
||||
Extra tools required for testing and examples :
|
||||
|
||||
Use FFTW : .................... yes
|
||||
Have libsndfile : ............. yes
|
||||
|
||||
Installation directories :
|
||||
|
||||
Library directory : ........... /usr/local/lib
|
||||
Program directory : ........... /usr/local/bin
|
||||
Pkgconfig directory : ......... /usr/local/lib/pkgconfig
|
||||
|
||||
Compiling some other packages against libsamplerate may require
|
||||
the addition of "/usr/local/lib/pkgconfig" to the
|
||||
PKG_CONFIG_PATH environment variable.
|
||||
|
||||
There are a number of configure options. See the output of
|
||||
configure when run with the --help command line option.
|
||||
|
||||
2) If all goes well with the above then compiling the library can be
|
||||
done with
|
||||
|
||||
make
|
||||
|
||||
3) When that has finished, the test suite can be run using:
|
||||
|
||||
make check
|
||||
|
||||
4) The final step is to install the library. This step needs to be
|
||||
carried out as the root user (or with sudo):
|
||||
|
||||
make install
|
||||
|
||||
This command will by default install the library in the directory
|
||||
/usr/local/lib. It can in installed in other location by using the
|
||||
--prefix option in step 1).
|
||||
|
||||
5) On linux, one more step is required, the registering of the library
|
||||
with the system. This is done by running the following command
|
||||
(also as the root user):
|
||||
|
||||
ldconfig -v
|
||||
|
||||
As a final test, you can run
|
||||
|
||||
sndfile-resample
|
||||
|
||||
to make sure everything is installed correctly.
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
EXTRA_DIST = add_cflags.m4 endian.m4
|
||||
|
|
@ -1,392 +0,0 @@
|
|||
# Makefile.in generated by automake 1.11.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
|
||||
|
||||
@SET_MAKE@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = M4
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/M4/check_signal.m4 \
|
||||
$(top_srcdir)/M4/clip_mode.m4 $(top_srcdir)/M4/endian.m4 \
|
||||
$(top_srcdir)/M4/libtool.m4 $(top_srcdir)/M4/lrint.m4 \
|
||||
$(top_srcdir)/M4/lrintf.m4 $(top_srcdir)/M4/ltoptions.m4 \
|
||||
$(top_srcdir)/M4/ltsugar.m4 $(top_srcdir)/M4/ltversion.m4 \
|
||||
$(top_srcdir)/M4/lt~obsolete.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/src/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_GEN = $(am__v_GEN_$(V))
|
||||
am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
AM_V_at = $(am__v_at_$(V))
|
||||
am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_at_0 = @
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPILER_IS_GCC = @COMPILER_IS_GCC@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DLLWRAP = @DLLWRAP@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FFTW3_CFLAGS = @FFTW3_CFLAGS@
|
||||
FFTW3_LIBS = @FFTW3_LIBS@
|
||||
FGREP = @FGREP@
|
||||
GCC_MAJOR_VERSION = @GCC_MAJOR_VERSION@
|
||||
GREP = @GREP@
|
||||
HAVE_FFTW3 = @HAVE_FFTW3@
|
||||
HAVE_SNDFILE = @HAVE_SNDFILE@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OS_SPECIFIC_INCLUDES = @OS_SPECIFIC_INCLUDES@
|
||||
OS_SPECIFIC_LINKS = @OS_SPECIFIC_LINKS@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PEXPORTS = @PEXPORTS@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
RANLIB = @RANLIB@
|
||||
RC = @RC@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHARED_VERSION_INFO = @SHARED_VERSION_INFO@
|
||||
SHELL = @SHELL@
|
||||
SHLIB_VERSION_ARG = @SHLIB_VERSION_ARG@
|
||||
SNDFILE_CFLAGS = @SNDFILE_CFLAGS@
|
||||
SNDFILE_LIBS = @SNDFILE_LIBS@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
htmldocdir = @htmldocdir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
EXTRA_DIST = add_cflags.m4 endian.m4
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu M4/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu M4/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
||||
distclean distclean-generic distclean-libtool distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-info install-info-am install-man install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
|
||||
|
||||
|
||||
# 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:
|
|
@ -1,17 +0,0 @@
|
|||
dnl @synopsis AC_ADD_CFLAGS
|
||||
dnl
|
||||
dnl Add the given option to CFLAGS, if it doesn't break the compiler
|
||||
|
||||
AC_DEFUN([AC_ADD_CFLAGS],
|
||||
[AC_MSG_CHECKING([if $CC accepts $1])
|
||||
ac_add_cflags__old_cflags="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $1"
|
||||
AC_TRY_LINK([
|
||||
#include <stdio.h>
|
||||
],
|
||||
[puts("Hello, World!"); return 0;],
|
||||
AC_MSG_RESULT([yes]),
|
||||
AC_MSG_RESULT([no])
|
||||
CFLAGS="$ac_add_cflags__old_cflags"
|
||||
)
|
||||
])# AC_ADD_CFLAGS
|
|
@ -1,26 +0,0 @@
|
|||
dnl @synopsis AC_CHECK_SIGNAL(SIGNAME)
|
||||
dnl
|
||||
dnl
|
||||
dnl @category C
|
||||
dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||
dnl @version 1.0 Jul 07 2007
|
||||
|
||||
AC_DEFUN([AC_CHECK_SIGNAL],
|
||||
[AC_CACHE_CHECK(for $1,
|
||||
ac_cv_signal_$1,
|
||||
[
|
||||
AC_TRY_LINK([
|
||||
#include <signal.h>
|
||||
|
||||
], signal($1, SIG_DFL) ;, ac_cv_signal_$1=yes, ac_cv_signal_$1=no)
|
||||
|
||||
])
|
||||
|
||||
if test "$ac_cv_signal_$1" = yes; then
|
||||
AC_DEFINE(HAVE_$1, 1,
|
||||
[Define if you have signal $1.])
|
||||
fi
|
||||
])# AC_CHECK_SIGNAL
|
||||
|
||||
|
||||
## AC_CHECK_SIGNALS
|
|
@ -1,124 +0,0 @@
|
|||
dnl @synopsis AC_C_CLIP_MODE
|
||||
dnl
|
||||
dnl Determine the clipping mode when converting float to int.
|
||||
dnl @version 1.0 May 17 2003
|
||||
dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||
dnl
|
||||
dnl Permission to use, copy, modify, distribute, and sell this file for any
|
||||
dnl purpose is hereby granted without fee, provided that the above copyright
|
||||
dnl and this permission notice appear in all copies. No representations are
|
||||
dnl made about the suitability of this software for any purpose. It is
|
||||
dnl provided "as is" without express or implied warranty.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
dnl Find the clipping mode in the following way:
|
||||
dnl 1) If we are not cross compiling test it.
|
||||
dnl 2) IF we are cross compiling, assume that clipping isn't done correctly.
|
||||
|
||||
AC_DEFUN([AC_C_CLIP_MODE],
|
||||
[AC_CACHE_CHECK(processor clipping capabilities,
|
||||
ac_cv_c_clip_type,
|
||||
|
||||
# Initialize to unknown
|
||||
ac_cv_c_clip_positive=unknown
|
||||
ac_cv_c_clip_negative=unknown
|
||||
|
||||
|
||||
if test $ac_cv_c_clip_positive = unknown ; then
|
||||
AC_TRY_RUN(
|
||||
[[
|
||||
#define _ISOC9X_SOURCE 1
|
||||
#define _ISOC99_SOURCE 1
|
||||
#define __USE_ISOC99 1
|
||||
#define __USE_ISOC9X 1
|
||||
#include <math.h>
|
||||
int main (void)
|
||||
{ double fval ;
|
||||
int k, ival ;
|
||||
|
||||
fval = 1.0 * 0x7FFFFFFF ;
|
||||
for (k = 0 ; k < 100 ; k++)
|
||||
{ ival = (lrint (fval)) >> 24 ;
|
||||
if (ival != 127)
|
||||
return 1 ;
|
||||
|
||||
fval *= 1.2499999 ;
|
||||
} ;
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
]],
|
||||
ac_cv_c_clip_positive=yes,
|
||||
ac_cv_c_clip_positive=no,
|
||||
ac_cv_c_clip_positive=unknown
|
||||
)
|
||||
|
||||
AC_TRY_RUN(
|
||||
[[
|
||||
#define _ISOC9X_SOURCE 1
|
||||
#define _ISOC99_SOURCE 1
|
||||
#define __USE_ISOC99 1
|
||||
#define __USE_ISOC9X 1
|
||||
#include <math.h>
|
||||
int main (void)
|
||||
{ double fval ;
|
||||
int k, ival ;
|
||||
|
||||
fval = -8.0 * 0x10000000 ;
|
||||
for (k = 0 ; k < 100 ; k++)
|
||||
{ ival = (lrint (fval)) >> 24 ;
|
||||
if (ival != -128)
|
||||
return 1 ;
|
||||
|
||||
fval *= 1.2499999 ;
|
||||
} ;
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
]],
|
||||
ac_cv_c_clip_negative=yes,
|
||||
ac_cv_c_clip_negative=no,
|
||||
ac_cv_c_clip_negative=unknown
|
||||
)
|
||||
fi
|
||||
|
||||
if test $ac_cv_c_clip_positive = yes ; then
|
||||
ac_cv_c_clip_positive=1
|
||||
else
|
||||
ac_cv_c_clip_positive=0
|
||||
fi
|
||||
|
||||
if test $ac_cv_c_clip_negative = yes ; then
|
||||
ac_cv_c_clip_negative=1
|
||||
else
|
||||
ac_cv_c_clip_negative=0
|
||||
fi
|
||||
|
||||
[[
|
||||
case "$ac_cv_c_clip_positive$ac_cv_c_clip_negative" in
|
||||
"00")
|
||||
ac_cv_c_clip_type="none"
|
||||
;;
|
||||
"10")
|
||||
ac_cv_c_clip_type="positive"
|
||||
;;
|
||||
"01")
|
||||
ac_cv_c_clip_type="negative"
|
||||
;;
|
||||
"11")
|
||||
ac_cv_c_clip_type="both"
|
||||
;;
|
||||
esac
|
||||
]]
|
||||
|
||||
)
|
||||
]
|
||||
|
||||
)# AC_C_CLIP_MODE
|
||||
|
||||
|
|
@ -1,155 +0,0 @@
|
|||
dnl @synopsis AC_C_FIND_ENDIAN
|
||||
dnl
|
||||
dnl Determine endian-ness of target processor.
|
||||
dnl @version 1.1 Mar 03 2002
|
||||
dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||
dnl
|
||||
dnl Majority written from scratch to replace the standard autoconf macro
|
||||
dnl AC_C_BIGENDIAN. Only part remaining from the original it the invocation
|
||||
dnl of the AC_TRY_RUN macro.
|
||||
dnl
|
||||
dnl Permission to use, copy, modify, distribute, and sell this file for any
|
||||
dnl purpose is hereby granted without fee, provided that the above copyright
|
||||
dnl and this permission notice appear in all copies. No representations are
|
||||
dnl made about the suitability of this software for any purpose. It is
|
||||
dnl provided "as is" without express or implied warranty.
|
||||
|
||||
dnl Find endian-ness in the following way:
|
||||
dnl 1) Look in <endian.h>.
|
||||
dnl 2) If 1) fails, look in <sys/types.h> and <sys/param.h>.
|
||||
dnl 3) If 1) and 2) fails and not cross compiling run a test program.
|
||||
dnl 4) If 1) and 2) fails and cross compiling then guess based on target.
|
||||
|
||||
AC_DEFUN([AC_C_FIND_ENDIAN],
|
||||
[AC_CACHE_CHECK(processor byte ordering,
|
||||
ac_cv_c_byte_order,
|
||||
|
||||
# Initialize to unknown
|
||||
ac_cv_c_byte_order=unknown
|
||||
|
||||
if test x$ac_cv_header_endian_h = xyes ; then
|
||||
|
||||
# First try <endian.h> which should set BYTE_ORDER.
|
||||
|
||||
[AC_TRY_LINK([
|
||||
#include <endian.h>
|
||||
#if BYTE_ORDER != LITTLE_ENDIAN
|
||||
not big endian
|
||||
#endif
|
||||
], return 0 ;,
|
||||
ac_cv_c_byte_order=little
|
||||
)]
|
||||
|
||||
[AC_TRY_LINK([
|
||||
#include <endian.h>
|
||||
#if BYTE_ORDER != BIG_ENDIAN
|
||||
not big endian
|
||||
#endif
|
||||
], return 0 ;,
|
||||
ac_cv_c_byte_order=big
|
||||
)]
|
||||
|
||||
fi
|
||||
|
||||
if test $ac_cv_c_byte_order = unknown ; then
|
||||
|
||||
[AC_TRY_LINK([
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
|
||||
bogus endian macros
|
||||
#endif
|
||||
], return 0 ;,
|
||||
|
||||
[AC_TRY_LINK([
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#if BYTE_ORDER != LITTLE_ENDIAN
|
||||
not big endian
|
||||
#endif
|
||||
], return 0 ;,
|
||||
ac_cv_c_byte_order=little
|
||||
)]
|
||||
|
||||
[AC_TRY_LINK([
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#if BYTE_ORDER != LITTLE_ENDIAN
|
||||
not big endian
|
||||
#endif
|
||||
], return 0 ;,
|
||||
ac_cv_c_byte_order=little
|
||||
)]
|
||||
|
||||
)]
|
||||
|
||||
fi
|
||||
|
||||
if test $ac_cv_c_byte_order = unknown ; then
|
||||
if test $cross_compiling = yes ; then
|
||||
# This is the last resort. Try to guess the target processor endian-ness
|
||||
# by looking at the target CPU type.
|
||||
[
|
||||
case "$target_cpu" in
|
||||
alpha* | i?86* | mipsel* | ia64*)
|
||||
ac_cv_c_byte_order=little
|
||||
;;
|
||||
|
||||
m68* | mips* | powerpc* | hppa* | sparc*)
|
||||
ac_cv_c_byte_order=big
|
||||
;;
|
||||
|
||||
esac
|
||||
]
|
||||
else
|
||||
AC_TRY_RUN(
|
||||
[[
|
||||
int main (void)
|
||||
{ /* Are we little or big endian? From Harbison&Steele. */
|
||||
union
|
||||
{ long l ;
|
||||
char c [sizeof (long)] ;
|
||||
} u ;
|
||||
u.l = 1 ;
|
||||
return (u.c [sizeof (long) - 1] == 1);
|
||||
}
|
||||
]], , ac_cv_c_byte_order=big,
|
||||
)
|
||||
|
||||
AC_TRY_RUN(
|
||||
[[int main (void)
|
||||
{ /* Are we little or big endian? From Harbison&Steele. */
|
||||
union
|
||||
{ long l ;
|
||||
char c [sizeof (long)] ;
|
||||
} u ;
|
||||
u.l = 1 ;
|
||||
return (u.c [0] == 1);
|
||||
}]], , ac_cv_c_byte_order=little,
|
||||
)
|
||||
fi
|
||||
fi
|
||||
|
||||
)
|
||||
|
||||
if test $ac_cv_c_byte_order = big ; then
|
||||
ac_cv_c_big_endian=1
|
||||
ac_cv_c_little_endian=0
|
||||
elif test $ac_cv_c_byte_order = little ; then
|
||||
ac_cv_c_big_endian=0
|
||||
ac_cv_c_little_endian=1
|
||||
else
|
||||
ac_cv_c_big_endian=0
|
||||
ac_cv_c_little_endian=0
|
||||
|
||||
AC_MSG_WARN([[*****************************************************************]])
|
||||
AC_MSG_WARN([[*** Not able to determine endian-ness of target processor. ]])
|
||||
AC_MSG_WARN([[*** The constants CPU_IS_BIG_ENDIAN and CPU_IS_LITTLE_ENDIAN in ]])
|
||||
AC_MSG_WARN([[*** src/config.h may need to be hand editied. ]])
|
||||
AC_MSG_WARN([[*****************************************************************]])
|
||||
fi
|
||||
|
||||
]
|
||||
)# AC_C_FIND_ENDIAN
|
||||
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
dnl @synopsis AC_C99_FUNC_LRINT
|
||||
dnl
|
||||
dnl Check whether C99's lrint function is available.
|
||||
dnl @version 1.3 Feb 12 2002
|
||||
dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||
dnl
|
||||
dnl Permission to use, copy, modify, distribute, and sell this file for any
|
||||
dnl purpose is hereby granted without fee, provided that the above copyright
|
||||
dnl and this permission notice appear in all copies. No representations are
|
||||
dnl made about the suitability of this software for any purpose. It is
|
||||
dnl provided "as is" without express or implied warranty.
|
||||
dnl
|
||||
AC_DEFUN([AC_C99_FUNC_LRINT],
|
||||
[AC_CACHE_CHECK(for lrint,
|
||||
ac_cv_c99_lrint,
|
||||
[
|
||||
lrint_save_CFLAGS=$CFLAGS
|
||||
CFLAGS="-lm"
|
||||
AC_TRY_LINK([
|
||||
#define _ISOC9X_SOURCE 1
|
||||
#define _ISOC99_SOURCE 1
|
||||
#define __USE_ISOC99 1
|
||||
#define __USE_ISOC9X 1
|
||||
|
||||
#include <math.h>
|
||||
], if (!lrint(3.14159)) lrint(2.7183);, ac_cv_c99_lrint=yes, ac_cv_c99_lrint=no)
|
||||
|
||||
CFLAGS=$lrint_save_CFLAGS
|
||||
|
||||
])
|
||||
|
||||
if test "$ac_cv_c99_lrint" = yes; then
|
||||
AC_DEFINE(HAVE_LRINT, 1,
|
||||
[Define if you have C99's lrint function.])
|
||||
fi
|
||||
])# AC_C99_FUNC_LRINT
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
dnl @synopsis AC_C99_FUNC_LRINTF
|
||||
dnl
|
||||
dnl Check whether C99's lrintf function is available.
|
||||
dnl @version 1.3 Feb 12 2002
|
||||
dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||
dnl
|
||||
dnl Permission to use, copy, modify, distribute, and sell this file for any
|
||||
dnl purpose is hereby granted without fee, provided that the above copyright
|
||||
dnl and this permission notice appear in all copies. No representations are
|
||||
dnl made about the suitability of this software for any purpose. It is
|
||||
dnl provided "as is" without express or implied warranty.
|
||||
dnl
|
||||
AC_DEFUN([AC_C99_FUNC_LRINTF],
|
||||
[AC_CACHE_CHECK(for lrintf,
|
||||
ac_cv_c99_lrintf,
|
||||
[
|
||||
lrintf_save_CFLAGS=$CFLAGS
|
||||
CFLAGS="-lm"
|
||||
AC_TRY_LINK([
|
||||
#define _ISOC9X_SOURCE 1
|
||||
#define _ISOC99_SOURCE 1
|
||||
#define __USE_ISOC99 1
|
||||
#define __USE_ISOC9X 1
|
||||
|
||||
#include <math.h>
|
||||
], if (!lrintf(3.14159)) lrintf(2.7183);, ac_cv_c99_lrintf=yes, ac_cv_c99_lrintf=no)
|
||||
|
||||
CFLAGS=$lrintf_save_CFLAGS
|
||||
|
||||
])
|
||||
|
||||
if test "$ac_cv_c99_lrintf" = yes; then
|
||||
AC_DEFINE(HAVE_LRINTF, 1,
|
||||
[Define if you have C99's lrintf function.])
|
||||
fi
|
||||
])# AC_C99_FUNC_LRINTF
|
||||
|
|
@ -1,369 +0,0 @@
|
|||
# Helper functions for option handling. -*- Autoconf -*-
|
||||
#
|
||||
# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# Written by Gary V. Vaughan, 2004
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# serial 7 ltoptions.m4
|
||||
|
||||
# This is to help aclocal find these macros, as it can't see m4_define.
|
||||
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
|
||||
|
||||
|
||||
# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
|
||||
# ------------------------------------------
|
||||
m4_define([_LT_MANGLE_OPTION],
|
||||
[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
|
||||
|
||||
|
||||
# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
|
||||
# ---------------------------------------
|
||||
# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
|
||||
# matching handler defined, dispatch to it. Other OPTION-NAMEs are
|
||||
# saved as a flag.
|
||||
m4_define([_LT_SET_OPTION],
|
||||
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
|
||||
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
|
||||
_LT_MANGLE_DEFUN([$1], [$2]),
|
||||
[m4_warning([Unknown $1 option `$2'])])[]dnl
|
||||
])
|
||||
|
||||
|
||||
# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
|
||||
# ------------------------------------------------------------
|
||||
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
|
||||
m4_define([_LT_IF_OPTION],
|
||||
[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
|
||||
|
||||
|
||||
# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
|
||||
# -------------------------------------------------------
|
||||
# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
|
||||
# are set.
|
||||
m4_define([_LT_UNLESS_OPTIONS],
|
||||
[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
|
||||
[m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
|
||||
[m4_define([$0_found])])])[]dnl
|
||||
m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
|
||||
])[]dnl
|
||||
])
|
||||
|
||||
|
||||
# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
|
||||
# ----------------------------------------
|
||||
# OPTION-LIST is a space-separated list of Libtool options associated
|
||||
# with MACRO-NAME. If any OPTION has a matching handler declared with
|
||||
# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
|
||||
# the unknown option and exit.
|
||||
m4_defun([_LT_SET_OPTIONS],
|
||||
[# Set options
|
||||
m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
|
||||
[_LT_SET_OPTION([$1], _LT_Option)])
|
||||
|
||||
m4_if([$1],[LT_INIT],[
|
||||
dnl
|
||||
dnl Simply set some default values (i.e off) if boolean options were not
|
||||
dnl specified:
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
|
||||
])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
|
||||
])
|
||||
dnl
|
||||
dnl If no reference was made to various pairs of opposing options, then
|
||||
dnl we run the default mode handler for the pair. For example, if neither
|
||||
dnl `shared' nor `disable-shared' was passed, we enable building of shared
|
||||
dnl archives by default:
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
|
||||
[_LT_ENABLE_FAST_INSTALL])
|
||||
])
|
||||
])# _LT_SET_OPTIONS
|
||||
|
||||
|
||||
## --------------------------------- ##
|
||||
## Macros to handle LT_INIT options. ##
|
||||
## --------------------------------- ##
|
||||
|
||||
# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
|
||||
# -----------------------------------------
|
||||
m4_define([_LT_MANGLE_DEFUN],
|
||||
[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
|
||||
|
||||
|
||||
# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
|
||||
# -----------------------------------------------
|
||||
m4_define([LT_OPTION_DEFINE],
|
||||
[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
|
||||
])# LT_OPTION_DEFINE
|
||||
|
||||
|
||||
# dlopen
|
||||
# ------
|
||||
LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
|
||||
])
|
||||
|
||||
AU_DEFUN([AC_LIBTOOL_DLOPEN],
|
||||
[_LT_SET_OPTION([LT_INIT], [dlopen])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you
|
||||
put the `dlopen' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
|
||||
|
||||
|
||||
# win32-dll
|
||||
# ---------
|
||||
# Declare package support for building win32 dll's.
|
||||
LT_OPTION_DEFINE([LT_INIT], [win32-dll],
|
||||
[enable_win32_dll=yes
|
||||
|
||||
case $host in
|
||||
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
|
||||
AC_CHECK_TOOL(AS, as, false)
|
||||
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
|
||||
AC_CHECK_TOOL(OBJDUMP, objdump, false)
|
||||
;;
|
||||
esac
|
||||
|
||||
test -z "$AS" && AS=as
|
||||
_LT_DECL([], [AS], [1], [Assembler program])dnl
|
||||
|
||||
test -z "$DLLTOOL" && DLLTOOL=dlltool
|
||||
_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
|
||||
|
||||
test -z "$OBJDUMP" && OBJDUMP=objdump
|
||||
_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
|
||||
])# win32-dll
|
||||
|
||||
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
|
||||
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
_LT_SET_OPTION([LT_INIT], [win32-dll])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you
|
||||
put the `win32-dll' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
|
||||
|
||||
|
||||
# _LT_ENABLE_SHARED([DEFAULT])
|
||||
# ----------------------------
|
||||
# implement the --enable-shared flag, and supports the `shared' and
|
||||
# `disable-shared' LT_INIT options.
|
||||
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
|
||||
m4_define([_LT_ENABLE_SHARED],
|
||||
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
|
||||
AC_ARG_ENABLE([shared],
|
||||
[AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
|
||||
[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
|
||||
[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.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
for pkg in $enableval; do
|
||||
IFS="$lt_save_ifs"
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_shared=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
|
||||
|
||||
_LT_DECL([build_libtool_libs], [enable_shared], [0],
|
||||
[Whether or not to build shared libraries])
|
||||
])# _LT_ENABLE_SHARED
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
|
||||
|
||||
# Old names:
|
||||
AC_DEFUN([AC_ENABLE_SHARED],
|
||||
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
|
||||
])
|
||||
|
||||
AC_DEFUN([AC_DISABLE_SHARED],
|
||||
[_LT_SET_OPTION([LT_INIT], [disable-shared])
|
||||
])
|
||||
|
||||
AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
|
||||
AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AM_ENABLE_SHARED], [])
|
||||
dnl AC_DEFUN([AM_DISABLE_SHARED], [])
|
||||
|
||||
|
||||
|
||||
# _LT_ENABLE_STATIC([DEFAULT])
|
||||
# ----------------------------
|
||||
# implement the --enable-static flag, and support the `static' and
|
||||
# `disable-static' LT_INIT options.
|
||||
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
|
||||
m4_define([_LT_ENABLE_STATIC],
|
||||
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
|
||||
AC_ARG_ENABLE([static],
|
||||
[AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
|
||||
[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
|
||||
[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.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
for pkg in $enableval; do
|
||||
IFS="$lt_save_ifs"
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_static=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
|
||||
|
||||
_LT_DECL([build_old_libs], [enable_static], [0],
|
||||
[Whether or not to build static libraries])
|
||||
])# _LT_ENABLE_STATIC
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
|
||||
|
||||
# Old names:
|
||||
AC_DEFUN([AC_ENABLE_STATIC],
|
||||
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
|
||||
])
|
||||
|
||||
AC_DEFUN([AC_DISABLE_STATIC],
|
||||
[_LT_SET_OPTION([LT_INIT], [disable-static])
|
||||
])
|
||||
|
||||
AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
|
||||
AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AM_ENABLE_STATIC], [])
|
||||
dnl AC_DEFUN([AM_DISABLE_STATIC], [])
|
||||
|
||||
|
||||
|
||||
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
|
||||
# ----------------------------------
|
||||
# implement the --enable-fast-install flag, and support the `fast-install'
|
||||
# and `disable-fast-install' LT_INIT options.
|
||||
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
|
||||
m4_define([_LT_ENABLE_FAST_INSTALL],
|
||||
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
|
||||
AC_ARG_ENABLE([fast-install],
|
||||
[AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
|
||||
[optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
|
||||
[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.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
for pkg in $enableval; do
|
||||
IFS="$lt_save_ifs"
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_fast_install=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
|
||||
|
||||
_LT_DECL([fast_install], [enable_fast_install], [0],
|
||||
[Whether or not to optimize for fast installation])dnl
|
||||
])# _LT_ENABLE_FAST_INSTALL
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
|
||||
|
||||
# Old names:
|
||||
AU_DEFUN([AC_ENABLE_FAST_INSTALL],
|
||||
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
|
||||
the `fast-install' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
|
||||
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
|
||||
the `disable-fast-install' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
|
||||
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
|
||||
|
||||
|
||||
# _LT_WITH_PIC([MODE])
|
||||
# --------------------
|
||||
# implement the --with-pic flag, and support the `pic-only' and `no-pic'
|
||||
# LT_INIT options.
|
||||
# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
|
||||
m4_define([_LT_WITH_PIC],
|
||||
[AC_ARG_WITH([pic],
|
||||
[AS_HELP_STRING([--with-pic],
|
||||
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
|
||||
[pic_mode="$withval"],
|
||||
[pic_mode=default])
|
||||
|
||||
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
|
||||
|
||||
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
|
||||
])# _LT_WITH_PIC
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
|
||||
|
||||
# Old name:
|
||||
AU_DEFUN([AC_LIBTOOL_PICMODE],
|
||||
[_LT_SET_OPTION([LT_INIT], [pic-only])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you
|
||||
put the `pic-only' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
|
||||
|
||||
## ----------------- ##
|
||||
## LTDL_INIT Options ##
|
||||
## ----------------- ##
|
||||
|
||||
m4_define([_LTDL_MODE], [])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
|
||||
[m4_define([_LTDL_MODE], [nonrecursive])])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [recursive],
|
||||
[m4_define([_LTDL_MODE], [recursive])])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [subproject],
|
||||
[m4_define([_LTDL_MODE], [subproject])])
|
||||
|
||||
m4_define([_LTDL_TYPE], [])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [installable],
|
||||
[m4_define([_LTDL_TYPE], [installable])])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [convenience],
|
||||
[m4_define([_LTDL_TYPE], [convenience])])
|
|
@ -1,123 +0,0 @@
|
|||
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
|
||||
# Written by Gary V. Vaughan, 2004
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# serial 6 ltsugar.m4
|
||||
|
||||
# This is to help aclocal find these macros, as it can't see m4_define.
|
||||
AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
|
||||
|
||||
|
||||
# lt_join(SEP, ARG1, [ARG2...])
|
||||
# -----------------------------
|
||||
# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
|
||||
# associated separator.
|
||||
# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
|
||||
# versions in m4sugar had bugs.
|
||||
m4_define([lt_join],
|
||||
[m4_if([$#], [1], [],
|
||||
[$#], [2], [[$2]],
|
||||
[m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
|
||||
m4_define([_lt_join],
|
||||
[m4_if([$#$2], [2], [],
|
||||
[m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
|
||||
|
||||
|
||||
# lt_car(LIST)
|
||||
# lt_cdr(LIST)
|
||||
# ------------
|
||||
# Manipulate m4 lists.
|
||||
# These macros are necessary as long as will still need to support
|
||||
# Autoconf-2.59 which quotes differently.
|
||||
m4_define([lt_car], [[$1]])
|
||||
m4_define([lt_cdr],
|
||||
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
|
||||
[$#], 1, [],
|
||||
[m4_dquote(m4_shift($@))])])
|
||||
m4_define([lt_unquote], $1)
|
||||
|
||||
|
||||
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
|
||||
# ------------------------------------------
|
||||
# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
|
||||
# Note that neither SEPARATOR nor STRING are expanded; they are appended
|
||||
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
|
||||
# No SEPARATOR is output if MACRO-NAME was previously undefined (different
|
||||
# than defined and empty).
|
||||
#
|
||||
# This macro is needed until we can rely on Autoconf 2.62, since earlier
|
||||
# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
|
||||
m4_define([lt_append],
|
||||
[m4_define([$1],
|
||||
m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
|
||||
|
||||
|
||||
|
||||
# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
|
||||
# ----------------------------------------------------------
|
||||
# Produce a SEP delimited list of all paired combinations of elements of
|
||||
# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
|
||||
# has the form PREFIXmINFIXSUFFIXn.
|
||||
# Needed until we can rely on m4_combine added in Autoconf 2.62.
|
||||
m4_define([lt_combine],
|
||||
[m4_if(m4_eval([$# > 3]), [1],
|
||||
[m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
|
||||
[[m4_foreach([_Lt_prefix], [$2],
|
||||
[m4_foreach([_Lt_suffix],
|
||||
]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
|
||||
[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
|
||||
|
||||
|
||||
# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
|
||||
# -----------------------------------------------------------------------
|
||||
# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
|
||||
# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
|
||||
m4_define([lt_if_append_uniq],
|
||||
[m4_ifdef([$1],
|
||||
[m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
|
||||
[lt_append([$1], [$2], [$3])$4],
|
||||
[$5])],
|
||||
[lt_append([$1], [$2], [$3])$4])])
|
||||
|
||||
|
||||
# lt_dict_add(DICT, KEY, VALUE)
|
||||
# -----------------------------
|
||||
m4_define([lt_dict_add],
|
||||
[m4_define([$1($2)], [$3])])
|
||||
|
||||
|
||||
# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
|
||||
# --------------------------------------------
|
||||
m4_define([lt_dict_add_subkey],
|
||||
[m4_define([$1($2:$3)], [$4])])
|
||||
|
||||
|
||||
# lt_dict_fetch(DICT, KEY, [SUBKEY])
|
||||
# ----------------------------------
|
||||
m4_define([lt_dict_fetch],
|
||||
[m4_ifval([$3],
|
||||
m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
|
||||
m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
|
||||
|
||||
|
||||
# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
|
||||
# -----------------------------------------------------------------
|
||||
m4_define([lt_if_dict_fetch],
|
||||
[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
|
||||
[$5],
|
||||
[$6])])
|
||||
|
||||
|
||||
# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
|
||||
# --------------------------------------------------------------
|
||||
m4_define([lt_dict_filter],
|
||||
[m4_if([$5], [], [],
|
||||
[lt_join(m4_quote(m4_default([$4], [[, ]])),
|
||||
lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
|
||||
[lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
|
||||
])
|
|
@ -1,23 +0,0 @@
|
|||
# ltversion.m4 -- version numbers -*- Autoconf -*-
|
||||
#
|
||||
# Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
# Written by Scott James Remnant, 2004
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# @configure_input@
|
||||
|
||||
# serial 3293 ltversion.m4
|
||||
# This file is part of GNU Libtool
|
||||
|
||||
m4_define([LT_PACKAGE_VERSION], [2.4])
|
||||
m4_define([LT_PACKAGE_REVISION], [1.3293])
|
||||
|
||||
AC_DEFUN([LTVERSION_VERSION],
|
||||
[macro_version='2.4'
|
||||
macro_revision='1.3293'
|
||||
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
|
||||
_LT_DECL(, macro_revision, 0)
|
||||
])
|
|
@ -1,98 +0,0 @@
|
|||
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
|
||||
# Written by Scott James Remnant, 2004.
|
||||
#
|
||||
# This file 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.
|
||||
|
||||
# serial 5 lt~obsolete.m4
|
||||
|
||||
# These exist entirely to fool aclocal when bootstrapping libtool.
|
||||
#
|
||||
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
|
||||
# which have later been changed to m4_define as they aren't part of the
|
||||
# exported API, or moved to Autoconf or Automake where they belong.
|
||||
#
|
||||
# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
|
||||
# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
|
||||
# using a macro with the same name in our local m4/libtool.m4 it'll
|
||||
# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
|
||||
# and doesn't know about Autoconf macros at all.)
|
||||
#
|
||||
# So we provide this file, which has a silly filename so it's always
|
||||
# included after everything else. This provides aclocal with the
|
||||
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
|
||||
# because those macros already exist, or will be overwritten later.
|
||||
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
|
||||
#
|
||||
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
|
||||
# Yes, that means every name once taken will need to remain here until
|
||||
# we give up compatibility with versions before 1.7, at which point
|
||||
# we need to keep only those names which we still refer to.
|
||||
|
||||
# This is to help aclocal find these macros, as it can't see m4_define.
|
||||
AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
|
||||
|
||||
m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
|
||||
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
|
||||
m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
|
||||
m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
|
||||
m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
|
||||
m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
|
||||
m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
|
||||
m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
|
||||
m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
|
||||
m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
|
||||
m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
|
||||
m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
|
||||
m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
|
||||
m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
|
||||
m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
|
||||
m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
|
||||
m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
|
||||
m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
|
||||
m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
|
||||
m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
|
||||
m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
|
||||
m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
|
||||
m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
|
||||
m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
|
||||
m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
|
||||
m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
|
||||
m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
|
||||
m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
|
||||
m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
|
||||
m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
|
||||
m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
|
||||
m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
|
||||
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
|
||||
m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
|
||||
m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
|
||||
m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
|
||||
m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
|
||||
m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
|
||||
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
|
||||
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
|
|
@ -1,22 +0,0 @@
|
|||
@echo off
|
||||
|
||||
if "%1"=="check" GOTO CHECK
|
||||
if "%1"=="clean" GOTO CLEAN
|
||||
|
||||
copy /y Win32\config.h src\config.h
|
||||
copy /y Win32\unistd.h examples\unistd.h
|
||||
|
||||
nmake -f Win32\Makefile.msvc
|
||||
goto END
|
||||
|
||||
|
||||
:CHECK
|
||||
nmake -f Win32\Makefile.msvc check
|
||||
goto END
|
||||
|
||||
:CLEAN
|
||||
nmake -f Win32\Makefile.msvc clean
|
||||
goto END
|
||||
|
||||
:END
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
DISTCHECK_CONFIGURE_FLAGS = --enable-gcc-werror
|
||||
|
||||
SUBDIRS = M4 src doc examples tests
|
||||
DIST_SUBDIRS = Win32 $(SUBDIRS)
|
||||
|
||||
EXTRA_DIST = autogen.sh libsamplerate.spec.in samplerate.pc.in Make.bat
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = samplerate.pc
|
||||
|
||||
m4datadir = $(datadir)/aclocal
|
||||
|
||||
# Some people prefer "make test" to "make check".
|
||||
|
||||
test:
|
||||
make check
|
||||
|
||||
check-asm :
|
||||
(cd src && make check-asm)
|
||||
|
|
@ -1,806 +0,0 @@
|
|||
# Makefile.in generated by automake 1.11.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = .
|
||||
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/libsamplerate.spec.in \
|
||||
$(srcdir)/samplerate.pc.in $(top_srcdir)/configure AUTHORS \
|
||||
COPYING Cfg/compile Cfg/config.guess Cfg/config.sub \
|
||||
Cfg/depcomp Cfg/install-sh Cfg/ltmain.sh Cfg/missing ChangeLog \
|
||||
INSTALL NEWS
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/M4/check_signal.m4 \
|
||||
$(top_srcdir)/M4/clip_mode.m4 $(top_srcdir)/M4/endian.m4 \
|
||||
$(top_srcdir)/M4/libtool.m4 $(top_srcdir)/M4/lrint.m4 \
|
||||
$(top_srcdir)/M4/lrintf.m4 $(top_srcdir)/M4/ltoptions.m4 \
|
||||
$(top_srcdir)/M4/ltsugar.m4 $(top_srcdir)/M4/ltversion.m4 \
|
||||
$(top_srcdir)/M4/lt~obsolete.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno config.status.lineno
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/src/config.h
|
||||
CONFIG_CLEAN_FILES = libsamplerate.spec samplerate.pc
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_GEN = $(am__v_GEN_$(V))
|
||||
am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
AM_V_at = $(am__v_at_$(V))
|
||||
am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_at_0 = @
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-dvi-recursive install-exec-recursive \
|
||||
install-html-recursive install-info-recursive \
|
||||
install-pdf-recursive install-ps-recursive install-recursive \
|
||||
installcheck-recursive installdirs-recursive pdf-recursive \
|
||||
ps-recursive uninstall-recursive
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
|
||||
DATA = $(pkgconfig_DATA)
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
|
||||
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
|
||||
distdir dist dist-all distcheck
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
am__remove_distdir = \
|
||||
{ test ! -d "$(distdir)" \
|
||||
|| { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -fr "$(distdir)"; }; }
|
||||
am__relativize = \
|
||||
dir0=`pwd`; \
|
||||
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
|
||||
sed_rest='s,^[^/]*/*,,'; \
|
||||
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
|
||||
sed_butlast='s,/*[^/]*$$,,'; \
|
||||
while test -n "$$dir1"; do \
|
||||
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
|
||||
if test "$$first" != "."; then \
|
||||
if test "$$first" = ".."; then \
|
||||
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
|
||||
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
|
||||
else \
|
||||
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
|
||||
if test "$$first2" = "$$first"; then \
|
||||
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
|
||||
else \
|
||||
dir2="../$$dir2"; \
|
||||
fi; \
|
||||
dir0="$$dir0"/"$$first"; \
|
||||
fi; \
|
||||
fi; \
|
||||
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
|
||||
done; \
|
||||
reldir="$$dir2"
|
||||
DIST_ARCHIVES = $(distdir).tar.gz
|
||||
GZIP_ENV = --best
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPILER_IS_GCC = @COMPILER_IS_GCC@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DLLWRAP = @DLLWRAP@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FFTW3_CFLAGS = @FFTW3_CFLAGS@
|
||||
FFTW3_LIBS = @FFTW3_LIBS@
|
||||
FGREP = @FGREP@
|
||||
GCC_MAJOR_VERSION = @GCC_MAJOR_VERSION@
|
||||
GREP = @GREP@
|
||||
HAVE_FFTW3 = @HAVE_FFTW3@
|
||||
HAVE_SNDFILE = @HAVE_SNDFILE@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OS_SPECIFIC_INCLUDES = @OS_SPECIFIC_INCLUDES@
|
||||
OS_SPECIFIC_LINKS = @OS_SPECIFIC_LINKS@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PEXPORTS = @PEXPORTS@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
RANLIB = @RANLIB@
|
||||
RC = @RC@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHARED_VERSION_INFO = @SHARED_VERSION_INFO@
|
||||
SHELL = @SHELL@
|
||||
SHLIB_VERSION_ARG = @SHLIB_VERSION_ARG@
|
||||
SNDFILE_CFLAGS = @SNDFILE_CFLAGS@
|
||||
SNDFILE_LIBS = @SNDFILE_LIBS@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
htmldocdir = @htmldocdir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
DISTCHECK_CONFIGURE_FLAGS = --enable-gcc-werror
|
||||
SUBDIRS = M4 src doc examples tests
|
||||
DIST_SUBDIRS = Win32 $(SUBDIRS)
|
||||
EXTRA_DIST = autogen.sh libsamplerate.spec.in samplerate.pc.in Make.bat
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = samplerate.pc
|
||||
m4datadir = $(datadir)/aclocal
|
||||
all: all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
am--refresh:
|
||||
@:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
|
||||
$(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
echo ' $(SHELL) ./config.status'; \
|
||||
$(SHELL) ./config.status;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
$(am__cd) $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
$(am__aclocal_m4_deps):
|
||||
libsamplerate.spec: $(top_builddir)/config.status $(srcdir)/libsamplerate.spec.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
samplerate.pc: $(top_builddir)/config.status $(srcdir)/samplerate.pc.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool config.lt
|
||||
install-pkgconfigDATA: $(pkgconfig_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
|
||||
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
|
||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-pkgconfigDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
test -n "$$files" || exit 0; \
|
||||
echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@fail= failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
$(RECURSIVE_CLEAN_TARGETS):
|
||||
@fail= failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
test -d "$(distdir)" || mkdir "$(distdir)"
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
|
||||
$(am__relativize); \
|
||||
new_distdir=$$reldir; \
|
||||
dir1=$$subdir; dir2="$(top_distdir)"; \
|
||||
$(am__relativize); \
|
||||
new_top_distdir=$$reldir; \
|
||||
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
|
||||
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
|
||||
($(am__cd) $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$new_top_distdir" \
|
||||
distdir="$$new_distdir" \
|
||||
am__remove_distdir=: \
|
||||
am__skip_length_check=: \
|
||||
am__skip_mode_fix=: \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
-test -n "$(am__skip_mode_fix)" \
|
||||
|| find "$(distdir)" -type d ! -perm -755 \
|
||||
-exec chmod u+rwx,go+rx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r "$(distdir)"
|
||||
dist-gzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-bzip2: distdir
|
||||
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-lzma: distdir
|
||||
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-xz: distdir
|
||||
tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-shar: distdir
|
||||
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-zip: distdir
|
||||
-rm -f $(distdir).zip
|
||||
zip -rq $(distdir).zip $(distdir)
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist dist-all: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
case '$(DIST_ARCHIVES)' in \
|
||||
*.tar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.lzma*) \
|
||||
lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
|
||||
*.tar.xz*) \
|
||||
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
|
||||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
esac
|
||||
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||
mkdir $(distdir)/_build
|
||||
mkdir $(distdir)/_inst
|
||||
chmod a-w $(distdir)
|
||||
test -d $(distdir)/_build || exit 0; \
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& am__cwd=`pwd` \
|
||||
&& $(am__cd) $(distdir)/_build \
|
||||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
||||
distuninstallcheck \
|
||||
&& chmod -R a-w "$$dc_install_base" \
|
||||
&& ({ \
|
||||
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
||||
&& rm -rf "$$dc_destdir" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
||||
&& rm -rf $(DIST_ARCHIVES) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
|
||||
&& cd "$$am__cwd" \
|
||||
|| exit 1
|
||||
$(am__remove_distdir)
|
||||
@(echo "$(distdir) archives ready for distribution: "; \
|
||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
||||
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
|
||||
distuninstallcheck:
|
||||
@$(am__cd) '$(distuninstallcheck_dir)' \
|
||||
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
echo " (check DESTDIR support)"; \
|
||||
fi ; \
|
||||
$(distuninstallcheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
distcleancheck: distclean
|
||||
@if test '$(srcdir)' = . ; then \
|
||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||
$(distcleancheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile $(DATA)
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-libtool \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-pkgconfigDATA
|
||||
|
||||
install-dvi: install-dvi-recursive
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-recursive
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-recursive
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-recursive
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf $(top_srcdir)/autom4te.cache
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-pkgconfigDATA
|
||||
|
||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
|
||||
install-am install-strip tags-recursive
|
||||
|
||||
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||
all all-am am--refresh check check-am clean clean-generic \
|
||||
clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
|
||||
dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
|
||||
distcheck distclean distclean-generic distclean-libtool \
|
||||
distclean-tags distcleancheck distdir distuninstallcheck dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-info install-info-am install-man install-pdf \
|
||||
install-pdf-am install-pkgconfigDATA install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
installdirs-am maintainer-clean maintainer-clean-generic \
|
||||
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
|
||||
ps ps-am tags tags-recursive uninstall uninstall-am \
|
||||
uninstall-pkgconfigDATA
|
||||
|
||||
|
||||
# Some people prefer "make test" to "make check".
|
||||
|
||||
test:
|
||||
make check
|
||||
|
||||
check-asm :
|
||||
(cd src && make check-asm)
|
||||
|
||||
# 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:
|
|
@ -1,36 +0,0 @@
|
|||
Version 0.1.8 (2011-08-15)
|
||||
* Minor bug fixes and upates.
|
||||
|
||||
Version 0.1.7 (2009-02-14)
|
||||
* Fix a segfault which occurs when memcpy is passed a bad length parameter.
|
||||
* Fix compilation under MSVC.
|
||||
|
||||
Version 0.1.6 (2009-01-27)
|
||||
* Minor bug fix in test suite (account for rounding error on x86_64).
|
||||
|
||||
Version 0.1.5 (2009-01-11)
|
||||
* Optimisation resulting dramatic throughput improvements.
|
||||
|
||||
Version 0.1.4 (2008-07-02)
|
||||
* Fix bug which causes a segfault with extremely low conversion ratios.
|
||||
|
||||
Version 0.1.3 (2008-03-23)
|
||||
* Huge improvement to the quality of conversion with the
|
||||
SRC_SINC_MEDIUM_QUALITY and SRC_SINC_BEST_QUALITY converters.
|
||||
* Minor bug fixes.
|
||||
|
||||
Version 0.1.2 (2004-09-12)
|
||||
* Fixed where callback based API wasn't being reset properly.
|
||||
* Minor bug fixes.
|
||||
|
||||
Version 0.1.1 (2004-07-17)
|
||||
* Fixed bug in callback based API.
|
||||
* Fixed a bug brought to light by aggressive optimisations of gcc-3.4.
|
||||
* Minor bug fixes.
|
||||
|
||||
Version 0.1.0 (2004-03-14)
|
||||
* Added callback based API.
|
||||
* Added a pair of functions for doing short to float and float to short
|
||||
conversions on an arrays of data.
|
||||
* Many minor bug fixes.
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
This is libsamplerate, 0.1.8
|
||||
|
||||
libsamplerate (also known as Secret Rabbit Code) is a library for
|
||||
perfroming sample rate conversion of audio data.
|
||||
|
||||
The src/ directory contains the source code for library itself.
|
||||
|
||||
The doc/ directory contains the libsamplerate documentation.
|
||||
|
||||
The examples/ directory contains examples of how to write code using
|
||||
libsamplerate.
|
||||
|
||||
The tests/ directory contains programs which link against
|
||||
libsamplerate and test its functionality.
|
||||
|
||||
The Win32/ directory contains files and documentation to allow
|
||||
libsamplerate to compile under Win32 with the Microsoft Visual C++
|
||||
compiler.
|
||||
|
||||
Win32
|
||||
-----
|
||||
There are detailed instructions for building libsamplerate on Win32
|
||||
in the file
|
||||
|
||||
doc/win32.html
|
||||
|
||||
|
||||
MacOSX
|
||||
------
|
||||
Building on MacOSX should be the same as building it on any other
|
||||
Unix.
|
||||
|
||||
|
||||
OTHER PLATFORMS
|
||||
---------------
|
||||
To compile libsamplerate on platforms which have a Bourne Shell compatible
|
||||
shell, an ANSI C compiler and a make utility should require no more that
|
||||
the following three commands :
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
|
||||
CONTACTS
|
||||
--------
|
||||
|
||||
libsamplerate was written by Erik de Castro Lopo (erikd AT mega-nerd DOT com).
|
||||
The libsamplerate home page is at :
|
||||
|
||||
http://www.mega-nerd.com/libsamplerate/
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
EXTRA_DIST = Makefile.msvc config.h unistd.h unistd.h libsamplerate-0.def
|
||||
|
|
@ -1,395 +0,0 @@
|
|||
# Makefile.in generated by automake 1.11.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
|
||||
|
||||
@SET_MAKE@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = Win32
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
$(srcdir)/Makefile.mingw.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/M4/check_signal.m4 \
|
||||
$(top_srcdir)/M4/clip_mode.m4 $(top_srcdir)/M4/endian.m4 \
|
||||
$(top_srcdir)/M4/libtool.m4 $(top_srcdir)/M4/lrint.m4 \
|
||||
$(top_srcdir)/M4/lrintf.m4 $(top_srcdir)/M4/ltoptions.m4 \
|
||||
$(top_srcdir)/M4/ltsugar.m4 $(top_srcdir)/M4/ltversion.m4 \
|
||||
$(top_srcdir)/M4/lt~obsolete.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/src/config.h
|
||||
CONFIG_CLEAN_FILES = Makefile.mingw
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_GEN = $(am__v_GEN_$(V))
|
||||
am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
AM_V_at = $(am__v_at_$(V))
|
||||
am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_at_0 = @
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPILER_IS_GCC = @COMPILER_IS_GCC@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DLLWRAP = @DLLWRAP@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FFTW3_CFLAGS = @FFTW3_CFLAGS@
|
||||
FFTW3_LIBS = @FFTW3_LIBS@
|
||||
FGREP = @FGREP@
|
||||
GCC_MAJOR_VERSION = @GCC_MAJOR_VERSION@
|
||||
GREP = @GREP@
|
||||
HAVE_FFTW3 = @HAVE_FFTW3@
|
||||
HAVE_SNDFILE = @HAVE_SNDFILE@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OS_SPECIFIC_INCLUDES = @OS_SPECIFIC_INCLUDES@
|
||||
OS_SPECIFIC_LINKS = @OS_SPECIFIC_LINKS@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PEXPORTS = @PEXPORTS@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
RANLIB = @RANLIB@
|
||||
RC = @RC@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHARED_VERSION_INFO = @SHARED_VERSION_INFO@
|
||||
SHELL = @SHELL@
|
||||
SHLIB_VERSION_ARG = @SHLIB_VERSION_ARG@
|
||||
SNDFILE_CFLAGS = @SNDFILE_CFLAGS@
|
||||
SNDFILE_LIBS = @SNDFILE_LIBS@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
htmldocdir = @htmldocdir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
EXTRA_DIST = Makefile.msvc config.h unistd.h unistd.h libsamplerate-0.def
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Win32/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu Win32/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
Makefile.mingw: $(top_builddir)/config.status $(srcdir)/Makefile.mingw.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
||||
distclean distclean-generic distclean-libtool distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-info install-info-am install-man install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
|
||||
|
||||
|
||||
# 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:
|
|
@ -1,155 +0,0 @@
|
|||
# MinGW specific Makefile for libsamplerate.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
PROGRAMS = sndfile-resample.exe
|
||||
TARGETS = libsamplerate.dll $(PROGRAMS) varispeed-play.exe samplerate.pc
|
||||
|
||||
AR = @AR@
|
||||
CC = @CC@
|
||||
CFLAGS = @CFLAGS@ -Isrc
|
||||
COMPILER_IS_GCC = @COMPILER_IS_GCC@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DLLWRAP = @DLLWRAP@
|
||||
FFTW3_CFLAGS = @FFTW3_CFLAGS@
|
||||
FFTW3_LIBS = @FFTW3_LIBS@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = ${INSTALL} -m 644
|
||||
install_sh = @install_sh@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LN_S = @LN_S@
|
||||
PEXPORTS = @PEXPORTS@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
RANLIB = @RANLIB@
|
||||
SNDFILE_CFLAGS = -std=c99 @SNDFILE_CFLAGS@
|
||||
SNDFILE_LIBS = @SNDFILE_LIBS@
|
||||
STRIP = @STRIP@
|
||||
|
||||
#====================================================================
|
||||
# Target directories.
|
||||
|
||||
bindir = @bindir@
|
||||
exec_prefix = @exec_prefix@
|
||||
htmldocdir = @htmldocdir@
|
||||
includedir = @includedir@
|
||||
libdir = @libdir@
|
||||
pkgconfigdir = @libdir@/pkgconfig
|
||||
prefix = @prefix@
|
||||
|
||||
#====================================================================
|
||||
# Targets
|
||||
|
||||
all : $(TARGETS)
|
||||
|
||||
clean :
|
||||
rm -f $(TARGETS) *.del *.lib src/*.o tests/*.o tests/*.exe
|
||||
|
||||
install : $(TARGETS)
|
||||
$(install_sh) -c libsamplerate.dll $(libdir)
|
||||
$(install_sh) -c samplerate.pc $(pkgconfigdir)
|
||||
@for prog in $(PROGRAMS); do \
|
||||
echo "installing ... $$prog" ; \
|
||||
$(install_sh) -c "$$prog" $(bindir) ; \
|
||||
done;
|
||||
$(install_sh) -c src/samplerate.h $(includedir)
|
||||
|
||||
uninstall :
|
||||
rm -f $(libdir)/libsamplerate.dll
|
||||
rm -f $(pkgconfigdir)/samplerate.pc
|
||||
@for prog in $(PROGRAMS); do \
|
||||
echo "removing ... $(bindir)/$$prog" ; \
|
||||
rm -f $(bindir)/"$$prog" ; \
|
||||
done;
|
||||
rm -f $(includedir)/samplerate.h
|
||||
|
||||
#====================================================================
|
||||
|
||||
LINK_OBJS = \
|
||||
src/src_linear.o \
|
||||
src/src_sinc.o \
|
||||
src/src_zoh.o \
|
||||
src/samplerate.o
|
||||
|
||||
libsamplerate.dll libsamplerate.lib : $(LINK_OBJS)
|
||||
$(DLLWRAP) --def Win32/libsamplerate.def $(LINK_OBJS) --output-lib libsamplerate.lib -o libsamplerate.dll
|
||||
$(STRIP) libsamplerate.dll
|
||||
|
||||
sndfile-resample.exe : examples/sndfile-resample.c libsamplerate.lib
|
||||
$(CC) $(CFLAGS) $(SNDFILE_CFLAGS) $+ $(SNDFILE_LIBS) -o $@
|
||||
|
||||
varispeed-play.exe : examples/varispeed-play.c examples/audio_out.o libsamplerate.lib
|
||||
$(CC) $(CFLAGS) $(SNDFILE_CFLAGS) $+ $(SNDFILE_LIBS) -lwinmm -o $@
|
||||
|
||||
examples/audio_out.o : examples/audio_out.c
|
||||
$(CC) $(CFLAGS) $(SNDFILE_CFLAGS) -c $+ -o $@
|
||||
|
||||
samplerate.pc : samplerate.pc.in config.status
|
||||
@./config.status $@
|
||||
|
||||
config.status :
|
||||
./configure
|
||||
|
||||
#====================================================================
|
||||
# Testing programs.
|
||||
|
||||
TEST_PROGS = \
|
||||
tests/misc_test.exe \
|
||||
tests/termination_test.exe \
|
||||
tests/simple_test.exe \
|
||||
tests/callback_test.exe \
|
||||
tests/reset_test.exe \
|
||||
tests/multi_channel_test.exe \
|
||||
tests/float_short_test.exe \
|
||||
tests/snr_bw_test.exe
|
||||
|
||||
|
||||
check : $(TEST_PROGS)
|
||||
tests/misc_test.exe
|
||||
tests/termination_test.exe
|
||||
tests/simple_test.exe
|
||||
tests/callback_test.exe
|
||||
tests/reset_test.exe
|
||||
tests/multi_channel_test.exe
|
||||
tests/float_short_test.exe
|
||||
tests/snr_bw_test.exe
|
||||
@echo ----------------------------------------------------------------------
|
||||
@echo libsamplerate passed all tests
|
||||
@echo ----------------------------------------------------------------------
|
||||
|
||||
#====================================================================
|
||||
# Test programs.
|
||||
|
||||
tests/misc_test.exe : tests/misc_test.c tests/util.c libsamplerate.lib
|
||||
$(CC) $(CFLAGS) $+ -o $@
|
||||
|
||||
tests/termination_test.exe : tests/termination_test.c tests/util.c libsamplerate.lib
|
||||
$(CC) $(CFLAGS) $+ -o $@
|
||||
|
||||
tests/simple_test.exe : tests/simple_test.c tests/util.c libsamplerate.lib
|
||||
$(CC) $(CFLAGS) $+ -o $@
|
||||
|
||||
tests/callback_test.exe : tests/callback_test.c tests/util.c libsamplerate.lib
|
||||
$(CC) $(CFLAGS) $+ -o $@
|
||||
|
||||
tests/reset_test.exe : tests/reset_test.c tests/util.c libsamplerate.lib
|
||||
$(CC) $(CFLAGS) $+ -o $@
|
||||
|
||||
tests/float_short_test.exe : tests/float_short_test.c tests/util.c libsamplerate.lib
|
||||
$(CC) $(CFLAGS) $+ -o $@
|
||||
|
||||
tests/multi_channel_test.exe : tests/multi_channel_test.c tests/util.c tests/calc_snr.c libsamplerate.lib
|
||||
$(CC) $(CFLAGS) $(FFTW3_CFLAGS) $+ $(FFTW3_LIBS) -o $@
|
||||
|
||||
tests/snr_bw_test.exe : tests/snr_bw_test.c tests/util.c tests/calc_snr.c libsamplerate.lib
|
||||
$(CC) $(CFLAGS) $(FFTW3_CFLAGS) $+ $(FFTW3_LIBS) -o $@
|
||||
|
||||
# End of Makefile
|
||||
#====================================================================
|
|
@ -1,150 +0,0 @@
|
|||
|
||||
# Set the value of $(MSVCDir) for your installation.
|
||||
|
||||
# MSVCDir="C:\Progra~1\Micros~1\VC98"
|
||||
# CFLAGS=/nologo /MD /W1 /GX /O2 /I "$(MSVCDir)\Include" /I . /I "Win32" /I "src" /D "WIN32" /D "_USRDLL" /YX /FD /Zm1000
|
||||
# PROG_LINK_FLAGS=/nologo /incremental:no /libpath:"$(MSVCDir)\Lib" /pdb:"libsamplerate-0.pdb" /machine:I386 /exetype:dynamic
|
||||
|
||||
MSVCDir="C:\Progra~1\Micros~1.Net\Vc7"
|
||||
CFLAGS=/nologo /MD /W1 /GX /O2 /Zm200 /I "$(MSVCDir)\Include" /I "$(MSVCDir)\PlatformSDK\Include" /I . /I "Win32" /I "src" /D "WIN32" /D "_USRDLL" /YX /FD /Zm1000
|
||||
PROG_LINK_FLAGS=/nologo /incremental:no /libpath:"$(MSVCDir)\Lib" /libpath:"$(MSVCDir)\PlatformSDK\Lib" /pdb:"libsamplerate-0.pdb" /machine:I386 /exetype:dynamic
|
||||
|
||||
CPP=cl.exe
|
||||
LINK32=link.exe
|
||||
DLL_LINK_FLAGS=/nologo /dll /incremental:no /libpath:"$(MSVCDir)\Lib" /pdb:"libsamplerate-0.pdb" /implib:".\libsamplerate-0.lib" /machine:I386 /out:"libsamplerate-0.dll"
|
||||
|
||||
#====================================================================
|
||||
# Targets
|
||||
|
||||
ALL : libsndfile-1.lib libsamplerate-0.dll \
|
||||
".\examples\sndfile-resample.exe" \
|
||||
".\examples\varispeed-play.exe"
|
||||
|
||||
CLEAN :
|
||||
-@erase "src\*.obj"
|
||||
-@erase "tests\*.exe"
|
||||
|
||||
#====================================================================
|
||||
|
||||
LINK32_OBJS= \
|
||||
".\src\samplerate.obj" \
|
||||
".\src\src_linear.obj" \
|
||||
".\src\src_zoh.obj" \
|
||||
".\src\src_sinc.obj"
|
||||
|
||||
libsamplerate-0.dll : $(LINK32_OBJS) ".\Win32\libsamplerate-0.def"
|
||||
$(LINK32) $(DLL_LINK_FLAGS) /def:".\Win32\libsamplerate-0.def" $(LINK32_OBJS)
|
||||
|
||||
".\examples\sndfile-resample.exe" : ".\examples\sndfile-resample.c"
|
||||
$(CPP) $(CFLAGS) /Fo".\examples\sndfile-resample.obj" /c ".\examples\sndfile-resample.c"
|
||||
$(LINK32) $(PROG_LINK_FLAGS) /out:".\examples\sndfile-resample.exe" ".\examples\sndfile-resample.obj" libsamplerate-0.lib libsndfile-1.lib
|
||||
|
||||
".\examples\varispeed-play.exe" : ".\examples\varispeed-play.c" ".\examples\audio_out.obj"
|
||||
$(CPP) $(CFLAGS) /Fo".\examples\varispeed-play.obj" /c ".\examples\varispeed-play.c"
|
||||
$(LINK32) $(PROG_LINK_FLAGS) /out:".\examples\varispeed-play.exe" ".\examples\varispeed-play.obj" ".\examples\audio_out.obj" libsamplerate-0.lib libsndfile-1.lib winmm.lib
|
||||
|
||||
".\examples\audio_out.obj" : ".\examples\audio_out.c"
|
||||
$(CPP) $(CFLAGS) /Fo".\examples\audio_out.obj" /c ".\examples\audio_out.c"
|
||||
|
||||
TEST_PROGS= \
|
||||
".\tests\misc_test.exe" \
|
||||
".\tests\termination_test.exe" \
|
||||
".\tests\simple_test.exe" \
|
||||
".\tests\reset_test.exe" \
|
||||
".\tests\multi_channel_test.exe" \
|
||||
".\tests\snr_bw_test.exe" \
|
||||
".\tests\throughput_test.exe"
|
||||
|
||||
CHECK: $(TEST_PROGS)
|
||||
".\tests\misc_test.exe"
|
||||
".\tests\termination_test.exe"
|
||||
".\tests\simple_test.exe"
|
||||
".\tests\reset_test.exe"
|
||||
".\tests\multi_channel_test.exe"
|
||||
".\tests\snr_bw_test.exe"
|
||||
".\tests\throughput_test.exe"
|
||||
-@echo ----------------------------------------------------------------------
|
||||
-@echo libsamplerate passed all tests
|
||||
-@echo ----------------------------------------------------------------------
|
||||
|
||||
#====================================================================
|
||||
# C files in src.
|
||||
|
||||
".\src\samplerate.obj" : ".\src\samplerate.c"
|
||||
$(CPP) $(CFLAGS) /Fo".\src\samplerate.obj" /c ".\src\samplerate.c"
|
||||
|
||||
".\src\src_linear.obj" : ".\src\src_linear.c"
|
||||
$(CPP) $(CFLAGS) /Fo".\src\src_linear.obj" /c ".\src\src_linear.c"
|
||||
|
||||
".\src\src_zoh.obj" : ".\src\src_zoh.c"
|
||||
$(CPP) $(CFLAGS) /Fo".\src\src_zoh.obj" /c ".\src\src_zoh.c"
|
||||
|
||||
".\src\src_sinc.obj" : ".\src\src_sinc.c"
|
||||
$(CPP) $(CFLAGS) /Fo".\src\src_sinc.obj" /c ".\src\src_sinc.c"
|
||||
|
||||
#====================================================================
|
||||
# Object files for test programs.
|
||||
|
||||
".\tests\util.obj" : ".\tests\util.c"
|
||||
$(CPP) $(CFLAGS) /Fo".\tests\util.obj" /c ".\tests\util.c"
|
||||
|
||||
".\tests\calc_snr.obj" : ".\tests\calc_snr.c"
|
||||
$(CPP) $(CFLAGS) /Fo".\tests\calc_snr.obj" /c ".\tests\calc_snr.c"
|
||||
|
||||
".\tests\dft_cmp.obj" : ".\tests\dft_cmp.c"
|
||||
$(CPP) $(CFLAGS) /Fo".\tests\dft_cmp.obj" /c ".\tests\dft_cmp.c"
|
||||
|
||||
#====================================================================
|
||||
# Test programs.
|
||||
|
||||
".\tests\misc_test.exe" : ".\tests\misc_test.c" ".\tests\util.obj"
|
||||
$(CPP) $(CFLAGS) /Fo".\tests\misc_test.obj" /c ".\tests\misc_test.c"
|
||||
$(LINK32) $(PROG_LINK_FLAGS) /out:".\tests\misc_test.exe" ".\tests\misc_test.obj" ".\tests\util.obj" libsamplerate-0.lib
|
||||
|
||||
".\tests\termination_test.exe" : ".\tests\termination_test.c" ".\tests\util.obj"
|
||||
$(CPP) $(CFLAGS) /Fo".\tests\termination_test.obj" /c ".\tests\termination_test.c"
|
||||
$(LINK32) $(PROG_LINK_FLAGS) /out:".\tests\termination_test.exe" ".\tests\termination_test.obj" ".\tests\util.obj" libsamplerate-0.lib
|
||||
|
||||
".\tests\streaming_test.exe" : ".\tests\streaming_test.c" ".\tests\util.obj"
|
||||
$(CPP) $(CFLAGS) /Fo".\tests\streaming_test.obj" /c ".\tests\streaming_test.c"
|
||||
$(LINK32) $(PROG_LINK_FLAGS) /out:".\tests\streaming_test.exe" ".\tests\streaming_test.obj" ".\tests\util.obj" libsamplerate-0.lib
|
||||
|
||||
".\tests\simple_test.exe" : ".\tests\simple_test.c" ".\tests\util.obj"
|
||||
$(CPP) $(CFLAGS) /Fo".\tests\simple_test.obj" /c ".\tests\simple_test.c"
|
||||
$(LINK32) $(PROG_LINK_FLAGS) /out:".\tests\simple_test.exe" ".\tests\simple_test.obj" ".\tests\util.obj" libsamplerate-0.lib
|
||||
|
||||
".\tests\reset_test.exe" : ".\tests\reset_test.c" ".\tests\util.obj"
|
||||
$(CPP) $(CFLAGS) /Fo".\tests\reset_test.obj" /c ".\tests\reset_test.c"
|
||||
$(LINK32) $(PROG_LINK_FLAGS) /out:".\tests\reset_test.exe" ".\tests\reset_test.obj" ".\tests\util.obj" libsamplerate-0.lib
|
||||
|
||||
".\tests\multi_channel_test.exe" : ".\tests\multi_channel_test.c" ".\tests\util.obj" ".\tests\calc_snr.obj"
|
||||
$(CPP) $(CFLAGS) /Fo".\tests\multi_channel_test.obj" /c ".\tests\multi_channel_test.c"
|
||||
$(LINK32) $(PROG_LINK_FLAGS) /out:".\tests\multi_channel_test.exe" ".\tests\multi_channel_test.obj" ".\tests\util.obj" ".\tests\calc_snr.obj" libsamplerate-0.lib
|
||||
|
||||
".\tests\snr_bw_test.exe" : ".\tests\snr_bw_test.c" ".\tests\util.obj"
|
||||
$(CPP) $(CFLAGS) /Fo".\tests\snr_bw_test.obj" /c ".\tests\snr_bw_test.c"
|
||||
$(LINK32) $(PROG_LINK_FLAGS) /out:".\tests\snr_bw_test.exe" ".\tests\snr_bw_test.obj" ".\tests\util.obj" libsamplerate-0.lib
|
||||
|
||||
".\tests\throughput_test.exe" : ".\tests\throughput_test.c" ".\tests\util.obj"
|
||||
$(CPP) $(CFLAGS) /Fo".\tests\throughput_test.obj" /c ".\tests\throughput_test.c"
|
||||
$(LINK32) $(PROG_LINK_FLAGS) /out:".\tests\throughput_test.exe" ".\tests\throughput_test.obj" ".\tests\util.obj" libsamplerate-0.lib
|
||||
|
||||
#====================================================================
|
||||
# Bit of extra trickery.
|
||||
|
||||
sndfile.h libsndfile-1.dll libsndfile-1.def :
|
||||
-@echo *---------------------------------------------------------------
|
||||
-@echo * You need to get the pre-built Win32 binaries for libsndfile
|
||||
-@echo * from : http://www.mega-nerd.com/libsndfile
|
||||
-@echo * The prebuilt binaries will be in a ZIP file which contains
|
||||
-@echo * the files :
|
||||
-@echo * sndfile.h libsndfile-1.dll libsndfile-1.def
|
||||
-@echo * which need to be copied to this directory.
|
||||
-@echo *---------------------------------------------------------------
|
||||
-@exit 1
|
||||
|
||||
libsndfile-1.lib : libsndfile-1.dll libsndfile-1.def
|
||||
lib /machine:i386 /def:libsndfile-1.def
|
||||
|
||||
# End of Makefile
|
||||
#====================================================================
|
|
@ -1,207 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
** This is the Win32 specific config.h header file.
|
||||
**
|
||||
** On Unix (including MacOSX), this header file is automatically generated
|
||||
** during the configure process while on Win32 this has to be hand edited
|
||||
** to keep it up to date.
|
||||
**
|
||||
** This is also a good file to add Win32 specific things.
|
||||
*/
|
||||
|
||||
/*
|
||||
** MSVC++ assumes that all floating point constants without a trailing
|
||||
** letter 'f' are double precision.
|
||||
**
|
||||
** If this assumption is incorrect and one of these floating point constants
|
||||
** is assigned to a float variable MSVC++ generates a warning.
|
||||
**
|
||||
** Since there are currently about 25000 of these warnings generated in
|
||||
** src/src_sinc.c this slows down compile times considerably. The
|
||||
** following #pragma disables the warning.
|
||||
*/
|
||||
|
||||
#pragma warning(disable: 4305)
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
** Normal #defines follow.
|
||||
*/
|
||||
|
||||
/* Set to 1 if the compile is GNU GCC. */
|
||||
#define COMPILER_IS_GCC 0
|
||||
|
||||
/* Target processor clips on negative float to int conversion. */
|
||||
#define CPU_CLIPS_NEGATIVE 0
|
||||
|
||||
/* Target processor clips on positive float to int conversion. */
|
||||
#define CPU_CLIPS_POSITIVE 0
|
||||
|
||||
/* Target processor is big endian. */
|
||||
#define CPU_IS_BIG_ENDIAN 0
|
||||
|
||||
/* Target processor is little endian. */
|
||||
#define CPU_IS_LITTLE_ENDIAN 1
|
||||
|
||||
/* Set to 1 to enable debugging. */
|
||||
#define ENABLE_DEBUG 0
|
||||
|
||||
/* Major version of GCC or 3 otherwise. */
|
||||
/* #undef GCC_MAJOR_VERSION */
|
||||
|
||||
/* Define to 1 if you have the `alarm' function. */
|
||||
/* #undef HAVE_ALARM */
|
||||
|
||||
/* Define to 1 if you have the `calloc' function. */
|
||||
#define HAVE_CALLOC 1
|
||||
|
||||
/* Define to 1 if you have the `ceil' function. */
|
||||
#define HAVE_CEIL 1
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
/* #undef HAVE_DLFCN_H */
|
||||
|
||||
/* Set to 1 if you have libfftw3. */
|
||||
/* #undef HAVE_FFTW3 */
|
||||
|
||||
/* Define to 1 if you have the `floor' function. */
|
||||
#define HAVE_FLOOR 1
|
||||
|
||||
/* Define to 1 if you have the `fmod' function. */
|
||||
#define HAVE_FMOD 1
|
||||
|
||||
/* Define to 1 if you have the `free' function. */
|
||||
#define HAVE_FREE 1
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
/* #undef HAVE_INTTYPES_H */
|
||||
|
||||
/* Define to 1 if you have the `m' library (-lm). */
|
||||
/* #undef HAVE_LIBM */
|
||||
|
||||
/* Define if you have C99's lrint function. */
|
||||
/* #undef HAVE_LRINT */
|
||||
|
||||
/* Define if you have C99's lrintf function. */
|
||||
/* #undef HAVE_LRINTF */
|
||||
|
||||
/* Define to 1 if you have the `malloc' function. */
|
||||
#define HAVE_MALLOC 1
|
||||
|
||||
/* Define to 1 if you have the `memcpy' function. */
|
||||
#define HAVE_MEMCPY 1
|
||||
|
||||
/* Define to 1 if you have the `memmove' function. */
|
||||
#define HAVE_MEMMOVE 1
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define if you have signal SIGALRM. */
|
||||
/* #undef HAVE_SIGALRM */
|
||||
|
||||
/* Define to 1 if you have the `signal' function. */
|
||||
/* #undef HAVE_SIGNAL */
|
||||
|
||||
/* Set to 1 if you have libsndfile. */
|
||||
#define HAVE_SNDFILE 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
/* #undef HAVE_STDINT_H */
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/times.h> header file. */
|
||||
/* #undef HAVE_SYS_TIMES_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
#define LT_OBJDIR ".libs/"
|
||||
|
||||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
||||
/* #undef NO_MINUS_C_MINUS_O */
|
||||
|
||||
/* Set to 1 if compiling for Win32 */
|
||||
#define OS_IS_WIN32 1
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "libsamplerate"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT "erikd@mega-nerd.com"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "libsamplerate"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "libsamplerate 0.1.8"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "libsamplerate"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL "http://www.mega-nerd.com/libsamplerate/"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "0.1.8"
|
||||
|
||||
/* The size of `double', as computed by sizeof. */
|
||||
#define SIZEOF_DOUBLE 8
|
||||
|
||||
/* The size of `float', as computed by sizeof. */
|
||||
#define SIZEOF_FLOAT 4
|
||||
|
||||
/* The size of `int', as computed by sizeof. */
|
||||
#define SIZEOF_INT 4
|
||||
|
||||
/* The size of `long', as computed by sizeof. */
|
||||
#define SIZEOF_LONG 4
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "0.1.8"
|
||||
|
||||
|
||||
|
||||
/* Extra Win32 hacks. */
|
||||
|
||||
/*
|
||||
** Microsoft's compiler still does not support the 1999 ISO C Standard
|
||||
** which includes 'inline'.
|
||||
*/
|
||||
|
||||
#define inline __inline
|
|
@ -1,28 +0,0 @@
|
|||
LIBRARY libsamplerate-0.dll
|
||||
EXPORTS
|
||||
|
||||
src_new @1
|
||||
src_delete @2
|
||||
|
||||
src_get_name @10
|
||||
src_get_description @11
|
||||
src_get_version @12
|
||||
|
||||
src_process @20
|
||||
src_reset @21
|
||||
src_set_ratio @22
|
||||
|
||||
src_error @30
|
||||
src_strerror @31
|
||||
|
||||
src_simple @40
|
||||
|
||||
src_is_valid_ratio @50
|
||||
|
||||
src_callback_new @60
|
||||
src_callback_read @61
|
||||
|
||||
src_short_to_float_array @70
|
||||
src_float_to_short_array @71
|
||||
src_int_to_float_array @80
|
||||
src_float_to_int_array @81
|
|
@ -1,22 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.1 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 Lesser General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU Lesser 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
** Emtpy file to prevent Win32 compiler from complaining that the
|
||||
** file doesn't exist.
|
||||
*/
|
File diff suppressed because it is too large
Load diff
|
@ -1,129 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Run this to set up the build system: configure, makefiles, etc.
|
||||
# (based on the version in enlightenment's cvs)
|
||||
|
||||
package="libsamplerate"
|
||||
|
||||
ACLOCAL_FLAGS="-I M4"
|
||||
|
||||
olddir=`pwd`
|
||||
srcdir=`dirname $0`
|
||||
test -z "$srcdir" && srcdir=.
|
||||
|
||||
cd "$srcdir"
|
||||
DIE=0
|
||||
|
||||
echo "checking for autoconf... "
|
||||
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
|
||||
echo
|
||||
echo "You must have autoconf installed to compile $package."
|
||||
echo "Download the appropriate package for your distribution,"
|
||||
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
|
||||
DIE=1
|
||||
}
|
||||
|
||||
VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/"
|
||||
VERSIONMKMAJ="sed -e s/\([0-9][0-9]*\)[^0-9].*/\\1/"
|
||||
VERSIONMKMIN="sed -e s/.*[0-9][0-9]*\.//"
|
||||
|
||||
# do we need automake?
|
||||
if test -r Makefile.am; then
|
||||
AM_OPTIONS=`fgrep AUTOMAKE_OPTIONS Makefile.am`
|
||||
AM_NEEDED=`echo $AM_OPTIONS | $VERSIONGREP`
|
||||
if test x"$AM_NEEDED" = "x$AM_OPTIONS"; then
|
||||
AM_NEEDED=""
|
||||
fi
|
||||
if test -z $AM_NEEDED; then
|
||||
echo -n "checking for automake... "
|
||||
AUTOMAKE=automake
|
||||
ACLOCAL=aclocal
|
||||
if ($AUTOMAKE --version < /dev/null > /dev/null 2>&1); then
|
||||
echo "yes"
|
||||
else
|
||||
echo "no"
|
||||
AUTOMAKE=
|
||||
fi
|
||||
else
|
||||
echo -n "checking for automake $AM_NEEDED or later... "
|
||||
majneeded=`echo $AM_NEEDED | $VERSIONMKMAJ`
|
||||
minneeded=`echo $AM_NEEDED | $VERSIONMKMIN`
|
||||
for am in automake-$AM_NEEDED automake$AM_NEEDED \
|
||||
automake automake-1.7 automake-1.8 automake-1.9 automake-1.10; do
|
||||
($am --version < /dev/null > /dev/null 2>&1) || continue
|
||||
ver=`$am --version < /dev/null | head -n 1 | $VERSIONGREP`
|
||||
maj=`echo $ver | $VERSIONMKMAJ`
|
||||
min=`echo $ver | $VERSIONMKMIN`
|
||||
if test $maj -eq $majneeded -a $min -ge $minneeded; then
|
||||
AUTOMAKE=$am
|
||||
echo $AUTOMAKE
|
||||
break
|
||||
fi
|
||||
done
|
||||
test -z $AUTOMAKE && echo "no"
|
||||
echo -n "checking for aclocal $AM_NEEDED or later... "
|
||||
for ac in aclocal-$AM_NEEDED aclocal$AM_NEEDED \
|
||||
aclocal aclocal-1.7 aclocal-1.8 aclocal-1.9 aclocal-1.10; do
|
||||
($ac --version < /dev/null > /dev/null 2>&1) || continue
|
||||
ver=`$ac --version < /dev/null | head -n 1 | $VERSIONGREP`
|
||||
maj=`echo $ver | $VERSIONMKMAJ`
|
||||
min=`echo $ver | $VERSIONMKMIN`
|
||||
if test $maj -eq $majneeded -a $min -ge $minneeded; then
|
||||
ACLOCAL=$ac
|
||||
echo $ACLOCAL
|
||||
break
|
||||
fi
|
||||
done
|
||||
test -z $ACLOCAL && echo "no"
|
||||
fi
|
||||
test -z $AUTOMAKE || test -z $ACLOCAL && {
|
||||
echo
|
||||
echo "You must have automake installed to compile $package."
|
||||
echo "Download the appropriate package for your distribution,"
|
||||
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
|
||||
echo -n "checking for libtool... "
|
||||
for LIBTOOLIZE in libtoolize glibtoolize nope; do
|
||||
($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 && break
|
||||
done
|
||||
if test x$LIBTOOLIZE = xnope; then
|
||||
echo "nope."
|
||||
LIBTOOLIZE=libtoolize
|
||||
else
|
||||
echo $LIBTOOLIZE
|
||||
fi
|
||||
($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
|
||||
echo
|
||||
echo "You must have libtool installed to compile $package."
|
||||
echo "Download the appropriate package for your system,"
|
||||
echo "or get the source from one of the GNU ftp sites"
|
||||
echo "listed in http://www.gnu.org/order/ftp.html"
|
||||
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 $package, please wait...."
|
||||
|
||||
echo " $ACLOCAL $ACLOCAL_FLAGS"
|
||||
$ACLOCAL $ACLOCAL_FLAGS || exit 1
|
||||
echo " $LIBTOOLIZE --automake"
|
||||
$LIBTOOLIZE --automake || exit 1
|
||||
echo " autoheader"
|
||||
autoheader || exit 1
|
||||
echo " $AUTOMAKE --add-missing $AUTOMAKE_FLAGS"
|
||||
$AUTOMAKE --add-missing $AUTOMAKE_FLAGS || exit 1
|
||||
echo " autoconf"
|
||||
autoconf || exit 1
|
||||
|
||||
cd $olddir
|
||||
$srcdir/configure --enable-gcc-werror "$@" && echo
|
File diff suppressed because it is too large
Load diff
|
@ -1,342 +0,0 @@
|
|||
# Copyright (C) 2002-2011 Erik de Castro Lopo (erikd AT mega-nerd DOT com).
|
||||
|
||||
dnl Require autoconf version
|
||||
AC_PREREQ(2.57)
|
||||
|
||||
AC_INIT([libsamplerate],[0.1.8],[erikd@mega-nerd.com],
|
||||
[libsamplerate],[http://www.mega-nerd.com/libsamplerate/])
|
||||
|
||||
# Put config stuff in Cfg.
|
||||
AC_CONFIG_AUX_DIR(Cfg)
|
||||
|
||||
AC_CONFIG_SRCDIR([src/samplerate.c])
|
||||
AC_CANONICAL_TARGET([])
|
||||
|
||||
AC_CONFIG_MACRO_DIR([M4])
|
||||
AC_CONFIG_HEADERS([src/config.h])
|
||||
|
||||
AM_INIT_AUTOMAKE($PACKAGE_NAME,$PACKAGE_VERSION)
|
||||
AM_SILENT_RULES([yes])
|
||||
|
||||
dnl Add parameters for aclocal
|
||||
AC_SUBST(ACLOCAL_AMFLAGS, "-I M4")
|
||||
|
||||
AC_LANG([C])
|
||||
|
||||
AC_PROG_CC
|
||||
AM_PROG_CC_C_O
|
||||
AC_PROG_CXX
|
||||
AC_PROG_SED
|
||||
|
||||
# Do not check for F77.
|
||||
define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
|
||||
|
||||
AM_PROG_LIBTOOL
|
||||
LT_PROG_RC
|
||||
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
|
||||
#------------------------------------------------------------------------------------
|
||||
# Rules for library version information:
|
||||
#
|
||||
# 1. Start with version information of `0:0:0' for each libtool library.
|
||||
# 2. Update the version information only immediately before a public release of
|
||||
# your software. More frequent updates are unnecessary, and only guarantee
|
||||
# that the current interface number gets larger faster.
|
||||
# 3. If the library source code has changed at all since the last update, then
|
||||
# increment revision (`c:r:a' becomes `c:r+1:a').
|
||||
# 4. If any interfaces have been added, removed, or changed since the last update,
|
||||
# increment current, and set revision to 0.
|
||||
# 5. If any interfaces have been added since the last public release, then increment
|
||||
# age.
|
||||
# 6. If any interfaces have been removed since the last public release, then set age
|
||||
# to 0.
|
||||
|
||||
SHARED_VERSION_INFO="1:8:1"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MKDIR_P
|
||||
|
||||
if test "x-$build_os-$host_os-$target_os" = x-mingw32-mingw32-mingw32 ; then
|
||||
AC_CHECK_PROG(DLLTOOL, dlltool, dlltool)
|
||||
AC_CHECK_PROG(DLLWRAP, dllwrap, dllwrap)
|
||||
AC_CHECK_PROG(PEXPORTS, pexports, pexports)
|
||||
fi
|
||||
|
||||
AC_HEADER_STDC
|
||||
|
||||
AC_CHECK_HEADERS(stdint.h sys/times.h)
|
||||
|
||||
#====================================================================================
|
||||
# Couple of initializations here. Fill in real values later.
|
||||
|
||||
SHLIB_VERSION_ARG=""
|
||||
|
||||
#====================================================================================
|
||||
# Finished checking, handle options.
|
||||
|
||||
AC_ARG_ENABLE(gcc-werror,
|
||||
AC_HELP_STRING([--enable-gcc-werror], [enable -Werror in all Makefiles]),
|
||||
ac_arg_gcc_werror=yes, ac_arg_gcc_werror=no)
|
||||
|
||||
AC_ARG_ENABLE(gcc-pipe,
|
||||
AC_HELP_STRING([--disable-gcc-pipe], [disable gcc -pipe option ]),
|
||||
ac_arg_gcc_pipe="N", ac_arg_gcc_pipe="Y")
|
||||
|
||||
AC_ARG_ENABLE(gcc-opt,
|
||||
AC_HELP_STRING([--disable-gcc-opt], [disable gcc optimisations ]),
|
||||
ac_arg_gcc_opt="N", ac_arg_gcc_opt="Y")
|
||||
|
||||
AC_ARG_ENABLE(fftw,
|
||||
AC_HELP_STRING([--disable-fftw], [disable usage of FFTW ]),
|
||||
ac_arg_fftw="N", ac_arg_fftw="Y")
|
||||
|
||||
AC_ARG_ENABLE(cpu-clip,
|
||||
AC_HELP_STRING([--disable-cpu-clip], [disable tricky cpu specific clipper]),
|
||||
ac_arg_cpu_clip="N", ac_arg_cpu_clip="Y")
|
||||
|
||||
#====================================================================================
|
||||
# Check types and their sizes.
|
||||
|
||||
AC_CHECK_SIZEOF(int,0)
|
||||
AC_CHECK_SIZEOF(long,0)
|
||||
AC_CHECK_SIZEOF(float,4)
|
||||
AC_CHECK_SIZEOF(double,8)
|
||||
|
||||
#====================================================================================
|
||||
# Determine endian-ness of target processor.
|
||||
|
||||
AC_C_FIND_ENDIAN
|
||||
|
||||
AC_DEFINE_UNQUOTED(CPU_IS_BIG_ENDIAN, ${ac_cv_c_big_endian},
|
||||
[Target processor is big endian.])
|
||||
AC_DEFINE_UNQUOTED(CPU_IS_LITTLE_ENDIAN, ${ac_cv_c_little_endian},
|
||||
[Target processor is little endian.])
|
||||
|
||||
#====================================================================================
|
||||
# Check for functions.
|
||||
|
||||
AC_CHECK_FUNCS(malloc calloc free memcpy memmove alarm signal)
|
||||
|
||||
AC_CHECK_LIB([m],floor)
|
||||
AC_CHECK_FUNCS(floor ceil fmod)
|
||||
|
||||
AC_CHECK_SIGNAL(SIGALRM)
|
||||
|
||||
AC_C99_FUNC_LRINT
|
||||
AC_C99_FUNC_LRINTF
|
||||
# AC_C99_FUNC_LLRINT Don't need this (yet?).
|
||||
|
||||
case "x$ac_cv_c99_lrint$ac_cv_c99_lrintf" in
|
||||
xyesyes)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_WARN([[*** Missing C99 standard functions lrint() and lrintf().]])
|
||||
AC_MSG_WARN([[*** This may cause benign compiler warnings on some systems (ie Solaris).]])
|
||||
;;
|
||||
esac
|
||||
|
||||
#====================================================================================
|
||||
# Determine if the processor can do clipping on float to int conversions.
|
||||
|
||||
if test x$ac_arg_cpu_clip = "xY" ; then
|
||||
AC_C_CLIP_MODE
|
||||
else
|
||||
echo "checking processor clipping capabilities... disabled"
|
||||
ac_cv_c_clip_positive=0
|
||||
ac_cv_c_clip_negative=0
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(CPU_CLIPS_POSITIVE, ${ac_cv_c_clip_positive},
|
||||
[Target processor clips on positive float to int conversion.])
|
||||
AC_DEFINE_UNQUOTED(CPU_CLIPS_NEGATIVE, ${ac_cv_c_clip_negative},
|
||||
[Target processor clips on negative float to int conversion.])
|
||||
|
||||
#====================================================================================
|
||||
# Check for libsndfile which is required for the test and example programs.
|
||||
|
||||
AC_ARG_ENABLE(sndfile,
|
||||
AC_HELP_STRING([--disable-sndfile], [disable support for sndfile (default=autodetect)]),
|
||||
[ enable_sndfile=$enableval ], [ enable_sndfile=yes ])
|
||||
|
||||
# Check for pkg-config outside the if statement.
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
if test "x$enable_sndfile" = "xyes"; then
|
||||
PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.6, ac_cv_sndfile=1, ac_cv_sndfile=0)
|
||||
else
|
||||
ac_cv_sndfile=0
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED([HAVE_SNDFILE],$ac_cv_sndfile,[Set to 1 if you have libsndfile.])
|
||||
|
||||
if test x$ac_cv_sndfile = x1 ; then
|
||||
ac_cv_sndfile=yes
|
||||
HAVE_SNDFILE=1
|
||||
else
|
||||
ac_cv_sndfile=no
|
||||
HAVE_SNDFILE=0
|
||||
fi
|
||||
|
||||
#====================================================================================
|
||||
# Check for libfftw3 which is required for the test and example programs.
|
||||
|
||||
if test $ac_arg_fftw = "Y" ; then
|
||||
PKG_CHECK_MODULES(FFTW3, fftw3 >= 0.15.0, ac_cv_fftw3=1, ac_cv_fftw3=0)
|
||||
AC_DEFINE_UNQUOTED([HAVE_FFTW3],$ac_cv_fftw3,[Set to 1 if you have libfftw3.])
|
||||
|
||||
if test x$ac_cv_fftw3 = x1 ; then
|
||||
ac_cv_fftw3=yes
|
||||
HAVE_FFTW3=1
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x$ac_cv_fftw3 != xyes ; then
|
||||
ac_cv_fftw3=no
|
||||
HAVE_FFTW3=0
|
||||
fi
|
||||
|
||||
#====================================================================================
|
||||
# GCC stuff.
|
||||
|
||||
if test $ac_cv_c_compiler_gnu = yes ; then
|
||||
CFLAGS="$CFLAGS -std=gnu99 -W -Wstrict-prototypes -Wmissing-prototypes -Wall -Waggregate-return -Wcast-align -Wcast-qual -Wnested-externs -Wshadow -Wpointer-arith"
|
||||
# -Wundef -Wbad-function-cast -Wmissing-declarations -Wconversion -Winline"
|
||||
if test "$ac_arg_gcc_opt" = "N" ; then
|
||||
temp_CFLAGS=`echo $CFLAGS | sed "s/O2/O0/"`
|
||||
CFLAGS=$temp_CFLAGS
|
||||
AC_MSG_WARN([[*** Compiler optimisations switched off. ***]])
|
||||
fi
|
||||
|
||||
# Disable -Wall for Apple Darwin/Rhapsody.
|
||||
# System headers on these systems are broken.
|
||||
case "$target_os" in
|
||||
darwin* | rhapsody*)
|
||||
temp_CFLAGS=`echo $CFLAGS | sed "s/-Wall//"`
|
||||
CFLAGS=$temp_CFLAGS
|
||||
;;
|
||||
|
||||
linux*|kfreebsd*-gnu*|gnu*)
|
||||
SHLIB_VERSION_ARG="-Wl,--version-script=Version_script"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
if test x$ac_arg_gcc_pipe != "xN" ; then
|
||||
CFLAGS="$CFLAGS -pipe"
|
||||
fi
|
||||
|
||||
if test x$ac_arg_gcc_werror = "xyes" ; then
|
||||
CFLAGS="-Werror $CFLAGS"
|
||||
fi
|
||||
|
||||
AC_DEFINE([COMPILER_IS_GCC],1, [Set to 1 if the compile is GNU GCC.])
|
||||
GCC_MAJOR_VERSION=`$CC -dumpversion | sed "s/\..*//"`
|
||||
AC_DEFINE_UNQUOTED([GCC_MAJOR_VERSION],${GCC_MAJOR_VERSION}, [Major version of GCC or 3 otherwise.])
|
||||
fi
|
||||
|
||||
#====================================================================================
|
||||
# Find known target OS.
|
||||
|
||||
OS_SPECIFIC_INCLUDES=""
|
||||
os_is_win32=0
|
||||
|
||||
case "$target_os" in
|
||||
darwin* | rhapsody*)
|
||||
OS_SPECIFIC_INCLUDES="-fpascal-strings -I/Developer/Headers/FlatCarbon"
|
||||
OS_SPECIFIC_LINKS="-framework CoreAudio"
|
||||
;;
|
||||
mingw32*)
|
||||
OS_SPECIFIC_LINKS="-lwinmm"
|
||||
os_is_win32=1
|
||||
;;
|
||||
*)
|
||||
OS_SPECIFIC_INCLUDES=""
|
||||
OS_SPECIFIC_LINKS=""
|
||||
;;
|
||||
esac
|
||||
|
||||
htmldocdir=$prefix/share/doc/libsamplerate0-dev/html
|
||||
|
||||
if test $prefix = "NONE" ; then
|
||||
htmldocdir=/usr/local/share/doc/libsamplerate0-dev/html
|
||||
else
|
||||
htmldocdir=$prefix/share/doc/libsamplerate0-dev/html
|
||||
fi
|
||||
|
||||
#====================================================================================
|
||||
# Now use the information from the checking stage.
|
||||
|
||||
AC_DEFINE_UNQUOTED(OS_IS_WIN32, ${os_is_win32}, [Set to 1 if compiling for Win32])
|
||||
|
||||
AC_SUBST(htmldocdir)
|
||||
|
||||
AC_SUBST(SHLIB_VERSION_ARG)
|
||||
AC_SUBST(SHARED_VERSION_INFO)
|
||||
AC_SUBST(OS_SPECIFIC_INCLUDES)
|
||||
AC_SUBST(OS_SPECIFIC_LINKS)
|
||||
|
||||
AC_SUBST(COMPILER_IS_GCC)
|
||||
AC_SUBST(GCC_MAJOR_VERSION)
|
||||
|
||||
AC_SUBST(HAVE_FFTW3)
|
||||
AC_SUBST(FFTW3_CFLAGS)
|
||||
AC_SUBST(FFTW3_LIBS)
|
||||
|
||||
AC_SUBST(HAVE_SNDFILE)
|
||||
AC_SUBST(SNDFILE_CFLAGS)
|
||||
AC_SUBST(SNDFILE_LIBS)
|
||||
|
||||
AC_CONFIG_FILES([Makefile M4/Makefile src/Version_script \
|
||||
Win32/Makefile Win32/Makefile.mingw \
|
||||
src/Makefile examples/Makefile tests/Makefile doc/Makefile \
|
||||
libsamplerate.spec samplerate.pc])
|
||||
AC_OUTPUT
|
||||
|
||||
#====================================================================================
|
||||
|
||||
AC_MSG_RESULT([
|
||||
-=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=-=-
|
||||
|
||||
Configuration summary :
|
||||
|
||||
Version : ..................... ${VERSION}
|
||||
|
||||
Host CPU : .................... ${host_cpu}
|
||||
Host Vendor : ................. ${host_vendor}
|
||||
Host OS : ..................... ${host_os}
|
||||
])
|
||||
|
||||
if test x$ac_cv_c_compiler_gnu = xyes ; then
|
||||
echo -e " Tools :\n"
|
||||
echo " Compiler is GCC : ............. ${ac_cv_c_compiler_gnu}"
|
||||
echo " GCC major version : ........... ${GCC_MAJOR_VERSION}"
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT([
|
||||
Extra tools required for testing and examples :
|
||||
|
||||
Use FFTW : .................... ${ac_cv_fftw3}])
|
||||
|
||||
AC_MSG_RESULT([ Have libsndfile : ............. ${ac_cv_sndfile}
|
||||
])
|
||||
|
||||
AC_MSG_RESULT([ Installation directories :
|
||||
|
||||
Library directory : ........... ${prefix}/lib
|
||||
Program directory : ........... ${prefix}/bin
|
||||
Pkgconfig directory : ......... ${prefix}/lib/pkgconfig
|
||||
])
|
||||
|
||||
if test x$prefix != "x/usr" ; then
|
||||
echo "Compiling some other packages against ${PACKAGE} may require "
|
||||
echo -e "the addition of \"${prefix}/lib/pkgconfig\" to the "
|
||||
echo -e "PKG_CONFIG_PATH environment variable.\n"
|
||||
fi
|
||||
|
File diff suppressed because it is too large
Load diff
|
@ -1,7 +0,0 @@
|
|||
htmldir = $(htmldocdir)
|
||||
html_DATA = SRC.png SRC.css index.html license.html history.html download.html \
|
||||
lists.html quality.html win32.html faq.html api.html \
|
||||
api_simple.html api_callback.html api_full.html api_misc.html
|
||||
|
||||
EXTRA_DIST = $(html_DATA)
|
||||
|
|
@ -1,445 +0,0 @@
|
|||
# Makefile.in generated by automake 1.11.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = doc
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog \
|
||||
NEWS
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/M4/check_signal.m4 \
|
||||
$(top_srcdir)/M4/clip_mode.m4 $(top_srcdir)/M4/endian.m4 \
|
||||
$(top_srcdir)/M4/libtool.m4 $(top_srcdir)/M4/lrint.m4 \
|
||||
$(top_srcdir)/M4/lrintf.m4 $(top_srcdir)/M4/ltoptions.m4 \
|
||||
$(top_srcdir)/M4/ltsugar.m4 $(top_srcdir)/M4/ltversion.m4 \
|
||||
$(top_srcdir)/M4/lt~obsolete.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/src/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_GEN = $(am__v_GEN_$(V))
|
||||
am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
AM_V_at = $(am__v_at_$(V))
|
||||
am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_at_0 = @
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__installdirs = "$(DESTDIR)$(htmldir)"
|
||||
DATA = $(html_DATA)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPILER_IS_GCC = @COMPILER_IS_GCC@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DLLWRAP = @DLLWRAP@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FFTW3_CFLAGS = @FFTW3_CFLAGS@
|
||||
FFTW3_LIBS = @FFTW3_LIBS@
|
||||
FGREP = @FGREP@
|
||||
GCC_MAJOR_VERSION = @GCC_MAJOR_VERSION@
|
||||
GREP = @GREP@
|
||||
HAVE_FFTW3 = @HAVE_FFTW3@
|
||||
HAVE_SNDFILE = @HAVE_SNDFILE@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OS_SPECIFIC_INCLUDES = @OS_SPECIFIC_INCLUDES@
|
||||
OS_SPECIFIC_LINKS = @OS_SPECIFIC_LINKS@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PEXPORTS = @PEXPORTS@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
RANLIB = @RANLIB@
|
||||
RC = @RC@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHARED_VERSION_INFO = @SHARED_VERSION_INFO@
|
||||
SHELL = @SHELL@
|
||||
SHLIB_VERSION_ARG = @SHLIB_VERSION_ARG@
|
||||
SNDFILE_CFLAGS = @SNDFILE_CFLAGS@
|
||||
SNDFILE_LIBS = @SNDFILE_LIBS@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = $(htmldocdir)
|
||||
htmldocdir = @htmldocdir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
html_DATA = SRC.png SRC.css index.html license.html history.html download.html \
|
||||
lists.html quality.html win32.html faq.html api.html \
|
||||
api_simple.html api_callback.html api_full.html api_misc.html
|
||||
|
||||
EXTRA_DIST = $(html_DATA)
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu doc/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-htmlDATA: $(html_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)"
|
||||
@list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
|
||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-htmlDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(html_DATA)'; test -n "$(htmldir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
test -n "$$files" || exit 0; \
|
||||
echo " ( cd '$(DESTDIR)$(htmldir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(htmldir)" && rm -f $$files
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(DATA)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(htmldir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-htmlDATA
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-htmlDATA
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
||||
distclean distclean-generic distclean-libtool distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-htmlDATA install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
uninstall uninstall-am uninstall-htmlDATA
|
||||
|
||||
|
||||
# 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:
|
|
@ -1,36 +0,0 @@
|
|||
Version 0.1.8 (2011-08-15)
|
||||
* Minor bug fixes and upates.
|
||||
|
||||
Version 0.1.7 (2009-02-14)
|
||||
* Fix a segfault which occurs when memcpy is passed a bad length parameter.
|
||||
* Fix compilation under MSVC.
|
||||
|
||||
Version 0.1.6 (2009-01-27)
|
||||
* Minor bug fix in test suite (account for rounding error on x86_64).
|
||||
|
||||
Version 0.1.5 (2009-01-11)
|
||||
* Optimisation resulting dramatic throughput improvements.
|
||||
|
||||
Version 0.1.4 (2008-07-02)
|
||||
* Fix bug which causes a segfault with extremely low conversion ratios.
|
||||
|
||||
Version 0.1.3 (2008-03-23)
|
||||
* Huge improvement to the quality of conversion with the
|
||||
SRC_SINC_MEDIUM_QUALITY and SRC_SINC_BEST_QUALITY converters.
|
||||
* Minor bug fixes.
|
||||
|
||||
Version 0.1.2 (2004-09-12)
|
||||
* Fixed where callback based API wasn't being reset properly.
|
||||
* Minor bug fixes.
|
||||
|
||||
Version 0.1.1 (2004-07-17)
|
||||
* Fixed bug in callback based API.
|
||||
* Fixed a bug brought to light by aggressive optimisations of gcc-3.4.
|
||||
* Minor bug fixes.
|
||||
|
||||
Version 0.1.0 (2004-03-14)
|
||||
* Added callback based API.
|
||||
* Added a pair of functions for doing short to float and float to short
|
||||
conversions on an arrays of data.
|
||||
* Many minor bug fixes.
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
body {
|
||||
background : black ;
|
||||
color : white ;
|
||||
font-family : arial, helvetica, sans-serif ;
|
||||
}
|
||||
td {
|
||||
font-family : arial, helvetica, sans-serif ;
|
||||
background : black ;
|
||||
color : white ;
|
||||
}
|
||||
center {
|
||||
font-family : arial, helvetica, sans-serif ;
|
||||
}
|
||||
div {
|
||||
line-height: 1.3;
|
||||
}
|
||||
p {
|
||||
font-family : arial, helvetica, sans-serif ;
|
||||
text-align : left ;
|
||||
line-height: 1.3;
|
||||
margin-left : 3% ;
|
||||
margin-right : 3% ;
|
||||
}
|
||||
.indent_block {
|
||||
font-family : arial, helvetica, sans-serif ;
|
||||
text-align : left ;
|
||||
margin-left : 10% ;
|
||||
margin-right : 10% ;
|
||||
}
|
||||
br {
|
||||
font-family : arial, helvetica, sans-serif ;
|
||||
}
|
||||
form {
|
||||
font-family : arial, helvetica, sans-serif ;
|
||||
}
|
||||
ul {
|
||||
font-family : arial, helvetica, sans-serif ;
|
||||
text-align : left ;
|
||||
line-height: 1.3;
|
||||
margin-left : 3% ;
|
||||
margin-right : 6% ;
|
||||
}
|
||||
ol {
|
||||
font-family : arial, helvetica, sans-serif ;
|
||||
text-align : left ;
|
||||
line-height: 1.3;
|
||||
margin-left : 3% ;
|
||||
margin-right : 6% ;
|
||||
}
|
||||
dl {
|
||||
font-family : arial, helvetica, sans-serif ;
|
||||
text-align : left ;
|
||||
margin-left : 3% ;
|
||||
margin-right : 3% ;
|
||||
}
|
||||
h1 {
|
||||
font-size : xx-large ;
|
||||
background : black ;
|
||||
color : #FB1465 ;
|
||||
text-align : left ;
|
||||
margin-left : 3% ;
|
||||
margin-right : 3% ;
|
||||
}
|
||||
h2 {
|
||||
font-size : x-large ;
|
||||
background : black ;
|
||||
color : #FB1465 ;
|
||||
text-align : left ;
|
||||
margin-left : 3% ;
|
||||
margin-right : 3% ;
|
||||
}
|
||||
h3 {
|
||||
font-size : large ;
|
||||
background : black ;
|
||||
color : #FB1465 ;
|
||||
text-align : left ;
|
||||
margin-left : 3% ;
|
||||
margin-right : 3% ;
|
||||
}
|
||||
pre {
|
||||
font-family : courier, monospace ;
|
||||
font-size : medium ;
|
||||
}
|
||||
|
|
@ -1,127 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
Secret Rabbit Code (aka libsamplerate)
|
||||
</TITLE>
|
||||
<META NAME="Author" CONTENT="Erik de Castro Lopo (erikd AT mega-nerd DOT com)">
|
||||
<META NAME="Version" CONTENT="libsamplerate-0.1.8">
|
||||
<META NAME="Description" CONTENT="The Secret Rabbit Code Home Page">
|
||||
<META NAME="Keywords" CONTENT="libsamplerate sound resample audio dsp Linux">
|
||||
<LINK REL=StyleSheet HREF="SRC.css" TYPE="text/css" MEDIA="all">
|
||||
</HEAD>
|
||||
|
||||
<BODY TEXT="#FFFFFF" BGCOLOR="#000000" LINK="#FB1465" VLINK="#FB1465" ALINK="#FB1465">
|
||||
<!-- pepper -->
|
||||
<CENTER>
|
||||
<IMG SRC="SRC.png" HEIGHT=100 WIDTH=760 ALT="SRC.png">
|
||||
</CENTER>
|
||||
<!-- pepper -->
|
||||
<BR>
|
||||
<!-- pepper -->
|
||||
<TABLE ALIGN="center" WIDTH="98%">
|
||||
<TR>
|
||||
<TD VALIGN="top">
|
||||
<BR>
|
||||
<DIV CLASS="nav">
|
||||
<BR>
|
||||
<A HREF="index.html">Home</A><BR>
|
||||
<A HREF="license.html">License</A><BR>
|
||||
<A HREF="history.html">History</A><BR>
|
||||
<A HREF="download.html">Download</A><BR>
|
||||
<A HREF="quality.html">Quality</A><BR>
|
||||
<A HREF="api.html">API</A><BR>
|
||||
<A HREF="bugs.html">Bug Reporting</A><BR>
|
||||
<A HREF="win32.html">On Win32</A><BR>
|
||||
<A HREF="faq.html">FAQ</A><BR>
|
||||
<A HREF="lists.html">Mailing Lists</A><BR>
|
||||
<A HREF="ChangeLog">ChangeLog</A><BR>
|
||||
<BR>
|
||||
<DIV CLASS="block">
|
||||
Author :<BR>Erik de Castro Lopo
|
||||
<!-- pepper -->
|
||||
<BR><BR>
|
||||
<!-- pepper -->
|
||||
|
||||
</DIV>
|
||||
<IMG SRC=
|
||||
"/cgi-bin/Count.cgi?ft=6|frgb=55;55;55|tr=0|md=6|dd=B|st=1|sh=1|df=src_api.dat"
|
||||
HEIGHT=30 WIDTH=100 ALT="counter.gif">
|
||||
</DIV>
|
||||
|
||||
</TD>
|
||||
<!-- pepper -->
|
||||
<!-- ######################################################################## -->
|
||||
<!-- pepper -->
|
||||
<TD VALIGN="top">
|
||||
<DIV CLASS="block">
|
||||
|
||||
<H1><B>Applications Programming Interface</B></H1>
|
||||
<P>
|
||||
The publically callable functions of libsamplerate are all listed in the
|
||||
<B><samplerate.h></B> header file.
|
||||
In order to use any of the functionality of libsamplerate, you need to add
|
||||
</P>
|
||||
<PRE>
|
||||
#include <samplerate.h>
|
||||
</PRE>
|
||||
<P>
|
||||
to the top of any function that call any of the following functions.
|
||||
You will also need to link you binary with the libsamplerate library.
|
||||
</P>
|
||||
<P>
|
||||
The API allows three methods for accessing the capabilies of the library:
|
||||
</P>
|
||||
<UL>
|
||||
<LI>A <A HREF="api_simple.html">simple interface</A> which can sample rate convert
|
||||
a single block of samples (one or more channels) in one go.
|
||||
The simple API is less capable than the full API.
|
||||
<LI>A <A HREF="api_full.html">more fully featured interface</A> which allows time
|
||||
varying sample rate conversion on streaming data (again one or more
|
||||
channels).
|
||||
<LI>A <A HREF="api_callback.html">callback interface</A> which has the same
|
||||
functionality as the interface above but allows the details of input and
|
||||
output to be separated.
|
||||
The output is generated by call a read function and the library calls a user
|
||||
supplied callback function to obtain its input.
|
||||
This interface is particularly well suited to applications where the output
|
||||
sample rate is varied with time.
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
<b>NB :</b> All three access methods are able to process multi channel interleaved
|
||||
data.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
The parts of the API which are common to all three interfaces are:
|
||||
</P>
|
||||
<UL>
|
||||
<LI> The <A HREF="api_misc.html#ErrorReporting">error reporting</A> mechanisim.
|
||||
<LI> The available <A HREF="api_misc.html#Converters">converter</A> types.
|
||||
<LI> The <A HREF="api_misc.html#SRC_DATA">SRC_DATA</A> struct.
|
||||
</UL>
|
||||
<P>
|
||||
All three versions of the API are restricted to operating on buffers of ISO C
|
||||
Standard <B>float</B> data.
|
||||
However, there are two
|
||||
<A HREF="api_misc.html#Aux">auxillary functions</A>
|
||||
for converting arrays of float data to and from short data.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
<B>Note:</B> The <B>tests/</B> and <B>examples/</B> directories of the source code
|
||||
distribution contain numerous example programs showing the use of the library.
|
||||
</P>
|
||||
|
||||
<!-- pepper -->
|
||||
<!-- <A HREF="mailto:aldel0305@mega-nerd.com">For the spam bots</A> -->
|
||||
<!-- pepper -->
|
||||
|
||||
</DIV>
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -1,176 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
Secret Rabbit Code (aka libsamplerate)
|
||||
</TITLE>
|
||||
<META NAME="Author" CONTENT="Erik de Castro Lopo (erikd AT mega-nerd DOT com)">
|
||||
<META NAME="Version" CONTENT="libsamplerate-0.1.8">
|
||||
<META NAME="Description" CONTENT="The Secret Rabbit Code Home Page">
|
||||
<META NAME="Keywords" CONTENT="libsamplerate sound resample audio dsp Linux">
|
||||
<LINK REL=StyleSheet HREF="SRC.css" TYPE="text/css" MEDIA="all">
|
||||
</HEAD>
|
||||
|
||||
<BODY TEXT="#FFFFFF" BGCOLOR="#000000" LINK="#FB1465" VLINK="#FB1465" ALINK="#FB1465">
|
||||
<!-- pepper -->
|
||||
<CENTER>
|
||||
<IMG SRC="SRC.png" HEIGHT=100 WIDTH=760 ALT="SRC.png">
|
||||
</CENTER>
|
||||
<!-- pepper -->
|
||||
<BR>
|
||||
<!-- pepper -->
|
||||
<TABLE ALIGN="center" WIDTH="98%">
|
||||
<TR>
|
||||
<TD VALIGN="top">
|
||||
<BR>
|
||||
<DIV CLASS="nav">
|
||||
<BR>
|
||||
<A HREF="index.html">Home</A><BR>
|
||||
<BR>
|
||||
<A HREF="api_simple.html">Simple API</A><BR>
|
||||
<A HREF="api_full.html">Full API</A><BR>
|
||||
<A HREF="api_callback.html">Callback API</A><BR>
|
||||
<A HREF="api_misc.html">Miscellaneous</A><BR>
|
||||
<A HREF="api_misc.html#ErrorReporting">Error Handling</A><BR>
|
||||
<BR>
|
||||
<DIV CLASS="block">
|
||||
Author :<BR>Erik de Castro Lopo
|
||||
<!-- pepper -->
|
||||
<BR><BR>
|
||||
<!-- pepper -->
|
||||
|
||||
</DIV>
|
||||
<IMG SRC=
|
||||
"/cgi-bin/Count.cgi?ft=6|frgb=55;55;55|tr=0|md=6|dd=B|st=1|sh=1|df=src_api.dat"
|
||||
HEIGHT=30 WIDTH=100 ALT="counter.gif">
|
||||
</DIV>
|
||||
|
||||
</TD>
|
||||
<!-- pepper -->
|
||||
<!-- ######################################################################## -->
|
||||
<!-- pepper -->
|
||||
<TD VALIGN="top">
|
||||
<DIV CLASS="block">
|
||||
|
||||
<H1><B>Callback API</B></H1>
|
||||
<P>
|
||||
The callback API consists of the following functions :
|
||||
</P>
|
||||
<PRE>
|
||||
typedef long (*src_callback_t) (void *cb_data, float **data) ;
|
||||
|
||||
SRC_STATE* <A HREF="#Init">src_callback_new</A> (src_callback_t func,
|
||||
int converter_type, int channels,
|
||||
int *error, void* cb_data) ;
|
||||
|
||||
SRC_STATE* <A HREF="api_full.html#CleanUp">src_delete</A> (SRC_STATE *state) ;
|
||||
|
||||
long <A HREF="#Read">src_callback_read</A> (SRC_STATE *state, double src_ratio,
|
||||
long frames, float *data) ;
|
||||
|
||||
int <A HREF="api_full.html#Reset">src_reset</A> (SRC_STATE *state) ;
|
||||
int <A HREF="api_full.html#SetRatio">src_set_ratio</A> (SRC_STATE *state, double new_ratio) ;
|
||||
</PRE>
|
||||
<BR>
|
||||
|
||||
<P>
|
||||
Like the
|
||||
<A HREF="api_simple.html">simple API</a>
|
||||
and the
|
||||
<A HREF="api_full.html">full API</a>,
|
||||
the callback based API is able to operate on interleaved multi channel data.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
An example of the use of the callback based API can be found in the
|
||||
<B>varispeed-play</B> program in the <B>examples/</B> directory of the
|
||||
source code tarball.
|
||||
</P>
|
||||
|
||||
<!-- pepper -->
|
||||
<A NAME="Init"></A>
|
||||
<H3><BR>Initialisation</H3>
|
||||
<PRE>
|
||||
SRC_STATE* src_callback_new (src_callback_t func,
|
||||
int converter_type, int channels,
|
||||
int *error, void* cb_data) ;
|
||||
</PRE>
|
||||
<P>
|
||||
The <B>src_callback_new</B> function returns an anonymous pointer to a
|
||||
sample rate converter callback object, src_state.
|
||||
This is the same type of object as that returned by <A HREF="api_full.html#init">
|
||||
src_new</A>, but with different internal state.
|
||||
Although these are the same object type, they cannot be used interchangeably.
|
||||
If an error occurs the function returns a NULL pointer and fills in the
|
||||
error value pointed to by the <B>error</B> pointer supplied by the caller.
|
||||
</P>
|
||||
<P>
|
||||
The caller then passes the SRC_STATE object to the <B>src_callback_read</B>
|
||||
function to pull data out of the converter.
|
||||
When the caller is finished with the converter they should pass it to the
|
||||
clean up function <A HREF="api_full.html#CleanUp">src_delete</A>.
|
||||
</P>
|
||||
<P>
|
||||
The <B>func</B> parameter is a user supplied function which must match the
|
||||
<B>src_callback_t</B> type signature while <B>cb_data</B> is a pointer to
|
||||
data which be passed as the first parameter to the user supplied callback
|
||||
function.
|
||||
This function is called by the converter whenever it needs input data as a
|
||||
result of being calls to <B>src_callback_read</B>.
|
||||
</P>
|
||||
<P>
|
||||
If the converter was initialised to work with more than one channel, the
|
||||
callback function must work with mutiple channels of interleaved data.
|
||||
The callback function should return the number of frames it supplying to
|
||||
the converter.
|
||||
For multi channel files, this return value should be the number of floats
|
||||
divided by the number of channels.
|
||||
</P>
|
||||
<P>
|
||||
The converter must be one of the supplied converter types documented
|
||||
<A HREF="api_misc.html#Converters">here</A>.
|
||||
</P>
|
||||
<P>
|
||||
The caller then passes the SRC_STATE pointer to the <B>src_callback_read</B>
|
||||
function to pull data out of the converter.
|
||||
</P>
|
||||
|
||||
<!-- pepper -->
|
||||
<A NAME="Read"></A>
|
||||
<H3><BR>Callback Read</H3>
|
||||
<PRE>
|
||||
long src_callback_read (SRC_STATE *state, double src_ratio,
|
||||
long frames, float *data) ;
|
||||
</PRE>
|
||||
<P>
|
||||
The <B>src_callback_read</B> function is passed the
|
||||
<A HREF="api_misc.html#SRC_DATA"><B>SRC_STATE</B></A>
|
||||
pointer returned by <B>src_callback_new</B>, the coversion ratio
|
||||
(output_sample_rate / input_sample_rate), the maximum number of output frames
|
||||
to generate and a pointer to a buffer in which to place the output data.
|
||||
For multi channel files, the data int the output buffer is stored in
|
||||
interleaved format.
|
||||
</P>
|
||||
<P>
|
||||
The <B>src_callback_read</B> function returns the number of frames generated
|
||||
or zero if an error occurs or it runs out of input (ie the user supplied
|
||||
callback function returns zero and there is no more data buffered internally).
|
||||
If an error has occurred, the function <A HREF="api_misc.html#ErrorReporting">
|
||||
src_error</A> will return non-zero.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
See also :
|
||||
<A HREF="api_full.html#SetRatio"><B>src_set_ratio</B></A>
|
||||
</P>
|
||||
|
||||
<!-- pepper -->
|
||||
|
||||
</DIV>
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
|
@ -1,199 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
Secret Rabbit Code (aka libsamplerate)
|
||||
</TITLE>
|
||||
<META NAME="Author" CONTENT="Erik de Castro Lopo (erikd AT mega-nerd DOT com)">
|
||||
<META NAME="Version" CONTENT="libsamplerate-0.1.8">
|
||||
<META NAME="Description" CONTENT="The Secret Rabbit Code Home Page">
|
||||
<META NAME="Keywords" CONTENT="libsamplerate sound resample audio dsp Linux">
|
||||
<LINK REL=StyleSheet HREF="SRC.css" TYPE="text/css" MEDIA="all">
|
||||
</HEAD>
|
||||
|
||||
<BODY TEXT="#FFFFFF" BGCOLOR="#000000" LINK="#FB1465" VLINK="#FB1465" ALINK="#FB1465">
|
||||
<!-- pepper -->
|
||||
<CENTER>
|
||||
<IMG SRC="SRC.png" HEIGHT=100 WIDTH=760 ALT="SRC.png">
|
||||
</CENTER>
|
||||
<!-- pepper -->
|
||||
<BR>
|
||||
<!-- pepper -->
|
||||
<TABLE ALIGN="center" WIDTH="98%">
|
||||
<TR>
|
||||
<TD VALIGN="top">
|
||||
<BR>
|
||||
<DIV CLASS="nav">
|
||||
<BR>
|
||||
<A HREF="index.html">Home</A><BR>
|
||||
<BR>
|
||||
<A HREF="api_simple.html">Simple API</A><BR>
|
||||
<A HREF="api_full.html">Full API</A><BR>
|
||||
<A HREF="api_callback.html">Callback API</A><BR>
|
||||
<A HREF="api_misc.html">Miscellaneous</A><BR>
|
||||
<A HREF="api_misc.html#ErrorReporting">Error Handling</A><BR>
|
||||
<BR>
|
||||
<DIV CLASS="block">
|
||||
Author :<BR>Erik de Castro Lopo
|
||||
<!-- pepper -->
|
||||
<BR><BR>
|
||||
<!-- pepper -->
|
||||
|
||||
</DIV>
|
||||
<IMG SRC=
|
||||
"/cgi-bin/Count.cgi?ft=6|frgb=55;55;55|tr=0|md=6|dd=B|st=1|sh=1|df=src_api.dat"
|
||||
HEIGHT=30 WIDTH=100 ALT="counter.gif">
|
||||
</DIV>
|
||||
|
||||
</TD>
|
||||
<!-- pepper -->
|
||||
<!-- ######################################################################## -->
|
||||
<!-- pepper -->
|
||||
<TD VALIGN="top">
|
||||
<DIV CLASS="block">
|
||||
|
||||
<H1><B>Full API</B></H1>
|
||||
<P>
|
||||
The full API consists of the following functions :
|
||||
</P>
|
||||
<PRE>
|
||||
SRC_STATE* <A HREF="#Init">src_new</A> (int converter_type, int channels, int *error) ;
|
||||
SRC_STATE* <A HREF="#CleanUp">src_delete</A> (SRC_STATE *state) ;
|
||||
|
||||
int <A HREF="#Process">src_process</A> (SRC_STATE *state, SRC_DATA *data) ;
|
||||
int <A HREF="#Reset">src_reset</A> (SRC_STATE *state) ;
|
||||
int <A HREF="#SetRatio">src_set_ratio</A> (SRC_STATE *state, double new_ratio) ;
|
||||
</PRE>
|
||||
|
||||
<A NAME="Init"></A>
|
||||
<H3><BR>Initialisation</H3>
|
||||
<PRE>
|
||||
SRC_STATE* src_new (int converter_type, int channels, int *error) ;
|
||||
</PRE>
|
||||
<P>
|
||||
The <B>src_new</B> function returns an anonymous pointer to a sample rate
|
||||
converter object, src_state.
|
||||
If an error occurs the function returns a NULL pointer and fills in the
|
||||
error value pointed to by the <B>error</B> pointer supplied by the caller.
|
||||
The converter must be one of the supplied converter types documented
|
||||
<A HREF="api_misc.html#Converters">here</A>.
|
||||
</P>
|
||||
|
||||
<A NAME="CleanUp"></A>
|
||||
<H3><BR>Cleanup</H3>
|
||||
<PRE>
|
||||
SRC_STATE* src_delete (SRC_STATE *state) ;
|
||||
</PRE>
|
||||
<P>
|
||||
The <B>src_delete</B> function frees up all memory allocated for the given sample
|
||||
rate converter object and returns a NULL pointer.
|
||||
The caller is responsible for freeing any memory passed to the sample rate converter
|
||||
via the pointer to the <B>SRC_DATA</B> struct.
|
||||
</P>
|
||||
|
||||
<A NAME="Process"></A>
|
||||
<H3><BR>Process</H3>
|
||||
<PRE>
|
||||
int src_process (SRC_STATE *state, SRC_DATA *data) ;
|
||||
</PRE>
|
||||
<P>
|
||||
The <B>src_process</B> function processes the data provided by the caller
|
||||
in an <B>SRC_DATA</B> struct using the sample rate converter object specified
|
||||
by the <B>SRC_STATE</B> pointer.
|
||||
When operating on streaming data, this function can be called over and over again,
|
||||
with each new call providing new input data and returning new output data.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
The <B>SRC_DATA</B> struct passed as the second parameter to the <B>src_process</B>
|
||||
function has the following fields:
|
||||
</P>
|
||||
<PRE>
|
||||
typedef struct
|
||||
{ float *data_in, *data_out ;
|
||||
|
||||
long input_frames, output_frames ;
|
||||
long input_frames_used, output_frames_gen ;
|
||||
|
||||
int end_of_input ;
|
||||
|
||||
double src_ratio ;
|
||||
} SRC_DATA ;
|
||||
</PRE>
|
||||
<P>
|
||||
The fields of this struct which must be filled in by the caller are:
|
||||
</P>
|
||||
<PRE>
|
||||
data_in : A pointer to the input data samples.
|
||||
input_frames : The number of frames of data pointed to by data_in.
|
||||
data_out : A pointer to the output data samples.
|
||||
output_frames : Maximum number of frames pointer to by data_out.
|
||||
src_ratio : Equal to output_sample_rate / input_sample_rate.
|
||||
end_of_input : Equal to 0 if more input data is available and 1
|
||||
otherwise.
|
||||
</PRE>
|
||||
<P>
|
||||
Note that the data_in and data_out arrays may not overlap. If they do, the
|
||||
library will return an error code.
|
||||
</P>
|
||||
<P>
|
||||
When the <B>src_process</B> function returns <B>output_frames_gen</B> will be
|
||||
set to the number of output frames generated and <B>input_frames_used</B> will
|
||||
be set to the number of input frames consumed to generate the provided number of
|
||||
output frames.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
The <B>src_process</B> function returns non-zero if an error occurs.
|
||||
The non-zero error return value can be decoded into a text string using the function
|
||||
documented <A HREF="api_misc.html#ErrorReporting">here</A>.
|
||||
</P>
|
||||
|
||||
<A NAME="Reset"></A>
|
||||
<H3><BR>Reset</H3>
|
||||
<PRE>
|
||||
int src_reset (SRC_STATE *state) ;
|
||||
</PRE>
|
||||
<P>
|
||||
The <B>src_reset</B> function resets the internal state of the sample rate
|
||||
converter object to the same state it had immediately after its creation using
|
||||
<B>src_new</B>.
|
||||
This should be called whenever a sample rate converter is to be used on two
|
||||
separate, unrelated pieces of audio.
|
||||
</P>
|
||||
|
||||
<A NAME="SetRatio"></A>
|
||||
<H3><BR>Set Ratio</H3>
|
||||
<PRE>
|
||||
int src_set_ratio (SRC_STATE *state, double new_ratio) ;
|
||||
</PRE>
|
||||
|
||||
<p>
|
||||
When using the <B>src_process</B> or <B>src_callback_process</B> APIs and
|
||||
updating the <B>src_ratio</B> field of the <B>SRC_STATE</B> struct, the library
|
||||
will try to smoothly transition between the conversion ratio of the last call
|
||||
and the conversion ratio of the current call.
|
||||
<p/>
|
||||
|
||||
<P>
|
||||
If the user want to bypass this smooth transition and achieve a step response in
|
||||
the conversion ratio, the <B>src_set_ratio</B> function can be used to set the
|
||||
starting conversion ratio of the next call to <B>src_process</B> or
|
||||
<B>src_callback_process</B>.
|
||||
<p/>
|
||||
|
||||
<P>
|
||||
This function returns non-zero on error and the error return value can be
|
||||
decoded into a text string using the function documented
|
||||
<A HREF="api_misc.html#ErrorReporting">here</A>.</P>
|
||||
|
||||
<!-- <A HREF="mailto:aldel@mega-nerd.com">For the spam bots</A> -->
|
||||
|
||||
</DIV>
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
|
@ -1,226 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
Secret Rabbit Code (aka libsamplerate)
|
||||
</TITLE>
|
||||
<META NAME="Author" CONTENT="Erik de Castro Lopo (erikd AT mega-nerd DOT com)">
|
||||
<META NAME="Version" CONTENT="libsamplerate-0.1.8">
|
||||
<META NAME="Description" CONTENT="The Secret Rabbit Code Home Page">
|
||||
<META NAME="Keywords" CONTENT="libsamplerate sound resample audio dsp Linux">
|
||||
<LINK REL=StyleSheet HREF="SRC.css" TYPE="text/css" MEDIA="all">
|
||||
</HEAD>
|
||||
|
||||
<BODY TEXT="#FFFFFF" BGCOLOR="#000000" LINK="#FB1465" VLINK="#FB1465" ALINK="#FB1465">
|
||||
<!-- pepper -->
|
||||
<CENTER>
|
||||
<IMG SRC="SRC.png" HEIGHT=100 WIDTH=760 ALT="SRC.png">
|
||||
</CENTER>
|
||||
<!-- pepper -->
|
||||
<BR>
|
||||
<!-- pepper -->
|
||||
<TABLE ALIGN="center" WIDTH="98%">
|
||||
<TR>
|
||||
<TD VALIGN="top">
|
||||
<BR>
|
||||
<DIV CLASS="nav">
|
||||
<BR>
|
||||
<A HREF="index.html">Home</A><BR>
|
||||
<BR>
|
||||
<A HREF="api_simple.html">Simple API</A><BR>
|
||||
<A HREF="api_full.html">Full API</A><BR>
|
||||
<A HREF="api_misc.html#ErrorReporting">Error Handling</A><BR>
|
||||
<A HREF="api_misc.html">Miscellaneous</A><BR>
|
||||
<BR>
|
||||
<DIV CLASS="block">
|
||||
Author :<BR>Erik de Castro Lopo
|
||||
<!-- pepper -->
|
||||
<BR><BR>
|
||||
<!-- pepper -->
|
||||
|
||||
</DIV>
|
||||
<IMG SRC=
|
||||
"/cgi-bin/Count.cgi?ft=6|frgb=55;55;55|tr=0|md=6|dd=B|st=1|sh=1|df=src_api.dat"
|
||||
HEIGHT=30 WIDTH=100 ALT="counter.gif">
|
||||
</DIV>
|
||||
|
||||
</TD>
|
||||
<!-- pepper -->
|
||||
<!-- ######################################################################## -->
|
||||
<!-- pepper -->
|
||||
<TD VALIGN="top">
|
||||
<DIV CLASS="block">
|
||||
|
||||
<H1><B>Miscellaneous API Documentation</B></H1>
|
||||
<A NAME="ErrorReporting"></A>
|
||||
<H3><BR>Error Reporting</H3>
|
||||
<P>
|
||||
Most of the API functions either return an integer error (ie <B>src_simple</B>
|
||||
and <B>src_process</B>) or return an integer error value via an int pointer
|
||||
parameter (<B>src_new</B>).
|
||||
These integer error values can be converted into a human readable text strings by
|
||||
calling the function:
|
||||
</P>
|
||||
<PRE>
|
||||
const char* src_strerror (int error) ;
|
||||
</PRE>
|
||||
<P>
|
||||
which will return an error string for valid error numbers, the string "No Error"
|
||||
for an error value of zero or a NULL pointer if no error message has been defined
|
||||
for that error value.
|
||||
</P>
|
||||
|
||||
<A NAME="Converters"></A>
|
||||
<H3><BR>Converters</H3>
|
||||
<P>
|
||||
Secret Rabbit Code has a number of different converters which can be selected
|
||||
using the <B>converter_type</B> parameter when calling <B>src_simple</B> or
|
||||
<b>src_new</B>.
|
||||
Currently, the five converters available are:
|
||||
</P>
|
||||
<PRE>
|
||||
enum
|
||||
{
|
||||
SRC_SINC_BEST_QUALITY = 0,
|
||||
SRC_SINC_MEDIUM_QUALITY = 1,
|
||||
SRC_SINC_FASTEST = 2,
|
||||
SRC_ZERO_ORDER_HOLD = 3,
|
||||
SRC_LINEAR = 4
|
||||
} ;
|
||||
</PRE>
|
||||
<P>
|
||||
As new converters are added, they will given a number corresponding to the
|
||||
next inetger.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
The details of these converters are as follows:
|
||||
</P>
|
||||
<UL>
|
||||
<LI> <B>SRC_SINC_BEST_QUALITY</B> - This is a bandlimited interpolator derived
|
||||
from the mathematical <B>sinc</B> function and this is the highest
|
||||
quality sinc based converter, providing a worst case Signal-to-Noise
|
||||
Ratio (SNR) of 97 decibels (dB) at a bandwidth of 97%.
|
||||
All three SRC_SINC_* converters are based on the techniques of
|
||||
<A HREF="http://ccrma-www.stanford.edu/~jos/resample/">Julius O. Smith</A>
|
||||
although this code was developed independantly.
|
||||
<LI> <B>SRC_SINC_MEDIUM_QUALITY</B> - This is another bandlimited interpolator
|
||||
much like the previous one. It has an SNR of 97dB and a bandwidth of 90%.
|
||||
The speed of the conversion is much faster than the previous one.
|
||||
<LI> <B>SRC_SINC_FASTEST</B> - This is the fastest bandlimited interpolator and
|
||||
has an SNR of 97dB and a bandwidth of 80%.
|
||||
<LI><B>SRC_ZERO_ORDER_HOLD</B> - A Zero Order Hold converter (interpolated value
|
||||
is equal to the last value). The quality is poor but the conversion speed is
|
||||
blindlingly fast.
|
||||
<li><b>SRC_LINEAR</b> - A linear converter. Again the quality is poor, but the
|
||||
conversion speed is blindingly fast.
|
||||
</UL>
|
||||
<P>
|
||||
There are two functions that give either a (text string) name or description
|
||||
for each converter:
|
||||
</P>
|
||||
<PRE>
|
||||
const char *src_get_name (int converter_type) ;
|
||||
const char *src_get_description (int converter_type) ;
|
||||
</PRE>
|
||||
<P>
|
||||
The name will typically be a short string for use in a dialog box, while the
|
||||
description string is longer.
|
||||
</P>
|
||||
<P>
|
||||
Both of these functions return a NULL pointer if there is no converter for the
|
||||
given <B>converter_type</B> value.
|
||||
Since the converters have consecutive <B>converter_type</B> values, the caller
|
||||
is easily able to figure out the number of converters at run time.
|
||||
This enables a binary dynamically linked against an old version of the library
|
||||
to know about converters from later versions of the library as they become
|
||||
available.
|
||||
</P>
|
||||
|
||||
<A NAME="SRC_DATA"></A>
|
||||
<H3><BR>SRC_DATA</H3>
|
||||
<P>
|
||||
Both the simple and the full featured versions of the API use the <B>SRC_DATA</B>
|
||||
struct to pass audio and control data into the sample rate converter.
|
||||
This struct is defined as:
|
||||
</P>
|
||||
<PRE>
|
||||
typedef struct
|
||||
{ float *data_in, *data_out ;
|
||||
|
||||
long input_frames, output_frames ;
|
||||
long input_frames_used, output_frames_gen ;
|
||||
|
||||
int end_of_input ;
|
||||
|
||||
double src_ratio ;
|
||||
} SRC_DATA ;
|
||||
</PRE>
|
||||
<P>
|
||||
The <B>data_in</B> pointer is used to pass audio data into the converter while the
|
||||
<B>data_out</B> pointer supplies the converter with an array to hold the converter's
|
||||
output.
|
||||
For a converter which has been configured for mulitchannel operation, these pointers
|
||||
need to point to a single array of interleaved data.
|
||||
</P>
|
||||
<P>
|
||||
The <B>input_frames</B> and <B>output_frames</B> fields supply the converter with
|
||||
the lengths of the arrays (in frames) pointed to by the <B>data_in</B> and
|
||||
<b>data_out</B> pointers respectively.
|
||||
For monophinc data, these values would indicate the length of the arrays while
|
||||
for multi channel data these values would be equal to the the length of the array
|
||||
divided by the number of channels.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
The <B>end_of_input</B> field is only used when the sample rate converter is used
|
||||
by calling the <B>src_process</B> function.
|
||||
In this case it should be set to zero if more buffers are to be passed to the
|
||||
converter and 1 if the current buffer is the last.
|
||||
</P>
|
||||
<P>
|
||||
Finally, the <B>src_ratio</B> field specifies the conversion ratio defined as
|
||||
the input sample rate divided by the output sample rate.
|
||||
For a connected set of buffers, this value can be varies on each call to
|
||||
<B>src_process</B> resulting in a time varying sample rate conversion
|
||||
process.
|
||||
For time varying sample rate conversions, the ratio will be linearly
|
||||
interpolated between the <B>src_ratio</B> value of the previous call
|
||||
to <B>src_process</B> and the value for the current call.
|
||||
</P>
|
||||
<P>
|
||||
The <B>input_frames_used</B> and <B>output_frames_gen</B> fields are set by the
|
||||
converter to inform the caller of the number of frames consumed from the
|
||||
<B>data_in</B> array and the number of frames generated in the <B>data_out</B>
|
||||
array respectively.
|
||||
These values are for the current call to <B>src_process</B> only.
|
||||
</P>
|
||||
|
||||
<A NAME="Aux"></A>
|
||||
<H3><BR>Auxillary Functions</H3>
|
||||
<P>
|
||||
There are four auxillary functions for converting arrays of float data
|
||||
to and from short or int data.
|
||||
These functions are defined as:
|
||||
</P>
|
||||
<PRE>
|
||||
void src_short_to_float_array (const short *in, float *out, int len) ;
|
||||
void src_float_to_short_array (const float *in, short *out, int len) ;
|
||||
void src_int_to_float_array (const int *in, float *out, int len) ;
|
||||
void src_float_to_int_array (const float *in, int *out, int len) ;
|
||||
</PRE>
|
||||
<P>
|
||||
The float data is assumed to be in the range [-1.0, 1.0] and it is
|
||||
automatically scaled on the conversion to and from float.
|
||||
On the float to short/int conversion path, any data values which would overflow
|
||||
the range of short/int data are clipped.
|
||||
</P>
|
||||
|
||||
</DIV>
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
|
@ -1,146 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
Secret Rabbit Code (aka libsamplerate)
|
||||
</TITLE>
|
||||
<META NAME="Author" CONTENT="Erik de Castro Lopo (erikd AT mega-nerd DOT com)">
|
||||
<META NAME="Version" CONTENT="libsamplerate-0.1.8">
|
||||
<META NAME="Description" CONTENT="The Secret Rabbit Code Home Page">
|
||||
<META NAME="Keywords" CONTENT="libsamplerate sound resample audio dsp Linux">
|
||||
<LINK REL=StyleSheet HREF="SRC.css" TYPE="text/css" MEDIA="all">
|
||||
</HEAD>
|
||||
|
||||
<BODY TEXT="#FFFFFF" BGCOLOR="#000000" LINK="#FB1465" VLINK="#FB1465" ALINK="#FB1465">
|
||||
<!-- pepper -->
|
||||
<CENTER>
|
||||
<IMG SRC="SRC.png" HEIGHT=100 WIDTH=760 ALT="SRC.png">
|
||||
</CENTER>
|
||||
<!-- pepper -->
|
||||
<BR>
|
||||
<!-- pepper -->
|
||||
<TABLE ALIGN="center" WIDTH="98%">
|
||||
<TR>
|
||||
<TD VALIGN="top">
|
||||
<BR>
|
||||
<DIV CLASS="nav">
|
||||
<BR>
|
||||
<A HREF="index.html">Home</A><BR>
|
||||
<BR>
|
||||
<A HREF="api_simple.html">Simple API</A><BR>
|
||||
<A HREF="api_full.html">Full API</A><BR>
|
||||
<A HREF="api_callback.html">Callback API</A><BR>
|
||||
<A HREF="api_misc.html">Miscellaneous</A><BR>
|
||||
<A HREF="api_misc.html#ErrorReporting">Error Handling</A><BR>
|
||||
<BR>
|
||||
<DIV CLASS="block">
|
||||
Author :<BR>Erik de Castro Lopo
|
||||
<!-- pepper -->
|
||||
<BR><BR>
|
||||
<!-- pepper -->
|
||||
|
||||
</DIV>
|
||||
<IMG SRC=
|
||||
"/cgi-bin/Count.cgi?ft=6|frgb=55;55;55|tr=0|md=6|dd=B|st=1|sh=1|df=src_api.dat"
|
||||
HEIGHT=30 WIDTH=100 ALT="counter.gif">
|
||||
</DIV>
|
||||
|
||||
</TD>
|
||||
<!-- pepper -->
|
||||
<!-- ######################################################################## -->
|
||||
<!-- pepper -->
|
||||
<TD VALIGN="top">
|
||||
<DIV CLASS="block">
|
||||
|
||||
<H1><B>Simple API</B></H1>
|
||||
|
||||
<P>
|
||||
<B>Important Note:</B>
|
||||
The simple API is not designed to work on small chunks of a larger piece of
|
||||
audio.
|
||||
If you attempt to use it this way you are doing it wrong and will not get the
|
||||
results you want.
|
||||
For processing audio data in chunks you <b>must</b> use the
|
||||
<a href="api_full.html">full api</a>
|
||||
or the
|
||||
<a href="api_callback.html">callback based api</a>.
|
||||
</P>
|
||||
|
||||
<br/><br/>
|
||||
|
||||
<P>
|
||||
The simple API consists of a single function :
|
||||
</P>
|
||||
<PRE>
|
||||
int src_simple (SRC_DATA *data, int converter_type, int channels) ;
|
||||
</PRE>
|
||||
<P>
|
||||
The use of this function rather than the more fully featured API requires the caller
|
||||
to know the total length of the input data before hand and that all input and output
|
||||
data can be held in the system's memory at once.
|
||||
It also assumes that there is a single constant ratio between input and output sample
|
||||
rates.
|
||||
<!--
|
||||
If these conditions cannot be met, the full featured API should be used instead.
|
||||
In addition, this documentation is complemented by this
|
||||
<A HREF="ex_simple.html">example code</A>. -->
|
||||
</P>
|
||||
|
||||
<P>
|
||||
Dealing with the easy stuff first, the <B>converter_type</B> parameter should be
|
||||
one of the values defined in <B>samplerate.h</B> and documented
|
||||
<A HREF="api_misc.html#Converters">here</A> while the <b>channels</b> parameter
|
||||
specifies the number of interleaved channels that the sample rate converter
|
||||
is being asked to process (number of input channels and output channels is always
|
||||
equal).
|
||||
There is no hard upper limit on the number of channels; it is limited purely
|
||||
by the amount of memory available.
|
||||
</P>
|
||||
|
||||
|
||||
<P>
|
||||
The first parameter to <B>src_simple</B> is a pointer to an <B>SRC_DATA</B> struct
|
||||
(more info <A HREF="api_misc.html#SRC_DATA">here</A>) defined as follows:
|
||||
</P>
|
||||
<PRE>
|
||||
typedef struct
|
||||
{ float *data_in, *data_out ;
|
||||
|
||||
long input_frames, output_frames ;
|
||||
long input_frames_used, output_frames_gen ;
|
||||
|
||||
int end_of_input ;
|
||||
|
||||
double src_ratio ;
|
||||
} SRC_DATA ;
|
||||
</PRE>
|
||||
<P>
|
||||
The fields of this struct which must be filled in by the caller are:
|
||||
</P>
|
||||
<PRE>
|
||||
data_in : A pointer to the input data samples.
|
||||
input_frames : The number of frames of data pointed to by data_in.
|
||||
data_out : A pointer to the output data samples.
|
||||
output_frames : Maximum number of frames pointer to by data_out.
|
||||
src_ratio : Equal to output_sample_rate / input_sample_rate.
|
||||
</PRE>
|
||||
<P>
|
||||
When the <B>src_simple</B> function returns <B>output_frames_gen</B> will be
|
||||
set to the number of output frames generated and <B>input_frames_used</B> will
|
||||
be set to the number of input frames used to generate the provided number of
|
||||
output frames.
|
||||
</P>
|
||||
<P>
|
||||
The <B>src_simple</B> function returns a non-zero value when an error occurs.
|
||||
See <A HREF="api_misc.html#ErrorReporting">here</A> for how to convert the error value into
|
||||
a text string.
|
||||
</P>
|
||||
|
||||
</DIV>
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
|
@ -1,90 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
Secret Rabbit Code (aka libsamplerate)
|
||||
</TITLE>
|
||||
<META NAME="Author" CONTENT="Erik de Castro Lopo (erikd AT mega-nerd DOT com)">
|
||||
<META NAME="Version" CONTENT="libsamplerate-0.1.8">
|
||||
<META NAME="Description" CONTENT="The Secret Rabbit Code Home Page">
|
||||
<META NAME="Keywords" CONTENT="libsamplerate sound resample audio dsp Linux">
|
||||
<LINK REL=StyleSheet HREF="SRC.css" TYPE="text/css" MEDIA="all">
|
||||
</HEAD>
|
||||
|
||||
<BODY TEXT="#FFFFFF" BGCOLOR="#000000" LINK="#FB1465" VLINK="#FB1465" ALINK="#FB1465">
|
||||
<!-- pepper -->
|
||||
<CENTER>
|
||||
<IMG SRC="SRC.png" HEIGHT=100 WIDTH=760 ALT="SRC.png">
|
||||
</CENTER>
|
||||
<!-- pepper -->
|
||||
<BR>
|
||||
<!-- pepper -->
|
||||
<TABLE ALIGN="center" WIDTH="98%">
|
||||
<TR>
|
||||
<TD VALIGN="top">
|
||||
<BR>
|
||||
<DIV CLASS="nav">
|
||||
<BR>
|
||||
<A HREF="index.html">Home</A><BR>
|
||||
<A HREF="license.html">License</A><BR>
|
||||
<A HREF="history.html">History</A><BR>
|
||||
<A HREF="download.html">Download</A><BR>
|
||||
<A HREF="quality.html">Quality</A><BR>
|
||||
<A HREF="api.html">API</A><BR>
|
||||
<A HREF="bugs.html">Bug Reporting</A><BR>
|
||||
<A HREF="win32.html">On Win32</A><BR>
|
||||
<A HREF="faq.html">FAQ</A><BR>
|
||||
<A HREF="lists.html">Mailing Lists</A><BR>
|
||||
<A HREF="ChangeLog">ChangeLog</A><BR>
|
||||
<BR>
|
||||
<DIV CLASS="block">
|
||||
Author :<BR>Erik de Castro Lopo
|
||||
<!-- pepper -->
|
||||
<BR><BR>
|
||||
<!-- pepper -->
|
||||
|
||||
</DIV>
|
||||
<IMG SRC=
|
||||
"/cgi-bin/Count.cgi?ft=6|frgb=55;55;55|tr=0|md=6|dd=B|st=1|sh=1|df=src_dl.dat"
|
||||
HEIGHT=30 WIDTH=100 ALT="counter.gif">
|
||||
</DIV>
|
||||
|
||||
</TD>
|
||||
<!-- pepper -->
|
||||
<!-- ######################################################################## -->
|
||||
<!-- pepper -->
|
||||
<TD VALIGN="top">
|
||||
<DIV CLASS="block">
|
||||
|
||||
<H1><B>Download</B></H1>
|
||||
<P>
|
||||
This is the latest version of Secret Rabbit Code.
|
||||
</P>
|
||||
<UL>
|
||||
<LI>Source code as a .tar.gz :
|
||||
<A HREF="libsamplerate-0.1.8.tar.gz">libsamplerate-0.1.8.tar.gz</A>
|
||||
and
|
||||
<A HREF="libsamplerate-0.1.8.tar.gz.asc">(GPG signature)</A>
|
||||
|
||||
</UL>
|
||||
<P>
|
||||
Compiling libsamplerate is relatively easy. The INSTALL file in the top
|
||||
level directory gives instructions on compiling and installing
|
||||
libsamplerate on Unix-like systems (including MacOSX). For Win32 there
|
||||
are instructions in the doc/ directory of the tarball.
|
||||
These instructions are mirrored
|
||||
<A HREF="win32.html">here</A>.
|
||||
</P>
|
||||
|
||||
<!-- pepper -->
|
||||
<!-- <A HREF="mailto:aldel0305@mega-nerd.com">For the spam bots</A> -->
|
||||
<!-- pepper -->
|
||||
|
||||
</DIV>
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
|
@ -1,361 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
Secret Rabbit Code (aka libsamplerate)
|
||||
</TITLE>
|
||||
<META NAME="Author" CONTENT="Erik de Castro Lopo (erikd AT mega-nerd DOT com)">
|
||||
<META NAME="Version" CONTENT="libsamplerate-0.1.8">
|
||||
<META NAME="Description" CONTENT="The Secret Rabbit Code Home Page">
|
||||
<META NAME="Keywords" CONTENT="libsamplerate sound resample audio dsp Linux">
|
||||
<LINK REL=StyleSheet HREF="SRC.css" TYPE="text/css" MEDIA="all">
|
||||
</HEAD>
|
||||
|
||||
<BODY TEXT="#FFFFFF" BGCOLOR="#000000" LINK="#FB1465" VLINK="#FB1465" ALINK="#FB1465">
|
||||
<!-- pepper -->
|
||||
<CENTER>
|
||||
<IMG SRC="SRC.png" HEIGHT=100 WIDTH=760 ALT="SRC.png">
|
||||
</CENTER>
|
||||
<!-- pepper -->
|
||||
<BR>
|
||||
<!-- pepper -->
|
||||
<TABLE ALIGN="center" WIDTH="98%">
|
||||
<TR>
|
||||
<TD VALIGN="top">
|
||||
<BR>
|
||||
<DIV CLASS="nav">
|
||||
<BR>
|
||||
<A HREF="index.html">Home</A><BR>
|
||||
<A HREF="license.html">License</A><BR>
|
||||
<A HREF="history.html">History</A><BR>
|
||||
<A HREF="download.html">Download</A><BR>
|
||||
<A HREF="quality.html">Quality</A><BR>
|
||||
<A HREF="api.html">API</A><BR>
|
||||
<A HREF="bugs.html">Bug Reporting</A><BR>
|
||||
<A HREF="win32.html">On Win32</A><BR>
|
||||
<A HREF="faq.html">FAQ</A><BR>
|
||||
<A HREF="lists.html">Mailing Lists</A><BR>
|
||||
<A HREF="ChangeLog">ChangeLog</A><BR>
|
||||
<BR>
|
||||
<DIV CLASS="block">
|
||||
Author :<BR>Erik de Castro Lopo
|
||||
<!-- pepper -->
|
||||
<BR><BR>
|
||||
<!-- pepper -->
|
||||
|
||||
</DIV>
|
||||
<IMG SRC=
|
||||
"/cgi-bin/Count.cgi?ft=6|frgb=55;55;55|tr=0|md=6|dd=B|st=1|sh=1|df=src_api.dat"
|
||||
HEIGHT=30 WIDTH=100 ALT="counter.gif">
|
||||
</DIV>
|
||||
|
||||
</TD>
|
||||
<!-- pepper -->
|
||||
<!-- ######################################################################## -->
|
||||
<!-- pepper -->
|
||||
<TD VALIGN="top">
|
||||
<DIV CLASS="block">
|
||||
|
||||
<H1><B>Frequently Asked Questions</B></H1>
|
||||
<P>
|
||||
<A HREF="#Q001">Q1 : Is it normal for the output of libsamplerate to be louder
|
||||
than its input?</A><BR><BR>
|
||||
<A HREF="#Q002">Q2 : On Unix/Linux/MacOSX, what is the best way of detecting
|
||||
the presence and location of libsamplerate and its header file using
|
||||
autoconf?</A><BR><BR>
|
||||
<A HREF="#Q003">Q3 : If I upsample and downsample to the original rate, for
|
||||
example 44.1->96->44.1, do I get an identical signal as the one before the
|
||||
up/down resampling?</A><BR><BR>
|
||||
<A HREF="#Q004">Q4 : If I ran src_simple (libsamplerate) on small chunks (160
|
||||
frames) would that sound bad?</A><BR><BR>
|
||||
<A HREF="#Q005">Q5 : I'm using libsamplerate but the high quality settings
|
||||
sound worse than the SRC_LINEAR converter. Why?</A><BR><BR>
|
||||
<A HREF="#Q006">Q6 : I'm use the SRC_SINC_* converters and up-sampling by a ratio of
|
||||
2. I reset the converter and put in 1000 samples and I expect to get 2000
|
||||
samples out, but I'm getting less than that. Why?</A><BR><BR>
|
||||
<A HREF="#Q007">Q7 : I have input and output sample rates that are integer
|
||||
values, but the API wants me to divide one by the other and put the result
|
||||
in a floating point number. Won't this case problems for long running
|
||||
conversions?</A><BR><BR>
|
||||
</P>
|
||||
<HR>
|
||||
<!-- ========================================================================= -->
|
||||
<A NAME="Q001"></A>
|
||||
<H2><BR><B>Q1 : Is it normal for the output of libsamplerate to be louder
|
||||
than its input?</B></H2>
|
||||
<P>
|
||||
The output of libsamplerate will be roughly the same volume as the input.
|
||||
However, even if the input is strictly in the range (-1.0, 1.0), it is still
|
||||
possible for the output to contain peak values outside this range.
|
||||
</P>
|
||||
<P>
|
||||
Consider four consecutive samples of [0.5 0.999 0.999 0.5].
|
||||
If we are up sampling by a factor of two we need to insert samples between
|
||||
each of the existing samples.
|
||||
Its pretty obvious then, that the sample between the two 0.999 values should
|
||||
and will be bigger than 0.999.
|
||||
</P>
|
||||
<P>
|
||||
This means that anyone using libsamplerate should normalize its output before
|
||||
doing things like saving the audio to a 16 bit WAV file.
|
||||
</P>
|
||||
|
||||
<!-- pepper -->
|
||||
<!-- ========================================================================= -->
|
||||
|
||||
<a NAME="Q002"></a>
|
||||
<h2><br><b>Q2 : On Unix/Linux/MacOSX, what is the best way of detecting
|
||||
the presence and location of libsamplerate and its header file using
|
||||
autoconf?</b></h2>
|
||||
|
||||
<p>
|
||||
libsamplerate uses the pkg-config (man pkg-config) method of registering itself
|
||||
with the host system.
|
||||
The best way of detecting its presence is using something like this in configure.ac
|
||||
(or configure.in):
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.1.3,
|
||||
ac_cv_samplerate=1, ac_cv_samplerate=0)
|
||||
|
||||
AC_DEFINE_UNQUOTED([HAVE_SAMPLERATE],${ac_cv_samplerate},
|
||||
[Set to 1 if you have libsamplerate.])
|
||||
|
||||
AC_SUBST(SAMPLERATE_CFLAGS)
|
||||
AC_SUBST(SAMPLERATE_LIBS)
|
||||
</pre>
|
||||
<p>
|
||||
This will automatically set the <b>SAMPLERATE_CFLAGS</b> and <b>SAMPLERATE_LIBS</b>
|
||||
variables which can be used in Makefile.am or Makefile.in like this:
|
||||
</p>
|
||||
<pre>
|
||||
SAMPLERATE_CFLAGS = @SAMPLERATE_CFLAGS@
|
||||
SAMPLERATE_LIBS = @SAMPLERATE_LIBS@
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
If you install libsamplerate from source, you will probably need to set the
|
||||
<b>PKG_CONFIG_PATH</b> environment variable's suggested at the end of the
|
||||
libsamplerate configure process. For instance on my system I get this:
|
||||
</p>
|
||||
<pre>
|
||||
-=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=-=-
|
||||
|
||||
Configuration summary :
|
||||
|
||||
Version : ..................... 0.1.3
|
||||
Enable debugging : ............ no
|
||||
|
||||
Tools :
|
||||
|
||||
Compiler is GCC : ............. yes
|
||||
GCC major version : ........... 3
|
||||
|
||||
Extra tools required for testing and examples :
|
||||
|
||||
Have FFTW : ................... yes
|
||||
Have libsndfile : ............. yes
|
||||
Have libefence : .............. no
|
||||
|
||||
Installation directories :
|
||||
|
||||
Library directory : ........... /usr/local/lib
|
||||
Program directory : ........... /usr/local/bin
|
||||
Pkgconfig directory : ......... /usr/local/lib/pkgconfig
|
||||
</pre>
|
||||
|
||||
|
||||
<!-- pepper -->
|
||||
<!-- ========================================================================= -->
|
||||
<A NAME="Q003"></A>
|
||||
<H2><BR><B>Q3 : If I upsample and downsample to the original rate, for
|
||||
example 44.1->96->44.1, do I get an identical signal as the one before the
|
||||
up/down resampling?</B></H2>
|
||||
<P>
|
||||
The short answer is that for the general case, no, you don't.
|
||||
The long answer is that for some signals, with some converters, you will
|
||||
get very, very close.
|
||||
</P>
|
||||
<P>
|
||||
In order to resample correctly (ie using the <B>SRC_SINC_*</B> converters),
|
||||
filtering needs to be applied, regardless of whether its upsampling or
|
||||
downsampling.
|
||||
This filter needs to attenuate all frequencies above 0.5 times the minimum of
|
||||
the source and destination sample rate (call this fshmin).
|
||||
Since the filter needed to achieve full attenuation at this point, it has to
|
||||
start rolling off a some frequency below this point.
|
||||
It is this rolloff of the very highest frequencies which causes some of the
|
||||
loss.
|
||||
</P>
|
||||
<P>
|
||||
The other factor is that the filter itself can introduce transient artifacts
|
||||
which causes the output to be different to the input.
|
||||
</P>
|
||||
|
||||
<!-- pepper -->
|
||||
<!-- ========================================================================= -->
|
||||
<A NAME="Q004"></A>
|
||||
<H2><BR><B>Q4 : If I ran src_simple on small chunks (say 160 frames) would that
|
||||
sound bad?</B></H2>
|
||||
<P>
|
||||
Well if you are after odd sound effects, it might sound OK.
|
||||
If you are after high quality sample rate conversion you will be disappointed.
|
||||
</P>
|
||||
<P>
|
||||
The src_simple() was designed to provide a simple to use interface for people
|
||||
who wanted to do sample rate conversion on say, a whole file all at once.
|
||||
</P>
|
||||
|
||||
<!-- pepper -->
|
||||
<!-- ========================================================================= -->
|
||||
<A NAME="Q005"></A>
|
||||
<H2><BR><B>Q5 : I'm using libsamplerate but the high quality settings
|
||||
sound worse than the SRC_LINEAR converter. Why?</B></H2>
|
||||
<P>
|
||||
There are two possible problems.
|
||||
Firstly, if you are using the src_simple() function on successive blocks
|
||||
of a stream of samples, you will get bad results. The src_simple() function
|
||||
is designed for use on a whole sound file, all at once, not on contiguous
|
||||
segments of the same sound file.
|
||||
To fix the problem, you need to move to the src_process() API or the callback
|
||||
based API.
|
||||
</P>
|
||||
<P>
|
||||
If you are already using the src_process() API or the callback based API and
|
||||
the high quality settings sound worse than SRC_LINEAR, then you have other
|
||||
problems.
|
||||
Read on for more debugging hints.
|
||||
</P>
|
||||
<P>
|
||||
All of the higher quality converters need to keep state while doing conversions
|
||||
on segments of a large chunk of audio.
|
||||
This state information is kept inside the private data pointed to by the
|
||||
SRC_STATE pointer returned by the src_new() function.
|
||||
This means, that when you want to start doing sample rate conversion on a
|
||||
stream of data, you should call src_new() to get a new SRC_STATE pointer
|
||||
(or alternatively, call src_reset() on an existing SRC_STATE pointer).
|
||||
You should then pass this SRC_STATE pointer to the src_process() function
|
||||
with each new block of audio data.
|
||||
When you have completed the conversion, you can then call src_delete() on
|
||||
the SRC_STATE pointer.
|
||||
</P>
|
||||
<P>
|
||||
If you are doing all of the above correctly, you need to examine your usage
|
||||
of the values passed to src_process() in the
|
||||
<A HREF="api_misc.html#SRC_DATA">SRC_DATA</A>
|
||||
struct.
|
||||
Specifically:
|
||||
</P>
|
||||
<UL>
|
||||
<LI> Check that input_frames and output_frames fields are being set in
|
||||
terms of frames (number of sample values times channels) instead
|
||||
of just the number of samples.
|
||||
<LI> Check that you are using the return values input_frames_used and
|
||||
output_frames_gen to update your source and destination pointers
|
||||
correctly.
|
||||
<LI> Check that you are updating the data_in and data_out pointers
|
||||
correctly for each successive call.
|
||||
</UL>
|
||||
<P>
|
||||
While doing the above, it is probably useful to compare what you are doing to
|
||||
what is done in the example programs in the examples/ directory of the source
|
||||
code tarball.
|
||||
</P>
|
||||
<P>
|
||||
If you have done all of the above and are still having problems then its
|
||||
probably time to email the author with the smallest chunk of code that
|
||||
adequately demonstrates your problem.
|
||||
This chunk should not need to be any more than 100 lines of code.
|
||||
</P>
|
||||
|
||||
<!-- pepper -->
|
||||
<!-- ========================================================================= -->
|
||||
<A NAME="Q006"></A>
|
||||
<H2><BR><B>Q6 : I'm use the SRC_SINC_* converters and up-sampling by a ratio of
|
||||
2. I reset the converter and put in 1000 samples and I expect to get 2000
|
||||
samples out, but I'm getting less than that. Why?</B></H2>
|
||||
<P>
|
||||
The short answer is that there is a transport delay inside the converter itself.
|
||||
Long answer follows.
|
||||
</P>
|
||||
<P>
|
||||
By way of example, the first time you call src_process() you might only get 1900
|
||||
samples out.
|
||||
However, after that first call all subsequent calls will probably get you about
|
||||
2000 samples out for every 1000 samples you put in.
|
||||
</P>
|
||||
<P>
|
||||
The main problems people have with this transport delay is that they need to read
|
||||
out an exact number of samples and the transport delay scews this up.
|
||||
The best way to overcome this problem is to always supply more samples on the
|
||||
input than is actually needed to create the required number of output samples.
|
||||
With reference to the example above, if you always supply 1500 samples at the
|
||||
input, you will always get 2000 samples at the output.
|
||||
You will always need to keep track of the number of input frames used on each
|
||||
call to src_process() and deal with these values appropriately.
|
||||
</P>
|
||||
|
||||
<!-- pepper -->
|
||||
<!-- ========================================================================= -->
|
||||
<A NAME="Q007"></A>
|
||||
<H2><BR><B>Q7 : I have input and output sample rates that are integer
|
||||
values, but the API wants me to divide one by the other and put the result
|
||||
in a floating point number. Won't this case problems for long running
|
||||
conversions?</B></H2>
|
||||
<P>
|
||||
The short answer is no, the precision of the ratio is many orders of magnitude
|
||||
more than is really needed.
|
||||
</P>
|
||||
<P>
|
||||
For the long answer, lets do come calculations.
|
||||
Firstly, the <tt>src_ratio</tt> field is double precision floating point number
|
||||
which has
|
||||
<a href="http://en.wikipedia.org/wiki/Double_precision">
|
||||
53 bits of precision</a>.
|
||||
</P>
|
||||
<P>
|
||||
That means that the maximum error in your ratio converted to a double is one
|
||||
bit in 2^53 which means the the double float value would be wrong by one sample
|
||||
after 9007199254740992 samples have passed or wrong by more than half a sample
|
||||
wrong after half that many (4503599627370496 samples) have passed.
|
||||
</P>
|
||||
<P>
|
||||
Now if for example our output sample rate is 96kHz then
|
||||
</P>
|
||||
<pre>
|
||||
4503599627370496 samples at 96kHz is 46912496118 seconds
|
||||
46912496118 seconds is 781874935 minutes
|
||||
781874935 minutes is 13031248 hours
|
||||
13031248 hours is 542968 days
|
||||
542968 days is 1486 years
|
||||
</pre>
|
||||
<P>
|
||||
So, after 1486 years, the input will be wrong by more than half of one sampling
|
||||
period.
|
||||
</P>
|
||||
<p>
|
||||
All this assumes that the crystal oscillators uses to sample the audio stream
|
||||
is perfect.
|
||||
This is not the case.
|
||||
According to
|
||||
<a href="http://www.ieee-uffc.org/freqcontrol/quartz/vig/vigcomp.htm">
|
||||
this web site</a>,
|
||||
the accuracy of standard crystal oscillators (XO, TCXO, OCXO) is at best
|
||||
1 in 100 million.
|
||||
The <tt>src_ratio</tt> is therefore 45035996 times more accurate than the
|
||||
crystal clock source used to sample the original audio signal and any potential
|
||||
problem with the <tt>src_ratio</tt> being a floating point number will be
|
||||
completely swamped by sampling inaccuracies.
|
||||
</p>
|
||||
|
||||
<!-- <A HREF="mailto:aldel@mega-nerd.com">For the spam bots</A> -->
|
||||
|
||||
</DIV>
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
|
@ -1,101 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
Secret Rabbit Code (aka libsamplerate)
|
||||
</TITLE>
|
||||
<META NAME="Author" CONTENT="Erik de Castro Lopo (erikd AT mega-nerd DOT com)">
|
||||
<META NAME="Version" CONTENT="libsamplerate-0.1.8">
|
||||
<META NAME="Description" CONTENT="The Secret Rabbit Code Home Page">
|
||||
<META NAME="Keywords" CONTENT="libsamplerate sound resample audio dsp Linux">
|
||||
<LINK REL=StyleSheet HREF="SRC.css" TYPE="text/css" MEDIA="all">
|
||||
</HEAD>
|
||||
|
||||
<BODY TEXT="#FFFFFF" BGCOLOR="#000000" LINK="#FB1465" VLINK="#FB1465" ALINK="#FB1465">
|
||||
<!-- pepper -->
|
||||
<CENTER>
|
||||
<IMG SRC="SRC.png" HEIGHT=100 WIDTH=760 ALT="SRC.png">
|
||||
</CENTER>
|
||||
<!-- pepper -->
|
||||
<BR>
|
||||
<!-- pepper -->
|
||||
<TABLE ALIGN="center" WIDTH="98%">
|
||||
<TR>
|
||||
<TD VALIGN="top">
|
||||
<BR>
|
||||
<DIV CLASS="nav">
|
||||
<BR>
|
||||
<A HREF="index.html">Home</A><BR>
|
||||
<A HREF="license.html">License</A><BR>
|
||||
<A HREF="history.html">History</A><BR>
|
||||
<A HREF="download.html">Download</A><BR>
|
||||
<A HREF="quality.html">Quality</A><BR>
|
||||
<A HREF="api.html">API</A><BR>
|
||||
<A HREF="bugs.html">Bug Reporting</A><BR>
|
||||
<A HREF="win32.html">On Win32</A><BR>
|
||||
<A HREF="faq.html">FAQ</A><BR>
|
||||
<A HREF="lists.html">Mailing Lists</A><BR>
|
||||
<A HREF="ChangeLog">ChangeLog</A><BR>
|
||||
<BR>
|
||||
<DIV CLASS="block">
|
||||
Author :<BR>Erik de Castro Lopo
|
||||
<!-- pepper -->
|
||||
<BR><BR>
|
||||
<!-- pepper -->
|
||||
|
||||
</DIV>
|
||||
<IMG SRC=
|
||||
"/cgi-bin/Count.cgi?ft=6|frgb=55;55;55|tr=0|md=6|dd=B|st=1|sh=1|df=src.dat"
|
||||
HEIGHT=30 WIDTH=100 ALT="counter.gif">
|
||||
</DIV>
|
||||
|
||||
</TD>
|
||||
<!-- pepper -->
|
||||
<!-- ######################################################################## -->
|
||||
<!-- pepper -->
|
||||
<TD VALIGN="top">
|
||||
<DIV CLASS="block">
|
||||
|
||||
<H1><B>History</B></H1>
|
||||
<UL>
|
||||
<LI>Version 0.0.0 (Oct 06 2002) First alpha release (friends and family only).
|
||||
<LI>Version 0.0.2 (Oct 10 2002) Second alpha release (fools rush in ....).
|
||||
<LI>...
|
||||
<LI>Version 0.0.7 (Nov 17 2002) The last mono only version.
|
||||
<LI>Version 0.0.9 (Nov 21 2002) Full multi channel support. First pass at
|
||||
documentation. Still not ready for release.
|
||||
<LI>Version 0.0.11 (Nov 26 2002) Incorporated some suggestions from Conrad
|
||||
Parker.
|
||||
<LI>Version 0.0.12 (Nov 28 2002) First public release.
|
||||
<LI>Version 0.0.13 (Dec 03 2002) Fixes for MacOSX and Solaris.
|
||||
<LI>Version 0.0.14 (Jan 13 2003) Now compiles on Win32. Major code speedup.
|
||||
Minor bug fixes.
|
||||
<LI>Version 0.0.15 (May 02 2003) Minor bug fixes.
|
||||
<LI>Version 0.1.0 (Mar 14 2004) Add callback API, functions for short to
|
||||
float and float to short conversion. Minor bug fixes.
|
||||
<LI>Version 0.1.1 (Jul 17 2004) Callback API bug fix. Bugfix for aggressive
|
||||
gcc-3.4 optimisations.
|
||||
<LI>Version 0.1.2 (Sep 12 2004) Callback API reset bug fix.
|
||||
<LI>Version 0.1.3 (Mar 23 2008) Huge quality improvements to two best SINC
|
||||
based converters.
|
||||
<LI>Version 0.1.4 (Jul 02 2008) Fix segfault when using extremely low
|
||||
conversion ratios.
|
||||
<LI>Version 0.1.5 (Jan 11 2009) Optimisation resulting in dramatic throughput
|
||||
improvements
|
||||
(<a href="http://www.mega-nerd.com/erikd/Blog/CodeHacking/SecretRabbitCode/rel_0_1_5.html">
|
||||
See here.</a>).
|
||||
<LI>Version 0.1.6 (Jan 27 2009) Minor bug fix in test suite (account for
|
||||
rounding error on x86_64).
|
||||
<LI>Version 0.1.7 (Feb 14 2009) Fix a segfault bug. Fix compilation under
|
||||
MSVC.
|
||||
<LI>Version 0.1.8 (Aug 15 2011) Minor bug fixes and updates.
|
||||
</UL>
|
||||
|
||||
</DIV>
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
|
@ -1,130 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
Secret Rabbit Code (aka libsamplerate)
|
||||
</TITLE>
|
||||
<META NAME="Author" CONTENT="Erik de Castro Lopo (erikd AT mega-nerd DOT com)">
|
||||
<META NAME="Version" CONTENT="libsamplerate-0.1.8">
|
||||
<META NAME="Description" CONTENT="The Secret Rabbit Code Home Page">
|
||||
<META NAME="Keywords" CONTENT="libsamplerate sound resample audio dsp Linux">
|
||||
<LINK REL=StyleSheet HREF="SRC.css" TYPE="text/css" MEDIA="all">
|
||||
</HEAD>
|
||||
|
||||
<BODY TEXT="#FFFFFF" BGCOLOR="#000000" LINK="#FB1465" VLINK="#FB1465" ALINK="#FB1465">
|
||||
<!-- pepper -->
|
||||
<CENTER>
|
||||
<IMG SRC="SRC.png" HEIGHT=100 WIDTH=760 ALT="SRC.png">
|
||||
</CENTER>
|
||||
<!-- pepper -->
|
||||
<BR>
|
||||
<!-- pepper -->
|
||||
<TABLE ALIGN="center" WIDTH="98%">
|
||||
<TR>
|
||||
<TD VALIGN="top">
|
||||
<BR>
|
||||
<DIV CLASS="nav">
|
||||
<BR>
|
||||
<A HREF="index.html">Home</A><BR>
|
||||
<A HREF="license.html">License</A><BR>
|
||||
<A HREF="history.html">History</A><BR>
|
||||
<A HREF="download.html">Download</A><BR>
|
||||
<A HREF="quality.html">Quality</A><BR>
|
||||
<A HREF="api.html">API</A><BR>
|
||||
<A HREF="bugs.html">Bug Reporting</A><BR>
|
||||
<A HREF="win32.html">On Win32</A><BR>
|
||||
<A HREF="faq.html">FAQ</A><BR>
|
||||
<A HREF="lists.html">Mailing Lists</A><BR>
|
||||
<A HREF="ChangeLog">ChangeLog</A><BR>
|
||||
<A HREF="fb2k.html">Foobar 2k</A><BR>
|
||||
<BR>
|
||||
<DIV CLASS="block">
|
||||
Author :<BR>Erik de Castro Lopo
|
||||
<!-- pepper -->
|
||||
<BR><BR>
|
||||
<!-- pepper -->
|
||||
|
||||
</DIV>
|
||||
<IMG SRC=
|
||||
"/cgi-bin/Count.cgi?ft=6|frgb=55;55;55|tr=0|md=6|dd=B|st=1|sh=1|df=src.dat"
|
||||
HEIGHT=30 WIDTH=100 ALT="counter.gif">
|
||||
</DIV>
|
||||
|
||||
</TD>
|
||||
<!-- pepper -->
|
||||
<!-- ######################################################################## -->
|
||||
<!-- pepper -->
|
||||
<TD VALIGN="top">
|
||||
<DIV CLASS="block">
|
||||
<BR>
|
||||
|
||||
<TABLE ALIGN="center" WIDTH="80%">
|
||||
<TR><TD>
|
||||
<P>
|
||||
<I>
|
||||
"Choosing a sample rate coverter wasn't easy. We ran numerous tests with
|
||||
Secret Rabbit Code and other sample rate converters, then compared them all.
|
||||
In the end, SRC outperformed the others, including some extremely well known
|
||||
and popular software. We had one issue with SRC, but after emailing Erik, he
|
||||
got back to us immediately with an answer. Choosing SRC was a no brainer."
|
||||
</I><BR>
|
||||
Ryan Smith, International Marketing Manager, <BR>
|
||||
<A HREF="http://emersys.co.kr/">Emersys Corp.</A>, South Korea.<BR>
|
||||
Product : <A HREF="http://maven3d.com">Maven3D</A>
|
||||
|
||||
</P>
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
<P>
|
||||
<B>S</B>ecret <B>R</B>abbit <B>C</B>ode (aka libsamplerate) is a
|
||||
<B>S</B>ample <B>R</B>ate <B>C</B>onverter for audio.
|
||||
One example of where such a thing would be useful is converting audio
|
||||
from the CD sample rate of 44.1kHz to the 48kHz sample rate used by
|
||||
DAT players.
|
||||
</P>
|
||||
<!-- pepper -->
|
||||
<P>
|
||||
<B>SRC</B> is capable of arbitrary and time varying conversions ; from
|
||||
downsampling by a factor of 256 to upsampling by the same factor.
|
||||
Arbitrary in this case means that the ratio of input and output
|
||||
sample rates can be an irrational number.
|
||||
The conversion ratio can also vary with time for speeding up and slowing
|
||||
down effects.
|
||||
</P>
|
||||
<!-- pepper -->
|
||||
<P>
|
||||
<B>SRC</B> provides a small set of converters to allow quality to
|
||||
be traded off against computation cost.
|
||||
The current best converter provides a signal-to-noise ratio of 145dB
|
||||
with -3dB passband extending from DC to 96% of the theoretical
|
||||
best bandwidth for a given pair of input and output sample rates.
|
||||
</P>
|
||||
<!-- pepper -->
|
||||
<P>
|
||||
Since the library has few dependencies beyond that provided by the
|
||||
standard C library, it should compile and work on just about any
|
||||
operating system.
|
||||
It is known to work on Linux, MacOSX,
|
||||
<A HREF="win32.html">Win32</A>
|
||||
and Solaris.
|
||||
With some relatively minor hacking it should also be relatively easy
|
||||
to port it to embedded systems and digital signal processors.
|
||||
</P>
|
||||
<!-- pepper -->
|
||||
<P>
|
||||
In addition, the library comes with a comprehensive test suite which
|
||||
can validate the performance of the library on new platforms.
|
||||
</P>
|
||||
|
||||
<!-- pepper -->
|
||||
<!-- <A HREF="mailto:aldel0305@mega-nerd.com">For the spam bots</A> -->
|
||||
<!-- pepper -->
|
||||
|
||||
</DIV>
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
|
@ -1,124 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
Secret Rabbit Code (aka libsamplerate)
|
||||
</TITLE>
|
||||
<META NAME="Author" CONTENT="Erik de Castro Lopo (erikd AT mega-nerd DOT com)">
|
||||
<META NAME="Version" CONTENT="libsamplerate-0.1.8">
|
||||
<META NAME="Description" CONTENT="The Secret Rabbit Code Home Page">
|
||||
<META NAME="Keywords" CONTENT="libsamplerate sound resample audio dsp Linux">
|
||||
<LINK REL=StyleSheet HREF="SRC.css" TYPE="text/css" MEDIA="all">
|
||||
</HEAD>
|
||||
|
||||
<BODY TEXT="#FFFFFF" BGCOLOR="#000000" LINK="#FB1465" VLINK="#FB1465" ALINK="#FB1465">
|
||||
<!-- pepper -->
|
||||
<CENTER>
|
||||
<IMG SRC="SRC.png" HEIGHT=100 WIDTH=760 ALT="SRC.png">
|
||||
</CENTER>
|
||||
<!-- pepper -->
|
||||
<BR>
|
||||
<!-- pepper -->
|
||||
<TABLE ALIGN="center" WIDTH="98%">
|
||||
<TR>
|
||||
<TD VALIGN="top">
|
||||
<BR>
|
||||
<DIV CLASS="nav">
|
||||
<BR>
|
||||
<A HREF="index.html">Home</A><BR>
|
||||
<A HREF="license.html">License</A><BR>
|
||||
<A HREF="history.html">History</A><BR>
|
||||
<A HREF="download.html">Download</A><BR>
|
||||
<A HREF="quality.html">Quality</A><BR>
|
||||
<A HREF="api.html">API</A><BR>
|
||||
<A HREF="bugs.html">Bug Reporting</A><BR>
|
||||
<A HREF="win32.html">On Win32</A><BR>
|
||||
<A HREF="faq.html">FAQ</A><BR>
|
||||
<A HREF="lists.html">Mailing Lists</A><BR>
|
||||
<A HREF="ChangeLog">ChangeLog</A><BR>
|
||||
<BR>
|
||||
<DIV CLASS="block">
|
||||
Author :<BR>Erik de Castro Lopo
|
||||
<!-- pepper -->
|
||||
<BR><BR>
|
||||
<!-- pepper -->
|
||||
|
||||
</DIV>
|
||||
<IMG SRC=
|
||||
"/cgi-bin/Count.cgi?ft=6|frgb=55;55;55|tr=0|md=6|dd=B|st=1|sh=1|df=src_lic.dat"
|
||||
HEIGHT=30 WIDTH=100 ALT="counter.gif">
|
||||
</DIV>
|
||||
|
||||
</TD>
|
||||
<!-- pepper -->
|
||||
<!-- ######################################################################## -->
|
||||
<!-- pepper -->
|
||||
<TD VALIGN="top">
|
||||
<DIV CLASS="block">
|
||||
|
||||
<H1><B>License</B></H1>
|
||||
<!-- pepper -->
|
||||
<P>
|
||||
Secret Rabbit Code is released under a dual licensing scheme.
|
||||
Users can choose which of these two licenses they wish to operate
|
||||
under :
|
||||
</P>
|
||||
<!-- pepper -->
|
||||
<UL>
|
||||
<LI> The standard
|
||||
<A HREF="http://www.gnu.org/copyleft/gpl.html">
|
||||
GNU General Public License
|
||||
</A>
|
||||
(GPL) as written and published by the Free Software Foundation.
|
||||
<LI> The very generous
|
||||
<A HREF="http://www.mega-nerd.com/SRC/libsamplerate-cul.pdf">
|
||||
libsamplerate Commercial Use License
|
||||
</A>
|
||||
that can be purchased for a one off payment of $1000 (one
|
||||
thousand) Australian dollars.
|
||||
</UL>
|
||||
<!-- pepper -->
|
||||
<P>
|
||||
Any person or organisation wishing to distribute (either privately or
|
||||
publicly) software which uses Secret Rabbit Code must either abide by
|
||||
the GPL or purchase a commercial use license.
|
||||
</P>
|
||||
<!-- pepper -->
|
||||
<P>
|
||||
The commercial use license allows licensees to use libsamplerate as a
|
||||
statically linked library in proprietary, shareware or other closed
|
||||
source applications.
|
||||
The licensee may use libsamplerate in as many separate products as
|
||||
they choose and sell as many copies of each as they can without paying
|
||||
any further licensing fees for libsamplerate.
|
||||
</P>
|
||||
<!-- pepper -->
|
||||
<P>
|
||||
2005-08-09 : There is a certain amount of
|
||||
<A HREF="http://www.wordiq.com/definition/GNU_General_Public_License#GPL-related_disputes">
|
||||
debate</A>
|
||||
about whether non-GPL software can dynamically link to GPL libraries.
|
||||
I side with the FSF and assert that an executable dynamically linked
|
||||
to libsamplerate is a derivative work of libsamplerate and is
|
||||
therefore subject to the GNU GPL.
|
||||
</P>
|
||||
<!-- pepper -->
|
||||
<P>
|
||||
For more information, please see the
|
||||
<A HREF="http://www.mega-nerd.com/SRC/procedure.html">
|
||||
commercial use licensing procedure
|
||||
</A>.
|
||||
</P>
|
||||
|
||||
<!-- pepper -->
|
||||
<!-- <A HREF="mailto:aldel0305@mega-nerd.com">For the spam bots</A> -->
|
||||
<!-- pepper -->
|
||||
|
||||
</DIV>
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
Secret Rabbit Code (aka libsamplerate)
|
||||
</TITLE>
|
||||
<META NAME="Author" CONTENT="Erik de Castro Lopo (erikd AT mega-nerd DOT com)">
|
||||
<META NAME="Version" CONTENT="libsamplerate-0.1.8">
|
||||
<META NAME="Description" CONTENT="The Secret Rabbit Code Home Page">
|
||||
<META NAME="Keywords" CONTENT="libsamplerate sound resample audio dsp Linux">
|
||||
<LINK REL=StyleSheet HREF="SRC.css" TYPE="text/css" MEDIA="all">
|
||||
</HEAD>
|
||||
|
||||
<BODY TEXT="#FFFFFF" BGCOLOR="#000000" LINK="#FB1465" VLINK="#FB1465" ALINK="#FB1465">
|
||||
<!-- pepper -->
|
||||
<CENTER>
|
||||
<IMG SRC="SRC.png" HEIGHT=100 WIDTH=760 ALT="SRC.png">
|
||||
</CENTER>
|
||||
<!-- pepper -->
|
||||
<BR>
|
||||
<!-- pepper -->
|
||||
<TABLE ALIGN="center" WIDTH="98%">
|
||||
<TR>
|
||||
<TD VALIGN="top">
|
||||
<BR>
|
||||
<DIV CLASS="nav">
|
||||
<BR>
|
||||
<A HREF="index.html">Home</A><BR>
|
||||
<A HREF="license.html">License</A><BR>
|
||||
<A HREF="history.html">History</A><BR>
|
||||
<A HREF="download.html">Download</A><BR>
|
||||
<A HREF="quality.html">Quality</A><BR>
|
||||
<A HREF="api.html">API</A><BR>
|
||||
<A HREF="bugs.html">Bug Reporting</A><BR>
|
||||
<A HREF="win32.html">On Win32</A><BR>
|
||||
<A HREF="faq.html">FAQ</A><BR>
|
||||
<A HREF="lists.html">Mailing Lists</A><BR>
|
||||
<A HREF="ChangeLog">ChangeLog</A><BR>
|
||||
<BR>
|
||||
<DIV CLASS="block">
|
||||
Author :<BR>Erik de Castro Lopo
|
||||
<!-- pepper -->
|
||||
<BR><BR>
|
||||
<!-- pepper -->
|
||||
|
||||
</DIV>
|
||||
<IMG SRC=
|
||||
"/cgi-bin/Count.cgi?ft=6|frgb=55;55;55|tr=0|md=6|dd=B|st=1|sh=1|df=src_lists.dat"
|
||||
HEIGHT=30 WIDTH=100 ALT="counter.gif">
|
||||
</DIV>
|
||||
|
||||
</TD>
|
||||
<!-- pepper -->
|
||||
<!-- ######################################################################## -->
|
||||
<!-- pepper -->
|
||||
<TD VALIGN="top">
|
||||
<DIV CLASS="block">
|
||||
|
||||
<H1><B>Mailing Lists</B></H1>
|
||||
<P>
|
||||
There are currently two mailings lists for Secret Rabbit Code:<!-- pepper -->
|
||||
</P>
|
||||
<!-- pepper -->
|
||||
<UL>
|
||||
<LI><B>src-announce@mega-nerd.com</B> <!-- pepper -->
|
||||
|
||||
<A HREF="mailto:src-announce-request@mega-nerd.com?subject=subscribe">Subscribe</A>
|
||||
<BR>
|
||||
A read only announcement list.<!-- pepper -->
|
||||
<BR><BR>
|
||||
<LI><B>src@mega-nerd.com</B> <!-- pepper -->
|
||||
<A HREF="mailto:src-request@mega-nerd.com?subject=subscribe">Subscribe</A>
|
||||
<BR>
|
||||
A general list which will also carry all the email from the announce list.
|
||||
Posting to this list is restricted to subscribers. <!-- pepper -->
|
||||
</UL>
|
||||
<!-- pepper -->
|
||||
<P>
|
||||
|
||||
</DIV>
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
<!-- pepper -->
|
||||
<!-- pepper -->
|
||||
<!-- pepper -->
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
|
@ -1,179 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
Secret Rabbit Code (aka libsamplerate)
|
||||
</TITLE>
|
||||
<META NAME="Author" CONTENT="Erik de Castro Lopo (erikd AT mega-nerd DOT com)">
|
||||
<META NAME="Version" CONTENT="libsamplerate-0.1.8">
|
||||
<META NAME="Description" CONTENT="The Secret Rabbit Code Home Page">
|
||||
<META NAME="Keywords" CONTENT="libsamplerate sound resample audio dsp Linux">
|
||||
<LINK REL=StyleSheet HREF="SRC.css" TYPE="text/css" MEDIA="all">
|
||||
</HEAD>
|
||||
|
||||
<BODY TEXT="#FFFFFF" BGCOLOR="#000000" LINK="#FB1465" VLINK="#FB1465" ALINK="#FB1465">
|
||||
<!-- pepper -->
|
||||
<CENTER>
|
||||
<IMG SRC="SRC.png" HEIGHT=100 WIDTH=760 ALT="SRC.png">
|
||||
</CENTER>
|
||||
<!-- pepper -->
|
||||
<BR>
|
||||
<!-- pepper -->
|
||||
<TABLE ALIGN="center" WIDTH="98%">
|
||||
<TR>
|
||||
<TD VALIGN="top">
|
||||
<BR>
|
||||
<DIV CLASS="nav">
|
||||
<BR>
|
||||
<A HREF="index.html">Home</A><BR>
|
||||
<A HREF="license.html">License</A><BR>
|
||||
<A HREF="history.html">History</A><BR>
|
||||
<A HREF="download.html">Download</A><BR>
|
||||
<A HREF="quality.html">Quality</A><BR>
|
||||
<A HREF="api.html">API</A><BR>
|
||||
<A HREF="bugs.html">Bug Reporting</A><BR>
|
||||
<A HREF="win32.html">On Win32</A><BR>
|
||||
<A HREF="faq.html">FAQ</A><BR>
|
||||
<A HREF="lists.html">Mailing Lists</A><BR>
|
||||
<A HREF="ChangeLog">ChangeLog</A><BR>
|
||||
<BR>
|
||||
<DIV CLASS="block">
|
||||
Author :<BR>Erik de Castro Lopo
|
||||
<!-- pepper -->
|
||||
<BR><BR>
|
||||
<!-- pepper -->
|
||||
|
||||
</DIV>
|
||||
<IMG SRC=
|
||||
"/cgi-bin/Count.cgi?ft=6|frgb=55;55;55|tr=0|md=6|dd=B|st=1|sh=1|df=src_qual.dat"
|
||||
HEIGHT=30 WIDTH=100 ALT="counter.gif">
|
||||
</DIV>
|
||||
|
||||
</TD>
|
||||
<!-- pepper -->
|
||||
<!-- ######################################################################## -->
|
||||
<!-- pepper -->
|
||||
<TD VALIGN="top">
|
||||
<DIV CLASS="block">
|
||||
|
||||
<H1><B>SRC Quality</B></H1>
|
||||
<CENTER><P>
|
||||
<B>This document not yet complete.</B><BR>
|
||||
</P></CENTER>
|
||||
<P>
|
||||
When measuring the performance of a Sample Rate Converter, there are three
|
||||
factors to consider:
|
||||
</P>
|
||||
<UL>
|
||||
<LI><B>Signal-to-Noise Ratio</B> - a measure of how much noise the sample
|
||||
rate conversion process adds to the signal.
|
||||
This is measured in decibels (dB) and the higher this value the
|
||||
better.
|
||||
For most sample rate converters, the SNR will vary depending on
|
||||
the input signal and the ratio between input and output sample
|
||||
rates.
|
||||
The only valid comparison of SNR is between the worst case for
|
||||
for each converter.
|
||||
<LI><B>Bandwidth</B> - most sample rate converters attenuate high
|
||||
frequencies as part of their operation.
|
||||
Bandwidth can be measured by finding the frequency where the
|
||||
attenuation is 3dB and expressing that as a percentage of the full
|
||||
bandwidth at that sampling rate.
|
||||
<LI><B>Speed</B> - the faster the better <B>:-)</B>.
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
There are a number of sample rate converters available for downloading
|
||||
but I will limit the comparison ot Secret Rabbit Code to the following:
|
||||
</P>
|
||||
<UL>
|
||||
<LI><A HREF="http://www.mega-nerd.com/SRC/download.html">sndfile-resample</A>
|
||||
which is a program (which uses libsamplerate) from the <B>examples/</B>
|
||||
directory of the Secret Rabbit Code source code distribution.
|
||||
<LI><A HREF="http://www-ccrma.stanford.edu/~jos/resample/Available_Software.html">
|
||||
Resample</A>
|
||||
by Julius O Smiths which seems to have been the first high quality converter
|
||||
available as source code.
|
||||
<LI><A HREF="http://www.tsp.ece.mcgill.ca/MMSP/Documents/Software/AFsp/ResampAudio.html">ResampAudio</A>
|
||||
which is part of
|
||||
<A HREF="http://www.tsp.ece.mcgill.ca/MMSP/Documents/Software/AFsp/AFsp.html">
|
||||
Audio File Programs and Routines</A>
|
||||
by Peter Kabal.
|
||||
<LI><A HREF="http://home.sprynet.com/~cbagwell/sox.html">SoX</A> which is maintained
|
||||
by Chris Bagwell.
|
||||
SoX is also able to perform some low quality sample rate conversions but these
|
||||
will not be investigated.
|
||||
<LI><A HREF="http://shibatch.sourceforge.net/">Shibatch</A> which seems to be a
|
||||
frequency domain sample rate converter.
|
||||
Unfortunately, this converter does not handle arbitrary conversion ratios and
|
||||
hence could not be properly compared to the other converters.
|
||||
<LI><A HREF="http://sr-convert.sourceforge.net/">sr-convert</A> is another
|
||||
converter which does not handle arbitrary conversion ratios.
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
It should be noted that the first three converters above are based on the algorithm
|
||||
by <A HREF="http://www-ccrma.stanford.edu/~jos/resample/"> Julius O. Smith</A>
|
||||
which emulates the conversion of the digital signal to an analogue one and then
|
||||
sampling the analogue signal at the new sample rate.
|
||||
</P>
|
||||
|
||||
<!--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
|
||||
|
||||
<H3><B>Methodology</B></H3>
|
||||
<P>
|
||||
Measuring the SNR of a converter is relatively straight forward.
|
||||
Generate an input signal consisting of a windowed sine wave, sample rate
|
||||
convert it and measure the signal-to-noise ratio of the output signal.
|
||||
A typical length for the original file is 30000 samples.
|
||||
</P>
|
||||
<P>
|
||||
The bandwidth of a sample rate converter is a little more difficult to measure.
|
||||
Currently this is done by generating two short files containing a windowed
|
||||
sine wave.
|
||||
The frequencies of the sine waves are 0.35 and 0.495 of the sample rate.
|
||||
These file are then upsampled by a factor of 2 using the converter under test.
|
||||
If the attenutaion of the lower frquency is less than 3dB and higher frequency is
|
||||
more than 3dB, it is then possible to iteratively increase the lower frequency
|
||||
and decrease the upper frequency keeping the -3dB point bracketed.
|
||||
When the distance between the upper and lower frequency is sufficiently small,
|
||||
it is possible to obtain a very accurate estimate of the -3dB frequency.
|
||||
</P>
|
||||
<P>
|
||||
The speed of a sample rate converter is easy to measure; simply perform a
|
||||
conversion on a large file or a number of smaller files and time the conversion
|
||||
process.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
The above measurement techniques are built into a test program which is delivered
|
||||
with the Secret Rabbit Code source code distibution.
|
||||
This program is able to test the first four of the above converters.
|
||||
</P>
|
||||
<!--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
|
||||
|
||||
<H3><B>SoX</B></H3>
|
||||
<P>
|
||||
SoX provides three methods of resampling; a linear interpolator, a polyphase
|
||||
resampler and the Julius O. Smith simulated analogue filter method.
|
||||
</P>
|
||||
|
||||
<H3><B>Shibatch</B></H3>
|
||||
<P>
|
||||
Shibach
|
||||
</P>
|
||||
|
||||
<P>
|
||||
<B>More Coming Soon.</B>
|
||||
</P>
|
||||
|
||||
<!-- <A HREF="mailto:aldel@mega-nerd.com">For the spam bots</A> -->
|
||||
|
||||
</DIV>
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
|
@ -1,156 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
|
||||
<HEAD>
|
||||
<TITLE>
|
||||
Secret Rabbit Code (aka libsamplerate)
|
||||
</TITLE>
|
||||
<META NAME="Author" CONTENT="Erik de Castro Lopo (erikd AT mega-nerd DOT com)">
|
||||
<META NAME="Version" CONTENT="libsamplerate-0.1.8">
|
||||
<META NAME="Description" CONTENT="The Secret Rabbit Code Home Page">
|
||||
<META NAME="Keywords" CONTENT="libsamplerate sound resample audio dsp Linux">
|
||||
<LINK REL=StyleSheet HREF="SRC.css" TYPE="text/css" MEDIA="all">
|
||||
</HEAD>
|
||||
|
||||
<BODY TEXT="#FFFFFF" BGCOLOR="#000000" LINK="#FB1465" VLINK="#FB1465" ALINK="#FB1465">
|
||||
<!-- pepper -->
|
||||
<CENTER>
|
||||
<IMG SRC="SRC.png" HEIGHT=100 WIDTH=760 ALT="SRC.png">
|
||||
</CENTER>
|
||||
<!-- pepper -->
|
||||
<BR>
|
||||
<!-- pepper -->
|
||||
<TABLE ALIGN="center" WIDTH="98%">
|
||||
<TR>
|
||||
<TD VALIGN="top">
|
||||
<BR>
|
||||
<DIV CLASS="nav">
|
||||
<BR>
|
||||
<A HREF="index.html">Home</A><BR>
|
||||
<A HREF="license.html">License</A><BR>
|
||||
<A HREF="history.html">History</A><BR>
|
||||
<A HREF="download.html">Download</A><BR>
|
||||
<A HREF="quality.html">Quality</A><BR>
|
||||
<A HREF="api.html">API</A><BR>
|
||||
<A HREF="bugs.html">Bug Reporting</A><BR>
|
||||
<A HREF="win32.html">On Win32</A><BR>
|
||||
<A HREF="faq.html">FAQ</A><BR>
|
||||
<A HREF="lists.html">Mailing Lists</A><BR>
|
||||
<A HREF="ChangeLog">ChangeLog</A><BR>
|
||||
<BR>
|
||||
<DIV CLASS="block">
|
||||
Author :<BR>Erik de Castro Lopo
|
||||
<!-- pepper -->
|
||||
<BR><BR>
|
||||
<!-- pepper -->
|
||||
|
||||
</DIV>
|
||||
<IMG SRC=
|
||||
"/cgi-bin/Count.cgi?ft=6|frgb=55;55;55|tr=0|md=6|dd=B|st=1|sh=1|df=src_win32.dat"
|
||||
HEIGHT=30 WIDTH=100 ALT="counter.gif">
|
||||
</DIV>
|
||||
|
||||
</TD>
|
||||
<!-- pepper -->
|
||||
<!-- ######################################################################## -->
|
||||
<!-- pepper -->
|
||||
<TD VALIGN="top">
|
||||
<DIV CLASS="block">
|
||||
|
||||
<H1><B>Compiling on Win32.</B></H1>
|
||||
<P>
|
||||
For Win32 there is a Microsoft Visual C++ compatible makefile in the <B>Win32\</B>
|
||||
directory and a MSDOS batch file in the top level directory of the distribution.
|
||||
</P>
|
||||
<P>
|
||||
To build the examples programs you will need to download the precompiled
|
||||
win32 or win64
|
||||
<A HREF="http://www.mega-nerd.com/libsndfile/#Download">libsndfile</A>
|
||||
binary and install them.
|
||||
|
||||
</P>
|
||||
<P>
|
||||
Making the libsamplerate DLL on Win32 involves the following:
|
||||
</P>
|
||||
<OL>
|
||||
<LI> Using WinZip in the GUI, open the libsamplerate-0.X.Y.tar.gz file and
|
||||
extract the files into a directory. The following example assumes
|
||||
<B>C:\</B>.
|
||||
<LI> In the directory containing the extracted files, find the file
|
||||
<B>Win32\Makefile.msvc</B> and open it in a text editor (ie Notepad or
|
||||
similar).
|
||||
<LI> Find the line which starts with <B>MSVCDir</B> and modify the directory
|
||||
path to point to the location of MSVC++ on your machine. This allows the
|
||||
makefile to inform the compiler of the location of the standard header
|
||||
files.
|
||||
<LI> Copy <B>libsndfile-1.dll</B>, <B>libsndfile-1.lib</B> and
|
||||
<B>libsndfile-1.def</B> from the directory libsndfile was installed in
|
||||
to the the directory containing libsamplerate.
|
||||
<LI> Copy the header file <B>include/sndfile.h</B> from where libsndfile was
|
||||
installed to the <B>Win32</B> directory under the libsamplerate
|
||||
directory.
|
||||
<LI> Open a Command Shell and cd into the libsamplerate-0.X.Y directory.
|
||||
<LI> Make sure that the program <B>nmake</B> (which is part of the MSCV++
|
||||
package) is in a directory which is part of your <B>PATH</B> variable.
|
||||
<LI> Type in the command
|
||||
<PRE> C:\libsamplerate-0.X.Y> make
|
||||
</PRE>
|
||||
and press <return>. You should now see a a large number of compile
|
||||
commands as libsamplerate.dll is built.
|
||||
<LI> To check that the built DLL has been compiled correctly type in and run the
|
||||
command
|
||||
<PRE> C:\libsamplerate-0.X.Y> make check
|
||||
</PRE>
|
||||
which will compile a set of test programs and run them.
|
||||
If any of the programs fail the error message will be help in debugging
|
||||
the problem.
|
||||
(Note that some of the tests require libsndfile or libfftw/librfftw and
|
||||
are not able to run on Win32).
|
||||
</OL>
|
||||
<P>
|
||||
At the end of the above procedure, you will find the DLL, <B>libsamplerate.dll</B>, a
|
||||
LIB file <B>libsamplerate.lib</B> in the current directory. These two files, along
|
||||
with the header file <B>samplerate.h</B> (in the <B>src\</B> directory) are all that
|
||||
you need to copy to your project in order to use libsamplerate.
|
||||
</P>
|
||||
|
||||
<H2><BR>Compile Problems</H2>
|
||||
<P>
|
||||
If you run into compile problems using the above procedure, you should
|
||||
<A HREF="lists.html"> join the main mailing list </A>
|
||||
and post your problem and/or questions there.
|
||||
Please include any error messages generated during step 6 above.
|
||||
</P>
|
||||
|
||||
<P>
|
||||
If you are using some other method to compile the libsamplerate DLL you are
|
||||
probably on your own.
|
||||
</P>
|
||||
<BR>
|
||||
|
||||
<!--
|
||||
|
||||
From here:
|
||||
|
||||
http://www.gimp.org/~tml/gimp/win32/downloads.html
|
||||
|
||||
Download these files:
|
||||
|
||||
gettext-runtime-0.13.1.zip
|
||||
glib-2.4.5-20040903.zip
|
||||
libiconv-1.9.1.bin.woe32.zip
|
||||
pkgconfig-0.15.zip
|
||||
|
||||
and install them.
|
||||
|
||||
-->
|
||||
|
||||
<!-- <A HREF="mailto:aldel@mega-nerd.com">For the spam bots</A> -->
|
||||
|
||||
</DIV>
|
||||
</TD></TR>
|
||||
</TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
# This file was automatically generated
|
||||
# DO NOT EDIT!
|
||||
|
||||
bin_PROGRAMS = sndfile-resample
|
||||
|
||||
noinst_PROGRAMS = varispeed-play timewarp-file
|
||||
|
||||
SAMPLERATEDIR =../src
|
||||
INCLUDES = -I$(srcdir)/$(SAMPLERATEDIR) @OS_SPECIFIC_INCLUDES@
|
||||
|
||||
OS_SPECIFIC_LINKS = @OS_SPECIFIC_LINKS@
|
||||
|
||||
SNDFILE_LIBS = @SNDFILE_LIBS@
|
||||
AM_CFLAGS = @SNDFILE_CFLAGS@
|
||||
|
||||
#===============================================================================
|
||||
|
||||
sndfile_resample_SOURCES = sndfile-resample.c
|
||||
sndfile_resample_LDADD = $(SAMPLERATEDIR)/libsamplerate.la $(SNDFILE_LIBS)
|
||||
|
||||
varispeed_play_SOURCES = varispeed-play.c audio_out.c audio_out.h
|
||||
varispeed_play_LDADD = $(SAMPLERATEDIR)/libsamplerate.la $(SNDFILE_LIBS) $(OS_SPECIFIC_LINKS)
|
||||
|
||||
timewarp_file_SOURCES = timewarp-file.c
|
||||
timewarp_file_LDADD = $(SAMPLERATEDIR)/libsamplerate.la $(SNDFILE_LIBS)
|
||||
|
|
@ -1,605 +0,0 @@
|
|||
# Makefile.in generated by automake 1.11.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
# This file was automatically generated
|
||||
# DO NOT EDIT!
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
bin_PROGRAMS = sndfile-resample$(EXEEXT)
|
||||
noinst_PROGRAMS = varispeed-play$(EXEEXT) timewarp-file$(EXEEXT)
|
||||
subdir = examples
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/M4/check_signal.m4 \
|
||||
$(top_srcdir)/M4/clip_mode.m4 $(top_srcdir)/M4/endian.m4 \
|
||||
$(top_srcdir)/M4/libtool.m4 $(top_srcdir)/M4/lrint.m4 \
|
||||
$(top_srcdir)/M4/lrintf.m4 $(top_srcdir)/M4/ltoptions.m4 \
|
||||
$(top_srcdir)/M4/ltsugar.m4 $(top_srcdir)/M4/ltversion.m4 \
|
||||
$(top_srcdir)/M4/lt~obsolete.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/src/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
am__installdirs = "$(DESTDIR)$(bindir)"
|
||||
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
|
||||
am_sndfile_resample_OBJECTS = sndfile-resample.$(OBJEXT)
|
||||
sndfile_resample_OBJECTS = $(am_sndfile_resample_OBJECTS)
|
||||
am__DEPENDENCIES_1 =
|
||||
sndfile_resample_DEPENDENCIES = $(SAMPLERATEDIR)/libsamplerate.la \
|
||||
$(am__DEPENDENCIES_1)
|
||||
AM_V_lt = $(am__v_lt_$(V))
|
||||
am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_lt_0 = --silent
|
||||
am_timewarp_file_OBJECTS = timewarp-file.$(OBJEXT)
|
||||
timewarp_file_OBJECTS = $(am_timewarp_file_OBJECTS)
|
||||
timewarp_file_DEPENDENCIES = $(SAMPLERATEDIR)/libsamplerate.la \
|
||||
$(am__DEPENDENCIES_1)
|
||||
am_varispeed_play_OBJECTS = varispeed-play.$(OBJEXT) \
|
||||
audio_out.$(OBJEXT)
|
||||
varispeed_play_OBJECTS = $(am_varispeed_play_OBJECTS)
|
||||
varispeed_play_DEPENDENCIES = $(SAMPLERATEDIR)/libsamplerate.la \
|
||||
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src
|
||||
depcomp = $(SHELL) $(top_srcdir)/Cfg/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
AM_V_CC = $(am__v_CC_$(V))
|
||||
am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_CC_0 = @echo " CC " $@;
|
||||
AM_V_at = $(am__v_at_$(V))
|
||||
am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_at_0 = @
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_CCLD = $(am__v_CCLD_$(V))
|
||||
am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
||||
AM_V_GEN = $(am__v_GEN_$(V))
|
||||
am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
SOURCES = $(sndfile_resample_SOURCES) $(timewarp_file_SOURCES) \
|
||||
$(varispeed_play_SOURCES)
|
||||
DIST_SOURCES = $(sndfile_resample_SOURCES) $(timewarp_file_SOURCES) \
|
||||
$(varispeed_play_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPILER_IS_GCC = @COMPILER_IS_GCC@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DLLWRAP = @DLLWRAP@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FFTW3_CFLAGS = @FFTW3_CFLAGS@
|
||||
FFTW3_LIBS = @FFTW3_LIBS@
|
||||
FGREP = @FGREP@
|
||||
GCC_MAJOR_VERSION = @GCC_MAJOR_VERSION@
|
||||
GREP = @GREP@
|
||||
HAVE_FFTW3 = @HAVE_FFTW3@
|
||||
HAVE_SNDFILE = @HAVE_SNDFILE@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OS_SPECIFIC_INCLUDES = @OS_SPECIFIC_INCLUDES@
|
||||
OS_SPECIFIC_LINKS = @OS_SPECIFIC_LINKS@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PEXPORTS = @PEXPORTS@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
RANLIB = @RANLIB@
|
||||
RC = @RC@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHARED_VERSION_INFO = @SHARED_VERSION_INFO@
|
||||
SHELL = @SHELL@
|
||||
SHLIB_VERSION_ARG = @SHLIB_VERSION_ARG@
|
||||
SNDFILE_CFLAGS = @SNDFILE_CFLAGS@
|
||||
SNDFILE_LIBS = @SNDFILE_LIBS@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
htmldocdir = @htmldocdir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
SAMPLERATEDIR = ../src
|
||||
INCLUDES = -I$(srcdir)/$(SAMPLERATEDIR) @OS_SPECIFIC_INCLUDES@
|
||||
AM_CFLAGS = @SNDFILE_CFLAGS@
|
||||
|
||||
#===============================================================================
|
||||
sndfile_resample_SOURCES = sndfile-resample.c
|
||||
sndfile_resample_LDADD = $(SAMPLERATEDIR)/libsamplerate.la $(SNDFILE_LIBS)
|
||||
varispeed_play_SOURCES = varispeed-play.c audio_out.c audio_out.h
|
||||
varispeed_play_LDADD = $(SAMPLERATEDIR)/libsamplerate.la $(SNDFILE_LIBS) $(OS_SPECIFIC_LINKS)
|
||||
timewarp_file_SOURCES = timewarp-file.c
|
||||
timewarp_file_LDADD = $(SAMPLERATEDIR)/libsamplerate.la $(SNDFILE_LIBS)
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu examples/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
|
||||
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed 's/$(EXEEXT)$$//' | \
|
||||
while read p p1; do if test -f $$p || test -f $$p1; \
|
||||
then echo "$$p"; echo "$$p"; else :; fi; \
|
||||
done | \
|
||||
sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
|
||||
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
|
||||
sed 'N;N;N;s,\n, ,g' | \
|
||||
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
|
||||
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
|
||||
if ($$2 == $$4) files[d] = files[d] " " $$1; \
|
||||
else { print "f", $$3 "/" $$4, $$1; } } \
|
||||
END { for (d in files) print "f", d, files[d] }' | \
|
||||
while read type dir files; do \
|
||||
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
|
||||
test -z "$$files" || { \
|
||||
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
|
||||
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
|
||||
} \
|
||||
; done
|
||||
|
||||
uninstall-binPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
|
||||
files=`for p in $$list; do echo "$$p"; done | \
|
||||
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
|
||||
-e 's/$$/$(EXEEXT)/' `; \
|
||||
test -n "$$list" || exit 0; \
|
||||
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(bindir)" && rm -f $$files
|
||||
|
||||
clean-binPROGRAMS:
|
||||
@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list || exit $$?; \
|
||||
test -n "$(EXEEXT)" || exit 0; \
|
||||
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list
|
||||
|
||||
clean-noinstPROGRAMS:
|
||||
@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list || exit $$?; \
|
||||
test -n "$(EXEEXT)" || exit 0; \
|
||||
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list
|
||||
sndfile-resample$(EXEEXT): $(sndfile_resample_OBJECTS) $(sndfile_resample_DEPENDENCIES)
|
||||
@rm -f sndfile-resample$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(sndfile_resample_OBJECTS) $(sndfile_resample_LDADD) $(LIBS)
|
||||
timewarp-file$(EXEEXT): $(timewarp_file_OBJECTS) $(timewarp_file_DEPENDENCIES)
|
||||
@rm -f timewarp-file$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(timewarp_file_OBJECTS) $(timewarp_file_LDADD) $(LIBS)
|
||||
varispeed-play$(EXEEXT): $(varispeed_play_OBJECTS) $(varispeed_play_DEPENDENCIES)
|
||||
@rm -f varispeed-play$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(varispeed_play_OBJECTS) $(varispeed_play_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio_out.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sndfile-resample.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timewarp-file.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/varispeed-play.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(PROGRAMS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(bindir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-binPROGRAMS clean-generic clean-libtool \
|
||||
clean-noinstPROGRAMS mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am: install-binPROGRAMS
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-binPROGRAMS
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
|
||||
clean-generic clean-libtool clean-noinstPROGRAMS ctags \
|
||||
distclean distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-binPROGRAMS \
|
||||
install-data install-data-am install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-info install-info-am install-man install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags uninstall uninstall-am uninstall-binPROGRAMS
|
||||
|
||||
|
||||
# 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:
|
|
@ -1,820 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 1999-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "audio_out.h"
|
||||
|
||||
#if (HAVE_SNDFILE)
|
||||
|
||||
#include <float_cast.h>
|
||||
|
||||
#include <sndfile.h>
|
||||
|
||||
#define BUFFER_LEN (2048)
|
||||
|
||||
#define MAKE_MAGIC(a,b,c,d,e,f,g,h) \
|
||||
((a) + ((b) << 1) + ((c) << 2) + ((d) << 3) + ((e) << 4) + ((f) << 5) + ((g) << 6) + ((h) << 7))
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
** Linux/OSS functions for playing a sound.
|
||||
*/
|
||||
|
||||
#if defined (__linux__)
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/soundcard.h>
|
||||
|
||||
#define LINUX_MAGIC MAKE_MAGIC ('L', 'i', 'n', 'u', 'x', 'O', 'S', 'S')
|
||||
|
||||
typedef struct
|
||||
{ int magic ;
|
||||
int fd ;
|
||||
int channels ;
|
||||
} LINUX_AUDIO_OUT ;
|
||||
|
||||
static AUDIO_OUT *linux_open (int channels, int samplerate) ;
|
||||
static void linux_play (get_audio_callback_t callback, AUDIO_OUT *audio_out, void *callback_data) ;
|
||||
static void linux_close (AUDIO_OUT *audio_out) ;
|
||||
|
||||
|
||||
static AUDIO_OUT *
|
||||
linux_open (int channels, int samplerate)
|
||||
{ LINUX_AUDIO_OUT *linux_out ;
|
||||
int stereo, fmt, error ;
|
||||
|
||||
if ((linux_out = malloc (sizeof (LINUX_AUDIO_OUT))) == NULL)
|
||||
{ perror ("linux_open : malloc ") ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
linux_out->magic = LINUX_MAGIC ;
|
||||
linux_out->channels = channels ;
|
||||
|
||||
if ((linux_out->fd = open ("/dev/dsp", O_WRONLY, 0)) == -1)
|
||||
{ perror ("linux_open : open ") ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
stereo = 0 ;
|
||||
if (ioctl (linux_out->fd, SNDCTL_DSP_STEREO, &stereo) == -1)
|
||||
{ /* Fatal error */
|
||||
perror ("linux_open : stereo ") ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (ioctl (linux_out->fd, SNDCTL_DSP_RESET, 0))
|
||||
{ perror ("linux_open : reset ") ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
fmt = CPU_IS_BIG_ENDIAN ? AFMT_S16_BE : AFMT_S16_LE ;
|
||||
if (ioctl (linux_out->fd, SNDCTL_DSP_SETFMT, &fmt) != 0)
|
||||
{ perror ("linux_open_dsp_device : set format ") ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if ((error = ioctl (linux_out->fd, SNDCTL_DSP_CHANNELS, &channels)) != 0)
|
||||
{ perror ("linux_open : channels ") ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if ((error = ioctl (linux_out->fd, SNDCTL_DSP_SPEED, &samplerate)) != 0)
|
||||
{ perror ("linux_open : sample rate ") ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if ((error = ioctl (linux_out->fd, SNDCTL_DSP_SYNC, 0)) != 0)
|
||||
{ perror ("linux_open : sync ") ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
return (AUDIO_OUT*) linux_out ;
|
||||
} /* linux_open */
|
||||
|
||||
static void
|
||||
linux_play (get_audio_callback_t callback, AUDIO_OUT *audio_out, void *callback_data)
|
||||
{ LINUX_AUDIO_OUT *linux_out ;
|
||||
static float float_buffer [BUFFER_LEN] ;
|
||||
static short buffer [BUFFER_LEN] ;
|
||||
int k, readcount ;
|
||||
|
||||
if ((linux_out = (LINUX_AUDIO_OUT*) audio_out) == NULL)
|
||||
{ printf ("linux_play : AUDIO_OUT is NULL.\n") ;
|
||||
return ;
|
||||
} ;
|
||||
|
||||
if (linux_out->magic != LINUX_MAGIC)
|
||||
{ printf ("linux_play : Bad magic number.\n") ;
|
||||
return ;
|
||||
} ;
|
||||
|
||||
while ((readcount = callback (callback_data, float_buffer, BUFFER_LEN / linux_out->channels)))
|
||||
{ for (k = 0 ; k < readcount * linux_out->channels ; k++)
|
||||
buffer [k] = lrint (32767.0 * float_buffer [k]) ;
|
||||
(void) write (linux_out->fd, buffer, readcount * linux_out->channels * sizeof (short)) ;
|
||||
} ;
|
||||
|
||||
return ;
|
||||
} /* linux_play */
|
||||
|
||||
static void
|
||||
linux_close (AUDIO_OUT *audio_out)
|
||||
{ LINUX_AUDIO_OUT *linux_out ;
|
||||
|
||||
if ((linux_out = (LINUX_AUDIO_OUT*) audio_out) == NULL)
|
||||
{ printf ("linux_close : AUDIO_OUT is NULL.\n") ;
|
||||
return ;
|
||||
} ;
|
||||
|
||||
if (linux_out->magic != LINUX_MAGIC)
|
||||
{ printf ("linux_close : Bad magic number.\n") ;
|
||||
return ;
|
||||
} ;
|
||||
|
||||
memset (linux_out, 0, sizeof (LINUX_AUDIO_OUT)) ;
|
||||
|
||||
free (linux_out) ;
|
||||
|
||||
return ;
|
||||
} /* linux_close */
|
||||
|
||||
#endif /* __linux__ */
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
** Mac OS X functions for playing a sound.
|
||||
*/
|
||||
|
||||
#if (defined (__MACH__) && defined (__APPLE__)) /* MacOSX */
|
||||
|
||||
#include <Carbon.h>
|
||||
#include <CoreAudio/AudioHardware.h>
|
||||
|
||||
#define MACOSX_MAGIC MAKE_MAGIC ('M', 'a', 'c', ' ', 'O', 'S', ' ', 'X')
|
||||
|
||||
typedef struct
|
||||
{ int magic ;
|
||||
AudioStreamBasicDescription format ;
|
||||
|
||||
UInt32 buf_size ;
|
||||
AudioDeviceID device ;
|
||||
|
||||
int channels ;
|
||||
int samplerate ;
|
||||
int buffer_size ;
|
||||
int done_playing ;
|
||||
|
||||
get_audio_callback_t callback ;
|
||||
|
||||
void *callback_data ;
|
||||
} MACOSX_AUDIO_OUT ;
|
||||
|
||||
static AUDIO_OUT *macosx_open (int channels, int samplerate) ;
|
||||
static void macosx_play (get_audio_callback_t callback, AUDIO_OUT *audio_out, void *callback_data) ;
|
||||
static void macosx_close (AUDIO_OUT *audio_out) ;
|
||||
|
||||
static OSStatus
|
||||
macosx_audio_out_callback (AudioDeviceID device, const AudioTimeStamp* current_time,
|
||||
const AudioBufferList* data_in, const AudioTimeStamp* time_in,
|
||||
AudioBufferList* data_out, const AudioTimeStamp* time_out, void* client_data) ;
|
||||
|
||||
|
||||
static AUDIO_OUT *
|
||||
macosx_open (int channels, int samplerate)
|
||||
{ MACOSX_AUDIO_OUT *macosx_out ;
|
||||
OSStatus err ;
|
||||
size_t count ;
|
||||
|
||||
if ((macosx_out = malloc (sizeof (MACOSX_AUDIO_OUT))) == NULL)
|
||||
{ perror ("macosx_open : malloc ") ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
macosx_out->magic = MACOSX_MAGIC ;
|
||||
macosx_out->channels = channels ;
|
||||
macosx_out->samplerate = samplerate ;
|
||||
|
||||
macosx_out->device = kAudioDeviceUnknown ;
|
||||
|
||||
/* get the default output device for the HAL */
|
||||
count = sizeof (AudioDeviceID) ;
|
||||
if ((err = AudioHardwareGetProperty (kAudioHardwarePropertyDefaultOutputDevice,
|
||||
&count, (void *) &(macosx_out->device))) != noErr)
|
||||
{ printf ("AudioHardwareGetProperty failed.\n") ;
|
||||
free (macosx_out) ;
|
||||
return NULL ;
|
||||
} ;
|
||||
|
||||
/* get the buffersize that the default device uses for IO */
|
||||
count = sizeof (UInt32) ;
|
||||
if ((err = AudioDeviceGetProperty (macosx_out->device, 0, false, kAudioDevicePropertyBufferSize,
|
||||
&count, &(macosx_out->buffer_size))) != noErr)
|
||||
{ printf ("AudioDeviceGetProperty (AudioDeviceGetProperty) failed.\n") ;
|
||||
free (macosx_out) ;
|
||||
return NULL ;
|
||||
} ;
|
||||
|
||||
/* get a description of the data format used by the default device */
|
||||
count = sizeof (AudioStreamBasicDescription) ;
|
||||
if ((err = AudioDeviceGetProperty (macosx_out->device, 0, false, kAudioDevicePropertyStreamFormat,
|
||||
&count, &(macosx_out->format))) != noErr)
|
||||
{ printf ("AudioDeviceGetProperty (kAudioDevicePropertyStreamFormat) failed.\n") ;
|
||||
free (macosx_out) ;
|
||||
return NULL ;
|
||||
} ;
|
||||
|
||||
macosx_out->format.mSampleRate = samplerate ;
|
||||
macosx_out->format.mChannelsPerFrame = channels ;
|
||||
|
||||
if ((err = AudioDeviceSetProperty (macosx_out->device, NULL, 0, false, kAudioDevicePropertyStreamFormat,
|
||||
sizeof (AudioStreamBasicDescription), &(macosx_out->format))) != noErr)
|
||||
{ printf ("AudioDeviceSetProperty (kAudioDevicePropertyStreamFormat) failed.\n") ;
|
||||
free (macosx_out) ;
|
||||
return NULL ;
|
||||
} ;
|
||||
|
||||
/* we want linear pcm */
|
||||
if (macosx_out->format.mFormatID != kAudioFormatLinearPCM)
|
||||
{ free (macosx_out) ;
|
||||
return NULL ;
|
||||
} ;
|
||||
|
||||
macosx_out->done_playing = 0 ;
|
||||
|
||||
/* Fire off the device. */
|
||||
if ((err = AudioDeviceAddIOProc (macosx_out->device, macosx_audio_out_callback,
|
||||
(void *) macosx_out)) != noErr)
|
||||
{ printf ("AudioDeviceAddIOProc failed.\n") ;
|
||||
free (macosx_out) ;
|
||||
return NULL ;
|
||||
} ;
|
||||
|
||||
return (MACOSX_AUDIO_OUT *) macosx_out ;
|
||||
} /* macosx_open */
|
||||
|
||||
static void
|
||||
macosx_play (get_audio_callback_t callback, AUDIO_OUT *audio_out, void *callback_data)
|
||||
{ MACOSX_AUDIO_OUT *macosx_out ;
|
||||
OSStatus err ;
|
||||
|
||||
if ((macosx_out = (MACOSX_AUDIO_OUT*) audio_out) == NULL)
|
||||
{ printf ("macosx_play : AUDIO_OUT is NULL.\n") ;
|
||||
return ;
|
||||
} ;
|
||||
|
||||
if (macosx_out->magic != MACOSX_MAGIC)
|
||||
{ printf ("macosx_play : Bad magic number.\n") ;
|
||||
return ;
|
||||
} ;
|
||||
|
||||
/* Set the callback function and callback data. */
|
||||
macosx_out->callback = callback ;
|
||||
macosx_out->callback_data = callback_data ;
|
||||
|
||||
err = AudioDeviceStart (macosx_out->device, macosx_audio_out_callback) ;
|
||||
if (err != noErr)
|
||||
printf ("AudioDeviceStart failed.\n") ;
|
||||
|
||||
while (macosx_out->done_playing == SF_FALSE)
|
||||
usleep (10 * 1000) ; /* 10 000 milliseconds. */
|
||||
|
||||
return ;
|
||||
} /* macosx_play */
|
||||
|
||||
static void
|
||||
macosx_close (AUDIO_OUT *audio_out)
|
||||
{ MACOSX_AUDIO_OUT *macosx_out ;
|
||||
OSStatus err ;
|
||||
|
||||
if ((macosx_out = (MACOSX_AUDIO_OUT*) audio_out) == NULL)
|
||||
{ printf ("macosx_close : AUDIO_OUT is NULL.\n") ;
|
||||
return ;
|
||||
} ;
|
||||
|
||||
if (macosx_out->magic != MACOSX_MAGIC)
|
||||
{ printf ("macosx_close : Bad magic number.\n") ;
|
||||
return ;
|
||||
} ;
|
||||
|
||||
|
||||
if ((err = AudioDeviceStop (macosx_out->device, macosx_audio_out_callback)) != noErr)
|
||||
{ printf ("AudioDeviceStop failed.\n") ;
|
||||
return ;
|
||||
} ;
|
||||
|
||||
err = AudioDeviceRemoveIOProc (macosx_out->device, macosx_audio_out_callback) ;
|
||||
if (err != noErr)
|
||||
{ printf ("AudioDeviceRemoveIOProc failed.\n") ;
|
||||
return ;
|
||||
} ;
|
||||
|
||||
} /* macosx_close */
|
||||
|
||||
static OSStatus
|
||||
macosx_audio_out_callback (AudioDeviceID device, const AudioTimeStamp* current_time,
|
||||
const AudioBufferList* data_in, const AudioTimeStamp* time_in,
|
||||
AudioBufferList* data_out, const AudioTimeStamp* time_out, void* client_data)
|
||||
{ MACOSX_AUDIO_OUT *macosx_out ;
|
||||
int k, size, sample_count, read_count ;
|
||||
float *buffer ;
|
||||
|
||||
if ((macosx_out = (MACOSX_AUDIO_OUT*) client_data) == NULL)
|
||||
{ printf ("macosx_play : AUDIO_OUT is NULL.\n") ;
|
||||
return 42 ;
|
||||
} ;
|
||||
|
||||
if (macosx_out->magic != MACOSX_MAGIC)
|
||||
{ printf ("macosx_play : Bad magic number.\n") ;
|
||||
return 42 ;
|
||||
} ;
|
||||
|
||||
size = data_out->mBuffers [0].mDataByteSize ;
|
||||
sample_count = size / sizeof (float) / macosx_out->channels ;
|
||||
|
||||
buffer = (float*) data_out->mBuffers [0].mData ;
|
||||
|
||||
read_count = macosx_out->callback (macosx_out->callback_data, buffer, sample_count) ;
|
||||
|
||||
if (read_count < sample_count)
|
||||
{ memset (&(buffer [read_count]), 0, (sample_count - read_count) * sizeof (float)) ;
|
||||
macosx_out->done_playing = 1 ;
|
||||
} ;
|
||||
|
||||
return noErr ;
|
||||
} /* macosx_audio_out_callback */
|
||||
|
||||
#endif /* MacOSX */
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
** Win32 functions for playing a sound.
|
||||
**
|
||||
** This API sucks. Its needlessly complicated and is *WAY* too loose with
|
||||
** passing pointers arounf in integers and and using char* pointers to
|
||||
** point to data instead of short*. It plain sucks!
|
||||
*/
|
||||
|
||||
#if (defined (_WIN32) || defined (WIN32))
|
||||
|
||||
#include <windows.h>
|
||||
#include <mmsystem.h>
|
||||
|
||||
#define WIN32_BUFFER_LEN (1<<15)
|
||||
#define WIN32_MAGIC MAKE_MAGIC ('W', 'i', 'n', '3', '2', 's', 'u', 'x')
|
||||
|
||||
typedef struct
|
||||
{ int magic ;
|
||||
|
||||
HWAVEOUT hwave ;
|
||||
WAVEHDR whdr [2] ;
|
||||
|
||||
HANDLE Event ;
|
||||
|
||||
short short_buffer [WIN32_BUFFER_LEN / sizeof (short)] ;
|
||||
float float_buffer [WIN32_BUFFER_LEN / sizeof (short) / 2] ;
|
||||
|
||||
int bufferlen, current ;
|
||||
|
||||
int channels ;
|
||||
|
||||
get_audio_callback_t callback ;
|
||||
|
||||
void *callback_data ;
|
||||
} WIN32_AUDIO_OUT ;
|
||||
|
||||
static AUDIO_OUT *win32_open (int channels, int samplerate) ;
|
||||
static void win32_play (get_audio_callback_t callback, AUDIO_OUT *audio_out, void *callback_data) ;
|
||||
static void win32_close (AUDIO_OUT *audio_out) ;
|
||||
|
||||
static DWORD CALLBACK
|
||||
win32_audio_out_callback (HWAVEOUT hwave, UINT msg, DWORD data, DWORD param1, DWORD param2) ;
|
||||
|
||||
static AUDIO_OUT*
|
||||
win32_open (int channels, int samplerate)
|
||||
{ WIN32_AUDIO_OUT *win32_out ;
|
||||
|
||||
WAVEFORMATEX wf ;
|
||||
int error ;
|
||||
|
||||
if ((win32_out = malloc (sizeof (WIN32_AUDIO_OUT))) == NULL)
|
||||
{ perror ("win32_open : malloc ") ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
win32_out->magic = WIN32_MAGIC ;
|
||||
win32_out->channels = channels ;
|
||||
|
||||
win32_out->current = 0 ;
|
||||
|
||||
win32_out->Event = CreateEvent (0, FALSE, FALSE, 0) ;
|
||||
|
||||
wf.nChannels = channels ;
|
||||
wf.nSamplesPerSec = samplerate ;
|
||||
wf.nBlockAlign = channels * sizeof (short) ;
|
||||
|
||||
wf.wFormatTag = WAVE_FORMAT_PCM ;
|
||||
wf.cbSize = 0 ;
|
||||
wf.wBitsPerSample = 16 ;
|
||||
wf.nAvgBytesPerSec = wf.nBlockAlign * wf.nSamplesPerSec ;
|
||||
|
||||
error = waveOutOpen (&(win32_out->hwave), WAVE_MAPPER, &wf, (DWORD) win32_audio_out_callback,
|
||||
(DWORD) win32_out, CALLBACK_FUNCTION) ;
|
||||
if (error)
|
||||
{ puts ("waveOutOpen failed.") ;
|
||||
free (win32_out) ;
|
||||
return NULL ;
|
||||
} ;
|
||||
|
||||
waveOutPause (win32_out->hwave) ;
|
||||
|
||||
return (WIN32_AUDIO_OUT *) win32_out ;
|
||||
} /* win32_open */
|
||||
|
||||
static void
|
||||
win32_play (get_audio_callback_t callback, AUDIO_OUT *audio_out, void *callback_data)
|
||||
{ WIN32_AUDIO_OUT *win32_out ;
|
||||
int error ;
|
||||
|
||||
if ((win32_out = (WIN32_AUDIO_OUT*) audio_out) == NULL)
|
||||
{ printf ("win32_play : AUDIO_OUT is NULL.\n") ;
|
||||
return ;
|
||||
} ;
|
||||
|
||||
if (win32_out->magic != WIN32_MAGIC)
|
||||
{ printf ("win32_play : Bad magic number (%d %d).\n", win32_out->magic, WIN32_MAGIC) ;
|
||||
return ;
|
||||
} ;
|
||||
|
||||
/* Set the callback function and callback data. */
|
||||
win32_out->callback = callback ;
|
||||
win32_out->callback_data = callback_data ;
|
||||
|
||||
win32_out->whdr [0].lpData = (char*) win32_out->short_buffer ;
|
||||
win32_out->whdr [1].lpData = ((char*) win32_out->short_buffer) + sizeof (win32_out->short_buffer) / 2 ;
|
||||
|
||||
win32_out->whdr [0].dwBufferLength = sizeof (win32_out->short_buffer) / 2 ;
|
||||
win32_out->whdr [1].dwBufferLength = sizeof (win32_out->short_buffer) / 2 ;
|
||||
|
||||
win32_out->bufferlen = sizeof (win32_out->short_buffer) / 2 / sizeof (short) ;
|
||||
|
||||
/* Prepare the WAVEHDRs */
|
||||
if ((error = waveOutPrepareHeader (win32_out->hwave, &(win32_out->whdr [0]), sizeof (WAVEHDR))))
|
||||
{ printf ("waveOutPrepareHeader [0] failed : %08X\n", error) ;
|
||||
waveOutClose (win32_out->hwave) ;
|
||||
return ;
|
||||
} ;
|
||||
|
||||
if ((error = waveOutPrepareHeader (win32_out->hwave, &(win32_out->whdr [1]), sizeof (WAVEHDR))))
|
||||
{ printf ("waveOutPrepareHeader [1] failed : %08X\n", error) ;
|
||||
waveOutUnprepareHeader (win32_out->hwave, &(win32_out->whdr [0]), sizeof (WAVEHDR)) ;
|
||||
waveOutClose (win32_out->hwave) ;
|
||||
return ;
|
||||
} ;
|
||||
|
||||
waveOutRestart (win32_out->hwave) ;
|
||||
|
||||
/* Fake 2 calls to the callback function to queue up enough audio. */
|
||||
win32_audio_out_callback (0, MM_WOM_DONE, (DWORD) win32_out, 0, 0) ;
|
||||
win32_audio_out_callback (0, MM_WOM_DONE, (DWORD) win32_out, 0, 0) ;
|
||||
|
||||
/* Wait for playback to finish. The callback notifies us when all
|
||||
** wave data has been played.
|
||||
*/
|
||||
WaitForSingleObject (win32_out->Event, INFINITE) ;
|
||||
|
||||
waveOutPause (win32_out->hwave) ;
|
||||
waveOutReset (win32_out->hwave) ;
|
||||
|
||||
waveOutUnprepareHeader (win32_out->hwave, &(win32_out->whdr [0]), sizeof (WAVEHDR)) ;
|
||||
waveOutUnprepareHeader (win32_out->hwave, &(win32_out->whdr [1]), sizeof (WAVEHDR)) ;
|
||||
|
||||
waveOutClose (win32_out->hwave) ;
|
||||
win32_out->hwave = 0 ;
|
||||
|
||||
return ;
|
||||
} /* win32_play */
|
||||
|
||||
static void
|
||||
win32_close (AUDIO_OUT *audio_out)
|
||||
{ WIN32_AUDIO_OUT *win32_out ;
|
||||
|
||||
if ((win32_out = (WIN32_AUDIO_OUT*) audio_out) == NULL)
|
||||
{ printf ("win32_close : AUDIO_OUT is NULL.\n") ;
|
||||
return ;
|
||||
} ;
|
||||
|
||||
if (win32_out->magic != WIN32_MAGIC)
|
||||
{ printf ("win32_close : Bad magic number.\n") ;
|
||||
return ;
|
||||
} ;
|
||||
|
||||
memset (win32_out, 0, sizeof (WIN32_AUDIO_OUT)) ;
|
||||
|
||||
free (win32_out) ;
|
||||
} /* win32_close */
|
||||
|
||||
static DWORD CALLBACK
|
||||
win32_audio_out_callback (HWAVEOUT hwave, UINT msg, DWORD data, DWORD param1, DWORD param2)
|
||||
{ WIN32_AUDIO_OUT *win32_out ;
|
||||
int read_count, sample_count, k ;
|
||||
short *sptr ;
|
||||
|
||||
/*
|
||||
** I consider this technique of passing a pointer via an integer as
|
||||
** fundamentally broken but thats the way microsoft has defined the
|
||||
** interface.
|
||||
*/
|
||||
if ((win32_out = (WIN32_AUDIO_OUT*) data) == NULL)
|
||||
{ printf ("win32_audio_out_callback : AUDIO_OUT is NULL.\n") ;
|
||||
return 1 ;
|
||||
} ;
|
||||
|
||||
if (win32_out->magic != WIN32_MAGIC)
|
||||
{ printf ("win32_audio_out_callback : Bad magic number (%d %d).\n", win32_out->magic, WIN32_MAGIC) ;
|
||||
return 1 ;
|
||||
} ;
|
||||
|
||||
if (msg != MM_WOM_DONE)
|
||||
return 0 ;
|
||||
|
||||
/* Do the actual audio. */
|
||||
sample_count = win32_out->bufferlen ;
|
||||
|
||||
read_count = win32_out->callback (win32_out->callback_data, win32_out->float_buffer, sample_count) ;
|
||||
|
||||
sptr = (short*) win32_out->whdr [win32_out->current].lpData ;
|
||||
|
||||
for (k = 0 ; k < read_count ; k++)
|
||||
sptr [k] = lrint (32767.0 * win32_out->float_buffer [k]) ;
|
||||
|
||||
if (read_count > 0)
|
||||
{ /* Fix buffer length is only a partial block. */
|
||||
if (read_count * sizeof (short) < win32_out->bufferlen)
|
||||
win32_out->whdr [win32_out->current].dwBufferLength = read_count * sizeof (short) ;
|
||||
|
||||
/* Queue the WAVEHDR */
|
||||
waveOutWrite (win32_out->hwave, (LPWAVEHDR) &(win32_out->whdr [win32_out->current]), sizeof (WAVEHDR)) ;
|
||||
}
|
||||
else
|
||||
{ /* Stop playback */
|
||||
waveOutPause (win32_out->hwave) ;
|
||||
|
||||
SetEvent (win32_out->Event) ;
|
||||
} ;
|
||||
|
||||
win32_out->current = (win32_out->current + 1) % 2 ;
|
||||
|
||||
return 0 ;
|
||||
} /* win32_audio_out_callback */
|
||||
|
||||
#endif /* Win32 */
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
** Solaris.
|
||||
*/
|
||||
|
||||
#if (defined (sun) && defined (unix)) /* ie Solaris */
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/audioio.h>
|
||||
|
||||
#define SOLARIS_MAGIC MAKE_MAGIC ('S', 'o', 'l', 'a', 'r', 'i', 's', ' ')
|
||||
|
||||
typedef struct
|
||||
{ int magic ;
|
||||
int fd ;
|
||||
int channels ;
|
||||
int samplerate ;
|
||||
} SOLARIS_AUDIO_OUT ;
|
||||
|
||||
static AUDIO_OUT *solaris_open (int channels, int samplerate) ;
|
||||
static void solaris_play (get_audio_callback_t callback, AUDIO_OUT *audio_out, void *callback_data) ;
|
||||
static void solaris_close (AUDIO_OUT *audio_out) ;
|
||||
|
||||
static AUDIO_OUT *
|
||||
solaris_open (int channels, int samplerate)
|
||||
{ SOLARIS_AUDIO_OUT *solaris_out ;
|
||||
audio_info_t audio_info ;
|
||||
int error ;
|
||||
|
||||
if ((solaris_out = malloc (sizeof (SOLARIS_AUDIO_OUT))) == NULL)
|
||||
{ perror ("solaris_open : malloc ") ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
solaris_out->magic = SOLARIS_MAGIC ;
|
||||
solaris_out->channels = channels ;
|
||||
solaris_out->samplerate = channels ;
|
||||
|
||||
/* open the audio device - write only, non-blocking */
|
||||
if ((solaris_out->fd = open ("/dev/audio", O_WRONLY | O_NONBLOCK)) < 0)
|
||||
{ perror ("open (/dev/audio) failed") ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
/* Retrive standard values. */
|
||||
AUDIO_INITINFO (&audio_info) ;
|
||||
|
||||
audio_info.play.sample_rate = samplerate ;
|
||||
audio_info.play.channels = channels ;
|
||||
audio_info.play.precision = 16 ;
|
||||
audio_info.play.encoding = AUDIO_ENCODING_LINEAR ;
|
||||
audio_info.play.gain = AUDIO_MAX_GAIN ;
|
||||
audio_info.play.balance = AUDIO_MID_BALANCE ;
|
||||
|
||||
if ((error = ioctl (solaris_out->fd, AUDIO_SETINFO, &audio_info)))
|
||||
{ perror ("ioctl (AUDIO_SETINFO) failed") ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
return (AUDIO_OUT*) solaris_out ;
|
||||
} /* solaris_open */
|
||||
|
||||
static void
|
||||
solaris_play (get_audio_callback_t callback, AUDIO_OUT *audio_out, void *callback_data)
|
||||
{ SOLARIS_AUDIO_OUT *solaris_out ;
|
||||
static float float_buffer [BUFFER_LEN] ;
|
||||
static short buffer [BUFFER_LEN] ;
|
||||
int k, readcount ;
|
||||
|
||||
if ((solaris_out = (SOLARIS_AUDIO_OUT*) audio_out) == NULL)
|
||||
{ printf ("solaris_play : AUDIO_OUT is NULL.\n") ;
|
||||
return ;
|
||||
} ;
|
||||
|
||||
if (solaris_out->magic != SOLARIS_MAGIC)
|
||||
{ printf ("solaris_play : Bad magic number.\n") ;
|
||||
return ;
|
||||
} ;
|
||||
|
||||
while ((readcount = callback (callback_data, float_buffer, BUFFER_LEN / solaris_out->channels)))
|
||||
{ for (k = 0 ; k < readcount * solaris_out->channels ; k++)
|
||||
buffer [k] = lrint (32767.0 * float_buffer [k]) ;
|
||||
write (solaris_out->fd, buffer, readcount * solaris_out->channels * sizeof (short)) ;
|
||||
} ;
|
||||
|
||||
return ;
|
||||
} /* solaris_play */
|
||||
|
||||
static void
|
||||
solaris_close (AUDIO_OUT *audio_out)
|
||||
{ SOLARIS_AUDIO_OUT *solaris_out ;
|
||||
|
||||
if ((solaris_out = (SOLARIS_AUDIO_OUT*) audio_out) == NULL)
|
||||
{ printf ("solaris_close : AUDIO_OUT is NULL.\n") ;
|
||||
return ;
|
||||
} ;
|
||||
|
||||
if (solaris_out->magic != SOLARIS_MAGIC)
|
||||
{ printf ("solaris_close : Bad magic number.\n") ;
|
||||
return ;
|
||||
} ;
|
||||
|
||||
memset (solaris_out, 0, sizeof (SOLARIS_AUDIO_OUT)) ;
|
||||
|
||||
free (solaris_out) ;
|
||||
|
||||
return ;
|
||||
} /* solaris_close */
|
||||
|
||||
#endif /* Solaris */
|
||||
|
||||
/*==============================================================================
|
||||
** Main function.
|
||||
*/
|
||||
|
||||
AUDIO_OUT *
|
||||
audio_open (int channels, int samplerate)
|
||||
{
|
||||
#if defined (__linux__)
|
||||
return linux_open (channels, samplerate) ;
|
||||
#elif (defined (__MACH__) && defined (__APPLE__))
|
||||
return macosx_open (channels, samplerate) ;
|
||||
#elif (defined (sun) && defined (unix))
|
||||
return solaris_open (channels, samplerate) ;
|
||||
#elif (defined (_WIN32) || defined (WIN32))
|
||||
return win32_open (channels, samplerate) ;
|
||||
#else
|
||||
#warning "*** Playing sound not yet supported on this platform."
|
||||
#warning "*** Please feel free to submit a patch."
|
||||
printf ("Error : Playing sound not yet supported on this platform.\n") ;
|
||||
return NULL ;
|
||||
#endif
|
||||
|
||||
|
||||
return NULL ;
|
||||
} /* audio_open */
|
||||
|
||||
void
|
||||
audio_play (get_audio_callback_t callback, AUDIO_OUT *audio_out, void *callback_data)
|
||||
{
|
||||
|
||||
if (callback == NULL)
|
||||
{ printf ("Error : bad callback pointer.\n") ;
|
||||
return ;
|
||||
} ;
|
||||
|
||||
if (audio_out == NULL)
|
||||
{ printf ("Error : bad audio_out pointer.\n") ;
|
||||
return ;
|
||||
} ;
|
||||
|
||||
if (callback_data == NULL)
|
||||
{ printf ("Error : bad callback_data pointer.\n") ;
|
||||
return ;
|
||||
} ;
|
||||
|
||||
#if defined (__linux__)
|
||||
linux_play (callback, audio_out, callback_data) ;
|
||||
#elif (defined (__MACH__) && defined (__APPLE__))
|
||||
macosx_play (callback, audio_out, callback_data) ;
|
||||
#elif (defined (sun) && defined (unix))
|
||||
solaris_play (callback, audio_out, callback_data) ;
|
||||
#elif (defined (_WIN32) || defined (WIN32))
|
||||
win32_play (callback, audio_out, callback_data) ;
|
||||
#else
|
||||
#warning "*** Playing sound not yet supported on this platform."
|
||||
#warning "*** Please feel free to submit a patch."
|
||||
printf ("Error : Playing sound not yet supported on this platform.\n") ;
|
||||
return ;
|
||||
#endif
|
||||
|
||||
return ;
|
||||
} /* audio_play */
|
||||
|
||||
void
|
||||
audio_close (AUDIO_OUT *audio_out)
|
||||
{
|
||||
#if defined (__linux__)
|
||||
linux_close (audio_out) ;
|
||||
#elif (defined (__MACH__) && defined (__APPLE__))
|
||||
macosx_close (audio_out) ;
|
||||
#elif (defined (sun) && defined (unix))
|
||||
solaris_close (audio_out) ;
|
||||
#elif (defined (_WIN32) || defined (WIN32))
|
||||
win32_close (audio_out) ;
|
||||
#else
|
||||
#warning "*** Playing sound not yet supported on this platform."
|
||||
#warning "*** Please feel free to submit a patch."
|
||||
printf ("Error : Playing sound not yet supported on this platform.\n") ;
|
||||
return ;
|
||||
#endif
|
||||
|
||||
return ;
|
||||
} /* audio_close */
|
||||
|
||||
#else /* (HAVE_SNDFILE == 0) */
|
||||
|
||||
/* Do not have libsndfile installed so just return. */
|
||||
|
||||
AUDIO_OUT *
|
||||
audio_open (int channels, int samplerate)
|
||||
{
|
||||
(void) channels ;
|
||||
(void) samplerate ;
|
||||
|
||||
return NULL ;
|
||||
} /* audio_open */
|
||||
|
||||
void
|
||||
audio_play (get_audio_callback_t callback, AUDIO_OUT *audio_out, void *callback_data)
|
||||
{
|
||||
(void) callback ;
|
||||
(void) audio_out ;
|
||||
(void) callback_data ;
|
||||
|
||||
return ;
|
||||
} /* audio_play */
|
||||
|
||||
void
|
||||
audio_close (AUDIO_OUT *audio_out)
|
||||
{
|
||||
audio_out = audio_out ;
|
||||
|
||||
return ;
|
||||
} /* audio_close */
|
||||
|
||||
#endif /* HAVE_SNDFILE */
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 1999-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
typedef void AUDIO_OUT ;
|
||||
|
||||
typedef int (*get_audio_callback_t) (void *callback_data, float *samples, int frames) ;
|
||||
|
||||
/* A general audio ooutput function (Linux/OSS, Win32, MacOSX, Solaris)
|
||||
** which retrieves data using the callback function in the above struct.
|
||||
**
|
||||
** audio_open - opens the device and returns an anonymous pointer to its
|
||||
** own private data.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
AUDIO_OUT *audio_open (int channels, int samplerate) ;
|
||||
|
||||
void audio_play (get_audio_callback_t callback, AUDIO_OUT *audio_out, void *callback_data) ;
|
||||
|
||||
void audio_close (AUDIO_OUT *audio_data) ;
|
||||
|
|
@ -1,332 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#if (HAVE_SNDFILE)
|
||||
|
||||
#include <samplerate.h>
|
||||
#include <sndfile.h>
|
||||
|
||||
#define DEFAULT_CONVERTER SRC_SINC_MEDIUM_QUALITY
|
||||
|
||||
#define BUFFER_LEN 4096 /*-(1<<16)-*/
|
||||
|
||||
static void usage_exit (const char *progname) ;
|
||||
static sf_count_t sample_rate_convert (SNDFILE *infile, SNDFILE *outfile, int converter, double src_ratio, int channels, double * gain) ;
|
||||
static double apply_gain (float * data, long frames, int channels, double max, double gain) ;
|
||||
|
||||
int
|
||||
main (int argc, char *argv [])
|
||||
{ SNDFILE *infile, *outfile = NULL ;
|
||||
SF_INFO sfinfo ;
|
||||
|
||||
sf_count_t count ;
|
||||
double src_ratio = -1.0, gain = 1.0 ;
|
||||
int new_sample_rate = -1, k, converter, max_speed = SF_FALSE ;
|
||||
|
||||
if (argc == 2 && strcmp (argv [1], "--version") == 0)
|
||||
{ char buffer [64], *cptr ;
|
||||
|
||||
if ((cptr = strrchr (argv [0], '/')) != NULL)
|
||||
argv [0] = cptr + 1 ;
|
||||
if ((cptr = strrchr (argv [0], '\\')) != NULL)
|
||||
argv [0] = cptr + 1 ;
|
||||
|
||||
sf_command (NULL, SFC_GET_LIB_VERSION, buffer, sizeof (buffer)) ;
|
||||
|
||||
printf ("%s (%s,%s)\n", argv [0], src_get_version (), buffer) ;
|
||||
exit (0) ;
|
||||
} ;
|
||||
|
||||
if (argc != 5 && argc != 7 && argc != 8)
|
||||
usage_exit (argv [0]) ;
|
||||
|
||||
/* Set default converter. */
|
||||
converter = DEFAULT_CONVERTER ;
|
||||
|
||||
for (k = 1 ; k < argc - 2 ; k++)
|
||||
{ if (strcmp (argv [k], "--max-speed") == 0)
|
||||
max_speed = SF_TRUE ;
|
||||
else if (strcmp (argv [k], "-to") == 0)
|
||||
{ k ++ ;
|
||||
new_sample_rate = atoi (argv [k]) ;
|
||||
}
|
||||
else if (strcmp (argv [k], "-by") == 0)
|
||||
{ k ++ ;
|
||||
src_ratio = atof (argv [k]) ;
|
||||
}
|
||||
else if (strcmp (argv [k], "-c") == 0)
|
||||
{ k ++ ;
|
||||
converter = atoi (argv [k]) ;
|
||||
}
|
||||
else
|
||||
usage_exit (argv [0]) ;
|
||||
} ;
|
||||
|
||||
if (new_sample_rate <= 0 && src_ratio <= 0.0)
|
||||
usage_exit (argv [0]) ;
|
||||
|
||||
if (src_get_name (converter) == NULL)
|
||||
{ printf ("Error : bad converter number.\n") ;
|
||||
usage_exit (argv [0]) ;
|
||||
} ;
|
||||
|
||||
if (strcmp (argv [argc - 2], argv [argc - 1]) == 0)
|
||||
{ printf ("Error : input and output file names are the same.\n") ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if ((infile = sf_open (argv [argc - 2], SFM_READ, &sfinfo)) == NULL)
|
||||
{ printf ("Error : Not able to open input file '%s'\n", argv [argc - 2]) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
printf ("Input File : %s\n", argv [argc - 2]) ;
|
||||
printf ("Sample Rate : %d\n", sfinfo.samplerate) ;
|
||||
printf ("Input Frames : %ld\n\n", (long) sfinfo.frames) ;
|
||||
|
||||
if (new_sample_rate > 0)
|
||||
{ src_ratio = (1.0 * new_sample_rate) / sfinfo.samplerate ;
|
||||
sfinfo.samplerate = new_sample_rate ;
|
||||
}
|
||||
else if (src_is_valid_ratio (src_ratio))
|
||||
sfinfo.samplerate = (int) floor (sfinfo.samplerate * src_ratio) ;
|
||||
else
|
||||
{ printf ("Not able to determine new sample rate. Exiting.\n") ;
|
||||
sf_close (infile) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (fabs (src_ratio - 1.0) < 1e-20)
|
||||
{ printf ("Target samplerate and input samplerate are the same. Exiting.\n") ;
|
||||
sf_close (infile) ;
|
||||
exit (0) ;
|
||||
} ;
|
||||
|
||||
printf ("SRC Ratio : %f\n", src_ratio) ;
|
||||
printf ("Converter : %s\n\n", src_get_name (converter)) ;
|
||||
|
||||
if (src_is_valid_ratio (src_ratio) == 0)
|
||||
{ printf ("Error : Sample rate change out of valid range.\n") ;
|
||||
sf_close (infile) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
/* Delete the output file length to zero if already exists. */
|
||||
remove (argv [argc - 1]) ;
|
||||
|
||||
printf ("Output file : %s\n", argv [argc - 1]) ;
|
||||
printf ("Sample Rate : %d\n", sfinfo.samplerate) ;
|
||||
|
||||
do
|
||||
{ sf_close (outfile) ;
|
||||
|
||||
if ((outfile = sf_open (argv [argc - 1], SFM_WRITE, &sfinfo)) == NULL)
|
||||
{ printf ("Error : Not able to open output file '%s'\n", argv [argc - 1]) ;
|
||||
sf_close (infile) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (max_speed)
|
||||
{ /* This is mainly for the comparison program tests/src-evaluate.c */
|
||||
sf_command (outfile, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_FALSE) ;
|
||||
}
|
||||
else
|
||||
{ /* Update the file header after every write. */
|
||||
sf_command (outfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_TRUE) ;
|
||||
} ;
|
||||
|
||||
sf_command (outfile, SFC_SET_CLIPPING, NULL, SF_TRUE) ;
|
||||
|
||||
count = sample_rate_convert (infile, outfile, converter, src_ratio, sfinfo.channels, &gain) ;
|
||||
}
|
||||
while (count < 0) ;
|
||||
|
||||
printf ("Output Frames : %ld\n\n", (long) count) ;
|
||||
|
||||
sf_close (infile) ;
|
||||
sf_close (outfile) ;
|
||||
|
||||
return 0 ;
|
||||
} /* main */
|
||||
|
||||
/*==============================================================================
|
||||
*/
|
||||
|
||||
static sf_count_t
|
||||
sample_rate_convert (SNDFILE *infile, SNDFILE *outfile, int converter, double src_ratio, int channels, double * gain)
|
||||
{ static float input [BUFFER_LEN] ;
|
||||
static float output [BUFFER_LEN] ;
|
||||
|
||||
SRC_STATE *src_state ;
|
||||
SRC_DATA src_data ;
|
||||
int error ;
|
||||
double max = 0.0 ;
|
||||
sf_count_t output_count = 0 ;
|
||||
|
||||
sf_seek (infile, 0, SEEK_SET) ;
|
||||
sf_seek (outfile, 0, SEEK_SET) ;
|
||||
|
||||
/* Initialize the sample rate converter. */
|
||||
if ((src_state = src_new (converter, channels, &error)) == NULL)
|
||||
{ printf ("\n\nError : src_new() failed : %s.\n\n", src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
src_data.end_of_input = 0 ; /* Set this later. */
|
||||
|
||||
/* Start with zero to force load in while loop. */
|
||||
src_data.input_frames = 0 ;
|
||||
src_data.data_in = input ;
|
||||
|
||||
src_data.src_ratio = src_ratio ;
|
||||
|
||||
src_data.data_out = output ;
|
||||
src_data.output_frames = BUFFER_LEN /channels ;
|
||||
|
||||
while (1)
|
||||
{
|
||||
/* If the input buffer is empty, refill it. */
|
||||
if (src_data.input_frames == 0)
|
||||
{ src_data.input_frames = sf_readf_float (infile, input, BUFFER_LEN / channels) ;
|
||||
src_data.data_in = input ;
|
||||
|
||||
/* The last read will not be a full buffer, so snd_of_input. */
|
||||
if (src_data.input_frames < BUFFER_LEN / channels)
|
||||
src_data.end_of_input = SF_TRUE ;
|
||||
} ;
|
||||
|
||||
if ((error = src_process (src_state, &src_data)))
|
||||
{ printf ("\nError : %s\n", src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
/* Terminate if done. */
|
||||
if (src_data.end_of_input && src_data.output_frames_gen == 0)
|
||||
break ;
|
||||
|
||||
max = apply_gain (src_data.data_out, src_data.output_frames_gen, channels, max, *gain) ;
|
||||
|
||||
/* Write output. */
|
||||
sf_writef_float (outfile, output, src_data.output_frames_gen) ;
|
||||
output_count += src_data.output_frames_gen ;
|
||||
|
||||
src_data.data_in += src_data.input_frames_used * channels ;
|
||||
src_data.input_frames -= src_data.input_frames_used ;
|
||||
} ;
|
||||
|
||||
src_state = src_delete (src_state) ;
|
||||
|
||||
if (max > 1.0)
|
||||
{ *gain = 1.0 / max ;
|
||||
printf ("\nOutput has clipped. Restarting conversion to prevent clipping.\n\n") ;
|
||||
return -1 ;
|
||||
} ;
|
||||
|
||||
return output_count ;
|
||||
} /* sample_rate_convert */
|
||||
|
||||
static double
|
||||
apply_gain (float * data, long frames, int channels, double max, double gain)
|
||||
{
|
||||
long k ;
|
||||
|
||||
for (k = 0 ; k < frames * channels ; k++)
|
||||
{ data [k] *= gain ;
|
||||
|
||||
if (fabs (data [k]) > max)
|
||||
max = fabs (data [k]) ;
|
||||
} ;
|
||||
|
||||
return max ;
|
||||
} /* apply_gain */
|
||||
|
||||
static void
|
||||
usage_exit (const char *progname)
|
||||
{ char lsf_ver [128] ;
|
||||
const char *cptr ;
|
||||
int k ;
|
||||
|
||||
if ((cptr = strrchr (progname, '/')) != NULL)
|
||||
progname = cptr + 1 ;
|
||||
|
||||
if ((cptr = strrchr (progname, '\\')) != NULL)
|
||||
progname = cptr + 1 ;
|
||||
|
||||
|
||||
sf_command (NULL, SFC_GET_LIB_VERSION, lsf_ver, sizeof (lsf_ver)) ;
|
||||
|
||||
printf ("\n"
|
||||
" A Sample Rate Converter using libsndfile for file I/O and Secret \n"
|
||||
" Rabbit Code (aka libsamplerate) for performing the conversion.\n"
|
||||
" It works on any file format supported by libsndfile with any \n"
|
||||
" number of channels (limited only by host memory).\n"
|
||||
"\n"
|
||||
" %s\n"
|
||||
" %s\n"
|
||||
"\n"
|
||||
" Usage : \n"
|
||||
" %s -to <new sample rate> [-c <number>] <input file> <output file>\n"
|
||||
" %s -by <amount> [-c <number>] <input file> <output file>\n"
|
||||
"\n", src_get_version (), lsf_ver, progname, progname) ;
|
||||
|
||||
puts (
|
||||
" The optional -c argument allows the converter type to be chosen from\n"
|
||||
" the following list :"
|
||||
"\n"
|
||||
) ;
|
||||
|
||||
for (k = 0 ; (cptr = src_get_name (k)) != NULL ; k++)
|
||||
printf (" %d : %s%s\n", k, cptr, k == DEFAULT_CONVERTER ? " (default)" : "") ;
|
||||
|
||||
puts ("") ;
|
||||
|
||||
exit (1) ;
|
||||
} /* usage_exit */
|
||||
|
||||
/*==============================================================================
|
||||
*/
|
||||
|
||||
#else /* (HAVE_SNFILE == 0) */
|
||||
|
||||
/* Alternative main function when libsndfile is not available. */
|
||||
|
||||
int
|
||||
main (void)
|
||||
{ puts (
|
||||
"\n"
|
||||
"****************************************************************\n"
|
||||
" This example program was compiled without libsndfile \n"
|
||||
" (http://www.mega-nerd.com/libsndfile/).\n"
|
||||
" It is therefore completely broken and non-functional.\n"
|
||||
"****************************************************************\n"
|
||||
"\n"
|
||||
) ;
|
||||
|
||||
return 0 ;
|
||||
} /* main */
|
||||
|
||||
#endif
|
||||
|
|
@ -1,240 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2005-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#if (HAVE_SNDFILE)
|
||||
|
||||
#include <samplerate.h>
|
||||
#include <sndfile.h>
|
||||
|
||||
#define ARRAY_LEN(x) ((int) (sizeof (x) / sizeof ((x) [0])))
|
||||
|
||||
#define DEFAULT_CONVERTER SRC_SINC_MEDIUM_QUALITY
|
||||
|
||||
#define BUFFER_LEN 1024
|
||||
#define INPUT_STEP_SIZE 8
|
||||
|
||||
typedef struct
|
||||
{ sf_count_t index ;
|
||||
double ratio ;
|
||||
} TIMEWARP_FACTOR ;
|
||||
|
||||
static void usage_exit (const char *progname) ;
|
||||
static sf_count_t timewarp_convert (SNDFILE *infile, SNDFILE *outfile, int converter, int channels) ;
|
||||
|
||||
int
|
||||
main (int argc, char *argv [])
|
||||
{ SNDFILE *infile, *outfile ;
|
||||
SF_INFO sfinfo ;
|
||||
sf_count_t count ;
|
||||
|
||||
if (argc != 3)
|
||||
usage_exit (argv [0]) ;
|
||||
|
||||
putchar ('\n') ;
|
||||
printf ("Input File : %s\n", argv [argc - 2]) ;
|
||||
if ((infile = sf_open (argv [argc - 2], SFM_READ, &sfinfo)) == NULL)
|
||||
{ printf ("Error : Not able to open input file '%s'\n", argv [argc - 2]) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (INPUT_STEP_SIZE * sfinfo.channels > BUFFER_LEN)
|
||||
{ printf ("\n\nError : INPUT_STEP_SIZE * sfinfo.channels > BUFFER_LEN\n\n") ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
|
||||
/* Delete the output file length to zero if already exists. */
|
||||
remove (argv [argc - 1]) ;
|
||||
|
||||
if ((outfile = sf_open (argv [argc - 1], SFM_WRITE, &sfinfo)) == NULL)
|
||||
{ printf ("Error : Not able to open output file '%s'\n", argv [argc - 1]) ;
|
||||
sf_close (infile) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
sf_command (outfile, SFC_SET_CLIPPING, NULL, SF_TRUE) ;
|
||||
|
||||
printf ("Output file : %s\n", argv [argc - 1]) ;
|
||||
printf ("Converter : %s\n", src_get_name (DEFAULT_CONVERTER)) ;
|
||||
|
||||
count = timewarp_convert (infile, outfile, DEFAULT_CONVERTER, sfinfo.channels) ;
|
||||
|
||||
printf ("Output Frames : %ld\n\n", (long) count) ;
|
||||
|
||||
sf_close (infile) ;
|
||||
sf_close (outfile) ;
|
||||
|
||||
return 0 ;
|
||||
} /* main */
|
||||
|
||||
/*==============================================================================
|
||||
*/
|
||||
|
||||
static TIMEWARP_FACTOR warp [] =
|
||||
{ { 0 , 1.00000001 },
|
||||
{ 20000 , 1.01000000 },
|
||||
{ 20200 , 1.00000001 },
|
||||
{ 40000 , 1.20000000 },
|
||||
{ 40300 , 1.00000001 },
|
||||
{ 60000 , 1.10000000 },
|
||||
{ 60400 , 1.00000001 },
|
||||
{ 80000 , 1.50000000 },
|
||||
{ 81000 , 1.00000001 },
|
||||
} ;
|
||||
|
||||
static sf_count_t
|
||||
timewarp_convert (SNDFILE *infile, SNDFILE *outfile, int converter, int channels)
|
||||
{ static float input [BUFFER_LEN] ;
|
||||
static float output [BUFFER_LEN] ;
|
||||
|
||||
SRC_STATE *src_state ;
|
||||
SRC_DATA src_data ;
|
||||
int error, warp_index = 0 ;
|
||||
sf_count_t input_count = 0, output_count = 0 ;
|
||||
|
||||
sf_seek (infile, 0, SEEK_SET) ;
|
||||
sf_seek (outfile, 0, SEEK_SET) ;
|
||||
|
||||
/* Initialize the sample rate converter. */
|
||||
if ((src_state = src_new (converter, channels, &error)) == NULL)
|
||||
{ printf ("\n\nError : src_new() failed : %s.\n\n", src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
src_data.end_of_input = 0 ; /* Set this later. */
|
||||
|
||||
/* Start with zero to force load in while loop. */
|
||||
src_data.input_frames = 0 ;
|
||||
src_data.data_in = input ;
|
||||
|
||||
if (warp [0].index > 0)
|
||||
src_data.src_ratio = 1.0 ;
|
||||
else
|
||||
{ src_data.src_ratio = warp [0].ratio ;
|
||||
warp_index ++ ;
|
||||
} ;
|
||||
|
||||
src_data.data_out = output ;
|
||||
src_data.output_frames = BUFFER_LEN /channels ;
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (warp_index < ARRAY_LEN (warp) - 1 && input_count >= warp [warp_index].index)
|
||||
{ src_data.src_ratio = warp [warp_index].ratio ;
|
||||
warp_index ++ ;
|
||||
} ;
|
||||
|
||||
/* If the input buffer is empty, refill it. */
|
||||
if (src_data.input_frames == 0)
|
||||
{ src_data.input_frames = sf_readf_float (infile, input, INPUT_STEP_SIZE) ;
|
||||
input_count += src_data.input_frames ;
|
||||
src_data.data_in = input ;
|
||||
|
||||
/* The last read will not be a full buffer, so snd_of_input. */
|
||||
if (src_data.input_frames < INPUT_STEP_SIZE)
|
||||
src_data.end_of_input = SF_TRUE ;
|
||||
} ;
|
||||
|
||||
/* Process current block. */
|
||||
if ((error = src_process (src_state, &src_data)))
|
||||
{ printf ("\nError : %s\n", src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
/* Terminate if done. */
|
||||
if (src_data.end_of_input && src_data.output_frames_gen == 0)
|
||||
break ;
|
||||
|
||||
/* Write output. */
|
||||
sf_writef_float (outfile, output, src_data.output_frames_gen) ;
|
||||
output_count += src_data.output_frames_gen ;
|
||||
|
||||
src_data.data_in += src_data.input_frames_used * channels ;
|
||||
src_data.input_frames -= src_data.input_frames_used ;
|
||||
} ;
|
||||
|
||||
src_state = src_delete (src_state) ;
|
||||
|
||||
return output_count ;
|
||||
} /* timewarp_convert */
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static void
|
||||
usage_exit (const char *progname)
|
||||
{ const char *cptr ;
|
||||
|
||||
if ((cptr = strrchr (progname, '/')) != NULL)
|
||||
progname = cptr + 1 ;
|
||||
|
||||
if ((cptr = strrchr (progname, '\\')) != NULL)
|
||||
progname = cptr + 1 ;
|
||||
|
||||
printf ("\n"
|
||||
" A program demonstrating the time warping capabilities of libsamplerate."
|
||||
" It uses libsndfile for file I/O and Secret Rabbit Code (aka libsamplerate)"
|
||||
" for performing the warping.\n"
|
||||
" It works on any file format supported by libsndfile with any \n"
|
||||
" number of channels (limited only by host memory).\n"
|
||||
"\n"
|
||||
" The warping is dependant on a table hard code into the source code.\n"
|
||||
"\n"
|
||||
" libsamplerate version : %s\n"
|
||||
"\n"
|
||||
" Usage : \n"
|
||||
" %s <input file> <output file>\n"
|
||||
"\n", src_get_version (), progname) ;
|
||||
|
||||
puts ("") ;
|
||||
|
||||
exit (1) ;
|
||||
} /* usage_exit */
|
||||
|
||||
/*==============================================================================
|
||||
*/
|
||||
|
||||
#else /* (HAVE_SNFILE == 0) */
|
||||
|
||||
/* Alternative main function when libsndfile is not available. */
|
||||
|
||||
int
|
||||
main (void)
|
||||
{ puts (
|
||||
"\n"
|
||||
"****************************************************************\n"
|
||||
" This example program was compiled without libsndfile \n"
|
||||
" (http://www.mega-nerd.com/libsndfile/).\n"
|
||||
" It is therefore completely broken and non-functional.\n"
|
||||
"****************************************************************\n"
|
||||
"\n"
|
||||
) ;
|
||||
|
||||
return 0 ;
|
||||
} /* main */
|
||||
|
||||
#endif
|
||||
|
|
@ -1,282 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <float_cast.h>
|
||||
|
||||
#if (HAVE_SNDFILE)
|
||||
|
||||
#include <samplerate.h>
|
||||
#include <sndfile.h>
|
||||
|
||||
#include "audio_out.h"
|
||||
|
||||
#define ARRAY_LEN(x) ((int) (sizeof (x) / sizeof ((x) [0])))
|
||||
|
||||
#define BUFFER_LEN 4096
|
||||
#define INPUT_FRAMES 100
|
||||
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
|
||||
#define MAGIC_NUMBER ((int) ('S' << 16) + ('R' << 8) + ('C'))
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846264338
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct
|
||||
{ int magic ;
|
||||
|
||||
SNDFILE *sndfile ;
|
||||
SF_INFO sfinfo ;
|
||||
|
||||
SRC_STATE *src_state ;
|
||||
SRC_DATA src_data ;
|
||||
|
||||
int freq_point ;
|
||||
int buffer_out_start, buffer_out_end ;
|
||||
|
||||
float buffer_in [BUFFER_LEN] ;
|
||||
float buffer_out [BUFFER_LEN] ;
|
||||
} CALLBACK_DATA ;
|
||||
|
||||
static int varispeed_get_data (CALLBACK_DATA *data, float *samples, int frames) ;
|
||||
static void varispeed_play (const char *filename, int converter) ;
|
||||
|
||||
int
|
||||
main (int argc, char *argv [])
|
||||
{ const char *cptr, *progname, *filename ;
|
||||
int k, converter ;
|
||||
|
||||
converter = SRC_SINC_FASTEST ;
|
||||
|
||||
progname = argv [0] ;
|
||||
|
||||
if ((cptr = strrchr (progname, '/')) != NULL)
|
||||
progname = cptr + 1 ;
|
||||
|
||||
if ((cptr = strrchr (progname, '\\')) != NULL)
|
||||
progname = cptr + 1 ;
|
||||
|
||||
printf ("\n"
|
||||
" %s\n"
|
||||
"\n"
|
||||
" This is a demo program which plays the given file at a slowly \n"
|
||||
" varying speed. Lots of fun with drum loops and full mixes.\n"
|
||||
"\n"
|
||||
" It uses Secret Rabbit Code (aka libsamplerate) to perform the \n"
|
||||
" vari-speeding and libsndfile for file I/O.\n"
|
||||
"\n", progname) ;
|
||||
|
||||
if (argc == 2)
|
||||
filename = argv [1] ;
|
||||
else if (argc == 4 && strcmp (argv [1], "-c") == 0)
|
||||
{ filename = argv [3] ;
|
||||
converter = atoi (argv [2]) ;
|
||||
}
|
||||
else
|
||||
{ printf (" Usage :\n\n %s [-c <number>] <input file>\n\n", progname) ;
|
||||
puts (
|
||||
" The optional -c argument allows the converter type to be chosen from\n"
|
||||
" the following list :"
|
||||
"\n"
|
||||
) ;
|
||||
|
||||
for (k = 0 ; (cptr = src_get_name (k)) != NULL ; k++)
|
||||
printf (" %d : %s\n", k, cptr) ;
|
||||
|
||||
puts ("") ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
varispeed_play (filename, converter) ;
|
||||
|
||||
return 0 ;
|
||||
} /* main */
|
||||
|
||||
/*==============================================================================
|
||||
*/
|
||||
|
||||
static void
|
||||
varispeed_play (const char *filename, int converter)
|
||||
{ CALLBACK_DATA *data ;
|
||||
AUDIO_OUT *audio_out ;
|
||||
int error ;
|
||||
|
||||
/* Allocate memory for the callback data. */
|
||||
if ((data = calloc (1, sizeof (CALLBACK_DATA))) == NULL)
|
||||
{ printf ("\n\n%s:%d Calloc failed!\n", __FILE__, __LINE__) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
data->magic = MAGIC_NUMBER ;
|
||||
|
||||
if ((data->sndfile = sf_open (filename, SFM_READ, &data->sfinfo)) == NULL)
|
||||
{ puts (sf_strerror (NULL)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
/* Initialize the sample rate converter. */
|
||||
if ((data->src_state = src_new (converter, data->sfinfo.channels, &error)) == NULL)
|
||||
{ printf ("\n\nError : src_new() failed : %s.\n\n", src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
printf (
|
||||
|
||||
" Playing : %s\n"
|
||||
" Converter : %s\n"
|
||||
"\n"
|
||||
" Press <control-c> to exit.\n"
|
||||
"\n",
|
||||
filename, src_get_name (converter)) ;
|
||||
|
||||
if ((audio_out = audio_open (data->sfinfo.channels, data->sfinfo.samplerate)) == NULL)
|
||||
{ printf ("\n\nError : audio_open () failed.\n") ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
/* Set up sample rate converter info. */
|
||||
data->src_data.end_of_input = 0 ; /* Set this later. */
|
||||
|
||||
/* Start with zero to force load in while loop. */
|
||||
data->src_data.input_frames = 0 ;
|
||||
data->src_data.data_in = data->buffer_in ;
|
||||
|
||||
/* Start with output frames also zero. */
|
||||
data->src_data.output_frames_gen = 0 ;
|
||||
|
||||
data->buffer_out_start = data->buffer_out_end = 0 ;
|
||||
data->src_data.src_ratio = 1.0 ;
|
||||
|
||||
/* Pass the data and the callbacl function to audio_play */
|
||||
audio_play ((get_audio_callback_t) varispeed_get_data, audio_out, data) ;
|
||||
|
||||
/* Cleanup */
|
||||
audio_close (audio_out) ;
|
||||
sf_close (data->sndfile) ;
|
||||
src_delete (data->src_state) ;
|
||||
|
||||
free (data) ;
|
||||
|
||||
} /* varispeed_play */
|
||||
|
||||
/*==============================================================================
|
||||
*/
|
||||
|
||||
static int
|
||||
varispeed_get_data (CALLBACK_DATA *data, float *samples, int frames)
|
||||
{ int error, readframes, frame_count, direct_out ;
|
||||
|
||||
if (data->magic != MAGIC_NUMBER)
|
||||
{ printf ("\n\n%s:%d Eeeek, something really bad happened!\n", __FILE__, __LINE__) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
frame_count = 0 ;
|
||||
|
||||
if (data->buffer_out_start < data->buffer_out_end)
|
||||
{ frame_count = MIN (data->buffer_out_end - data->buffer_out_start, frames) ;
|
||||
memcpy (samples, data->buffer_out + data->sfinfo.channels * data->buffer_out_start, data->sfinfo.channels * frame_count * sizeof (float)) ;
|
||||
data->buffer_out_start += frame_count ;
|
||||
} ;
|
||||
|
||||
data->buffer_out_start = data->buffer_out_end = 0 ;
|
||||
|
||||
while (frame_count < frames)
|
||||
{
|
||||
/* Read INPUT_FRAMES frames worth looping at end of file. */
|
||||
for (readframes = 0 ; readframes < INPUT_FRAMES ; )
|
||||
{ sf_count_t position ;
|
||||
|
||||
readframes += sf_readf_float (data->sndfile, data->buffer_in + data->sfinfo.channels * readframes, INPUT_FRAMES - readframes) ;
|
||||
|
||||
position = sf_seek (data->sndfile, 0, SEEK_CUR) ;
|
||||
|
||||
if (position < 0 || position == data->sfinfo.frames)
|
||||
sf_seek (data->sndfile, 0, SEEK_SET) ;
|
||||
} ;
|
||||
|
||||
data->src_data.input_frames = readframes ;
|
||||
|
||||
data->src_data.src_ratio = 1.0 - 0.5 * sin (data->freq_point * 2 * M_PI / 20000) ;
|
||||
data->freq_point ++ ;
|
||||
|
||||
direct_out = (data->src_data.src_ratio * readframes < frames - frame_count) ? 1 : 0 ;
|
||||
|
||||
if (direct_out)
|
||||
{ data->src_data.data_out = samples + frame_count * data->sfinfo.channels ;
|
||||
data->src_data.output_frames = frames - frame_count ;
|
||||
}
|
||||
else
|
||||
{ data->src_data.data_out = data->buffer_out ;
|
||||
data->src_data.output_frames = BUFFER_LEN / data->sfinfo.channels ;
|
||||
} ;
|
||||
|
||||
if ((error = src_process (data->src_state, &data->src_data)))
|
||||
{ printf ("\nError : %s\n\n", src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (direct_out)
|
||||
{ frame_count += data->src_data.output_frames_gen ;
|
||||
continue ;
|
||||
} ;
|
||||
|
||||
memcpy (samples + frame_count * data->sfinfo.channels, data->buffer_out, (frames - frame_count) * data->sfinfo.channels * sizeof (float)) ;
|
||||
|
||||
data->buffer_out_start = frames - frame_count ;
|
||||
data->buffer_out_end = data->src_data.output_frames_gen ;
|
||||
|
||||
frame_count += frames - frame_count ;
|
||||
} ;
|
||||
|
||||
return frame_count ;
|
||||
} /* varispeed_get_data */
|
||||
|
||||
/*==============================================================================
|
||||
*/
|
||||
|
||||
#else /* (HAVE_SNFILE == 0) */
|
||||
|
||||
/* Alternative main function when libsndfile is not available. */
|
||||
|
||||
int
|
||||
main (void)
|
||||
{ puts (
|
||||
"\n"
|
||||
"****************************************************************\n"
|
||||
" This example program was compiled without libsndfile \n"
|
||||
" (http://www.zip.com.au/~erikd/libsndfile/).\n"
|
||||
" It is therefore completely broken and non-functional.\n"
|
||||
"****************************************************************\n"
|
||||
"\n"
|
||||
) ;
|
||||
|
||||
return 0 ;
|
||||
} /* main */
|
||||
|
||||
#endif
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
|
||||
%define name @PACKAGE@
|
||||
%define version @VERSION@
|
||||
%define release 1
|
||||
%define prefix /usr
|
||||
|
||||
Summary: A library to do sample rate conversion for audio.
|
||||
Name: %{name}
|
||||
Version: %{version}
|
||||
Release: %{release}
|
||||
Prefix: %{prefix}
|
||||
Copyright: LGPL
|
||||
Group: Libraries/Sound
|
||||
Source: http://www.mega-nerd.com/SRC/libsamplerate-%{version}.tar.gz
|
||||
URL: http://www.mega-nerd.com/SRC/
|
||||
BuildRoot: /var/tmp/%{name}-%{version}
|
||||
|
||||
%description
|
||||
libsamplerate is a C library capable of arbitrary and time varying
|
||||
conversions; from downsampling by a factor of 12 to upsampling by the
|
||||
same factor. The conversion ratio can also vary with time for speeding
|
||||
up and slowing down effects.
|
||||
|
||||
%package devel
|
||||
Summary: Libraries, includes, etc to develop libsamplerate applications
|
||||
Group: Libraries
|
||||
|
||||
%description devel
|
||||
Libraries, include files, etc you can use to develop libsamplerate applications.
|
||||
|
||||
%prep
|
||||
%setup
|
||||
|
||||
%build
|
||||
./configure --prefix=%{prefix}
|
||||
make
|
||||
|
||||
%install
|
||||
if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi
|
||||
mkdir -p $RPM_BUILD_ROOT
|
||||
make prefix=$RPM_BUILD_ROOT%{prefix} install
|
||||
|
||||
%clean
|
||||
if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc AUTHORS COPYING ChangeLog INSTALL NEWS README doc
|
||||
%prefix/lib/libsamplerate.so.*
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root)
|
||||
%{prefix}/lib/libsamplerate.a
|
||||
%{prefix}/lib/libsamplerate.la
|
||||
%{prefix}/lib/libsamplerate.so
|
||||
%{prefix}/include/samplerate.h
|
||||
%{prefix}/lib/pkgconfig/samplerate.pc
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: samplerate
|
||||
Description: An audio Sample Rate Conversion library
|
||||
Requires:
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -lsamplerate
|
||||
Cflags: -I${includedir}
|
|
@ -1,39 +0,0 @@
|
|||
# This file was automatically generated from the Makefile.am
|
||||
# DO NOT EDIT!
|
||||
|
||||
lib_LTLIBRARIES = libsamplerate.la
|
||||
include_HEADERS = samplerate.h
|
||||
|
||||
EXTRA_DIST = config.h.in Version_script.in check_asm.sh
|
||||
CLEANFILES = src_sinc.s
|
||||
|
||||
COEFF_HDRS = fastest_coeffs.h mid_qual_coeffs.h high_qual_coeffs.h
|
||||
|
||||
|
||||
noinst_HEADERS = common.h float_cast.h $(COEFF_HDRS)
|
||||
|
||||
SRC_SOURCES = samplerate.c src_sinc.c $(COEFF_HDRS) src_zoh.c src_linear.c
|
||||
|
||||
# MinGW requires -no-undefined if a DLL is to be built.
|
||||
libsamplerate_la_LDFLAGS = -no-undefined -version-info @SHARED_VERSION_INFO@ @SHLIB_VERSION_ARG@
|
||||
libsamplerate_la_SOURCES = $(SRC_SOURCES) $(noinst_HEADERS)
|
||||
libsamplerate_la_LIBADD = -lm
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# An extra check for bad asm.
|
||||
|
||||
check-asm : check_asm.sh src_sinc.s src_linear.s src_zoh.s
|
||||
@echo
|
||||
@echo
|
||||
$(srcdir)/check_asm.sh src_sinc.s
|
||||
$(srcdir)/check_asm.sh src_linear.s
|
||||
$(srcdir)/check_asm.sh src_zoh.s
|
||||
@echo
|
||||
@echo
|
||||
|
||||
%.s : $(srcdir)/%.c
|
||||
$(CC) -S $(CFLAGS) $(DEFAULT_INCLUDES) $(srcdir)/$+ -o $@
|
||||
|
||||
# Disable autoheader.
|
||||
AUTOHEADER=echo
|
||||
|
|
@ -1,656 +0,0 @@
|
|||
# Makefile.in generated by automake 1.11.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
# This file was automatically generated from the Makefile.am
|
||||
# DO NOT EDIT!
|
||||
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = src
|
||||
DIST_COMMON = $(include_HEADERS) $(noinst_HEADERS) \
|
||||
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
$(srcdir)/Version_script.in $(srcdir)/config.h.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/M4/check_signal.m4 \
|
||||
$(top_srcdir)/M4/clip_mode.m4 $(top_srcdir)/M4/endian.m4 \
|
||||
$(top_srcdir)/M4/libtool.m4 $(top_srcdir)/M4/lrint.m4 \
|
||||
$(top_srcdir)/M4/lrintf.m4 $(top_srcdir)/M4/ltoptions.m4 \
|
||||
$(top_srcdir)/M4/ltsugar.m4 $(top_srcdir)/M4/ltversion.m4 \
|
||||
$(top_srcdir)/M4/lt~obsolete.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES = Version_script
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
|
||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
||||
libsamplerate_la_DEPENDENCIES =
|
||||
am__objects_1 =
|
||||
am__objects_2 = samplerate.lo src_sinc.lo $(am__objects_1) src_zoh.lo \
|
||||
src_linear.lo
|
||||
am__objects_3 = $(am__objects_1)
|
||||
am_libsamplerate_la_OBJECTS = $(am__objects_2) $(am__objects_3)
|
||||
libsamplerate_la_OBJECTS = $(am_libsamplerate_la_OBJECTS)
|
||||
AM_V_lt = $(am__v_lt_$(V))
|
||||
am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_lt_0 = --silent
|
||||
libsamplerate_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
|
||||
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
|
||||
$(AM_CFLAGS) $(CFLAGS) $(libsamplerate_la_LDFLAGS) $(LDFLAGS) \
|
||||
-o $@
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@
|
||||
depcomp = $(SHELL) $(top_srcdir)/Cfg/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
AM_V_CC = $(am__v_CC_$(V))
|
||||
am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_CC_0 = @echo " CC " $@;
|
||||
AM_V_at = $(am__v_at_$(V))
|
||||
am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_at_0 = @
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_CCLD = $(am__v_CCLD_$(V))
|
||||
am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
||||
AM_V_GEN = $(am__v_GEN_$(V))
|
||||
am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
SOURCES = $(libsamplerate_la_SOURCES)
|
||||
DIST_SOURCES = $(libsamplerate_la_SOURCES)
|
||||
HEADERS = $(include_HEADERS) $(noinst_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
|
||||
# Disable autoheader.
|
||||
AUTOHEADER = echo
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPILER_IS_GCC = @COMPILER_IS_GCC@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DLLWRAP = @DLLWRAP@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FFTW3_CFLAGS = @FFTW3_CFLAGS@
|
||||
FFTW3_LIBS = @FFTW3_LIBS@
|
||||
FGREP = @FGREP@
|
||||
GCC_MAJOR_VERSION = @GCC_MAJOR_VERSION@
|
||||
GREP = @GREP@
|
||||
HAVE_FFTW3 = @HAVE_FFTW3@
|
||||
HAVE_SNDFILE = @HAVE_SNDFILE@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OS_SPECIFIC_INCLUDES = @OS_SPECIFIC_INCLUDES@
|
||||
OS_SPECIFIC_LINKS = @OS_SPECIFIC_LINKS@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PEXPORTS = @PEXPORTS@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
RANLIB = @RANLIB@
|
||||
RC = @RC@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHARED_VERSION_INFO = @SHARED_VERSION_INFO@
|
||||
SHELL = @SHELL@
|
||||
SHLIB_VERSION_ARG = @SHLIB_VERSION_ARG@
|
||||
SNDFILE_CFLAGS = @SNDFILE_CFLAGS@
|
||||
SNDFILE_LIBS = @SNDFILE_LIBS@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
htmldocdir = @htmldocdir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
lib_LTLIBRARIES = libsamplerate.la
|
||||
include_HEADERS = samplerate.h
|
||||
EXTRA_DIST = config.h.in Version_script.in check_asm.sh
|
||||
CLEANFILES = src_sinc.s
|
||||
COEFF_HDRS = fastest_coeffs.h mid_qual_coeffs.h high_qual_coeffs.h
|
||||
noinst_HEADERS = common.h float_cast.h $(COEFF_HDRS)
|
||||
SRC_SOURCES = samplerate.c src_sinc.c $(COEFF_HDRS) src_zoh.c src_linear.c
|
||||
|
||||
# MinGW requires -no-undefined if a DLL is to be built.
|
||||
libsamplerate_la_LDFLAGS = -no-undefined -version-info @SHARED_VERSION_INFO@ @SHLIB_VERSION_ARG@
|
||||
libsamplerate_la_SOURCES = $(SRC_SOURCES) $(noinst_HEADERS)
|
||||
libsamplerate_la_LIBADD = -lm
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu src/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
config.h: stamp-h1
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h1; \
|
||||
$(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
|
||||
else :; fi
|
||||
|
||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status src/config.h
|
||||
$(srcdir)/config.h.in: $(am__configure_deps)
|
||||
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h stamp-h1
|
||||
Version_script: $(top_builddir)/config.status $(srcdir)/Version_script.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
|
||||
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
|
||||
list2=; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
list2="$$list2 $$p"; \
|
||||
else :; fi; \
|
||||
done; \
|
||||
test -z "$$list2" || { \
|
||||
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
|
||||
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
|
||||
}
|
||||
|
||||
uninstall-libLTLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
|
||||
for p in $$list; do \
|
||||
$(am__strip_dir) \
|
||||
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
|
||||
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
|
||||
done
|
||||
|
||||
clean-libLTLIBRARIES:
|
||||
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
|
||||
test "$$dir" != "$$p" || dir=.; \
|
||||
echo "rm -f \"$${dir}/so_locations\""; \
|
||||
rm -f "$${dir}/so_locations"; \
|
||||
done
|
||||
libsamplerate.la: $(libsamplerate_la_OBJECTS) $(libsamplerate_la_DEPENDENCIES)
|
||||
$(AM_V_CCLD)$(libsamplerate_la_LINK) -rpath $(libdir) $(libsamplerate_la_OBJECTS) $(libsamplerate_la_LIBADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/samplerate.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/src_linear.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/src_sinc.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/src_zoh.Plo@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-includeHEADERS: $(include_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
|
||||
@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
|
||||
$(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-includeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
test -n "$$files" || exit 0; \
|
||||
echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(includedir)" && rm -f $$files
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-hdr distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-includeHEADERS
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am: install-libLTLIBRARIES
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES
|
||||
|
||||
.MAKE: all install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libLTLIBRARIES clean-libtool ctags distclean \
|
||||
distclean-compile distclean-generic distclean-hdr \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am \
|
||||
install-includeHEADERS install-info install-info-am \
|
||||
install-libLTLIBRARIES install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags uninstall uninstall-am uninstall-includeHEADERS \
|
||||
uninstall-libLTLIBRARIES
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# An extra check for bad asm.
|
||||
|
||||
check-asm : check_asm.sh src_sinc.s src_linear.s src_zoh.s
|
||||
@echo
|
||||
@echo
|
||||
$(srcdir)/check_asm.sh src_sinc.s
|
||||
$(srcdir)/check_asm.sh src_linear.s
|
||||
$(srcdir)/check_asm.sh src_zoh.s
|
||||
@echo
|
||||
@echo
|
||||
|
||||
%.s : $(srcdir)/%.c
|
||||
$(CC) -S $(CFLAGS) $(DEFAULT_INCLUDES) $(srcdir)/$+ -o $@
|
||||
|
||||
# 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:
|
|
@ -1,53 +0,0 @@
|
|||
#
|
||||
# Export file for libsamplerate
|
||||
#
|
||||
# Only the symbols listed in the global section will be callable from
|
||||
# applications linking to libsamplerate.
|
||||
#
|
||||
|
||||
@PACKAGE@.so.0.0
|
||||
{
|
||||
global:
|
||||
src_new ;
|
||||
src_delete ;
|
||||
src_get_name ;
|
||||
src_get_description ;
|
||||
src_get_version ;
|
||||
src_process ;
|
||||
src_reset ;
|
||||
src_error ;
|
||||
src_strerror ;
|
||||
src_simple ;
|
||||
src_is_valid_ratio ;
|
||||
src_set_ratio ;
|
||||
|
||||
local:
|
||||
*;
|
||||
};
|
||||
|
||||
@PACKAGE@.so.0.1
|
||||
{
|
||||
global:
|
||||
src_new ;
|
||||
src_delete ;
|
||||
src_get_name ;
|
||||
src_get_description ;
|
||||
src_get_version ;
|
||||
src_process ;
|
||||
src_reset ;
|
||||
src_error ;
|
||||
src_strerror ;
|
||||
src_simple ;
|
||||
src_is_valid_ratio ;
|
||||
src_set_ratio ;
|
||||
|
||||
src_callback_new ;
|
||||
src_callback_read ;
|
||||
|
||||
src_short_to_float_array ;
|
||||
src_float_to_short_array ;
|
||||
src_int_to_float_array ;
|
||||
src_float_to_int_array ;
|
||||
local:
|
||||
*;
|
||||
};
|
|
@ -1,47 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2004-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
#
|
||||
# This program 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.
|
||||
|
||||
#=======================================================================
|
||||
# This short test script compiles the file src_sinc.c into assembler
|
||||
# output and the greps the assembler output for the fldcw (FPU Load
|
||||
# Control Word) instruction which is very detrimental to the perfromance
|
||||
# of floating point code.
|
||||
|
||||
echo -n " Checking assembler output for bad code : "
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Error : Need the name of the input file."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
filename=$1
|
||||
|
||||
if [ ! -f $filename ];then
|
||||
echo "Error : Can't find file $filename."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
count=`grep fldcw $filename | wc -l`
|
||||
|
||||
if [ $count -gt 0 ]; then
|
||||
echo -e "\n\nError : found $count bad instructions.\n\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "ok"
|
||||
|
|
@ -1,169 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
** This code is part of Secret Rabbit Code aka libsamplerate. A commercial
|
||||
** use license for this code is available, please see:
|
||||
** http://www.mega-nerd.com/SRC/procedure.html
|
||||
*/
|
||||
|
||||
#ifndef COMMON_H_INCLUDED
|
||||
#define COMMON_H_INCLUDED
|
||||
|
||||
#ifdef HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#elif (SIZEOF_INT == 4)
|
||||
typedef int int32_t ;
|
||||
#elif (SIZEOF_LONG == 4)
|
||||
typedef long int32_t ;
|
||||
#endif
|
||||
|
||||
#define SRC_MAX_RATIO 256
|
||||
#define SRC_MAX_RATIO_STR "256"
|
||||
|
||||
#define SRC_MIN_RATIO_DIFF (1e-20)
|
||||
|
||||
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
|
||||
|
||||
#define ARRAY_LEN(x) ((int) (sizeof (x) / sizeof ((x) [0])))
|
||||
#define OFFSETOF(type,member) ((int) (&((type*) 0)->member))
|
||||
|
||||
#define MAKE_MAGIC(a,b,c,d,e,f) ((a) + ((b) << 4) + ((c) << 8) + ((d) << 12) + ((e) << 16) + ((f) << 20))
|
||||
|
||||
/*
|
||||
** Inspiration : http://sourcefrog.net/weblog/software/languages/C/unused.html
|
||||
*/
|
||||
#ifdef UNUSED
|
||||
#elif defined (__GNUC__)
|
||||
# define UNUSED(x) UNUSED_ ## x __attribute__ ((unused))
|
||||
#elif defined (__LCLINT__)
|
||||
# define UNUSED(x) /*@unused@*/ x
|
||||
#else
|
||||
# define UNUSED(x) x
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define WARN_UNUSED __attribute__ ((warn_unused_result))
|
||||
#else
|
||||
# define WARN_UNUSED
|
||||
#endif
|
||||
|
||||
|
||||
#include "samplerate.h"
|
||||
|
||||
enum
|
||||
{ SRC_FALSE = 0,
|
||||
SRC_TRUE = 1,
|
||||
|
||||
SRC_MODE_PROCESS = 555,
|
||||
SRC_MODE_CALLBACK = 556
|
||||
} ;
|
||||
|
||||
enum
|
||||
{ SRC_ERR_NO_ERROR = 0,
|
||||
|
||||
SRC_ERR_MALLOC_FAILED,
|
||||
SRC_ERR_BAD_STATE,
|
||||
SRC_ERR_BAD_DATA,
|
||||
SRC_ERR_BAD_DATA_PTR,
|
||||
SRC_ERR_NO_PRIVATE,
|
||||
SRC_ERR_BAD_SRC_RATIO,
|
||||
SRC_ERR_BAD_PROC_PTR,
|
||||
SRC_ERR_SHIFT_BITS,
|
||||
SRC_ERR_FILTER_LEN,
|
||||
SRC_ERR_BAD_CONVERTER,
|
||||
SRC_ERR_BAD_CHANNEL_COUNT,
|
||||
SRC_ERR_SINC_BAD_BUFFER_LEN,
|
||||
SRC_ERR_SIZE_INCOMPATIBILITY,
|
||||
SRC_ERR_BAD_PRIV_PTR,
|
||||
SRC_ERR_BAD_SINC_STATE,
|
||||
SRC_ERR_DATA_OVERLAP,
|
||||
SRC_ERR_BAD_CALLBACK,
|
||||
SRC_ERR_BAD_MODE,
|
||||
SRC_ERR_NULL_CALLBACK,
|
||||
SRC_ERR_NO_VARIABLE_RATIO,
|
||||
SRC_ERR_SINC_PREPARE_DATA_BAD_LEN,
|
||||
|
||||
/* This must be the last error number. */
|
||||
SRC_ERR_MAX_ERROR
|
||||
} ;
|
||||
|
||||
typedef struct SRC_PRIVATE_tag
|
||||
{ double last_ratio, last_position ;
|
||||
|
||||
int error ;
|
||||
int channels ;
|
||||
|
||||
/* SRC_MODE_PROCESS or SRC_MODE_CALLBACK */
|
||||
int mode ;
|
||||
|
||||
/* Pointer to data to converter specific data. */
|
||||
void *private_data ;
|
||||
|
||||
/* Varispeed process function. */
|
||||
int (*vari_process) (struct SRC_PRIVATE_tag *psrc, SRC_DATA *data) ;
|
||||
|
||||
/* Constant speed process function. */
|
||||
int (*const_process) (struct SRC_PRIVATE_tag *psrc, SRC_DATA *data) ;
|
||||
|
||||
/* State reset. */
|
||||
void (*reset) (struct SRC_PRIVATE_tag *psrc) ;
|
||||
|
||||
/* Data specific to SRC_MODE_CALLBACK. */
|
||||
src_callback_t callback_func ;
|
||||
void *user_callback_data ;
|
||||
long saved_frames ;
|
||||
float *saved_data ;
|
||||
} SRC_PRIVATE ;
|
||||
|
||||
/* In src_sinc.c */
|
||||
const char* sinc_get_name (int src_enum) ;
|
||||
const char* sinc_get_description (int src_enum) ;
|
||||
|
||||
int sinc_set_converter (SRC_PRIVATE *psrc, int src_enum) ;
|
||||
|
||||
/* In src_linear.c */
|
||||
const char* linear_get_name (int src_enum) ;
|
||||
const char* linear_get_description (int src_enum) ;
|
||||
|
||||
int linear_set_converter (SRC_PRIVATE *psrc, int src_enum) ;
|
||||
|
||||
/* In src_zoh.c */
|
||||
const char* zoh_get_name (int src_enum) ;
|
||||
const char* zoh_get_description (int src_enum) ;
|
||||
|
||||
int zoh_set_converter (SRC_PRIVATE *psrc, int src_enum) ;
|
||||
|
||||
/*----------------------------------------------------------
|
||||
** Common static inline functions.
|
||||
*/
|
||||
|
||||
static inline double
|
||||
fmod_one (double x)
|
||||
{ double res ;
|
||||
|
||||
res = x - lrint (x) ;
|
||||
if (res < 0.0)
|
||||
return res + 1.0 ;
|
||||
|
||||
return res ;
|
||||
} /* fmod_one */
|
||||
|
||||
#endif /* COMMON_H_INCLUDED */
|
||||
|
|
@ -1,149 +0,0 @@
|
|||
/* src/config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Set to 1 if the compile is GNU GCC. */
|
||||
#undef COMPILER_IS_GCC
|
||||
|
||||
/* Target processor clips on negative float to int conversion. */
|
||||
#undef CPU_CLIPS_NEGATIVE
|
||||
|
||||
/* Target processor clips on positive float to int conversion. */
|
||||
#undef CPU_CLIPS_POSITIVE
|
||||
|
||||
/* Target processor is big endian. */
|
||||
#undef CPU_IS_BIG_ENDIAN
|
||||
|
||||
/* Target processor is little endian. */
|
||||
#undef CPU_IS_LITTLE_ENDIAN
|
||||
|
||||
/* Major version of GCC or 3 otherwise. */
|
||||
#undef GCC_MAJOR_VERSION
|
||||
|
||||
/* Define to 1 if you have the `alarm' function. */
|
||||
#undef HAVE_ALARM
|
||||
|
||||
/* Define to 1 if you have the `calloc' function. */
|
||||
#undef HAVE_CALLOC
|
||||
|
||||
/* Define to 1 if you have the `ceil' function. */
|
||||
#undef HAVE_CEIL
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Set to 1 if you have libfftw3. */
|
||||
#undef HAVE_FFTW3
|
||||
|
||||
/* Define to 1 if you have the `floor' function. */
|
||||
#undef HAVE_FLOOR
|
||||
|
||||
/* Define to 1 if you have the `fmod' function. */
|
||||
#undef HAVE_FMOD
|
||||
|
||||
/* Define to 1 if you have the `free' function. */
|
||||
#undef HAVE_FREE
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the `m' library (-lm). */
|
||||
#undef HAVE_LIBM
|
||||
|
||||
/* Define if you have C99's lrint function. */
|
||||
#undef HAVE_LRINT
|
||||
|
||||
/* Define if you have C99's lrintf function. */
|
||||
#undef HAVE_LRINTF
|
||||
|
||||
/* Define to 1 if you have the `malloc' function. */
|
||||
#undef HAVE_MALLOC
|
||||
|
||||
/* Define to 1 if you have the `memcpy' function. */
|
||||
#undef HAVE_MEMCPY
|
||||
|
||||
/* Define to 1 if you have the `memmove' function. */
|
||||
#undef HAVE_MEMMOVE
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define if you have signal SIGALRM. */
|
||||
#undef HAVE_SIGALRM
|
||||
|
||||
/* Define to 1 if you have the `signal' function. */
|
||||
#undef HAVE_SIGNAL
|
||||
|
||||
/* Set to 1 if you have libsndfile. */
|
||||
#undef HAVE_SNDFILE
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/times.h> header file. */
|
||||
#undef HAVE_SYS_TIMES_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
#undef LT_OBJDIR
|
||||
|
||||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
||||
#undef NO_MINUS_C_MINUS_O
|
||||
|
||||
/* Set to 1 if compiling for Win32 */
|
||||
#undef OS_IS_WIN32
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#undef PACKAGE_URL
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* The size of `double', as computed by sizeof. */
|
||||
#undef SIZEOF_DOUBLE
|
||||
|
||||
/* The size of `float', as computed by sizeof. */
|
||||
#undef SIZEOF_FLOAT
|
||||
|
||||
/* The size of `int', as computed by sizeof. */
|
||||
#undef SIZEOF_INT
|
||||
|
||||
/* The size of `long', as computed by sizeof. */
|
||||
#undef SIZEOF_LONG
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
File diff suppressed because it is too large
Load diff
|
@ -1,281 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2001-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.1 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 Lesser General Public License for more details.
|
||||
**
|
||||
** You should have received a copy of the GNU Lesser 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.
|
||||
*/
|
||||
|
||||
/* Version 1.5 */
|
||||
|
||||
#ifndef FLOAT_CAST_HEADER
|
||||
#define FLOAT_CAST_HEADER
|
||||
|
||||
/*============================================================================
|
||||
** On Intel Pentium processors (especially PIII and probably P4), converting
|
||||
** from float to int is very slow. To meet the C specs, the code produced by
|
||||
** most C compilers targeting Pentium needs to change the FPU rounding mode
|
||||
** before the float to int conversion is performed.
|
||||
**
|
||||
** Changing the FPU rounding mode causes the FPU pipeline to be flushed. It
|
||||
** is this flushing of the pipeline which is so slow.
|
||||
**
|
||||
** Fortunately the ISO C99 specifications define the functions lrint, lrintf,
|
||||
** llrint and llrintf which fix this problem as a side effect.
|
||||
**
|
||||
** On Unix-like systems, the configure process should have detected the
|
||||
** presence of these functions. If they weren't found we have to replace them
|
||||
** here with a standard C cast.
|
||||
*/
|
||||
|
||||
/*
|
||||
** The C99 prototypes for lrint and lrintf are as follows:
|
||||
**
|
||||
** long int lrintf (float x) ;
|
||||
** long int lrint (double x) ;
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
/*
|
||||
** The presence of the required functions are detected during the configure
|
||||
** process and the values HAVE_LRINT and HAVE_LRINTF are set accordingly in
|
||||
** the config.h file.
|
||||
*/
|
||||
|
||||
#define HAVE_LRINT_REPLACEMENT 0
|
||||
|
||||
#if (HAVE_LRINT && HAVE_LRINTF)
|
||||
|
||||
/*
|
||||
** These defines enable functionality introduced with the 1999 ISO C
|
||||
** standard. They must be defined before the inclusion of math.h to
|
||||
** engage them. If optimisation is enabled, these functions will be
|
||||
** inlined. With optimisation switched off, you have to link in the
|
||||
** maths library using -lm.
|
||||
*/
|
||||
|
||||
#define _ISOC9X_SOURCE 1
|
||||
#define _ISOC99_SOURCE 1
|
||||
|
||||
#define __USE_ISOC9X 1
|
||||
#define __USE_ISOC99 1
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#elif (defined (__CYGWIN__))
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#undef HAVE_LRINT_REPLACEMENT
|
||||
#define HAVE_LRINT_REPLACEMENT 1
|
||||
|
||||
#undef lrint
|
||||
#undef lrintf
|
||||
|
||||
#define lrint double2int
|
||||
#define lrintf float2int
|
||||
|
||||
/*
|
||||
** The native CYGWIN lrint and lrintf functions are buggy:
|
||||
** http://sourceware.org/ml/cygwin/2005-06/msg00153.html
|
||||
** http://sourceware.org/ml/cygwin/2005-09/msg00047.html
|
||||
** and slow.
|
||||
** These functions (pulled from the Public Domain MinGW math.h header)
|
||||
** replace the native versions.
|
||||
*/
|
||||
|
||||
static inline long double2int (double in)
|
||||
{ long retval ;
|
||||
|
||||
__asm__ __volatile__
|
||||
( "fistpl %0"
|
||||
: "=m" (retval)
|
||||
: "t" (in)
|
||||
: "st"
|
||||
) ;
|
||||
|
||||
return retval ;
|
||||
} /* double2int */
|
||||
|
||||
static inline long float2int (float in)
|
||||
{ long retval ;
|
||||
|
||||
__asm__ __volatile__
|
||||
( "fistpl %0"
|
||||
: "=m" (retval)
|
||||
: "t" (in)
|
||||
: "st"
|
||||
) ;
|
||||
|
||||
return retval ;
|
||||
} /* float2int */
|
||||
|
||||
#elif (defined (WIN64) || defined(_WIN64))
|
||||
|
||||
/* Win64 section should be places before Win32 one, because
|
||||
** most likely both WIN32 and WIN64 will be defined in 64-bit case.
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
|
||||
/* Win64 doesn't seem to have these functions, nor inline assembly.
|
||||
** Therefore implement inline versions of these functions here.
|
||||
*/
|
||||
#include <emmintrin.h>
|
||||
#include <mmintrin.h>
|
||||
|
||||
__inline long int
|
||||
lrint(double flt)
|
||||
{
|
||||
return _mm_cvtsd_si32(_mm_load_sd(&flt));
|
||||
}
|
||||
|
||||
__inline long int
|
||||
lrintf(float flt)
|
||||
{
|
||||
return _mm_cvtss_si32(_mm_load_ss(&flt));
|
||||
}
|
||||
|
||||
#elif (defined (WIN32) || defined (_WIN32))
|
||||
|
||||
#undef HAVE_LRINT_REPLACEMENT
|
||||
#define HAVE_LRINT_REPLACEMENT 1
|
||||
|
||||
#include <math.h>
|
||||
|
||||
/*
|
||||
** Win32 doesn't seem to have these functions.
|
||||
** Therefore implement inline versions of these functions here.
|
||||
*/
|
||||
|
||||
__inline long int
|
||||
lrint (double flt)
|
||||
{ int intgr ;
|
||||
|
||||
_asm
|
||||
{ fld flt
|
||||
fistp intgr
|
||||
} ;
|
||||
|
||||
return intgr ;
|
||||
}
|
||||
|
||||
__inline long int
|
||||
lrintf (float flt)
|
||||
{ int intgr ;
|
||||
|
||||
_asm
|
||||
{ fld flt
|
||||
fistp intgr
|
||||
} ;
|
||||
|
||||
return intgr ;
|
||||
}
|
||||
|
||||
#elif (defined (__MWERKS__) && defined (macintosh))
|
||||
|
||||
/* This MacOS 9 solution was provided by Stephane Letz */
|
||||
|
||||
#undef HAVE_LRINT_REPLACEMENT
|
||||
#define HAVE_LRINT_REPLACEMENT 1
|
||||
#include <math.h>
|
||||
|
||||
#undef lrint
|
||||
#undef lrintf
|
||||
|
||||
#define lrint double2int
|
||||
#define lrintf float2int
|
||||
|
||||
inline int
|
||||
float2int (register float in)
|
||||
{ long res [2] ;
|
||||
|
||||
asm
|
||||
{ fctiw in, in
|
||||
stfd in, res
|
||||
}
|
||||
return res [1] ;
|
||||
} /* float2int */
|
||||
|
||||
inline int
|
||||
double2int (register double in)
|
||||
{ long res [2] ;
|
||||
|
||||
asm
|
||||
{ fctiw in, in
|
||||
stfd in, res
|
||||
}
|
||||
return res [1] ;
|
||||
} /* double2int */
|
||||
|
||||
#elif (defined (__MACH__) && defined (__APPLE__))
|
||||
|
||||
/* For Apple MacOSX. */
|
||||
|
||||
#undef HAVE_LRINT_REPLACEMENT
|
||||
#define HAVE_LRINT_REPLACEMENT 1
|
||||
#include <math.h>
|
||||
|
||||
#undef lrint
|
||||
#undef lrintf
|
||||
|
||||
#define lrint double2int
|
||||
#define lrintf float2int
|
||||
|
||||
inline static long
|
||||
float2int (register float in)
|
||||
{ int res [2] ;
|
||||
|
||||
__asm__ __volatile__
|
||||
( "fctiw %1, %1\n\t"
|
||||
"stfd %1, %0"
|
||||
: "=m" (res) /* Output */
|
||||
: "f" (in) /* Input */
|
||||
: "memory"
|
||||
) ;
|
||||
|
||||
return res [1] ;
|
||||
} /* lrintf */
|
||||
|
||||
inline static long
|
||||
double2int (register double in)
|
||||
{ int res [2] ;
|
||||
|
||||
__asm__ __volatile__
|
||||
( "fctiw %1, %1\n\t"
|
||||
"stfd %1, %0"
|
||||
: "=m" (res) /* Output */
|
||||
: "f" (in) /* Input */
|
||||
: "memory"
|
||||
) ;
|
||||
|
||||
return res [1] ;
|
||||
} /* lrint */
|
||||
|
||||
#else
|
||||
#ifndef __sgi
|
||||
#warning "Don't have the functions lrint() and lrintf()."
|
||||
#warning "Replacing these functions with a standard C cast."
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#define lrint(dbl) ((long) (dbl))
|
||||
#define lrintf(flt) ((long) (flt))
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* FLOAT_CAST_HEADER */
|
||||
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,545 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
** This code is part of Secret Rabbit Code aka libsamplerate. A commercial
|
||||
** use license for this code is available, please see:
|
||||
** http://www.mega-nerd.com/SRC/procedure.html
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "samplerate.h"
|
||||
#include "float_cast.h"
|
||||
#include "common.h"
|
||||
|
||||
static int psrc_set_converter (SRC_PRIVATE *psrc, int converter_type) ;
|
||||
|
||||
|
||||
static inline int
|
||||
is_bad_src_ratio (double ratio)
|
||||
{ return (ratio < (1.0 / SRC_MAX_RATIO) || ratio > (1.0 * SRC_MAX_RATIO)) ;
|
||||
} /* is_bad_src_ratio */
|
||||
|
||||
SRC_STATE *
|
||||
src_new (int converter_type, int channels, int *error)
|
||||
{ SRC_PRIVATE *psrc ;
|
||||
|
||||
if (error)
|
||||
*error = SRC_ERR_NO_ERROR ;
|
||||
|
||||
if (channels < 1)
|
||||
{ if (error)
|
||||
*error = SRC_ERR_BAD_CHANNEL_COUNT ;
|
||||
return NULL ;
|
||||
} ;
|
||||
|
||||
if ((psrc = calloc (1, sizeof (*psrc))) == NULL)
|
||||
{ if (error)
|
||||
*error = SRC_ERR_MALLOC_FAILED ;
|
||||
return NULL ;
|
||||
} ;
|
||||
|
||||
psrc->channels = channels ;
|
||||
psrc->mode = SRC_MODE_PROCESS ;
|
||||
|
||||
if (psrc_set_converter (psrc, converter_type) != SRC_ERR_NO_ERROR)
|
||||
{ if (error)
|
||||
*error = SRC_ERR_BAD_CONVERTER ;
|
||||
free (psrc) ;
|
||||
psrc = NULL ;
|
||||
} ;
|
||||
|
||||
src_reset ((SRC_STATE*) psrc) ;
|
||||
|
||||
return (SRC_STATE*) psrc ;
|
||||
} /* src_new */
|
||||
|
||||
SRC_STATE*
|
||||
src_callback_new (src_callback_t func, int converter_type, int channels, int *error, void* cb_data)
|
||||
{ SRC_STATE *src_state ;
|
||||
|
||||
if (func == NULL)
|
||||
{ if (error)
|
||||
*error = SRC_ERR_BAD_CALLBACK ;
|
||||
return NULL ;
|
||||
} ;
|
||||
|
||||
if (error != NULL)
|
||||
*error = 0 ;
|
||||
|
||||
if ((src_state = src_new (converter_type, channels, error)) == NULL)
|
||||
return NULL ;
|
||||
|
||||
src_reset (src_state) ;
|
||||
|
||||
((SRC_PRIVATE*) src_state)->mode = SRC_MODE_CALLBACK ;
|
||||
((SRC_PRIVATE*) src_state)->callback_func = func ;
|
||||
((SRC_PRIVATE*) src_state)->user_callback_data = cb_data ;
|
||||
|
||||
return src_state ;
|
||||
} /* src_callback_new */
|
||||
|
||||
SRC_STATE *
|
||||
src_delete (SRC_STATE *state)
|
||||
{ SRC_PRIVATE *psrc ;
|
||||
|
||||
psrc = (SRC_PRIVATE*) state ;
|
||||
if (psrc)
|
||||
{ if (psrc->private_data)
|
||||
free (psrc->private_data) ;
|
||||
memset (psrc, 0, sizeof (SRC_PRIVATE)) ;
|
||||
free (psrc) ;
|
||||
} ;
|
||||
|
||||
return NULL ;
|
||||
} /* src_state */
|
||||
|
||||
int
|
||||
src_process (SRC_STATE *state, SRC_DATA *data)
|
||||
{ SRC_PRIVATE *psrc ;
|
||||
int error ;
|
||||
|
||||
psrc = (SRC_PRIVATE*) state ;
|
||||
|
||||
if (psrc == NULL)
|
||||
return SRC_ERR_BAD_STATE ;
|
||||
if (psrc->vari_process == NULL || psrc->const_process == NULL)
|
||||
return SRC_ERR_BAD_PROC_PTR ;
|
||||
|
||||
if (psrc->mode != SRC_MODE_PROCESS)
|
||||
return SRC_ERR_BAD_MODE ;
|
||||
|
||||
/* Check for valid SRC_DATA first. */
|
||||
if (data == NULL)
|
||||
return SRC_ERR_BAD_DATA ;
|
||||
|
||||
/* And that data_in and data_out are valid. */
|
||||
if (data->data_in == NULL || data->data_out == NULL)
|
||||
return SRC_ERR_BAD_DATA_PTR ;
|
||||
|
||||
/* Check src_ratio is in range. */
|
||||
if (is_bad_src_ratio (data->src_ratio))
|
||||
return SRC_ERR_BAD_SRC_RATIO ;
|
||||
|
||||
if (data->input_frames < 0)
|
||||
data->input_frames = 0 ;
|
||||
if (data->output_frames < 0)
|
||||
data->output_frames = 0 ;
|
||||
|
||||
if (data->data_in < data->data_out)
|
||||
{ if (data->data_in + data->input_frames * psrc->channels > data->data_out)
|
||||
{ /*-printf ("\n\ndata_in: %p data_out: %p\n",
|
||||
(void*) (data->data_in + data->input_frames * psrc->channels), (void*) data->data_out) ;-*/
|
||||
return SRC_ERR_DATA_OVERLAP ;
|
||||
} ;
|
||||
}
|
||||
else if (data->data_out + data->output_frames * psrc->channels > data->data_in)
|
||||
{ /*-printf ("\n\ndata_in : %p ouput frames: %ld data_out: %p\n", (void*) data->data_in, data->output_frames, (void*) data->data_out) ;
|
||||
|
||||
printf ("data_out: %p (%p) data_in: %p\n", (void*) data->data_out,
|
||||
(void*) (data->data_out + data->input_frames * psrc->channels), (void*) data->data_in) ;-*/
|
||||
return SRC_ERR_DATA_OVERLAP ;
|
||||
} ;
|
||||
|
||||
/* Set the input and output counts to zero. */
|
||||
data->input_frames_used = 0 ;
|
||||
data->output_frames_gen = 0 ;
|
||||
|
||||
/* Special case for when last_ratio has not been set. */
|
||||
if (psrc->last_ratio < (1.0 / SRC_MAX_RATIO))
|
||||
psrc->last_ratio = data->src_ratio ;
|
||||
|
||||
/* Now process. */
|
||||
if (fabs (psrc->last_ratio - data->src_ratio) < 1e-15)
|
||||
error = psrc->const_process (psrc, data) ;
|
||||
else
|
||||
error = psrc->vari_process (psrc, data) ;
|
||||
|
||||
return error ;
|
||||
} /* src_process */
|
||||
|
||||
long
|
||||
src_callback_read (SRC_STATE *state, double src_ratio, long frames, float *data)
|
||||
{ SRC_PRIVATE *psrc ;
|
||||
SRC_DATA src_data ;
|
||||
|
||||
long output_frames_gen ;
|
||||
int error = 0 ;
|
||||
|
||||
if (state == NULL)
|
||||
return 0 ;
|
||||
|
||||
if (frames <= 0)
|
||||
return 0 ;
|
||||
|
||||
psrc = (SRC_PRIVATE*) state ;
|
||||
|
||||
if (psrc->mode != SRC_MODE_CALLBACK)
|
||||
{ psrc->error = SRC_ERR_BAD_MODE ;
|
||||
return 0 ;
|
||||
} ;
|
||||
|
||||
if (psrc->callback_func == NULL)
|
||||
{ psrc->error = SRC_ERR_NULL_CALLBACK ;
|
||||
return 0 ;
|
||||
} ;
|
||||
|
||||
memset (&src_data, 0, sizeof (src_data)) ;
|
||||
|
||||
/* Check src_ratio is in range. */
|
||||
if (is_bad_src_ratio (src_ratio))
|
||||
{ psrc->error = SRC_ERR_BAD_SRC_RATIO ;
|
||||
return 0 ;
|
||||
} ;
|
||||
|
||||
/* Switch modes temporarily. */
|
||||
src_data.src_ratio = src_ratio ;
|
||||
src_data.data_out = data ;
|
||||
src_data.output_frames = frames ;
|
||||
|
||||
src_data.data_in = psrc->saved_data ;
|
||||
src_data.input_frames = psrc->saved_frames ;
|
||||
|
||||
output_frames_gen = 0 ;
|
||||
while (output_frames_gen < frames)
|
||||
{ /* Use a dummy array for the case where the callback function
|
||||
** returns without setting the ptr.
|
||||
*/
|
||||
float dummy [1] ;
|
||||
|
||||
if (src_data.input_frames == 0)
|
||||
{ float *ptr = dummy ;
|
||||
|
||||
src_data.input_frames = psrc->callback_func (psrc->user_callback_data, &ptr) ;
|
||||
src_data.data_in = ptr ;
|
||||
|
||||
if (src_data.input_frames == 0)
|
||||
src_data.end_of_input = 1 ;
|
||||
} ;
|
||||
|
||||
/*
|
||||
** Now call process function. However, we need to set the mode
|
||||
** to SRC_MODE_PROCESS first and when we return set it back to
|
||||
** SRC_MODE_CALLBACK.
|
||||
*/
|
||||
psrc->mode = SRC_MODE_PROCESS ;
|
||||
error = src_process (state, &src_data) ;
|
||||
psrc->mode = SRC_MODE_CALLBACK ;
|
||||
|
||||
if (error != 0)
|
||||
break ;
|
||||
|
||||
src_data.data_in += src_data.input_frames_used * psrc->channels ;
|
||||
src_data.input_frames -= src_data.input_frames_used ;
|
||||
|
||||
src_data.data_out += src_data.output_frames_gen * psrc->channels ;
|
||||
src_data.output_frames -= src_data.output_frames_gen ;
|
||||
|
||||
output_frames_gen += src_data.output_frames_gen ;
|
||||
|
||||
if (src_data.end_of_input == SRC_TRUE && src_data.output_frames_gen == 0)
|
||||
break ;
|
||||
} ;
|
||||
|
||||
psrc->saved_data = src_data.data_in ;
|
||||
psrc->saved_frames = src_data.input_frames ;
|
||||
|
||||
if (error != 0)
|
||||
{ psrc->error = error ;
|
||||
return 0 ;
|
||||
} ;
|
||||
|
||||
return output_frames_gen ;
|
||||
} /* src_callback_read */
|
||||
|
||||
/*==========================================================================
|
||||
*/
|
||||
|
||||
int
|
||||
src_set_ratio (SRC_STATE *state, double new_ratio)
|
||||
{ SRC_PRIVATE *psrc ;
|
||||
|
||||
psrc = (SRC_PRIVATE*) state ;
|
||||
|
||||
if (psrc == NULL)
|
||||
return SRC_ERR_BAD_STATE ;
|
||||
if (psrc->vari_process == NULL || psrc->const_process == NULL)
|
||||
return SRC_ERR_BAD_PROC_PTR ;
|
||||
|
||||
if (is_bad_src_ratio (new_ratio))
|
||||
return SRC_ERR_BAD_SRC_RATIO ;
|
||||
|
||||
psrc->last_ratio = new_ratio ;
|
||||
|
||||
return SRC_ERR_NO_ERROR ;
|
||||
} /* src_set_ratio */
|
||||
|
||||
int
|
||||
src_reset (SRC_STATE *state)
|
||||
{ SRC_PRIVATE *psrc ;
|
||||
|
||||
if ((psrc = (SRC_PRIVATE*) state) == NULL)
|
||||
return SRC_ERR_BAD_STATE ;
|
||||
|
||||
if (psrc->reset != NULL)
|
||||
psrc->reset (psrc) ;
|
||||
|
||||
psrc->last_position = 0.0 ;
|
||||
psrc->last_ratio = 0.0 ;
|
||||
|
||||
psrc->saved_data = NULL ;
|
||||
psrc->saved_frames = 0 ;
|
||||
|
||||
psrc->error = SRC_ERR_NO_ERROR ;
|
||||
|
||||
return SRC_ERR_NO_ERROR ;
|
||||
} /* src_reset */
|
||||
|
||||
/*==============================================================================
|
||||
** Control functions.
|
||||
*/
|
||||
|
||||
const char *
|
||||
src_get_name (int converter_type)
|
||||
{ const char *desc ;
|
||||
|
||||
if ((desc = sinc_get_name (converter_type)) != NULL)
|
||||
return desc ;
|
||||
|
||||
if ((desc = zoh_get_name (converter_type)) != NULL)
|
||||
return desc ;
|
||||
|
||||
if ((desc = linear_get_name (converter_type)) != NULL)
|
||||
return desc ;
|
||||
|
||||
return NULL ;
|
||||
} /* src_get_name */
|
||||
|
||||
const char *
|
||||
src_get_description (int converter_type)
|
||||
{ const char *desc ;
|
||||
|
||||
if ((desc = sinc_get_description (converter_type)) != NULL)
|
||||
return desc ;
|
||||
|
||||
if ((desc = zoh_get_description (converter_type)) != NULL)
|
||||
return desc ;
|
||||
|
||||
if ((desc = linear_get_description (converter_type)) != NULL)
|
||||
return desc ;
|
||||
|
||||
return NULL ;
|
||||
} /* src_get_description */
|
||||
|
||||
const char *
|
||||
src_get_version (void)
|
||||
{ return PACKAGE "-" VERSION " (c) 2002-2008 Erik de Castro Lopo" ;
|
||||
} /* src_get_version */
|
||||
|
||||
int
|
||||
src_is_valid_ratio (double ratio)
|
||||
{
|
||||
if (is_bad_src_ratio (ratio))
|
||||
return SRC_FALSE ;
|
||||
|
||||
return SRC_TRUE ;
|
||||
} /* src_is_valid_ratio */
|
||||
|
||||
/*==============================================================================
|
||||
** Error reporting functions.
|
||||
*/
|
||||
|
||||
int
|
||||
src_error (SRC_STATE *state)
|
||||
{ if (state)
|
||||
return ((SRC_PRIVATE*) state)->error ;
|
||||
return SRC_ERR_NO_ERROR ;
|
||||
} /* src_error */
|
||||
|
||||
const char*
|
||||
src_strerror (int error)
|
||||
{
|
||||
switch (error)
|
||||
{ case SRC_ERR_NO_ERROR :
|
||||
return "No error." ;
|
||||
case SRC_ERR_MALLOC_FAILED :
|
||||
return "Malloc failed." ;
|
||||
case SRC_ERR_BAD_STATE :
|
||||
return "SRC_STATE pointer is NULL." ;
|
||||
case SRC_ERR_BAD_DATA :
|
||||
return "SRC_DATA pointer is NULL." ;
|
||||
case SRC_ERR_BAD_DATA_PTR :
|
||||
return "SRC_DATA->data_out is NULL." ;
|
||||
case SRC_ERR_NO_PRIVATE :
|
||||
return "Internal error. No private data." ;
|
||||
|
||||
case SRC_ERR_BAD_SRC_RATIO :
|
||||
return "SRC ratio outside [1/" SRC_MAX_RATIO_STR ", " SRC_MAX_RATIO_STR "] range." ;
|
||||
|
||||
case SRC_ERR_BAD_SINC_STATE :
|
||||
return "src_process() called without reset after end_of_input." ;
|
||||
case SRC_ERR_BAD_PROC_PTR :
|
||||
return "Internal error. No process pointer." ;
|
||||
case SRC_ERR_SHIFT_BITS :
|
||||
return "Internal error. SHIFT_BITS too large." ;
|
||||
case SRC_ERR_FILTER_LEN :
|
||||
return "Internal error. Filter length too large." ;
|
||||
case SRC_ERR_BAD_CONVERTER :
|
||||
return "Bad converter number." ;
|
||||
case SRC_ERR_BAD_CHANNEL_COUNT :
|
||||
return "Channel count must be >= 1." ;
|
||||
case SRC_ERR_SINC_BAD_BUFFER_LEN :
|
||||
return "Internal error. Bad buffer length. Please report this." ;
|
||||
case SRC_ERR_SIZE_INCOMPATIBILITY :
|
||||
return "Internal error. Input data / internal buffer size difference. Please report this." ;
|
||||
case SRC_ERR_BAD_PRIV_PTR :
|
||||
return "Internal error. Private pointer is NULL. Please report this." ;
|
||||
case SRC_ERR_DATA_OVERLAP :
|
||||
return "Input and output data arrays overlap." ;
|
||||
case SRC_ERR_BAD_CALLBACK :
|
||||
return "Supplied callback function pointer is NULL." ;
|
||||
case SRC_ERR_BAD_MODE :
|
||||
return "Calling mode differs from initialisation mode (ie process v callback)." ;
|
||||
case SRC_ERR_NULL_CALLBACK :
|
||||
return "Callback function pointer is NULL in src_callback_read ()." ;
|
||||
case SRC_ERR_NO_VARIABLE_RATIO :
|
||||
return "This converter only allows constant conversion ratios." ;
|
||||
case SRC_ERR_SINC_PREPARE_DATA_BAD_LEN :
|
||||
return "Internal error : Bad length in prepare_data ()." ;
|
||||
|
||||
case SRC_ERR_MAX_ERROR :
|
||||
return "Placeholder. No error defined for this error number." ;
|
||||
|
||||
default : break ;
|
||||
}
|
||||
|
||||
return NULL ;
|
||||
} /* src_strerror */
|
||||
|
||||
/*==============================================================================
|
||||
** Simple interface for performing a single conversion from input buffer to
|
||||
** output buffer at a fixed conversion ratio.
|
||||
*/
|
||||
|
||||
int
|
||||
src_simple (SRC_DATA *src_data, int converter, int channels)
|
||||
{ SRC_STATE *src_state ;
|
||||
int error ;
|
||||
|
||||
if ((src_state = src_new (converter, channels, &error)) == NULL)
|
||||
return error ;
|
||||
|
||||
src_data->end_of_input = 1 ; /* Only one buffer worth of input. */
|
||||
|
||||
error = src_process (src_state, src_data) ;
|
||||
|
||||
src_state = src_delete (src_state) ;
|
||||
|
||||
return error ;
|
||||
} /* src_simple */
|
||||
|
||||
void
|
||||
src_short_to_float_array (const short *in, float *out, int len)
|
||||
{
|
||||
while (len)
|
||||
{ len -- ;
|
||||
out [len] = (float) (in [len] / (1.0 * 0x8000)) ;
|
||||
} ;
|
||||
|
||||
return ;
|
||||
} /* src_short_to_float_array */
|
||||
|
||||
void
|
||||
src_float_to_short_array (const float *in, short *out, int len)
|
||||
{ double scaled_value ;
|
||||
|
||||
while (len)
|
||||
{ len -- ;
|
||||
|
||||
scaled_value = in [len] * (8.0 * 0x10000000) ;
|
||||
if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFFFFFF))
|
||||
{ out [len] = 32767 ;
|
||||
continue ;
|
||||
} ;
|
||||
if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x10000000))
|
||||
{ out [len] = -32768 ;
|
||||
continue ;
|
||||
} ;
|
||||
|
||||
out [len] = (short) (lrint (scaled_value) >> 16) ;
|
||||
} ;
|
||||
|
||||
} /* src_float_to_short_array */
|
||||
|
||||
void
|
||||
src_int_to_float_array (const int *in, float *out, int len)
|
||||
{
|
||||
while (len)
|
||||
{ len -- ;
|
||||
out [len] = (float) (in [len] / (8.0 * 0x10000000)) ;
|
||||
} ;
|
||||
|
||||
return ;
|
||||
} /* src_int_to_float_array */
|
||||
|
||||
void
|
||||
src_float_to_int_array (const float *in, int *out, int len)
|
||||
{ double scaled_value ;
|
||||
|
||||
while (len)
|
||||
{ len -- ;
|
||||
|
||||
scaled_value = in [len] * (8.0 * 0x10000000) ;
|
||||
if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFFFFFF))
|
||||
{ out [len] = 0x7fffffff ;
|
||||
continue ;
|
||||
} ;
|
||||
if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x10000000))
|
||||
{ out [len] = -1 - 0x7fffffff ;
|
||||
continue ;
|
||||
} ;
|
||||
|
||||
out [len] = lrint (scaled_value) ;
|
||||
} ;
|
||||
|
||||
} /* src_float_to_int_array */
|
||||
|
||||
/*==============================================================================
|
||||
** Private functions.
|
||||
*/
|
||||
|
||||
static int
|
||||
psrc_set_converter (SRC_PRIVATE *psrc, int converter_type)
|
||||
{
|
||||
if (sinc_set_converter (psrc, converter_type) == SRC_ERR_NO_ERROR)
|
||||
return SRC_ERR_NO_ERROR ;
|
||||
|
||||
if (zoh_set_converter (psrc, converter_type) == SRC_ERR_NO_ERROR)
|
||||
return SRC_ERR_NO_ERROR ;
|
||||
|
||||
if (linear_set_converter (psrc, converter_type) == SRC_ERR_NO_ERROR)
|
||||
return SRC_ERR_NO_ERROR ;
|
||||
|
||||
return SRC_ERR_BAD_CONVERTER ;
|
||||
} /* psrc_set_converter */
|
||||
|
|
@ -1,197 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
** This code is part of Secret Rabbit Code aka libsamplerate. A commercial
|
||||
** use license for this code is available, please see:
|
||||
** http://www.mega-nerd.com/SRC/procedure.html
|
||||
*/
|
||||
|
||||
/*
|
||||
** API documentation is available here:
|
||||
** http://www.mega-nerd.com/SRC/api.html
|
||||
*/
|
||||
|
||||
#ifndef SAMPLERATE_H
|
||||
#define SAMPLERATE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
/* Opaque data type SRC_STATE. */
|
||||
typedef struct SRC_STATE_tag SRC_STATE ;
|
||||
|
||||
/* SRC_DATA is used to pass data to src_simple() and src_process(). */
|
||||
typedef struct
|
||||
{ float *data_in, *data_out ;
|
||||
|
||||
long input_frames, output_frames ;
|
||||
long input_frames_used, output_frames_gen ;
|
||||
|
||||
int end_of_input ;
|
||||
|
||||
double src_ratio ;
|
||||
} SRC_DATA ;
|
||||
|
||||
/* SRC_CB_DATA is used with callback based API. */
|
||||
typedef struct
|
||||
{ long frames ;
|
||||
float *data_in ;
|
||||
} SRC_CB_DATA ;
|
||||
|
||||
/*
|
||||
** User supplied callback function type for use with src_callback_new()
|
||||
** and src_callback_read(). First parameter is the same pointer that was
|
||||
** passed into src_callback_new(). Second parameter is pointer to a
|
||||
** pointer. The user supplied callback function must modify *data to
|
||||
** point to the start of the user supplied float array. The user supplied
|
||||
** function must return the number of frames that **data points to.
|
||||
*/
|
||||
|
||||
typedef long (*src_callback_t) (void *cb_data, float **data) ;
|
||||
|
||||
/*
|
||||
** Standard initialisation function : return an anonymous pointer to the
|
||||
** internal state of the converter. Choose a converter from the enums below.
|
||||
** Error returned in *error.
|
||||
*/
|
||||
|
||||
SRC_STATE* src_new (int converter_type, int channels, int *error) ;
|
||||
|
||||
/*
|
||||
** Initilisation for callback based API : return an anonymous pointer to the
|
||||
** internal state of the converter. Choose a converter from the enums below.
|
||||
** The cb_data pointer can point to any data or be set to NULL. Whatever the
|
||||
** value, when processing, user supplied function "func" gets called with
|
||||
** cb_data as first parameter.
|
||||
*/
|
||||
|
||||
SRC_STATE* src_callback_new (src_callback_t func, int converter_type, int channels,
|
||||
int *error, void* cb_data) ;
|
||||
|
||||
/*
|
||||
** Cleanup all internal allocations.
|
||||
** Always returns NULL.
|
||||
*/
|
||||
|
||||
SRC_STATE* src_delete (SRC_STATE *state) ;
|
||||
|
||||
/*
|
||||
** Standard processing function.
|
||||
** Returns non zero on error.
|
||||
*/
|
||||
|
||||
int src_process (SRC_STATE *state, SRC_DATA *data) ;
|
||||
|
||||
/*
|
||||
** Callback based processing function. Read up to frames worth of data from
|
||||
** the converter int *data and return frames read or -1 on error.
|
||||
*/
|
||||
long src_callback_read (SRC_STATE *state, double src_ratio, long frames, float *data) ;
|
||||
|
||||
/*
|
||||
** Simple interface for performing a single conversion from input buffer to
|
||||
** output buffer at a fixed conversion ratio.
|
||||
** Simple interface does not require initialisation as it can only operate on
|
||||
** a single buffer worth of audio.
|
||||
*/
|
||||
|
||||
int src_simple (SRC_DATA *data, int converter_type, int channels) ;
|
||||
|
||||
/*
|
||||
** This library contains a number of different sample rate converters,
|
||||
** numbered 0 through N.
|
||||
**
|
||||
** Return a string giving either a name or a more full description of each
|
||||
** sample rate converter or NULL if no sample rate converter exists for
|
||||
** the given value. The converters are sequentially numbered from 0 to N.
|
||||
*/
|
||||
|
||||
const char *src_get_name (int converter_type) ;
|
||||
const char *src_get_description (int converter_type) ;
|
||||
const char *src_get_version (void) ;
|
||||
|
||||
/*
|
||||
** Set a new SRC ratio. This allows step responses
|
||||
** in the conversion ratio.
|
||||
** Returns non zero on error.
|
||||
*/
|
||||
|
||||
int src_set_ratio (SRC_STATE *state, double new_ratio) ;
|
||||
|
||||
/*
|
||||
** Reset the internal SRC state.
|
||||
** Does not modify the quality settings.
|
||||
** Does not free any memory allocations.
|
||||
** Returns non zero on error.
|
||||
*/
|
||||
|
||||
int src_reset (SRC_STATE *state) ;
|
||||
|
||||
/*
|
||||
** Return TRUE if ratio is a valid conversion ratio, FALSE
|
||||
** otherwise.
|
||||
*/
|
||||
|
||||
int src_is_valid_ratio (double ratio) ;
|
||||
|
||||
/*
|
||||
** Return an error number.
|
||||
*/
|
||||
|
||||
int src_error (SRC_STATE *state) ;
|
||||
|
||||
/*
|
||||
** Convert the error number into a string.
|
||||
*/
|
||||
const char* src_strerror (int error) ;
|
||||
|
||||
/*
|
||||
** The following enums can be used to set the interpolator type
|
||||
** using the function src_set_converter().
|
||||
*/
|
||||
|
||||
enum
|
||||
{
|
||||
SRC_SINC_BEST_QUALITY = 0,
|
||||
SRC_SINC_MEDIUM_QUALITY = 1,
|
||||
SRC_SINC_FASTEST = 2,
|
||||
SRC_ZERO_ORDER_HOLD = 3,
|
||||
SRC_LINEAR = 4,
|
||||
} ;
|
||||
|
||||
/*
|
||||
** Extra helper functions for converting from short to float and
|
||||
** back again.
|
||||
*/
|
||||
|
||||
void src_short_to_float_array (const short *in, float *out, int len) ;
|
||||
void src_float_to_short_array (const float *in, short *out, int len) ;
|
||||
|
||||
void src_int_to_float_array (const int *in, float *out, int len) ;
|
||||
void src_float_to_int_array (const float *in, int *out, int len) ;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* SAMPLERATE_H */
|
||||
|
|
@ -1,220 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
** This code is part of Secret Rabbit Code aka libsamplerate. A commercial
|
||||
** use license for this code is available, please see:
|
||||
** http://www.mega-nerd.com/SRC/procedure.html
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "float_cast.h"
|
||||
#include "common.h"
|
||||
|
||||
static int linear_vari_process (SRC_PRIVATE *psrc, SRC_DATA *data) ;
|
||||
static void linear_reset (SRC_PRIVATE *psrc) ;
|
||||
|
||||
/*========================================================================================
|
||||
*/
|
||||
|
||||
#define LINEAR_MAGIC_MARKER MAKE_MAGIC ('l', 'i', 'n', 'e', 'a', 'r')
|
||||
|
||||
#define SRC_DEBUG 0
|
||||
|
||||
typedef struct
|
||||
{ int linear_magic_marker ;
|
||||
int channels ;
|
||||
int reset ;
|
||||
long in_count, in_used ;
|
||||
long out_count, out_gen ;
|
||||
float last_value [1] ;
|
||||
} LINEAR_DATA ;
|
||||
|
||||
/*----------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static int
|
||||
linear_vari_process (SRC_PRIVATE *psrc, SRC_DATA *data)
|
||||
{ LINEAR_DATA *priv ;
|
||||
double src_ratio, input_index, rem ;
|
||||
int ch ;
|
||||
|
||||
if (data->input_frames <= 0)
|
||||
return SRC_ERR_NO_ERROR ;
|
||||
|
||||
if (psrc->private_data == NULL)
|
||||
return SRC_ERR_NO_PRIVATE ;
|
||||
|
||||
priv = (LINEAR_DATA*) psrc->private_data ;
|
||||
|
||||
if (priv->reset)
|
||||
{ /* If we have just been reset, set the last_value data. */
|
||||
for (ch = 0 ; ch < priv->channels ; ch++)
|
||||
priv->last_value [ch] = data->data_in [ch] ;
|
||||
priv->reset = 0 ;
|
||||
} ;
|
||||
|
||||
priv->in_count = data->input_frames * priv->channels ;
|
||||
priv->out_count = data->output_frames * priv->channels ;
|
||||
priv->in_used = priv->out_gen = 0 ;
|
||||
|
||||
src_ratio = psrc->last_ratio ;
|
||||
input_index = psrc->last_position ;
|
||||
|
||||
/* Calculate samples before first sample in input array. */
|
||||
while (input_index < 1.0 && priv->out_gen < priv->out_count)
|
||||
{
|
||||
if (priv->in_used + priv->channels * (1.0 + input_index) >= priv->in_count)
|
||||
break ;
|
||||
|
||||
if (priv->out_count > 0 && fabs (psrc->last_ratio - data->src_ratio) > SRC_MIN_RATIO_DIFF)
|
||||
src_ratio = psrc->last_ratio + priv->out_gen * (data->src_ratio - psrc->last_ratio) / priv->out_count ;
|
||||
|
||||
for (ch = 0 ; ch < priv->channels ; ch++)
|
||||
{ data->data_out [priv->out_gen] = (float) (priv->last_value [ch] + input_index *
|
||||
(data->data_in [ch] - priv->last_value [ch])) ;
|
||||
priv->out_gen ++ ;
|
||||
} ;
|
||||
|
||||
/* Figure out the next index. */
|
||||
input_index += 1.0 / src_ratio ;
|
||||
} ;
|
||||
|
||||
rem = fmod_one (input_index) ;
|
||||
priv->in_used += priv->channels * lrint (input_index - rem) ;
|
||||
input_index = rem ;
|
||||
|
||||
/* Main processing loop. */
|
||||
while (priv->out_gen < priv->out_count && priv->in_used + priv->channels * input_index < priv->in_count)
|
||||
{
|
||||
if (priv->out_count > 0 && fabs (psrc->last_ratio - data->src_ratio) > SRC_MIN_RATIO_DIFF)
|
||||
src_ratio = psrc->last_ratio + priv->out_gen * (data->src_ratio - psrc->last_ratio) / priv->out_count ;
|
||||
|
||||
if (SRC_DEBUG && priv->in_used < priv->channels && input_index < 1.0)
|
||||
{ printf ("Whoops!!!! in_used : %ld channels : %d input_index : %f\n", priv->in_used, priv->channels, input_index) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
for (ch = 0 ; ch < priv->channels ; ch++)
|
||||
{ data->data_out [priv->out_gen] = (float) (data->data_in [priv->in_used - priv->channels + ch] + input_index *
|
||||
(data->data_in [priv->in_used + ch] - data->data_in [priv->in_used - priv->channels + ch])) ;
|
||||
priv->out_gen ++ ;
|
||||
} ;
|
||||
|
||||
/* Figure out the next index. */
|
||||
input_index += 1.0 / src_ratio ;
|
||||
rem = fmod_one (input_index) ;
|
||||
|
||||
priv->in_used += priv->channels * lrint (input_index - rem) ;
|
||||
input_index = rem ;
|
||||
} ;
|
||||
|
||||
if (priv->in_used > priv->in_count)
|
||||
{ input_index += (priv->in_used - priv->in_count) / priv->channels ;
|
||||
priv->in_used = priv->in_count ;
|
||||
} ;
|
||||
|
||||
psrc->last_position = input_index ;
|
||||
|
||||
if (priv->in_used > 0)
|
||||
for (ch = 0 ; ch < priv->channels ; ch++)
|
||||
priv->last_value [ch] = data->data_in [priv->in_used - priv->channels + ch] ;
|
||||
|
||||
/* Save current ratio rather then target ratio. */
|
||||
psrc->last_ratio = src_ratio ;
|
||||
|
||||
data->input_frames_used = priv->in_used / priv->channels ;
|
||||
data->output_frames_gen = priv->out_gen / priv->channels ;
|
||||
|
||||
return SRC_ERR_NO_ERROR ;
|
||||
} /* linear_vari_process */
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const char*
|
||||
linear_get_name (int src_enum)
|
||||
{
|
||||
if (src_enum == SRC_LINEAR)
|
||||
return "Linear Interpolator" ;
|
||||
|
||||
return NULL ;
|
||||
} /* linear_get_name */
|
||||
|
||||
const char*
|
||||
linear_get_description (int src_enum)
|
||||
{
|
||||
if (src_enum == SRC_LINEAR)
|
||||
return "Linear interpolator, very fast, poor quality." ;
|
||||
|
||||
return NULL ;
|
||||
} /* linear_get_descrition */
|
||||
|
||||
int
|
||||
linear_set_converter (SRC_PRIVATE *psrc, int src_enum)
|
||||
{ LINEAR_DATA *priv = NULL ;
|
||||
|
||||
if (src_enum != SRC_LINEAR)
|
||||
return SRC_ERR_BAD_CONVERTER ;
|
||||
|
||||
if (psrc->private_data != NULL)
|
||||
{ free (psrc->private_data) ;
|
||||
psrc->private_data = NULL ;
|
||||
} ;
|
||||
|
||||
if (psrc->private_data == NULL)
|
||||
{ priv = calloc (1, sizeof (*priv) + psrc->channels * sizeof (float)) ;
|
||||
if (priv == NULL)
|
||||
return SRC_ERR_MALLOC_FAILED ;
|
||||
psrc->private_data = priv ;
|
||||
} ;
|
||||
|
||||
priv->linear_magic_marker = LINEAR_MAGIC_MARKER ;
|
||||
priv->channels = psrc->channels ;
|
||||
|
||||
psrc->const_process = linear_vari_process ;
|
||||
psrc->vari_process = linear_vari_process ;
|
||||
psrc->reset = linear_reset ;
|
||||
|
||||
linear_reset (psrc) ;
|
||||
|
||||
return SRC_ERR_NO_ERROR ;
|
||||
} /* linear_set_converter */
|
||||
|
||||
/*===================================================================================
|
||||
*/
|
||||
|
||||
static void
|
||||
linear_reset (SRC_PRIVATE *psrc)
|
||||
{ LINEAR_DATA *priv = NULL ;
|
||||
|
||||
priv = (LINEAR_DATA*) psrc->private_data ;
|
||||
if (priv == NULL)
|
||||
return ;
|
||||
|
||||
priv->channels = psrc->channels ;
|
||||
priv->reset = 1 ;
|
||||
memset (priv->last_value, 0, sizeof (priv->last_value [0]) * priv->channels) ;
|
||||
|
||||
return ;
|
||||
} /* linear_reset */
|
||||
|
File diff suppressed because it is too large
Load diff
|
@ -1,211 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
** This code is part of Secret Rabbit Code aka libsamplerate. A commercial
|
||||
** use license for this code is available, please see:
|
||||
** http://www.mega-nerd.com/SRC/procedure.html
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "float_cast.h"
|
||||
#include "common.h"
|
||||
|
||||
static int zoh_vari_process (SRC_PRIVATE *psrc, SRC_DATA *data) ;
|
||||
static void zoh_reset (SRC_PRIVATE *psrc) ;
|
||||
|
||||
/*========================================================================================
|
||||
*/
|
||||
|
||||
#define ZOH_MAGIC_MARKER MAKE_MAGIC ('s', 'r', 'c', 'z', 'o', 'h')
|
||||
|
||||
typedef struct
|
||||
{ int zoh_magic_marker ;
|
||||
int channels ;
|
||||
int reset ;
|
||||
long in_count, in_used ;
|
||||
long out_count, out_gen ;
|
||||
float last_value [1] ;
|
||||
} ZOH_DATA ;
|
||||
|
||||
/*----------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static int
|
||||
zoh_vari_process (SRC_PRIVATE *psrc, SRC_DATA *data)
|
||||
{ ZOH_DATA *priv ;
|
||||
double src_ratio, input_index, rem ;
|
||||
int ch ;
|
||||
|
||||
if (data->input_frames <= 0)
|
||||
return SRC_ERR_NO_ERROR ;
|
||||
|
||||
if (psrc->private_data == NULL)
|
||||
return SRC_ERR_NO_PRIVATE ;
|
||||
|
||||
priv = (ZOH_DATA*) psrc->private_data ;
|
||||
|
||||
if (priv->reset)
|
||||
{ /* If we have just been reset, set the last_value data. */
|
||||
for (ch = 0 ; ch < priv->channels ; ch++)
|
||||
priv->last_value [ch] = data->data_in [ch] ;
|
||||
priv->reset = 0 ;
|
||||
} ;
|
||||
|
||||
priv->in_count = data->input_frames * priv->channels ;
|
||||
priv->out_count = data->output_frames * priv->channels ;
|
||||
priv->in_used = priv->out_gen = 0 ;
|
||||
|
||||
src_ratio = psrc->last_ratio ;
|
||||
input_index = psrc->last_position ;
|
||||
|
||||
/* Calculate samples before first sample in input array. */
|
||||
while (input_index < 1.0 && priv->out_gen < priv->out_count)
|
||||
{
|
||||
if (priv->in_used + priv->channels * input_index >= priv->in_count)
|
||||
break ;
|
||||
|
||||
if (priv->out_count > 0 && fabs (psrc->last_ratio - data->src_ratio) > SRC_MIN_RATIO_DIFF)
|
||||
src_ratio = psrc->last_ratio + priv->out_gen * (data->src_ratio - psrc->last_ratio) / priv->out_count ;
|
||||
|
||||
for (ch = 0 ; ch < priv->channels ; ch++)
|
||||
{ data->data_out [priv->out_gen] = priv->last_value [ch] ;
|
||||
priv->out_gen ++ ;
|
||||
} ;
|
||||
|
||||
/* Figure out the next index. */
|
||||
input_index += 1.0 / src_ratio ;
|
||||
} ;
|
||||
|
||||
rem = fmod_one (input_index) ;
|
||||
priv->in_used += priv->channels * lrint (input_index - rem) ;
|
||||
input_index = rem ;
|
||||
|
||||
/* Main processing loop. */
|
||||
while (priv->out_gen < priv->out_count && priv->in_used + priv->channels * input_index <= priv->in_count)
|
||||
{
|
||||
if (priv->out_count > 0 && fabs (psrc->last_ratio - data->src_ratio) > SRC_MIN_RATIO_DIFF)
|
||||
src_ratio = psrc->last_ratio + priv->out_gen * (data->src_ratio - psrc->last_ratio) / priv->out_count ;
|
||||
|
||||
for (ch = 0 ; ch < priv->channels ; ch++)
|
||||
{ data->data_out [priv->out_gen] = data->data_in [priv->in_used - priv->channels + ch] ;
|
||||
priv->out_gen ++ ;
|
||||
} ;
|
||||
|
||||
/* Figure out the next index. */
|
||||
input_index += 1.0 / src_ratio ;
|
||||
rem = fmod_one (input_index) ;
|
||||
|
||||
priv->in_used += priv->channels * lrint (input_index - rem) ;
|
||||
input_index = rem ;
|
||||
} ;
|
||||
|
||||
if (priv->in_used > priv->in_count)
|
||||
{ input_index += (priv->in_used - priv->in_count) / priv->channels ;
|
||||
priv->in_used = priv->in_count ;
|
||||
} ;
|
||||
|
||||
psrc->last_position = input_index ;
|
||||
|
||||
if (priv->in_used > 0)
|
||||
for (ch = 0 ; ch < priv->channels ; ch++)
|
||||
priv->last_value [ch] = data->data_in [priv->in_used - priv->channels + ch] ;
|
||||
|
||||
/* Save current ratio rather then target ratio. */
|
||||
psrc->last_ratio = src_ratio ;
|
||||
|
||||
data->input_frames_used = priv->in_used / priv->channels ;
|
||||
data->output_frames_gen = priv->out_gen / priv->channels ;
|
||||
|
||||
return SRC_ERR_NO_ERROR ;
|
||||
} /* zoh_vari_process */
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const char*
|
||||
zoh_get_name (int src_enum)
|
||||
{
|
||||
if (src_enum == SRC_ZERO_ORDER_HOLD)
|
||||
return "ZOH Interpolator" ;
|
||||
|
||||
return NULL ;
|
||||
} /* zoh_get_name */
|
||||
|
||||
const char*
|
||||
zoh_get_description (int src_enum)
|
||||
{
|
||||
if (src_enum == SRC_ZERO_ORDER_HOLD)
|
||||
return "Zero order hold interpolator, very fast, poor quality." ;
|
||||
|
||||
return NULL ;
|
||||
} /* zoh_get_descrition */
|
||||
|
||||
int
|
||||
zoh_set_converter (SRC_PRIVATE *psrc, int src_enum)
|
||||
{ ZOH_DATA *priv = NULL ;
|
||||
|
||||
if (src_enum != SRC_ZERO_ORDER_HOLD)
|
||||
return SRC_ERR_BAD_CONVERTER ;
|
||||
|
||||
if (psrc->private_data != NULL)
|
||||
{ free (psrc->private_data) ;
|
||||
psrc->private_data = NULL ;
|
||||
} ;
|
||||
|
||||
if (psrc->private_data == NULL)
|
||||
{ priv = calloc (1, sizeof (*priv) + psrc->channels * sizeof (float)) ;
|
||||
if (priv == NULL)
|
||||
return SRC_ERR_MALLOC_FAILED ;
|
||||
psrc->private_data = priv ;
|
||||
} ;
|
||||
|
||||
priv->zoh_magic_marker = ZOH_MAGIC_MARKER ;
|
||||
priv->channels = psrc->channels ;
|
||||
|
||||
psrc->const_process = zoh_vari_process ;
|
||||
psrc->vari_process = zoh_vari_process ;
|
||||
psrc->reset = zoh_reset ;
|
||||
|
||||
zoh_reset (psrc) ;
|
||||
|
||||
return SRC_ERR_NO_ERROR ;
|
||||
} /* zoh_set_converter */
|
||||
|
||||
/*===================================================================================
|
||||
*/
|
||||
|
||||
static void
|
||||
zoh_reset (SRC_PRIVATE *psrc)
|
||||
{ ZOH_DATA *priv ;
|
||||
|
||||
priv = (ZOH_DATA*) psrc->private_data ;
|
||||
if (priv == NULL)
|
||||
return ;
|
||||
|
||||
priv->channels = psrc->channels ;
|
||||
priv->reset = 1 ;
|
||||
memset (priv->last_value, 0, sizeof (priv->last_value [0]) * priv->channels) ;
|
||||
|
||||
return ;
|
||||
} /* zoh_reset */
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
noinst_PROGRAMS = misc_test termination_test simple_test callback_test \
|
||||
reset_test multi_channel_test snr_bw_test \
|
||||
float_short_test varispeed_test callback_hang_test \
|
||||
src-evaluate throughput_test multichan_throughput_test \
|
||||
downsample_test
|
||||
|
||||
SAMPLRATEDIR =../src
|
||||
INCLUDES = -I$(srcdir)/$(SAMPLRATEDIR)
|
||||
noinst_HEADERS = util.h
|
||||
|
||||
#===============================================================================
|
||||
|
||||
misc_test_SOURCES = misc_test.c util.c util.h
|
||||
misc_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la
|
||||
|
||||
termination_test_SOURCES = termination_test.c util.c util.h
|
||||
termination_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la
|
||||
|
||||
callback_hang_test_SOURCES = callback_hang_test.c util.c util.h
|
||||
callback_hang_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la
|
||||
|
||||
simple_test_SOURCES = simple_test.c util.c util.h
|
||||
simple_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la
|
||||
|
||||
reset_test_SOURCES = reset_test.c util.c util.h
|
||||
reset_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la
|
||||
|
||||
multi_channel_test_SOURCES = multi_channel_test.c util.c calc_snr.c
|
||||
multi_channel_test_CFLAGS = @FFTW3_CFLAGS@
|
||||
multi_channel_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la $(FFTW3_LIBS)
|
||||
|
||||
snr_bw_test_SOURCES = snr_bw_test.c calc_snr.c util.c util.h
|
||||
snr_bw_test_CFLAGS = @FFTW3_CFLAGS@
|
||||
snr_bw_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la $(FFTW3_LIBS)
|
||||
|
||||
callback_test_SOURCES = callback_test.c util.c util.h
|
||||
callback_test_CFLAGS = @FFTW3_CFLAGS@
|
||||
callback_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la
|
||||
|
||||
float_short_test_SOURCES = float_short_test.c util.c util.h
|
||||
float_short_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la
|
||||
|
||||
downsample_test_SOURCES = downsample_test.c util.c util.h
|
||||
downsample_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la
|
||||
|
||||
varispeed_test_SOURCES = varispeed_test.c util.c util.h calc_snr.c
|
||||
varispeed_test_CFLAGS = @FFTW3_CFLAGS@
|
||||
varispeed_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la $(FFTW3_LIBS)
|
||||
|
||||
# This program is for evaluating other sample rate converters.
|
||||
|
||||
throughput_test_CFLAGS = $(AM_CFLAGS) @FFTW3_CFLAGS@
|
||||
throughput_test_SOURCES = throughput_test.c util.c calc_snr.c
|
||||
throughput_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la $(FFTW3_LIBS)
|
||||
|
||||
multichan_throughput_test_CFLAGS = $(AM_CFLAGS) @FFTW3_CFLAGS@
|
||||
multichan_throughput_test_SOURCES = multichan_throughput_test.c util.c calc_snr.c
|
||||
multichan_throughput_test_LDADD = $(SAMPLRATEDIR)/libsamplerate.la $(FFTW3_LIBS)
|
||||
|
||||
src_evaluate_SOURCES = src-evaluate.c calc_snr.c util.c
|
||||
src_evaluate_CFLAGS = @SNDFILE_CFLAGS@ @FFTW3_CFLAGS@
|
||||
src_evaluate_LDADD = $(SNDFILE_LIBS) $(FFTW3_LIBS)
|
||||
|
||||
#===============================================================================
|
||||
|
||||
check: $(noinst_PROGRAMS)
|
||||
date
|
||||
uname -a
|
||||
./misc_test
|
||||
./termination_test
|
||||
./callback_hang_test
|
||||
./downsample_test
|
||||
./simple_test
|
||||
./callback_test
|
||||
./reset_test
|
||||
./multi_channel_test
|
||||
./varispeed_test
|
||||
./float_short_test
|
||||
./snr_bw_test
|
||||
./throughput_test
|
||||
@echo "-----------------------------------------------------------------"
|
||||
@echo " ${PACKAGE}-${VERSION} passed all tests."
|
||||
@echo "-----------------------------------------------------------------"
|
||||
|
File diff suppressed because it is too large
Load diff
|
@ -1,242 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#if (HAVE_FFTW3 == 1)
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <fftw3.h>
|
||||
|
||||
#define MAX_SPEC_LEN (1<<18)
|
||||
#define MAX_PEAKS 10
|
||||
|
||||
static void log_mag_spectrum (double *input, int len, double *magnitude) ;
|
||||
static void smooth_mag_spectrum (double *magnitude, int len) ;
|
||||
static double find_snr (const double *magnitude, int len, int expected_peaks) ;
|
||||
|
||||
typedef struct
|
||||
{ double peak ;
|
||||
int index ;
|
||||
} PEAK_DATA ;
|
||||
|
||||
double
|
||||
calculate_snr (float *data, int len, int expected_peaks)
|
||||
{ static double magnitude [MAX_SPEC_LEN] ;
|
||||
static double datacopy [MAX_SPEC_LEN] ;
|
||||
|
||||
double snr = 200.0 ;
|
||||
int k ;
|
||||
|
||||
if (len > MAX_SPEC_LEN)
|
||||
{ printf ("%s : line %d : data length too large.\n", __FILE__, __LINE__) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
for (k = 0 ; k < len ; k++)
|
||||
datacopy [k] = data [k] ;
|
||||
|
||||
/* Pad the data just a little to speed up the FFT. */
|
||||
while ((len & 0x1F) && len < MAX_SPEC_LEN)
|
||||
{ datacopy [len] = 0.0 ;
|
||||
len ++ ;
|
||||
} ;
|
||||
|
||||
log_mag_spectrum (datacopy, len, magnitude) ;
|
||||
smooth_mag_spectrum (magnitude, len / 2) ;
|
||||
|
||||
snr = find_snr (magnitude, len, expected_peaks) ;
|
||||
|
||||
return snr ;
|
||||
} /* calculate_snr */
|
||||
|
||||
/*==============================================================================
|
||||
** There is a slight problem with trying to measure SNR with the method used
|
||||
** here; the side lobes of the windowed FFT can look like a noise/aliasing peak.
|
||||
** The solution is to smooth the magnitude spectrum by wiping out troughs
|
||||
** between adjacent peaks as done here.
|
||||
** This removes side lobe peaks without affecting noise/aliasing peaks.
|
||||
*/
|
||||
|
||||
static void linear_smooth (double *mag, PEAK_DATA *larger, PEAK_DATA *smaller) ;
|
||||
|
||||
static void
|
||||
smooth_mag_spectrum (double *mag, int len)
|
||||
{ PEAK_DATA peaks [2] ;
|
||||
|
||||
int k ;
|
||||
|
||||
memset (peaks, 0, sizeof (peaks)) ;
|
||||
|
||||
/* Find first peak. */
|
||||
for (k = 1 ; k < len - 1 ; k++)
|
||||
{ if (mag [k - 1] < mag [k] && mag [k] >= mag [k + 1])
|
||||
{ peaks [0].peak = mag [k] ;
|
||||
peaks [0].index = k ;
|
||||
break ;
|
||||
} ;
|
||||
} ;
|
||||
|
||||
/* Find subsequent peaks ans smooth between peaks. */
|
||||
for (k = peaks [0].index + 1 ; k < len - 1 ; k++)
|
||||
{ if (mag [k - 1] < mag [k] && mag [k] >= mag [k + 1])
|
||||
{ peaks [1].peak = mag [k] ;
|
||||
peaks [1].index = k ;
|
||||
|
||||
if (peaks [1].peak > peaks [0].peak)
|
||||
linear_smooth (mag, &peaks [1], &peaks [0]) ;
|
||||
else
|
||||
linear_smooth (mag, &peaks [0], &peaks [1]) ;
|
||||
peaks [0] = peaks [1] ;
|
||||
} ;
|
||||
} ;
|
||||
|
||||
} /* smooth_mag_spectrum */
|
||||
|
||||
static void
|
||||
linear_smooth (double *mag, PEAK_DATA *larger, PEAK_DATA *smaller)
|
||||
{ int k ;
|
||||
|
||||
if (smaller->index < larger->index)
|
||||
{ for (k = smaller->index + 1 ; k < larger->index ; k++)
|
||||
mag [k] = (mag [k] < mag [k - 1]) ? 0.999 * mag [k - 1] : mag [k] ;
|
||||
}
|
||||
else
|
||||
{ for (k = smaller->index - 1 ; k >= larger->index ; k--)
|
||||
mag [k] = (mag [k] < mag [k + 1]) ? 0.999 * mag [k + 1] : mag [k] ;
|
||||
} ;
|
||||
|
||||
} /* linear_smooth */
|
||||
|
||||
/*==============================================================================
|
||||
*/
|
||||
|
||||
static int
|
||||
peak_compare (const void *vp1, const void *vp2)
|
||||
{ const PEAK_DATA *peak1, *peak2 ;
|
||||
|
||||
peak1 = (const PEAK_DATA*) vp1 ;
|
||||
peak2 = (const PEAK_DATA*) vp2 ;
|
||||
|
||||
return (peak1->peak < peak2->peak) ? 1 : -1 ;
|
||||
} /* peak_compare */
|
||||
|
||||
static double
|
||||
find_snr (const double *magnitude, int len, int expected_peaks)
|
||||
{ PEAK_DATA peaks [MAX_PEAKS] ;
|
||||
|
||||
int k, peak_count = 0 ;
|
||||
double snr ;
|
||||
|
||||
memset (peaks, 0, sizeof (peaks)) ;
|
||||
|
||||
/* Find the MAX_PEAKS largest peaks. */
|
||||
for (k = 1 ; k < len - 1 ; k++)
|
||||
{ if (magnitude [k - 1] < magnitude [k] && magnitude [k] >= magnitude [k + 1])
|
||||
{ if (peak_count < MAX_PEAKS)
|
||||
{ peaks [peak_count].peak = magnitude [k] ;
|
||||
peaks [peak_count].index = k ;
|
||||
peak_count ++ ;
|
||||
qsort (peaks, peak_count, sizeof (PEAK_DATA), peak_compare) ;
|
||||
}
|
||||
else if (magnitude [k] > peaks [MAX_PEAKS - 1].peak)
|
||||
{ peaks [MAX_PEAKS - 1].peak = magnitude [k] ;
|
||||
peaks [MAX_PEAKS - 1].index = k ;
|
||||
qsort (peaks, MAX_PEAKS, sizeof (PEAK_DATA), peak_compare) ;
|
||||
} ;
|
||||
} ;
|
||||
} ;
|
||||
|
||||
if (peak_count < expected_peaks)
|
||||
{ printf ("\n%s : line %d : bad peak_count (%d), expected %d.\n\n", __FILE__, __LINE__, peak_count, expected_peaks) ;
|
||||
return -1.0 ;
|
||||
} ;
|
||||
|
||||
/* Sort the peaks. */
|
||||
qsort (peaks, peak_count, sizeof (PEAK_DATA), peak_compare) ;
|
||||
|
||||
snr = peaks [0].peak ;
|
||||
for (k = 1 ; k < peak_count ; k++)
|
||||
if (fabs (snr - peaks [k].peak) > 10.0)
|
||||
return fabs (peaks [k].peak) ;
|
||||
|
||||
return snr ;
|
||||
} /* find_snr */
|
||||
|
||||
static void
|
||||
log_mag_spectrum (double *input, int len, double *magnitude)
|
||||
{ fftw_plan plan = NULL ;
|
||||
|
||||
double maxval ;
|
||||
int k ;
|
||||
|
||||
if (input == NULL || magnitude == NULL)
|
||||
return ;
|
||||
|
||||
plan = fftw_plan_r2r_1d (len, input, magnitude, FFTW_R2HC, FFTW_ESTIMATE | FFTW_PRESERVE_INPUT) ;
|
||||
if (plan == NULL)
|
||||
{ printf ("%s : line %d : create plan failed.\n", __FILE__, __LINE__) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
fftw_execute (plan) ;
|
||||
|
||||
fftw_destroy_plan (plan) ;
|
||||
|
||||
/* (k < N/2 rounded up) */
|
||||
maxval = 0.0 ;
|
||||
for (k = 1 ; k < len / 2 ; k++)
|
||||
{ magnitude [k] = sqrt (magnitude [k] * magnitude [k] + magnitude [len - k - 1] * magnitude [len - k - 1]) ;
|
||||
maxval = (maxval < magnitude [k]) ? magnitude [k] : maxval ;
|
||||
} ;
|
||||
|
||||
memset (magnitude + len / 2, 0, len / 2 * sizeof (magnitude [0])) ;
|
||||
|
||||
/* Don't care about DC component. Make it zero. */
|
||||
magnitude [0] = 0.0 ;
|
||||
|
||||
/* log magnitude. */
|
||||
for (k = 0 ; k < len ; k++)
|
||||
{ magnitude [k] = magnitude [k] / maxval ;
|
||||
magnitude [k] = (magnitude [k] < 1e-15) ? -200.0 : 20.0 * log10 (magnitude [k]) ;
|
||||
} ;
|
||||
|
||||
return ;
|
||||
} /* log_mag_spectrum */
|
||||
|
||||
#else /* ! (HAVE_LIBFFTW && HAVE_LIBRFFTW) */
|
||||
|
||||
double
|
||||
calculate_snr (float *data, int len, int expected_peaks)
|
||||
{ double snr = 200.0 ;
|
||||
|
||||
data = data ;
|
||||
len = len ;
|
||||
expected_peaks = expected_peaks ;
|
||||
|
||||
return snr ;
|
||||
} /* calculate_snr */
|
||||
|
||||
#endif
|
||||
|
|
@ -1,131 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <math.h>
|
||||
|
||||
#if HAVE_ALARM && HAVE_SIGNAL && HAVE_SIGALRM
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#include <samplerate.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#define SHORT_BUFFER_LEN 512
|
||||
#define LONG_BUFFER_LEN (1 << 14)
|
||||
|
||||
typedef struct
|
||||
{ double ratio ;
|
||||
int count ;
|
||||
} SRC_PAIR ;
|
||||
|
||||
static void callback_hang_test (int converter) ;
|
||||
|
||||
static void alarm_handler (int number) ;
|
||||
static long input_callback (void *cb_data, float **data) ;
|
||||
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
/* Set up SIGALRM handler. */
|
||||
signal (SIGALRM, alarm_handler) ;
|
||||
|
||||
puts ("") ;
|
||||
callback_hang_test (SRC_ZERO_ORDER_HOLD) ;
|
||||
callback_hang_test (SRC_LINEAR) ;
|
||||
callback_hang_test (SRC_SINC_FASTEST) ;
|
||||
puts ("") ;
|
||||
|
||||
return 0 ;
|
||||
} /* main */
|
||||
|
||||
|
||||
static void
|
||||
callback_hang_test (int converter)
|
||||
{ static float output [LONG_BUFFER_LEN] ;
|
||||
static SRC_PAIR pairs [] =
|
||||
{
|
||||
{ 1.2, 5 }, { 1.1, 1 }, { 1.0, 1 }, { 3.0, 1 }, { 2.0, 1 }, { 0.3, 1 },
|
||||
{ 1.2, 0 }, { 1.1, 10 }, { 1.0, 1 }
|
||||
} ;
|
||||
|
||||
|
||||
SRC_STATE *src_state ;
|
||||
|
||||
double src_ratio = 1.0 ;
|
||||
int k, error ;
|
||||
|
||||
printf ("\tcallback_hang_test (%-28s) ....... ", src_get_name (converter)) ;
|
||||
fflush (stdout) ;
|
||||
|
||||
/* Perform sample rate conversion. */
|
||||
src_state = src_callback_new (input_callback, converter, 1, &error, NULL) ;
|
||||
if (src_state == NULL)
|
||||
{ printf ("\n\nLine %d : src_callback_new () failed : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
for (k = 0 ; k < ARRAY_LEN (pairs) ; k++)
|
||||
{ alarm (1) ;
|
||||
src_ratio = pairs [k].ratio ;
|
||||
src_callback_read (src_state, src_ratio, pairs [k].count, output) ;
|
||||
} ;
|
||||
|
||||
src_state = src_delete (src_state) ;
|
||||
|
||||
alarm (0) ;
|
||||
puts ("ok") ;
|
||||
|
||||
return ;
|
||||
} /* callback_hang_test */
|
||||
|
||||
static void
|
||||
alarm_handler (int number)
|
||||
{
|
||||
(void) number ;
|
||||
printf ("\n\n Error : Hang inside src_callback_read() detected. Exiting!\n\n") ;
|
||||
exit (1) ;
|
||||
} /* alarm_handler */
|
||||
|
||||
static long
|
||||
input_callback (void *cb_data, float **data)
|
||||
{
|
||||
static float buffer [20] ;
|
||||
|
||||
(void) cb_data ;
|
||||
*data = buffer ;
|
||||
|
||||
return ARRAY_LEN (buffer) ;
|
||||
} /* input_callback */
|
||||
|
||||
#else
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
puts ("\tCan't run this test on this platform.") ;
|
||||
return 0 ;
|
||||
} /* main */
|
||||
|
||||
#endif
|
|
@ -1,243 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2003-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <samplerate.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#define BUFFER_LEN 10000
|
||||
#define CB_READ_LEN 256
|
||||
|
||||
static void callback_test (int converter, double ratio) ;
|
||||
static void end_of_stream_test (int converter) ;
|
||||
|
||||
int
|
||||
main (void)
|
||||
{ static double src_ratios [] =
|
||||
{ 1.0, 0.099, 0.1, 0.33333333, 0.789, 1.0001, 1.9, 3.1, 9.9
|
||||
} ;
|
||||
|
||||
int k ;
|
||||
|
||||
puts ("") ;
|
||||
|
||||
puts (" Zero Order Hold interpolator :") ;
|
||||
for (k = 0 ; k < ARRAY_LEN (src_ratios) ; k++)
|
||||
callback_test (SRC_ZERO_ORDER_HOLD, src_ratios [k]) ;
|
||||
|
||||
puts (" Linear interpolator :") ;
|
||||
for (k = 0 ; k < ARRAY_LEN (src_ratios) ; k++)
|
||||
callback_test (SRC_LINEAR, src_ratios [k]) ;
|
||||
|
||||
puts (" Sinc interpolator :") ;
|
||||
for (k = 0 ; k < ARRAY_LEN (src_ratios) ; k++)
|
||||
callback_test (SRC_SINC_FASTEST, src_ratios [k]) ;
|
||||
|
||||
puts ("") ;
|
||||
|
||||
puts (" End of stream test :") ;
|
||||
end_of_stream_test (SRC_ZERO_ORDER_HOLD) ;
|
||||
end_of_stream_test (SRC_LINEAR) ;
|
||||
end_of_stream_test (SRC_SINC_FASTEST) ;
|
||||
|
||||
puts ("") ;
|
||||
return 0 ;
|
||||
} /* main */
|
||||
|
||||
/*=====================================================================================
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{ int channels ;
|
||||
long count, total ;
|
||||
int end_of_data ;
|
||||
float data [BUFFER_LEN] ;
|
||||
} TEST_CB_DATA ;
|
||||
|
||||
static long
|
||||
test_callback_func (void *cb_data, float **data)
|
||||
{ TEST_CB_DATA *pcb_data ;
|
||||
|
||||
long frames ;
|
||||
|
||||
if ((pcb_data = cb_data) == NULL)
|
||||
return 0 ;
|
||||
|
||||
if (data == NULL)
|
||||
return 0 ;
|
||||
|
||||
if (pcb_data->total - pcb_data->count > CB_READ_LEN)
|
||||
frames = CB_READ_LEN / pcb_data->channels ;
|
||||
else
|
||||
frames = (pcb_data->total - pcb_data->count) / pcb_data->channels ;
|
||||
|
||||
*data = pcb_data->data + pcb_data->count ;
|
||||
pcb_data->count += frames ;
|
||||
|
||||
return frames ;
|
||||
} /* test_callback_func */
|
||||
|
||||
|
||||
static void
|
||||
callback_test (int converter, double src_ratio)
|
||||
{ static TEST_CB_DATA test_callback_data ;
|
||||
static float output [BUFFER_LEN] ;
|
||||
|
||||
SRC_STATE *src_state ;
|
||||
|
||||
long read_count, read_total ;
|
||||
int error ;
|
||||
|
||||
printf ("\tcallback_test (SRC ratio = %6.4f) ........... ", src_ratio) ;
|
||||
fflush (stdout) ;
|
||||
|
||||
test_callback_data.channels = 2 ;
|
||||
test_callback_data.count = 0 ;
|
||||
test_callback_data.end_of_data = 0 ;
|
||||
test_callback_data.total = ARRAY_LEN (test_callback_data.data) ;
|
||||
|
||||
if ((src_state = src_callback_new (test_callback_func, converter, test_callback_data.channels, &error, &test_callback_data)) == NULL)
|
||||
{ printf ("\n\nLine %d : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
read_total = 0 ;
|
||||
do
|
||||
{ /* We will be throwing away output data, so just grab as much as possible. */
|
||||
read_count = ARRAY_LEN (output) / test_callback_data.channels ;
|
||||
read_count = src_callback_read (src_state, src_ratio, read_count, output) ;
|
||||
read_total += read_count ;
|
||||
}
|
||||
while (read_count > 0) ;
|
||||
|
||||
if ((error = src_error (src_state)) != 0)
|
||||
{ printf ("\n\nLine %d : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
src_state = src_delete (src_state) ;
|
||||
|
||||
if (fabs (read_total / src_ratio - ARRAY_LEN (test_callback_data.data)) > 2.0)
|
||||
{ printf ("\n\nLine %d : input / output length mismatch.\n\n", __LINE__) ;
|
||||
printf (" input len : %d\n", ARRAY_LEN (test_callback_data.data)) ;
|
||||
printf (" output len : %ld (should be %g +/- 2)\n\n", read_total,
|
||||
floor (0.5 + src_ratio * ARRAY_LEN (test_callback_data.data))) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
puts ("ok") ;
|
||||
|
||||
return ;
|
||||
} /* callback_test */
|
||||
|
||||
/*=====================================================================================
|
||||
*/
|
||||
|
||||
static long
|
||||
eos_callback_func (void *cb_data, float **data)
|
||||
{
|
||||
TEST_CB_DATA *pcb_data ;
|
||||
long frames ;
|
||||
|
||||
if (data == NULL)
|
||||
return 0 ;
|
||||
|
||||
if ((pcb_data = cb_data) == NULL)
|
||||
return 0 ;
|
||||
|
||||
/*
|
||||
** Return immediately if there is no more data.
|
||||
** In this case, the output pointer 'data' will not be set and
|
||||
** valgrind should not warn about it.
|
||||
*/
|
||||
if (pcb_data->end_of_data)
|
||||
return 0 ;
|
||||
|
||||
if (pcb_data->total - pcb_data->count > CB_READ_LEN)
|
||||
frames = CB_READ_LEN / pcb_data->channels ;
|
||||
else
|
||||
frames = (pcb_data->total - pcb_data->count) / pcb_data->channels ;
|
||||
|
||||
*data = pcb_data->data + pcb_data->count ;
|
||||
pcb_data->count += frames ;
|
||||
|
||||
/*
|
||||
** Set end_of_data so that the next call to the callback function will
|
||||
** return zero ocunt without setting the 'data' pointer.
|
||||
*/
|
||||
if (pcb_data->total < 2 * pcb_data->count)
|
||||
pcb_data->end_of_data = 1 ;
|
||||
|
||||
return frames ;
|
||||
} /* eos_callback_data */
|
||||
|
||||
|
||||
static void
|
||||
end_of_stream_test (int converter)
|
||||
{ static TEST_CB_DATA test_callback_data ;
|
||||
static float output [BUFFER_LEN] ;
|
||||
|
||||
SRC_STATE *src_state ;
|
||||
|
||||
double src_ratio = 0.3 ;
|
||||
long read_count, read_total ;
|
||||
int error ;
|
||||
|
||||
printf ("\t%-30s ........... ", src_get_name (converter)) ;
|
||||
fflush (stdout) ;
|
||||
|
||||
test_callback_data.channels = 2 ;
|
||||
test_callback_data.count = 0 ;
|
||||
test_callback_data.end_of_data = 0 ;
|
||||
test_callback_data.total = ARRAY_LEN (test_callback_data.data) ;
|
||||
|
||||
if ((src_state = src_callback_new (eos_callback_func, converter, test_callback_data.channels, &error, &test_callback_data)) == NULL)
|
||||
{ printf ("\n\nLine %d : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
read_total = 0 ;
|
||||
do
|
||||
{ /* We will be throwing away output data, so just grab as much as possible. */
|
||||
read_count = ARRAY_LEN (output) / test_callback_data.channels ;
|
||||
read_count = src_callback_read (src_state, src_ratio, read_count, output) ;
|
||||
read_total += read_count ;
|
||||
}
|
||||
while (read_count > 0) ;
|
||||
|
||||
if ((error = src_error (src_state)) != 0)
|
||||
{ printf ("\n\nLine %d : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
src_state = src_delete (src_state) ;
|
||||
|
||||
if (test_callback_data.end_of_data == 0)
|
||||
{ printf ("\n\nLine %d : test_callback_data.end_of_data should not be 0."
|
||||
" This is a bug in the test.\n\n", __LINE__) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
puts ("ok") ;
|
||||
return ;
|
||||
} /* end_of_stream_test */
|
|
@ -1,61 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2008-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <samplerate.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
static void
|
||||
downsample_test (int converter)
|
||||
{ static float in [1000], out [10] ;
|
||||
SRC_DATA data ;
|
||||
|
||||
printf (" downsample_test (%-28s) ....... ", src_get_name (converter)) ;
|
||||
fflush (stdout) ;
|
||||
|
||||
data.src_ratio = 1.0 / 255.0 ;
|
||||
data.input_frames = ARRAY_LEN (in) ;
|
||||
data.output_frames = ARRAY_LEN (out) ;
|
||||
data.data_in = in ;
|
||||
data.data_out = out ;
|
||||
|
||||
if (src_simple (&data, converter, 1))
|
||||
{ puts ("src_simple failed.") ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
puts ("ok") ;
|
||||
} /* downsample_test */
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
puts ("") ;
|
||||
|
||||
downsample_test (SRC_ZERO_ORDER_HOLD) ;
|
||||
downsample_test (SRC_LINEAR) ;
|
||||
downsample_test (SRC_SINC_FASTEST) ;
|
||||
downsample_test (SRC_SINC_MEDIUM_QUALITY) ;
|
||||
downsample_test (SRC_SINC_BEST_QUALITY) ;
|
||||
|
||||
puts ("") ;
|
||||
|
||||
return 0 ;
|
||||
} /* main */
|
|
@ -1,192 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2003-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <samplerate.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#define BUFFER_LEN 10000
|
||||
|
||||
static void float_to_short_test (void) ;
|
||||
static void short_to_float_test (void) ;
|
||||
|
||||
static void float_to_int_test (void) ;
|
||||
static void int_to_float_test (void) ;
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
puts ("") ;
|
||||
|
||||
float_to_short_test () ;
|
||||
short_to_float_test () ;
|
||||
|
||||
float_to_int_test () ;
|
||||
int_to_float_test () ;
|
||||
|
||||
puts ("") ;
|
||||
|
||||
return 0 ;
|
||||
} /* main */
|
||||
|
||||
/*=====================================================================================
|
||||
*/
|
||||
|
||||
static void
|
||||
float_to_short_test (void)
|
||||
{
|
||||
static float fpos [] =
|
||||
{ 0.95, 0.99, 1.0, 1.01, 1.1, 2.0, 11.1, 111.1, 2222.2, 33333.3
|
||||
} ;
|
||||
static float fneg [] =
|
||||
{ -0.95, -0.99, -1.0, -1.01, -1.1, -2.0, -11.1, -111.1, -2222.2, -33333.3
|
||||
} ;
|
||||
|
||||
static short out [MAX (ARRAY_LEN (fpos), ARRAY_LEN (fneg))] ;
|
||||
|
||||
int k ;
|
||||
|
||||
printf ("\tfloat_to_short_test ............................. ") ;
|
||||
|
||||
src_float_to_short_array (fpos, out, ARRAY_LEN (fpos)) ;
|
||||
|
||||
for (k = 0 ; k < ARRAY_LEN (fpos) ; k++)
|
||||
if (out [k] < 30000)
|
||||
{ printf ("\n\n\tLine %d : out [%d] == %d\n", __LINE__, k, out [k]) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
src_float_to_short_array (fneg, out, ARRAY_LEN (fneg)) ;
|
||||
|
||||
for (k = 0 ; k < ARRAY_LEN (fneg) ; k++)
|
||||
if (out [k] > -30000)
|
||||
{ printf ("\n\n\tLine %d : out [%d] == %d\n", __LINE__, k, out [k]) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
puts ("ok") ;
|
||||
|
||||
return ;
|
||||
} /* float_to_short_test */
|
||||
|
||||
/*-------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static void
|
||||
short_to_float_test (void)
|
||||
{
|
||||
static short input [BUFFER_LEN] ;
|
||||
static short output [BUFFER_LEN] ;
|
||||
static float temp [BUFFER_LEN] ;
|
||||
|
||||
int k ;
|
||||
|
||||
printf ("\tshort_to_float_test ............................. ") ;
|
||||
|
||||
for (k = 0 ; k < ARRAY_LEN (input) ; k++)
|
||||
input [k] = (k * 0x8000) / ARRAY_LEN (input) ;
|
||||
|
||||
src_short_to_float_array (input, temp, ARRAY_LEN (temp)) ;
|
||||
src_float_to_short_array (temp, output, ARRAY_LEN (output)) ;
|
||||
|
||||
for (k = 0 ; k < ARRAY_LEN (input) ; k++)
|
||||
if (ABS (input [k] - output [k]) > 0)
|
||||
{ printf ("\n\n\tLine %d : index %d %d -> %d\n", __LINE__, k, input [k], output [k]) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
puts ("ok") ;
|
||||
|
||||
return ;
|
||||
} /* short_to_float_test */
|
||||
|
||||
/*=====================================================================================
|
||||
*/
|
||||
|
||||
static void
|
||||
float_to_int_test (void)
|
||||
{
|
||||
static float fpos [] =
|
||||
{ 0.95, 0.99, 1.0, 1.01, 1.1, 2.0, 11.1, 111.1, 2222.2, 33333.3
|
||||
} ;
|
||||
static float fneg [] =
|
||||
{ -0.95, -0.99, -1.0, -1.01, -1.1, -2.0, -11.1, -111.1, -2222.2, -33333.3
|
||||
} ;
|
||||
|
||||
static int out [MAX (ARRAY_LEN (fpos), ARRAY_LEN (fneg))] ;
|
||||
|
||||
int k ;
|
||||
|
||||
printf ("\tfloat_to_int_test ............................... ") ;
|
||||
|
||||
src_float_to_int_array (fpos, out, ARRAY_LEN (fpos)) ;
|
||||
|
||||
for (k = 0 ; k < ARRAY_LEN (fpos) ; k++)
|
||||
if (out [k] < 30000 * 0x10000)
|
||||
{ printf ("\n\n\tLine %d : out [%d] == %d\n", __LINE__, k, out [k]) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
src_float_to_int_array (fneg, out, ARRAY_LEN (fneg)) ;
|
||||
|
||||
for (k = 0 ; k < ARRAY_LEN (fneg) ; k++)
|
||||
if (out [k] > -30000 * 0x1000)
|
||||
{ printf ("\n\n\tLine %d : out [%d] == %d\n", __LINE__, k, out [k]) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
puts ("ok") ;
|
||||
|
||||
return ;
|
||||
} /* float_to_int_test */
|
||||
|
||||
/*-------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static void
|
||||
int_to_float_test (void)
|
||||
{
|
||||
static int input [BUFFER_LEN] ;
|
||||
static int output [BUFFER_LEN] ;
|
||||
static float temp [BUFFER_LEN] ;
|
||||
|
||||
int k ;
|
||||
|
||||
printf ("\tint_to_float_test ............................... ") ;
|
||||
|
||||
for (k = 0 ; k < ARRAY_LEN (input) ; k++)
|
||||
input [k] = (k * 0x80000000) / ARRAY_LEN (input) ;
|
||||
|
||||
src_int_to_float_array (input, temp, ARRAY_LEN (temp)) ;
|
||||
src_float_to_int_array (temp, output, ARRAY_LEN (output)) ;
|
||||
|
||||
for (k = 0 ; k < ARRAY_LEN (input) ; k++)
|
||||
if (ABS (input [k] - output [k]) > 0)
|
||||
{ printf ("\n\n\tLine %d : index %d %d -> %d\n", __LINE__, k, input [k], output [k]) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
puts ("ok") ;
|
||||
|
||||
return ;
|
||||
} /* int_to_float_test */
|
||||
|
|
@ -1,175 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <samplerate.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
static void name_test (void) ;
|
||||
static void error_test (void) ;
|
||||
static void src_ratio_test (void) ;
|
||||
static void zero_input_test (int converter) ;
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
puts ("") ;
|
||||
|
||||
printf (" version : %s\n\n", src_get_version ()) ;
|
||||
|
||||
/* Current max converter is SRC_LINEAR. */
|
||||
name_test () ;
|
||||
|
||||
error_test () ;
|
||||
|
||||
src_ratio_test () ;
|
||||
|
||||
zero_input_test (SRC_ZERO_ORDER_HOLD) ;
|
||||
zero_input_test (SRC_LINEAR) ;
|
||||
zero_input_test (SRC_SINC_FASTEST) ;
|
||||
|
||||
puts ("") ;
|
||||
return 0 ;
|
||||
} /* main */
|
||||
|
||||
static void
|
||||
name_test (void)
|
||||
{ const char *name ;
|
||||
int k = 0 ;
|
||||
|
||||
puts (" name_test :") ;
|
||||
|
||||
while (1)
|
||||
{ name = src_get_name (k) ;
|
||||
if (name == NULL)
|
||||
break ;
|
||||
printf ("\tName %d : %s\n", k, name) ;
|
||||
printf ("\tDesc %d : %s\n", k, src_get_description (k)) ;
|
||||
k ++ ;
|
||||
} ;
|
||||
|
||||
puts ("") ;
|
||||
|
||||
return ;
|
||||
} /* name_test */
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{ double ratio ;
|
||||
int should_pass ;
|
||||
} RATIO_TEST ;
|
||||
|
||||
static RATIO_TEST ratio_test [] =
|
||||
{ { 1.0 / 256.1, 0 },
|
||||
{ 1.0 / 256.0, 1 },
|
||||
{ 1.0, 1 },
|
||||
{ 256.0, 1 },
|
||||
{ 256.1, 0 },
|
||||
{ -1.0, 0 }
|
||||
} ;
|
||||
|
||||
static void
|
||||
src_ratio_test (void)
|
||||
{ int k ;
|
||||
|
||||
puts (" src_ratio_test (SRC ratio must be in range [1/256, 256]):" ) ;
|
||||
|
||||
|
||||
for (k = 0 ; k < ARRAY_LEN (ratio_test) ; k++)
|
||||
{ if (ratio_test [k].should_pass && src_is_valid_ratio (ratio_test [k].ratio) == 0)
|
||||
{ printf ("\n\nLine %d : SRC ratio %f should have passed.\n\n", __LINE__, ratio_test [k].ratio) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
if (! ratio_test [k].should_pass && src_is_valid_ratio (ratio_test [k].ratio) != 0)
|
||||
{ printf ("\n\nLine %d : SRC ratio %f should not have passed.\n\n", __LINE__, ratio_test [k].ratio) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
printf ("\t SRC ratio (%9.5f) : %s ................... ok\n", ratio_test [k].ratio,
|
||||
(ratio_test [k].should_pass ? "pass" : "fail")) ;
|
||||
} ;
|
||||
|
||||
puts ("") ;
|
||||
|
||||
return ;
|
||||
} /* src_ratio_test */
|
||||
|
||||
static void
|
||||
error_test (void)
|
||||
{ const char *errorstr ;
|
||||
int k, errors = 0 ;
|
||||
|
||||
puts (" error_test :") ;
|
||||
|
||||
for (k = 0 ; 1 ; k++)
|
||||
{ errorstr = src_strerror (k) ;
|
||||
printf ("\t%-2d : %s\n", k, errorstr) ;
|
||||
if (errorstr == NULL)
|
||||
{ errors ++ ;
|
||||
continue ;
|
||||
} ;
|
||||
if (strstr (errorstr, "Placeholder.") == errorstr)
|
||||
break ;
|
||||
} ;
|
||||
|
||||
if (errors != 0)
|
||||
{ printf ("\n\nLine %d : Missing error numbers above.\n\n", __LINE__) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
puts ("") ;
|
||||
|
||||
return ;
|
||||
} /* error_test */
|
||||
|
||||
static void
|
||||
zero_input_test (int converter)
|
||||
{ SRC_DATA data ;
|
||||
SRC_STATE *state ;
|
||||
float out [100] ;
|
||||
int error ;
|
||||
|
||||
printf (" %s (%-26s) ........ ", __func__, src_get_name (converter)) ;
|
||||
fflush (stdout) ;
|
||||
|
||||
if ((state = src_new (converter, 1, &error)) == NULL)
|
||||
{ printf ("\n\nLine %d : src_new failed : %s.\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
data.data_in = (float *) 0xdeadbeef ;
|
||||
data.input_frames = 0 ;
|
||||
data.data_out = out ;
|
||||
data.output_frames = ARRAY_LEN (out) ;
|
||||
data.end_of_input = 0 ;
|
||||
data.src_ratio = 1.0 ;
|
||||
|
||||
if ((error = src_process (state, &data)))
|
||||
{ printf ("\n\nLine %d : src_new failed : %s.\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
state = src_delete (state) ;
|
||||
|
||||
puts ("ok") ;
|
||||
} /* zero_input_test */
|
|
@ -1,364 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <samplerate.h>
|
||||
|
||||
#include "util.h"
|
||||
#define BUFFER_LEN 50000
|
||||
#define BLOCK_LEN (12)
|
||||
|
||||
#define MAX_CHANNELS 10
|
||||
|
||||
static void simple_test (int converter, int channel_count, double target_snr) ;
|
||||
static void process_test (int converter, int channel_count, double target_snr) ;
|
||||
static void callback_test (int converter, int channel_count, double target_snr) ;
|
||||
|
||||
int
|
||||
main (void)
|
||||
{ double target ;
|
||||
int k ;
|
||||
|
||||
puts ("\n Zero Order Hold interpolator :") ;
|
||||
target = 38.0 ;
|
||||
for (k = 1 ; k <= 3 ; k++)
|
||||
{ simple_test (SRC_ZERO_ORDER_HOLD, k, target) ;
|
||||
process_test (SRC_ZERO_ORDER_HOLD, k, target) ;
|
||||
callback_test (SRC_ZERO_ORDER_HOLD, k, target) ;
|
||||
} ;
|
||||
|
||||
puts ("\n Linear interpolator :") ;
|
||||
target = 79.0 ;
|
||||
for (k = 1 ; k <= 3 ; k++)
|
||||
{ simple_test (SRC_LINEAR, k, target) ;
|
||||
process_test (SRC_LINEAR, k, target) ;
|
||||
callback_test (SRC_LINEAR, k, target) ;
|
||||
} ;
|
||||
|
||||
puts ("\n Sinc interpolator :") ;
|
||||
target = 100.0 ;
|
||||
for (k = 1 ; k <= MAX_CHANNELS ; k++)
|
||||
{ simple_test (SRC_SINC_FASTEST, k, target) ;
|
||||
process_test (SRC_SINC_FASTEST, k, target) ;
|
||||
callback_test (SRC_SINC_FASTEST, k, target) ;
|
||||
} ;
|
||||
|
||||
puts ("") ;
|
||||
|
||||
return 0 ;
|
||||
} /* main */
|
||||
|
||||
/*==============================================================================
|
||||
*/
|
||||
|
||||
static float input_serial [BUFFER_LEN * MAX_CHANNELS] ;
|
||||
static float input_interleaved [BUFFER_LEN * MAX_CHANNELS] ;
|
||||
static float output_interleaved [BUFFER_LEN * MAX_CHANNELS] ;
|
||||
static float output_serial [BUFFER_LEN * MAX_CHANNELS] ;
|
||||
|
||||
static void
|
||||
simple_test (int converter, int channel_count, double target_snr)
|
||||
{ SRC_DATA src_data ;
|
||||
|
||||
double freq, snr ;
|
||||
int ch, error, frames ;
|
||||
|
||||
printf ("\t%-22s (%2d channel%c) ............ ", "simple_test", channel_count, channel_count > 1 ? 's' : ' ') ;
|
||||
fflush (stdout) ;
|
||||
|
||||
assert (channel_count <= MAX_CHANNELS) ;
|
||||
|
||||
memset (input_serial, 0, sizeof (input_serial)) ;
|
||||
memset (input_interleaved, 0, sizeof (input_interleaved)) ;
|
||||
memset (output_interleaved, 0, sizeof (output_interleaved)) ;
|
||||
memset (output_serial, 0, sizeof (output_serial)) ;
|
||||
|
||||
frames = BUFFER_LEN ;
|
||||
|
||||
/* Calculate channel_count separate windowed sine waves. */
|
||||
for (ch = 0 ; ch < channel_count ; ch++)
|
||||
{ freq = (200.0 + 33.333333333 * ch) / 44100.0 ;
|
||||
gen_windowed_sines (1, &freq, 1.0, input_serial + ch * frames, frames) ;
|
||||
} ;
|
||||
|
||||
/* Interleave the data in preparation for SRC. */
|
||||
interleave_data (input_serial, input_interleaved, frames, channel_count) ;
|
||||
|
||||
/* Choose a converstion ratio <= 1.0. */
|
||||
src_data.src_ratio = 0.95 ;
|
||||
|
||||
src_data.data_in = input_interleaved ;
|
||||
src_data.input_frames = frames ;
|
||||
|
||||
src_data.data_out = output_interleaved ;
|
||||
src_data.output_frames = frames ;
|
||||
|
||||
if ((error = src_simple (&src_data, converter, channel_count)))
|
||||
{ printf ("\n\nLine %d : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (fabs (src_data.output_frames_gen - src_data.src_ratio * src_data.input_frames) > 2)
|
||||
{ printf ("\n\nLine %d : bad output data length %ld should be %d.\n", __LINE__,
|
||||
src_data.output_frames_gen, (int) floor (src_data.src_ratio * src_data.input_frames)) ;
|
||||
printf ("\tsrc_ratio : %.4f\n", src_data.src_ratio) ;
|
||||
printf ("\tinput_len : %ld\n", src_data.input_frames) ;
|
||||
printf ("\toutput_len : %ld\n\n", src_data.output_frames_gen) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
/* De-interleave data so SNR can be calculated for each channel. */
|
||||
deinterleave_data (output_interleaved, output_serial, frames, channel_count) ;
|
||||
|
||||
for (ch = 0 ; ch < channel_count ; ch++)
|
||||
{ snr = calculate_snr (output_serial + ch * frames, frames, 1) ;
|
||||
if (snr < target_snr)
|
||||
{ printf ("\n\nLine %d: channel %d snr %f should be %f\n", __LINE__, ch, snr, target_snr) ;
|
||||
save_oct_float ("output.dat", input_serial, channel_count * frames, output_serial, channel_count * frames) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
} ;
|
||||
|
||||
puts ("ok") ;
|
||||
|
||||
return ;
|
||||
} /* simple_test */
|
||||
|
||||
/*==============================================================================
|
||||
*/
|
||||
|
||||
static void
|
||||
process_test (int converter, int channel_count, double target_snr)
|
||||
{ SRC_STATE *src_state ;
|
||||
SRC_DATA src_data ;
|
||||
|
||||
double freq, snr ;
|
||||
int ch, error, frames, current_in, current_out ;
|
||||
|
||||
printf ("\t%-22s (%2d channel%c) ............ ", "process_test", channel_count, channel_count > 1 ? 's' : ' ') ;
|
||||
fflush (stdout) ;
|
||||
|
||||
assert (channel_count <= MAX_CHANNELS) ;
|
||||
|
||||
memset (input_serial, 0, sizeof (input_serial)) ;
|
||||
memset (input_interleaved, 0, sizeof (input_interleaved)) ;
|
||||
memset (output_interleaved, 0, sizeof (output_interleaved)) ;
|
||||
memset (output_serial, 0, sizeof (output_serial)) ;
|
||||
|
||||
frames = BUFFER_LEN ;
|
||||
|
||||
/* Calculate channel_count separate windowed sine waves. */
|
||||
for (ch = 0 ; ch < channel_count ; ch++)
|
||||
{ freq = (400.0 + 11.333333333 * ch) / 44100.0 ;
|
||||
gen_windowed_sines (1, &freq, 1.0, input_serial + ch * frames, frames) ;
|
||||
} ;
|
||||
|
||||
/* Interleave the data in preparation for SRC. */
|
||||
interleave_data (input_serial, input_interleaved, frames, channel_count) ;
|
||||
|
||||
/* Perform sample rate conversion. */
|
||||
if ((src_state = src_new (converter, channel_count, &error)) == NULL)
|
||||
{ printf ("\n\nLine %d : src_new() failed : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
src_data.end_of_input = 0 ; /* Set this later. */
|
||||
|
||||
/* Choose a converstion ratio < 1.0. */
|
||||
src_data.src_ratio = 0.95 ;
|
||||
|
||||
src_data.data_in = input_interleaved ;
|
||||
src_data.data_out = output_interleaved ;
|
||||
|
||||
current_in = current_out = 0 ;
|
||||
|
||||
while (1)
|
||||
{ src_data.input_frames = MAX (MIN (BLOCK_LEN, frames - current_in), 0) ;
|
||||
src_data.output_frames = MAX (MIN (BLOCK_LEN, frames - current_out), 0) ;
|
||||
|
||||
if ((error = src_process (src_state, &src_data)))
|
||||
{ printf ("\n\nLine %d : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (src_data.end_of_input && src_data.output_frames_gen == 0)
|
||||
break ;
|
||||
|
||||
current_in += src_data.input_frames_used ;
|
||||
current_out += src_data.output_frames_gen ;
|
||||
|
||||
src_data.data_in += src_data.input_frames_used * channel_count ;
|
||||
src_data.data_out += src_data.output_frames_gen * channel_count ;
|
||||
|
||||
src_data.end_of_input = (current_in >= frames) ? 1 : 0 ;
|
||||
} ;
|
||||
|
||||
src_state = src_delete (src_state) ;
|
||||
|
||||
if (fabs (current_out - src_data.src_ratio * current_in) > 2)
|
||||
{ printf ("\n\nLine %d : bad output data length %d should be %d.\n", __LINE__,
|
||||
current_out, (int) floor (src_data.src_ratio * current_in)) ;
|
||||
printf ("\tsrc_ratio : %.4f\n", src_data.src_ratio) ;
|
||||
printf ("\tinput_len : %d\n", frames) ;
|
||||
printf ("\toutput_len : %d\n\n", current_out) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
/* De-interleave data so SNR can be calculated for each channel. */
|
||||
deinterleave_data (output_interleaved, output_serial, frames, channel_count) ;
|
||||
|
||||
for (ch = 0 ; ch < channel_count ; ch++)
|
||||
{ snr = calculate_snr (output_serial + ch * frames, frames, 1) ;
|
||||
if (snr < target_snr)
|
||||
{ printf ("\n\nLine %d: channel %d snr %f should be %f\n", __LINE__, ch, snr, target_snr) ;
|
||||
save_oct_float ("output.dat", input_serial, channel_count * frames, output_serial, channel_count * frames) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
} ;
|
||||
|
||||
puts ("ok") ;
|
||||
|
||||
return ;
|
||||
} /* process_test */
|
||||
|
||||
/*==============================================================================
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{ int channels ;
|
||||
long total_frames ;
|
||||
long current_frame ;
|
||||
float *data ;
|
||||
} TEST_CB_DATA ;
|
||||
|
||||
static long
|
||||
test_callback_func (void *cb_data, float **data)
|
||||
{ TEST_CB_DATA *pcb_data ;
|
||||
|
||||
long frames ;
|
||||
|
||||
if ((pcb_data = cb_data) == NULL)
|
||||
return 0 ;
|
||||
|
||||
if (data == NULL)
|
||||
return 0 ;
|
||||
|
||||
*data = pcb_data->data + (pcb_data->current_frame * pcb_data->channels) ;
|
||||
|
||||
if (pcb_data->total_frames - pcb_data->current_frame < BLOCK_LEN)
|
||||
frames = pcb_data->total_frames - pcb_data->current_frame ;
|
||||
else
|
||||
frames = BLOCK_LEN ;
|
||||
|
||||
pcb_data->current_frame += frames ;
|
||||
|
||||
return frames ;
|
||||
} /* test_callback_func */
|
||||
|
||||
static void
|
||||
callback_test (int converter, int channel_count, double target_snr)
|
||||
{ TEST_CB_DATA test_callback_data ;
|
||||
SRC_STATE *src_state = NULL ;
|
||||
|
||||
double freq, snr, src_ratio ;
|
||||
int ch, error, frames, read_total, read_count ;
|
||||
|
||||
printf ("\t%-22s (%2d channel%c) ............ ", "callback_test", channel_count, channel_count > 1 ? 's' : ' ') ;
|
||||
fflush (stdout) ;
|
||||
|
||||
assert (channel_count <= MAX_CHANNELS) ;
|
||||
|
||||
memset (input_serial, 0, sizeof (input_serial)) ;
|
||||
memset (input_interleaved, 0, sizeof (input_interleaved)) ;
|
||||
memset (output_interleaved, 0, sizeof (output_interleaved)) ;
|
||||
memset (output_serial, 0, sizeof (output_serial)) ;
|
||||
memset (&test_callback_data, 0, sizeof (test_callback_data)) ;
|
||||
|
||||
frames = BUFFER_LEN ;
|
||||
|
||||
/* Calculate channel_count separate windowed sine waves. */
|
||||
for (ch = 0 ; ch < channel_count ; ch++)
|
||||
{ freq = (200.0 + 33.333333333 * ch) / 44100.0 ;
|
||||
gen_windowed_sines (1, &freq, 1.0, input_serial + ch * frames, frames) ;
|
||||
} ;
|
||||
|
||||
/* Interleave the data in preparation for SRC. */
|
||||
interleave_data (input_serial, input_interleaved, frames, channel_count) ;
|
||||
|
||||
/* Perform sample rate conversion. */
|
||||
src_ratio = 0.95 ;
|
||||
test_callback_data.channels = channel_count ;
|
||||
test_callback_data.total_frames = frames ;
|
||||
test_callback_data.current_frame = 0 ;
|
||||
test_callback_data.data = input_interleaved ;
|
||||
|
||||
if ((src_state = src_callback_new (test_callback_func, converter, channel_count, &error, &test_callback_data)) == NULL)
|
||||
{ printf ("\n\nLine %d : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
read_total = 0 ;
|
||||
while (read_total < frames)
|
||||
{ read_count = src_callback_read (src_state, src_ratio, frames - read_total, output_interleaved + read_total * channel_count) ;
|
||||
|
||||
if (read_count <= 0)
|
||||
break ;
|
||||
|
||||
read_total += read_count ;
|
||||
} ;
|
||||
|
||||
if ((error = src_error (src_state)) != 0)
|
||||
{ printf ("\n\nLine %d : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
src_state = src_delete (src_state) ;
|
||||
|
||||
if (fabs (read_total - src_ratio * frames) > 2)
|
||||
{ printf ("\n\nLine %d : bad output data length %d should be %d.\n", __LINE__,
|
||||
read_total, (int) floor (src_ratio * frames)) ;
|
||||
printf ("\tsrc_ratio : %.4f\n", src_ratio) ;
|
||||
printf ("\tinput_len : %d\n", frames) ;
|
||||
printf ("\toutput_len : %d\n\n", read_total) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
/* De-interleave data so SNR can be calculated for each channel. */
|
||||
deinterleave_data (output_interleaved, output_serial, frames, channel_count) ;
|
||||
|
||||
for (ch = 0 ; ch < channel_count ; ch++)
|
||||
{ snr = calculate_snr (output_serial + ch * frames, frames, 1) ;
|
||||
if (snr < target_snr)
|
||||
{ printf ("\n\nLine %d: channel %d snr %f should be %f\n", __LINE__, ch, snr, target_snr) ;
|
||||
save_oct_float ("output.dat", input_serial, channel_count * frames, output_serial, channel_count * frames) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
} ;
|
||||
|
||||
puts ("ok") ;
|
||||
|
||||
return ;
|
||||
} /* callback_test */
|
||||
|
|
@ -1,216 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2008-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <samplerate.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "util.h"
|
||||
#include "float_cast.h"
|
||||
|
||||
#define BUFFER_LEN (1<<17)
|
||||
|
||||
static float input [BUFFER_LEN] ;
|
||||
static float output [BUFFER_LEN] ;
|
||||
|
||||
static long
|
||||
throughput_test (int converter, int channels, long best_throughput)
|
||||
{ SRC_DATA src_data ;
|
||||
clock_t start_time, clock_time ;
|
||||
double duration ;
|
||||
long total_frames = 0, throughput ;
|
||||
int error ;
|
||||
|
||||
printf (" %-30s %2d ", src_get_name (converter), channels) ;
|
||||
fflush (stdout) ;
|
||||
|
||||
src_data.data_in = input ;
|
||||
src_data.input_frames = ARRAY_LEN (input) / channels ;
|
||||
|
||||
src_data.data_out = output ;
|
||||
src_data.output_frames = ARRAY_LEN (output) / channels ;
|
||||
|
||||
src_data.src_ratio = 0.99 ;
|
||||
|
||||
sleep (2) ;
|
||||
|
||||
start_time = clock () ;
|
||||
|
||||
do
|
||||
{
|
||||
if ((error = src_simple (&src_data, converter, channels)) != 0)
|
||||
{ puts (src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
total_frames += src_data.output_frames_gen ;
|
||||
|
||||
clock_time = clock () - start_time ;
|
||||
duration = (1.0 * clock_time) / CLOCKS_PER_SEC ;
|
||||
}
|
||||
while (duration < 5.0) ;
|
||||
|
||||
if (src_data.input_frames_used != src_data.input_frames)
|
||||
{ printf ("\n\nLine %d : input frames used %ld should be %ld\n", __LINE__, src_data.input_frames_used, src_data.input_frames) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (fabs (src_data.src_ratio * src_data.input_frames_used - src_data.output_frames_gen) > 2)
|
||||
{ printf ("\n\nLine %d : input / output length mismatch.\n\n", __LINE__) ;
|
||||
printf (" input len : %d\n", ARRAY_LEN (input) / channels) ;
|
||||
printf (" output len : %ld (should be %g +/- 2)\n\n", src_data.output_frames_gen,
|
||||
floor (0.5 + src_data.src_ratio * src_data.input_frames_used)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
throughput = lrint (floor (total_frames / duration)) ;
|
||||
|
||||
if (best_throughput == 0)
|
||||
{ best_throughput = MAX (throughput, best_throughput) ;
|
||||
printf ("%5.2f %10ld\n", duration, throughput) ;
|
||||
}
|
||||
else
|
||||
{ best_throughput = MAX (throughput, best_throughput) ;
|
||||
printf ("%5.2f %10ld %10ld\n", duration, throughput, best_throughput) ;
|
||||
}
|
||||
|
||||
return best_throughput ;
|
||||
} /* throughput_test */
|
||||
|
||||
static void
|
||||
single_run (void)
|
||||
{ const int max_channels = 10 ;
|
||||
int k ;
|
||||
|
||||
printf ("\n CPU name : %s\n", get_cpu_name ()) ;
|
||||
|
||||
puts (
|
||||
"\n"
|
||||
" Converter Channels Duration Throughput\n"
|
||||
" ---------------------------------------------------------------------"
|
||||
) ;
|
||||
|
||||
for (k = 1 ; k <= max_channels / 2 ; k++)
|
||||
throughput_test (SRC_SINC_FASTEST, k, 0) ;
|
||||
|
||||
puts ("") ;
|
||||
for (k = 1 ; k <= max_channels / 2 ; k++)
|
||||
throughput_test (SRC_SINC_MEDIUM_QUALITY, k, 0) ;
|
||||
|
||||
puts ("") ;
|
||||
for (k = 1 ; k <= max_channels ; k++)
|
||||
throughput_test (SRC_SINC_BEST_QUALITY, k, 0) ;
|
||||
|
||||
puts ("") ;
|
||||
return ;
|
||||
} /* single_run */
|
||||
|
||||
static void
|
||||
multi_run (int run_count)
|
||||
{ int k, ch ;
|
||||
|
||||
printf ("\n CPU name : %s\n", get_cpu_name ()) ;
|
||||
|
||||
puts (
|
||||
"\n"
|
||||
" Converter Channels Duration Throughput Best Throughput\n"
|
||||
" ----------------------------------------------------------------------------------------"
|
||||
) ;
|
||||
|
||||
for (ch = 1 ; ch <= 5 ; ch++)
|
||||
{ long sinc_fastest = 0, sinc_medium = 0, sinc_best = 0 ;
|
||||
|
||||
for (k = 0 ; k < run_count ; k++)
|
||||
{ sinc_fastest = throughput_test (SRC_SINC_FASTEST, ch, sinc_fastest) ;
|
||||
sinc_medium = throughput_test (SRC_SINC_MEDIUM_QUALITY, ch, sinc_medium) ;
|
||||
sinc_best = throughput_test (SRC_SINC_BEST_QUALITY, ch, sinc_best) ;
|
||||
|
||||
puts ("") ;
|
||||
|
||||
/* Let the CPU cool down. We might be running on a laptop. */
|
||||
sleep (10) ;
|
||||
} ;
|
||||
|
||||
puts (
|
||||
"\n"
|
||||
" Converter Best Throughput\n"
|
||||
" ------------------------------------------------"
|
||||
) ;
|
||||
|
||||
printf (" %-30s %10ld\n", src_get_name (SRC_SINC_FASTEST), sinc_fastest) ;
|
||||
printf (" %-30s %10ld\n", src_get_name (SRC_SINC_MEDIUM_QUALITY), sinc_medium) ;
|
||||
printf (" %-30s %10ld\n", src_get_name (SRC_SINC_BEST_QUALITY), sinc_best) ;
|
||||
} ;
|
||||
|
||||
puts ("") ;
|
||||
} /* multi_run */
|
||||
|
||||
static void
|
||||
usage_exit (const char * argv0)
|
||||
{ const char * cptr ;
|
||||
|
||||
if ((cptr = strrchr (argv0, '/')) != NULL)
|
||||
argv0 = cptr ;
|
||||
|
||||
printf (
|
||||
"Usage :\n"
|
||||
" %s - Single run of the throughput test.\n"
|
||||
" %s --best-of N - Do N runs of test a print bext result.\n"
|
||||
"\n",
|
||||
argv0, argv0) ;
|
||||
|
||||
exit (0) ;
|
||||
} /* usage_exit */
|
||||
|
||||
int
|
||||
main (int argc, char ** argv)
|
||||
{ double freq ;
|
||||
|
||||
memset (input, 0, sizeof (input)) ;
|
||||
freq = 0.01 ;
|
||||
gen_windowed_sines (1, &freq, 1.0, input, BUFFER_LEN) ;
|
||||
|
||||
if (argc == 1)
|
||||
single_run () ;
|
||||
else if (argc == 3 && strcmp (argv [1], "--best-of") == 0)
|
||||
{ int run_count = atoi (argv [2]) ;
|
||||
|
||||
if (run_count < 1 || run_count > 20)
|
||||
{ printf ("Please be sensible. Run count should be in range (1, 10].\n") ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
multi_run (run_count) ;
|
||||
}
|
||||
else
|
||||
usage_exit (argv [0]) ;
|
||||
|
||||
puts (
|
||||
" Duration is in seconds.\n"
|
||||
" Throughput is in frames/sec (more is better).\n"
|
||||
) ;
|
||||
|
||||
return 0 ;
|
||||
} /* main */
|
||||
|
|
@ -1,238 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <samplerate.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#define BUFFER_LEN 2048
|
||||
#define CB_READ_LEN 256
|
||||
|
||||
static void process_reset_test (int converter) ;
|
||||
static void callback_reset_test (int converter) ;
|
||||
|
||||
static float data_one [BUFFER_LEN] ;
|
||||
static float data_zero [BUFFER_LEN] ;
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
puts ("") ;
|
||||
|
||||
process_reset_test (SRC_ZERO_ORDER_HOLD) ;
|
||||
process_reset_test (SRC_LINEAR) ;
|
||||
process_reset_test (SRC_SINC_FASTEST) ;
|
||||
|
||||
callback_reset_test (SRC_ZERO_ORDER_HOLD) ;
|
||||
callback_reset_test (SRC_LINEAR) ;
|
||||
callback_reset_test (SRC_SINC_FASTEST) ;
|
||||
|
||||
puts ("") ;
|
||||
|
||||
return 0 ;
|
||||
} /* main */
|
||||
|
||||
static void
|
||||
process_reset_test (int converter)
|
||||
{ static float output [BUFFER_LEN] ;
|
||||
|
||||
SRC_STATE *src_state ;
|
||||
SRC_DATA src_data ;
|
||||
int k, error ;
|
||||
|
||||
printf ("\tprocess_reset_test (%-28s) ....... ", src_get_name (converter)) ;
|
||||
fflush (stdout) ;
|
||||
|
||||
for (k = 0 ; k < BUFFER_LEN ; k++)
|
||||
{ data_one [k] = 1.0 ;
|
||||
data_zero [k] = 0.0 ;
|
||||
} ;
|
||||
|
||||
/* Get a converter. */
|
||||
if ((src_state = src_new (converter, 1, &error)) == NULL)
|
||||
{ printf ("\n\nLine %d : src_new() failed : %s.\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
/* Process a bunch of 1.0 valued samples. */
|
||||
src_data.data_in = data_one ;
|
||||
src_data.data_out = output ;
|
||||
src_data.input_frames = BUFFER_LEN ;
|
||||
src_data.output_frames = BUFFER_LEN ;
|
||||
src_data.src_ratio = 0.9 ;
|
||||
src_data.end_of_input = 1 ;
|
||||
|
||||
if ((error = src_process (src_state, &src_data)) != 0)
|
||||
{ printf ("\n\nLine %d : src_simple () returned error : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
/* Reset the state of the converter.*/
|
||||
src_reset (src_state) ;
|
||||
|
||||
/* Now process some zero data. */
|
||||
src_data.data_in = data_zero ;
|
||||
src_data.data_out = output ;
|
||||
src_data.input_frames = BUFFER_LEN ;
|
||||
src_data.output_frames = BUFFER_LEN ;
|
||||
src_data.src_ratio = 0.9 ;
|
||||
src_data.end_of_input = 1 ;
|
||||
|
||||
if ((error = src_process (src_state, &src_data)) != 0)
|
||||
{ printf ("\n\nLine %d : src_simple () returned error : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
/* Finally make sure that the output data is zero ie reset was sucessful. */
|
||||
for (k = 0 ; k < BUFFER_LEN / 2 ; k++)
|
||||
if (output [k] != 0.0)
|
||||
{ printf ("\n\nLine %d : output [%d] should be 0.0, is %f.\n", __LINE__, k, output [k]) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
/* Make sure that this function has been exported. */
|
||||
src_set_ratio (src_state, 1.0) ;
|
||||
|
||||
/* Delete converter. */
|
||||
src_state = src_delete (src_state) ;
|
||||
|
||||
puts ("ok") ;
|
||||
} /* process_reset_test */
|
||||
|
||||
/*==============================================================================
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{ int channels ;
|
||||
long count, total ;
|
||||
float *data ;
|
||||
} TEST_CB_DATA ;
|
||||
|
||||
static long
|
||||
test_callback_func (void *cb_data, float **data)
|
||||
{ TEST_CB_DATA *pcb_data ;
|
||||
|
||||
long frames ;
|
||||
|
||||
if ((pcb_data = cb_data) == NULL)
|
||||
return 0 ;
|
||||
|
||||
if (data == NULL)
|
||||
return 0 ;
|
||||
|
||||
if (pcb_data->total - pcb_data->count > 0)
|
||||
frames = pcb_data->total - pcb_data->count ;
|
||||
else
|
||||
frames = 0 ;
|
||||
|
||||
*data = pcb_data->data + pcb_data->count ;
|
||||
pcb_data->count += frames ;
|
||||
|
||||
return frames ;
|
||||
} /* test_callback_func */
|
||||
|
||||
static void
|
||||
callback_reset_test (int converter)
|
||||
{ static TEST_CB_DATA test_callback_data ;
|
||||
|
||||
static float output [BUFFER_LEN] ;
|
||||
|
||||
SRC_STATE *src_state ;
|
||||
|
||||
double src_ratio = 1.1 ;
|
||||
long read_count, read_total ;
|
||||
int k, error ;
|
||||
|
||||
printf ("\tcallback_reset_test (%-28s) ....... ", src_get_name (converter)) ;
|
||||
fflush (stdout) ;
|
||||
|
||||
for (k = 0 ; k < ARRAY_LEN (data_one) ; k++)
|
||||
{ data_one [k] = 1.0 ;
|
||||
data_zero [k] = 0.0 ;
|
||||
} ;
|
||||
|
||||
if ((src_state = src_callback_new (test_callback_func, converter, 1, &error, &test_callback_data)) == NULL)
|
||||
{ printf ("\n\nLine %d : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
/* Process a bunch of 1.0 valued samples. */
|
||||
test_callback_data.channels = 1 ;
|
||||
test_callback_data.count = 0 ;
|
||||
test_callback_data.total = ARRAY_LEN (data_one) ;
|
||||
test_callback_data.data = data_one ;
|
||||
|
||||
read_total = 0 ;
|
||||
do
|
||||
{ read_count = (ARRAY_LEN (output) - read_total > CB_READ_LEN) ? CB_READ_LEN : ARRAY_LEN (output) - read_total ;
|
||||
read_count = src_callback_read (src_state, src_ratio, read_count, output + read_total) ;
|
||||
read_total += read_count ;
|
||||
}
|
||||
while (read_count > 0) ;
|
||||
|
||||
/* Check for errors. */
|
||||
if ((error = src_error (src_state)) != 0)
|
||||
{ printf ("\n\nLine %d : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
/* Reset the state of the converter.*/
|
||||
src_reset (src_state) ;
|
||||
|
||||
/* Process a bunch of 0.0 valued samples. */
|
||||
test_callback_data.channels = 1 ;
|
||||
test_callback_data.count = 0 ;
|
||||
test_callback_data.total = ARRAY_LEN (data_zero) ;
|
||||
test_callback_data.data = data_zero ;
|
||||
|
||||
/* Now process some zero data. */
|
||||
read_total = 0 ;
|
||||
do
|
||||
{ read_count = (ARRAY_LEN (output) - read_total > CB_READ_LEN) ? CB_READ_LEN : ARRAY_LEN (output) - read_total ;
|
||||
read_count = src_callback_read (src_state, src_ratio, read_count, output + read_total) ;
|
||||
read_total += read_count ;
|
||||
}
|
||||
while (read_count > 0) ;
|
||||
|
||||
/* Check for errors. */
|
||||
if ((error = src_error (src_state)) != 0)
|
||||
{ printf ("\n\nLine %d : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
/* Finally make sure that the output data is zero ie reset was sucessful. */
|
||||
for (k = 0 ; k < BUFFER_LEN / 2 ; k++)
|
||||
if (output [k] != 0.0)
|
||||
{ printf ("\n\nLine %d : output [%d] should be 0.0, is %f.\n\n", __LINE__, k, output [k]) ;
|
||||
save_oct_float ("output.dat", data_one, ARRAY_LEN (data_one), output, ARRAY_LEN (output)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
/* Make sure that this function has been exported. */
|
||||
src_set_ratio (src_state, 1.0) ;
|
||||
|
||||
/* Delete converter. */
|
||||
src_state = src_delete (src_state) ;
|
||||
|
||||
puts ("ok") ;
|
||||
} /* callback_reset_test */
|
||||
|
||||
|
|
@ -1,117 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <samplerate.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#define BUFFER_LEN 2048
|
||||
|
||||
static void simple_test (int converter, double ratio) ;
|
||||
|
||||
int
|
||||
main (void)
|
||||
{ static double src_ratios [] =
|
||||
{ 1.0001, 0.099, 0.1, 0.33333333, 0.789, 1.9, 3.1, 9.9
|
||||
} ;
|
||||
|
||||
int k ;
|
||||
|
||||
puts ("") ;
|
||||
|
||||
puts (" Zero Order Hold interpolator :") ;
|
||||
for (k = 0 ; k < ARRAY_LEN (src_ratios) ; k++)
|
||||
simple_test (SRC_ZERO_ORDER_HOLD, src_ratios [k]) ;
|
||||
|
||||
puts (" Linear interpolator :") ;
|
||||
for (k = 0 ; k < ARRAY_LEN (src_ratios) ; k++)
|
||||
simple_test (SRC_LINEAR, src_ratios [k]) ;
|
||||
|
||||
puts (" Sinc interpolator :") ;
|
||||
for (k = 0 ; k < ARRAY_LEN (src_ratios) ; k++)
|
||||
simple_test (SRC_SINC_FASTEST, src_ratios [k]) ;
|
||||
|
||||
puts ("") ;
|
||||
|
||||
return 0 ;
|
||||
} /* main */
|
||||
|
||||
static void
|
||||
simple_test (int converter, double src_ratio)
|
||||
{ static float input [BUFFER_LEN], output [BUFFER_LEN] ;
|
||||
|
||||
SRC_DATA src_data ;
|
||||
|
||||
int input_len, output_len, error, terminate ;
|
||||
|
||||
printf ("\tsimple_test (SRC ratio = %6.4f) ........... ", src_ratio) ;
|
||||
fflush (stdout) ;
|
||||
|
||||
/* Calculate maximun input and output lengths. */
|
||||
if (src_ratio >= 1.0)
|
||||
{ output_len = BUFFER_LEN ;
|
||||
input_len = (int) floor (BUFFER_LEN / src_ratio) ;
|
||||
}
|
||||
else
|
||||
{ input_len = BUFFER_LEN ;
|
||||
output_len = (int) floor (BUFFER_LEN * src_ratio) ;
|
||||
} ;
|
||||
|
||||
/* Reduce input_len by 10 so output is longer than necessary. */
|
||||
input_len -= 10 ;
|
||||
|
||||
if (output_len > BUFFER_LEN)
|
||||
{ printf ("\n\nLine %d : output_len > BUFFER_LEN\n\n", __LINE__) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
memset (&src_data, 0, sizeof (src_data)) ;
|
||||
|
||||
src_data.data_in = input ;
|
||||
src_data.input_frames = input_len ;
|
||||
|
||||
src_data.src_ratio = src_ratio ;
|
||||
|
||||
src_data.data_out = output ;
|
||||
src_data.output_frames = BUFFER_LEN ;
|
||||
|
||||
if ((error = src_simple (&src_data, converter, 1)))
|
||||
{ printf ("\n\nLine %d : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
terminate = (int) ceil ((src_ratio >= 1.0) ? src_ratio : 1.0 / src_ratio) ;
|
||||
|
||||
if (fabs (src_data.output_frames_gen - src_ratio * input_len) > 2 * terminate)
|
||||
{ printf ("\n\nLine %d : bad output data length %ld should be %d.\n", __LINE__,
|
||||
src_data.output_frames_gen, (int) floor (src_ratio * input_len)) ;
|
||||
printf ("\tsrc_ratio : %.4f\n", src_ratio) ;
|
||||
printf ("\tinput_len : %d\n\toutput_len : %d\n\n", input_len, output_len) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
puts ("ok") ;
|
||||
|
||||
return ;
|
||||
} /* simple_test */
|
||||
|
|
@ -1,401 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <time.h>
|
||||
|
||||
#if (HAVE_FFTW3)
|
||||
|
||||
#include <samplerate.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#define BUFFER_LEN 50000
|
||||
#define MAX_FREQS 4
|
||||
#define MAX_RATIOS 6
|
||||
#define MAX_SPEC_LEN (1<<15)
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846264338
|
||||
#endif
|
||||
|
||||
enum
|
||||
{ BOOLEAN_FALSE = 0,
|
||||
BOOLEAN_TRUE = 1
|
||||
} ;
|
||||
|
||||
typedef struct
|
||||
{ int freq_count ;
|
||||
double freqs [MAX_FREQS] ;
|
||||
|
||||
double src_ratio ;
|
||||
int pass_band_peaks ;
|
||||
|
||||
double snr ;
|
||||
double peak_value ;
|
||||
} SINGLE_TEST ;
|
||||
|
||||
typedef struct
|
||||
{ int converter ;
|
||||
int tests ;
|
||||
int do_bandwidth_test ;
|
||||
SINGLE_TEST test_data [10] ;
|
||||
} CONVERTER_TEST ;
|
||||
|
||||
static double snr_test (SINGLE_TEST *snr_test_data, int number, int converter, int verbose) ;
|
||||
static double find_peak (float *output, int output_len) ;
|
||||
static double bandwidth_test (int converter, int verbose) ;
|
||||
|
||||
int
|
||||
main (int argc, char *argv [])
|
||||
{ CONVERTER_TEST snr_test_data [] =
|
||||
{
|
||||
{ SRC_ZERO_ORDER_HOLD,
|
||||
8,
|
||||
BOOLEAN_FALSE,
|
||||
{ { 1, { 0.01111111111 }, 3.0, 1, 28.0, 1.0 },
|
||||
{ 1, { 0.01111111111 }, 0.6, 1, 36.0, 1.0 },
|
||||
{ 1, { 0.01111111111 }, 0.3, 1, 36.0, 1.0 },
|
||||
{ 1, { 0.01111111111 }, 1.0, 1, 150.0, 1.0 },
|
||||
{ 1, { 0.01111111111 }, 1.001, 1, 38.0, 1.0 },
|
||||
{ 2, { 0.011111, 0.324 }, 1.9999, 2, 14.0, 1.0 },
|
||||
{ 2, { 0.012345, 0.457 }, 0.456789, 1, 12.0, 1.0 },
|
||||
{ 1, { 0.3511111111 }, 1.33, 1, 10.0, 1.0 }
|
||||
}
|
||||
},
|
||||
|
||||
{ SRC_LINEAR,
|
||||
8,
|
||||
BOOLEAN_FALSE,
|
||||
{ { 1, { 0.01111111111 }, 3.0, 1, 73.0, 1.0 },
|
||||
{ 1, { 0.01111111111 }, 0.6, 1, 73.0, 1.0 },
|
||||
{ 1, { 0.01111111111 }, 0.3, 1, 73.0, 1.0 },
|
||||
{ 1, { 0.01111111111 }, 1.0, 1, 150.0, 1.0 },
|
||||
{ 1, { 0.01111111111 }, 1.001, 1, 77.0, 1.0 },
|
||||
{ 2, { 0.011111, 0.324 }, 1.9999, 2, 16.0, 0.94 },
|
||||
{ 2, { 0.012345, 0.457 }, 0.456789, 1, 26.0, 0.96 },
|
||||
{ 1, { 0.3511111111 }, 1.33, 1, 22.0, 0.99 }
|
||||
}
|
||||
},
|
||||
|
||||
{ SRC_SINC_FASTEST,
|
||||
9,
|
||||
BOOLEAN_TRUE,
|
||||
{ { 1, { 0.01111111111 }, 3.0, 1, 100.0, 1.0 },
|
||||
{ 1, { 0.01111111111 }, 0.6, 1, 99.0, 1.0 },
|
||||
{ 1, { 0.01111111111 }, 0.3, 1, 100.0, 1.0 },
|
||||
{ 1, { 0.01111111111 }, 1.0, 1, 150.0, 1.0 },
|
||||
{ 1, { 0.01111111111 }, 1.001, 1, 100.0, 1.0 },
|
||||
{ 2, { 0.011111, 0.324 }, 1.9999, 2, 97.0, 1.0 },
|
||||
{ 2, { 0.012345, 0.457 }, 0.456789, 1, 100.0, 0.5 },
|
||||
{ 2, { 0.011111, 0.45 }, 0.6, 1, 97.0, 0.5 },
|
||||
{ 1, { 0.3511111111 }, 1.33, 1, 97.0, 1.0 }
|
||||
}
|
||||
},
|
||||
|
||||
{ SRC_SINC_MEDIUM_QUALITY,
|
||||
9,
|
||||
BOOLEAN_TRUE,
|
||||
{ { 1, { 0.01111111111 }, 3.0, 1, 145.0, 1.0 },
|
||||
{ 1, { 0.01111111111 }, 0.6, 1, 132.0, 1.0 },
|
||||
{ 1, { 0.01111111111 }, 0.3, 1, 138.0, 1.0 },
|
||||
{ 1, { 0.01111111111 }, 1.0, 1, 157.0, 1.0 },
|
||||
{ 1, { 0.01111111111 }, 1.001, 1, 148.0, 1.0 },
|
||||
{ 2, { 0.011111, 0.324 }, 1.9999, 2, 127.0, 1.0 },
|
||||
{ 2, { 0.012345, 0.457 }, 0.456789, 1, 124.0, 0.5 },
|
||||
{ 2, { 0.011111, 0.45 }, 0.6, 1, 126.0, 0.5 },
|
||||
{ 1, { 0.43111111111 }, 1.33, 1, 121.0, 1.0 }
|
||||
}
|
||||
},
|
||||
|
||||
{ SRC_SINC_BEST_QUALITY,
|
||||
9,
|
||||
BOOLEAN_TRUE,
|
||||
{ { 1, { 0.01111111111 }, 3.0, 1, 149.0, 1.0 },
|
||||
{ 1, { 0.01111111111 }, 0.6, 1, 147.0, 1.0 },
|
||||
{ 1, { 0.01111111111 }, 0.3, 1, 148.0, 1.0 },
|
||||
{ 1, { 0.01111111111 }, 1.0, 1, 155.0, 1.0 },
|
||||
{ 1, { 0.01111111111 }, 1.001, 1, 148.0, 1.0 },
|
||||
{ 2, { 0.011111, 0.324 }, 1.9999, 2, 147.0, 1.0 },
|
||||
{ 2, { 0.012345, 0.457 }, 0.456789, 1, 148.0, 0.5 },
|
||||
{ 2, { 0.011111, 0.45 }, 0.6, 1, 149.0, 0.5 },
|
||||
{ 1, { 0.43111111111 }, 1.33, 1, 145.0, 1.0 }
|
||||
}
|
||||
},
|
||||
} ; /* snr_test_data */
|
||||
|
||||
double best_snr, snr, freq3dB ;
|
||||
int j, k, converter, verbose = 0 ;
|
||||
|
||||
if (argc == 2 && strcmp (argv [1], "--verbose") == 0)
|
||||
verbose = 1 ;
|
||||
|
||||
puts ("") ;
|
||||
|
||||
for (j = 0 ; j < ARRAY_LEN (snr_test_data) ; j++)
|
||||
{ best_snr = 5000.0 ;
|
||||
|
||||
converter = snr_test_data [j].converter ;
|
||||
|
||||
printf (" Converter %d : %s\n", converter, src_get_name (converter)) ;
|
||||
printf (" %s\n", src_get_description (converter)) ;
|
||||
|
||||
for (k = 0 ; k < snr_test_data [j].tests ; k++)
|
||||
{ snr = snr_test (&(snr_test_data [j].test_data [k]), k, converter, verbose) ;
|
||||
if (best_snr > snr)
|
||||
best_snr = snr ;
|
||||
} ;
|
||||
|
||||
printf (" Worst case Signal-to-Noise Ratio : %.2f dB.\n", best_snr) ;
|
||||
|
||||
if (snr_test_data [j].do_bandwidth_test == BOOLEAN_FALSE)
|
||||
{ puts (" Bandwith test not performed on this converter.\n") ;
|
||||
continue ;
|
||||
}
|
||||
|
||||
freq3dB = bandwidth_test (converter, verbose) ;
|
||||
|
||||
printf (" Measured -3dB rolloff point : %5.2f %%.\n\n", freq3dB) ;
|
||||
} ;
|
||||
|
||||
return 0 ;
|
||||
} /* main */
|
||||
|
||||
/*==============================================================================
|
||||
*/
|
||||
|
||||
static double
|
||||
snr_test (SINGLE_TEST *test_data, int number, int converter, int verbose)
|
||||
{ static float data [BUFFER_LEN + 1] ;
|
||||
static float output [MAX_SPEC_LEN] ;
|
||||
|
||||
SRC_STATE *src_state ;
|
||||
SRC_DATA src_data ;
|
||||
|
||||
double output_peak, snr ;
|
||||
int k, output_len, input_len, error ;
|
||||
|
||||
if (verbose != 0)
|
||||
{ printf ("\tSignal-to-Noise Ratio Test %d.\n"
|
||||
"\t=====================================\n", number) ;
|
||||
printf ("\tFrequencies : [ ") ;
|
||||
for (k = 0 ; k < test_data->freq_count ; k++)
|
||||
printf ("%6.4f ", test_data->freqs [k]) ;
|
||||
|
||||
printf ("]\n\tSRC Ratio : %8.4f\n", test_data->src_ratio) ;
|
||||
}
|
||||
else
|
||||
{ printf ("\tSignal-to-Noise Ratio Test %d : ", number) ;
|
||||
fflush (stdout) ;
|
||||
} ;
|
||||
|
||||
/* Set up the output array. */
|
||||
if (test_data->src_ratio >= 1.0)
|
||||
{ output_len = MAX_SPEC_LEN ;
|
||||
input_len = (int) ceil (MAX_SPEC_LEN / test_data->src_ratio) ;
|
||||
if (input_len > BUFFER_LEN)
|
||||
input_len = BUFFER_LEN ;
|
||||
}
|
||||
else
|
||||
{ input_len = BUFFER_LEN ;
|
||||
output_len = (int) ceil (BUFFER_LEN * test_data->src_ratio) ;
|
||||
output_len &= ((-1) << 4) ;
|
||||
if (output_len > MAX_SPEC_LEN)
|
||||
output_len = MAX_SPEC_LEN ;
|
||||
input_len = (int) ceil (output_len / test_data->src_ratio) ;
|
||||
} ;
|
||||
|
||||
memset (output, 0, sizeof (output)) ;
|
||||
|
||||
/* Generate input data array. */
|
||||
gen_windowed_sines (test_data->freq_count, test_data->freqs, 1.0, data, input_len) ;
|
||||
|
||||
/* Perform sample rate conversion. */
|
||||
if ((src_state = src_new (converter, 1, &error)) == NULL)
|
||||
{ printf ("\n\nLine %d : src_new() failed : %s.\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
src_data.end_of_input = 1 ; /* Only one buffer worth of input. */
|
||||
|
||||
src_data.data_in = data ;
|
||||
src_data.input_frames = input_len ;
|
||||
|
||||
src_data.src_ratio = test_data->src_ratio ;
|
||||
|
||||
src_data.data_out = output ;
|
||||
src_data.output_frames = output_len ;
|
||||
|
||||
if ((error = src_process (src_state, &src_data)))
|
||||
{ printf ("\n\nLine %d : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
src_state = src_delete (src_state) ;
|
||||
|
||||
if (verbose != 0)
|
||||
printf ("\tOutput Len : %ld\n", src_data.output_frames_gen) ;
|
||||
|
||||
if (abs (src_data.output_frames_gen - output_len) > 4)
|
||||
{ printf ("\n\nLine %d : output data length should be %d.\n\n", __LINE__, output_len) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
/* Check output peak. */
|
||||
output_peak = find_peak (output, src_data.output_frames_gen) ;
|
||||
|
||||
if (verbose != 0)
|
||||
printf ("\tOutput Peak : %6.4f\n", output_peak) ;
|
||||
|
||||
if (fabs (output_peak - test_data->peak_value) > 0.01)
|
||||
{ printf ("\n\nLine %d : output peak (%6.4f) should be %6.4f\n\n", __LINE__, output_peak, test_data->peak_value) ;
|
||||
save_oct_float ("snr_test.dat", data, BUFFER_LEN, output, output_len) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
/* Calculate signal-to-noise ratio. */
|
||||
snr = calculate_snr (output, src_data.output_frames_gen, test_data->pass_band_peaks) ;
|
||||
|
||||
if (snr < 0.0)
|
||||
{ /* An error occurred. */
|
||||
save_oct_float ("snr_test.dat", data, BUFFER_LEN, output, src_data.output_frames_gen) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (verbose != 0)
|
||||
printf ("\tSNR Ratio : %.2f dB\n", snr) ;
|
||||
|
||||
if (snr < test_data->snr)
|
||||
{ printf ("\n\nLine %d : SNR (%5.2f) should be > %6.2f dB\n\n", __LINE__, snr, test_data->snr) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (verbose != 0)
|
||||
puts ("\t-------------------------------------\n\tPass\n") ;
|
||||
else
|
||||
puts ("Pass") ;
|
||||
|
||||
return snr ;
|
||||
} /* snr_test */
|
||||
|
||||
static double
|
||||
find_peak (float *data, int len)
|
||||
{ double peak = 0.0 ;
|
||||
int k = 0 ;
|
||||
|
||||
for (k = 0 ; k < len ; k++)
|
||||
if (fabs (data [k]) > peak)
|
||||
peak = fabs (data [k]) ;
|
||||
|
||||
return peak ;
|
||||
} /* find_peak */
|
||||
|
||||
|
||||
static double
|
||||
find_attenuation (double freq, int converter, int verbose)
|
||||
{ static float input [BUFFER_LEN] ;
|
||||
static float output [2 * BUFFER_LEN] ;
|
||||
|
||||
SRC_DATA src_data ;
|
||||
double output_peak ;
|
||||
int error ;
|
||||
|
||||
gen_windowed_sines (1, &freq, 1.0, input, BUFFER_LEN) ;
|
||||
|
||||
src_data.end_of_input = 1 ; /* Only one buffer worth of input. */
|
||||
|
||||
src_data.data_in = input ;
|
||||
src_data.input_frames = BUFFER_LEN ;
|
||||
|
||||
src_data.src_ratio = 1.999 ;
|
||||
|
||||
src_data.data_out = output ;
|
||||
src_data.output_frames = ARRAY_LEN (output) ;
|
||||
|
||||
if ((error = src_simple (&src_data, converter, 1)))
|
||||
{ printf ("\n\nLine %d : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
output_peak = find_peak (output, ARRAY_LEN (output)) ;
|
||||
|
||||
if (verbose)
|
||||
printf ("\tFreq : %6f InPeak : %6f OutPeak : %6f Atten : %6.2f dB\n",
|
||||
freq, 1.0, output_peak, 20.0 * log10 (1.0 / output_peak)) ;
|
||||
|
||||
return 20.0 * log10 (1.0 / output_peak) ;
|
||||
} /* find_attenuation */
|
||||
|
||||
static double
|
||||
bandwidth_test (int converter, int verbose)
|
||||
{ double f1, f2, a1, a2 ;
|
||||
double freq, atten ;
|
||||
|
||||
f1 = 0.35 ;
|
||||
a1 = find_attenuation (f1, converter, verbose) ;
|
||||
|
||||
f2 = 0.495 ;
|
||||
a2 = find_attenuation (f2, converter, verbose) ;
|
||||
|
||||
if (a1 > 3.0 || a2 < 3.0)
|
||||
{ printf ("\n\nLine %d : cannot bracket 3dB point.\n\n", __LINE__) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
while (a2 - a1 > 1.0)
|
||||
{ freq = f1 + 0.5 * (f2 - f1) ;
|
||||
atten = find_attenuation (freq, converter, verbose) ;
|
||||
|
||||
if (atten < 3.0)
|
||||
{ f1 = freq ;
|
||||
a1 = atten ;
|
||||
}
|
||||
else
|
||||
{ f2 = freq ;
|
||||
a2 = atten ;
|
||||
} ;
|
||||
} ;
|
||||
|
||||
freq = f1 + (3.0 - a1) * (f2 - f1) / (a2 - a1) ;
|
||||
|
||||
return 200.0 * freq ;
|
||||
} /* bandwidth_test */
|
||||
|
||||
#else /* (HAVE_FFTW3) == 0 */
|
||||
|
||||
/* Alternative main function when librfftw is not available. */
|
||||
|
||||
int
|
||||
main (void)
|
||||
{ puts ("\n"
|
||||
"****************************************************************\n"
|
||||
" This test cannot be run without FFTW (http://www.fftw.org/).\n"
|
||||
" Both the real and the complex versions of the library are\n"
|
||||
" required.") ;
|
||||
puts ("****************************************************************\n") ;
|
||||
|
||||
return 0 ;
|
||||
} /* main */
|
||||
|
||||
#endif
|
||||
|
|
@ -1,529 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if (HAVE_FFTW3 && HAVE_SNDFILE && HAVE_SYS_TIMES_H)
|
||||
|
||||
#include <time.h>
|
||||
#include <sys/times.h>
|
||||
|
||||
#include <sndfile.h>
|
||||
#include <math.h>
|
||||
#include <sys/utsname.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#define MAX_FREQS 4
|
||||
#define BUFFER_LEN 80000
|
||||
|
||||
#define SAFE_STRNCAT(dest,src,len) \
|
||||
{ int safe_strncat_count ; \
|
||||
safe_strncat_count = (len) - strlen (dest) - 1 ; \
|
||||
strncat ((dest), (src), safe_strncat_count) ; \
|
||||
(dest) [(len) - 1] = 0 ; \
|
||||
} ;
|
||||
|
||||
typedef struct
|
||||
{ int freq_count ;
|
||||
double freqs [MAX_FREQS] ;
|
||||
|
||||
int output_samplerate ;
|
||||
int pass_band_peaks ;
|
||||
|
||||
double peak_value ;
|
||||
} SNR_TEST ;
|
||||
|
||||
typedef struct
|
||||
{ const char *progname ;
|
||||
const char *version_cmd ;
|
||||
const char *version_start ;
|
||||
const char *convert_cmd ;
|
||||
int format ;
|
||||
} RESAMPLE_PROG ;
|
||||
|
||||
static char *get_progname (char *) ;
|
||||
static void usage_exit (const char *, const RESAMPLE_PROG *prog, int count) ;
|
||||
static void measure_program (const RESAMPLE_PROG *prog, int verbose) ;
|
||||
static void generate_source_wav (const char *filename, const double *freqs, int freq_count, int format) ;
|
||||
static const char* get_machine_details (void) ;
|
||||
|
||||
static char version_string [512] ;
|
||||
|
||||
int
|
||||
main (int argc, char *argv [])
|
||||
{ static RESAMPLE_PROG resample_progs [] =
|
||||
{ { "sndfile-resample",
|
||||
"examples/sndfile-resample --version",
|
||||
"libsamplerate",
|
||||
"examples/sndfile-resample --max-speed -c 0 -to %d source.wav destination.wav",
|
||||
SF_FORMAT_WAV | SF_FORMAT_PCM_32
|
||||
},
|
||||
{ "sox",
|
||||
"sox -h 2>&1",
|
||||
"sox",
|
||||
"sox source.wav -r %d destination.wav resample 0.835",
|
||||
SF_FORMAT_WAV | SF_FORMAT_PCM_32
|
||||
},
|
||||
{ "ResampAudio",
|
||||
"ResampAudio --version",
|
||||
"ResampAudio",
|
||||
"ResampAudio -f cutoff=0.41,atten=100,ratio=128 -s %d source.wav destination.wav",
|
||||
SF_FORMAT_WAV | SF_FORMAT_PCM_32
|
||||
},
|
||||
|
||||
/*-
|
||||
{ /+*
|
||||
** The Shibatch converter doesn't work for all combinations of
|
||||
** source and destination sample rates. Therefore it can't be
|
||||
** included in this test.
|
||||
*+/
|
||||
"shibatch",
|
||||
"ssrc",
|
||||
"Shibatch",
|
||||
"ssrc --rate %d source.wav destination.wav",
|
||||
SF_FORMAT_WAV | SF_FORMAT_PCM_32
|
||||
},-*/
|
||||
|
||||
/*-
|
||||
{ /+*
|
||||
** The resample program is not able to match the bandwidth and SNR
|
||||
** specs or sndfile-resample and hence will not be tested.
|
||||
*+/
|
||||
"resample",
|
||||
"resample -version",
|
||||
"resample",
|
||||
"resample -to %d source.wav destination.wav",
|
||||
SF_FORMAT_WAV | SF_FORMAT_FLOAT
|
||||
},-*/
|
||||
|
||||
/*-
|
||||
{ "mplayer",
|
||||
"mplayer -v 2>&1",
|
||||
"MPlayer ",
|
||||
"mplayer -ao pcm -srate %d source.wav >/dev/null 2>&1 && mv audiodump.wav destination.wav",
|
||||
SF_FORMAT_WAV | SF_FORMAT_PCM_32
|
||||
},-*/
|
||||
|
||||
} ; /* resample_progs */
|
||||
|
||||
char *progname ;
|
||||
int prog = 0, verbose = 0 ;
|
||||
|
||||
progname = get_progname (argv [0]) ;
|
||||
|
||||
printf ("\n %s : evaluate a sample rate converter.\n", progname) ;
|
||||
|
||||
if (argc == 3 && strcmp ("--verbose", argv [1]) == 0)
|
||||
{ verbose = 1 ;
|
||||
prog = atoi (argv [2]) ;
|
||||
}
|
||||
else if (argc == 2)
|
||||
{ verbose = 0 ;
|
||||
prog = atoi (argv [1]) ;
|
||||
}
|
||||
else
|
||||
usage_exit (progname, resample_progs, ARRAY_LEN (resample_progs)) ;
|
||||
|
||||
if (prog < 0 || prog >= ARRAY_LEN (resample_progs))
|
||||
usage_exit (progname, resample_progs, ARRAY_LEN (resample_progs)) ;
|
||||
|
||||
measure_program (& (resample_progs [prog]), verbose) ;
|
||||
|
||||
puts ("") ;
|
||||
|
||||
return 0 ;
|
||||
} /* main */
|
||||
|
||||
/*==============================================================================
|
||||
*/
|
||||
|
||||
static char *
|
||||
get_progname (char *progname)
|
||||
{ char *cptr ;
|
||||
|
||||
if ((cptr = strrchr (progname, '/')) != NULL)
|
||||
progname = cptr + 1 ;
|
||||
|
||||
if ((cptr = strrchr (progname, '\\')) != NULL)
|
||||
progname = cptr + 1 ;
|
||||
|
||||
return progname ;
|
||||
} /* get_progname */
|
||||
|
||||
static void
|
||||
usage_exit (const char *progname, const RESAMPLE_PROG *prog, int count)
|
||||
{ int k ;
|
||||
|
||||
printf ("\n Usage : %s <number>\n\n", progname) ;
|
||||
|
||||
puts (" where <number> specifies the program to test:\n") ;
|
||||
|
||||
for (k = 0 ; k < count ; k++)
|
||||
printf (" %d : %s\n", k, prog [k].progname) ;
|
||||
|
||||
puts ("\n"
|
||||
" Obviously to test a given program you have to have it available on\n"
|
||||
" your system. See http://www.mega-nerd.com/SRC/quality.html for\n"
|
||||
" the download location of these programs.\n") ;
|
||||
|
||||
exit (1) ;
|
||||
} /* usage_exit */
|
||||
|
||||
static const char*
|
||||
get_machine_details (void)
|
||||
{ static char namestr [256] ;
|
||||
|
||||
struct utsname name ;
|
||||
|
||||
if (uname (&name) != 0)
|
||||
{ snprintf (namestr, sizeof (namestr), "Unknown") ;
|
||||
return namestr ;
|
||||
} ;
|
||||
|
||||
snprintf (namestr, sizeof (namestr), "%s (%s %s %s)", name.nodename,
|
||||
name.machine, name.sysname, name.release) ;
|
||||
|
||||
return namestr ;
|
||||
} /* get_machine_details */
|
||||
|
||||
|
||||
/*==============================================================================
|
||||
*/
|
||||
|
||||
static void
|
||||
get_version_string (const RESAMPLE_PROG *prog)
|
||||
{ FILE *file ;
|
||||
char *cptr ;
|
||||
|
||||
/* Default. */
|
||||
snprintf (version_string, sizeof (version_string), "no version") ;
|
||||
|
||||
if (prog->version_cmd == NULL)
|
||||
return ;
|
||||
|
||||
if ((file = popen (prog->version_cmd, "r")) == NULL)
|
||||
return ;
|
||||
|
||||
while ((cptr = fgets (version_string, sizeof (version_string), file)) != NULL)
|
||||
{
|
||||
if (strstr (cptr, prog->version_start) != NULL)
|
||||
break ;
|
||||
|
||||
version_string [0] = 0 ;
|
||||
} ;
|
||||
|
||||
pclose (file) ;
|
||||
|
||||
/* Remove trailing newline. */
|
||||
if ((cptr = strchr (version_string, '\n')) != NULL)
|
||||
cptr [0] = 0 ;
|
||||
|
||||
/* Remove leading whitespace from version string. */
|
||||
cptr = version_string ;
|
||||
while (cptr [0] != 0 && isspace (cptr [0]))
|
||||
cptr ++ ;
|
||||
|
||||
if (cptr != version_string)
|
||||
strncpy (version_string, cptr, sizeof (version_string)) ;
|
||||
|
||||
return ;
|
||||
} /* get_version_string */
|
||||
|
||||
static void
|
||||
generate_source_wav (const char *filename, const double *freqs, int freq_count, int format)
|
||||
{ static float buffer [BUFFER_LEN] ;
|
||||
|
||||
SNDFILE *sndfile ;
|
||||
SF_INFO sfinfo ;
|
||||
|
||||
sfinfo.channels = 1 ;
|
||||
sfinfo.samplerate = 44100 ;
|
||||
sfinfo.format = format ;
|
||||
|
||||
if ((sndfile = sf_open (filename, SFM_WRITE, &sfinfo)) == NULL)
|
||||
{ printf ("Line %d : cound not open '%s' : %s\n", __LINE__, filename, sf_strerror (NULL)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
sf_command (sndfile, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_FALSE) ;
|
||||
|
||||
gen_windowed_sines (freq_count, freqs, 0.9, buffer, ARRAY_LEN (buffer)) ;
|
||||
|
||||
if (sf_write_float (sndfile, buffer, ARRAY_LEN (buffer)) != ARRAY_LEN (buffer))
|
||||
{ printf ("Line %d : sf_write_float short write.\n", __LINE__) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
sf_close (sndfile) ;
|
||||
} /* generate_source_wav */
|
||||
|
||||
static double
|
||||
measure_destination_wav (char *filename, int *output_samples, int expected_peaks)
|
||||
{ static float buffer [250000] ;
|
||||
|
||||
SNDFILE *sndfile ;
|
||||
SF_INFO sfinfo ;
|
||||
double snr ;
|
||||
|
||||
if ((sndfile = sf_open (filename, SFM_READ, &sfinfo)) == NULL)
|
||||
{ printf ("Line %d : Cound not open '%s' : %s\n", __LINE__, filename, sf_strerror (NULL)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (sfinfo.channels != 1)
|
||||
{ printf ("Line %d : Bad channel count (%d). Should be 1.\n", __LINE__, sfinfo.channels) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (sfinfo.frames > ARRAY_LEN (buffer))
|
||||
{ printf ("Line %d : Too many frames (%ld) of data in file.\n", __LINE__, (long) sfinfo.frames) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
*output_samples = (int) sfinfo.frames ;
|
||||
|
||||
if (sf_read_float (sndfile, buffer, sfinfo.frames) != sfinfo.frames)
|
||||
{ printf ("Line %d : Bad read.\n", __LINE__) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
sf_close (sndfile) ;
|
||||
|
||||
snr = calculate_snr (buffer, sfinfo.frames, expected_peaks) ;
|
||||
|
||||
return snr ;
|
||||
} /* measure_desination_wav */
|
||||
|
||||
static double
|
||||
measure_snr (const RESAMPLE_PROG *prog, int *output_samples, int verbose)
|
||||
{ static SNR_TEST snr_test [] =
|
||||
{
|
||||
{ 1, { 0.211111111111 }, 48000, 1, 1.0 },
|
||||
{ 1, { 0.011111111111 }, 132301, 1, 1.0 },
|
||||
{ 1, { 0.111111111111 }, 92301, 1, 1.0 },
|
||||
{ 1, { 0.011111111111 }, 26461, 1, 1.0 },
|
||||
{ 1, { 0.011111111111 }, 13231, 1, 1.0 },
|
||||
{ 1, { 0.011111111111 }, 44101, 1, 1.0 },
|
||||
{ 2, { 0.311111, 0.49 }, 78199, 2, 1.0 },
|
||||
{ 2, { 0.011111, 0.49 }, 12345, 1, 0.5 },
|
||||
{ 2, { 0.0123456, 0.4 }, 20143, 1, 0.5 },
|
||||
{ 2, { 0.0111111, 0.4 }, 26461, 1, 0.5 },
|
||||
{ 1, { 0.381111111111 }, 58661, 1, 1.0 }
|
||||
} ; /* snr_test */
|
||||
static char command [256] ;
|
||||
|
||||
double snr, worst_snr = 500.0 ;
|
||||
int k , retval, sample_count ;
|
||||
|
||||
*output_samples = 0 ;
|
||||
|
||||
for (k = 0 ; k < ARRAY_LEN (snr_test) ; k++)
|
||||
{ remove ("source.wav") ;
|
||||
remove ("destination.wav") ;
|
||||
|
||||
if (verbose)
|
||||
printf (" SNR test #%d : ", k) ;
|
||||
fflush (stdout) ;
|
||||
generate_source_wav ("source.wav", snr_test [k].freqs, snr_test [k].freq_count, prog->format) ;
|
||||
|
||||
snprintf (command, sizeof (command), prog->convert_cmd, snr_test [k].output_samplerate) ;
|
||||
SAFE_STRNCAT (command, " >/dev/null 2>&1", sizeof (command)) ;
|
||||
if ((retval = system (command)) != 0)
|
||||
printf ("system returned %d\n", retval) ;
|
||||
|
||||
snr = measure_destination_wav ("destination.wav", &sample_count, snr_test->pass_band_peaks) ;
|
||||
|
||||
*output_samples += sample_count ;
|
||||
|
||||
if (fabs (snr) < fabs (worst_snr))
|
||||
worst_snr = fabs (snr) ;
|
||||
|
||||
if (verbose)
|
||||
printf ("%6.2f dB\n", snr) ;
|
||||
} ;
|
||||
|
||||
return worst_snr ;
|
||||
} /* measure_snr */
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static double
|
||||
measure_destination_peak (const char *filename)
|
||||
{ static float data [2 * BUFFER_LEN] ;
|
||||
SNDFILE *sndfile ;
|
||||
SF_INFO sfinfo ;
|
||||
double peak = 0.0 ;
|
||||
int k = 0 ;
|
||||
|
||||
if ((sndfile = sf_open (filename, SFM_READ, &sfinfo)) == NULL)
|
||||
{ printf ("Line %d : failed to open file %s\n", __LINE__, filename) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (sfinfo.channels != 1)
|
||||
{ printf ("Line %d : bad channel count.\n", __LINE__) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (sfinfo.frames > ARRAY_LEN (data) + 4 || sfinfo.frames < ARRAY_LEN (data) - 100)
|
||||
{ printf ("Line %d : bad frame count (got %d, expected %d).\n", __LINE__, (int) sfinfo.frames, ARRAY_LEN (data)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (sf_read_float (sndfile, data, sfinfo.frames) != sfinfo.frames)
|
||||
{ printf ("Line %d : bad read.\n", __LINE__) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
sf_close (sndfile) ;
|
||||
|
||||
for (k = 0 ; k < (int) sfinfo.frames ; k++)
|
||||
if (fabs (data [k]) > peak)
|
||||
peak = fabs (data [k]) ;
|
||||
|
||||
return peak ;
|
||||
} /* measure_destination_peak */
|
||||
|
||||
static double
|
||||
find_attenuation (double freq, const RESAMPLE_PROG *prog, int verbose)
|
||||
{ static char command [256] ;
|
||||
double output_peak ;
|
||||
int retval ;
|
||||
char *filename ;
|
||||
|
||||
filename = "destination.wav" ;
|
||||
|
||||
generate_source_wav ("source.wav", &freq, 1, prog->format) ;
|
||||
|
||||
remove (filename) ;
|
||||
|
||||
snprintf (command, sizeof (command), prog->convert_cmd, 88189) ;
|
||||
SAFE_STRNCAT (command, " >/dev/null 2>&1", sizeof (command)) ;
|
||||
if ((retval = system (command)) != 0)
|
||||
printf ("system returned %d\n", retval) ;
|
||||
|
||||
output_peak = measure_destination_peak (filename) ;
|
||||
|
||||
if (verbose)
|
||||
printf (" freq : %f peak : %f\n", freq, output_peak) ;
|
||||
|
||||
return fabs (20.0 * log10 (output_peak)) ;
|
||||
} /* find_attenuation */
|
||||
|
||||
static double
|
||||
bandwidth_test (const RESAMPLE_PROG *prog, int verbose)
|
||||
{ double f1, f2, a1, a2 ;
|
||||
double freq, atten ;
|
||||
|
||||
f1 = 0.35 ;
|
||||
a1 = find_attenuation (f1, prog, verbose) ;
|
||||
|
||||
f2 = 0.49999 ;
|
||||
a2 = find_attenuation (f2, prog, verbose) ;
|
||||
|
||||
|
||||
if (fabs (a1) < 1e-2 && a2 < 3.0)
|
||||
return -1.0 ;
|
||||
|
||||
if (a1 > 3.0 || a2 < 3.0)
|
||||
{ printf ("\n\nLine %d : cannot bracket 3dB point.\n\n", __LINE__) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
while (a2 - a1 > 1.0)
|
||||
{ freq = f1 + 0.5 * (f2 - f1) ;
|
||||
atten = find_attenuation (freq, prog, verbose) ;
|
||||
|
||||
if (atten < 3.0)
|
||||
{ f1 = freq ;
|
||||
a1 = atten ;
|
||||
}
|
||||
else
|
||||
{ f2 = freq ;
|
||||
a2 = atten ;
|
||||
} ;
|
||||
} ;
|
||||
|
||||
freq = f1 + (3.0 - a1) * (f2 - f1) / (a2 - a1) ;
|
||||
|
||||
return 200.0 * freq ;
|
||||
} /* bandwidth_test */
|
||||
|
||||
static void
|
||||
measure_program (const RESAMPLE_PROG *prog, int verbose)
|
||||
{ double snr, bandwidth, conversion_rate ;
|
||||
int output_samples ;
|
||||
struct tms time_data ;
|
||||
time_t time_now ;
|
||||
|
||||
printf ("\n Machine : %s\n", get_machine_details ()) ;
|
||||
time_now = time (NULL) ;
|
||||
printf (" Date : %s", ctime (&time_now)) ;
|
||||
|
||||
get_version_string (prog) ;
|
||||
printf (" Program : %s\n", version_string) ;
|
||||
printf (" Command : %s\n\n", prog->convert_cmd) ;
|
||||
|
||||
snr = measure_snr (prog, &output_samples, verbose) ;
|
||||
|
||||
printf (" Worst case SNR : %6.2f dB\n", snr) ;
|
||||
|
||||
times (&time_data) ;
|
||||
|
||||
conversion_rate = (1.0 * output_samples * sysconf (_SC_CLK_TCK)) / time_data.tms_cutime ;
|
||||
|
||||
printf (" Conversion rate : %5.0f samples/sec\n", conversion_rate) ;
|
||||
|
||||
bandwidth = bandwidth_test (prog, verbose) ;
|
||||
|
||||
if (bandwidth > 0.0)
|
||||
printf (" Measured bandwidth : %5.2f %%\n", bandwidth) ;
|
||||
else
|
||||
printf (" Could not measure bandwidth (no -3dB point found).\n") ;
|
||||
|
||||
return ;
|
||||
} /* measure_program */
|
||||
|
||||
/*##############################################################################
|
||||
*/
|
||||
|
||||
#else
|
||||
|
||||
int
|
||||
main (void)
|
||||
{ puts ("\n"
|
||||
"****************************************************************\n"
|
||||
" This program has been compiled without :\n"
|
||||
" 1) FFTW (http://www.fftw.org/).\n"
|
||||
" 2) libsndfile (http://www.zip.com.au/~erikd/libsndfile/).\n"
|
||||
" Without these two libraries there is not much it can do.\n"
|
||||
"****************************************************************\n") ;
|
||||
|
||||
return 0 ;
|
||||
} /* main */
|
||||
|
||||
#endif /* (HAVE_FFTW3 && HAVE_SNDFILE) */
|
||||
|
|
@ -1,339 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <samplerate.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#define SHORT_BUFFER_LEN 2048
|
||||
#define LONG_BUFFER_LEN ((1 << 16) - 20)
|
||||
|
||||
static void simple_test (int converter) ;
|
||||
static void stream_test (int converter, double ratio) ;
|
||||
static void init_term_test (int converter, double ratio) ;
|
||||
|
||||
static int next_block_length (int reset) ;
|
||||
|
||||
int
|
||||
main (void)
|
||||
{ static double src_ratios [] =
|
||||
{ 0.999900, 1.000100, 0.789012, 1.200000, 0.333333, 3.100000,
|
||||
0.125000, 8.000000, 0.099900, 9.990000, 0.100000, 10.00000
|
||||
} ;
|
||||
|
||||
int k ;
|
||||
|
||||
puts ("\n Zero Order Hold interpolator:") ;
|
||||
|
||||
for (k = 0 ; k < ARRAY_LEN (src_ratios) ; k++)
|
||||
init_term_test (SRC_ZERO_ORDER_HOLD, src_ratios [k]) ;
|
||||
puts ("") ;
|
||||
for (k = 0 ; k < ARRAY_LEN (src_ratios) ; k++)
|
||||
stream_test (SRC_ZERO_ORDER_HOLD, src_ratios [k]) ;
|
||||
|
||||
|
||||
puts ("\n Linear interpolator:") ;
|
||||
for (k = 0 ; k < ARRAY_LEN (src_ratios) ; k++)
|
||||
init_term_test (SRC_LINEAR, src_ratios [k]) ;
|
||||
puts ("") ;
|
||||
for (k = 0 ; k < ARRAY_LEN (src_ratios) ; k++)
|
||||
stream_test (SRC_LINEAR, src_ratios [k]) ;
|
||||
|
||||
|
||||
puts ("\n Sinc interpolator:") ;
|
||||
for (k = 0 ; k < ARRAY_LEN (src_ratios) ; k++)
|
||||
init_term_test (SRC_SINC_FASTEST, src_ratios [k]) ;
|
||||
puts ("") ;
|
||||
for (k = 0 ; k < ARRAY_LEN (src_ratios) ; k++)
|
||||
stream_test (SRC_SINC_FASTEST, src_ratios [k]) ;
|
||||
|
||||
puts ("") ;
|
||||
|
||||
simple_test (SRC_SINC_FASTEST) ;
|
||||
|
||||
return 0 ;
|
||||
} /* main */
|
||||
|
||||
static void
|
||||
simple_test (int converter)
|
||||
{
|
||||
int ilen = 199030, olen = 1000, error ;
|
||||
|
||||
{
|
||||
float in [ilen] ;
|
||||
float out [olen] ;
|
||||
double ratio = (1.0 * olen) / ilen ;
|
||||
SRC_DATA src_data =
|
||||
{ in, out,
|
||||
ilen, olen,
|
||||
0, 0, 0,
|
||||
ratio
|
||||
} ;
|
||||
|
||||
error = src_simple (&src_data, converter, 1) ;
|
||||
if (error)
|
||||
{ printf ("\n\nLine %d : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
} ;
|
||||
|
||||
return ;
|
||||
} /* simple_test */
|
||||
|
||||
static void
|
||||
init_term_test (int converter, double src_ratio)
|
||||
{ static float input [SHORT_BUFFER_LEN], output [SHORT_BUFFER_LEN] ;
|
||||
|
||||
SRC_DATA src_data ;
|
||||
|
||||
int k, input_len, output_len, error, terminate ;
|
||||
|
||||
printf ("\tinit_term_test (SRC ratio = %7.4f) .......... ", src_ratio) ;
|
||||
fflush (stdout) ;
|
||||
|
||||
/* Calculate maximun input and output lengths. */
|
||||
if (src_ratio >= 1.0)
|
||||
{ output_len = SHORT_BUFFER_LEN ;
|
||||
input_len = (int) floor (SHORT_BUFFER_LEN / src_ratio) ;
|
||||
}
|
||||
else
|
||||
{ input_len = SHORT_BUFFER_LEN ;
|
||||
output_len = (int) floor (SHORT_BUFFER_LEN * src_ratio) ;
|
||||
} ;
|
||||
|
||||
/* Reduce input_len by 10 so output is longer than necessary. */
|
||||
input_len -= 10 ;
|
||||
|
||||
for (k = 0 ; k < ARRAY_LEN (input) ; k++)
|
||||
input [k] = 1.0 ;
|
||||
|
||||
if (output_len > SHORT_BUFFER_LEN)
|
||||
{ printf ("\n\nLine %d : output_len > SHORT_BUFFER_LEN\n\n", __LINE__) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
src_data.data_in = input ;
|
||||
src_data.input_frames = input_len ;
|
||||
|
||||
src_data.src_ratio = src_ratio ;
|
||||
|
||||
src_data.data_out = output ;
|
||||
src_data.output_frames = SHORT_BUFFER_LEN ;
|
||||
|
||||
if ((error = src_simple (&src_data, converter, 1)))
|
||||
{ printf ("\n\nLine %d : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
terminate = (int) ceil ((src_ratio >= 1.0) ? 1 : 1.0 / src_ratio) ;
|
||||
|
||||
if (fabs (src_ratio * input_len - src_data.output_frames_gen) > terminate)
|
||||
{ printf ("\n\nLine %d : Bad output frame count.\n\n", __LINE__) ;
|
||||
printf ("\tterminate : %d\n", terminate) ;
|
||||
printf ("\tsrc_ratio : %.4f\n", src_ratio) ;
|
||||
printf ("\tinput_len : %d\n"
|
||||
"\tinput_len * src_ratio : %f\n", input_len, input_len * src_ratio) ;
|
||||
printf ("\toutput_frames_gen : %ld\n\n", src_data.output_frames_gen) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (abs (src_data.input_frames_used - input_len) > 1)
|
||||
{ printf ("\n\nLine %d : input_frames_used should be %d, is %ld.\n\n",
|
||||
__LINE__, input_len, src_data.input_frames_used) ;
|
||||
printf ("\tsrc_ratio : %.4f\n", src_ratio) ;
|
||||
printf ("\tinput_len : %d\n\tinput_used : %ld\n\n", input_len, src_data.input_frames_used) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (fabs (output [0]) < 0.1)
|
||||
{ printf ("\n\nLine %d : First output sample is bad.\n\n", __LINE__) ;
|
||||
printf ("\toutput [0] == %f\n\n", output [0]) ;
|
||||
exit (1) ;
|
||||
}
|
||||
|
||||
puts ("ok") ;
|
||||
|
||||
return ;
|
||||
} /* init_term_test */
|
||||
|
||||
static void
|
||||
stream_test (int converter, double src_ratio)
|
||||
{ static float input [LONG_BUFFER_LEN], output [LONG_BUFFER_LEN] ;
|
||||
|
||||
SRC_STATE *src_state ;
|
||||
SRC_DATA src_data ;
|
||||
|
||||
int input_len, output_len, current_in, current_out ;
|
||||
int k, error, terminate ;
|
||||
|
||||
printf ("\tstream_test (SRC ratio = %7.4f) .......... ", src_ratio) ;
|
||||
fflush (stdout) ;
|
||||
|
||||
/* Erik */
|
||||
for (k = 0 ; k < LONG_BUFFER_LEN ; k++) input [k] = k * 1.0 ;
|
||||
|
||||
/* Calculate maximun input and output lengths. */
|
||||
if (src_ratio >= 1.0)
|
||||
{ output_len = LONG_BUFFER_LEN ;
|
||||
input_len = (int) floor (LONG_BUFFER_LEN / src_ratio) ;
|
||||
}
|
||||
else
|
||||
{ input_len = LONG_BUFFER_LEN ;
|
||||
output_len = (int) floor (LONG_BUFFER_LEN * src_ratio) ;
|
||||
} ;
|
||||
|
||||
/* Reduce input_len by 10 so output is longer than necessary. */
|
||||
input_len -= 20 ;
|
||||
|
||||
if (output_len > LONG_BUFFER_LEN)
|
||||
{ printf ("\n\nLine %d : output_len > LONG_BUFFER_LEN\n\n", __LINE__) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
current_in = current_out = 0 ;
|
||||
|
||||
/* Perform sample rate conversion. */
|
||||
if ((src_state = src_new (converter, 1, &error)) == NULL)
|
||||
{ printf ("\n\nLine %d : src_new() failed : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
src_data.end_of_input = 0 ; /* Set this later. */
|
||||
|
||||
src_data.data_in = input ;
|
||||
|
||||
src_data.src_ratio = src_ratio ;
|
||||
|
||||
src_data.data_out = output ;
|
||||
src_data.output_frames = ARRAY_LEN (output) / 10 ;
|
||||
|
||||
terminate = 1 + (int) ceil ((src_ratio >= 1.0) ? src_ratio : 1.0 / src_ratio) ;
|
||||
|
||||
while (1)
|
||||
{
|
||||
src_data.input_frames = next_block_length (0) ;
|
||||
src_data.input_frames = MIN (src_data.input_frames, input_len - current_in) ;
|
||||
|
||||
src_data.output_frames = ARRAY_LEN (output) - current_out ;
|
||||
/*-Erik MIN (src_data.output_frames, output_len - current_out) ;-*/
|
||||
|
||||
src_data.end_of_input = (current_in >= input_len) ? 1 : 0 ;
|
||||
|
||||
if ((error = src_process (src_state, &src_data)))
|
||||
{ printf ("\n\nLine %d : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
printf (" src_data.input_frames : %ld\n", src_data.input_frames) ;
|
||||
printf (" src_data.output_frames : %ld\n\n", src_data.output_frames) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (src_data.end_of_input && src_data.output_frames_gen == 0)
|
||||
break ;
|
||||
|
||||
if (src_data.input_frames_used > src_data.input_frames)
|
||||
{ printf ("\n\nLine %d : input_frames_used > input_frames\n\n", __LINE__) ;
|
||||
printf (" src_data.input_frames : %ld\n", src_data.input_frames) ;
|
||||
printf (" src_data.input_frames_used : %ld\n", src_data.input_frames_used) ;
|
||||
printf (" src_data.output_frames : %ld\n", src_data.output_frames) ;
|
||||
printf (" src_data.output_frames_gen : %ld\n\n", src_data.output_frames_gen) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (src_data.input_frames_used < 0)
|
||||
{ printf ("\n\nLine %d : input_frames_used (%ld) < 0\n\n", __LINE__, src_data.input_frames_used) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (src_data.output_frames_gen < 0)
|
||||
{ printf ("\n\nLine %d : output_frames_gen (%ld) < 0\n\n", __LINE__, src_data.output_frames_gen) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
current_in += src_data.input_frames_used ;
|
||||
current_out += src_data.output_frames_gen ;
|
||||
|
||||
if (current_in > input_len + terminate)
|
||||
{ printf ("\n\nLine %d : current_in (%d) > input_len (%d + %d)\n\n", __LINE__, current_in, input_len, terminate) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (current_out > output_len)
|
||||
{ printf ("\n\nLine %d : current_out (%d) > output_len (%d)\n\n", __LINE__, current_out, output_len) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (src_data.input_frames_used > input_len)
|
||||
{ printf ("\n\nLine %d : input_frames_used (%ld) > %d\n\n", __LINE__, src_data.input_frames_used, input_len) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (src_data.output_frames_gen > output_len)
|
||||
{ printf ("\n\nLine %d : output_frames_gen (%ld) > %d\n\n", __LINE__, src_data.output_frames_gen, output_len) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (src_data.data_in == NULL && src_data.output_frames_gen == 0)
|
||||
break ;
|
||||
|
||||
|
||||
src_data.data_in += src_data.input_frames_used ;
|
||||
src_data.data_out += src_data.output_frames_gen ;
|
||||
} ;
|
||||
|
||||
src_state = src_delete (src_state) ;
|
||||
|
||||
if (fabs (current_out - src_ratio * input_len) > terminate)
|
||||
{ printf ("\n\nLine %d : bad output data length %d should be %2.1f +/- %d.\n", __LINE__,
|
||||
current_out, src_ratio * input_len, terminate) ;
|
||||
printf ("\tsrc_ratio : %.4f\n", src_ratio) ;
|
||||
printf ("\tinput_len : %d\n\tinput_used : %d\n", input_len, current_in) ;
|
||||
printf ("\toutput_len : %d\n\toutput_gen : %d\n\n", output_len, current_out) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (current_in != input_len)
|
||||
{ printf ("\n\nLine %d : unused input.\n", __LINE__) ;
|
||||
printf ("\tinput_len : %d\n", input_len) ;
|
||||
printf ("\tinput_frames_used : %d\n\n", current_in) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
puts ("ok") ;
|
||||
|
||||
return ;
|
||||
} /* stream_test */
|
||||
|
||||
static int
|
||||
next_block_length (int reset)
|
||||
{ static int block_lengths [] = /* Should be an odd length. */
|
||||
{ /*-2, 500, 5, 400, 10, 300, 20, 200, 50, 100, 70 -*/
|
||||
5, 400, 10, 300, 20, 200, 50, 100, 70
|
||||
} ;
|
||||
static int block_len_index = 0 ;
|
||||
|
||||
if (reset)
|
||||
block_len_index = 0 ;
|
||||
else
|
||||
block_len_index = (block_len_index + 1) % ARRAY_LEN (block_lengths) ;
|
||||
|
||||
return block_lengths [block_len_index] ;
|
||||
} /* next_block_length */
|
||||
|
|
@ -1,212 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2004-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <samplerate.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "util.h"
|
||||
#include "float_cast.h"
|
||||
|
||||
#define BUFFER_LEN (1<<16)
|
||||
|
||||
static float input [BUFFER_LEN] ;
|
||||
static float output [BUFFER_LEN] ;
|
||||
|
||||
static long
|
||||
throughput_test (int converter, long best_throughput)
|
||||
{ SRC_DATA src_data ;
|
||||
clock_t start_time, clock_time ;
|
||||
double duration ;
|
||||
long total_frames = 0, throughput ;
|
||||
int error ;
|
||||
|
||||
printf (" %-30s ", src_get_name (converter)) ;
|
||||
fflush (stdout) ;
|
||||
|
||||
src_data.data_in = input ;
|
||||
src_data.input_frames = ARRAY_LEN (input) ;
|
||||
|
||||
src_data.data_out = output ;
|
||||
src_data.output_frames = ARRAY_LEN (output) ;
|
||||
|
||||
src_data.src_ratio = 0.99 ;
|
||||
|
||||
sleep (2) ;
|
||||
|
||||
start_time = clock () ;
|
||||
|
||||
do
|
||||
{
|
||||
if ((error = src_simple (&src_data, converter, 1)) != 0)
|
||||
{ puts (src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
total_frames += src_data.output_frames_gen ;
|
||||
|
||||
clock_time = clock () - start_time ;
|
||||
duration = (1.0 * clock_time) / CLOCKS_PER_SEC ;
|
||||
}
|
||||
while (duration < 3.0) ;
|
||||
|
||||
if (src_data.input_frames_used != ARRAY_LEN (input))
|
||||
{ printf ("\n\nLine %d : input frames used %ld should be %d\n", __LINE__, src_data.input_frames_used, ARRAY_LEN (input)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (fabs (src_data.src_ratio * src_data.input_frames_used - src_data.output_frames_gen) > 2)
|
||||
{ printf ("\n\nLine %d : input / output length mismatch.\n\n", __LINE__) ;
|
||||
printf (" input len : %d\n", ARRAY_LEN (input)) ;
|
||||
printf (" output len : %ld (should be %g +/- 2)\n\n", src_data.output_frames_gen,
|
||||
floor (0.5 + src_data.src_ratio * src_data.input_frames_used)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
throughput = lrint (floor (total_frames / duration)) ;
|
||||
|
||||
if (best_throughput == 0)
|
||||
{ best_throughput = MAX (throughput, best_throughput) ;
|
||||
printf ("%5.2f %10ld\n", duration, throughput) ;
|
||||
}
|
||||
else
|
||||
{ best_throughput = MAX (throughput, best_throughput) ;
|
||||
printf ("%5.2f %10ld %10ld\n", duration, throughput, best_throughput) ;
|
||||
}
|
||||
|
||||
|
||||
return best_throughput ;
|
||||
} /* throughput_test */
|
||||
|
||||
static void
|
||||
single_run (void)
|
||||
{
|
||||
|
||||
printf ("\n CPU name : %s\n", get_cpu_name ()) ;
|
||||
|
||||
puts (
|
||||
"\n"
|
||||
" Converter Duration Throughput\n"
|
||||
" -----------------------------------------------------------"
|
||||
) ;
|
||||
|
||||
throughput_test (SRC_ZERO_ORDER_HOLD, 0) ;
|
||||
throughput_test (SRC_LINEAR, 0) ;
|
||||
throughput_test (SRC_SINC_FASTEST, 0) ;
|
||||
throughput_test (SRC_SINC_MEDIUM_QUALITY, 0) ;
|
||||
throughput_test (SRC_SINC_BEST_QUALITY, 0) ;
|
||||
|
||||
puts ("") ;
|
||||
return ;
|
||||
} /* single_run */
|
||||
|
||||
static void
|
||||
multi_run (int run_count)
|
||||
{ long zero_order_hold = 0, linear = 0 ;
|
||||
long sinc_fastest = 0, sinc_medium = 0, sinc_best = 0 ;
|
||||
int k ;
|
||||
|
||||
puts (
|
||||
"\n"
|
||||
" Converter Duration Throughput Best Throughput\n"
|
||||
" --------------------------------------------------------------------------------"
|
||||
) ;
|
||||
|
||||
for (k = 0 ; k < run_count ; k++)
|
||||
{ zero_order_hold = throughput_test (SRC_ZERO_ORDER_HOLD, zero_order_hold) ;
|
||||
linear = throughput_test (SRC_LINEAR, linear) ;
|
||||
sinc_fastest = throughput_test (SRC_SINC_FASTEST, sinc_fastest) ;
|
||||
sinc_medium = throughput_test (SRC_SINC_MEDIUM_QUALITY, sinc_medium) ;
|
||||
sinc_best = throughput_test (SRC_SINC_BEST_QUALITY, sinc_best) ;
|
||||
|
||||
puts ("") ;
|
||||
|
||||
/* Let the CPU cool down. We might be running on a laptop. */
|
||||
sleep (10) ;
|
||||
} ;
|
||||
|
||||
printf ("\n CPU name : %s\n", get_cpu_name ()) ;
|
||||
|
||||
puts (
|
||||
"\n"
|
||||
" Converter Best Throughput\n"
|
||||
" ------------------------------------------------"
|
||||
) ;
|
||||
printf (" %-30s %10ld\n", src_get_name (SRC_ZERO_ORDER_HOLD), zero_order_hold) ;
|
||||
printf (" %-30s %10ld\n", src_get_name (SRC_LINEAR), linear) ;
|
||||
printf (" %-30s %10ld\n", src_get_name (SRC_SINC_FASTEST), sinc_fastest) ;
|
||||
printf (" %-30s %10ld\n", src_get_name (SRC_SINC_MEDIUM_QUALITY), sinc_medium) ;
|
||||
printf (" %-30s %10ld\n", src_get_name (SRC_SINC_BEST_QUALITY), sinc_best) ;
|
||||
|
||||
puts ("") ;
|
||||
} /* multi_run */
|
||||
|
||||
static void
|
||||
usage_exit (const char * argv0)
|
||||
{ const char * cptr ;
|
||||
|
||||
if ((cptr = strrchr (argv0, '/')) != NULL)
|
||||
argv0 = cptr ;
|
||||
|
||||
printf (
|
||||
"Usage :\n"
|
||||
" %s - Single run of the throughput test.\n"
|
||||
" %s --best-of N - Do N runs of test a print bext result.\n"
|
||||
"\n",
|
||||
argv0, argv0) ;
|
||||
|
||||
exit (0) ;
|
||||
} /* usage_exit */
|
||||
|
||||
int
|
||||
main (int argc, char ** argv)
|
||||
{ double freq ;
|
||||
|
||||
memset (input, 0, sizeof (input)) ;
|
||||
freq = 0.01 ;
|
||||
gen_windowed_sines (1, &freq, 1.0, input, BUFFER_LEN) ;
|
||||
|
||||
if (argc == 1)
|
||||
single_run () ;
|
||||
else if (argc == 3 && strcmp (argv [1], "--best-of") == 0)
|
||||
{ int run_count = atoi (argv [2]) ;
|
||||
|
||||
if (run_count < 1 || run_count > 20)
|
||||
{ printf ("Please be sensible. Run count should be in range (1, 10].\n") ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
multi_run (run_count) ;
|
||||
}
|
||||
else
|
||||
usage_exit (argv [0]) ;
|
||||
|
||||
puts (
|
||||
" Duration is in seconds.\n"
|
||||
" Throughput is in samples/sec (more is better).\n"
|
||||
) ;
|
||||
|
||||
return 0 ;
|
||||
} /* main */
|
||||
|
|
@ -1,230 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846264338
|
||||
#endif
|
||||
|
||||
void
|
||||
gen_windowed_sines (int freq_count, const double *freqs, double max, float *output, int output_len)
|
||||
{ int k, freq ;
|
||||
double amplitude, phase ;
|
||||
|
||||
amplitude = max / freq_count ;
|
||||
|
||||
for (k = 0 ; k < output_len ; k++)
|
||||
output [k] = 0.0 ;
|
||||
|
||||
for (freq = 0 ; freq < freq_count ; freq++)
|
||||
{ phase = 0.9 * M_PI / freq_count ;
|
||||
|
||||
if (freqs [freq] <= 0.0 || freqs [freq] >= 0.5)
|
||||
{ printf ("\n%s : Error : freq [%d] == %g is out of range. Should be < 0.5.\n", __FILE__, freq, freqs [freq]) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
for (k = 0 ; k < output_len ; k++)
|
||||
output [k] += amplitude * sin (freqs [freq] * (2 * k) * M_PI + phase) ;
|
||||
} ;
|
||||
|
||||
/* Apply Hanning Window. */
|
||||
for (k = 0 ; k < output_len ; k++)
|
||||
output [k] *= 0.5 - 0.5 * cos ((2 * k) * M_PI / (output_len - 1)) ;
|
||||
|
||||
/* data [k] *= 0.3635819 - 0.4891775 * cos ((2 * k) * M_PI / (output_len - 1))
|
||||
+ 0.1365995 * cos ((4 * k) * M_PI / (output_len - 1))
|
||||
- 0.0106411 * cos ((6 * k) * M_PI / (output_len - 1)) ;
|
||||
*/
|
||||
|
||||
return ;
|
||||
} /* gen_windowed_sines */
|
||||
|
||||
void
|
||||
save_oct_float (char *filename, float *input, int in_len, float *output, int out_len)
|
||||
{ FILE *file ;
|
||||
int k ;
|
||||
|
||||
printf ("Dumping input and output data to file : %s.\n\n", filename) ;
|
||||
|
||||
if (! (file = fopen (filename, "w")))
|
||||
return ;
|
||||
|
||||
fprintf (file, "# Not created by Octave\n") ;
|
||||
|
||||
fprintf (file, "# name: input\n") ;
|
||||
fprintf (file, "# type: matrix\n") ;
|
||||
fprintf (file, "# rows: %d\n", in_len) ;
|
||||
fprintf (file, "# columns: 1\n") ;
|
||||
|
||||
for (k = 0 ; k < in_len ; k++)
|
||||
fprintf (file, "% g\n", input [k]) ;
|
||||
|
||||
fprintf (file, "# name: output\n") ;
|
||||
fprintf (file, "# type: matrix\n") ;
|
||||
fprintf (file, "# rows: %d\n", out_len) ;
|
||||
fprintf (file, "# columns: 1\n") ;
|
||||
|
||||
for (k = 0 ; k < out_len ; k++)
|
||||
fprintf (file, "% g\n", output [k]) ;
|
||||
|
||||
fclose (file) ;
|
||||
return ;
|
||||
} /* save_oct_float */
|
||||
|
||||
void
|
||||
save_oct_double (char *filename, double *input, int in_len, double *output, int out_len)
|
||||
{ FILE *file ;
|
||||
int k ;
|
||||
|
||||
printf ("Dumping input and output data to file : %s.\n\n", filename) ;
|
||||
|
||||
if (! (file = fopen (filename, "w")))
|
||||
return ;
|
||||
|
||||
fprintf (file, "# Not created by Octave\n") ;
|
||||
|
||||
fprintf (file, "# name: input\n") ;
|
||||
fprintf (file, "# type: matrix\n") ;
|
||||
fprintf (file, "# rows: %d\n", in_len) ;
|
||||
fprintf (file, "# columns: 1\n") ;
|
||||
|
||||
for (k = 0 ; k < in_len ; k++)
|
||||
fprintf (file, "% g\n", input [k]) ;
|
||||
|
||||
fprintf (file, "# name: output\n") ;
|
||||
fprintf (file, "# type: matrix\n") ;
|
||||
fprintf (file, "# rows: %d\n", out_len) ;
|
||||
fprintf (file, "# columns: 1\n") ;
|
||||
|
||||
for (k = 0 ; k < out_len ; k++)
|
||||
fprintf (file, "% g\n", output [k]) ;
|
||||
|
||||
fclose (file) ;
|
||||
return ;
|
||||
} /* save_oct_double */
|
||||
|
||||
void
|
||||
interleave_data (const float *in, float *out, int frames, int channels)
|
||||
{ int fr, ch ;
|
||||
|
||||
for (fr = 0 ; fr < frames ; fr++)
|
||||
for (ch = 0 ; ch < channels ; ch++)
|
||||
out [ch + channels * fr] = in [fr + frames * ch] ;
|
||||
|
||||
return ;
|
||||
} /* interleave_data */
|
||||
|
||||
void
|
||||
deinterleave_data (const float *in, float *out, int frames, int channels)
|
||||
{ int fr, ch ;
|
||||
|
||||
for (ch = 0 ; ch < channels ; ch++)
|
||||
for (fr = 0 ; fr < frames ; fr++)
|
||||
out [fr + frames * ch] = in [ch + channels * fr] ;
|
||||
|
||||
return ;
|
||||
} /* deinterleave_data */
|
||||
|
||||
void
|
||||
reverse_data (float *data, int datalen)
|
||||
{ int left, right ;
|
||||
float temp ;
|
||||
|
||||
left = 0 ;
|
||||
right = datalen - 1 ;
|
||||
|
||||
while (left < right)
|
||||
{ temp = data [left] ;
|
||||
data [left] = data [right] ;
|
||||
data [right] = temp ;
|
||||
left ++ ;
|
||||
right -- ;
|
||||
} ;
|
||||
|
||||
} /* reverse_data */
|
||||
|
||||
const char *
|
||||
get_cpu_name (void)
|
||||
{
|
||||
const char *name = "Unknown", *search = NULL ;
|
||||
static char buffer [512] ;
|
||||
FILE * file = NULL ;
|
||||
int is_pipe = 0 ;
|
||||
|
||||
#if defined (__linux__)
|
||||
file = fopen ("/proc/cpuinfo", "r") ;
|
||||
search = "model name" ;
|
||||
#elif defined (__APPLE__)
|
||||
file = popen ("/usr/sbin/system_profiler -detailLevel full SPHardwareDataType", "r") ;
|
||||
search = "Processor Name" ;
|
||||
is_pipe = 1 ;
|
||||
#elif defined (__FreeBSD__)
|
||||
file = popen ("sysctl -a", "r") ;
|
||||
search = "hw.model" ;
|
||||
is_pipe = 1 ;
|
||||
#else
|
||||
file = NULL ;
|
||||
#endif
|
||||
|
||||
if (file == NULL)
|
||||
return name ;
|
||||
|
||||
if (search == NULL)
|
||||
{ printf ("Error : search is NULL in function %s.\n", __func__) ;
|
||||
return name ;
|
||||
} ;
|
||||
|
||||
while (fgets (buffer, sizeof (buffer), file) != NULL)
|
||||
if (strstr (buffer, search))
|
||||
{ char *src, *dest ;
|
||||
|
||||
if ((src = strchr (buffer, ':')) != NULL)
|
||||
{ src ++ ;
|
||||
while (isspace (src [0]))
|
||||
src ++ ;
|
||||
name = src ;
|
||||
|
||||
/* Remove consecutive spaces. */
|
||||
src ++ ;
|
||||
for (dest = src ; src [0] ; src ++)
|
||||
{ if (isspace (src [0]) && isspace (dest [-1]))
|
||||
continue ;
|
||||
dest [0] = src [0] ;
|
||||
dest ++ ;
|
||||
} ;
|
||||
dest [0] = 0 ;
|
||||
break ;
|
||||
} ;
|
||||
} ;
|
||||
|
||||
if (is_pipe)
|
||||
pclose (file) ;
|
||||
else
|
||||
fclose (file) ;
|
||||
|
||||
return name ;
|
||||
} /* get_cpu_name */
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
#define ABS(a) (((a) < 0) ? - (a) : (a))
|
||||
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#define MAX(a,b) (((a) >= (b)) ? (a) : (b))
|
||||
|
||||
#define ARRAY_LEN(x) ((int) (sizeof (x) / sizeof ((x) [0])))
|
||||
|
||||
void gen_windowed_sines (int freq_count, const double *freqs, double max, float *output, int output_len) ;
|
||||
|
||||
void save_oct_float (char *filename, float *input, int in_len, float *output, int out_len) ;
|
||||
void save_oct_double (char *filename, double *input, int in_len, double *output, int out_len) ;
|
||||
|
||||
void interleave_data (const float *in, float *out, int frames, int channels) ;
|
||||
|
||||
void deinterleave_data (const float *in, float *out, int frames, int channels) ;
|
||||
|
||||
void reverse_data (float *data, int datalen) ;
|
||||
|
||||
double calculate_snr (float *data, int len, int expected_peaks) ;
|
||||
|
||||
const char * get_cpu_name (void) ;
|
||||
|
||||
#if OS_IS_WIN32
|
||||
/*
|
||||
** Extra Win32 hacks.
|
||||
**
|
||||
** Despite Microsoft claim of windows being POSIX compatibile it has '_sleep'
|
||||
** instead of 'sleep'.
|
||||
*/
|
||||
|
||||
#define sleep _sleep
|
||||
#endif
|
||||
|
|
@ -1,152 +0,0 @@
|
|||
/*
|
||||
** Copyright (C) 2006-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program 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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <samplerate.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#define BUFFER_LEN (1 << 16)
|
||||
|
||||
static void varispeed_test (int converter, double target_snr) ;
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
puts ("") ;
|
||||
printf (" Zero Order Hold interpolator : ") ;
|
||||
varispeed_test (SRC_ZERO_ORDER_HOLD, 10.0) ;
|
||||
|
||||
printf (" Linear interpolator : ") ;
|
||||
varispeed_test (SRC_LINEAR, 10.0) ;
|
||||
|
||||
printf (" Sinc interpolator : ") ;
|
||||
varispeed_test (SRC_SINC_FASTEST, 115.0) ;
|
||||
|
||||
puts ("") ;
|
||||
|
||||
return 0 ;
|
||||
} /* main */
|
||||
|
||||
static void
|
||||
varispeed_test (int converter, double target_snr)
|
||||
{ static float input [BUFFER_LEN], output [BUFFER_LEN] ;
|
||||
double sine_freq, snr ;
|
||||
|
||||
SRC_STATE *src_state ;
|
||||
SRC_DATA src_data ;
|
||||
|
||||
int input_len, error ;
|
||||
|
||||
memset (input, 0, sizeof (input)) ;
|
||||
|
||||
input_len = ARRAY_LEN (input) / 2 ;
|
||||
|
||||
sine_freq = 0.0111 ;
|
||||
gen_windowed_sines (1, &sine_freq, 1.0, input, input_len) ;
|
||||
|
||||
/* Perform sample rate conversion. */
|
||||
if ((src_state = src_new (converter, 1, &error)) == NULL)
|
||||
{ printf ("\n\nLine %d : src_new() failed : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
src_data.end_of_input = 1 ;
|
||||
|
||||
src_data.data_in = input ;
|
||||
src_data.input_frames = input_len ;
|
||||
|
||||
src_data.src_ratio = 3.0 ;
|
||||
|
||||
src_data.data_out = output ;
|
||||
src_data.output_frames = ARRAY_LEN (output) ;
|
||||
|
||||
if ((error = src_set_ratio (src_state, 1.0 / src_data.src_ratio)))
|
||||
{ printf ("\n\nLine %d : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if ((error = src_process (src_state, &src_data)))
|
||||
{ printf ("\n\nLine %d : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
printf (" src_data.input_frames : %ld\n", src_data.input_frames) ;
|
||||
printf (" src_data.output_frames : %ld\n\n", src_data.output_frames) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (src_data.input_frames_used != input_len)
|
||||
{ printf ("\n\nLine %d : unused input.\n", __LINE__) ;
|
||||
printf ("\tinput_len : %d\n", input_len) ;
|
||||
printf ("\tinput_frames_used : %ld\n\n", src_data.input_frames_used) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
/* Copy the last output to the input. */
|
||||
memcpy (input, output, sizeof (input)) ;
|
||||
reverse_data (input, src_data.output_frames_gen) ;
|
||||
|
||||
if ((error = src_reset (src_state)))
|
||||
{ printf ("\n\nLine %d : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
src_data.end_of_input = 1 ;
|
||||
|
||||
src_data.data_in = input ;
|
||||
input_len = src_data.input_frames = src_data.output_frames_gen ;
|
||||
|
||||
src_data.data_out = output ;
|
||||
src_data.output_frames = ARRAY_LEN (output) ;
|
||||
|
||||
if ((error = src_set_ratio (src_state, 1.0 / src_data.src_ratio)))
|
||||
{ printf ("\n\nLine %d : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if ((error = src_process (src_state, &src_data)))
|
||||
{ printf ("\n\nLine %d : %s\n\n", __LINE__, src_strerror (error)) ;
|
||||
printf (" src_data.input_frames : %ld\n", src_data.input_frames) ;
|
||||
printf (" src_data.output_frames : %ld\n\n", src_data.output_frames) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
if (src_data.input_frames_used != input_len)
|
||||
{ printf ("\n\nLine %d : unused input.\n", __LINE__) ;
|
||||
printf ("\tinput_len : %d\n", input_len) ;
|
||||
printf ("\tinput_frames_used : %ld\n\n", src_data.input_frames_used) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
src_state = src_delete (src_state) ;
|
||||
|
||||
snr = calculate_snr (output, src_data.output_frames_gen, 1) ;
|
||||
|
||||
if (target_snr > snr)
|
||||
{ printf ("\n\nLine %d : snr (%3.1f) does not meet target (%3.1f)\n\n", __LINE__, snr, target_snr) ;
|
||||
save_oct_float ("varispeed.mat", input, src_data.input_frames, output, src_data.output_frames_gen) ;
|
||||
exit (1) ;
|
||||
} ;
|
||||
|
||||
puts ("ok") ;
|
||||
|
||||
return ;
|
||||
} /* varispeed_test */
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
Gregory Maxwell (greg@xiph.org)
|
||||
Jean-Marc Valin - Original opusdec implementation / Resampler
|
||||
Thorvald Natvig - Resampler
|
||||
Michael Smith - Ogginfo (basis of opusinfo)
|
||||
John Edwards - Windows audio output
|
|
@ -1,3 +1,34 @@
|
|||
|
||||
Opus-tools, with the exception of opusinfo.[ch] is available under
|
||||
the following two clause BSD-style license:
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
|
||||
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
Opusinfo is a fork of ogginfo from the vorbis-tools package
|
||||
(http://www.xiph.org). It is available under the GPL:
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
2012-05-16 Gregory Maxwell <greg@xiph.org>
|
||||
|
||||
* Initial public version, 0.1.0
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue