Hello community, here is the log from the commit of package alsa-plugins checked in at Fri May 4 00:25:54 CEST 2007. -------- --- alsa-plugins/alsa-plugins-a52.changes 2007-03-14 17:24:38.000000000 +0100 +++ /mounts/work_src_done/STABLE/alsa-plugins/alsa-plugins-a52.changes 2007-05-02 12:44:05.000000000 +0200 @@ -1,0 +2,6 @@ +Wed May 2 12:43:55 CEST 2007 - tiwai@suse.de + +- updated to version 1.0.14rc4: + including HG fixes + +------------------------------------------------------------------- --- alsa-plugins/alsa-plugins.changes 2007-04-10 18:53:35.000000000 +0200 +++ /mounts/work_src_done/STABLE/alsa-plugins/alsa-plugins.changes 2007-05-02 12:43:38.000000000 +0200 @@ -1,0 +2,6 @@ +Wed May 2 12:43:27 CEST 2007 - tiwai@suse.de + +- updated to version 1.0.14rc4: + including HG fixes + +------------------------------------------------------------------- Old: ---- alsa-plugins-1.0.14rc3.tar.bz2 alsa-plugins-hg-fixes.diff New: ---- alsa-plugins-1.0.14rc4.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ alsa-plugins-a52.spec ++++++ --- /var/tmp/diff_new_pack.A23535/_old 2007-05-04 00:25:49.000000000 +0200 +++ /var/tmp/diff_new_pack.A23535/_new 2007-05-04 00:25:49.000000000 +0200 @@ -12,16 +12,16 @@ Name: alsa-plugins-a52 BuildRequires: alsa-devel ffmpeg-devel pkg-config -%define package_version 1.0.14rc3 +%define package_version 1.0.14rc4 URL: http://www.alsa-project.org/ Summary: A52 Encoding Plug-In for the ALSA Library Version: 1.0.13 -Release: 21 +Release: 27 License: GNU General Public License (GPL), GNU Library General Public License v. 2.0 and 2.1 (LGPL) Group: System/Libraries Autoreqprov: on Source: ftp://ftp.alsa-project.org/pub/plugins/alsa-plugins-%{package_version}.tar.bz2 -Patch1: alsa-plugins-hg-fixes.diff +# Patch1: alsa-plugins-hg-fixes.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -35,7 +35,7 @@ %prep %setup -n alsa-plugins-%{package_version} -%patch1 -p1 +# %patch1 -p1 %build %{?suse_update_config:%{suse_update_config -f}} @@ -61,6 +61,9 @@ %{_libdir}/alsa-lib/libasound_module_rate_*.so %changelog +* Wed May 02 2007 - tiwai@suse.de +- updated to version 1.0.14rc4: + including HG fixes * Wed Mar 14 2007 - tiwai@suse.de - updated to version 1.0.14rc3: * added rate-lavc resampler plugin ++++++ alsa-plugins.spec ++++++ --- /var/tmp/diff_new_pack.A23535/_old 2007-05-04 00:25:49.000000000 +0200 +++ /var/tmp/diff_new_pack.A23535/_new 2007-05-04 00:25:49.000000000 +0200 @@ -12,16 +12,16 @@ Name: alsa-plugins BuildRequires: alsa-devel dbus-1-devel jack-devel libsamplerate-devel pulseaudio-devel -%define package_version 1.0.14rc3 +%define package_version 1.0.14rc4 URL: http://www.alsa-project.org/ Summary: Extra Plug-Ins for the ALSA Library Version: 1.0.13 -Release: 21 +Release: 25 License: BSD License and BSD-like, GNU Library General Public License v. 2.0 and 2.1 (LGPL) Group: System/Libraries Autoreqprov: on Source: ftp://ftp.alsa-project.org/pub/plugins/alsa-plugins-%{package_version}.tar.bz2 -Patch1: alsa-plugins-hg-fixes.diff +# Patch1: alsa-plugins-hg-fixes.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -97,7 +97,7 @@ %prep %setup -n %{name}-%{package_version} -%patch1 -p1 +# %patch1 -p1 %build %{?suse_update_config:%{suse_update_config -f}} @@ -152,6 +152,9 @@ %{_libdir}/alsa-lib/libasound_module_rate_samplerate*.so %changelog +* Wed May 02 2007 - tiwai@suse.de +- updated to version 1.0.14rc4: + including HG fixes * Tue Apr 10 2007 - tiwai@suse.de - split samplerate to subpackage (the sole GPL-only module). - fixed licenses on PDB. ++++++ alsa-plugins-1.0.14rc3.tar.bz2 -> alsa-plugins-1.0.14rc4.tar.bz2 ++++++ ++++ 13743 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alsa-plugins-1.0.14rc3/configure.in new/alsa-plugins-1.0.14rc4/configure.in --- old/alsa-plugins-1.0.14rc3/configure.in 2007-02-26 10:21:37.000000000 +0100 +++ new/alsa-plugins-1.0.14rc4/configure.in 2007-05-02 13:31:35.000000000 +0200 @@ -1,6 +1,6 @@ AC_PREREQ(2.59) AC_INIT(oss/pcm_oss.c) -AM_INIT_AUTOMAKE(alsa-plugins, 1.0.14rc3) +AM_INIT_AUTOMAKE(alsa-plugins, 1.0.14rc4) AC_PREFIX_DEFAULT(/usr) AC_CONFIG_HEADERS(config.h) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alsa-plugins-1.0.14rc3/doc/Makefile.am new/alsa-plugins-1.0.14rc4/doc/Makefile.am --- old/alsa-plugins-1.0.14rc3/doc/Makefile.am 2007-02-26 10:21:37.000000000 +0100 +++ new/alsa-plugins-1.0.14rc4/doc/Makefile.am 2007-05-02 13:31:35.000000000 +0200 @@ -1,2 +1,3 @@ EXTRA_DIST = README-pcm-oss README-jack README-pulse README-maemo \ - upmix.txt vdownmix.txt samplerate.txt a52.txt lavcrate.txt + upmix.txt vdownmix.txt samplerate.txt a52.txt lavcrate.txt \ + speexrate.txt diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alsa-plugins-1.0.14rc3/doc/speexrate.txt new/alsa-plugins-1.0.14rc4/doc/speexrate.txt --- old/alsa-plugins-1.0.14rc3/doc/speexrate.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/alsa-plugins-1.0.14rc4/doc/speexrate.txt 2007-05-02 13:31:35.000000000 +0200 @@ -0,0 +1,29 @@ +Rate Converter Plugin Using Speex Resampler +=========================================== + +The plugin in rate subdirectory is an external rate converter using +the Speex resampler (aka Public Parrot Hack) by Jean-Marc Valin. You can +use this rate converter plugin by defining a rate PCM with "converter" +parameter, such as: + + pcm.my_rate { + type rate + slave.pcm "hw" + converter "speexrate" + } + +The plug plugin has also a similar field, "rate_converter". + +Or, more easily, define a global variable "defaults.pcm.rate_converter", +which is used as the default converter type by plug and rate plugins: + + defaults.pcm.rate_converter "speexrate" + +Write the above in your ~/.asoundrc or /etc/asound.conf. + +The following converter types are available: + + - speexrate_best Use quality 10 (equivalent to SRC_SINC_BEST_QUALITY) + - speexrate_medium Use quality 5 (equivalent to SRC_SINC_MEDIUM_QUALITY) + - speexrate Use quality 3 (equivalent to SRC_SINC_FASTEST) + diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alsa-plugins-1.0.14rc3/pph/arch.h new/alsa-plugins-1.0.14rc4/pph/arch.h --- old/alsa-plugins-1.0.14rc3/pph/arch.h 1970-01-01 01:00:00.000000000 +0100 +++ new/alsa-plugins-1.0.14rc4/pph/arch.h 2007-05-02 13:31:35.000000000 +0200 @@ -0,0 +1,197 @@ +/* Copyright (C) 2003 Jean-Marc Valin */ +/** + @file arch.h + @brief Various architecture definitions Speex +*/ +/* + 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. + + - Neither the name of the Xiph.org Foundation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + 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 FOUNDATION 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. +*/ + +#ifndef ARCH_H +#define ARCH_H + +#ifndef OUTSIDE_SPEEX +#include "speex/speex_types.h" +#endif + +#define ABS(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute integer value. */ +#define ABS16(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute 16-bit value. */ +#define MIN16(a,b) ((a) < (b) ? (a) : (b)) /**< Maximum 16-bit value. */ +#define MAX16(a,b) ((a) > (b) ? (a) : (b)) /**< Maximum 16-bit value. */ +#define ABS32(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute 32-bit value. */ +#define MIN32(a,b) ((a) < (b) ? (a) : (b)) /**< Maximum 32-bit value. */ +#define MAX32(a,b) ((a) > (b) ? (a) : (b)) /**< Maximum 32-bit value. */ + +#ifdef FIXED_POINT + +typedef spx_int16_t spx_word16_t; +typedef spx_int32_t spx_word32_t; +typedef spx_word32_t spx_mem_t; +typedef spx_word16_t spx_coef_t; +typedef spx_word16_t spx_lsp_t; +typedef spx_word32_t spx_sig_t; + +#define Q15ONE 32767 + +#define LPC_SCALING 8192 +#define SIG_SCALING 16384 +#define LSP_SCALING 8192. +#define GAMMA_SCALING 32768. +#define GAIN_SCALING 64 +#define GAIN_SCALING_1 0.015625 + +#define LPC_SHIFT 13 +#define LSP_SHIFT 13 +#define SIG_SHIFT 14 + +#define VERY_SMALL 0 +#define VERY_LARGE32 ((spx_word32_t)2147483647) +#define VERY_LARGE16 ((spx_word16_t)32767) +#define Q15_ONE ((spx_word16_t)32767) + + +#ifdef FIXED_DEBUG +#include "fixed_debug.h" +#else + +#include "fixed_generic.h" + +#ifdef ARM5E_ASM +#include "fixed_arm5e.h" +#elif defined (ARM4_ASM) +#include "fixed_arm4.h" +#elif defined (ARM5E_ASM) +#include "fixed_arm5e.h" +#elif defined (BFIN_ASM) +#include "fixed_bfin.h" +#endif + +#endif + + +#else + +typedef float spx_mem_t; +typedef float spx_coef_t; +typedef float spx_lsp_t; +typedef float spx_sig_t; +typedef float spx_word16_t; +typedef float spx_word32_t; + +#define Q15ONE 1.0f +#define LPC_SCALING 1.f +#define SIG_SCALING 1.f +#define LSP_SCALING 1.f +#define GAMMA_SCALING 1.f +#define GAIN_SCALING 1.f +#define GAIN_SCALING_1 1.f + +#define LPC_SHIFT 0 +#define LSP_SHIFT 0 +#define SIG_SHIFT 0 + +#define VERY_SMALL 1e-15f +#define VERY_LARGE32 1e15f +#define VERY_LARGE16 1e15f +#define Q15_ONE ((spx_word16_t)1.f) + +#define QCONST16(x,bits) (x) +#define QCONST32(x,bits) (x) + +#define NEG16(x) (-(x)) +#define NEG32(x) (-(x)) +#define EXTRACT16(x) (x) +#define EXTEND32(x) (x) +#define SHR16(a,shift) (a) +#define SHL16(a,shift) (a) +#define SHR32(a,shift) (a) +#define SHL32(a,shift) (a) +#define PSHR16(a,shift) (a) +#define PSHR32(a,shift) (a) +#define VSHR32(a,shift) (a) +#define SATURATE16(x,a) (x) +#define SATURATE32(x,a) (x) + +#define PSHR(a,shift) (a) +#define SHR(a,shift) (a) +#define SHL(a,shift) (a) +#define SATURATE(x,a) (x) + +#define ADD16(a,b) ((a)+(b)) +#define SUB16(a,b) ((a)-(b)) +#define ADD32(a,b) ((a)+(b)) +#define SUB32(a,b) ((a)-(b)) +#define MULT16_16_16(a,b) ((a)*(b)) +#define MULT16_16(a,b) ((spx_word32_t)(a)*(spx_word32_t)(b)) +#define MAC16_16(c,a,b) ((c)+(spx_word32_t)(a)*(spx_word32_t)(b)) + +#define MULT16_32_Q11(a,b) ((a)*(b)) +#define MULT16_32_Q13(a,b) ((a)*(b)) +#define MULT16_32_Q14(a,b) ((a)*(b)) +#define MULT16_32_Q15(a,b) ((a)*(b)) +#define MULT16_32_P15(a,b) ((a)*(b)) + +#define MAC16_32_Q11(c,a,b) ((c)+(a)*(b)) +#define MAC16_32_Q15(c,a,b) ((c)+(a)*(b)) + +#define MAC16_16_Q11(c,a,b) ((c)+(a)*(b)) +#define MAC16_16_Q13(c,a,b) ((c)+(a)*(b)) +#define MAC16_16_P13(c,a,b) ((c)+(a)*(b)) +#define MULT16_16_Q11_32(a,b) ((a)*(b)) +#define MULT16_16_Q13(a,b) ((a)*(b)) +#define MULT16_16_Q14(a,b) ((a)*(b)) +#define MULT16_16_Q15(a,b) ((a)*(b)) +#define MULT16_16_P15(a,b) ((a)*(b)) +#define MULT16_16_P13(a,b) ((a)*(b)) +#define MULT16_16_P14(a,b) ((a)*(b)) + +#define DIV32_16(a,b) (((spx_word32_t)(a))/(spx_word16_t)(b)) +#define PDIV32_16(a,b) (((spx_word32_t)(a))/(spx_word16_t)(b)) +#define DIV32(a,b) (((spx_word32_t)(a))/(spx_word32_t)(b)) +#define PDIV32(a,b) (((spx_word32_t)(a))/(spx_word32_t)(b)) + + +#endif + + +#if defined (CONFIG_TI_C54X) || defined (CONFIG_TI_C55X) + +/* 2 on TI C5x DSP */ +#define BYTES_PER_CHAR 2 +#define BITS_PER_CHAR 16 +#define LOG2_BITS_PER_CHAR 4 + +#else + +#define BYTES_PER_CHAR 1 +#define BITS_PER_CHAR 8 +#define LOG2_BITS_PER_CHAR 3 + +#endif + +#endif diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alsa-plugins-1.0.14rc3/pph/fixed_generic.h new/alsa-plugins-1.0.14rc4/pph/fixed_generic.h --- old/alsa-plugins-1.0.14rc3/pph/fixed_generic.h 1970-01-01 01:00:00.000000000 +0100 +++ new/alsa-plugins-1.0.14rc4/pph/fixed_generic.h 2007-05-02 13:31:35.000000000 +0200 @@ -0,0 +1,106 @@ +/* Copyright (C) 2003 Jean-Marc Valin */ +/** + @file fixed_generic.h + @brief Generic fixed-point operations +*/ +/* + 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. + + - Neither the name of the Xiph.org Foundation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + 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 FOUNDATION 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. +*/ + +#ifndef FIXED_GENERIC_H +#define FIXED_GENERIC_H + +#define QCONST16(x,bits) ((spx_word16_t)(.5+(x)*(((spx_word32_t)1)<<(bits)))) +#define QCONST32(x,bits) ((spx_word32_t)(.5+(x)*(((spx_word32_t)1)<<(bits)))) + +#define NEG16(x) (-(x)) +#define NEG32(x) (-(x)) +#define EXTRACT16(x) ((spx_word16_t)(x)) +#define EXTEND32(x) ((spx_word32_t)(x)) +#define SHR16(a,shift) ((a) >> (shift)) +#define SHL16(a,shift) ((a) << (shift)) +#define SHR32(a,shift) ((a) >> (shift)) +#define SHL32(a,shift) ((a) << (shift)) +#define PSHR16(a,shift) (SHR16((a)+((1<<((shift))>>1)),shift)) +#define PSHR32(a,shift) (SHR32((a)+((1<<((shift))>>1)),shift)) +#define VSHR32(a, shift) (((shift)>0) ? SHR32(a, shift) : SHL32(a, -(shift))) +#define SATURATE16(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x))) +#define SATURATE32(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x))) + +#define SHR(a,shift) ((a) >> (shift)) +#define SHL(a,shift) ((spx_word32_t)(a) << (shift)) +#define PSHR(a,shift) (SHR((a)+((1<<((shift))>>1)),shift)) +#define SATURATE(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x))) + + +#define ADD16(a,b) ((spx_word16_t)((spx_word16_t)(a)+(spx_word16_t)(b))) +#define SUB16(a,b) ((spx_word16_t)(a)-(spx_word16_t)(b)) +#define ADD32(a,b) ((spx_word32_t)(a)+(spx_word32_t)(b)) +#define SUB32(a,b) ((spx_word32_t)(a)-(spx_word32_t)(b)) + + +/* result fits in 16 bits */ +#define MULT16_16_16(a,b) ((((spx_word16_t)(a))*((spx_word16_t)(b)))) + +/* (spx_word32_t)(spx_word16_t) gives TI compiler a hint that it's 16x16->32 multiply */ +#define MULT16_16(a,b) (((spx_word32_t)(spx_word16_t)(a))*((spx_word32_t)(spx_word16_t)(b))) + +#define MAC16_16(c,a,b) (ADD32((c),MULT16_16((a),(b)))) +#define MULT16_32_Q12(a,b) ADD32(MULT16_16((a),SHR((b),12)), SHR(MULT16_16((a),((b)&0x00000fff)),12)) +#define MULT16_32_Q13(a,b) ADD32(MULT16_16((a),SHR((b),13)), SHR(MULT16_16((a),((b)&0x00001fff)),13)) +#define MULT16_32_Q14(a,b) ADD32(MULT16_16((a),SHR((b),14)), SHR(MULT16_16((a),((b)&0x00003fff)),14)) + +#define MULT16_32_Q11(a,b) ADD32(MULT16_16((a),SHR((b),11)), SHR(MULT16_16((a),((b)&0x000007ff)),11)) +#define MAC16_32_Q11(c,a,b) ADD32(c,ADD32(MULT16_16((a),SHR((b),11)), SHR(MULT16_16((a),((b)&0x000007ff)),11))) + +#define MULT16_32_P15(a,b) ADD32(MULT16_16((a),SHR((b),15)), PSHR(MULT16_16((a),((b)&0x00007fff)),15)) +#define MULT16_32_Q15(a,b) ADD32(MULT16_16((a),SHR((b),15)), SHR(MULT16_16((a),((b)&0x00007fff)),15)) +#define MAC16_32_Q15(c,a,b) ADD32(c,ADD32(MULT16_16((a),SHR((b),15)), SHR(MULT16_16((a),((b)&0x00007fff)),15))) + + +#define MAC16_16_Q11(c,a,b) (ADD32((c),SHR(MULT16_16((a),(b)),11))) +#define MAC16_16_Q13(c,a,b) (ADD32((c),SHR(MULT16_16((a),(b)),13))) +#define MAC16_16_P13(c,a,b) (ADD32((c),SHR(ADD32(4096,MULT16_16((a),(b))),13))) + +#define MULT16_16_Q11_32(a,b) (SHR(MULT16_16((a),(b)),11)) +#define MULT16_16_Q13(a,b) (SHR(MULT16_16((a),(b)),13)) +#define MULT16_16_Q14(a,b) (SHR(MULT16_16((a),(b)),14)) +#define MULT16_16_Q15(a,b) (SHR(MULT16_16((a),(b)),15)) + +#define MULT16_16_P13(a,b) (SHR(ADD32(4096,MULT16_16((a),(b))),13)) +#define MULT16_16_P14(a,b) (SHR(ADD32(8192,MULT16_16((a),(b))),14)) +#define MULT16_16_P15(a,b) (SHR(ADD32(16384,MULT16_16((a),(b))),15)) + +#define MUL_16_32_R15(a,bh,bl) ADD32(MULT16_16((a),(bh)), SHR(MULT16_16((a),(bl)),15)) + +#define DIV32_16(a,b) ((spx_word16_t)(((spx_word32_t)(a))/((spx_word16_t)(b)))) +#define PDIV32_16(a,b) ((spx_word16_t)(((spx_word32_t)(a)+((spx_word16_t)(b)>>1))/((spx_word16_t)(b)))) +#define DIV32(a,b) (((spx_word32_t)(a))/((spx_word32_t)(b))) +#define PDIV32(a,b) (((spx_word32_t)(a)+((spx_word16_t)(b)>>1))/((spx_word32_t)(b))) + +#endif diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alsa-plugins-1.0.14rc3/pph/Makefile.am new/alsa-plugins-1.0.14rc4/pph/Makefile.am --- old/alsa-plugins-1.0.14rc3/pph/Makefile.am 2007-02-26 10:21:37.000000000 +0100 +++ new/alsa-plugins-1.0.14rc4/pph/Makefile.am 2007-05-02 13:31:35.000000000 +0200 @@ -2,7 +2,7 @@ asound_module_rate_speexratedir = $(libdir)/alsa-lib -AM_CFLAGS = -DOUTSIDE_SPEEX -Wall -g @ALSA_CFLAGS@ +AM_CFLAGS = -DVAR_ARRAYS -DRANDOM_PREFIX=alsa_lib -DOUTSIDE_SPEEX -Wall -g @ALSA_CFLAGS@ AM_LDFLAGS = -module -avoid-version -export-dynamic libasound_module_rate_speexrate_la_SOURCES = rate_speexrate.c resample.c @@ -16,4 +16,4 @@ uninstall-hook: rm -f $(DESTDIR)$(libdir)/alsa-lib/libasound_module_rate_speexrate_*.so -noinst_HEADERS = speex_resampler.h +noinst_HEADERS = speex_resampler.h arch.h fixed_generic.h diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alsa-plugins-1.0.14rc3/pph/rate_speexrate.c new/alsa-plugins-1.0.14rc4/pph/rate_speexrate.c --- old/alsa-plugins-1.0.14rc3/pph/rate_speexrate.c 2007-02-26 10:21:37.000000000 +0100 +++ new/alsa-plugins-1.0.14rc4/pph/rate_speexrate.c 2007-05-02 13:31:35.000000000 +0200 @@ -42,7 +42,7 @@ static snd_pcm_uframes_t input_frames(void *obj, snd_pcm_uframes_t frames) { - int num, den; + spx_uint32_t num, den; struct rate_src *rate = obj; if (frames == 0) return 0; @@ -52,7 +52,7 @@ static snd_pcm_uframes_t output_frames(void *obj, snd_pcm_uframes_t frames) { - int num, den; + spx_uint32_t num, den; struct rate_src *rate = obj; if (frames == 0) return 0; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alsa-plugins-1.0.14rc3/pph/resample.c new/alsa-plugins-1.0.14rc4/pph/resample.c --- old/alsa-plugins-1.0.14rc3/pph/resample.c 2007-02-26 10:21:37.000000000 +0100 +++ new/alsa-plugins-1.0.14rc4/pph/resample.c 2007-05-02 13:31:35.000000000 +0200 @@ -60,10 +60,12 @@ void *speex_realloc (void *ptr, int size) {return realloc(ptr, size);} void speex_free (void *ptr) {free(ptr);} #include "speex_resampler.h" -#else +#include "arch.h" +#else /* OUTSIDE_SPEEX */ + #include "speex/speex_resampler.h" #include "misc.h" -#endif +#endif /* OUTSIDE_SPEEX */ #include <math.h> @@ -84,33 +86,33 @@ #define IMAX(a,b) ((a) > (b) ? (a) : (b)) -typedef int (*resampler_basic_func)(SpeexResamplerState *, int , const spx_word16_t *, int *, spx_word16_t *, int *); +typedef int (*resampler_basic_func)(SpeexResamplerState *, spx_uint32_t , const spx_word16_t *, spx_uint32_t *, spx_word16_t *, spx_uint32_t *); struct SpeexResamplerState_ { - int in_rate; - int out_rate; - int num_rate; - int den_rate; + spx_uint32_t in_rate; + spx_uint32_t out_rate; + spx_uint32_t num_rate; + spx_uint32_t den_rate; int quality; - int nb_channels; - int filt_len; - int mem_alloc_size; - int int_advance; - int frac_advance; + spx_uint32_t nb_channels; + spx_uint32_t filt_len; + spx_uint32_t mem_alloc_size; + int int_advance; + int frac_advance; float cutoff; - int oversample; - int initialised; - int started; + spx_uint32_t oversample; + int initialised; + int started; /* These are per-channel */ - int *last_sample; - int *samp_frac_num; - int *magic_samples; + spx_int32_t *last_sample; + spx_uint32_t *samp_frac_num; + spx_uint32_t *magic_samples; spx_word16_t *mem; spx_word16_t *sinc_table; - int sinc_table_length; + spx_uint32_t sinc_table_length; resampler_basic_func resampler_ptr; int in_stride; @@ -197,7 +199,7 @@ by the sinusoids/noise just below the Nyquist rate (guaranteed only for up-sampling). */ -const struct QualityMapping quality_map[11] = { +static const struct QualityMapping quality_map[11] = { { 8, 4, 0.830f, 0.860f, KAISER6 }, /* Q0 */ { 16, 4, 0.850f, 0.880f, KAISER6 }, /* Q1 */ { 32, 4, 0.882f, 0.910f, KAISER6 }, /* Q2 */ /* 82.3% cutoff ( ~60 dB stop) 6 */ @@ -302,15 +304,15 @@ } #endif -static int resampler_basic_direct_single(SpeexResamplerState *st, int channel_index, const spx_word16_t *in, int *in_len, spx_word16_t *out, int *out_len) +static int resampler_basic_direct_single(SpeexResamplerState *st, spx_uint32_t channel_index, const spx_word16_t *in, spx_uint32_t *in_len, spx_word16_t *out, spx_uint32_t *out_len) { int N = st->filt_len; int out_sample = 0; spx_word16_t *mem; int last_sample = st->last_sample[channel_index]; - int samp_frac_num = st->samp_frac_num[channel_index]; + spx_uint32_t samp_frac_num = st->samp_frac_num[channel_index]; mem = st->mem + channel_index * st->mem_alloc_size; - while (!(last_sample >= *in_len || out_sample >= *out_len)) + while (!(last_sample >= (spx_int32_t)*in_len || out_sample >= (spx_int32_t)*out_len)) { int j; spx_word32_t sum=0; @@ -350,15 +352,15 @@ #ifdef FIXED_POINT #else /* This is the same as the previous function, except with a double-precision accumulator */ -static int resampler_basic_direct_double(SpeexResamplerState *st, int channel_index, const spx_word16_t *in, int *in_len, spx_word16_t *out, int *out_len) +static int resampler_basic_direct_double(SpeexResamplerState *st, spx_uint32_t channel_index, const spx_word16_t *in, spx_uint32_t *in_len, spx_word16_t *out, spx_uint32_t *out_len) { int N = st->filt_len; int out_sample = 0; spx_word16_t *mem; int last_sample = st->last_sample[channel_index]; - int samp_frac_num = st->samp_frac_num[channel_index]; + spx_uint32_t samp_frac_num = st->samp_frac_num[channel_index]; mem = st->mem + channel_index * st->mem_alloc_size; - while (!(last_sample >= *in_len || out_sample >= *out_len)) + while (!(last_sample >= (spx_int32_t)*in_len || out_sample >= (spx_int32_t)*out_len)) { int j; double sum=0; @@ -396,15 +398,15 @@ } #endif -static int resampler_basic_interpolate_single(SpeexResamplerState *st, int channel_index, const spx_word16_t *in, int *in_len, spx_word16_t *out, int *out_len) +static int resampler_basic_interpolate_single(SpeexResamplerState *st, spx_uint32_t channel_index, const spx_word16_t *in, spx_uint32_t *in_len, spx_word16_t *out, spx_uint32_t *out_len) { int N = st->filt_len; int out_sample = 0; spx_word16_t *mem; int last_sample = st->last_sample[channel_index]; - int samp_frac_num = st->samp_frac_num[channel_index]; + spx_uint32_t samp_frac_num = st->samp_frac_num[channel_index]; mem = st->mem + channel_index * st->mem_alloc_size; - while (!(last_sample >= *in_len || out_sample >= *out_len)) + while (!(last_sample >= (spx_int32_t)*in_len || out_sample >= (spx_int32_t)*out_len)) { int j; spx_word32_t sum=0; @@ -465,15 +467,15 @@ #ifdef FIXED_POINT #else /* This is the same as the previous function, except with a double-precision accumulator */ -static int resampler_basic_interpolate_double(SpeexResamplerState *st, int channel_index, const spx_word16_t *in, int *in_len, spx_word16_t *out, int *out_len) +static int resampler_basic_interpolate_double(SpeexResamplerState *st, spx_uint32_t channel_index, const spx_word16_t *in, spx_uint32_t *in_len, spx_word16_t *out, spx_uint32_t *out_len) { int N = st->filt_len; int out_sample = 0; spx_word16_t *mem; int last_sample = st->last_sample[channel_index]; - int samp_frac_num = st->samp_frac_num[channel_index]; + spx_uint32_t samp_frac_num = st->samp_frac_num[channel_index]; mem = st->mem + channel_index * st->mem_alloc_size; - while (!(last_sample >= *in_len || out_sample >= *out_len)) + while (!(last_sample >= (spx_int32_t)*in_len || out_sample >= (spx_int32_t)*out_len)) { int j; spx_word32_t sum=0; @@ -529,8 +531,7 @@ static void update_filter(SpeexResamplerState *st) { - int i; - int old_length; + spx_uint32_t old_length; old_length = st->filt_len; st->oversample = quality_map[st->quality].oversample; @@ -552,6 +553,7 @@ /* Choose the resampling type that requires the least amount of memory */ if (st->den_rate <= st->oversample) { + spx_uint32_t i; if (!st->sinc_table) st->sinc_table = (spx_word16_t *)speex_alloc(st->filt_len*st->den_rate*sizeof(spx_word16_t)); else if (st->sinc_table_length < st->filt_len*st->den_rate) @@ -561,7 +563,7 @@ } for (i=0;i<st->den_rate;i++) { - int j; + spx_uint32_t j; for (j=0;j<st->filt_len;j++) { st->sinc_table[i*st->filt_len+j] = sinc(st->cutoff,((j-st->filt_len/2+1)-((float)i)/st->den_rate), st->filt_len, quality_map[st->quality].window_func); @@ -577,6 +579,7 @@ #endif /*fprintf (stderr, "resampler uses direct sinc table and normalised cutoff %f\n", cutoff);*/ } else { + spx_int32_t i; if (!st->sinc_table) st->sinc_table = (spx_word16_t *)speex_alloc((st->filt_len*st->oversample+8)*sizeof(spx_word16_t)); else if (st->sinc_table_length < st->filt_len*st->oversample+8) @@ -584,7 +587,7 @@ st->sinc_table = (spx_word16_t *)speex_realloc(st->sinc_table,(st->filt_len*st->oversample+8)*sizeof(spx_word16_t)); st->sinc_table_length = st->filt_len*st->oversample+8; } - for (i=-4;i<st->oversample*st->filt_len+4;i++) + for (i=-4;i<(spx_int32_t)(st->oversample*st->filt_len+4);i++) st->sinc_table[i+4] = sinc(st->cutoff,(i/(float)st->oversample - st->filt_len/2), st->filt_len, quality_map[st->quality].window_func); #ifdef FIXED_POINT st->resampler_ptr = resampler_basic_interpolate_single; @@ -601,6 +604,7 @@ if (!st->mem) { + spx_uint32_t i; st->mem = (spx_word16_t*)speex_alloc(st->nb_channels*(st->filt_len-1) * sizeof(spx_word16_t)); for (i=0;i<st->nb_channels*(st->filt_len-1);i++) st->mem[i] = 0; @@ -608,6 +612,7 @@ /*speex_warning("init filter");*/ } else if (!st->started) { + spx_uint32_t i; st->mem = (spx_word16_t*)speex_realloc(st->mem, st->nb_channels*(st->filt_len-1) * sizeof(spx_word16_t)); for (i=0;i<st->nb_channels*(st->filt_len-1);i++) st->mem[i] = 0; @@ -615,6 +620,7 @@ /*speex_warning("reinit filter");*/ } else if (st->filt_len > old_length) { + spx_uint32_t i; /* Increase the filter length */ /*speex_warning("increase filter size");*/ int old_alloc_size = st->mem_alloc_size; @@ -625,7 +631,7 @@ } for (i=0;i<st->nb_channels;i++) { - int j; + spx_uint32_t j; /* Copy data going backward */ for (j=0;j<old_length-1;j++) st->mem[i*st->mem_alloc_size+(st->filt_len-2-j)] = st->mem[i*old_alloc_size+(old_length-2-j)]; @@ -637,13 +643,14 @@ } } else if (st->filt_len < old_length) { + spx_uint32_t i; /* Reduce filter length, this a bit tricky */ /*speex_warning("decrease filter size (unimplemented)");*/ /* Adjust last_sample (which will likely end up negative) */ /*st->last_sample += (st->filt_len - old_length)/2;*/ for (i=0;i<st->nb_channels;i++) { - int j; + spx_uint32_t j; st->magic_samples[i] = (old_length - st->filt_len)/2; /* Copy data going backward */ for (j=0;j<st->filt_len-1+st->magic_samples[i];j++) @@ -653,14 +660,14 @@ } -SpeexResamplerState *speex_resampler_init(int nb_channels, int in_rate, int out_rate, int quality) +SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels, spx_uint32_t in_rate, spx_uint32_t out_rate, int quality) { return speex_resampler_init_frac(nb_channels, in_rate, out_rate, in_rate, out_rate, quality); } -SpeexResamplerState *speex_resampler_init_frac(int nb_channels, int ratio_num, int ratio_den, int in_rate, int out_rate, int quality) +SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels, spx_uint32_t ratio_num, spx_uint32_t ratio_den, spx_uint32_t in_rate, spx_uint32_t out_rate, int quality) { - int i; + spx_uint32_t i; SpeexResamplerState *st = (SpeexResamplerState *)speex_alloc(sizeof(SpeexResamplerState)); st->initialised = 0; st->started = 0; @@ -681,9 +688,9 @@ st->out_stride = 1; /* Per channel data */ - st->last_sample = (int*)speex_alloc(nb_channels*sizeof(int)); - st->magic_samples = (int*)speex_alloc(nb_channels*sizeof(int)); - st->samp_frac_num = (int*)speex_alloc(nb_channels*sizeof(int)); + st->last_sample = (spx_int32_t*)speex_alloc(nb_channels*sizeof(int)); + st->magic_samples = (spx_uint32_t*)speex_alloc(nb_channels*sizeof(int)); + st->samp_frac_num = (spx_uint32_t*)speex_alloc(nb_channels*sizeof(int)); for (i=0;i<nb_channels;i++) { st->last_sample[i] = 0; @@ -713,21 +720,21 @@ -static void speex_resampler_process_native(SpeexResamplerState *st, int channel_index, const spx_word16_t *in, int *in_len, spx_word16_t *out, int *out_len) +static void speex_resampler_process_native(SpeexResamplerState *st, spx_uint32_t channel_index, const spx_word16_t *in, spx_uint32_t *in_len, spx_word16_t *out, spx_uint32_t *out_len) { int j=0; int N = st->filt_len; int out_sample = 0; spx_word16_t *mem; - int tmp_out_len = 0; + spx_uint32_t tmp_out_len = 0; mem = st->mem + channel_index * st->mem_alloc_size; st->started = 1; /* Handle the case where we have samples left from a reduction in filter length */ if (st->magic_samples[channel_index]) { - int tmp_in_len; - int tmp_magic; + spx_uint32_t tmp_in_len; + spx_uint32_t tmp_magic; tmp_in_len = st->magic_samples[channel_index]; tmp_out_len = *out_len; /* FIXME: Need to handle the case where the out array is too small */ @@ -739,7 +746,7 @@ /* If we couldn't process all "magic" input samples, save the rest for next time */ if (tmp_in_len < tmp_magic) { - int i; + spx_uint32_t i; st->magic_samples[channel_index] = tmp_magic-tmp_in_len; for (i=0;i<st->magic_samples[channel_index];i++) mem[N-1+i]=mem[N-1+i+tmp_in_len]; @@ -750,25 +757,32 @@ /* Call the right resampler through the function ptr */ out_sample = st->resampler_ptr(st, channel_index, in, in_len, out, out_len); - if (st->last_sample[channel_index] < *in_len) + if (st->last_sample[channel_index] < (spx_int32_t)*in_len) *in_len = st->last_sample[channel_index]; *out_len = out_sample+tmp_out_len; st->last_sample[channel_index] -= *in_len; - for (j=0;j<N-1-*in_len;j++) + for (j=0;j<N-1-(spx_int32_t)*in_len;j++) mem[j] = mem[j+*in_len]; for (;j<N-1;j++) mem[j] = in[st->in_stride*(j+*in_len-N+1)]; } +#define FIXED_STACK_ALLOC 1024 + #ifdef FIXED_POINT -void speex_resampler_process_float(SpeexResamplerState *st, int channel_index, const float *in, int *in_len, float *out, int *out_len) +void speex_resampler_process_float(SpeexResamplerState *st, spx_uint32_t channel_index, const float *in, spx_uint32_t *in_len, float *out, spx_uint32_t *out_len) { - int i; + spx_uint32_t i; int istride_save, ostride_save; +#ifdef VAR_ARRAYS spx_word16_t x[*in_len]; spx_word16_t y[*out_len]; + /*VARDECL(spx_word16_t *x); + VARDECL(spx_word16_t *y); + ALLOC(x, *in_len, spx_word16_t); + ALLOC(y, *out_len, spx_word16_t);*/ istride_save = st->in_stride; ostride_save = st->out_stride; for (i=0;i<*in_len;i++) @@ -779,22 +793,58 @@ st->out_stride = ostride_save; for (i=0;i<*out_len;i++) out[i*st->out_stride] = y[i]; +#else + spx_word16_t x[FIXED_STACK_ALLOC]; + spx_word16_t y[FIXED_STACK_ALLOC]; + spx_uint32_t ilen=*in_len, olen=*out_len; + istride_save = st->in_stride; + ostride_save = st->out_stride; + while (ilen && olen) + { + spx_uint32_t ichunk, ochunk; + ichunk = ilen; + ochunk = olen; + if (ichunk>FIXED_STACK_ALLOC) + ichunk=FIXED_STACK_ALLOC; + if (ochunk>FIXED_STACK_ALLOC) + ochunk=FIXED_STACK_ALLOC; + for (i=0;i<ichunk;i++) + x[i] = WORD2INT(in[i*st->in_stride]); + st->in_stride = st->out_stride = 1; + speex_resampler_process_native(st, channel_index, x, &ichunk, y, &ochunk); + st->in_stride = istride_save; + st->out_stride = ostride_save; + for (i=0;i<ochunk;i++) + out[i*st->out_stride] = y[i]; + out += ochunk; + in += ichunk; + ilen -= ichunk; + olen -= ochunk; + } + *in_len -= ilen; + *out_len -= olen; +#endif } -void speex_resampler_process_int(SpeexResamplerState *st, int channel_index, const spx_int16_t *in, int *in_len, spx_int16_t *out, int *out_len) +void speex_resampler_process_int(SpeexResamplerState *st, spx_uint32_t channel_index, const spx_int16_t *in, spx_uint32_t *in_len, spx_int16_t *out, spx_uint32_t *out_len) { speex_resampler_process_native(st, channel_index, in, in_len, out, out_len); } #else -void speex_resampler_process_float(SpeexResamplerState *st, int channel_index, const float *in, int *in_len, float *out, int *out_len) +void speex_resampler_process_float(SpeexResamplerState *st, spx_uint32_t channel_index, const float *in, spx_uint32_t *in_len, float *out, spx_uint32_t *out_len) { speex_resampler_process_native(st, channel_index, in, in_len, out, out_len); } -void speex_resampler_process_int(SpeexResamplerState *st, int channel_index, const spx_int16_t *in, int *in_len, spx_int16_t *out, int *out_len) +void speex_resampler_process_int(SpeexResamplerState *st, spx_uint32_t channel_index, const spx_int16_t *in, spx_uint32_t *in_len, spx_int16_t *out, spx_uint32_t *out_len) { - int i; + spx_uint32_t i; int istride_save, ostride_save; +#ifdef VAR_ARRAYS spx_word16_t x[*in_len]; spx_word16_t y[*out_len]; + /*VARDECL(spx_word16_t *x); + VARDECL(spx_word16_t *y); + ALLOC(x, *in_len, spx_word16_t); + ALLOC(y, *out_len, spx_word16_t);*/ istride_save = st->in_stride; ostride_save = st->out_stride; for (i=0;i<*in_len;i++) @@ -805,12 +855,43 @@ st->out_stride = ostride_save; for (i=0;i<*out_len;i++) out[i*st->out_stride] = WORD2INT(y[i]); +#else + spx_word16_t x[FIXED_STACK_ALLOC]; + spx_word16_t y[FIXED_STACK_ALLOC]; + spx_uint32_t ilen=*in_len, olen=*out_len; + istride_save = st->in_stride; + ostride_save = st->out_stride; + while (ilen && olen) + { + spx_uint32_t ichunk, ochunk; + ichunk = ilen; + ochunk = olen; + if (ichunk>FIXED_STACK_ALLOC) + ichunk=FIXED_STACK_ALLOC; + if (ochunk>FIXED_STACK_ALLOC) + ochunk=FIXED_STACK_ALLOC; + for (i=0;i<ichunk;i++) + x[i] = in[i*st->in_stride]; + st->in_stride = st->out_stride = 1; + speex_resampler_process_native(st, channel_index, x, &ichunk, y, &ochunk); + st->in_stride = istride_save; + st->out_stride = ostride_save; + for (i=0;i<ochunk;i++) + out[i*st->out_stride] = WORD2INT(y[i]); + out += ochunk; + in += ichunk; + ilen -= ichunk; + olen -= ochunk; + } + *in_len -= ilen; + *out_len -= olen; +#endif } #endif -void speex_resampler_process_interleaved_float(SpeexResamplerState *st, const float *in, int *in_len, float *out, int *out_len) +void speex_resampler_process_interleaved_float(SpeexResamplerState *st, const float *in, spx_uint32_t *in_len, float *out, spx_uint32_t *out_len) { - int i; + spx_uint32_t i; int istride_save, ostride_save; istride_save = st->in_stride; ostride_save = st->out_stride; @@ -823,9 +904,9 @@ st->out_stride = ostride_save; } -void speex_resampler_process_interleaved_int(SpeexResamplerState *st, const spx_int16_t *in, int *in_len, spx_int16_t *out, int *out_len) +void speex_resampler_process_interleaved_int(SpeexResamplerState *st, const spx_int16_t *in, spx_uint32_t *in_len, spx_int16_t *out, spx_uint32_t *out_len) { - int i; + spx_uint32_t i; int istride_save, ostride_save; istride_save = st->in_stride; ostride_save = st->out_stride; @@ -838,18 +919,18 @@ st->out_stride = ostride_save; } -void speex_resampler_set_rate(SpeexResamplerState *st, int in_rate, int out_rate) +void speex_resampler_set_rate(SpeexResamplerState *st, spx_uint32_t in_rate, spx_uint32_t out_rate) { speex_resampler_set_rate_frac(st, in_rate, out_rate, in_rate, out_rate); } -void speex_resampler_get_rate(SpeexResamplerState *st, int *in_rate, int *out_rate) +void speex_resampler_get_rate(SpeexResamplerState *st, spx_uint32_t *in_rate, spx_uint32_t *out_rate) { *in_rate = st->in_rate; *out_rate = st->out_rate; } -void speex_resampler_set_rate_frac(SpeexResamplerState *st, int ratio_num, int ratio_den, int in_rate, int out_rate) +void speex_resampler_set_rate_frac(SpeexResamplerState *st, spx_uint32_t ratio_num, spx_uint32_t ratio_den, spx_uint32_t in_rate, spx_uint32_t out_rate) { int fact; if (st->in_rate == in_rate && st->out_rate == out_rate && st->num_rate == ratio_num && st->den_rate == ratio_den) @@ -873,7 +954,7 @@ update_filter(st); } -void speex_resampler_get_ratio(SpeexResamplerState *st, int *ratio_num, int *ratio_den) +void speex_resampler_get_ratio(SpeexResamplerState *st, spx_uint32_t *ratio_num, spx_uint32_t *ratio_den) { *ratio_num = st->num_rate; *ratio_den = st->den_rate; @@ -897,36 +978,36 @@ *quality = st->quality; } -void speex_resampler_set_input_stride(SpeexResamplerState *st, int stride) +void speex_resampler_set_input_stride(SpeexResamplerState *st, spx_uint32_t stride) { st->in_stride = stride; } -void speex_resampler_get_input_stride(SpeexResamplerState *st, int *stride) +void speex_resampler_get_input_stride(SpeexResamplerState *st, spx_uint32_t *stride) { *stride = st->in_stride; } -void speex_resampler_set_output_stride(SpeexResamplerState *st, int stride) +void speex_resampler_set_output_stride(SpeexResamplerState *st, spx_uint32_t stride) { st->out_stride = stride; } -void speex_resampler_get_output_stride(SpeexResamplerState *st, int *stride) +void speex_resampler_get_output_stride(SpeexResamplerState *st, spx_uint32_t *stride) { *stride = st->out_stride; } void speex_resampler_skip_zeros(SpeexResamplerState *st) { - int i; + spx_uint32_t i; for (i=0;i<st->nb_channels;i++) st->last_sample[i] = st->filt_len/2; } void speex_resampler_reset_mem(SpeexResamplerState *st) { - int i; + spx_uint32_t i; for (i=0;i<st->nb_channels*(st->filt_len-1);i++) st->mem[i] = 0; } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alsa-plugins-1.0.14rc3/pph/speex_resampler.h new/alsa-plugins-1.0.14rc4/pph/speex_resampler.h --- old/alsa-plugins-1.0.14rc3/pph/speex_resampler.h 2007-02-26 10:21:37.000000000 +0100 +++ new/alsa-plugins-1.0.14rc4/pph/speex_resampler.h 2007-05-02 13:31:35.000000000 +0200 @@ -46,7 +46,7 @@ /* If the resampler is defined outside of Speex, we change the symbol names so that there won't be any clash if linking with Speex later on. */ -#define RANDOM_PREFIX ALSA_PUBLIC_PARROT_HACK_PLUGIN +/* #define RANDOM_PREFIX your software name here */ #ifndef RANDOM_PREFIX #error "Please define RANDOM_PREFIX (above) to something specific to your project to prevent symbol name clashes" #endif @@ -75,10 +75,15 @@ #define speex_resampler_reset_mem CAT_PREFIX(RANDOM_PREFIX,_resampler_reset_mem) #define spx_int16_t short +#define spx_int32_t int +#define spx_uint16_t unsigned short +#define spx_uint32_t unsigned int +#if 0 #ifdef FIXED_POINT -#define spx_word16_t short -#define spx_word32_t int +/*#define spx_word16_t spx_int16_t +#define spx_word32_t spx_int32_t*/ +#include "arch.h" #else /* FIXED_POINT */ @@ -88,7 +93,8 @@ #define MULT16_32_Q15(a,b) ((a)*(b)) #define PSHR32(a,b) (a) #endif /* FIXED_POINT */ - +#endif + #else /* OUTSIDE_SPEEX */ #include "speex/speex_types.h" @@ -117,9 +123,9 @@ * @return Newly created resampler state * @retval NULL Error: not enough memory */ -SpeexResamplerState *speex_resampler_init(int nb_channels, - int in_rate, - int out_rate, +SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels, + spx_uint32_t in_rate, + spx_uint32_t out_rate, int quality); /** Create a new resampler with fractional input/output rates. The sampling @@ -135,11 +141,11 @@ * @return Newly created resampler state * @retval NULL Error: not enough memory */ -SpeexResamplerState *speex_resampler_init_frac(int nb_channels, - int ratio_num, - int ratio_den, - int in_rate, - int out_rate, +SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels, + spx_uint32_t ratio_num, + spx_uint32_t ratio_den, + spx_uint32_t in_rate, + spx_uint32_t out_rate, int quality); /** Destroy a resampler state. @@ -158,11 +164,11 @@ * @param out_len Size of the output buffer. Returns the number of samples written */ void speex_resampler_process_float(SpeexResamplerState *st, - int channel_index, + spx_uint32_t channel_index, const float *in, - int *in_len, + spx_uint32_t *in_len, float *out, - int *out_len); + spx_uint32_t *out_len); /** Resample an int array. The input and output buffers must *not* overlap. * @param st Resampler state @@ -175,11 +181,11 @@ * @param out_len Size of the output buffer. Returns the number of samples written */ void speex_resampler_process_int(SpeexResamplerState *st, - int channel_index, + spx_uint32_t channel_index, const spx_int16_t *in, - int *in_len, + spx_uint32_t *in_len, spx_int16_t *out, - int *out_len); + spx_uint32_t *out_len); /** Resample an interleaved float array. The input and output buffers must *not* overlap. * @param st Resampler state @@ -192,9 +198,9 @@ */ void speex_resampler_process_interleaved_float(SpeexResamplerState *st, const float *in, - int *in_len, + spx_uint32_t *in_len, float *out, - int *out_len); + spx_uint32_t *out_len); /** Resample an interleaved int array. The input and output buffers must *not* overlap. * @param st Resampler state @@ -207,9 +213,9 @@ */ void speex_resampler_process_interleaved_int(SpeexResamplerState *st, const spx_int16_t *in, - int *in_len, + spx_uint32_t *in_len, spx_int16_t *out, - int *out_len); + spx_uint32_t *out_len); /** Set (change) the input/output sampling rates (integer value). * @param st Resampler state @@ -217,8 +223,8 @@ * @param out_rate Output sampling rate (integer number of Hz). */ void speex_resampler_set_rate(SpeexResamplerState *st, - int in_rate, - int out_rate); + spx_uint32_t in_rate, + spx_uint32_t out_rate); /** Get the current input/output sampling rates (integer value). * @param st Resampler state @@ -226,8 +232,8 @@ * @param out_rate Output sampling rate (integer number of Hz) copied. */ void speex_resampler_get_rate(SpeexResamplerState *st, - int *in_rate, - int *out_rate); + spx_uint32_t *in_rate, + spx_uint32_t *out_rate); /** Set (change) the input/output sampling rates and resampling ratio * (fractional values in Hz supported). @@ -238,10 +244,10 @@ * @param out_rate Output sampling rate rounded to the nearest integer (in Hz). */ void speex_resampler_set_rate_frac(SpeexResamplerState *st, - int ratio_num, - int ratio_den, - int in_rate, - int out_rate); + spx_uint32_t ratio_num, + spx_uint32_t ratio_den, + spx_uint32_t in_rate, + spx_uint32_t out_rate); /** Get the current resampling ratio. This will be reduced to the least * common denominator. @@ -250,8 +256,8 @@ * @param ratio_den Denominator of the sampling rate ratio copied */ void speex_resampler_get_ratio(SpeexResamplerState *st, - int *ratio_num, - int *ratio_den); + spx_uint32_t *ratio_num, + spx_uint32_t *ratio_den); /** Set (change) the conversion quality. * @param st Resampler state @@ -274,28 +280,28 @@ * @param stride Input stride */ void speex_resampler_set_input_stride(SpeexResamplerState *st, - int stride); + spx_uint32_t stride); /** Get the input stride. * @param st Resampler state * @param stride Input stride copied */ void speex_resampler_get_input_stride(SpeexResamplerState *st, - int *stride); + spx_uint32_t *stride); /** Set (change) the output stride. * @param st Resampler state * @param stride Output stride */ void speex_resample_set_output_stride(SpeexResamplerState *st, - int stride); + spx_uint32_t stride); /** Get the output stride. * @param st Resampler state copied * @param stride Output stride */ void speex_resample_get_output_stride(SpeexResamplerState *st, - int *stride); + spx_uint32_t *stride); /** Make sure that the first samples to go out of the resamplers don't have * leading zeros. This is only useful before starting to use a newly created diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alsa-plugins-1.0.14rc3/pulse/pcm_pulse.c new/alsa-plugins-1.0.14rc4/pulse/pcm_pulse.c --- old/alsa-plugins-1.0.14rc3/pulse/pcm_pulse.c 2007-02-26 10:21:37.000000000 +0100 +++ new/alsa-plugins-1.0.14rc4/pulse/pcm_pulse.c 2007-05-02 13:31:35.000000000 +0200 @@ -643,23 +643,8 @@ if (err < 0) return err; - err = snd_pcm_ioplug_set_param_minmax(io, SND_PCM_IOPLUG_HW_RATE, - 8000, 48000); - if (err < 0) - return err; - - err = snd_pcm_ioplug_set_param_minmax(io, SND_PCM_IOPLUG_HW_PERIOD_BYTES, - 1, 4294967295U); - if (err < 0) - return err; - - err = snd_pcm_ioplug_set_param_minmax(io, SND_PCM_IOPLUG_HW_PERIODS, - 2, 4294967295U); - if (err < 0) - return err; - err = snd_pcm_ioplug_set_param_minmax(io, SND_PCM_IOPLUG_HW_BUFFER_BYTES, - 1, 4294967295U); + 1, 4 * 1024 * 1024); if (err < 0) return err; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alsa-plugins-1.0.14rc3/rate-lavc/gcd.h new/alsa-plugins-1.0.14rc4/rate-lavc/gcd.h --- old/alsa-plugins-1.0.14rc3/rate-lavc/gcd.h 1970-01-01 01:00:00.000000000 +0100 +++ new/alsa-plugins-1.0.14rc4/rate-lavc/gcd.h 2007-05-02 13:31:35.000000000 +0200 @@ -0,0 +1,56 @@ +/* + * Fast implementation of greatest common divisor using the binary algorithm. + * Copyright (c) 2007 Nicholas Kain + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/* computes gcd using binary algorithm */ +static int gcd(int a, int b) +{ + int s,d; + + if (!a || !b) + return a | b; + + for (s=0; ((a|b)&1) == 0; ++s) { + a >>= 1; + b >>= 1; + } + + while ((a&1) == 0) + a >>= 1; + + do { + while ((b&1) == 0) { + b >>= 1; + } + if (a<b) { + b -= a; + } else { + d = a-b; + a = b; + b = d; + } + b >>= 1; + } while (b); + + return a << s; +} + diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alsa-plugins-1.0.14rc3/rate-lavc/Makefile.am new/alsa-plugins-1.0.14rc4/rate-lavc/Makefile.am --- old/alsa-plugins-1.0.14rc3/rate-lavc/Makefile.am 2007-02-26 10:21:37.000000000 +0100 +++ new/alsa-plugins-1.0.14rc4/rate-lavc/Makefile.am 2007-05-02 13:31:35.000000000 +0200 @@ -8,6 +8,8 @@ libasound_module_rate_lavcrate_la_SOURCES = rate_lavcrate.c libasound_module_rate_lavcrate_la_LIBADD = @ALSA_LIBS@ @AVCODEC_LIBS@ +noinst_HEADERS = gcd.h + install-exec-hook: rm -f $(DESTDIR)$(libdir)/alsa-lib/libasound_module_rate_lavcrate_*.so $(LN_S) libasound_module_rate_lavcrate.so $(DESTDIR)$(libdir)/alsa-lib/libasound_module_rate_lavcrate_higher.so diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/alsa-plugins-1.0.14rc3/version new/alsa-plugins-1.0.14rc4/version --- old/alsa-plugins-1.0.14rc3/version 2007-02-26 10:23:17.000000000 +0100 +++ new/alsa-plugins-1.0.14rc4/version 2007-05-02 13:31:53.000000000 +0200 @@ -1 +1 @@ -1.0.14rc3 +1.0.14rc4 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de