commit c2f828d057e3c900529c752e2b392c915d61ebb0
parent 961f446bb0aa232c887110c242f07debd1e20523
Author: Sean Enderby <sean.enderby@gmail.com>
Date: Tue, 12 Jan 2021 17:20:39 +0000
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
@@ -437,6 +437,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++)
{