Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
4db84bac
Commit
4db84bac
authored
11 years ago
by
Clément Bœsch
Browse files
Options
Downloads
Patches
Plain Diff
lavfi/opencl: replace SHIFTUP with FF_CEIL_RSHIFT.
parent
f0250cc4
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libavfilter/unsharp.h
+0
-3
0 additions, 3 deletions
libavfilter/unsharp.h
libavfilter/unsharp_opencl.c
+4
-3
4 additions, 3 deletions
libavfilter/unsharp_opencl.c
libavfilter/vf_unsharp.c
+3
-3
3 additions, 3 deletions
libavfilter/vf_unsharp.c
with
7 additions
and
9 deletions
libavfilter/unsharp.h
+
0
−
3
View file @
4db84bac
...
...
@@ -30,9 +30,6 @@
#define MIN_MATRIX_SIZE 3
#define MAX_MATRIX_SIZE 63
/* right-shift and round-up */
#define SHIFTUP(x,shift) (-((-(x))>>(shift)))
#if CONFIG_OPENCL
typedef
struct
{
...
...
This diff is collapsed.
Click to expand it.
libavfilter/unsharp_opencl.c
+
4
−
3
View file @
4db84bac
...
...
@@ -24,6 +24,7 @@
*/
#include
"unsharp_opencl.h"
#include
"libavutil/common.h"
#include
"libavutil/opencl_internal.h"
#define PLANE_NUM 3
...
...
@@ -152,8 +153,8 @@ int ff_opencl_apply_unsharp(AVFilterContext *ctx, AVFrame *in, AVFrame *out)
AVFilterLink
*
link
=
ctx
->
inputs
[
0
];
UnsharpContext
*
unsharp
=
ctx
->
priv
;
cl_int
status
;
int
cw
=
SHIFT
UP
(
link
->
w
,
unsharp
->
hsub
);
int
ch
=
SHIFT
UP
(
link
->
h
,
unsharp
->
vsub
);
int
cw
=
FF_CEIL_R
SHIFT
(
link
->
w
,
unsharp
->
hsub
);
int
ch
=
FF_CEIL_R
SHIFT
(
link
->
h
,
unsharp
->
vsub
);
const
size_t
global_work_size
=
link
->
w
*
link
->
h
+
2
*
ch
*
cw
;
FFOpenclParam
opencl_param
=
{
0
};
...
...
@@ -245,7 +246,7 @@ int ff_opencl_unsharp_process_inout_buf(AVFilterContext *ctx, AVFrame *in, AVFra
int
ret
=
0
;
AVFilterLink
*
link
=
ctx
->
inputs
[
0
];
UnsharpContext
*
unsharp
=
ctx
->
priv
;
int
ch
=
SHIFT
UP
(
link
->
h
,
unsharp
->
vsub
);
int
ch
=
FF_CEIL_R
SHIFT
(
link
->
h
,
unsharp
->
vsub
);
if
((
!
unsharp
->
opencl_ctx
.
cl_inbuf
)
||
(
!
unsharp
->
opencl_ctx
.
cl_outbuf
))
{
unsharp
->
opencl_ctx
.
in_plane_size
[
0
]
=
(
in
->
linesize
[
0
]
*
in
->
height
);
...
...
This diff is collapsed.
Click to expand it.
libavfilter/vf_unsharp.c
+
3
−
3
View file @
4db84bac
...
...
@@ -114,9 +114,9 @@ static int apply_unsharp_c(AVFilterContext *ctx, AVFrame *in, AVFrame *out)
int
i
,
plane_w
[
3
],
plane_h
[
3
];
UnsharpFilterParam
*
fp
[
3
];
plane_w
[
0
]
=
inlink
->
w
;
plane_w
[
1
]
=
plane_w
[
2
]
=
SHIFT
UP
(
inlink
->
w
,
unsharp
->
hsub
);
plane_w
[
1
]
=
plane_w
[
2
]
=
FF_CEIL_R
SHIFT
(
inlink
->
w
,
unsharp
->
hsub
);
plane_h
[
0
]
=
inlink
->
h
;
plane_h
[
1
]
=
plane_h
[
2
]
=
SHIFT
UP
(
inlink
->
h
,
unsharp
->
vsub
);
plane_h
[
1
]
=
plane_h
[
2
]
=
FF_CEIL_R
SHIFT
(
inlink
->
h
,
unsharp
->
vsub
);
fp
[
0
]
=
&
unsharp
->
luma
;
fp
[
1
]
=
fp
[
2
]
=
&
unsharp
->
chroma
;
for
(
i
=
0
;
i
<
3
;
i
++
)
{
...
...
@@ -207,7 +207,7 @@ static int config_props(AVFilterLink *link)
ret
=
init_filter_param
(
link
->
dst
,
&
unsharp
->
luma
,
"luma"
,
link
->
w
);
if
(
ret
<
0
)
return
ret
;
ret
=
init_filter_param
(
link
->
dst
,
&
unsharp
->
chroma
,
"chroma"
,
SHIFT
UP
(
link
->
w
,
unsharp
->
hsub
));
ret
=
init_filter_param
(
link
->
dst
,
&
unsharp
->
chroma
,
"chroma"
,
FF_CEIL_R
SHIFT
(
link
->
w
,
unsharp
->
hsub
));
if
(
ret
<
0
)
return
ret
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment