4" * Copyright (c) 2018 Dylan Fernando\n"
6" * This file is part of FFmpeg.\n"
8" * FFmpeg is free software; you can redistribute it and/or\n"
9" * modify it under the terms of the GNU Lesser General Public\n"
10" * License as published by the Free Software Foundation; either\n"
11" * version 2.1 of the License, or (at your option) any later version.\n"
13" * FFmpeg is distributed in the hope that it will be useful,\n"
14" * but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
15" * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n"
16" * Lesser General Public License for more details.\n"
18" * You should have received a copy of the GNU Lesser General Public\n"
19" * License along with FFmpeg; if not, write to the Free Software\n"
20" * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n"
24"__kernel void avgblur_horiz(__write_only image2d_t dst,\n"
25" __read_only image2d_t src,\n"
28" const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |\n"
29" CLK_FILTER_NEAREST);\n"
30" int2 loc = (int2)(get_global_id(0), get_global_id(1));\n"
31" int2 size = (int2)(get_global_size(0), get_global_size(1));\n"
34" float4 acc = (float4)(0,0,0,0);\n"
36" for (int xx = max(0, loc.x - rad); xx < min(loc.x + rad + 1, size.x); xx++) {\n"
38" acc += read_imagef(src, sampler, (int2)(xx, loc.y));\n"
41" write_imagef(dst, loc, acc / count);\n"
44"__kernel void avgblur_vert(__write_only image2d_t dst,\n"
45" __read_only image2d_t src,\n"
48" const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |\n"
49" CLK_FILTER_NEAREST);\n"
50" int2 loc = (int2)(get_global_id(0), get_global_id(1));\n"
51" int2 size = (int2)(get_global_size(0), get_global_size(1));\n"
54" float4 acc = (float4)(0,0,0,0);\n"
56" for (int yy = max(0, loc.y - radv); yy < min(loc.y + radv + 1, size.y); yy++) {\n"
58" acc += read_imagef(src, sampler, (int2)(loc.x, yy));\n"
61" write_imagef(dst, loc, acc / count);\n"
const char * ff_source_avgblur_cl