// '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);
staticinlinevoid highbd_sad16xhx4d_neon(const uint8_t *src_ptr, int src_stride, const uint8_t *const ref_ptr[4], int ref_stride, uint32_t res[4], int h) { // '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 8 16-wide rows. constint h_overflow = 8;
highbd_sadwxhx4d_neon(src_ptr, src_stride, ref_ptr, ref_stride, res, 16, h,
h_overflow);
}
staticinlinevoid highbd_sad32xhx4d_neon(const uint8_t *src_ptr, int src_stride, const uint8_t *const ref_ptr[4], int ref_stride, uint32_t res[4], 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 4 32-wide rows. constint h_overflow = 4;
highbd_sadwxhx4d_neon(src_ptr, src_stride, ref_ptr, ref_stride, res, 32, h,
h_overflow);
}
staticinlinevoid highbd_sad64xhx4d_neon(const uint8_t *src_ptr, int src_stride, const uint8_t *const ref_ptr[4], int ref_stride, uint32_t res[4], 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 2 64-wide rows. constint h_overflow = 2;
highbd_sadwxhx4d_neon(src_ptr, src_stride, ref_ptr, ref_stride, res, 64, h,
h_overflow);
}
staticinlinevoid highbd_sad128xhx4d_neon(const uint8_t *src_ptr, int src_stride, const uint8_t *const ref_ptr[4], int ref_stride, uint32_t res[4], 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 1 128-wide rows. constint h_overflow = 1;
highbd_sadwxhx4d_neon(src_ptr, src_stride, ref_ptr, ref_stride, res, 128, h,
h_overflow);
}
int i = 0; do {
uint16x4_t s = vld1_u16(src16_ptr + i * src_stride);
uint16x4_t r0 = vld1_u16(ref16_ptr0 + i * ref_stride);
uint16x4_t r1 = vld1_u16(ref16_ptr1 + i * ref_stride);
uint16x4_t r2 = vld1_u16(ref16_ptr2 + i * ref_stride);
// '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);
int h_tmp = h_limit; int i = 0; do {
uint16x8_t sum_u16[3] = { vdupq_n_u16(0), vdupq_n_u16(0), vdupq_n_u16(0) }; do {
uint16x8_t s0 = vld1q_u16(src16_ptr + i * src_stride);
sum_u16[0] =
vabaq_u16(sum_u16[0], s0, vld1q_u16(ref16_ptr0 + i * ref_stride));
sum_u16[1] =
vabaq_u16(sum_u16[1], s0, vld1q_u16(ref16_ptr1 + i * ref_stride));
sum_u16[2] =
vabaq_u16(sum_u16[2], s0, vld1q_u16(ref16_ptr2 + i * ref_stride));
} while (++i < h_tmp);
staticinlinevoid highbd_sad16xhx3d_neon(const uint8_t *src_ptr, int src_stride, const uint8_t *const ref_ptr[4], int ref_stride, uint32_t res[4], int h) { // '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 8 16-wide rows. constint h_overflow = 8;
highbd_sadwxhx3d_neon(src_ptr, src_stride, ref_ptr, ref_stride, res, 16, h,
h_overflow);
}
staticinlinevoid highbd_sad32xhx3d_neon(const uint8_t *src_ptr, int src_stride, const uint8_t *const ref_ptr[4], int ref_stride, uint32_t res[4], 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 4 32-wide rows. constint h_overflow = 4;
highbd_sadwxhx3d_neon(src_ptr, src_stride, ref_ptr, ref_stride, res, 32, h,
h_overflow);
}
staticinlinevoid highbd_sad64xhx3d_neon(const uint8_t *src_ptr, int src_stride, const uint8_t *const ref_ptr[4], int ref_stride, uint32_t res[4], 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 2 64-wide rows. constint h_overflow = 2;
highbd_sadwxhx3d_neon(src_ptr, src_stride, ref_ptr, ref_stride, res, 64, h,
h_overflow);
}
staticinlinevoid highbd_sad128xhx3d_neon(const uint8_t *src_ptr, int src_stride, const uint8_t *const ref_ptr[4], int ref_stride, uint32_t res[4], 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 1 128-wide rows. constint h_overflow = 1;
highbd_sadwxhx3d_neon(src_ptr, src_stride, ref_ptr, ref_stride, res, 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.