| 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 | 11 #include "vpx_config.h" | 
| 12 #include "vp8/encoder/variance.h" | 12 #include "vp8/encoder/variance.h" | 
| 13 #include "vp8/common/pragmas.h" | 13 #include "vp8/common/pragmas.h" | 
| 14 #include "vpx_ports/mem.h" | 14 #include "vpx_ports/mem.h" | 
| 15 | 15 | 
| 16 extern void filter_block1d_h6_mmx | 16 extern void filter_block1d_h6_mmx | 
| 17 ( | 17 ( | 
| 18     const unsigned char *src_ptr, | 18     const unsigned char *src_ptr, | 
| 19     unsigned short *output_ptr, | 19     unsigned short *output_ptr, | 
| 20     unsigned int src_pixels_per_line, | 20     unsigned int src_pixels_per_line, | 
| 21     unsigned int pixel_step, | 21     unsigned int pixel_step, | 
| 22     unsigned int output_height, | 22     unsigned int output_height, | 
| 23     unsigned int output_width, | 23     unsigned int output_width, | 
| 24     short *vp7_filter | 24     short *vp7_filter | 
| 25 ); | 25 ); | 
| 26 extern void filter_block1d_v6_mmx | 26 extern void filter_block1d_v6_mmx | 
| 27 ( | 27 ( | 
| 28     const short *src_ptr, | 28     const short *src_ptr, | 
| 29     unsigned char *output_ptr, | 29     unsigned char *output_ptr, | 
| 30     unsigned int pixels_per_line, | 30     unsigned int pixels_per_line, | 
| 31     unsigned int pixel_step, | 31     unsigned int pixel_step, | 
| 32     unsigned int output_height, | 32     unsigned int output_height, | 
| 33     unsigned int output_width, | 33     unsigned int output_width, | 
| 34     short *vp7_filter | 34     short *vp7_filter | 
| 35 ); | 35 ); | 
| 36 | 36 | 
| 37 extern unsigned int vp8_get_mb_ss_mmx(short *src_ptr); | 37 extern unsigned int vp8_get_mb_ss_mmx(const short *src_ptr); | 
| 38 extern unsigned int vp8_get8x8var_mmx | 38 extern unsigned int vp8_get8x8var_mmx | 
| 39 ( | 39 ( | 
| 40     const unsigned char *src_ptr, | 40     const unsigned char *src_ptr, | 
| 41     int  source_stride, | 41     int  source_stride, | 
| 42     const unsigned char *ref_ptr, | 42     const unsigned char *ref_ptr, | 
| 43     int  recon_stride, | 43     int  recon_stride, | 
| 44     unsigned int *SSE, | 44     unsigned int *SSE, | 
| 45     int *Sum | 45     int *Sum | 
| 46 ); | 46 ); | 
| 47 extern unsigned int vp8_get4x4var_mmx | 47 extern unsigned int vp8_get4x4var_mmx | 
| (...skipping 21 matching lines...) Expand all  Loading... | 
| 69     const unsigned char *ref_ptr, | 69     const unsigned char *ref_ptr, | 
| 70     int ref_pixels_per_line, | 70     int ref_pixels_per_line, | 
| 71     const unsigned char *src_ptr, | 71     const unsigned char *src_ptr, | 
| 72     int src_pixels_per_line, | 72     int src_pixels_per_line, | 
| 73     unsigned int Height, | 73     unsigned int Height, | 
| 74     const short *HFilter, | 74     const short *HFilter, | 
| 75     const short *VFilter, | 75     const short *VFilter, | 
| 76     int *sum, | 76     int *sum, | 
| 77     unsigned int *sumsquared | 77     unsigned int *sumsquared | 
| 78 ); | 78 ); | 
| 79 extern unsigned int vp8_get16x16pred_error_mmx |  | 
| 80 ( |  | 
| 81     unsigned char *src_ptr, |  | 
| 82     int src_stride, |  | 
| 83     unsigned char *ref_ptr, |  | 
| 84     int ref_stride |  | 
| 85 ); |  | 
| 86 |  | 
| 87 |  | 
| 88 unsigned int vp8_get16x16var_mmx( |  | 
| 89     const unsigned char *src_ptr, |  | 
| 90     int  source_stride, |  | 
| 91     const unsigned char *ref_ptr, |  | 
| 92     int  recon_stride, |  | 
| 93     unsigned *SSE, |  | 
| 94     unsigned *SUM |  | 
| 95 ) |  | 
| 96 { |  | 
| 97     unsigned int sse0, sse1, sse2, sse3, var; |  | 
| 98     int sum0, sum1, sum2, sum3, avg; |  | 
| 99 |  | 
| 100 |  | 
| 101     vp8_get8x8var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum
     0) ; |  | 
