From 540715f94ce641f644235b2f3e786c5ec0f4fe55 Mon Sep 17 00:00:00 2001 From: smorlat Date: Mon, 13 Jul 2009 09:28:16 +0000 Subject: [PATCH] update README.mingw work in progress in equalizer. git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@531 3f6dc0c8-ddfe-455d-9043-3cd528dc4637 --- linphone/README.mingw | 46 +++++++++++++++++-------- linphone/mediastreamer2/src/equalizer.c | 39 +++++++++++++++++++-- 2 files changed, 69 insertions(+), 16 deletions(-) diff --git a/linphone/README.mingw b/linphone/README.mingw index 08afc7bda..af854de5f 100644 --- a/linphone/README.mingw +++ b/linphone/README.mingw @@ -1,18 +1,26 @@ Software to install +******************* + * mingw32 * msys * automake*/autoconf*/libtool , uncompress in / * gcc-part-core-4.3 gcc-part-c++-4.3, uncompress in /mingw -* download unzip for mingw - -* gtk+bundle, uncompress in /usr/local -* libglade and libglade-dev >=2.6.3 from gnome ftp, uncompress in /usr/local -* download and install ActiveState perl -* linphone-deps from linphone website, uncompress in /usr/local -* install zip and unzip from http://www.info-zip.org/Zip.html#Downloads +* download unzip from mingw downloads, uncompress in /mingw +* install zip from http://www.info-zip.org/Zip.html#Downloads (quicklink: ftp://ftp.dante.de/tex-archive/tools/zip/info-zip/WIN32/zip232xN.zip), and extract zip.exe to c:\msys\1.0\usr\local\bin +* gtk+bundle from http://www.gtk.org , uncompress in /usr/local +* libglade and libglade-dev >=2.6.3 from gnome ftp: + http://ftp.gnome.org/pub/GNOME/binaries/win32/libglade/2.6/libglade-dev_2.6.3-1_win32.zip + http://ftp.gnome.org/pub/GNOME/binaries/win32/libglade/2.6/libglade_2.6.3-1_win32.zip + uncompress in /usr/local +* download ActiveState perl and run the installer with default options. +* download lastest linphone-deps from linphone downloads, misc directory: + http://download.savannah.gnu.org/releases-noredirect/linphone/misc/) + uncompress in /usr/local + + Building ******** @@ -42,7 +50,7 @@ make #make a binary zip of this plugin make zip -cd coreapi/plugins/buddyloolup +cd coreapi/plugins/buddylookup ./autogen.sh PKG_CONFIG_PATH=/opt/linphone/lib/pkgconfig ./configure --prefix=/opt/linphone --enable-shared --disable-static make @@ -53,6 +61,12 @@ make zip ****************************************************** * Notes about linphone-deps generation * ****************************************************** + +Linphone-deps is a collection of linphone dependencies, that are for some of them difficult +to find as windows binaries. +These notes are useful if you want to upgrade part of the software that is included in the +linphone-deps packages. + List of software included in linphone-deps: libosip2 (compiled) libeXosip2 (compiled) @@ -67,10 +81,14 @@ libxml2 (compiled) libsoup (compiled) -- build ffmpeg -./configure --enable-shared --disable-static --enable-memalign-hack --extra-cflags="-fno-common" --enable-gpl && make -make install DESTDIR=/c/output/ -Copy to linphone-deps/ -Copy also all *.dll.a files from the build tree to lib/ directort of linphone-deps. These are the implibs necessary to link a program against the dlls. -- build libxml2: the binaries found on the internet are generated with MSVC++, and for obscure reason they are not suitable for building libsoup (that requires libxml2). +- building ffmpeg + ./configure --enable-shared --disable-static --enable-memalign-hack --extra-cflags="-fno-common" --enable-gpl && make + make install DESTDIR=/c/output/ + Copy to linphone-deps/ + Copy also all *.dll.a files from the build tree to lib/ directort of linphone-deps. These are the implibs necessary to link a program against the dlls. + +- building libxml2: the binaries found on the internet are generated with MSVC++, and for obscure reason they are not suitable for building libsoup + (that requires libxml2). + ./configure --enable-shared --disable-static && make && make install DESTDIR=/c/output + diff --git a/linphone/mediastreamer2/src/equalizer.c b/linphone/mediastreamer2/src/equalizer.c index 341b4e4ff..4a585f83b 100644 --- a/linphone/mediastreamer2/src/equalizer.c +++ b/linphone/mediastreamer2/src/equalizer.c @@ -18,6 +18,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include +#include + +#define GAIN_ZERODB 22000 typedef struct _EqualizerState{ @@ -28,11 +31,19 @@ typedef struct _EqualizerState{ int16_t *fir; } EqualizerState; -static EqualizerState * equalizer_state_new(){ +static void equalizer_flatten(EqualizerState *s){ + int i; + for(i=0;infft;i+=2) + s->fft_cpx[i]=GAIN_ZERODB; +} + +static EqualizerState * equalizer_state_new(int nfft){ EqualizerState *s=ms_new0(EqualizerState,1); + int i; s->rate=8000; - s->nfft=128; + s->nfft=nfft; s->fft_cpx=ms_new0(int16_t,s->nfft); + equalizer_flatten(s); s->fir_len=s->nfft; s->fir=ms_new(int16_t,s->fir_len); } @@ -83,3 +94,27 @@ static int16_t equalizer_set(EqualizerState *s, int freqhz, float gain){ s->fft_cpx[i*2]=gain_int16(gain); } } + +static void dump_table(int16_t *t, int len){ + int i; + for(i=0;infft); + ms_ifft(fft_handle,s->fft_cpx,s->fir); + ms_message("Inverse fft result:"); + dump_table(s->fir,s->fir_len); + apodize(s->fir,s->fir_len); +} +