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
55
60 const uint8_t *
c[],
int peak,
int radius,
63
66
68 int x,
int w,
int y,
int h,
int bpc)
69 {
71
72 for (
i = 0;
i < 9;
i++) {
73 int xoff =
FFABS(x + ((
i % 3) - 1));
74 int yoff =
FFABS(y + (
i / 3) - 1);
75
76 xoff = xoff >=
w ? 2 *
w - 1 - xoff : xoff;
77 yoff = yoff >=
h ? 2 *
h - 1 - yoff : yoff;
78
80 }
81 }
82
85 const uint8_t *
c[],
int peak,
int radius,
87 {
88 const uint8_t *c0 =
c[0], *
c1 =
c[1], *
c2 =
c[2];
89 const uint8_t *c3 =
c[3], *c5 =
c[5];
90 const uint8_t *c6 =
c[6], *c7 =
c[7], *c8 =
c[8];
91 int x;
92
93 for (x = 0; x <
width; x++) {
94 float suma = c0[x] * -1 +
c1[x] * -2 +
c2[x] * -1 +
95 c6[x] * 1 + c7[x] * 2 + c8[x] * 1;
96 float sumb = c0[x] * -1 +
c2[x] * 1 + c3[x] * -2 +
97 c5[x] * 2 + c6[x] * -1 + c8[x] * 1;
98
100 }
101 }
102
105 const uint8_t *
c[],
int peak,
int radius,
107 {
108 uint16_t *dst = (uint16_t *)dstp;
109 int x;
110
111 for (x = 0; x <
width; x++) {
116
118 }
119 }
120
122 {
123 for (
int i = 0;
i < 4;
i++) {
125 s->copy[
i] = !((1 <<
i) &
s->planes);
128 s->rdiv[
i] =
s->scale;
129 s->bias[
i] =
s->delta;
130 }
132 for (
int i = 0;
i < 4;
i++)
134 #if ARCH_X86_64
136 #endif
137 }
138 #endif