Commit ed90a176 authored by Yaowu Xu's avatar Yaowu Xu
Browse files

Remove redundant function and calls

lf deltas are later setup in function vp9_setup_past_independence(),
so this commit removed the redundant copy. Also renamed a function
to better align the behavior of the funciton.

Change-Id: I5d28c2f5b12b3d31817e14296ed4605c1fd5c98c
parent ed7e3d24
...@@ -42,8 +42,6 @@ ...@@ -42,8 +42,6 @@
void vp9_entropy_mode_init(); void vp9_entropy_mode_init();
void vp9_coef_tree_initialize(); void vp9_coef_tree_initialize();
static void set_default_lf_deltas(struct loopfilter *lf);
#define DEFAULT_INTERP_FILTER SWITCHABLE #define DEFAULT_INTERP_FILTER SWITCHABLE
#define SHARP_FILTER_QTHRESH 0 /* Q threshold for 8-tap sharp filter */ #define SHARP_FILTER_QTHRESH 0 /* Q threshold for 8-tap sharp filter */
...@@ -172,27 +170,15 @@ void vp9_initialize_enc() { ...@@ -172,27 +170,15 @@ void vp9_initialize_enc() {
} }
} }
static void setup_features(VP9_COMMON *cm) { static void reset_segment_features(VP9_COMMON *cm) {
struct loopfilter *const lf = &cm->lf;
struct segmentation *const seg = &cm->seg; struct segmentation *const seg = &cm->seg;
// Set up default state for MB feature flags // Set up default state for MB feature flags
seg->enabled = 0; seg->enabled = 0;
seg->update_map = 0; seg->update_map = 0;
seg->update_data = 0; seg->update_data = 0;
vpx_memset(seg->tree_probs, 255, sizeof(seg->tree_probs)); vpx_memset(seg->tree_probs, 255, sizeof(seg->tree_probs));
vp9_clearall_segfeatures(seg); vp9_clearall_segfeatures(seg);
lf->mode_ref_delta_enabled = 0;
lf->mode_ref_delta_update = 0;
vp9_zero(lf->ref_deltas);
vp9_zero(lf->mode_deltas);
vp9_zero(lf->last_ref_deltas);
vp9_zero(lf->last_mode_deltas);
set_default_lf_deltas(lf);
} }
static void dealloc_compressor_data(VP9_COMP *cpi) { static void dealloc_compressor_data(VP9_COMP *cpi) {
...@@ -490,23 +476,6 @@ static void update_reference_segmentation_map(VP9_COMP *cpi) { ...@@ -490,23 +476,6 @@ static void update_reference_segmentation_map(VP9_COMP *cpi) {
} }
} }
static void set_default_lf_deltas(struct loopfilter *lf) {
lf->mode_ref_delta_enabled = 1;
lf->mode_ref_delta_update = 1;
vp9_zero(lf->ref_deltas);
vp9_zero(lf->mode_deltas);
// Test of ref frame deltas
lf->ref_deltas[INTRA_FRAME] = 2;
lf->ref_deltas[LAST_FRAME] = 0;
lf->ref_deltas[GOLDEN_FRAME] = -2;
lf->ref_deltas[ALTREF_FRAME] = -2;
lf->mode_deltas[0] = 0; // Zero
lf->mode_deltas[1] = 0; // New mv
}
static void set_rd_speed_thresholds(VP9_COMP *cpi, int mode) { static void set_rd_speed_thresholds(VP9_COMP *cpi, int mode) {
SPEED_FEATURES *sf = &cpi->sf; SPEED_FEATURES *sf = &cpi->sf;
int i; int i;
...@@ -1206,7 +1175,7 @@ void vp9_change_config(VP9_PTR ptr, VP9_CONFIG *oxcf) { ...@@ -1206,7 +1175,7 @@ void vp9_change_config(VP9_PTR ptr, VP9_CONFIG *oxcf) {
cm->refresh_frame_context = 1; cm->refresh_frame_context = 1;
cm->reset_frame_context = 0; cm->reset_frame_context = 0;
setup_features(cm); reset_segment_features(cm);
set_high_precision_mv(cpi, 0); set_high_precision_mv(cpi, 0);
{ {
...@@ -2948,7 +2917,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, ...@@ -2948,7 +2917,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
if (frame_is_intra_only(cm)) { if (frame_is_intra_only(cm)) {
vp9_setup_key_frame(cpi); vp9_setup_key_frame(cpi);
// Reset the loop filter deltas and segmentation map. // Reset the loop filter deltas and segmentation map.
setup_features(cm); reset_segment_features(cm);
// If segmentation is enabled force a map update for key frames. // If segmentation is enabled force a map update for key frames.
if (seg->enabled) { if (seg->enabled) {
......
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