Lines Matching refs:ps_entropy_ctxt

229     entropy_context_t *ps_entropy_ctxt;  in ihevce_entropy_init()  local
232 ps_entropy_ctxt = (entropy_context_t *)ps_mem_tab[ENTROPY_CTXT].pv_base; in ihevce_entropy_init()
233 memset(ps_entropy_ctxt, 0, sizeof(entropy_context_t)); in ihevce_entropy_init()
235 ps_entropy_ctxt->pu1_skip_cu_top = (UWORD8 *)ps_mem_tab[ENTROPY_TOP_SKIP_FLAGS].pv_base; in ihevce_entropy_init()
236 ps_entropy_ctxt->pu1_cu_depth_top = (UWORD8 *)ps_mem_tab[ENTROPY_TOP_CU_DEPTH].pv_base; in ihevce_entropy_init()
237 ps_entropy_ctxt->pv_dummy_out_buf = ps_mem_tab[ENTROPY_DUMMY_OUT_BUF].pv_base; in ihevce_entropy_init()
238 ps_entropy_ctxt->i4_bitstream_buf_size = ps_mem_tab[ENTROPY_DUMMY_OUT_BUF].i4_mem_size; in ihevce_entropy_init()
246 ps_entropy_ctxt->apu1_cbf_cb[0] = &ps_entropy_ctxt->au1_cbf_cb[0][1]; in ihevce_entropy_init()
247 ps_entropy_ctxt->apu1_cbf_cr[0] = &ps_entropy_ctxt->au1_cbf_cr[0][1]; in ihevce_entropy_init()
248 ps_entropy_ctxt->apu1_cbf_cb[1] = &ps_entropy_ctxt->au1_cbf_cb[1][1]; in ihevce_entropy_init()
249 ps_entropy_ctxt->apu1_cbf_cr[1] = &ps_entropy_ctxt->au1_cbf_cr[1][1]; in ihevce_entropy_init()
251 memset(ps_entropy_ctxt->au1_cbf_cb, 0, (MAX_TFR_DEPTH + 1) * 2 * sizeof(UWORD8)); in ihevce_entropy_init()
254 ps_entropy_ctxt->i4_codec_level = in ihevce_entropy_init()
258 ps_entropy_ctxt->i4_sps_at_cdr_enable = ps_init_prms->s_out_strm_prms.i4_sps_at_cdr_enable; in ihevce_entropy_init()
261 ps_entropy_ctxt->pv_tile_params_base = pv_tile_params_base; in ihevce_entropy_init()
263 ps_entropy_ctxt->pv_sys_api = (void *)&ps_init_prms->s_sys_api; in ihevce_entropy_init()
265 ps_entropy_ctxt->i4_slice_segment_mode = ps_init_prms->s_slice_params.i4_slice_segment_mode; in ihevce_entropy_init()
268 if((ps_entropy_ctxt->i4_slice_segment_mode == 1) || in ihevce_entropy_init()
269 (ps_entropy_ctxt->i4_slice_segment_mode == 2)) in ihevce_entropy_init()
271 ps_entropy_ctxt->i4_slice_segment_max_length = in ihevce_entropy_init()
276 ps_entropy_ctxt->i4_slice_segment_max_length = 0; in ihevce_entropy_init()
280 return ((void *)ps_entropy_ctxt); in ihevce_entropy_init()
313 entropy_context_t *ps_entropy_ctxt = (entropy_context_t *)pv_entropy_hdl; in ihevce_entropy_encode_frame() local
337 bitstrm_t *ps_bitstrm = &ps_entropy_ctxt->s_bit_strm; in ihevce_entropy_encode_frame()
344 ihevce_sys_api_t *ps_sys_api = (ihevce_sys_api_t *)ps_entropy_ctxt->pv_sys_api; in ihevce_entropy_encode_frame()
349 if(0 == ps_entropy_ctxt->i4_sps_at_cdr_enable) in ihevce_entropy_encode_frame()
355 ps_entropy_ctxt->ps_vps = ps_vps; in ihevce_entropy_encode_frame()
356 ps_entropy_ctxt->ps_sps = ps_sps; in ihevce_entropy_encode_frame()
357 ps_entropy_ctxt->ps_pps = ps_pps; in ihevce_entropy_encode_frame()
358 ps_entropy_ctxt->ps_sei = ps_sei; in ihevce_entropy_encode_frame()
359 ps_entropy_ctxt->ps_slice_hdr = &ps_curr_inp->s_slice_hdr; in ihevce_entropy_encode_frame()
360 ps_entropy_ctxt->i4_is_cu_cbf_zero = 1; in ihevce_entropy_encode_frame()
362 ps_entropy_ctxt->ps_pic_level_info = &ps_curr_inp->s_pic_level_info; in ihevce_entropy_encode_frame()
365 ps_entropy_ctxt->ps_frm_ctb = ps_curr_inp->ps_frm_ctb_data; in ihevce_entropy_encode_frame()
368 ps_entropy_ctxt->i4_next_slice_seg_x = 0; in ihevce_entropy_encode_frame()
369 ps_entropy_ctxt->i4_next_slice_seg_y = 0; in ihevce_entropy_encode_frame()
372 ps_entropy_ctxt->i4_enable_res_encode = 1; in ihevce_entropy_encode_frame()
407 ret |= ihevce_generate_vps(ps_bitstrm, ps_entropy_ctxt->ps_vps); in ihevce_entropy_encode_frame()
410 ret |= ihevce_generate_sps(ps_bitstrm, ps_entropy_ctxt->ps_sps); in ihevce_entropy_encode_frame()
413 ret |= ihevce_generate_pps(ps_bitstrm, ps_entropy_ctxt->ps_pps); in ihevce_entropy_encode_frame()
417 if(1 == ps_entropy_ctxt->ps_sei->i1_sei_parameters_present_flag) in ihevce_entropy_encode_frame()
420 ps_entropy_ctxt->ps_sei->i1_buf_period_params_present_flag || in ihevce_entropy_encode_frame()
421 ps_entropy_ctxt->ps_sei->i1_pic_timing_params_present_flag || in ihevce_entropy_encode_frame()
422 ps_entropy_ctxt->ps_sei->i1_recovery_point_params_present_flag || in ihevce_entropy_encode_frame()
423 ps_entropy_ctxt->ps_sei->i4_sei_mastering_disp_colour_vol_params_present_flags || in ihevce_entropy_encode_frame()
430 ps_entropy_ctxt->ps_sei, in ihevce_entropy_encode_frame()
431 &ps_entropy_ctxt->ps_sps->s_vui_parameters, in ihevce_entropy_encode_frame()
440 ps_entropy_ctxt->ps_pic_level_info->u8_bits_estimated_slice_header += in ihevce_entropy_encode_frame()
443 ps_tile_params_base = (ihevce_tile_params_t *)ps_entropy_ctxt->pv_tile_params_base; in ihevce_entropy_encode_frame()
501 WORD32 codec_level_index = ihevce_get_level_index(ps_entropy_ctxt->i4_codec_level); in ihevce_entropy_encode_frame()
504 ps_entropy_ctxt->i4_num_slice_seg = 0; in ihevce_entropy_encode_frame()
508 i4_slice_segment_max_length_bckp = ps_entropy_ctxt->i4_slice_segment_max_length; in ihevce_entropy_encode_frame()
526 ps_entropy_ctxt->ps_slice_hdr, in ihevce_entropy_encode_frame()
527 ps_entropy_ctxt->ps_pps, in ihevce_entropy_encode_frame()
528 ps_entropy_ctxt->ps_sps, in ihevce_entropy_encode_frame()
529 &ps_entropy_ctxt->s_dup_bit_strm_ent_offset, in ihevce_entropy_encode_frame()
530 &ps_entropy_ctxt->s_cabac_ctxt.u4_first_slice_start_offset, in ihevce_entropy_encode_frame()
532 ps_entropy_ctxt->i4_next_slice_seg_x, in ihevce_entropy_encode_frame()
533 ps_entropy_ctxt->i4_next_slice_seg_y); in ihevce_entropy_encode_frame()
539 if(2 == ps_entropy_ctxt->i4_slice_segment_mode) in ihevce_entropy_encode_frame()
541 ps_entropy_ctxt->i4_slice_seg_len = (i4_slice_header_bits / 8); in ihevce_entropy_encode_frame()
545 ps_entropy_ctxt->i4_slice_seg_len = 0; in ihevce_entropy_encode_frame()
549 ps_entropy_ctxt->ps_pic_level_info->u8_bits_estimated_slice_header += in ihevce_entropy_encode_frame()
553 if(ps_entropy_ctxt->i4_num_slice_seg == (i4_max_num_slices - 1)) in ihevce_entropy_encode_frame()
557 ps_entropy_ctxt->i4_slice_segment_max_length = 0x7FFFFFFF; in ihevce_entropy_encode_frame()
562 ps_entropy_ctxt, (ps_tile_params_base + tile_ctr), &i4_end_of_slice); in ihevce_entropy_encode_frame()
565 ps_entropy_ctxt->i4_num_slice_seg++; in ihevce_entropy_encode_frame()
571 &ps_entropy_ctxt->s_dup_bit_strm_ent_offset, in ihevce_entropy_encode_frame()
572 ps_entropy_ctxt->ps_slice_hdr, in ihevce_entropy_encode_frame()
573 ps_entropy_ctxt->ps_pps, in ihevce_entropy_encode_frame()
574 ps_entropy_ctxt->s_cabac_ctxt.u4_first_slice_start_offset); in ihevce_entropy_encode_frame()
580 i4_bytes_generated = ps_entropy_ctxt->s_dup_bit_strm_ent_offset.u4_strm_buf_offset; in ihevce_entropy_encode_frame()
584 i4_bytes_generated = ps_entropy_ctxt->s_cabac_ctxt.u4_strm_buf_offset; in ihevce_entropy_encode_frame()
597 if(ps_entropy_ctxt->i4_num_slice_seg == i4_max_num_slices) in ihevce_entropy_encode_frame()
599 if(ps_entropy_ctxt->i4_slice_seg_len >= i4_slice_segment_max_length_bckp) in ihevce_entropy_encode_frame()
601 if(1 == ps_entropy_ctxt->i4_slice_segment_mode) in ihevce_entropy_encode_frame()
607 ps_entropy_ctxt->i4_slice_seg_len, in ihevce_entropy_encode_frame()
611 else if(2 == ps_entropy_ctxt->i4_slice_segment_mode) in ihevce_entropy_encode_frame()
617 ps_entropy_ctxt->i4_slice_seg_len, in ihevce_entropy_encode_frame()
625 ps_entropy_ctxt->i4_slice_segment_max_length = i4_slice_segment_max_length_bckp; in ihevce_entropy_encode_frame()
678 if(1 == ps_entropy_ctxt->ps_sei->i1_sei_parameters_present_flag) in ihevce_entropy_encode_frame()
681 if(0 != ps_entropy_ctxt->ps_sei->i1_decoded_pic_hash_sei_flag) in ihevce_entropy_encode_frame()
685 ps_entropy_ctxt->ps_sei, in ihevce_entropy_encode_frame()
686 &ps_entropy_ctxt->ps_sps->s_vui_parameters, in ihevce_entropy_encode_frame()
763 ps_entropy_ctxt->ps_pic_level_info->i1_num_ref_idx_l0_active = in ihevce_entropy_encode_frame()
764 ps_entropy_ctxt->ps_slice_hdr->i1_num_ref_idx_l0_active; in ihevce_entropy_encode_frame()
765 ps_entropy_ctxt->ps_pic_level_info->i1_num_ref_idx_l1_active = in ihevce_entropy_encode_frame()
766 ps_entropy_ctxt->ps_slice_hdr->i1_num_ref_idx_l1_active; in ihevce_entropy_encode_frame()
767 for(i = 0; i < ps_entropy_ctxt->ps_slice_hdr->i1_num_ref_idx_l0_active; i++) in ihevce_entropy_encode_frame()
769 ps_entropy_ctxt->ps_pic_level_info->i4_ref_poc_l0[i] = in ihevce_entropy_encode_frame()
770 ps_entropy_ctxt->ps_slice_hdr->s_rplm.i4_ref_poc_l0[i]; in ihevce_entropy_encode_frame()
771 ps_entropy_ctxt->ps_pic_level_info->i1_list_entry_l0[i] = in ihevce_entropy_encode_frame()
772 ps_entropy_ctxt->ps_slice_hdr->s_rplm.i1_list_entry_l0[i]; in ihevce_entropy_encode_frame()
773 ps_entropy_ctxt->ps_pic_level_info->i2_luma_weight_l0[i] = in ihevce_entropy_encode_frame()
774 (DOUBLE)ps_entropy_ctxt->ps_slice_hdr->s_wt_ofst.i2_luma_weight_l0[i] / in ihevce_entropy_encode_frame()
775 (1 << ps_entropy_ctxt->ps_slice_hdr->s_wt_ofst.i1_luma_log2_weight_denom); in ihevce_entropy_encode_frame()
776 ps_entropy_ctxt->ps_pic_level_info->i2_luma_offset_l0[i] = in ihevce_entropy_encode_frame()
777 ps_entropy_ctxt->ps_slice_hdr->s_wt_ofst.i2_luma_offset_l0[i]; in ihevce_entropy_encode_frame()
779 for(i = 0; i < ps_entropy_ctxt->ps_slice_hdr->i1_num_ref_idx_l1_active; i++) in ihevce_entropy_encode_frame()
781 ps_entropy_ctxt->ps_pic_level_info->i4_ref_poc_l1[i] = in ihevce_entropy_encode_frame()
782 ps_entropy_ctxt->ps_slice_hdr->s_rplm.i4_ref_poc_l1[i]; in ihevce_entropy_encode_frame()
783 ps_entropy_ctxt->ps_pic_level_info->i1_list_entry_l1[i] = in ihevce_entropy_encode_frame()
784 ps_entropy_ctxt->ps_slice_hdr->s_rplm.i1_list_entry_l1[i]; in ihevce_entropy_encode_frame()
785 ps_entropy_ctxt->ps_pic_level_info->i2_luma_weight_l1[i] = in ihevce_entropy_encode_frame()
786 (DOUBLE)ps_entropy_ctxt->ps_slice_hdr->s_wt_ofst.i2_luma_weight_l1[i] / in ihevce_entropy_encode_frame()
787 (1 << ps_entropy_ctxt->ps_slice_hdr->s_wt_ofst.i1_luma_log2_weight_denom); in ihevce_entropy_encode_frame()
788 ps_entropy_ctxt->ps_pic_level_info->i2_luma_offset_l1[i] = in ihevce_entropy_encode_frame()
789 ps_entropy_ctxt->ps_slice_hdr->s_wt_ofst.i2_luma_offset_l1[i]; in ihevce_entropy_encode_frame()