/* * Copyright (c) 2023 The WebM project authors. All rights reserved. * Copyright (c) 2022, Alliance for Open Media. All rights reserved. * * This source code is subject to the terms of the BSD 2 Clause License and * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License * was not distributed with this source code in the LICENSE file, you can * obtain it at www.aomedia.org/license/software. If the Alliance for Open * Media Patent License 1.0 was not distributed with this source code in the * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
// Process a block of width 4 two rows at a time. staticinlinevoid highbd_variance_4xh_neon(const uint16_t *src_ptr, int src_stride, const uint16_t *ref_ptr, int ref_stride, int h,
uint64_t *sse, int64_t *sum) {
int16x8_t sum_s16 = vdupq_n_s16(0);
int32x4_t sse_s32 = vdupq_n_s32(0);
int i = h; do { const uint16x8_t s = load_unaligned_u16_4x2(src_ptr, src_stride); const uint16x8_t r = load_unaligned_u16_4x2(ref_ptr, ref_stride);
// For 8-bit and 10-bit data, since we're using two int32x4 accumulators, all // block sizes can be processed in 32-bit elements (1023*1023*128*32 = // 4286582784 for a 128x128 block). staticinlinevoid highbd_variance_large_neon(const uint16_t *src_ptr, int src_stride, const uint16_t *ref_ptr, int ref_stride, int w, int h,
uint64_t *sse, int64_t *sum) {
int32x4_t sum_s32 = vdupq_n_s32(0);
int32x4_t sse_s32[2] = { vdupq_n_s32(0), vdupq_n_s32(0) };
int i = h; do { int j = 0; do { const uint16x8_t s = vld1q_u16(src_ptr + j); const uint16x8_t r = vld1q_u16(ref_ptr + j);
staticinlinevoid highbd_variance_8xh_neon(const uint16_t *src, int src_stride, const uint16_t *ref, int ref_stride, int h, uint64_t *sse,
int64_t *sum) {
highbd_variance_large_neon(src, src_stride, ref, ref_stride, 8, h, sse, sum);
}
staticinlinevoid highbd_variance_16xh_neon(const uint16_t *src, int src_stride, const uint16_t *ref, int ref_stride, int h,
uint64_t *sse, int64_t *sum) {
highbd_variance_large_neon(src, src_stride, ref, ref_stride, 16, h, sse, sum);
}
staticinlinevoid highbd_variance_32xh_neon(const uint16_t *src, int src_stride, const uint16_t *ref, int ref_stride, int h,
uint64_t *sse, int64_t *sum) {
highbd_variance_large_neon(src, src_stride, ref, ref_stride, 32, h, sse, sum);
}
staticinlinevoid highbd_variance_64xh_neon(const uint16_t *src, int src_stride, const uint16_t *ref, int ref_stride, int h,
uint64_t *sse, int64_t *sum) {
highbd_variance_large_neon(src, src_stride, ref, ref_stride, 64, h, sse, sum);
}
staticinlinevoid highbd_variance_128xh_neon(const uint16_t *src, int src_stride, const uint16_t *ref, int ref_stride, int h,
uint64_t *sse, int64_t *sum) {
highbd_variance_large_neon(src, src_stride, ref, ref_stride, 128, h, sse,
sum);
}
// For 12-bit data, we can only accumulate up to 128 elements in the sum of // squares (4095*4095*128 = 2146435200), and because we're using two int32x4 // accumulators, we can only process up to 32 32-element rows (32*32/8 = 128) // or 16 64-element rows before we have to accumulate into 64-bit elements. // Therefore blocks of size 32x64, 64x32, 64x64, 64x128, 128x64, 128x128 are // processed in a different helper function.
// Process a block of any size where the width is divisible by 8, with // accumulation into 64-bit elements. staticinlinevoid highbd_variance_xlarge_neon( const uint16_t *src_ptr, int src_stride, const uint16_t *ref_ptr, int ref_stride, int w, int h, int h_limit, uint64_t *sse, int64_t *sum) {
int32x4_t sum_s32 = vdupq_n_s32(0);
int64x2_t sse_s64 = vdupq_n_s64(0);
// 'h_limit' is the number of 'w'-width rows we can process before our 32-bit // accumulator overflows. After hitting this limit we accumulate into 64-bit // elements. int h_tmp = h > h_limit ? h_limit : h;
int i = 0; do {
int32x4_t sse_s32[2] = { vdupq_n_s32(0), vdupq_n_s32(0) }; do { int j = 0; do { const uint16x8_t s0 = vld1q_u16(src_ptr + j); const uint16x8_t r0 = vld1q_u16(ref_ptr + j);
uint64_t aom_mse_wxh_16bit_highbd_neon(uint16_t *dst, int dstride,
uint16_t *src, int sstride, int w, int h) {
assert((w == 8 || w == 4) && (h == 8 || h == 4));
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.