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.

58 lines
1.7 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:
[[nodiscard]] std::span<const float> Decode(
float rate, std::span<const float> in);
void Reset();
[[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, const int k, const int il,
const int ir, bool decode_rear,
const 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);
int olddelay = -1;
float old_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(float rate);
std::vector<float> out_buf;
};
#endif