pcm/PcmFormat: use transform_n()

This commit is contained in:
Max Kellermann 2019-08-05 11:02:11 +02:00
parent a189a9e478
commit 91e565d92e

View File

@ -23,6 +23,7 @@
#include "FloatConvert.hxx" #include "FloatConvert.hxx"
#include "ShiftConvert.hxx" #include "ShiftConvert.hxx"
#include "util/ConstBuffer.hxx" #include "util/ConstBuffer.hxx"
#include "util/TransformN.hxx"
#include "Dither.cxx" // including the .cxx file to get inlined templates #include "Dither.cxx" // including the .cxx file to get inlined templates
@ -38,8 +39,7 @@ struct PerSampleConvert : C {
void Convert(typename DstTraits::pointer_type gcc_restrict out, void Convert(typename DstTraits::pointer_type gcc_restrict out,
typename SrcTraits::const_pointer_type gcc_restrict in, typename SrcTraits::const_pointer_type gcc_restrict in,
size_t n) const { size_t n) const {
for (size_t i = 0; i != n; ++i) transform_n(in, n, out, C::Convert);
out[i] = C::Convert(in[i]);
} }
}; };