commit 181b24a19867ee7d193cd54afc8daec4b492fbd7
parent d6bacca14e0c740af78cd2d8d8b36172806ab1a1
Author: Dan L CazarÃn <d.levin256@gmail.com>
Date: Tue, 27 Jun 2023 19:53:08 +0100
Merge pull request #124 from seanlikeskites/dev
Fix inverse DCT
Diffstat:
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/capi/capi.cpp b/capi/capi.cpp
@@ -262,19 +262,19 @@ extern "C"
void kfr_dct_execute_f32(KFR_DCT_PLAN_F32* plan, float* out, const float* in, uint8_t* temp)
{
- reinterpret_cast<kfr::dct_plan<float>*>(plan)->execute(out, in, temp);
+ reinterpret_cast<kfr::dct_plan<float>*>(plan)->execute(out, in, temp, kfr::cfalse);
}
void kfr_dct_execute_f64(KFR_DCT_PLAN_F64* plan, double* out, const double* in, uint8_t* temp)
{
- reinterpret_cast<kfr::dct_plan<double>*>(plan)->execute(out, in, temp);
+ reinterpret_cast<kfr::dct_plan<double>*>(plan)->execute(out, in, temp, kfr::cfalse);
}
void kfr_dct_execute_inverse_f32(KFR_DCT_PLAN_F32* plan, float* out, const float* in, uint8_t* temp)
{
- reinterpret_cast<kfr::dct_plan<float>*>(plan)->execute(out, in, temp);
+ reinterpret_cast<kfr::dct_plan<float>*>(plan)->execute(out, in, temp, kfr::ctrue);
}
void kfr_dct_execute_inverse_f64(KFR_DCT_PLAN_F64* plan, double* out, const double* in, uint8_t* temp)
{
- reinterpret_cast<kfr::dct_plan<double>*>(plan)->execute(out, in, temp);
+ reinterpret_cast<kfr::dct_plan<double>*>(plan)->execute(out, in, temp, kfr::ctrue);
}
void kfr_dct_delete_plan_f32(KFR_DCT_PLAN_F32* plan)
diff --git a/include/kfr/dft/fft.hpp b/include/kfr/dft/fft.hpp
@@ -434,6 +434,7 @@ struct dct_plan : dft_plan<T>
else
{
mirrored = make_complex(make_univector(in, size) * cos(t), make_univector(in, size) * -sin(t));
+ mirrored[0] = mirrored[0] * 0.5;
dft_plan<T>::execute(mirrored_dft.data(), mirrored.data(), temp, cfalse);
for (size_t i = 0; i < halfSize; i++)
{