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
50c9367d
Commit
50c9367d
authored
Nov 27, 2014
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3451 from wangyan42164:ocl_pyrup_unrolled
parents
73ba4356
6e705055
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
pyr_up.cl
modules/imgproc/src/opencl/pyr_up.cl
+15
-15
No files found.
modules/imgproc/src/opencl/pyr_up.cl
View file @
50c9367d
...
...
@@ -165,27 +165,27 @@ __kernel void pyrUp_unrolled(__global const uchar * src, int src_step, int src_o
//
(
x,y
)
sum
=
co3
*
s_srcPatch[1
+
(
ly
>>
1
)
][1
+
((
lx
-
2
)
>>
1
)
]
;
sum
=
sum
+
co1
*
s_srcPatch[1
+
(
ly
>>
1
)
][1
+
((
lx
)
>>
1
)
]
;
sum
=
sum
+
co3
*
s_srcPatch[1
+
(
ly
>>
1
)
][1
+
((
lx
+
2
)
>>
1
)
]
;
sum
=
mad
(
co1,
s_srcPatch[1
+
(
ly
>>
1
)
][1
+
((
lx
)
>>
1
)
],
sum
)
;
sum
=
mad
(
co3,
s_srcPatch[1
+
(
ly
>>
1
)
][1
+
((
lx
+
2
)
>>
1
)
],
sum
)
;
s_dstPatch[1
+
get_local_id
(
1
)
][lx]
=
sum
;
//
(
x+1,y
)
sum
=
co2
*
s_srcPatch[1
+
(
ly
>>
1
)
][1
+
((
lx
+
1
-
1
)
>>
1
)
]
;
sum
=
sum
+
co2
*
s_srcPatch[1
+
(
ly
>>
1
)
][1
+
((
lx
+
1
+
1
)
>>
1
)
]
;
sum
=
mad
(
co2,
s_srcPatch[1
+
(
ly
>>
1
)
][1
+
((
lx
+
1
+
1
)
>>
1
)
],
sum
)
;
s_dstPatch[1
+
get_local_id
(
1
)
][lx+1]
=
sum
;
if
(
ly
<
1
)
{
//
(
x,y
)
sum
=
co3
*
s_srcPatch[0][1
+
((
lx
-
2
)
>>
1
)
]
;
sum
=
sum
+
co1
*
s_srcPatch[0][1
+
((
lx
)
>>
1
)
]
;
sum
=
sum
+
co3
*
s_srcPatch[0][1
+
((
lx
+
2
)
>>
1
)
]
;
sum
=
mad
(
co1,
s_srcPatch[0][1
+
((
lx
)
>>
1
)
],
sum
)
;
sum
=
mad
(
co3,
s_srcPatch[0][1
+
((
lx
+
2
)
>>
1
)
],
sum
)
;
s_dstPatch[0][lx]
=
sum
;
//
(
x+1,y
)
sum
=
co2
*
s_srcPatch[0][1
+
((
lx
+
1
-
1
)
>>
1
)
]
;
sum
=
sum
+
co2
*
s_srcPatch[0][1
+
((
lx
+
1
+
1
)
>>
1
)
]
;
sum
=
mad
(
co2,
s_srcPatch[0][1
+
((
lx
+
1
+
1
)
>>
1
)
],
sum
)
;
s_dstPatch[0][lx+1]
=
sum
;
}
...
...
@@ -193,13 +193,13 @@ __kernel void pyrUp_unrolled(__global const uchar * src, int src_step, int src_o
{
//
(
x,y
)
sum
=
co3
*
s_srcPatch[LOCAL_SIZE+1][1
+
((
lx
-
2
)
>>
1
)
]
;
sum
=
sum
+
co1
*
s_srcPatch[LOCAL_SIZE+1][1
+
((
lx
)
>>
1
)
]
;
sum
=
sum
+
co3
*
s_srcPatch[LOCAL_SIZE+1][1
+
((
lx
+
2
)
>>
1
)
]
;
sum
=
mad
(
co1,
s_srcPatch[LOCAL_SIZE+1][1
+
((
lx
)
>>
1
)
],
sum
)
;
sum
=
mad
(
co3,
s_srcPatch[LOCAL_SIZE+1][1
+
((
lx
+
2
)
>>
1
)
],
sum
)
;
s_dstPatch[LOCAL_SIZE+1][lx]
=
sum
;
//
(
x+1,y
)
sum
=
co2
*
s_srcPatch[LOCAL_SIZE+1][1
+
((
lx
+
1
-
1
)
>>
1
)
]
;
sum
=
sum
+
co2
*
s_srcPatch[LOCAL_SIZE+1][1
+
((
lx
+
1
+
1
)
>>
1
)
]
;
sum
=
mad
(
co2,
s_srcPatch[LOCAL_SIZE+1][1
+
((
lx
+
1
+
1
)
>>
1
)
],
sum
)
;
s_dstPatch[LOCAL_SIZE+1][lx+1]
=
sum
;
}
...
...
@@ -211,24 +211,24 @@ __kernel void pyrUp_unrolled(__global const uchar * src, int src_step, int src_o
{
//
(
x,y
)
sum
=
co3
*
s_dstPatch[1
+
get_local_id
(
1
)
-
1][lx]
;
sum
=
sum
+
co1
*
s_dstPatch[1
+
get_local_id
(
1
)
][lx]
;
sum
=
sum
+
co3
*
s_dstPatch[1
+
get_local_id
(
1
)
+
1][lx]
;
sum
=
mad
(
co1,
s_dstPatch[1
+
get_local_id
(
1
)
][lx],
sum
)
;
sum
=
mad
(
co3,
s_dstPatch[1
+
get_local_id
(
1
)
+
1][lx],
sum
)
;
storepix
(
convertToT
(
sum
)
,
dstData
+
dst_y
*
dst_step
+
dst_x
*
PIXSIZE
)
;
//
(
x+1,y
)
sum
=
co3
*
s_dstPatch[1
+
get_local_id
(
1
)
-
1][lx+1]
;
sum
=
sum
+
co1
*
s_dstPatch[1
+
get_local_id
(
1
)
][lx+1]
;
sum
=
sum
+
co3
*
s_dstPatch[1
+
get_local_id
(
1
)
+
1][lx+1]
;
sum
=
mad
(
co1,
s_dstPatch[1
+
get_local_id
(
1
)
][lx+1],
sum
)
;
sum
=
mad
(
co3,
s_dstPatch[1
+
get_local_id
(
1
)
+
1][lx+1],
sum
)
;
storepix
(
convertToT
(
sum
)
,
dstData
+
dst_y
*
dst_step
+
(
dst_x+1
)
*
PIXSIZE
)
;
//
(
x,y+1
)
sum
=
co2
*
s_dstPatch[1
+
get_local_id
(
1
)
][lx]
;
sum
=
sum
+
co2
*
s_dstPatch[1
+
get_local_id
(
1
)
+
1][lx]
;
sum
=
mad
(
co2,
s_dstPatch[1
+
get_local_id
(
1
)
+
1][lx],
sum
)
;
storepix
(
convertToT
(
sum
)
,
dstData
+
(
dst_y+1
)
*
dst_step
+
dst_x
*
PIXSIZE
)
;
//
(
x+1,y+1
)
sum
=
co2
*
s_dstPatch[1
+
get_local_id
(
1
)
][lx+1]
;
sum
=
sum
+
co2
*
s_dstPatch[1
+
get_local_id
(
1
)
+
1][lx+1]
;
sum
=
mad
(
co2,
s_dstPatch[1
+
get_local_id
(
1
)
+
1][lx+1],
sum
)
;
storepix
(
convertToT
(
sum
)
,
dstData
+
(
dst_y+1
)
*
dst_step
+
(
dst_x+1
)
*
PIXSIZE
)
;
}
}
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