michael@0: /* michael@0: * Copyright (c) 2010 The WebM project authors. All Rights Reserved. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license michael@0: * that can be found in the LICENSE file in the root of the source michael@0: * tree. An additional intellectual property rights grant can be found michael@0: * in the file PATENTS. All contributing project authors may michael@0: * be found in the AUTHORS file in the root of the source tree. michael@0: */ michael@0: michael@0: #include "vpx_config.h" michael@0: #include "vp8_rtcd.h" michael@0: #include "vp8/common/variance.h" michael@0: #include "vp8/common/filter.h" michael@0: michael@0: #if HAVE_MEDIA michael@0: #include "vp8/common/arm/bilinearfilter_arm.h" michael@0: michael@0: unsigned int vp8_sub_pixel_variance8x8_armv6 michael@0: ( michael@0: const unsigned char *src_ptr, michael@0: int src_pixels_per_line, michael@0: int xoffset, michael@0: int yoffset, michael@0: const unsigned char *dst_ptr, michael@0: int dst_pixels_per_line, michael@0: unsigned int *sse michael@0: ) michael@0: { michael@0: unsigned short first_pass[10*8]; michael@0: unsigned char second_pass[8*8]; michael@0: const short *HFilter, *VFilter; michael@0: michael@0: HFilter = vp8_bilinear_filters[xoffset]; michael@0: VFilter = vp8_bilinear_filters[yoffset]; michael@0: michael@0: vp8_filter_block2d_bil_first_pass_armv6(src_ptr, first_pass, michael@0: src_pixels_per_line, michael@0: 9, 8, HFilter); michael@0: vp8_filter_block2d_bil_second_pass_armv6(first_pass, second_pass, michael@0: 8, 8, 8, VFilter); michael@0: michael@0: return vp8_variance8x8_armv6(second_pass, 8, dst_ptr, michael@0: dst_pixels_per_line, sse); michael@0: } michael@0: michael@0: unsigned int vp8_sub_pixel_variance16x16_armv6 michael@0: ( michael@0: const unsigned char *src_ptr, michael@0: int src_pixels_per_line, michael@0: int xoffset, michael@0: int yoffset, michael@0: const unsigned char *dst_ptr, michael@0: int dst_pixels_per_line, michael@0: unsigned int *sse michael@0: ) michael@0: { michael@0: unsigned short first_pass[36*16]; michael@0: unsigned char second_pass[20*16]; michael@0: const short *HFilter, *VFilter; michael@0: unsigned int var; michael@0: michael@0: if (xoffset == 4 && yoffset == 0) michael@0: { michael@0: var = vp8_variance_halfpixvar16x16_h_armv6(src_ptr, src_pixels_per_line, michael@0: dst_ptr, dst_pixels_per_line, sse); michael@0: } michael@0: else if (xoffset == 0 && yoffset == 4) michael@0: { michael@0: var = vp8_variance_halfpixvar16x16_v_armv6(src_ptr, src_pixels_per_line, michael@0: dst_ptr, dst_pixels_per_line, sse); michael@0: } michael@0: else if (xoffset == 4 && yoffset == 4) michael@0: { michael@0: var = vp8_variance_halfpixvar16x16_hv_armv6(src_ptr, src_pixels_per_line, michael@0: dst_ptr, dst_pixels_per_line, sse); michael@0: } michael@0: else michael@0: { michael@0: HFilter = vp8_bilinear_filters[xoffset]; michael@0: VFilter = vp8_bilinear_filters[yoffset]; michael@0: michael@0: vp8_filter_block2d_bil_first_pass_armv6(src_ptr, first_pass, michael@0: src_pixels_per_line, michael@0: 17, 16, HFilter); michael@0: vp8_filter_block2d_bil_second_pass_armv6(first_pass, second_pass, michael@0: 16, 16, 16, VFilter); michael@0: michael@0: var = vp8_variance16x16_armv6(second_pass, 16, dst_ptr, michael@0: dst_pixels_per_line, sse); michael@0: } michael@0: return var; michael@0: } michael@0: michael@0: #endif /* HAVE_MEDIA */ michael@0: michael@0: michael@0: #if HAVE_NEON michael@0: michael@0: extern unsigned int vp8_sub_pixel_variance16x16_neon_func michael@0: ( michael@0: const unsigned char *src_ptr, michael@0: int src_pixels_per_line, michael@0: int xoffset, michael@0: int yoffset, michael@0: const unsigned char *dst_ptr, michael@0: int dst_pixels_per_line, michael@0: unsigned int *sse michael@0: ); michael@0: michael@0: unsigned int vp8_sub_pixel_variance16x16_neon michael@0: ( michael@0: const unsigned char *src_ptr, michael@0: int src_pixels_per_line, michael@0: int xoffset, michael@0: int yoffset, michael@0: const unsigned char *dst_ptr, michael@0: int dst_pixels_per_line, michael@0: unsigned int *sse michael@0: ) michael@0: { michael@0: if (xoffset == 4 && yoffset == 0) michael@0: return vp8_variance_halfpixvar16x16_h_neon(src_ptr, src_pixels_per_line, dst_ptr, dst_pixels_per_line, sse); michael@0: else if (xoffset == 0 && yoffset == 4) michael@0: return vp8_variance_halfpixvar16x16_v_neon(src_ptr, src_pixels_per_line, dst_ptr, dst_pixels_per_line, sse); michael@0: else if (xoffset == 4 && yoffset == 4) michael@0: return vp8_variance_halfpixvar16x16_hv_neon(src_ptr, src_pixels_per_line, dst_ptr, dst_pixels_per_line, sse); michael@0: else michael@0: return vp8_sub_pixel_variance16x16_neon_func(src_ptr, src_pixels_per_line, xoffset, yoffset, dst_ptr, dst_pixels_per_line, sse); michael@0: } michael@0: michael@0: #endif