| 102     vp8_get8x8var_mmx(src_ptr + 8, source_stride, ref_ptr + 8, recon_stride, &ss
     e1, &sum1); |  | 
| 103     vp8_get8x8var_mmx(src_ptr + 8 * source_stride, source_stride, ref_ptr + 8 * 
     recon_stride, recon_stride, &sse2, &sum2) ; |  | 
| 104     vp8_get8x8var_mmx(src_ptr + 8 * source_stride + 8, source_stride, ref_ptr + 
     8 * recon_stride + 8, recon_stride, &sse3, &sum3); |  | 
| 105 |  | 
| 106     var = sse0 + sse1 + sse2 + sse3; |  | 
| 107     avg = sum0 + sum1 + sum2 + sum3; |  | 
| 108 |  | 
| 109     *SSE = var; |  | 
| 110     *SUM = avg; |  | 
| 111     return (var - ((avg * avg) >> 8)); |  | 
| 112 |  | 
| 113 } |  | 
| 114 |  | 
| 115 |  | 
| 116 |  | 
| 117 | 79 | 
| 118 | 80 | 
| 119 unsigned int vp8_variance4x4_mmx( | 81 unsigned int vp8_variance4x4_mmx( | 
| 120     const unsigned char *src_ptr, | 82     const unsigned char *src_ptr, | 
| 121     int  source_stride, | 83     int  source_stride, | 
| 122     const unsigned char *ref_ptr, | 84     const unsigned char *ref_ptr, | 
| 123     int  recon_stride, | 85     int  recon_stride, | 
| 124     unsigned int *sse) | 86     unsigned int *sse) | 
| 125 { | 87 { | 
| 126     unsigned int var; | 88     unsigned int var; | 
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 169     *sse = var; | 131     *sse = var; | 
| 170     return var; | 132     return var; | 
| 171 } | 133 } | 
| 172 | 134 | 
| 173 | 135 | 
| 174 unsigned int vp8_variance16x16_mmx( | 136 unsigned int vp8_variance16x16_mmx( | 
| 175     const unsigned char *src_ptr, | 137     const unsigned char *src_ptr, | 
| 176     int  source_stride, | 138     int  source_stride, | 
| 177     const unsigned char *ref_ptr, | 139     const unsigned char *ref_ptr, | 
| 178     int  recon_stride, | 140     int  recon_stride, | 
| 179     int *sse) | 141     unsigned int *sse) | 
| 180 { | 142 { | 
| 181     unsigned int sse0, sse1, sse2, sse3, var; | 143     unsigned int sse0, sse1, sse2, sse3, var; | 
| 182     int sum0, sum1, sum2, sum3, avg; | 144     int sum0, sum1, sum2, sum3, avg; | 
| 183 | 145 | 
| 184 | 146 | 
| 185     vp8_get8x8var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum
     0) ; | 147     vp8_get8x8var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum
     0) ; | 
