33 #define pixel uint16_t
39 #define fn3(a,b) ff_##a##_##b
40 #define fn2(a,b) fn3(a,b)
41 #define fn(a) fn2(a, DEPTH)
44 uint16_t *dst,
int dst_linesize,
45 int8_t *dir,
int dir_linesize,
46 const uint8_t *
src,
int src_linesize,
int src_stride)
50 src_stride /=
sizeof(
pixel);
51 src_linesize /=
sizeof(
pixel);
52 dst_linesize /=
sizeof(
pixel);
54 for (
int j = 1; j <
h - 1; j++) {
58 for (
int i = 1;
i <
w - 1;
i++) {
60 -1*srcp[-src_linesize + (
i-1)*src_stride] + 1*srcp[-src_linesize + (
i+1)*src_stride]
61 -2*srcp[ (
i-1)*src_stride] + 2*srcp[ (
i+1)*src_stride]
62 -1*srcp[ src_linesize + (
i-1)*src_stride] + 1*srcp[ src_linesize + (
i+1)*src_stride];
64 -1*srcp[-src_linesize + (
i-1)*src_stride] + 1*srcp[ src_linesize + (
i-1)*src_stride]
65 -2*srcp[-src_linesize + (
i )*src_stride] + 2*srcp[ src_linesize + (
i )*src_stride]
66 -1*srcp[-src_linesize + (
i+1)*src_stride] + 1*srcp[ src_linesize + (
i+1)*src_stride];
75 uint8_t *dst,
int dst_linesize,
76 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 memcpy(dstp, srcp,
w*
sizeof(
pixel)); dstp += dst_linesize; srcp += src_linesize;
86 memcpy(dstp, srcp,
w*
sizeof(
pixel)); dstp += dst_linesize; srcp += src_linesize;
87 for (
int j = 2; j <
h - 2; j++) {
88 dstp[0] = srcp[(0)*src_stride];
89 dstp[1] = srcp[(1)*src_stride];
90 for (
int i = 2;
i <
w - 2;
i++) {
92 dstp[
i] = ((srcp[-2*src_linesize + (
i-2)*src_stride] + srcp[2*src_linesize + (
i-2)*src_stride]) * 2
93 + (srcp[-2*src_linesize + (
i-1)*src_stride] + srcp[2*src_linesize + (
i-1)*src_stride]) * 4
94 + (srcp[-2*src_linesize + (
i )*src_stride] + srcp[2*src_linesize + (
i )*src_stride]) * 5
95 + (srcp[-2*src_linesize + (
i+1)*src_stride] + srcp[2*src_linesize + (
i+1)*src_stride]) * 4
96 + (srcp[-2*src_linesize + (
i+2)*src_stride] + srcp[2*src_linesize + (
i+2)*src_stride]) * 2
98 + (srcp[ -src_linesize + (
i-2)*src_stride] + srcp[ src_linesize + (
i-2)*src_stride]) * 4
99 + (srcp[ -src_linesize + (
i-1)*src_stride] + srcp[ src_linesize + (
i-1)*src_stride]) * 9
100 + (srcp[ -src_linesize + (
i )*src_stride] + srcp[ src_linesize + (
i )*src_stride]) * 12
101 + (srcp[ -src_linesize + (
i+1)*src_stride] + srcp[ src_linesize + (
i+1)*src_stride]) * 9
102 + (srcp[ -src_linesize + (
i+2)*src_stride] + srcp[ src_linesize + (
i+2)*src_stride]) * 4
104 + srcp[(
i-2)*src_stride] * 5
105 + srcp[(
i-1)*src_stride] * 12
106 + srcp[(
i )*src_stride] * 15
107 + srcp[(
i+1)*src_stride] * 12
108 + srcp[(
i+2)*src_stride] * 5) / 159;
110 dstp[
w - 2] = srcp[(
w - 2)*src_stride];
111 dstp[
w - 1] = srcp[(
w - 1)*src_stride];
113 dstp += dst_linesize;
114 srcp += src_linesize;
116 memcpy(dstp, srcp,
w*
sizeof(
pixel)); dstp += dst_linesize; srcp += src_linesize;
117 memcpy(dstp, srcp,
w*
sizeof(
pixel));