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

Unified Diff: webrtc/modules/video_coding/utility/quality_scaler.cc

Issue 2341433004: Fix undefined reference to log2 on android (Closed)
Patch Set: Clarify comment Created 4 years, 3 months 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/utility/quality_scaler.cc
diff --git a/webrtc/modules/video_coding/utility/quality_scaler.cc b/webrtc/modules/video_coding/utility/quality_scaler.cc
index 99bc6dad223bdaa58fcfcb56da6d451cf0ab0ad4..7ef7c575ba4b699210fca7c4e40f0b557a54d440 100644
--- a/webrtc/modules/video_coding/utility/quality_scaler.cc
+++ b/webrtc/modules/video_coding/utility/quality_scaler.cc
@@ -10,8 +10,15 @@
#include "webrtc/modules/video_coding/utility/quality_scaler.h"
+#include <math.h>
+
#include <algorithm>
-#include <cmath>
+
+// TODO(kthelgason): Some versions of Android have issues with log2.
+// See https://code.google.com/p/android/issues/detail?id=212634 for details
+#if defined(WEBRTC_ANDROID)
+#define log2(x) (log(x) / log(2))
+#endif
namespace webrtc {
@@ -182,7 +189,7 @@ void QualityScaler::UpdateTargetResolution(int width, int height) {
maximum_shift_ = 0;
} else {
maximum_shift_ = static_cast<int>(
- std::log2(std::min(width, height) / kMinDownscaleDimension));
+ log2(std::min(width, height) / kMinDownscaleDimension));
}
target_res_ = Resolution{width, height};
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698