From d556ae211ce1da3ff7e2c460cf67e37490ced917 Mon Sep 17 00:00:00 2001 From: Martin Reinecke Date: Mon, 22 Jul 2019 09:37:19 +0200 Subject: [PATCH] cleanup DCT/DST, part 1 --- pocketfft_hdronly.h | 133 +++++++++++++++++--------------------------- 1 file changed, 50 insertions(+), 83 deletions(-) diff --git a/pocketfft_hdronly.h b/pocketfft_hdronly.h index eba3398..b875db8 100644 --- a/pocketfft_hdronly.h +++ b/pocketfft_hdronly.h @@ -2342,40 +2342,29 @@ template class T_dct2 { constexpr T0 sqrt2=T0(1.414213562373095048801688724209698L); size_t N=length(); - if (N==1) - c[0]*=2*fct; - else if (N==2) + size_t NS2 = (N+1)/2; + for (size_t i=2; i class T_dct3 constexpr T0 sqrt2=T0(1.414213562373095048801688724209698L); size_t N=length(); if (ortho) c[0]*=sqrt2; - if (N==1) - c[0]*=fct; - else if (N==2) + size_t NS2 = (N+1)/2; + for (size_t k=1, kc=N-1; k class T_dst2 { constexpr T0 sqrt2=T0(1.414213562373095048801688724209698L); size_t N=length(); - if (N==1) - c[0]*=2*fct; - else - { - for (size_t k=1; k class T_dst3 constexpr T0 sqrt2=T0(1.414213562373095048801688724209698L); size_t N=length(); if (ortho) c[0]*=sqrt2; - if (N==1) - c[0]*=fct; - else - { - size_t NS2 = N/2; - for (size_t k=0, kc=N-1; k class T_dst4 template POCKETFFT_NOINLINE void exec(T c[], T0 fct, bool /*ortho*/) { size_t N=length(); - //if (N==1) { c[0]*=fct; return; } size_t NS2 = N/2; for (size_t k=0, kc=N-1; k