Commit 359a6796 authored by Ranjit Kumar Tulabandu's avatar Ranjit Kumar Tulabandu Committed by Yunqing Wang
Browse files

Changes to facilitate row based multi-threading of ARNR filtering

Change-Id: I2fd72af00afbbeb903e4fe364611abcc148f2fbb
parent 106c620a
...@@ -420,6 +420,14 @@ typedef struct { ...@@ -420,6 +420,14 @@ typedef struct {
double max_cpb_size; // in bits double max_cpb_size; // in bits
} LevelConstraint; } LevelConstraint;
typedef struct ARNRFilterData {
YV12_BUFFER_CONFIG *frames[MAX_LAG_BUFFERS];
int strength;
int frame_count;
int alt_ref_index;
struct scale_factors sf;
} ARNRFilterData;
typedef struct VP9_COMP { typedef struct VP9_COMP {
QUANTS quants; QUANTS quants;
ThreadData td; ThreadData td;
...@@ -662,6 +670,7 @@ typedef struct VP9_COMP { ...@@ -662,6 +670,7 @@ typedef struct VP9_COMP {
MultiThreadHandle multi_thread_ctxt; MultiThreadHandle multi_thread_ctxt;
void (*row_mt_sync_read_ptr)(VP9RowMTSync *const, int, int); void (*row_mt_sync_read_ptr)(VP9RowMTSync *const, int, int);
void (*row_mt_sync_write_ptr)(VP9RowMTSync *const, int, int, const int); void (*row_mt_sync_write_ptr)(VP9RowMTSync *const, int, int, const int);
ARNRFilterData arnr_filter_data;
int new_mt; int new_mt;
// Previous Partition Info // Previous Partition Info
......
...@@ -45,8 +45,8 @@ static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi, const MV *ref_mv, ...@@ -45,8 +45,8 @@ static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi, const MV *ref_mv,
mv_sf->search_method = HEX; mv_sf->search_method = HEX;
vp9_full_pixel_search(cpi, x, BLOCK_16X16, &ref_full, step_param, vp9_full_pixel_search(cpi, x, BLOCK_16X16, &ref_full, step_param,
x->errorperbit, cond_cost_list(cpi, cost_list), ref_mv, cpi->sf.mv.search_method, x->errorperbit,
dst_mv, 0, 0); cond_cost_list(cpi, cost_list), ref_mv, dst_mv, 0, 0);
mv_sf->search_method = old_search_method; mv_sf->search_method = old_search_method;
// Try sub-pixel MC // Try sub-pixel MC
......
...@@ -2364,11 +2364,11 @@ static int is_exhaustive_allowed(VP9_COMP *cpi, MACROBLOCK *x) { ...@@ -2364,11 +2364,11 @@ static int is_exhaustive_allowed(VP9_COMP *cpi, MACROBLOCK *x) {
} }
int vp9_full_pixel_search(VP9_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int vp9_full_pixel_search(VP9_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize,
MV *mvp_full, int step_param, int error_per_bit, MV *mvp_full, int step_param, int search_method,
int *cost_list, const MV *ref_mv, MV *tmp_mv, int error_per_bit, int *cost_list, const MV *ref_mv,
int var_max, int rd) { MV *tmp_mv, int var_max, int rd) {
const SPEED_FEATURES *const sf = &cpi->sf; const SPEED_FEATURES *const sf = &cpi->sf;
const SEARCH_METHODS method = sf->mv.search_method; const SEARCH_METHODS method = (SEARCH_METHODS)search_method;
vp9_variance_fn_ptr_t *fn_ptr = &cpi->fn_ptr[bsize]; vp9_variance_fn_ptr_t *fn_ptr = &cpi->fn_ptr[bsize];
int var = 0; int var = 0;
if (cost_list) { if (cost_list) {
......
...@@ -105,9 +105,9 @@ int vp9_refining_search_8p_c(const MACROBLOCK *x, MV *ref_mv, int error_per_bit, ...@@ -105,9 +105,9 @@ int vp9_refining_search_8p_c(const MACROBLOCK *x, MV *ref_mv, int error_per_bit,
struct VP9_COMP; struct VP9_COMP;
int vp9_full_pixel_search(struct VP9_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int vp9_full_pixel_search(struct VP9_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize,
MV *mvp_full, int step_param, int error_per_bit, MV *mvp_full, int step_param, int search_method,
int *cost_list, const MV *ref_mv, MV *tmp_mv, int error_per_bit, int *cost_list, const MV *ref_mv,
int var_max, int rd); MV *tmp_mv, int var_max, int rd);
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
......
...@@ -184,9 +184,9 @@ static int combined_motion_search(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -184,9 +184,9 @@ static int combined_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
else else
center_mv = tmp_mv->as_mv; center_mv = tmp_mv->as_mv;
vp9_full_pixel_search(cpi, x, bsize, &mvp_full, step_param, sadpb, vp9_full_pixel_search(
cond_cost_list(cpi, cost_list), &center_mv, cpi, x, bsize, &mvp_full, step_param, cpi->sf.mv.search_method, sadpb,
&tmp_mv->as_mv, INT_MAX, 0); cond_cost_list(cpi, cost_list), &center_mv, &tmp_mv->as_mv, INT_MAX, 0);
x->mv_limits = tmp_mv_limits; x->mv_limits = tmp_mv_limits;
...@@ -2260,10 +2260,10 @@ void vp9_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x, int mi_row, ...@@ -2260,10 +2260,10 @@ void vp9_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x, int mi_row,
vp9_set_mv_search_range(&x->mv_limits, vp9_set_mv_search_range(&x->mv_limits,
&mbmi_ext->ref_mvs[0]->as_mv); &mbmi_ext->ref_mvs[0]->as_mv);
vp9_full_pixel_search(cpi, x, bsize, &mvp_full, step_param, vp9_full_pixel_search(
x->sadperbit4, cond_cost_list(cpi, cost_list), cpi, x, bsize, &mvp_full, step_param, cpi->sf.mv.search_method,
&mbmi_ext->ref_mvs[ref_frame][0].as_mv, x->sadperbit4, cond_cost_list(cpi, cost_list),
&tmp_mv, INT_MAX, 0); &mbmi_ext->ref_mvs[ref_frame][0].as_mv, &tmp_mv, INT_MAX, 0);
x->mv_limits = tmp_mv_limits; x->mv_limits = tmp_mv_limits;
......
...@@ -1998,7 +1998,8 @@ static int64_t rd_pick_best_sub8x8_mode( ...@@ -1998,7 +1998,8 @@ static int64_t rd_pick_best_sub8x8_mode(
vp9_set_mv_search_range(&x->mv_limits, &bsi->ref_mv[0]->as_mv); vp9_set_mv_search_range(&x->mv_limits, &bsi->ref_mv[0]->as_mv);
bestsme = vp9_full_pixel_search( bestsme = vp9_full_pixel_search(
cpi, x, bsize, &mvp_full, step_param, sadpb, cpi, x, bsize, &mvp_full, step_param, cpi->sf.mv.search_method,
sadpb,
sf->mv.subpel_search_method != SUBPEL_TREE ? cost_list : NULL, sf->mv.subpel_search_method != SUBPEL_TREE ? cost_list : NULL,
&bsi->ref_mv[0]->as_mv, new_mv, INT_MAX, 1); &bsi->ref_mv[0]->as_mv, new_mv, INT_MAX, 1);
...@@ -2403,9 +2404,9 @@ static void single_motion_search(VP9_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize, ...@@ -2403,9 +2404,9 @@ static void single_motion_search(VP9_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize,
mvp_full.col >>= 3; mvp_full.col >>= 3;
mvp_full.row >>= 3; mvp_full.row >>= 3;
bestsme = vp9_full_pixel_search(cpi, x, bsize, &mvp_full, step_param, sadpb, bestsme = vp9_full_pixel_search(
cond_cost_list(cpi, cost_list), &ref_mv, cpi, x, bsize, &mvp_full, step_param, cpi->sf.mv.search_method, sadpb,
&tmp_mv->as_mv, INT_MAX, 1); cond_cost_list(cpi, cost_list), &ref_mv, &tmp_mv->as_mv, INT_MAX, 1);
x->mv_limits = tmp_mv_limits; x->mv_limits = tmp_mv_limits;
......
This diff is collapsed.
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