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

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

Issue 1508793002: Clang format of video_processing folder. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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
« no previous file with comments | « no previous file | webrtc/modules/video_processing/content_analysis.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a54aba5187b415991675a357ab6d2c9a3a77f6c7..7455cf975917c08c629e4e63d3fd9c083d11e1ee 100644
--- a/webrtc/modules/video_processing/brightness_detection.cc
+++ b/webrtc/modules/video_processing/brightness_detection.cc
@@ -64,10 +64,10 @@ int32_t VPMBrightnessDetection::ProcessFrame(
const uint8_t* buffer = frame.buffer(kYPlane);
float std_y = 0;
for (int h = 0; h < height; h += (1 << stats.sub_sampling_factor)) {
- int row = h*width;
+ int row = h * width;
for (int w = 0; w < width; w += (1 << stats.sub_sampling_factor)) {
- std_y += (buffer[w + row] - stats.mean) * (buffer[w + row] -
- stats.mean);
+ std_y +=
+ (buffer[w + row] - stats.mean) * (buffer[w + row] - stats.mean);
}
}
std_y = sqrt(std_y / stats.num_pixels);
@@ -82,37 +82,39 @@ int32_t VPMBrightnessDetection::ProcessFrame(
float posPerc95 = stats.num_pixels * 0.95f;
for (uint32_t i = 0; i < 256; i++) {
sum += stats.hist[i];
- if (sum < pos_perc05) perc05 = i; // 5th perc.
- if (sum < pos_median) median_y = i; // 50th perc.
+ if (sum < pos_perc05)
+ perc05 = i; // 5th perc.
+ if (sum < pos_median)
+ median_y = i; // 50th perc.
if (sum < posPerc95)
- perc95 = i; // 95th perc.
+ perc95 = i; // 95th perc.
else
break;
}
- // Check if image is too dark
- if ((std_y < 55) && (perc05 < 50)) {
- if (median_y < 60 || stats.mean < 80 || perc95 < 130 ||
- prop_low > 0.20) {
- frame_cnt_dark_++;
- } else {
- frame_cnt_dark_ = 0;
- }
+ // Check if image is too dark
+ if ((std_y < 55) && (perc05 < 50)) {
+ if (median_y < 60 || stats.mean < 80 || perc95 < 130 ||
+ prop_low > 0.20) {
+ frame_cnt_dark_++;
} else {
frame_cnt_dark_ = 0;
}
+ } else {
+ frame_cnt_dark_ = 0;
+ }
- // Check if image is too bright
- if ((std_y < 52) && (perc95 > 200) && (median_y > 160)) {
- if (median_y > 185 || stats.mean > 185 || perc05 > 140 ||
- prop_high > 0.25) {
- frame_cnt_bright_++;
- } else {
- frame_cnt_bright_ = 0;
- }
+ // Check if image is too bright
+ if ((std_y < 52) && (perc95 > 200) && (median_y > 160)) {
+ if (median_y > 185 || stats.mean > 185 || perc05 > 140 ||
+ prop_high > 0.25) {
+ frame_cnt_bright_++;
} else {
frame_cnt_bright_ = 0;
}
+ } else {
+ frame_cnt_bright_ = 0;
+ }
} else {
frame_cnt_dark_ = 0;
frame_cnt_bright_ = 0;
« no previous file with comments | « no previous file | webrtc/modules/video_processing/content_analysis.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698