OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include "webrtc/modules/video_coding/main/source/content_metrics_processing.h" | 11 #include "webrtc/modules/video_coding/main/source/content_metrics_processing.h" |
12 | 12 |
13 #include <math.h> | 13 #include <math.h> |
14 | 14 |
15 #include "webrtc/modules/interface/module_common_types.h" | 15 #include "webrtc/modules/include/module_common_types.h" |
16 #include "webrtc/modules/video_coding/main/interface/video_coding_defines.h" | 16 #include "webrtc/modules/video_coding/main/interface/video_coding_defines.h" |
17 | 17 |
18 namespace webrtc { | 18 namespace webrtc { |
19 ////////////////////////////////// | 19 ////////////////////////////////// |
20 /// VCMContentMetricsProcessing // | 20 /// VCMContentMetricsProcessing // |
21 ////////////////////////////////// | 21 ////////////////////////////////// |
22 | 22 |
23 VCMContentMetricsProcessing::VCMContentMetricsProcessing() | 23 VCMContentMetricsProcessing::VCMContentMetricsProcessing() |
24 : recursive_avg_factor_(1 / 150.0f), // matched to 30fps. | 24 : recursive_avg_factor_(1 / 150.0f), // matched to 30fps. |
25 frame_cnt_uniform_avg_(0), | 25 frame_cnt_uniform_avg_(0), |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 recursive_avg_->spatial_pred_err_v = (1 - recursive_avg_factor_) * | 116 recursive_avg_->spatial_pred_err_v = (1 - recursive_avg_factor_) * |
117 recursive_avg_->spatial_pred_err_v + | 117 recursive_avg_->spatial_pred_err_v + |
118 recursive_avg_factor_ * contentMetrics->spatial_pred_err_v; | 118 recursive_avg_factor_ * contentMetrics->spatial_pred_err_v; |
119 | 119 |
120 // Motion metric: Derived from NFD (normalized frame difference). | 120 // Motion metric: Derived from NFD (normalized frame difference). |
121 recursive_avg_->motion_magnitude = (1 - recursive_avg_factor_) * | 121 recursive_avg_->motion_magnitude = (1 - recursive_avg_factor_) * |
122 recursive_avg_->motion_magnitude + | 122 recursive_avg_->motion_magnitude + |
123 recursive_avg_factor_ * contentMetrics->motion_magnitude; | 123 recursive_avg_factor_ * contentMetrics->motion_magnitude; |
124 } | 124 } |
125 } // namespace | 125 } // namespace |
OLD | NEW |