Update of /cvsroot/pure-data/externals/iem/iem_bin_ambi/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28972/iem/iem_bin_ambi/src
Modified Files: bin_ambi_calc_HRTF.c bin_ambi_reduced_decode.c bin_ambi_reduced_decode2.c bin_ambi_reduced_decode_fft.c bin_ambi_reduced_decode_fft2.c bin_ambi_reduced_decode_fir.c bin_ambi_reduced_decode_fir2.c iem_bin_ambi.c iemlib.h Added Files: makefile_linux Log Message: changed float to t_float -fno-strict-aliasing #pragma obsolete
Index: bin_ambi_reduced_decode_fft2.c =================================================================== RCS file: /cvsroot/pure-data/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode_fft2.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** bin_ambi_reduced_decode_fft2.c 9 Mar 2006 15:56:05 -0000 1.1 --- bin_ambi_reduced_decode_fft2.c 28 Nov 2006 18:56:01 -0000 1.2 *************** *** 4,12 **** iem_bin_ambi written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005 */
- #ifdef NT - #pragma warning( disable : 4244 ) - #pragma warning( disable : 4305 ) - #endif -
#include "m_pd.h" --- 4,7 ---- [...2715 lines suppressed...] Reihenfolge: ! n_re_ls x bin_ambi_reduced_decode_fft2_real_ls
+ n_im_ls x bin_ambi_reduced_decode_fft2_pht_ls + + n_re_ls x bin_ambi_reduced_decode_fft2_load_HRIR + + 1 x bin_ambi_reduced_decode_fft2_calc_pinv + + n_mir x bin_ambi_reduced_decode_fft2_ipht_ireal_muladd + + n_re_ls x bin_ambi_reduced_decode_fft2_check_HRIR_arrays + + n_ambi x bin_ambi_reduced_decode_fft2_check_HRTF_arrays + + n_ambi x bin_ambi_reduced_decode_fft2_calc_reduced + + bin_ambi_reduced_decode_fft2_calc_sym + */
Index: bin_ambi_reduced_decode_fir2.c =================================================================== RCS file: /cvsroot/pure-data/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode_fir2.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** bin_ambi_reduced_decode_fir2.c 9 Mar 2006 15:56:05 -0000 1.1 --- bin_ambi_reduced_decode_fir2.c 28 Nov 2006 18:56:01 -0000 1.2 *************** *** 4,13 **** iem_bin_ambi written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005 */
- #ifdef NT - #pragma warning( disable : 4244 ) - #pragma warning( disable : 4305 ) - #endif - - #include "m_pd.h" #include "iemlib.h" --- 4,7 ---- *************** *** 58,64 **** int *x_phi_sym; int *x_sym_flag; ! float *x_beg_fade_out_hrir; ! float *x_beg_hrir; ! float **x_beg_hrir_red; t_symbol **x_hrir_filename; t_symbol **x_s_hrir; --- 52,58 ---- int *x_phi_sym; int *x_sym_flag; ! t_float *x_beg_fade_out_hrir; ! t_float *x_beg_hrir; ! t_float **x_beg_hrir_red; t_symbol **x_hrir_filename; t_symbol **x_s_hrir; *************** *** 589,593 **** if(nz < 0) { ! post("bin_ambi_reduced_decode_fir2 ERROR: matrix not regular !!!!"); x->x_seq_ok = 0; return; --- 583,587 ---- if(nz < 0) { ! post("bin_ambi_reduced_decode_fir2 ERROR: matrix singular !!!!"); x->x_seq_ok = 0; return; *************** *** 623,627 **** }
! post("matrix_inverse regular"); x->x_seq_ok = 1; } --- 617,621 ---- }
! post("matrix_inverse nonsingular"); x->x_seq_ok = 1; } *************** *** 670,674 **** double *dv3=x->x_prod3; double *dv2=x->x_prod2; ! float mw;
if(argc < 3) --- 664,668 ---- double *dv3=x->x_prod3; double *dv2=x->x_prod2; ! t_float mw;
if(argc < 3) *************** *** 722,726 **** }
! static void bin_ambi_reduced_decode_fir2_check_HRIR_arrays(t_bin_ambi_reduced_decode_fir2 *x, float findex) { int index=(int)findex - 1; --- 716,720 ---- }
! static void bin_ambi_reduced_decode_fir2_check_HRIR_arrays(t_bin_ambi_reduced_decode_fir2 *x, t_floatarg findex) { int index=(int)findex - 1; *************** *** 731,735 **** t_symbol *hrir; t_float *vec_hrir, *vec, *vec_fade_out_hrir; ! float decr, sum;
if(index < 0) --- 725,729 ---- t_symbol *hrir; t_float *vec_hrir, *vec, *vec_fade_out_hrir; ! t_float decr, sum;
if(index < 0) *************** *** 766,770 **** vec[j] = vec_hrir[j]; sum = 1.0f; ! decr = 4.0f / (float)firsize; for(j=n, k=0; j<firsize; j++, k++) { --- 760,764 ---- vec[j] = vec_hrir[j]; sum = 1.0f; ! decr = 4.0f / (t_float)firsize; for(j=n, k=0; j<firsize; j++, k++) { *************** *** 776,780 **** }
! static void bin_ambi_reduced_decode_fir2_check_HRIR_RED_arrays(t_bin_ambi_reduced_decode_fir2 *x, float findex) { int index=(int)findex - 1; --- 770,774 ---- }
! static void bin_ambi_reduced_decode_fir2_check_HRIR_RED_arrays(t_bin_ambi_reduced_decode_fir2 *x, t_floatarg findex) { int index=(int)findex - 1; *************** *** 804,808 **** }
! static void bin_ambi_reduced_decode_fir2_calc_reduced(t_bin_ambi_reduced_decode_fir2 *x, float findex) { int index=(int)findex - 1; --- 798,802 ---- }
! static void bin_ambi_reduced_decode_fir2_calc_reduced(t_bin_ambi_reduced_decode_fir2 *x, t_floatarg findex) { int index=(int)findex - 1; *************** *** 813,817 **** int n_ambi = x->x_n_ambi; int n_ls = x->x_n_real_ls; ! float mul;
if(x->x_seq_ok) --- 807,811 ---- int n_ambi = x->x_n_ambi; int n_ls = x->x_n_real_ls; ! t_float mul;
if(x->x_seq_ok) *************** *** 825,829 ****
dv = x->x_prod3 + index; ! mul = (float)(*dv); vec_hrir = x->x_beg_hrir; for(i=0; i<firsize; i++)/*first step of acumulating the HRIRs*/ --- 819,823 ----
dv = x->x_prod3 + index; ! mul = (t_float)(*dv); vec_hrir = x->x_beg_hrir; for(i=0; i<firsize; i++)/*first step of acumulating the HRIRs*/ *************** *** 835,841 **** { dv += n_ambi; ! mul = (float)(*dv); vec_hrir = x->x_beg_hrir; vec_hrir += j * firsize; for(i=0; i<firsize; i++) { --- 829,836 ---- { dv += n_ambi; ! mul = (t_float)(*dv); vec_hrir = x->x_beg_hrir; vec_hrir += j * firsize; + for(i=0; i<firsize; i++) { *************** *** 967,971 **** else if(plus_minus[i] == '-') SETFLOAT(x->x_at, 2.0f); ! SETFLOAT(x->x_at+1, (float)(i+1)); outlet_list(x->x_out_sign_sum, &s_list, 2, x->x_at); } --- 962,966 ---- else if(plus_minus[i] == '-') SETFLOAT(x->x_at, 2.0f); ! SETFLOAT(x->x_at+1, (t_float)(i+1)); outlet_list(x->x_out_sign_sum, &s_list, 2, x->x_at); } *************** *** 1041,1046 **** freebytes(x->x_sym_flag, x->x_n_real_ls * sizeof(int));
! freebytes(x->x_beg_hrir, x->x_firsize * x->x_n_real_ls * sizeof(float)); ! freebytes(x->x_beg_hrir_red, x->x_n_ambi * sizeof(float *)); }
--- 1036,1041 ---- freebytes(x->x_sym_flag, x->x_n_real_ls * sizeof(int));
! freebytes(x->x_beg_hrir, x->x_firsize * x->x_n_real_ls * sizeof(t_float)); ! freebytes(x->x_beg_hrir_red, x->x_n_ambi * sizeof(t_float *)); }
*************** *** 1191,1197 **** x->x_sym_flag = (int *)getbytes(x->x_n_real_ls * sizeof(int));
! x->x_beg_fade_out_hrir = (float *)0; ! x->x_beg_hrir = (float *)getbytes(x->x_firsize * x->x_n_real_ls * sizeof(float)); ! x->x_beg_hrir_red = (float **)getbytes(x->x_n_ambi * sizeof(float *));
x->x_sqrt3 = sqrt(3.0); --- 1186,1192 ---- x->x_sym_flag = (int *)getbytes(x->x_n_real_ls * sizeof(int));
! x->x_beg_fade_out_hrir = (t_float *)0; ! x->x_beg_hrir = (t_float *)getbytes(x->x_firsize * x->x_n_real_ls * sizeof(t_float)); ! x->x_beg_hrir_red = (t_float **)getbytes(x->x_n_ambi * sizeof(t_float *));
x->x_sqrt3 = sqrt(3.0);
--- NEW FILE: makefile_linux --- current: all
.SUFFIXES: .pd_linux
INCLUDE = -I. -I/usr/local/src/pd/src
LDFLAGS = -export-dynamic -shared LIB = -ldl -lm -lpthread
#select either the DBG and OPT compiler flags below:
CFLAGS = -DPD -DUNIX -W -Werror -Wno-unused \ -Wno-parentheses -Wno-switch -O6 -funroll-loops -fomit-frame-pointer -fno-strict-aliasing \ -DDL_OPEN
SYSTEM = $(shell uname -m)
# the sources
SRC = bin_ambi_calc_HRTF.c \ bin_ambi_reduced_decode2.c \ bin_ambi_reduced_decode.c \ bin_ambi_reduced_decode_fft2.c \ bin_ambi_reduced_decode_fft.c \ bin_ambi_reduced_decode_fir2.c \ bin_ambi_reduced_decode_fir.c \ iem_bin_ambi.c
TARGET = iem_bin_ambi.pd_linux
OBJ = $(SRC:.c=.o)
# # ------------------ targets ------------------------------------ #
clean: rm $(TARGET) rm *.o
all: $(OBJ) @echo :: $(OBJ) $(LD) $(LDFLAGS) -o $(TARGET) *.o $(LIB) strip --strip-unneeded $(TARGET)
$(OBJ) : %.o : %.c $(CC) $(CFLAGS) $(INCLUDE) -c -o $*.o $*.c
Index: iem_bin_ambi.c =================================================================== RCS file: /cvsroot/pure-data/externals/iem/iem_bin_ambi/src/iem_bin_ambi.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** iem_bin_ambi.c 9 Mar 2006 15:56:05 -0000 1.3 --- iem_bin_ambi.c 28 Nov 2006 18:56:01 -0000 1.4 *************** *** 4,12 **** iem_bin_ambi written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005 */
- #ifdef NT - #pragma warning( disable : 4244 ) - #pragma warning( disable : 4305 ) - #endif -
#include "m_pd.h" --- 4,7 ----
Index: bin_ambi_calc_HRTF.c =================================================================== RCS file: /cvsroot/pure-data/externals/iem/iem_bin_ambi/src/bin_ambi_calc_HRTF.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** bin_ambi_calc_HRTF.c 9 Mar 2006 15:56:05 -0000 1.2 --- bin_ambi_calc_HRTF.c 28 Nov 2006 18:56:01 -0000 1.3 *************** *** 4,13 **** iem_bin_ambi written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005 */
- #ifdef NT - #pragma warning( disable : 4244 ) - #pragma warning( disable : 4305 ) - #endif - - #include "m_pd.h" #include "iemlib.h" --- 4,7 ---- *************** *** 15,19 **** #include <math.h> #include <stdio.h> - #include <string.h>
--- 9,12 ----
Index: bin_ambi_reduced_decode2.c =================================================================== RCS file: /cvsroot/pure-data/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode2.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** bin_ambi_reduced_decode2.c 9 Mar 2006 15:56:05 -0000 1.1 --- bin_ambi_reduced_decode2.c 28 Nov 2006 18:56:01 -0000 1.2 *************** *** 4,13 **** iem_bin_ambi written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005 */
- #ifdef NT - #pragma warning( disable : 4244 ) - #pragma warning( disable : 4305 ) - #endif - - #include "m_pd.h" #include "iemlib.h" --- 4,7 ----
Index: iemlib.h =================================================================== RCS file: /cvsroot/pure-data/externals/iem/iem_bin_ambi/src/iemlib.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** iemlib.h 9 Mar 2006 15:56:05 -0000 1.2 --- iemlib.h 28 Nov 2006 18:56:01 -0000 1.3 *************** *** 2,6 **** * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
! iemlib.h written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005 */
#ifndef __IEMLIB_H__ --- 2,6 ---- * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
! iemlib written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005 */
#ifndef __IEMLIB_H__ *************** *** 96,102 **** --- 96,108 ---- };
+ #ifdef __i386__ #define IEM_DENORMAL(f) ((((*(unsigned int*)&(f))&0x60000000)==0) || \ (((*(unsigned int*)&(f))&0x60000000)==0x60000000)) /* more stringent test: anything not between 1e-19 and 1e19 in absolute val */ + #else + + #define IEM_DENORMAL(f) 0 + + #endif
#endif
Index: bin_ambi_reduced_decode_fir.c =================================================================== RCS file: /cvsroot/pure-data/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode_fir.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** bin_ambi_reduced_decode_fir.c 9 Mar 2006 15:56:05 -0000 1.1 --- bin_ambi_reduced_decode_fir.c 28 Nov 2006 18:56:01 -0000 1.2 *************** *** 4,13 **** iem_bin_ambi written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005 */
- #ifdef NT - #pragma warning( disable : 4244 ) - #pragma warning( disable : 4305 ) - #endif - - #include "m_pd.h" #include "iemlib.h" --- 4,7 ----
Index: bin_ambi_reduced_decode_fft.c =================================================================== RCS file: /cvsroot/pure-data/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode_fft.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** bin_ambi_reduced_decode_fft.c 9 Mar 2006 15:56:05 -0000 1.1 --- bin_ambi_reduced_decode_fft.c 28 Nov 2006 18:56:01 -0000 1.2 *************** *** 4,13 **** iem_bin_ambi written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005 */
- #ifdef NT - #pragma warning( disable : 4244 ) - #pragma warning( disable : 4305 ) - #endif - - #include "m_pd.h" #include "iemlib.h" --- 4,7 ----
Index: bin_ambi_reduced_decode.c =================================================================== RCS file: /cvsroot/pure-data/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** bin_ambi_reduced_decode.c 9 Mar 2006 15:56:05 -0000 1.2 --- bin_ambi_reduced_decode.c 28 Nov 2006 18:56:01 -0000 1.3 *************** *** 4,13 **** iem_bin_ambi written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2005 */
- #ifdef NT - #pragma warning( disable : 4244 ) - #pragma warning( disable : 4305 ) - #endif - - #include "m_pd.h" #include "iemlib.h" --- 4,7 ----