Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
612888c0
Commit
612888c0
authored
Mar 04, 2015
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reduce remap instantiates for tiny build
parent
e7b55f49
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
4 deletions
+49
-4
remap.cu
modules/gpu/src/cuda/remap.cu
+37
-4
remap.cpp
modules/gpu/src/remap.cpp
+12
-0
No files found.
modules/gpu/src/cuda/remap.cu
View file @
612888c0
...
...
@@ -209,6 +209,7 @@ namespace cv { namespace gpu { namespace device
typedef void (*caller_t)(PtrStepSz<T> src, PtrStepSz<T> srcWhole, int xoff, int yoff, PtrStepSzf xmap, PtrStepSzf ymap,
PtrStepSz<T> dst, const float* borderValue, cudaStream_t stream, bool cc20);
#ifdef OPENCV_TINY_GPU_MODULE
static const caller_t callers[3][5] =
{
{
...
...
@@ -216,25 +217,55 @@ namespace cv { namespace gpu { namespace device
RemapDispatcher<PointFilter, BrdReplicate, T>::call,
RemapDispatcher<PointFilter, BrdConstant, T>::call,
RemapDispatcher<PointFilter, BrdReflect, T>::call,
RemapDispatcher<PointFilter, BrdWrap, T>::call
0/*RemapDispatcher<PointFilter, BrdWrap, T>::call*/,
},
{
RemapDispatcher<LinearFilter, BrdReflect101, T>::call,
RemapDispatcher<LinearFilter, BrdReplicate, T>::call,
RemapDispatcher<LinearFilter, BrdConstant, T>::call,
RemapDispatcher<LinearFilter, BrdReflect, T>::call,
RemapDispatcher<LinearFilter, BrdWrap, T>::call
0/*RemapDispatcher<LinearFilter, BrdWrap, T>::call*/,
},
{
0/*RemapDispatcher<CubicFilter, BrdReflect101, T>::call*/,
0/*RemapDispatcher<CubicFilter, BrdReplicate, T>::call*/,
0/*RemapDispatcher<CubicFilter, BrdConstant, T>::call*/,
0/*RemapDispatcher<CubicFilter, BrdReflect, T>::call*/,
0/*RemapDispatcher<CubicFilter, BrdWrap, T>::call*/,
}
};
#else
static const caller_t callers[3][5] =
{
{
RemapDispatcher<PointFilter, BrdReflect101, T>::call,
RemapDispatcher<PointFilter, BrdReplicate, T>::call,
RemapDispatcher<PointFilter, BrdConstant, T>::call,
RemapDispatcher<PointFilter, BrdReflect, T>::call,
RemapDispatcher<PointFilter, BrdWrap, T>::call,
},
{
RemapDispatcher<LinearFilter, BrdReflect101, T>::call,
RemapDispatcher<LinearFilter, BrdReplicate, T>::call,
RemapDispatcher<LinearFilter, BrdConstant, T>::call,
RemapDispatcher<LinearFilter, BrdReflect, T>::call,
RemapDispatcher<LinearFilter, BrdWrap, T>::call,
},
{
RemapDispatcher<CubicFilter, BrdReflect101, T>::call,
RemapDispatcher<CubicFilter, BrdReplicate, T>::call,
RemapDispatcher<CubicFilter, BrdConstant, T>::call,
RemapDispatcher<CubicFilter, BrdReflect, T>::call,
RemapDispatcher<CubicFilter, BrdWrap, T>::call
RemapDispatcher<CubicFilter, BrdWrap, T>::call
,
}
};
#endif
const caller_t caller = callers[interpolation][borderMode];
if (!caller)
cv::gpu::error("Unsupported input parameters for remap", __FILE__, __LINE__, "");
caller
s[interpolation][borderMode]
(static_cast< PtrStepSz<T> >(src), static_cast< PtrStepSz<T> >(srcWhole), xoff, yoff, xmap, ymap,
caller(static_cast< PtrStepSz<T> >(src), static_cast< PtrStepSz<T> >(srcWhole), xoff, yoff, xmap, ymap,
static_cast< PtrStepSz<T> >(dst), borderValue, stream, cc20);
}
...
...
@@ -243,6 +274,7 @@ namespace cv { namespace gpu { namespace device
template void remap_gpu<uchar3>(PtrStepSzb src, PtrStepSzb srcWhole, int xoff, int yoff, PtrStepSzf xmap, PtrStepSzf ymap, PtrStepSzb dst, int interpolation, int borderMode, const float* borderValue, cudaStream_t stream, bool cc20);
template void remap_gpu<uchar4>(PtrStepSzb src, PtrStepSzb srcWhole, int xoff, int yoff, PtrStepSzf xmap, PtrStepSzf ymap, PtrStepSzb dst, int interpolation, int borderMode, const float* borderValue, cudaStream_t stream, bool cc20);
#ifndef OPENCV_TINY_GPU_MODULE
//template void remap_gpu<schar>(PtrStepSzb src, PtrStepSzb srcWhole, int xoff, int yoff, PtrStepSzf xmap, PtrStepSzf ymap, PtrStepSzb dst, int interpolation, int borderMode, const float* borderValue, cudaStream_t stream, bool cc20);
//template void remap_gpu<char2>(PtrStepSzb src, PtrStepSzb srcWhole, int xoff, int yoff, PtrStepSzf xmap, PtrStepSzf ymap, PtrStepSzb dst, int interpolation, int borderMode, const float* borderValue, cudaStream_t stream, bool cc20);
//template void remap_gpu<char3>(PtrStepSzb src, PtrStepSzb srcWhole, int xoff, int yoff, PtrStepSzf xmap, PtrStepSzf ymap, PtrStepSzb dst, int interpolation, int borderMode, const float* borderValue, cudaStream_t stream, bool cc20);
...
...
@@ -262,6 +294,7 @@ namespace cv { namespace gpu { namespace device
//template void remap_gpu<int2>(PtrStepSzb src, PtrStepSzb srcWhole, int xoff, int yoff, PtrStepSzf xmap, PtrStepSzf ymap, PtrStepSzb dst, int interpolation, int borderMode, const float* borderValue, cudaStream_t stream, bool cc20);
//template void remap_gpu<int3>(PtrStepSzb src, PtrStepSzb srcWhole, int xoff, int yoff, PtrStepSzf xmap, PtrStepSzf ymap, PtrStepSzb dst, int interpolation, int borderMode, const float* borderValue, cudaStream_t stream, bool cc20);
//template void remap_gpu<int4>(PtrStepSzb src, PtrStepSzb srcWhole, int xoff, int yoff, PtrStepSzf xmap, PtrStepSzf ymap, PtrStepSzb dst, int interpolation, int borderMode, const float* borderValue, cudaStream_t stream, bool cc20);
#endif
template void remap_gpu<float >(PtrStepSzb src, PtrStepSzb srcWhole, int xoff, int yoff, PtrStepSzf xmap, PtrStepSzf ymap, PtrStepSzb dst, int interpolation, int borderMode, const float* borderValue, cudaStream_t stream, bool cc20);
//template void remap_gpu<float2>(PtrStepSzb src, PtrStepSzb srcWhole, int xoff, int yoff, PtrStepSzf xmap, PtrStepSzf ymap, PtrStepSzb dst, int interpolation, int borderMode, const float* borderValue, cudaStream_t stream, bool cc20);
...
...
modules/gpu/src/remap.cpp
View file @
612888c0
...
...
@@ -65,6 +65,17 @@ void cv::gpu::remap(const GpuMat& src, GpuMat& dst, const GpuMat& xmap, const Gp
typedef
void
(
*
func_t
)(
PtrStepSzb
src
,
PtrStepSzb
srcWhole
,
int
xoff
,
int
yoff
,
PtrStepSzf
xmap
,
PtrStepSzf
ymap
,
PtrStepSzb
dst
,
int
interpolation
,
int
borderMode
,
const
float
*
borderValue
,
cudaStream_t
stream
,
bool
cc20
);
#ifdef OPENCV_TINY_GPU_MODULE
static
const
func_t
funcs
[
6
][
4
]
=
{
{
remap_gpu
<
uchar
>
,
0
/*remap_gpu<uchar2>*/
,
remap_gpu
<
uchar3
>
,
remap_gpu
<
uchar4
>
},
{
0
,
0
,
0
,
0
},
{
0
,
0
,
0
,
0
},
{
0
,
0
,
0
,
0
},
{
0
,
0
,
0
,
0
},
{
remap_gpu
<
float
>
,
0
/*remap_gpu<float2>*/
,
remap_gpu
<
float3
>
,
remap_gpu
<
float4
>
}
};
#else
static
const
func_t
funcs
[
6
][
4
]
=
{
{
remap_gpu
<
uchar
>
,
0
/*remap_gpu<uchar2>*/
,
remap_gpu
<
uchar3
>
,
remap_gpu
<
uchar4
>
},
...
...
@@ -74,6 +85,7 @@ void cv::gpu::remap(const GpuMat& src, GpuMat& dst, const GpuMat& xmap, const Gp
{
0
/*remap_gpu<int>*/
,
0
/*remap_gpu<int2>*/
,
0
/*remap_gpu<int3>*/
,
0
/*remap_gpu<int4>*/
},
{
remap_gpu
<
float
>
,
0
/*remap_gpu<float2>*/
,
remap_gpu
<
float3
>
,
remap_gpu
<
float4
>
}
};
#endif
CV_Assert
(
src
.
depth
()
<=
CV_32F
&&
src
.
channels
()
<=
4
);
CV_Assert
(
xmap
.
type
()
==
CV_32F
&&
ymap
.
type
()
==
CV_32F
&&
xmap
.
size
()
==
ymap
.
size
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment