fixed random failures in Core_DFT.complex_output2 test (the case of input_mat.cols...
authorRostislav Vasilikhin <rostislav.vasilikhin@intel.com>
Mon, 5 Sep 2016 19:33:31 +0000 (22:33 +0300)
committerRostislav Vasilikhin <rostislav.vasilikhin@intel.com>
Wed, 7 Sep 2016 11:56:22 +0000 (14:56 +0300)
modules/core/src/dxt.cpp

index 79cb31c..90eb392 100644 (file)
@@ -1070,11 +1070,12 @@ RealDFT( const T* src, T* dst, int n, int nf, int* factors, const int* itab,
         }
     }
 
-    if( complex_output && (n & 1) == 0 )
+    if (complex_output && ((n & 1) == 0 || n == 1))
     {
         dst[-1] = dst[0];
         dst[0] = 0;
-        dst[n] = 0;
+        if (n > 1)
+            dst[n] = 0;
     }
 }