mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-14 21:38:34 +00:00
[libvpx] Update to v1.12.0
This commit is contained in:
1 parent
287a71dc66
commit
b5046d2a76
572 files changed
+52900
-29493
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -21,6 +21,9 @@
|
||||
|
||||
// Compute the sum of all pixel differences of this MB.
|
||||
static INLINE int horizontal_add_s8x16(const int8x16_t v_sum_diff_total) {
|
||||
#if defined(__aarch64__)
|
||||
return vaddlvq_s8(v_sum_diff_total);
|
||||
#else
|
||||
const int16x8_t fe_dc_ba_98_76_54_32_10 = vpaddlq_s8(v_sum_diff_total);
|
||||
const int32x4_t fedc_ba98_7654_3210 = vpaddlq_s16(fe_dc_ba_98_76_54_32_10);
|
||||
const int64x2_t fedcba98_76543210 = vpaddlq_s32(fedc_ba98_7654_3210);
|
||||
@@ -28,6 +31,7 @@ static INLINE int horizontal_add_s8x16(const int8x16_t v_sum_diff_total) {
|
||||
vget_low_s64(fedcba98_76543210));
|
||||
const int sum_diff = vget_lane_s32(vreinterpret_s32_s64(x), 0);
|
||||
return sum_diff;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Denoise a 16x1 vector.
|
||||
|
||||
@@ -26,12 +26,27 @@
|
||||
#include "vpx_dsp/arm/mem_neon.h"
|
||||
#include "vpx_dsp/vpx_dsp_common.h"
|
||||
|
||||
static INLINE void calculate_dqcoeff_and_store(const int16x8_t qcoeff,
|
||||
const int16x8_t dequant,
|
||||
tran_low_t *dqcoeff) {
|
||||
const int32x4_t dqcoeff_0 =
|
||||
vmull_s16(vget_low_s16(qcoeff), vget_low_s16(dequant));
|
||||
const int32x4_t dqcoeff_1 =
|
||||
vmull_s16(vget_high_s16(qcoeff), vget_high_s16(dequant));
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
vst1q_s32(dqcoeff, dqcoeff_0);
|
||||
vst1q_s32(dqcoeff + 4, dqcoeff_1);
|
||||
#else
|
||||
vst1q_s16(dqcoeff, vcombine_s16(vmovn_s32(dqcoeff_0), vmovn_s32(dqcoeff_1)));
|
||||
#endif // CONFIG_VP9_HIGHBITDEPTH
|
||||
}
|
||||
|
||||
void vp9_quantize_fp_neon(const tran_low_t *coeff_ptr, intptr_t count,
|
||||
int skip_block, const int16_t *round_ptr,
|
||||
const int16_t *quant_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 int16_t *round_ptr, const int16_t *quant_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) {
|
||||
// Quantization pass: All coefficients with index >= zero_flag are
|
||||
// skippable. Note: zero_flag can be zero.
|
||||
int i;
|
||||
@@ -43,8 +58,6 @@ void vp9_quantize_fp_neon(const tran_low_t *coeff_ptr, intptr_t count,
|
||||
int16x8_t v_dequant = vmovq_n_s16(dequant_ptr[1]);
|
||||
|
||||
(void)scan;
|
||||
(void)skip_block;
|
||||
assert(!skip_block);
|
||||
|
||||
// adjust for dc
|
||||
v_round = vsetq_lane_s16(round_ptr[0], v_round, 0);
|
||||
@@ -55,7 +68,8 @@ void vp9_quantize_fp_neon(const tran_low_t *coeff_ptr, intptr_t count,
|
||||
const int16x8_t v_iscan = vld1q_s16(&iscan[0]);
|
||||
const int16x8_t v_coeff = load_tran_low_to_s16q(coeff_ptr);
|
||||
const int16x8_t v_coeff_sign = vshrq_n_s16(v_coeff, 15);
|
||||
const int16x8_t v_tmp = vabaq_s16(v_round, v_coeff, v_zero);
|
||||
const int16x8_t v_abs = vabsq_s16(v_coeff);
|
||||
const int16x8_t v_tmp = vqaddq_s16(v_abs, v_round);
|
||||
const int32x4_t v_tmp_lo =
|
||||
vmull_s16(vget_low_s16(v_tmp), vget_low_s16(v_quant));
|
||||
const int32x4_t v_tmp_hi =
|
||||
@@ -67,10 +81,9 @@ void vp9_quantize_fp_neon(const tran_low_t *coeff_ptr, intptr_t count,
|
||||
const int16x8_t v_nz_iscan = vbslq_s16(v_nz_mask, v_zero, v_iscan_plus1);
|
||||
const int16x8_t v_qcoeff_a = veorq_s16(v_tmp2, v_coeff_sign);
|
||||
const int16x8_t v_qcoeff = vsubq_s16(v_qcoeff_a, v_coeff_sign);
|
||||
const int16x8_t v_dqcoeff = vmulq_s16(v_qcoeff, v_dequant);
|
||||
calculate_dqcoeff_and_store(v_qcoeff, v_dequant, dqcoeff_ptr);
|
||||
v_eobmax_76543210 = vmaxq_s16(v_eobmax_76543210, v_nz_iscan);
|
||||
store_s16q_to_tran_low(qcoeff_ptr, v_qcoeff);
|
||||
store_s16q_to_tran_low(dqcoeff_ptr, v_dqcoeff);
|
||||
v_round = vmovq_n_s16(round_ptr[1]);
|
||||
v_quant = vmovq_n_s16(quant_ptr[1]);
|
||||
v_dequant = vmovq_n_s16(dequant_ptr[1]);
|
||||
@@ -80,7 +93,8 @@ void vp9_quantize_fp_neon(const tran_low_t *coeff_ptr, intptr_t count,
|
||||
const int16x8_t v_iscan = vld1q_s16(&iscan[i]);
|
||||
const int16x8_t v_coeff = load_tran_low_to_s16q(coeff_ptr + i);
|
||||
const int16x8_t v_coeff_sign = vshrq_n_s16(v_coeff, 15);
|
||||
const int16x8_t v_tmp = vabaq_s16(v_round, v_coeff, v_zero);
|
||||
const int16x8_t v_abs = vabsq_s16(v_coeff);
|
||||
const int16x8_t v_tmp = vqaddq_s16(v_abs, v_round);
|
||||
const int32x4_t v_tmp_lo =
|
||||
vmull_s16(vget_low_s16(v_tmp), vget_low_s16(v_quant));
|
||||
const int32x4_t v_tmp_hi =
|
||||
@@ -92,10 +106,9 @@ void vp9_quantize_fp_neon(const tran_low_t *coeff_ptr, intptr_t count,
|
||||
const int16x8_t v_nz_iscan = vbslq_s16(v_nz_mask, v_zero, v_iscan_plus1);
|
||||
const int16x8_t v_qcoeff_a = veorq_s16(v_tmp2, v_coeff_sign);
|
||||
const int16x8_t v_qcoeff = vsubq_s16(v_qcoeff_a, v_coeff_sign);
|
||||
const int16x8_t v_dqcoeff = vmulq_s16(v_qcoeff, v_dequant);
|
||||
calculate_dqcoeff_and_store(v_qcoeff, v_dequant, dqcoeff_ptr + i);
|
||||
v_eobmax_76543210 = vmaxq_s16(v_eobmax_76543210, v_nz_iscan);
|
||||
store_s16q_to_tran_low(qcoeff_ptr + i, v_qcoeff);
|
||||
store_s16q_to_tran_low(dqcoeff_ptr + i, v_dqcoeff);
|
||||
}
|
||||
#ifdef __aarch64__
|
||||
*eob_ptr = vmaxvq_s16(v_eobmax_76543210);
|
||||
@@ -122,7 +135,7 @@ static INLINE int32x4_t extract_sign_bit(int32x4_t a) {
|
||||
}
|
||||
|
||||
void vp9_quantize_fp_32x32_neon(const tran_low_t *coeff_ptr, intptr_t count,
|
||||
int skip_block, const int16_t *round_ptr,
|
||||
const int16_t *round_ptr,
|
||||
const int16_t *quant_ptr,
|
||||
tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr,
|
||||
const int16_t *dequant_ptr, uint16_t *eob_ptr,
|
||||
@@ -146,14 +159,11 @@ void vp9_quantize_fp_32x32_neon(const tran_low_t *coeff_ptr, intptr_t count,
|
||||
const int16x8_t dequant_mask =
|
||||
vreinterpretq_s16_u16(vcgeq_s16(coeff_abs, dequant_thresh));
|
||||
|
||||
int16x8_t qcoeff = vaddq_s16(coeff_abs, round);
|
||||
int16x8_t qcoeff = vqaddq_s16(coeff_abs, round);
|
||||
int32x4_t dqcoeff_0, dqcoeff_1;
|
||||
int16x8_t dqcoeff;
|
||||
uint16x8_t eob_max;
|
||||
(void)scan;
|
||||
(void)count;
|
||||
(void)skip_block;
|
||||
assert(!skip_block);
|
||||
|
||||
// coeff * quant_ptr[]) >> 15
|
||||
qcoeff = vqdmulhq_s16(qcoeff, quant);
|
||||
@@ -170,13 +180,17 @@ void vp9_quantize_fp_32x32_neon(const tran_low_t *coeff_ptr, intptr_t count,
|
||||
// Add 1 if negative to round towards zero because the C uses division.
|
||||
dqcoeff_0 = vaddq_s32(dqcoeff_0, extract_sign_bit(dqcoeff_0));
|
||||
dqcoeff_1 = vaddq_s32(dqcoeff_1, extract_sign_bit(dqcoeff_1));
|
||||
|
||||
dqcoeff = vcombine_s16(vshrn_n_s32(dqcoeff_0, 1), vshrn_n_s32(dqcoeff_1, 1));
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
vst1q_s32(dqcoeff_ptr, vshrq_n_s32(dqcoeff_0, 1));
|
||||
vst1q_s32(dqcoeff_ptr + 4, vshrq_n_s32(dqcoeff_1, 1));
|
||||
#else
|
||||
store_s16q_to_tran_low(dqcoeff_ptr, vcombine_s16(vshrn_n_s32(dqcoeff_0, 1),
|
||||
vshrn_n_s32(dqcoeff_1, 1)));
|
||||
#endif
|
||||
|
||||
eob_max = vandq_u16(vtstq_s16(qcoeff, neg_one), v_iscan);
|
||||
|
||||
store_s16q_to_tran_low(qcoeff_ptr, qcoeff);
|
||||
store_s16q_to_tran_low(dqcoeff_ptr, dqcoeff);
|
||||
|
||||
iscan += 8;
|
||||
coeff_ptr += 8;
|
||||
@@ -200,9 +214,8 @@ void vp9_quantize_fp_32x32_neon(const tran_low_t *coeff_ptr, intptr_t count,
|
||||
const int16x8_t dequant_mask =
|
||||
vreinterpretq_s16_u16(vcgeq_s16(coeff_abs, dequant_thresh));
|
||||
|
||||
int16x8_t qcoeff = vaddq_s16(coeff_abs, round);
|
||||
int16x8_t qcoeff = vqaddq_s16(coeff_abs, round);
|
||||
int32x4_t dqcoeff_0, dqcoeff_1;
|
||||
int16x8_t dqcoeff;
|
||||
|
||||
qcoeff = vqdmulhq_s16(qcoeff, quant);
|
||||
qcoeff = veorq_s16(qcoeff, coeff_sign);
|
||||
@@ -215,14 +228,19 @@ void vp9_quantize_fp_32x32_neon(const tran_low_t *coeff_ptr, intptr_t count,
|
||||
dqcoeff_0 = vaddq_s32(dqcoeff_0, extract_sign_bit(dqcoeff_0));
|
||||
dqcoeff_1 = vaddq_s32(dqcoeff_1, extract_sign_bit(dqcoeff_1));
|
||||
|
||||
dqcoeff =
|
||||
vcombine_s16(vshrn_n_s32(dqcoeff_0, 1), vshrn_n_s32(dqcoeff_1, 1));
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
vst1q_s32(dqcoeff_ptr, vshrq_n_s32(dqcoeff_0, 1));
|
||||
vst1q_s32(dqcoeff_ptr + 4, vshrq_n_s32(dqcoeff_1, 1));
|
||||
#else
|
||||
store_s16q_to_tran_low(
|
||||
dqcoeff_ptr,
|
||||
vcombine_s16(vshrn_n_s32(dqcoeff_0, 1), vshrn_n_s32(dqcoeff_1, 1)));
|
||||
#endif
|
||||
|
||||
eob_max =
|
||||
vmaxq_u16(eob_max, vandq_u16(vtstq_s16(qcoeff, neg_one), v_iscan));
|
||||
|
||||
store_s16q_to_tran_low(qcoeff_ptr, qcoeff);
|
||||
store_s16q_to_tran_low(dqcoeff_ptr, dqcoeff);
|
||||
|
||||
iscan += 8;
|
||||
coeff_ptr += 8;
|
||||
|
||||
Reference in new issue
Block a user