From 24ab3a135c27b4c4bdba3c57ceb2cfcb5efbccea Mon Sep 17 00:00:00 2001 From: ChenHengming Date: Thu, 24 Sep 2015 14:18:29 +0000 Subject: [PATCH] [astyle]: format code git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@297 6e48237b-75ef-9749-8fc9-41990f28c85a --- mpp/codec/dec/dummy/dummy_dec_api.c | 8 +- mpp/codec/dec/h264/h264d_api.c | 20 +- mpp/codec/dec/h264/h264d_dpb.c | 4 +- mpp/codec/dec/h264/h264d_fill.c | 4 +- mpp/codec/dec/h264/h264d_init.c | 4 +- mpp/codec/dec/h264/h264d_parse.c | 20 +- mpp/codec/dec/h264/h264d_slice.c | 193 ++++++++++---------- mpp/codec/dec/h265/h265d_parser.c | 2 +- mpp/codec/dec/h265/h265d_ps.c | 4 +- mpp/codec/dec/h265/h265d_refs.c | 14 +- mpp/codec/dec/h265/test/h265d_parser_test.c | 10 +- mpp/codec/mpp_buf_slot.cpp | 2 +- mpp/codec/mpp_dec.cpp | 2 +- mpp/hal/rkdec/h264d/hal_h264d_api.c | 2 +- mpp/hal/rkdec/h264d/hal_h264d_packet.c | 46 +++-- mpp/hal/rkdec/h265d/hal_h265d_reg.c | 74 ++++---- mpp/test/h264d_rwfile.c | 60 +++--- mpp/test/h264d_test.c | 56 +++--- 18 files changed, 260 insertions(+), 265 deletions(-) diff --git a/mpp/codec/dec/dummy/dummy_dec_api.c b/mpp/codec/dec/dummy/dummy_dec_api.c index 28a71273..3d05bf41 100644 --- a/mpp/codec/dec/dummy/dummy_dec_api.c +++ b/mpp/codec/dec/dummy/dummy_dec_api.c @@ -186,11 +186,11 @@ MPP_RET dummy_dec_prepare(void *dec, MppPacket pkt, HalDecTask *task) return MPP_OK; } MPP_RET dummy_dec_parse(void *dec, HalDecTask *task) -{ - (void)dec; - (void)task; +{ + (void)dec; + (void)task; - return MPP_OK; + return MPP_OK; } const ParserApi dummy_dec_parser = { diff --git a/mpp/codec/dec/h264/h264d_api.c b/mpp/codec/dec/h264/h264d_api.c index 9d2f687a..8484f394 100644 --- a/mpp/codec/dec/h264/h264d_api.c +++ b/mpp/codec/dec/h264/h264d_api.c @@ -506,26 +506,26 @@ __RETURN: */ MPP_RET h264d_prepare(void *decoder, MppPacket in_pkt, HalDecTask *in_task) { - MPP_RET ret = MPP_ERR_UNKNOW; - H264_DecCtx_t *p_Dec = (H264_DecCtx_t *)decoder; - MppPacketImpl *pkt = (MppPacketImpl *)in_pkt; + MPP_RET ret = MPP_ERR_UNKNOW; + H264_DecCtx_t *p_Dec = (H264_DecCtx_t *)decoder; + MppPacketImpl *pkt = (MppPacketImpl *)in_pkt; INP_CHECK(ret, ctx, !decoder && !in_pkt && !in_task); - FunctionIn(p_Dec->logctx.parr[RUN_PARSE]); - p_Dec->p_Inp->in_buf = (RK_U8 *)pkt->pos; - p_Dec->p_Inp->in_size = &pkt->size; - p_Dec->p_Inp->is_eos = pkt->flag & MPP_PACKET_FLAG_EOS; + FunctionIn(p_Dec->logctx.parr[RUN_PARSE]); + p_Dec->p_Inp->in_buf = (RK_U8 *)pkt->pos; + p_Dec->p_Inp->in_size = &pkt->size; + p_Dec->p_Inp->is_eos = pkt->flag & MPP_PACKET_FLAG_EOS; - FunctionOut(p_Dec->logctx.parr[RUN_PARSE]); + FunctionOut(p_Dec->logctx.parr[RUN_PARSE]); __RETURN: - return ret = MPP_OK; + return ret = MPP_OK; //__FAILED: -// return ret; +// return ret; } diff --git a/mpp/codec/dec/h264/h264d_dpb.c b/mpp/codec/dec/h264/h264d_dpb.c index 9d4fc8d7..f3117655 100644 --- a/mpp/codec/dec/h264/h264d_dpb.c +++ b/mpp/codec/dec/h264/h264d_dpb.c @@ -1650,9 +1650,9 @@ MPP_RET exit_picture(H264dVideoCtx_t *p_Vid, H264_StorePic_t **dec_picture) set_curframe_poc((*dec_picture), &p_Vid->p_Dec->regs); #endif FUN_CHECK(ret = store_picture_in_dpb(p_Vid->p_Dpb_layer[(*dec_picture)->layer_id], *dec_picture)); - FPRINT(g_debug_file1, "decoder ending, g_framecnt=%d \n", p_Vid->g_framecnt); + FPRINT(g_debug_file1, "decoder ending, g_framecnt=%d \n", p_Vid->g_framecnt); - mpp_log("decoder ending, g_framecnt=%d \n", p_Vid->g_framecnt++); + mpp_log("decoder ending, g_framecnt=%d \n", p_Vid->g_framecnt++); diff --git a/mpp/codec/dec/h264/h264d_fill.c b/mpp/codec/dec/h264/h264d_fill.c index 6fb03437..30331430 100644 --- a/mpp/codec/dec/h264/h264d_fill.c +++ b/mpp/codec/dec/h264/h264d_fill.c @@ -85,8 +85,8 @@ static MPP_RET fill_stream_data(H264dDxvaCtx_t *dxva_ctx, H264_Nalu_t *p_nal) p_long->wBadSliceChopping = 0; //!< set to 0 in Rock-Chip RKVDEC IP memcpy(&dxva_ctx->bitstream[dxva_ctx->strm_offset], start_code, sizeof(start_code)); dxva_ctx->strm_offset += sizeof(start_code); - memcpy(&dxva_ctx->bitstream[dxva_ctx->strm_offset], p_nal->sodb_buf, p_nal->sodb_len); - dxva_ctx->strm_offset += p_nal->sodb_len; + memcpy(&dxva_ctx->bitstream[dxva_ctx->strm_offset], p_nal->sodb_buf, p_nal->sodb_len); + dxva_ctx->strm_offset += p_nal->sodb_len; p_long->SliceBytesInBuffer = dxva_ctx->strm_offset - p_long->BSNALunitDataLocation; return ret = MPP_OK; diff --git a/mpp/codec/dec/h264/h264d_init.c b/mpp/codec/dec/h264/h264d_init.c index fda7cc96..1f1292bd 100644 --- a/mpp/codec/dec/h264/h264d_init.c +++ b/mpp/codec/dec/h264/h264d_init.c @@ -384,7 +384,7 @@ static void malloc_dpb_memory_index(H264dVideoCtx_t *p_Vid, RK_S32 structure, RK { RK_U8 idx = 1; H264_DpbMark_t *pmem_dpb = p_Vid->p_Dec->dpb_mark; - //!< malloc + //!< malloc if (!combine_flag) { while (pmem_dpb[idx].top_used || pmem_dpb[idx].bot_used) { idx++; @@ -569,7 +569,7 @@ static void update_pic_num(H264_SLICE_t *currSlice) static MPP_RET init_picture_decoding(H264dVideoCtx_t *p_Vid, H264_SLICE_t *pSlice) { MPP_RET ret = MPP_ERR_UNKNOW; - //!< MVC idr_flag==1 + //!< MVC idr_flag==1 if (pSlice->layer_id && !pSlice->svc_extension_flag && !pSlice->mvcExt.non_idr_flag) { ASSERT(pSlice->layer_id == 1); FUN_CHECK(ret = idr_memory_management(p_Vid->p_Dpb_layer[pSlice->layer_id], p_Vid->dec_picture)); diff --git a/mpp/codec/dec/h264/h264d_parse.c b/mpp/codec/dec/h264/h264d_parse.c index 01b60ddc..2e3a1ba9 100644 --- a/mpp/codec/dec/h264/h264d_parse.c +++ b/mpp/codec/dec/h264/h264d_parse.c @@ -45,8 +45,8 @@ static void reset_slice(H264dVideoCtx_t *p_Vid) currSlice->p_Cur = p_Vid->p_Cur; currSlice->p_Inp = p_Vid->p_Inp; currSlice->logctx = &p_Vid->p_Dec->logctx; - currSlice->active_sps = p_Vid->active_sps; - currSlice->active_pps = p_Vid->active_pps; + currSlice->active_sps = p_Vid->active_sps; + currSlice->active_pps = p_Vid->active_pps; //--- reset listP listB for (i = 0; i < 2; i++) { currSlice->listP[i] = p_Vid->p_Cur->listP[i]; @@ -137,7 +137,7 @@ static MPP_RET read_nalu(H264_SLICE_t *currSlice) p_Cur->strm.endcode_found = (p_Inp->is_eos && p_Cur->nalu.sodb_len) ? 1 : p_Cur->strm.endcode_found; p_Dec->nalu_ret = p_Inp->is_eos ? (p_Cur->nalu.sodb_len ? EndOfNalu : EndofStream) : HaveNoStream; } - + FunctionIn(logctx->parr[RUN_PARSE]); return ret = MPP_OK; @@ -157,7 +157,7 @@ static MPP_RET parser_nalu_header(H264_SLICE_t *currSlice) FunctionIn(logctx->parr[RUN_PARSE]); set_bitread_ctx(p_bitctx, cur_nal->sodb_buf, cur_nal->sodb_len); - g_strm_bytes += p_Cur->nalu.sodb_len; + g_strm_bytes += p_Cur->nalu.sodb_len; set_bitread_logctx(p_bitctx, logctx->parr[LOG_READ_NALU]); WRITE_LOG(p_bitctx, "================== NAL begin ==================="); READ_BITS(ret, p_bitctx, 1, &cur_nal->forbidden_bit, "forbidden_bit"); @@ -167,11 +167,11 @@ static MPP_RET parser_nalu_header(H264_SLICE_t *currSlice) if (g_nalu_cnt == 344) { g_nalu_cnt = g_nalu_cnt; } - //if (g_debug_file1 == NULL) - //{ - // g_debug_file1 = fopen("rk_debugfile_view1.txt", "wb"); - //} - //FPRINT(g_debug_file1, "g_nalu_cnt = %d, nal_unit_type = %d, nalu_size = %d\n", g_nalu_cnt++, cur_nal->nal_unit_type, cur_nal->sodb_len); + //if (g_debug_file1 == NULL) + //{ + // g_debug_file1 = fopen("rk_debugfile_view1.txt", "wb"); + //} + //FPRINT(g_debug_file1, "g_nalu_cnt = %d, nal_unit_type = %d, nalu_size = %d\n", g_nalu_cnt++, cur_nal->nal_unit_type, cur_nal->sodb_len); cur_nal->ualu_header_bytes = 1; @@ -206,7 +206,7 @@ static MPP_RET parser_nalu_header(H264_SLICE_t *currSlice) } set_bitread_ctx(p_bitctx, (cur_nal->sodb_buf + cur_nal->ualu_header_bytes), (cur_nal->sodb_len - cur_nal->ualu_header_bytes)); // reset - FunctionOut(logctx->parr[RUN_PARSE]); + FunctionOut(logctx->parr[RUN_PARSE]); return ret = MPP_OK; __FAILED: diff --git a/mpp/codec/dec/h264/h264d_slice.c b/mpp/codec/dec/h264/h264d_slice.c index 07a3885f..f5a52e46 100644 --- a/mpp/codec/dec/h264/h264d_slice.c +++ b/mpp/codec/dec/h264/h264d_slice.c @@ -435,108 +435,107 @@ MPP_RET process_slice(H264_SLICE_t *currSlice) WRITE_LOG(p_bitctx, "----------------------------- SLICE begin --------------------------------"); //!< read slice head syntax READ_UE(ret, p_bitctx, &currSlice->start_mb_nr, "first_mb_in_slice"); - //FPRINT(g_debug_file1, "first_mb_in_slice = %d \n", currSlice->start_mb_nr); - if (currSlice->start_mb_nr == 0/*is_new_picture(currSlice)*/) { - READ_UE(ret, p_bitctx, &temp, "slice_type"); - p_Vid->slice_type = currSlice->slice_type = temp % 5; - READ_UE(ret, p_bitctx, &currSlice->pic_parameter_set_id, "slice_pic_parameter_set_id"); - init_slice_parmeters(currSlice); - FUN_CHECK(ret = set_slice_user_parmeters(currSlice)); - //!< read rest slice header syntax - READ_BITS(ret, p_bitctx, currSlice->active_sps->log2_max_frame_num_minus4 + 4, &currSlice->frame_num, "frame_num"); - if (currSlice->active_sps->frame_mbs_only_flag) { //!< user in_slice info - p_Vid->structure = FRAME; - currSlice->field_pic_flag = 0; - currSlice->bottom_field_flag = 0; - } else { - READ_ONEBIT(ret, p_bitctx, &currSlice->field_pic_flag, "field_pic_flag"); - if (currSlice->field_pic_flag) { - READ_ONEBIT(ret, p_bitctx, &currSlice->bottom_field_flag, "field_pic_flag"); - p_Vid->structure = currSlice->bottom_field_flag ? BOTTOM_FIELD : TOP_FIELD; - } else { - p_Vid->structure = FRAME; - currSlice->bottom_field_flag = 0; - } - } - currSlice->structure = p_Vid->structure; - currSlice->mb_aff_frame_flag = (currSlice->active_sps->mb_adaptive_frame_field_flag && (currSlice->field_pic_flag == 0)); - if (currSlice->idr_flag) { - READ_UE(ret, p_bitctx, &currSlice->idr_pic_id, "idr_pic_id"); - } else if (currSlice->svc_extension_flag == 0 && currSlice->mvcExt.non_idr_flag == 0) { - READ_UE(ret, p_bitctx, &currSlice->idr_pic_id, "idr_pic_id"); - } - if (currSlice->active_sps->pic_order_cnt_type == 0) { - READ_BITS(ret, p_bitctx, currSlice->active_sps->log2_max_pic_order_cnt_lsb_minus4 + 4, &currSlice->pic_order_cnt_lsb, "pic_order_cnt_lsb"); - if (currSlice->p_Vid->active_pps->bottom_field_pic_order_in_frame_present_flag == 1 - && !currSlice->field_pic_flag) { - READ_SE(ret, p_bitctx, &currSlice->delta_pic_order_cnt_bottom, "delta_pic_order_cnt_bottom"); - } else { - currSlice->delta_pic_order_cnt_bottom = 0; - } - } - if (currSlice->active_sps->pic_order_cnt_type == 1) { - if (!currSlice->active_sps->delta_pic_order_always_zero_flag) { - READ_SE(ret, p_bitctx, &currSlice->delta_pic_order_cnt[0], "delta_pic_order_cnt[0]"); + //FPRINT(g_debug_file1, "first_mb_in_slice = %d \n", currSlice->start_mb_nr); + if (currSlice->start_mb_nr == 0/*is_new_picture(currSlice)*/) { + READ_UE(ret, p_bitctx, &temp, "slice_type"); + p_Vid->slice_type = currSlice->slice_type = temp % 5; + READ_UE(ret, p_bitctx, &currSlice->pic_parameter_set_id, "slice_pic_parameter_set_id"); + init_slice_parmeters(currSlice); + FUN_CHECK(ret = set_slice_user_parmeters(currSlice)); + //!< read rest slice header syntax + READ_BITS(ret, p_bitctx, currSlice->active_sps->log2_max_frame_num_minus4 + 4, &currSlice->frame_num, "frame_num"); + if (currSlice->active_sps->frame_mbs_only_flag) { //!< user in_slice info + p_Vid->structure = FRAME; + currSlice->field_pic_flag = 0; + currSlice->bottom_field_flag = 0; + } else { + READ_ONEBIT(ret, p_bitctx, &currSlice->field_pic_flag, "field_pic_flag"); + if (currSlice->field_pic_flag) { + READ_ONEBIT(ret, p_bitctx, &currSlice->bottom_field_flag, "field_pic_flag"); + p_Vid->structure = currSlice->bottom_field_flag ? BOTTOM_FIELD : TOP_FIELD; + } else { + p_Vid->structure = FRAME; + currSlice->bottom_field_flag = 0; + } + } + currSlice->structure = p_Vid->structure; + currSlice->mb_aff_frame_flag = (currSlice->active_sps->mb_adaptive_frame_field_flag && (currSlice->field_pic_flag == 0)); + if (currSlice->idr_flag) { + READ_UE(ret, p_bitctx, &currSlice->idr_pic_id, "idr_pic_id"); + } else if (currSlice->svc_extension_flag == 0 && currSlice->mvcExt.non_idr_flag == 0) { + READ_UE(ret, p_bitctx, &currSlice->idr_pic_id, "idr_pic_id"); + } + if (currSlice->active_sps->pic_order_cnt_type == 0) { + READ_BITS(ret, p_bitctx, currSlice->active_sps->log2_max_pic_order_cnt_lsb_minus4 + 4, &currSlice->pic_order_cnt_lsb, "pic_order_cnt_lsb"); + if (currSlice->p_Vid->active_pps->bottom_field_pic_order_in_frame_present_flag == 1 + && !currSlice->field_pic_flag) { + READ_SE(ret, p_bitctx, &currSlice->delta_pic_order_cnt_bottom, "delta_pic_order_cnt_bottom"); + } else { + currSlice->delta_pic_order_cnt_bottom = 0; + } + } + if (currSlice->active_sps->pic_order_cnt_type == 1) { + if (!currSlice->active_sps->delta_pic_order_always_zero_flag) { + READ_SE(ret, p_bitctx, &currSlice->delta_pic_order_cnt[0], "delta_pic_order_cnt[0]"); - if (currSlice->p_Vid->active_pps->bottom_field_pic_order_in_frame_present_flag == 1 && !currSlice->field_pic_flag) { - READ_SE(ret, p_bitctx, &currSlice->delta_pic_order_cnt[1], "delta_pic_order_cnt[1]"); - } else { - currSlice->delta_pic_order_cnt[1] = 0; // set to zero if not in stream - } - } else { - currSlice->delta_pic_order_cnt[0] = 0; - currSlice->delta_pic_order_cnt[1] = 0; - } - } + if (currSlice->p_Vid->active_pps->bottom_field_pic_order_in_frame_present_flag == 1 && !currSlice->field_pic_flag) { + READ_SE(ret, p_bitctx, &currSlice->delta_pic_order_cnt[1], "delta_pic_order_cnt[1]"); + } else { + currSlice->delta_pic_order_cnt[1] = 0; // set to zero if not in stream + } + } else { + currSlice->delta_pic_order_cnt[0] = 0; + currSlice->delta_pic_order_cnt[1] = 0; + } + } - //!< redundant_pic_cnt is missing here - ASSERT(currSlice->p_Vid->active_pps->redundant_pic_cnt_present_flag == 0); // add by dw, high 4:2:2 profile not support - if (currSlice->p_Vid->active_pps->redundant_pic_cnt_present_flag) { - READ_UE(ret, p_bitctx, &currSlice->redundant_pic_cnt, "redundant_pic_cnt"); - } + //!< redundant_pic_cnt is missing here + ASSERT(currSlice->p_Vid->active_pps->redundant_pic_cnt_present_flag == 0); // add by dw, high 4:2:2 profile not support + if (currSlice->p_Vid->active_pps->redundant_pic_cnt_present_flag) { + READ_UE(ret, p_bitctx, &currSlice->redundant_pic_cnt, "redundant_pic_cnt"); + } - if (currSlice->slice_type == B_SLICE) { - READ_ONEBIT(ret, p_bitctx, &currSlice->direct_spatial_mv_pred_flag, "direct_spatial_mv_pred_flag"); - } else { - currSlice->direct_spatial_mv_pred_flag = 0; - } - currSlice->num_ref_idx_active[LIST_0] = currSlice->p_Vid->active_pps->num_ref_idx_l0_default_active_minus1 + 1; - currSlice->num_ref_idx_active[LIST_1] = currSlice->p_Vid->active_pps->num_ref_idx_l1_default_active_minus1 + 1; + if (currSlice->slice_type == B_SLICE) { + READ_ONEBIT(ret, p_bitctx, &currSlice->direct_spatial_mv_pred_flag, "direct_spatial_mv_pred_flag"); + } else { + currSlice->direct_spatial_mv_pred_flag = 0; + } + currSlice->num_ref_idx_active[LIST_0] = currSlice->p_Vid->active_pps->num_ref_idx_l0_default_active_minus1 + 1; + currSlice->num_ref_idx_active[LIST_1] = currSlice->p_Vid->active_pps->num_ref_idx_l1_default_active_minus1 + 1; - if (currSlice->slice_type == P_SLICE - || currSlice->slice_type == SP_SLICE || currSlice->slice_type == B_SLICE) { - //!< direct_spatial_mv_pred_flag - READ_ONEBIT(ret, p_bitctx, &currSlice->num_ref_idx_override_flag, "num_ref_idx_override_flag"); - if (currSlice->num_ref_idx_override_flag) { - READ_UE(ret, p_bitctx, &currSlice->num_ref_idx_active[LIST_0], "num_ref_idx_active0"); - currSlice->num_ref_idx_active[LIST_0] += 1; - if (currSlice->slice_type == B_SLICE) { - READ_UE(ret, p_bitctx, &currSlice->num_ref_idx_active[LIST_1], "num_ref_idx_active1"); - currSlice->num_ref_idx_active[LIST_1] += 1; - } - } - } - if (currSlice->slice_type != B_SLICE) { - currSlice->num_ref_idx_active[LIST_1] = 0; - } - //!<---------------------------- + if (currSlice->slice_type == P_SLICE + || currSlice->slice_type == SP_SLICE || currSlice->slice_type == B_SLICE) { + //!< direct_spatial_mv_pred_flag + READ_ONEBIT(ret, p_bitctx, &currSlice->num_ref_idx_override_flag, "num_ref_idx_override_flag"); + if (currSlice->num_ref_idx_override_flag) { + READ_UE(ret, p_bitctx, &currSlice->num_ref_idx_active[LIST_0], "num_ref_idx_active0"); + currSlice->num_ref_idx_active[LIST_0] += 1; + if (currSlice->slice_type == B_SLICE) { + READ_UE(ret, p_bitctx, &currSlice->num_ref_idx_active[LIST_1], "num_ref_idx_active1"); + currSlice->num_ref_idx_active[LIST_1] += 1; + } + } + } + if (currSlice->slice_type != B_SLICE) { + currSlice->num_ref_idx_active[LIST_1] = 0; + } + //!<---------------------------- - //FPRINT(g_debug_file1, "--- new frame ---- \n"); - FUN_CHECK(ret = ref_pic_list_mvc_modification(currSlice)); - if ((currSlice->p_Vid->active_pps->weighted_pred_flag - && (currSlice->slice_type == P_SLICE || currSlice->slice_type == SP_SLICE)) - || (currSlice->p_Vid->active_pps->weighted_bipred_idc == 1 && (currSlice->slice_type == B_SLICE))) { - FUN_CHECK(ret = pred_weight_table(currSlice)); - } - if (currSlice->nal_reference_idc) { - FUN_CHECK(ret = dec_ref_pic_marking(currSlice)); - } - if (g_max_bytes < (p_bitctx->used_bits>>3)) - { - g_max_bytes = (p_bitctx->used_bits>>3); - } - currSlice->is_new_picture_flag = 1; - } + //FPRINT(g_debug_file1, "--- new frame ---- \n"); + FUN_CHECK(ret = ref_pic_list_mvc_modification(currSlice)); + if ((currSlice->p_Vid->active_pps->weighted_pred_flag + && (currSlice->slice_type == P_SLICE || currSlice->slice_type == SP_SLICE)) + || (currSlice->p_Vid->active_pps->weighted_bipred_idc == 1 && (currSlice->slice_type == B_SLICE))) { + FUN_CHECK(ret = pred_weight_table(currSlice)); + } + if (currSlice->nal_reference_idc) { + FUN_CHECK(ret = dec_ref_pic_marking(currSlice)); + } + if (g_max_bytes < (p_bitctx->used_bits >> 3)) { + g_max_bytes = (p_bitctx->used_bits >> 3); + } + currSlice->is_new_picture_flag = 1; + } FunctionOut(logctx->parr[RUN_PARSE]); return ret = MPP_OK; diff --git a/mpp/codec/dec/h265/h265d_parser.c b/mpp/codec/dec/h265/h265d_parser.c index 60cf6c0b..72494c70 100644 --- a/mpp/codec/dec/h265/h265d_parser.c +++ b/mpp/codec/dec/h265/h265d_parser.c @@ -626,7 +626,7 @@ static RK_S32 hls_slice_header(HEVCContext *s) SliceHeader *sh = &s->sh; RK_S32 i, ret; RK_S32 value, pps_id; - RK_S32 bit_begin; + RK_S32 bit_begin; #ifdef JCTVC_M0458_INTERLAYER_RPS_SIG int NumILRRefIdx; diff --git a/mpp/codec/dec/h265/h265d_ps.c b/mpp/codec/dec/h265/h265d_ps.c index 82848130..50f7fe86 100644 --- a/mpp/codec/dec/h265/h265d_ps.c +++ b/mpp/codec/dec/h265/h265d_ps.c @@ -1633,8 +1633,8 @@ RK_S32 mpp_hevc_decode_nal_sps(HEVCContext *s) READ_BIT1(gb, &sps->set_mfm_enabled_flag); #endif READ_BIT1(gb, &sps->sps_strong_intra_smoothing_enable_flag); - sps->vui.sar.num = 0; - sps->vui.sar.den = 1; + sps->vui.sar.num = 0; + sps->vui.sar.den = 1; READ_BIT1(gb, &vui_present); if (vui_present) decode_vui(s, sps); diff --git a/mpp/codec/dec/h265/h265d_refs.c b/mpp/codec/dec/h265/h265d_refs.c index 0ba80dbb..b387d173 100644 --- a/mpp/codec/dec/h265/h265d_refs.c +++ b/mpp/codec/dec/h265/h265d_refs.c @@ -210,11 +210,11 @@ static HEVCFrame *find_ref_idx(HEVCContext *s, int poc) int mpp_hevc_slice_rpl(HEVCContext *s) { - RK_U8 list_idx; - RK_U32 i; - RK_S32 j, ret; - RefPicList *rpl = NULL; - RK_S32 cand_lists[3]; + RK_U8 list_idx; + RK_U32 i; + RK_S32 j, ret; + RefPicList *rpl = NULL; + RK_S32 cand_lists[3]; SliceHeader *sh = &s->sh; RK_U8 nb_list = sh->slice_type == B_SLICE ? 2 : 1; @@ -238,8 +238,8 @@ int mpp_hevc_slice_rpl(HEVCContext *s) * ST_CURR_BEF - ST_CURR_AFT - LT_CURR for the L0 and * ST_CURR_AFT - ST_CURR_BEF - LT_CURR for the L1 */ cand_lists[0] = list_idx ? ST_CURR_AFT : ST_CURR_BEF; - cand_lists[1] = list_idx ? ST_CURR_BEF : ST_CURR_AFT; - cand_lists[2] = LT_CURR; + cand_lists[1] = list_idx ? ST_CURR_BEF : ST_CURR_AFT; + cand_lists[2] = LT_CURR; /* concatenate the candidate lists for the current frame */ while ((RK_U32)rpl_tmp.nb_refs < sh->nb_refs[list_idx]) { for (i = 0; i < MPP_ARRAY_ELEMS(cand_lists); i++) { diff --git a/mpp/codec/dec/h265/test/h265d_parser_test.c b/mpp/codec/dec/h265/test/h265d_parser_test.c index cbe0015c..1ac8f9cc 100644 --- a/mpp/codec/dec/h265/test/h265d_parser_test.c +++ b/mpp/codec/dec/h265/test/h265d_parser_test.c @@ -98,7 +98,7 @@ static RK_S32 show_help() RK_U32 i = 0; RK_U32 n = sizeof(parserCmd) / sizeof(ParserCmd_t); - mpp_log("usage: parserDemo [options] input_file, \n\n"); + mpp_log("usage: parserDemo [options] input_file, \n\n"); for (i = 0; i < n; i++) { mpp_log("-%s %s\t\t%s\n", parserCmd[i].name, parserCmd[i].argname, parserCmd[i].help); @@ -367,7 +367,7 @@ RK_S32 hevc_parser_test(ParserDemoCmdContext_t *cmd) RK_U8 *tmpbuf = buf; RK_U8 *pos = NULL; - nal_len = get_next_nal(pInFile, buf); + nal_len = get_next_nal(pInFile, buf); mpp_err("get nal len from file %d", nal_len); do { mpp_packet_init(&rkpkt, tmpbuf, nal_len); @@ -432,7 +432,7 @@ RK_S32 hevc_parser_test(ParserDemoCmdContext_t *cmd) #if 1//def DUMP RK_U32 stride_w, stride_h; void *ptr = NULL; - MppBuffer framebuf; + MppBuffer framebuf; stride_w = mpp_frame_get_hor_stride(frame); stride_h = mpp_frame_get_ver_stride(frame); framebuf = mpp_frame_get_buffer(frame); @@ -495,9 +495,9 @@ RK_S32 hevc_parser_test(ParserDemoCmdContext_t *cmd) int main(int argc, char **argv) { - RK_S32 ret = 0; + RK_S32 ret = 0; ParserDemoCmdContext_t demoCmdCtx; - ParserDemoCmdContext_t* cmd = NULL; + ParserDemoCmdContext_t* cmd = NULL; if (argc == 1) { show_usage(); diff --git a/mpp/codec/mpp_buf_slot.cpp b/mpp/codec/mpp_buf_slot.cpp index 2aa215a8..e89d7f18 100644 --- a/mpp/codec/mpp_buf_slot.cpp +++ b/mpp/codec/mpp_buf_slot.cpp @@ -211,7 +211,7 @@ static void slot_ops_with_log(mpp_list *logs, MppBufSlotEntry *slot, MppBufSlotO mpp_err("found invalid operation code %d\n", op); } break; } - mpp_assert((RK_S16)(status&MPP_SLOT_HW_REF_MASK) >= 0); + mpp_assert((RK_S16)(status & MPP_SLOT_HW_REF_MASK) >= 0); slot->status = status; buf_slot_dbg(BUF_SLOT_DBG_OPS_RUNTIME, "index %2d op: %s status in %08x out %08x", index, op_string[op], before, status); diff --git a/mpp/codec/mpp_dec.cpp b/mpp/codec/mpp_dec.cpp index 4cde5f2a..9ea29f2e 100644 --- a/mpp/codec/mpp_dec.cpp +++ b/mpp/codec/mpp_dec.cpp @@ -116,7 +116,7 @@ void *mpp_dec_parser_thread(void *data) task_ready = task_dec->valid; if (!task_ready) continue; - parser_parse(dec->parser, task_dec); + parser_parse(dec->parser, task_dec); /* * 4. parse local task and slot to check whether new buffer or info change is needed. * diff --git a/mpp/hal/rkdec/h264d/hal_h264d_api.c b/mpp/hal/rkdec/h264d/hal_h264d_api.c index 52ea002c..90f28509 100644 --- a/mpp/hal/rkdec/h264d/hal_h264d_api.c +++ b/mpp/hal/rkdec/h264d/hal_h264d_api.c @@ -212,7 +212,7 @@ MPP_RET hal_h264d_gen_regs(void *hal, HalTask *task) FunctionIn(p_hal->logctx.parr[RUN_HAL]); explain_input_buffer(hal, &task->dec); - prepare_spspps_packet(hal, &p_hal->pkts->spspps); + prepare_spspps_packet(hal, &p_hal->pkts->spspps); prepare_framerps_packet(hal, &p_hal->pkts->rps); prepare_scanlist_packet(hal, &p_hal->pkts->scanlist); prepare_stream_packet(hal, &p_hal->pkts->strm); diff --git a/mpp/hal/rkdec/h264d/hal_h264d_packet.c b/mpp/hal/rkdec/h264d/hal_h264d_packet.c index 0010f915..962eec92 100644 --- a/mpp/hal/rkdec/h264d/hal_h264d_packet.c +++ b/mpp/hal/rkdec/h264d/hal_h264d_packet.c @@ -464,28 +464,26 @@ void generate_regs(void *hal, FifoCtx_t *pkt) fifo_fwrite_data(pkt); //!< "REGH" header 32 bit } -/*! -*********************************************************************** -* \brief -* for debug -*********************************************************************** -*/ -void fprint_fifo_data(FILE *fp, FifoCtx_t *pkt) -{ - RK_U32 i = 0, pkt_size = 0; - RK_U8 *ptr = (RK_U8 *)pkt->pbuf; - if (fp) { - pkt_size = pkt->index * sizeof(RK_U64); - fprintf(fp, "------ Header=%08x, size=%d ------ \n", pkt->header, pkt_size); - for (i = 0; i < pkt_size;) - { - fprintf(fp, "0x%02x, ", ptr[i]); - i++; - if ((i % 16) == 0) - { - fprintf(fp, "\n"); - } - } - fprintf(fp, "\n\n"); - } +/*! +*********************************************************************** +* \brief +* for debug +*********************************************************************** +*/ +void fprint_fifo_data(FILE *fp, FifoCtx_t *pkt) +{ + RK_U32 i = 0, pkt_size = 0; + RK_U8 *ptr = (RK_U8 *)pkt->pbuf; + if (fp) { + pkt_size = pkt->index * sizeof(RK_U64); + fprintf(fp, "------ Header=%08x, size=%d ------ \n", pkt->header, pkt_size); + for (i = 0; i < pkt_size;) { + fprintf(fp, "0x%02x, ", ptr[i]); + i++; + if ((i % 16) == 0) { + fprintf(fp, "\n"); + } + } + fprintf(fp, "\n\n"); + } } \ No newline at end of file diff --git a/mpp/hal/rkdec/h265d/hal_h265d_reg.c b/mpp/hal/rkdec/h265d/hal_h265d_reg.c index 6c4916c0..a4e9e32a 100644 --- a/mpp/hal/rkdec/h265d/hal_h265d_reg.c +++ b/mpp/hal/rkdec/h265d/hal_h265d_reg.c @@ -378,9 +378,9 @@ static RK_S32 _count = 0; static RK_U64 mpp_get_bits(RK_U64 src, RK_S32 size, RK_S32 offset) { - RK_S32 i; + RK_S32 i; RK_U64 temp = 0; - + mpp_assert(size + offset <= 64);// 64 is the FIFO_BIT_WIDTH for (i = 0; i < size ; i++) { @@ -414,9 +414,9 @@ static void mpp_put_bits(RK_U64 data, RK_S32 size, RK_U64* Dec_Fifo, RK_S32 *p_f static void mpp_align(RK_S32 align_width, RK_U64* Dec_Fifo, RK_S32 *p_fifo_index, RK_S32 *p_bit_offset, RK_S32 *p_bit_len, RK_S32 fifo_len) { - RK_S32 i; - RK_U64 temp = 0; - RK_S32 len = 0; + RK_S32 i; + RK_U64 temp = 0; + RK_S32 len = 0; if (*p_fifo_index >= fifo_len) return; @@ -441,7 +441,7 @@ static void mpp_align(RK_S32 align_width, RK_U64* Dec_Fifo, RK_S32 *p_fifo_index static void hal_record_scaling_list(scalingFactor_t *pScalingFactor_out, scalingList_t *pScalingList) { - RK_S32 i; + RK_S32 i; RK_U32 g_scalingListNum_model[SCALING_LIST_SIZE_NUM] = {6, 6, 6, 2}; // from C Model RK_U32 nIndex = 0; RK_U32 sizeId, matrixId, listId; @@ -580,8 +580,8 @@ static int hal_h265d_slice_rpl(void *dxva, SliceHeader_t *sh, RefPicListTab_t *r RK_U8 list_idx; RK_U32 i, j; RK_U8 bef_nb_refs = 0, aft_nb_refs = 0, lt_cur_nb_refs = 0; - h265d_dxva2_picture_context_t *dxva_cxt = NULL; - RK_S32 cand_lists[3]; + h265d_dxva2_picture_context_t *dxva_cxt = NULL; + RK_S32 cand_lists[3]; memset(ref, 0, sizeof(RefPicListTab_t)); dxva_cxt = (h265d_dxva2_picture_context_t*)dxva; @@ -614,10 +614,10 @@ static int hal_h265d_slice_rpl(void *dxva, SliceHeader_t *sh, RefPicListTab_t *r /* The order of the elements is * ST_CURR_BEF - ST_CURR_AFT - LT_CURR for the L0 and * ST_CURR_AFT - ST_CURR_BEF - LT_CURR for the L1 */ - - cand_lists[0] = list_idx ? ST_CURR_AFT : ST_CURR_BEF; - cand_lists[1] = list_idx ? ST_CURR_BEF : ST_CURR_AFT; - cand_lists[2] = LT_CURR; + + cand_lists[0] = list_idx ? ST_CURR_AFT : ST_CURR_BEF; + cand_lists[1] = list_idx ? ST_CURR_BEF : ST_CURR_AFT; + cand_lists[2] = LT_CURR; /* concatenate the candidate lists for the current frame */ while ((RK_U32)rpl_tmp.nb_refs < sh->nb_refs[list_idx]) { for (i = 0; i < MPP_ARRAY_ELEMS(cand_lists); i++) { @@ -670,8 +670,8 @@ static RK_S32 hal_h265d_slice_output_rps(void *dxva, void *rps_buf) RK_U8 lowdelay_flag[600]; slice_ref_map_t rps_pic_info[600][2][15]; RK_U32 nb_refs = 0; - RK_S32 bit_begin; - h265d_dxva2_picture_context_t *dxva_cxt = NULL; + RK_S32 bit_begin; + h265d_dxva2_picture_context_t *dxva_cxt = NULL; memset(&rps_pic_info, 0, sizeof(rps_pic_info)); memset(&slice_nb_rps_poc, 0, sizeof(slice_nb_rps_poc)); @@ -944,7 +944,7 @@ static RK_S32 hal_h265d_slice_output_rps(void *dxva, void *rps_buf) RK_S32 bit_offset = 0; RK_S32 fifo_len = nb_slice * 4;//size of rps_packet RK_S32 bit_len = 0; - RK_U64 *rps_packet = mpp_malloc(RK_U64, fifo_len); + RK_U64 *rps_packet = mpp_malloc(RK_U64, fifo_len); for (k = 0; k < (RK_U32)nb_slice; k++) { for (j = 0; j < 2; j++) { @@ -980,8 +980,8 @@ static RK_S32 hal_h265d_slice_output_rps(void *dxva, void *rps_buf) if (rps_buf != NULL) { memcpy(rps_buf, rps_packet, nb_slice * 32); } - mpp_free(rps_packet); - } + mpp_free(rps_packet); + } return 0; } @@ -1023,13 +1023,13 @@ RK_S32 hal_h265d_output_pps_packet(void *hal, void *dxva) RK_S32 bit_len = 0; RK_S32 i, j; RK_U32 addr; - RK_U64 *pps_packet = NULL; - RK_U32 log2_min_cb_size; - RK_S32 width, height; + RK_U64 *pps_packet = NULL; + RK_U32 log2_min_cb_size; + RK_S32 width, height; h265d_reg_context_t *reg_cxt = ( h265d_reg_context_t *)hal; h265d_dxva2_picture_context_t *dxva_cxt = (h265d_dxva2_picture_context_t*)dxva; - _count = 0; + _count = 0; if (NULL == reg_cxt || dxva_cxt == NULL) { mpp_err("%s:%s:%d reg_cxt or dxva_cxt is NULL", __FILE__, __FUNCTION__, __LINE__); @@ -1215,7 +1215,7 @@ RK_S32 hal_h265d_output_pps_packet(void *hal, void *dxva) } { - RK_U8 *p0, *p1; + RK_U8 *p0, *p1; RK_U8 *ptr_scaling = (RK_U8 *)mpp_buffer_get_ptr(reg_cxt->scaling_list_data); if (dxva_cxt->pp.scaling_list_data_present_flag) { addr = (dxva_cxt->pp.pps_id + 16) * 1360; @@ -1237,9 +1237,9 @@ RK_S32 hal_h265d_output_pps_packet(void *hal, void *dxva) } #endif mpp_put_bits(0 , 32 , pps_packet, &fifo_index, &bit_offset, &bit_len, fifo_len); - - p0 = (RK_U8*)&pps_packet[9]; - p1 = (RK_U8*)&addr; + + p0 = (RK_U8*)&pps_packet[9]; + p1 = (RK_U8*)&addr; p0[2] = p1[0]; p0[3] = p1[1]; p0[4] = p1[2]; @@ -1252,17 +1252,17 @@ RK_S32 hal_h265d_output_pps_packet(void *hal, void *dxva) fwrite(pps_ptr, 1, 80 * 64, fp); fflush(fp); #endif - mpp_free(pps_packet); + mpp_free(pps_packet); return 0; } MPP_RET hal_h265d_gen_regs(void *hal, HalTask *syn) { - RK_U32 uiMaxCUWidth, uiMaxCUHeight; - RK_U32 log2_min_cb_size; - RK_S32 width, height, numCuInWidth; - RK_S32 stride_y, stride_uv, virstrid_y, virstrid_yuv; + RK_U32 uiMaxCUWidth, uiMaxCUHeight; + RK_U32 log2_min_cb_size; + RK_S32 width, height, numCuInWidth; + RK_S32 stride_y, stride_uv, virstrid_y, virstrid_yuv; H265d_REGS_t *hw_regs; RK_S32 ret = MPP_SUCCESS; @@ -1306,21 +1306,21 @@ MPP_RET hal_h265d_gen_regs(void *hal, HalTask *syn) uiMaxCUWidth = 1 << (dxva_cxt->pp.log2_diff_max_min_luma_coding_block_size + dxva_cxt->pp.log2_min_luma_coding_block_size_minus3 + 3); uiMaxCUHeight = uiMaxCUWidth; - + log2_min_cb_size = dxva_cxt->pp.log2_min_luma_coding_block_size_minus3 + 3; - + width = (dxva_cxt->pp.PicWidthInMinCbsY << log2_min_cb_size); - + height = (dxva_cxt->pp.PicHeightInMinCbsY << log2_min_cb_size); - + numCuInWidth = width / uiMaxCUWidth + (width % uiMaxCUWidth != 0); - + stride_y = ((((numCuInWidth * uiMaxCUWidth * (dxva_cxt->pp.bit_depth_luma_minus8 + 8) + 2047) & (~2047)) | 2048) >> 3); stride_uv = ((((numCuInWidth * uiMaxCUHeight * (dxva_cxt->pp.bit_depth_chroma_minus8 + 8) + 2047) & (~2047)) | 2048) >> 3); virstrid_y = stride_y * height; - + virstrid_yuv = virstrid_y + stride_uv * height / 2; hw_regs->sw_picparameter.sw_slice_num = dxva_cxt->slice_count; @@ -1486,4 +1486,4 @@ const MppHalApi hal_api_h265d = { }; #endif - + diff --git a/mpp/test/h264d_rwfile.c b/mpp/test/h264d_rwfile.c index d37eec73..a6adda9b 100644 --- a/mpp/test/h264d_rwfile.c +++ b/mpp/test/h264d_rwfile.c @@ -485,12 +485,12 @@ static void find_next_nalu(InputParams *p_in) RK_U32 g_nalu_cnt2 = 0; static MPP_RET read_next_nalu(InputParams *p_in) { - RK_S32 forbidden_bit = -1; - RK_S32 nal_reference_idc = -1; - RK_S32 nal_unit_type = -1; - RK_S32 nalu_header_bytes = -1; - RK_U32 first_mb_in_slice = -1; - RK_S32 svc_extension_flag = -1; + RK_S32 forbidden_bit = -1; + RK_S32 nal_reference_idc = -1; + RK_S32 nal_unit_type = -1; + RK_S32 nalu_header_bytes = -1; + RK_U32 first_mb_in_slice = -1; + RK_S32 svc_extension_flag = -1; GetBitCtx_t *pStrmData = (GetBitCtx_t *)p_in->bitctx; memset(pStrmData, 0, sizeof(GetBitCtx_t)); @@ -499,32 +499,31 @@ static MPP_RET read_next_nalu(InputParams *p_in) ASSERT(forbidden_bit == 0); read_bits( pStrmData, 2, &nal_reference_idc); read_bits( pStrmData, 5, &nal_unit_type); - if (g_nalu_cnt2 == 344) - { - g_nalu_cnt2 = g_nalu_cnt2; - } - //if (g_debug_file0 == NULL) - //{ - // g_debug_file0 = fopen("rk_debugfile_view0.txt", "wb"); - //} - //FPRINT(g_debug_file0, "g_nalu_cnt = %d, nal_unit_type = %d, nalu_size = %d\n", g_nalu_cnt2++, nal_unit_type, p_in->IO.nalubytes); + if (g_nalu_cnt2 == 344) { + g_nalu_cnt2 = g_nalu_cnt2; + } + //if (g_debug_file0 == NULL) + //{ + // g_debug_file0 = fopen("rk_debugfile_view0.txt", "wb"); + //} + //FPRINT(g_debug_file0, "g_nalu_cnt = %d, nal_unit_type = %d, nalu_size = %d\n", g_nalu_cnt2++, nal_unit_type, p_in->IO.nalubytes); nalu_header_bytes = 1; if ((nal_unit_type == NALU_TYPE_PREFIX) || (nal_unit_type == NALU_TYPE_SLC_EXT)) { - read_bits(pStrmData, 1, &svc_extension_flag); - if (!svc_extension_flag && nal_unit_type == NALU_TYPE_SLC_EXT) {//!< MVC - nal_unit_type = NALU_TYPE_SLICE; - } + read_bits(pStrmData, 1, &svc_extension_flag); + if (!svc_extension_flag && nal_unit_type == NALU_TYPE_SLC_EXT) {//!< MVC + nal_unit_type = NALU_TYPE_SLICE; + } nalu_header_bytes += 3; } //-- parse slice if ( nal_unit_type == NALU_TYPE_SLICE || nal_unit_type == NALU_TYPE_IDR) { set_streamdata(pStrmData, (p_in->IO.pNALU + nalu_header_bytes), 4); // reset read_ue(pStrmData, &first_mb_in_slice); - //FPRINT(g_debug_file0, "first_mb_in_slice = %d \n", first_mb_in_slice); - //if (first_mb_in_slice == 0) { - // FPRINT(g_debug_file0, "--- new frame ---- \n"); - //} + //FPRINT(g_debug_file0, "first_mb_in_slice = %d \n", first_mb_in_slice); + //if (first_mb_in_slice == 0) { + // FPRINT(g_debug_file0, "--- new frame ---- \n"); + //} if (!p_in->is_fist_frame && (first_mb_in_slice == 0)) { p_in->is_new_frame = 1; } @@ -758,17 +757,16 @@ MPP_RET h264d_read_one_frame(InputParams *p_in, MppPacket pkt) find_next_nalu(p_in); read_next_nalu(p_in); } while (!p_in->is_new_frame && !p_in->is_eof); - //if (first_mb_in_slice == 0) { - //FPRINT(g_debug_file0, "--- new frame ---- \n"); - //} + //if (first_mb_in_slice == 0) { + //FPRINT(g_debug_file0, "--- new frame ---- \n"); + //} //-- set code input context ((MppPacketImpl *)pkt)->pos = p_in->strm.pbuf; - ((MppPacketImpl *)pkt)->size = p_in->strm.strmbytes; - if (g_max_slice_data < p_in->strm.strmbytes) - { - g_max_slice_data = p_in->strm.strmbytes; - } + ((MppPacketImpl *)pkt)->size = p_in->strm.strmbytes; + if (g_max_slice_data < p_in->strm.strmbytes) { + g_max_slice_data = p_in->strm.strmbytes; + } if (p_in->is_eof) { mpp_packet_set_eos(pkt); } diff --git a/mpp/test/h264d_test.c b/mpp/test/h264d_test.c index 38f75084..aa5538aa 100644 --- a/mpp/test/h264d_test.c +++ b/mpp/test/h264d_test.c @@ -109,9 +109,9 @@ __FAILED: int main(int argc, char **argv) { - //FILE *g_debug_file = NULL; - //RK_S32 m_max_bytes = 0; - //RK_S32 m_max_slice_data = 0; + //FILE *g_debug_file = NULL; + //RK_S32 m_max_bytes = 0; + //RK_S32 m_max_slice_data = 0; MPP_RET ret = MPP_ERR_UNKNOW; InputParams *pIn = mpp_calloc(InputParams, 1); @@ -132,18 +132,18 @@ int main(int argc, char **argv) do { if (!pkt->size) { FUN_CHECK(ret = h264d_read_one_frame(pIn, (MppPacket)pkt)); - //if (g_debug_file1 == NULL) - //{ - // g_debug_file1 = fopen("rk_debugfile_view1.txt", "wb"); - //} - //FPRINT(g_debug_file1, "---- read_one_frame Frame_no = %d, size = %d \n", pIn->iFrmdecoded, pkt->size); - mpp_log("---- decoder, read_one_frame Frame_no = %d \n", pIn->iFrmdecoded++); + //if (g_debug_file1 == NULL) + //{ + // g_debug_file1 = fopen("rk_debugfile_view1.txt", "wb"); + //} + //FPRINT(g_debug_file1, "---- read_one_frame Frame_no = %d, size = %d \n", pIn->iFrmdecoded, pkt->size); + mpp_log("---- decoder, read_one_frame Frame_no = %d \n", pIn->iFrmdecoded++); } - FUN_CHECK(ret = parser_prepare(pApi->parser, pkt, &task->dec)); + FUN_CHECK(ret = parser_prepare(pApi->parser, pkt, &task->dec)); FUN_CHECK(ret = parser_parse(pApi->parser, &task->dec)); - //FPRINT(g_debug_file1, "parse, frame_no = %d, size = %d \n", pIn->iFrmdecoded, pkt->size); + //FPRINT(g_debug_file1, "parse, frame_no = %d, size = %d \n", pIn->iFrmdecoded, pkt->size); if (((HalDecTask*)&task->dec)->valid) { - FUN_CHECK(ret = mpp_hal_reg_gen(pApi->hal, task)); + FUN_CHECK(ret = mpp_hal_reg_gen(pApi->hal, task)); //!< end of stream if (!pkt->size && (pkt->flag & MPP_PACKET_FLAG_EOS)) { break; @@ -166,23 +166,23 @@ __FAILED: mpp_free(pkt); mpp_free(task); - //g_debug_file = fopen("rk_debugfile_view0.txt", "rb"); - //if(g_debug_file) - // fscanf(g_debug_file, "(max_bytes)%d, (max_slice_data)%d \n", &m_max_bytes, &m_max_slice_data); - //FCLOSE(g_debug_file); - //if (m_max_bytes < g_max_bytes) - //{ - // m_max_bytes = g_max_bytes; - //} - //if (m_max_slice_data < g_max_slice_data) - //{ - // m_max_slice_data = g_max_slice_data; - //} - //g_debug_file = fopen("rk_debugfile_view0.txt", "ab+"); - //if(g_debug_file) - // fprintf(g_debug_file, "(max_bytes)%d, (max_slice_data)%d \n", g_max_bytes, g_max_slice_data); + //g_debug_file = fopen("rk_debugfile_view0.txt", "rb"); + //if(g_debug_file) + // fscanf(g_debug_file, "(max_bytes)%d, (max_slice_data)%d \n", &m_max_bytes, &m_max_slice_data); + //FCLOSE(g_debug_file); + //if (m_max_bytes < g_max_bytes) + //{ + // m_max_bytes = g_max_bytes; + //} + //if (m_max_slice_data < g_max_slice_data) + //{ + // m_max_slice_data = g_max_slice_data; + //} + //g_debug_file = fopen("rk_debugfile_view0.txt", "ab+"); + //if(g_debug_file) + // fprintf(g_debug_file, "(max_bytes)%d, (max_slice_data)%d \n", g_max_bytes, g_max_slice_data); - //FCLOSE(g_debug_file); + //FCLOSE(g_debug_file); return ret; }