From abb089431d0467c3609207d0b27359ef08a6c16d Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 6 Nov 2019 21:35:49 +0100 Subject: common: add a helper to round up to next power of 2 This is something relatively frequently needed, and there must be half a dozen ad-hoc implementations in mpv. The next commit uses this, the suspected duplicate implementations are hiding. --- common/common.h | 1 + 1 file changed, 1 insertion(+) (limited to 'common/common.h') diff --git a/common/common.h b/common/common.h index 5e6950c931..8dbb304625 100644 --- a/common/common.h +++ b/common/common.h @@ -89,6 +89,7 @@ bool mp_rect_contains(struct mp_rect *rc, int x, int y); bool mp_rect_equals(struct mp_rect *rc1, struct mp_rect *rc2); unsigned int mp_log2(uint32_t v); +uint32_t mp_round_next_power_of_2(uint32_t v); int mp_snprintf_cat(char *str, size_t size, const char *format, ...) PRINTF_ATTRIBUTE(3, 4); -- cgit v1.2.3