1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-26 19:17:52 +00:00

Makes some attempt at stereo support, with the Amstrad CPC being the test case.

This commit is contained in:
Thomas Harte
2020-02-15 18:55:19 -05:00
parent 89d6b85b83
commit e66a3523b6
3 changed files with 33 additions and 23 deletions
+3 -3
View File
@@ -49,15 +49,15 @@ class FIRFilter {
@param src The source buffer to apply the filter to.
@returns The result of applying the filter.
*/
inline short apply(const short *src) const {
inline short apply(const short *src, size_t stride = 1) const {
#ifdef __APPLE__
short result;
vDSP_dotpr_s1_15(filter_coefficients_.data(), 1, src, 1, &result, filter_coefficients_.size());
vDSP_dotpr_s1_15(filter_coefficients_.data(), 1, src, stride, &result, filter_coefficients_.size());
return result;
#else
int outputValue = 0;
for(std::size_t c = 0; c < filter_coefficients_.size(); ++c) {
outputValue += filter_coefficients_[c] * src[c];
outputValue += filter_coefficients_[c] * src[c * stride];
}
return static_cast<short>(outputValue >> FixedShift);
#endif