Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Unified Diff: webrtc/modules/video_processing/brightness_detection.cc

Issue 1482913003: Initial VideoProcessing refactoring. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Based on pbos review Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/video_processing/brightness_detection.cc
diff --git a/webrtc/modules/video_processing/brightness_detection.cc b/webrtc/modules/video_processing/brightness_detection.cc
index eefb7966ec79ad07ebd470c8e47c0d3b86d95095..a54aba5187b415991675a357ab6d2c9a3a77f6c7 100644
--- a/webrtc/modules/video_processing/brightness_detection.cc
+++ b/webrtc/modules/video_processing/brightness_detection.cc
@@ -8,11 +8,12 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "webrtc/modules/video_processing/include/video_processing.h"
#include "webrtc/modules/video_processing/brightness_detection.h"
#include <math.h>
+#include "webrtc/modules/video_processing/include/video_processing.h"
+
namespace webrtc {
VPMBrightnessDetection::VPMBrightnessDetection() {
@@ -28,14 +29,14 @@ void VPMBrightnessDetection::Reset() {
int32_t VPMBrightnessDetection::ProcessFrame(
const VideoFrame& frame,
- const VideoProcessingModule::FrameStats& stats) {
+ const VideoProcessing::FrameStats& stats) {
if (frame.IsZeroSize()) {
return VPM_PARAMETER_ERROR;
}
int width = frame.width();
int height = frame.height();
- if (!VideoProcessingModule::ValidFrameStats(stats)) {
+ if (!VideoProcessing::ValidFrameStats(stats)) {
return VPM_PARAMETER_ERROR;
}
@@ -62,9 +63,9 @@ int32_t VPMBrightnessDetection::ProcessFrame(
// Standard deviation of Y
const uint8_t* buffer = frame.buffer(kYPlane);
float std_y = 0;
- for (int h = 0; h < height; h += (1 << stats.subSamplHeight)) {
+ for (int h = 0; h < height; h += (1 << stats.sub_sampling_factor)) {
int row = h*width;
- for (int w = 0; w < width; w += (1 << stats.subSamplWidth)) {
+ for (int w = 0; w < width; w += (1 << stats.sub_sampling_factor)) {
std_y += (buffer[w + row] - stats.mean) * (buffer[w + row] -
stats.mean);
}
@@ -122,11 +123,11 @@ int32_t VPMBrightnessDetection::ProcessFrame(
}
if (frame_cnt_dark_ > frame_cnt_alarm) {
- return VideoProcessingModule::kDarkWarning;
+ return VideoProcessing::kDarkWarning;
} else if (frame_cnt_bright_ > frame_cnt_alarm) {
- return VideoProcessingModule::kBrightWarning;
+ return VideoProcessing::kBrightWarning;
} else {
- return VideoProcessingModule::kNoWarning;
+ return VideoProcessing::kNoWarning;
}
}

Powered by Google App Engine
This is Rietveld 408576698