diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2013-01-20 17:20:30 +0100 |
|---|---|---|
| committer | Pierre Bourdon <delroth@gmail.com> | 2013-01-20 17:20:30 +0100 |
| commit | 7252becf24583e6bf34f89889944611ccf343bb4 (patch) | |
| tree | 8028a8aa8bca87fe4991676ef6b51d8dd7a09ccf /Source/Core | |
| parent | c6629015048bc9d4aa18d297c0c41d3e26293843 (diff) | |
Fix the voice LPF implementation
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AXStructs.h | 4 | ||||
| -rw-r--r-- | Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX_Voice.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AXStructs.h b/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AXStructs.h index cc24bd78b7..2ac9ddd2f0 100644 --- a/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AXStructs.h +++ b/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AXStructs.h @@ -231,8 +231,8 @@ struct PBLowPassFilter { u16 enabled; s16 yn1; - s16 a0; - s16 b0; + u16 a0; + u16 b0; }; struct AXPB diff --git a/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX_Voice.h b/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX_Voice.h index fcc1bb7999..f41c4c47ff 100644 --- a/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX_Voice.h +++ b/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX_Voice.h @@ -342,10 +342,10 @@ void MixAdd(int* out, const s16* input, u32 count, u16* pvol, s16* dpop, bool ra // Execute a low pass filter on the samples using one history value. Returns // the new history value. -s16 LowPassFilter(s16* samples, u32 count, s16 yn1, s16 a0, s16 b0) +s16 LowPassFilter(s16* samples, u32 count, s16 yn1, u16 a0, u16 b0) { for (u32 i = 0; i < count; ++i) - yn1 = samples[i] = (s32)a0 * samples[i] - (s32)b0 * yn1; + yn1 = samples[i] = (a0 * (s32)samples[i] + b0 * (s32)yn1) >> 15; return yn1; } |
