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"
13 #include "vp8/common/variance.h"
14 #include "vp8/common/filter.h"
17 #include "vp8/common/arm/bilinearfilter_arm.h"
19 unsigned int vp8_sub_pixel_variance8x8_armv6
21 const unsigned char *src_ptr,
22 int src_pixels_per_line,
25 const unsigned char *dst_ptr,
26 int dst_pixels_per_line,
30 unsigned short first_pass[10*8];
31 unsigned char second_pass[8*8];
32 const short *HFilter, *VFilter;
34 HFilter = vp8_bilinear_filters[xoffset];
35 VFilter = vp8_bilinear_filters[yoffset];
37 vp8_filter_block2d_bil_first_pass_armv6(src_ptr, first_pass,
40 vp8_filter_block2d_bil_second_pass_armv6(first_pass, second_pass,
43 return vp8_variance8x8_armv6(second_pass, 8, dst_ptr,
44 dst_pixels_per_line, sse);
47 unsigned int vp8_sub_pixel_variance16x16_armv6
49 const unsigned char *src_ptr,
50 int src_pixels_per_line,
53 const unsigned char *dst_ptr,
54 int dst_pixels_per_line,
58 unsigned short first_pass[36*16];
59 unsigned char second_pass[20*16];
60 const short *HFilter, *VFilter;
63 if (xoffset == 4 && yoffset == 0)
65 var = vp8_variance_halfpixvar16x16_h_armv6(src_ptr, src_pixels_per_line,
66 dst_ptr, dst_pixels_per_line, sse);
68 else if (xoffset == 0 && yoffset == 4)
70 var = vp8_variance_halfpixvar16x16_v_armv6(src_ptr, src_pixels_per_line,
71 dst_ptr, dst_pixels_per_line, sse);
73 else if (xoffset == 4 && yoffset == 4)
75 var = vp8_variance_halfpixvar16x16_hv_armv6(src_ptr, src_pixels_per_line,
76 dst_ptr, dst_pixels_per_line, sse);
80 HFilter = vp8_bilinear_filters[xoffset];
81 VFilter = vp8_bilinear_filters[yoffset];
83 vp8_filter_block2d_bil_first_pass_armv6(src_ptr, first_pass,
86 vp8_filter_block2d_bil_second_pass_armv6(first_pass, second_pass,
89 var = vp8_variance16x16_armv6(second_pass, 16, dst_ptr,
90 dst_pixels_per_line, sse);
95 #endif /* HAVE_MEDIA */
100 unsigned int vp8_sub_pixel_variance16x16_neon
102 const unsigned char *src_ptr,
103 int src_pixels_per_line,
106 const unsigned char *dst_ptr,
107 int dst_pixels_per_line,
111 if (xoffset == 4 && yoffset == 0)
112 return vp8_variance_halfpixvar16x16_h_neon(src_ptr, src_pixels_per_line, dst_ptr, dst_pixels_per_line, sse);
113 else if (xoffset == 0 && yoffset == 4)
114 return vp8_variance_halfpixvar16x16_v_neon(src_ptr, src_pixels_per_line, dst_ptr, dst_pixels_per_line, sse);
115 else if (xoffset == 4 && yoffset == 4)
116 return vp8_variance_halfpixvar16x16_hv_neon(src_ptr, src_pixels_per_line, dst_ptr, dst_pixels_per_line, sse);
118 return vp8_sub_pixel_variance16x16_neon_func(src_ptr, src_pixels_per_line, xoffset, yoffset, dst_ptr, dst_pixels_per_line, sse);