Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
ffmpeg
Commits
48a1abed
Commit
48a1abed
authored
Jul 03, 2018
by
Ruiling Song
Committed by
Mark Thompson
Jul 11, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/opencl: add macro for opencl error handling.
Signed-off-by:
Ruiling Song
<
ruiling.song@intel.com
>
parent
09628cb1
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
134 deletions
+45
-134
opencl.h
libavfilter/opencl.h
+12
-0
vf_avgblur_opencl.c
libavfilter/vf_avgblur_opencl.c
+11
-34
vf_overlay_opencl.c
libavfilter/vf_overlay_opencl.c
+6
-23
vf_program_opencl.c
libavfilter/vf_program_opencl.c
+2
-12
vf_tonemap_opencl.c
libavfilter/vf_tonemap_opencl.c
+6
-27
vf_unsharp_opencl.c
libavfilter/vf_unsharp_opencl.c
+8
-38
No files found.
libavfilter/opencl.h
View file @
48a1abed
...
@@ -61,6 +61,18 @@ typedef struct OpenCLFilterContext {
...
@@ -61,6 +61,18 @@ typedef struct OpenCLFilterContext {
goto fail; \
goto fail; \
}
}
/**
* A helper macro to handle OpenCL errors. It will assign errcode to
* variable err, log error msg, and jump to fail label on error.
*/
#define CL_FAIL_ON_ERROR(errcode, ...) do { \
if (cle != CL_SUCCESS) { \
av_log(avctx, AV_LOG_ERROR, __VA_ARGS__); \
err = errcode; \
goto fail; \
} \
} while(0)
/**
/**
* Return that all inputs and outputs support only AV_PIX_FMT_OPENCL.
* Return that all inputs and outputs support only AV_PIX_FMT_OPENCL.
*/
*/
...
...
libavfilter/vf_avgblur_opencl.c
View file @
48a1abed
...
@@ -64,26 +64,16 @@ static int avgblur_opencl_init(AVFilterContext *avctx)
...
@@ -64,26 +64,16 @@ static int avgblur_opencl_init(AVFilterContext *avctx)
ctx
->
command_queue
=
clCreateCommandQueue
(
ctx
->
ocf
.
hwctx
->
context
,
ctx
->
command_queue
=
clCreateCommandQueue
(
ctx
->
ocf
.
hwctx
->
context
,
ctx
->
ocf
.
hwctx
->
device_id
,
ctx
->
ocf
.
hwctx
->
device_id
,
0
,
&
cle
);
0
,
&
cle
);
if
(
!
ctx
->
command_queue
)
{
CL_FAIL_ON_ERROR
(
AVERROR
(
EIO
),
"Failed to create OpenCL "
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to create OpenCL "
"command queue %d.
\n
"
,
cle
);
"command queue: %d.
\n
"
,
cle
);
err
=
AVERROR
(
EIO
);
goto
fail
;
}
ctx
->
kernel_horiz
=
clCreateKernel
(
ctx
->
ocf
.
program
,
"avgblur_horiz"
,
&
cle
);
ctx
->
kernel_horiz
=
clCreateKernel
(
ctx
->
ocf
.
program
,
"avgblur_horiz"
,
&
cle
);
if
(
!
ctx
->
kernel_horiz
)
{
CL_FAIL_ON_ERROR
(
AVERROR
(
EIO
),
"Failed to create horizontal "
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to create kernel: %d.
\n
"
,
cle
);
"kernel %d.
\n
"
,
cle
);
err
=
AVERROR
(
EIO
);
goto
fail
;
}
ctx
->
kernel_vert
=
clCreateKernel
(
ctx
->
ocf
.
program
,
"avgblur_vert"
,
&
cle
);
ctx
->
kernel_vert
=
clCreateKernel
(
ctx
->
ocf
.
program
,
"avgblur_vert"
,
&
cle
);
if
(
!
ctx
->
kernel_vert
)
{
CL_FAIL_ON_ERROR
(
AVERROR
(
EIO
),
"Failed to create vertical "
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to create kernel: %d.
\n
"
,
cle
);
"kernel %d.
\n
"
,
cle
);
err
=
AVERROR
(
EIO
);
goto
fail
;
}
ctx
->
initialised
=
1
;
ctx
->
initialised
=
1
;
return
0
;
return
0
;
...
@@ -236,12 +226,8 @@ static int avgblur_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input)
...
@@ -236,12 +226,8 @@ static int avgblur_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input)
cle
=
clEnqueueNDRangeKernel
(
ctx
->
command_queue
,
ctx
->
kernel_horiz
,
2
,
NULL
,
cle
=
clEnqueueNDRangeKernel
(
ctx
->
command_queue
,
ctx
->
kernel_horiz
,
2
,
NULL
,
global_work
,
NULL
,
global_work
,
NULL
,
0
,
NULL
,
NULL
);
0
,
NULL
,
NULL
);
if
(
cle
!=
CL_SUCCESS
)
{
CL_FAIL_ON_ERROR
(
AVERROR
(
EIO
),
"Failed to enqueue horizontal "
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to enqueue kernel: %d.
\n
"
,
"kernel: %d.
\n
"
,
cle
);
cle
);
err
=
AVERROR
(
EIO
);
goto
fail
;
}
cle
=
clFinish
(
ctx
->
command_queue
);
cle
=
clFinish
(
ctx
->
command_queue
);
err
=
ff_opencl_filter_work_size_from_image
(
avctx
,
global_work
,
err
=
ff_opencl_filter_work_size_from_image
(
avctx
,
global_work
,
...
@@ -259,22 +245,13 @@ static int avgblur_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input)
...
@@ -259,22 +245,13 @@ static int avgblur_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input)
cle
=
clEnqueueNDRangeKernel
(
ctx
->
command_queue
,
ctx
->
kernel_vert
,
2
,
NULL
,
cle
=
clEnqueueNDRangeKernel
(
ctx
->
command_queue
,
ctx
->
kernel_vert
,
2
,
NULL
,
global_work
,
NULL
,
global_work
,
NULL
,
0
,
NULL
,
NULL
);
0
,
NULL
,
NULL
);
if
(
cle
!=
CL_SUCCESS
)
{
CL_FAIL_ON_ERROR
(
AVERROR
(
EIO
),
"Failed to enqueue vertical "
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to enqueue kernel: %d.
\n
"
,
"kernel: %d.
\n
"
,
cle
);
cle
);
err
=
AVERROR
(
EIO
);
goto
fail
;
}
}
}
}
}
cle
=
clFinish
(
ctx
->
command_queue
);
cle
=
clFinish
(
ctx
->
command_queue
);
if
(
cle
!=
CL_SUCCESS
)
{
CL_FAIL_ON_ERROR
(
AVERROR
(
EIO
),
"Failed to finish command queue: %d.
\n
"
,
cle
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to finish command queue: %d.
\n
"
,
cle
);
err
=
AVERROR
(
EIO
);
goto
fail
;
}
err
=
av_frame_copy_props
(
output
,
input
);
err
=
av_frame_copy_props
(
output
,
input
);
if
(
err
<
0
)
if
(
err
<
0
)
...
...
libavfilter/vf_overlay_opencl.c
View file @
48a1abed
...
@@ -100,19 +100,11 @@ static int overlay_opencl_load(AVFilterContext *avctx,
...
@@ -100,19 +100,11 @@ static int overlay_opencl_load(AVFilterContext *avctx,
ctx
->
command_queue
=
clCreateCommandQueue
(
ctx
->
ocf
.
hwctx
->
context
,
ctx
->
command_queue
=
clCreateCommandQueue
(
ctx
->
ocf
.
hwctx
->
context
,
ctx
->
ocf
.
hwctx
->
device_id
,
ctx
->
ocf
.
hwctx
->
device_id
,
0
,
&
cle
);
0
,
&
cle
);
if
(
!
ctx
->
command_queue
)
{
CL_FAIL_ON_ERROR
(
AVERROR
(
EIO
),
"Failed to create OpenCL "
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to create OpenCL "
"command queue %d.
\n
"
,
cle
);
"command queue: %d.
\n
"
,
cle
);
err
=
AVERROR
(
EIO
);
goto
fail
;
}
ctx
->
kernel
=
clCreateKernel
(
ctx
->
ocf
.
program
,
kernel
,
&
cle
);
ctx
->
kernel
=
clCreateKernel
(
ctx
->
ocf
.
program
,
kernel
,
&
cle
);
if
(
!
ctx
->
kernel
)
{
CL_FAIL_ON_ERROR
(
AVERROR
(
EIO
),
"Failed to create kernel %d.
\n
"
,
cle
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to create kernel: %d.
\n
"
,
cle
);
err
=
AVERROR
(
EIO
);
goto
fail
;
}
ctx
->
initialised
=
1
;
ctx
->
initialised
=
1
;
return
0
;
return
0
;
...
@@ -209,21 +201,12 @@ static int overlay_opencl_blend(FFFrameSync *fs)
...
@@ -209,21 +201,12 @@ static int overlay_opencl_blend(FFFrameSync *fs)
cle
=
clEnqueueNDRangeKernel
(
ctx
->
command_queue
,
ctx
->
kernel
,
2
,
NULL
,
cle
=
clEnqueueNDRangeKernel
(
ctx
->
command_queue
,
ctx
->
kernel
,
2
,
NULL
,
global_work
,
NULL
,
0
,
NULL
,
NULL
);
global_work
,
NULL
,
0
,
NULL
,
NULL
);
if
(
cle
!=
CL_SUCCESS
)
{
CL_FAIL_ON_ERROR
(
AVERROR
(
EIO
),
"Failed to enqueue overlay kernel "
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to enqueue "
"for plane %d: %d.
\n
"
,
plane
,
cle
);
"overlay kernel for plane %d: %d.
\n
"
,
cle
,
plane
);
err
=
AVERROR
(
EIO
);
goto
fail
;
}
}
}
cle
=
clFinish
(
ctx
->
command_queue
);
cle
=
clFinish
(
ctx
->
command_queue
);
if
(
cle
!=
CL_SUCCESS
)
{
CL_FAIL_ON_ERROR
(
AVERROR
(
EIO
),
"Failed to finish command queue: %d.
\n
"
,
cle
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to finish "
"command queue: %d.
\n
"
,
cle
);
err
=
AVERROR
(
EIO
);
goto
fail
;
}
err
=
av_frame_copy_props
(
output
,
input_main
);
err
=
av_frame_copy_props
(
output
,
input_main
);
...
...
libavfilter/vf_program_opencl.c
View file @
48a1abed
...
@@ -148,21 +148,11 @@ static int program_opencl_run(AVFilterContext *avctx)
...
@@ -148,21 +148,11 @@ static int program_opencl_run(AVFilterContext *avctx)
cle
=
clEnqueueNDRangeKernel
(
ctx
->
command_queue
,
ctx
->
kernel
,
2
,
NULL
,
cle
=
clEnqueueNDRangeKernel
(
ctx
->
command_queue
,
ctx
->
kernel
,
2
,
NULL
,
global_work
,
NULL
,
0
,
NULL
,
NULL
);
global_work
,
NULL
,
0
,
NULL
,
NULL
);
if
(
cle
!=
CL_SUCCESS
)
{
CL_FAIL_ON_ERROR
(
AVERROR
(
EIO
),
"Failed to enqueue kernel: %d.
\n
"
,
cle
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to enqueue kernel: %d.
\n
"
,
cle
);
err
=
AVERROR
(
EIO
);
goto
fail
;
}
}
}
cle
=
clFinish
(
ctx
->
command_queue
);
cle
=
clFinish
(
ctx
->
command_queue
);
if
(
cle
!=
CL_SUCCESS
)
{
CL_FAIL_ON_ERROR
(
AVERROR
(
EIO
),
"Failed to finish command queue: %d.
\n
"
,
cle
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to finish command queue: %d.
\n
"
,
cle
);
err
=
AVERROR
(
EIO
);
goto
fail
;
}
if
(
ctx
->
nb_inputs
>
0
)
{
if
(
ctx
->
nb_inputs
>
0
)
{
err
=
av_frame_copy_props
(
output
,
ctx
->
frames
[
0
]);
err
=
av_frame_copy_props
(
output
,
ctx
->
frames
[
0
]);
...
...
libavfilter/vf_tonemap_opencl.c
View file @
48a1abed
...
@@ -262,29 +262,17 @@ static int tonemap_opencl_init(AVFilterContext *avctx)
...
@@ -262,29 +262,17 @@ static int tonemap_opencl_init(AVFilterContext *avctx)
ctx
->
command_queue
=
clCreateCommandQueue
(
ctx
->
ocf
.
hwctx
->
context
,
ctx
->
command_queue
=
clCreateCommandQueue
(
ctx
->
ocf
.
hwctx
->
context
,
ctx
->
ocf
.
hwctx
->
device_id
,
ctx
->
ocf
.
hwctx
->
device_id
,
0
,
&
cle
);
0
,
&
cle
);
if
(
!
ctx
->
command_queue
)
{
CL_FAIL_ON_ERROR
(
AVERROR
(
EIO
),
"Failed to create OpenCL "
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to create OpenCL "
"command queue %d.
\n
"
,
cle
);
"command queue: %d.
\n
"
,
cle
);
err
=
AVERROR
(
EIO
);
goto
fail
;
}
ctx
->
kernel
=
clCreateKernel
(
ctx
->
ocf
.
program
,
"tonemap"
,
&
cle
);
ctx
->
kernel
=
clCreateKernel
(
ctx
->
ocf
.
program
,
"tonemap"
,
&
cle
);
if
(
!
ctx
->
kernel
)
{
CL_FAIL_ON_ERROR
(
AVERROR
(
EIO
),
"Failed to create kernel %d.
\n
"
,
cle
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to create kernel: %d.
\n
"
,
cle
);
err
=
AVERROR
(
EIO
);
goto
fail
;
}
ctx
->
util_mem
=
ctx
->
util_mem
=
clCreateBuffer
(
ctx
->
ocf
.
hwctx
->
context
,
0
,
clCreateBuffer
(
ctx
->
ocf
.
hwctx
->
context
,
0
,
(
2
*
DETECTION_FRAMES
+
7
)
*
sizeof
(
unsigned
),
(
2
*
DETECTION_FRAMES
+
7
)
*
sizeof
(
unsigned
),
NULL
,
&
cle
);
NULL
,
&
cle
);
if
(
cle
!=
CL_SUCCESS
)
{
CL_FAIL_ON_ERROR
(
AVERROR
(
EIO
),
"Failed to create util buffer: %d.
\n
"
,
cle
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to create util buffer: %d.
\n
"
,
cle
);
err
=
AVERROR
(
EIO
);
goto
fail
;
}
ctx
->
initialised
=
1
;
ctx
->
initialised
=
1
;
return
0
;
return
0
;
...
@@ -349,11 +337,7 @@ static int launch_kernel(AVFilterContext *avctx, cl_kernel kernel,
...
@@ -349,11 +337,7 @@ static int launch_kernel(AVFilterContext *avctx, cl_kernel kernel,
cle
=
clEnqueueNDRangeKernel
(
ctx
->
command_queue
,
kernel
,
2
,
NULL
,
cle
=
clEnqueueNDRangeKernel
(
ctx
->
command_queue
,
kernel
,
2
,
NULL
,
global_work
,
local_work
,
global_work
,
local_work
,
0
,
NULL
,
NULL
);
0
,
NULL
,
NULL
);
if
(
cle
!=
CL_SUCCESS
)
{
CL_FAIL_ON_ERROR
(
AVERROR
(
EIO
),
"Failed to enqueue kernel: %d.
\n
"
,
cle
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to enqueue kernel: %d.
\n
"
,
cle
);
return
AVERROR
(
EIO
);
}
return
0
;
return
0
;
fail:
fail:
return
err
;
return
err
;
...
@@ -482,12 +466,7 @@ static int tonemap_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input)
...
@@ -482,12 +466,7 @@ static int tonemap_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input)
}
}
cle
=
clFinish
(
ctx
->
command_queue
);
cle
=
clFinish
(
ctx
->
command_queue
);
if
(
cle
!=
CL_SUCCESS
)
{
CL_FAIL_ON_ERROR
(
AVERROR
(
EIO
),
"Failed to finish command queue: %d.
\n
"
,
cle
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to finish command queue: %d.
\n
"
,
cle
);
err
=
AVERROR
(
EIO
);
goto
fail
;
}
av_frame_free
(
&
input
);
av_frame_free
(
&
input
);
...
...
libavfilter/vf_unsharp_opencl.c
View file @
48a1abed
...
@@ -76,12 +76,8 @@ static int unsharp_opencl_init(AVFilterContext *avctx)
...
@@ -76,12 +76,8 @@ static int unsharp_opencl_init(AVFilterContext *avctx)
ctx
->
command_queue
=
clCreateCommandQueue
(
ctx
->
ocf
.
hwctx
->
context
,
ctx
->
command_queue
=
clCreateCommandQueue
(
ctx
->
ocf
.
hwctx
->
context
,
ctx
->
ocf
.
hwctx
->
device_id
,
ctx
->
ocf
.
hwctx
->
device_id
,
0
,
&
cle
);
0
,
&
cle
);
if
(
!
ctx
->
command_queue
)
{
CL_FAIL_ON_ERROR
(
AVERROR
(
EIO
),
"Failed to create OpenCL "
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to create OpenCL "
"command queue %d.
\n
"
,
cle
);
"command queue: %d.
\n
"
,
cle
);
err
=
AVERROR
(
EIO
);
goto
fail
;
}
// Use global kernel if mask size will be too big for the local store..
// Use global kernel if mask size will be too big for the local store..
ctx
->
global
=
(
ctx
->
luma_size_x
>
17
.
0
f
||
ctx
->
global
=
(
ctx
->
luma_size_x
>
17
.
0
f
||
...
@@ -92,11 +88,7 @@ static int unsharp_opencl_init(AVFilterContext *avctx)
...
@@ -92,11 +88,7 @@ static int unsharp_opencl_init(AVFilterContext *avctx)
ctx
->
kernel
=
clCreateKernel
(
ctx
->
ocf
.
program
,
ctx
->
kernel
=
clCreateKernel
(
ctx
->
ocf
.
program
,
ctx
->
global
?
"unsharp_global"
ctx
->
global
?
"unsharp_global"
:
"unsharp_local"
,
&
cle
);
:
"unsharp_local"
,
&
cle
);
if
(
!
ctx
->
kernel
)
{
CL_FAIL_ON_ERROR
(
AVERROR
(
EIO
),
"Failed to create kernel %d.
\n
"
,
cle
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to create kernel: %d.
\n
"
,
cle
);
err
=
AVERROR
(
EIO
);
goto
fail
;
}
ctx
->
initialised
=
1
;
ctx
->
initialised
=
1
;
return
0
;
return
0
;
...
@@ -176,12 +168,8 @@ static int unsharp_opencl_make_filter_params(AVFilterContext *avctx)
...
@@ -176,12 +168,8 @@ static int unsharp_opencl_make_filter_params(AVFilterContext *avctx)
CL_MEM_COPY_HOST_PTR
|
CL_MEM_COPY_HOST_PTR
|
CL_MEM_HOST_NO_ACCESS
,
CL_MEM_HOST_NO_ACCESS
,
matrix_bytes
,
matrix
,
&
cle
);
matrix_bytes
,
matrix
,
&
cle
);
if
(
!
buffer
)
{
CL_FAIL_ON_ERROR
(
AVERROR
(
EIO
),
"Failed to create matrix buffer: "
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to create matrix buffer: "
"%d.
\n
"
,
cle
);
"%d.
\n
"
,
cle
);
err
=
AVERROR
(
EIO
);
goto
fail
;
}
ctx
->
plane
[
p
].
matrix
=
buffer
;
ctx
->
plane
[
p
].
matrix
=
buffer
;
}
else
{
}
else
{
buffer
=
clCreateBuffer
(
ctx
->
ocf
.
hwctx
->
context
,
buffer
=
clCreateBuffer
(
ctx
->
ocf
.
hwctx
->
context
,
...
@@ -190,12 +178,8 @@ static int unsharp_opencl_make_filter_params(AVFilterContext *avctx)
...
@@ -190,12 +178,8 @@ static int unsharp_opencl_make_filter_params(AVFilterContext *avctx)
CL_MEM_HOST_NO_ACCESS
,
CL_MEM_HOST_NO_ACCESS
,
sizeof
(
ctx
->
plane
[
p
].
blur_x
),
sizeof
(
ctx
->
plane
[
p
].
blur_x
),
ctx
->
plane
[
p
].
blur_x
,
&
cle
);
ctx
->
plane
[
p
].
blur_x
,
&
cle
);
if
(
!
buffer
)
{
CL_FAIL_ON_ERROR
(
AVERROR
(
EIO
),
"Failed to create x-coef buffer: "
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to create x-coef buffer: "
"%d.
\n
"
,
cle
);
"%d.
\n
"
,
cle
);
err
=
AVERROR
(
EIO
);
goto
fail
;
}
ctx
->
plane
[
p
].
coef_x
=
buffer
;
ctx
->
plane
[
p
].
coef_x
=
buffer
;
buffer
=
clCreateBuffer
(
ctx
->
ocf
.
hwctx
->
context
,
buffer
=
clCreateBuffer
(
ctx
->
ocf
.
hwctx
->
context
,
...
@@ -204,12 +188,8 @@ static int unsharp_opencl_make_filter_params(AVFilterContext *avctx)
...
@@ -204,12 +188,8 @@ static int unsharp_opencl_make_filter_params(AVFilterContext *avctx)
CL_MEM_HOST_NO_ACCESS
,
CL_MEM_HOST_NO_ACCESS
,
sizeof
(
ctx
->
plane
[
p
].
blur_y
),
sizeof
(
ctx
->
plane
[
p
].
blur_y
),
ctx
->
plane
[
p
].
blur_y
,
&
cle
);
ctx
->
plane
[
p
].
blur_y
,
&
cle
);
if
(
!
buffer
)
{
CL_FAIL_ON_ERROR
(
AVERROR
(
EIO
),
"Failed to create y-coef buffer: "
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to create y-coef buffer: "
"%d.
\n
"
,
cle
);
"%d.
\n
"
,
cle
);
err
=
AVERROR
(
EIO
);
goto
fail
;
}
ctx
->
plane
[
p
].
coef_y
=
buffer
;
ctx
->
plane
[
p
].
coef_y
=
buffer
;
}
}
...
@@ -296,21 +276,11 @@ static int unsharp_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input)
...
@@ -296,21 +276,11 @@ static int unsharp_opencl_filter_frame(AVFilterLink *inlink, AVFrame *input)
cle
=
clEnqueueNDRangeKernel
(
ctx
->
command_queue
,
ctx
->
kernel
,
2
,
NULL
,
cle
=
clEnqueueNDRangeKernel
(
ctx
->
command_queue
,
ctx
->
kernel
,
2
,
NULL
,
global_work
,
ctx
->
global
?
NULL
:
local_work
,
global_work
,
ctx
->
global
?
NULL
:
local_work
,
0
,
NULL
,
NULL
);
0
,
NULL
,
NULL
);
if
(
cle
!=
CL_SUCCESS
)
{
CL_FAIL_ON_ERROR
(
AVERROR
(
EIO
),
"Failed to enqueue kernel: %d.
\n
"
,
cle
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to enqueue kernel: %d.
\n
"
,
cle
);
err
=
AVERROR
(
EIO
);
goto
fail
;
}
}
}
cle
=
clFinish
(
ctx
->
command_queue
);
cle
=
clFinish
(
ctx
->
command_queue
);
if
(
cle
!=
CL_SUCCESS
)
{
CL_FAIL_ON_ERROR
(
AVERROR
(
EIO
),
"Failed to finish command queue: %d.
\n
"
,
cle
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to finish command queue: %d.
\n
"
,
cle
);
err
=
AVERROR
(
EIO
);
goto
fail
;
}
err
=
av_frame_copy_props
(
output
,
input
);
err
=
av_frame_copy_props
(
output
,
input
);
if
(
err
<
0
)
if
(
err
<
0
)
...
...
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