From d5c627a611f9b9801d40c3345446c789c9900c5d Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Wed, 19 Nov 2003 03:37:40 +0000 Subject: "" svn path=/trunk/; revision=1195 --- externals/grill/xsample/source/record.cpp | 146 ++++++++++++++++-------------- 1 file changed, 76 insertions(+), 70 deletions(-) (limited to 'externals/grill/xsample/source') diff --git a/externals/grill/xsample/source/record.cpp b/externals/grill/xsample/source/record.cpp index 51fd56fc..cc9e074b 100644 --- a/externals/grill/xsample/source/record.cpp +++ b/externals/grill/xsample/source/record.cpp @@ -335,52 +335,55 @@ TMPLDEF V xrecord::s_rec(I n,S *const *invecs,S *const *outvecs) else { // don't append switch(mixmode) { - case 0: - for(i = 0; i < ncur; ++i,++si) { - if(*(on++) >= 0) - { - for(int ci = 0; ci < ICHNS; ++ci) - bf[ci] = sig[ci][si]; - bf += BCHNS; - *(pos++) = p,p += pf,++o; - } - else { - *(pos++) = p = scale(o = 0); - bf = buf->Data(); - } - } - break; - case 1: - for(i = 0; i < ncur; ++i,++si) { - register const S g = *(on++); - if(g >= 0) { - for(int ci = 0; ci < ICHNS; ++ci) - bf[ci] = bf[ci]*(1.-g)+sig[ci][si]*g; - bf += BCHNS; - *(pos++) = p,p += pf,++o; - } - else { - *(pos++) = p = scale(o = 0); - bf = buf->Data(); - } - } - break; - case 2: - for(i = 0; i < ncur; ++i,++si) { - if(*(on++) >= 0) - { - for(int ci = 0; ci < ICHNS; ++ci) - bf[ci] += sig[ci][si]; - bf += BCHNS; - *(pos++) = p,p += pf,++o; - } - else { - *(pos++) = p = scale(o = 0); - bf = buf->Data(); - } - } - break; - } + case 0: { + for(i = 0; i < ncur; ++i,++si) { + if(*(on++) >= 0) + { + for(int ci = 0; ci < ICHNS; ++ci) + bf[ci] = sig[ci][si]; + bf += BCHNS; + *(pos++) = p,p += pf,++o; + } + else { + *(pos++) = p = scale(o = 0); + bf = buf->Data(); + } + } + break; + } + case 1: { + for(i = 0; i < ncur; ++i,++si) { + register const S g = *(on++); + if(g >= 0) { + for(int ci = 0; ci < ICHNS; ++ci) + bf[ci] = bf[ci]*(1.-g)+sig[ci][si]*g; + bf += BCHNS; + *(pos++) = p,p += pf,++o; + } + else { + *(pos++) = p = scale(o = 0); + bf = buf->Data(); + } + } + break; + } + case 2: { + for(i = 0; i < ncur; ++i,++si) { + if(*(on++) >= 0) + { + for(int ci = 0; ci < ICHNS; ++ci) + bf[ci] += sig[ci][si]; + bf += BCHNS; + *(pos++) = p,p += pf,++o; + } + else { + *(pos++) = p = scale(o = 0); + bf = buf->Data(); + } + } + break; + } + } } } else { @@ -388,30 +391,33 @@ TMPLDEF V xrecord::s_rec(I n,S *const *invecs,S *const *outvecs) // Altivec optimization for that! switch(mixmode) { - case 0: - for(int ci = 0; ci < ICHNS; ++ci) { - register S *b = bf+ci; - register const F *s = sig[ci]; - for(i = 0; i < ncur; ++i,b += BCHNS,++s) *b = *s; - } - si += ncur; - break; - case 1: - for(i = 0; i < ncur; ++i,++si) { - register const S w = *(on++); - for(int ci = 0; ci < ICHNS; ++ci) - bf[ci] = bf[ci]*(1.-w)+sig[ci][si]*w; - bf += BCHNS; - } - break; - case 2: - for(int ci = 0; ci < ICHNS; ++ci) { - register S *b = bf+ci; - register const F *s = sig[ci]; - for(i = 0; i < ncur; ++i,b += BCHNS,++s) *b += *s; - } - si += ncur; - break; + case 0: { + for(int ci = 0; ci < ICHNS; ++ci) { + register S *b = bf+ci; + register const F *s = sig[ci]; + for(i = 0; i < ncur; ++i,b += BCHNS,++s) *b = *s; + } + si += ncur; + break; + } + case 1: { + for(i = 0; i < ncur; ++i,++si) { + register const S w = *(on++); + for(int ci = 0; ci < ICHNS; ++ci) + bf[ci] = bf[ci]*(1.-w)+sig[ci][si]*w; + bf += BCHNS; + } + break; + } + case 2: { + for(int ci = 0; ci < ICHNS; ++ci) { + register S *b = bf+ci; + register const F *s = sig[ci]; + for(i = 0; i < ncur; ++i,b += BCHNS,++s) *b += *s; + } + si += ncur; + break; + } } for(i = 0; i < ncur; ++i) { -- cgit v1.2.1