diff --git a/mpp/base/mpp_buffer_impl.cpp b/mpp/base/mpp_buffer_impl.cpp index 84e45d35..e6f2ccca 100644 --- a/mpp/base/mpp_buffer_impl.cpp +++ b/mpp/base/mpp_buffer_impl.cpp @@ -121,8 +121,8 @@ static const char *ops2str[BUF_OPS_BUTT] = { "buf destroy", }; -static MppMemPool mpp_buffer_pool = mpp_mem_pool_init(sizeof(MppBufferImpl)); -static MppMemPool mpp_buf_grp_pool = mpp_mem_pool_init(sizeof(MppBufferGroupImpl)); +static MppMemPool mpp_buffer_pool = mpp_mem_pool_init_f(MODULE_TAG, sizeof(MppBufferImpl)); +static MppMemPool mpp_buf_grp_pool = mpp_mem_pool_init_f("mpp_buf_grp", sizeof(MppBufferGroupImpl)); RK_U32 mpp_buffer_debug = 0; diff --git a/mpp/base/mpp_frame.cpp b/mpp/base/mpp_frame.cpp index 7010626a..e4e0dbd9 100644 --- a/mpp/base/mpp_frame.cpp +++ b/mpp/base/mpp_frame.cpp @@ -26,7 +26,7 @@ #include "mpp_mem_pool.h" static const char *module_name = MODULE_TAG; -static MppMemPool mpp_frame_pool = mpp_mem_pool_init(sizeof(MppFrameImpl)); +static MppMemPool mpp_frame_pool = mpp_mem_pool_init_f(module_name, sizeof(MppFrameImpl)); static void setup_mpp_frame_name(MppFrameImpl *frame) { diff --git a/mpp/base/mpp_packet.cpp b/mpp/base/mpp_packet.cpp index 19f1b914..77b5d401 100644 --- a/mpp/base/mpp_packet.cpp +++ b/mpp/base/mpp_packet.cpp @@ -24,7 +24,7 @@ #include "mpp_meta_impl.h" static const char *module_name = MODULE_TAG; -static MppMemPool mpp_packet_pool = mpp_mem_pool_init(sizeof(MppPacketImpl)); +static MppMemPool mpp_packet_pool = mpp_mem_pool_init_f(module_name, sizeof(MppPacketImpl)); #define setup_mpp_packet_name(packet) \ ((MppPacketImpl*)packet)->name = module_name; diff --git a/mpp/codec/dec/m2v/m2vd_parser.c b/mpp/codec/dec/m2v/m2vd_parser.c index 62eb7c11..b8bd118b 100755 --- a/mpp/codec/dec/m2v/m2vd_parser.c +++ b/mpp/codec/dec/m2v/m2vd_parser.c @@ -1113,8 +1113,8 @@ static MPP_RET m2vd_alloc_frame(M2VDParserContext *ctx) if ((pts > ctx->PreGetFrameTime) && (ctx->GroupFrameCnt > 0)) { tmp_frame_period = (tmp_frame_period * 256) / ctx->GroupFrameCnt; if ((tmp_frame_period > 4200) && (tmp_frame_period < 11200) && - (abs(ctx->frame_period - tmp_frame_period) > 128)) { - if (abs(ctx->preframe_period - tmp_frame_period) > 128) + (llabs(ctx->frame_period - tmp_frame_period) > 128)) { + if (llabs(ctx->preframe_period - tmp_frame_period) > 128) ctx->preframe_period = tmp_frame_period; else ctx->frame_period = tmp_frame_period; @@ -1458,8 +1458,8 @@ MPP_RET m2vd_parser_parse(void *ctx, HalDecTask *in_task) mpp_frame_set_color_trc(frame, p->dxva_ctx->seq_disp_ext.transfer_characteristics); mpp_frame_set_colorspace(frame, p->dxva_ctx->seq_disp_ext.matrix_coefficients); } else { - mpp_frame_set_color_primaries(frame, MPP_FRAME_SPC_UNSPECIFIED); - mpp_frame_set_color_trc(frame, MPP_FRAME_SPC_UNSPECIFIED); + mpp_frame_set_color_primaries(frame, MPP_FRAME_PRI_UNSPECIFIED); + mpp_frame_set_color_trc(frame, MPP_FRAME_TRC_UNSPECIFIED); mpp_frame_set_colorspace(frame, MPP_FRAME_SPC_UNSPECIFIED); } diff --git a/mpp/codec/rc/rc_model_v2_smt.c b/mpp/codec/rc/rc_model_v2_smt.c index da03933b..9ac4fb23 100644 --- a/mpp/codec/rc/rc_model_v2_smt.c +++ b/mpp/codec/rc/rc_model_v2_smt.c @@ -924,8 +924,6 @@ MPP_RET rc_model_v2_smt_start(void *ctx, EncRcTask *task) delta_coef = 0.5; else if (delta_coef >= 0.3) delta_coef = 0.3; - else - delta_coef = delta_coef; if (p->qp_prev_out > (frame_low_qp + 1)) delta_coef += 0.1; diff --git a/mpp/hal/vpu/av1d/hal_av1d_vdpu.c b/mpp/hal/vpu/av1d/hal_av1d_vdpu.c index 6d6d67b0..850795cc 100644 --- a/mpp/hal/vpu/av1d/hal_av1d_vdpu.c +++ b/mpp/hal/vpu/av1d/hal_av1d_vdpu.c @@ -2321,7 +2321,7 @@ MPP_RET vdpu_av1d_control(void *hal, MpiCmd cmd_type, void *param) RK_U32 imgheight = mpp_frame_get_height((MppFrame)param); AV1D_DBG(AV1D_DBG_LOG, "control info: fmt %d, w %d, h %d\n", fmt, imgwidth, imgheight); - if ((fmt & MPP_FRAME_FMT_COLOR_MASK) == MPP_FMT_YUV422SP) { + if ((fmt & MPP_FRAME_FMT_MASK) == MPP_FMT_YUV422SP) { mpp_slots_set_prop(p_hal->slots, SLOTS_LEN_ALIGN, rkv_len_align_422); } break; diff --git a/mpp/inc/mpp.h b/mpp/inc/mpp.h index a24a17e0..2c776f89 100644 --- a/mpp/inc/mpp.h +++ b/mpp/inc/mpp.h @@ -96,7 +96,7 @@ class Mpp { public: - Mpp(MppCtx ctx); + Mpp(MppCtx ctx = NULL); ~Mpp(); MPP_RET init(MppCtxType type, MppCodingType coding); diff --git a/mpp/inc/mpp_cfg.h b/mpp/inc/mpp_cfg.h index 9154136b..7f530c8d 100644 --- a/mpp/inc/mpp_cfg.h +++ b/mpp/inc/mpp_cfg.h @@ -33,9 +33,9 @@ typedef enum CfgType_e { typedef struct MppCfgApi_t { const char *name; CfgType data_type; - RK_S32 flag_offset; + RK_U32 flag_offset; RK_U32 flag_value; - RK_S32 data_offset; + RK_U32 data_offset; RK_S32 data_size; } MppCfgApi; diff --git a/mpp/mpp.cpp b/mpp/mpp.cpp index d38378f8..aa64d8fb 100644 --- a/mpp/mpp.cpp +++ b/mpp/mpp.cpp @@ -73,7 +73,7 @@ static MPP_RET check_frm_task_cnt_cap(MppCodingType coding) return MPP_OK; } -Mpp::Mpp(MppCtx ctx = NULL) +Mpp::Mpp(MppCtx ctx) : mPktIn(NULL), mPktOut(NULL), mFrmIn(NULL), diff --git a/mpp/vproc/iep2/iep2.h b/mpp/vproc/iep2/iep2.h index 27ff2d21..5193e237 100644 --- a/mpp/vproc/iep2/iep2.h +++ b/mpp/vproc/iep2/iep2.h @@ -33,7 +33,7 @@ #define FLOOR(v, r) (((v) / (r)) * (r)) #define RKCLIP(a, min, max) ((a < min) ? (min) : ((a > max) ? max : a)) -#define RKABS(a) (((a) >= 0) ? (a) : -(a)) +#define RKABS(a) (RK_U32)(((a) >= 0) ? (a) : -(a)) #define RKMIN(a, b) (((a) < (b)) ? (a) : (b)) #define RKMAX(a, b) (((a) > (b)) ? (a) : (b)) diff --git a/mpp/vproc/iep2/iep2_ff.c b/mpp/vproc/iep2/iep2_ff.c index b274b923..c74bfbb3 100644 --- a/mpp/vproc/iep2/iep2_ff.c +++ b/mpp/vproc/iep2/iep2_ff.c @@ -25,10 +25,6 @@ #include "iep2_api.h" #include "iep2_ff.h" -#define RKABS(a) (((a) >= 0) ? (a) : -(a)) -#define RKMIN(a, b) (((a) < (b)) ? (a) : (b)) -#define RKMAX(a, b) (((a) > (b)) ? (a) : (b)) - void iep2_check_ffo(struct iep2_api_ctx *ctx) { RK_U32 tdiff = ctx->output.ff_gradt_tcnt + 1; diff --git a/osal/inc/mpp_time.h b/osal/inc/mpp_time.h index d7585802..92a3f533 100644 --- a/osal/inc/mpp_time.h +++ b/osal/inc/mpp_time.h @@ -117,7 +117,7 @@ RK_S64 mpp_stopwatch_elapsed_time(MppStopwatch stopwatch); class AutoTiming { public: - AutoTiming(const char *name = __FUNCTION__); + AutoTiming(const char *name = "AutoTiming"); ~AutoTiming(); private: const char *mName; diff --git a/osal/mpp_trace.cpp b/osal/mpp_trace.cpp index 4a70cabf..bca08e0c 100644 --- a/osal/mpp_trace.cpp +++ b/osal/mpp_trace.cpp @@ -88,7 +88,7 @@ void MppTraceService::trace_write(const char *fmt, ...) len = vsnprintf(buf, sizeof(buf) - 1, fmt, ap); va_end(ap); - write(mTraceFd, buf, len); + (void)!write(mTraceFd, buf, len); } void MppTraceService::trace_begin(const char* name) diff --git a/test/mpi_dec_mt_test.c b/test/mpi_dec_mt_test.c index 1c03cd8e..9284f3f6 100644 --- a/test/mpi_dec_mt_test.c +++ b/test/mpi_dec_mt_test.c @@ -257,7 +257,7 @@ int mt_dec_decode(MpiDecTestCmd *cmd) MppCodingType type = cmd->type; pthread_t thd_in; - pthread_t thd_out; + pthread_t thd_out = 0; pthread_attr_t attr; MpiDecMtLoopData data; diff --git a/utils/mpi_dec_utils.c b/utils/mpi_dec_utils.c index 693f1eb4..fcbd6e01 100644 --- a/utils/mpi_dec_utils.c +++ b/utils/mpi_dec_utils.c @@ -87,7 +87,7 @@ OptionInfo mpi_dec_cmd[] = { {"s", "instance_nb", "number of instances"}, {"v", "trace", "q - quiet f - show fps"}, {"c", "verify_file", "verify file for slt check"}, - {NULL}, + {NULL, NULL, NULL}, }; static MPP_RET add_new_slot(FileReaderImpl* impl, FileBufSlot *slot)