Increase VPMVideoDecimator's initial max_frame_rate_ to 60, which allow us potentially do 60fps.

BUG=
R=stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/21499006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6274 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/video_coding/main/test/quality_modes_test.cc b/webrtc/modules/video_coding/main/test/quality_modes_test.cc
index 385f197..d488fa9 100644
--- a/webrtc/modules/video_coding/main/test/quality_modes_test.cc
+++ b/webrtc/modules/video_coding/main/test/quality_modes_test.cc
@@ -249,7 +249,6 @@
 
   VideoContentMetrics* contentMetrics = NULL;
   // setting user frame rate
-  _vpm->SetMaxFramerate((uint32_t)(_nativeFrameRate+ 0.5f));
   // for starters: keeping native values:
   _vpm->SetTargetResolution(_width, _height,
                             (uint32_t)(_frameRate+ 0.5f));
diff --git a/webrtc/modules/video_processing/main/interface/video_processing.h b/webrtc/modules/video_processing/main/interface/video_processing.h
index b3e0483..817d43d9 100644
--- a/webrtc/modules/video_processing/main/interface/video_processing.h
+++ b/webrtc/modules/video_processing/main/interface/video_processing.h
@@ -236,14 +236,6 @@
                                       uint32_t frame_rate) = 0;
 
   /**
-  Set max frame rate
-  \param[in] max_frame_rate: maximum frame rate (limited to native frame rate)
-
-  \return VPM_OK on success, a negative value on error (see error codes)
-  */
-  virtual int32_t SetMaxFramerate(uint32_t max_frame_rate) = 0;
-
-  /**
   Get decimated(target) frame rate
   */
   virtual uint32_t Decimatedframe_rate() = 0;
diff --git a/webrtc/modules/video_processing/main/source/frame_preprocessor.cc b/webrtc/modules/video_processing/main/source/frame_preprocessor.cc
index 8050f70..e1cd04f 100644
--- a/webrtc/modules/video_processing/main/source/frame_preprocessor.cc
+++ b/webrtc/modules/video_processing/main/source/frame_preprocessor.cc
@@ -15,7 +15,6 @@
 VPMFramePreprocessor::VPMFramePreprocessor()
     : id_(0),
       content_metrics_(NULL),
-      max_frame_rate_(0),
       resampled_frame_(),
       enable_ca_(false),
       frame_cnt_(0) {
@@ -59,14 +58,6 @@
   spatial_resampler_->SetInputFrameResampleMode(resampling_mode);
 }
 
