diff --git a/vp8/common/onyx.h b/vp8/common/onyx.h index 8bbdbf27d243a902673c440009395ba4bbb3088e..97f71080fa88f9af71d9b8e81a739287012f2557 100644 --- a/vp8/common/onyx.h +++ b/vp8/common/onyx.h @@ -154,10 +154,6 @@ extern "C" int best_allowed_q; int cq_level; - // allow internal frame rate alterations - int allow_df; - int drop_frames_water_mark; - // two pass datarate control int two_pass_vbrbias; // two pass datarate control tweaks int two_pass_vbrmin_section; diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index 9214a2fbdefc8e25a9bc5a9f07505db88fb65d52..837a395153ca0dc06bb58ed9be5a4708944947ec 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -1413,9 +1413,6 @@ void vp8_change_config(VP8_PTR ptr, VP8_CONFIG *oxcf) cpi->cq_target_quality = cpi->oxcf.cq_level; - // Only allow dropped frames in buffered mode - cpi->drop_frames_allowed = cpi->oxcf.allow_df && cpi->buffered_mode; - if (!cm->use_bilinear_mc_filter) cm->mcomp_filter_type = SIXTAP; else @@ -1668,11 +1665,6 @@ VP8_PTR vp8_create_compressor(VP8_CONFIG *oxcf) cpi->avg_q = vp8_convert_qindex_to_q( cpi->oxcf.worst_allowed_q ); cpi->total_byte_count = 0; - cpi->drop_frame = 0; - cpi->drop_count = 0; - cpi->max_drop_count = 0; - cpi->max_consec_dropped_frames = 4; - cpi->rate_correction_factor = 1.0; cpi->key_frame_rate_correction_factor = 1.0; cpi->gf_rate_correction_factor = 1.0; @@ -2514,7 +2506,6 @@ void write_cx_frame_to_file(YV12_BUFFER_CONFIG *frame, int this_frame) fclose(yframe); } #endif -// return of 0 means drop frame // Function to test for conditions that indeicate we should loop // back and recode a frame. @@ -2818,10 +2809,6 @@ static void encode_frame_to_data_rate int overshoot_seen = FALSE; int undershoot_seen = FALSE; - int drop_mark = cpi->oxcf.drop_frames_water_mark * cpi->oxcf.optimal_buffer_level / 100; - int drop_mark75 = drop_mark * 2 / 3; - int drop_mark50 = drop_mark / 4; - int drop_mark25 = drop_mark / 8; // Clear down mmx registers to allow floating point in what follows vp8_clear_system_state(); @@ -2908,81 +2895,6 @@ static void encode_frame_to_data_rate // Test code for new segment features init_seg_features( cpi ); - if (cpi->drop_frames_allowed) - { - // The reset to decimation 0 is only done here for one pass. - // Once it is set two pass leaves decimation on till the next kf. - if ((cpi->buffer_level > drop_mark) && (cpi->decimation_factor > 0)) - cpi->decimation_factor --; - - if (cpi->buffer_level > drop_mark75 && cpi->decimation_factor > 0) - cpi->decimation_factor = 1; - - else if (cpi->buffer_level < drop_mark25 && (cpi->decimation_factor == 2 || cpi->decimation_factor == 3)) - { - cpi->decimation_factor = 3; - } - else if (cpi->buffer_level < drop_mark50 && (cpi->decimation_factor == 1 || cpi->decimation_factor == 2)) - { - cpi->decimation_factor = 2; - } - else if (cpi->buffer_level < drop_mark75 && (cpi->decimation_factor == 0 || cpi->decimation_factor == 1)) - { - cpi->decimation_factor = 1; - } - - //vpx_log("Encoder: Decimation Factor: %d \n",cpi->decimation_factor); - } - - // The following decimates the frame rate according to a regular pattern (i.e. to 1/2 or 2/3 frame rate) - // This can be used to help prevent buffer under-run in CBR mode. Alternatively it might be desirable in - // some situations to drop frame rate but throw more bits at each frame. - // - // Note that dropping a key frame can be problematic if spatial resampling is also active - if (cpi->decimation_factor > 0) - { - switch (cpi->decimation_factor) - { - case 1: - cpi->per_frame_bandwidth = cpi->per_frame_bandwidth * 3 / 2; - break; - case 2: - cpi->per_frame_bandwidth = cpi->per_frame_bandwidth * 5 / 4; - break; - case 3: - cpi->per_frame_bandwidth = cpi->per_frame_bandwidth * 5 / 4; - break; - } - - // Note that we should not throw out a key frame (especially when spatial resampling is enabled). - if ((cm->frame_type == KEY_FRAME)) - { - cpi->decimation_count = cpi->decimation_factor; - } - else if (cpi->decimation_count > 0) - { - cpi->decimation_count --; - cpi->bits_off_target += cpi->av_per_frame_bandwidth; - - // Clip the buffer level at the maximum buffer size - if (cpi->bits_off_target > cpi->oxcf.maximum_buffer_size) - cpi->bits_off_target = cpi->oxcf.maximum_buffer_size; - - cm->current_video_frame++; - cpi->frames_since_key++; - -#if CONFIG_INTERNAL_STATS - cpi->count ++; -#endif - - cpi->buffer_level = cpi->bits_off_target; - - return; - } - else - cpi->decimation_count = cpi->decimation_factor; - } - // Decide how big to make the frame if (!vp8_pick_frame_size(cpi)) { @@ -3608,17 +3520,6 @@ static void encode_frame_to_data_rate cpi->ni_av_qi = (cpi->ni_tot_qi / cpi->ni_frames); } - // Set the count for maximum consequative dropped frames based upon the ratio of - // this frame size to the target average per frame bandwidth. - // (cpi->av_per_frame_bandwidth > 0) is just a sanity check to prevent / 0. - if (cpi->drop_frames_allowed && (cpi->av_per_frame_bandwidth > 0)) - { - cpi->max_drop_count = cpi->projected_frame_size / cpi->av_per_frame_bandwidth; - - if (cpi->max_drop_count > cpi->max_consec_dropped_frames) - cpi->max_drop_count = cpi->max_consec_dropped_frames; - } - // Update the buffer level variable. // Non-viewable frames are a special case and are treated as pure overhead. if ( !cm->show_frame ) diff --git a/vp8/encoder/onyx_int.h b/vp8/encoder/onyx_int.h index 49638323f8e953401580c87771827a931f5ef67a..f883ea5febffc1df0149e790a013a96896c32884 100644 --- a/vp8/encoder/onyx_int.h +++ b/vp8/encoder/onyx_int.h @@ -436,13 +436,6 @@ typedef struct VP8_COMP int cq_target_quality; - int drop_frames_allowed; // Are we permitted to drop frames? - int drop_frame; // Drop this frame? - int drop_count; // How many frames have we dropped? - int max_drop_count; // How many frames should we drop? - int max_consec_dropped_frames; // Limit number of consecutive frames that can be dropped. - - int ymode_count [VP8_YMODES]; /* intra MB type cts this frame */ int uv_mode_count[VP8_UV_MODES]; /* intra MB type cts this frame */ diff --git a/vp8/encoder/ratectrl.c b/vp8/encoder/ratectrl.c index 08169552f9ebe55c8f4dec20057468a39b22282b..2a86fc014452ae0713b1e3ae67ee842c9e51d824 100644 --- a/vp8/encoder/ratectrl.c +++ b/vp8/encoder/ratectrl.c @@ -738,16 +738,7 @@ int vp8_pick_frame_size(VP8_COMP *cpi) if (cm->frame_type == KEY_FRAME) calc_iframe_target_size(cpi); else - { calc_pframe_target_size(cpi); - // Check if we're dropping the frame: - if (cpi->drop_frame) - { - cpi->drop_frame = FALSE; - cpi->drop_count++; - return 0; - } - } return 1; } diff --git a/vp8/vp8_cx_iface.c b/vp8/vp8_cx_iface.c index 670811a1028257a8dc057fd9b52c50f1756e6904..47d3f25f7483b94a01840bf5044969a426bf7aec 100644 --- a/vp8/vp8_cx_iface.c +++ b/vp8/vp8_cx_iface.c @@ -269,9 +269,6 @@ static vpx_codec_err_t set_vp8e_config(VP8_CONFIG *oxcf, oxcf->lag_in_frames = cfg.g_lag_in_frames; } - oxcf->allow_df = (cfg.rc_dropframe_thresh > 0); - oxcf->drop_frames_water_mark = cfg.rc_dropframe_thresh; - // VBR only supported for now. // CBR code has been deprectated for experimental phase. // CQ mode not yet tested @@ -343,8 +340,6 @@ static vpx_codec_err_t set_vp8e_config(VP8_CONFIG *oxcf, printf("fixed_q: %d\n", oxcf->fixed_q); printf("worst_allowed_q: %d\n", oxcf->worst_allowed_q); printf("best_allowed_q: %d\n", oxcf->best_allowed_q); - printf("allow_df: %d\n", oxcf->allow_df); - printf("drop_frames_water_mark: %d\n", oxcf->drop_frames_water_mark); printf("two_pass_vbrbias: %d\n", oxcf->two_pass_vbrbias); printf("two_pass_vbrmin_section: %d\n", oxcf->two_pass_vbrmin_section); printf("two_pass_vbrmax_section: %d\n", oxcf->two_pass_vbrmax_section);