Delete unused methods of the VideoProcessing class. And fix a typo.
Rename EnableDenosing --> EnableDenoising.
Delete VideoProcessing FrameStats methods.
Delete VideoProcessingImpl::BrightnessDetection and related files.
Delete VideoProcessingImpl::Deflickering and related files.
Delete VideoProcessing::Brighten.
BUG=
Review URL: https://codereview.webrtc.org/1901393003
Cr-Commit-Position: refs/heads/master@{#12521}
diff --git a/webrtc/modules/video_processing/video_processing_impl.cc b/webrtc/modules/video_processing/video_processing_impl.cc
index cb52c67..b4f86ae 100644
--- a/webrtc/modules/video_processing/video_processing_impl.cc
+++ b/webrtc/modules/video_processing/video_processing_impl.cc
@@ -18,21 +18,6 @@
namespace webrtc {
-namespace {
-
-int GetSubSamplingFactor(int width, int height) {
- if (width * height >= 640 * 480) {
- return 3;
- } else if (width * height >= 352 * 288) {
- return 2;
- } else if (width * height >= 176 * 144) {
- return 1;
- } else {
- return 0;
- }
-}
-} // namespace
-
VideoProcessing* VideoProcessing::Create() {
return new VideoProcessingImpl();
}
@@ -40,83 +25,6 @@
VideoProcessingImpl::VideoProcessingImpl() {}
VideoProcessingImpl::~VideoProcessingImpl() {}
-void VideoProcessing::GetFrameStats(const VideoFrame& frame,
- FrameStats* stats) {
- ClearFrameStats(stats); // The histogram needs to be zeroed out.
- if (frame.IsZeroSize()) {
- return;
- }
-
- int width = frame.width();
- int height = frame.height();
- stats->sub_sampling_factor = GetSubSamplingFactor(width, height);
-
- const uint8_t* buffer = frame.buffer(kYPlane);
- // Compute histogram and sum of frame
- for (int i = 0; i < height; i += (1 << stats->sub_sampling_factor)) {
- int k = i * width;
- for (int j = 0; j < width; j += (1 << stats->sub_sampling_factor)) {
- stats->hist[buffer[k + j]]++;
- stats->sum += buffer[k + j];
- }
- }
-
- stats->num_pixels = (width * height) / ((1 << stats->sub_sampling_factor) *
- (1 << stats->sub_sampling_factor));
- assert(stats->num_pixels > 0);
-
- // Compute mean value of frame
- stats->mean = stats->sum / stats->num_pixels;
-}
-
-bool VideoProcessing::ValidFrameStats(const FrameStats& stats) {
- if (stats.num_pixels == 0) {
- LOG(LS_WARNING) << "Invalid frame stats.";
- return false;
- }
- return true;
-}
-
-void VideoProcessing::ClearFrameStats(FrameStats* stats) {
- stats->mean = 0;
- stats->sum = 0;
- stats->num_pixels = 0;
- stats->sub_sampling_factor = 0;
- memset(stats->hist, 0, sizeof(stats->hist));
-}
-
-void VideoProcessing::Brighten(int delta, VideoFrame* frame) {
- RTC_DCHECK(!frame->IsZeroSize());
- RTC_DCHECK(frame->width() > 0);
- RTC_DCHECK(frame->height() > 0);
-
- int num_pixels = frame->width() * frame->height();
-
- int look_up[256];
- for (int i = 0; i < 256; i++) {
- int val = i + delta;
- look_up[i] = ((((val < 0) ? 0 : val) > 255) ? 255 : val);
- }
-
- uint8_t* temp_ptr = frame->buffer(kYPlane);
- for (int i = 0; i < num_pixels; i++) {
- *temp_ptr = static_cast<uint8_t>(look_up[*temp_ptr]);
- temp_ptr++;
- }
-}
-
-int32_t VideoProcessingImpl::Deflickering(VideoFrame* frame,
- FrameStats* stats) {
- rtc::CritScope mutex(&mutex_);
- return deflickering_.ProcessFrame(frame, stats);
-}
-
-int32_t VideoProcessingImpl::BrightnessDetection(const VideoFrame& frame,
- const FrameStats& stats) {
- rtc::CritScope mutex(&mutex_);
- return brightness_detection_.ProcessFrame(frame, stats);
-}
-
void VideoProcessingImpl::EnableTemporalDecimation(bool enable) {
rtc::CritScope mutex(&mutex_);
frame_pre_processor_.EnableTemporalDecimation(enable);
@@ -150,9 +58,9 @@
return frame_pre_processor_.GetDecimatedHeight();
}
-void VideoProcessingImpl::EnableDenosing(bool enable) {
+void VideoProcessingImpl::EnableDenoising(bool enable) {
rtc::CritScope cs(&mutex_);
- frame_pre_processor_.EnableDenosing(enable);
+ frame_pre_processor_.EnableDenoising(enable);
}
const VideoFrame* VideoProcessingImpl::PreprocessFrame(