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

Side by Side Diff: source/libvpx/vp9/encoder/vp9_variance.c

Issue 1169543007: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: Created 5 years, 6 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
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
11 #include "./vp9_rtcd.h" 11 #include "./vp9_rtcd.h"
12 #include "./vpx_dsp_rtcd.h" 12 #include "./vpx_dsp_rtcd.h"
13 13
14 #include "vpx_ports/mem.h" 14 #include "vpx_ports/mem.h"
15 #include "vpx/vpx_integer.h" 15 #include "vpx/vpx_integer.h"
16 16
17 #include "vp9/common/vp9_common.h" 17 #include "vp9/common/vp9_common.h"
18 #include "vp9/common/vp9_filter.h" 18 #include "vp9/common/vp9_filter.h"
19 19
20 #include "vp9/encoder/vp9_variance.h" 20 #include "vp9/encoder/vp9_variance.h"
21 21
22 static uint8_t bilinear_filters[8][2] = {
23 { 128, 0, },
24 { 112, 16, },
25 { 96, 32, },
26 { 80, 48, },
27 { 64, 64, },
28 { 48, 80, },
29 { 32, 96, },
30 { 16, 112, },
31 };
32
22 // Applies a 1-D 2-tap bi-linear filter to the source block in either horizontal 33 // Applies a 1-D 2-tap bi-linear filter to the source block in either horizontal
23 // or vertical direction to produce the filtered output block. Used to implement 34 // or vertical direction to produce the filtered output block. Used to implement
24 // first-pass of 2-D separable filter. 35 // first-pass of 2-D separable filter.
25 // 36 //
26 // Produces int32_t output to retain precision for next pass. Two filter taps 37 // Produces int32_t output to retain precision for next pass. Two filter taps
27 // should sum to VP9_FILTER_WEIGHT. pixel_step defines whether the filter is 38 // should sum to VP9_FILTER_WEIGHT. pixel_step defines whether the filter is
28 // applied horizontally (pixel_step=1) or vertically (pixel_step=stride). It 39 // applied horizontally (pixel_step=1) or vertically (pixel_step=stride). It
29 // defines the offset required to move from one input to the next. 40 // defines the offset required to move from one input to the next.
30 static void var_filter_block2d_bil_first_pass(const uint8_t *src_ptr, 41 static void var_filter_block2d_bil_first_pass(const uint8_t *src_ptr,
31 uint16_t *output_ptr, 42 uint16_t *output_ptr,
32 unsigned int src_pixels_per_line, 43 unsigned int src_pixels_per_line,
33 int pixel_step, 44 int pixel_step,
34 unsigned int output_height, 45 unsigned int output_height,
35 unsigned int output_width, 46 unsigned int output_width,
36 const int16_t *vp9_filter) { 47 const uint8_t *vp9_filter) {
37 unsigned int i, j; 48 unsigned int i, j;
38 49
39 for (i = 0; i < output_height; i++) { 50 for (i = 0; i < output_height; i++) {
40 for (j = 0; j < output_width; j++) { 51 for (j = 0; j < output_width; j++) {
41 output_ptr[j] = ROUND_POWER_OF_TWO((int)src_ptr[0] * vp9_filter[0] + 52 output_ptr[j] = ROUND_POWER_OF_TWO((int)src_ptr[0] * vp9_filter[0] +
42 (int)src_ptr[pixel_step] * vp9_filter[1], 53 (int)src_ptr[pixel_step] * vp9_filter[1],
43 FILTER_BITS); 54 FILTER_BITS);
44 55
45 src_ptr++; 56 src_ptr++;
46 } 57 }
(...skipping 11 matching lines...) Expand all
58 // Requires 32-bit input as produced by filter_block2d_bil_first_pass. Two 69 // Requires 32-bit input as produced by filter_block2d_bil_first_pass. Two
59 // filter taps should sum to VP9_FILTER_WEIGHT. pixel_step defines whether the 70 // filter taps should sum to VP9_FILTER_WEIGHT. pixel_step defines whether the
60 // filter is applied horizontally (pixel_step=1) or vertically (pixel_step= 71 // filter is applied horizontally (pixel_step=1) or vertically (pixel_step=
61 // stride). It defines the offset required to move from one input to the next. 72 // stride). It defines the offset required to move from one input to the next.
62 static void var_filter_block2d_bil_second_pass(const uint16_t *src_ptr, 73 static void var_filter_block2d_bil_second_pass(const uint16_t *src_ptr,
63 uint8_t *output_ptr, 74 uint8_t *output_ptr,
64 unsigned int src_pixels_per_line, 75 unsigned int src_pixels_per_line,
65 unsigned int pixel_step, 76 unsigned int pixel_step,
66 unsigned int output_height, 77 unsigned int output_height,
67 unsigned int output_width, 78 unsigned int output_width,
68 const int16_t *vp9_filter) { 79 const uint8_t *vp9_filter) {
69 unsigned int i, j; 80 unsigned int i, j;
70 81
71 for (i = 0; i < output_height; i++) { 82 for (i = 0; i < output_height; i++) {
72 for (j = 0; j < output_width; j++) { 83 for (j = 0; j < output_width; j++) {
73 output_ptr[j] = ROUND_POWER_OF_TWO((int)src_ptr[0] * vp9_filter[0] + 84 output_ptr[j] = ROUND_POWER_OF_TWO((int)src_ptr[0] * vp9_filter[0] +
74 (int)src_ptr[pixel_step] * vp9_filter[1], 85 (int)src_ptr[pixel_step] * vp9_filter[1],
75 FILTER_BITS); 86 FILTER_BITS);
76 src_ptr++; 87 src_ptr++;
77 } 88 }
78 89
79 src_ptr += src_pixels_per_line - output_width; 90 src_ptr += src_pixels_per_line - output_width;
80 output_ptr += output_width; 91 output_ptr += output_width;
81 } 92 }
82 } 93 }
83 94
84 #define SUBPIX_VAR(W, H) \ 95 #define SUBPIX_VAR(W, H) \
85 unsigned int vp9_sub_pixel_variance##W##x##H##_c( \ 96 unsigned int vp9_sub_pixel_variance##W##x##H##_c( \
86 const uint8_t *src, int src_stride, \ 97 const uint8_t *src, int src_stride, \
87 int xoffset, int yoffset, \ 98 int xoffset, int yoffset, \
88 const uint8_t *dst, int dst_stride, \ 99 const uint8_t *dst, int dst_stride, \
89 unsigned int *sse) { \ 100 unsigned int *sse) { \
90 uint16_t fdata3[(H + 1) * W]; \ 101 uint16_t fdata3[(H + 1) * W]; \
91 uint8_t temp2[H * W]; \ 102 uint8_t temp2[H * W]; \
92 \ 103 \
93 var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, W, \ 104 var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, W, \
94 BILINEAR_FILTERS_2TAP(xoffset)); \ 105 bilinear_filters[xoffset]); \
95 var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \ 106 var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \
96 BILINEAR_FILTERS_2TAP(yoffset)); \ 107 bilinear_filters[yoffset]); \
97 \ 108 \
98 return vpx_variance##W##x##H##_c(temp2, W, dst, dst_stride, sse); \ 109 return vpx_variance##W##x##H##_c(temp2, W, dst, dst_stride, sse); \
99 } 110 }
100 111
101 #define SUBPIX_AVG_VAR(W, H) \ 112 #define SUBPIX_AVG_VAR(W, H) \
102 unsigned int vp9_sub_pixel_avg_variance##W##x##H##_c( \ 113 unsigned int vp9_sub_pixel_avg_variance##W##x##H##_c( \
103 const uint8_t *src, int src_stride, \ 114 const uint8_t *src, int src_stride, \
104 int xoffset, int yoffset, \ 115 int xoffset, int yoffset, \
105 const uint8_t *dst, int dst_stride, \ 116 const uint8_t *dst, int dst_stride, \
106 unsigned int *sse, \ 117 unsigned int *sse, \
107 const uint8_t *second_pred) { \ 118 const uint8_t *second_pred) { \
108 uint16_t fdata3[(H + 1) * W]; \ 119 uint16_t fdata3[(H + 1) * W]; \
109 uint8_t temp2[H * W]; \ 120 uint8_t temp2[H * W]; \
110 DECLARE_ALIGNED(16, uint8_t, temp3[H * W]); \ 121 DECLARE_ALIGNED(16, uint8_t, temp3[H * W]); \
111 \ 122 \
112 var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, W, \ 123 var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, W, \
113 BILINEAR_FILTERS_2TAP(xoffset)); \ 124 bilinear_filters[xoffset]); \
114 var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \ 125 var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \
115 BILINEAR_FILTERS_2TAP(yoffset)); \ 126 bilinear_filters[yoffset]); \
116 \ 127 \
117 vpx_comp_avg_pred(temp3, second_pred, W, H, temp2, W); \ 128 vpx_comp_avg_pred(temp3, second_pred, W, H, temp2, W); \
118 \ 129 \
119 return vpx_variance##W##x##H##_c(temp3, W, dst, dst_stride, sse); \ 130 return vpx_variance##W##x##H##_c(temp3, W, dst, dst_stride, sse); \
120 } 131 }
121 132
122 SUBPIX_VAR(4, 4) 133 SUBPIX_VAR(4, 4)
123 SUBPIX_AVG_VAR(4, 4) 134 SUBPIX_AVG_VAR(4, 4)
124 135
125 SUBPIX_VAR(4, 8) 136 SUBPIX_VAR(4, 8)
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 SUBPIX_AVG_VAR(64, 64) 170 SUBPIX_AVG_VAR(64, 64)
160 171
161 #if CONFIG_VP9_HIGHBITDEPTH 172 #if CONFIG_VP9_HIGHBITDEPTH
162 static void highbd_var_filter_block2d_bil_first_pass( 173 static void highbd_var_filter_block2d_bil_first_pass(
163 const uint8_t *src_ptr8, 174 const uint8_t *src_ptr8,
164 uint16_t *output_ptr, 175 uint16_t *output_ptr,
165 unsigned int src_pixels_per_line, 176 unsigned int src_pixels_per_line,
166 int pixel_step, 177 int pixel_step,
167 unsigned int output_height, 178 unsigned int output_height,
168 unsigned int output_width, 179 unsigned int output_width,
169 const int16_t *vp9_filter) { 180 const uint8_t *vp9_filter) {
170 unsigned int i, j; 181 unsigned int i, j;
171 uint16_t *src_ptr = CONVERT_TO_SHORTPTR(src_ptr8); 182 uint16_t *src_ptr = CONVERT_TO_SHORTPTR(src_ptr8);
172 for (i = 0; i < output_height; i++) { 183 for (i = 0; i < output_height; i++) {
173 for (j = 0; j < output_width; j++) { 184 for (j = 0; j < output_width; j++) {
174 output_ptr[j] = 185 output_ptr[j] =
175 ROUND_POWER_OF_TWO((int)src_ptr[0] * vp9_filter[0] + 186 ROUND_POWER_OF_TWO((int)src_ptr[0] * vp9_filter[0] +
176 (int)src_ptr[pixel_step] * vp9_filter[1], 187 (int)src_ptr[pixel_step] * vp9_filter[1],
177 FILTER_BITS); 188 FILTER_BITS);
178 189
179 src_ptr++; 190 src_ptr++;
180 } 191 }
181 192
182 // Next row... 193 // Next row...
183 src_ptr += src_pixels_per_line - output_width; 194 src_ptr += src_pixels_per_line - output_width;
184 output_ptr += output_width; 195 output_ptr += output_width;
185 } 196 }
186 } 197 }
187 198
188 static void highbd_var_filter_block2d_bil_second_pass( 199 static void highbd_var_filter_block2d_bil_second_pass(
189 const uint16_t *src_ptr, 200 const uint16_t *src_ptr,
190 uint16_t *output_ptr, 201 uint16_t *output_ptr,
191 unsigned int src_pixels_per_line, 202 unsigned int src_pixels_per_line,
192 unsigned int pixel_step, 203 unsigned int pixel_step,
193 unsigned int output_height, 204 unsigned int output_height,
194 unsigned int output_width, 205 unsigned int output_width,
195 const int16_t *vp9_filter) { 206 const uint8_t *vp9_filter) {
196 unsigned int i, j; 207 unsigned int i, j;
197 208
198 for (i = 0; i < output_height; i++) { 209 for (i = 0; i < output_height; i++) {
199 for (j = 0; j < output_width; j++) { 210 for (j = 0; j < output_width; j++) {
200 output_ptr[j] = 211 output_ptr[j] =
201 ROUND_POWER_OF_TWO((int)src_ptr[0] * vp9_filter[0] + 212 ROUND_POWER_OF_TWO((int)src_ptr[0] * vp9_filter[0] +
202 (int)src_ptr[pixel_step] * vp9_filter[1], 213 (int)src_ptr[pixel_step] * vp9_filter[1],
203 FILTER_BITS); 214 FILTER_BITS);
204 src_ptr++; 215 src_ptr++;
205 } 216 }
206 217
207 src_ptr += src_pixels_per_line - output_width; 218 src_ptr += src_pixels_per_line - output_width;
208 output_ptr += output_width; 219 output_ptr += output_width;
209 } 220 }
210 } 221 }
211 222
212 #define HIGHBD_SUBPIX_VAR(W, H) \ 223 #define HIGHBD_SUBPIX_VAR(W, H) \
213 unsigned int vp9_highbd_sub_pixel_variance##W##x##H##_c( \ 224 unsigned int vp9_highbd_sub_pixel_variance##W##x##H##_c( \
214 const uint8_t *src, int src_stride, \ 225 const uint8_t *src, int src_stride, \
215 int xoffset, int yoffset, \ 226 int xoffset, int yoffset, \
216 const uint8_t *dst, int dst_stride, \ 227 const uint8_t *dst, int dst_stride, \
217 unsigned int *sse) { \ 228 unsigned int *sse) { \
218 uint16_t fdata3[(H + 1) * W]; \ 229 uint16_t fdata3[(H + 1) * W]; \
219 uint16_t temp2[H * W]; \ 230 uint16_t temp2[H * W]; \
220 \ 231 \
221 highbd_var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, \ 232 highbd_var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, \
222 W, BILINEAR_FILTERS_2TAP(xoffset)); \ 233 W, bilinear_filters[xoffset]); \
223 highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \ 234 highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \
224 BILINEAR_FILTERS_2TAP(yoffset)); \ 235 bilinear_filters[yoffset]); \
225 \ 236 \
226 return vpx_highbd_8_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp2), W, dst, \ 237 return vpx_highbd_8_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp2), W, dst, \
227 dst_stride, sse); \ 238 dst_stride, sse); \
228 } \ 239 } \
229 \ 240 \
230 unsigned int vp9_highbd_10_sub_pixel_variance##W##x##H##_c( \ 241 unsigned int vp9_highbd_10_sub_pixel_variance##W##x##H##_c( \
231 const uint8_t *src, int src_stride, \ 242 const uint8_t *src, int src_stride, \
232 int xoffset, int yoffset, \ 243 int xoffset, int yoffset, \
233 const uint8_t *dst, int dst_stride, \ 244 const uint8_t *dst, int dst_stride, \
234 unsigned int *sse) { \ 245 unsigned int *sse) { \
235 uint16_t fdata3[(H + 1) * W]; \ 246 uint16_t fdata3[(H + 1) * W]; \
236 uint16_t temp2[H * W]; \ 247 uint16_t temp2[H * W]; \
237 \ 248 \
238 highbd_var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, \ 249 highbd_var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, \
239 W, BILINEAR_FILTERS_2TAP(xoffset)); \ 250 W, bilinear_filters[xoffset]); \
240 highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \ 251 highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \
241 BILINEAR_FILTERS_2TAP(yoffset)); \ 252 bilinear_filters[yoffset]); \
242 \ 253 \
243 return vpx_highbd_10_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp2), \ 254 return vpx_highbd_10_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp2), \
244 W, dst, dst_stride, sse); \ 255 W, dst, dst_stride, sse); \
245 } \ 256 } \
246 \ 257 \
247 unsigned int vp9_highbd_12_sub_pixel_variance##W##x##H##_c( \ 258 unsigned int vp9_highbd_12_sub_pixel_variance##W##x##H##_c( \
248 const uint8_t *src, int src_stride, \ 259 const uint8_t *src, int src_stride, \
249 int xoffset, int yoffset, \ 260 int xoffset, int yoffset, \
250 const uint8_t *dst, int dst_stride, \ 261 const uint8_t *dst, int dst_stride, \
251 unsigned int *sse) { \ 262 unsigned int *sse) { \
252 uint16_t fdata3[(H + 1) * W]; \ 263 uint16_t fdata3[(H + 1) * W]; \
253 uint16_t temp2[H * W]; \ 264 uint16_t temp2[H * W]; \
254 \ 265 \
255 highbd_var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, \ 266 highbd_var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, \
256 W, BILINEAR_FILTERS_2TAP(xoffset)); \ 267 W, bilinear_filters[xoffset]); \
257 highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \ 268 highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \
258 BILINEAR_FILTERS_2TAP(yoffset)); \ 269 bilinear_filters[yoffset]); \
259 \ 270 \
260 return vpx_highbd_12_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp2), \ 271 return vpx_highbd_12_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp2), \
261 W, dst, dst_stride, sse); \ 272 W, dst, dst_stride, sse); \
262 } 273 }
263 274
264 #define HIGHBD_SUBPIX_AVG_VAR(W, H) \ 275 #define HIGHBD_SUBPIX_AVG_VAR(W, H) \
265 unsigned int vp9_highbd_sub_pixel_avg_variance##W##x##H##_c( \ 276 unsigned int vp9_highbd_sub_pixel_avg_variance##W##x##H##_c( \
266 const uint8_t *src, int src_stride, \ 277 const uint8_t *src, int src_stride, \
267 int xoffset, int yoffset, \ 278 int xoffset, int yoffset, \
268 const uint8_t *dst, int dst_stride, \ 279 const uint8_t *dst, int dst_stride, \
269 unsigned int *sse, \ 280 unsigned int *sse, \
270 const uint8_t *second_pred) { \ 281 const uint8_t *second_pred) { \
271 uint16_t fdata3[(H + 1) * W]; \ 282 uint16_t fdata3[(H + 1) * W]; \
272 uint16_t temp2[H * W]; \ 283 uint16_t temp2[H * W]; \
273 DECLARE_ALIGNED(16, uint16_t, temp3[H * W]); \ 284 DECLARE_ALIGNED(16, uint16_t, temp3[H * W]); \
274 \ 285 \
275 highbd_var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, \ 286 highbd_var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, \
276 W, BILINEAR_FILTERS_2TAP(xoffset)); \ 287 W, bilinear_filters[xoffset]); \
277 highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \ 288 highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \
278 BILINEAR_FILTERS_2TAP(yoffset)); \ 289 bilinear_filters[yoffset]); \
279 \ 290 \
280 vpx_highbd_comp_avg_pred(temp3, second_pred, W, H, \ 291 vpx_highbd_comp_avg_pred(temp3, second_pred, W, H, \
281 CONVERT_TO_BYTEPTR(temp2), W); \ 292 CONVERT_TO_BYTEPTR(temp2), W); \
282 \ 293 \
283 return vpx_highbd_8_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp3), W, dst, \ 294 return vpx_highbd_8_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp3), W, dst, \
284 dst_stride, sse); \ 295 dst_stride, sse); \
285 } \ 296 } \
286 \ 297 \
287 unsigned int vp9_highbd_10_sub_pixel_avg_variance##W##x##H##_c( \ 298 unsigned int vp9_highbd_10_sub_pixel_avg_variance##W##x##H##_c( \
288 const uint8_t *src, int src_stride, \ 299 const uint8_t *src, int src_stride, \
289 int xoffset, int yoffset, \ 300 int xoffset, int yoffset, \
290 const uint8_t *dst, int dst_stride, \ 301 const uint8_t *dst, int dst_stride, \
291 unsigned int *sse, \ 302 unsigned int *sse, \
292 const uint8_t *second_pred) { \ 303 const uint8_t *second_pred) { \
293 uint16_t fdata3[(H + 1) * W]; \ 304 uint16_t fdata3[(H + 1) * W]; \
294 uint16_t temp2[H * W]; \ 305 uint16_t temp2[H * W]; \
295 DECLARE_ALIGNED(16, uint16_t, temp3[H * W]); \ 306 DECLARE_ALIGNED(16, uint16_t, temp3[H * W]); \
296 \ 307 \
297 highbd_var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, \ 308 highbd_var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, \
298 W, BILINEAR_FILTERS_2TAP(xoffset)); \ 309 W, bilinear_filters[xoffset]); \
299 highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \ 310 highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \
300 BILINEAR_FILTERS_2TAP(yoffset)); \ 311 bilinear_filters[yoffset]); \
301 \ 312 \
302 vpx_highbd_comp_avg_pred(temp3, second_pred, W, H, \ 313 vpx_highbd_comp_avg_pred(temp3, second_pred, W, H, \
303 CONVERT_TO_BYTEPTR(temp2), W); \ 314 CONVERT_TO_BYTEPTR(temp2), W); \
304 \ 315 \
305 return vpx_highbd_10_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp3), \ 316 return vpx_highbd_10_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp3), \
306 W, dst, dst_stride, sse); \ 317 W, dst, dst_stride, sse); \
307 } \ 318 } \
308 \ 319 \
309 unsigned int vp9_highbd_12_sub_pixel_avg_variance##W##x##H##_c( \ 320 unsigned int vp9_highbd_12_sub_pixel_avg_variance##W##x##H##_c( \
310 const uint8_t *src, int src_stride, \ 321 const uint8_t *src, int src_stride, \
311 int xoffset, int yoffset, \ 322 int xoffset, int yoffset, \
312 const uint8_t *dst, int dst_stride, \ 323 const uint8_t *dst, int dst_stride, \
313 unsigned int *sse, \ 324 unsigned int *sse, \
314 const uint8_t *second_pred) { \ 325 const uint8_t *second_pred) { \
315 uint16_t fdata3[(H + 1) * W]; \ 326 uint16_t fdata3[(H + 1) * W]; \
316 uint16_t temp2[H * W]; \ 327 uint16_t temp2[H * W]; \
317 DECLARE_ALIGNED(16, uint16_t, temp3[H * W]); \ 328 DECLARE_ALIGNED(16, uint16_t, temp3[H * W]); \
318 \ 329 \
319 highbd_var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, \ 330 highbd_var_filter_block2d_bil_first_pass(src, fdata3, src_stride, 1, H + 1, \
320 W, BILINEAR_FILTERS_2TAP(xoffset)); \ 331 W, bilinear_filters[xoffset]); \
321 highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \ 332 highbd_var_filter_block2d_bil_second_pass(fdata3, temp2, W, W, H, W, \
322 BILINEAR_FILTERS_2TAP(yoffset)); \ 333 bilinear_filters[yoffset]); \
323 \ 334 \
324 vpx_highbd_comp_avg_pred(temp3, second_pred, W, H, \ 335 vpx_highbd_comp_avg_pred(temp3, second_pred, W, H, \
325 CONVERT_TO_BYTEPTR(temp2), W); \ 336 CONVERT_TO_BYTEPTR(temp2), W); \
326 \ 337 \
327 return vpx_highbd_12_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp3), \ 338 return vpx_highbd_12_variance##W##x##H##_c(CONVERT_TO_BYTEPTR(temp3), \
328 W, dst, dst_stride, sse); \ 339 W, dst, dst_stride, sse); \
329 } 340 }
330 341
331 HIGHBD_SUBPIX_VAR(4, 4) 342 HIGHBD_SUBPIX_VAR(4, 4)
332 HIGHBD_SUBPIX_AVG_VAR(4, 4) 343 HIGHBD_SUBPIX_AVG_VAR(4, 4)
(...skipping 27 matching lines...) Expand all
360 371
361 HIGHBD_SUBPIX_VAR(32, 64) 372 HIGHBD_SUBPIX_VAR(32, 64)
362 HIGHBD_SUBPIX_AVG_VAR(32, 64) 373 HIGHBD_SUBPIX_AVG_VAR(32, 64)
363 374
364 HIGHBD_SUBPIX_VAR(64, 32) 375 HIGHBD_SUBPIX_VAR(64, 32)
365 HIGHBD_SUBPIX_AVG_VAR(64, 32) 376 HIGHBD_SUBPIX_AVG_VAR(64, 32)
366 377
367 HIGHBD_SUBPIX_VAR(64, 64) 378 HIGHBD_SUBPIX_VAR(64, 64)
368 HIGHBD_SUBPIX_AVG_VAR(64, 64) 379 HIGHBD_SUBPIX_AVG_VAR(64, 64)
369 #endif // CONFIG_VP9_HIGHBITDEPTH 380 #endif // CONFIG_VP9_HIGHBITDEPTH
OLDNEW
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_variance.h ('k') | source/libvpx/vp9/encoder/x86/vp9_highbd_subpel_variance.asm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698