diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2003-11-19 03:37:40 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2003-11-19 03:37:40 +0000 |
commit | d5c627a611f9b9801d40c3345446c789c9900c5d (patch) | |
tree | fab502304d9513eb56ef595255a1357912c69b28 /externals/grill/xsample/source | |
parent | 5aa36d82aa1122e4cda553006dd55cb3ac6afd79 (diff) |
""
svn path=/trunk/; revision=1195
Diffstat (limited to 'externals/grill/xsample/source')
-rw-r--r-- | externals/grill/xsample/source/record.cpp | 146 |
1 files changed, 76 insertions, 70 deletions
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) { |