mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-07 01:52:46 +08:00
[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:
@@ -47,6 +47,18 @@ extern "C" {
|
|||||||
RK_S32 mpp_log2(RK_U32 v);
|
RK_S32 mpp_log2(RK_U32 v);
|
||||||
RK_S32 mpp_log2_16bit(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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user