mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-17 14:58: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
@@ -197,28 +197,68 @@ static const int rd_boost_factor[16] = { 64, 32, 32, 32, 24, 16, 12, 12,
|
||||
static const int rd_frame_type_factor[FRAME_UPDATE_TYPES] = { 128, 144, 128,
|
||||
128, 144, 144 };
|
||||
|
||||
int vp9_compute_rd_mult_based_on_qindex(const VP9_COMP *cpi, int qindex) {
|
||||
// largest dc_quant is 21387, therefore rdmult should always fit in int32_t
|
||||
const int q = vp9_dc_quant(qindex, 0, cpi->common.bit_depth);
|
||||
uint32_t rdmult = q * q;
|
||||
// Configure Vizier RD parameters.
|
||||
// Later this function will use passed in command line values.
|
||||
void vp9_init_rd_parameters(VP9_COMP *cpi) {
|
||||
RD_CONTROL *const rdc = &cpi->rd_ctrl;
|
||||
|
||||
if (cpi->common.frame_type != KEY_FRAME) {
|
||||
if (qindex < 128)
|
||||
rdmult = rdmult * 4;
|
||||
else if (qindex < 190)
|
||||
rdmult = rdmult * 4 + rdmult / 2;
|
||||
else
|
||||
rdmult = rdmult * 3;
|
||||
// When |use_vizier_rc_params| is 1, we expect the rd parameters have been
|
||||
// initialized by the pass in values.
|
||||
// Be careful that parameters below are only initialized to 1, if we do not
|
||||
// pass values to them. It is desired to take care of each parameter when
|
||||
// using |use_vizier_rc_params|.
|
||||
if (cpi->twopass.use_vizier_rc_params) return;
|
||||
|
||||
// Make sure this function is floating point safe.
|
||||
vpx_clear_system_state();
|
||||
|
||||
rdc->rd_mult_inter_qp_fac = 1.0;
|
||||
rdc->rd_mult_arf_qp_fac = 1.0;
|
||||
rdc->rd_mult_key_qp_fac = 1.0;
|
||||
}
|
||||
|
||||
// Returns the default rd multiplier for inter frames for a given qindex.
|
||||
// The function here is a first pass estimate based on data from
|
||||
// a previous Vizer run
|
||||
static double def_inter_rd_multiplier(int qindex) {
|
||||
return 4.15 + (0.001 * (double)qindex);
|
||||
}
|
||||
|
||||
// Returns the default rd multiplier for ARF/Golden Frames for a given qindex.
|
||||
// The function here is a first pass estimate based on data from
|
||||
// a previous Vizer run
|
||||
static double def_arf_rd_multiplier(int qindex) {
|
||||
return 4.25 + (0.001 * (double)qindex);
|
||||
}
|
||||
|
||||
// Returns the default rd multiplier for key frames for a given qindex.
|
||||
// The function here is a first pass estimate based on data from
|
||||
// a previous Vizer run
|
||||
static double def_kf_rd_multiplier(int qindex) {
|
||||
return 4.35 + (0.001 * (double)qindex);
|
||||
}
|
||||
|
||||
int vp9_compute_rd_mult_based_on_qindex(const VP9_COMP *cpi, int qindex) {
|
||||
const RD_CONTROL *rdc = &cpi->rd_ctrl;
|
||||
const int q = vp9_dc_quant(qindex, 0, cpi->common.bit_depth);
|
||||
// largest dc_quant is 21387, therefore rdmult should fit in int32_t
|
||||
int rdmult = q * q;
|
||||
|
||||
// Make sure this function is floating point safe.
|
||||
vpx_clear_system_state();
|
||||
|
||||
if (cpi->common.frame_type == KEY_FRAME) {
|
||||
double def_rd_q_mult = def_kf_rd_multiplier(qindex);
|
||||
rdmult = (int)((double)rdmult * def_rd_q_mult * rdc->rd_mult_key_qp_fac);
|
||||
} else if (!cpi->rc.is_src_frame_alt_ref &&
|
||||
(cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame)) {
|
||||
double def_rd_q_mult = def_arf_rd_multiplier(qindex);
|
||||
rdmult = (int)((double)rdmult * def_rd_q_mult * rdc->rd_mult_arf_qp_fac);
|
||||
} else {
|
||||
if (qindex < 64)
|
||||
rdmult = rdmult * 4;
|
||||
else if (qindex <= 128)
|
||||
rdmult = rdmult * 3 + rdmult / 2;
|
||||
else if (qindex < 190)
|
||||
rdmult = rdmult * 4 + rdmult / 2;
|
||||
else
|
||||
rdmult = rdmult * 7 + rdmult / 2;
|
||||
double def_rd_q_mult = def_inter_rd_multiplier(qindex);
|
||||
rdmult = (int)((double)rdmult * def_rd_q_mult * rdc->rd_mult_inter_qp_fac);
|
||||
}
|
||||
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
switch (cpi->common.bit_depth) {
|
||||
case VPX_BITS_10: rdmult = ROUND_POWER_OF_TWO(rdmult, 4); break;
|
||||
@@ -589,7 +629,7 @@ void vp9_mv_pred(VP9_COMP *cpi, MACROBLOCK *x, uint8_t *ref_y_buffer,
|
||||
x->mbmi_ext->ref_mvs[ref_frame][1].as_int;
|
||||
|
||||
// Get the sad for each candidate reference mv.
|
||||
for (i = 0; i < num_mv_refs && i < MAX_MV_REF_CANDIDATES + 1; ++i) {
|
||||
for (i = 0; i < num_mv_refs; ++i) {
|
||||
const MV *this_mv = &pred_mv[i];
|
||||
int fp_row, fp_col;
|
||||
if (this_mv->row == INT16_MAX || this_mv->col == INT16_MAX) continue;
|
||||
|
||||
Reference in new issue
Block a user