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

Unified Diff: webrtc/audio/conversion.h

Issue 1414743004: Implement AudioSendStream::GetStats(). (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: comments Created 5 years, 2 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
Index: webrtc/audio/conversion.h
diff --git a/webrtc/audio/conversion.h b/webrtc/audio/conversion.h
index c1cf9b632e87432f8d172e2edd1fa164365e5eeb..6ae32432d3820742d3ccf4b748cdca98a22d9fe6 100644
--- a/webrtc/audio/conversion.h
+++ b/webrtc/audio/conversion.h
@@ -13,8 +13,13 @@
namespace webrtc {
+// Convert fixed point number with 8 bit fractional part, to floating point.
+inline float Q8ToFloat(uint32_t v) {
+ return static_cast<float>(v) / (1 << 8);
+}
+
// Convert fixed point number with 14 bit fractional part, to floating point.
-inline float Q14ToFloat(uint16_t v) {
+inline float Q14ToFloat(uint32_t v) {
return static_cast<float>(v) / (1 << 14);
}
kwiberg-webrtc 2015/10/26 13:19:53 Would it make sense to just have one function, and
the sun 2015/10/26 14:44:02 Yes maybe... though I'm thinking that the internal
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698