vp9_variance_c.c 40.1 KB
Newer Older
John Koleszar's avatar
John Koleszar committed
1
/*
2
 *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
John Koleszar's avatar
John Koleszar committed
3
 *
4
 *  Use of this source code is governed by a BSD-style license
5 6
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
7
 *  in the file PATENTS.  All contributing project authors may
8
 *  be found in the AUTHORS file in the root of the source tree.
John Koleszar's avatar
John Koleszar committed
9 10 11
 */


12
#include "vp9/encoder/vp9_variance.h"
13 14
#include "vp9/common/vp9_filter.h"
#include "vp9/common/vp9_subpelvar.h"
15
#include "vpx/vpx_integer.h"
16
#include "vpx_ports/mem.h"
John Koleszar's avatar
John Koleszar committed
17

18
unsigned int vp9_get_mb_ss_c(const int16_t *src_ptr) {
19
  unsigned int i, sum = 0;
John Koleszar's avatar
John Koleszar committed
20

21
  for (i = 0; i < 256; i++) {
John Koleszar's avatar
John Koleszar committed
22
    sum += (src_ptr[i] * src_ptr[i]);
23
  }
John Koleszar's avatar
John Koleszar committed
24

John Koleszar's avatar
John Koleszar committed
25
  return sum;
John Koleszar's avatar
John Koleszar committed
26 27
}

28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
unsigned int vp9_variance64x32_c(const uint8_t *src_ptr,
                                 int  source_stride,
                                 const uint8_t *ref_ptr,
                                 int  recon_stride,
                                 unsigned int *sse) {
  unsigned int var;
  int avg;

  variance(src_ptr, source_stride, ref_ptr, recon_stride, 64, 32, &var, &avg);
  *sse = var;
  return (var - (((int64_t)avg * avg) >> 11));
}

unsigned int vp9_sub_pixel_variance64x32_c(const uint8_t *src_ptr,
                                           int  src_pixels_per_line,
                                           int  xoffset,
                                           int  yoffset,
                                           const uint8_t *dst_ptr,
                                           int dst_pixels_per_line,
                                           unsigned int *sse) {
  uint16_t fdata3[65 * 64];  // Temp data bufffer used in filtering
  uint8_t temp2[68 * 64];
  const int16_t *hfilter, *vfilter;

  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);

  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 33, 64, hfilter);
  var_filter_block2d_bil_second_pass(fdata3, temp2, 64, 64, 32, 64, vfilter);

  return vp9_variance64x32_c(temp2, 64, dst_ptr, dst_pixels_per_line, sse);
}

62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
unsigned int vp9_sub_pixel_avg_variance64x32_c(const uint8_t *src_ptr,
                                               int  src_pixels_per_line,
                                               int  xoffset,
                                               int  yoffset,
                                               const uint8_t *dst_ptr,
                                               int dst_pixels_per_line,
                                               unsigned int *sse,
                                               const uint8_t *second_pred) {
  uint16_t fdata3[65 * 64];  // Temp data bufffer used in filtering
  uint8_t temp2[68 * 64];
  DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 64 * 64);  // compound pred buffer
  const int16_t *hfilter, *vfilter;

  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);

  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 33, 64, hfilter);
  var_filter_block2d_bil_second_pass(fdata3, temp2, 64, 64, 32, 64, vfilter);
  comp_avg_pred(temp3, second_pred, 64, 32, temp2, 64);
  return vp9_variance64x32_c(temp3, 64, dst_ptr, dst_pixels_per_line, sse);
}

85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
unsigned int vp9_variance32x64_c(const uint8_t *src_ptr,
                                 int  source_stride,
                                 const uint8_t *ref_ptr,
                                 int  recon_stride,
                                 unsigned int *sse) {
  unsigned int var;
  int avg;

  variance(src_ptr, source_stride, ref_ptr, recon_stride, 32, 64, &var, &avg);
  *sse = var;
  return (var - (((int64_t)avg * avg) >> 11));
}

unsigned int vp9_sub_pixel_variance32x64_c(const uint8_t *src_ptr,
                                           int  src_pixels_per_line,
                                           int  xoffset,
                                           int  yoffset,
                                           const uint8_t *dst_ptr,
                                           int dst_pixels_per_line,
                                           unsigned int *sse) {
  uint16_t fdata3[65 * 64];  // Temp data bufffer used in filtering
  uint8_t temp2[68 * 64];
  const int16_t *hfilter, *vfilter;

  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);

  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 65, 32, hfilter);
114
  var_filter_block2d_bil_second_pass(fdata3, temp2, 32, 32, 64, 32, vfilter);
115

116
  return vp9_variance32x64_c(temp2, 32, dst_ptr, dst_pixels_per_line, sse);
117 118
}

