aboutsummaryrefslogtreecommitdiff
path: root/plugins/dfsound/xa.c
diff options
context:
space:
mode:
authorTwinaphex2019-01-29 06:45:03 +0100
committerGitHub2019-01-29 06:45:03 +0100
commit46486658dc234b657802a44ce99c99a9cb7ddcaa (patch)
tree486c017601a8b71d6b918b0d975d3bd7949c565d /plugins/dfsound/xa.c
parent0e35159d407910cff7200dced66cf848a8df6e7e (diff)
parent636462080c6b984993d7427b5d7688a362e45c2f (diff)
downloadpcsx_rearmed-46486658dc234b657802a44ce99c99a9cb7ddcaa.tar.gz
pcsx_rearmed-46486658dc234b657802a44ce99c99a9cb7ddcaa.tar.bz2
pcsx_rearmed-46486658dc234b657802a44ce99c99a9cb7ddcaa.zip
Merge pull request #218 from Sakitoshi/master
updated gaussian audio interpolation
Diffstat (limited to 'plugins/dfsound/xa.c')
-rw-r--r--plugins/dfsound/xa.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/plugins/dfsound/xa.c b/plugins/dfsound/xa.c
index ad7e824..bfebe3e 100644
--- a/plugins/dfsound/xa.c
+++ b/plugins/dfsound/xa.c
@@ -189,16 +189,16 @@ INLINE void FeedXA(xa_decode_t *xap)
spos -= 0x10000L;
}
vl = (spos >> 6) & ~3;
- vr=(gauss[vl]*gvall0)&~2047;
- vr+=(gauss[vl+1]*gvall(1))&~2047;
- vr+=(gauss[vl+2]*gvall(2))&~2047;
- vr+=(gauss[vl+3]*gvall(3))&~2047;
- l= (vr >> 11) & 0xffff;
- vr=(gauss[vl]*gvalr0)&~2047;
- vr+=(gauss[vl+1]*gvalr(1))&~2047;
- vr+=(gauss[vl+2]*gvalr(2))&~2047;
- vr+=(gauss[vl+3]*gvalr(3))&~2047;
- l |= vr << 5;
+ vr=(gauss[vl]*gvall0) >> 15;
+ vr+=(gauss[vl+1]*gvall(1)) >> 15;
+ vr+=(gauss[vl+2]*gvall(2)) >> 15;
+ vr+=(gauss[vl+3]*gvall(3)) >> 15;
+ l= vr & 0xffff;
+ vr=(gauss[vl]*gvalr0) >> 15;
+ vr+=(gauss[vl+1]*gvalr(1)) >> 15;
+ vr+=(gauss[vl+2]*gvalr(2)) >> 15;
+ vr+=(gauss[vl+3]*gvalr(3)) >> 15;
+ l |= vr << 16;
}
else
{
@@ -246,16 +246,16 @@ INLINE void FeedXA(xa_decode_t *xap)
spos -= 0x10000L;
}
vl = (spos >> 6) & ~3;
- vr=(gauss[vl]*gvall0)&~2047;
- vr+=(gauss[vl+1]*gvall(1))&~2047;
- vr+=(gauss[vl+2]*gvall(2))&~2047;
- vr+=(gauss[vl+3]*gvall(3))&~2047;
- l= (vr >> 11) & 0xffff;
- vr=(gauss[vl]*gvalr0)&~2047;
- vr+=(gauss[vl+1]*gvalr(1))&~2047;
- vr+=(gauss[vl+2]*gvalr(2))&~2047;
- vr+=(gauss[vl+3]*gvalr(3))&~2047;
- l |= vr << 5;
+ vr=(gauss[vl]*gvall0) >> 15;
+ vr+=(gauss[vl+1]*gvall(1)) >> 15;
+ vr+=(gauss[vl+2]*gvall(2)) >> 15;
+ vr+=(gauss[vl+3]*gvall(3)) >> 15;
+ l= vr & 0xffff;
+ vr=(gauss[vl]*gvalr0) >> 15;
+ vr+=(gauss[vl+1]*gvalr(1)) >> 15;
+ vr+=(gauss[vl+2]*gvalr(2)) >> 15;
+ vr+=(gauss[vl+3]*gvalr(3)) >> 15;
+ l |= vr << 16;
}
else
{
@@ -298,11 +298,11 @@ INLINE void FeedXA(xa_decode_t *xap)
spos -= 0x10000L;
}
vl = (spos >> 6) & ~3;
- vr=(gauss[vl]*gvall0)&~2047;
- vr+=(gauss[vl+1]*gvall(1))&~2047;
- vr+=(gauss[vl+2]*gvall(2))&~2047;
- vr+=(gauss[vl+3]*gvall(3))&~2047;
- l1=s= vr >> 11;
+ vr=(gauss[vl]*gvall0) >> 15;
+ vr+=(gauss[vl+1]*gvall(1)) >> 15;
+ vr+=(gauss[vl+2]*gvall(2)) >> 15;
+ vr+=(gauss[vl+3]*gvall(3)) >> 15;
+ l1=s= vr;
l1 &= 0xffff;
}
else
@@ -343,11 +343,11 @@ INLINE void FeedXA(xa_decode_t *xap)
spos -= 0x10000L;
}
vl = (spos >> 6) & ~3;
- vr=(gauss[vl]*gvall0)&~2047;
- vr+=(gauss[vl+1]*gvall(1))&~2047;
- vr+=(gauss[vl+2]*gvall(2))&~2047;
- vr+=(gauss[vl+3]*gvall(3))&~2047;
- l=s= vr >> 11;
+ vr=(gauss[vl]*gvall0) >> 15;
+ vr+=(gauss[vl+1]*gvall(1)) >> 15;
+ vr+=(gauss[vl+2]*gvall(2)) >> 15;
+ vr+=(gauss[vl+3]*gvall(3)) >> 15;
+ l=s= vr;
}
else
{