OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved. |
| 3 * |
| 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 |
| 6 * 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. |
| 9 */ |
| 10 #include "vp9/common/vp9_common.h" |
| 11 #include "vpx_ports/mem.h" |
| 12 |
| 13 unsigned int vp9_avg_8x8_c(const uint8_t *s, int p) { |
| 14 int i, j; |
| 15 int sum = 0; |
| 16 for (i = 0; i < 8; ++i, s+=p) |
| 17 for (j = 0; j < 8; sum += s[j], ++j) {} |
| 18 |
| 19 return (sum + 32) >> 6; |
| 20 } |
| 21 |
| 22 #if CONFIG_VP9_HIGHBITDEPTH |
| 23 unsigned int vp9_highbd_avg_8x8_c(const uint8_t *s8, int p) { |
| 24 int i, j; |
| 25 int sum = 0; |
| 26 const uint16_t* s = CONVERT_TO_SHORTPTR(s8); |
| 27 for (i = 0; i < 8; ++i, s+=p) |
| 28 for (j = 0; j < 8; sum += s[j], ++j) {} |
| 29 |
| 30 return (sum + 32) >> 6; |
| 31 } |
| 32 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 33 |
OLD | NEW |