Welcome to mirror list, hosted at ThFree Co, Russian Federation.

DspDither.h « src - github.com/mpc-hc/sanear.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b41c37e217fc72c59f73fc6294c86aca84dd9fdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once

#include "DspBase.h"

namespace SaneAudioRenderer
{
    class DspDither final
        : public DspBase
    {
    public:

        DspDither() = default;
        DspDither(const DspDither&) = delete;
        DspDither& operator=(const DspDither&) = delete;

        void Initialize(DspFormat outputFormat);

        std::wstring Name() override { return L"Dither"; }

        bool Active() override;

        void Process(DspChunk& chunk) override;
        void Finish(DspChunk& chunk) override;

    private:

        bool m_active = false;
        std::array<float, 18> m_error1;
        std::array<float, 18> m_error2;
        std::minstd_rand m_rand;
    };
}