Commit b3dab498 authored by Sarah Parker's avatar Sarah Parker
Browse files

Cosmetic fixes in global motion experiment

These are in response to post-commit suggestions made on
If429c93bb90b66fdff0edc07ecd9fc078077d303.

Change-Id: Id29afa158471bd6259bd07ac00812a50bfd0a709
parent 839b07fe
...@@ -4492,10 +4492,10 @@ static int input_fpmb_stats(FIRSTPASS_MB_STATS *firstpass_mb_stats, ...@@ -4492,10 +4492,10 @@ static int input_fpmb_stats(FIRSTPASS_MB_STATS *firstpass_mb_stats,
// zero-centering. // zero-centering.
static int16_t add_param_offset(int param_index, int16_t param_value, static int16_t add_param_offset(int param_index, int16_t param_value,
int16_t offset) { int16_t offset) {
int scale_vals[2] = { GM_ALPHA_PREC_DIFF, GM_TRANS_PREC_DIFF }; const int scale_vals[2] = { GM_ALPHA_PREC_DIFF, GM_TRANS_PREC_DIFF };
int clamp_vals[2] = { GM_ALPHA_MAX, GM_TRANS_MAX }; const int clamp_vals[2] = { GM_ALPHA_MAX, GM_TRANS_MAX };
int is_trans_param = param_index < 2; const int is_trans_param = param_index < 2;
int is_one_centered = (!is_trans_param) && (param_index & 1); const int is_one_centered = (!is_trans_param) && (param_index & 1);
// Make parameter zero-centered and offset the shift that was done to make // Make parameter zero-centered and offset the shift that was done to make
// it compatible with the warped model // it compatible with the warped model
...@@ -4507,11 +4507,11 @@ static int16_t add_param_offset(int param_index, int16_t param_value, ...@@ -4507,11 +4507,11 @@ static int16_t add_param_offset(int param_index, int16_t param_value,
// to it in the bitstream // to it in the bitstream
param_value = (int16_t)clamp(param_value, -clamp_vals[is_trans_param], param_value = (int16_t)clamp(param_value, -clamp_vals[is_trans_param],
clamp_vals[is_trans_param]); clamp_vals[is_trans_param]);
// Rescale the parameter to WARPEDMODEL_PRECIION_BITS so it is compatible // Rescale the parameter to WARPEDMODEL_PRECISION_BITS so it is compatible
// with the warped motion library // with the warped motion library
param_value *= (1 << scale_vals[is_trans_param]); param_value *= (1 << scale_vals[is_trans_param]);
// Undo the zero-centring step if necessary // Undo the zero-centering step if necessary
return param_value + (is_one_centered << WARPEDMODEL_PREC_BITS); return param_value + (is_one_centered << WARPEDMODEL_PREC_BITS);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment