diff --git a/media/webrtc/trunk/webrtc/modules/video_coding/main/source/content_metrics_processing.cc b/media/webrtc/trunk/webrtc/modules/video_coding/main/source/content_metrics_processing.cc index 757ffb0e46f..9e142613c58 100644 --- a/media/webrtc/trunk/webrtc/modules/video_coding/main/source/content_metrics_processing.cc +++ b/media/webrtc/trunk/webrtc/modules/video_coding/main/source/content_metrics_processing.cc @@ -21,7 +21,7 @@ namespace webrtc { ////////////////////////////////// VCMContentMetricsProcessing::VCMContentMetricsProcessing() - : recursive_avg_factor_(1 / 150.0f), // matched to 30fps. + : recursive_avg_factor_(1 / 150.0f), // matched to 15fps. frame_cnt_uniform_avg_(0), avg_motion_level_(0.0f), avg_spatial_level_(0.0f) { @@ -43,7 +43,7 @@ int VCMContentMetricsProcessing::Reset() { return VCM_OK; } -void VCMContentMetricsProcessing::UpdateFrameRate(uint32_t frameRate) { +void VCMContentMetricsProcessing::UpdateFrameRate(float frameRate) { // Update factor for recursive averaging. recursive_avg_factor_ = static_cast (1000.0f) / static_cast(frameRate * kQmMinIntervalMs); diff --git a/media/webrtc/trunk/webrtc/modules/video_coding/main/source/content_metrics_processing.h b/media/webrtc/trunk/webrtc/modules/video_coding/main/source/content_metrics_processing.h index 3517f757d46..06c036ddd28 100644 --- a/media/webrtc/trunk/webrtc/modules/video_coding/main/source/content_metrics_processing.h +++ b/media/webrtc/trunk/webrtc/modules/video_coding/main/source/content_metrics_processing.h @@ -45,7 +45,7 @@ class VCMContentMetricsProcessing { int Reset(); // Inform class of current frame rate. - void UpdateFrameRate(uint32_t frameRate); + void UpdateFrameRate(float frameRate); // Returns the long-term averaged content data: recursive average over longer // time scale. diff --git a/media/webrtc/trunk/webrtc/modules/video_coding/main/source/media_optimization.cc b/media/webrtc/trunk/webrtc/modules/video_coding/main/source/media_optimization.cc index 57f437e79d8..2d34a6a2812 100644 --- a/media/webrtc/trunk/webrtc/modules/video_coding/main/source/media_optimization.cc +++ b/media/webrtc/trunk/webrtc/modules/video_coding/main/source/media_optimization.cc @@ -152,9 +152,9 @@ static int GreatestCommonDenominator(int a, int b) { } void MediaOptimization::SetEncodingData(VideoCodecType send_codec_type, - int32_t max_bit_rate, - uint32_t frame_rate, - uint32_t target_bitrate, + int32_t max_bit_rate, // in bits/s + uint32_t frame_rate, // in fps*1000 + uint32_t target_bitrate, // in bits/s uint16_t width, uint16_t height, uint8_t divisor, @@ -166,19 +166,19 @@ void MediaOptimization::SetEncodingData(VideoCodecType send_codec_type, // after the processing of the first frame. last_change_time_ = clock_->TimeInMilliseconds(); content_->Reset(); - content_->UpdateFrameRate(frame_rate); + content_->UpdateFrameRate(static_cast(frame_rate) / 1000.0f); max_bit_rate_ = max_bit_rate; send_codec_type_ = send_codec_type; target_bit_rate_ = target_bitrate; float target_bitrate_kbps = static_cast(target_bitrate) / 1000.0f; loss_prot_logic_->UpdateBitRate(target_bitrate_kbps); - loss_prot_logic_->UpdateFrameRate(static_cast(frame_rate)); + loss_prot_logic_->UpdateFrameRate(static_cast(frame_rate) / 1000.0f); loss_prot_logic_->UpdateFrameSize(width, height); loss_prot_logic_->UpdateNumLayers(num_layers); frame_dropper_->Reset(); - frame_dropper_->SetRates(target_bitrate_kbps, static_cast(frame_rate)); - user_frame_rate_ = static_cast(frame_rate); + frame_dropper_->SetRates(target_bitrate_kbps, static_cast(frame_rate) / 1000.0f); + user_frame_rate_ = static_cast(frame_rate)/1000.0f; codec_width_ = width; codec_height_ = height; int gcd = GreatestCommonDenominator(codec_width_, codec_height_);