[PD-cvs] pd/src desire.c, 1.1.2.217.2.113, 1.1.2.217.2.114 m_pd.h, 1.4.4.11.2.33.2.36, 1.4.4.11.2.33.2.37 builtins_dsp.c, 1.1.2.13, 1.1.2.14
Mathieu Bouchard
matju at users.sourceforge.net
Fri Jan 5 00:21:26 CET 2007
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21904
Modified Files:
Tag: desiredata
desire.c m_pd.h builtins_dsp.c
Log Message:
removed s_ prefixes in t_signal
Index: m_pd.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/m_pd.h,v
retrieving revision 1.4.4.11.2.33.2.36
retrieving revision 1.4.4.11.2.33.2.37
diff -C2 -d -r1.4.4.11.2.33.2.36 -r1.4.4.11.2.33.2.37
*** m_pd.h 4 Jan 2007 21:37:08 -0000 1.4.4.11.2.33.2.36
--- m_pd.h 4 Jan 2007 23:21:24 -0000 1.4.4.11.2.33.2.37
***************
*** 574,577 ****
--- 574,591 ----
#define MAXSIGSIZE (1 << MAXLOGSIG)
+ /* this doesn't really have to do with C++, just with getting rid of prefixes */
+ #ifdef PD_PLUSPLUS_FACE
+ struct t_signal {
+ int n;
+ t_sample *v;
+ float sr;
+ int refcount;
+ int isborrowed;
+ t_signal *borrowedfrom;
+ t_signal *nextfree;
+ t_signal *nextused;
+ int vecsize;
+ };
+ #else
typedef struct _signal {
int s_n; /* number of points in the array */
***************
*** 585,589 ****
int s_vecsize; /* allocated size of array in points */
} t_signal;
!
typedef t_int *(*t_perfroutine)(t_int *args);
--- 599,603 ----
int s_vecsize; /* allocated size of array in points */
} t_signal;
! #endif
typedef t_int *(*t_perfroutine)(t_int *args);
***************
*** 679,684 ****
t_int downsample; /* downsampling factor */
t_int upsample; /* upsampling factor */
! t_float *s_vec; /* here we hold the resampled data */
int s_n;
t_float *coeffs; /* coefficients for filtering... */
int coefsize;
--- 693,703 ----
t_int downsample; /* downsampling factor */
t_int upsample; /* upsampling factor */
! #ifdef PD_PLUSPLUS_FACE
! t_float *v; /* here we hold the resampled data */
! int s_n;
! #else
! t_float *s_vec;
int s_n;
+ #endif
t_float *coeffs; /* coefficients for filtering... */
int coefsize;
Index: builtins_dsp.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/builtins_dsp.c,v
retrieving revision 1.1.2.13
retrieving revision 1.1.2.14
diff -C2 -d -r1.1.2.13 -r1.1.2.14
*** builtins_dsp.c 4 Jan 2007 23:16:06 -0000 1.1.2.13
--- builtins_dsp.c 4 Jan 2007 23:21:24 -0000 1.1.2.14
***************
*** 90,104 ****
#define DSPDSP(NAME) \
static void NAME##_dsp(t_minus *x, t_signal **sp) { \
! const int n = sp[0]->s_n; \
! if(n&7) dsp_add(NAME##_perform, 4, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, n); \
! else if(SIMD_CHECK3(n,sp[0]->s_vec,sp[1]->s_vec,sp[2]->s_vec)) \
! dsp_add(NAME##_perf_simd, 4, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, n); \
! else dsp_add(NAME##_perf8, 4, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, n);} \
static void scalar##NAME##_dsp(t_scalarminus *x, t_signal **sp) { \
! const int n = sp[0]->s_n;\
! if(n&7) dsp_add(scalar##NAME##_perform, 4, sp[0]->s_vec, &x->b,sp[1]->s_vec, n);\
[...1094 lines suppressed...]
--- 4184,4189 ----
}
static void sigvcf_dsp(t_sigvcf *x, t_signal **sp) {
! x->ctl->isr = 6.28318f/sp[0]->sr;
! dsp_add(sigvcf_perform, 6, sp[0]->v, sp[1]->v, sp[2]->v, sp[3]->v, x->ctl, sp[0]->n);
}
***************
*** 4221,4225 ****
}
static void noise_dsp(t_noise *x, t_signal **sp) {
! dsp_add(noise_perform, 3, sp[0]->s_vec, &x->val, sp[0]->s_n);
}
static void noise_setup() {
--- 4221,4225 ----
}
static void noise_dsp(t_noise *x, t_signal **sp) {
! dsp_add(noise_perform, 3, sp[0]->v, &x->val, sp[0]->n);
}
static void noise_setup() {
Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.217.2.113
retrieving revision 1.1.2.217.2.114
diff -C2 -d -r1.1.2.217.2.113 -r1.1.2.217.2.114
*** desire.c 4 Jan 2007 21:55:35 -0000 1.1.2.217.2.113
--- desire.c 4 Jan 2007 23:21:22 -0000 1.1.2.217.2.114
***************
*** 3188,3197 ****
if (x->directsignal) signal_setborrowed(sp[0], x->directsignal);
else {
! const int vecsize = outsig->s_vecsize;
! /* if the outsig->s_vec is aligned the x->read will also be... */
! if(vecsize&7) dsp_add(vinlet_perform, 3, x, outsig->s_vec,vecsize);
! else if(SIMD_CHECK1(n,outsig->s_vec))
! dsp_add(vinlet_perfsimd, 3, x, outsig->s_vec,vecsize);
! else dsp_add(vinlet_perf8, 3, x, outsig->s_vec,vecsize);
x->read = x->buf;
}
--- 3188,3197 ----
if (x->directsignal) signal_setborrowed(sp[0], x->directsignal);
else {
! const int vecsize = outsig->vecsize;
! /* if the outsig->v is aligned the x->read will also be... */
! if(vecsize&7) dsp_add(vinlet_perform, 3, x, outsig->v,vecsize);
! else if(SIMD_CHECK1(n,outsig->v))
! dsp_add(vinlet_perfsimd, 3, x, outsig->v,vecsize);
! else dsp_add(vinlet_perf8, 3, x, outsig->v,vecsize);
x->read = x->buf;
}
***************
*** 3236,3240 ****
if (parentsigs) {
insig = parentsigs[inlet_getsignalindex(x->inlet)];
! parentvecsize = insig->s_vecsize;
re_parentvecsize = parentvecsize * upsample / downsample;
} else {
--- 3236,3240 ----
if (parentsigs) {
insig = parentsigs[inlet_getsignalindex(x->inlet)];
! parentvecsize = insig->vecsize;
re_parentvecsize = parentvecsize * upsample / downsample;
} else {
***************
*** 3258,3270 ****
x->fill = x->endbuf - (x->hop - prologphase * re_parentvecsize);
if (upsample * downsample == 1)
! dsp_add(vinlet_doprolog, 3, x, insig->s_vec, re_parentvecsize);
else {
! resamplefrom_dsp(&x->updown, insig->s_vec, parentvecsize, re_parentvecsize, x->updown.method);
! dsp_add(vinlet_doprolog, 3, x, x->updown.s_vec, re_parentvecsize);
}
/* } IOhannes */
/* if the input signal's reference count is zero, we have
to free it here because we didn't in ugen_doit(). */
! if (!insig->s_refcount) signal_makereusable(insig);
}
else memset((char *)(x->buf), 0, bufsize * sizeof(*x->buf));
--- 3258,3270 ----
x->fill = x->endbuf - (x->hop - prologphase * re_parentvecsize);
if (upsample * downsample == 1)
! dsp_add(vinlet_doprolog, 3, x, insig->v, re_parentvecsize);
else {
! resamplefrom_dsp(&x->updown, insig->v, parentvecsize, re_parentvecsize, x->updown.method);
! dsp_add(vinlet_doprolog, 3, x, x->updown.v, re_parentvecsize);
}
/* } IOhannes */
/* if the input signal's reference count is zero, we have
to free it here because we didn't in ugen_doit(). */
! if (!insig->refcount) signal_makereusable(insig);
}
else memset((char *)(x->buf), 0, bufsize * sizeof(*x->buf));
***************
*** 3397,3401 ****
t_float *out = (t_float *)(w[2]); /* IOhannes */
t_float *in = x->empty;
! if (x->updown.downsample != x->updown.upsample) out = x->updown.s_vec; /* IOhannes */
for (int n = (int)(w[3]); n--; in++) *out++ = *in, *in = 0;
if (in == x->endbuf) in = x->buf;
--- 3397,3401 ----
t_float *out = (t_float *)(w[2]); /* IOhannes */
t_float *in = x->empty;
! if (x->updown.downsample != x->updown.upsample) out = x->updown.v; /* IOhannes */
for (int n = (int)(w[3]); n--; in++) *out++ = *in, *in = 0;
if (in == x->endbuf) in = x->buf;
***************
*** 3408,3412 ****
t_voutlet *x = (t_voutlet *)(w[1]);
t_float *in = x->empty;
! t_float *out = x->updown.s_vec; /* IOhannes */
for (int n = (int)(w[2]); n--; in++) *out++ = *in, *in = 0;
if (in == x->endbuf) in = x->buf;
--- 3408,3412 ----
t_voutlet *x = (t_voutlet *)(w[1]);
t_float *in = x->empty;
! t_float *out = x->updown.v; /* IOhannes */
for (int n = (int)(w[2]); n--; in++) *out++ = *in, *in = 0;
if (in == x->endbuf) in = x->buf;
***************
*** 3438,3448 ****
if (!x->buf) return;
insig = sp[0];
! if (x->justcopyout) dsp_add_copy(insig->s_vec, x->directsignal->s_vec, insig->s_n);
else if (x->directsignal) {
/* if we're just going to make the signal available on the
parent patch, hand it off to the parent signal. */
! /* this is done elsewhere--> sp[0]->s_refcount++; */
signal_setborrowed(x->directsignal, sp[0]);
! } else dsp_add(voutlet_perform, 3, x, insig->s_vec, insig->s_n);
}
--- 3438,3448 ----
if (!x->buf) return;
insig = sp[0];
! if (x->justcopyout) dsp_add_copy(insig->v, x->directsignal->v, insig->n);
else if (x->directsignal) {
/* if we're just going to make the signal available on the
parent patch, hand it off to the parent signal. */
! /* this is done elsewhere--> sp[0]->refcount++; */
signal_setborrowed(x->directsignal, sp[0]);
! } else dsp_add(voutlet_perform, 3, x, insig->v, insig->n);
}
***************
*** 3463,3467 ****
if (parentsigs) {
outsig = parentsigs[outlet_getsignalindex(x->parentoutlet)];
! parentvecsize = outsig->s_vecsize;
re_parentvecsize = parentvecsize * upsample / downsample;
} else {
--- 3463,3467 ----
if (parentsigs) {
outsig = parentsigs[outlet_getsignalindex(x->parentoutlet)];
! parentvecsize = outsig->vecsize;
re_parentvecsize = parentvecsize * upsample / downsample;
} else {
***************
*** 3496,3503 ****
x->empty = x->buf + re_parentvecsize * epilogphase;
if (upsample * downsample == 1)
! dsp_add(voutlet_doepilog, 3, x, outsig->s_vec, re_parentvecsize);
else {
dsp_add(voutlet_doepilog_resampling, 2, x, re_parentvecsize);
! resampleto_dsp(&x->updown, outsig->s_vec, re_parentvecsize, parentvecsize, x->updown.method);
}
/* } IOhannes */
--- 3496,3503 ----
x->empty = x->buf + re_parentvecsize * epilogphase;
if (upsample * downsample == 1)
! dsp_add(voutlet_doepilog, 3, x, outsig->v, re_parentvecsize);
else {
dsp_add(voutlet_doepilog_resampling, 2, x, re_parentvecsize);
! resampleto_dsp(&x->updown, outsig->v, re_parentvecsize, parentvecsize, x->updown.method);
}
/* } IOhannes */
***************
*** 3510,3514 ****
if (parentsigs) {
t_signal *outsig = parentsigs[outlet_getsignalindex(x->parentoutlet)];
! dsp_add_zero(outsig->s_vec, outsig->s_n);
}
}
--- 3510,3514 ----
if (parentsigs) {
t_signal *outsig = parentsigs[outlet_getsignalindex(x->parentoutlet)];
! dsp_add_zero(outsig->v, outsig->n);
}
}
More information about the Pd-cvs
mailing list