/* * 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.
*/
// Process a block of width 4 two rows at a time. staticINLINEvoid variance_4xh_neon(const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, int h, uint32_t *sse, int *sum) {
int16x8_t sum_s16 = vdupq_n_s16(0);
int32x4_t sse_s32 = vdupq_n_s32(0); int i = h;
// Number of rows we can process before 'sum_s16' overflows: // 32767 / 255 ~= 128, but we use an 8-wide accumulator; so 256 4-wide rows.
assert(h <= 256);
do { const uint8x8_t s = load_unaligned_u8(src_ptr, src_stride); const uint8x8_t r = load_unaligned_u8(ref_ptr, ref_stride); const int16x8_t diff = vreinterpretq_s16_u16(vsubl_u8(s, r));
// Process a block of width 8 one row at a time. staticINLINEvoid variance_8xh_neon(const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, int h, uint32_t *sse, int *sum) {
int16x8_t sum_s16 = vdupq_n_s16(0);
int32x4_t sse_s32[2] = { vdupq_n_s32(0), vdupq_n_s32(0) }; int i = h;
// Number of rows we can process before 'sum_s16' overflows: // 32767 / 255 ~= 128
assert(h <= 128);
do { const uint8x8_t s = vld1_u8(src_ptr); const uint8x8_t r = vld1_u8(ref_ptr); const int16x8_t diff = vreinterpretq_s16_u16(vsubl_u8(s, r));
// Process a block of width 16 one row at a time. staticINLINEvoid variance_16xh_neon(const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, int h, uint32_t *sse, int *sum) {
int16x8_t sum_s16[2] = { vdupq_n_s16(0), vdupq_n_s16(0) };
int32x4_t sse_s32[2] = { vdupq_n_s32(0), vdupq_n_s32(0) }; int i = h;
// Number of rows we can process before 'sum_s16' accumulators overflow: // 32767 / 255 ~= 128, so 128 16-wide rows.
assert(h <= 128);
do { const uint8x16_t s = vld1q_u8(src_ptr); const uint8x16_t r = vld1q_u8(ref_ptr);
// Process a block of any size where the width is divisible by 16. staticINLINEvoid variance_large_neon(const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, int w, int h, int h_limit, unsignedint *sse, int *sum) {
int32x4_t sum_s32 = vdupq_n_s32(0);
int32x4_t sse_s32[2] = { vdupq_n_s32(0), vdupq_n_s32(0) };
// 'h_limit' is the number of 'w'-width rows we can process before our 16-bit // accumulator overflows. After hitting this limit we accumulate into 32-bit // elements. int h_tmp = h > h_limit ? h_limit : h;
int i = 0; do {
int16x8_t sum_s16[2] = { vdupq_n_s16(0), vdupq_n_s16(0) }; do { int j = 0; do { const uint8x16_t s = vld1q_u8(src_ptr + j); const uint8x16_t r = vld1q_u8(ref_ptr + j);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.