#include <immintrin.h>
#include "config/av1_rtcd.h"
#include "aom/aom_integer.h"
#include "aom_dsp/aom_dsp_common.h"
static inline void write_zero(tran_low_t *qcoeff) { … }
static inline void init_one_qp(const __m128i *p, __m256i *qp) { … }
static inline void init_qp(const int16_t *round_ptr, const int16_t *quant_ptr,
const int16_t *dequant_ptr, int log_scale,
__m256i *thr, __m256i *qp) { … }
static inline void update_qp(__m256i *thr, __m256i *qp) { … }
static inline __m256i load_coefficients_avx2(const tran_low_t *coeff_ptr) { … }
static inline void store_coefficients_avx2(__m256i coeff_vals,
tran_low_t *coeff_ptr) { … }
static inline uint16_t quant_gather_eob(__m256i eob) { … }
static inline int16_t accumulate_eob256(__m256i eob256) { … }
static AOM_FORCE_INLINE void quantize_lp_16_first(
const int16_t *coeff_ptr, const int16_t *iscan_ptr, int16_t *qcoeff_ptr,
int16_t *dqcoeff_ptr, __m256i *round256, __m256i *quant256,
__m256i *dequant256, __m256i *eob) { … }
static AOM_FORCE_INLINE void quantize_lp_16(
const int16_t *coeff_ptr, intptr_t n_coeffs, const int16_t *iscan_ptr,
int16_t *qcoeff_ptr, int16_t *dqcoeff_ptr, __m256i *round256,
__m256i *quant256, __m256i *dequant256, __m256i *eob) { … }
void av1_quantize_lp_avx2(const int16_t *coeff_ptr, intptr_t n_coeffs,
const int16_t *round_ptr, const int16_t *quant_ptr,
int16_t *qcoeff_ptr, int16_t *dqcoeff_ptr,
const int16_t *dequant_ptr, uint16_t *eob_ptr,
const int16_t *scan, const int16_t *iscan) { … }
static AOM_FORCE_INLINE __m256i get_max_lane_eob(const int16_t *iscan,
__m256i v_eobmax,
__m256i v_mask) { … }
static AOM_FORCE_INLINE void quantize_fp_16(
const __m256i *thr, const __m256i *qp, const tran_low_t *coeff_ptr,
const int16_t *iscan_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr,
__m256i *eob) { … }
void av1_quantize_fp_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_ptr, const int16_t *iscan_ptr) { … }
static AOM_FORCE_INLINE void quantize_fp_32x32(
const __m256i *thr, const __m256i *qp, const tran_low_t *coeff_ptr,
const int16_t *iscan_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr,
__m256i *eob) { … }
void av1_quantize_fp_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_ptr, const int16_t *iscan_ptr) { … }
static inline void quantize_fp_64x64(const __m256i *thr, const __m256i *qp,
const tran_low_t *coeff_ptr,
const int16_t *iscan_ptr,
tran_low_t *qcoeff_ptr,
tran_low_t *dqcoeff_ptr, __m256i *eob) { … }
void av1_quantize_fp_64x64_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_ptr, const int16_t *iscan_ptr) { … }