diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-05-04 21:16:35 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-05-04 21:16:35 +0000 |
commit | 6cb07e106ab29653418c8d868c276d32549f353a (patch) | |
tree | 79a42957a583e009065926e36f6ab75a50a02676 | |
parent | a09be998000a01335515eefa8d86206417542775 (diff) | |
parent | 4f95fc0b9cfdebce2adbad847285c69f8247df71 (diff) | |
download | libavc-6cb07e106ab29653418c8d868c276d32549f353a.tar.gz |
Merge "decoder: Remove skip picture support" into qt-dev
-rw-r--r-- | decoder/ih264d_api.c | 113 | ||||
-rw-r--r-- | decoder/ih264d_parse_slice.c | 56 | ||||
-rw-r--r-- | decoder/ih264d_structs.h | 4 |
3 files changed, 2 insertions, 171 deletions
diff --git a/decoder/ih264d_api.c b/decoder/ih264d_api.c index 2682125..c9426a6 100644 --- a/decoder/ih264d_api.c +++ b/decoder/ih264d_api.c @@ -975,9 +975,6 @@ void ih264d_init_decoder(void * ps_dec_params) ps_dec->i4_degrade_type = 0; ps_dec->i4_degrade_pics = 0; - ps_dec->i4_app_skip_mode = IVD_SKIP_NONE; - ps_dec->i4_dec_skip_mode = IVD_SKIP_NONE; - memset(ps_dec->ps_pps, 0, ((sizeof(dec_pic_params_t)) * MAX_NUM_PIC_PARAMS)); memset(ps_dec->ps_sps, 0, @@ -2074,8 +2071,6 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op) ih264d_init_decoder(ps_dec); } - ps_dec->u4_prev_nal_skipped = 0; - ps_dec->u2_cur_mb_addr = 0; ps_dec->u2_total_mbs_coded = 0; ps_dec->u2_cur_slice_num = 0; @@ -2152,51 +2147,6 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op) bytes_consumed = buflen + u4_length_of_start_code; ps_dec_op->u4_num_bytes_consumed += bytes_consumed; - { - UWORD8 u1_firstbyte, u1_nal_ref_idc; - - if(ps_dec->i4_app_skip_mode == IVD_SKIP_B) - { - u1_firstbyte = *(pu1_buf + u4_length_of_start_code); - u1_nal_ref_idc = (UWORD8)(NAL_REF_IDC(u1_firstbyte)); - if(u1_nal_ref_idc == 0) - { - /*skip non reference frames*/ - cur_slice_is_nonref = 1; - continue; - } - else - { - if(1 == cur_slice_is_nonref) - { - /*We have encountered a referenced frame,return to app*/ - ps_dec_op->u4_num_bytes_consumed -= - bytes_consumed; - ps_dec_op->e_pic_type = IV_B_FRAME; - ps_dec_op->u4_error_code = - IVD_DEC_FRM_SKIPPED; - ps_dec_op->u4_error_code |= (1 - << IVD_UNSUPPORTEDPARAM); - ps_dec_op->u4_frame_decoded_flag = 0; - ps_dec_op->u4_size = - sizeof(ivd_video_decode_op_t); - /*signal the decode thread*/ - ih264d_signal_decode_thread(ps_dec); - /* close deblock thread if it is not closed yet*/ - if(ps_dec->u4_num_cores == 3) - { - ih264d_signal_bs_deblk_thread(ps_dec); - } - - return (IV_FAIL); - } - } - - } - - } - - if(buflen) { memcpy(pu1_bitstrm_buf, pu1_buf + u4_length_of_start_code, @@ -2247,7 +2197,6 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op) } - ps_dec->u4_return_to_app = 0; ret = ih264d_parse_nal_unit(dec_hdl, ps_dec_op, pu1_bitstrm_buf, buflen); if(ret != OK) @@ -2284,27 +2233,6 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op) } - if(ps_dec->u4_return_to_app) - { - /*We have encountered a referenced frame,return to app*/ - ps_dec_op->u4_num_bytes_consumed -= bytes_consumed; - ps_dec_op->u4_error_code = IVD_DEC_FRM_SKIPPED; - ps_dec_op->u4_error_code |= (1 << IVD_UNSUPPORTEDPARAM); - ps_dec_op->u4_frame_decoded_flag = 0; - ps_dec_op->u4_size = sizeof(ivd_video_decode_op_t); - /*signal the decode thread*/ - ih264d_signal_decode_thread(ps_dec); - /* close deblock thread if it is not closed yet*/ - if(ps_dec->u4_num_cores == 3) - { - ih264d_signal_bs_deblk_thread(ps_dec); - } - return (IV_FAIL); - - } - - - header_data_left = ((ps_dec->i4_decode_header == 1) && (ps_dec->i4_header_decoded != 3) && (ps_dec_op->u4_num_bytes_consumed @@ -2437,21 +2365,6 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op) ps_dec_op->u4_error_code |= (1 << IVD_INSUFFICIENTDATA); api_ret_value = IV_FAIL; } - if(ps_dec->u4_prev_nal_skipped) - { - /*We have encountered a referenced frame,return to app*/ - ps_dec_op->u4_error_code = IVD_DEC_FRM_SKIPPED; - ps_dec_op->u4_error_code |= (1 << IVD_UNSUPPORTEDPARAM); - ps_dec_op->u4_frame_decoded_flag = 0; - ps_dec_op->u4_size = sizeof(ivd_video_decode_op_t); - /* close deblock thread if it is not closed yet*/ - if(ps_dec->u4_num_cores == 3) - { - ih264d_signal_bs_deblk_thread(ps_dec); - } - return (IV_FAIL); - - } if((ps_dec->u4_pic_buf_got == 1) && (ERROR_DANGLING_FIELD_IN_PIC != i4_err_status)) @@ -3163,32 +3076,10 @@ WORD32 ih264d_set_params(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op) ps_ctl_op->u4_error_code = 0; - ps_dec->i4_app_skip_mode = ps_ctl_ip->e_frm_skip_mode; - - /*Is it really supported test it when you so the corner testing using test app*/ - if(ps_ctl_ip->e_frm_skip_mode != IVD_SKIP_NONE) { - - if(ps_ctl_ip->e_frm_skip_mode == IVD_SKIP_P) - ps_dec->u4_skip_frm_mask |= 1 << P_SLC_BIT; - else if(ps_ctl_ip->e_frm_skip_mode == IVD_SKIP_B) - ps_dec->u4_skip_frm_mask |= 1 << B_SLC_BIT; - else if(ps_ctl_ip->e_frm_skip_mode == IVD_SKIP_PB) - { - ps_dec->u4_skip_frm_mask |= 1 << B_SLC_BIT; - ps_dec->u4_skip_frm_mask |= 1 << P_SLC_BIT; - } - else if(ps_ctl_ip->e_frm_skip_mode == IVD_SKIP_I) - ps_dec->u4_skip_frm_mask |= 1 << I_SLC_BIT; - else - { - //dynamic parameter not supported - //Put an appropriate error code to return the error.. - //when you do the error code tests and after that remove this comment - ps_ctl_op->u4_error_code = (1 << IVD_UNSUPPORTEDPARAM); - ret = IV_FAIL; - } + ps_ctl_op->u4_error_code = (1 << IVD_UNSUPPORTEDPARAM); + ret = IV_FAIL; } if(ps_ctl_ip->u4_disp_wd >= ps_dec->u2_pic_wd) diff --git a/decoder/ih264d_parse_slice.c b/decoder/ih264d_parse_slice.c index 5282738..c384f45 100644 --- a/decoder/ih264d_parse_slice.c +++ b/decoder/ih264d_parse_slice.c @@ -1060,62 +1060,6 @@ WORD32 ih264d_parse_decode_slice(UWORD8 u1_is_idr_slice, u1_slice_type -= 5; } - { - UWORD32 skip; - - if((ps_dec->i4_app_skip_mode == IVD_SKIP_PB) - || (ps_dec->i4_dec_skip_mode == IVD_SKIP_PB)) - { - UWORD32 u4_bit_stream_offset = 0; - - if(ps_dec->u1_nal_unit_type == IDR_SLICE_NAL) - { - skip = 0; - - ps_dec->i4_dec_skip_mode = IVD_SKIP_NONE; - } - else if((I_SLICE == u1_slice_type) - && (1 >= ps_dec->ps_cur_sps->u1_num_ref_frames)) - { - skip = 0; - - ps_dec->i4_dec_skip_mode = IVD_SKIP_NONE; - } - else - { - skip = 1; - } - - /* If one frame worth of data is already skipped, do not skip the next one */ - if((0 == u2_first_mb_in_slice) && (1 == ps_dec->u4_prev_nal_skipped)) - { - skip = 0; - } - - if(skip) - { - ps_dec->u4_prev_nal_skipped = 1; - ps_dec->i4_dec_skip_mode = IVD_SKIP_PB; - return 0; - } - else - { - /* If the previous NAL was skipped, then - do not process that buffer in this call. - Return to app and process it in the next call. - This is necessary to handle cases where I/IDR is not complete in - the current buffer and application intends to fill the remaining part of the bitstream - later. This ensures we process only frame worth of data in every call */ - if(1 == ps_dec->u4_prev_nal_skipped) - { - ps_dec->u4_return_to_app = 1; - return 0; - } - } - } - - } - u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf); if(u4_temp & MASK_ERR_PIC_SET_ID) return ERROR_INV_SLICE_HDR_T; diff --git a/decoder/ih264d_structs.h b/decoder/ih264d_structs.h index 706fe9d..97e9797 100644 --- a/decoder/ih264d_structs.h +++ b/decoder/ih264d_structs.h @@ -1231,7 +1231,6 @@ typedef struct _DecStruct UWORD32 u4_num_mbs_cur_nmb; UWORD32 u4_app_deblk_disable_level; UWORD32 u4_app_disable_deblk_frm; - WORD32 i4_app_skip_mode; WORD32 i4_mv_frac_mask; disp_buf_t disp_bufs[MAX_DISP_BUFS_NEW]; @@ -1239,9 +1238,6 @@ typedef struct _DecStruct UWORD32 u4_disp_buf_to_be_freed[MAX_DISP_BUFS_NEW]; UWORD32 u4_share_disp_buf; UWORD32 u4_num_disp_bufs; - UWORD32 u4_prev_nal_skipped; - UWORD32 u4_return_to_app; - WORD32 i4_dec_skip_mode; UWORD32 u4_bs_deblk_thread_created; volatile UWORD32 u4_start_recon_deblk; |