summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_segmentation.c
diff options
context:
space:
mode:
Diffstat (limited to 'vp9/encoder/vp9_segmentation.c')
-rw-r--r--vp9/encoder/vp9_segmentation.c48
1 files changed, 2 insertions, 46 deletions
diff --git a/vp9/encoder/vp9_segmentation.c b/vp9/encoder/vp9_segmentation.c
index aac42f738..6336969fb 100644
--- a/vp9/encoder/vp9_segmentation.c
+++ b/vp9/encoder/vp9_segmentation.c
@@ -15,50 +15,6 @@
#include "vp9/common/vp9_pred_common.h"
#include "vp9/common/vp9_tile_common.h"
-void vp9_update_gf_useage_maps(VP9_COMP *cpi, VP9_COMMON *cm, MACROBLOCK *x) {
- int mb_row, mb_col;
-
- MODE_INFO *this_mb_mode_info = cm->mi;
-
- x->gf_active_ptr = (signed char *)cpi->gf_active_flags;
-
- if ((cm->frame_type == KEY_FRAME) || (cpi->refresh_golden_frame)) {
- // Reset Gf useage monitors
- vpx_memset(cpi->gf_active_flags, 1, (cm->mb_rows * cm->mb_cols));
- cpi->gf_active_count = cm->mb_rows * cm->mb_cols;
- } else {
- // for each macroblock row in image
- for (mb_row = 0; mb_row < cm->mb_rows; mb_row++) {
- // for each macroblock col in image
- for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) {
-
- // If using golden then set GF active flag if not already set.
- // If using last frame 0,0 mode then leave flag as it is
- // else if using non 0,0 motion or intra modes then clear
- // flag if it is currently set
- if ((this_mb_mode_info->mbmi.ref_frame == GOLDEN_FRAME) ||
- (this_mb_mode_info->mbmi.ref_frame == ALTREF_FRAME)) {
- if (*(x->gf_active_ptr) == 0) {
- *(x->gf_active_ptr) = 1;
- cpi->gf_active_count++;
- }
- } else if ((this_mb_mode_info->mbmi.mode != ZEROMV) &&
- *(x->gf_active_ptr)) {
- *(x->gf_active_ptr) = 0;
- cpi->gf_active_count--;
- }
-
- x->gf_active_ptr++; // Step onto next entry
- this_mb_mode_info++; // skip to next mb
-
- }
-
- // this is to account for the border
- this_mb_mode_info++;
- }
- }
-}
-
void vp9_enable_segmentation(VP9_PTR ptr) {
VP9_COMP *cpi = (VP9_COMP *)(ptr);
@@ -215,7 +171,6 @@ static void count_segs(VP9_COMP *cpi,
int bw, int bh, int mb_row, int mb_col) {
VP9_COMMON *const cm = &cpi->common;
MACROBLOCKD *const xd = &cpi->mb.e_mbd;
- const int segmap_index = mb_row * cm->mb_cols + mb_col;
const int segment_id = mi->mbmi.segment_id;
xd->mode_info_context = mi;
@@ -228,7 +183,8 @@ static void count_segs(VP9_COMP *cpi,
// Temporal prediction not allowed on key frames
if (cm->frame_type != KEY_FRAME) {
// Test to see if the segment id matches the predicted value.
- const int pred_seg_id = vp9_get_pred_mb_segid(cm, xd, segmap_index);
+ const int pred_seg_id = vp9_get_pred_mb_segid(cm, mi->mbmi.sb_type,
+ mb_row, mb_col);
const int seg_predicted = (segment_id == pred_seg_id);
// Get the segment id prediction context