Add round_to_log_2()
[dcpomatic.git] / src / lib / util.cc
index 0646a478772a086704cfcb6b7e4d2d87408ab18c..33f24eeeb6f9e8d22148ef2c715f655a77c3a3c5 100644 (file)
@@ -1183,6 +1183,13 @@ to_upper (string s)
 }
 
 
+int
+round_to_log_2 (int x, int b)
+{
+       return x & ~ ((1 << b) - 1);
+}
+
+
 /* Set to 1 to print the IDs of some of our threads to stdout on creation */
 #define DCPOMATIC_DEBUG_THREADS 0