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
72685cf0
Commit
72685cf0
authored
Mar 04, 2015
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reduce resize instantiates for tiny build
parent
612888c0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
resize.cu
modules/gpu/src/cuda/resize.cu
+12
-0
resize.cpp
modules/gpu/src/resize.cpp
+13
-0
No files found.
modules/gpu/src/cuda/resize.cu
View file @
72685cf0
...
...
@@ -342,11 +342,13 @@ namespace cv { namespace gpu { namespace device
template <> struct ResizeNearestDispatcher<uchar> : SelectImplForNearest<uchar> {};
template <> struct ResizeNearestDispatcher<uchar4> : SelectImplForNearest<uchar4> {};
#ifndef OPENCV_TINY_GPU_MODULE
template <> struct ResizeNearestDispatcher<ushort> : SelectImplForNearest<ushort> {};
template <> struct ResizeNearestDispatcher<ushort4> : SelectImplForNearest<ushort4> {};
template <> struct ResizeNearestDispatcher<short> : SelectImplForNearest<short> {};
template <> struct ResizeNearestDispatcher<short4> : SelectImplForNearest<short4> {};
#endif
template <> struct ResizeNearestDispatcher<float> : SelectImplForNearest<float> {};
template <> struct ResizeNearestDispatcher<float4> : SelectImplForNearest<float4> {};
...
...
@@ -380,11 +382,13 @@ namespace cv { namespace gpu { namespace device
template <> struct ResizeLinearDispatcher<uchar> : SelectImplForLinear<uchar> {};
template <> struct ResizeLinearDispatcher<uchar4> : SelectImplForLinear<uchar4> {};
#ifndef OPENCV_TINY_GPU_MODULE
template <> struct ResizeLinearDispatcher<ushort> : SelectImplForLinear<ushort> {};
template <> struct ResizeLinearDispatcher<ushort4> : SelectImplForLinear<ushort4> {};
template <> struct ResizeLinearDispatcher<short> : SelectImplForLinear<short> {};
template <> struct ResizeLinearDispatcher<short4> : SelectImplForLinear<short4> {};
#endif
template <> struct ResizeLinearDispatcher<float> : SelectImplForLinear<float> {};
template <> struct ResizeLinearDispatcher<float4> : SelectImplForLinear<float4> {};
...
...
@@ -410,6 +414,7 @@ namespace cv { namespace gpu { namespace device
}
};
#ifndef OPENCV_TINY_GPU_MODULE
template <> struct ResizeCubicDispatcher<uchar> : SelectImplForCubic<uchar> {};
template <> struct ResizeCubicDispatcher<uchar4> : SelectImplForCubic<uchar4> {};
...
...
@@ -421,6 +426,7 @@ namespace cv { namespace gpu { namespace device
template <> struct ResizeCubicDispatcher<float> : SelectImplForCubic<float> {};
template <> struct ResizeCubicDispatcher<float4> : SelectImplForCubic<float4> {};
#endif
// ResizeAreaDispatcher
...
...
@@ -467,7 +473,11 @@ namespace cv { namespace gpu { namespace device
{
ResizeNearestDispatcher<T>::call,
ResizeLinearDispatcher<T>::call,
#ifdef OPENCV_TINY_GPU_MODULE
0,
#else
ResizeCubicDispatcher<T>::call,
#endif
ResizeAreaDispatcher<T>::call
};
...
...
@@ -482,6 +492,7 @@ namespace cv { namespace gpu { namespace device
template void resize<uchar3>(const PtrStepSzb& src, const PtrStepSzb& srcWhole, int yoff, int xoff, const PtrStepSzb& dst, float fy, float fx, int interpolation, cudaStream_t stream);
template void resize<uchar4>(const PtrStepSzb& src, const PtrStepSzb& srcWhole, int yoff, int xoff, const PtrStepSzb& dst, float fy, float fx, int interpolation, cudaStream_t stream);
#ifndef OPENCV_TINY_GPU_MODULE
template void resize<ushort >(const PtrStepSzb& src, const PtrStepSzb& srcWhole, int yoff, int xoff, const PtrStepSzb& dst, float fy, float fx, int interpolation, cudaStream_t stream);
template void resize<ushort3>(const PtrStepSzb& src, const PtrStepSzb& srcWhole, int yoff, int xoff, const PtrStepSzb& dst, float fy, float fx, int interpolation, cudaStream_t stream);
template void resize<ushort4>(const PtrStepSzb& src, const PtrStepSzb& srcWhole, int yoff, int xoff, const PtrStepSzb& dst, float fy, float fx, int interpolation, cudaStream_t stream);
...
...
@@ -489,6 +500,7 @@ namespace cv { namespace gpu { namespace device
template void resize<short >(const PtrStepSzb& src, const PtrStepSzb& srcWhole, int yoff, int xoff, const PtrStepSzb& dst, float fy, float fx, int interpolation, cudaStream_t stream);
template void resize<short3>(const PtrStepSzb& src, const PtrStepSzb& srcWhole, int yoff, int xoff, const PtrStepSzb& dst, float fy, float fx, int interpolation, cudaStream_t stream);
template void resize<short4>(const PtrStepSzb& src, const PtrStepSzb& srcWhole, int yoff, int xoff, const PtrStepSzb& dst, float fy, float fx, int interpolation, cudaStream_t stream);
#endif
template void resize<float >(const PtrStepSzb& src, const PtrStepSzb& srcWhole, int yoff, int xoff, const PtrStepSzb& dst, float fy, float fx, int interpolation, cudaStream_t stream);
template void resize<float3>(const PtrStepSzb& src, const PtrStepSzb& srcWhole, int yoff, int xoff, const PtrStepSzb& dst, float fy, float fx, int interpolation, cudaStream_t stream);
...
...
modules/gpu/src/resize.cpp
View file @
72685cf0
...
...
@@ -57,6 +57,18 @@ namespace cv { namespace gpu { namespace device
void
cv
::
gpu
::
resize
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
Size
dsize
,
double
fx
,
double
fy
,
int
interpolation
,
Stream
&
stream
)
{
typedef
void
(
*
func_t
)(
const
PtrStepSzb
&
src
,
const
PtrStepSzb
&
srcWhole
,
int
yoff
,
int
xoff
,
const
PtrStepSzb
&
dst
,
float
fy
,
float
fx
,
int
interpolation
,
cudaStream_t
stream
);
#ifdef OPENCV_TINY_GPU_MODULE
static
const
func_t
funcs
[
6
][
4
]
=
{
{
device
::
resize
<
uchar
>
,
0
/*device::resize<uchar2>*/
,
device
::
resize
<
uchar3
>
,
device
::
resize
<
uchar4
>
},
{
0
,
0
,
0
,
0
},
{
0
,
0
,
0
,
0
},
{
0
,
0
,
0
,
0
},
{
0
,
0
,
0
,
0
},
{
device
::
resize
<
float
>
,
0
/*device::resize<float2>*/
,
device
::
resize
<
float3
>
,
device
::
resize
<
float4
>
}
};
#else
static
const
func_t
funcs
[
6
][
4
]
=
{
{
device
::
resize
<
uchar
>
,
0
/*device::resize<uchar2>*/
,
device
::
resize
<
uchar3
>
,
device
::
resize
<
uchar4
>
},
...
...
@@ -66,6 +78,7 @@ void cv::gpu::resize(const GpuMat& src, GpuMat& dst, Size dsize, double fx, doub
{
0
/*device::resize<int>*/
,
0
/*device::resize<int2>*/
,
0
/*device::resize<int3>*/
,
0
/*device::resize<int4>*/
},
{
device
::
resize
<
float
>
,
0
/*device::resize<float2>*/
,
device
::
resize
<
float3
>
,
device
::
resize
<
float4
>
}
};
#endif
CV_Assert
(
src
.
depth
()
<=
CV_32F
&&
src
.
channels
()
<=
4
);
CV_Assert
(
interpolation
==
INTER_NEAREST
||
interpolation
==
INTER_LINEAR
||
interpolation
==
INTER_CUBIC
||
interpolation
==
INTER_AREA
);
...
...
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