Reformat the WebRTC code base
Running clang-format with chromium's style guide. The goal is n-fold: * providing consistency and readability (that's what code guidelines are for) * preventing noise with presubmit checks and git cl format * building on the previous point: making it easier to automatically fix format issues * you name it Please consider using git-hyper-blame to ignore this commit. Bug: webrtc:9340 Change-Id: I694567c4cdf8cee2860958cfe82bfaf25848bb87 Reviewed-on: https://webrtc-review.googlesource.com/81185 Reviewed-by: Patrik Höglund <phoglund@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23660}
This commit is contained in:
@ -14,8 +14,8 @@
|
||||
|
||||
#include "common_video/include/i420_buffer_pool.h"
|
||||
#include "modules/video_processing/video_denoiser.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/frame_utils.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/testsupport/fileutils.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -8,8 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <emmintrin.h>
|
||||
#include "modules/video_processing/util/denoiser_filter_sse2.h"
|
||||
#include <emmintrin.h>
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
|
||||
@ -16,11 +16,14 @@
|
||||
namespace webrtc {
|
||||
|
||||
// Fixed-point skin color model parameters.
|
||||
static const int skin_mean[5][2] = {
|
||||
{7463, 9614}, {6400, 10240}, {7040, 10240}, {8320, 9280}, {6800, 9614}};
|
||||
static const int skin_mean[5][2] = {{7463, 9614},
|
||||
{6400, 10240},
|
||||
{7040, 10240},
|
||||
{8320, 9280},
|
||||
{6800, 9614}};
|
||||
static const int skin_inv_cov[4] = {4107, 1663, 1663, 2157}; // q16
|
||||
static const int skin_threshold[6] = {1570636, 1400000, 800000, 800000, 800000,
|
||||
800000}; // q18
|
||||
static const int skin_threshold[6] = {1570636, 1400000, 800000,
|
||||
800000, 800000, 800000}; // q18
|
||||
|
||||
// Thresholds on luminance.
|
||||
static const int y_low = 40;
|
||||
@ -39,10 +42,9 @@ static int EvaluateSkinColorDifference(int cb, int cr, int idx) {
|
||||
const int cb_diff_q2 = (cb_diff_q12 + (1 << 9)) >> 10;
|
||||
const int cbcr_diff_q2 = (cbcr_diff_q12 + (1 << 9)) >> 10;
|
||||
const int cr_diff_q2 = (cr_diff_q12 + (1 << 9)) >> 10;
|
||||
const int skin_diff = skin_inv_cov[0] * cb_diff_q2 +
|
||||
skin_inv_cov[1] * cbcr_diff_q2 +
|
||||
skin_inv_cov[2] * cbcr_diff_q2 +
|
||||
skin_inv_cov[3] * cr_diff_q2;
|
||||
const int skin_diff =
|
||||
skin_inv_cov[0] * cb_diff_q2 + skin_inv_cov[1] * cbcr_diff_q2 +
|
||||
skin_inv_cov[2] * cbcr_diff_q2 + skin_inv_cov[3] * cr_diff_q2;
|
||||
return skin_diff;
|
||||
}
|
||||
|
||||
|
||||
0
modules/video_processing/util/skin_detection.h
Executable file → Normal file
0
modules/video_processing/util/skin_detection.h
Executable file → Normal file
@ -31,10 +31,14 @@ static void ShowRect(const std::unique_ptr<DenoiserFilter>& filter,
|
||||
const std::unique_ptr<uint8_t[]>& moving_edge_red,
|
||||
const std::unique_ptr<uint8_t[]>& x_density,
|
||||
const std::unique_ptr<uint8_t[]>& y_density,
|
||||
const uint8_t* u_src, int stride_u_src,
|
||||
const uint8_t* v_src, int stride_v_src,
|
||||
uint8_t* u_dst, int stride_u_dst,
|
||||
uint8_t* v_dst, int stride_v_dst,
|
||||
const uint8_t* u_src,
|
||||
int stride_u_src,
|
||||
const uint8_t* v_src,
|
||||
int stride_v_src,
|
||||
uint8_t* u_dst,
|
||||
int stride_u_dst,
|
||||
uint8_t* v_dst,
|
||||
int stride_v_dst,
|
||||
int mb_rows_,
|
||||
int mb_cols_) {
|
||||
for (int mb_row = 0; mb_row < mb_rows_; ++mb_row) {
|
||||
@ -323,20 +327,17 @@ rtc::scoped_refptr<I420BufferInterface> VideoDenoiser::DenoiseFrame(
|
||||
CopyLumaOnMargin(y_src, stride_y_src, y_dst, stride_y_dst);
|
||||
|
||||
// Copy u/v planes.
|
||||
libyuv::CopyPlane(frame->DataU(), frame->StrideU(),
|
||||
dst->MutableDataU(), dst->StrideU(),
|
||||
(width_ + 1) >> 1, (height_ + 1) >> 1);
|
||||
libyuv::CopyPlane(frame->DataV(), frame->StrideV(),
|
||||
dst->MutableDataV(), dst->StrideV(),
|
||||
(width_ + 1) >> 1, (height_ + 1) >> 1);
|
||||
libyuv::CopyPlane(frame->DataU(), frame->StrideU(), dst->MutableDataU(),
|
||||
dst->StrideU(), (width_ + 1) >> 1, (height_ + 1) >> 1);
|
||||
libyuv::CopyPlane(frame->DataV(), frame->StrideV(), dst->MutableDataV(),
|
||||
dst->StrideV(), (width_ + 1) >> 1, (height_ + 1) >> 1);
|
||||
|
||||
#if DISPLAY || DISPLAYNEON
|
||||
// Show rectangular region
|
||||
ShowRect(filter_, moving_edge_, moving_object_, x_density_, y_density_,
|
||||
frame->DataU(), frame->StrideU(), frame->DataV(), frame->StrideV(),
|
||||
dst->MutableDataU(), dst->StrideU(),
|
||||
dst->MutableDataV(), dst->StrideV(),
|
||||
mb_rows_, mb_cols_);
|
||||
dst->MutableDataU(), dst->StrideU(), dst->MutableDataV(),
|
||||
dst->StrideV(), mb_rows_, mb_cols_);
|
||||
#endif
|
||||
prev_buffer_ = dst;
|
||||
return dst;
|
||||
|
||||
Reference in New Issue
Block a user