-int32_t VPMFramePreprocessor::SetMaxFramerate(uint32_t max_frame_rate) {
-  if (max_frame_rate == 0) return VPM_PARAMETER_ERROR;
-
-  // Max allowed frame_rate.
-  max_frame_rate_ = max_frame_rate;
-  return vd_->SetMaxFramerate(max_frame_rate);
-}
-
 int32_t VPMFramePreprocessor::SetTargetResolution(
     uint32_t width, uint32_t height, uint32_t frame_rate) {
   if ( (width == 0) || (height == 0) || (frame_rate == 0)) {
@@ -77,7 +68,7 @@
 
   if (ret_val < 0) return ret_val;
 
-  ret_val = vd_->SetTargetframe_rate(frame_rate);
+  ret_val = vd_->SetTargetFramerate(frame_rate);
   if (ret_val < 0) return ret_val;
 
   return VPM_OK;
diff --git a/webrtc/modules/video_processing/main/source/frame_preprocessor.h b/webrtc/modules/video_processing/main/source/frame_preprocessor.h
index ca62d38..64a5797 100644
--- a/webrtc/modules/video_processing/main/source/frame_preprocessor.h
+++ b/webrtc/modules/video_processing/main/source/frame_preprocessor.h
@@ -39,9 +39,6 @@
   // Enable content analysis.
   void EnableContentAnalysis(bool enable);
 
-  // Set max frame rate.
-  int32_t SetMaxFramerate(uint32_t max_frame_rate);
-
   // Set target resolution: frame rate and dimension.
   int32_t SetTargetResolution(uint32_t width, uint32_t height,
                               uint32_t frame_rate);
@@ -68,7 +65,6 @@
 
   int32_t id_;
   VideoContentMetrics* content_metrics_;
-  uint32_t max_frame_rate_;
   I420VideoFrame resampled_frame_;
   VPMSpatialResampler* spatial_resampler_;
   VPMContentAnalysis* ca_;
diff --git a/webrtc/modules/video_processing/main/source/video_decimator.cc b/webrtc/modules/video_processing/main/source/video_decimator.cc
index 8fd3d03..bf05bd7 100644
--- a/webrtc/modules/video_processing/main/source/video_decimator.cc
+++ b/webrtc/modules/video_processing/main/source/video_decimator.cc
@@ -16,15 +16,7 @@
 
 namespace webrtc {
 
-VPMVideoDecimator::VPMVideoDecimator()
-    : overshoot_modifier_(0),
-      drop_count_(0),
-      keep_count_(0),
-      target_frame_rate_(30),
-      incoming_frame_rate_(0.0f),
-      max_frame_rate_(30),
-      incoming_frame_times_(),
-      enable_temporal_decimation_(true) {
+VPMVideoDecimator::VPMVideoDecimator() {
   Reset();
 }
 
@@ -36,7 +28,6 @@
   keep_count_ = 0;
   target_frame_rate_ = 30;
   incoming_frame_rate_ = 0.0f;
-  max_frame_rate_ = 30;
   memset(incoming_frame_times_, 0, sizeof(incoming_frame_times_));
   enable_temporal_decimation_ = true;
 }
@@ -45,26 +36,10 @@
   enable_temporal_decimation_ = enable;
 }
 
-int32_t VPMVideoDecimator::SetMaxFramerate(uint32_t max_frame_rate) {
-  if (max_frame_rate == 0) return VPM_PARAMETER_ERROR;
-
-  max_frame_rate_ = max_frame_rate;
-
-  if (target_frame_rate_ > max_frame_rate_)
-    target_frame_rate_ = max_frame_rate_;
-
-  return VPM_OK;
-}
-
-int32_t VPMVideoDecimator::SetTargetframe_rate(uint32_t frame_rate) {
+int32_t VPMVideoDecimator::SetTargetFramerate(uint32_t frame_rate) {
   if (frame_rate == 0) return VPM_PARAMETER_ERROR;
 
-  if (frame_rate > max_frame_rate_) {
-    // Override.
-    target_frame_rate_ = max_frame_rate_;
-  } else {
-    target_frame_rate_ = frame_rate;
-  }
+  target_frame_rate_ = frame_rate;
   return VPM_OK;
 }
 
diff --git a/webrtc/modules/video_processing/main/source/video_decimator.h b/webrtc/modules/video_processing/main/source/video_decimator.h
index d17da61..fca74ae 100644
--- a/webrtc/modules/video_processing/main/source/video_decimator.h
+++ b/webrtc/modules/video_processing/main/source/video_decimator.h
@@ -25,8 +25,7 @@
 
   void EnableTemporalDecimation(bool enable);
 
-  int32_t SetMaxFramerate(uint32_t max_frame_rate);
-  int32_t SetTargetframe_rate(uint32_t frame_rate);
+  int32_t SetTargetFramerate(uint32_t frame_rate);
 
   bool DropFrame();
 
@@ -50,7 +49,6 @@
   uint32_t keep_count_;
   uint32_t target_frame_rate_;
   float incoming_frame_rate_;
-  uint32_t max_frame_rate_;
   int64_t incoming_frame_times_[kFrameCountHistory_size];
   bool enable_temporal_decimation_;
 };
diff --git a/webrtc/modules/video_processing/main/source/video_processing_impl.cc b/webrtc/modules/video_processing/main/source/video_processing_impl.cc
index 999227e..3560030 100644
--- a/webrtc/modules/video_processing/main/source/video_processing_impl.cc
+++ b/webrtc/modules/video_processing/main/source/video_processing_impl.cc
@@ -171,11 +171,6 @@
   frame_pre_processor_.SetInputFrameResampleMode(resampling_mode);
 }
 
-int32_t VideoProcessingModuleImpl::SetMaxFramerate(uint32_t max_frame_rate) {
-  CriticalSectionScoped cs(&mutex_);
-  return frame_pre_processor_.SetMaxFramerate(max_frame_rate);
-}
-
 int32_t VideoProcessingModuleImpl::SetTargetResolution(uint32_t width,
                                                        uint32_t height,
                                                        uint32_t frame_rate) {
diff --git a/webrtc/modules/video_processing/main/source/video_processing_impl.h b/webrtc/modules/video_processing/main/source/video_processing_impl.h
index 913bb64..deae6ff 100644
--- a/webrtc/modules/video_processing/main/source/video_processing_impl.h
+++ b/webrtc/modules/video_processing/main/source/video_processing_impl.h
@@ -51,9 +51,6 @@
   // Enable content analysis
   virtual void EnableContentAnalysis(bool enable);
 
-  // Set max frame rate
-  virtual int32_t SetMaxFramerate(uint32_t max_frame_rate);
-
   // Set Target Resolution: frame rate and dimension
   virtual int32_t SetTargetResolution(uint32_t width,
                                       uint32_t height,
diff --git a/webrtc/modules/video_processing/main/test/unit_test/video_processing_unittest.cc b/webrtc/modules/video_processing/main/test/unit_test/video_processing_unittest.cc
index 9d70e67..973552c 100644
--- a/webrtc/modules/video_processing/main/test/unit_test/video_processing_unittest.cc
+++ b/webrtc/modules/video_processing/main/test/unit_test/video_processing_unittest.cc
@@ -118,7 +118,6 @@
   EXPECT_EQ(-3, vpm_->BrightnessDetection(video_frame_, stats));
 
   EXPECT_EQ(VPM_PARAMETER_ERROR, vpm_->SetTargetResolution(0,0,0));
-  EXPECT_EQ(VPM_PARAMETER_ERROR, vpm_->SetMaxFramerate(0));
 
   I420VideoFrame *out_frame = NULL;
   EXPECT_EQ(VPM_PARAMETER_ERROR, vpm_->PreprocessFrame(video_frame_,
@@ -200,7 +199,6 @@
   // Disable temporal sampling (frame dropping).
   vpm_->EnableTemporalDecimation(false);
   int resolution = 100;
-  EXPECT_EQ(VPM_OK, vpm_->SetMaxFramerate(30));
   EXPECT_EQ(VPM_OK, vpm_->SetTargetResolution(resolution, resolution, 15));
   EXPECT_EQ(VPM_OK, vpm_->SetTargetResolution(resolution, resolution, 30));
   // Disable spatial sampling.