variance_sse2.c 13.2 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
#include "vpx_config.h"
12
13
#include "vp9/encoder/variance.h"
#include "vp9/common/pragmas.h"
John Koleszar's avatar
John Koleszar committed
14
15
#include "vpx_ports/mem.h"

16
17
#define HALFNDX 8

18
19
20
21
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);
extern void filter_block1d_v6_mmx(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);
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, unsigned int output_height, unsigned int output_width, short *vp7_filter);
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);
John Koleszar's avatar
John Koleszar committed
22

23
extern void vp9_filter_block2d_bil4x4_var_mmx
John Koleszar's avatar
John Koleszar committed
24
(
John Koleszar's avatar
John Koleszar committed
25
26
27
28
29
30
31
32
  const unsigned char *ref_ptr,
  int ref_pixels_per_line,
  const unsigned char *src_ptr,
  int src_pixels_per_line,
  const short *HFilter,
  const short *VFilter,
  int *sum,
  unsigned int *sumsquared
John Koleszar's avatar
John Koleszar committed
33
34
);

35
extern unsigned int vp9_get4x4var_mmx
John Koleszar's avatar
John Koleszar committed
36
(
John Koleszar's avatar
John Koleszar committed
37
38
39
40
41
42
  const unsigned char *src_ptr,
  int  source_stride,
  const unsigned char *ref_ptr,
  int  recon_stride,
  unsigned int *SSE,
  int *Sum
John Koleszar's avatar
John Koleszar committed
43
44
);

45
unsigned int vp9_get_mb_ss_sse2
John Koleszar's avatar
John Koleszar committed
46
(
John Koleszar's avatar
John Koleszar committed
47
  const short *src_ptr
John Koleszar's avatar
John Koleszar committed
48
);
49
unsigned int vp9_get16x16var_sse2
John Koleszar's avatar
John Koleszar committed
50
(
John Koleszar's avatar
John Koleszar committed
51
52
53
54
55
56
  const unsigned char *src_ptr,
  int source_stride,
  const unsigned char *ref_ptr,
  int recon_stride,
  unsigned int *SSE,
  int *Sum
John Koleszar's avatar
John Koleszar committed
57
);
58
unsigned int vp9_get8x8var_sse2
John Koleszar's avatar
John Koleszar committed
59
(
John Koleszar's avatar
John Koleszar committed
60
61
62
63
64
65
  const unsigned char *src_ptr,
  int source_stride,
  const unsigned char *ref_ptr,
  int recon_stride,
  unsigned int *SSE,
  int *Sum
John Koleszar's avatar
John Koleszar committed
66
);
67
void vp9_filter_block2d_bil_var_sse2
John Koleszar's avatar
John Koleszar committed
68
(
John Koleszar's avatar
John Koleszar committed
69
70
71
72
73
74
75
76
77
  const unsigned char *ref_ptr,
  int ref_pixels_per_line,
  const unsigned char *src_ptr,
  int src_pixels_per_line,
  unsigned int Height,
  int  xoffset,
  int  yoffset,
  int *sum,
  unsigned int *sumsquared
John Koleszar's avatar
John Koleszar committed
78
);
79
void vp9_half_horiz_vert_variance8x_h_sse2
80
(
John Koleszar's avatar
John Koleszar committed
81
82
83
84
85
86
87
  const unsigned char *ref_ptr,
  int ref_pixels_per_line,
  const unsigned char *src_ptr,
  int src_pixels_per_line,
  unsigned int Height,
  int *sum,
  unsigned int *sumsquared
88
);
89
void vp9_half_horiz_vert_variance16x_h_sse2
John Koleszar's avatar
John Koleszar committed
90
(
John Koleszar's avatar
John Koleszar committed
91
92
93
94
95
96
97
  const unsigned char *ref_ptr,
  int ref_pixels_per_line,
  const unsigned char *src_ptr,
  int src_pixels_per_line,
  unsigned int Height,
  int *sum,
  unsigned int *sumsquared
John Koleszar's avatar
John Koleszar committed
98
);
99
void vp9_half_horiz_variance8x_h_sse2
100
(
John Koleszar's avatar
John Koleszar committed
101
102
103
104
105
106
107
  const unsigned char *ref_ptr,
  int ref_pixels_per_line,
  const unsigned char *src_ptr,
  int src_pixels_per_line,
  unsigned int Height,
  int *sum,
  unsigned int *sumsquared
108
);
109
void vp9_half_horiz_variance16x_h_sse2
John Koleszar's avatar
John Koleszar committed
110
(
John Koleszar's avatar
John Koleszar committed
111
112
113
114
115
116
117
  const unsigned char *ref_ptr,
  int ref_pixels_per_line,
  const unsigned char *src_ptr,
  int src_pixels_per_line,
  unsigned int Height,
  int *sum,
  unsigned int *sumsquared
John Koleszar's avatar
John Koleszar committed
118
);
119
void vp9_half_vert_variance8x_h_sse2
120
(
John Koleszar's avatar
John Koleszar committed
121
122
123
124
125
126
127
  const unsigned char *ref_ptr,
  int ref_pixels_per_line,
  const unsigned char *src_ptr,
  int src_pixels_per_line,
  unsigned int Height,
  int *sum,
  unsigned int *sumsquared
128
);
129
void vp9_half_vert_variance16x_h_sse2
John Koleszar's avatar
John Koleszar committed
130
(
John Koleszar's avatar
John Koleszar committed
131
132
133
134
135
136
137
  const unsigned char *ref_ptr,
  int ref_pixels_per_line,
  const unsigned char *src_ptr,
  int src_pixels_per_line,
  unsigned int Height,
  int *sum,
  unsigned int *sumsquared
John Koleszar's avatar
John Koleszar committed
138
139
);