119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
unsigned int vp9_sub_pixel_avg_variance32x64_c(const uint8_t *src_ptr,
                                               int  src_pixels_per_line,
                                               int  xoffset,
                                               int  yoffset,
                                               const uint8_t *dst_ptr,
                                               int dst_pixels_per_line,
                                               unsigned int *sse,
                                               const uint8_t *second_pred) {
  uint16_t fdata3[65 * 64];  // Temp data bufffer used in filtering
  uint8_t temp2[68 * 64];
  DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 32 * 64);  // compound pred buffer
  const int16_t *hfilter, *vfilter;

  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);

  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 65, 32, hfilter);
  var_filter_block2d_bil_second_pass(fdata3, temp2, 32, 32, 64, 32, vfilter);
  comp_avg_pred(temp3, second_pred, 32, 64, temp2, 32);
  return vp9_variance32x64_c(temp3, 32, dst_ptr, dst_pixels_per_line, sse);
}

142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
unsigned int vp9_variance32x16_c(const uint8_t *src_ptr,
                                 int  source_stride,
                                 const uint8_t *ref_ptr,
                                 int  recon_stride,
                                 unsigned int *sse) {
  unsigned int var;
  int avg;

  variance(src_ptr, source_stride, ref_ptr, recon_stride, 32, 16, &var, &avg);
  *sse = var;
  return (var - (((int64_t)avg * avg) >> 9));
}

unsigned int vp9_sub_pixel_variance32x16_c(const uint8_t *src_ptr,
                                           int  src_pixels_per_line,
                                           int  xoffset,
                                           int  yoffset,
                                           const uint8_t *dst_ptr,
                                           int dst_pixels_per_line,
                                           unsigned int *sse) {
  uint16_t fdata3[33 * 32];  // Temp data bufffer used in filtering
  uint8_t temp2[36 * 32];
  const int16_t *hfilter, *vfilter;

  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);

  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 17, 32, hfilter);
  var_filter_block2d_bil_second_pass(fdata3, temp2, 32, 32, 16, 32, vfilter);

  return vp9_variance32x16_c(temp2, 32, dst_ptr, dst_pixels_per_line, sse);
}

176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
unsigned int vp9_sub_pixel_avg_variance32x16_c(const uint8_t *src_ptr,
                                               int  src_pixels_per_line,
                                               int  xoffset,
                                               int  yoffset,
                                               const uint8_t *dst_ptr,
                                               int dst_pixels_per_line,
                                               unsigned int *sse,
                                               const uint8_t *second_pred) {
  uint16_t fdata3[33 * 32];  // Temp data bufffer used in filtering
  uint8_t temp2[36 * 32];
  DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 32 * 16);  // compound pred buffer
  const int16_t *hfilter, *vfilter;

  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);

  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 17, 32, hfilter);
  var_filter_block2d_bil_second_pass(fdata3, temp2, 32, 32, 16, 32, vfilter);
  comp_avg_pred(temp3, second_pred, 32, 16, temp2, 32);
  return vp9_variance32x16_c(temp3, 32, dst_ptr, dst_pixels_per_line, sse);
}

199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
unsigned int vp9_variance16x32_c(const uint8_t *src_ptr,
                                 int  source_stride,
                                 const uint8_t *ref_ptr,
                                 int  recon_stride,
                                 unsigned int *sse) {
  unsigned int var;
  int avg;

  variance(src_ptr, source_stride, ref_ptr, recon_stride, 16, 32, &var, &avg);
  *sse = var;
  return (var - (((int64_t)avg * avg) >> 9));
}

unsigned int vp9_sub_pixel_variance16x32_c(const uint8_t *src_ptr,
                                           int  src_pixels_per_line,
                                           int  xoffset,
                                           int  yoffset,
                                           const uint8_t *dst_ptr,
                                           int dst_pixels_per_line,
                                           unsigned int *sse) {
  uint16_t fdata3[33 * 32];  // Temp data bufffer used in filtering
  uint8_t temp2[36 * 32];
  const int16_t *hfilter, *vfilter;

  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);

  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 33, 16, hfilter);
228
  var_filter_block2d_bil_second_pass(fdata3, temp2, 16, 16, 32, 16, vfilter);
229

230
  return vp9_variance16x32_c(temp2, 16, dst_ptr, dst_pixels_per_line, sse);
231 232
}

233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
unsigned int vp9_sub_pixel_avg_variance16x32_c(const uint8_t *src_ptr,
                                               int  src_pixels_per_line,
                                               int  xoffset,
                                               int  yoffset,
                                               const uint8_t *dst_ptr,
                                               int dst_pixels_per_line,
                                               unsigned int *sse,
                                               const uint8_t *second_pred) {
  uint16_t fdata3[33 * 32];  // Temp data bufffer used in filtering
  uint8_t temp2[36 * 32];
  DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 16 * 32);  // compound pred buffer
  const int16_t *hfilter, *vfilter;

  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);

  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 33, 16, hfilter);
  var_filter_block2d_bil_second_pass(fdata3, temp2, 16, 16, 32, 16, vfilter);
  comp_avg_pred(temp3, second_pred, 16, 32, temp2, 16);
  return vp9_variance16x32_c(temp3, 16, dst_ptr, dst_pixels_per_line, sse);
}

