Removed unused parameters and code related to drop_frame.
Change-Id: I594e050d49b1805c6f72abf06005ef624256bb57
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;
}
}
-#if 0
-
- // If the frame was massively oversize and we are below optimal buffer level drop next frame
- if ((cpi->drop_frames_allowed) &&
- (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) &&
- (cpi->buffer_level < cpi->oxcf.drop_frames_water_mark * cpi->oxcf.optimal_buffer_level / 100) &&
- (cpi->projected_frame_size > (4 * cpi->this_frame_target)))
- {
- cpi->drop_frame = 1;
- }
-
-#endif
-
- // Set the count for maximum consecutive 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 )
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 */
// In unbufferd mode (eg vide conferencing) the descision to
// code or drop a frame is made outside the codec in response to real
// world comms or buffer considerations.
- if (cpi->drop_frames_allowed && cpi->buffered_mode &&
+ if (cpi->drop_frames_allowed &&
(cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) &&
((cpi->common.frame_type != KEY_FRAME))) //|| !cpi->oxcf.allow_spatial_resampling) )
{
//vpx_log("Decoder: Drop frame due to bandwidth: %d \n",cpi->buffer_level, cpi->av_per_frame_bandwidth);
cpi->drop_frame = 1;
- }
-
-#if 0
- // Check for other drop frame crtieria (Note 2 pass cbr uses decimation on whole KF sections)
- else if ((cpi->buffer_level < cpi->oxcf.drop_frames_water_mark * cpi->oxcf.optimal_buffer_level / 100) &&
- (cpi->drop_count < cpi->max_drop_count) && (cpi->pass == 0))
- {
- cpi->drop_frame = 1;
- }
-#endif
-
- if (cpi->drop_frame)
- {
// Update the buffer level variable.
cpi->bits_off_target += cpi->av_per_frame_bandwidth;
if (cpi->bits_off_target > cpi->oxcf.maximum_buffer_size)
cpi->bits_off_target = cpi->oxcf.maximum_buffer_size;
cpi->buffer_level = cpi->bits_off_target;
}
- else
- cpi->drop_count = 0;
}
// Adjust target frame size for Golden Frames:
if (cpi->drop_frame)
{
cpi->drop_frame = 0;
- cpi->drop_count++;
return 0;
}
}