OLD | NEW |
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 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 vp9_subpixvariance_fn_t svf; | 93 vp9_subpixvariance_fn_t svf; |
94 vp9_subp_avg_variance_fn_t svaf; | 94 vp9_subp_avg_variance_fn_t svaf; |
95 vp9_variance_fn_t svf_halfpix_h; | 95 vp9_variance_fn_t svf_halfpix_h; |
96 vp9_variance_fn_t svf_halfpix_v; | 96 vp9_variance_fn_t svf_halfpix_v; |
97 vp9_variance_fn_t svf_halfpix_hv; | 97 vp9_variance_fn_t svf_halfpix_hv; |
98 vp9_sad_multi_fn_t sdx3f; | 98 vp9_sad_multi_fn_t sdx3f; |
99 vp9_sad_multi1_fn_t sdx8f; | 99 vp9_sad_multi1_fn_t sdx8f; |
100 vp9_sad_multi_d_fn_t sdx4df; | 100 vp9_sad_multi_d_fn_t sdx4df; |
101 } vp9_variance_fn_ptr_t; | 101 } vp9_variance_fn_ptr_t; |
102 | 102 |
103 static void comp_avg_pred(uint8_t *comp_pred, const uint8_t *pred, int width, | 103 void vp9_comp_avg_pred(uint8_t *comp_pred, const uint8_t *pred, int width, |
104 int height, const uint8_t *ref, int ref_stride) { | 104 int height, const uint8_t *ref, int ref_stride); |
105 int i, j; | |
106 | 105 |
107 for (i = 0; i < height; i++) { | |
108 for (j = 0; j < width; j++) { | |
109 int tmp; | |
110 tmp = pred[j] + ref[j]; | |
111 comp_pred[j] = (tmp + 1) >> 1; | |
112 } | |
113 comp_pred += width; | |
114 pred += width; | |
115 ref += ref_stride; | |
116 } | |
117 } | |
118 #ifdef __cplusplus | 106 #ifdef __cplusplus |
119 } // extern "C" | 107 } // extern "C" |
120 #endif | 108 #endif |
121 | 109 |
122 #endif // VP9_ENCODER_VP9_VARIANCE_H_ | 110 #endif // VP9_ENCODER_VP9_VARIANCE_H_ |
OLD | NEW |