2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
11 #include "vpx_config.h"
12 #include "vp8/encoder/variance.h"
13 #include "vp8/common/filter.h"
14 #include "vp8/common/arm/bilinearfilter_arm.h"
18 unsigned int vp8_sub_pixel_variance8x8_armv6
20 const unsigned char *src_ptr
,
21 int src_pixels_per_line
,
24 const unsigned char *dst_ptr
,
25 int dst_pixels_per_line
,
29 unsigned short first_pass
[10*8];
30 unsigned char second_pass
[8*8];
31 const short *HFilter
, *VFilter
;
33 HFilter
= vp8_bilinear_filters
[xoffset
];
34 VFilter
= vp8_bilinear_filters
[yoffset
];
36 vp8_filter_block2d_bil_first_pass_armv6(src_ptr
, first_pass
,
39 vp8_filter_block2d_bil_second_pass_armv6(first_pass
, second_pass
,
42 return vp8_variance8x8_armv6(second_pass
, 8, dst_ptr
,
43 dst_pixels_per_line
, sse
);
46 unsigned int vp8_sub_pixel_variance16x16_armv6
48 const unsigned char *src_ptr
,
49 int src_pixels_per_line
,
52 const unsigned char *dst_ptr
,
53 int dst_pixels_per_line
,
57 unsigned short first_pass
[36*16];
58 unsigned char second_pass
[20*16];
59 const short *HFilter
, *VFilter
;
62 if (xoffset
== 4 && yoffset
== 0)
64 var
= vp8_variance_halfpixvar16x16_h_armv6(src_ptr
, src_pixels_per_line
,
65 dst_ptr
, dst_pixels_per_line
, sse
);
67 else if (xoffset
== 0 && yoffset
== 4)
69 var
= vp8_variance_halfpixvar16x16_v_armv6(src_ptr
, src_pixels_per_line
,
70 dst_ptr
, dst_pixels_per_line
, sse
);
72 else if (xoffset
== 4 && yoffset
== 4)
74 var
= vp8_variance_halfpixvar16x16_hv_armv6(src_ptr
, src_pixels_per_line
,
75 dst_ptr
, dst_pixels_per_line
, sse
);
79 HFilter
= vp8_bilinear_filters
[xoffset
];
80 VFilter
= vp8_bilinear_filters
[yoffset
];
82 vp8_filter_block2d_bil_first_pass_armv6(src_ptr
, first_pass
,
85 vp8_filter_block2d_bil_second_pass_armv6(first_pass
, second_pass
,
88 var
= vp8_variance16x16_armv6(second_pass
, 16, dst_ptr
,
89 dst_pixels_per_line
, sse
);
94 #endif /* HAVE_ARMV6 */
99 unsigned int vp8_sub_pixel_variance16x16_neon
101 const unsigned char *src_ptr
,
102 int src_pixels_per_line
,
105 const unsigned char *dst_ptr
,
106 int dst_pixels_per_line
,
110 if (xoffset
== 4 && yoffset
== 0)
111 return vp8_variance_halfpixvar16x16_h_neon(src_ptr
, src_pixels_per_line
, dst_ptr
, dst_pixels_per_line
, sse
);
112 else if (xoffset
== 0 && yoffset
== 4)
113 return vp8_variance_halfpixvar16x16_v_neon(src_ptr
, src_pixels_per_line
, dst_ptr
, dst_pixels_per_line
, sse
);
114 else if (xoffset
== 4 && yoffset
== 4)
115 return vp8_variance_halfpixvar16x16_hv_neon(src_ptr
, src_pixels_per_line
, dst_ptr
, dst_pixels_per_line
, sse
);
117 return vp8_sub_pixel_variance16x16_neon_func(src_ptr
, src_pixels_per_line
, xoffset
, yoffset
, dst_ptr
, dst_pixels_per_line
, sse
);