staticinline uint32_t highbd_sad8xh_neon(const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, int h) { const uint16_t *src16_ptr = CONVERT_TO_SHORTPTR(src_ptr); const uint16_t *ref16_ptr = CONVERT_TO_SHORTPTR(ref_ptr);
// 'h_overflow' is the number of 8-wide rows we can process before 16-bit // accumulators overflow. After hitting this limit accumulate into 32-bit // elements. 65535 / 4095 ~= 16, so 16 8-wide rows. constint h_overflow = 16; // If block height 'h' is smaller than this limit, use 'h' instead. constint h_limit = h < h_overflow ? h : h_overflow;
assert(h % h_limit == 0);
uint32x4_t sum_u32 = vdupq_n_u32(0);
do {
uint16x8_t sum_u16 = vdupq_n_u16(0);
int i = h_limit; do {
uint16x8_t s0 = vld1q_u16(src16_ptr);
uint16x8_t r0 = vld1q_u16(ref16_ptr);
sum_u16 = vabaq_u16(sum_u16, s0, r0);
staticinline uint32_t highbd_sad16xh_neon(const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, int h) { const uint16_t *src16_ptr = CONVERT_TO_SHORTPTR(src_ptr); const uint16_t *ref16_ptr = CONVERT_TO_SHORTPTR(ref_ptr);
// 'h_overflow' is the number of 16-wide rows we can process before 16-bit // accumulators overflow. After hitting this limit accumulate into 32-bit // elements. 65535 / 4095 ~= 16, so 16 16-wide rows using two accumulators. constint h_overflow = 16; // If block height 'h' is smaller than this limit, use 'h' instead. constint h_limit = h < h_overflow ? h : h_overflow;
assert(h % h_limit == 0);
uint32x4_t sum_u32 = vdupq_n_u32(0);
do {
uint16x8_t sum_u16[2] = { vdupq_n_u16(0), vdupq_n_u16(0) }; int i = h_limit; do {
uint16x8_t s0 = vld1q_u16(src16_ptr);
uint16x8_t r0 = vld1q_u16(ref16_ptr);
sum_u16[0] = vabaq_u16(sum_u16[0], s0, r0);
h -= h_limit;
} while (h != 0); return horizontal_add_u32x4(sum_u32);
}
staticinline uint32_t highbd_sad32xh_neon(const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, int h) { // 'h_overflow' is the number of 32-wide rows we can process before 16-bit // accumulators overflow. After hitting this limit accumulate into 32-bit // elements. 65535 / 4095 ~= 16, so 16 32-wide rows using four accumulators. constint h_overflow = 16; return highbd_sadwxh_neon(src_ptr, src_stride, ref_ptr, ref_stride, 32, h,
h_overflow);
}
staticinline uint32_t highbd_sad64xh_neon(const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, int h) { // 'h_overflow' is the number of 64-wide rows we can process before 16-bit // accumulators overflow. After hitting this limit accumulate into 32-bit // elements. 65535 / 4095 ~= 16, so 8 64-wide rows using four accumulators. constint h_overflow = 8; return highbd_sadwxh_neon(src_ptr, src_stride, ref_ptr, ref_stride, 64, h,
h_overflow);
}
staticinline uint32_t highbd_sad128xh_neon(const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, int h) { // 'h_overflow' is the number of 128-wide rows we can process before 16-bit // accumulators overflow. After hitting this limit accumulate into 32-bit // elements. 65535 / 4095 ~= 16, so 4 128-wide rows using four accumulators. constint h_overflow = 4; return highbd_sadwxh_neon(src_ptr, src_stride, ref_ptr, ref_stride, 128, h,
h_overflow);
}
// 'h_overflow' is the number of 8-wide rows we can process before 16-bit // accumulators overflow. After hitting this limit accumulate into 32-bit // elements. 65535 / 4095 ~= 16, so 16 8-wide rows. constint h_overflow = 16; // If block height 'h' is smaller than this limit, use 'h' instead. constint h_limit = h < h_overflow ? h : h_overflow;
assert(h % h_limit == 0);
uint32x4_t sum_u32 = vdupq_n_u32(0);
do {
uint16x8_t sum_u16 = vdupq_n_u16(0);
int i = h_limit; do {
uint16x8_t s = vld1q_u16(src16_ptr);
uint16x8_t r = vld1q_u16(ref16_ptr);
uint16x8_t p = vld1q_u16(pred16_ptr);
// 'h_overflow' is the number of 16-wide rows we can process before 16-bit // accumulators overflow. After hitting this limit accumulate into 32-bit // elements. 65535 / 4095 ~= 16, so 16 16-wide rows using two accumulators. constint h_overflow = 16; // If block height 'h' is smaller than this limit, use 'h' instead. constint h_limit = h < h_overflow ? h : h_overflow;
assert(h % h_limit == 0);
uint32x4_t sum_u32 = vdupq_n_u32(0);
do {
uint16x8_t sum_u16[2] = { vdupq_n_u16(0), vdupq_n_u16(0) };
int i = h_limit; do {
uint16x8_t s0 = vld1q_u16(src16_ptr);
uint16x8_t r0 = vld1q_u16(ref16_ptr);
uint16x8_t p0 = vld1q_u16(pred16_ptr);
staticinline uint32_t highbd_sad32xh_avg_neon(const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, int h, const uint8_t *second_pred) { // 'h_overflow' is the number of 32-wide rows we can process before 16-bit // accumulators overflow. After hitting this limit accumulate into 32-bit // elements. 65535 / 4095 ~= 16, so 16 32-wide rows using four accumulators. constint h_overflow = 16; return highbd_sadwxh_avg_neon(src_ptr, src_stride, ref_ptr, ref_stride,
second_pred, 32, h, h_overflow);
}
staticinline uint32_t highbd_sad64xh_avg_neon(const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, int h, const uint8_t *second_pred) { // 'h_overflow' is the number of 64-wide rows we can process before 16-bit // accumulators overflow. After hitting this limit accumulate into 32-bit // elements. 65535 / 4095 ~= 16, so 8 64-wide rows using four accumulators. constint h_overflow = 8; return highbd_sadwxh_avg_neon(src_ptr, src_stride, ref_ptr, ref_stride,
second_pred, 64, h, h_overflow);
}
staticinline uint32_t highbd_sad128xh_avg_neon(const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, int h, const uint8_t *second_pred) { // 'h_overflow' is the number of 128-wide rows we can process before 16-bit // accumulators overflow. After hitting this limit accumulate into 32-bit // elements. 65535 / 4095 ~= 16, so 4 128-wide rows using four accumulators. constint h_overflow = 4; return highbd_sadwxh_avg_neon(src_ptr, src_stride, ref_ptr, ref_stride,
second_pred, 128, h, h_overflow);
}
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.