[osal]: add mpp_ceil_log2 and mpp_clip function

git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@115 6e48237b-75ef-9749-8fc9-41990f28c85a
This commit is contained in:
ChenHengming
2015-08-17 09:24:09 +00:00
parent 32c1b2f18c
commit fa4fbd822c

View File

@@ -47,6 +47,18 @@ extern "C" {
RK_S32 mpp_log2(RK_U32 v);
RK_S32 mpp_log2_16bit(RK_U32 v);
static inline RK_S32 mpp_ceil_log2(RK_S32 x)
{
return mpp_log2((x - 1) << 1);
}
static inline RK_S32 mpp_clip(RK_S32 a, RK_S32 amin, RK_S32 amax)
{
if (a < amin) return amin;
else if (a > amax) return amax;
else return a;
}
#ifdef __cplusplus
}
#endif