MCPcopy Create free account
hub / github.com/creatale/node-dv / CCSIDFT

Function CCSIDFT

deps/opencv/modules/core/src/dxt.cpp:1086–1244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1084 re[0], re[1], im[1], ... , re[n/2-1], im[n/2-1], re[n/2] OR
1085 re(0), 0, re(1), im(1), ..., re(n/2-1), im((n+1)/2-1) [, re((n+1)/2), 0] */
1086template<typename T> static void
1087CCSIDFT( const T* src, T* dst, int n, int nf, int* factors, const int* itab,
1088 const Complex<T>* wave, int tab_size,
1089 const void*
1090#ifdef USE_IPP_DFT
1091 spec
1092#endif
1093 , Complex<T>* buf,
1094 int flags, double _scale )
1095{
1096 int complex_input = (flags & DFT_COMPLEX_INPUT_OR_OUTPUT) != 0;
1097 int j, k, n2 = (n+1) >> 1;
1098 T scale = (T)_scale;
1099 T save_s1 = 0.;
1100 T t0, t1, t2, t3, t;
1101
1102 assert( tab_size == n );
1103
1104 if( complex_input )
1105 {
1106 assert( src != dst );
1107 save_s1 = src[1];
1108 ((T*)src)[1] = src[0];
1109 src++;
1110 }
1111#ifdef USE_IPP_DFT
1112 if( spec )
1113 {
1114 ippsDFTInv_PackToR( src, dst, spec, (uchar*)buf );
1115 goto finalize;
1116 }
1117#endif
1118 if( n == 1 )
1119 {
1120 dst[0] = (T)(src[0]*scale);
1121 }
1122 else if( n == 2 )
1123 {
1124 t = (src[0] + src[1])*scale;
1125 dst[1] = (src[0] - src[1])*scale;
1126 dst[0] = t;
1127 }
1128 else if( n & 1 )
1129 {
1130 Complex<T>* _src = (Complex<T>*)(src-1);
1131 Complex<T>* _dst = (Complex<T>*)dst;
1132
1133 _dst[0].re = src[0];
1134 _dst[0].im = 0;
1135 for( j = 1; j < n2; j++ )
1136 {
1137 int k0 = itab[j], k1 = itab[n-j];
1138 t0 = _src[j].re; t1 = _src[j].im;
1139 _dst[k0].re = t0; _dst[k0].im = -t1;
1140 _dst[k1].re = t0; _dst[k1].im = t1;
1141 }
1142
1143 DFT( _dst, _dst, n, nf, factors, itab, wave,

Callers 3

CCSIDFT_32fFunction · 0.85
CCSIDFT_64fFunction · 0.85
IDCTFunction · 0.85

Calls 2

ippsDFTInv_PackToRFunction · 0.85
DFTFunction · 0.85

Tested by

no test coverage detected