From 524ba817b76fdd27c6833cc948d27aba18280332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 13 Jan 2009 17:13:31 +0000 Subject: start for 64bit; broken for now.. svn path=/trunk/externals/iem/iem_bin_ambi/; revision=10532 --- src/bin_ambi_calc_HRTF.c | 8 ++++---- src/bin_ambi_reduced_decode.c | 8 ++++---- src/bin_ambi_reduced_decode2.c | 8 ++++---- src/bin_ambi_reduced_decode_fft.c | 8 ++++---- src/bin_ambi_reduced_decode_fft2.c | 8 ++++---- src/bin_ambi_reduced_decode_fir.c | 13 +++++++------ src/bin_ambi_reduced_decode_fir2.c | 6 +++--- src/iemlib.h | 12 ++++++++++++ 8 files changed, 42 insertions(+), 29 deletions(-) diff --git a/src/bin_ambi_calc_HRTF.c b/src/bin_ambi_calc_HRTF.c index 403c81d..4003bbc 100644 --- a/src/bin_ambi_calc_HRTF.c +++ b/src/bin_ambi_calc_HRTF.c @@ -233,7 +233,7 @@ static void bin_ambi_calc_HRTF_check_fade_out(t_bin_ambi_calc_HRTF *x) { 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); - else if (!garray_getfloatarray(a, &npoints, &fadevec)) + else if (!iemarray_getarray(a, &npoints, &fadevec)) error("%s: bad template for bin_ambi_calc_HRTF", x->x_s_fade_out_hrir->s_name); else if (npoints < x->x_fftsize) error("%s: bad array-size: %d", x->x_s_fade_out_hrir->s_name, npoints); @@ -301,19 +301,19 @@ static void bin_ambi_calc_HRTF_check_arrays(t_bin_ambi_calc_HRTF *x, float finde if (!(a = (t_garray *)pd_findbyclass(hrtf_re, garray_class))) error("%s: no such array", hrtf_re->s_name); - else if (!garray_getfloatarray(a, &npoints, &vec_hrtf_re)) + else if (!iemarray_getarray(a, &npoints, &vec_hrtf_re)) error("%s: bad template for bin_ambi_calc_HRTF", hrtf_re->s_name); else if (npoints < fftsize) error("%s: bad array-size: %d", hrtf_re->s_name, npoints); else if (!(a = (t_garray *)pd_findbyclass(hrtf_im, garray_class))) error("%s: no such array", hrtf_im->s_name); - else if (!garray_getfloatarray(a, &npoints, &vec_hrtf_im)) + else if (!iemarray_getarray(a, &npoints, &vec_hrtf_im)) error("%s: bad template for bin_ambi_calc_HRTF", hrtf_im->s_name); else if (npoints < fftsize) error("%s: bad array-size: %d", hrtf_im->s_name, npoints); else if (!(a = (t_garray *)pd_findbyclass(hrir, garray_class))) error("%s: no such array", hrir->s_name); - else if (!garray_getfloatarray(a, &npoints, &vec_hrir)) + else if (!iemarray_getarray(a, &npoints, &vec_hrir)) error("%s: bad template for bin_ambi_calc_HRTF", hrir->s_name); else { diff --git a/src/bin_ambi_reduced_decode.c b/src/bin_ambi_reduced_decode.c index 3441bb2..949c715 100644 --- a/src/bin_ambi_reduced_decode.c +++ b/src/bin_ambi_reduced_decode.c @@ -644,7 +644,7 @@ static void bin_ambi_reduced_decode_calc_pinv(t_bin_ambi_reduced_decode *x) { 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); - else if (!garray_getfloatarray(a, &npoints, &fadevec)) + else if (!iemarray_getarray(a, &npoints, &fadevec)) error("%s: bad template for bin_ambi_reduced_decode", x->x_s_fade_out_hrir->s_name); else if (npoints < x->x_fftsize) error("%s: bad array-size: %d", x->x_s_fade_out_hrir->s_name, npoints); @@ -714,19 +714,19 @@ static void bin_ambi_reduced_decode_check_arrays(t_bin_ambi_reduced_decode *x, f if (!(a = (t_garray *)pd_findbyclass(hrtf_re, garray_class))) error("%s: no such array", hrtf_re->s_name); - else if (!garray_getfloatarray(a, &npoints, &vec_hrtf_re)) + else if (!iemarray_getarray(a, &npoints, &vec_hrtf_re)) error("%s: bad template for bin_ambi_reduced_decode", hrtf_re->s_name); else if (npoints < fftsize) error("%s: bad array-size: %d", hrtf_re->s_name, npoints); else if (!(a = (t_garray *)pd_findbyclass(hrtf_im, garray_class))) error("%s: no such array", hrtf_im->s_name); - else if (!garray_getfloatarray(a, &npoints, &vec_hrtf_im)) + else if (!iemarray_getarray(a, &npoints, &vec_hrtf_im)) error("%s: bad template for bin_ambi_reduced_decode", hrtf_im->s_name); else if (npoints < fftsize) error("%s: bad array-size: %d", hrtf_im->s_name, npoints); else if (!(a = (t_garray *)pd_findbyclass(hrir, garray_class))) error("%s: no such array", hrir->s_name); - else if (!garray_getfloatarray(a, &npoints, &vec_hrir)) + else if (!iemarray_getarray(a, &npoints, &vec_hrir)) error("%s: bad template for bin_ambi_reduced_decode", hrir->s_name); else { diff --git a/src/bin_ambi_reduced_decode2.c b/src/bin_ambi_reduced_decode2.c index f9c2907..ea176db 100644 --- a/src/bin_ambi_reduced_decode2.c +++ b/src/bin_ambi_reduced_decode2.c @@ -670,7 +670,7 @@ static void bin_ambi_reduced_decode2_calc_pinv(t_bin_ambi_reduced_decode2 *x) { 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); - else if (!garray_getfloatarray(a, &npoints, &fadevec)) + else if (!iemarray_getarray(a, &npoints, &fadevec)) error("%s: bad template for bin_ambi_reduced_decode2", x->x_s_fade_out_hrir->s_name); else if (npoints < x->x_fftsize) error("%s: bad array-size: %d", x->x_s_fade_out_hrir->s_name, npoints); @@ -739,7 +739,7 @@ static void bin_ambi_reduced_decode2_check_HRIR_arrays(t_bin_ambi_reduced_decode hrir = x->x_s_hrir[index]; if (!(a = (t_garray *)pd_findbyclass(hrir, garray_class))) error("%s: no such array", hrir->s_name); - else if (!garray_getfloatarray(a, &npoints, &vec_hrir)) + else if (!iemarray_getarray(a, &npoints, &vec_hrir)) error("%s: bad template for bin_ambi_reduced_decode2", hrir->s_name); else { @@ -793,13 +793,13 @@ static void bin_ambi_reduced_decode2_check_HRTF_arrays(t_bin_ambi_reduced_decode if (!(a = (t_garray *)pd_findbyclass(hrtf_re, garray_class))) error("%s: no such array", hrtf_re->s_name); - else if (!garray_getfloatarray(a, &npoints, &vec_hrtf_re)) + else if (!iemarray_getarray(a, &npoints, &vec_hrtf_re)) error("%s: bad template for bin_ambi_reduced_decode2", hrtf_re->s_name); else if (npoints < fftsize) error("%s: bad array-size: %d", hrtf_re->s_name, npoints); else if (!(a = (t_garray *)pd_findbyclass(hrtf_im, garray_class))) error("%s: no such array", hrtf_im->s_name); - else if (!garray_getfloatarray(a, &npoints, &vec_hrtf_im)) + else if (!iemarray_getarray(a, &npoints, &vec_hrtf_im)) error("%s: bad template for bin_ambi_reduced_decode2", hrtf_im->s_name); else if (npoints < fftsize) error("%s: bad array-size: %d", hrtf_im->s_name, npoints); diff --git a/src/bin_ambi_reduced_decode_fft.c b/src/bin_ambi_reduced_decode_fft.c index 7549eaa..d99a023 100644 --- a/src/bin_ambi_reduced_decode_fft.c +++ b/src/bin_ambi_reduced_decode_fft.c @@ -794,7 +794,7 @@ static void bin_ambi_reduced_decode_fft_calc_pinv(t_bin_ambi_reduced_decode_fft { 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); - else if (!garray_getfloatarray(a, &npoints, &fadevec)) + else if (!iemarray_getarray(a, &npoints, &fadevec)) error("%s: bad template for bin_ambi_reduced_decode_fft", x->x_s_fade_out_hrir->s_name); else if (npoints < x->x_fftsize) error("%s: bad array-size: %d", x->x_s_fade_out_hrir->s_name, npoints); @@ -864,7 +864,7 @@ static void bin_ambi_reduced_decode_fft_check_HRIR_arrays(t_bin_ambi_reduced_dec hrir = x->x_s_hrir[index]; if (!(a = (t_garray *)pd_findbyclass(hrir, garray_class))) error("%s: no such array", hrir->s_name); - else if (!garray_getfloatarray(a, &npoints, &vec_hrir)) + else if (!iemarray_getarray(a, &npoints, &vec_hrir)) error("%s: bad template for bin_ambi_reduced_decode_fft", hrir->s_name); else { @@ -918,13 +918,13 @@ static void bin_ambi_reduced_decode_fft_check_HRTF_arrays(t_bin_ambi_reduced_dec if (!(a = (t_garray *)pd_findbyclass(hrtf_re, garray_class))) error("%s: no such array", hrtf_re->s_name); - else if (!garray_getfloatarray(a, &npoints, &vec_hrtf_re)) + else if (!iemarray_getarray(a, &npoints, &vec_hrtf_re)) error("%s: bad template for bin_ambi_reduced_decode_fft", hrtf_re->s_name); else if (npoints < fftsize) error("%s: bad array-size: %d", hrtf_re->s_name, npoints); else if (!(a = (t_garray *)pd_findbyclass(hrtf_im, garray_class))) error("%s: no such array", hrtf_im->s_name); - else if (!garray_getfloatarray(a, &npoints, &vec_hrtf_im)) + else if (!iemarray_getarray(a, &npoints, &vec_hrtf_im)) error("%s: bad template for bin_ambi_reduced_decode_fft", hrtf_im->s_name); else if (npoints < fftsize) error("%s: bad array-size: %d", hrtf_im->s_name, npoints); diff --git a/src/bin_ambi_reduced_decode_fft2.c b/src/bin_ambi_reduced_decode_fft2.c index 30a7e8a..eb565d5 100644 --- a/src/bin_ambi_reduced_decode_fft2.c +++ b/src/bin_ambi_reduced_decode_fft2.c @@ -654,7 +654,7 @@ static void bin_ambi_reduced_decode_fft2_calc_pinv(t_bin_ambi_reduced_decode_fft { 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); - else if (!garray_getfloatarray(a, &npoints, &fadevec)) + else if (!iemarray_getarray(a, &npoints, &fadevec)) error("%s: bad template for bin_ambi_reduced_decode_fft2", x->x_s_fade_out_hrir->s_name); else if (npoints < x->x_fftsize) error("%s: bad array-size: %d", x->x_s_fade_out_hrir->s_name, npoints); @@ -756,7 +756,7 @@ static void bin_ambi_reduced_decode_fft2_check_HRIR_arrays(t_bin_ambi_reduced_de hrir = x->x_s_hrir[index]; if (!(a = (t_garray *)pd_findbyclass(hrir, garray_class))) error("%s: no such array", hrir->s_name); - else if (!garray_getfloatarray(a, &npoints, &vec_hrir)) + else if (!iemarray_getarray(a, &npoints, &vec_hrir)) error("%s: bad template for bin_ambi_reduced_decode_fft2", hrir->s_name); else { @@ -810,13 +810,13 @@ static void bin_ambi_reduced_decode_fft2_check_HRTF_arrays(t_bin_ambi_reduced_de if (!(a = (t_garray *)pd_findbyclass(hrtf_re, garray_class))) error("%s: no such array", hrtf_re->s_name); - else if (!garray_getfloatarray(a, &npoints, &vec_hrtf_re)) + else if (!iemarray_getarray(a, &npoints, &vec_hrtf_re)) error("%s: bad template for bin_ambi_reduced_decode_fft2", hrtf_re->s_name); else if (npoints < fftsize) error("%s: bad array-size: %d", hrtf_re->s_name, npoints); else if (!(a = (t_garray *)pd_findbyclass(hrtf_im, garray_class))) error("%s: no such array", hrtf_im->s_name); - else if (!garray_getfloatarray(a, &npoints, &vec_hrtf_im)) + else if (!iemarray_getarray(a, &npoints, &vec_hrtf_im)) error("%s: bad template for bin_ambi_reduced_decode_fft2", hrtf_im->s_name); else if (npoints < fftsize) error("%s: bad array-size: %d", hrtf_im->s_name, npoints); diff --git a/src/bin_ambi_reduced_decode_fir.c b/src/bin_ambi_reduced_decode_fir.c index 7664a04..8c4059f 100644 --- a/src/bin_ambi_reduced_decode_fir.c +++ b/src/bin_ambi_reduced_decode_fir.c @@ -768,13 +768,13 @@ static void bin_ambi_reduced_decode_fir_calc_pinv(t_bin_ambi_reduced_decode_fir { t_garray *a; int npoints; - t_float *fadevec; + iemarray_t *fadevec; if((int)(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); - else if (!garray_getfloatarray(a, &npoints, &fadevec)) + else if (!iemarray_getarray(a, &npoints, &fadevec)) error("%s: bad template for bin_ambi_reduced_decode_fir", x->x_s_fade_out_hrir->s_name); else if (npoints < x->x_firsize) error("%s: bad array-size: %d", x->x_s_fade_out_hrir->s_name, npoints); @@ -833,7 +833,8 @@ static void bin_ambi_reduced_decode_fir_check_HRIR_LS_arrays(t_bin_ambi_reduced_ t_garray *a; int npoints; t_symbol *hrir; - t_float *vec_hrir, *vec, *vec_fade_out_hrir; + iemarray_t *vec_hrir; + t_float *vec, *vec_fade_out_hrir; float decr, sum; if(index < 0) @@ -844,7 +845,7 @@ static void bin_ambi_reduced_decode_fir_check_HRIR_LS_arrays(t_bin_ambi_reduced_ hrir = x->x_s_hrir[index]; if (!(a = (t_garray *)pd_findbyclass(hrir, garray_class))) error("%s: no such array", hrir->s_name); - else if (!garray_getfloatarray(a, &npoints, &vec_hrir)) + else if (!iemarray_getarray(a, &npoints, &vec_hrir)) error("%s: bad template for bin_ambi_reduced_decode_fir", hrir->s_name); else { @@ -885,7 +886,7 @@ static void bin_ambi_reduced_decode_fir_check_HRIR_RED_arrays(t_bin_ambi_reduced 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) @@ -897,7 +898,7 @@ static void bin_ambi_reduced_decode_fir_check_HRIR_RED_arrays(t_bin_ambi_reduced if (!(a = (t_garray *)pd_findbyclass(hrir_red, garray_class))) error("%s: no such array", hrir_red->s_name); - else if (!garray_getfloatarray(a, &npoints, &vec_hrir_red)) + else if (!iemarray_getarray(a, &npoints, &vec_hrir_red)) error("%s: bad template for bin_ambi_reduced_decode_fir", hrir_red->s_name); else if (npoints < firsize) error("%s: bad array-size: %d", hrir_red->s_name, npoints); diff --git a/src/bin_ambi_reduced_decode_fir2.c b/src/bin_ambi_reduced_decode_fir2.c index ec6da47..90b476d 100644 --- a/src/bin_ambi_reduced_decode_fir2.c +++ b/src/bin_ambi_reduced_decode_fir2.c @@ -633,7 +633,7 @@ static void bin_ambi_reduced_decode_fir2_calc_pinv(t_bin_ambi_reduced_decode_fir { 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); - else if (!garray_getfloatarray(a, &npoints, &fadevec)) + else if (!iemarray_getarray(a, &npoints, &fadevec)) error("%s: bad template for bin_ambi_reduced_decode_fir2", x->x_s_fade_out_hrir->s_name); else if (npoints < x->x_firsize) error("%s: bad array-size: %d", x->x_s_fade_out_hrir->s_name, npoints); @@ -734,7 +734,7 @@ static void bin_ambi_reduced_decode_fir2_check_HRIR_arrays(t_bin_ambi_reduced_de hrir = x->x_s_hrir[index]; if (!(a = (t_garray *)pd_findbyclass(hrir, garray_class))) error("%s: no such array", hrir->s_name); - else if (!garray_getfloatarray(a, &npoints, &vec_hrir)) + else if (!iemarray_getarray(a, &npoints, &vec_hrir)) error("%s: bad template for bin_ambi_reduced_decode_fir2", hrir->s_name); else { @@ -787,7 +787,7 @@ static void bin_ambi_reduced_decode_fir2_check_HRIR_RED_arrays(t_bin_ambi_reduce if (!(a = (t_garray *)pd_findbyclass(hrir_red, garray_class))) error("%s: no such array", hrir_red->s_name); - else if (!garray_getfloatarray(a, &npoints, &vec_hrir_red)) + else if (!iemarray_getarray(a, &npoints, &vec_hrir_red)) error("%s: bad template for bin_ambi_reduced_decode_fir2", hrir_red->s_name); else if (npoints < firsize) error("%s: bad array-size: %d", hrir_red->s_name, npoints); diff --git a/src/iemlib.h b/src/iemlib.h index 973bfeb..4757df9 100644 --- a/src/iemlib.h +++ b/src/iemlib.h @@ -99,4 +99,16 @@ union tabfudge_f #endif + +/* on 64bit systems we cannot use garray_getfloatarray... */ +#if (defined __x86_64__) +# define iemarray_t t_word +# define iemarray_getarray garray_getfloatwords +# define iemarray_getfloat(pointer, index) (pointer[index].w_float) +#else +# define iemarray_t t_float +# define iemarray_getarray garray_getfloatarray +# define iemarray_getfloat(pointer, index) (pointer[index]) +#endif + #endif -- cgit v1.2.1