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
9ca39821
Commit
9ca39821
authored
Aug 03, 2017
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: divUp function
parent
2e608b1c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
10 deletions
+17
-10
utility.hpp
modules/core/include/opencv2/core/utility.hpp
+17
-0
matrix.cpp
modules/core/src/matrix.cpp
+0
-5
fast_nlmeans_denoising_opencl.hpp
modules/photo/src/fast_nlmeans_denoising_opencl.hpp
+0
-5
No files found.
modules/core/include/opencv2/core/utility.hpp
View file @
9ca39821
...
@@ -444,6 +444,23 @@ static inline size_t alignSize(size_t sz, int n)
...
@@ -444,6 +444,23 @@ static inline size_t alignSize(size_t sz, int n)
return
(
sz
+
n
-
1
)
&
-
n
;
return
(
sz
+
n
-
1
)
&
-
n
;
}
}
/** @brief Integer division with result round up.
Use this function instead of `ceil((float)a / b)` expressions.
@sa alignSize
*/
static
inline
int
divUp
(
int
a
,
unsigned
int
b
)
{
CV_DbgAssert
(
a
>=
0
);
return
(
a
+
b
-
1
)
/
b
;
}
/** @overload */
static
inline
size_t
divUp
(
size_t
a
,
unsigned
int
b
)
{
return
(
a
+
b
-
1
)
/
b
;
}
/** @brief Enables or disables the optimized code.
/** @brief Enables or disables the optimized code.
The function can be used to dynamically turn on and off optimized code (code that uses SSE2, AVX,
The function can be used to dynamically turn on and off optimized code (code that uses SSE2, AVX,
...
...
modules/core/src/matrix.cpp
View file @
9ca39821
...
@@ -3406,11 +3406,6 @@ static TransposeInplaceFunc transposeInplaceTab[] =
...
@@ -3406,11 +3406,6 @@ static TransposeInplaceFunc transposeInplaceTab[] =
#ifdef HAVE_OPENCL
#ifdef HAVE_OPENCL
static
inline
int
divUp
(
int
a
,
int
b
)
{
return
(
a
+
b
-
1
)
/
b
;
}
static
bool
ocl_transpose
(
InputArray
_src
,
OutputArray
_dst
)
static
bool
ocl_transpose
(
InputArray
_src
,
OutputArray
_dst
)
{
{
const
ocl
::
Device
&
dev
=
ocl
::
Device
::
getDefault
();
const
ocl
::
Device
&
dev
=
ocl
::
Device
::
getDefault
();
...
...
modules/photo/src/fast_nlmeans_denoising_opencl.hpp
View file @
9ca39821
...
@@ -23,11 +23,6 @@ enum
...
@@ -23,11 +23,6 @@ enum
CTA_SIZE_DEFAULT
=
256
CTA_SIZE_DEFAULT
=
256
};
};
static
int
divUp
(
int
a
,
int
b
)
{
return
(
a
+
b
-
1
)
/
b
;
}
template
<
typename
FT
,
typename
ST
,
typename
WT
>
template
<
typename
FT
,
typename
ST
,
typename
WT
>
static
bool
ocl_calcAlmostDist2Weight
(
UMat
&
almostDist2Weight
,
static
bool
ocl_calcAlmostDist2Weight
(
UMat
&
almostDist2Weight
,
int
searchWindowSize
,
int
templateWindowSize
,
int
searchWindowSize
,
int
templateWindowSize
,
...
...
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