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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user