aboutsummaryrefslogtreecommitdiff
path: root/vpx_dsp/arm/highbd_quantize_neon.c
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2024-01-22 21:37:00 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2024-01-22 21:37:00 +0000
commitb469e8f789e4d59075c477caaa87154e53e992b4 (patch)
tree7f7370f69833b55ad06e2247f03f4b4c59393823 /vpx_dsp/arm/highbd_quantize_neon.c
parent19c147b0cd203a31ff997509e87d343c92e26412 (diff)
parentfbd2ac50e2d177e59fb35418144f6bc3676fb62c (diff)
downloadlibvpx-b469e8f789e4d59075c477caaa87154e53e992b4.tar.gz
Merge "Merge commit '602e2e8979d111b02c959470da5322797dd96a19' into aosp/main" into main
Diffstat (limited to 'vpx_dsp/arm/highbd_quantize_neon.c')
-rw-r--r--vpx_dsp/arm/highbd_quantize_neon.c53
1 files changed, 23 insertions, 30 deletions
diff --git a/vpx_dsp/arm/highbd_quantize_neon.c b/vpx_dsp/arm/highbd_quantize_neon.c
index b9f72a94c..c2ad34a69 100644
--- a/vpx_dsp/arm/highbd_quantize_neon.c
+++ b/vpx_dsp/arm/highbd_quantize_neon.c
@@ -13,6 +13,8 @@
#include "./vpx_config.h"
#include "./vpx_dsp_rtcd.h"
#include "vpx_dsp/arm/mem_neon.h"
+#include "vp9/common/vp9_scan.h"
+#include "vp9/encoder/vp9_block.h"
static VPX_FORCE_INLINE void highbd_calculate_dqcoeff_and_store(
const int32x4_t dqcoeff_0, const int32x4_t dqcoeff_1,
@@ -94,26 +96,25 @@ highbd_quantize_b_neon(const tran_low_t *coeff_ptr, tran_low_t *qcoeff_ptr,
}
void vpx_highbd_quantize_b_neon(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
- const int16_t *zbin_ptr,
- const int16_t *round_ptr,
- const int16_t *quant_ptr,
- const int16_t *quant_shift_ptr,
+ const struct macroblock_plane *const mb_plane,
tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr,
const int16_t *dequant_ptr, uint16_t *eob_ptr,
- const int16_t *scan, const int16_t *iscan) {
+ const struct ScanOrder *const scan_order) {
const int16x8_t neg_one = vdupq_n_s16(-1);
uint16x8_t eob_max;
+ const int16_t *iscan = scan_order->iscan;
// Only the first element of each vector is DC.
// High half has identical elements, but we can reconstruct it from the low
// half by duplicating the 2nd element. So we only need to pass a 4x32-bit
// vector
- int32x4_t zbin = vmovl_s16(vld1_s16(zbin_ptr));
- int32x4_t round = vmovl_s16(vld1_s16(round_ptr));
+ int32x4_t zbin = vmovl_s16(vld1_s16(mb_plane->zbin));
+ int32x4_t round = vmovl_s16(vld1_s16(mb_plane->round));
// Extend the quant, quant_shift vectors to ones of 32-bit elements
// scale to high-half, so we can use vqdmulhq_s32
- int32x4_t quant = vshlq_n_s32(vmovl_s16(vld1_s16(quant_ptr)), 15);
- int32x4_t quant_shift = vshlq_n_s32(vmovl_s16(vld1_s16(quant_shift_ptr)), 15);
+ int32x4_t quant = vshlq_n_s32(vmovl_s16(vld1_s16(mb_plane->quant)), 15);
+ int32x4_t quant_shift =
+ vshlq_n_s32(vmovl_s16(vld1_s16(mb_plane->quant_shift)), 15);
int32x4_t dequant = vmovl_s16(vld1_s16(dequant_ptr));
// Process first 8 values which include a dc component.
@@ -164,7 +165,7 @@ void vpx_highbd_quantize_b_neon(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
} while (n_coeffs > 0);
}
-#ifdef __aarch64__
+#if VPX_ARCH_AARCH64
*eob_ptr = vmaxvq_u16(eob_max);
#else
{
@@ -174,11 +175,7 @@ void vpx_highbd_quantize_b_neon(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
const uint16x4_t eob_max_2 = vpmax_u16(eob_max_1, eob_max_1);
vst1_lane_u16(eob_ptr, eob_max_2, 0);
}
-#endif // __aarch64__
- // Need these here, else the compiler complains about mixing declarations and
- // code in C90
- (void)n_coeffs;
- (void)scan;
+#endif // VPX_ARCH_AARCH64
}
static VPX_FORCE_INLINE int32x4_t extract_sign_bit(int32x4_t a) {
@@ -224,25 +221,25 @@ static VPX_FORCE_INLINE int16x8_t highbd_quantize_b_32x32_neon(
}
void vpx_highbd_quantize_b_32x32_neon(
- const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr,
- const int16_t *round_ptr, const int16_t *quant_ptr,
- const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr,
- tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr,
- const int16_t *scan, const int16_t *iscan) {
+ const tran_low_t *coeff_ptr, const struct macroblock_plane *const mb_plane,
+ tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr,
+ uint16_t *eob_ptr, const struct ScanOrder *const scan_order) {
const int16x8_t neg_one = vdupq_n_s16(-1);
uint16x8_t eob_max;
int i;
+ const int16_t *iscan = scan_order->iscan;
// Only the first element of each vector is DC.
// High half has identical elements, but we can reconstruct it from the low
// half by duplicating the 2nd element. So we only need to pass a 4x32-bit
// vector
- int32x4_t zbin = vrshrq_n_s32(vmovl_s16(vld1_s16(zbin_ptr)), 1);
- int32x4_t round = vrshrq_n_s32(vmovl_s16(vld1_s16(round_ptr)), 1);
+ int32x4_t zbin = vrshrq_n_s32(vmovl_s16(vld1_s16(mb_plane->zbin)), 1);
+ int32x4_t round = vrshrq_n_s32(vmovl_s16(vld1_s16(mb_plane->round)), 1);
// Extend the quant, quant_shift vectors to ones of 32-bit elements
// scale to high-half, so we can use vqdmulhq_s32
- int32x4_t quant = vshlq_n_s32(vmovl_s16(vld1_s16(quant_ptr)), 15);
- int32x4_t quant_shift = vshlq_n_s32(vmovl_s16(vld1_s16(quant_shift_ptr)), 16);
+ int32x4_t quant = vshlq_n_s32(vmovl_s16(vld1_s16(mb_plane->quant)), 15);
+ int32x4_t quant_shift =
+ vshlq_n_s32(vmovl_s16(vld1_s16(mb_plane->quant_shift)), 16);
int32x4_t dequant = vmovl_s16(vld1_s16(dequant_ptr));
// Process first 8 values which include a dc component.
@@ -289,7 +286,7 @@ void vpx_highbd_quantize_b_32x32_neon(
}
}
-#ifdef __aarch64__
+#if VPX_ARCH_AARCH64
*eob_ptr = vmaxvq_u16(eob_max);
#else
{
@@ -299,9 +296,5 @@ void vpx_highbd_quantize_b_32x32_neon(
const uint16x4_t eob_max_2 = vpmax_u16(eob_max_1, eob_max_1);
vst1_lane_u16(eob_ptr, eob_max_2, 0);
}
-#endif // __aarch64__
- // Need these here, else the compiler complains about mixing declarations and
- // code in C90
- (void)n_coeffs;
- (void)scan;
+#endif // VPX_ARCH_AARCH64
}