From de2ba4f658470cb77b7463d6b7e9396b81367ff4 Mon Sep 17 00:00:00 2001 From: Urvang Joshi <urvang@google.com> Date: Thu, 28 Jul 2016 15:51:12 -0700 Subject: [PATCH] Remove unused array 'last_frame_seg_map_copy'. This array was allocated and used to save and restore segmentation map, however the original segmentation map was never modified between the calls to save and restore. Change-Id: Iaf0fbfed733c097e84cf44d2aa6b8f35d2fb456b --- av1/encoder/encoder.c | 14 -------------- av1/encoder/encoder.h | 2 -- 2 files changed, 16 deletions(-) diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c index 83a45f4172..c019b71aa6 100644 --- a/av1/encoder/encoder.c +++ b/av1/encoder/encoder.c @@ -375,8 +375,6 @@ static void dealloc_compressor_data(AV1_COMP *cpi) { // Delete sementation map aom_free(cpi->segmentation_map); cpi->segmentation_map = NULL; - aom_free(cpi->coding_context.last_frame_seg_map_copy); - cpi->coding_context.last_frame_seg_map_copy = NULL; #if CONFIG_REF_MV for (i = 0; i < NMV_CONTEXTS; ++i) { @@ -484,9 +482,6 @@ static void save_coding_context(AV1_COMP *cpi) { av1_copy(cc->segment_pred_probs, cm->segp.pred_probs); #endif - memcpy(cpi->coding_context.last_frame_seg_map_copy, cm->last_frame_seg_map, - (cm->mi_rows * cm->mi_cols)); - av1_copy(cc->last_ref_lf_deltas, cm->lf.last_ref_deltas); av1_copy(cc->last_mode_lf_deltas, cm->lf.last_mode_deltas); @@ -529,9 +524,6 @@ static void restore_coding_context(AV1_COMP *cpi) { av1_copy(cm->segp.pred_probs, cc->segment_pred_probs); #endif - memcpy(cm->last_frame_seg_map, cpi->coding_context.last_frame_seg_map_copy, - (cm->mi_rows * cm->mi_cols)); - av1_copy(cm->lf.last_ref_deltas, cc->last_ref_lf_deltas); av1_copy(cm->lf.last_mode_deltas, cc->last_mode_lf_deltas); @@ -1471,12 +1463,6 @@ static void realloc_segmentation_maps(AV1_COMP *cpi) { aom_free(cpi->active_map.map); CHECK_MEM_ERROR(cm, cpi->active_map.map, aom_calloc(cm->mi_rows * cm->mi_cols, 1)); - - // And a place holder structure is the coding context - // for use if we want to save and restore it - aom_free(cpi->coding_context.last_frame_seg_map_copy); - CHECK_MEM_ERROR(cm, cpi->coding_context.last_frame_seg_map_copy, - aom_calloc(cm->mi_rows * cm->mi_cols, 1)); } void av1_change_config(struct AV1_COMP *cpi, const AV1EncoderConfig *oxcf) { diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h index b7f42d02ae..b418ac7df6 100644 --- a/av1/encoder/encoder.h +++ b/av1/encoder/encoder.h @@ -70,8 +70,6 @@ typedef struct { aom_prob segment_pred_probs[PREDICTION_PROBS]; #endif - unsigned char *last_frame_seg_map_copy; - // 0 = Intra, Last, GF, ARF signed char last_ref_lf_deltas[MAX_REF_FRAMES]; // 0 = ZERO_MV, MV -- GitLab