pcm/Traits: drop "_type" from type names

This commit is contained in:
Max Kellermann 2020-01-03 15:59:50 +01:00
parent 4937d77cb6
commit 44d7a1d8d2
8 changed files with 49 additions and 49 deletions

View File

@ -128,7 +128,7 @@ mpc_to_mpd_sample(MPC_SAMPLE_FORMAT sample)
}
static void
mpc_to_mpd_buffer(MpcdecSampleTraits::pointer_type dest,
mpc_to_mpd_buffer(MpcdecSampleTraits::pointer dest,
const MPC_SAMPLE_FORMAT *src,
unsigned num_samples)
{

View File

@ -89,9 +89,9 @@ PcmDither::DitherConvert(typename ST::value_type sample) noexcept
template<typename ST, typename DT>
inline void
PcmDither::DitherConvert(typename DT::pointer_type dest,
typename ST::const_pointer_type src,
typename ST::const_pointer_type src_end) noexcept
PcmDither::DitherConvert(typename DT::pointer dest,
typename ST::const_pointer src,
typename ST::const_pointer src_end) noexcept
{
while (src < src_end)
*dest++ = DitherConvert<ST, DT>(*src++);

View File

@ -76,9 +76,9 @@ private:
typename DT::value_type DitherConvert(typename ST::value_type sample) noexcept;
template<typename ST, typename DT>
void DitherConvert(typename DT::pointer_type dest,
typename ST::const_pointer_type src,
typename ST::const_pointer_type src_end) noexcept;
void DitherConvert(typename DT::pointer dest,
typename ST::const_pointer src,
typename ST::const_pointer src_end) noexcept;
};
#endif

View File

@ -46,8 +46,8 @@ PcmAddVolume(PcmDither &dither,
template<SampleFormat F, class Traits=SampleTraits<F>>
static void
PcmAddVolume(PcmDither &dither,
typename Traits::pointer_type a,
typename Traits::const_pointer_type b,
typename Traits::pointer a,
typename Traits::const_pointer b,
size_t n, int volume1, int volume2) noexcept
{
for (size_t i = 0; i != n; ++i)
@ -65,8 +65,8 @@ PcmAddVolumeVoid(PcmDither &dither,
assert(size % sample_size == 0);
PcmAddVolume<F, Traits>(dither,
typename Traits::pointer_type(a),
typename Traits::const_pointer_type(b),
typename Traits::pointer(a),
typename Traits::const_pointer(b),
size / sample_size,
volume1, volume2);
}
@ -143,8 +143,8 @@ PcmAdd(typename Traits::value_type _a, typename Traits::value_type _b) noexcept
template<SampleFormat F, class Traits=SampleTraits<F>>
static void
PcmAdd(typename Traits::pointer_type a,
typename Traits::const_pointer_type b,
PcmAdd(typename Traits::pointer a,
typename Traits::const_pointer b,
size_t n) noexcept
{
for (size_t i = 0; i != n; ++i)
@ -158,8 +158,8 @@ PcmAddVoid(void *a, const void *b, size_t size) noexcept
constexpr size_t sample_size = Traits::SAMPLE_SIZE;
assert(size % sample_size == 0);
PcmAdd<F, Traits>(typename Traits::pointer_type(a),
typename Traits::const_pointer_type(b),
PcmAdd<F, Traits>(typename Traits::pointer(a),
typename Traits::const_pointer(b),
size / sample_size);
}

View File

@ -55,10 +55,10 @@ StereoToMono(typename Traits::value_type _a,
}
template<SampleFormat F, class Traits=SampleTraits<F>>
static typename Traits::pointer_type
StereoToMono(typename Traits::pointer_type dest,
typename Traits::const_pointer_type src,
typename Traits::const_pointer_type end) noexcept
static typename Traits::pointer
StereoToMono(typename Traits::pointer dest,
typename Traits::const_pointer src,
typename Traits::const_pointer end) noexcept
{
while (src != end) {
const auto a = *src++;
@ -71,11 +71,11 @@ StereoToMono(typename Traits::pointer_type dest,
}
template<SampleFormat F, class Traits=SampleTraits<F>>
static typename Traits::pointer_type
NToStereo(typename Traits::pointer_type dest,
static typename Traits::pointer
NToStereo(typename Traits::pointer dest,
unsigned src_channels,
typename Traits::const_pointer_type src,
typename Traits::const_pointer_type end) noexcept
typename Traits::const_pointer src,
typename Traits::const_pointer end) noexcept
{
assert((end - src) % src_channels == 0);
@ -100,11 +100,11 @@ NToStereo(typename Traits::pointer_type dest,
* remaining (surround) channels are filled with silence.
*/
template<SampleFormat F, class Traits=SampleTraits<F>>
static typename Traits::pointer_type
StereoToN(typename Traits::pointer_type dest,
static typename Traits::pointer
StereoToN(typename Traits::pointer dest,
unsigned dest_channels,
typename Traits::const_pointer_type src,
typename Traits::const_pointer_type end) noexcept
typename Traits::const_pointer src,
typename Traits::const_pointer end) noexcept
{
assert(dest_channels > 2);
assert((end - src) % 2 == 0);
@ -127,12 +127,12 @@ StereoToN(typename Traits::pointer_type dest,
}
template<SampleFormat F, class Traits=SampleTraits<F>>
static typename Traits::pointer_type
NToM(typename Traits::pointer_type dest,
static typename Traits::pointer
NToM(typename Traits::pointer dest,
unsigned dest_channels,
unsigned src_channels,
typename Traits::const_pointer_type src,
typename Traits::const_pointer_type end) noexcept
typename Traits::const_pointer src,
typename Traits::const_pointer end) noexcept
{
assert((end - src) % src_channels == 0);

View File

@ -36,8 +36,8 @@ struct PerSampleConvert : C {
typedef typename C::SrcTraits SrcTraits;
typedef typename C::DstTraits DstTraits;
void Convert(typename DstTraits::pointer_type gcc_restrict out,
typename SrcTraits::const_pointer_type gcc_restrict in,
void Convert(typename DstTraits::pointer gcc_restrict out,
typename SrcTraits::const_pointer gcc_restrict in,
size_t n) const {
transform_n(in, n, out, C::Convert);
}
@ -91,8 +91,8 @@ public:
typedef typename Portable::SrcTraits SrcTraits;
typedef typename Portable::DstTraits DstTraits;
void Convert(typename DstTraits::pointer_type out,
typename SrcTraits::const_pointer_type in,
void Convert(typename DstTraits::pointer out,
typename SrcTraits::const_pointer in,
size_t n) const {
Optimized::Convert(out, in, n);

View File

@ -43,12 +43,12 @@ struct SampleTraits<SampleFormat::S8> {
/**
* A writable pointer.
*/
typedef value_type *pointer_type;
typedef value_type *pointer;
/**
* A read-only pointer.
*/
typedef const value_type *const_pointer_type;
typedef const value_type *const_pointer;
/**
* A "long" type that is large and accurate enough for adding
@ -94,8 +94,8 @@ struct SampleTraits<SampleFormat::S8> {
template<>
struct SampleTraits<SampleFormat::S16> {
typedef int16_t value_type;
typedef value_type *pointer_type;
typedef const value_type *const_pointer_type;
typedef value_type *pointer;
typedef const value_type *const_pointer;
typedef int_least32_t sum_type;
typedef int_least32_t long_type;
@ -111,8 +111,8 @@ struct SampleTraits<SampleFormat::S16> {
template<>
struct SampleTraits<SampleFormat::S32> {
typedef int32_t value_type;
typedef value_type *pointer_type;
typedef const value_type *const_pointer_type;
typedef value_type *pointer;
typedef const value_type *const_pointer;
typedef int_least64_t sum_type;
typedef int_least64_t long_type;
@ -128,8 +128,8 @@ struct SampleTraits<SampleFormat::S32> {
template<>
struct SampleTraits<SampleFormat::S24_P32> {
typedef int32_t value_type;
typedef value_type *pointer_type;
typedef const value_type *const_pointer_type;
typedef value_type *pointer;
typedef const value_type *const_pointer;
typedef int_least32_t sum_type;
typedef int_least64_t long_type;
@ -145,8 +145,8 @@ struct SampleTraits<SampleFormat::S24_P32> {
template<>
struct SampleTraits<SampleFormat::FLOAT> {
typedef float value_type;
typedef value_type *pointer_type;
typedef const value_type *const_pointer_type;
typedef value_type *pointer;
typedef const value_type *const_pointer;
typedef float sum_type;
typedef float long_type;
@ -161,8 +161,8 @@ struct SampleTraits<SampleFormat::FLOAT> {
template<>
struct SampleTraits<SampleFormat::DSD> {
typedef uint8_t value_type;
typedef value_type *pointer_type;
typedef const value_type *const_pointer_type;
typedef value_type *pointer;
typedef const value_type *const_pointer;
static constexpr size_t SAMPLE_SIZE = sizeof(value_type);

View File

@ -90,8 +90,8 @@ pcm_volume_sample(PcmDither &dither,
template<SampleFormat F, class Traits=SampleTraits<F>>
static void
pcm_volume_change(PcmDither &dither,
typename Traits::pointer_type dest,
typename Traits::const_pointer_type src,
typename Traits::pointer dest,
typename Traits::const_pointer src,
size_t n,
int volume) noexcept
{