| 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(const unsigned char *src_ptr, unsigned short *
     output_ptr, unsigned int src_pixels_per_line, unsigned int pixel_step, unsigned 
     int output_height, unsigned int output_width, short *vp7_filter); | 16 extern void filter_block1d_h6_mmx(const unsigned char *src_ptr, unsigned short *
     output_ptr, unsigned int src_pixels_per_line, unsigned int pixel_step, unsigned 
     int output_height, unsigned int output_width, short *vp7_filter); | 
| 17 extern void filter_block1d_v6_mmx(const short *src_ptr, unsigned char *output_pt
     r, unsigned int pixels_per_line, unsigned int pixel_step, unsigned int output_he
     ight, unsigned int output_width, short *vp7_filter); | 17 extern void filter_block1d_v6_mmx(const short *src_ptr, unsigned char *output_pt
     r, unsigned int pixels_per_line, unsigned int pixel_step, unsigned int output_he
     ight, unsigned int output_width, short *vp7_filter); | 
| 18 extern void filter_block1d8_h6_sse2(const unsigned char *src_ptr, unsigned short
      *output_ptr, unsigned int src_pixels_per_line, unsigned int pixel_step, unsigne
     d int output_height, unsigned int output_width, short *vp7_filter); | 18 extern void filter_block1d8_h6_sse2(const unsigned char *src_ptr, unsigned short
      *output_ptr, unsigned int src_pixels_per_line, unsigned int pixel_step, unsigne
     d int output_height, unsigned int output_width, short *vp7_filter); | 
| 19 extern void filter_block1d8_v6_sse2(const short *src_ptr, unsigned char *output_
     ptr, unsigned int pixels_per_line, unsigned int pixel_step, unsigned int output_
     height, unsigned int output_width, short *vp7_filter); | 19 extern void filter_block1d8_v6_sse2(const short *src_ptr, unsigned char *output_
     ptr, unsigned int pixels_per_line, unsigned int pixel_step, unsigned int output_
     height, unsigned int output_width, short *vp7_filter); | 
| 20 | 20 | 
| 21 extern void vp8_filter_block2d_bil4x4_var_mmx | 21 extern void vp8_filter_block2d_bil4x4_var_mmx | 
| (...skipping 24 matching lines...) Expand all  Loading... | 
| 46 ); | 46 ); | 
| 47 unsigned int vp8_get16x16var_sse2 | 47 unsigned int vp8_get16x16var_sse2 | 
| 48 ( | 48 ( | 
| 49     const unsigned char *src_ptr, | 49     const unsigned char *src_ptr, | 
| 50     int source_stride, | 50     int source_stride, | 
| 51     const unsigned char *ref_ptr, | 51     const unsigned char *ref_ptr, | 
| 52     int recon_stride, | 52     int recon_stride, | 
| 53     unsigned int *SSE, | 53     unsigned int *SSE, | 
| 54     int *Sum | 54     int *Sum | 
| 55 ); | 55 ); | 
| 56 unsigned int vp8_get16x16pred_error_sse2 |  | 
| 57 ( |  | 
| 58     const unsigned char *src_ptr, |  | 
| 59     int src_stride, |  | 
| 60     const unsigned char *ref_ptr, |  | 
| 61     int ref_stride |  | 
| 62 ); |  | 
| 63 unsigned int vp8_get8x8var_sse2 | 56 unsigned int vp8_get8x8var_sse2 | 
| 64 ( | 57 ( | 
| 65     const unsigned char *src_ptr, | 58     const unsigned char *src_ptr, | 
| 66     int source_stride, | 59     int source_stride, | 
| 67     const unsigned char *ref_ptr, | 60     const unsigned char *ref_ptr, | 
| 68     int recon_stride, | 61     int recon_stride, | 
| 69     unsigned int *SSE, | 62     unsigned int *SSE, | 
| 70     int *Sum | 63     int *Sum | 
| 71 ); | 64 ); | 
| 72 void vp8_filter_block2d_bil_var_sse2 | 65 void vp8_filter_block2d_bil_var_sse2 | 
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 141     int *sum, | 134     int *sum, | 
| 142     unsigned int *sumsquared | 135     unsigned int *sumsquared | 
| 143 ); | 136 ); | 
| 144 | 137 | 
| 145 DECLARE_ALIGNED(16, extern short, vp8_vp7_bilinear_filters_mmx[8][8]); | 138 DECLARE_ALIGNED(16, extern short, vp8_vp7_bilinear_filters_mmx[8][8]); | 
| 146 | 139 | 
| 147 unsigned int vp8_variance4x4_wmt( | 140 unsigned int vp8_variance4x4_wmt( | 
| 148     const unsigned char *src_ptr, | 141     const unsigned char *src_ptr, | 
| 149     int  source_stride, | 142     int  source_stride, | 
| 150     const unsigned char *ref_ptr, | 143     const unsigned char *ref_ptr, | 
| 151     int  recon_stride) | 144     int  recon_stride, | 
|  | 145     unsigned int *sse) | 
| 152 { | 146 { | 
| 153     unsigned int var; | 147     unsigned int var; | 
| 154     int avg; | 148     int avg; | 
| 155 | 149 | 
| 156     vp8_get4x4var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &var, &avg)
      ; | 150     vp8_get4x4var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &var, &avg)
      ; | 
