48 dst_stride /=
sizeof(
pixel);
49 src_stride /=
sizeof(
pixel);
52 int far = (y + 3 < vb_pos - 3) || (y > vb_pos + 2);
55 const pixel *s0 =
src + y * src_stride + x;
56 const pixel *s1 = s0 + src_stride;
57 const pixel *s2 = s0 - src_stride;
58 const pixel *s3 = s1 + src_stride;
59 const pixel *s4 = s2 - src_stride;
60 const pixel *s5 = s3 + src_stride;
61 const pixel *s6 = s4 - src_stride;
66 const pixel *p0 = s0 +
i * src_stride;
67 const pixel *p1 = s1 +
i * src_stride;
68 const pixel *p2 = s2 +
i * src_stride;
69 const pixel *p3 = s3 +
i * src_stride;
70 const pixel *p4 = s4 +
i * src_stride;
71 const pixel *p5 = s5 +
i * src_stride;
72 const pixel *p6 = s6 +
i * src_stride;
76 is_near_vb = (y +
i == vb_pos - 1) || (y +
i == vb_pos);
81 if (y +
i >= vb_pos - 2 && y +
i <= vb_pos + 1) {
85 if (y +
i >= vb_pos - 3 && y +
i <= vb_pos + 2) {
91 (
const pixel *[]) { p0, p1, p2, p3, p4, p5, p6},
103 ptrdiff_t dst_stride,
105 ptrdiff_t src_stride,
114 dst_stride /=
sizeof(
pixel);
115 src_stride /=
sizeof(
pixel);
118 int far = (y + 3 < vb_pos - 2) || (y > vb_pos + 1);
121 const pixel *s0 =
src + y * src_stride + x;
122 const pixel *s1 = s0 + src_stride;
123 const pixel *s2 = s0 - src_stride;
124 const pixel *s3 = s1 + src_stride;
125 const pixel *s4 = s2 - src_stride;
130 const pixel *p0 = s0 +
i * src_stride;
131 const pixel *p1 = s1 +
i * src_stride;
132 const pixel *p2 = s2 +
i * src_stride;
133 const pixel *p3 = s3 +
i * src_stride;
134 const pixel *p4 = s4 +
i * src_stride;
138 is_near_vb = (y +
i == vb_pos - 1) || (y +
i == vb_pos);
144 if (y +
i >= vb_pos - 2 && y +
i <= vb_pos + 1) {
151 (
const pixel *[]){p0, p1, p2, p3, p4},
159 #define ALF_DIR_VERT 0
160 #define ALF_DIR_HORZ 1
161 #define ALF_DIR_DIGA0 2
162 #define ALF_DIR_DIGA1 3
164 static void FUNC(
alf_get_idx)(
int *class_idx,
int *transpose_idx,
const int *sum,
const int ac)
166 static const int arg_var[] = {0, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4 };
168 int hv0, hv1, dir_hv, d0, d1, dir_d, hvd1, hvd0, sum_hv, dir1;
179 dir1 = (uint64_t)d1 * hv0 <= (uint64_t)hv1 * d0;
180 hvd1 = dir1 ? hv1 : d1;
181 hvd0 = dir1 ? hv0 : d0;
185 if (hvd1 * 2 > 9 * hvd0)
186 *class_idx += ((dir1 << 1) + 2) * 5;
187 else if (hvd1 > 2 * hvd0)
188 *class_idx += ((dir1 << 1) + 1) * 5;
190 *transpose_idx = dir_d * 2 + dir_hv;
194 const uint8_t *
_src,
const ptrdiff_t _src_stride,
const int width,
const int height,
195 const int vb_pos, int16_t *gradient_tmp)
211 }
else if (y == vb_pos) {
233 void FUNC2(ff_alf_classify_grad,
BIT_DEPTH, _neon)(
int *class_idx,
int *transpose_idx,
234 const uint8_t *
_src,
const ptrdiff_t _src_stride,
const int width,
const int height,
235 const int vb_pos, int16_t *gradient_tmp);
238 const uint8_t *
_src,
const ptrdiff_t _src_stride,
const int width,
const int height,
239 const int vb_pos,
int *gradient_tmp)