• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  * Copyright (C) 2018 The Android Open Source Project
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at:
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *****************************************************************************
18  * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
19 */
20 /*!
21 ******************************************************************************
22 * \file ihevce_enc_loop_pass.h
23 *
24 * \brief
25 *    This file contains interface defination of Encode loop pass function
26 *
27 * \date
28 *    18/09/2012
29 *
30 * \author
31 *    Ittiam
32 *
33 ******************************************************************************
34 */
35 
36 #ifndef _IHEVCE_ENC_LOOP_PASS_H_
37 #define _IHEVCE_ENC_LOOP_PASS_H_
38 
39 /*****************************************************************************/
40 /* Constant Macros                                                           */
41 /*****************************************************************************/
42 
43 /*****************************************************************************/
44 /* Function Macros                                                           */
45 /*****************************************************************************/
46 
47 /*****************************************************************************/
48 /* Typedefs                                                                  */
49 /*****************************************************************************/
50 
51 /*****************************************************************************/
52 /* Enums                                                                     */
53 /*****************************************************************************/
54 
55 /*****************************************************************************/
56 /* Structure                                                                 */
57 /*****************************************************************************/
58 
59 /*****************************************************************************/
60 /* Extern Variable Declarations                                              */
61 /*****************************************************************************/
62 
63 /*****************************************************************************/
64 /* Extern Function Declarations                                              */
65 /*****************************************************************************/
66 WORD32 ihevce_enc_loop_get_num_mem_recs(WORD32 i4_num_bitrate_inst, WORD32 i4_num_enc_frm_parallel);
67 
68 WORD32 ihevce_enc_loop_get_mem_recs(
69     iv_mem_rec_t *ps_mem_tab,
70     ihevce_static_cfg_params_t *ps_init_prms,
71     WORD32 i4_num_proc_thrds,
72     WORD32 i4_num_bitrate_inst,
73     WORD32 i4_num_enc_frm_parallel,
74     WORD32 i4_mem_space,
75     WORD32 i4_resolution_id);
76 
77 void *ihevce_enc_loop_init(
78     iv_mem_rec_t *ps_mem_tab,
79     ihevce_static_cfg_params_t *ps_init_prms,
80     WORD32 i4_num_proc_thrds,
81     void *pv_osal_handle,
82     func_selector_t *ps_func_selector,
83     rc_quant_t *ps_rc_quant_ctxt,
84     ihevce_tile_params_t *ps_tile_params_base,
85     WORD32 i4_resolution_id,
86     WORD32 i4_num_enc_loop_frm_pllel,
87     UWORD8 u1_is_popcnt_available);
88 
89 void ihevce_enc_loop_reg_sem_hdls(
90     void *pv_enc_loop_ctxt, void **ppv_sem_hdls, WORD32 i4_num_proc_thrds);
91 
92 void ihevce_enc_loop_dep_mngr_frame_reset(void *pv_enc_loop_ctxt, WORD32 enc_frm_id);
93 
94 void ihevce_enc_loop_delete(void *pv_enc_loop_ctxt);
95 
96 void ihevce_enc_loop_frame_init(
97     void *pv_enc_loop_ctxt,
98     WORD32 i4_frm_qp,
99     recon_pic_buf_t *(*aps_ref_list)[HEVCE_MAX_REF_PICS * 2],
100     recon_pic_buf_t *ps_frm_recon,
101     slice_header_t *ps_slice_hdr,
102     pps_t *ps_pps,
103     sps_t *ps_sps,
104     vps_t *ps_vps,
105     WORD8 i1_weighted_pred_flag,
106     WORD8 i1_weighted_bipred_flag,
107     WORD32 log2_luma_wght_denom,
108     WORD32 log2_chroma_wght_denom,
109     WORD32 cur_poc,
110     WORD32 i4_display_num,
111     enc_ctxt_t *ps_enc_ctxt,
112     me_enc_rdopt_ctxt_t *ps_cur_pic_ctxt,
113     WORD32 i4_bitrate_instance_num,
114     WORD32 i4_thrd_id,
115     WORD32 i4_enc_frm_id,
116     WORD32 i4_num_bitrates,
117     WORD32 i4_quality_preset,
118     void *pv_dep_mngr_encloop_dep_me);
119 
120 void ihevce_enc_loop_process(
121     void *pv_ctxt,
122     ihevce_lap_enc_buf_t *ps_curr_inp,
123     ctb_analyse_t *ps_ctb_in,
124     ipe_l0_ctb_analyse_for_me_t *ps_ipe_analyse,
125     recon_pic_buf_t *ps_frm_recon,
126     cur_ctb_cu_tree_t *ps_cu_tree_out,
127     ctb_enc_loop_out_t *ps_ctb_out,
128     cu_enc_loop_out_t *ps_cu_out,
129     tu_enc_loop_out_t *ps_tu_out,
130     pu_t *ps_pu_out,
131     UWORD8 *pu1_frm_ecd_data,
132     frm_ctb_ctxt_t *ps_frm_ctb_prms,
133     frm_lambda_ctxt_t *ps_frm_lamda,
134     multi_thrd_ctxt_t *ps_multi_thrd_ctxt,
135     WORD32 thrd_id,
136     WORD32 i4_enc_frm_id,
137     WORD32 i4_pass);
138 
139 LWORD64 ihevce_cu_mode_decide(
140     ihevce_enc_loop_ctxt_t *ps_ctxt,
141     enc_loop_cu_prms_t *ps_cu_prms,
142     cu_analyse_t *ps_cu_analyse,
143     final_mode_state_t *ps_final_mode_state,
144     UWORD8 *pu1_ecd_data,
145     pu_col_mv_t *ps_col_pu,
146     UWORD8 *pu1_col_pu_map,
147     WORD32 col_start_pu_idx);
148 
149 #endif /* _IHEVCE_ENC_LOOP_PASS_H_ */
150