1 /*
2 * Copyright (c) 2012-2013 Oka Motofumi (chikuzen.mo at gmail dot com)
3 * Copyright (c) 2015 Paul B Mahol
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21 #ifndef AVFILTER_CONVOLUTION_H
22 #define AVFILTER_CONVOLUTION_H
25
31 };
32
35
43
56
61 const uint8_t *
c[],
int peak,
int radius,
64
67
69 int x,
int w,
int y,
int h,
int bpc)
70 {
72
73 for (
i = 0;
i < 9;
i++) {
74 int xoff =
FFABS(x + ((
i % 3) - 1));
75 int yoff =
FFABS(y + (
i / 3) - 1);
76
77 xoff = xoff >=
w ? 2 *
w - 1 - xoff : xoff;
78 yoff = yoff >=
h ? 2 *
h - 1 - yoff : yoff;
79
81 }
82 }
83
86 const uint8_t *
c[],
int peak,
int radius,
88 {
89 const uint8_t *c0 =
c[0], *
c1 =
c[1], *
c2 =
c[2];
90 const uint8_t *c3 =
c[3], *c5 =
c[5];
91 const uint8_t *c6 =
c[6], *c7 =
c[7], *c8 =
c[8];
92 int x;
93
94 for (x = 0; x <
width; x++) {
95 float suma = c0[x] * -1 +
c1[x] * -2 +
c2[x] * -1 +
96 c6[x] * 1 + c7[x] * 2 + c8[x] * 1;
97 float sumb = c0[x] * -1 +
c2[x] * 1 + c3[x] * -2 +
98 c5[x] * 2 + c6[x] * -1 + c8[x] * 1;
99
101 }
102 }
103
106 const uint8_t *
c[],
int peak,
int radius,
108 {
109 uint16_t *
dst = (uint16_t *)dstp;
110 int x;
111
112 for (x = 0; x <
width; x++) {
117
119 }
120 }
121
123 {
124 for (
int i = 0;
i < 4;
i++) {
126 s->copy[
i] = !((1 <<
i) &
s->planes);
129 s->rdiv[
i] =
s->scale;
130 s->bias[
i] =
s->delta;
131 }
133 for (
int i = 0;
i < 4;
i++)
135 #if ARCH_X86_64
137 #endif
138 }
139 #endif