Ronald S. Bultje's avatar
Ronald S. Bultje committed
256 257 258 259 260 261 262 263 264 265 266 267 268
unsigned int vp9_variance64x64_c(const uint8_t *src_ptr,
                                 int  source_stride,
                                 const uint8_t *ref_ptr,
                                 int  recon_stride,
                                 unsigned int *sse) {
  unsigned int var;
  int avg;

  variance(src_ptr, source_stride, ref_ptr, recon_stride, 64, 64, &var, &avg);
  *sse = var;
  return (var - (((int64_t)avg * avg) >> 12));
}

269
unsigned int vp9_variance32x32_c(const uint8_t *src_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
270
                                 int  source_stride,
271
                                 const uint8_t *ref_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
272 273 274 275 276 277 278
                                 int  recon_stride,
                                 unsigned int *sse) {
  unsigned int var;
  int avg;

  variance(src_ptr, source_stride, ref_ptr, recon_stride, 32, 32, &var, &avg);
  *sse = var;
279
  return (var - (((int64_t)avg * avg) >> 10));
Ronald S. Bultje's avatar
Ronald S. Bultje committed
280
}
John Koleszar's avatar
John Koleszar committed
281

282
unsigned int vp9_variance16x16_c(const uint8_t *src_ptr,
283
                                 int  source_stride,
284
                                 const uint8_t *ref_ptr,
285 286
                                 int  recon_stride,
                                 unsigned int *sse) {
John Koleszar's avatar
John Koleszar committed
287 288 289 290 291
  unsigned int var;
  int avg;

  variance(src_ptr, source_stride, ref_ptr, recon_stride, 16, 16, &var, &avg);
  *sse = var;
292
  return (var - (((unsigned int)avg * avg) >> 8));
John Koleszar's avatar
John Koleszar committed
293 294
}

295
unsigned int vp9_variance8x16_c(const uint8_t *src_ptr,
296
                                int  source_stride,
297
                                const uint8_t *ref_ptr,
298 299
                                int  recon_stride,
                                unsigned int *sse) {
John Koleszar's avatar
John Koleszar committed
300 301 302 303 304
  unsigned int var;
  int avg;

  variance(src_ptr, source_stride, ref_ptr, recon_stride, 8, 16, &var, &avg);
  *sse = var;
305
  return (var - (((unsigned int)avg * avg) >> 7));
John Koleszar's avatar
John Koleszar committed
306 307
}

308
unsigned int vp9_variance16x8_c(const uint8_t *src_ptr,
309
                                int  source_stride,
310
                                const uint8_t *ref_ptr,
311 312
                                int  recon_stride,
                                unsigned int *sse) {
John Koleszar's avatar
John Koleszar committed
313 314 315 316 317
  unsigned int var;
  int avg;

  variance(src_ptr, source_stride, ref_ptr, recon_stride, 16, 8, &var, &avg);
  *sse = var;
318
  return (var - (((unsigned int)avg * avg) >> 7));
John Koleszar's avatar
John Koleszar committed
319 320 321
}


322
unsigned int vp9_variance8x8_c(const uint8_t *src_ptr,
323
                               int  source_stride,
324
                               const uint8_t *ref_ptr,
325 326
                               int  recon_stride,
                               unsigned int *sse) {
John Koleszar's avatar
John Koleszar committed
327 328 329 330 331
  unsigned int var;
  int avg;

  variance(src_ptr, source_stride, ref_ptr, recon_stride, 8, 8, &var, &avg);
  *sse = var;
332
  return (var - (((unsigned int)avg * avg) >> 6));
John Koleszar's avatar
John Koleszar committed
333 334
}

335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360
unsigned int vp9_variance8x4_c(const uint8_t *src_ptr,
                               int  source_stride,
                               const uint8_t *ref_ptr,
                               int  recon_stride,
                               unsigned int *sse) {
  unsigned int var;
  int avg;

  variance(src_ptr, source_stride, ref_ptr, recon_stride, 8, 4, &var, &avg);
  *sse = var;
  return (var - (((unsigned int)avg * avg) >> 5));
}

unsigned int vp9_variance4x8_c(const uint8_t *src_ptr,
                               int  source_stride,
                               const uint8_t *ref_ptr,
                               int  recon_stride,
                               unsigned int *sse) {
  unsigned int var;
  int avg;

  variance(src_ptr, source_stride, ref_ptr, recon_stride, 4, 8, &var, &avg);
  *sse = var;
  return (var - (((unsigned int)avg * avg) >> 5));
}

361
unsigned int vp9_variance4x4_c(const uint8_t *src_ptr,
362
                               int  source_stride,
363
                               const uint8_t *ref_ptr,
364 365
                               int  recon_stride,
                               unsigned int *sse) {
John Koleszar's avatar
John Koleszar committed
366 367 368 369 370
  unsigned int var;
  int avg;

  variance(src_ptr, source_stride, ref_ptr, recon_stride, 4, 4, &var, &avg);
  *sse = var;
371
  return (var - (((unsigned int)avg * avg) >> 4));
John Koleszar's avatar
John Koleszar committed
372 373 374
}


