commit 05bf393a66bf6add0fd34663a0213fc9f3f198cf
parent c6afc785fe1f9a3e5e62a244d1ea1d4226f9cfc1
Author: d.levin256@gmail.com <d.levin256@gmail.com>
Date: Thu, 3 Nov 2016 07:38:02 +0300
Set size in upsample/downsample
Diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/include/kfr/dsp/sample_rate_conversion.hpp b/include/kfr/dsp/sample_rate_conversion.hpp
@@ -214,6 +214,8 @@ struct expression_upsample<2, E> : expression<E>
using value_type = value_type_of<E>;
using T = value_type;
+ size_t size() const noexcept { return expression<E>::size() * 2; }
+
template <size_t N>
vec<T, N> operator()(cinput_t cinput, size_t index, vec_t<T, N>) const
{
@@ -236,6 +238,8 @@ struct expression_upsample<4, E> : expression<E>
using value_type = value_type_of<E>;
using T = value_type;
+ size_t size() const noexcept { return expression<E>::size() * 4; }
+
template <size_t N>
vec<T, N> operator()(cinput_t cinput, size_t index, vec_t<T, N>) const
{
@@ -255,7 +259,6 @@ struct expression_upsample<4, E> : expression<E>
return 0;
}
}
- template <typename T>
vec<T, 1> operator()(cinput_t cinput, size_t index, vec_t<T, 1>) const
{
if (index & 3)
@@ -272,6 +275,8 @@ struct expression_downsample<2, offset, E> : expression<E>
using value_type = value_type_of<E>;
using T = value_type;
+ size_t size() const noexcept { return expression<E>::size() / 2; }
+
template <size_t N>
vec<T, N> operator()(cinput_t cinput, size_t index, vec_t<T, N>) const
{
@@ -287,6 +292,8 @@ struct expression_downsample<4, offset, E> : expression<E>
using value_type = value_type_of<E>;
using T = value_type;
+ size_t size() const noexcept { return expression<E>::size() / 4; }
+
template <size_t N>
vec<T, N> operator()(cinput_t cinput, size_t index, vec_t<T, N>) const
{