140
DECLARE_ALIGNED(16, extern short, vp9_bilinear_filters_mmx[16][8]);
John Koleszar's avatar
John Koleszar committed
141

142
unsigned int vp9_variance4x4_wmt(
John Koleszar's avatar
John Koleszar committed
143
144
145
146
147
148
149
150
  const unsigned char *src_ptr,
  int  source_stride,
  const unsigned char *ref_ptr,
  int  recon_stride,
  unsigned int *sse) {
  unsigned int var;
  int avg;

151
  vp9_get4x4var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &var, &avg);
John Koleszar's avatar
John Koleszar committed
152
  *sse = var;
153
  return (var - (((unsigned int)avg * avg) >> 4));
John Koleszar's avatar
John Koleszar committed
154
155
156

}

157
unsigned int vp9_variance8x8_wmt
John Koleszar's avatar
John Koleszar committed
158
(
John Koleszar's avatar
John Koleszar committed
159
160
161
162
163
164
165
166
  const unsigned char *src_ptr,
  int  source_stride,
  const unsigned char *ref_ptr,
  int  recon_stride,
  unsigned int *sse) {
  unsigned int var;
  int avg;

167
  vp9_get8x8var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &var, &avg);
John Koleszar's avatar
John Koleszar committed
168
  *sse = var;
169
  return (var - (((unsigned int)avg * avg) >> 6));
John Koleszar's avatar
John Koleszar committed
170
171
172
173

}


174
unsigned int vp9_variance16x16_wmt
John Koleszar's avatar
John Koleszar committed
175
(
John Koleszar's avatar
John Koleszar committed
176
177
178
179
180
181
182
183
184
  const unsigned char *src_ptr,
  int  source_stride,
  const unsigned char *ref_ptr,
  int  recon_stride,
  unsigned int *sse) {
  unsigned int sse0;
  int sum0;


185
  vp9_get16x16var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum0);
John Koleszar's avatar
John Koleszar committed
186
  *sse = sse0;
187
  return (sse0 - (((unsigned int)sum0 * sum0) >> 8));