375
unsigned int vp9_mse16x16_c(const uint8_t *src_ptr,
376
                            int  source_stride,
377
                            const uint8_t *ref_ptr,
378 379
                            int  recon_stride,
                            unsigned int *sse) {
John Koleszar's avatar
John Koleszar committed
380 381 382 383 384 385
  unsigned int var;
  int avg;

  variance(src_ptr, source_stride, ref_ptr, recon_stride, 16, 16, &var, &avg);
  *sse = var;
  return var;
John Koleszar's avatar
John Koleszar committed
386 387 388
}


389
unsigned int vp9_sub_pixel_variance4x4_c(const uint8_t *src_ptr,
390 391 392
                                         int  src_pixels_per_line,
                                         int  xoffset,
                                         int  yoffset,
393
                                         const uint8_t *dst_ptr,
394 395
                                         int dst_pixels_per_line,
                                         unsigned int *sse) {
396
  uint8_t temp2[20 * 16];
397 398
  const int16_t *hfilter, *vfilter;
  uint16_t fdata3[5 * 4];  // Temp data bufffer used in filtering
John Koleszar's avatar
John Koleszar committed
399

400 401
  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);
John Koleszar's avatar
John Koleszar committed
402 403

  // First filter 1d Horizontal
404 405
  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 5, 4, hfilter);
John Koleszar's avatar
John Koleszar committed
406 407

  // Now filter Verticaly
408
  var_filter_block2d_bil_second_pass(fdata3, temp2, 4,  4,  4,  4, vfilter);
John Koleszar's avatar
John Koleszar committed
409

410
  return vp9_variance4x4_c(temp2, 4, dst_ptr, dst_pixels_per_line, sse);
John Koleszar's avatar
John Koleszar committed
411 412
}

413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437
unsigned int vp9_sub_pixel_avg_variance4x4_c(const uint8_t *src_ptr,
                                             int  src_pixels_per_line,
                                             int  xoffset,
                                             int  yoffset,
                                             const uint8_t *dst_ptr,
                                             int dst_pixels_per_line,
                                             unsigned int *sse,
                                             const uint8_t *second_pred) {
  uint8_t temp2[20 * 16];
  const int16_t *hfilter, *vfilter;
  DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 4 * 4);  // compound pred buffer
  uint16_t fdata3[5 * 4];  // Temp data bufffer used in filtering

  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);

  // First filter 1d Horizontal
  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 5, 4, hfilter);

  // Now filter Verticaly
  var_filter_block2d_bil_second_pass(fdata3, temp2, 4,  4,  4,  4, vfilter);
  comp_avg_pred(temp3, second_pred, 4, 4, temp2, 4);
  return vp9_variance4x4_c(temp3, 4, dst_ptr, dst_pixels_per_line, sse);
}
John Koleszar's avatar
John Koleszar committed
438

439
unsigned int vp9_sub_pixel_variance8x8_c(const uint8_t *src_ptr,
440 441 442
                                         int  src_pixels_per_line,
                                         int  xoffset,
                                         int  yoffset,
443
                                         const uint8_t *dst_ptr,
444 445
                                         int dst_pixels_per_line,
                                         unsigned int *sse) {
446
  uint16_t fdata3[9 * 8];  // Temp data bufffer used in filtering
447
  uint8_t temp2[20 * 16];
448
  const int16_t *hfilter, *vfilter;
John Koleszar's avatar
John Koleszar committed
449

450 451
  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);
John Koleszar's avatar
John Koleszar committed
452

453 454 455
  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 9, 8, hfilter);
  var_filter_block2d_bil_second_pass(fdata3, temp2, 8, 8, 8, 8, vfilter);
John Koleszar's avatar
John Koleszar committed
456

457
  return vp9_variance8x8_c(temp2, 8, dst_ptr, dst_pixels_per_line, sse);
John Koleszar's avatar
John Koleszar committed
458 459
}

460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482
unsigned int vp9_sub_pixel_avg_variance8x8_c(const uint8_t *src_ptr,
                                             int  src_pixels_per_line,
                                             int  xoffset,
                                             int  yoffset,
                                             const uint8_t *dst_ptr,
                                             int dst_pixels_per_line,
                                             unsigned int *sse,
                                             const uint8_t *second_pred) {
  uint16_t fdata3[9 * 8];  // Temp data bufffer used in filtering
  uint8_t temp2[20 * 16];
  DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 8 * 8);  // compound pred buffer
  const int16_t *hfilter, *vfilter;

  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);

  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 9, 8, hfilter);
  var_filter_block2d_bil_second_pass(fdata3, temp2, 8, 8, 8, 8, vfilter);
  comp_avg_pred(temp3, second_pred, 8, 8, temp2, 8);
  return vp9_variance8x8_c(temp3, 8, dst_ptr, dst_pixels_per_line, sse);
}

