Remove unused code in drop_frame
Removed unused parameters and code related to drop_frame. Change-Id: I594e050d49b1805c6f72abf06005ef624256bb57
This commit is contained in:
parent
965d8686bb
commit
9904c28f5b
@ -1889,9 +1889,6 @@ struct VP8_COMP* vp8_create_compressor(VP8_CONFIG *oxcf)
|
||||
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;
|
||||
@ -4313,30 +4310,6 @@ static void encode_frame_to_data_rate
|
||||
}
|
||||
}
|
||||
|
||||
#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 )
|
||||
|
@ -436,10 +436,6 @@ typedef struct VP8_COMP
|
||||
|
||||
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 */
|
||||
|
@ -966,7 +966,7 @@ static void calc_pframe_target_size(VP8_COMP *cpi)
|
||||
// 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) )
|
||||
{
|
||||
@ -984,28 +984,13 @@ static void calc_pframe_target_size(VP8_COMP *cpi)
|
||||
//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:
|
||||
@ -1554,7 +1539,6 @@ int vp8_pick_frame_size(VP8_COMP *cpi)
|
||||
if (cpi->drop_frame)
|
||||
{
|
||||
cpi->drop_frame = 0;
|
||||
cpi->drop_count++;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user