| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include <arm_neon.h> | 11 #include <arm_neon.h> |
| 12 #include "vpx_ports/mem.h" | 12 #include "vpx_ports/mem.h" |
| 13 #include "vpx/vpx_integer.h" | 13 #include "vpx/vpx_integer.h" |
| 14 | 14 |
| 15 static const uint16_t bilinear_taps_coeff[8][2] = { | 15 static const uint8_t bilinear_taps_coeff[8][2] = { |
| 16 {128, 0}, | 16 {128, 0}, |
| 17 {112, 16}, | 17 {112, 16}, |
| 18 { 96, 32}, | 18 { 96, 32}, |
| 19 { 80, 48}, | 19 { 80, 48}, |
| 20 { 64, 64}, | 20 { 64, 64}, |
| 21 { 48, 80}, | 21 { 48, 80}, |
| 22 { 32, 96}, | 22 { 32, 96}, |
| 23 { 16, 112} | 23 { 16, 112} |
| 24 }; | 24 }; |
| 25 | 25 |
| (...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 variance_neon_w8(a, a_stride, b, b_stride, 8, 8, sse, &sum); | 965 variance_neon_w8(a, a_stride, b, b_stride, 8, 8, sse, &sum); |
| 966 return *sse - (((int64_t)sum * sum) / (8 * 8)); | 966 return *sse - (((int64_t)sum * sum) / (8 * 8)); |
| 967 } | 967 } |
| 968 | 968 |
| 969 static void var_filter_block2d_bil_w8(const uint8_t *src_ptr, | 969 static void var_filter_block2d_bil_w8(const uint8_t *src_ptr, |
| 970 uint8_t *output_ptr, | 970 uint8_t *output_ptr, |
| 971 unsigned int src_pixels_per_line, | 971 unsigned int src_pixels_per_line, |
| 972 int pixel_step, | 972 int pixel_step, |
| 973 unsigned int output_height, | 973 unsigned int output_height, |
| 974 unsigned int output_width, | 974 unsigned int output_width, |
| 975 const uint16_t *vpx_filter) { | 975 const uint8_t *vpx_filter) { |
| 976 const uint8x8_t f0 = vmov_n_u8((uint8_t)vpx_filter[0]); | 976 const uint8x8_t f0 = vmov_n_u8(vpx_filter[0]); |
| 977 const uint8x8_t f1 = vmov_n_u8((uint8_t)vpx_filter[1]); | 977 const uint8x8_t f1 = vmov_n_u8(vpx_filter[1]); |
| 978 unsigned int i; | 978 unsigned int i; |
| 979 for (i = 0; i < output_height; ++i) { | 979 for (i = 0; i < output_height; ++i) { |
| 980 const uint8x8_t src_0 = vld1_u8(&src_ptr[0]); | 980 const uint8x8_t src_0 = vld1_u8(&src_ptr[0]); |
| 981 const uint8x8_t src_1 = vld1_u8(&src_ptr[pixel_step]); | 981 const uint8x8_t src_1 = vld1_u8(&src_ptr[pixel_step]); |
| 982 const uint16x8_t a = vmull_u8(src_0, f0); | 982 const uint16x8_t a = vmull_u8(src_0, f0); |
| 983 const uint16x8_t b = vmlal_u8(a, src_1, f1); | 983 const uint16x8_t b = vmlal_u8(a, src_1, f1); |
| 984 const uint8x8_t out = vrshrn_n_u16(b, FILTER_BITS); | 984 const uint8x8_t out = vrshrn_n_u16(b, FILTER_BITS); |
| 985 vst1_u8(&output_ptr[0], out); | 985 vst1_u8(&output_ptr[0], out); |
| 986 // Next row... | 986 // Next row... |
| 987 src_ptr += src_pixels_per_line; | 987 src_ptr += src_pixels_per_line; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1008 bilinear_taps_coeff[xoffset]); | 1008 bilinear_taps_coeff[xoffset]); |
| 1009 } else { | 1009 } else { |
| 1010 var_filter_block2d_bil_w8(src, fdata3, src_stride, 1, | 1010 var_filter_block2d_bil_w8(src, fdata3, src_stride, 1, |
| 1011 9, 8, | 1011 9, 8, |
| 1012 bilinear_taps_coeff[xoffset]); | 1012 bilinear_taps_coeff[xoffset]); |
| 1013 var_filter_block2d_bil_w8(fdata3, temp2, 8, 8, 8, | 1013 var_filter_block2d_bil_w8(fdata3, temp2, 8, 8, 8, |
| 1014 8, bilinear_taps_coeff[yoffset]); | 1014 8, bilinear_taps_coeff[yoffset]); |
| 1015 } | 1015 } |
| 1016 return variance8x8_neon(temp2, 8, dst, dst_stride, sse); | 1016 return variance8x8_neon(temp2, 8, dst, dst_stride, sse); |
| 1017 } | 1017 } |
| OLD | NEW |