Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* |
michael@0 | 2 | * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
michael@0 | 3 | * |
michael@0 | 4 | * Use of this source code is governed by a BSD-style license |
michael@0 | 5 | * that can be found in the LICENSE file in the root of the source |
michael@0 | 6 | * tree. An additional intellectual property rights grant can be found |
michael@0 | 7 | * in the file PATENTS. All contributing project authors may |
michael@0 | 8 | * be found in the AUTHORS file in the root of the source tree. |
michael@0 | 9 | */ |
michael@0 | 10 | |
michael@0 | 11 | #include "vpx_config.h" |
michael@0 | 12 | #include "vp8_rtcd.h" |
michael@0 | 13 | #include "vp8/common/variance.h" |
michael@0 | 14 | #include "vp8/common/filter.h" |
michael@0 | 15 | |
michael@0 | 16 | #if HAVE_MEDIA |
michael@0 | 17 | #include "vp8/common/arm/bilinearfilter_arm.h" |
michael@0 | 18 | |
michael@0 | 19 | unsigned int vp8_sub_pixel_variance8x8_armv6 |
michael@0 | 20 | ( |
michael@0 | 21 | const unsigned char *src_ptr, |
michael@0 | 22 | int src_pixels_per_line, |
michael@0 | 23 | int xoffset, |
michael@0 | 24 | int yoffset, |
michael@0 | 25 | const unsigned char *dst_ptr, |
michael@0 | 26 | int dst_pixels_per_line, |
michael@0 | 27 | unsigned int *sse |
michael@0 | 28 | ) |
michael@0 | 29 | { |
michael@0 | 30 | unsigned short first_pass[10*8]; |
michael@0 | 31 | unsigned char second_pass[8*8]; |
michael@0 | 32 | const short *HFilter, *VFilter; |
michael@0 | 33 | |
michael@0 | 34 | HFilter = vp8_bilinear_filters[xoffset]; |
michael@0 | 35 | VFilter = vp8_bilinear_filters[yoffset]; |
michael@0 | 36 | |
michael@0 | 37 | vp8_filter_block2d_bil_first_pass_armv6(src_ptr, first_pass, |
michael@0 | 38 | src_pixels_per_line, |
michael@0 | 39 | 9, 8, HFilter); |
michael@0 | 40 | vp8_filter_block2d_bil_second_pass_armv6(first_pass, second_pass, |
michael@0 | 41 | 8, 8, 8, VFilter); |
michael@0 | 42 | |
michael@0 | 43 | return vp8_variance8x8_armv6(second_pass, 8, dst_ptr, |
michael@0 | 44 | dst_pixels_per_line, sse); |
michael@0 | 45 | } |
michael@0 | 46 | |
michael@0 | 47 | unsigned int vp8_sub_pixel_variance16x16_armv6 |
michael@0 | 48 | ( |
michael@0 | 49 | const unsigned char *src_ptr, |
michael@0 | 50 | int src_pixels_per_line, |
michael@0 | 51 | int xoffset, |
michael@0 | 52 | int yoffset, |
michael@0 | 53 | const unsigned char *dst_ptr, |
michael@0 | 54 | int dst_pixels_per_line, |
michael@0 | 55 | unsigned int *sse |
michael@0 | 56 | ) |
michael@0 | 57 | { |
michael@0 | 58 | unsigned short first_pass[36*16]; |
michael@0 | 59 | unsigned char second_pass[20*16]; |
michael@0 | 60 | const short *HFilter, *VFilter; |
michael@0 | 61 | unsigned int var; |
michael@0 | 62 | |
michael@0 | 63 | if (xoffset == 4 && yoffset == 0) |
michael@0 | 64 | { |
michael@0 | 65 | var = vp8_variance_halfpixvar16x16_h_armv6(src_ptr, src_pixels_per_line, |
michael@0 | 66 | dst_ptr, dst_pixels_per_line, sse); |
michael@0 | 67 | } |
michael@0 | 68 | else if (xoffset == 0 && yoffset == 4) |
michael@0 | 69 | { |
michael@0 | 70 | var = vp8_variance_halfpixvar16x16_v_armv6(src_ptr, src_pixels_per_line, |
michael@0 | 71 | dst_ptr, dst_pixels_per_line, sse); |
michael@0 | 72 | } |
michael@0 | 73 | else if (xoffset == 4 && yoffset == 4) |
michael@0 | 74 | { |
michael@0 | 75 | var = vp8_variance_halfpixvar16x16_hv_armv6(src_ptr, src_pixels_per_line, |
michael@0 | 76 | dst_ptr, dst_pixels_per_line, sse); |
michael@0 | 77 | } |
michael@0 | 78 | else |
michael@0 | 79 | { |
michael@0 | 80 | HFilter = vp8_bilinear_filters[xoffset]; |
michael@0 | 81 | VFilter = vp8_bilinear_filters[yoffset]; |
michael@0 | 82 | |
michael@0 | 83 | vp8_filter_block2d_bil_first_pass_armv6(src_ptr, first_pass, |
michael@0 | 84 | src_pixels_per_line, |
michael@0 | 85 | 17, 16, HFilter); |
michael@0 | 86 | vp8_filter_block2d_bil_second_pass_armv6(first_pass, second_pass, |
michael@0 | 87 | 16, 16, 16, VFilter); |
michael@0 | 88 | |
michael@0 | 89 | var = vp8_variance16x16_armv6(second_pass, 16, dst_ptr, |
michael@0 | 90 | dst_pixels_per_line, sse); |
michael@0 | 91 | } |
michael@0 | 92 | return var; |
michael@0 | 93 | } |
michael@0 | 94 | |
michael@0 | 95 | #endif /* HAVE_MEDIA */ |
michael@0 | 96 | |
michael@0 | 97 | |
michael@0 | 98 | #if HAVE_NEON |
michael@0 | 99 | |
michael@0 | 100 | extern unsigned int vp8_sub_pixel_variance16x16_neon_func |
michael@0 | 101 | ( |
michael@0 | 102 | const unsigned char *src_ptr, |
michael@0 | 103 | int src_pixels_per_line, |
michael@0 | 104 | int xoffset, |
michael@0 | 105 | int yoffset, |
michael@0 | 106 | const unsigned char *dst_ptr, |
michael@0 | 107 | int dst_pixels_per_line, |
michael@0 | 108 | unsigned int *sse |
michael@0 | 109 | ); |
michael@0 | 110 | |
michael@0 | 111 | unsigned int vp8_sub_pixel_variance16x16_neon |
michael@0 | 112 | ( |
michael@0 | 113 | const unsigned char *src_ptr, |
michael@0 | 114 | int src_pixels_per_line, |
michael@0 | 115 | int xoffset, |
michael@0 | 116 | int yoffset, |
michael@0 | 117 | const unsigned char *dst_ptr, |
michael@0 | 118 | int dst_pixels_per_line, |
michael@0 | 119 | unsigned int *sse |
michael@0 | 120 | ) |
michael@0 | 121 | { |
michael@0 | 122 | if (xoffset == 4 && yoffset == 0) |
michael@0 | 123 | return vp8_variance_halfpixvar16x16_h_neon(src_ptr, src_pixels_per_line, dst_ptr, dst_pixels_per_line, sse); |
michael@0 | 124 | else if (xoffset == 0 && yoffset == 4) |
michael@0 | 125 | return vp8_variance_halfpixvar16x16_v_neon(src_ptr, src_pixels_per_line, dst_ptr, dst_pixels_per_line, sse); |
michael@0 | 126 | else if (xoffset == 4 && yoffset == 4) |
michael@0 | 127 | return vp8_variance_halfpixvar16x16_hv_neon(src_ptr, src_pixels_per_line, dst_ptr, dst_pixels_per_line, sse); |
michael@0 | 128 | else |
michael@0 | 129 | return vp8_sub_pixel_variance16x16_neon_func(src_ptr, src_pixels_per_line, xoffset, yoffset, dst_ptr, dst_pixels_per_line, sse); |
michael@0 | 130 | } |
michael@0 | 131 | |
michael@0 | 132 | #endif |