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

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

Issue 2341433004: Fix undefined reference to log2 on android (Closed)
Patch Set: 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..ba43be54ddda1199f0e8ab730c68fb3253ad4575 100644
--- a/webrtc/modules/video_coding/utility/quality_scaler.cc
+++ b/webrtc/modules/video_coding/utility/quality_scaler.cc
@@ -10,8 +10,14 @@
#include "webrtc/modules/video_coding/utility/quality_scaler.h"
+#include <math.h>
nisse-webrtc 2016/09/15 08:22:12 Why switching from cmath to math.h? Just to drop t
kthelgason 2016/09/15 08:25:15 Yep.
+
#include <algorithm>
-#include <cmath>
+
+// Android does not support log2
nisse-webrtc 2016/09/15 08:22:12 [citation needed] Is there any documentation or b
kthelgason 2016/09/15 08:25:15 I found some references to this on the internet, i
+#if defined(WEBRTC_ANDROID)
+#define log2(x) (log(x) / log(2))
+#endif
namespace webrtc {
@@ -182,7 +188,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