|  | 151     *sse = var; | 
| 157     return (var - ((avg * avg) >> 4)); | 152     return (var - ((avg * avg) >> 4)); | 
| 158 | 153 | 
| 159 } | 154 } | 
| 160 | 155 | 
| 161 |  | 
| 162 |  | 
| 163 unsigned int vp8_variance8x8_wmt | 156 unsigned int vp8_variance8x8_wmt | 
| 164 ( | 157 ( | 
| 165     const unsigned char *src_ptr, | 158     const unsigned char *src_ptr, | 
| 166     int  source_stride, | 159     int  source_stride, | 
| 167     const unsigned char *ref_ptr, | 160     const unsigned char *ref_ptr, | 
| 168     int  recon_stride) | 161     int  recon_stride, | 
|  | 162     unsigned int *sse) | 
| 169 { | 163 { | 
| 170     unsigned int var; | 164     unsigned int var; | 
| 171     int avg; | 165     int avg; | 
| 172 | 166 | 
| 173     vp8_get8x8var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &var, &avg
     ) ; | 167     vp8_get8x8var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &var, &avg
     ) ; | 
| 174 | 168     *sse = var; | 
| 175     return (var - ((avg * avg) >> 6)); | 169     return (var - ((avg * avg) >> 6)); | 
| 176 | 170 | 
| 177 } | 171 } | 
| 178 | 172 | 
| 179 | 173 | 
| 180 unsigned int vp8_variance16x16_wmt | 174 unsigned int vp8_variance16x16_wmt | 
| 181 ( | 175 ( | 
| 182     const unsigned char *src_ptr, | 176     const unsigned char *src_ptr, | 
| 183     int  source_stride, | 177     int  source_stride, | 
| 184     const unsigned char *ref_ptr, | 178     const unsigned char *ref_ptr, | 
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 555     unsigned int xxsum0; | 549     unsigned int xxsum0; | 
| 556 | 550 | 
| 557     vp8_half_horiz_vert_variance16x_h_sse2( | 551     vp8_half_horiz_vert_variance16x_h_sse2( | 
| 558         src_ptr, src_pixels_per_line, | 552         src_ptr, src_pixels_per_line, | 
| 559         dst_ptr, dst_pixels_per_line, 16, | 553         dst_ptr, dst_pixels_per_line, 16, | 
| 560         &xsum0, &xxsum0); | 554         &xsum0, &xxsum0); | 
| 561 | 555 | 
| 562     *sse = xxsum0; | 556     *sse = xxsum0; | 
| 563     return (xxsum0 - ((xsum0 * xsum0) >> 8)); | 557     return (xxsum0 - ((xsum0 * xsum0) >> 8)); | 
| 564 } | 558 } | 
| OLD | NEW | 
|---|