[astyle]: format coding style

git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@539 6e48237b-75ef-9749-8fc9-41990f28c85a
This commit is contained in:
ChenHengming
2016-01-20 09:45:56 +00:00
parent 9f274ee171
commit 4bf0d086a3
34 changed files with 1670 additions and 1677 deletions

View File

@@ -398,7 +398,7 @@ static void get_pkt_timestamp(H264dCurStream_t *p_strm, H264dInputCtx_t *p_Inp,
{
H264dTimeStamp_t *p_last = NULL, *p_curr = NULL;
if (!p_Inp->in_length){
if (!p_Inp->in_length) {
p_last = &p_strm->pkt_ts[p_strm->pkt_ts_idx];
p_strm->pkt_ts_idx = (p_strm->pkt_ts_idx + 1) % MAX_PTS_NUM ;
p_curr = &p_strm->pkt_ts[p_strm->pkt_ts_idx];
@@ -537,7 +537,7 @@ MPP_RET h264d_reset(void *decoder)
p_strm->pkt_ts_idx = 0;
p_strm->pkt_used_bytes = 0;
p_strm->startcode_found = p_Dec->p_Inp->is_nalff;
memset(p_strm->pkt_ts, 0, MAX_PTS_NUM*sizeof(H264dTimeStamp_t));
memset(p_strm->pkt_ts, 0, MAX_PTS_NUM * sizeof(H264dTimeStamp_t));
//!< reset decoder parameter
p_Dec->next_state = SliceSTATE_ResetSlice;
p_Dec->nalu_ret = NALU_NULL;
@@ -553,8 +553,8 @@ MPP_RET h264d_reset(void *decoder)
//!< reset dpb
FUN_CHECK(ret = flush_dpb(p_Dec->p_Vid->p_Dpb_layer[0], 1));
FUN_CHECK(ret = init_dpb(p_Dec->p_Vid, p_Dec->p_Vid->p_Dpb_layer[0], 1));
if (p_Dec->mvc_valid)
{ // layer_id == 1
if (p_Dec->mvc_valid) {
// layer_id == 1
FUN_CHECK(ret = flush_dpb(p_Dec->p_Vid->p_Dpb_layer[1], 1));
FUN_CHECK(ret = init_dpb(p_Dec->p_Vid, p_Dec->p_Vid->p_Dpb_layer[1], 2));
}
@@ -590,8 +590,8 @@ MPP_RET h264d_flush(void *decoder)
FUN_CHECK(ret = flush_dpb(p_Dec->p_Vid->p_Dpb_layer[0], 1));
FUN_CHECK(ret = init_dpb(p_Dec->p_Vid, p_Dec->p_Vid->p_Dpb_layer[0], 1));
//free_dpb(p_Dec->p_Vid->p_Dpb_layer[0]);
if (p_Dec->mvc_valid)
{ // layer_id == 1
if (p_Dec->mvc_valid) {
// layer_id == 1
FUN_CHECK(ret = flush_dpb(p_Dec->p_Vid->p_Dpb_layer[1], 2));
FUN_CHECK(ret = init_dpb(p_Dec->p_Vid, p_Dec->p_Vid->p_Dpb_layer[1], 2));
@@ -681,7 +681,7 @@ MPP_RET h264d_prepare(void *decoder, MppPacket pkt, HalDecTask *task)
if (mpp_packet_get_flag(pkt)& MPP_PACKET_FLAG_EXTRA_DATA) {
RK_U8 *pdata = p_Dec->p_Inp->in_buf;
p_Dec->p_Inp->is_nalff = (p_Dec->p_Inp->in_length > 3)&& (pdata[0] && pdata[1]);
p_Dec->p_Inp->is_nalff = (p_Dec->p_Inp->in_length > 3) && (pdata[0] && pdata[1]);
if (p_Dec->p_Inp->is_nalff) {
(ret = parse_prepare_extra_header(p_Dec->p_Inp, p_Dec->p_Cur));
@@ -702,13 +702,13 @@ MPP_RET h264d_prepare(void *decoder, MppPacket pkt, HalDecTask *task)
(ret = parse_prepare_extra_data(p_Dec->p_Inp, p_Dec->p_Cur));
task->valid = p_Dec->p_Inp->task_valid; //!< prepare valid flag
} else {
do{
do {
(ret = parse_prepare_fast(p_Dec->p_Inp, p_Dec->p_Cur));
task->valid = p_Dec->p_Inp->task_valid; //!< prepare valid flag
//LogTrace(logctx, "[Prepare_Ing] length=%d, valid=%d,strm_off=%d, g_framecnt=%d", mpp_packet_get_length(pkt), task->valid, p_Dec->dxva_ctx->strm_offset, p_Dec->p_Vid->g_framecnt);
//FPRINT(g_debug_file0, "[Prepare_Ing] length=%d, valid=%d,strm_off=%d, g_framecnt=%d \n", mpp_packet_get_length(pkt), task->valid, p_Dec->dxva_ctx->strm_offset, p_Dec->p_Vid->g_framecnt);
}while(mpp_packet_get_length(pkt) && !task->valid);
} while (mpp_packet_get_length(pkt) && !task->valid);
}
//LogTrace(logctx, "Prepare Out: len=%d, valid=%d ", mpp_packet_get_length(pkt), task->valid);
@@ -794,7 +794,7 @@ MPP_RET h264d_callback(void *decoder, void *err_info)
ctx->err_flag |= VPU_FRAME_ERR_UNSUPPORT;
if(ctx->err_flag & VPU_FRAME_ERR_UNSUPPORT) {
if (ctx->err_flag & VPU_FRAME_ERR_UNSUPPORT) {
h264d_reset(decoder);
}

View File

@@ -896,8 +896,7 @@ static void muti_view_output(MppBufSlots frame_slots, H264_DpbMark_t *p_mark, H2
p_out[1]->list[p_out[1]->begin] = NULL;
p_out[0]->begin = (p_out[0]->begin + 1) % p_out[0]->max_size;
p_out[1]->begin = (p_out[1]->begin + 1) % p_out[1]->max_size;
}
else if (mpp_frame_get_poc(frame0) > mpp_frame_get_poc(frame1)) {
} else if (mpp_frame_get_poc(frame0) > mpp_frame_get_poc(frame1)) {
H264D_LOG("[Write_picture] p_mark0->poc > p_mark1->poc \n");
mpp_buf_slot_enqueue(frame_slots, p_mark1->slot_idx, QUEUE_DISPLAY);
p_mark1->out_flag = 0;
@@ -905,8 +904,7 @@ static void muti_view_output(MppBufSlots frame_slots, H264_DpbMark_t *p_mark, H2
p_out[1]->list[p_out[1]->begin] = NULL;
p_out[1]->begin = (p_out[1]->begin + 1) % p_out[1]->max_size;
mpp_frame_set_discard(frame1, 1);
}
else { //!< mpp_frame_get_poc(frame0) < mpp_frame_get_poc(frame1)
} else { //!< mpp_frame_get_poc(frame0) < mpp_frame_get_poc(frame1)
H264D_LOG("[Write_picture] p_mark0->poc < p_mark1->poc \n");
mpp_buf_slot_enqueue(frame_slots, p_mark0->slot_idx, QUEUE_DISPLAY);
p_mark0->out_flag = 0;
@@ -969,8 +967,7 @@ static void write_picture(H264_StorePic_t *p, H264dVideoCtx_t *p_Vid)
if (p_Vid->p_Dec->mvc_valid) {
muti_view_output(p_Vid->p_Dec->frame_slots, p_mark, p_Vid);
} else
{
} else {
mpp_buf_slot_enqueue(p_Vid->p_Dec->frame_slots, p_mark->slot_idx, QUEUE_DISPLAY);
p_Vid->p_Dec->last_frame_slot_idx = p_mark->slot_idx;
p_mark->out_flag = 0;
@@ -1402,7 +1399,7 @@ __FAILED:
//extern "C"
void flush_muti_view_output(MppBufSlots frame_slots, H264dOutList_t *p_list, H264dVideoCtx_t *p_Vid)
{
RK_U32 i= 0;
RK_U32 i = 0;
MppFrame frame;
H264_DpbMark_t *p_mark = NULL;
H264dOutList_t *p_out = NULL;
@@ -1758,7 +1755,7 @@ MPP_RET init_dpb(H264dVideoCtx_t *p_Vid, H264_DpbBuf_t *p_Dpb, RK_S32 type) //
MPP_RET ret = MPP_ERR_UNKNOW;
H264_SPS_t *active_sps = p_Vid->active_sps;
if(!active_sps){
if (!active_sps) {
ret = MPP_NOK;
goto __FAILED;
}
@@ -1957,7 +1954,7 @@ static MPP_RET adjust_input(H264_SLICE_t *currSlice)
find_flag = 0;
if (old_dpb[i].picbuf) {
for (j = 0; j < MAX_DPB_SIZE; j++) {
if(new_dpb[j].picbuf) {
if (new_dpb[j].picbuf) {
find_flag = (old_dpb[i].frame_num == new_dpb[j].frame_num) ? 1 : 0;
find_flag = (old_dpb[i].slot_index == new_dpb[j].slot_index) ? find_flag : 0;
if (new_dpb[j].is_used & 0x1) {
@@ -1991,7 +1988,7 @@ static MPP_RET adjust_input(H264_SLICE_t *currSlice)
}
}
//memcpy(new_dpb, old_dpb, MAX_DPB_SIZE*sizeof(H264_DpbInfo_t));
memset(new_dpb, 0, MAX_DPB_SIZE*sizeof(H264_DpbInfo_t));
memset(new_dpb, 0, MAX_DPB_SIZE * sizeof(H264_DpbInfo_t));
for (i = 0, j = 0; i < MAX_DPB_SIZE; i++) {
if (old_dpb[i].picbuf) {
new_dpb[j] = old_dpb[i];
@@ -2004,7 +2001,7 @@ static MPP_RET adjust_input(H264_SLICE_t *currSlice)
for (; j < 16; j++) {
reset_dpb_info(&new_dpb[j]);
}
memcpy(old_dpb, new_dpb, MAX_DPB_SIZE*sizeof(H264_DpbInfo_t));
memcpy(old_dpb, new_dpb, MAX_DPB_SIZE * sizeof(H264_DpbInfo_t));
return MPP_OK;
}

View File

@@ -856,12 +856,12 @@ typedef struct h264d_input_ctx_t {
//!< TimeStamp context
#define MAX_PTS_NUM 5
typedef struct h264d_timestamp_t{
typedef struct h264d_timestamp_t {
RK_U64 begin_off;
RK_U64 end_off;
RK_S64 pts;
RK_S64 dts;
}H264dTimeStamp_t;
} H264dTimeStamp_t;
//!< current stream
typedef struct h264d_curstrm_t {
@@ -917,7 +917,7 @@ typedef struct h264d_outlist_t {
RK_U32 end;
RK_U32 max_size;
H264_DpbMark_t *list[MAX_MARK_SIZE];
}H264dOutList_t;
} H264dOutList_t;
//!< parameters for video decoder
typedef struct h264d_video_ctx_t {
@@ -1051,7 +1051,7 @@ typedef struct h264_err_ctx_t {
RK_U32 err_flag;
void *data;
RK_U32 length;
}H264dErrCtx_t;
} H264dErrCtx_t;
//!< decoder video parameter

View File

@@ -396,8 +396,7 @@ static void dpb_mark_malloc(H264dVideoCtx_t *p_Vid, RK_S32 structure, RK_U8 comb
cur_mark = &p_mark[idx];
cur_mark->out_flag = 1;
if(p_Vid->g_framecnt == 255)
{
if (p_Vid->g_framecnt == 255) {
idx = idx;
}
//LogInfo(p_Vid->p_Dec->logctx.parr[RUN_PARSE], "[MALLOC] g_frame_no=%d, mark_idx=%d, slot_idx=%d \n", p_Vid->g_framecnt, cur_mark->mark_idx, cur_mark->slot_idx);
@@ -408,7 +407,7 @@ static void dpb_mark_malloc(H264dVideoCtx_t *p_Vid, RK_S32 structure, RK_U8 comb
//FPRINT(g_debug_file1, "[MALLOC] g_frame_no=%d, mark_idx=%d, slot_idx=%d \n", p_Vid->g_framecnt, cur_mark->mark_idx, cur_mark->slot_idx);
if((YUV420 == p_Vid->yuv_format) && (8 == p_Vid->bit_depth_luma)) {
if ((YUV420 == p_Vid->yuv_format) && (8 == p_Vid->bit_depth_luma)) {
mpp_frame_set_fmt(cur_mark->frame, MPP_FMT_YUV420SP);
} else if ((YUV420 == p_Vid->yuv_format) && (10 == p_Vid->bit_depth_luma)) {
mpp_frame_set_fmt(cur_mark->frame, MPP_FMT_YUV420SP_10BIT);
@@ -419,7 +418,7 @@ static void dpb_mark_malloc(H264dVideoCtx_t *p_Vid, RK_S32 structure, RK_U8 comb
mpp_frame_set_fmt(cur_mark->frame, MPP_FMT_YUV422SP_10BIT);
}
hor_stride = ((p_Vid->width * p_Vid->bit_depth_luma + 127) & (~127))/8;
hor_stride = ((p_Vid->width * p_Vid->bit_depth_luma + 127) & (~127)) / 8;
ver_stride = p_Vid->height;
hor_stride = MPP_ALIGN(hor_stride, 256) | 256;
ver_stride = MPP_ALIGN(ver_stride, 16);

View File

@@ -503,7 +503,7 @@ MPP_RET parse_prepare(H264dInputCtx_t *p_Inp, H264dCurCtx_t *p_Cur)
}
p_strm->nalu_buf[p_strm->nalu_len++] = *p_strm->curdata;
if (p_strm->nalu_len == 1) {
p_strm->nalu_type = p_strm->nalu_buf[0]&0x1F;
p_strm->nalu_type = p_strm->nalu_buf[0] & 0x1F;
nalu_header_bytes += 1;
if ((p_strm->nalu_type == NALU_TYPE_PREFIX)
|| (p_strm->nalu_type == NALU_TYPE_SLC_EXT)) {
@@ -595,7 +595,7 @@ MPP_RET parse_prepare_fast(H264dInputCtx_t *p_Inp, H264dCurCtx_t *p_Cur)
}
p_strm->nalu_buf[p_strm->nalu_len++] = *p_strm->curdata;
if (p_strm->nalu_len == 1) {
p_strm->nalu_type = p_strm->nalu_buf[0]&0x1F;
p_strm->nalu_type = p_strm->nalu_buf[0] & 0x1F;
//nalu_header_bytes += 1;
//if ((p_strm->nalu_type == NALU_TYPE_PREFIX)
// || (p_strm->nalu_type == NALU_TYPE_SLC_EXT)) {
@@ -679,7 +679,7 @@ MPP_RET parse_prepare_extra_header(H264dInputCtx_t *p_Inp, H264dCurCtx_t *p_Cur)
H264D_ERR("avcC too short, len=%d \n", p_Inp->in_length);
goto __FAILED;
}
if(pdata[0] != 1){
if (pdata[0] != 1) {
goto __FAILED;
}
p_Inp->profile = pdata[1];
@@ -689,7 +689,7 @@ MPP_RET parse_prepare_extra_header(H264dInputCtx_t *p_Inp, H264dCurCtx_t *p_Cur)
pdata += 6;
extrasize -= 6;
for (i=0; i < p_Inp->sps_num; ++i) {
for (i = 0; i < p_Inp->sps_num; ++i) {
p_strm->nalu_len = U16_AT(pdata);
pdata += 2;
extrasize -= 2;
@@ -759,7 +759,7 @@ MPP_RET parse_prepare_extra_data(H264dInputCtx_t *p_Inp, H264dCurCtx_t *p_Cur)
H264D_LOG("[extra_data] before: p_Inp_length=%d \n", p_Inp->in_length);
p_strm->curdata = &p_Inp->in_buf[p_strm->nalu_offset];
while(p_Inp->in_length > 0) {
while (p_Inp->in_length > 0) {
if (p_strm->startcode_found) {
//RK_U8 *pdata = NULL;
RK_U32 nalu_header_bytes = 0;
@@ -786,8 +786,8 @@ MPP_RET parse_prepare_extra_data(H264dInputCtx_t *p_Inp, H264dCurCtx_t *p_Cur)
p_Inp->in_length -= p_Inp->nal_size;
p_strm->nalu_buf = p_strm->curdata;
p_strm->nalu_type = p_strm->nalu_buf[0]&0x1F;
nalu_header_bytes = ((p_strm->nalu_type == NALU_TYPE_PREFIX) || (p_strm->nalu_type == NALU_TYPE_SLC_EXT)) ? 4 :1;
p_strm->nalu_type = p_strm->nalu_buf[0] & 0x1F;
nalu_header_bytes = ((p_strm->nalu_type == NALU_TYPE_PREFIX) || (p_strm->nalu_type == NALU_TYPE_SLC_EXT)) ? 4 : 1;
//mpp_log("[extra_data] after: nalu_type=%d, nalu_len=%d, in_len=%d \n", p_strm->nalu_type, p_strm->nalu_len, mpp_packet_get_length(p_Inp->in_pkt));
//pdata = p_strm->nalu_buf;
//mpp_log("[extra_data] [NALU_DATA] nalu_len=%d, max_len=%d, %02x, %02x, %02x, %02x, %02x, %02x \n", p_strm->nalu_len,p_strm->nalu_max_size,

View File

@@ -31,7 +31,7 @@
#include <ctype.h>
char *_strupr(char *str)
{
char *orign=str;
char *orign = str;
for (; *str != '\0'; str++) {
*str = toupper(*str);
}
@@ -67,7 +67,7 @@ static void interpret_user_data_registered_itu_t_t35_info()
static MPP_RET interpret_user_data_unregistered_info(RK_U8 *payload, RK_S32 size, H264_SEI_t *sei_msg)
{
MPP_RET ret = MPP_ERR_UNKNOW;
H264D_LOG("size=%d",size);
H264D_LOG("size=%d", size);
ASSERT(size >= 16);
#if 0
{
@@ -76,7 +76,7 @@ static MPP_RET interpret_user_data_unregistered_info(RK_U8 *payload, RK_S32 size
mpp_log("User data unregistered SEI message\n");
mpp_log("uuid_iso_11578 = 0x");
for (offset = 0; offset < 16; offset++) {
mpp_log("%02x",payload[offset]);
mpp_log("%02x", payload[offset]);
}
while (offset < size) {
payload_byte = payload[offset];

View File

@@ -716,7 +716,7 @@ static RK_S32 hls_slice_header(HEVCContext *s)
if (s->nal_unit_type >= 16 && s->nal_unit_type <= 23)
READ_ONEBIT(gb, &sh->no_output_of_prior_pics_flag);
if(IS_IRAP(s) && s->miss_ref_flag && sh->first_slice_in_pic_flag){
if (IS_IRAP(s) && s->miss_ref_flag && sh->first_slice_in_pic_flag) {
// mpp_err("s->nal_unit_type = %d s->poc %d",s->nal_unit_type,s->poc);
s->max_ra = INT_MAX;
s->miss_ref_flag = 0;
@@ -1134,8 +1134,8 @@ static RK_S32 hevc_frame_start(HEVCContext *s)
s->miss_ref_flag = 0;
ret = mpp_hevc_frame_rps(s);
if(s->miss_ref_flag && !IS_IRAP(s)){
mpp_frame_set_errinfo(s->frame,VPU_FRAME_ERR_UNKNOW);
if (s->miss_ref_flag && !IS_IRAP(s)) {
mpp_frame_set_errinfo(s->frame, VPU_FRAME_ERR_UNKNOW);
s->ref->error_flag = 1;
}
@@ -1485,18 +1485,18 @@ static RK_S32 split_nal_units(HEVCContext *s, RK_U8 *buf, RK_U32 length)
continue;
}
if (buf[0] != 0 || buf[1] != 0 || buf[2] != 1) {
RK_U32 state = (RK_U32)-1;
RK_U32 state = (RK_U32) - 1;
int has_nal = 0;
for (i = 0; i < (RK_S32)length; i++) {
state = (state << 8) | buf[i];
if (((state >> 8) & 0xFFFFFF) == START_CODE){
if (((state >> 8) & 0xFFFFFF) == START_CODE) {
has_nal = 1;
i = i -3;
i = i - 3;
break;
}
}
if(has_nal){
if (has_nal) {
length -= i;
buf += i;
continue;
@@ -1717,7 +1717,7 @@ MPP_RET h265d_prepare(void *ctx, MppPacket pkt, HalDecTask *task)
pos = buf + length;
s->pts = pts;
mpp_packet_set_pos(pkt, pos);
if(s->eos){
if (s->eos) {
task->valid = 0;
task->flags.eos = 1;
@@ -1974,11 +1974,11 @@ MPP_RET h265d_flush(void *ctx)
ret = mpp_hevc_output_frame(ctx, 1);
} while (ret);
frame = &s->DPB[s->output_frame_idx];
if(frame->slot_index < 0xff){
if (frame->slot_index < 0xff) {
mpp_buf_slot_set_prop(s->slots, frame->slot_index, SLOT_EOS, &eos);
}else{
if(s->notify_cb.callBack != NULL){
s->notify_cb.callBack(s->notify_cb.opaque,NULL);
} else {
if (s->notify_cb.callBack != NULL) {
s->notify_cb.callBack(s->notify_cb.opaque, NULL);
}
}
@@ -2014,11 +2014,11 @@ MPP_RET h265d_callback(void *ctx, void *err_info)
RK_U32 i = 0;
s->max_ra = INT_MAX;
// s->miss_ref_flag = 1;
mpp_buf_slot_get_prop(s->slots, s->ref->slot_index,SLOT_FRAME,&s->ref->frame);
mpp_frame_set_errinfo(s->ref->frame,VPU_FRAME_ERR_UNKNOW);
mpp_buf_slot_get_prop(s->slots, s->ref->slot_index, SLOT_FRAME, &s->ref->frame);
mpp_frame_set_errinfo(s->ref->frame, VPU_FRAME_ERR_UNKNOW);
mpp_buf_slot_set_prop(s->slots, s->ref->slot_index, SLOT_FRAME, s->ref->frame);
for (i = 0; i < MPP_ARRAY_ELEMS(s->DPB); i++) {
if(s->DPB[i].slot_index == s->ref->slot_index){
if (s->DPB[i].slot_index == s->ref->slot_index) {
s->DPB[i].error_flag = 1;
}

View File

@@ -172,8 +172,7 @@ static void fill_picture_parameters(const HEVCContext *h,
}
// mpp_err("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;
while (!frame && j < MPP_ARRAY_ELEMS(h->DPB)) {
if (&h->DPB[j] != current_picture &&

View File

@@ -96,7 +96,7 @@ static HEVCFrame *alloc_frame(HEVCContext *s)
mpp_frame_set_hor_stride(frame->frame, (s->h265dctx->coded_width * s->h265dctx->nBitDepth) >> 3);
mpp_frame_set_ver_stride(frame->frame, s->h265dctx->coded_height);
mpp_frame_set_fmt(frame->frame, s->h265dctx->pix_fmt);
mpp_frame_set_errinfo(frame->frame,0);
mpp_frame_set_errinfo(frame->frame, 0);
h265d_dbg(H265D_DBG_GLOBAL, "w_stride %d h_stride %d\n", s->h265dctx->coded_width, s->h265dctx->coded_height);
@@ -349,7 +349,7 @@ static int add_candidate_ref(HEVCContext *s, RefPicList *list,
mpp_buf_slot_set_flag(s->slots, ref->slot_index, SLOT_CODEC_USE);
}
mark_ref(ref, ref_flag);
if(ref->error_flag){
if (ref->error_flag) {
s->miss_ref_flag = 1;
}
return 0;

View File

@@ -555,7 +555,7 @@ void *mpp_dec_parser_thread(void *data)
}
parser->lock();
if(MPP_THREAD_RUNNING == parser->get_status()){
if (MPP_THREAD_RUNNING == parser->get_status()) {
if (check_task_wait(dec, &task))
parser->wait();
}
@@ -606,7 +606,7 @@ void *mpp_dec_hal_thread(void *data)
* hal thread wait for dxva interface intput firt
*/
hal->lock();
if(MPP_THREAD_RUNNING == hal->get_status()){
if (MPP_THREAD_RUNNING == hal->get_status()) {
if (hal_task_get_hnd(tasks, TASK_PROCESSING, &task))
hal->wait();
}

View File

@@ -398,10 +398,10 @@ void rkv_generate_regs(void *hal, HalTaskInfo *task, FifoCtx_t *pkt)
} else if (pp->chroma_format_idc == 2) { //!< Y422
yuv_virstride += 2 * y_virstride;
}
p_regs->swreg3_picpar.sw_y_hor_virstride = hor_virstride/16;
p_regs->swreg3_picpar.sw_uv_hor_virstride = hor_virstride/16;
p_regs->swreg8_y_virstride.sw_y_virstride = y_virstride/16;
p_regs->swreg9_yuv_virstride.sw_yuv_virstride = yuv_virstride/16;
p_regs->swreg3_picpar.sw_y_hor_virstride = hor_virstride / 16;
p_regs->swreg3_picpar.sw_uv_hor_virstride = hor_virstride / 16;
p_regs->swreg8_y_virstride.sw_y_virstride = y_virstride / 16;
p_regs->swreg9_yuv_virstride.sw_yuv_virstride = yuv_virstride / 16;
//mpp_log("$$$$$$$$ hor_stride=%d, y_stride=%d, yuv_stride=%d \n", p_regs->swreg3_picpar.sw_y_hor_virstride,
// p_regs->swreg8_y_virstride.sw_y_virstride, p_regs->swreg9_yuv_virstride.sw_yuv_virstride);
}

View File

@@ -302,17 +302,17 @@ MPP_RET rkv_h264d_gen_regs(void *hal, HalTaskInfo *task)
for (i = 0; i < 256; i++) {
mpp_buffer_write(p_hal->cabac_buf, (strm_offset + 32 * i), (void *)pkts->spspps.pbuf, RKV_SPSPPS_SIZE);
}
p_regs->swreg42_pps_base.sw_pps_base = hw_base + (strm_offset<<10);
p_regs->swreg42_pps_base.sw_pps_base = hw_base + (strm_offset << 10);
strm_offset += RKV_SPSPPS_SIZE;
mpp_buffer_write(p_hal->cabac_buf, strm_offset, (void *)pkts->rps.pbuf, RKV_RPS_SIZE);
p_regs->swreg43_rps_base.sw_rps_base = hw_base + (strm_offset<<10);
p_regs->swreg43_rps_base.sw_rps_base = hw_base + (strm_offset << 10);
strm_offset += RKV_RPS_SIZE;
mpp_buffer_write(p_hal->cabac_buf, strm_offset, (void *)pkts->scanlist.pbuf, RKV_SCALING_LIST_SIZE);
strm_offset += RKV_SCALING_LIST_SIZE;
p_regs->swreg75_h264_errorinfo_base.sw_errorinfo_base = hw_base + (strm_offset<<10);
p_regs->swreg75_h264_errorinfo_base.sw_errorinfo_base = hw_base + (strm_offset << 10);
((HalDecTask*)&task->dec)->valid = 0;

View File

@@ -1109,7 +1109,7 @@ MPP_RET vdpu_set_vlc_regs(void *hal, HalRegDrvCtx_t *p_drv)
pocBase = (RK_U32 *) ((RK_U8 *)mpp_buffer_get_ptr(p_hal->cabac_buf) + VDPU_CABAC_TAB_SIZE);
for(i = 0; i < 16; i++) {
for (i = 0; i < 16; i++) {
RK_S32 dpb_idx = 0, longTermTmp = 0;
if (p_hal->pp->RefFrameList[i / 2].bPicEntry != 0xff) {
FPRINT(g_debug_file1, "i=%2d, picnum=%d, framenum=%2d,", i, p_hal->pp->FrameNumList[i], p_hal->pp->FrameNumList[i]);
@@ -1117,7 +1117,7 @@ MPP_RET vdpu_set_vlc_regs(void *hal, HalRegDrvCtx_t *p_drv)
dpb_idx = p_hal->pp->RefFrameList[i / 2].Index7Bits;
FPRINT(g_debug_file1, " dbp_idx=%d, longterm=%d, poc=%d \n", dpb_idx, longTermTmp, *pocBase);
}
pocBase +=2;
pocBase += 2;
}
hal_get_regdrv((HalRegDrvCtx_t *)p_hal->regs, VDPU_REFER_VALID_E, &validFlags);
FPRINT(g_debug_file1, " view=%d, nonivref=%d, iv_base=%08x, ref_valid_e=%d, mvc_e=%d, cur_poc=%d \n", 0, 0, 0x0, validFlags, 0, *pocBase);
@@ -1230,7 +1230,7 @@ MPP_RET vdpu_set_asic_regs(void *hal, HalRegDrvCtx_t *p_drv)
if (pp->RefFrameList[i].bPicEntry != 0xff) {
mpp_buf_slot_get_prop(p_hal->frame_slots, pp->RefFrameList[i].Index7Bits, SLOT_BUFFER, &frame_buf); //!< reference phy addr
j = i;
} else/* if(j == 0xff)*/ {
} else { /* if(j == 0xff)*/
mpp_buf_slot_get_prop(p_hal->frame_slots, pp->CurrPic.Index7Bits, SLOT_BUFFER, &frame_buf); //!< current out phy addr
}
//else {
@@ -1294,8 +1294,8 @@ MPP_RET vdpu_set_asic_regs(void *hal, HalRegDrvCtx_t *p_drv)
RK_U32 *ptr = NULL;
ptr = (RK_U32 *)((RK_U8 *)mpp_buffer_get_ptr(p_hal->cabac_buf) + VDPU_CABAC_TAB_SIZE + VDPU_POC_BUF_SIZE);
for(i = 0; i < 6; i++) {
for(j = 0; j < 4; j++) {
for (i = 0; i < 6; i++) {
for (j = 0; j < 4; j++) {
temp = (p_hal->qm->bScalingLists4x4[i][4 * j + 0] << 24) |
(p_hal->qm->bScalingLists4x4[i][4 * j + 1] << 16) |
(p_hal->qm->bScalingLists4x4[i][4 * j + 2] << 8) |
@@ -1303,8 +1303,8 @@ MPP_RET vdpu_set_asic_regs(void *hal, HalRegDrvCtx_t *p_drv)
*ptr++ = temp;
}
}
for(i = 0; i < 2; i++) {
for(j = 0; j < 16; j++) {
for (i = 0; i < 2; i++) {
for (j = 0; j < 16; j++) {
temp = (p_hal->qm->bScalingLists8x8[i][4 * j + 0] << 24) |
(p_hal->qm->bScalingLists8x8[i][4 * j + 1] << 16) |
(p_hal->qm->bScalingLists8x8[i][4 * j + 2] << 8) |
@@ -1318,15 +1318,15 @@ MPP_RET vdpu_set_asic_regs(void *hal, HalRegDrvCtx_t *p_drv)
{
RK_U8 i = 0, j = 0;
RK_U8 *ptr = (RK_U8 *)mpp_buffer_get_ptr(p_hal->cabac_buf) + VDPU_CABAC_TAB_SIZE + VDPU_POC_BUF_SIZE;
for(i = 0; i < 6; i++) {
for(j = 0; j < 16; j++) {
for (i = 0; i < 6; i++) {
for (j = 0; j < 16; j++) {
FPRINT(g_debug_file1, "[i=%2d][j=%2d]=%d, ", i, j, *ptr);
ptr++;
}
FPRINT(g_debug_file1, "\n");
}
for(i = 6; i < 8; i++) {
for(j = 0; j < 64; j++) {
for (i = 6; i < 8; i++) {
for (j = 0; j < 64; j++) {
FPRINT(g_debug_file1, "[i=%2d][j=%2d]=%d, ", i, j, *ptr);
ptr++;
}

View File

@@ -333,8 +333,7 @@ static MPP_RET vdpu_adjust_input(H264dHalCtx_t *p_hal)
}
}
}
if (p_hal->iDecodedNum == 3)
{
if (p_hal->iDecodedNum == 3) {
i = i;
}
@@ -361,7 +360,7 @@ static MPP_RET vdpu_adjust_input(H264dHalCtx_t *p_hal)
if (old_dpb[i].valid) {
for (j = 0; j < MPP_ARRAY_ELEMS(pp->RefFrameList); j++) {
if(new_dpb[j].valid) {
if (new_dpb[j].valid) {
find_flag = (old_dpb[i].frame_num == new_dpb[j].frame_num) ? 1 : 0;
if (new_dpb[j].top_used) {
find_flag = (old_dpb[i].TOP_POC == new_dpb[j].TOP_POC) ? find_flag : 0;

View File

@@ -1367,8 +1367,8 @@ RK_S32 hal_h265d_output_pps_packet(void *hal, void *dxva)
}
#ifdef ANDROID
for(i = 0; i < 64; i++){
memcpy(pps_ptr+i*80,pps_packet,80);
for (i = 0; i < 64; i++) {
memcpy(pps_ptr + i * 80, pps_packet, 80);
}
#ifdef dump
fwrite(pps_ptr, 1, 80 * 64, fp);
@@ -1501,8 +1501,8 @@ MPP_RET hal_h265d_gen_regs(void *hal, HalTaskInfo *syn)
hw_regs->sw_stream_len = ((dxva_cxt->bitstream_size + 15) & (~15)) + 64;
aglin_offset = hw_regs->sw_stream_len - dxva_cxt->bitstream_size;
if(aglin_offset > 0){
memset((void *)(dxva_cxt->bitstream + dxva_cxt->bitstream_size),0,aglin_offset);
if (aglin_offset > 0) {
memset((void *)(dxva_cxt->bitstream + dxva_cxt->bitstream_size), 0, aglin_offset);
}
hw_regs->sw_interrupt.sw_dec_e = 1;
hw_regs->sw_interrupt.sw_dec_timeout_e = 1;
@@ -1565,7 +1565,7 @@ MPP_RET hal_h265d_start(void *hal, HalTaskInfo *task)
hw_regs = ( H265d_REGS_t *)reg_cxt->hw_regs;
}
if(hw_regs == NULL){
if (hw_regs == NULL) {
mpp_err("hal_h265d_start hw_regs is NULL");
return MPP_ERR_NULL_PTR;
}

View File

@@ -217,7 +217,8 @@ public:
mpp_log("dlopen vpu lib");
}
~VpulibDlsym(){
~VpulibDlsym()
{
dlclose(rkapi_hdl);
mpp_log("dlclose vpu lib");
}
@@ -227,8 +228,7 @@ VpulibDlsym gVpulib;
RK_S32 open_orign_vpu(VpuCodecContext **ctx)
{
if(NULL != gVpulib.rkvpu_open_cxt)
{
if (NULL != gVpulib.rkvpu_open_cxt) {
(gVpulib.rkvpu_open_cxt)(ctx);
}
return MPP_OK;
@@ -236,8 +236,7 @@ RK_S32 open_orign_vpu(VpuCodecContext **ctx)
RK_S32 close_orign_vpu(VpuCodecContext **ctx)
{
if(NULL != gVpulib.rkvpu_close_cxt)
{
if (NULL != gVpulib.rkvpu_close_cxt) {
(gVpulib.rkvpu_close_cxt)(ctx);
}
return MPP_OK;
@@ -252,7 +251,7 @@ RK_S32 vpu_open_context(VpuCodecContext **ctx)
#ifdef ANDROID
value = value || (!!access("/dev/rkvdec", F_OK));
if(s != NULL)
if (s != NULL)
value = (value & (s->videoCoding != OMX_RK_VIDEO_CodingHEVC));
if (value || !s) {
@@ -303,7 +302,7 @@ RK_S32 vpu_open_context(VpuCodecContext **ctx)
return 0;
} else {
#ifdef ANDROID
if(s != NULL){
if (s != NULL) {
free(s);
s = NULL;
}

View File

@@ -130,7 +130,7 @@ RK_S32 VpuApi:: decode_getoutframe(DecoderOut_t *aDecOut)
aDecOut->size = 0;
return 0;
}
if(set_eos){
if (set_eos) {
aDecOut->size = 0;
return VPU_API_EOS_STREAM_REACHED;
}
@@ -195,7 +195,7 @@ RK_S32 VpuApi:: decode_getoutframe(DecoderOut_t *aDecOut)
}
if (mpp_frame_get_eos(mframe)) {
set_eos = 1;
if(buf == NULL){
if (buf == NULL) {
aDecOut->size = 0;
}
}

View File

@@ -192,7 +192,7 @@ RK_S32 VPUMallocLinear(VPUMemLinear_t *p, RK_U32 size)
int ret = 0;
MppBuffer buffer = NULL;
ret = mpp_buffer_get(NULL, &buffer, size);
if(ret != MPP_OK){
if (ret != MPP_OK) {
return -1;
}
p->phy_addr = (RK_U32)mpp_buffer_get_fd(buffer);
@@ -206,11 +206,11 @@ RK_S32 VPUMallocLinearFromRender(VPUMemLinear_t *p, RK_U32 size, void *ctx)
{
VPUMemLinear_t *dma_buf = NULL;
vpu_display_mem_pool_impl *p_mempool = (vpu_display_mem_pool_impl *)ctx;
if(ctx == NULL){
return VPUMallocLinear(p,size);
if (ctx == NULL) {
return VPUMallocLinear(p, size);
}
dma_buf = (VPUMemLinear_t *)p_mempool->get_free((vpu_display_mem_pool *)ctx);
memset(p,0,sizeof(VPUMemLinear_t));
memset(p, 0, sizeof(VPUMemLinear_t));
if (dma_buf != NULL) {
if (dma_buf->size < size) {
mpp_free(dma_buf);