483
unsigned int vp9_sub_pixel_variance16x16_c(const uint8_t *src_ptr,
484 485 486
                                           int  src_pixels_per_line,
                                           int  xoffset,
                                           int  yoffset,
487
                                           const uint8_t *dst_ptr,
488 489
                                           int dst_pixels_per_line,
                                           unsigned int *sse) {
490
  uint16_t fdata3[17 * 16];  // Temp data bufffer used in filtering
491
  uint8_t temp2[20 * 16];
492
  const int16_t *hfilter, *vfilter;
John Koleszar's avatar
John Koleszar committed
493

494 495
  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);
John Koleszar's avatar
John Koleszar committed
496

497 498 499
  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 17, 16, hfilter);
  var_filter_block2d_bil_second_pass(fdata3, temp2, 16, 16, 16, 16, vfilter);
John Koleszar's avatar
John Koleszar committed
500

501
  return vp9_variance16x16_c(temp2, 16, dst_ptr, dst_pixels_per_line, sse);
John Koleszar's avatar
John Koleszar committed
502 503
}

504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527
unsigned int vp9_sub_pixel_avg_variance16x16_c(const uint8_t *src_ptr,
                                               int  src_pixels_per_line,
                                               int  xoffset,
                                               int  yoffset,
                                               const uint8_t *dst_ptr,
                                               int dst_pixels_per_line,
                                               unsigned int *sse,
                                               const uint8_t *second_pred) {
  uint16_t fdata3[17 * 16];
  uint8_t temp2[20 * 16];
  DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 16 * 16);  // compound pred buffer
  const int16_t *hfilter, *vfilter;

  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);

  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 17, 16, hfilter);
  var_filter_block2d_bil_second_pass(fdata3, temp2, 16, 16, 16, 16, vfilter);

  comp_avg_pred(temp3, second_pred, 16, 16, temp2, 16);
  return vp9_variance16x16_c(temp3, 16, dst_ptr, dst_pixels_per_line, sse);
}

Ronald S. Bultje's avatar
Ronald S. Bultje committed
528 529 530 531 532 533 534
unsigned int vp9_sub_pixel_variance64x64_c(const uint8_t *src_ptr,
                                           int  src_pixels_per_line,
                                           int  xoffset,
                                           int  yoffset,
                                           const uint8_t *dst_ptr,
                                           int dst_pixels_per_line,
                                           unsigned int *sse) {
535
  uint16_t fdata3[65 * 64];  // Temp data bufffer used in filtering
Ronald S. Bultje's avatar
Ronald S. Bultje committed
536
  uint8_t temp2[68 * 64];
537
  const int16_t *hfilter, *vfilter;
Ronald S. Bultje's avatar
Ronald S. Bultje committed
538

539 540
  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);
Ronald S. Bultje's avatar
Ronald S. Bultje committed
541

542 543 544
  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 65, 64, hfilter);
  var_filter_block2d_bil_second_pass(fdata3, temp2, 64, 64, 64, 64, vfilter);
Ronald S. Bultje's avatar
Ronald S. Bultje committed
545 546 547 548

  return vp9_variance64x64_c(temp2, 64, dst_ptr, dst_pixels_per_line, sse);
}

549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571
unsigned int vp9_sub_pixel_avg_variance64x64_c(const uint8_t *src_ptr,
                                               int  src_pixels_per_line,
                                               int  xoffset,
                                               int  yoffset,
                                               const uint8_t *dst_ptr,
                                               int dst_pixels_per_line,
                                               unsigned int *sse,
                                               const uint8_t *second_pred) {
  uint16_t fdata3[65 * 64];  // Temp data bufffer used in filtering
  uint8_t temp2[68 * 64];
  DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 64 * 64);  // compound pred buffer
  const int16_t *hfilter, *vfilter;

  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);

  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 65, 64, hfilter);
  var_filter_block2d_bil_second_pass(fdata3, temp2, 64, 64, 64, 64, vfilter);
  comp_avg_pred(temp3, second_pred, 64, 64, temp2, 64);
  return vp9_variance64x64_c(temp3, 64, dst_ptr, dst_pixels_per_line, sse);
}

572
unsigned int vp9_sub_pixel_variance32x32_c(const uint8_t *src_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
573 574 575
                                           int  src_pixels_per_line,
                                           int  xoffset,
                                           int  yoffset,
576
                                           const uint8_t *dst_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
577 578
                                           int dst_pixels_per_line,
                                           unsigned int *sse) {
579
  uint16_t fdata3[33 * 32];  // Temp data bufffer used in filtering
580
  uint8_t temp2[36 * 32];
581
  const int16_t *hfilter, *vfilter;
Ronald S. Bultje's avatar
Ronald S. Bultje committed
582

583 584
  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);
Ronald S. Bultje's avatar
Ronald S. Bultje committed
585

586 587 588
  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 33, 32, hfilter);
  var_filter_block2d_bil_second_pass(fdata3, temp2, 32, 32, 32, 32, vfilter);
Ronald S. Bultje's avatar
Ronald S. Bultje committed
589

590
  return vp9_variance32x32_c(temp2, 32, dst_ptr, dst_pixels_per_line, sse);
Ronald S. Bultje's avatar
Ronald S. Bultje committed
591
}
592

