diff options
Diffstat (limited to 'vp9/encoder')
-rw-r--r-- | vp9/encoder/vp9_encodeframe.c | 3 | ||||
-rw-r--r-- | vp9/encoder/vp9_onyx_if.c | 44 | ||||
-rw-r--r-- | vp9/encoder/vp9_onyx_int.h | 6 | ||||
-rw-r--r-- | vp9/encoder/vp9_rdopt.c | 20 | ||||
-rw-r--r-- | vp9/encoder/vp9_segmentation.c | 44 | ||||
-rw-r--r-- | vp9/encoder/vp9_segmentation.h | 2 |
6 files changed, 3 insertions, 116 deletions
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index c563e8e33..e9612b988 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 85ac5231d..66ed1da72 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 ba7505ee5..6d309c84d 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_rdopt.c b/vp9/encoder/vp9_rdopt.c index b940e9849..0f6d7132f 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -2690,7 +2690,7 @@ static void setup_buffer_inter(VP9_COMP *cpi, MACROBLOCK *x, YV12_BUFFER_CONFIG *yv12 = &cm->yv12_fb[cpi->common.ref_frame_map[idx]]; MACROBLOCKD *const xd = &x->e_mbd; MB_MODE_INFO *const mbmi = &xd->mode_info_context->mbmi; - int use_prev_in_find_mv_refs, use_prev_in_find_best_ref; + int use_prev_in_find_mv_refs; // set up scaling factors scale[frame_type] = cpi->common.active_ref_scale[frame_type - 1]; @@ -2715,15 +2715,7 @@ static void setup_buffer_inter(VP9_COMP *cpi, MACROBLOCK *x, cpi->common.ref_frame_sign_bias); // Candidate refinement carried out at encoder and decoder - use_prev_in_find_best_ref = - scale[frame_type].x_num == scale[frame_type].x_den && - scale[frame_type].y_num == scale[frame_type].y_den && - !cm->error_resilient_mode && - !cm->frame_parallel_decoding_mode; vp9_find_best_ref_mvs(xd, - use_prev_in_find_best_ref ? - yv12_mb[frame_type].y_buffer : NULL, - yv12->y_stride, mbmi->ref_mvs[frame_type], &frame_nearest_mv[frame_type], &frame_near_mv[frame_type]); @@ -2820,7 +2812,6 @@ static enum BlockSize y_bsizet_to_block_size(BLOCK_SIZE_TYPE bs) { static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE_TYPE bsize, - int *saddone, int near_sadidx[], int mdcounts[4], int64_t txfm_cache[], int *rate2, int *distortion, int *skippable, int *compmode_cost, @@ -3355,9 +3346,6 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, int distortion_uv = INT_MAX; int64_t best_yrd = INT64_MAX; - int near_sadidx[8] = {0, 1, 2, 3, 4, 5, 6, 7}; - int saddone = 0; - int_mv frame_mv[MB_MODE_COUNT][MAX_REF_FRAMES]; int frame_mdcounts[4][4]; YV12_BUFFER_CONFIG yv12_mb[4]; @@ -3812,7 +3800,7 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, } #endif this_rd = handle_inter_mode(cpi, x, BLOCK_SIZE_MB16X16, - &saddone, near_sadidx, mdcounts, txfm_cache, + mdcounts, txfm_cache, &rate2, &distortion2, &skippable, &compmode_cost, #if CONFIG_COMP_INTERINTRA_PRED @@ -4324,8 +4312,6 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, cpi->gld_fb_idx, cpi->alt_fb_idx}; int mdcounts[4]; - int near_sadidx[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - int saddone = 0; int64_t best_rd = INT64_MAX; int64_t best_txfm_rd[NB_TXFM_MODES]; int64_t best_txfm_diff[NB_TXFM_MODES]; @@ -4583,7 +4569,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, } #endif this_rd = handle_inter_mode(cpi, x, bsize, - &saddone, near_sadidx, mdcounts, txfm_cache, + mdcounts, txfm_cache, &rate2, &distortion2, &skippable, &compmode_cost, #if CONFIG_COMP_INTERINTRA_PRED diff --git a/vp9/encoder/vp9_segmentation.c b/vp9/encoder/vp9_segmentation.c index aac42f738..e48c11db1 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 1c90c2f2d..2183771c4 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); |