Commit 29199efd authored by Dmitry Kovalev's avatar Dmitry Kovalev Committed by Gerrit Code Review
Browse files

Merge "Moving reset_segment_features() to encoder/vp9_segmentation.h."

parents bbb25e6a 4603f31d
...@@ -170,17 +170,6 @@ void vp9_initialize_enc() { ...@@ -170,17 +170,6 @@ void vp9_initialize_enc() {
} }
} }
static void reset_segment_features(VP9_COMMON *cm) {
struct segmentation *const seg = &cm->seg;
// Set up default state for MB feature flags
seg->enabled = 0;
seg->update_map = 0;
seg->update_data = 0;
vpx_memset(seg->tree_probs, 255, sizeof(seg->tree_probs));
vp9_clearall_segfeatures(seg);
}
static void dealloc_compressor_data(VP9_COMP *cpi) { static void dealloc_compressor_data(VP9_COMP *cpi) {
// Delete sementation map // Delete sementation map
vpx_free(cpi->segmentation_map); vpx_free(cpi->segmentation_map);
...@@ -1192,7 +1181,7 @@ void vp9_change_config(VP9_PTR ptr, VP9_CONFIG *oxcf) { ...@@ -1192,7 +1181,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;
reset_segment_features(cm); vp9_reset_segment_features(&cm->seg);
set_high_precision_mv(cpi, 0); set_high_precision_mv(cpi, 0);
{ {
...@@ -2939,7 +2928,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, ...@@ -2939,7 +2928,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.
reset_segment_features(cm); vp9_reset_segment_features(&cm->seg);
// 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) {
......
...@@ -296,3 +296,12 @@ void vp9_choose_segmap_coding_method(VP9_COMP *cpi) { ...@@ -296,3 +296,12 @@ void vp9_choose_segmap_coding_method(VP9_COMP *cpi) {
vpx_memcpy(seg->tree_probs, no_pred_tree, sizeof(no_pred_tree)); vpx_memcpy(seg->tree_probs, no_pred_tree, sizeof(no_pred_tree));
} }
} }
void vp9_reset_segment_features(struct segmentation *seg) {
// Set up default state for MB feature flags
seg->enabled = 0;
seg->update_map = 0;
seg->update_data = 0;
vpx_memset(seg->tree_probs, 255, sizeof(seg->tree_probs));
vp9_clearall_segfeatures(seg);
}
...@@ -43,4 +43,6 @@ void vp9_set_segment_data(VP9_PTR ptr, signed char *feature_data, ...@@ -43,4 +43,6 @@ void vp9_set_segment_data(VP9_PTR ptr, signed char *feature_data,
void vp9_choose_segmap_coding_method(VP9_COMP *cpi); void vp9_choose_segmap_coding_method(VP9_COMP *cpi);
void vp9_reset_segment_features(struct segmentation *seg);
#endif // VP9_ENCODER_VP9_SEGMENTATION_H_ #endif // VP9_ENCODER_VP9_SEGMENTATION_H_
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