John Koleszar's avatar
John Koleszar committed
188
}
189
unsigned int vp9_mse16x16_wmt(
John Koleszar's avatar
John Koleszar committed
190
191
192
193
194
195
196
197
  const unsigned char *src_ptr,
  int  source_stride,
  const unsigned char *ref_ptr,
  int  recon_stride,
  unsigned int *sse) {

  unsigned int sse0;
  int sum0;
198
  vp9_get16x16var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum0);
John Koleszar's avatar
John Koleszar committed
199
200
  *sse = sse0;
  return sse0;
John Koleszar's avatar
John Koleszar committed
201
202
203
204

}


205
unsigned int vp9_variance16x8_wmt
John Koleszar's avatar
John Koleszar committed
206
(
John Koleszar's avatar
John Koleszar committed
207
208
209
210
211
212
213
214
  const unsigned char *src_ptr,
  int  source_stride,
  const unsigned char *ref_ptr,
  int  recon_stride,
  unsigned int *sse) {
  unsigned int sse0, sse1, var;
  int sum0, sum1, avg;

215
216
  vp9_get8x8var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum0);
  vp9_get8x8var_sse2(src_ptr + 8, source_stride, ref_ptr + 8, recon_stride, &sse1, &sum1);
John Koleszar's avatar
John Koleszar committed
217
218
219
220

  var = sse0 + sse1;
  avg = sum0 + sum1;
  *sse = var;
221
  return (var - (((unsigned int)avg * avg) >> 7));
John Koleszar's avatar
John Koleszar committed
222
223
224

}

225
unsigned int vp9_variance8x16_wmt
John Koleszar's avatar
John Koleszar committed
226
(
John Koleszar's avatar
John Koleszar committed
227
228
229
230
231
232
233
234
  const unsigned char *src_ptr,
  int  source_stride,
  const unsigned char *ref_ptr,
  int  recon_stride,
  unsigned int *sse) {
  unsigned int sse0, sse1, var;
  int sum0, sum1, avg;

235
236
  vp9_get8x8var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum0);
  vp9_get8x8var_sse2(src_ptr + 8 * source_stride, source_stride, ref_ptr + 8 * recon_stride, recon_stride, &sse1, &sum1);
John Koleszar's avatar
John Koleszar committed
237
238
239
240

  var = sse0 + sse1;
  avg = sum0 + sum1;
  *sse = var;
241
  return (var - (((unsigned int)avg * avg) >> 7));
John Koleszar's avatar
John Koleszar committed
242
243
244

}

245
unsigned int vp9_sub_pixel_variance4x4_wmt
John Koleszar's avatar
John Koleszar committed
246
(
John Koleszar's avatar
John Koleszar committed
247
248
249
250
251
252
253
254
255
256
  const unsigned char  *src_ptr,
  int  src_pixels_per_line,
  int  xoffset,
  int  yoffset,
  const unsigned char *dst_ptr,
  int dst_pixels_per_line,
  unsigned int *sse
) {
  int xsum;
  unsigned int xxsum;
257
  vp9_filter_block2d_bil4x4_var_mmx(
John Koleszar's avatar
John Koleszar committed
258
259
    src_ptr, src_pixels_per_line,
    dst_ptr, dst_pixels_per_line,
260
    vp9_bilinear_filters_mmx[xoffset], vp9_bilinear_filters_mmx[yoffset],
John Koleszar's avatar
John Koleszar committed
261
262
263
    &xsum, &xxsum
  );
  *sse = xxsum;
264
  return (xxsum - (((unsigned int)xsum * xsum) >> 4));
John Koleszar's avatar
John Koleszar committed
265
266
267
}


