diff options
Diffstat (limited to 'vp9/encoder/vp9_avg.c')
-rw-r--r-- | vp9/encoder/vp9_avg.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/vp9/encoder/vp9_avg.c b/vp9/encoder/vp9_avg.c new file mode 100644 index 000000000..22c6cc4fc --- /dev/null +++ b/vp9/encoder/vp9_avg.c @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2014 The WebM project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ +#include "vpx_ports/mem.h" + +unsigned int vp9_avg_8x8_c(const uint8_t *s, int p) { + int i, j; + int sum = 0; + for (i = 0; i < 8; ++i, s+=p) + for (j = 0; j < 8; sum += s[j], ++j) {} + + return (sum + 32) >> 6; +} |