};
CV_EXPORTS void dftInit2D(DftContext & c, int _width, int _height, int _depth, int _src_channels, int _dst_channels, int flags, int _nonzero_rows = 0);
-CV_EXPORTS void dftRun2D(const DftContext & c, const void * src, int src_step, void * dst, int dst_step);
+CV_EXPORTS void dft2D(const DftContext & c, const void * src, int src_step, void * dst, int dst_step);
CV_EXPORTS void dftFree2D(DftContext & c);
-CV_EXPORTS void dftInit(DftContext & c, int len, int count, int depth, int flags, bool * useBuffer = 0);
-CV_EXPORTS void dftRun(const DftContext & c, const void * src, void * dst);
-CV_EXPORTS void dftFree(DftContext & c);
+CV_EXPORTS void dftInit1D(DftContext & c, int len, int count, int depth, int flags, bool * useBuffer = 0);
+CV_EXPORTS void dft1D(const DftContext & c, const void * src, void * dst);
+CV_EXPORTS void dftFree1D(DftContext & c);
-CV_EXPORTS void dctInit(DftContext & c, int width, int height, int depth, int flags);
-CV_EXPORTS void dctRun(const DftContext & c, const void * src, int src_step, void * dst, int dst_step);
-CV_EXPORTS void dctFree(DftContext & c);
+CV_EXPORTS void dctInit2D(DftContext & c, int width, int height, int depth, int flags);
+CV_EXPORTS void dct2D(const DftContext & c, const void * src, int src_step, void * dst, int dst_step);
+CV_EXPORTS void dctFree2D(DftContext & c);
//! @} core_hal
count = height;
}
needBufferA = isInplace;
- hal::dftInit(contextA, len, count, depth, f, &needBufferA);
+ hal::dftInit1D(contextA, len, count, depth, f, &needBufferA);
if (needBufferA)
tmp_bufA.allocate(len * complex_elem_size);
}
count = width;
f |= CV_HAL_DFT_STAGE_COLS;
needBufferB = isInplace;
- hal::dftInit(contextB, len, count, depth, f, &needBufferB);
+ hal::dftInit1D(contextB, len, count, depth, f, &needBufferB);
if (needBufferB)
tmp_bufB.allocate(len * complex_elem_size);
{
if (useIpp)
return;
- hal::dftFree(contextA);
- hal::dftFree(contextB);
+ hal::dftFree1D(contextA);
+ hal::dftFree1D(contextB);
}
protected:
if( needBufferA )
dptr = tmp_bufA;
- hal::dftRun(contextA, sptr, dptr);
+ hal::dft1D(contextA, sptr, dptr);
if( needBufferA )
memcpy( dptr0, dptr + dptr_offset, dst_full_len );
}
if( even )
- hal::dftRun(contextB, buf1, dbuf1);
- hal::dftRun(contextB, buf0, dbuf0);
+ hal::dft1D(contextB, buf1, dbuf1);
+ hal::dft1D(contextB, buf0, dbuf0);
if( stage_dst_channels == 1 )
{
if( i+1 < b )
{
CopyFrom2Columns( sptr0, src_step, buf0, buf1, len, complex_elem_size );
- hal::dftRun(contextB, buf1, dbuf1);
+ hal::dft1D(contextB, buf1, dbuf1);
}
else
CopyColumn( sptr0, src_step, buf0, complex_elem_size, len, complex_elem_size );
- hal::dftRun(contextB, buf0, dbuf0);
+ hal::dft1D(contextB, buf0, dbuf0);
if( i+1 < b )
CopyTo2Columns( dbuf0, dbuf1, dptr0, dst_step, len, complex_elem_size );
//================== 1D ======================
-void dftInit(DftContext & context, int len, int count, int depth, int flags, bool *needBuffer)
+void dftInit1D(DftContext & context, int len, int count, int depth, int flags, bool *needBuffer)
{
- int res = cv_hal_dftInit(&context.impl, len, count, depth, flags, needBuffer);
+ int res = cv_hal_dftInit1D(&context.impl, len, count, depth, flags, needBuffer);
if (res == CV_HAL_ERROR_OK)
{
context.useReplacement = true;
c->init(len, count, depth, flags, needBuffer);
}
-void dftRun(const DftContext & context, const void * src, void * dst)
+void dft1D(const DftContext & context, const void * src, void * dst)
{
if (context.useReplacement)
{
- int res = cv_hal_dftRun(context.impl, src, dst);
+ int res = cv_hal_dft1D(context.impl, src, dst);
if (res != CV_HAL_ERROR_OK)
{
CV_Error( CV_StsNotImplemented, "Custom HAL implementation failed to call dftRun");
c->run(src, dst);
}
-void dftFree(DftContext & context)
+void dftFree1D(DftContext & context)
{
if (context.useReplacement)
{
- int res = cv_hal_dftFree(context.impl);
+ int res = cv_hal_dftFree1D(context.impl);
if (res != CV_HAL_ERROR_OK)
{
CV_Error( CV_StsNotImplemented, "Custom HAL implementation failed to call dftFree");
//================== 2D ======================
void dftInit2D(DftContext & c,
- int _width, int _height, int _depth, int _src_channels, int _dst_channels,
- int flags,
- int _nonzero_rows)
+ int _width, int _height, int _depth, int _src_channels, int _dst_channels,
+ int flags,
+ int _nonzero_rows)
{
int res = cv_hal_dftInit2D(&c.impl, _width, _height, _depth, _src_channels, _dst_channels, flags, _nonzero_rows);
if (res == CV_HAL_ERROR_OK)
c.impl = (void*)d;
}
-void dftRun2D(const DftContext & c,
- const void * src, int src_step, void * dst, int dst_step)
+void dft2D(const DftContext & c,
+ const void * src, int src_step, void * dst, int dst_step)
{
if (c.useReplacement)
{
- int res = cv_hal_dftRun2D(c.impl, (uchar*)src, src_step, (uchar*)dst, dst_step);
+ int res = cv_hal_dft2D(c.impl, (uchar*)src, src_step, (uchar*)dst, dst_step);
if (res != CV_HAL_ERROR_OK)
{
CV_Error( CV_StsNotImplemented, "Custom HAL implementation failed to call dftRun2D");
f |= CV_HAL_DFT_IS_INPLACE;
hal::DftContext c;
hal::dftInit2D(c, src.cols, src.rows, depth, src.channels(), dst.channels(), f, nonzero_rows);
- hal::dftRun2D(c, src.data, (int)src.step, dst.data, (int)dst.step);
+ hal::dft2D(c, src.data, (int)src.step, dst.data, (int)dst.step);
hal::dftFree2D(c);
}
namespace hal {
-void dctInit(DftContext & c, int width, int height, int depth, int flags)
+void dctInit2D(DftContext & c, int width, int height, int depth, int flags)
{
- int res = cv_hal_dctInit(&c.impl, width, height, depth, flags);
+ int res = cv_hal_dctInit2D(&c.impl, width, height, depth, flags);
if (res == CV_HAL_ERROR_OK)
{
c.useReplacement = true;
c.impl = impl;
}
-void dctRun(const DftContext & c, const void * src, int src_step, void * dst, int dst_step)
+void dct2D(const DftContext & c, const void * src, int src_step, void * dst, int dst_step)
{
if (c.useReplacement)
{
- int res = cv_hal_dctRun(c.impl, src, src_step, dst, dst_step);
+ int res = cv_hal_dct2D(c.impl, src, src_step, dst, dst_step);
if (res != CV_HAL_ERROR_OK)
{
CV_Error( CV_StsNotImplemented, "Custom HAL implementation failed to call dctRun");
impl->run((uchar*)src, src_step, (uchar*)dst, dst_step);
}
-void dctFree(DftContext & c)
+void dctFree2D(DftContext & c)
{
if (c.useReplacement)
{
- int res = cv_hal_dctFree(c.impl);
+ int res = cv_hal_dctFree2D(c.impl);
if (res != CV_HAL_ERROR_OK)
{
CV_Error( CV_StsNotImplemented, "Custom HAL implementation failed to call dctFree");
f |= CV_HAL_DFT_IS_CONTINUOUS;
hal::DftContext c;
- hal::dctInit(c, src.cols, src.rows, depth, f);
- hal::dctRun(c, (void*)src.data, (int)src.step, (void*)dst.data, (int)dst.step);
- hal::dctFree(c);
+ hal::dctInit2D(c, src.cols, src.rows, depth, f);
+ hal::dct2D(c, (void*)src.data, (int)src.step, (void*)dst.data, (int)dst.step);
+ hal::dctFree2D(c);
}
# pragma warning( pop )
#endif
-inline int hal_ni_dftInit(void**, int, int, int, int, bool*) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
-inline int hal_ni_dftRun(const void*, const void*, void*) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
-inline int hal_ni_dftFree(void*) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
+inline int hal_ni_dftInit1D(void**, int, int, int, int, bool*) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
+inline int hal_ni_dft1D(const void*, const void*, void*) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
+inline int hal_ni_dftFree1D(void*) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
-#define cv_hal_dftInit hal_ni_dftInit
-#define cv_hal_dftRun hal_ni_dftRun
-#define cv_hal_dftFree hal_ni_dftFree
+#define cv_hal_dftInit1D hal_ni_dftInit1D
+#define cv_hal_dft1D hal_ni_dft1D
+#define cv_hal_dftFree1D hal_ni_dftFree1D
inline int hal_ni_dftInit2D(void **, int, int, int, int, int, int, int) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
-inline int hal_ni_dftRun2D(const void *, const void *, int, void *, int) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
+inline int hal_ni_dft2D(const void *, const void *, int, void *, int) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
inline int hal_ni_dftFree2D(void *) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
#define cv_hal_dftInit2D hal_ni_dftInit2D
-#define cv_hal_dftRun2D hal_ni_dftRun2D
+#define cv_hal_dft2D hal_ni_dft2D
#define cv_hal_dftFree2D hal_ni_dftFree2D
-inline int hal_ni_dctInit(void **, int, int, int, int) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
-inline int hal_ni_dctRun(const void *, const void *, int, void *, int) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
-inline int hal_ni_dctFree(void *) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
+inline int hal_ni_dctInit2D(void **, int, int, int, int) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
+inline int hal_ni_dct2D(const void *, const void *, int, void *, int) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
+inline int hal_ni_dctFree2D(void *) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }
-#define cv_hal_dctInit hal_ni_dctInit
-#define cv_hal_dctRun hal_ni_dctRun
-#define cv_hal_dctFree hal_ni_dctFree
+#define cv_hal_dctInit2D hal_ni_dctInit2D
+#define cv_hal_dct2D hal_ni_dct2D
+#define cv_hal_dctFree2D hal_ni_dctFree2D
#include "custom_hal.hpp"