Namespace global motion functions
BUG=aomedia:1540
Change-Id: I62693946ae357ecbd90b8270315852b8a18aeef0
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index 2e9a922..d5833f2 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -5637,19 +5637,19 @@
(MAX_PARAMDIM - 1) * sizeof(*params_by_motion));
}
- compute_global_motion(model, cpi->source, ref_buf[frame],
- cpi->common.seq_params.bit_depth,
- inliers_by_motion, params_by_motion,
- RANSAC_NUM_MOTIONS);
+ av1_compute_global_motion(model, cpi->source, ref_buf[frame],
+ cpi->common.seq_params.bit_depth,
+ inliers_by_motion, params_by_motion,
+ RANSAC_NUM_MOTIONS);
for (i = 0; i < RANSAC_NUM_MOTIONS; ++i) {
if (inliers_by_motion[i] == 0) continue;
params_this_motion = params_by_motion + (MAX_PARAMDIM - 1) * i;
- convert_model_to_params(params_this_motion, &tmp_wm_params);
+ av1_convert_model_to_params(params_this_motion, &tmp_wm_params);
if (tmp_wm_params.wmtype != IDENTITY) {
- const int64_t warp_error = refine_integerized_param(
+ const int64_t warp_error = av1_refine_integerized_param(
&tmp_wm_params, tmp_wm_params.wmtype,
xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH, xd->bd,
ref_buf[frame]->y_buffer, ref_buf[frame]->y_width,
@@ -5659,7 +5659,7 @@
best_warp_error);
if (warp_error < best_warp_error) {
best_warp_error = warp_error;
- // Save the wm_params modified by refine_integerized_param()
+ // Save the wm_params modified by av1_refine_integerized_param()
// rather than motion index to avoid rerunning refine() below.
memcpy(&(cm->global_motion[frame]), &tmp_wm_params,
sizeof(WarpedMotionParams));
@@ -5683,7 +5683,7 @@
// If the best error advantage found doesn't meet the threshold for
// this motion type, revert to IDENTITY.
- if (!is_enough_erroradvantage(
+ if (!av1_is_enough_erroradvantage(
(double)best_warp_error / ref_frame_error,
gm_get_params_cost(&cm->global_motion[frame], ref_params,
cm->allow_high_precision_mv),
diff --git a/av1/encoder/global_motion.c b/av1/encoder/global_motion.c
index 46bb723..61fbf55 100644
--- a/av1/encoder/global_motion.c
+++ b/av1/encoder/global_motion.c
@@ -58,8 +58,8 @@
static const double erroradv_tr[] = { 0.65, 0.60, 0.55 };
static const double erroradv_prod_tr[] = { 20000, 18000, 16000 };
-int is_enough_erroradvantage(double best_erroradvantage, int params_cost,
- int erroradv_type) {
+int av1_is_enough_erroradvantage(double best_erroradvantage, int params_cost,
+ int erroradv_type) {
assert(erroradv_type < GM_ERRORADV_TR_TYPES);
return best_erroradvantage < erroradv_tr[erroradv_type] &&
best_erroradvantage * params_cost < erroradv_prod_tr[erroradv_type];
@@ -98,7 +98,8 @@
}
}
-void convert_model_to_params(const double *params, WarpedMotionParams *model) {
+void av1_convert_model_to_params(const double *params,
+ WarpedMotionParams *model) {
convert_to_params(params, model->wmmat);
model->wmtype = get_gmtype(model);
model->invalid = 0;
@@ -154,12 +155,13 @@
wm->wmtype = wmtype;
}
-int64_t refine_integerized_param(WarpedMotionParams *wm,
- TransformationType wmtype, int use_hbd, int bd,
- uint8_t *ref, int r_width, int r_height,
- int r_stride, uint8_t *dst, int d_width,
- int d_height, int d_stride, int n_refinements,
- int64_t best_frame_error) {
+int64_t av1_refine_integerized_param(WarpedMotionParams *wm,
+ TransformationType wmtype, int use_hbd,
+ int bd, uint8_t *ref, int r_width,
+ int r_height, int r_stride, uint8_t *dst,
+ int d_width, int d_height, int d_stride,
+ int n_refinements,
+ int64_t best_frame_error) {
static const int max_trans_model_params[TRANS_TYPES] = { 0, 2, 4, 6 };
const int border = ERRORADV_BORDER;
int i = 0, p;
@@ -529,10 +531,10 @@
}
#endif
-int compute_global_motion(TransformationType type, YV12_BUFFER_CONFIG *frm,
- YV12_BUFFER_CONFIG *ref, int bit_depth,
- int *num_inliers_by_motion, double *params_by_motion,
- int num_motions) {
+int av1_compute_global_motion(TransformationType type, YV12_BUFFER_CONFIG *frm,
+ YV12_BUFFER_CONFIG *ref, int bit_depth,
+ int *num_inliers_by_motion,
+ double *params_by_motion, int num_motions) {
#if USE_GM_FEATURE_BASED
return compute_global_motion_feature_based(type, frm, ref, bit_depth,
num_inliers_by_motion,
diff --git a/av1/encoder/global_motion.h b/av1/encoder/global_motion.h
index 81eed08..42cf221 100644
--- a/av1/encoder/global_motion.h
+++ b/av1/encoder/global_motion.h
@@ -22,20 +22,22 @@
#define RANSAC_NUM_MOTIONS 1
-void convert_model_to_params(const double *params, WarpedMotionParams *model);
+void av1_convert_model_to_params(const double *params,
+ WarpedMotionParams *model);
-int is_enough_erroradvantage(double best_erroradvantage, int params_cost,
- int erroradv_type);
+int av1_is_enough_erroradvantage(double best_erroradvantage, int params_cost,
+ int erroradv_type);
// Returns the av1_warp_error between "dst" and the result of applying the
// motion params that result from fine-tuning "wm" to "ref". Note that "wm" is
// modified in place.
-int64_t refine_integerized_param(WarpedMotionParams *wm,
- TransformationType wmtype, int use_hbd, int bd,
- uint8_t *ref, int r_width, int r_height,
- int r_stride, uint8_t *dst, int d_width,
- int d_height, int d_stride, int n_refinements,
- int64_t best_frame_error);
+int64_t av1_refine_integerized_param(WarpedMotionParams *wm,
+ TransformationType wmtype, int use_hbd,
+ int bd, uint8_t *ref, int r_width,
+ int r_height, int r_stride, uint8_t *dst,
+ int d_width, int d_height, int d_stride,
+ int n_refinements,
+ int64_t best_frame_error);
/*
Computes "num_motions" candidate global motion parameters between two frames.
@@ -52,10 +54,10 @@
number of inlier feature points for each motion. Params for which the
num_inliers entry is 0 should be ignored by the caller.
*/
-int compute_global_motion(TransformationType type, YV12_BUFFER_CONFIG *frm,
- YV12_BUFFER_CONFIG *ref, int bit_depth,
- int *num_inliers_by_motion, double *params_by_motion,
- int num_motions);
+int av1_compute_global_motion(TransformationType type, YV12_BUFFER_CONFIG *frm,
+ YV12_BUFFER_CONFIG *ref, int bit_depth,
+ int *num_inliers_by_motion,
+ double *params_by_motion, int num_motions);
#ifdef __cplusplus
} // extern "C"
#endif