From 83222e8ed72ae2f1f23e42064a53d24e2795f7c2 Mon Sep 17 00:00:00 2001 From: "leo.ding" Date: Thu, 25 Aug 2016 21:33:31 +0800 Subject: [PATCH] [compile]: remove warnings in vs Change-Id: I468c8d9094a76e42a0a45e3c3541f1f41fc40b3c Signed-off-by: leo.ding --- mpp/codec/dec/jpeg/jpegd_parser.c | 2 +- mpp/codec/dec/m2v/m2vd_parser.c | 2 +- mpp/codec/dec/vp8/vp8d_parser.c | 2 +- mpp/codec/enc/h264/src/encpreprocess.c | 4 ++-- mpp/codec/enc/h264/src/h264e_api.c | 2 +- mpp/hal/rkenc/h264e/hal_h264e_rkv.c | 6 +++--- mpp/hal/rkenc/h264e/test/h264e_hal_test.c | 8 ++++---- mpp/legacy/vpu_api_legacy.cpp | 6 +++--- mpp/test/jpegd_test.c | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/mpp/codec/dec/jpeg/jpegd_parser.c b/mpp/codec/dec/jpeg/jpegd_parser.c index 86e18b17..66d48aea 100644 --- a/mpp/codec/dec/jpeg/jpegd_parser.c +++ b/mpp/codec/dec/jpeg/jpegd_parser.c @@ -1134,7 +1134,7 @@ MPP_RET jpegd_prepare(void *ctx, MppPacket pkt, HalDecTask *task) JpegParserCtx->pts = mpp_packet_get_pts(pkt); JpegParserCtx->eos = mpp_packet_get_eos(pkt); - pkt_length = mpp_packet_get_length(pkt); + pkt_length = (RK_U32)mpp_packet_get_length(pkt); pPacket = pPos = mpp_packet_get_pos(pkt); if (JpegParserCtx->eos) { diff --git a/mpp/codec/dec/m2v/m2vd_parser.c b/mpp/codec/dec/m2v/m2vd_parser.c index 5af33101..2938d6f7 100644 --- a/mpp/codec/dec/m2v/m2vd_parser.c +++ b/mpp/codec/dec/m2v/m2vd_parser.c @@ -426,7 +426,7 @@ MPP_RET m2vd_parser_prepare(void *ctx, MppPacket pkt, HalDecTask *task) FUN_T("FUN_I"); task->valid = 0; - len_in = mpp_packet_get_length(pkt), + len_in = (RK_U32)mpp_packet_get_length(pkt), p->eos = mpp_packet_get_eos(pkt); // mpp_log("len_in = %d",len_in); if (len_in > p->max_stream_size) { diff --git a/mpp/codec/dec/vp8/vp8d_parser.c b/mpp/codec/dec/vp8/vp8d_parser.c index 2e39d0b9..3174613e 100644 --- a/mpp/codec/dec/vp8/vp8d_parser.c +++ b/mpp/codec/dec/vp8/vp8d_parser.c @@ -417,7 +417,7 @@ MPP_RET vp8d_parser_prepare(void *ctx, MppPacket pkt, HalDecTask *task) buf = pos = mpp_packet_get_pos(pkt); p->pts = mpp_packet_get_pts(pkt); - len_in = mpp_packet_get_length(pkt), + len_in = (RK_U32)mpp_packet_get_length(pkt), p->eos = mpp_packet_get_eos(pkt); // mpp_log("len_in = %d",len_in); if (len_in > p->max_stream_size) { diff --git a/mpp/codec/enc/h264/src/encpreprocess.c b/mpp/codec/enc/h264/src/encpreprocess.c index 9bab5be2..07d3ad97 100644 --- a/mpp/codec/enc/h264/src/encpreprocess.c +++ b/mpp/codec/enc/h264/src/encpreprocess.c @@ -120,7 +120,7 @@ void EncPreProcess(asicData_s * asic, const preProcess_s * preProcess) tmp = preProcess->verOffsetSrc / 2; tmp *= stride / 2; tmp += preProcess->horOffsetSrc / 2; - +#ifdef RKPLATFORM if (VPUClientGetIOMMUStatus() <= 0) { regs->inputCbBase += (tmp & (~7)); regs->inputCrBase += (tmp & (~7)); @@ -128,7 +128,7 @@ void EncPreProcess(asicData_s * asic, const preProcess_s * preProcess) regs->inputCbBase += (tmp & (~7)) << 10; regs->inputCrBase += (tmp & (~7)) << 10; } - +#endif regs->inputChromaBaseOffset = tmp & 7; } break; case MPP_FMT_YUV420P : { diff --git a/mpp/codec/enc/h264/src/h264e_api.c b/mpp/codec/enc/h264/src/h264e_api.c index fe863ab5..85abc6e7 100644 --- a/mpp/codec/enc/h264/src/h264e_api.c +++ b/mpp/codec/enc/h264/src/h264e_api.c @@ -87,7 +87,7 @@ MPP_RET h264e_encode(void *ctx, HalEncTask *task) encIn->pOutBuf = (RK_U32*)mpp_buffer_get_ptr(task->output); encIn->busOutBuf = mpp_buffer_get_fd(task->output); - encIn->outBufSize = mpp_buffer_get_size(task->output); + encIn->outBufSize = (RK_U32)mpp_buffer_get_size(task->output); /* Start stream */ if (p->encStatus == H264ENCSTAT_INIT) { diff --git a/mpp/hal/rkenc/h264e/hal_h264e_rkv.c b/mpp/hal/rkenc/h264e/hal_h264e_rkv.c index 4e31a575..851ed783 100644 --- a/mpp/hal/rkenc/h264e/hal_h264e_rkv.c +++ b/mpp/hal/rkenc/h264e/hal_h264e_rkv.c @@ -1780,7 +1780,7 @@ MPP_RET hal_h264e_rkv_set_sps(h264e_hal_sps *sps, h264e_hal_param *par, h264e_co RK_S32 hal_h264e_rkv_stream_get_pos(h264e_hal_rkv_stream *s) { - return (8 * (s->p - s->p_start) + (4 * 8) - s->i_left); + return (RK_S32)(8 * (s->p - s->p_start) + (4 * 8) - s->i_left); } @@ -2015,7 +2015,7 @@ void hal_h264e_rkv_nal_end(h264e_hal_rkv_extra_info *out) h264e_hal_rkv_stream *s = &out->stream; RK_U8 *stream_buf = s->p_start; RK_U8 *end = &stream_buf[hal_h264e_rkv_stream_get_pos(s) / 8]; - nal->i_payload = end - nal->p_payload; + nal->i_payload = (RK_S32)(end - nal->p_payload); /* Assembly implementation of nal_escape reads past the end of the input. * While undefined padding wouldn't actually affect the output, it makes valgrind unhappy. */ memset(end, 0xff, 64); @@ -2058,7 +2058,7 @@ void hal_h264e_rkv_nal_encode(RK_U8 *dst, h264e_hal_rkv_nal *nal) *dst++ = (0x00 << 7) | (nal->i_ref_idc << 5) | nal->i_type; dst = hal_h264e_rkv_nal_escape_c(dst, src, end); - size = (dst - orig_dst) - 4; + size = (RK_S32)((dst - orig_dst) - 4); /* Write the size header for mp4/etc */ if (!b_annexb) { diff --git a/mpp/hal/rkenc/h264e/test/h264e_hal_test.c b/mpp/hal/rkenc/h264e/test/h264e_hal_test.c index 05c13944..4609f882 100644 --- a/mpp/hal/rkenc/h264e/test/h264e_hal_test.c +++ b/mpp/hal/rkenc/h264e/test/h264e_hal_test.c @@ -340,7 +340,7 @@ static MPP_RET get_rkv_h264e_yuv_in_frame(h264e_syntax *syn, MppBuffer *hw_buf) RK_U8 *hw_buf_ptr = (RK_U8 *)mpp_buffer_get_ptr(hw_buf[g_frame_read_cnt % RKV_H264E_LINKTABLE_FRAME_NUM]);; mpp_assert(fp_h264e_yuv_in); - read_ret = fread(hw_buf_ptr, 1, frame_size, fp_h264e_yuv_in); + read_ret = (RK_U32)fread(hw_buf_ptr, 1, frame_size, fp_h264e_yuv_in); if (read_ret == 0) { mpp_log("yuv file end, nothing is read in %d frame", g_frame_read_cnt); return MPP_EOS_STREAM_REACHED; @@ -366,7 +366,7 @@ static MPP_RET get_h264e_yuv_in_one_frame(RK_U8 *sw_buf, h264e_syntax *syn, MppB mpp_assert(fp_h264e_yuv_in); //TODO: remove sw_buf, read & write fd ptr directly - read_ret = fread(sw_buf, 1, frame_size, fp_h264e_yuv_in); + read_ret = (RK_U32)fread(sw_buf, 1, frame_size, fp_h264e_yuv_in); if (read_ret == 0) { mpp_log("yuv file end, nothing is read in frame %d", g_frame_cnt); return MPP_EOS_STREAM_REACHED; @@ -1196,7 +1196,7 @@ static MPP_RET get_rkv_syntax_in( h264e_syntax *syn, MppBuffer *hw_in_buf, MppBu mpp_err("rkv_syntax_in.txt doesn't exits"); } #endif - syn->output_strm_limit_size = syn->pic_luma_width * syn->pic_luma_height * 1.5; + syn->output_strm_limit_size = (RK_U32)(syn->pic_luma_width * syn->pic_luma_height * 3 / 2); h264e_hal_debug_leave(); return MPP_OK; @@ -1516,7 +1516,7 @@ MPP_RET h264e_hal_rkv_test(h264e_hal_test_cfg *test_cfg) mpp_buffer_get(hw_input_buf_grp, &hw_input_buf_mul[k], frame_luma_stride * 3 / 2); for (k = 0; k < RKV_H264E_LINKTABLE_FRAME_NUM; k++) - mpp_buffer_get(hw_output_buf_grp, &hw_output_strm_buf_mul[k], syntax_data[0].pic_luma_width * syntax_data[0].pic_luma_height * 1.5); + mpp_buffer_get(hw_output_buf_grp, &hw_output_strm_buf_mul[k], syntax_data[0].pic_luma_width * syntax_data[0].pic_luma_height * 3 / 2); hal_cfg.hal_int_cb.callBack = h264_hal_test_call_back; diff --git a/mpp/legacy/vpu_api_legacy.cpp b/mpp/legacy/vpu_api_legacy.cpp index eadcd149..a3fc318c 100644 --- a/mpp/legacy/vpu_api_legacy.cpp +++ b/mpp/legacy/vpu_api_legacy.cpp @@ -254,7 +254,7 @@ RK_S32 VpuApiLegacy::init(VpuCodecContext *ctx, RK_U8 *extraData, RK_U32 extra_s mpi->control(mpp_ctx, MPP_ENC_GET_EXTRA_INFO, &pkt); if (pkt) { - ctx->extradata_size = mpp_packet_get_length(pkt); + ctx->extradata_size = (RK_S32)mpp_packet_get_length(pkt); ctx->extradata = mpp_packet_get_data(pkt); } pkt = NULL; @@ -730,7 +730,7 @@ RK_S32 VpuApiLegacy::encoder_sendframe(VpuCodecContext *ctx, EncInputStream_t *a RK_U32 height = ctx->height; RK_U32 hor_stride = MPP_ALIGN(width, 16); RK_U32 ver_stride = MPP_ALIGN(height, 16); - RK_S32 pts = aEncInStrm->timeUs; + RK_S32 pts = (RK_S32)aEncInStrm->timeUs; RK_S32 import_fd = -1; RK_U32 import_size = 0; @@ -767,7 +767,7 @@ RK_S32 VpuApiLegacy::encoder_sendframe(VpuCodecContext *ctx, EncInputStream_t *a goto FUNC_RET; } import_fd = mpp_buffer_get_fd(buffer); - import_size = mpp_buffer_get_size(buffer); + import_size = (RK_U32)mpp_buffer_get_size(buffer); mpp_frame_set_buffer(frame, buffer); diff --git a/mpp/test/jpegd_test.c b/mpp/test/jpegd_test.c index de09e1d4..86029acb 100644 --- a/mpp/test/jpegd_test.c +++ b/mpp/test/jpegd_test.c @@ -96,7 +96,7 @@ MPP_RET jpegd_readbytes_from_file(RK_U8* buf, RK_S32 aBytes, FILE* fp) return -1; } - RK_S32 rd_bytes = fread(buf, 1, aBytes, fp); + RK_S32 rd_bytes = (RK_S32)fread(buf, 1, aBytes, fp); if (rd_bytes != aBytes) { mpp_log("read %u bytes from file fail, actually only %#x bytes is read.", (RK_U32)aBytes, rd_bytes); return -1;