268
unsigned int vp9_sub_pixel_variance8x8_wmt
John Koleszar's avatar
John Koleszar committed
269
(
John Koleszar's avatar
John Koleszar committed
270
271
272
273
274
275
276
277
278
279
280
281
  const unsigned char  *src_ptr,
  int  src_pixels_per_line,
  int  xoffset,
  int  yoffset,
  const unsigned char *dst_ptr,
  int dst_pixels_per_line,
  unsigned int *sse
) {
  int xsum;
  unsigned int xxsum;

  if (xoffset == HALFNDX && yoffset == 0) {
282
    vp9_half_horiz_variance8x_h_sse2(
John Koleszar's avatar
John Koleszar committed
283
284
285
286
      src_ptr, src_pixels_per_line,
      dst_ptr, dst_pixels_per_line, 8,
      &xsum, &xxsum);
  } else if (xoffset == 0 && yoffset == HALFNDX) {
287
    vp9_half_vert_variance8x_h_sse2(
John Koleszar's avatar
John Koleszar committed
288
289
290
291
      src_ptr, src_pixels_per_line,
      dst_ptr, dst_pixels_per_line, 8,
      &xsum, &xxsum);
  } else if (xoffset == HALFNDX && yoffset == HALFNDX) {
292
    vp9_half_horiz_vert_variance8x_h_sse2(
John Koleszar's avatar
John Koleszar committed
293
294
295
296
      src_ptr, src_pixels_per_line,
      dst_ptr, dst_pixels_per_line, 8,
      &xsum, &xxsum);
  } else {
297
    vp9_filter_block2d_bil_var_sse2(
John Koleszar's avatar
John Koleszar committed
298
299
300
301
302
303
304
      src_ptr, src_pixels_per_line,
      dst_ptr, dst_pixels_per_line, 8,
      xoffset, yoffset,
      &xsum, &xxsum);
  }

  *sse = xxsum;
305
  return (xxsum - (((unsigned int)xsum * xsum) >> 6));
John Koleszar's avatar
John Koleszar committed
306
307
}

308
unsigned int vp9_sub_pixel_variance16x16_wmt
John Koleszar's avatar
John Koleszar committed
309
(
John Koleszar's avatar
John Koleszar committed
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
  const unsigned char  *src_ptr,
  int  src_pixels_per_line,
  int  xoffset,
  int  yoffset,
  const unsigned char *dst_ptr,
  int dst_pixels_per_line,
  unsigned int *sse
) {
  int xsum0, xsum1;
  unsigned int xxsum0, xxsum1;


  // note we could avoid these if statements if the calling function
  // just called the appropriate functions inside.
  if (xoffset == HALFNDX && yoffset == 0) {
325
    vp9_half_horiz_variance16x_h_sse2(
John Koleszar's avatar
John Koleszar committed
326
327
328
329
      src_ptr, src_pixels_per_line,
      dst_ptr, dst_pixels_per_line, 16,
      &xsum0, &xxsum0);
  } else if (xoffset == 0 && yoffset == HALFNDX) {
330
    vp9_half_vert_variance16x_h_sse2(
John Koleszar's avatar
John Koleszar committed
331
332
333
334
      src_ptr, src_pixels_per_line,
      dst_ptr, dst_pixels_per_line, 16,
      &xsum0, &xxsum0);
  } else if (xoffset == HALFNDX && yoffset == HALFNDX) {
335
    vp9_half_horiz_vert_variance16x_h_sse2(
John Koleszar's avatar
John Koleszar committed
336
337
338
339
      src_ptr, src_pixels_per_line,
      dst_ptr, dst_pixels_per_line, 16,
      &xsum0, &xxsum0);
  } else {
340
    vp9_filter_block2d_bil_var_sse2(
John Koleszar's avatar
John Koleszar committed
341
342
343
344
345
346
      src_ptr, src_pixels_per_line,
      dst_ptr, dst_pixels_per_line, 16,
      xoffset, yoffset,
      &xsum0, &xxsum0
    );

347
    vp9_filter_block2d_bil_var_sse2(
John Koleszar's avatar
John Koleszar committed
348
349
350
351
352
353
354
355
356
357
      src_ptr + 8, src_pixels_per_line,
      dst_ptr + 8, dst_pixels_per_line, 16,
      xoffset, yoffset,
      &xsum1, &xxsum1
    );
    xsum0 += xsum1;
    xxsum0 += xxsum1;
  }

  *sse = xxsum0;
358
  return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 8));
