Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: source/libvpx/vp8/common/variance_c.c

Issue 13042014: Description: (Closed) Base URL: https://src.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: libvpx: Pull from upstream Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « source/libvpx/vp8/common/rtcd_defs.sh ('k') | source/libvpx/vp8/common/vp8_asm_com_offsets.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 const unsigned char *ref_ptr, 68 const unsigned char *ref_ptr,
69 int recon_stride, 69 int recon_stride,
70 unsigned int *sse) 70 unsigned int *sse)
71 { 71 {
72 unsigned int var; 72 unsigned int var;
73 int avg; 73 int avg;
74 74
75 75
76 variance(src_ptr, source_stride, ref_ptr, recon_stride, 16, 16, &var, &avg); 76 variance(src_ptr, source_stride, ref_ptr, recon_stride, 16, 16, &var, &avg);
77 *sse = var; 77 *sse = var;
78 return (var - ((unsigned int)(avg * avg) >> 8)); 78 return (var - (((unsigned int)avg * avg) >> 8));
79 } 79 }
80 80
81 unsigned int vp8_variance8x16_c( 81 unsigned int vp8_variance8x16_c(
82 const unsigned char *src_ptr, 82 const unsigned char *src_ptr,
83 int source_stride, 83 int source_stride,
84 const unsigned char *ref_ptr, 84 const unsigned char *ref_ptr,
85 int recon_stride, 85 int recon_stride,
86 unsigned int *sse) 86 unsigned int *sse)
87 { 87 {
88 unsigned int var; 88 unsigned int var;
89 int avg; 89 int avg;
90 90
91 91
92 variance(src_ptr, source_stride, ref_ptr, recon_stride, 8, 16, &var, &avg); 92 variance(src_ptr, source_stride, ref_ptr, recon_stride, 8, 16, &var, &avg);
93 *sse = var; 93 *sse = var;
94 return (var - ((unsigned int)(avg * avg) >> 7)); 94 return (var - (((unsigned int)avg * avg) >> 7));
95 } 95 }
96 96
97 unsigned int vp8_variance16x8_c( 97 unsigned int vp8_variance16x8_c(
98 const unsigned char *src_ptr, 98 const unsigned char *src_ptr,
99 int source_stride, 99 int source_stride,
100 const unsigned char *ref_ptr, 100 const unsigned char *ref_ptr,
101 int recon_stride, 101 int recon_stride,
102 unsigned int *sse) 102 unsigned int *sse)
103 { 103 {
104 unsigned int var; 104 unsigned int var;
105 int avg; 105 int avg;
106 106
107 107
108 variance(src_ptr, source_stride, ref_ptr, recon_stride, 16, 8, &var, &avg); 108 variance(src_ptr, source_stride, ref_ptr, recon_stride, 16, 8, &var, &avg);
109 *sse = var; 109 *sse = var;
110 return (var - ((unsigned int)(avg * avg) >> 7)); 110 return (var - (((unsigned int)avg * avg) >> 7));
111 } 111 }
112 112
113 113
114 unsigned int vp8_variance8x8_c( 114 unsigned int vp8_variance8x8_c(
115 const unsigned char *src_ptr, 115 const unsigned char *src_ptr,
116 int source_stride, 116 int source_stride,
117 const unsigned char *ref_ptr, 117 const unsigned char *ref_ptr,
118 int recon_stride, 118 int recon_stride,
119 unsigned int *sse) 119 unsigned int *sse)
120 { 120 {
121 unsigned int var; 121 unsigned int var;
122 int avg; 122 int avg;
123 123
124 124
125 variance(src_ptr, source_stride, ref_ptr, recon_stride, 8, 8, &var, &avg); 125 variance(src_ptr, source_stride, ref_ptr, recon_stride, 8, 8, &var, &avg);
126 *sse = var; 126 *sse = var;
127 return (var - ((unsigned int)(avg * avg) >> 6)); 127 return (var - (((unsigned int)avg * avg) >> 6));
128 } 128 }
129 129
130 unsigned int vp8_variance4x4_c( 130 unsigned int vp8_variance4x4_c(
131 const unsigned char *src_ptr, 131 const unsigned char *src_ptr,
132 int source_stride, 132 int source_stride,
133 const unsigned char *ref_ptr, 133 const unsigned char *ref_ptr,
134 int recon_stride, 134 int recon_stride,
135 unsigned int *sse) 135 unsigned int *sse)
136 { 136 {
137 unsigned int var; 137 unsigned int var;
138 int avg; 138 int avg;
139 139
140 140
141 variance(src_ptr, source_stride, ref_ptr, recon_stride, 4, 4, &var, &avg); 141 variance(src_ptr, source_stride, ref_ptr, recon_stride, 4, 4, &var, &avg);
142 *sse = var; 142 *sse = var;
143 return (var - ((unsigned int)(avg * avg) >> 4)); 143 return (var - (((unsigned int)avg * avg) >> 4));
144 } 144 }
145 145
146 146
147 unsigned int vp8_mse16x16_c( 147 unsigned int vp8_mse16x16_c(
148 const unsigned char *src_ptr, 148 const unsigned char *src_ptr,
149 int source_stride, 149 int source_stride,
150 const unsigned char *ref_ptr, 150 const unsigned char *ref_ptr,
151 int recon_stride, 151 int recon_stride,
152 unsigned int *sse) 152 unsigned int *sse)
153 { 153 {
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 449
450 HFilter = vp8_bilinear_filters[xoffset]; 450 HFilter = vp8_bilinear_filters[xoffset];
451 VFilter = vp8_bilinear_filters[yoffset]; 451 VFilter = vp8_bilinear_filters[yoffset];
452 452
453 453
454 var_filter_block2d_bil_first_pass(src_ptr, FData3, src_pixels_per_line, 1, 1 7, 8, HFilter); 454 var_filter_block2d_bil_first_pass(src_ptr, FData3, src_pixels_per_line, 1, 1 7, 8, HFilter);
455 var_filter_block2d_bil_second_pass(FData3, temp2, 8, 8, 16, 8, VFilter); 455 var_filter_block2d_bil_second_pass(FData3, temp2, 8, 8, 16, 8, VFilter);
456 456
457 return vp8_variance8x16_c(temp2, 8, dst_ptr, dst_pixels_per_line, sse); 457 return vp8_variance8x16_c(temp2, 8, dst_ptr, dst_pixels_per_line, sse);
458 } 458 }
OLDNEW
« no previous file with comments | « source/libvpx/vp8/common/rtcd_defs.sh ('k') | source/libvpx/vp8/common/vp8_asm_com_offsets.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698