Commit 64cf3987 authored by Dmitry Kovalev's avatar Dmitry Kovalev Committed by Gerrit Code Review

Merge "Using MV struct instead of int_mv union in encoder."

parents 33df4f04 25da21b1
......@@ -15,7 +15,7 @@
#include "vp9/common/vp9_common.h"
typedef struct {
typedef struct mv {
int16_t row;
int16_t col;
} MV;
......@@ -25,7 +25,7 @@ typedef union int_mv {
MV as_mv;
} int_mv; /* facilitates faster equality tests and copies */
typedef struct {
typedef struct mv32 {
int32_t row;
int32_t col;
} MV32;
......
......@@ -14,6 +14,7 @@ struct macroblock;
struct vp9_variance_vtable;
#define DEC_MVCOSTS int *mvjcost, int *mvcost[2]
struct mv;
union int_mv;
struct yv12_buffer_config;
EOF
......@@ -736,20 +737,20 @@ specialize vp9_fdct32x32_rd sse2 avx2
#
# Motion search
#
prototype int vp9_full_search_sad "struct macroblock *x, union int_mv *ref_mv, int sad_per_bit, int distance, struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, union int_mv *center_mv, int n"
prototype int vp9_full_search_sad "struct macroblock *x, struct mv *ref_mv, int sad_per_bit, int distance, struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, const struct mv *center_mv, int n"
specialize vp9_full_search_sad sse3 sse4_1
vp9_full_search_sad_sse3=vp9_full_search_sadx3
vp9_full_search_sad_sse4_1=vp9_full_search_sadx8
prototype int vp9_refining_search_sad "struct macroblock *x, union int_mv *ref_mv, int sad_per_bit, int distance, struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, union int_mv *center_mv"
prototype int vp9_refining_search_sad "struct macroblock *x, struct mv *ref_mv, int sad_per_bit, int distance, struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, const struct mv *center_mv"
specialize vp9_refining_search_sad sse3
vp9_refining_search_sad_sse3=vp9_refining_search_sadx4
prototype int vp9_diamond_search_sad "struct macroblock *x, union int_mv *ref_mv, union int_mv *best_mv, int search_param, int sad_per_bit, int *num00, struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, union int_mv *center_mv"
prototype int vp9_diamond_search_sad "struct macroblock *x, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, const struct mv *center_mv"
specialize vp9_diamond_search_sad sse3
vp9_diamond_search_sad_sse3=vp9_diamond_search_sadx4
prototype int vp9_full_range_search "struct macroblock *x, union int_mv *ref_mv, union int_mv *best_mv, int search_param, int sad_per_bit, int *num00, struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, union int_mv *center_mv"
prototype int vp9_full_range_search "struct macroblock *x, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, const struct mv *center_mv"
specialize vp9_full_range_search
prototype void vp9_temporal_filter_apply "uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_size, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count"
......
......@@ -406,8 +406,7 @@ static void first_pass_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
int step_param = 3;
int further_steps = (MAX_MVSEARCH_STEPS - 1) - step_param;
int n;
vp9_variance_fn_ptr_t v_fn_ptr =
cpi->fn_ptr[xd->mi_8x8[0]->mbmi.sb_type];
vp9_variance_fn_ptr_t v_fn_ptr = cpi->fn_ptr[xd->mi_8x8[0]->mbmi.sb_type];
int new_mv_mode_penalty = 256;
int sr = 0;
......@@ -444,10 +443,11 @@ static void first_pass_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
tmp_mv.as_int = 0;
ref_mv_full.as_mv.col = ref_mv->as_mv.col >> 3;
ref_mv_full.as_mv.row = ref_mv->as_mv.row >> 3;
tmp_err = cpi->diamond_search_sad(x, &ref_mv_full, &tmp_mv, step_param,
tmp_err = cpi->diamond_search_sad(x, &ref_mv_full.as_mv, &tmp_mv.as_mv,
step_param,
x->sadperbit16, &num00, &v_fn_ptr,
x->nmvjointcost,
x->mvcost, ref_mv);
x->mvcost, &ref_mv->as_mv);
if (tmp_err < INT_MAX - new_mv_mode_penalty)
tmp_err += new_mv_mode_penalty;
......@@ -467,11 +467,11 @@ static void first_pass_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
if (num00) {
num00--;
} else {
tmp_err = cpi->diamond_search_sad(x, &ref_mv_full, &tmp_mv,
tmp_err = cpi->diamond_search_sad(x, &ref_mv_full.as_mv, &tmp_mv.as_mv,
step_param + n, x->sadperbit16,
&num00, &v_fn_ptr,
x->nmvjointcost,
x->mvcost, ref_mv);
x->mvcost, &ref_mv->as_mv);
if (tmp_err < INT_MAX - new_mv_mode_penalty)
tmp_err += new_mv_mode_penalty;
......
This diff is collapsed.
......@@ -103,25 +103,25 @@ extern fractional_mv_step_comp_fp vp9_find_best_sub_pixel_comp_iterative;
extern fractional_mv_step_comp_fp vp9_find_best_sub_pixel_comp_tree;
typedef int (*vp9_full_search_fn_t)(MACROBLOCK *x,
int_mv *ref_mv, int sad_per_bit,
MV *ref_mv, int sad_per_bit,
int distance, vp9_variance_fn_ptr_t *fn_ptr,
int *mvjcost, int *mvcost[2],
int_mv *center_mv, int n);
const MV *center_mv, int n);
typedef int (*vp9_refining_search_fn_t)(MACROBLOCK *x,
int_mv *ref_mv, int sad_per_bit,
MV *ref_mv, int sad_per_bit,
int distance,
vp9_variance_fn_ptr_t *fn_ptr,
int *mvjcost, int *mvcost[2],
int_mv *center_mv);
const MV *center_mv);
typedef int (*vp9_diamond_search_fn_t)(MACROBLOCK *x,
int_mv *ref_mv, int_mv *best_mv,
MV *ref_mv, MV *best_mv,
int search_param, int sad_per_bit,
int *num00,
vp9_variance_fn_ptr_t *fn_ptr,
int *mvjcost, int *mvcost[2],
int_mv *center_mv);
const MV *center_mv);
int vp9_refining_search_8p_c(MACROBLOCK *x,
int_mv *ref_mv, int error_per_bit,
......
......@@ -1813,10 +1813,10 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
clamp_mv(&mvp_full.as_mv, x->mv_col_min, x->mv_col_max,
x->mv_row_min, x->mv_row_max);
thissme = cpi->full_search_sad(x, &mvp_full,
thissme = cpi->full_search_sad(x, &mvp_full.as_mv,
sadpb, 16, v_fn_ptr,
x->nmvjointcost, x->mvcost,
bsi->ref_mv, i);
&bsi->ref_mv->as_mv, i);
if (thissme < bestsme) {
bestsme = thissme;
......
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