27 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7,
28 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12
36 for (y = 0; y < 8; y++) {
38 int p0 = src[y * stride - 2];
39 int p1 = src[y * stride - 1];
40 int p2 = src[y * stride + 0];
41 int p3 = src[y * stride + 1];
42 int d = (p0 - p3 + 4 * (p2 - p1)) / 8;
44 if (d < -2 * strength)
46 else if (d < -strength)
47 d1 = -2 * strength - d;
48 else if (d < strength)
50 else if (d < 2 * strength)
51 d1 = 2 * strength - d;
62 src[y * stride - 1] = p1;
63 src[y * stride + 0] = p2;
67 d2 = av_clip((p0 - p3) / 4, -ad1, ad1);
69 src[y * stride - 2] = p0 - d2;
70 src[y * stride + 1] = p3 + d2;
79 for (x = 0; x < 8; x++) {
81 int p0 = src[x - 2 * stride];
82 int p1 = src[x - 1 * stride];
83 int p2 = src[x + 0 * stride];
84 int p3 = src[x + 1 * stride];
85 int d = (p0 - p3 + 4 * (p2 - p1)) / 8;
87 if (d < -2 * strength)
89 else if (d < -strength)
90 d1 = -2 * strength - d;
91 else if (d < strength)
93 else if (d < 2 * strength)
94 d1 = 2 * strength - d;
105 src[x - 1 * stride] = p1;
106 src[x + 0 * stride] = p2;
108 ad1 =
FFABS(d1) >> 1;
110 d2 = av_clip((p0 - p3) / 4, -ad1, ad1);
112 src[x - 2 * stride] = p0 - d2;
113 src[x + stride] = p3 + d2;