| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 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 "./vp8_rtcd.h" |
| 11 #include "vpx_config.h" | 12 #include "vpx_config.h" |
| 12 #include "vp8/common/variance.h" | 13 #include "vp8/common/variance.h" |
| 13 #include "vpx_ports/mem.h" | 14 #include "vpx_ports/mem.h" |
| 14 #include "vp8/common/x86/filter_x86.h" | 15 #include "vp8/common/x86/filter_x86.h" |
| 15 | 16 |
| 16 extern void filter_block1d_h6_mmx | 17 extern void filter_block1d_h6_mmx |
| 17 ( | 18 ( |
| 18 const unsigned char *src_ptr, | 19 const unsigned char *src_ptr, |
| 19 unsigned short *output_ptr, | 20 unsigned short *output_ptr, |
| 20 unsigned int src_pixels_per_line, | 21 unsigned int src_pixels_per_line, |
| 21 unsigned int pixel_step, | 22 unsigned int pixel_step, |
| 22 unsigned int output_height, | 23 unsigned int output_height, |
| 23 unsigned int output_width, | 24 unsigned int output_width, |
| 24 short *filter | 25 short *filter |
| 25 ); | 26 ); |
| 26 extern void filter_block1d_v6_mmx | 27 extern void filter_block1d_v6_mmx |
| 27 ( | 28 ( |
| 28 const short *src_ptr, | 29 const short *src_ptr, |
| 29 unsigned char *output_ptr, | 30 unsigned char *output_ptr, |
| 30 unsigned int pixels_per_line, | 31 unsigned int pixels_per_line, |
| 31 unsigned int pixel_step, | 32 unsigned int pixel_step, |
| 32 unsigned int output_height, | 33 unsigned int output_height, |
| 33 unsigned int output_width, | 34 unsigned int output_width, |
| 34 short *filter | 35 short *filter |
| 35 ); | 36 ); |
| 36 | 37 |
| 37 extern unsigned int vp8_get_mb_ss_mmx(const short *src_ptr); | |
| 38 extern unsigned int vp8_get8x8var_mmx | |
| 39 ( | |
| 40 const unsigned char *src_ptr, | |
| 41 int source_stride, | |
| 42 const unsigned char *ref_ptr, | |
| 43 int recon_stride, | |
| 44 unsigned int *SSE, | |
| 45 int *Sum | |
| 46 ); | |
| 47 extern unsigned int vp8_get4x4var_mmx | |
| 48 ( | |
| 49 const unsigned char *src_ptr, | |
| 50 int source_stride, | |
| 51 const unsigned char *ref_ptr, | |
| 52 int recon_stride, | |
| 53 unsigned int *SSE, | |
| 54 int *Sum | |
| 55 ); | |
| 56 extern void vp8_filter_block2d_bil4x4_var_mmx | 38 extern void vp8_filter_block2d_bil4x4_var_mmx |
| 57 ( | 39 ( |
| 58 const unsigned char *ref_ptr, | 40 const unsigned char *ref_ptr, |
| 59 int ref_pixels_per_line, | 41 int ref_pixels_per_line, |
| 60 const unsigned char *src_ptr, | 42 const unsigned char *src_ptr, |
| 61 int src_pixels_per_line, | 43 int src_pixels_per_line, |
| 62 const short *HFilter, | 44 const short *HFilter, |
| 63 const short *VFilter, | 45 const short *VFilter, |
| 64 int *sum, | 46 int *sum, |
| 65 unsigned int *sumsquared | 47 unsigned int *sumsquared |
| 66 ); | 48 ); |
| 67 extern void vp8_filter_block2d_bil_var_mmx | 49 extern void vp8_filter_block2d_bil_var_mmx |
| 68 ( | 50 ( |
| 69 const unsigned char *ref_ptr, | 51 const unsigned char *ref_ptr, |
| 70 int ref_pixels_per_line, | 52 int ref_pixels_per_line, |
| 71 const unsigned char *src_ptr, | 53 const unsigned char *src_ptr, |
| 72 int src_pixels_per_line, | 54 int src_pixels_per_line, |
| 73 unsigned int Height, | 55 unsigned int Height, |
| 74 const short *HFilter, | 56 const short *HFilter, |
| 75 const short *VFilter, | 57 const short *VFilter, |
| 76 int *sum, | 58 int *sum, |
| 77 unsigned int *sumsquared | 59 unsigned int *sumsquared |
| 78 ); | 60 ); |
| 79 | 61 |
| 80 | |
| 81 unsigned int vp8_variance4x4_mmx( | |
| 82 const unsigned char *src_ptr, | |
| 83 int source_stride, | |
| 84 const unsigned char *ref_ptr, | |
| 85 int recon_stride, | |
| 86 unsigned int *sse) | |
| 87 { | |
| 88 unsigned int var; | |
| 89 int avg; | |
| 90 | |
| 91 vp8_get4x4var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &var, &avg)
; | |
| 92 *sse = var; | |
| 93 return (var - (((unsigned int)avg * avg) >> 4)); | |
| 94 | |
| 95 } | |
| 96 | |
| 97 unsigned int vp8_variance8x8_mmx( | |
| 98 const unsigned char *src_ptr, | |
| 99 int source_stride, | |
| 100 const unsigned char *ref_ptr, | |
| 101 int recon_stride, | |
| 102 unsigned int *sse) | |
| 103 { | |
| 104 unsigned int var; | |
| 105 int avg; | |
| 106 | |
| 107 vp8_get8x8var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &var, &avg)
; | |
| 108 *sse = var; | |
| 109 | |
| 110 return (var - (((unsigned int)avg * avg) >> 6)); | |
| 111 | |
| 112 } | |
| 113 | |
| 114 unsigned int vp8_mse16x16_mmx( | |
| 115 const unsigned char *src_ptr, | |
| 116 int source_stride, | |
| 117 const unsigned char *ref_ptr, | |
| 118 int recon_stride, | |
| 119 unsigned int *sse) | |
| 120 { | |
| 121 unsigned int sse0, sse1, sse2, sse3, var; | |
| 122 int sum0, sum1, sum2, sum3; | |
| 123 | |
| 124 | |
| 125 vp8_get8x8var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum
0) ; | |
| 126 vp8_get8x8var_mmx(src_ptr + 8, source_stride, ref_ptr + 8, recon_stride, &ss
e1, &sum1); | |
| 127 vp8_get8x8var_mmx(src_ptr + 8 * source_stride, source_stride, ref_ptr + 8 *
recon_stride, recon_stride, &sse2, &sum2) ; | |
| 128 vp8_get8x8var_mmx(src_ptr + 8 * source_stride + 8, source_stride, ref_ptr +
8 * recon_stride + 8, recon_stride, &sse3, &sum3); | |
| 129 | |
| 130 var = sse0 + sse1 + sse2 + sse3; | |
| 131 *sse = var; | |
| 132 return var; | |
| 133 } | |
| 134 | |
| 135 | |
| 136 unsigned int vp8_variance16x16_mmx( | |
| 137 const unsigned char *src_ptr, | |
| 138 int source_stride, | |
| 139 const unsigned char *ref_ptr, | |
| 140 int recon_stride, | |
| 141 unsigned int *sse) | |
| 142 { | |
| 143 unsigned int sse0, sse1, sse2, sse3, var; | |
| 144 int sum0, sum1, sum2, sum3, avg; | |
| 145 | |
| 146 | |
| 147 vp8_get8x8var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum
0) ; | |
| 148 vp8_get8x8var_mmx(src_ptr + 8, source_stride, ref_ptr + 8, recon_stride, &ss
e1, &sum1); | |
| 149 vp8_get8x8var_mmx(src_ptr + 8 * source_stride, source_stride, ref_ptr + 8 *
recon_stride, recon_stride, &sse2, &sum2) ; | |
| 150 vp8_get8x8var_mmx(src_ptr + 8 * source_stride + 8, source_stride, ref_ptr +
8 * recon_stride + 8, recon_stride, &sse3, &sum3); | |
| 151 | |
| 152 var = sse0 + sse1 + sse2 + sse3; | |
| 153 avg = sum0 + sum1 + sum2 + sum3; | |
| 154 *sse = var; | |
| 155 return (var - (((unsigned int)avg * avg) >> 8)); | |
| 156 } | |
| 157 | |
| 158 unsigned int vp8_variance16x8_mmx( | |
| 159 const unsigned char *src_ptr, | |
| 160 int source_stride, | |
| 161 const unsigned char *ref_ptr, | |
| 162 int recon_stride, | |
| 163 unsigned int *sse) | |
| 164 { | |
| 165 unsigned int sse0, sse1, var; | |
| 166 int sum0, sum1, avg; | |
| 167 | |
| 168 vp8_get8x8var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum
0) ; | |
| 169 vp8_get8x8var_mmx(src_ptr + 8, source_stride, ref_ptr + 8, recon_stride, &ss
e1, &sum1); | |
| 170 | |
| 171 var = sse0 + sse1; | |
| 172 avg = sum0 + sum1; | |
| 173 *sse = var; | |
| 174 return (var - (((unsigned int)avg * avg) >> 7)); | |
| 175 | |
| 176 } | |
| 177 | |
| 178 | |
| 179 unsigned int vp8_variance8x16_mmx( | |
| 180 const unsigned char *src_ptr, | |
| 181 int source_stride, | |
| 182 const unsigned char *ref_ptr, | |
| 183 int recon_stride, | |
| 184 unsigned int *sse) | |
| 185 { | |
| 186 unsigned int sse0, sse1, var; | |
| 187 int sum0, sum1, avg; | |
| 188 | |
| 189 vp8_get8x8var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum
0) ; | |
| 190 vp8_get8x8var_mmx(src_ptr + 8 * source_stride, source_stride, ref_ptr + 8 *
recon_stride, recon_stride, &sse1, &sum1) ; | |
| 191 | |
| 192 var = sse0 + sse1; | |
| 193 avg = sum0 + sum1; | |
| 194 *sse = var; | |
| 195 | |
| 196 return (var - (((unsigned int)avg * avg) >> 7)); | |
| 197 | |
| 198 } | |
| 199 | |
| 200 | |
| 201 unsigned int vp8_sub_pixel_variance4x4_mmx | 62 unsigned int vp8_sub_pixel_variance4x4_mmx |
| 202 ( | 63 ( |
| 203 const unsigned char *src_ptr, | 64 const unsigned char *src_ptr, |
| 204 int src_pixels_per_line, | 65 int src_pixels_per_line, |
| 205 int xoffset, | 66 int xoffset, |
| 206 int yoffset, | 67 int yoffset, |
| 207 const unsigned char *dst_ptr, | 68 const unsigned char *dst_ptr, |
| 208 int dst_pixels_per_line, | 69 int dst_pixels_per_line, |
| 209 unsigned int *sse) | 70 unsigned int *sse) |
| 210 | 71 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 unsigned int vp8_variance_halfpixvar16x16_hv_mmx( | 249 unsigned int vp8_variance_halfpixvar16x16_hv_mmx( |
| 389 const unsigned char *src_ptr, | 250 const unsigned char *src_ptr, |
| 390 int source_stride, | 251 int source_stride, |
| 391 const unsigned char *ref_ptr, | 252 const unsigned char *ref_ptr, |
| 392 int recon_stride, | 253 int recon_stride, |
| 393 unsigned int *sse) | 254 unsigned int *sse) |
| 394 { | 255 { |
| 395 return vp8_sub_pixel_variance16x16_mmx(src_ptr, source_stride, 4, 4, | 256 return vp8_sub_pixel_variance16x16_mmx(src_ptr, source_stride, 4, 4, |
| 396 ref_ptr, recon_stride, sse); | 257 ref_ptr, recon_stride, sse); |
| 397 } | 258 } |
| OLD | NEW |