mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-19 07:24:34 +08:00
[hal_h264e]: Change hal_h264e debug flag
Change-Id: I6ace4915c1213f4c9c65678920a2ae863211c814 Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
@@ -31,7 +31,7 @@
|
|||||||
#include "hal_h264e_rkv.h"
|
#include "hal_h264e_rkv.h"
|
||||||
#include "hal_h264e_vepu1.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)
|
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;
|
H264eHwCfg *hw_cfg = &ctx->hw_cfg;
|
||||||
RK_U32 vcodec_type = 0;
|
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();
|
vcodec_type = mpp_get_vcodec_type();
|
||||||
if (vcodec_type & HAVE_RKVENC) {
|
if (vcodec_type & HAVE_RKVENC) {
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include "h264e_syntax.h"
|
#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_SIMPLE 0x00000010
|
||||||
#define H264E_DBG_REG 0x00000020
|
#define H264E_DBG_REG 0x00000020
|
||||||
@@ -51,23 +51,34 @@ extern RK_U32 h264e_hal_log_mode;
|
|||||||
|
|
||||||
#define h264e_hal_dbg(type, fmt, ...) \
|
#define h264e_hal_dbg(type, fmt, ...) \
|
||||||
do {\
|
do {\
|
||||||
if (h264e_hal_log_mode & type)\
|
if (hal_h264e_debug & type)\
|
||||||
mpp_log(fmt, ## __VA_ARGS__);\
|
mpp_log(fmt, ## __VA_ARGS__);\
|
||||||
} while (0)
|
} 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() \
|
#define h264e_hal_enter() \
|
||||||
do {\
|
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__);\
|
mpp_log("line(%d), func(%s), enter", __LINE__, __FUNCTION__);\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define h264e_hal_leave() \
|
#define h264e_hal_leave() \
|
||||||
do {\
|
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__);\
|
mpp_log("line(%d), func(%s), leave", __LINE__, __FUNCTION__);\
|
||||||
} while (0)
|
} 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_MIN(a,b) ( (a)<(b) ? (a) : (b) )
|
||||||
#define H264E_HAL_MAX(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)))
|
#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) \
|
#define H264E_HAL_SET_REG(reg, addr, val) \
|
||||||
do { \
|
do { \
|
||||||
reg[(addr)>>2] = (RK_U32)(val); \
|
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); \
|
mpp_log("line(%d) set reg[%03d/%03x]: %08x", __LINE__, (addr)>>2, addr, val); \
|
||||||
} while (0)
|
} 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, ...) \
|
#define H264E_HAL_SPRINT(s, len, ...) \
|
||||||
do { \
|
do { \
|
||||||
if (len > 0) { \
|
if (len > 0) { \
|
||||||
|
Reference in New Issue
Block a user