diff --git a/mpp/hal/common/h264/hal_h264e_api.c b/mpp/hal/common/h264/hal_h264e_api.c index 5bf744cc..f785a55c 100644 --- a/mpp/hal/common/h264/hal_h264e_api.c +++ b/mpp/hal/common/h264/hal_h264e_api.c @@ -31,7 +31,7 @@ #include "hal_h264e_rkv.h" #include "hal_h264e_vepu1.h" -RK_U32 h264e_hal_log_mode = 0; +RK_U32 hal_h264e_debug = 0; MPP_RET hal_h264e_init(void *hal, MppHalCfg *cfg) { @@ -44,7 +44,7 @@ MPP_RET hal_h264e_init(void *hal, MppHalCfg *cfg) H264eHwCfg *hw_cfg = &ctx->hw_cfg; RK_U32 vcodec_type = 0; - mpp_env_get_u32("h264e_hal_debug", &h264e_hal_log_mode, 0x00000001); + mpp_env_get_u32("hal_h264e_debug", &hal_h264e_debug, 0x00000001); vcodec_type = mpp_get_vcodec_type(); if (vcodec_type & HAVE_RKVENC) { diff --git a/mpp/hal/common/h264/hal_h264e_com.h b/mpp/hal/common/h264/hal_h264e_com.h index 2da23b0e..c2371a6e 100644 --- a/mpp/hal/common/h264/hal_h264e_com.h +++ b/mpp/hal/common/h264/hal_h264e_com.h @@ -26,7 +26,7 @@ #include "h264e_syntax.h" -extern RK_U32 h264e_hal_log_mode; +extern RK_U32 hal_h264e_debug; #define H264E_DBG_SIMPLE 0x00000010 #define H264E_DBG_REG 0x00000020 @@ -51,23 +51,34 @@ extern RK_U32 h264e_hal_log_mode; #define h264e_hal_dbg(type, fmt, ...) \ do {\ - if (h264e_hal_log_mode & type)\ + if (hal_h264e_debug & type)\ mpp_log(fmt, ## __VA_ARGS__);\ } while (0) +#define h264e_hal_dbg_f(type, fmt, ...) \ + do {\ + if (hal_h264e_debug & type)\ + mpp_log_f(fmt, ## __VA_ARGS__);\ + } while (0) + #define h264e_hal_enter() \ do {\ - if (h264e_hal_log_mode & H264E_DBG_FLOW)\ + if (hal_h264e_debug & H264E_DBG_FLOW)\ mpp_log("line(%d), func(%s), enter", __LINE__, __FUNCTION__);\ } while (0) #define h264e_hal_leave() \ do {\ - if (h264e_hal_log_mode & H264E_DBG_FLOW)\ + if (hal_h264e_debug & H264E_DBG_FLOW)\ mpp_log("line(%d), func(%s), leave", __LINE__, __FUNCTION__);\ } while (0) + +#define h264e_dpb_dbg(fmt, ...) h264e_hal_dbg(H264E_DBG_DPB, fmt, ## __VA_ARGS__) +#define h264e_dpb_dbg_f(fmt, ...) h264e_hal_dbg_f(H264E_DBG_DPB, fmt, ## __VA_ARGS__) + + #define H264E_HAL_MIN(a,b) ( (a)<(b) ? (a) : (b) ) #define H264E_HAL_MAX(a,b) ( (a)>(b) ? (a) : (b) ) #define H264E_HAL_MIN3(a,b,c) H264E_HAL_MIN((a),H264E_HAL_MIN((b),(c))) @@ -81,27 +92,10 @@ extern RK_U32 h264e_hal_log_mode; #define H264E_HAL_SET_REG(reg, addr, val) \ do { \ reg[(addr)>>2] = (RK_U32)(val); \ - if (h264e_hal_log_mode & 0/*H264E_HAL_LOG_INFO*/) \ + if (hal_h264e_debug & 0/*H264E_HAL_LOG_INFO*/) \ mpp_log("line(%d) set reg[%03d/%03x]: %08x", __LINE__, (addr)>>2, addr, val); \ } while (0) - -#define H264E_HAL_VALIDATE_GT(val, name, limit) \ - do { \ - if ((val)<=(limit)) { \ - mpp_err("%s(%d) should > %d", name, val, limit);\ - return MPP_NOK; \ - } \ - } while (0) - -#define H264E_HAL_VALIDATE_NEQ(val, name, limit) \ - do { \ - if((val)==(limit)) { \ - mpp_err("%s(%d) should not = %d", name, val, limit); \ - return MPP_NOK; \ - } \ - } while (0) - #define H264E_HAL_SPRINT(s, len, ...) \ do { \ if (len > 0) { \