You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.6 KiB
C++

#ifndef GUARD_LEERILY_DIMORAIC_MATHOM_PIMPS_OUT_4424
#define GUARD_LEERILY_DIMORAIC_MATHOM_PIMPS_OUT_4424
#pragma once
#include "../channel.hpp"
#include "../options.hpp"
#include <memory>
#include <span>
#include <vector>
class FfdshowDecoder
{
public:
void Init(float rate);
[[nodiscard]] std::span<const float> Decode(std::span<const float> in);
[[nodiscard]] static constexpr unsigned GetBlockSize() noexcept { return 0; }
[[nodiscard]] std::vector<Option> GetOptions();
[[nodiscard]] static std::vector<Channel::E> GetChannels();
[[nodiscard]] static constexpr uint32_t GetDelay() noexcept { return 0; }
bool enable_lfe = true;
float center_gain = 1;
private:
static float passive_lock(float x);
void matrix_decode(const float *in, int k, int il,
int ir, bool decode_rear,
int dlbuflen,
float l_fwr, float r_fwr,
float lpr_fwr, float lmr_fwr,
float *adapt_l_gain, float *adapt_r_gain,
float *adapt_lpr_gain, float *adapt_lmr_gain,
float *lf, float *rf, float *lr,
float *rr, float *cf) const;
float rate = -1;
unsigned int dlbuflen;
int cyc_pos;
float l_fwr, r_fwr, lpr_fwr, lmr_fwr;
std::vector<float> fwrbuf_l, fwrbuf_r;
float adapt_l_gain, adapt_r_gain, adapt_lpr_gain, adapt_lmr_gain;
std::vector<float> lf, rf, lr, rr, cf, cr;
float LFE_buf[256];
unsigned int lfe_pos;
std::unique_ptr<float[]> filter_coefs_lfe;
unsigned int len125;
std::unique_ptr<float[]> calc_coefficients_125Hz_lowpass();
std::vector<float> out_buf;
};
#endif