31 #define pixel uint16_t
37 #define fn3(a,b) ff_##a##_##b
38 #define fn2(a,b) fn3(a,b)
39 #define fn(a) fn2(a, DEPTH)
42 uint16_t *
dst,
int dst_linesize,
43 int8_t *dir,
int dir_linesize,
44 const uint8_t *
src,
int src_linesize,
int src_stride)
48 src_stride /=
sizeof(
pixel);
49 src_linesize /=
sizeof(
pixel);
50 dst_linesize /=
sizeof(
pixel);
52 for (
int j = 1; j <
h - 1; j++) {
56 for (
int i = 1;
i <
w - 1;
i++) {
58 -1*srcp[-src_linesize + (
i-1)*src_stride] + 1*srcp[-src_linesize + (
i+1)*src_stride]
59 -2*srcp[ (
i-1)*src_stride] + 2*srcp[ (
i+1)*src_stride]
60 -1*srcp[ src_linesize + (
i-1)*src_stride] + 1*srcp[ src_linesize + (
i+1)*src_stride];
62 -1*srcp[-src_linesize + (
i-1)*src_stride] + 1*srcp[ src_linesize + (
i-1)*src_stride]
63 -2*srcp[-src_linesize + (
i )*src_stride] + 2*srcp[ src_linesize + (
i )*src_stride]
64 -1*srcp[-src_linesize + (
i+1)*src_stride] + 1*srcp[ src_linesize + (
i+1)*src_stride];
73 uint8_t *
dst,
int dst_linesize,
74 const uint8_t *
src,
int src_linesize,
int src_stride)
80 src_stride /=
sizeof(
pixel);
81 src_linesize /=
sizeof(
pixel);
82 dst_linesize /=
sizeof(
pixel);
84 for (j = 0; j <
FFMIN(
h, 2); j++) {
85 memcpy(dstp, srcp,
w*
sizeof(
pixel));
90 for (; j <
h - 2; j++) {
93 dstp[
i] = srcp[
i*src_stride];
94 for (;
i <
w - 2;
i++) {
96 dstp[
i] = ((srcp[-2*src_linesize + (
i-2)*src_stride] + srcp[2*src_linesize + (
i-2)*src_stride]) * 2
97 + (srcp[-2*src_linesize + (
i-1)*src_stride] + srcp[2*src_linesize + (
i-1)*src_stride]) * 4
98 + (srcp[-2*src_linesize + (
i )*src_stride] + srcp[2*src_linesize + (
i )*src_stride]) * 5
99 + (srcp[-2*src_linesize + (
i+1)*src_stride] + srcp[2*src_linesize + (
i+1)*src_stride]) * 4
100 + (srcp[-2*src_linesize + (
i+2)*src_stride] + srcp[2*src_linesize + (
i+2)*src_stride]) * 2
102 + (srcp[ -src_linesize + (
i-2)*src_stride] + srcp[ src_linesize + (
i-2)*src_stride]) * 4
103 + (srcp[ -src_linesize + (
i-1)*src_stride] + srcp[ src_linesize + (
i-1)*src_stride]) * 9
104 + (srcp[ -src_linesize + (
i )*src_stride] + srcp[ src_linesize + (
i )*src_stride]) * 12
105 + (srcp[ -src_linesize + (
i+1)*src_stride] + srcp[ src_linesize + (
i+1)*src_stride]) * 9
106 + (srcp[ -src_linesize + (
i+2)*src_stride] + srcp[ src_linesize + (
i+2)*src_stride]) * 4
108 + srcp[(
i-2)*src_stride] * 5
109 + srcp[(
i-1)*src_stride] * 12
110 + srcp[(
i )*src_stride] * 15
111 + srcp[(
i+1)*src_stride] * 12
112 + srcp[(
i+2)*src_stride] * 5) / 159;
115 dstp[
i] = srcp[
i*src_stride];
117 dstp += dst_linesize;
118 srcp += src_linesize;
121 memcpy(dstp, srcp,
w*
sizeof(
pixel));
122 dstp += dst_linesize;
123 srcp += src_linesize;