mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-08 02:20:06 +08:00
[all]: fix compiling error and coding style formating
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@354 6e48237b-75ef-9749-8fc9-41990f28c85a
This commit is contained in:
@@ -199,8 +199,8 @@ void mpp_fetch_timestamp(SplitContext_t *s, RK_S32 off, RK_S32 remove)
|
|||||||
s->dts = s->cur_frame_dts[i];
|
s->dts = s->cur_frame_dts[i];
|
||||||
s->pts = s->cur_frame_pts[i];
|
s->pts = s->cur_frame_pts[i];
|
||||||
s->offset = s->next_frame_offset - s->cur_frame_offset[i];
|
s->offset = s->next_frame_offset - s->cur_frame_offset[i];
|
||||||
/* if (remove)
|
/* if (remove)
|
||||||
s->cur_frame_offset[i] = INT64_MAX;*/
|
s->cur_frame_offset[i] = INT64_MAX;*/
|
||||||
if (s->cur_offset + off < s->cur_frame_end[i])
|
if (s->cur_offset + off < s->cur_frame_end[i])
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -276,7 +276,7 @@ RK_S32 h265d_split_reset(void *sc)
|
|||||||
buf = s->buffer;
|
buf = s->buffer;
|
||||||
size = s->buffer_size;
|
size = s->buffer_size;
|
||||||
s->fetch_timestamp = 1;
|
s->fetch_timestamp = 1;
|
||||||
memset(s,0,sizeof(SplitContext_t));
|
memset(s, 0, sizeof(SplitContext_t));
|
||||||
s->buffer = buf;
|
s->buffer = buf;
|
||||||
s->buffer_size = size;
|
s->buffer_size = size;
|
||||||
return MPP_OK;
|
return MPP_OK;
|
||||||
@@ -1616,7 +1616,8 @@ MPP_RET h265d_prepare(void *ctx, MppPacket pkt, HalDecTask *task)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MPP_RET h265d_get_stream(void *ctx, RK_U8 **buf, RK_S32 *size){
|
MPP_RET h265d_get_stream(void *ctx, RK_U8 **buf, RK_S32 *size)
|
||||||
|
{
|
||||||
MPP_RET ret = MPP_OK;
|
MPP_RET ret = MPP_OK;
|
||||||
H265dContext_t *h265dctx = (H265dContext_t *)ctx;
|
H265dContext_t *h265dctx = (H265dContext_t *)ctx;
|
||||||
HEVCContext *s = h265dctx->priv_data;
|
HEVCContext *s = h265dctx->priv_data;
|
||||||
@@ -1625,7 +1626,8 @@ MPP_RET h265d_get_stream(void *ctx, RK_U8 **buf, RK_S32 *size){
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
MPP_RET h265d_set_compare_info(void *ctx, void *info){
|
MPP_RET h265d_set_compare_info(void *ctx, void *info)
|
||||||
|
{
|
||||||
MPP_RET ret = MPP_OK;
|
MPP_RET ret = MPP_OK;
|
||||||
H265dContext_t *h265dctx = (H265dContext_t *)ctx;
|
H265dContext_t *h265dctx = (H265dContext_t *)ctx;
|
||||||
h265dctx->compare_info = info;
|
h265dctx->compare_info = info;
|
||||||
@@ -1651,17 +1653,17 @@ MPP_RET h265d_parse(void *ctx, HalDecTask *task)
|
|||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
h265d_dbg(H265D_DBG_GLOBAL,"decode poc = %d", s->poc);
|
h265d_dbg(H265D_DBG_GLOBAL, "decode poc = %d", s->poc);
|
||||||
if (s->ref) {
|
if (s->ref) {
|
||||||
h265d_parser2_syntax(h265dctx);
|
h265d_parser2_syntax(h265dctx);
|
||||||
s->task->syntax.data = s->hal_pic_private;
|
s->task->syntax.data = s->hal_pic_private;
|
||||||
s->task->syntax.number = 1;
|
s->task->syntax.number = 1;
|
||||||
s->task->valid = 1;
|
s->task->valid = 1;
|
||||||
if (s->eos) {
|
if (s->eos) {
|
||||||
s->task->flags |= MPP_PACKET_FLAG_EOS;
|
s->task->flags.eos = 1;
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
if(s->eos){
|
if (s->eos) {
|
||||||
h265d_flush(ctx);
|
h265d_flush(ctx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -158,7 +158,7 @@ static void fill_picture_parameters(const HEVCContext *h,
|
|||||||
pp->log2_parallel_merge_level_minus2 = pps->log2_parallel_merge_level - 2;
|
pp->log2_parallel_merge_level_minus2 = pps->log2_parallel_merge_level - 2;
|
||||||
pp->CurrPicOrderCntVal = h->poc;
|
pp->CurrPicOrderCntVal = h->poc;
|
||||||
|
|
||||||
// mpp_err("fill RefPicList from the DPB");
|
// mpp_err("fill RefPicList from the DPB");
|
||||||
// fill RefPicList from the DPB
|
// fill RefPicList from the DPB
|
||||||
for (i = 0, j = 0; i < MPP_ARRAY_ELEMS(pp->RefPicList); i++) {
|
for (i = 0, j = 0; i < MPP_ARRAY_ELEMS(pp->RefPicList); i++) {
|
||||||
const HEVCFrame *frame = NULL;
|
const HEVCFrame *frame = NULL;
|
||||||
@@ -270,7 +270,7 @@ RK_S32 h265d_syntax_fill_slice(void *ctx, RK_S32 input_index)
|
|||||||
MppBuffer streambuf = NULL;
|
MppBuffer streambuf = NULL;
|
||||||
RK_S32 i, count = 0;
|
RK_S32 i, count = 0;
|
||||||
RK_U32 position = 0;
|
RK_U32 position = 0;
|
||||||
// mpp_err("input_index = %d",input_index);
|
// mpp_err("input_index = %d",input_index);
|
||||||
mpp_buf_slot_get_prop(h->packet_slots, input_index, SLOT_BUFFER, &streambuf);
|
mpp_buf_slot_get_prop(h->packet_slots, input_index, SLOT_BUFFER, &streambuf);
|
||||||
RK_U8 *ptr = (RK_U8 *)mpp_buffer_get_ptr(streambuf);
|
RK_U8 *ptr = (RK_U8 *)mpp_buffer_get_ptr(streambuf);
|
||||||
RK_U8 *current = ptr;
|
RK_U8 *current = ptr;
|
||||||
@@ -303,7 +303,7 @@ RK_S32 h265d_syntax_fill_slice(void *ctx, RK_S32 input_index)
|
|||||||
current += start_code_size;
|
current += start_code_size;
|
||||||
position += start_code_size;
|
position += start_code_size;
|
||||||
memcpy(current, h->nals[i].data, h->nals[i].size);
|
memcpy(current, h->nals[i].data, h->nals[i].size);
|
||||||
// mpp_log("h->nals[%d].size = %d", i, h->nals[i].size);
|
// mpp_log("h->nals[%d].size = %d", i, h->nals[i].size);
|
||||||
fill_slice_short(&ctx_pic->slice_short[count], position, h->nals[i].size);
|
fill_slice_short(&ctx_pic->slice_short[count], position, h->nals[i].size);
|
||||||
current += h->nals[i].size;
|
current += h->nals[i].size;
|
||||||
position += h->nals[i].size;
|
position += h->nals[i].size;
|
||||||
|
@@ -1527,7 +1527,7 @@ RK_S32 mpp_hevc_decode_nal_sps(HEVCContext *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
READ_ONEBIT(gb, &sublayer_ordering_info);
|
READ_ONEBIT(gb, &sublayer_ordering_info);
|
||||||
h265d_dbg(H265D_DBG_SPS,"read bit left %d",gb->num_remaining_bits_in_curr_byte_ + gb->bytes_left_*8);
|
h265d_dbg(H265D_DBG_SPS, "read bit left %d", gb->num_remaining_bits_in_curr_byte_ + gb->bytes_left_ * 8);
|
||||||
start = sublayer_ordering_info ? 0 : sps->max_sub_layers - 1;
|
start = sublayer_ordering_info ? 0 : sps->max_sub_layers - 1;
|
||||||
for (i = start; i < sps->max_sub_layers; i++) {
|
for (i = start; i < sps->max_sub_layers; i++) {
|
||||||
READ_UE(gb, &sps->temporal_layer[i].max_dec_pic_buffering) ;
|
READ_UE(gb, &sps->temporal_layer[i].max_dec_pic_buffering) ;
|
||||||
@@ -1560,25 +1560,25 @@ RK_S32 mpp_hevc_decode_nal_sps(HEVCContext *s)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
h265d_dbg(H265D_DBG_SPS,"2 read bit left %d",gb->num_remaining_bits_in_curr_byte_ + gb->bytes_left_*8);
|
h265d_dbg(H265D_DBG_SPS, "2 read bit left %d", gb->num_remaining_bits_in_curr_byte_ + gb->bytes_left_ * 8);
|
||||||
READ_UE(gb, &sps->log2_min_cb_size) ;
|
READ_UE(gb, &sps->log2_min_cb_size) ;
|
||||||
sps->log2_min_cb_size += 3;
|
sps->log2_min_cb_size += 3;
|
||||||
|
|
||||||
h265d_dbg(H265D_DBG_SPS,"sps->log2_min_cb_size %d",sps->log2_min_cb_size);
|
h265d_dbg(H265D_DBG_SPS, "sps->log2_min_cb_size %d", sps->log2_min_cb_size);
|
||||||
READ_UE(gb, &sps->log2_diff_max_min_coding_block_size);
|
READ_UE(gb, &sps->log2_diff_max_min_coding_block_size);
|
||||||
|
|
||||||
h265d_dbg(H265D_DBG_SPS,"sps->log2_diff_max_min_coding_block_size %d",sps->log2_diff_max_min_coding_block_size);
|
h265d_dbg(H265D_DBG_SPS, "sps->log2_diff_max_min_coding_block_size %d", sps->log2_diff_max_min_coding_block_size);
|
||||||
READ_UE(gb, &sps->log2_min_tb_size);
|
READ_UE(gb, &sps->log2_min_tb_size);
|
||||||
sps->log2_min_tb_size += 2;
|
sps->log2_min_tb_size += 2;
|
||||||
|
|
||||||
h265d_dbg(H265D_DBG_SPS,"sps->log2_min_tb_size %d",sps->log2_min_tb_size);
|
h265d_dbg(H265D_DBG_SPS, "sps->log2_min_tb_size %d", sps->log2_min_tb_size);
|
||||||
READ_UE(gb, &log2_diff_max_min_transform_block_size);
|
READ_UE(gb, &log2_diff_max_min_transform_block_size);
|
||||||
|
|
||||||
h265d_dbg(H265D_DBG_SPS,"sps->log2_diff_max_min_transform_block_size %d",log2_diff_max_min_transform_block_size);
|
h265d_dbg(H265D_DBG_SPS, "sps->log2_diff_max_min_transform_block_size %d", log2_diff_max_min_transform_block_size);
|
||||||
sps->log2_max_trafo_size = log2_diff_max_min_transform_block_size +
|
sps->log2_max_trafo_size = log2_diff_max_min_transform_block_size +
|
||||||
sps->log2_min_tb_size;
|
sps->log2_min_tb_size;
|
||||||
|
|
||||||
h265d_dbg(H265D_DBG_SPS,"sps->log2_max_trafo_size %d",sps->log2_max_trafo_size);
|
h265d_dbg(H265D_DBG_SPS, "sps->log2_max_trafo_size %d", sps->log2_max_trafo_size);
|
||||||
|
|
||||||
if (sps->log2_min_tb_size >= sps->log2_min_cb_size) {
|
if (sps->log2_min_tb_size >= sps->log2_min_cb_size) {
|
||||||
mpp_err( "Invalid value for log2_min_tb_size");
|
mpp_err( "Invalid value for log2_min_tb_size");
|
||||||
@@ -1609,9 +1609,9 @@ RK_S32 mpp_hevc_decode_nal_sps(HEVCContext *s)
|
|||||||
READ_ONEBIT(gb, &sps->sao_enabled);
|
READ_ONEBIT(gb, &sps->sao_enabled);
|
||||||
READ_ONEBIT(gb, &sps->pcm_enabled_flag);
|
READ_ONEBIT(gb, &sps->pcm_enabled_flag);
|
||||||
|
|
||||||
h265d_dbg(H265D_DBG_SPS,"sps->amp_enabled_flag = %d", sps->amp_enabled_flag);
|
h265d_dbg(H265D_DBG_SPS, "sps->amp_enabled_flag = %d", sps->amp_enabled_flag);
|
||||||
h265d_dbg(H265D_DBG_SPS,"sps->sao_enabled = %d", sps->sao_enabled);
|
h265d_dbg(H265D_DBG_SPS, "sps->sao_enabled = %d", sps->sao_enabled);
|
||||||
h265d_dbg(H265D_DBG_SPS,"sps->pcm_enabled_flag = %d", sps->pcm_enabled_flag);
|
h265d_dbg(H265D_DBG_SPS, "sps->pcm_enabled_flag = %d", sps->pcm_enabled_flag);
|
||||||
|
|
||||||
if (sps->pcm_enabled_flag) {
|
if (sps->pcm_enabled_flag) {
|
||||||
READ_BITS(gb, 4, &sps->pcm.bit_depth);
|
READ_BITS(gb, 4, &sps->pcm.bit_depth);
|
||||||
@@ -1724,9 +1724,9 @@ RK_S32 mpp_hevc_decode_nal_sps(HEVCContext *s)
|
|||||||
// Inferred parameters
|
// Inferred parameters
|
||||||
sps->log2_ctb_size = sps->log2_min_cb_size + sps->log2_diff_max_min_coding_block_size;
|
sps->log2_ctb_size = sps->log2_min_cb_size + sps->log2_diff_max_min_coding_block_size;
|
||||||
|
|
||||||
h265d_dbg(H265D_DBG_SPS,"sps->log2_min_cb_size = %d sps->log2_diff_max_min_coding_block_size = %d",sps->log2_min_cb_size,sps->log2_diff_max_min_coding_block_size);
|
h265d_dbg(H265D_DBG_SPS, "sps->log2_min_cb_size = %d sps->log2_diff_max_min_coding_block_size = %d", sps->log2_min_cb_size, sps->log2_diff_max_min_coding_block_size);
|
||||||
|
|
||||||
h265d_dbg(H265D_DBG_SPS,"plus sps->log2_ctb_size %d",sps->log2_ctb_size);
|
h265d_dbg(H265D_DBG_SPS, "plus sps->log2_ctb_size %d", sps->log2_ctb_size);
|
||||||
sps->log2_min_pu_size = sps->log2_min_cb_size - 1;
|
sps->log2_min_pu_size = sps->log2_min_cb_size - 1;
|
||||||
|
|
||||||
sps->ctb_width = (sps->width + (1 << sps->log2_ctb_size) - 1) >> sps->log2_ctb_size;
|
sps->ctb_width = (sps->width + (1 << sps->log2_ctb_size) - 1) >> sps->log2_ctb_size;
|
||||||
@@ -1762,7 +1762,7 @@ RK_S32 mpp_hevc_decode_nal_sps(HEVCContext *s)
|
|||||||
sps->max_transform_hierarchy_depth_intra);
|
sps->max_transform_hierarchy_depth_intra);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
h265d_dbg(H265D_DBG_SPS,"sps->log2_ctb_size %d",sps->log2_ctb_size);
|
h265d_dbg(H265D_DBG_SPS, "sps->log2_ctb_size %d", sps->log2_ctb_size);
|
||||||
if (sps->log2_max_trafo_size > (RK_U32)MPP_MIN(sps->log2_ctb_size, 5)) {
|
if (sps->log2_max_trafo_size > (RK_U32)MPP_MIN(sps->log2_ctb_size, 5)) {
|
||||||
mpp_err(
|
mpp_err(
|
||||||
"max transform block size out of range: %d\n",
|
"max transform block size out of range: %d\n",
|
||||||
@@ -1770,15 +1770,15 @@ RK_S32 mpp_hevc_decode_nal_sps(HEVCContext *s)
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
if (s->h265dctx->compare_info != NULL) {
|
if (s->h265dctx->compare_info != NULL) {
|
||||||
CurrentFameInf_t *info = (CurrentFameInf_t *)s->h265dctx->compare_info;
|
CurrentFameInf_t *info = (CurrentFameInf_t *)s->h265dctx->compare_info;
|
||||||
HEVCSPS *openhevc_sps = (HEVCSPS *)&info->sps[sps_id];
|
HEVCSPS *openhevc_sps = (HEVCSPS *)&info->sps[sps_id];
|
||||||
mpp_log("compare sps in");
|
mpp_log("compare sps in");
|
||||||
if (compare_sps(openhevc_sps, (HEVCSPS *)sps_buf) < 0) {
|
if (compare_sps(openhevc_sps, (HEVCSPS *)sps_buf) < 0) {
|
||||||
mpp_err("compare sps with openhevc error found");
|
mpp_err("compare sps with openhevc error found");
|
||||||
mpp_assert(0);
|
mpp_assert(0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
mpp_log("compare sps ok");
|
mpp_log("compare sps ok");
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
if (s->h265dctx->debug & FF_DEBUG_BITSTREAM) {
|
if (s->h265dctx->debug & FF_DEBUG_BITSTREAM) {
|
||||||
|
@@ -88,7 +88,7 @@ static HEVCFrame *alloc_frame(HEVCContext *s)
|
|||||||
if (ret != MPP_OK) {
|
if (ret != MPP_OK) {
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
h265d_dbg(H265D_DBG_GLOBAL,"width = %d height = %d", s->h265dctx->width, s->h265dctx->height);
|
h265d_dbg(H265D_DBG_GLOBAL, "width = %d height = %d", s->h265dctx->width, s->h265dctx->height);
|
||||||
mpp_frame_set_width(frame->frame, s->h265dctx->width);
|
mpp_frame_set_width(frame->frame, s->h265dctx->width);
|
||||||
mpp_frame_set_height(frame->frame, s->h265dctx->height);
|
mpp_frame_set_height(frame->frame, s->h265dctx->height);
|
||||||
|
|
||||||
|
@@ -315,7 +315,7 @@ RK_S32 hevc_parser_test(ParserDemoCmdContext_t *cmd)
|
|||||||
mpp_buf_slot_init(&slots);
|
mpp_buf_slot_init(&slots);
|
||||||
|
|
||||||
mpp_buf_slot_init(&packet_slots);
|
mpp_buf_slot_init(&packet_slots);
|
||||||
mpp_buf_slot_setup(packet_slots, 2, 1024*1024, 0);
|
mpp_buf_slot_setup(packet_slots, 2, 1024 * 1024, 0);
|
||||||
if (NULL == slots) {
|
if (NULL == slots) {
|
||||||
mpp_err("could not init buffer slot\n");
|
mpp_err("could not init buffer slot\n");
|
||||||
return MPP_ERR_UNKNOW;
|
return MPP_ERR_UNKNOW;
|
||||||
@@ -376,7 +376,7 @@ RK_S32 hevc_parser_test(ParserDemoCmdContext_t *cmd)
|
|||||||
mpp_err("get nal len from file %d", nal_len);
|
mpp_err("get nal len from file %d", nal_len);
|
||||||
do {
|
do {
|
||||||
mpp_packet_init(&rkpkt, tmpbuf, nal_len);
|
mpp_packet_init(&rkpkt, tmpbuf, nal_len);
|
||||||
if(-1 == curtask->input){
|
if (-1 == curtask->input) {
|
||||||
if (MPP_OK == mpp_buf_slot_get_unused(packet_slots, &index) ) {
|
if (MPP_OK == mpp_buf_slot_get_unused(packet_slots, &index) ) {
|
||||||
MppBuffer buffer = NULL;
|
MppBuffer buffer = NULL;
|
||||||
curtask->input = index;
|
curtask->input = index;
|
||||||
@@ -388,10 +388,10 @@ RK_S32 hevc_parser_test(ParserDemoCmdContext_t *cmd)
|
|||||||
mpp_err("mpp_buffer_get");
|
mpp_err("mpp_buffer_get");
|
||||||
mpp_buffer_get(mStreamGroup, &buffer, size);
|
mpp_buffer_get(mStreamGroup, &buffer, size);
|
||||||
if (buffer != NULL)
|
if (buffer != NULL)
|
||||||
mpp_err("mpp_buf_slot_set_prop %p",buffer);
|
mpp_err("mpp_buf_slot_set_prop %p", buffer);
|
||||||
mpp_buf_slot_set_prop(packet_slots, index, SLOT_BUFFER, buffer);
|
mpp_buf_slot_set_prop(packet_slots, index, SLOT_BUFFER, buffer);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
h265d_prepare(mpp_codex_ctx, rkpkt, curtask);
|
h265d_prepare(mpp_codex_ctx, rkpkt, curtask);
|
||||||
pos = (RK_U8 *)mpp_packet_get_pos(rkpkt);
|
pos = (RK_U8 *)mpp_packet_get_pos(rkpkt);
|
||||||
@@ -410,15 +410,15 @@ RK_S32 hevc_parser_test(ParserDemoCmdContext_t *cmd)
|
|||||||
curtask->valid = 0;
|
curtask->valid = 0;
|
||||||
#ifndef ANDROID
|
#ifndef ANDROID
|
||||||
#ifdef COMPARE
|
#ifdef COMPARE
|
||||||
mpp_err("hevc_decode_frame in \n");
|
mpp_err("hevc_decode_frame in \n");
|
||||||
void *sliceInfo = NULL;
|
void *sliceInfo = NULL;
|
||||||
RK_U8 *split_out_buf = NULL;
|
RK_U8 *split_out_buf = NULL;
|
||||||
RK_S32 split_size = 0;
|
RK_S32 split_size = 0;
|
||||||
h265d_get_stream(mpp_codex_ctx,&split_out_buf,&split_size);
|
h265d_get_stream(mpp_codex_ctx, &split_out_buf, &split_size);
|
||||||
libOpenHevcDecode(openHevcHandle, split_out_buf, split_size, 0);
|
libOpenHevcDecode(openHevcHandle, split_out_buf, split_size, 0);
|
||||||
sliceInfo = libOpenHevcGetSliceInfo(openHevcHandle);
|
sliceInfo = libOpenHevcGetSliceInfo(openHevcHandle);
|
||||||
mpp_err("open hevc out \n");
|
mpp_err("open hevc out \n");
|
||||||
h265d_set_compare_info(mpp_codex_ctx,sliceInfo);
|
h265d_set_compare_info(mpp_codex_ctx, sliceInfo);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
h265d_parse(mpp_codex_ctx, curtask);
|
h265d_parse(mpp_codex_ctx, curtask);
|
||||||
@@ -460,7 +460,7 @@ RK_S32 hevc_parser_test(ParserDemoCmdContext_t *cmd)
|
|||||||
if (ret == MPP_OK) {
|
if (ret == MPP_OK) {
|
||||||
mpp_buf_slot_get_prop(slots, index, SLOT_FRAME, &frame);
|
mpp_buf_slot_get_prop(slots, index, SLOT_FRAME, &frame);
|
||||||
if (frame) {
|
if (frame) {
|
||||||
#if 1//def DUMP
|
#if 1//def DUMP
|
||||||
RK_U32 stride_w, stride_h;
|
RK_U32 stride_w, stride_h;
|
||||||
void *ptr = NULL;
|
void *ptr = NULL;
|
||||||
MppBuffer framebuf;
|
MppBuffer framebuf;
|
||||||
@@ -468,11 +468,11 @@ RK_S32 hevc_parser_test(ParserDemoCmdContext_t *cmd)
|
|||||||
stride_h = mpp_frame_get_ver_stride(frame);
|
stride_h = mpp_frame_get_ver_stride(frame);
|
||||||
framebuf = mpp_frame_get_buffer(frame);
|
framebuf = mpp_frame_get_buffer(frame);
|
||||||
ptr = mpp_buffer_get_ptr(framebuf);
|
ptr = mpp_buffer_get_ptr(framebuf);
|
||||||
if(fp){
|
if (fp) {
|
||||||
fwrite(ptr, 1, stride_w * stride_h * 3 / 2, fp);
|
fwrite(ptr, 1, stride_w * stride_h * 3 / 2, fp);
|
||||||
fflush(fp);
|
fflush(fp);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
mpp_frame_deinit(&frame);
|
mpp_frame_deinit(&frame);
|
||||||
frame = NULL;
|
frame = NULL;
|
||||||
}
|
}
|
||||||
@@ -495,7 +495,7 @@ RK_S32 hevc_parser_test(ParserDemoCmdContext_t *cmd)
|
|||||||
mpp_buf_slot_set_flag(packet_slots, curtask->input, SLOT_HAL_INPUT);
|
mpp_buf_slot_set_flag(packet_slots, curtask->input, SLOT_HAL_INPUT);
|
||||||
mpp_buf_slot_get_prop(packet_slots, curtask->input, SLOT_BUFFER, &buffer);
|
mpp_buf_slot_get_prop(packet_slots, curtask->input, SLOT_BUFFER, &buffer);
|
||||||
mpp_buf_slot_clr_flag(packet_slots, curtask->input, SLOT_HAL_INPUT);
|
mpp_buf_slot_clr_flag(packet_slots, curtask->input, SLOT_HAL_INPUT);
|
||||||
mpp_err("mpp_buf_slot free for last packet %p",buffer);
|
mpp_err("mpp_buf_slot free for last packet %p", buffer);
|
||||||
mpp_buffer_put(buffer);
|
mpp_buffer_put(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -504,13 +504,13 @@ RK_S32 hevc_parser_test(ParserDemoCmdContext_t *cmd)
|
|||||||
RK_U32 index;
|
RK_U32 index;
|
||||||
ret = mpp_buf_slot_dequeue(slots, &index, QUEUE_DISPLAY);
|
ret = mpp_buf_slot_dequeue(slots, &index, QUEUE_DISPLAY);
|
||||||
if (ret == MPP_OK) {
|
if (ret == MPP_OK) {
|
||||||
mpp_log("get_display for index = %d",index);
|
mpp_log("get_display for index = %d", index);
|
||||||
mpp_buf_slot_get_prop(slots, index, SLOT_FRAME, &frame);
|
mpp_buf_slot_get_prop(slots, index, SLOT_FRAME, &frame);
|
||||||
if (frame) {
|
if (frame) {
|
||||||
mpp_frame_deinit(&frame);
|
mpp_frame_deinit(&frame);
|
||||||
}
|
}
|
||||||
mpp_buf_slot_clr_flag(slots, index, SLOT_QUEUE_USE);
|
mpp_buf_slot_clr_flag(slots, index, SLOT_QUEUE_USE);
|
||||||
}
|
}
|
||||||
|
|
||||||
} while (ret == MPP_OK);
|
} while (ret == MPP_OK);
|
||||||
|
|
||||||
@@ -523,12 +523,12 @@ RK_S32 hevc_parser_test(ParserDemoCmdContext_t *cmd)
|
|||||||
mpp_err("hal_h265d_deinit in");
|
mpp_err("hal_h265d_deinit in");
|
||||||
hal_h265d_deinit(hal);
|
hal_h265d_deinit(hal);
|
||||||
}
|
}
|
||||||
if (slots != NULL){
|
if (slots != NULL) {
|
||||||
mpp_err("frame slots deInit");
|
mpp_err("frame slots deInit");
|
||||||
mpp_buf_slot_deinit(slots);
|
mpp_buf_slot_deinit(slots);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (packet_slots != NULL){
|
if (packet_slots != NULL) {
|
||||||
mpp_err("packet slots deInit");
|
mpp_err("packet slots deInit");
|
||||||
mpp_buf_slot_deinit(packet_slots);
|
mpp_buf_slot_deinit(packet_slots);
|
||||||
}
|
}
|
||||||
@@ -549,9 +549,9 @@ RK_S32 hevc_parser_test(ParserDemoCmdContext_t *cmd)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
if(fp){
|
if (fp) {
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
mpp_free(buf);
|
mpp_free(buf);
|
||||||
mpp_free(mpp_codex_ctx);
|
mpp_free(mpp_codex_ctx);
|
||||||
|
@@ -332,7 +332,7 @@ void *mpp_dec_hal_thread(void *data)
|
|||||||
mpp_buf_slot_clr_flag(frame_slots, index, SLOT_HAL_INPUT);
|
mpp_buf_slot_clr_flag(frame_slots, index, SLOT_HAL_INPUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (task_dec->eos) {
|
if (task_dec->flags.eos) {
|
||||||
mpp_dec_flush(dec);
|
mpp_dec_flush(dec);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -380,7 +380,7 @@ MPP_RET mpp_dec_init(MppDec **dec, MppCodingType coding)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
mpp_buf_slot_setup(packet_slots,2, SZ_512K, 0);
|
mpp_buf_slot_setup(packet_slots, 2, SZ_512K, 0);
|
||||||
|
|
||||||
ParserCfg parser_cfg = {
|
ParserCfg parser_cfg = {
|
||||||
coding,
|
coding,
|
||||||
|
@@ -196,8 +196,7 @@ MPP_RET hal_task_info_init(HalTaskInfo *task, MppCtxType type)
|
|||||||
if (MPP_CTX_DEC == type) {
|
if (MPP_CTX_DEC == type) {
|
||||||
HalDecTask *p = &task->dec;
|
HalDecTask *p = &task->dec;
|
||||||
p->valid = 0;
|
p->valid = 0;
|
||||||
p->eos = 0;
|
p->flags.val = 0;
|
||||||
p->info_change = 0;
|
|
||||||
p->input_packet = NULL;
|
p->input_packet = NULL;
|
||||||
p->output = -1;
|
p->output = -1;
|
||||||
p->input = -1;
|
p->input = -1;
|
||||||
|
@@ -73,11 +73,19 @@ typedef struct MppSyntax_t {
|
|||||||
* | | |
|
* | | |
|
||||||
* +----------------------+ +----v----+
|
* +----------------------+ +----v----+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
typedef union HalDecTaskFlag_t {
|
||||||
|
RK_U32 val;
|
||||||
|
struct {
|
||||||
|
RK_U32 eos : 1;
|
||||||
|
RK_U32 info_change : 1;
|
||||||
|
};
|
||||||
|
} HalDecTaskFlag;
|
||||||
|
|
||||||
typedef struct HalDecTask_t {
|
typedef struct HalDecTask_t {
|
||||||
// set by parser to signal that it is valid
|
// set by parser to signal that it is valid
|
||||||
RK_U32 valid;
|
RK_U32 valid;
|
||||||
RK_U32 eos;
|
HalDecTaskFlag flags;
|
||||||
RK_U32 info_change;
|
|
||||||
|
|
||||||
// current tesk protocol syntax information
|
// current tesk protocol syntax information
|
||||||
MppSyntax syntax;
|
MppSyntax syntax;
|
||||||
|
@@ -54,8 +54,8 @@ MPP_RET hal_h264d_init(void *hal, MppHalCfg *cfg)
|
|||||||
|
|
||||||
p_api = &p_hal->hal_api;
|
p_api = &p_hal->hal_api;
|
||||||
//!< choose hard mode
|
//!< choose hard mode
|
||||||
switch (cfg->hard_mode) {
|
switch (cfg->device_id) {
|
||||||
case HAL_HARD_RKVDEC:
|
case HAL_RKVDEC:
|
||||||
p_api->init = rkv_h264d_init;
|
p_api->init = rkv_h264d_init;
|
||||||
p_api->deinit = rkv_h264d_deinit;
|
p_api->deinit = rkv_h264d_deinit;
|
||||||
p_api->reg_gen = rkv_h264d_gen_regs;
|
p_api->reg_gen = rkv_h264d_gen_regs;
|
||||||
@@ -65,7 +65,7 @@ MPP_RET hal_h264d_init(void *hal, MppHalCfg *cfg)
|
|||||||
p_api->flush = rkv_h264d_flush;
|
p_api->flush = rkv_h264d_flush;
|
||||||
p_api->control = rkv_h264d_control;
|
p_api->control = rkv_h264d_control;
|
||||||
break;
|
break;
|
||||||
case HAL_HARD_VDPU:
|
case HAL_VDPU:
|
||||||
p_api->init = vdpu_h264d_init;
|
p_api->init = vdpu_h264d_init;
|
||||||
p_api->deinit = vdpu_h264d_deinit;
|
p_api->deinit = vdpu_h264d_deinit;
|
||||||
p_api->reg_gen = vdpu_h264d_gen_regs;
|
p_api->reg_gen = vdpu_h264d_gen_regs;
|
||||||
@@ -74,12 +74,6 @@ MPP_RET hal_h264d_init(void *hal, MppHalCfg *cfg)
|
|||||||
p_api->reset = vdpu_h264d_reset;
|
p_api->reset = vdpu_h264d_reset;
|
||||||
p_api->flush = vdpu_h264d_flush;
|
p_api->flush = vdpu_h264d_flush;
|
||||||
p_api->control = vdpu_h264d_control;
|
p_api->control = vdpu_h264d_control;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -201,13 +201,13 @@ RK_S32 VpuApi::control(VpuCodecContext *ctx, VPU_API_CMD cmd, void *param)
|
|||||||
MpiCmd mpicmd;
|
MpiCmd mpicmd;
|
||||||
(void)ctx;
|
(void)ctx;
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case VPU_API_SET_VPUMEM_CONTEXT: {
|
case VPU_API_SET_VPUMEM_CONTEXT: {
|
||||||
mpicmd = MPP_DEC_SET_EXT_BUF_GROUP;
|
mpicmd = MPP_DEC_SET_EXT_BUF_GROUP;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mpi->control(mpp_ctx, (MpiCmd)mpicmd, (MppParam)param);
|
return mpi->control(mpp_ctx, (MpiCmd)mpicmd, (MppParam)param);
|
||||||
mpp_log_f("ok\n");
|
mpp_log_f("ok\n");
|
||||||
|
@@ -94,7 +94,7 @@ static MPP_RET decoder_init(MppDec *pApi)
|
|||||||
hal_cfg.type = MPP_CTX_DEC;
|
hal_cfg.type = MPP_CTX_DEC;
|
||||||
hal_cfg.coding = pApi->coding;
|
hal_cfg.coding = pApi->coding;
|
||||||
hal_cfg.work_mode = HAL_MODE_LIBVPU;
|
hal_cfg.work_mode = HAL_MODE_LIBVPU;
|
||||||
hal_cfg.hard_mode = HAL_HARD_RKVDEC;
|
hal_cfg.device_id = HAL_RKVDEC;
|
||||||
hal_cfg.frame_slots = pApi->frame_slots;
|
hal_cfg.frame_slots = pApi->frame_slots;
|
||||||
hal_cfg.packet_slots = pApi->packet_slots;
|
hal_cfg.packet_slots = pApi->packet_slots;
|
||||||
hal_cfg.task_count = parser_cfg.task_count;
|
hal_cfg.task_count = parser_cfg.task_count;
|
||||||
|
Reference in New Issue
Block a user