593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615
unsigned int vp9_sub_pixel_avg_variance32x32_c(const uint8_t *src_ptr,
                                               int  src_pixels_per_line,
                                               int  xoffset,
                                               int  yoffset,
                                               const uint8_t *dst_ptr,
                                               int dst_pixels_per_line,
                                               unsigned int *sse,
                                               const uint8_t *second_pred) {
  uint16_t fdata3[33 * 32];  // Temp data bufffer used in filtering
  uint8_t temp2[36 * 32];
  DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 32 * 32);  // compound pred buffer
  const int16_t *hfilter, *vfilter;

  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);

  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 33, 32, hfilter);
  var_filter_block2d_bil_second_pass(fdata3, temp2, 32, 32, 32, 32, vfilter);
  comp_avg_pred(temp3, second_pred, 32, 32, temp2, 32);
  return vp9_variance32x32_c(temp3, 32, dst_ptr, dst_pixels_per_line, sse);
}

616
unsigned int vp9_variance_halfpixvar16x16_h_c(const uint8_t *src_ptr,
617
                                              int  source_stride,
618
                                              const uint8_t *ref_ptr,
619 620
                                              int  recon_stride,
                                              unsigned int *sse) {
621
  return vp9_sub_pixel_variance16x16_c(src_ptr, source_stride, 8, 0,
John Koleszar's avatar
John Koleszar committed
622
                                       ref_ptr, recon_stride, sse);
623 624
}

625
unsigned int vp9_variance_halfpixvar32x32_h_c(const uint8_t *src_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
626
                                              int  source_stride,
627
                                              const uint8_t *ref_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
628 629
                                              int  recon_stride,
                                              unsigned int *sse) {
630
  return vp9_sub_pixel_variance32x32_c(src_ptr, source_stride, 8, 0,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
631 632
                                       ref_ptr, recon_stride, sse);
}
Ronald S. Bultje's avatar
Ronald S. Bultje committed
633 634 635 636 637 638 639 640 641

unsigned int vp9_variance_halfpixvar64x64_h_c(const uint8_t *src_ptr,
                                              int  source_stride,
                                              const uint8_t *ref_ptr,
                                              int  recon_stride,
                                              unsigned int *sse) {
  return vp9_sub_pixel_variance64x64_c(src_ptr, source_stride, 8, 0,
                                       ref_ptr, recon_stride, sse);
}
642

643
unsigned int vp9_variance_halfpixvar16x16_v_c(const uint8_t *src_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
644
                                              int  source_stride,
645
                                              const uint8_t *ref_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
646 647
                                              int  recon_stride,
                                              unsigned int *sse) {
648
  return vp9_sub_pixel_variance16x16_c(src_ptr, source_stride, 0, 8,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
649 650 651
                                       ref_ptr, recon_stride, sse);
}

652
unsigned int vp9_variance_halfpixvar32x32_v_c(const uint8_t *src_ptr,
653
                                              int  source_stride,
654
                                              const uint8_t *ref_ptr,
655 656
                                              int  recon_stride,
                                              unsigned int *sse) {
657
  return vp9_sub_pixel_variance32x32_c(src_ptr, source_stride, 0, 8,
John Koleszar's avatar
John Koleszar committed
658
                                       ref_ptr, recon_stride, sse);
659
}
Ronald S. Bultje's avatar
Ronald S. Bultje committed
660 661 662 663 664 665 666 667 668

unsigned int vp9_variance_halfpixvar64x64_v_c(const uint8_t *src_ptr,
                                              int  source_stride,
                                              const uint8_t *ref_ptr,
                                              int  recon_stride,
                                              unsigned int *sse) {
  return vp9_sub_pixel_variance64x64_c(src_ptr, source_stride, 0, 8,
                                       ref_ptr, recon_stride, sse);
}
669

670
unsigned int vp9_variance_halfpixvar16x16_hv_c(const uint8_t *src_ptr,
671
                                               int  source_stride,
672
                                               const uint8_t *ref_ptr,
673 674
                                               int  recon_stride,
                                               unsigned int *sse) {
675
  return vp9_sub_pixel_variance16x16_c(src_ptr, source_stride, 8, 8,
John Koleszar's avatar
John Koleszar committed
676
                                       ref_ptr, recon_stride, sse);
677 678
}

679
unsigned int vp9_variance_halfpixvar32x32_hv_c(const uint8_t *src_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
680
                                               int  source_stride,
681
                                               const uint8_t *ref_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
682 683
                                               int  recon_stride,
                                               unsigned int *sse) {
684
  return vp9_sub_pixel_variance32x32_c(src_ptr, source_stride, 8, 8,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
685 686
                                       ref_ptr, recon_stride, sse);
}
Ronald S. Bultje's avatar
Ronald S. Bultje committed
687 688 689 690 691 692 693 694 695

unsigned int vp9_variance_halfpixvar64x64_hv_c(const uint8_t *src_ptr,
                                               int  source_stride,
                                               const uint8_t *ref_ptr,
                                               int  recon_stride,
                                               unsigned int *sse) {
  return vp9_sub_pixel_variance64x64_c(src_ptr, source_stride, 8, 8,
                                       ref_ptr, recon_stride, sse);
}
696