| 186     vp8_get8x8var_mmx(src_ptr + 8, source_stride, ref_ptr + 8, recon_stride, &ss
     e1, &sum1); | 148     vp8_get8x8var_mmx(src_ptr + 8, source_stride, ref_ptr + 8, recon_stride, &ss
     e1, &sum1); | 
| 187     vp8_get8x8var_mmx(src_ptr + 8 * source_stride, source_stride, ref_ptr + 8 * 
     recon_stride, recon_stride, &sse2, &sum2) ; | 149     vp8_get8x8var_mmx(src_ptr + 8 * source_stride, source_stride, ref_ptr + 8 * 
     recon_stride, recon_stride, &sse2, &sum2) ; | 
| 188     vp8_get8x8var_mmx(src_ptr + 8 * source_stride + 8, source_stride, ref_ptr + 
     8 * recon_stride + 8, recon_stride, &sse3, &sum3); | 150     vp8_get8x8var_mmx(src_ptr + 8 * source_stride + 8, source_stride, ref_ptr + 
     8 * recon_stride + 8, recon_stride, &sse3, &sum3); | 
| 189 | 151 | 
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 394 } | 356 } | 
| 395 | 357 | 
| 396 unsigned int vp8_sub_pixel_variance8x16_mmx | 358 unsigned int vp8_sub_pixel_variance8x16_mmx | 
| 397 ( | 359 ( | 
| 398     const unsigned char  *src_ptr, | 360     const unsigned char  *src_ptr, | 
| 399     int  src_pixels_per_line, | 361     int  src_pixels_per_line, | 
| 400     int  xoffset, | 362     int  xoffset, | 
| 401     int  yoffset, | 363     int  yoffset, | 
| 402     const unsigned char *dst_ptr, | 364     const unsigned char *dst_ptr, | 
| 403     int dst_pixels_per_line, | 365     int dst_pixels_per_line, | 
| 404     int *sse | 366     unsigned int *sse | 
| 405 ) | 367 ) | 
| 406 { | 368 { | 
| 407     int xsum; | 369     int xsum; | 
| 408     unsigned int xxsum; | 370     unsigned int xxsum; | 
| 409     vp8_filter_block2d_bil_var_mmx( | 371     vp8_filter_block2d_bil_var_mmx( | 
| 410         src_ptr, src_pixels_per_line, | 372         src_ptr, src_pixels_per_line, | 
| 411         dst_ptr, dst_pixels_per_line, 16, | 373         dst_ptr, dst_pixels_per_line, 16, | 
| 412         vp8_vp7_bilinear_filters_mmx[xoffset], vp8_vp7_bilinear_filters_mmx[yoff
     set], | 374         vp8_vp7_bilinear_filters_mmx[xoffset], vp8_vp7_bilinear_filters_mmx[yoff
     set], | 
| 413         &xsum, &xxsum | 375         &xsum, &xxsum | 
| 414     ); | 376     ); | 
| (...skipping 29 matching lines...) Expand all  Loading... | 
| 444 unsigned int vp8_variance_halfpixvar16x16_hv_mmx( | 406 unsigned int vp8_variance_halfpixvar16x16_hv_mmx( | 
| 445     const unsigned char *src_ptr, | 407     const unsigned char *src_ptr, | 
| 446     int  source_stride, | 408     int  source_stride, | 
| 447     const unsigned char *ref_ptr, | 409     const unsigned char *ref_ptr, | 
| 448     int  recon_stride, | 410     int  recon_stride, | 
| 449     unsigned int *sse) | 411     unsigned int *sse) | 
| 450 { | 412 { | 
| 451     return vp8_sub_pixel_variance16x16_mmx(src_ptr, source_stride, 4, 4, | 413     return vp8_sub_pixel_variance16x16_mmx(src_ptr, source_stride, 4, 4, | 
| 452                                            ref_ptr, recon_stride, sse); | 414                                            ref_ptr, recon_stride, sse); | 
| 453 } | 415 } | 
| OLD | NEW | 
|---|