[misc]: Fix a few compile warnings and errors

Reported by llvm-clang.

Change-Id: I62f22fe5754d3e8d77405d213c81fda5d9f5e27d
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
This commit is contained in:
Jeffy Chen
2022-03-11 16:09:13 +08:00
committed by Herman Chen
parent da6654c148
commit c07169d533
15 changed files with 18 additions and 24 deletions

View File

@@ -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;

View File

@@ -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)
{

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -96,7 +96,7 @@
class Mpp
{
public:
Mpp(MppCtx ctx);
Mpp(MppCtx ctx = NULL);
~Mpp();
MPP_RET init(MppCtxType type, MppCodingType coding);

View File

@@ -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;

View File

@@ -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),

View File

@@ -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))

View File

@@ -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;

View File

@@ -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;

View File

@@ -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)

View File

@@ -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;

View File

@@ -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)