697
unsigned int vp9_sub_pixel_mse16x16_c(const uint8_t *src_ptr,
698 699 700
                                      int  src_pixels_per_line,
                                      int  xoffset,
                                      int  yoffset,
701
                                      const uint8_t *dst_ptr,
702 703 704 705 706
                                      int dst_pixels_per_line,
                                      unsigned int *sse) {
  vp9_sub_pixel_variance16x16_c(src_ptr, src_pixels_per_line,
                                xoffset, yoffset, dst_ptr,
                                dst_pixels_per_line, sse);
John Koleszar's avatar
John Koleszar committed
707
  return *sse;
John Koleszar's avatar
John Koleszar committed
708 709
}

710
unsigned int vp9_sub_pixel_mse32x32_c(const uint8_t *src_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
711 712 713
                                      int  src_pixels_per_line,
                                      int  xoffset,
                                      int  yoffset,
714
                                      const uint8_t *dst_ptr,
Ronald S. Bultje's avatar
Ronald S. Bultje committed
715 716
                                      int dst_pixels_per_line,
                                      unsigned int *sse) {
717 718 719
  vp9_sub_pixel_variance32x32_c(src_ptr, src_pixels_per_line,
                                xoffset, yoffset, dst_ptr,
                                dst_pixels_per_line, sse);
Ronald S. Bultje's avatar
Ronald S. Bultje committed
720 721
  return *sse;
}
Ronald S. Bultje's avatar
Ronald S. Bultje committed
722 723 724 725 726 727 728 729 730 731 732 733 734

unsigned int vp9_sub_pixel_mse64x64_c(const uint8_t *src_ptr,
                                      int  src_pixels_per_line,
                                      int  xoffset,
                                      int  yoffset,
                                      const uint8_t *dst_ptr,
                                      int dst_pixels_per_line,
                                      unsigned int *sse) {
  vp9_sub_pixel_variance64x64_c(src_ptr, src_pixels_per_line,
                                xoffset, yoffset, dst_ptr,
                                dst_pixels_per_line, sse);
  return *sse;
}
Ronald S. Bultje's avatar
Ronald S. Bultje committed
735

736
unsigned int vp9_sub_pixel_variance16x8_c(const uint8_t *src_ptr,
737 738 739
                                          int  src_pixels_per_line,
                                          int  xoffset,
                                          int  yoffset,
740
                                          const uint8_t *dst_ptr,
741 742
                                          int dst_pixels_per_line,
                                          unsigned int *sse) {
743
  uint16_t fdata3[16 * 9];  // Temp data bufffer used in filtering
744
  uint8_t temp2[20 * 16];
745
  const int16_t *hfilter, *vfilter;
John Koleszar's avatar
John Koleszar committed
746

747 748
  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);
John Koleszar's avatar
John Koleszar committed
749

750 751 752
  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 9, 16, hfilter);
  var_filter_block2d_bil_second_pass(fdata3, temp2, 16, 16, 8, 16, vfilter);
John Koleszar's avatar
John Koleszar committed
753

754
  return vp9_variance16x8_c(temp2, 16, dst_ptr, dst_pixels_per_line, sse);
John Koleszar's avatar
John Koleszar committed
755 756
}

757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779
unsigned int vp9_sub_pixel_avg_variance16x8_c(const uint8_t *src_ptr,
                                              int  src_pixels_per_line,
                                              int  xoffset,
                                              int  yoffset,
                                              const uint8_t *dst_ptr,
                                              int dst_pixels_per_line,
                                              unsigned int *sse,
                                              const uint8_t *second_pred) {
  uint16_t fdata3[16 * 9];  // Temp data bufffer used in filtering
  uint8_t temp2[20 * 16];
  DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 16 * 8);  // compound pred buffer
  const int16_t *hfilter, *vfilter;

  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);

  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 9, 16, hfilter);
  var_filter_block2d_bil_second_pass(fdata3, temp2, 16, 16, 8, 16, vfilter);
  comp_avg_pred(temp3, second_pred, 16, 8, temp2, 16);
  return vp9_variance16x8_c(temp3, 16, dst_ptr, dst_pixels_per_line, sse);
}

780
unsigned int vp9_sub_pixel_variance8x16_c(const uint8_t *src_ptr,
781 782 783
                                          int  src_pixels_per_line,
                                          int  xoffset,
                                          int  yoffset,
784
                                          const uint8_t *dst_ptr,
785 786
                                          int dst_pixels_per_line,
                                          unsigned int *sse) {
787
  uint16_t fdata3[9 * 16];  // Temp data bufffer used in filtering
788
  uint8_t temp2[20 * 16];
789
  const int16_t *hfilter, *vfilter;
John Koleszar's avatar
John Koleszar committed
790

791 792
  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);
John Koleszar's avatar
John Koleszar committed
793

