| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 #include "vp9/common/vp9_common.h" | 10 #include "vp9/common/vp9_common.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 for (i = 0; i < height; ++i) | 39 for (i = 0; i < height; ++i) |
| 40 hbuf[idx] += ref[i * ref_stride]; | 40 hbuf[idx] += ref[i * ref_stride]; |
| 41 hbuf[idx] /= norm_factor; | 41 hbuf[idx] /= norm_factor; |
| 42 ++ref; | 42 ++ref; |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 | 45 |
| 46 int16_t vp9_int_pro_col_c(uint8_t const *ref, const int width) { | 46 int16_t vp9_int_pro_col_c(uint8_t const *ref, const int width) { |
| 47 int idx; | 47 int idx; |
| 48 int16_t sum = 0; | 48 int16_t sum = 0; |
| 49 const int norm_factor = MAX(8, width >> 1); | |
| 50 for (idx = 0; idx < width; ++idx) | 49 for (idx = 0; idx < width; ++idx) |
| 51 sum += ref[idx]; | 50 sum += ref[idx]; |
| 52 return sum / norm_factor; | 51 return sum; |
| 53 } | 52 } |
| 54 | 53 |
| 55 int vp9_vector_var_c(int16_t const *ref, int16_t const *src, | 54 int vp9_vector_var_c(int16_t const *ref, int16_t const *src, |
| 56 const int bwl) { | 55 const int bwl) { |
| 57 int i; | 56 int i; |
| 58 int width = 4 << bwl; | 57 int width = 4 << bwl; |
| 59 int sse = 0, mean = 0, var; | 58 int sse = 0, mean = 0, var; |
| 60 | 59 |
| 61 for (i = 0; i < width; ++i) { | 60 for (i = 0; i < width; ++i) { |
| 62 int diff = ref[i] - src[i]; | 61 int diff = ref[i] - src[i]; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 84 int sum = 0; | 83 int sum = 0; |
| 85 const uint16_t* s = CONVERT_TO_SHORTPTR(s8); | 84 const uint16_t* s = CONVERT_TO_SHORTPTR(s8); |
| 86 for (i = 0; i < 4; ++i, s+=p) | 85 for (i = 0; i < 4; ++i, s+=p) |
| 87 for (j = 0; j < 4; sum += s[j], ++j) {} | 86 for (j = 0; j < 4; sum += s[j], ++j) {} |
| 88 | 87 |
| 89 return (sum + 8) >> 4; | 88 return (sum + 8) >> 4; |
| 90 } | 89 } |
| 91 #endif // CONFIG_VP9_HIGHBITDEPTH | 90 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 92 | 91 |
| 93 | 92 |
| OLD | NEW |