Commit b9a7045b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

OpenGL: use clz()

parent 0af63c4f
......@@ -93,14 +93,11 @@
# define VLCGL_TYPE VLCGL_RGB_TYPE
#endif
static inline int GetAlignedSize(int i_size)
static inline int GetAlignedSize(unsigned size)
{
/* Return the nearest power of 2 */
int i_result = 1;
while(i_result < i_size)
i_result *= 2;
return i_result;
/* Return the smallest larger or equal power of 2 */
unsigned align = 1 << (8 * sizeof (unsigned) - clz(size));
return ((align >> 1) == size) ? size : align;
}
int vout_display_opengl_Init(vout_display_opengl_t *vgl,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment