diff options
author | Chris Robinson <[email protected]> | 2019-12-24 23:41:26 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-12-24 23:41:26 -0800 |
commit | de2c64c06f256323dad457a353fd396f01ef1f21 (patch) | |
tree | 66ba5b7abcd5f863c8664d5ae0a9bddfe238245f /alc/filters/nfc.cpp | |
parent | 04b8f2a0422a8c98915f48c40e17f7decf557c7c (diff) |
Pass a span to the NFC filters
Diffstat (limited to 'alc/filters/nfc.cpp')
-rw-r--r-- | alc/filters/nfc.cpp | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/alc/filters/nfc.cpp b/alc/filters/nfc.cpp index e4436b27..9a28517c 100644 --- a/alc/filters/nfc.cpp +++ b/alc/filters/nfc.cpp @@ -278,10 +278,8 @@ void NfcFilter::adjust(const float w0) noexcept } -void NfcFilter::process1(float *RESTRICT dst, const float *RESTRICT src, const size_t count) +void NfcFilter::process1(const al::span<const float> src, float *RESTRICT dst) { - ASSUME(count > 0); - const float gain{first.gain}; const float b1{first.b1}; const float a1{first.a1}; @@ -293,14 +291,12 @@ void NfcFilter::process1(float *RESTRICT dst, const float *RESTRICT src, const s z1 += y; return out; }; - std::transform(src, src+count, dst, proc_sample); + std::transform(src.cbegin(), src.cend(), dst, proc_sample); first.z[0] = z1; } -void NfcFilter::process2(float *RESTRICT dst, const float *RESTRICT src, const size_t count) +void NfcFilter::process2(const al::span<const float> src, float *RESTRICT dst) { - ASSUME(count > 0); - const float gain{second.gain}; const float b1{second.b1}; const float b2{second.b2}; @@ -316,15 +312,13 @@ void NfcFilter::process2(float *RESTRICT dst, const float *RESTRICT src, const s z1 += y; return out; }; - std::transform(src, src+count, dst, proc_sample); + std::transform(src.cbegin(), src.cend(), dst, proc_sample); second.z[0] = z1; second.z[1] = z2; } -void NfcFilter::process3(float *RESTRICT dst, const float *RESTRICT src, const size_t count) +void NfcFilter::process3(const al::span<const float> src, float *RESTRICT dst) { - ASSUME(count > 0); - const float gain{third.gain}; const float b1{third.b1}; const float b2{third.b2}; @@ -347,16 +341,14 @@ void NfcFilter::process3(float *RESTRICT dst, const float *RESTRICT src, const s z3 += y; return out; }; - std::transform(src, src+count, dst, proc_sample); + std::transform(src.cbegin(), src.cend(), dst, proc_sample); third.z[0] = z1; third.z[1] = z2; third.z[2] = z3; } -void NfcFilter::process4(float *RESTRICT dst, const float *RESTRICT src, const size_t count) +void NfcFilter::process4(const al::span<const float> src, float *RESTRICT dst) { - ASSUME(count > 0); - const float gain{fourth.gain}; const float b1{fourth.b1}; const float b2{fourth.b2}; @@ -383,7 +375,7 @@ void NfcFilter::process4(float *RESTRICT dst, const float *RESTRICT src, const s z3 += y; return out; }; - std::transform(src, src+count, dst, proc_sample); + std::transform(src.cbegin(), src.cend(), dst, proc_sample); fourth.z[0] = z1; fourth.z[1] = z2; fourth.z[2] = z3; |