John Koleszar's avatar
John Koleszar committed
359
360
}

361
unsigned int vp9_sub_pixel_mse16x16_wmt(
John Koleszar's avatar
John Koleszar committed
362
363
364
365
366
367
368
369
  const unsigned char  *src_ptr,
  int  src_pixels_per_line,
  int  xoffset,
  int  yoffset,
  const unsigned char *dst_ptr,
  int dst_pixels_per_line,
  unsigned int *sse
) {
370
  vp9_sub_pixel_variance16x16_wmt(src_ptr, src_pixels_per_line, xoffset, yoffset, dst_ptr, dst_pixels_per_line, sse);
John Koleszar's avatar
John Koleszar committed
371
  return *sse;
John Koleszar's avatar
John Koleszar committed
372
373
}

374
unsigned int vp9_sub_pixel_variance16x8_wmt
John Koleszar's avatar
John Koleszar committed
375
(
John Koleszar's avatar
John Koleszar committed
376
377
378
379
380
381
382
383
384
385
386
387
388
  const unsigned char  *src_ptr,
  int  src_pixels_per_line,
  int  xoffset,
  int  yoffset,
  const unsigned char *dst_ptr,
  int dst_pixels_per_line,
  unsigned int *sse

) {
  int xsum0, xsum1;
  unsigned int xxsum0, xxsum1;

  if (xoffset == HALFNDX && yoffset == 0) {
389
    vp9_half_horiz_variance16x_h_sse2(
John Koleszar's avatar
John Koleszar committed
390
391
392
393
      src_ptr, src_pixels_per_line,
      dst_ptr, dst_pixels_per_line, 8,
      &xsum0, &xxsum0);
  } else if (xoffset == 0 && yoffset == HALFNDX) {
394
    vp9_half_vert_variance16x_h_sse2(
John Koleszar's avatar
John Koleszar committed
395
396
397
398
      src_ptr, src_pixels_per_line,
      dst_ptr, dst_pixels_per_line, 8,
      &xsum0, &xxsum0);
  } else if (xoffset == HALFNDX && yoffset == HALFNDX) {
399
    vp9_half_horiz_vert_variance16x_h_sse2(
John Koleszar's avatar
John Koleszar committed
400
401
402
403
      src_ptr, src_pixels_per_line,
      dst_ptr, dst_pixels_per_line, 8,
      &xsum0, &xxsum0);
  } else {
404
    vp9_filter_block2d_bil_var_sse2(
John Koleszar's avatar
John Koleszar committed
405
406
407
408
409
      src_ptr, src_pixels_per_line,
      dst_ptr, dst_pixels_per_line, 8,
      xoffset, yoffset,
      &xsum0, &xxsum0);

410
    vp9_filter_block2d_bil_var_sse2(
John Koleszar's avatar
John Koleszar committed
411
412
413
414
415
416
417
418
419
      src_ptr + 8, src_pixels_per_line,
      dst_ptr + 8, dst_pixels_per_line, 8,
      xoffset, yoffset,
      &xsum1, &xxsum1);
    xsum0 += xsum1;
    xxsum0 += xxsum1;
  }

  *sse = xxsum0;
420
  return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 7));
John Koleszar's avatar
John Koleszar committed
421
422
}

