diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index 32dba9d7253003866a6e13c868badee7c365c917..2185f4f50bd232609ce29a0628913168c9fcd32d 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -551,9 +551,6 @@ static void set_offsets(VP9_COMP *cpi, xd->above_context = cm->above_context + mb_col; xd->left_context = cm->left_context + (mb_row & 3); - // GF active flags data structure - x->gf_active_ptr = (signed char *)&cpi->gf_active_flags[idx_map]; - // Activity map pointer x->mb_activity_ptr = &cpi->mb_activity_map[idx_map]; x->active_ptr = cpi->active_map + idx_map; diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c index 85ac5231d4ca874cf4d1aa0a6fc29137f5a6610d..66ed1da72a03c74ab3670f3c65627cadbebd40dd 100644 --- a/vp9/encoder/vp9_onyx_if.c +++ b/vp9/encoder/vp9_onyx_if.c @@ -332,10 +332,6 @@ static void dealloc_compressor_data(VP9_COMP *cpi) { vpx_free(cpi->tok); cpi->tok = 0; - // Structure used to monitor GF usage - vpx_free(cpi->gf_active_flags); - cpi->gf_active_flags = 0; - // Activity mask based per mb zbin adjustments vpx_free(cpi->mb_activity_map); cpi->mb_activity_map = 0; @@ -909,13 +905,6 @@ void vp9_alloc_compressor_data(VP9_COMP *cpi) { cpi->gf_bad_count = 0; cpi->gf_update_recommended = 0; - - // Structures used to minitor GF usage - vpx_free(cpi->gf_active_flags); - CHECK_MEM_ERROR(cpi->gf_active_flags, - vpx_calloc(1, cm->mb_rows * cm->mb_cols)); - cpi->gf_active_count = cm->mb_rows * cm->mb_cols; - vpx_free(cpi->mb_activity_map); CHECK_MEM_ERROR(cpi->mb_activity_map, vpx_calloc(sizeof(unsigned int), @@ -2231,12 +2220,6 @@ static void scale_and_extend_frame(YV12_BUFFER_CONFIG *src_fb, static void update_alt_ref_frame_stats(VP9_COMP *cpi) { - VP9_COMMON *cm = &cpi->common; - - // Update data structure that monitors level of reference to last GF - vpx_memset(cpi->gf_active_flags, 1, (cm->mb_rows * cm->mb_cols)); - cpi->gf_active_count = cm->mb_rows * cm->mb_cols; - // this frame refreshes means next frames don't unless specified by user cpi->common.frames_since_golden = 0; @@ -2248,18 +2231,10 @@ static void update_alt_ref_frame_stats(VP9_COMP *cpi) { // Set the alternate reference frame active flag cpi->source_alt_ref_active = 1; - - } static void update_golden_frame_stats(VP9_COMP *cpi) { - VP9_COMMON *cm = &cpi->common; - // Update the Golden frame usage counts. if (cpi->refresh_golden_frame) { - // Update data structure that monitors level of reference to last GF - vpx_memset(cpi->gf_active_flags, 1, (cm->mb_rows * cm->mb_cols)); - cpi->gf_active_count = cm->mb_rows * cm->mb_cols; - // this frame refreshes means next frames don't unless specified by user cpi->refresh_golden_frame = 0; cpi->common.frames_since_golden = 0; @@ -3293,28 +3268,9 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, } } - // Update the GF usage maps. - // This is done after completing the compression of a frame when all modes - // etc. are finalized but before loop filter - vp9_update_gf_useage_maps(cpi, cm, &cpi->mb); - if (cm->frame_type == KEY_FRAME) cpi->refresh_last_frame = 1; -#if 0 - { - FILE *f = fopen("gfactive.stt", "a"); - fprintf(f, "%8d %8d %8d %8d %8d\n", - cm->current_video_frame, - (100 * cpi->gf_active_count) - / (cpi->common.mb_rows * cpi->common.mb_cols), - cpi->this_iiratio, - cpi->next_iiratio, - cpi->refresh_golden_frame); - fclose(f); - } -#endif - cm->frame_to_show = &cm->yv12_fb[cm->new_fb_idx]; #if WRITE_RECON_BUFFER diff --git a/vp9/encoder/vp9_onyx_int.h b/vp9/encoder/vp9_onyx_int.h index ba7505ee5658f6c5985622fb7e5b0a76f265c93d..6d309c84d63837975e56d36faa608f47d2a4ba4f 100644 --- a/vp9/encoder/vp9_onyx_int.h +++ b/vp9/encoder/vp9_onyx_int.h @@ -658,12 +658,6 @@ typedef struct VP9_COMP { unsigned int activity_avg; unsigned int *mb_activity_map; int *mb_norm_activity_map; - - // Record of which MBs still refer to last golden frame either - // directly or through 0,0 - unsigned char *gf_active_flags; - int gf_active_count; - int output_partition; // Store last frame's MV info for next frame MV prediction diff --git a/vp9/encoder/vp9_segmentation.c b/vp9/encoder/vp9_segmentation.c index aac42f7389ca20935e85bdfe3f0e7bc566060691..e48c11db1a32f95025b33b1bae41d36f1b7d0fd4 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); diff --git a/vp9/encoder/vp9_segmentation.h b/vp9/encoder/vp9_segmentation.h index 1c90c2f2d9001af15767bad6225910eb5ecdde5a..2183771c45971c8e6bfa5d3fea4373532909a283 100644 --- a/vp9/encoder/vp9_segmentation.h +++ b/vp9/encoder/vp9_segmentation.h @@ -15,8 +15,6 @@ #include "vp9/common/vp9_blockd.h" #include "vp9/encoder/vp9_onyx_int.h" -void vp9_update_gf_useage_maps(VP9_COMP *cpi, VP9_COMMON *cm, MACROBLOCK *x); - void vp9_enable_segmentation(VP9_PTR ptr); void vp9_disable_segmentation(VP9_PTR ptr);