32 #define pixel uint16_t
38 #define fn3(a,b) ff_##a##_##b
39 #define fn2(a,b) fn3(a,b)
40 #define fn(a) fn2(a, DEPTH)
43 uint16_t *dst,
int dst_linesize,
44 int8_t *dir,
int dir_linesize,
45 const uint8_t *
src,
int src_linesize,
int src_stride)
49 src_stride /=
sizeof(
pixel);
50 src_linesize /=
sizeof(
pixel);
51 dst_linesize /=
sizeof(
pixel);
53 for (
int j = 1; j <
h - 1; j++) {
57 for (
int i = 1;
i <
w - 1;
i++) {
59 -1*srcp[-src_linesize + (
i-1)*src_stride] + 1*srcp[-src_linesize + (
i+1)*src_stride]
60 -2*srcp[ (
i-1)*src_stride] + 2*srcp[ (
i+1)*src_stride]
61 -1*srcp[ src_linesize + (
i-1)*src_stride] + 1*srcp[ src_linesize + (
i+1)*src_stride];
63 -1*srcp[-src_linesize + (
i-1)*src_stride] + 1*srcp[ src_linesize + (
i-1)*src_stride]
64 -2*srcp[-src_linesize + (
i )*src_stride] + 2*srcp[ src_linesize + (
i )*src_stride]
65 -1*srcp[-src_linesize + (
i+1)*src_stride] + 1*srcp[ src_linesize + (
i+1)*src_stride];
74 uint8_t *dst,
int dst_linesize,
75 const uint8_t *
src,
int src_linesize,
int src_stride)
81 src_stride /=
sizeof(
pixel);
82 src_linesize /=
sizeof(
pixel);
83 dst_linesize /=
sizeof(
pixel);
85 for (j = 0; j <
FFMIN(
h, 2); j++) {
86 memcpy(dstp, srcp,
w*
sizeof(
pixel));
91 for (; j <
h - 2; j++) {
94 dstp[
i] = srcp[
i*src_stride];
95 for (;
i <
w - 2;
i++) {
97 dstp[
i] = ((srcp[-2*src_linesize + (
i-2)*src_stride] + srcp[2*src_linesize + (
i-2)*src_stride]) * 2
98 + (srcp[-2*src_linesize + (
i-1)*src_stride] + srcp[2*src_linesize + (
i-1)*src_stride]) * 4
99 + (srcp[-2*src_linesize + (
i )*src_stride] + srcp[2*src_linesize + (
i )*src_stride]) * 5
100 + (srcp[-2*src_linesize + (
i+1)*src_stride] + srcp[2*src_linesize + (
i+1)*src_stride]) * 4
101 + (srcp[-2*src_linesize + (
i+2)*src_stride] + srcp[2*src_linesize + (
i+2)*src_stride]) * 2
103 + (srcp[ -src_linesize + (
i-2)*src_stride] + srcp[ src_linesize + (
i-2)*src_stride]) * 4
104 + (srcp[ -src_linesize + (
i-1)*src_stride] + srcp[ src_linesize + (
i-1)*src_stride]) * 9
105 + (srcp[ -src_linesize + (
i )*src_stride] + srcp[ src_linesize + (
i )*src_stride]) * 12
106 + (srcp[ -src_linesize + (
i+1)*src_stride] + srcp[ src_linesize + (
i+1)*src_stride]) * 9
107 + (srcp[ -src_linesize + (
i+2)*src_stride] + srcp[ src_linesize + (
i+2)*src_stride]) * 4
109 + srcp[(
i-2)*src_stride] * 5
110 + srcp[(
i-1)*src_stride] * 12
111 + srcp[(
i )*src_stride] * 15
112 + srcp[(
i+1)*src_stride] * 12
113 + srcp[(
i+2)*src_stride] * 5) / 159;
116 dstp[
i] = srcp[
i*src_stride];
118 dstp += dst_linesize;
119 srcp += src_linesize;
122 memcpy(dstp, srcp,
w*
sizeof(
pixel));
123 dstp += dst_linesize;
124 srcp += src_linesize;