794 795 796
  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 17, 8, hfilter);
  var_filter_block2d_bil_second_pass(fdata3, temp2, 8, 8, 16, 8, vfilter);
John Koleszar's avatar
John Koleszar committed
797

798
  return vp9_variance8x16_c(temp2, 8, dst_ptr, dst_pixels_per_line, sse);
John Koleszar's avatar
John Koleszar committed
799
}
800

801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822
unsigned int vp9_sub_pixel_avg_variance8x16_c(const uint8_t *src_ptr,
                                              int  src_pixels_per_line,
                                              int  xoffset,
                                              int  yoffset,
                                              const uint8_t *dst_ptr,
                                              int dst_pixels_per_line,
                                              unsigned int *sse,
                                              const uint8_t *second_pred) {
  uint16_t fdata3[9 * 16];  // Temp data bufffer used in filtering
  uint8_t temp2[20 * 16];
  DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 8 * 16);  // compound pred buffer
  const int16_t *hfilter, *vfilter;

  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);

  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 17, 8, hfilter);
  var_filter_block2d_bil_second_pass(fdata3, temp2, 8, 8, 16, 8, vfilter);
  comp_avg_pred(temp3, second_pred, 8, 16, temp2, 8);
  return vp9_variance8x16_c(temp3, 8, dst_ptr, dst_pixels_per_line, sse);
}
823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910

unsigned int vp9_sub_pixel_variance8x4_c(const uint8_t *src_ptr,
                                         int  src_pixels_per_line,
                                         int  xoffset,
                                         int  yoffset,
                                         const uint8_t *dst_ptr,
                                         int dst_pixels_per_line,
                                         unsigned int *sse) {
  uint16_t fdata3[8 * 5];  // Temp data bufffer used in filtering
  uint8_t temp2[20 * 16];
  const int16_t *hfilter, *vfilter;

  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);

  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 5, 8, hfilter);
  var_filter_block2d_bil_second_pass(fdata3, temp2, 8, 8, 4, 8, vfilter);

  return vp9_variance8x4_c(temp2, 8, dst_ptr, dst_pixels_per_line, sse);
}

unsigned int vp9_sub_pixel_avg_variance8x4_c(const uint8_t *src_ptr,
                                             int  src_pixels_per_line,
                                             int  xoffset,
                                             int  yoffset,
                                             const uint8_t *dst_ptr,
                                             int dst_pixels_per_line,
                                             unsigned int *sse,
                                             const uint8_t *second_pred) {
  uint16_t fdata3[8 * 5];  // Temp data bufffer used in filtering
  uint8_t temp2[20 * 16];
  DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 8 * 4);  // compound pred buffer
  const int16_t *hfilter, *vfilter;

  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);

  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 5, 8, hfilter);
  var_filter_block2d_bil_second_pass(fdata3, temp2, 8, 8, 4, 8, vfilter);
  comp_avg_pred(temp3, second_pred, 8, 4, temp2, 8);
  return vp9_variance8x4_c(temp3, 8, dst_ptr, dst_pixels_per_line, sse);
}

unsigned int vp9_sub_pixel_variance4x8_c(const uint8_t *src_ptr,
                                         int  src_pixels_per_line,
                                         int  xoffset,
                                         int  yoffset,
                                         const uint8_t *dst_ptr,
                                         int dst_pixels_per_line,
                                         unsigned int *sse) {
  uint16_t fdata3[5 * 8];  // Temp data bufffer used in filtering
  uint8_t temp2[20 * 16];
  const int16_t *hfilter, *vfilter;

  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);

  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 17, 4, hfilter);
  var_filter_block2d_bil_second_pass(fdata3, temp2, 4, 4, 8, 4, vfilter);

  return vp9_variance4x8_c(temp2, 4, dst_ptr, dst_pixels_per_line, sse);
}

unsigned int vp9_sub_pixel_avg_variance4x8_c(const uint8_t *src_ptr,
                                             int  src_pixels_per_line,
                                             int  xoffset,
                                             int  yoffset,
                                             const uint8_t *dst_ptr,
                                             int dst_pixels_per_line,
                                             unsigned int *sse,
                                             const uint8_t *second_pred) {
  uint16_t fdata3[5 * 8];  // Temp data bufffer used in filtering
  uint8_t temp2[20 * 16];
  DECLARE_ALIGNED_ARRAY(16, uint8_t, temp3, 4 * 8);  // compound pred buffer
  const int16_t *hfilter, *vfilter;

  hfilter = VP9_BILINEAR_FILTERS_2TAP(xoffset);
  vfilter = VP9_BILINEAR_FILTERS_2TAP(yoffset);

  var_filter_block2d_bil_first_pass(src_ptr, fdata3, src_pixels_per_line,
                                    1, 17, 4, hfilter);
  var_filter_block2d_bil_second_pass(fdata3, temp2, 4, 4, 8, 4, vfilter);
  comp_avg_pred(temp3, second_pred, 4, 8, temp2, 4);
  return vp9_variance4x8_c(temp3, 4, dst_ptr, dst_pixels_per_line, sse);
}