Revision: 10534 http://pure-data.svn.sourceforge.net/pure-data/?rev=10534&view=rev Author: zmoelnig Date: 2009-01-13 18:00:10 +0000 (Tue, 13 Jan 2009)
Log Message: ----------- hopefully made 64bit able
Modified Paths: -------------- trunk/externals/iem/iem_bin_ambi/src/bin_ambi_calc_HRTF.c trunk/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode.c trunk/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode2.c trunk/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode_fft.c trunk/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode_fft2.c trunk/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode_fir.c trunk/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode_fir2.c
Modified: trunk/externals/iem/iem_bin_ambi/src/bin_ambi_calc_HRTF.c =================================================================== --- trunk/externals/iem/iem_bin_ambi/src/bin_ambi_calc_HRTF.c 2009-01-13 17:57:25 UTC (rev 10533) +++ trunk/externals/iem/iem_bin_ambi/src/bin_ambi_calc_HRTF.c 2009-01-13 18:00:10 UTC (rev 10534) @@ -37,10 +37,10 @@ int *x_phi; BIN_AMBI_COMPLEX *x_spec; BIN_AMBI_COMPLEX *x_sin_cos; - float *x_beg_fade_out_hrir; - float *x_beg_hrir; - float **x_beg_hrtf_re; - float **x_beg_hrtf_im; + iemarray_t *x_beg_fade_out_hrir; + float *x_beg_hrir; + iemarray_t **x_beg_hrtf_re; + iemarray_t **x_beg_hrtf_im; t_symbol **x_hrir_filename; t_symbol **x_s_hrir; t_symbol **x_s_hrtf_re; @@ -227,9 +227,9 @@ { t_garray *a; int npoints; - t_float *fadevec; + iemarray_t *fadevec;
- if((int)(x->x_beg_fade_out_hrir) == 0) + if(x->x_beg_fade_out_hrir == 0) { if (!(a = (t_garray *)pd_findbyclass(x->x_s_fade_out_hrir, garray_class))) error("%s: no such array", x->x_s_fade_out_hrir->s_name); @@ -285,8 +285,9 @@ int fs2=fftsize/2; t_garray *a; int npoints; - t_float *vec_hrir, *vec, *vec_fade_out_hrir; - t_float *vec_hrtf_re, *vec_hrtf_im; + t_float *vec; + iemarray_t *vec_fade_out_hrir; + iemarray_t *vec_hrir, *vec_hrtf_re, *vec_hrtf_im; t_symbol *hrir, *hrtf_re, *hrtf_im; float decr, sum;
@@ -327,11 +328,11 @@ vec = x->x_beg_hrir; vec += index * fftsize; - if((int)(x->x_beg_fade_out_hrir)) + if(x->x_beg_fade_out_hrir) { vec_fade_out_hrir = x->x_beg_fade_out_hrir; for(j=0; j<fs2; j++) - vec[j] = vec_hrir[j]*vec_fade_out_hrir[j]; + vec[j] = iemarray_getfloat(vec_hrir,j)*iemarray_getfloat(vec_fade_out_hrir,j); } else { @@ -339,13 +340,13 @@ n = fs2 * 3; n /= 4; for(j=0; j<n; j++) - vec[j] = vec_hrir[j]; + vec[j] = iemarray_getfloat(vec_hrir,j); sum = 1.0f; decr = 4.0f / (float)fs2; for(j=n, k=0; j<fs2; j++, k++) { sum -= decr; - vec[j] = vec_hrir[j] * sum; + vec[j] = iemarray_getfloat(vec_hrir,j) * sum; } } } @@ -359,7 +360,8 @@ BIN_AMBI_COMPLEX old1, old2, w; BIN_AMBI_COMPLEX *sincos = x->x_sin_cos; BIN_AMBI_COMPLEX *val = x->x_spec; - t_float *vec_hrir, *vec_hrtf_re, *vec_hrtf_im; + t_float *vec_hrir; + iemarray_t *vec_hrtf_re, *vec_hrtf_im; int n_ls = x->x_n_ls;
if(index < 0) @@ -424,15 +426,15 @@ } }
- vec_hrtf_re[0] = val[0].real; - vec_hrtf_im[0] = 0.0f; + iemarray_getfloat(vec_hrtf_re,0) = val[0].real; + iemarray_getfloat(vec_hrtf_im,0) = 0.0f; for( i = 1; i < fs2; i++ ) { - vec_hrtf_re[i] = 2.0f*val[i].real; - vec_hrtf_im[i] = 2.0f*val[i].imag; + iemarray_getfloat(vec_hrtf_re,i) = 2.0f*val[i].real; + iemarray_getfloat(vec_hrtf_im,i) = 2.0f*val[i].imag; } - vec_hrtf_re[fs2] = 0.0f; - vec_hrtf_im[fs2] = 0.0f; + iemarray_getfloat(vec_hrtf_re,fs2) = 0.0f; + iemarray_getfloat(vec_hrtf_im,fs2) = 0.0f; }
static void bin_ambi_calc_HRTF_free(t_bin_ambi_calc_HRTF *x) @@ -537,10 +539,10 @@ x->x_spec = (BIN_AMBI_COMPLEX *)getbytes(x->x_fftsize * sizeof(BIN_AMBI_COMPLEX)); x->x_sin_cos = (BIN_AMBI_COMPLEX *)getbytes(x->x_fftsize * sizeof(BIN_AMBI_COMPLEX));
- x->x_beg_fade_out_hrir = (float *)0; + x->x_beg_fade_out_hrir = 0; x->x_beg_hrir = (float *)getbytes(x->x_fftsize * x->x_n_ls * sizeof(float)); - x->x_beg_hrtf_re = (float **)getbytes(x->x_n_ls * sizeof(float *)); - x->x_beg_hrtf_im = (float **)getbytes(x->x_n_ls * sizeof(float *)); + x->x_beg_hrtf_re = (iemarray_t **)getbytes(x->x_n_ls * sizeof(iemarray_t *)); + x->x_beg_hrtf_im = (iemarray_t **)getbytes(x->x_n_ls * sizeof(iemarray_t *));
x->x_pi_over_180 = 4.0 * atan(1.0) / 180.0;
Modified: trunk/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode.c =================================================================== --- trunk/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode.c 2009-01-13 17:57:25 UTC (rev 10533) +++ trunk/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode.c 2009-01-13 18:00:10 UTC (rev 10534) @@ -45,10 +45,10 @@ int *x_sym_flag; BIN_AMBI_COMPLEX *x_spec; BIN_AMBI_COMPLEX *x_sin_cos; - float *x_beg_fade_out_hrir; - float *x_beg_hrir; - float **x_beg_hrtf_re; - float **x_beg_hrtf_im; + iemarray_t *x_beg_fade_out_hrir; + float *x_beg_hrir; + iemarray_t **x_beg_hrtf_re; + iemarray_t **x_beg_hrtf_im; t_symbol **x_hrir_filename; t_symbol **x_s_hrir; t_symbol **x_s_hrtf_re; @@ -638,9 +638,9 @@ { t_garray *a; int npoints; - t_float *fadevec; + iemarray_t *fadevec;
- if((int)(x->x_beg_fade_out_hrir) == 0) + if(x->x_beg_fade_out_hrir == 0) { if (!(a = (t_garray *)pd_findbyclass(x->x_s_fade_out_hrir, garray_class))) error("%s: no such array", x->x_s_fade_out_hrir->s_name); @@ -698,8 +698,10 @@ int fs2=fftsize/2; t_garray *a; int npoints; - t_float *vec_hrir, *vec, *vec_fade_out_hrir; - t_float *vec_hrtf_re, *vec_hrtf_im; + iemarray_t *vec_hrir; + t_float *vec; + iemarray_t *vec_fade_out_hrir; + iemarray_t *vec_hrtf_re, *vec_hrtf_im; t_symbol *hrir, *hrtf_re, *hrtf_im; float decr, sum;
@@ -740,11 +742,11 @@ vec = x->x_beg_hrir; vec += index * fftsize; - if((int)(x->x_beg_fade_out_hrir)) + if(x->x_beg_fade_out_hrir) { vec_fade_out_hrir = x->x_beg_fade_out_hrir; for(j=0; j<fs2; j++) - vec[j] = vec_hrir[j]*vec_fade_out_hrir[j]; + vec[j] = iemarray_getfloat(vec_hrir,j)*iemarray_getfloat(vec_fade_out_hrir,j); } else { @@ -752,13 +754,13 @@ n = fs2 * 3; n /= 4; for(j=0; j<n; j++) - vec[j] = vec_hrir[j]; + vec[j] = iemarray_getfloat(vec_hrir,j); sum = 1.0f; decr = 4.0f / (float)fs2; for(j=n, k=0; j<fs2; j++, k++) { sum -= decr; - vec[j] = vec_hrir[j] * sum; + vec[j] = iemarray_getfloat(vec_hrir,j) * sum; } } } @@ -772,7 +774,8 @@ BIN_AMBI_COMPLEX old1, old2, w; BIN_AMBI_COMPLEX *sincos = x->x_sin_cos; BIN_AMBI_COMPLEX *val = x->x_spec; - t_float *vec_hrir, *vec_hrtf_re, *vec_hrtf_im; + t_float *vec_hrir; + iemarray_t *vec_hrtf_re, *vec_hrtf_im; double *dv, *db=x->x_inv_work2; int n_ambi = x->x_n_ambi; int n_ambi2 = 2*n_ambi; @@ -854,15 +857,15 @@ } for(i = 0; i<fs2; i++) { - vec_hrtf_re[i] = val[i].real; - vec_hrtf_im[i] = val[i].imag; + iemarray_getfloat(vec_hrtf_re,i) = val[i].real; + iemarray_getfloat(vec_hrtf_im,i) = val[i].imag; } - vec_hrtf_re[fs2] = val[fs2].real; - vec_hrtf_im[fs2] = 0.0f; + iemarray_getfloat(vec_hrtf_re,fs2) = val[fs2].real; + iemarray_getfloat(vec_hrtf_im,fs2) = 0.0f; for(i = fs2+1; i < fftsize; i++) { - vec_hrtf_re[i] = 0.0f; - vec_hrtf_im[i] = 0.0f; + iemarray_getfloat(vec_hrtf_re,i) = 0.0f; + iemarray_getfloat(vec_hrtf_im,i) = 0.0f; } }
@@ -1207,10 +1210,10 @@ x->x_spec = (BIN_AMBI_COMPLEX *)getbytes(x->x_fftsize * sizeof(BIN_AMBI_COMPLEX)); x->x_sin_cos = (BIN_AMBI_COMPLEX *)getbytes(x->x_fftsize * sizeof(BIN_AMBI_COMPLEX));
- x->x_beg_fade_out_hrir = (float *)0; + x->x_beg_fade_out_hrir = 0; x->x_beg_hrir = (float *)getbytes(x->x_fftsize * x->x_n_ambi * sizeof(float)); - x->x_beg_hrtf_re = (float **)getbytes(x->x_n_ambi * sizeof(float *)); - x->x_beg_hrtf_im = (float **)getbytes(x->x_n_ambi * sizeof(float *)); + x->x_beg_hrtf_re = (iemarray_t **)getbytes(x->x_n_ambi * sizeof(iemarray_t *)); + x->x_beg_hrtf_im = (iemarray_t **)getbytes(x->x_n_ambi * sizeof(iemarray_t *));
x->x_sqrt3 = sqrt(3.0); x->x_sqrt5_2 = sqrt(5.0) / 2.0;
Modified: trunk/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode2.c =================================================================== --- trunk/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode2.c 2009-01-13 17:57:25 UTC (rev 10533) +++ trunk/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode2.c 2009-01-13 18:00:10 UTC (rev 10534) @@ -50,10 +50,10 @@ int *x_sym_flag; BIN_AMBI_COMPLEX *x_spec; BIN_AMBI_COMPLEX *x_sin_cos; - float *x_beg_fade_out_hrir; + iemarray_t *x_beg_fade_out_hrir; float *x_beg_hrir; - float **x_beg_hrtf_re; - float **x_beg_hrtf_im; + iemarray_t **x_beg_hrtf_re; + iemarray_t **x_beg_hrtf_im; t_symbol **x_hrir_filename; t_symbol **x_s_hrir; t_symbol **x_s_hrtf_re; @@ -664,9 +664,9 @@ { t_garray *a; int npoints; - t_float *fadevec; + iemarray_t *fadevec;
- if((int)(x->x_beg_fade_out_hrir) == 0) + if(x->x_beg_fade_out_hrir == 0) { if (!(a = (t_garray *)pd_findbyclass(x->x_s_fade_out_hrir, garray_class))) error("%s: no such array", x->x_s_fade_out_hrir->s_name); @@ -728,7 +728,8 @@ t_garray *a; int npoints; t_symbol *hrir; - t_float *vec_hrir, *vec, *vec_fade_out_hrir; + iemarray_t *vec_hrir, *vec_fade_out_hrir; + t_float *vec; float decr, sum;
if(index < 0) @@ -750,11 +751,11 @@ vec = x->x_beg_hrir; vec += index * fftsize; - if((int)(x->x_beg_fade_out_hrir)) + if(x->x_beg_fade_out_hrir) { vec_fade_out_hrir = x->x_beg_fade_out_hrir; for(j=0; j<fs2; j++) - vec[j] = vec_hrir[j]*vec_fade_out_hrir[j]; + vec[j] = iemarray_getfloat(vec_hrir,j)*iemarray_getfloat(vec_fade_out_hrir,j); } else { @@ -762,13 +763,13 @@ n = fs2 * 3; n /= 4; for(j=0; j<n; j++) - vec[j] = vec_hrir[j]; + vec[j] = iemarray_getfloat(vec_hrir,j); sum = 1.0f; decr = 4.0f / (float)fs2; for(j=n, k=0; j<fs2; j++, k++) { sum -= decr; - vec[j] = vec_hrir[j] * sum; + vec[j] = iemarray_getfloat(vec_hrir,j) * sum; } } } @@ -780,7 +781,7 @@ t_garray *a; int npoints; int fftsize = x->x_fftsize; - t_float *vec_hrtf_re, *vec_hrtf_im; + iemarray_t *vec_hrtf_re, *vec_hrtf_im; t_symbol *hrtf_re, *hrtf_im;
if(index < 0) @@ -818,7 +819,8 @@ BIN_AMBI_COMPLEX old1, old2, w; BIN_AMBI_COMPLEX *sincos = x->x_sin_cos; BIN_AMBI_COMPLEX *val = x->x_spec;/*weighted decoder-matrix with n_ls lines and n_ambi columns*/ - t_float *vec_hrir, *vec_hrtf_re, *vec_hrtf_im; + t_float *vec_hrir; + iemarray_t *vec_hrtf_re, *vec_hrtf_im; double *dv, *db=x->x_prod; int n_ambi = x->x_n_ambi; int n_ls = x->x_n_ls; @@ -902,15 +904,15 @@ } for(i = 0; i<fs2; i++) { - vec_hrtf_re[i] = val[i].real; - vec_hrtf_im[i] = val[i].imag; + iemarray_getfloat(vec_hrtf_re,i) = val[i].real; + iemarray_getfloat(vec_hrtf_im,i) = val[i].imag; } - vec_hrtf_re[fs2] = val[fs2].real; - vec_hrtf_im[fs2] = 0.0f; + iemarray_getfloat(vec_hrtf_re,fs2) = val[fs2].real; + iemarray_getfloat(vec_hrtf_im,fs2) = 0.0f; for(i = fs2+1; i < fftsize; i++) { - vec_hrtf_re[i] = 0.0f; - vec_hrtf_im[i] = 0.0f; + iemarray_getfloat(vec_hrtf_re,i) = 0.0f; + iemarray_getfloat(vec_hrtf_im,i) = 0.0f; } } } @@ -1284,10 +1286,10 @@ x->x_spec = (BIN_AMBI_COMPLEX *)getbytes(x->x_fftsize * sizeof(BIN_AMBI_COMPLEX)); x->x_sin_cos = (BIN_AMBI_COMPLEX *)getbytes(x->x_fftsize * sizeof(BIN_AMBI_COMPLEX));
- x->x_beg_fade_out_hrir = (float *)0; - x->x_beg_hrir = (float *)getbytes(x->x_fftsize * x->x_n_ls * sizeof(float)); - x->x_beg_hrtf_re = (float **)getbytes(x->x_n_ambi * sizeof(float *)); - x->x_beg_hrtf_im = (float **)getbytes(x->x_n_ambi * sizeof(float *)); + x->x_beg_fade_out_hrir = 0; + x->x_beg_hrir = (float *)getbytes(x->x_fftsize * x->x_n_ls * sizeof(float)); + x->x_beg_hrtf_re = (iemarray_t **)getbytes(x->x_n_ambi * sizeof(iemarray_t *)); + x->x_beg_hrtf_im = (iemarray_t **)getbytes(x->x_n_ambi * sizeof(iemarray_t *));
x->x_sqrt3 = sqrt(3.0); x->x_sqrt5_2 = sqrt(5.0) / 2.0;
Modified: trunk/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode_fft.c =================================================================== --- trunk/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode_fft.c 2009-01-13 17:57:25 UTC (rev 10533) +++ trunk/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode_fft.c 2009-01-13 18:00:10 UTC (rev 10534) @@ -54,10 +54,10 @@ int *x_sym_flag; BIN_AMBI_COMPLEX *x_spec; BIN_AMBI_COMPLEX *x_sin_cos; - float *x_beg_fade_out_hrir; + iemarray_t *x_beg_fade_out_hrir; float *x_beg_hrir; - float **x_beg_hrtf_re; - float **x_beg_hrtf_im; + iemarray_t **x_beg_hrtf_re; + iemarray_t **x_beg_hrtf_im; t_symbol **x_hrir_filename; t_symbol **x_s_hrir; t_symbol **x_s_hrtf_re; @@ -788,9 +788,9 @@ { t_garray *a; int npoints; - t_float *fadevec; + iemarray_t *fadevec;
- if((int)(x->x_beg_fade_out_hrir) == 0) + if(x->x_beg_fade_out_hrir == 0) { if (!(a = (t_garray *)pd_findbyclass(x->x_s_fade_out_hrir, garray_class))) error("%s: no such array", x->x_s_fade_out_hrir->s_name); @@ -853,7 +853,8 @@ t_garray *a; int npoints; t_symbol *hrir; - t_float *vec_hrir, *vec, *vec_fade_out_hrir; + t_float *vec; + iemarray_t *vec_hrir, *vec_fade_out_hrir; float decr, sum;
if(index < 0) @@ -875,11 +876,11 @@ vec = x->x_beg_hrir; vec += index * fftsize; - if((int)(x->x_beg_fade_out_hrir)) + if(x->x_beg_fade_out_hrir) { vec_fade_out_hrir = x->x_beg_fade_out_hrir; for(j=0; j<fs2; j++) - vec[j] = vec_hrir[j]*vec_fade_out_hrir[j]; + vec[j] = iemarray_getfloat(vec_hrir,j)*iemarray_getfloat(vec_fade_out_hrir,j); } else { @@ -887,13 +888,13 @@ n = fs2 * 3; n /= 4; for(j=0; j<n; j++) - vec[j] = vec_hrir[j]; + vec[j] = iemarray_getfloat(vec_hrir,j); sum = 1.0f; decr = 4.0f / (float)fs2; for(j=n, k=0; j<fs2; j++, k++) { sum -= decr; - vec[j] = vec_hrir[j] * sum; + vec[j] = iemarray_getfloat(vec_hrir,j) * sum; } } } @@ -905,7 +906,7 @@ t_garray *a; int npoints; int fftsize = x->x_fftsize; - t_float *vec_hrtf_re, *vec_hrtf_im; + iemarray_t *vec_hrtf_re, *vec_hrtf_im; t_symbol *hrtf_re, *hrtf_im;
if(index < 0) @@ -943,7 +944,8 @@ BIN_AMBI_COMPLEX old1, old2, w; BIN_AMBI_COMPLEX *sincos = x->x_sin_cos; BIN_AMBI_COMPLEX *val = x->x_spec;/*weighted decoder-matrix with n_ls lines and n_ambi columns*/ - t_float *vec_hrir, *vec_hrtf_re, *vec_hrtf_im; + t_float *vec_hrir; + iemarray_t *vec_hrtf_re, *vec_hrtf_im; double *dv, *db=x->x_prod3; int n_ambi = x->x_n_ambi; int n_ls = x->x_n_ind_ls + x->x_n_mrg_mir_ls; @@ -1027,15 +1029,15 @@ } for(i = 0; i<fs2; i++) { - vec_hrtf_re[i] = val[i].real; - vec_hrtf_im[i] = val[i].imag; + iemarray_getfloat(vec_hrtf_re, i) = val[i].real; + iemarray_getfloat(vec_hrtf_im, i) = val[i].imag; } - vec_hrtf_re[fs2] = val[fs2].real; - vec_hrtf_im[fs2] = 0.0f; + iemarray_getfloat(vec_hrtf_re, fs2) = val[fs2].real; + iemarray_getfloat(vec_hrtf_im, fs2) = 0.0f; for(i = fs2+1; i < fftsize; i++) { - vec_hrtf_re[i] = 0.0f; - vec_hrtf_im[i] = 0.0f; + iemarray_getfloat(vec_hrtf_re, i) = 0.0f; + iemarray_getfloat(vec_hrtf_im, i) = 0.0f; } } } @@ -1430,10 +1432,10 @@ x->x_spec = (BIN_AMBI_COMPLEX *)getbytes(x->x_fftsize * sizeof(BIN_AMBI_COMPLEX)); x->x_sin_cos = (BIN_AMBI_COMPLEX *)getbytes(x->x_fftsize * sizeof(BIN_AMBI_COMPLEX));
- x->x_beg_fade_out_hrir = (float *)0; - x->x_beg_hrir = (float *)getbytes(x->x_fftsize * (x->x_n_ind_ls+x->x_n_mrg_mir_ls) * sizeof(float)); - x->x_beg_hrtf_re = (float **)getbytes(x->x_n_ambi * sizeof(float *)); - x->x_beg_hrtf_im = (float **)getbytes(x->x_n_ambi * sizeof(float *)); + x->x_beg_fade_out_hrir = 0; + x->x_beg_hrir = (float *)getbytes(x->x_fftsize * (x->x_n_ind_ls+x->x_n_mrg_mir_ls) * sizeof(float)); + x->x_beg_hrtf_re = (iemarray_t **)getbytes(x->x_n_ambi * sizeof(iemarray_t *)); + x->x_beg_hrtf_im = (iemarray_t **)getbytes(x->x_n_ambi * sizeof(iemarray_t *));
x->x_sqrt3 = sqrt(3.0); x->x_sqrt5_2 = sqrt(5.0) / 2.0;
Modified: trunk/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode_fft2.c =================================================================== --- trunk/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode_fft2.c 2009-01-13 17:57:25 UTC (rev 10533) +++ trunk/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode_fft2.c 2009-01-13 18:00:10 UTC (rev 10534) @@ -53,10 +53,10 @@ int *x_sym_flag; BIN_AMBI_COMPLEX *x_spec; BIN_AMBI_COMPLEX *x_sin_cos; - t_float *x_beg_fade_out_hrir; + iemarray_t *x_beg_fade_out_hrir; t_float *x_beg_hrir; - t_float **x_beg_hrtf_re; - t_float **x_beg_hrtf_im; + iemarray_t **x_beg_hrtf_re; + iemarray_t **x_beg_hrtf_im; t_symbol **x_hrir_filename; t_symbol **x_s_hrir; t_symbol **x_s_hrtf_re; @@ -645,12 +645,12 @@ { t_garray *a; int npoints; - t_float *fadevec; + iemarray_t *fadevec; int i, n; double *dv3=x->x_prod3; double *dv2=x->x_prod2;
- if((int)(x->x_beg_fade_out_hrir) == 0) + if(x->x_beg_fade_out_hrir == 0) { if (!(a = (t_garray *)pd_findbyclass(x->x_s_fade_out_hrir, garray_class))) error("%s: no such array", x->x_s_fade_out_hrir->s_name); @@ -745,7 +745,8 @@ t_garray *a; int npoints; t_symbol *hrir; - t_float *vec_hrir, *vec, *vec_fade_out_hrir; + t_float*vec; + iemarray_t *vec_hrir, *vec_fade_out_hrir; t_float decr, sum;
if(index < 0) @@ -767,11 +768,11 @@ vec = x->x_beg_hrir; vec += index * fftsize;
- if((int)(x->x_beg_fade_out_hrir)) + if(x->x_beg_fade_out_hrir) { vec_fade_out_hrir = x->x_beg_fade_out_hrir; for(j=0; j<fs2; j++) - vec[j] = vec_hrir[j]*vec_fade_out_hrir[j]; + vec[j] = iemarray_getfloat(vec_hrir, j)*iemarray_getfloat(vec_fade_out_hrir, j); } else { @@ -779,13 +780,13 @@ n = fs2 * 3; n /= 4; for(j=0; j<n; j++) - vec[j] = vec_hrir[j]; + vec[j] =iemarray_getfloat(vec_hrir,j); sum = 1.0f; decr = 4.0f / (t_float)fs2; for(j=n, k=0; j<fs2; j++, k++) { sum -= decr; - vec[j] = vec_hrir[j] * sum; + vec[j] = iemarray_getfloat(vec_hrir,j) * sum; } } } @@ -797,7 +798,7 @@ t_garray *a; int npoints; int fftsize = x->x_fftsize; - t_float *vec_hrtf_re, *vec_hrtf_im; + iemarray_t *vec_hrtf_re, *vec_hrtf_im; t_symbol *hrtf_re, *hrtf_im;
if(index < 0) @@ -835,7 +836,8 @@ BIN_AMBI_COMPLEX old1, old2, w; BIN_AMBI_COMPLEX *sincos = x->x_sin_cos; BIN_AMBI_COMPLEX *val = x->x_spec;/*weighted decoder-matrix with n_ls lines and n_ambi columns*/ - t_float *vec_hrir, *vec_hrtf_re, *vec_hrtf_im; + t_float *vec_hrir; + iemarray_t*vec_hrtf_re, *vec_hrtf_im; double *dv, *db=x->x_prod3; int n_ambi = x->x_n_ambi; int n_ls = x->x_n_real_ls; @@ -919,15 +921,15 @@ } for(i = 0; i<fs2; i++) { - vec_hrtf_re[i] = val[i].real; - vec_hrtf_im[i] = val[i].imag; + iemarray_getfloat(vec_hrtf_re, i) = val[i].real; + iemarray_getfloat(vec_hrtf_im, i) = val[i].imag; } - vec_hrtf_re[fs2] = val[fs2].real; - vec_hrtf_im[fs2] = 0.0f; + iemarray_getfloat(vec_hrtf_re, fs2) = val[fs2].real; + iemarray_getfloat(vec_hrtf_im, fs2) = 0.0f; for(i = fs2+1; i < fftsize; i++) { - vec_hrtf_re[i] = 0.0f; - vec_hrtf_im[i] = 0.0f; + iemarray_getfloat(vec_hrtf_re, i) = 0.0f; + iemarray_getfloat(vec_hrtf_im, i) = 0.0f; } } } @@ -1310,10 +1312,10 @@ x->x_spec = (BIN_AMBI_COMPLEX *)getbytes(x->x_fftsize * sizeof(BIN_AMBI_COMPLEX)); x->x_sin_cos = (BIN_AMBI_COMPLEX *)getbytes(x->x_fftsize * sizeof(BIN_AMBI_COMPLEX));
- x->x_beg_fade_out_hrir = (t_float *)0; + x->x_beg_fade_out_hrir = 0; x->x_beg_hrir = (t_float *)getbytes(x->x_fftsize * x->x_n_real_ls * sizeof(t_float)); - x->x_beg_hrtf_re = (t_float **)getbytes(x->x_n_ambi * sizeof(t_float *)); - x->x_beg_hrtf_im = (t_float **)getbytes(x->x_n_ambi * sizeof(t_float *)); + x->x_beg_hrtf_re = (iemarray_t **)getbytes(x->x_n_ambi * sizeof(iemarray_t *)); + x->x_beg_hrtf_im = (iemarray_t **)getbytes(x->x_n_ambi * sizeof(iemarray_t *));
x->x_sqrt3 = sqrt(3.0); x->x_sqrt5_2 = sqrt(5.0) / 2.0;
Modified: trunk/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode_fir.c =================================================================== --- trunk/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode_fir.c 2009-01-13 17:57:25 UTC (rev 10533) +++ trunk/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode_fir.c 2009-01-13 18:00:10 UTC (rev 10534) @@ -52,9 +52,9 @@ int *x_phi; int *x_phi_sym; int *x_sym_flag; - float *x_beg_fade_out_hrir; - float *x_beg_hrir; - float **x_beg_hrir_red; + iemarray_t *x_beg_fade_out_hrir; + float *x_beg_hrir; + iemarray_t **x_beg_hrir_red; t_symbol **x_hrir_filename; t_symbol **x_s_hrir; t_symbol **x_s_hrir_red; @@ -770,7 +770,7 @@ int npoints; iemarray_t *fadevec;
- if((int)(x->x_beg_fade_out_hrir) == 0) + if(x->x_beg_fade_out_hrir == 0) { if (!(a = (t_garray *)pd_findbyclass(x->x_s_fade_out_hrir, garray_class))) error("%s: no such array", x->x_s_fade_out_hrir->s_name); @@ -834,7 +834,8 @@ int npoints; t_symbol *hrir; iemarray_t *vec_hrir; - t_float *vec, *vec_fade_out_hrir; + t_float *vec; + iemarray_t *vec_fade_out_hrir; float decr, sum;
if(index < 0) @@ -856,11 +857,11 @@ vec = x->x_beg_hrir; vec += index * firsize; - if((int)(x->x_beg_fade_out_hrir)) + if(x->x_beg_fade_out_hrir) { vec_fade_out_hrir = x->x_beg_fade_out_hrir; for(j=0; j<fs2; j++) - vec[j] = vec_hrir[j]*vec_fade_out_hrir[j]; + vec[j] = iemarray_getfloat(vec_hrir,j)*iemarray_getfloat(vec_fade_out_hrir,j); } else { @@ -868,13 +869,13 @@ n = fs2 * 3; n /= 4; for(j=0; j<n; j++) - vec[j] = vec_hrir[j]; + vec[j] = iemarray_getfloat(vec_hrir,j); sum = 1.0f; decr = 4.0f / (float)fs2; for(j=n, k=0; j<fs2; j++, k++) { sum -= decr; - vec[j] = vec_hrir[j] * sum; + vec[j] = iemarray_getfloat(vec_hrir,j) * sum; } } } @@ -904,7 +905,7 @@ error("%s: bad array-size: %d", hrir_red->s_name, npoints); else { - x->x_beg_hrir_red[index] = vec_hrir_red; + x->x_beg_hrir_red[index] = vec_hrir_red; } }
@@ -913,7 +914,8 @@ int index=(int)findex - 1; int i, j; int firsize = x->x_firsize; - t_float *vec_hrir, *vec_hrir_red; + t_float *vec_hrir; + iemarray_t*vec_hrir_red; double *dv; int n_ambi = x->x_n_ambi; int n_ls = x->x_n_ind_ls + x->x_n_mrg_mir_ls; @@ -933,7 +935,7 @@ vec_hrir = x->x_beg_hrir; for(i=0; i<firsize; i++)/*first step of acumulating the HRIRs*/ { - vec_hrir_red[i] = mul * vec_hrir[i]; + iemarray_getfloat(vec_hrir_red,i) = mul * vec_hrir[i]; }
for(j=1; j<n_ls; j++) @@ -944,7 +946,7 @@ vec_hrir += j * firsize; for(i=0; i<firsize; i++) { - vec_hrir_red[i] += mul * vec_hrir[i]; + iemarray_getfloat(vec_hrir_red,i) += mul * vec_hrir[i]; } } } @@ -1307,10 +1309,10 @@ x->x_phi_sym = (int *)getbytes((x->x_n_ind_ls+x->x_n_mrg_mir_ls) * sizeof(int)); x->x_sym_flag = (int *)getbytes((x->x_n_ind_ls+x->x_n_mrg_mir_ls) * sizeof(int));
- x->x_beg_fade_out_hrir = (float *)0; + x->x_beg_fade_out_hrir = 0; x->x_beg_hrir = (float *)getbytes(x->x_firsize * (x->x_n_ind_ls+x->x_n_mrg_mir_ls) * sizeof(float)); - x->x_beg_hrir_red = (float **)getbytes(x->x_n_ambi * sizeof(float *)); - + x->x_beg_hrir_red = (iemarray_t **)getbytes(x->x_n_ambi * sizeof(iemarray_t *)); + x->x_sqrt3 = sqrt(3.0); x->x_sqrt5_2 = sqrt(5.0) / 2.0; x->x_sqrt6_4 = sqrt(6.0) / 4.0;
Modified: trunk/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode_fir2.c =================================================================== --- trunk/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode_fir2.c 2009-01-13 17:57:25 UTC (rev 10533) +++ trunk/externals/iem/iem_bin_ambi/src/bin_ambi_reduced_decode_fir2.c 2009-01-13 18:00:10 UTC (rev 10534) @@ -51,9 +51,9 @@ int *x_phi; 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; + iemarray_t *x_beg_fade_out_hrir; + t_float *x_beg_hrir; + iemarray_t **x_beg_hrir_red; t_symbol **x_hrir_filename; t_symbol **x_s_hrir; t_symbol **x_s_hrir_red; @@ -624,12 +624,12 @@ { t_garray *a; int npoints; - t_float *fadevec; + iemarray_t *fadevec; int i, n; double *dv3=x->x_prod3; double *dv2=x->x_prod2;
- if((int)(x->x_beg_fade_out_hrir) == 0) + if(x->x_beg_fade_out_hrir == 0) { if (!(a = (t_garray *)pd_findbyclass(x->x_s_fade_out_hrir, garray_class))) error("%s: no such array", x->x_s_fade_out_hrir->s_name); @@ -723,7 +723,8 @@ t_garray *a; int npoints; t_symbol *hrir; - t_float *vec_hrir, *vec, *vec_fade_out_hrir; + t_float *vec; + iemarray_t *vec_hrir, *vec_fade_out_hrir; t_float decr, sum;
if(index < 0) @@ -745,11 +746,11 @@ vec = x->x_beg_hrir; vec += index * firsize; - if((int)(x->x_beg_fade_out_hrir)) + if(x->x_beg_fade_out_hrir) { vec_fade_out_hrir = x->x_beg_fade_out_hrir; for(j=0; j<firsize; j++) - vec[j] = vec_hrir[j]*vec_fade_out_hrir[j]; + vec[j] = iemarray_getfloat(vec_hrir,j)*iemarray_getfloat(vec_fade_out_hrir,j); } else { @@ -757,13 +758,13 @@ n = firsize * 3; n /= 4; for(j=0; j<n; j++) - vec[j] = vec_hrir[j]; + vec[j] = iemarray_getfloat(vec_hrir,j); sum = 1.0f; decr = 4.0f / (t_float)firsize; for(j=n, k=0; j<firsize; j++, k++) { sum -= decr; - vec[j] = vec_hrir[j] * sum; + vec[j] = iemarray_getfloat(vec_hrir,j) * sum; } } } @@ -775,7 +776,7 @@ t_garray *a; int npoints; int firsize = x->x_firsize; - t_float *vec_hrir_red; + iemarray_t *vec_hrir_red; t_symbol *hrir_red;
if(index < 0) @@ -802,7 +803,8 @@ int index=(int)findex - 1; int i, j; int firsize = x->x_firsize; - t_float *vec_hrir, *vec_hrir_red; + t_float *vec_hrir; + iemarray_t*vec_hrir_red; double *dv; int n_ambi = x->x_n_ambi; int n_ls = x->x_n_real_ls; @@ -822,7 +824,7 @@ vec_hrir = x->x_beg_hrir; for(i=0; i<firsize; i++)/*first step of acumulating the HRIRs*/ { - vec_hrir_red[i] = mul * vec_hrir[i]; + iemarray_getfloat(vec_hrir_red,i) = mul * vec_hrir[i]; }
for(j=1; j<n_ls; j++) @@ -834,7 +836,7 @@
for(i=0; i<firsize; i++) { - vec_hrir_red[i] += mul * vec_hrir[i]; + iemarray_getfloat(vec_hrir_red,i) += mul * vec_hrir[i]; } } } @@ -1185,9 +1187,9 @@ x->x_phi_sym = (int *)getbytes(x->x_n_real_ls * sizeof(int)); 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_beg_fade_out_hrir = 0; + x->x_beg_hrir = (t_float *)getbytes(x->x_firsize * x->x_n_real_ls * sizeof(t_float)); + x->x_beg_hrir_red = (iemarray_t **)getbytes(x->x_n_ambi * sizeof(iemarray_t *));
x->x_sqrt3 = sqrt(3.0); x->x_sqrt5_2 = sqrt(5.0) / 2.0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.