aboutsummaryrefslogtreecommitdiff
path: root/vpx_dsp/x86/highbd_quantize_intrin_avx2.c
diff options
context:
space:
mode:
Diffstat (limited to 'vpx_dsp/x86/highbd_quantize_intrin_avx2.c')
-rw-r--r--vpx_dsp/x86/highbd_quantize_intrin_avx2.c44
1 files changed, 20 insertions, 24 deletions
diff --git a/vpx_dsp/x86/highbd_quantize_intrin_avx2.c b/vpx_dsp/x86/highbd_quantize_intrin_avx2.c
index 8edddd637..35ca55404 100644
--- a/vpx_dsp/x86/highbd_quantize_intrin_avx2.c
+++ b/vpx_dsp/x86/highbd_quantize_intrin_avx2.c
@@ -11,6 +11,8 @@
#include <immintrin.h>
#include "./vpx_dsp_rtcd.h"
+#include "vp9/common/vp9_scan.h"
+#include "vp9/encoder/vp9_block.h"
static VPX_FORCE_INLINE void init_one_qp(const __m128i *p, __m256i *qp) {
const __m128i sign = _mm_srai_epi16(*p, 15);
@@ -26,17 +28,15 @@ static VPX_FORCE_INLINE void update_qp(__m256i *qp) {
}
}
-static VPX_FORCE_INLINE void init_qp(const int16_t *zbin_ptr,
- const int16_t *round_ptr,
- const int16_t *quant_ptr,
- const int16_t *dequant_ptr,
- const int16_t *quant_shift_ptr,
- __m256i *qp, int log_scale) {
- const __m128i zbin = _mm_loadu_si128((const __m128i *)zbin_ptr);
- const __m128i round = _mm_loadu_si128((const __m128i *)round_ptr);
- const __m128i quant = _mm_loadu_si128((const __m128i *)quant_ptr);
+static VPX_FORCE_INLINE void init_qp(
+ const struct macroblock_plane *const mb_plane, const int16_t *dequant_ptr,
+ __m256i *qp, int log_scale) {
+ const __m128i zbin = _mm_loadu_si128((const __m128i *)mb_plane->zbin);
+ const __m128i round = _mm_loadu_si128((const __m128i *)mb_plane->round);
+ const __m128i quant = _mm_loadu_si128((const __m128i *)mb_plane->quant);
const __m128i dequant = _mm_loadu_si128((const __m128i *)dequant_ptr);
- const __m128i quant_shift = _mm_loadu_si128((const __m128i *)quant_shift_ptr);
+ const __m128i quant_shift =
+ _mm_loadu_si128((const __m128i *)mb_plane->quant_shift);
init_one_qp(&zbin, &qp[0]);
init_one_qp(&round, &qp[1]);
init_one_qp(&quant, &qp[2]);
@@ -134,19 +134,16 @@ static VPX_FORCE_INLINE void quantize(const __m256i *qp,
}
void vpx_highbd_quantize_b_avx2(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 int step = 8;
__m256i eob = _mm256_setzero_si256();
__m256i qp[5];
- (void)scan;
+ const int16_t *iscan = scan_order->iscan;
- init_qp(zbin_ptr, round_ptr, quant_ptr, dequant_ptr, quant_shift_ptr, qp, 0);
+ init_qp(mb_plane, dequant_ptr, qp, 0);
quantize(qp, coeff_ptr, iscan, qcoeff_ptr, dqcoeff_ptr, &eob);
@@ -222,17 +219,16 @@ static VPX_FORCE_INLINE void quantize_b_32x32(
}
void vpx_highbd_quantize_b_32x32_avx2(
- 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 unsigned int step = 8;
+ intptr_t n_coeffs = 32 * 32;
+ const int16_t *iscan = scan_order->iscan;
__m256i eob = _mm256_setzero_si256();
__m256i qp[5];
- (void)scan;
- init_qp(zbin_ptr, round_ptr, quant_ptr, dequant_ptr, quant_shift_ptr, qp, 1);
+ init_qp(mb_plane, dequant_ptr, qp, 1);
quantize_b_32x32(qp, coeff_ptr, iscan, qcoeff_ptr, dqcoeff_ptr, &eob);