423
unsigned int vp9_sub_pixel_variance8x16_wmt
John Koleszar's avatar
John Koleszar committed
424
(
John Koleszar's avatar
John Koleszar committed
425
426
427
428
429
430
431
432
433
434
435
436
  const unsigned char  *src_ptr,
  int  src_pixels_per_line,
  int  xoffset,
  int  yoffset,
  const unsigned char *dst_ptr,
  int dst_pixels_per_line,
  unsigned int *sse
) {
  int xsum;
  unsigned int xxsum;

  if (xoffset == HALFNDX && yoffset == 0) {
437
    vp9_half_horiz_variance8x_h_sse2(
John Koleszar's avatar
John Koleszar committed
438
439
440
441
      src_ptr, src_pixels_per_line,
      dst_ptr, dst_pixels_per_line, 16,
      &xsum, &xxsum);
  } else if (xoffset == 0 && yoffset == HALFNDX) {
442
    vp9_half_vert_variance8x_h_sse2(
John Koleszar's avatar
John Koleszar committed
443
444
445
446
      src_ptr, src_pixels_per_line,
      dst_ptr, dst_pixels_per_line, 16,
      &xsum, &xxsum);
  } else if (xoffset == HALFNDX && yoffset == HALFNDX) {
447
    vp9_half_horiz_vert_variance8x_h_sse2(
John Koleszar's avatar
John Koleszar committed
448
449
450
451
      src_ptr, src_pixels_per_line,
      dst_ptr, dst_pixels_per_line, 16,
      &xsum, &xxsum);
  } else {
452
    vp9_filter_block2d_bil_var_sse2(
John Koleszar's avatar
John Koleszar committed
453
454
455
456
457
458
459
      src_ptr, src_pixels_per_line,
      dst_ptr, dst_pixels_per_line, 16,
      xoffset, yoffset,
      &xsum, &xxsum);
  }

  *sse = xxsum;
460
  return (xxsum - (((unsigned int)xsum * xsum) >> 7));
John Koleszar's avatar
John Koleszar committed
461
462
}

463

464
unsigned int vp9_variance_halfpixvar16x16_h_wmt(
John Koleszar's avatar
John Koleszar committed
465
466
467
468
469
470
471
472
  const unsigned char *src_ptr,
  int  src_pixels_per_line,
  const unsigned char *dst_ptr,
  int  dst_pixels_per_line,
  unsigned int *sse) {
  int xsum0;
  unsigned int xxsum0;

473
  vp9_half_horiz_variance16x_h_sse2(
John Koleszar's avatar
John Koleszar committed
474
475
476
477
478
    src_ptr, src_pixels_per_line,
    dst_ptr, dst_pixels_per_line, 16,
    &xsum0, &xxsum0);

  *sse = xxsum0;
479
  return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 8));
480
481
482
}


483
unsigned int vp9_variance_halfpixvar16x16_v_wmt(
John Koleszar's avatar
John Koleszar committed
484
485
486
487
488
489
490
  const unsigned char *src_ptr,
  int  src_pixels_per_line,
  const unsigned char *dst_ptr,
  int  dst_pixels_per_line,
  unsigned int *sse) {
  int xsum0;
  unsigned int xxsum0;
491
  vp9_half_vert_variance16x_h_sse2(
John Koleszar's avatar
John Koleszar committed
492
493
494
495
496
    src_ptr, src_pixels_per_line,
    dst_ptr, dst_pixels_per_line, 16,
    &xsum0, &xxsum0);

  *sse = xxsum0;
497
  return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 8));
498
499
500
}


501
unsigned int vp9_variance_halfpixvar16x16_hv_wmt(
John Koleszar's avatar
John Koleszar committed
502
503
504
505
506
507
508
509
  const unsigned char *src_ptr,
  int  src_pixels_per_line,
  const unsigned char *dst_ptr,
  int  dst_pixels_per_line,
  unsigned int *sse) {
  int xsum0;
  unsigned int xxsum0;

510
  vp9_half_horiz_vert_variance16x_h_sse2(
John Koleszar's avatar
John Koleszar committed
511
512
513
514
515
    src_ptr, src_pixels_per_line,
    dst_ptr, dst_pixels_per_line, 16,
    &xsum0, &xxsum0);

  *sse = xxsum0;
516
  return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 8));
517
}