[PD-cvs] externals/ext13 receive13~.c,1.1.1.1,1.2

Tim Blechmann timblech at users.sourceforge.net
Fri Sep 3 09:56:30 CEST 2004


Update of /cvsroot/pure-data/externals/ext13
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1804

Modified Files:
	receive13~.c 
Log Message:
added vectorized funtion


Index: receive13~.c
===================================================================
RCS file: /cvsroot/pure-data/externals/ext13/receive13~.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** receive13~.c	9 Jul 2002 12:41:52 -0000	1.1.1.1
--- receive13~.c	3 Sep 2004 07:56:28 -0000	1.2
***************
*** 12,16 ****
  /* ----------------------------- receive13~ ----------------------------- */
  
!  void *sigreceive13_new(t_symbol *s)
  {
      t_sigreceive13 *x = (t_sigreceive13 *)pd_new(sigreceive13_class);
--- 12,16 ----
  /* ----------------------------- receive13~ ----------------------------- */
  
! void *sigreceive13_new(t_symbol *s)
  {
      t_sigreceive13 *x = (t_sigreceive13 *)pd_new(sigreceive13_class);
***************
*** 23,27 ****
  }
  
!  t_int *sigreceive13_perform(t_int *w)
  {
      t_sigreceive13 *x = (t_sigreceive13 *)(w[1]);
--- 23,27 ----
  }
  
! t_int *sigreceive13_perform(t_int *w)
  {
      t_sigreceive13 *x = (t_sigreceive13 *)(w[1]);
***************
*** 42,46 ****
  }
  
!  void sigreceive13_set(t_sigreceive13 *x, t_symbol *s)
  {
      t_sigsend13 *sender = (t_sigsend13 *)pd_findbyclass((x->x_sym = s),
--- 42,72 ----
  }
  
! /* tb: vectorized */
! t_int *sigreceive13_perf8(t_int *w)
! {
!     t_sigreceive13 *x = (t_sigreceive13 *)(w[1]);
!     t_float *out = (t_float *)(w[2]);
!     int n = (int)(w[3]);
!     t_float *in = x->x_wherefrom;
!     if (in)
!     {
! 	for (; n; n -= 8, in += 8, out += 8)
! 	{
! 	    out[0] = in[0]; out[1] = in[1]; out[2] = in[2]; out[3] = in[3]; 
! 	    out[4] = in[4]; out[5] = in[5]; out[6] = in[6]; out[7] = in[7]; 
! 	}
!     }
!     else
!     {
!     	for (; n; n -= 8, in += 8, out += 8)
! 	{
! 	    out[0] = 0; out[1] = 0; out[2] = 0; out[3] = 0; 
! 	    out[4] = 0; out[5] = 0; out[6] = 0; out[7] = 0; 
! 	}
!     }
!     return (w+4);
! }
! 
! void sigreceive13_set(t_sigreceive13 *x, t_symbol *s)
  {
      t_sigsend13 *sender = (t_sigsend13 *)pd_findbyclass((x->x_sym = s),
***************
*** 72,77 ****
      {
      	sigreceive13_set(x, x->x_sym);
!     	dsp_add(sigreceive13_perform, 3,
!     	    x, sp[0]->s_vec, sp[0]->s_n);
      }
  }
--- 98,107 ----
      {
      	sigreceive13_set(x, x->x_sym);
! 	if(sp[0]->s_n&7)
! 	    dsp_add(sigreceive13_perform, 3,
! 		    x, sp[0]->s_vec, sp[0]->s_n);
! 	else
! 	    dsp_add(sigreceive13_perf8, 3,
! 		    x, sp[0]->s_vec, sp[0]->s_n);
      }
  }





More information about the Pd-cvs mailing list