3 "#line 1 \"libavfilter/opencl/avgblur.cl\"\n"
5 " * Copyright (c) 2018 Dylan Fernando\n"
7 " * This file is part of FFmpeg.\n"
9 " * FFmpeg is free software; you can redistribute it and/or\n"
10 " * modify it under the terms of the GNU Lesser General Public\n"
11 " * License as published by the Free Software Foundation; either\n"
12 " * version 2.1 of the License, or (at your option) any later version.\n"
14 " * FFmpeg is distributed in the hope that it will be useful,\n"
15 " * but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
16 " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n"
17 " * Lesser General Public License for more details.\n"
19 " * You should have received a copy of the GNU Lesser General Public\n"
20 " * License along with FFmpeg; if not, write to the Free Software\n"
21 " * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n"
25 "__kernel void avgblur_horiz(__write_only image2d_t dst,\n"
26 " __read_only image2d_t src,\n"
29 " const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |\n"
30 " CLK_FILTER_NEAREST);\n"
31 " int2 loc = (int2)(get_global_id(0), get_global_id(1));\n"
32 " int2 size = (int2)(get_global_size(0), get_global_size(1));\n"
35 " float4 acc = (float4)(0,0,0,0);\n"
37 " for (int xx = max(0, loc.x - rad); xx < min(loc.x + rad + 1, size.x); xx++) {\n"
39 " acc += read_imagef(src, sampler, (int2)(xx, loc.y));\n"
42 " write_imagef(dst, loc, acc / count);\n"
45 "__kernel void avgblur_vert(__write_only image2d_t dst,\n"
46 " __read_only image2d_t src,\n"
49 " const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |\n"
50 " CLK_FILTER_NEAREST);\n"
51 " int2 loc = (int2)(get_global_id(0), get_global_id(1));\n"
52 " int2 size = (int2)(get_global_size(0), get_global_size(1));\n"
55 " float4 acc = (float4)(0,0,0,0);\n"
57 " for (int yy = max(0, loc.y - radv); yy < min(loc.y + radv + 1, size.y); yy++) {\n"
59 " acc += read_imagef(src, sampler, (int2)(loc.x, yy));\n"
62 " write_imagef(dst, loc, acc / count);\n"
const char * ff_opencl_source_avgblur