xref: /aosp_15_r20/external/libavc/encoder/svc/isvce_structs.h (revision 495ae853bb871d1e5a258cb02c2cc13cde8ddb9a)
1*495ae853SAndroid Build Coastguard Worker /******************************************************************************
2*495ae853SAndroid Build Coastguard Worker  *
3*495ae853SAndroid Build Coastguard Worker  * Copyright (C) 2022 The Android Open Source Project
4*495ae853SAndroid Build Coastguard Worker  *
5*495ae853SAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
6*495ae853SAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
7*495ae853SAndroid Build Coastguard Worker  * You may obtain a copy of the License at:
8*495ae853SAndroid Build Coastguard Worker  *
9*495ae853SAndroid Build Coastguard Worker  * http://www.apache.org/licenses/LICENSE-2.0
10*495ae853SAndroid Build Coastguard Worker  *
11*495ae853SAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
12*495ae853SAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
13*495ae853SAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14*495ae853SAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
15*495ae853SAndroid Build Coastguard Worker  * limitations under the License.
16*495ae853SAndroid Build Coastguard Worker  *
17*495ae853SAndroid Build Coastguard Worker  *****************************************************************************
18*495ae853SAndroid Build Coastguard Worker  * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
19*495ae853SAndroid Build Coastguard Worker  */
20*495ae853SAndroid Build Coastguard Worker 
21*495ae853SAndroid Build Coastguard Worker /**
22*495ae853SAndroid Build Coastguard Worker *******************************************************************************
23*495ae853SAndroid Build Coastguard Worker * @file
24*495ae853SAndroid Build Coastguard Worker *  isvce_structs.h
25*495ae853SAndroid Build Coastguard Worker *
26*495ae853SAndroid Build Coastguard Worker * @brief
27*495ae853SAndroid Build Coastguard Worker *  Contains struct definition used for SVC encoding
28*495ae853SAndroid Build Coastguard Worker *
29*495ae853SAndroid Build Coastguard Worker * @author
30*495ae853SAndroid Build Coastguard Worker *  ittiam
31*495ae853SAndroid Build Coastguard Worker *
32*495ae853SAndroid Build Coastguard Worker * @remarks
33*495ae853SAndroid Build Coastguard Worker *  None
34*495ae853SAndroid Build Coastguard Worker *
35*495ae853SAndroid Build Coastguard Worker *******************************************************************************
36*495ae853SAndroid Build Coastguard Worker */
37*495ae853SAndroid Build Coastguard Worker 
38*495ae853SAndroid Build Coastguard Worker #ifndef _ISVCE_STRUCTS_H_
39*495ae853SAndroid Build Coastguard Worker #define _ISVCE_STRUCTS_H_
40*495ae853SAndroid Build Coastguard Worker 
41*495ae853SAndroid Build Coastguard Worker #include "ih264_typedefs.h"
42*495ae853SAndroid Build Coastguard Worker #include "iv2.h"
43*495ae853SAndroid Build Coastguard Worker #include "ive2.h"
44*495ae853SAndroid Build Coastguard Worker #include "ih264_defs.h"
45*495ae853SAndroid Build Coastguard Worker #include "ih264_deblk_edge_filters.h"
46*495ae853SAndroid Build Coastguard Worker #include "isvc_inter_pred_filters.h"
47*495ae853SAndroid Build Coastguard Worker #include "ithread.h"
48*495ae853SAndroid Build Coastguard Worker #include "isvc_defs.h"
49*495ae853SAndroid Build Coastguard Worker #include "isvc_mem_fns.h"
50*495ae853SAndroid Build Coastguard Worker #include "isvc_cabac_tables.h"
51*495ae853SAndroid Build Coastguard Worker #include "isvc_trans_quant_itrans_iquant.h"
52*495ae853SAndroid Build Coastguard Worker 
53*495ae853SAndroid Build Coastguard Worker /* Dependencies of ime_structs.h */
54*495ae853SAndroid Build Coastguard Worker #include "ime_defs.h"
55*495ae853SAndroid Build Coastguard Worker #include "ime_distortion_metrics.h"
56*495ae853SAndroid Build Coastguard Worker 
57*495ae853SAndroid Build Coastguard Worker /* Dependencies of ih264e_cabac_structs.h */
58*495ae853SAndroid Build Coastguard Worker #include "ih264_cabac_tables.h"
59*495ae853SAndroid Build Coastguard Worker 
60*495ae853SAndroid Build Coastguard Worker /* Dependencies of ih264e_structs.h */
61*495ae853SAndroid Build Coastguard Worker #include "ih264e_error.h"
62*495ae853SAndroid Build Coastguard Worker #include "ih264_trans_quant_itrans_iquant.h"
63*495ae853SAndroid Build Coastguard Worker #include "ih264_inter_pred_filters.h"
64*495ae853SAndroid Build Coastguard Worker #include "ih264e_bitstream.h"
65*495ae853SAndroid Build Coastguard Worker #include "ih264e_cabac_structs.h"
66*495ae853SAndroid Build Coastguard Worker #include "ih264e_defs.h"
67*495ae853SAndroid Build Coastguard Worker #include "ime_structs.h"
68*495ae853SAndroid Build Coastguard Worker 
69*495ae853SAndroid Build Coastguard Worker /* Dependencies of 'irc_picture_type.h' */
70*495ae853SAndroid Build Coastguard Worker #include "irc_cntrl_param.h"
71*495ae853SAndroid Build Coastguard Worker #include "irc_frame_info_collector.h"
72*495ae853SAndroid Build Coastguard Worker #include "irc_mem_req_and_acq.h"
73*495ae853SAndroid Build Coastguard Worker 
74*495ae853SAndroid Build Coastguard Worker /* Dependencies of 'irc_rate_control_api_structs' */
75*495ae853SAndroid Build Coastguard Worker #include "irc_picture_type.h"
76*495ae853SAndroid Build Coastguard Worker #include "irc_rd_model.h"
77*495ae853SAndroid Build Coastguard Worker #include "irc_vbr_storage_vbv.h"
78*495ae853SAndroid Build Coastguard Worker #include "irc_est_sad.h"
79*495ae853SAndroid Build Coastguard Worker #include "irc_bit_allocation.h"
80*495ae853SAndroid Build Coastguard Worker #include "irc_mb_model_based.h"
81*495ae853SAndroid Build Coastguard Worker #include "irc_cbr_buffer_control.h"
82*495ae853SAndroid Build Coastguard Worker #include "irc_vbr_str_prms.h"
83*495ae853SAndroid Build Coastguard Worker #include "irc_common.h"
84*495ae853SAndroid Build Coastguard Worker #include "irc_rate_control_api_structs.h"
85*495ae853SAndroid Build Coastguard Worker 
86*495ae853SAndroid Build Coastguard Worker #include "ih264e_structs.h"
87*495ae853SAndroid Build Coastguard Worker #include "isvce_cabac_structs.h"
88*495ae853SAndroid Build Coastguard Worker #include "isvce_defs.h"
89*495ae853SAndroid Build Coastguard Worker #include "isvce_downscaler.h"
90*495ae853SAndroid Build Coastguard Worker #include "isvce_interface_structs.h"
91*495ae853SAndroid Build Coastguard Worker #include "isvce_nalu_stat_aggregator.h"
92*495ae853SAndroid Build Coastguard Worker #include "isvce_pred_structs.h"
93*495ae853SAndroid Build Coastguard Worker #include "isvce_rc_utils.h"
94*495ae853SAndroid Build Coastguard Worker 
95*495ae853SAndroid Build Coastguard Worker typedef struct svc_params_t
96*495ae853SAndroid Build Coastguard Worker {
97*495ae853SAndroid Build Coastguard Worker     /**
98*495ae853SAndroid Build Coastguard Worker      * Num Temporal Layers
99*495ae853SAndroid Build Coastguard Worker      */
100*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_num_temporal_layers;
101*495ae853SAndroid Build Coastguard Worker 
102*495ae853SAndroid Build Coastguard Worker     /**
103*495ae853SAndroid Build Coastguard Worker      * Num Spatial Layers
104*495ae853SAndroid Build Coastguard Worker      */
105*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_num_spatial_layers;
106*495ae853SAndroid Build Coastguard Worker 
107*495ae853SAndroid Build Coastguard Worker     /**
108*495ae853SAndroid Build Coastguard Worker      * Resolution ration b/w spatial layers
109*495ae853SAndroid Build Coastguard Worker      */
110*495ae853SAndroid Build Coastguard Worker     DOUBLE d_spatial_res_ratio;
111*495ae853SAndroid Build Coastguard Worker 
112*495ae853SAndroid Build Coastguard Worker } svc_params_t;
113*495ae853SAndroid Build Coastguard Worker 
114*495ae853SAndroid Build Coastguard Worker typedef struct svc_layer_data_t
115*495ae853SAndroid Build Coastguard Worker {
116*495ae853SAndroid Build Coastguard Worker     /**
117*495ae853SAndroid Build Coastguard Worker      * Array of structs that contain mode_info per MB for every MB per layer
118*495ae853SAndroid Build Coastguard Worker      */
119*495ae853SAndroid Build Coastguard Worker     isvce_mb_info_t *ps_mb_info;
120*495ae853SAndroid Build Coastguard Worker 
121*495ae853SAndroid Build Coastguard Worker     UWORD32 *pu4_num_pus_in_mb;
122*495ae853SAndroid Build Coastguard Worker 
123*495ae853SAndroid Build Coastguard Worker } svc_layer_data_t;
124*495ae853SAndroid Build Coastguard Worker 
125*495ae853SAndroid Build Coastguard Worker typedef struct svc_au_data_t
126*495ae853SAndroid Build Coastguard Worker {
127*495ae853SAndroid Build Coastguard Worker     /**
128*495ae853SAndroid Build Coastguard Worker      * Array of structs that contain layer-wise data used for svc prediction
129*495ae853SAndroid Build Coastguard Worker      */
130*495ae853SAndroid Build Coastguard Worker     svc_layer_data_t *ps_svc_layer_data;
131*495ae853SAndroid Build Coastguard Worker 
132*495ae853SAndroid Build Coastguard Worker     /**
133*495ae853SAndroid Build Coastguard Worker      * Absolute POC for the current MV Bank
134*495ae853SAndroid Build Coastguard Worker      */
135*495ae853SAndroid Build Coastguard Worker     WORD32 i4_abs_poc;
136*495ae853SAndroid Build Coastguard Worker 
137*495ae853SAndroid Build Coastguard Worker     /**
138*495ae853SAndroid Build Coastguard Worker      * Buffer Id
139*495ae853SAndroid Build Coastguard Worker      */
140*495ae853SAndroid Build Coastguard Worker     WORD32 i4_buf_id;
141*495ae853SAndroid Build Coastguard Worker 
142*495ae853SAndroid Build Coastguard Worker } svc_au_data_t;
143*495ae853SAndroid Build Coastguard Worker 
144*495ae853SAndroid Build Coastguard Worker typedef struct isvce_inp_buf_t
145*495ae853SAndroid Build Coastguard Worker {
146*495ae853SAndroid Build Coastguard Worker     /* App's buffer */
147*495ae853SAndroid Build Coastguard Worker     isvce_raw_inp_buf_t s_inp_props;
148*495ae853SAndroid Build Coastguard Worker 
149*495ae853SAndroid Build Coastguard Worker     /* A copy of SVC parameters */
150*495ae853SAndroid Build Coastguard Worker     svc_params_t s_svc_params;
151*495ae853SAndroid Build Coastguard Worker 
152*495ae853SAndroid Build Coastguard Worker     /**
153*495ae853SAndroid Build Coastguard Worker      * Array of structs that contain properties of the buffers used for storing
154*495ae853SAndroid Build Coastguard Worker      * layer-wise YUV data
155*495ae853SAndroid Build Coastguard Worker      */
156*495ae853SAndroid Build Coastguard Worker     yuv_buf_props_t as_layer_yuv_buf_props[MAX_NUM_SPATIAL_LAYERS];
157*495ae853SAndroid Build Coastguard Worker 
158*495ae853SAndroid Build Coastguard Worker } isvce_inp_buf_t;
159*495ae853SAndroid Build Coastguard Worker 
160*495ae853SAndroid Build Coastguard Worker typedef struct mb_intra_modes_t
161*495ae853SAndroid Build Coastguard Worker {
162*495ae853SAndroid Build Coastguard Worker     UWORD8 au1_intra_modes[MAX_PU_IN_MB];
163*495ae853SAndroid Build Coastguard Worker } mb_intra_modes_t;
164*495ae853SAndroid Build Coastguard Worker 
165*495ae853SAndroid Build Coastguard Worker typedef struct nbr_info_t
166*495ae853SAndroid Build Coastguard Worker {
167*495ae853SAndroid Build Coastguard Worker     isvce_mb_info_t *ps_top_row_mb_info;
168*495ae853SAndroid Build Coastguard Worker 
169*495ae853SAndroid Build Coastguard Worker     isvce_mb_info_t *ps_left_mb_info;
170*495ae853SAndroid Build Coastguard Worker 
171*495ae853SAndroid Build Coastguard Worker     mb_intra_modes_t *ps_top_mb_intra_modes;
172*495ae853SAndroid Build Coastguard Worker 
173*495ae853SAndroid Build Coastguard Worker     mb_intra_modes_t *ps_left_mb_intra_modes;
174*495ae853SAndroid Build Coastguard Worker 
175*495ae853SAndroid Build Coastguard Worker } nbr_info_t;
176*495ae853SAndroid Build Coastguard Worker 
177*495ae853SAndroid Build Coastguard Worker typedef struct svc_nbr_info_t
178*495ae853SAndroid Build Coastguard Worker {
179*495ae853SAndroid Build Coastguard Worker     /**
180*495ae853SAndroid Build Coastguard Worker      * Array of structs that contain properties of the buffers used for storing
181*495ae853SAndroid Build Coastguard Worker      * layer-wise neighbour info
182*495ae853SAndroid Build Coastguard Worker      */
183*495ae853SAndroid Build Coastguard Worker     nbr_info_t *ps_layer_nbr_info;
184*495ae853SAndroid Build Coastguard Worker } svc_nbr_info_t;
185*495ae853SAndroid Build Coastguard Worker 
186*495ae853SAndroid Build Coastguard Worker typedef struct layer_resampler_props_t
187*495ae853SAndroid Build Coastguard Worker {
188*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_shift_x;
189*495ae853SAndroid Build Coastguard Worker 
190*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_shift_y;
191*495ae853SAndroid Build Coastguard Worker 
192*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_scale_x;
193*495ae853SAndroid Build Coastguard Worker 
194*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_scale_y;
195*495ae853SAndroid Build Coastguard Worker 
196*495ae853SAndroid Build Coastguard Worker     WORD32 i4_offset_x;
197*495ae853SAndroid Build Coastguard Worker 
198*495ae853SAndroid Build Coastguard Worker     WORD32 i4_offset_y;
199*495ae853SAndroid Build Coastguard Worker 
200*495ae853SAndroid Build Coastguard Worker     WORD32 i4_add_x;
201*495ae853SAndroid Build Coastguard Worker 
202*495ae853SAndroid Build Coastguard Worker     WORD32 i4_add_y;
203*495ae853SAndroid Build Coastguard Worker 
204*495ae853SAndroid Build Coastguard Worker     WORD32 i4_delta_x;
205*495ae853SAndroid Build Coastguard Worker 
206*495ae853SAndroid Build Coastguard Worker     WORD32 i4_delta_y;
207*495ae853SAndroid Build Coastguard Worker 
208*495ae853SAndroid Build Coastguard Worker     WORD32 i4_refphase_x;
209*495ae853SAndroid Build Coastguard Worker 
210*495ae853SAndroid Build Coastguard Worker     WORD32 i4_refphase_y;
211*495ae853SAndroid Build Coastguard Worker 
212*495ae853SAndroid Build Coastguard Worker     WORD32 i4_phase_x;
213*495ae853SAndroid Build Coastguard Worker 
214*495ae853SAndroid Build Coastguard Worker     WORD32 i4_phase_y;
215*495ae853SAndroid Build Coastguard Worker 
216*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_sub_wd;
217*495ae853SAndroid Build Coastguard Worker 
218*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_sub_ht;
219*495ae853SAndroid Build Coastguard Worker 
220*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_mb_wd;
221*495ae853SAndroid Build Coastguard Worker 
222*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_mb_ht;
223*495ae853SAndroid Build Coastguard Worker 
224*495ae853SAndroid Build Coastguard Worker } layer_resampler_props_t;
225*495ae853SAndroid Build Coastguard Worker 
226*495ae853SAndroid Build Coastguard Worker typedef struct svc_ilp_data_t
227*495ae853SAndroid Build Coastguard Worker {
228*495ae853SAndroid Build Coastguard Worker     /* Pointer to current AU buf */
229*495ae853SAndroid Build Coastguard Worker     svc_au_data_t *ps_svc_au_data;
230*495ae853SAndroid Build Coastguard Worker 
231*495ae853SAndroid Build Coastguard Worker     /* Array of bufs corresponding to numSpatialLayers */
232*495ae853SAndroid Build Coastguard Worker     layer_resampler_props_t *aps_layer_resampler_props[NUM_SP_COMPONENTS];
233*495ae853SAndroid Build Coastguard Worker 
234*495ae853SAndroid Build Coastguard Worker     /* Array of bufs corresponding to numSpatialLayers */
235*495ae853SAndroid Build Coastguard Worker     yuv_buf_props_t *ps_intra_recon_bufs;
236*495ae853SAndroid Build Coastguard Worker 
237*495ae853SAndroid Build Coastguard Worker     /* Array of bufs corresponding to numSpatialLayers */
238*495ae853SAndroid Build Coastguard Worker     yuv_buf_props_t *ps_residual_bufs;
239*495ae853SAndroid Build Coastguard Worker } svc_ilp_data_t;
240*495ae853SAndroid Build Coastguard Worker 
241*495ae853SAndroid Build Coastguard Worker typedef struct ilp_mv_t
242*495ae853SAndroid Build Coastguard Worker {
243*495ae853SAndroid Build Coastguard Worker     isvce_enc_pu_mv_t as_mv[ENC_MAX_PU_IN_MB][NUM_PRED_DIRS];
244*495ae853SAndroid Build Coastguard Worker 
245*495ae853SAndroid Build Coastguard Worker     MBTYPES_T e_mb_type;
246*495ae853SAndroid Build Coastguard Worker 
247*495ae853SAndroid Build Coastguard Worker     PRED_MODE_T ae_pred_mode[ENC_MAX_PU_IN_MB];
248*495ae853SAndroid Build Coastguard Worker } ilp_mv_t;
249*495ae853SAndroid Build Coastguard Worker 
250*495ae853SAndroid Build Coastguard Worker typedef struct ilp_me_cands_t
251*495ae853SAndroid Build Coastguard Worker {
252*495ae853SAndroid Build Coastguard Worker     isvce_enc_pu_mv_t as_mv[MAX_PU_IN_MB + MAX_ILP_MV_IN_NBR_RGN][NUM_PRED_DIRS];
253*495ae853SAndroid Build Coastguard Worker 
254*495ae853SAndroid Build Coastguard Worker     MBTYPES_T e_mb_type[MAX_PU_IN_MB + MAX_ILP_MV_IN_NBR_RGN];
255*495ae853SAndroid Build Coastguard Worker 
256*495ae853SAndroid Build Coastguard Worker     PRED_MODE_T ae_pred_mode[MAX_PU_IN_MB + MAX_ILP_MV_IN_NBR_RGN];
257*495ae853SAndroid Build Coastguard Worker 
258*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_num_ilp_mvs;
259*495ae853SAndroid Build Coastguard Worker 
260*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_num_ilp_mvs_incl_nbrs;
261*495ae853SAndroid Build Coastguard Worker } ilp_me_cands_t;
262*495ae853SAndroid Build Coastguard Worker 
263*495ae853SAndroid Build Coastguard Worker typedef struct isvce_cfg_params_t
264*495ae853SAndroid Build Coastguard Worker {
265*495ae853SAndroid Build Coastguard Worker     /** maximum width for which codec should request memory requirements    */
266*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_max_wd;
267*495ae853SAndroid Build Coastguard Worker 
268*495ae853SAndroid Build Coastguard Worker     /** maximum height for which codec should request memory requirements   */
269*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_max_ht;
270*495ae853SAndroid Build Coastguard Worker 
271*495ae853SAndroid Build Coastguard Worker     /** Maximum number of reference frames                                  */
272*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_max_ref_cnt;
273*495ae853SAndroid Build Coastguard Worker 
274*495ae853SAndroid Build Coastguard Worker     /** Maximum number of reorder frames                                    */
275*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_max_reorder_cnt;
276*495ae853SAndroid Build Coastguard Worker 
277*495ae853SAndroid Build Coastguard Worker     /** Maximum level supported                                             */
278*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_max_level;
279*495ae853SAndroid Build Coastguard Worker 
280*495ae853SAndroid Build Coastguard Worker     /** Input color format                                                  */
281*495ae853SAndroid Build Coastguard Worker     IV_COLOR_FORMAT_T e_inp_color_fmt;
282*495ae853SAndroid Build Coastguard Worker 
283*495ae853SAndroid Build Coastguard Worker     /** Flag to enable/disable - To be used only for debugging/testing      */
284*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_enable_recon;
285*495ae853SAndroid Build Coastguard Worker 
286*495ae853SAndroid Build Coastguard Worker     /** Recon color format                                                  */
287*495ae853SAndroid Build Coastguard Worker     IV_COLOR_FORMAT_T e_recon_color_fmt;
288*495ae853SAndroid Build Coastguard Worker 
289*495ae853SAndroid Build Coastguard Worker     /** Encoder Speed preset - Value between 0 (slowest) and 100 (fastest)  */
290*495ae853SAndroid Build Coastguard Worker     IVE_SPEED_CONFIG u4_enc_speed_preset;
291*495ae853SAndroid Build Coastguard Worker 
292*495ae853SAndroid Build Coastguard Worker     /** Rate control mode                                                   */
293*495ae853SAndroid Build Coastguard Worker     IVE_RC_MODE_T e_rc_mode;
294*495ae853SAndroid Build Coastguard Worker 
295*495ae853SAndroid Build Coastguard Worker     /** Maximum frame rate to be supported                                  */
296*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_max_framerate;
297*495ae853SAndroid Build Coastguard Worker 
298*495ae853SAndroid Build Coastguard Worker     /** Maximum bitrate to be supported                                     */
299*495ae853SAndroid Build Coastguard Worker     UWORD32 au4_max_bitrate[MAX_NUM_SPATIAL_LAYERS];
300*495ae853SAndroid Build Coastguard Worker 
301*495ae853SAndroid Build Coastguard Worker     /** Maximum number of consecutive  B frames                             */
302*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_num_bframes;
303*495ae853SAndroid Build Coastguard Worker 
304*495ae853SAndroid Build Coastguard Worker     /** Content type Interlaced/Progressive                                 */
305*495ae853SAndroid Build Coastguard Worker     IV_CONTENT_TYPE_T e_content_type;
306*495ae853SAndroid Build Coastguard Worker 
307*495ae853SAndroid Build Coastguard Worker     /** Maximum search range to be used in X direction                      */
308*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_max_srch_rng_x;
309*495ae853SAndroid Build Coastguard Worker 
310*495ae853SAndroid Build Coastguard Worker     /** Maximum search range to be used in Y direction                      */
311*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_max_srch_rng_y;
312*495ae853SAndroid Build Coastguard Worker 
313*495ae853SAndroid Build Coastguard Worker     /** Slice Mode                                                          */
314*495ae853SAndroid Build Coastguard Worker     IVE_SLICE_MODE_T e_slice_mode;
315*495ae853SAndroid Build Coastguard Worker 
316*495ae853SAndroid Build Coastguard Worker     /** Slice parameter                                                     */
317*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_slice_param;
318*495ae853SAndroid Build Coastguard Worker 
319*495ae853SAndroid Build Coastguard Worker     /** Processor architecture                                          */
320*495ae853SAndroid Build Coastguard Worker     IV_ARCH_T e_arch;
321*495ae853SAndroid Build Coastguard Worker 
322*495ae853SAndroid Build Coastguard Worker     /** SOC details                                                     */
323*495ae853SAndroid Build Coastguard Worker     IV_SOC_T e_soc;
324*495ae853SAndroid Build Coastguard Worker 
325*495ae853SAndroid Build Coastguard Worker     /** Input width to be sent in bitstream                                */
326*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_disp_wd;
327*495ae853SAndroid Build Coastguard Worker 
328*495ae853SAndroid Build Coastguard Worker     /** Input height to be sent in bitstream                               */
329*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_disp_ht;
330*495ae853SAndroid Build Coastguard Worker 
331*495ae853SAndroid Build Coastguard Worker     /** Input width                                                     */
332*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_wd;
333*495ae853SAndroid Build Coastguard Worker 
334*495ae853SAndroid Build Coastguard Worker     /** Input height                                                    */
335*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_ht;
336*495ae853SAndroid Build Coastguard Worker 
337*495ae853SAndroid Build Coastguard Worker     /** Input stride                                                    */
338*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_strd;
339*495ae853SAndroid Build Coastguard Worker 
340*495ae853SAndroid Build Coastguard Worker     /** Source frame rate                                               */
341*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_src_frame_rate;
342*495ae853SAndroid Build Coastguard Worker 
343*495ae853SAndroid Build Coastguard Worker     /** Target frame rate                                               */
344*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_tgt_frame_rate;
345*495ae853SAndroid Build Coastguard Worker 
346*495ae853SAndroid Build Coastguard Worker     /** Target bitrate in kilobits per second                           */
347*495ae853SAndroid Build Coastguard Worker     UWORD32 au4_target_bitrate[MAX_NUM_SPATIAL_LAYERS];
348*495ae853SAndroid Build Coastguard Worker 
349*495ae853SAndroid Build Coastguard Worker     /** Force current frame type                                        */
350*495ae853SAndroid Build Coastguard Worker     IV_PICTURE_CODING_TYPE_T e_frame_type;
351*495ae853SAndroid Build Coastguard Worker 
352*495ae853SAndroid Build Coastguard Worker     /** Encoder mode                                                    */
353*495ae853SAndroid Build Coastguard Worker     IVE_ENC_MODE_T e_enc_mode;
354*495ae853SAndroid Build Coastguard Worker 
355*495ae853SAndroid Build Coastguard Worker     /** Set initial Qp for I pictures                                   */
356*495ae853SAndroid Build Coastguard Worker     UWORD32 au4_i_qp[MAX_NUM_SPATIAL_LAYERS];
357*495ae853SAndroid Build Coastguard Worker 
358*495ae853SAndroid Build Coastguard Worker     /** Set initial Qp for P pictures                                   */
359*495ae853SAndroid Build Coastguard Worker     UWORD32 au4_p_qp[MAX_NUM_SPATIAL_LAYERS];
360*495ae853SAndroid Build Coastguard Worker 
361*495ae853SAndroid Build Coastguard Worker     /** Set initial Qp for B pictures                                   */
362*495ae853SAndroid Build Coastguard Worker     UWORD32 au4_b_qp[MAX_NUM_SPATIAL_LAYERS];
363*495ae853SAndroid Build Coastguard Worker 
364*495ae853SAndroid Build Coastguard Worker     /** Set minimum Qp for I pictures                                   */
365*495ae853SAndroid Build Coastguard Worker     UWORD32 au4_i_qp_min[MAX_NUM_SPATIAL_LAYERS];
366*495ae853SAndroid Build Coastguard Worker 
367*495ae853SAndroid Build Coastguard Worker     /** Set maximum Qp for I pictures                                   */
368*495ae853SAndroid Build Coastguard Worker     UWORD32 au4_i_qp_max[MAX_NUM_SPATIAL_LAYERS];
369*495ae853SAndroid Build Coastguard Worker 
370*495ae853SAndroid Build Coastguard Worker     /** Set minimum Qp for P pictures                                   */
371*495ae853SAndroid Build Coastguard Worker     UWORD32 au4_p_qp_min[MAX_NUM_SPATIAL_LAYERS];
372*495ae853SAndroid Build Coastguard Worker 
373*495ae853SAndroid Build Coastguard Worker     /** Set maximum Qp for P pictures                                   */
374*495ae853SAndroid Build Coastguard Worker     UWORD32 au4_p_qp_max[MAX_NUM_SPATIAL_LAYERS];
375*495ae853SAndroid Build Coastguard Worker 
376*495ae853SAndroid Build Coastguard Worker     /** Set minimum Qp for B pictures                                   */
377*495ae853SAndroid Build Coastguard Worker     UWORD32 au4_b_qp_min[MAX_NUM_SPATIAL_LAYERS];
378*495ae853SAndroid Build Coastguard Worker 
379*495ae853SAndroid Build Coastguard Worker     /** Set maximum Qp for B pictures                                   */
380*495ae853SAndroid Build Coastguard Worker     UWORD32 au4_b_qp_max[MAX_NUM_SPATIAL_LAYERS];
381*495ae853SAndroid Build Coastguard Worker 
382*495ae853SAndroid Build Coastguard Worker     /** Adaptive intra refresh mode                                     */
383*495ae853SAndroid Build Coastguard Worker     IVE_AIR_MODE_T e_air_mode;
384*495ae853SAndroid Build Coastguard Worker 
385*495ae853SAndroid Build Coastguard Worker     /** Adaptive intra refresh period in frames                         */
386*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_air_refresh_period;
387*495ae853SAndroid Build Coastguard Worker 
388*495ae853SAndroid Build Coastguard Worker     /** VBV buffer delay                                                */
389*495ae853SAndroid Build Coastguard Worker     UWORD32 au4_vbv_buffer_delay[MAX_NUM_SPATIAL_LAYERS];
390*495ae853SAndroid Build Coastguard Worker 
391*495ae853SAndroid Build Coastguard Worker     /** Number of cores to be used                                      */
392*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_num_cores;
393*495ae853SAndroid Build Coastguard Worker 
394*495ae853SAndroid Build Coastguard Worker     /** ME speed preset - Value between 0 (slowest) and 100 (fastest)      */
395*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_me_speed_preset;
396*495ae853SAndroid Build Coastguard Worker 
397*495ae853SAndroid Build Coastguard Worker     /** Flag to enable/disable half pel motion estimation               */
398*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_enable_hpel;
399*495ae853SAndroid Build Coastguard Worker 
400*495ae853SAndroid Build Coastguard Worker     /** Flag to enable/disable quarter pel motion estimation            */
401*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_enable_qpel;
402*495ae853SAndroid Build Coastguard Worker 
403*495ae853SAndroid Build Coastguard Worker     /** Flag to enable/disable intra 4x4 analysis                       */
404*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_enable_intra_4x4;
405*495ae853SAndroid Build Coastguard Worker 
406*495ae853SAndroid Build Coastguard Worker     /** Flag to enable/disable intra 8x8 analysis                       */
407*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_enable_intra_8x8;
408*495ae853SAndroid Build Coastguard Worker 
409*495ae853SAndroid Build Coastguard Worker     /** Flag to enable/disable intra 16x16 analysis                     */
410*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_enable_intra_16x16;
411*495ae853SAndroid Build Coastguard Worker 
412*495ae853SAndroid Build Coastguard Worker     /** Flag to enable/disable fast SAD approximation                   */
413*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_enable_fast_sad;
414*495ae853SAndroid Build Coastguard Worker 
415*495ae853SAndroid Build Coastguard Worker     /*flag to enable/disable alternate reference frames                 */
416*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_enable_alt_ref;
417*495ae853SAndroid Build Coastguard Worker 
418*495ae853SAndroid Build Coastguard Worker     /*Flag to enable/disable computation of SATDQ in ME*/
419*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_enable_satqd;
420*495ae853SAndroid Build Coastguard Worker 
421*495ae853SAndroid Build Coastguard Worker     /*Minimum SAD to search for*/
422*495ae853SAndroid Build Coastguard Worker     WORD32 i4_min_sad;
423*495ae853SAndroid Build Coastguard Worker 
424*495ae853SAndroid Build Coastguard Worker     /** Maximum search range in X direction for farthest reference      */
425*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_srch_rng_x;
426*495ae853SAndroid Build Coastguard Worker 
427*495ae853SAndroid Build Coastguard Worker     /** Maximum search range in Y direction for farthest reference      */
428*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_srch_rng_y;
429*495ae853SAndroid Build Coastguard Worker 
430*495ae853SAndroid Build Coastguard Worker     /** I frame interval                                                */
431*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_i_frm_interval;
432*495ae853SAndroid Build Coastguard Worker 
433*495ae853SAndroid Build Coastguard Worker     /** IDR frame interval                                              */
434*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_idr_frm_interval;
435*495ae853SAndroid Build Coastguard Worker 
436*495ae853SAndroid Build Coastguard Worker     /** Disable deblock level (0: Enable completely, 3: Disable completely */
437*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_disable_deblock_level;
438*495ae853SAndroid Build Coastguard Worker 
439*495ae853SAndroid Build Coastguard Worker     /** Profile                                                         */
440*495ae853SAndroid Build Coastguard Worker     IV_PROFILE_T e_profile;
441*495ae853SAndroid Build Coastguard Worker 
442*495ae853SAndroid Build Coastguard Worker     /** Lower 32bits of time stamp corresponding to input buffer,
443*495ae853SAndroid Build Coastguard Worker      * from which this command takes effect                             */
444*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_timestamp_low;
445*495ae853SAndroid Build Coastguard Worker 
446*495ae853SAndroid Build Coastguard Worker     /** Upper 32bits of time stamp corresponding to input buffer,
447*495ae853SAndroid Build Coastguard Worker      * from which this command takes effect                             */
448*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_timestamp_high;
449*495ae853SAndroid Build Coastguard Worker 
450*495ae853SAndroid Build Coastguard Worker     /** Flag to say if the current config parameter set is valid
451*495ae853SAndroid Build Coastguard Worker      * Will be zero to start with and will be set to 1, when configured
452*495ae853SAndroid Build Coastguard Worker      * Once encoder uses the parameter set, this will be set to zero */
453*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_is_valid;
454*495ae853SAndroid Build Coastguard Worker 
455*495ae853SAndroid Build Coastguard Worker     /** Command associated with this config param set */
456*495ae853SAndroid Build Coastguard Worker     ISVCE_CONTROL_API_COMMAND_TYPE_T e_cmd;
457*495ae853SAndroid Build Coastguard Worker 
458*495ae853SAndroid Build Coastguard Worker     /** Input width in mbs                                                    */
459*495ae853SAndroid Build Coastguard Worker     UWORD32 i4_wd_mbs;
460*495ae853SAndroid Build Coastguard Worker 
461*495ae853SAndroid Build Coastguard Worker     /** Input height in mbs                                                   */
462*495ae853SAndroid Build Coastguard Worker     UWORD32 i4_ht_mbs;
463*495ae853SAndroid Build Coastguard Worker 
464*495ae853SAndroid Build Coastguard Worker     /** entropy coding mode flag                                              */
465*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_entropy_coding_mode;
466*495ae853SAndroid Build Coastguard Worker 
467*495ae853SAndroid Build Coastguard Worker     /** enable weighted prediction                                            */
468*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_weighted_prediction;
469*495ae853SAndroid Build Coastguard Worker 
470*495ae853SAndroid Build Coastguard Worker     /** Pic info type */
471*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_pic_info_type;
472*495ae853SAndroid Build Coastguard Worker     /**
473*495ae853SAndroid Build Coastguard Worker      * MB info type
474*495ae853SAndroid Build Coastguard Worker      */
475*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_isvce_mb_info_type;
476*495ae853SAndroid Build Coastguard Worker 
477*495ae853SAndroid Build Coastguard Worker     /** VUI structure                                                         */
478*495ae853SAndroid Build Coastguard Worker     vui_t s_vui;
479*495ae853SAndroid Build Coastguard Worker 
480*495ae853SAndroid Build Coastguard Worker     /** SEI structure                                                         */
481*495ae853SAndroid Build Coastguard Worker     sei_params_t s_sei;
482*495ae853SAndroid Build Coastguard Worker 
483*495ae853SAndroid Build Coastguard Worker     /** Flag to enable/disable VUI from header                          */
484*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_disable_vui;
485*495ae853SAndroid Build Coastguard Worker 
486*495ae853SAndroid Build Coastguard Worker     /** SVC params                                                            */
487*495ae853SAndroid Build Coastguard Worker     svc_params_t s_svc_params;
488*495ae853SAndroid Build Coastguard Worker 
489*495ae853SAndroid Build Coastguard Worker     bool b_nalu_info_export_enable;
490*495ae853SAndroid Build Coastguard Worker 
491*495ae853SAndroid Build Coastguard Worker } isvce_cfg_params_t;
492*495ae853SAndroid Build Coastguard Worker 
493*495ae853SAndroid Build Coastguard Worker typedef struct mb_qp_ctxt_t
494*495ae853SAndroid Build Coastguard Worker {
495*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_cur_mb_qp;
496*495ae853SAndroid Build Coastguard Worker 
497*495ae853SAndroid Build Coastguard Worker } mb_qp_ctxt_t;
498*495ae853SAndroid Build Coastguard Worker 
499*495ae853SAndroid Build Coastguard Worker typedef struct isvce_entropy_ctxt_t
500*495ae853SAndroid Build Coastguard Worker {
501*495ae853SAndroid Build Coastguard Worker     /**
502*495ae853SAndroid Build Coastguard Worker      * Pointer to the cabac context
503*495ae853SAndroid Build Coastguard Worker      */
504*495ae853SAndroid Build Coastguard Worker     isvce_cabac_ctxt_t *ps_cabac;
505*495ae853SAndroid Build Coastguard Worker 
506*495ae853SAndroid Build Coastguard Worker     mb_qp_ctxt_t *ps_mb_qp_ctxt;
507*495ae853SAndroid Build Coastguard Worker 
508*495ae853SAndroid Build Coastguard Worker     /**
509*495ae853SAndroid Build Coastguard Worker      * start of frame / start of slice flag
510*495ae853SAndroid Build Coastguard Worker      */
511*495ae853SAndroid Build Coastguard Worker     WORD32 i4_sof;
512*495ae853SAndroid Build Coastguard Worker 
513*495ae853SAndroid Build Coastguard Worker     /**
514*495ae853SAndroid Build Coastguard Worker      * end of frame / end of slice flag
515*495ae853SAndroid Build Coastguard Worker      */
516*495ae853SAndroid Build Coastguard Worker     WORD32 i4_eof;
517*495ae853SAndroid Build Coastguard Worker 
518*495ae853SAndroid Build Coastguard Worker     /**
519*495ae853SAndroid Build Coastguard Worker      * generate header upon request
520*495ae853SAndroid Build Coastguard Worker      */
521*495ae853SAndroid Build Coastguard Worker     WORD32 i4_gen_header;
522*495ae853SAndroid Build Coastguard Worker 
523*495ae853SAndroid Build Coastguard Worker     WORD32 i4_gen_subset_sps;
524*495ae853SAndroid Build Coastguard Worker 
525*495ae853SAndroid Build Coastguard Worker     /**
526*495ae853SAndroid Build Coastguard Worker      * Pointer to base of sequence parameter set structure array
527*495ae853SAndroid Build Coastguard Worker      */
528*495ae853SAndroid Build Coastguard Worker     sps_t *ps_sps_base;
529*495ae853SAndroid Build Coastguard Worker 
530*495ae853SAndroid Build Coastguard Worker     /**
531*495ae853SAndroid Build Coastguard Worker      * Pointer to base of Picture parameter set structure array
532*495ae853SAndroid Build Coastguard Worker      */
533*495ae853SAndroid Build Coastguard Worker     pps_t *ps_pps_base;
534*495ae853SAndroid Build Coastguard Worker 
535*495ae853SAndroid Build Coastguard Worker     /**
536*495ae853SAndroid Build Coastguard Worker      * Current slice idx
537*495ae853SAndroid Build Coastguard Worker      */
538*495ae853SAndroid Build Coastguard Worker     WORD32 i4_cur_slice_idx;
539*495ae853SAndroid Build Coastguard Worker 
540*495ae853SAndroid Build Coastguard Worker     /**
541*495ae853SAndroid Build Coastguard Worker      * Points to the array of slice indices which is used to identify the
542*495ae853SAndroid Build Coastguard Worker      * independent slice to which each MB in a frame belongs.
543*495ae853SAndroid Build Coastguard Worker      */
544*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_slice_idx;
545*495ae853SAndroid Build Coastguard Worker 
546*495ae853SAndroid Build Coastguard Worker     /**
547*495ae853SAndroid Build Coastguard Worker      * Pointer to base of svc_nalu_ext structure array
548*495ae853SAndroid Build Coastguard Worker      */
549*495ae853SAndroid Build Coastguard Worker     svc_nalu_ext_t *ps_svc_nalu_ext_base;
550*495ae853SAndroid Build Coastguard Worker 
551*495ae853SAndroid Build Coastguard Worker     /**
552*495ae853SAndroid Build Coastguard Worker      * Pointer to base of subset sequence parameter set structure array
553*495ae853SAndroid Build Coastguard Worker      */
554*495ae853SAndroid Build Coastguard Worker     subset_sps_t *ps_subset_sps_base;
555*495ae853SAndroid Build Coastguard Worker 
556*495ae853SAndroid Build Coastguard Worker     /**
557*495ae853SAndroid Build Coastguard Worker      * Pointer to base of slice header structure array
558*495ae853SAndroid Build Coastguard Worker      */
559*495ae853SAndroid Build Coastguard Worker     slice_header_t *ps_slice_hdr_base;
560*495ae853SAndroid Build Coastguard Worker 
561*495ae853SAndroid Build Coastguard Worker     /**
562*495ae853SAndroid Build Coastguard Worker      * Pointer to base of SVC slice header structure array
563*495ae853SAndroid Build Coastguard Worker      */
564*495ae853SAndroid Build Coastguard Worker     svc_slice_header_t *ps_svc_slice_hdr_base;
565*495ae853SAndroid Build Coastguard Worker 
566*495ae853SAndroid Build Coastguard Worker     /**
567*495ae853SAndroid Build Coastguard Worker      * entropy status
568*495ae853SAndroid Build Coastguard Worker      */
569*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_entropy_map;
570*495ae853SAndroid Build Coastguard Worker 
571*495ae853SAndroid Build Coastguard Worker     /**
572*495ae853SAndroid Build Coastguard Worker      * MB's x position within a picture in raster scan in MB units
573*495ae853SAndroid Build Coastguard Worker      */
574*495ae853SAndroid Build Coastguard Worker     WORD32 i4_mb_x;
575*495ae853SAndroid Build Coastguard Worker 
576*495ae853SAndroid Build Coastguard Worker     /**
577*495ae853SAndroid Build Coastguard Worker      * MB's y position within a picture in raster scan in MB units
578*495ae853SAndroid Build Coastguard Worker      */
579*495ae853SAndroid Build Coastguard Worker     WORD32 i4_mb_y;
580*495ae853SAndroid Build Coastguard Worker 
581*495ae853SAndroid Build Coastguard Worker     /**
582*495ae853SAndroid Build Coastguard Worker      * MB start address
583*495ae853SAndroid Build Coastguard Worker      */
584*495ae853SAndroid Build Coastguard Worker     WORD32 i4_mb_cnt;
585*495ae853SAndroid Build Coastguard Worker 
586*495ae853SAndroid Build Coastguard Worker     /**
587*495ae853SAndroid Build Coastguard Worker      * MB start address
588*495ae853SAndroid Build Coastguard Worker      */
589*495ae853SAndroid Build Coastguard Worker     WORD32 i4_mb_start_add;
590*495ae853SAndroid Build Coastguard Worker 
591*495ae853SAndroid Build Coastguard Worker     /**
592*495ae853SAndroid Build Coastguard Worker      * MB end address
593*495ae853SAndroid Build Coastguard Worker      */
594*495ae853SAndroid Build Coastguard Worker     WORD32 i4_mb_end_add;
595*495ae853SAndroid Build Coastguard Worker 
596*495ae853SAndroid Build Coastguard Worker     /**
597*495ae853SAndroid Build Coastguard Worker      * Input width in mbs
598*495ae853SAndroid Build Coastguard Worker      */
599*495ae853SAndroid Build Coastguard Worker     WORD32 i4_wd_mbs;
600*495ae853SAndroid Build Coastguard Worker 
601*495ae853SAndroid Build Coastguard Worker     /**
602*495ae853SAndroid Build Coastguard Worker      * Input height in mbs
603*495ae853SAndroid Build Coastguard Worker      */
604*495ae853SAndroid Build Coastguard Worker     WORD32 i4_ht_mbs;
605*495ae853SAndroid Build Coastguard Worker 
606*495ae853SAndroid Build Coastguard Worker     /**
607*495ae853SAndroid Build Coastguard Worker      * Bitstream structure
608*495ae853SAndroid Build Coastguard Worker      */
609*495ae853SAndroid Build Coastguard Worker     bitstrm_t *ps_bitstrm;
610*495ae853SAndroid Build Coastguard Worker 
611*495ae853SAndroid Build Coastguard Worker #if ENABLE_RE_ENC_AS_SKIP
612*495ae853SAndroid Build Coastguard Worker     bitstrm_t *ps_bitstrm_after_slice_hdr;
613*495ae853SAndroid Build Coastguard Worker #endif
614*495ae853SAndroid Build Coastguard Worker 
615*495ae853SAndroid Build Coastguard Worker     /**
616*495ae853SAndroid Build Coastguard Worker      *  transform_8x8_mode_flag
617*495ae853SAndroid Build Coastguard Worker      */
618*495ae853SAndroid Build Coastguard Worker     WORD8 i1_transform_8x8_mode_flag;
619*495ae853SAndroid Build Coastguard Worker 
620*495ae853SAndroid Build Coastguard Worker     /**
621*495ae853SAndroid Build Coastguard Worker      *  entropy_coding_mode_flag
622*495ae853SAndroid Build Coastguard Worker      */
623*495ae853SAndroid Build Coastguard Worker     WORD8 u1_entropy_coding_mode_flag;
624*495ae853SAndroid Build Coastguard Worker 
625*495ae853SAndroid Build Coastguard Worker     /**
626*495ae853SAndroid Build Coastguard Worker      * Pointer to the top row nnz for luma
627*495ae853SAndroid Build Coastguard Worker      */
628*495ae853SAndroid Build Coastguard Worker     UWORD8 (*pu1_top_nnz_luma)[4];
629*495ae853SAndroid Build Coastguard Worker 
630*495ae853SAndroid Build Coastguard Worker     /**
631*495ae853SAndroid Build Coastguard Worker      * left nnz for luma
632*495ae853SAndroid Build Coastguard Worker      */
633*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_left_nnz_luma;
634*495ae853SAndroid Build Coastguard Worker 
635*495ae853SAndroid Build Coastguard Worker     /**
636*495ae853SAndroid Build Coastguard Worker      * Pointer to zero runs before for the mb
637*495ae853SAndroid Build Coastguard Worker      */
638*495ae853SAndroid Build Coastguard Worker     UWORD8 au1_zero_run[16];
639*495ae853SAndroid Build Coastguard Worker 
640*495ae853SAndroid Build Coastguard Worker     /**
641*495ae853SAndroid Build Coastguard Worker      * Pointer to the top row nnz for chroma
642*495ae853SAndroid Build Coastguard Worker      */
643*495ae853SAndroid Build Coastguard Worker     UWORD8 (*pu1_top_nnz_cbcr)[4];
644*495ae853SAndroid Build Coastguard Worker 
645*495ae853SAndroid Build Coastguard Worker     /**
646*495ae853SAndroid Build Coastguard Worker      * left nnz for chroma
647*495ae853SAndroid Build Coastguard Worker      */
648*495ae853SAndroid Build Coastguard Worker     UWORD8 u4_left_nnz_cbcr;
649*495ae853SAndroid Build Coastguard Worker 
650*495ae853SAndroid Build Coastguard Worker     /**
651*495ae853SAndroid Build Coastguard Worker      * Pointer frame level mb subblock coeff data
652*495ae853SAndroid Build Coastguard Worker      */
653*495ae853SAndroid Build Coastguard Worker     void *pv_pic_mb_coeff_data;
654*495ae853SAndroid Build Coastguard Worker 
655*495ae853SAndroid Build Coastguard Worker     /**
656*495ae853SAndroid Build Coastguard Worker      * Pointer to mb subblock coeff data and number of subblocks and scan idx
657*495ae853SAndroid Build Coastguard Worker      * Incremented each time a coded subblock is processed
658*495ae853SAndroid Build Coastguard Worker      */
659*495ae853SAndroid Build Coastguard Worker     void *pv_mb_coeff_data;
660*495ae853SAndroid Build Coastguard Worker 
661*495ae853SAndroid Build Coastguard Worker     /**
662*495ae853SAndroid Build Coastguard Worker      * Pointer frame level mb header data
663*495ae853SAndroid Build Coastguard Worker      */
664*495ae853SAndroid Build Coastguard Worker     void *pv_pic_mb_header_data;
665*495ae853SAndroid Build Coastguard Worker 
666*495ae853SAndroid Build Coastguard Worker     /**
667*495ae853SAndroid Build Coastguard Worker      * Pointer to mb header data and
668*495ae853SAndroid Build Coastguard Worker      * incremented each time a coded mb is encoded
669*495ae853SAndroid Build Coastguard Worker      */
670*495ae853SAndroid Build Coastguard Worker     void *pv_mb_header_data;
671*495ae853SAndroid Build Coastguard Worker 
672*495ae853SAndroid Build Coastguard Worker     /**
673*495ae853SAndroid Build Coastguard Worker      * Error code during parse stage
674*495ae853SAndroid Build Coastguard Worker      */
675*495ae853SAndroid Build Coastguard Worker     IH264E_ERROR_T i4_error_code;
676*495ae853SAndroid Build Coastguard Worker 
677*495ae853SAndroid Build Coastguard Worker     /**
678*495ae853SAndroid Build Coastguard Worker      * Void pointer to job context
679*495ae853SAndroid Build Coastguard Worker      */
680*495ae853SAndroid Build Coastguard Worker     void *pv_proc_jobq, *pv_entropy_jobq;
681*495ae853SAndroid Build Coastguard Worker 
682*495ae853SAndroid Build Coastguard Worker     /**
683*495ae853SAndroid Build Coastguard Worker      * Flag to signal end of frame
684*495ae853SAndroid Build Coastguard Worker      */
685*495ae853SAndroid Build Coastguard Worker     WORD32 i4_end_of_frame;
686*495ae853SAndroid Build Coastguard Worker 
687*495ae853SAndroid Build Coastguard Worker     /**
688*495ae853SAndroid Build Coastguard Worker      * Abs POC count of the frame
689*495ae853SAndroid Build Coastguard Worker      */
690*495ae853SAndroid Build Coastguard Worker     WORD32 i4_abs_pic_order_cnt;
691*495ae853SAndroid Build Coastguard Worker 
692*495ae853SAndroid Build Coastguard Worker     /**
693*495ae853SAndroid Build Coastguard Worker      * mb skip run
694*495ae853SAndroid Build Coastguard Worker      */
695*495ae853SAndroid Build Coastguard Worker     WORD32 *pi4_mb_skip_run;
696*495ae853SAndroid Build Coastguard Worker 
697*495ae853SAndroid Build Coastguard Worker     /**
698*495ae853SAndroid Build Coastguard Worker      * Flag to signal end of sequence
699*495ae853SAndroid Build Coastguard Worker      */
700*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_is_last;
701*495ae853SAndroid Build Coastguard Worker 
702*495ae853SAndroid Build Coastguard Worker     /**
703*495ae853SAndroid Build Coastguard Worker      * Lower 32bits of time-stamp corresponding to the buffer being encoded
704*495ae853SAndroid Build Coastguard Worker      */
705*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_timestamp_low;
706*495ae853SAndroid Build Coastguard Worker 
707*495ae853SAndroid Build Coastguard Worker     /**
708*495ae853SAndroid Build Coastguard Worker      * Upper 32bits of time-stamp corresponding to the buffer being encoded
709*495ae853SAndroid Build Coastguard Worker      */
710*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_timestamp_high;
711*495ae853SAndroid Build Coastguard Worker 
712*495ae853SAndroid Build Coastguard Worker     /**
713*495ae853SAndroid Build Coastguard Worker      * Current Picture count - used for synchronization
714*495ae853SAndroid Build Coastguard Worker      */
715*495ae853SAndroid Build Coastguard Worker     WORD32 i4_pic_cnt;
716*495ae853SAndroid Build Coastguard Worker 
717*495ae853SAndroid Build Coastguard Worker     /**
718*495ae853SAndroid Build Coastguard Worker      * Number of bits consumed by header for I and P mb types
719*495ae853SAndroid Build Coastguard Worker      */
720*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_header_bits[MAX_MB_TYPE];
721*495ae853SAndroid Build Coastguard Worker 
722*495ae853SAndroid Build Coastguard Worker     /**
723*495ae853SAndroid Build Coastguard Worker      * Number of bits consumed by residue for I and P mb types
724*495ae853SAndroid Build Coastguard Worker      */
725*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_residue_bits[MAX_MB_TYPE];
726*495ae853SAndroid Build Coastguard Worker 
727*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_spatial_layer_id;
728*495ae853SAndroid Build Coastguard Worker 
729*495ae853SAndroid Build Coastguard Worker } isvce_entropy_ctxt_t;
730*495ae853SAndroid Build Coastguard Worker 
731*495ae853SAndroid Build Coastguard Worker /**
732*495ae853SAndroid Build Coastguard Worker  ******************************************************************************
733*495ae853SAndroid Build Coastguard Worker  *  @brief      Rate control related variables
734*495ae853SAndroid Build Coastguard Worker  ******************************************************************************
735*495ae853SAndroid Build Coastguard Worker  */
736*495ae853SAndroid Build Coastguard Worker typedef struct isvce_rate_control_ctxt_t
737*495ae853SAndroid Build Coastguard Worker {
738*495ae853SAndroid Build Coastguard Worker     rate_control_api_t *apps_rate_control_api[MAX_NUM_SPATIAL_LAYERS];
739*495ae853SAndroid Build Coastguard Worker 
740*495ae853SAndroid Build Coastguard Worker     void *pps_frame_time;
741*495ae853SAndroid Build Coastguard Worker 
742*495ae853SAndroid Build Coastguard Worker     void *pps_time_stamp;
743*495ae853SAndroid Build Coastguard Worker 
744*495ae853SAndroid Build Coastguard Worker     void *pps_pd_frm_rate;
745*495ae853SAndroid Build Coastguard Worker 
746*495ae853SAndroid Build Coastguard Worker     /**
747*495ae853SAndroid Build Coastguard Worker      * frame rate pull down
748*495ae853SAndroid Build Coastguard Worker      */
749*495ae853SAndroid Build Coastguard Worker     WORD32 pre_encode_skip[MAX_CTXT_SETS];
750*495ae853SAndroid Build Coastguard Worker 
751*495ae853SAndroid Build Coastguard Worker     /**
752*495ae853SAndroid Build Coastguard Worker      * skip frame (cbr)
753*495ae853SAndroid Build Coastguard Worker      */
754*495ae853SAndroid Build Coastguard Worker     WORD32 post_encode_skip[MAX_CTXT_SETS];
755*495ae853SAndroid Build Coastguard Worker 
756*495ae853SAndroid Build Coastguard Worker     /**
757*495ae853SAndroid Build Coastguard Worker      * rate control type
758*495ae853SAndroid Build Coastguard Worker      */
759*495ae853SAndroid Build Coastguard Worker     rc_type_e e_rc_type;
760*495ae853SAndroid Build Coastguard Worker 
761*495ae853SAndroid Build Coastguard Worker     /**
762*495ae853SAndroid Build Coastguard Worker      * pic type
763*495ae853SAndroid Build Coastguard Worker      */
764*495ae853SAndroid Build Coastguard Worker     picture_type_e e_pic_type;
765*495ae853SAndroid Build Coastguard Worker 
766*495ae853SAndroid Build Coastguard Worker     /**
767*495ae853SAndroid Build Coastguard Worker      * rc utils context
768*495ae853SAndroid Build Coastguard Worker      */
769*495ae853SAndroid Build Coastguard Worker     svc_rc_utils_ctxt_t s_rc_utils;
770*495ae853SAndroid Build Coastguard Worker 
771*495ae853SAndroid Build Coastguard Worker     /**
772*495ae853SAndroid Build Coastguard Worker      * intra cnt in previous frame
773*495ae853SAndroid Build Coastguard Worker      */
774*495ae853SAndroid Build Coastguard Worker     WORD32 ai4_num_intra_in_prev_frame[MAX_NUM_SPATIAL_LAYERS];
775*495ae853SAndroid Build Coastguard Worker 
776*495ae853SAndroid Build Coastguard Worker     /**
777*495ae853SAndroid Build Coastguard Worker      * avg activity of prev frame
778*495ae853SAndroid Build Coastguard Worker      */
779*495ae853SAndroid Build Coastguard Worker     WORD32 ai4_avg_activity[MAX_NUM_SPATIAL_LAYERS];
780*495ae853SAndroid Build Coastguard Worker 
781*495ae853SAndroid Build Coastguard Worker } isvce_rate_control_ctxt_t;
782*495ae853SAndroid Build Coastguard Worker 
783*495ae853SAndroid Build Coastguard Worker typedef struct
784*495ae853SAndroid Build Coastguard Worker {
785*495ae853SAndroid Build Coastguard Worker     /**
786*495ae853SAndroid Build Coastguard Worker      * mb type and mode
787*495ae853SAndroid Build Coastguard Worker      */
788*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_mb_type_mode;
789*495ae853SAndroid Build Coastguard Worker 
790*495ae853SAndroid Build Coastguard Worker     /**
791*495ae853SAndroid Build Coastguard Worker      * CBP
792*495ae853SAndroid Build Coastguard Worker      */
793*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_cbp;
794*495ae853SAndroid Build Coastguard Worker 
795*495ae853SAndroid Build Coastguard Worker     /**
796*495ae853SAndroid Build Coastguard Worker      * MB qp delta
797*495ae853SAndroid Build Coastguard Worker      */
798*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_mb_qp;
799*495ae853SAndroid Build Coastguard Worker 
800*495ae853SAndroid Build Coastguard Worker     /**
801*495ae853SAndroid Build Coastguard Worker      * Element to align structure to 2 byte boundary
802*495ae853SAndroid Build Coastguard Worker      */
803*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_pad;
804*495ae853SAndroid Build Coastguard Worker 
805*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_base_mode_flag;
806*495ae853SAndroid Build Coastguard Worker 
807*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_residual_prediction_flag;
808*495ae853SAndroid Build Coastguard Worker 
809*495ae853SAndroid Build Coastguard Worker } isvce_mb_hdr_common_t;
810*495ae853SAndroid Build Coastguard Worker 
811*495ae853SAndroid Build Coastguard Worker /**
812*495ae853SAndroid Build Coastguard Worker ******************************************************************************
813*495ae853SAndroid Build Coastguard Worker *  @brief      macro block info for I4x4 MB
814*495ae853SAndroid Build Coastguard Worker ******************************************************************************
815*495ae853SAndroid Build Coastguard Worker */
816*495ae853SAndroid Build Coastguard Worker typedef struct
817*495ae853SAndroid Build Coastguard Worker {
818*495ae853SAndroid Build Coastguard Worker     /**
819*495ae853SAndroid Build Coastguard Worker      * Common MB header params
820*495ae853SAndroid Build Coastguard Worker      */
821*495ae853SAndroid Build Coastguard Worker     isvce_mb_hdr_common_t common;
822*495ae853SAndroid Build Coastguard Worker 
823*495ae853SAndroid Build Coastguard Worker     /**
824*495ae853SAndroid Build Coastguard Worker      * Sub block modes, 2 modes per byte
825*495ae853SAndroid Build Coastguard Worker      */
826*495ae853SAndroid Build Coastguard Worker     UWORD8 au1_sub_blk_modes[8];
827*495ae853SAndroid Build Coastguard Worker } isvce_mb_hdr_i4x4_t;
828*495ae853SAndroid Build Coastguard Worker 
829*495ae853SAndroid Build Coastguard Worker /**
830*495ae853SAndroid Build Coastguard Worker ******************************************************************************
831*495ae853SAndroid Build Coastguard Worker *  @brief      macro block info for I8x8 MB
832*495ae853SAndroid Build Coastguard Worker ******************************************************************************
833*495ae853SAndroid Build Coastguard Worker */
834*495ae853SAndroid Build Coastguard Worker typedef struct
835*495ae853SAndroid Build Coastguard Worker {
836*495ae853SAndroid Build Coastguard Worker     /**
837*495ae853SAndroid Build Coastguard Worker      * Common MB header params
838*495ae853SAndroid Build Coastguard Worker      */
839*495ae853SAndroid Build Coastguard Worker     isvce_mb_hdr_common_t common;
840*495ae853SAndroid Build Coastguard Worker 
841*495ae853SAndroid Build Coastguard Worker     /**
842*495ae853SAndroid Build Coastguard Worker      * Sub block modes, 2 modes per byte
843*495ae853SAndroid Build Coastguard Worker      */
844*495ae853SAndroid Build Coastguard Worker     UWORD8 au1_sub_blk_modes[2];
845*495ae853SAndroid Build Coastguard Worker } isvce_mb_hdr_i8x8_t;
846*495ae853SAndroid Build Coastguard Worker 
847*495ae853SAndroid Build Coastguard Worker /**
848*495ae853SAndroid Build Coastguard Worker ******************************************************************************
849*495ae853SAndroid Build Coastguard Worker *  @brief      macro block info for I16x16 MB
850*495ae853SAndroid Build Coastguard Worker ******************************************************************************
851*495ae853SAndroid Build Coastguard Worker */
852*495ae853SAndroid Build Coastguard Worker typedef struct
853*495ae853SAndroid Build Coastguard Worker {
854*495ae853SAndroid Build Coastguard Worker     /**
855*495ae853SAndroid Build Coastguard Worker      * Common MB header params
856*495ae853SAndroid Build Coastguard Worker      */
857*495ae853SAndroid Build Coastguard Worker     isvce_mb_hdr_common_t common;
858*495ae853SAndroid Build Coastguard Worker 
859*495ae853SAndroid Build Coastguard Worker } isvce_mb_hdr_i16x16_t;
860*495ae853SAndroid Build Coastguard Worker 
861*495ae853SAndroid Build Coastguard Worker /**
862*495ae853SAndroid Build Coastguard Worker ******************************************************************************
863*495ae853SAndroid Build Coastguard Worker *  @brief      macro block info for P16x16 MB
864*495ae853SAndroid Build Coastguard Worker ******************************************************************************
865*495ae853SAndroid Build Coastguard Worker */
866*495ae853SAndroid Build Coastguard Worker typedef struct
867*495ae853SAndroid Build Coastguard Worker {
868*495ae853SAndroid Build Coastguard Worker     /**
869*495ae853SAndroid Build Coastguard Worker      * Common MB header params
870*495ae853SAndroid Build Coastguard Worker      */
871*495ae853SAndroid Build Coastguard Worker     isvce_mb_hdr_common_t common;
872*495ae853SAndroid Build Coastguard Worker 
873*495ae853SAndroid Build Coastguard Worker     /**
874*495ae853SAndroid Build Coastguard Worker      * MV
875*495ae853SAndroid Build Coastguard Worker      */
876*495ae853SAndroid Build Coastguard Worker     WORD16 ai2_mvd[2];
877*495ae853SAndroid Build Coastguard Worker 
878*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_mvp_idx;
879*495ae853SAndroid Build Coastguard Worker } isvce_mb_hdr_p16x16_t;
880*495ae853SAndroid Build Coastguard Worker 
881*495ae853SAndroid Build Coastguard Worker /**
882*495ae853SAndroid Build Coastguard Worker ******************************************************************************
883*495ae853SAndroid Build Coastguard Worker *  @brief      macro block info for PSKIP MB
884*495ae853SAndroid Build Coastguard Worker ******************************************************************************
885*495ae853SAndroid Build Coastguard Worker */
886*495ae853SAndroid Build Coastguard Worker typedef struct
887*495ae853SAndroid Build Coastguard Worker {
888*495ae853SAndroid Build Coastguard Worker     /**
889*495ae853SAndroid Build Coastguard Worker      * Common MB header params
890*495ae853SAndroid Build Coastguard Worker      */
891*495ae853SAndroid Build Coastguard Worker     isvce_mb_hdr_common_t common;
892*495ae853SAndroid Build Coastguard Worker 
893*495ae853SAndroid Build Coastguard Worker } isvce_mb_hdr_pskip_t;
894*495ae853SAndroid Build Coastguard Worker 
895*495ae853SAndroid Build Coastguard Worker /**
896*495ae853SAndroid Build Coastguard Worker ******************************************************************************
897*495ae853SAndroid Build Coastguard Worker *  @brief      macro block info for B16x16 MB
898*495ae853SAndroid Build Coastguard Worker ******************************************************************************
899*495ae853SAndroid Build Coastguard Worker */
900*495ae853SAndroid Build Coastguard Worker typedef struct
901*495ae853SAndroid Build Coastguard Worker {
902*495ae853SAndroid Build Coastguard Worker     /**
903*495ae853SAndroid Build Coastguard Worker      * Common MB header params
904*495ae853SAndroid Build Coastguard Worker      */
905*495ae853SAndroid Build Coastguard Worker     isvce_mb_hdr_common_t common;
906*495ae853SAndroid Build Coastguard Worker 
907*495ae853SAndroid Build Coastguard Worker     /**
908*495ae853SAndroid Build Coastguard Worker      * MV
909*495ae853SAndroid Build Coastguard Worker      */
910*495ae853SAndroid Build Coastguard Worker     WORD16 ai2_mvd[NUM_PRED_DIRS][2];
911*495ae853SAndroid Build Coastguard Worker 
912*495ae853SAndroid Build Coastguard Worker     UWORD8 au1_mvp_idx[NUM_PRED_DIRS];
913*495ae853SAndroid Build Coastguard Worker } isvce_mb_hdr_b16x16_t;
914*495ae853SAndroid Build Coastguard Worker 
915*495ae853SAndroid Build Coastguard Worker /**
916*495ae853SAndroid Build Coastguard Worker ******************************************************************************
917*495ae853SAndroid Build Coastguard Worker *  @brief      macro block info for BDIRECT MB
918*495ae853SAndroid Build Coastguard Worker ******************************************************************************
919*495ae853SAndroid Build Coastguard Worker */
920*495ae853SAndroid Build Coastguard Worker typedef struct
921*495ae853SAndroid Build Coastguard Worker {
922*495ae853SAndroid Build Coastguard Worker     /**
923*495ae853SAndroid Build Coastguard Worker      * Common MB header params
924*495ae853SAndroid Build Coastguard Worker      */
925*495ae853SAndroid Build Coastguard Worker     isvce_mb_hdr_common_t common;
926*495ae853SAndroid Build Coastguard Worker 
927*495ae853SAndroid Build Coastguard Worker } isvce_mb_hdr_bdirect_t;
928*495ae853SAndroid Build Coastguard Worker 
929*495ae853SAndroid Build Coastguard Worker /**
930*495ae853SAndroid Build Coastguard Worker ******************************************************************************
931*495ae853SAndroid Build Coastguard Worker *  @brief      macro block info for PSKIP MB
932*495ae853SAndroid Build Coastguard Worker ******************************************************************************
933*495ae853SAndroid Build Coastguard Worker */
934*495ae853SAndroid Build Coastguard Worker typedef struct
935*495ae853SAndroid Build Coastguard Worker {
936*495ae853SAndroid Build Coastguard Worker     /**
937*495ae853SAndroid Build Coastguard Worker      * Common MB header params
938*495ae853SAndroid Build Coastguard Worker      */
939*495ae853SAndroid Build Coastguard Worker     isvce_mb_hdr_common_t common;
940*495ae853SAndroid Build Coastguard Worker 
941*495ae853SAndroid Build Coastguard Worker } isvce_mb_hdr_bskip_t;
942*495ae853SAndroid Build Coastguard Worker 
943*495ae853SAndroid Build Coastguard Worker /**
944*495ae853SAndroid Build Coastguard Worker ******************************************************************************
945*495ae853SAndroid Build Coastguard Worker *  @brief      macro block info for IBL MB
946*495ae853SAndroid Build Coastguard Worker ******************************************************************************
947*495ae853SAndroid Build Coastguard Worker */
948*495ae853SAndroid Build Coastguard Worker typedef struct isvce_mb_hdr_base_mode_t
949*495ae853SAndroid Build Coastguard Worker {
950*495ae853SAndroid Build Coastguard Worker     /**
951*495ae853SAndroid Build Coastguard Worker      * Common MB header params
952*495ae853SAndroid Build Coastguard Worker      */
953*495ae853SAndroid Build Coastguard Worker     isvce_mb_hdr_common_t common;
954*495ae853SAndroid Build Coastguard Worker 
955*495ae853SAndroid Build Coastguard Worker } isvce_mb_hdr_base_mode_t;
956*495ae853SAndroid Build Coastguard Worker 
957*495ae853SAndroid Build Coastguard Worker /**
958*495ae853SAndroid Build Coastguard Worker ******************************************************************************
959*495ae853SAndroid Build Coastguard Worker *  @brief      Union of mb_hdr structures for size calculation
960*495ae853SAndroid Build Coastguard Worker *  and to access first few common elements
961*495ae853SAndroid Build Coastguard Worker ******************************************************************************
962*495ae853SAndroid Build Coastguard Worker */
963*495ae853SAndroid Build Coastguard Worker 
964*495ae853SAndroid Build Coastguard Worker typedef union isvce_mb_hdr_t
965*495ae853SAndroid Build Coastguard Worker {
966*495ae853SAndroid Build Coastguard Worker     isvce_mb_hdr_i4x4_t mb_hdr_i4x4;
967*495ae853SAndroid Build Coastguard Worker     isvce_mb_hdr_i8x8_t mb_hdr_i8x8;
968*495ae853SAndroid Build Coastguard Worker     isvce_mb_hdr_i16x16_t mb_hdr_i16x16;
969*495ae853SAndroid Build Coastguard Worker     isvce_mb_hdr_p16x16_t mb_hdr_p16x16;
970*495ae853SAndroid Build Coastguard Worker     isvce_mb_hdr_pskip_t mb_hdr_pskip;
971*495ae853SAndroid Build Coastguard Worker     isvce_mb_hdr_b16x16_t mb_hdr_b16x16;
972*495ae853SAndroid Build Coastguard Worker     isvce_mb_hdr_bdirect_t mb_hdr_bdirect;
973*495ae853SAndroid Build Coastguard Worker     isvce_mb_hdr_bskip_t mb_hdr_bskip;
974*495ae853SAndroid Build Coastguard Worker     isvce_mb_hdr_base_mode_t mb_hdr_base_mode;
975*495ae853SAndroid Build Coastguard Worker } isvce_mb_hdr_t;
976*495ae853SAndroid Build Coastguard Worker 
977*495ae853SAndroid Build Coastguard Worker typedef struct isvce_bs_ctxt_t
978*495ae853SAndroid Build Coastguard Worker {
979*495ae853SAndroid Build Coastguard Worker     /**
980*495ae853SAndroid Build Coastguard Worker      * MB's x position within a picture in raster scan in MB units
981*495ae853SAndroid Build Coastguard Worker      */
982*495ae853SAndroid Build Coastguard Worker     WORD32 i4_mb_x;
983*495ae853SAndroid Build Coastguard Worker 
984*495ae853SAndroid Build Coastguard Worker     /**
985*495ae853SAndroid Build Coastguard Worker      * MB's y position within a picture in raster scan in MB units
986*495ae853SAndroid Build Coastguard Worker      */
987*495ae853SAndroid Build Coastguard Worker     WORD32 i4_mb_y;
988*495ae853SAndroid Build Coastguard Worker 
989*495ae853SAndroid Build Coastguard Worker     /**
990*495ae853SAndroid Build Coastguard Worker      * MB's x position within a Slice in raster scan in MB units
991*495ae853SAndroid Build Coastguard Worker      */
992*495ae853SAndroid Build Coastguard Worker     WORD32 i4_mb_slice_x;
993*495ae853SAndroid Build Coastguard Worker 
994*495ae853SAndroid Build Coastguard Worker     /**
995*495ae853SAndroid Build Coastguard Worker      * MB's y position within a Slice in raster scan in MB units
996*495ae853SAndroid Build Coastguard Worker      */
997*495ae853SAndroid Build Coastguard Worker     WORD32 i4_mb_slice_y;
998*495ae853SAndroid Build Coastguard Worker 
999*495ae853SAndroid Build Coastguard Worker     /**
1000*495ae853SAndroid Build Coastguard Worker      * Vertical strength, Two bits per edge.
1001*495ae853SAndroid Build Coastguard Worker      * Stored in format. BS[15] | BS[14] | .. |BS[0]
1002*495ae853SAndroid Build Coastguard Worker      */
1003*495ae853SAndroid Build Coastguard Worker     UWORD32 *pu4_pic_vert_bs;
1004*495ae853SAndroid Build Coastguard Worker 
1005*495ae853SAndroid Build Coastguard Worker     UWORD32 *pu4_intra_base_vert_bs;
1006*495ae853SAndroid Build Coastguard Worker 
1007*495ae853SAndroid Build Coastguard Worker     /**
1008*495ae853SAndroid Build Coastguard Worker      * Boundary strength, Two bits per edge.
1009*495ae853SAndroid Build Coastguard Worker      * Stored in format. BS[15] | BS[14] | .. |BS[0]
1010*495ae853SAndroid Build Coastguard Worker      */
1011*495ae853SAndroid Build Coastguard Worker     UWORD32 *pu4_pic_horz_bs;
1012*495ae853SAndroid Build Coastguard Worker 
1013*495ae853SAndroid Build Coastguard Worker     UWORD32 *pu4_intra_base_horz_bs;
1014*495ae853SAndroid Build Coastguard Worker 
1015*495ae853SAndroid Build Coastguard Worker     /**
1016*495ae853SAndroid Build Coastguard Worker      *  Qp array stored for each mb
1017*495ae853SAndroid Build Coastguard Worker      */
1018*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_pic_qp;
1019*495ae853SAndroid Build Coastguard Worker 
1020*495ae853SAndroid Build Coastguard Worker } isvce_bs_ctxt_t;
1021*495ae853SAndroid Build Coastguard Worker 
1022*495ae853SAndroid Build Coastguard Worker typedef struct isvce_deblk_ctxt_t
1023*495ae853SAndroid Build Coastguard Worker {
1024*495ae853SAndroid Build Coastguard Worker     /**
1025*495ae853SAndroid Build Coastguard Worker      * MB's x position within a picture in raster scan in MB units
1026*495ae853SAndroid Build Coastguard Worker      */
1027*495ae853SAndroid Build Coastguard Worker     WORD32 i4_mb_x;
1028*495ae853SAndroid Build Coastguard Worker 
1029*495ae853SAndroid Build Coastguard Worker     /**
1030*495ae853SAndroid Build Coastguard Worker      * MB's y position within a picture in raster scan in MB units
1031*495ae853SAndroid Build Coastguard Worker      */
1032*495ae853SAndroid Build Coastguard Worker     WORD32 i4_mb_y;
1033*495ae853SAndroid Build Coastguard Worker 
1034*495ae853SAndroid Build Coastguard Worker     /**
1035*495ae853SAndroid Build Coastguard Worker      * structure that contains BS and QP frame level arrays
1036*495ae853SAndroid Build Coastguard Worker      */
1037*495ae853SAndroid Build Coastguard Worker     isvce_bs_ctxt_t s_bs_ctxt;
1038*495ae853SAndroid Build Coastguard Worker 
1039*495ae853SAndroid Build Coastguard Worker     /*
1040*495ae853SAndroid Build Coastguard Worker      * Recon Buffers
1041*495ae853SAndroid Build Coastguard Worker      */
1042*495ae853SAndroid Build Coastguard Worker     yuv_buf_props_t s_rec_pic_buf_props;
1043*495ae853SAndroid Build Coastguard Worker 
1044*495ae853SAndroid Build Coastguard Worker     /**
1045*495ae853SAndroid Build Coastguard Worker      *  Points to the array of slice indices which is used to identify the slice
1046*495ae853SAndroid Build Coastguard Worker      *  to which each MB in a frame belongs.
1047*495ae853SAndroid Build Coastguard Worker      */
1048*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_slice_idx;
1049*495ae853SAndroid Build Coastguard Worker 
1050*495ae853SAndroid Build Coastguard Worker } isvce_deblk_ctxt_t;
1051*495ae853SAndroid Build Coastguard Worker 
1052*495ae853SAndroid Build Coastguard Worker /**
1053*495ae853SAndroid Build Coastguard Worker **************************************************************************
1054*495ae853SAndroid Build Coastguard Worker *   @brief   isvce_me_ctxt_t
1055*495ae853SAndroid Build Coastguard Worker *
1056*495ae853SAndroid Build Coastguard Worker *   Structure encapsulating the parameters used in the motion estimation
1057*495ae853SAndroid Build Coastguard Worker *   context
1058*495ae853SAndroid Build Coastguard Worker **************************************************************************
1059*495ae853SAndroid Build Coastguard Worker */
1060*495ae853SAndroid Build Coastguard Worker typedef struct isvce_me_ctxt_t
1061*495ae853SAndroid Build Coastguard Worker {
1062*495ae853SAndroid Build Coastguard Worker     /**
1063*495ae853SAndroid Build Coastguard Worker      * Ref pointer to current MB luma for each ref list
1064*495ae853SAndroid Build Coastguard Worker      */
1065*495ae853SAndroid Build Coastguard Worker     UWORD8 *apu1_ref_buf_luma[MAX_NUM_REFLIST];
1066*495ae853SAndroid Build Coastguard Worker 
1067*495ae853SAndroid Build Coastguard Worker     /**
1068*495ae853SAndroid Build Coastguard Worker      * Src pointer to current MB luma
1069*495ae853SAndroid Build Coastguard Worker      */
1070*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_src_buf_luma;
1071*495ae853SAndroid Build Coastguard Worker 
1072*495ae853SAndroid Build Coastguard Worker     /**
1073*495ae853SAndroid Build Coastguard Worker      * source stride
1074*495ae853SAndroid Build Coastguard Worker      * (strides for luma and chroma are the same)
1075*495ae853SAndroid Build Coastguard Worker      */
1076*495ae853SAndroid Build Coastguard Worker     WORD32 i4_src_strd;
1077*495ae853SAndroid Build Coastguard Worker 
1078*495ae853SAndroid Build Coastguard Worker     /**
1079*495ae853SAndroid Build Coastguard Worker      * recon stride
1080*495ae853SAndroid Build Coastguard Worker      * (strides for luma and chroma are the same)
1081*495ae853SAndroid Build Coastguard Worker      */
1082*495ae853SAndroid Build Coastguard Worker     WORD32 ai4_rec_strd[MAX_NUM_REFLIST];
1083*495ae853SAndroid Build Coastguard Worker 
1084*495ae853SAndroid Build Coastguard Worker     /**
1085*495ae853SAndroid Build Coastguard Worker      * Offset for half pel x plane from the pic buf
1086*495ae853SAndroid Build Coastguard Worker      */
1087*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_half_x_offset;
1088*495ae853SAndroid Build Coastguard Worker 
1089*495ae853SAndroid Build Coastguard Worker     /**
1090*495ae853SAndroid Build Coastguard Worker      * Offset for half pel y plane from half x plane
1091*495ae853SAndroid Build Coastguard Worker      */
1092*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_half_y_offset;
1093*495ae853SAndroid Build Coastguard Worker 
1094*495ae853SAndroid Build Coastguard Worker     /**
1095*495ae853SAndroid Build Coastguard Worker      * Offset for half pel xy plane from half y plane
1096*495ae853SAndroid Build Coastguard Worker      */
1097*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_half_xy_offset;
1098*495ae853SAndroid Build Coastguard Worker 
1099*495ae853SAndroid Build Coastguard Worker     /**
1100*495ae853SAndroid Build Coastguard Worker      *  Search range in the X, Y axis in terms of pixels
1101*495ae853SAndroid Build Coastguard Worker      */
1102*495ae853SAndroid Build Coastguard Worker     WORD32 ai2_srch_boundaries[2];
1103*495ae853SAndroid Build Coastguard Worker 
1104*495ae853SAndroid Build Coastguard Worker     /**
1105*495ae853SAndroid Build Coastguard Worker      *  Search range in the north direction in terms of pixels
1106*495ae853SAndroid Build Coastguard Worker      */
1107*495ae853SAndroid Build Coastguard Worker     WORD32 i4_srch_range_n;
1108*495ae853SAndroid Build Coastguard Worker 
1109*495ae853SAndroid Build Coastguard Worker     /**
1110*495ae853SAndroid Build Coastguard Worker      *  Search range in the south direction in terms of pixels
1111*495ae853SAndroid Build Coastguard Worker      */
1112*495ae853SAndroid Build Coastguard Worker     WORD32 i4_srch_range_s;
1113*495ae853SAndroid Build Coastguard Worker 
1114*495ae853SAndroid Build Coastguard Worker     /**
1115*495ae853SAndroid Build Coastguard Worker      *  Search range in the east direction in terms of pixels
1116*495ae853SAndroid Build Coastguard Worker      */
1117*495ae853SAndroid Build Coastguard Worker     WORD32 i4_srch_range_e;
1118*495ae853SAndroid Build Coastguard Worker 
1119*495ae853SAndroid Build Coastguard Worker     /**
1120*495ae853SAndroid Build Coastguard Worker      *  Search range in the west direction in terms of pixels
1121*495ae853SAndroid Build Coastguard Worker      */
1122*495ae853SAndroid Build Coastguard Worker     WORD32 i4_srch_range_w;
1123*495ae853SAndroid Build Coastguard Worker 
1124*495ae853SAndroid Build Coastguard Worker     /**
1125*495ae853SAndroid Build Coastguard Worker      * left mb motion vector
1126*495ae853SAndroid Build Coastguard Worker      */
1127*495ae853SAndroid Build Coastguard Worker     ime_mv_t s_left_mv;
1128*495ae853SAndroid Build Coastguard Worker 
1129*495ae853SAndroid Build Coastguard Worker     /**
1130*495ae853SAndroid Build Coastguard Worker      * top left mb motion vector
1131*495ae853SAndroid Build Coastguard Worker      */
1132*495ae853SAndroid Build Coastguard Worker     ime_mv_t s_top_left_mv;
1133*495ae853SAndroid Build Coastguard Worker 
1134*495ae853SAndroid Build Coastguard Worker     /*
1135*495ae853SAndroid Build Coastguard Worker      * ilp MVs for ME candidates *
1136*495ae853SAndroid Build Coastguard Worker      */
1137*495ae853SAndroid Build Coastguard Worker     ilp_me_cands_t *ps_ilp_me_cands;
1138*495ae853SAndroid Build Coastguard Worker 
1139*495ae853SAndroid Build Coastguard Worker     /**
1140*495ae853SAndroid Build Coastguard Worker      * Number of valid candidates for the Initial search position
1141*495ae853SAndroid Build Coastguard Worker      */
1142*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_num_candidates[MAX_NUM_REFLIST + 1];
1143*495ae853SAndroid Build Coastguard Worker 
1144*495ae853SAndroid Build Coastguard Worker     /**
1145*495ae853SAndroid Build Coastguard Worker      * Motion vector predictors derived from neighboring
1146*495ae853SAndroid Build Coastguard Worker      * blocks for each of the six block partitions
1147*495ae853SAndroid Build Coastguard Worker      */
1148*495ae853SAndroid Build Coastguard Worker     ime_mv_t as_mv_init_search[MAX_NUM_REFLIST + 1][MAX_FPEL_SEARCH_CANDIDATES];
1149*495ae853SAndroid Build Coastguard Worker 
1150*495ae853SAndroid Build Coastguard Worker     /**
1151*495ae853SAndroid Build Coastguard Worker      * mv bits
1152*495ae853SAndroid Build Coastguard Worker      */
1153*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_mv_bits;
1154*495ae853SAndroid Build Coastguard Worker 
1155*495ae853SAndroid Build Coastguard Worker     /**
1156*495ae853SAndroid Build Coastguard Worker      * lambda (lagrange multiplier for cost computation)
1157*495ae853SAndroid Build Coastguard Worker      */
1158*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_lambda_motion;
1159*495ae853SAndroid Build Coastguard Worker 
1160*495ae853SAndroid Build Coastguard Worker     /**
1161*495ae853SAndroid Build Coastguard Worker      * enabled fast sad computation
1162*495ae853SAndroid Build Coastguard Worker      */
1163*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_enable_fast_sad;
1164*495ae853SAndroid Build Coastguard Worker 
1165*495ae853SAndroid Build Coastguard Worker     /*
1166*495ae853SAndroid Build Coastguard Worker      * Enable SKIP block prediction based on SATQD
1167*495ae853SAndroid Build Coastguard Worker      */
1168*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_enable_stat_sad;
1169*495ae853SAndroid Build Coastguard Worker 
1170*495ae853SAndroid Build Coastguard Worker     /*
1171*495ae853SAndroid Build Coastguard Worker      * Minimum distortion to search for
1172*495ae853SAndroid Build Coastguard Worker      * */
1173*495ae853SAndroid Build Coastguard Worker     WORD32 i4_min_sad;
1174*495ae853SAndroid Build Coastguard Worker 
1175*495ae853SAndroid Build Coastguard Worker     /*
1176*495ae853SAndroid Build Coastguard Worker      * Signal that minimum sad has been reached in ME
1177*495ae853SAndroid Build Coastguard Worker      * */
1178*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_min_sad_reached;
1179*495ae853SAndroid Build Coastguard Worker 
1180*495ae853SAndroid Build Coastguard Worker     /**
1181*495ae853SAndroid Build Coastguard Worker      * Flag to enable/disbale half pel motion estimation
1182*495ae853SAndroid Build Coastguard Worker      */
1183*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_enable_hpel;
1184*495ae853SAndroid Build Coastguard Worker 
1185*495ae853SAndroid Build Coastguard Worker     /**
1186*495ae853SAndroid Build Coastguard Worker      * Diamond search Iteration Max Cnt
1187*495ae853SAndroid Build Coastguard Worker      */
1188*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_num_layers;
1189*495ae853SAndroid Build Coastguard Worker 
1190*495ae853SAndroid Build Coastguard Worker     /**
1191*495ae853SAndroid Build Coastguard Worker      * encoder me speed
1192*495ae853SAndroid Build Coastguard Worker      */
1193*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_me_speed_preset;
1194*495ae853SAndroid Build Coastguard Worker 
1195*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_left_is_intra;
1196*495ae853SAndroid Build Coastguard Worker 
1197*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_left_is_skip;
1198*495ae853SAndroid Build Coastguard Worker 
1199*495ae853SAndroid Build Coastguard Worker     /* skip_type can be PREDL0, PREDL1 or  BIPRED */
1200*495ae853SAndroid Build Coastguard Worker     WORD32 i4_skip_type;
1201*495ae853SAndroid Build Coastguard Worker 
1202*495ae853SAndroid Build Coastguard Worker     /* Biasing given for skip prediction */
1203*495ae853SAndroid Build Coastguard Worker     WORD32 i4_skip_bias[2];
1204*495ae853SAndroid Build Coastguard Worker 
1205*495ae853SAndroid Build Coastguard Worker     /**
1206*495ae853SAndroid Build Coastguard Worker      * Structure to store the MB partition info
1207*495ae853SAndroid Build Coastguard Worker      * We need 1(L0)+1(L1)+1(bi)
1208*495ae853SAndroid Build Coastguard Worker      */
1209*495ae853SAndroid Build Coastguard Worker     mb_part_ctxt as_mb_part[MAX_NUM_REFLIST + 1];
1210*495ae853SAndroid Build Coastguard Worker     /*
1211*495ae853SAndroid Build Coastguard Worker      * Threshold to compare the sad with
1212*495ae853SAndroid Build Coastguard Worker      */
1213*495ae853SAndroid Build Coastguard Worker     UWORD16 *pu2_sad_thrsh;
1214*495ae853SAndroid Build Coastguard Worker 
1215*495ae853SAndroid Build Coastguard Worker     /**
1216*495ae853SAndroid Build Coastguard Worker      * fn ptrs for compute sad routines
1217*495ae853SAndroid Build Coastguard Worker      */
1218*495ae853SAndroid Build Coastguard Worker     ime_compute_sad_ft *pf_ime_compute_sad_16x16[2];
1219*495ae853SAndroid Build Coastguard Worker     ime_compute_sad_ft *pf_ime_compute_sad_16x8;
1220*495ae853SAndroid Build Coastguard Worker     ime_compute_sad4_diamond *pf_ime_compute_sad4_diamond;
1221*495ae853SAndroid Build Coastguard Worker     ime_compute_sad3_diamond *pf_ime_compute_sad3_diamond;
1222*495ae853SAndroid Build Coastguard Worker     ime_compute_sad2_diamond *pf_ime_compute_sad2_diamond;
1223*495ae853SAndroid Build Coastguard Worker     ime_sub_pel_compute_sad_16x16_ft *pf_ime_sub_pel_compute_sad_16x16;
1224*495ae853SAndroid Build Coastguard Worker 
1225*495ae853SAndroid Build Coastguard Worker     /*
1226*495ae853SAndroid Build Coastguard Worker      * Function poitners for SATQD
1227*495ae853SAndroid Build Coastguard Worker      */
1228*495ae853SAndroid Build Coastguard Worker     ime_compute_sad_stat *pf_ime_compute_sad_stat_luma_16x16;
1229*495ae853SAndroid Build Coastguard Worker 
1230*495ae853SAndroid Build Coastguard Worker     /**
1231*495ae853SAndroid Build Coastguard Worker      * Qp
1232*495ae853SAndroid Build Coastguard Worker      */
1233*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_mb_qp;
1234*495ae853SAndroid Build Coastguard Worker 
1235*495ae853SAndroid Build Coastguard Worker     /*
1236*495ae853SAndroid Build Coastguard Worker      * Buffers for holding subpel and bipred temp buffers
1237*495ae853SAndroid Build Coastguard Worker      */
1238*495ae853SAndroid Build Coastguard Worker     UWORD8 *apu1_subpel_buffs[SUBPEL_BUFF_CNT];
1239*495ae853SAndroid Build Coastguard Worker 
1240*495ae853SAndroid Build Coastguard Worker     WORD32 u4_subpel_buf_strd;
1241*495ae853SAndroid Build Coastguard Worker 
1242*495ae853SAndroid Build Coastguard Worker     /*
1243*495ae853SAndroid Build Coastguard Worker      * Buffers to store the best halfpel plane*
1244*495ae853SAndroid Build Coastguard Worker      */
1245*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_hpel_buf;
1246*495ae853SAndroid Build Coastguard Worker 
1247*495ae853SAndroid Build Coastguard Worker } isvce_me_ctxt_t;
1248*495ae853SAndroid Build Coastguard Worker 
1249*495ae853SAndroid Build Coastguard Worker typedef struct isvce_mb_info_nmb_t
1250*495ae853SAndroid Build Coastguard Worker {
1251*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_mb_type;
1252*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_min_sad;
1253*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_min_sad_reached;
1254*495ae853SAndroid Build Coastguard Worker     WORD32 i4_mb_cost;
1255*495ae853SAndroid Build Coastguard Worker     WORD32 i4_mb_distortion;
1256*495ae853SAndroid Build Coastguard Worker 
1257*495ae853SAndroid Build Coastguard Worker     isvce_enc_pu_mv_t as_skip_mv[4];
1258*495ae853SAndroid Build Coastguard Worker 
1259*495ae853SAndroid Build Coastguard Worker     isvce_enc_pu_mv_t as_pred_mv[2];
1260*495ae853SAndroid Build Coastguard Worker 
1261*495ae853SAndroid Build Coastguard Worker     block_neighbors_t s_ngbr_avbl;
1262*495ae853SAndroid Build Coastguard Worker 
1263*495ae853SAndroid Build Coastguard Worker     /*
1264*495ae853SAndroid Build Coastguard Worker      * Buffer to hold best subpel buffer in each MB of NMB
1265*495ae853SAndroid Build Coastguard Worker      */
1266*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_best_sub_pel_buf;
1267*495ae853SAndroid Build Coastguard Worker 
1268*495ae853SAndroid Build Coastguard Worker     /*
1269*495ae853SAndroid Build Coastguard Worker      * Stride for subpel buffer
1270*495ae853SAndroid Build Coastguard Worker      */
1271*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_bst_spel_buf_strd;
1272*495ae853SAndroid Build Coastguard Worker 
1273*495ae853SAndroid Build Coastguard Worker } isvce_mb_info_nmb_t;
1274*495ae853SAndroid Build Coastguard Worker 
1275*495ae853SAndroid Build Coastguard Worker typedef struct isvce_process_ctxt_t
1276*495ae853SAndroid Build Coastguard Worker {
1277*495ae853SAndroid Build Coastguard Worker     svc_params_t s_svc_params;
1278*495ae853SAndroid Build Coastguard Worker 
1279*495ae853SAndroid Build Coastguard Worker     /* Resolves circular dependency with svc_ilp_mv_ctxt_t */
1280*495ae853SAndroid Build Coastguard Worker     void *ps_svc_ilp_mv_ctxt;
1281*495ae853SAndroid Build Coastguard Worker 
1282*495ae853SAndroid Build Coastguard Worker     /* Resolves circular dependency with svc_res_pred_ctxt_t */
1283*495ae853SAndroid Build Coastguard Worker     void *ps_res_pred_ctxt;
1284*495ae853SAndroid Build Coastguard Worker 
1285*495ae853SAndroid Build Coastguard Worker     /* Resolves circular dependency with svc_intra_pred_ctxt_t */
1286*495ae853SAndroid Build Coastguard Worker     void *ps_intra_pred_ctxt;
1287*495ae853SAndroid Build Coastguard Worker 
1288*495ae853SAndroid Build Coastguard Worker     /* Resolves circular dependency with svc_sub_pic_rc_ctxt_t */
1289*495ae853SAndroid Build Coastguard Worker     void *ps_sub_pic_rc_ctxt;
1290*495ae853SAndroid Build Coastguard Worker 
1291*495ae853SAndroid Build Coastguard Worker     yuv_buf_props_t *ps_mb_pred_buf;
1292*495ae853SAndroid Build Coastguard Worker 
1293*495ae853SAndroid Build Coastguard Worker     yuv_buf_props_t *ps_mb_res_buf;
1294*495ae853SAndroid Build Coastguard Worker 
1295*495ae853SAndroid Build Coastguard Worker     ilp_mv_t *ps_ilp_mv;
1296*495ae853SAndroid Build Coastguard Worker 
1297*495ae853SAndroid Build Coastguard Worker     /**
1298*495ae853SAndroid Build Coastguard Worker      * entropy context
1299*495ae853SAndroid Build Coastguard Worker      */
1300*495ae853SAndroid Build Coastguard Worker     isvce_entropy_ctxt_t s_entropy;
1301*495ae853SAndroid Build Coastguard Worker 
1302*495ae853SAndroid Build Coastguard Worker     /**
1303*495ae853SAndroid Build Coastguard Worker      * me context
1304*495ae853SAndroid Build Coastguard Worker      */
1305*495ae853SAndroid Build Coastguard Worker     isvce_me_ctxt_t s_me_ctxt;
1306*495ae853SAndroid Build Coastguard Worker 
1307*495ae853SAndroid Build Coastguard Worker     /* Resolves circular dependency with isvce_codec_t */
1308*495ae853SAndroid Build Coastguard Worker     void *ps_codec;
1309*495ae853SAndroid Build Coastguard Worker 
1310*495ae853SAndroid Build Coastguard Worker     /**
1311*495ae853SAndroid Build Coastguard Worker      * N mb process contest
1312*495ae853SAndroid Build Coastguard Worker      */
1313*495ae853SAndroid Build Coastguard Worker     n_mb_process_ctxt_t s_n_mb_ctxt;
1314*495ae853SAndroid Build Coastguard Worker 
1315*495ae853SAndroid Build Coastguard Worker     /*
1316*495ae853SAndroid Build Coastguard Worker      * Src Buffers
1317*495ae853SAndroid Build Coastguard Worker      */
1318*495ae853SAndroid Build Coastguard Worker     yuv_buf_props_t s_src_buf_props;
1319*495ae853SAndroid Build Coastguard Worker 
1320*495ae853SAndroid Build Coastguard Worker     /*
1321*495ae853SAndroid Build Coastguard Worker      * Recon Buffers
1322*495ae853SAndroid Build Coastguard Worker      */
1323*495ae853SAndroid Build Coastguard Worker     yuv_buf_props_t s_rec_buf_props;
1324*495ae853SAndroid Build Coastguard Worker 
1325*495ae853SAndroid Build Coastguard Worker     /*
1326*495ae853SAndroid Build Coastguard Worker      * Reference Frame Buffers
1327*495ae853SAndroid Build Coastguard Worker      */
1328*495ae853SAndroid Build Coastguard Worker     yuv_buf_props_t as_ref_buf_props[MAX_REF_PIC_CNT];
1329*495ae853SAndroid Build Coastguard Worker 
1330*495ae853SAndroid Build Coastguard Worker     /*
1331*495ae853SAndroid Build Coastguard Worker      * Src Buffers
1332*495ae853SAndroid Build Coastguard Worker      */
1333*495ae853SAndroid Build Coastguard Worker     yuv_buf_props_t s_src_pic_buf_props;
1334*495ae853SAndroid Build Coastguard Worker 
1335*495ae853SAndroid Build Coastguard Worker     /*
1336*495ae853SAndroid Build Coastguard Worker      * Recon Buffers
1337*495ae853SAndroid Build Coastguard Worker      */
1338*495ae853SAndroid Build Coastguard Worker     yuv_buf_props_t s_rec_pic_buf_props;
1339*495ae853SAndroid Build Coastguard Worker 
1340*495ae853SAndroid Build Coastguard Worker     /*
1341*495ae853SAndroid Build Coastguard Worker      * Reference Frame Buffers
1342*495ae853SAndroid Build Coastguard Worker      */
1343*495ae853SAndroid Build Coastguard Worker     yuv_buf_props_t as_ref_pic_buf_props[MAX_REF_PIC_CNT];
1344*495ae853SAndroid Build Coastguard Worker 
1345*495ae853SAndroid Build Coastguard Worker     /**
1346*495ae853SAndroid Build Coastguard Worker      * Pointer to ME NMB info
1347*495ae853SAndroid Build Coastguard Worker      */
1348*495ae853SAndroid Build Coastguard Worker     isvce_mb_info_nmb_t *ps_nmb_info;
1349*495ae853SAndroid Build Coastguard Worker 
1350*495ae853SAndroid Build Coastguard Worker     isvce_mb_info_nmb_t *ps_cur_mb;
1351*495ae853SAndroid Build Coastguard Worker 
1352*495ae853SAndroid Build Coastguard Worker     /**
1353*495ae853SAndroid Build Coastguard Worker      * Offset for half pel x plane from the pic buf
1354*495ae853SAndroid Build Coastguard Worker      */
1355*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_half_x_offset;
1356*495ae853SAndroid Build Coastguard Worker 
1357*495ae853SAndroid Build Coastguard Worker     /**
1358*495ae853SAndroid Build Coastguard Worker      * Offset for half pel y plane from half x plane
1359*495ae853SAndroid Build Coastguard Worker      */
1360*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_half_y_offset;
1361*495ae853SAndroid Build Coastguard Worker 
1362*495ae853SAndroid Build Coastguard Worker     /**
1363*495ae853SAndroid Build Coastguard Worker      * Offset for half pel xy plane from half y plane
1364*495ae853SAndroid Build Coastguard Worker      */
1365*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_half_xy_offset;
1366*495ae853SAndroid Build Coastguard Worker 
1367*495ae853SAndroid Build Coastguard Worker     /**
1368*495ae853SAndroid Build Coastguard Worker      * pred buffer pointer (temp buffer 1)
1369*495ae853SAndroid Build Coastguard Worker      */
1370*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_pred_mb;
1371*495ae853SAndroid Build Coastguard Worker 
1372*495ae853SAndroid Build Coastguard Worker     /**
1373*495ae853SAndroid Build Coastguard Worker      * pred buffer pointer (prediction buffer for intra 16x16
1374*495ae853SAndroid Build Coastguard Worker      */
1375*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_pred_mb_intra_16x16;
1376*495ae853SAndroid Build Coastguard Worker 
1377*495ae853SAndroid Build Coastguard Worker     /**
1378*495ae853SAndroid Build Coastguard Worker      * pred buffer pointer (prediction buffer for intra 16x16_plane
1379*495ae853SAndroid Build Coastguard Worker      */
1380*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_pred_mb_intra_16x16_plane;
1381*495ae853SAndroid Build Coastguard Worker 
1382*495ae853SAndroid Build Coastguard Worker     /**
1383*495ae853SAndroid Build Coastguard Worker      * pred buffer pointer (prediction buffer for intra chroma
1384*495ae853SAndroid Build Coastguard Worker      */
1385*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_pred_mb_intra_chroma;
1386*495ae853SAndroid Build Coastguard Worker 
1387*495ae853SAndroid Build Coastguard Worker     /**
1388*495ae853SAndroid Build Coastguard Worker      * pred buffer pointer (prediction buffer for intra chroma plane
1389*495ae853SAndroid Build Coastguard Worker      */
1390*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_pred_mb_intra_chroma_plane;
1391*495ae853SAndroid Build Coastguard Worker 
1392*495ae853SAndroid Build Coastguard Worker     /**
1393*495ae853SAndroid Build Coastguard Worker      * temp. reference buffer ptr for intra 4x4 when rdopt is on
1394*495ae853SAndroid Build Coastguard Worker      */
1395*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_ref_mb_intra_4x4;
1396*495ae853SAndroid Build Coastguard Worker 
1397*495ae853SAndroid Build Coastguard Worker     /**
1398*495ae853SAndroid Build Coastguard Worker      * prediction buffer stride
1399*495ae853SAndroid Build Coastguard Worker      */
1400*495ae853SAndroid Build Coastguard Worker     WORD32 i4_pred_strd;
1401*495ae853SAndroid Build Coastguard Worker 
1402*495ae853SAndroid Build Coastguard Worker     /**
1403*495ae853SAndroid Build Coastguard Worker      * transform buffer pointer (temp buffer 2)
1404*495ae853SAndroid Build Coastguard Worker      */
1405*495ae853SAndroid Build Coastguard Worker     WORD16 *pi2_res_buf;
1406*495ae853SAndroid Build Coastguard Worker 
1407*495ae853SAndroid Build Coastguard Worker     /**
1408*495ae853SAndroid Build Coastguard Worker      * temp. transform buffer ptr for intra 4x4 when rdopt is on
1409*495ae853SAndroid Build Coastguard Worker      */
1410*495ae853SAndroid Build Coastguard Worker     WORD16 *pi2_res_buf_intra_4x4;
1411*495ae853SAndroid Build Coastguard Worker 
1412*495ae853SAndroid Build Coastguard Worker     /**
1413*495ae853SAndroid Build Coastguard Worker      * transform buffer stride
1414*495ae853SAndroid Build Coastguard Worker      */
1415*495ae853SAndroid Build Coastguard Worker     WORD32 i4_res_strd;
1416*495ae853SAndroid Build Coastguard Worker 
1417*495ae853SAndroid Build Coastguard Worker     /**
1418*495ae853SAndroid Build Coastguard Worker      * scratch buffer for inverse transform (temp buffer 3)
1419*495ae853SAndroid Build Coastguard Worker      */
1420*495ae853SAndroid Build Coastguard Worker     void *pv_scratch_buff;
1421*495ae853SAndroid Build Coastguard Worker 
1422*495ae853SAndroid Build Coastguard Worker     /**
1423*495ae853SAndroid Build Coastguard Worker      * frame num
1424*495ae853SAndroid Build Coastguard Worker      */
1425*495ae853SAndroid Build Coastguard Worker     WORD32 i4_frame_num;
1426*495ae853SAndroid Build Coastguard Worker 
1427*495ae853SAndroid Build Coastguard Worker     /**
1428*495ae853SAndroid Build Coastguard Worker      * start address of frame / sub-frame
1429*495ae853SAndroid Build Coastguard Worker      */
1430*495ae853SAndroid Build Coastguard Worker     WORD32 i4_frame_strt_add;
1431*495ae853SAndroid Build Coastguard Worker 
1432*495ae853SAndroid Build Coastguard Worker     /**
1433*495ae853SAndroid Build Coastguard Worker      *  IDR pic
1434*495ae853SAndroid Build Coastguard Worker      */
1435*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_is_idr;
1436*495ae853SAndroid Build Coastguard Worker 
1437*495ae853SAndroid Build Coastguard Worker     /**
1438*495ae853SAndroid Build Coastguard Worker      *  idr_pic_id
1439*495ae853SAndroid Build Coastguard Worker      */
1440*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_idr_pic_id;
1441*495ae853SAndroid Build Coastguard Worker 
1442*495ae853SAndroid Build Coastguard Worker     /**
1443*495ae853SAndroid Build Coastguard Worker      * Input width in mbs
1444*495ae853SAndroid Build Coastguard Worker      */
1445*495ae853SAndroid Build Coastguard Worker     WORD32 i4_wd_mbs;
1446*495ae853SAndroid Build Coastguard Worker 
1447*495ae853SAndroid Build Coastguard Worker     /**
1448*495ae853SAndroid Build Coastguard Worker      * Input height in mbs
1449*495ae853SAndroid Build Coastguard Worker      */
1450*495ae853SAndroid Build Coastguard Worker     WORD32 i4_ht_mbs;
1451*495ae853SAndroid Build Coastguard Worker 
1452*495ae853SAndroid Build Coastguard Worker     /**
1453*495ae853SAndroid Build Coastguard Worker      *  slice_type
1454*495ae853SAndroid Build Coastguard Worker      */
1455*495ae853SAndroid Build Coastguard Worker     WORD32 i4_slice_type;
1456*495ae853SAndroid Build Coastguard Worker 
1457*495ae853SAndroid Build Coastguard Worker     /**
1458*495ae853SAndroid Build Coastguard Worker      * Current slice idx
1459*495ae853SAndroid Build Coastguard Worker      */
1460*495ae853SAndroid Build Coastguard Worker     WORD32 i4_cur_slice_idx;
1461*495ae853SAndroid Build Coastguard Worker 
1462*495ae853SAndroid Build Coastguard Worker     /**
1463*495ae853SAndroid Build Coastguard Worker      * MB's x position within a picture in raster scan in MB units
1464*495ae853SAndroid Build Coastguard Worker      */
1465*495ae853SAndroid Build Coastguard Worker     WORD32 i4_mb_x;
1466*495ae853SAndroid Build Coastguard Worker 
1467*495ae853SAndroid Build Coastguard Worker     /**
1468*495ae853SAndroid Build Coastguard Worker      * MB's y position within a picture in raster scan in MB units
1469*495ae853SAndroid Build Coastguard Worker      */
1470*495ae853SAndroid Build Coastguard Worker     WORD32 i4_mb_y;
1471*495ae853SAndroid Build Coastguard Worker 
1472*495ae853SAndroid Build Coastguard Worker     /**
1473*495ae853SAndroid Build Coastguard Worker      * MB's x position within a Slice in raster scan in MB units
1474*495ae853SAndroid Build Coastguard Worker      */
1475*495ae853SAndroid Build Coastguard Worker     WORD32 i4_mb_slice_x;
1476*495ae853SAndroid Build Coastguard Worker 
1477*495ae853SAndroid Build Coastguard Worker     /**
1478*495ae853SAndroid Build Coastguard Worker      * MB's y position within a Slice in raster scan in MB units
1479*495ae853SAndroid Build Coastguard Worker      */
1480*495ae853SAndroid Build Coastguard Worker     WORD32 i4_mb_slice_y;
1481*495ae853SAndroid Build Coastguard Worker 
1482*495ae853SAndroid Build Coastguard Worker     /**
1483*495ae853SAndroid Build Coastguard Worker      * mb neighbor availability pointer
1484*495ae853SAndroid Build Coastguard Worker      */
1485*495ae853SAndroid Build Coastguard Worker     block_neighbors_t *ps_ngbr_avbl;
1486*495ae853SAndroid Build Coastguard Worker 
1487*495ae853SAndroid Build Coastguard Worker     /**
1488*495ae853SAndroid Build Coastguard Worker      * lambda (lagrange multiplier for cost computation)
1489*495ae853SAndroid Build Coastguard Worker      */
1490*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_lambda;
1491*495ae853SAndroid Build Coastguard Worker 
1492*495ae853SAndroid Build Coastguard Worker     /**
1493*495ae853SAndroid Build Coastguard Worker      * mb distortion
1494*495ae853SAndroid Build Coastguard Worker      */
1495*495ae853SAndroid Build Coastguard Worker     WORD32 i4_mb_distortion;
1496*495ae853SAndroid Build Coastguard Worker 
1497*495ae853SAndroid Build Coastguard Worker     /**
1498*495ae853SAndroid Build Coastguard Worker      * mb cost
1499*495ae853SAndroid Build Coastguard Worker      */
1500*495ae853SAndroid Build Coastguard Worker     WORD32 i4_mb_cost;
1501*495ae853SAndroid Build Coastguard Worker 
1502*495ae853SAndroid Build Coastguard Worker     /********************************************************************/
1503*495ae853SAndroid Build Coastguard Worker     /* i4_ngbr_avbl_mb_16 - ngbr avbl of curr mb                        */
1504*495ae853SAndroid Build Coastguard Worker     /* i4_ngbr_avbl_sb_8 - ngbr avbl of all 8x8 sub blocks of curr mb   */
1505*495ae853SAndroid Build Coastguard Worker     /* i4_ngbr_avbl_sb_4 - ngbr avbl of all 4x4 sub blocks of curr mb   */
1506*495ae853SAndroid Build Coastguard Worker     /* i4_ngbr_avbl_mb_c - chroma ngbr avbl of curr mb                  */
1507*495ae853SAndroid Build Coastguard Worker     /********************************************************************/
1508*495ae853SAndroid Build Coastguard Worker     WORD32 i4_ngbr_avbl_16x16_mb;
1509*495ae853SAndroid Build Coastguard Worker     WORD32 ai4_neighbor_avail_8x8_subblks[4];
1510*495ae853SAndroid Build Coastguard Worker     UWORD8 au1_ngbr_avbl_4x4_subblks[16];
1511*495ae853SAndroid Build Coastguard Worker     WORD32 i4_chroma_neighbor_avail_8x8_mb;
1512*495ae853SAndroid Build Coastguard Worker 
1513*495ae853SAndroid Build Coastguard Worker     /**
1514*495ae853SAndroid Build Coastguard Worker      * array to store the mode of mb sub blocks
1515*495ae853SAndroid Build Coastguard Worker      */
1516*495ae853SAndroid Build Coastguard Worker     UWORD8 au1_intra_luma_mb_4x4_modes[16];
1517*495ae853SAndroid Build Coastguard Worker 
1518*495ae853SAndroid Build Coastguard Worker     /**
1519*495ae853SAndroid Build Coastguard Worker      * array to store the predicted mode of mb sub blks
1520*495ae853SAndroid Build Coastguard Worker      */
1521*495ae853SAndroid Build Coastguard Worker     UWORD8 au1_predicted_intra_luma_mb_4x4_modes[16];
1522*495ae853SAndroid Build Coastguard Worker 
1523*495ae853SAndroid Build Coastguard Worker     /**
1524*495ae853SAndroid Build Coastguard Worker      * macro block intra 16x16 mode
1525*495ae853SAndroid Build Coastguard Worker      */
1526*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_l_i16_mode;
1527*495ae853SAndroid Build Coastguard Worker 
1528*495ae853SAndroid Build Coastguard Worker     /**
1529*495ae853SAndroid Build Coastguard Worker      * array to store the mode of the macro block intra 8x8 4 modes
1530*495ae853SAndroid Build Coastguard Worker      */
1531*495ae853SAndroid Build Coastguard Worker     UWORD8 au1_intra_luma_mb_8x8_modes[4];
1532*495ae853SAndroid Build Coastguard Worker 
1533*495ae853SAndroid Build Coastguard Worker     /**
1534*495ae853SAndroid Build Coastguard Worker      * intra chroma mb mode
1535*495ae853SAndroid Build Coastguard Worker      */
1536*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_c_i8_mode;
1537*495ae853SAndroid Build Coastguard Worker 
1538*495ae853SAndroid Build Coastguard Worker     /********************************************************************/
1539*495ae853SAndroid Build Coastguard Worker     /* array to store pixels from the neighborhood for intra prediction */
1540*495ae853SAndroid Build Coastguard Worker     /* i16 - 16 left pels + 1 top left pel + 16 top pels = 33 pels      */
1541*495ae853SAndroid Build Coastguard Worker     /* i8 - 8 lpels + 1 tlpels + 8 tpels + 8 tr pels = 25 pels          */
1542*495ae853SAndroid Build Coastguard Worker     /* i4 - 4 lpels + 1 tlpels + 4 tpels + 4 tr pels = 13 pels          */
1543*495ae853SAndroid Build Coastguard Worker     /* ic - 8 left pels + 1 top left pel + 8 top pels )*2               */
1544*495ae853SAndroid Build Coastguard Worker     /********************************************************************/
1545*495ae853SAndroid Build Coastguard Worker     UWORD8 au1_ngbr_pels[34];
1546*495ae853SAndroid Build Coastguard Worker 
1547*495ae853SAndroid Build Coastguard Worker     /**
1548*495ae853SAndroid Build Coastguard Worker      * array for 8x8 intra pels filtering (temp buff 4)
1549*495ae853SAndroid Build Coastguard Worker      */
1550*495ae853SAndroid Build Coastguard Worker     UWORD8 au1_neighbor_pels_i8x8_unfiltered[25];
1551*495ae853SAndroid Build Coastguard Worker 
1552*495ae853SAndroid Build Coastguard Worker     /**
1553*495ae853SAndroid Build Coastguard Worker      * Number of sub partitons in the inter pred MB
1554*495ae853SAndroid Build Coastguard Worker      */
1555*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_num_sub_partitions;
1556*495ae853SAndroid Build Coastguard Worker 
1557*495ae853SAndroid Build Coastguard Worker     /**
1558*495ae853SAndroid Build Coastguard Worker      *  Pointer to hold num PUs each MB in a picture
1559*495ae853SAndroid Build Coastguard Worker      */
1560*495ae853SAndroid Build Coastguard Worker     UWORD32 *pu4_mb_pu_cnt;
1561*495ae853SAndroid Build Coastguard Worker 
1562*495ae853SAndroid Build Coastguard Worker     /**
1563*495ae853SAndroid Build Coastguard Worker      * Pointer to the array of structures having motion vectors, size
1564*495ae853SAndroid Build Coastguard Worker      *  and position of sub partitions
1565*495ae853SAndroid Build Coastguard Worker      */
1566*495ae853SAndroid Build Coastguard Worker     isvce_mb_info_t *ps_mb_info;
1567*495ae853SAndroid Build Coastguard Worker 
1568*495ae853SAndroid Build Coastguard Worker     /**
1569*495ae853SAndroid Build Coastguard Worker      * Pointer to the pu of current co-located MB in list 1
1570*495ae853SAndroid Build Coastguard Worker      */
1571*495ae853SAndroid Build Coastguard Worker     isvce_mb_info_t *ps_col_mb;
1572*495ae853SAndroid Build Coastguard Worker 
1573*495ae853SAndroid Build Coastguard Worker     /**
1574*495ae853SAndroid Build Coastguard Worker      * predicted motion vector
1575*495ae853SAndroid Build Coastguard Worker      */
1576*495ae853SAndroid Build Coastguard Worker     isvce_enc_pu_mv_t *ps_skip_mv;
1577*495ae853SAndroid Build Coastguard Worker 
1578*495ae853SAndroid Build Coastguard Worker     /**
1579*495ae853SAndroid Build Coastguard Worker      * predicted motion vector
1580*495ae853SAndroid Build Coastguard Worker      */
1581*495ae853SAndroid Build Coastguard Worker     isvce_enc_pu_mv_t *ps_pred_mv;
1582*495ae853SAndroid Build Coastguard Worker 
1583*495ae853SAndroid Build Coastguard Worker     /**
1584*495ae853SAndroid Build Coastguard Worker      * top row mb syntax information base
1585*495ae853SAndroid Build Coastguard Worker      * In normal working scenarios, for a given context set,
1586*495ae853SAndroid Build Coastguard Worker      * the mb syntax info pointer is identical across all process threads.
1587*495ae853SAndroid Build Coastguard Worker      * But when the hard bound on slices are enabled, in multi core, frame
1588*495ae853SAndroid Build Coastguard Worker      * is partitioned in to sections equal to set number of cores and each
1589*495ae853SAndroid Build Coastguard Worker      * partition is run independently. In this scenario, a ctxt set will alone
1590*495ae853SAndroid Build Coastguard Worker      * appear to run multiple frames at a time. For this to occur, the common
1591*495ae853SAndroid Build Coastguard Worker      * pointers across the proc ctxt should disappear.
1592*495ae853SAndroid Build Coastguard Worker      *
1593*495ae853SAndroid Build Coastguard Worker      * This is done by allocating MAX_PROCESS_THREADS memory and distributing
1594*495ae853SAndroid Build Coastguard Worker      * across individual ctxts when byte bnd per slice is enabled.
1595*495ae853SAndroid Build Coastguard Worker      */
1596*495ae853SAndroid Build Coastguard Worker     svc_nbr_info_t s_nbr_info_base;
1597*495ae853SAndroid Build Coastguard Worker 
1598*495ae853SAndroid Build Coastguard Worker     nbr_info_t s_nbr_info;
1599*495ae853SAndroid Build Coastguard Worker 
1600*495ae853SAndroid Build Coastguard Worker     /**
1601*495ae853SAndroid Build Coastguard Worker      * mb neighbor availability pointer
1602*495ae853SAndroid Build Coastguard Worker      */
1603*495ae853SAndroid Build Coastguard Worker     block_neighbors_t s_ngbr_avbl;
1604*495ae853SAndroid Build Coastguard Worker 
1605*495ae853SAndroid Build Coastguard Worker     /**
1606*495ae853SAndroid Build Coastguard Worker      * coded block pattern
1607*495ae853SAndroid Build Coastguard Worker      */
1608*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_cbp;
1609*495ae853SAndroid Build Coastguard Worker 
1610*495ae853SAndroid Build Coastguard Worker     /**
1611*495ae853SAndroid Build Coastguard Worker      *  number of non zero coeffs
1612*495ae853SAndroid Build Coastguard Worker      */
1613*495ae853SAndroid Build Coastguard Worker     UWORD32 au4_nnz[5];
1614*495ae853SAndroid Build Coastguard Worker 
1615*495ae853SAndroid Build Coastguard Worker     UWORD8 au1_chroma_nnz[2 * (NUM_4x4_IN_8x8 + 1)];
1616*495ae853SAndroid Build Coastguard Worker 
1617*495ae853SAndroid Build Coastguard Worker     /**
1618*495ae853SAndroid Build Coastguard Worker      *  number of non zero coeffs for intra 4x4 when rdopt is on
1619*495ae853SAndroid Build Coastguard Worker      */
1620*495ae853SAndroid Build Coastguard Worker     UWORD32 au4_nnz_intra_4x4[4];
1621*495ae853SAndroid Build Coastguard Worker 
1622*495ae853SAndroid Build Coastguard Worker     /**
1623*495ae853SAndroid Build Coastguard Worker      * frame qp & mb qp
1624*495ae853SAndroid Build Coastguard Worker      */
1625*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_frame_qp;
1626*495ae853SAndroid Build Coastguard Worker 
1627*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_mb_qp;
1628*495ae853SAndroid Build Coastguard Worker 
1629*495ae853SAndroid Build Coastguard Worker     /**
1630*495ae853SAndroid Build Coastguard Worker      * quantization parameters for luma & chroma planes
1631*495ae853SAndroid Build Coastguard Worker      */
1632*495ae853SAndroid Build Coastguard Worker     quant_params_t *ps_qp_params[3];
1633*495ae853SAndroid Build Coastguard Worker 
1634*495ae853SAndroid Build Coastguard Worker     /**
1635*495ae853SAndroid Build Coastguard Worker      * Pointer frame level mb subblock coeff data
1636*495ae853SAndroid Build Coastguard Worker      */
1637*495ae853SAndroid Build Coastguard Worker     void *pv_pic_mb_coeff_data;
1638*495ae853SAndroid Build Coastguard Worker 
1639*495ae853SAndroid Build Coastguard Worker     /**
1640*495ae853SAndroid Build Coastguard Worker      * Pointer to mb subblock coeff data and number of subblocks and scan idx
1641*495ae853SAndroid Build Coastguard Worker      * Incremented each time a coded subblock is processed
1642*495ae853SAndroid Build Coastguard Worker      */
1643*495ae853SAndroid Build Coastguard Worker     void *pv_mb_coeff_data;
1644*495ae853SAndroid Build Coastguard Worker 
1645*495ae853SAndroid Build Coastguard Worker     /**
1646*495ae853SAndroid Build Coastguard Worker      * Pointer frame level mb header data
1647*495ae853SAndroid Build Coastguard Worker      */
1648*495ae853SAndroid Build Coastguard Worker     void *pv_pic_mb_header_data;
1649*495ae853SAndroid Build Coastguard Worker 
1650*495ae853SAndroid Build Coastguard Worker     /**
1651*495ae853SAndroid Build Coastguard Worker      * Pointer to mb header data and
1652*495ae853SAndroid Build Coastguard Worker      * incremented each time a coded mb is encoded
1653*495ae853SAndroid Build Coastguard Worker      */
1654*495ae853SAndroid Build Coastguard Worker     void *pv_mb_header_data;
1655*495ae853SAndroid Build Coastguard Worker 
1656*495ae853SAndroid Build Coastguard Worker     /**
1657*495ae853SAndroid Build Coastguard Worker      * Signal that pic_init is called first time
1658*495ae853SAndroid Build Coastguard Worker      */
1659*495ae853SAndroid Build Coastguard Worker     WORD32 i4_first_pic_init;
1660*495ae853SAndroid Build Coastguard Worker 
1661*495ae853SAndroid Build Coastguard Worker     /**
1662*495ae853SAndroid Build Coastguard Worker      * Current MV Bank's buffer ID
1663*495ae853SAndroid Build Coastguard Worker      */
1664*495ae853SAndroid Build Coastguard Worker     WORD32 i4_cur_mv_bank_buf_id;
1665*495ae853SAndroid Build Coastguard Worker 
1666*495ae853SAndroid Build Coastguard Worker     /**
1667*495ae853SAndroid Build Coastguard Worker      * Void pointer to job context
1668*495ae853SAndroid Build Coastguard Worker      */
1669*495ae853SAndroid Build Coastguard Worker     void *pv_proc_jobq, *pv_entropy_jobq;
1670*495ae853SAndroid Build Coastguard Worker 
1671*495ae853SAndroid Build Coastguard Worker     /**
1672*495ae853SAndroid Build Coastguard Worker      * Number of MBs to be processed in the current Job
1673*495ae853SAndroid Build Coastguard Worker      */
1674*495ae853SAndroid Build Coastguard Worker     WORD32 i4_mb_cnt;
1675*495ae853SAndroid Build Coastguard Worker 
1676*495ae853SAndroid Build Coastguard Worker     /**
1677*495ae853SAndroid Build Coastguard Worker      * ID for the current context - Used for debugging
1678*495ae853SAndroid Build Coastguard Worker      */
1679*495ae853SAndroid Build Coastguard Worker     WORD32 i4_id;
1680*495ae853SAndroid Build Coastguard Worker 
1681*495ae853SAndroid Build Coastguard Worker     /**
1682*495ae853SAndroid Build Coastguard Worker      * Pointer to current picture buffer structure
1683*495ae853SAndroid Build Coastguard Worker      */
1684*495ae853SAndroid Build Coastguard Worker     svc_au_buf_t *ps_cur_pic;
1685*495ae853SAndroid Build Coastguard Worker 
1686*495ae853SAndroid Build Coastguard Worker     /**
1687*495ae853SAndroid Build Coastguard Worker      * Pointer to current picture's mv buffer structure
1688*495ae853SAndroid Build Coastguard Worker      */
1689*495ae853SAndroid Build Coastguard Worker     svc_au_data_t *ps_cur_mv_buf;
1690*495ae853SAndroid Build Coastguard Worker 
1691*495ae853SAndroid Build Coastguard Worker     /**
1692*495ae853SAndroid Build Coastguard Worker      * Flag to indicate if ps_proc was initialized at least once in a frame.
1693*495ae853SAndroid Build Coastguard Worker      * This is needed to handle cases where a core starts to handle format
1694*495ae853SAndroid Build Coastguard Worker      * conversion jobs directly
1695*495ae853SAndroid Build Coastguard Worker      */
1696*495ae853SAndroid Build Coastguard Worker     WORD32 i4_init_done;
1697*495ae853SAndroid Build Coastguard Worker 
1698*495ae853SAndroid Build Coastguard Worker     /**
1699*495ae853SAndroid Build Coastguard Worker      * Process status: one byte per MB
1700*495ae853SAndroid Build Coastguard Worker      */
1701*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_proc_map;
1702*495ae853SAndroid Build Coastguard Worker 
1703*495ae853SAndroid Build Coastguard Worker     /**
1704*495ae853SAndroid Build Coastguard Worker      * Deblk status: one byte per MB
1705*495ae853SAndroid Build Coastguard Worker      */
1706*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_deblk_map;
1707*495ae853SAndroid Build Coastguard Worker 
1708*495ae853SAndroid Build Coastguard Worker     /**
1709*495ae853SAndroid Build Coastguard Worker      * Process status: one byte per MB
1710*495ae853SAndroid Build Coastguard Worker      */
1711*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_me_map;
1712*495ae853SAndroid Build Coastguard Worker 
1713*495ae853SAndroid Build Coastguard Worker     /*
1714*495ae853SAndroid Build Coastguard Worker      * Intra refresh mask.
1715*495ae853SAndroid Build Coastguard Worker      * Indicates if an Mb is coded in intra mode within the current AIR interval
1716*495ae853SAndroid Build Coastguard Worker      * NOTE Refreshes after each AIR period
1717*495ae853SAndroid Build Coastguard Worker      * NOTE The map is shared between process
1718*495ae853SAndroid Build Coastguard Worker      */
1719*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_is_intra_coded;
1720*495ae853SAndroid Build Coastguard Worker 
1721*495ae853SAndroid Build Coastguard Worker     /**
1722*495ae853SAndroid Build Coastguard Worker      * Disable deblock level (0: Enable completely, 3: Disable completely
1723*495ae853SAndroid Build Coastguard Worker      */
1724*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_disable_deblock_level;
1725*495ae853SAndroid Build Coastguard Worker 
1726*495ae853SAndroid Build Coastguard Worker     /**
1727*495ae853SAndroid Build Coastguard Worker      * Pointer to the structure that contains deblock context
1728*495ae853SAndroid Build Coastguard Worker      */
1729*495ae853SAndroid Build Coastguard Worker     isvce_deblk_ctxt_t s_deblk_ctxt;
1730*495ae853SAndroid Build Coastguard Worker 
1731*495ae853SAndroid Build Coastguard Worker     /**
1732*495ae853SAndroid Build Coastguard Worker      * Points to the array of slice indices which is used to identify the
1733*495ae853SAndroid Build Coastguard Worker      * independent slice to which each MB in a frame belongs.
1734*495ae853SAndroid Build Coastguard Worker      */
1735*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_slice_idx;
1736*495ae853SAndroid Build Coastguard Worker 
1737*495ae853SAndroid Build Coastguard Worker     /**
1738*495ae853SAndroid Build Coastguard Worker      * Pointer to base of svc_nalu_ext structure array
1739*495ae853SAndroid Build Coastguard Worker      */
1740*495ae853SAndroid Build Coastguard Worker     svc_nalu_ext_t *ps_svc_nalu_ext_base;
1741*495ae853SAndroid Build Coastguard Worker 
1742*495ae853SAndroid Build Coastguard Worker     /**
1743*495ae853SAndroid Build Coastguard Worker      * Pointer to base of subset sequence parameter set structure array
1744*495ae853SAndroid Build Coastguard Worker      */
1745*495ae853SAndroid Build Coastguard Worker     subset_sps_t *ps_subset_sps_base;
1746*495ae853SAndroid Build Coastguard Worker 
1747*495ae853SAndroid Build Coastguard Worker     /**
1748*495ae853SAndroid Build Coastguard Worker      * Pointer to base of slice header structure array
1749*495ae853SAndroid Build Coastguard Worker      */
1750*495ae853SAndroid Build Coastguard Worker     slice_header_t *ps_slice_hdr_base;
1751*495ae853SAndroid Build Coastguard Worker 
1752*495ae853SAndroid Build Coastguard Worker     /**
1753*495ae853SAndroid Build Coastguard Worker      * Pointer to base of SVC slice header structure array
1754*495ae853SAndroid Build Coastguard Worker      */
1755*495ae853SAndroid Build Coastguard Worker     svc_slice_header_t *ps_svc_slice_hdr_base;
1756*495ae853SAndroid Build Coastguard Worker 
1757*495ae853SAndroid Build Coastguard Worker     /**
1758*495ae853SAndroid Build Coastguard Worker      * Number of mb's to process in one loop
1759*495ae853SAndroid Build Coastguard Worker      */
1760*495ae853SAndroid Build Coastguard Worker     WORD32 i4_nmb_ntrpy;
1761*495ae853SAndroid Build Coastguard Worker 
1762*495ae853SAndroid Build Coastguard Worker     /**
1763*495ae853SAndroid Build Coastguard Worker      * Number of mb's to process in one loop
1764*495ae853SAndroid Build Coastguard Worker      */
1765*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_nmb_me;
1766*495ae853SAndroid Build Coastguard Worker 
1767*495ae853SAndroid Build Coastguard Worker     /**
1768*495ae853SAndroid Build Coastguard Worker      * Structure for current input buffer
1769*495ae853SAndroid Build Coastguard Worker      */
1770*495ae853SAndroid Build Coastguard Worker     isvce_inp_buf_t s_inp_buf;
1771*495ae853SAndroid Build Coastguard Worker 
1772*495ae853SAndroid Build Coastguard Worker     /**
1773*495ae853SAndroid Build Coastguard Worker      * api call cnt
1774*495ae853SAndroid Build Coastguard Worker      */
1775*495ae853SAndroid Build Coastguard Worker     WORD32 i4_encode_api_call_cnt;
1776*495ae853SAndroid Build Coastguard Worker 
1777*495ae853SAndroid Build Coastguard Worker     /**
1778*495ae853SAndroid Build Coastguard Worker      * Current Picture count - used for synchronization
1779*495ae853SAndroid Build Coastguard Worker      */
1780*495ae853SAndroid Build Coastguard Worker     WORD32 i4_pic_cnt;
1781*495ae853SAndroid Build Coastguard Worker 
1782*495ae853SAndroid Build Coastguard Worker     /**
1783*495ae853SAndroid Build Coastguard Worker      * Intermediate buffer for interpred leaf level functions
1784*495ae853SAndroid Build Coastguard Worker      */
1785*495ae853SAndroid Build Coastguard Worker     WORD32 ai16_pred1[HP_BUFF_WD * HP_BUFF_HT];
1786*495ae853SAndroid Build Coastguard Worker 
1787*495ae853SAndroid Build Coastguard Worker     /**
1788*495ae853SAndroid Build Coastguard Worker      * Reference picture for the current picture
1789*495ae853SAndroid Build Coastguard Worker      * TODO: Only 2 reference assumed currently
1790*495ae853SAndroid Build Coastguard Worker      */
1791*495ae853SAndroid Build Coastguard Worker     svc_au_buf_t *aps_ref_pic[MAX_REF_PIC_CNT];
1792*495ae853SAndroid Build Coastguard Worker 
1793*495ae853SAndroid Build Coastguard Worker     /**
1794*495ae853SAndroid Build Coastguard Worker      * Reference MV buff for the current picture
1795*495ae853SAndroid Build Coastguard Worker      */
1796*495ae853SAndroid Build Coastguard Worker     svc_au_data_t *aps_mv_buf[MAX_REF_PIC_CNT];
1797*495ae853SAndroid Build Coastguard Worker 
1798*495ae853SAndroid Build Coastguard Worker     /**
1799*495ae853SAndroid Build Coastguard Worker      * frame info used by RC
1800*495ae853SAndroid Build Coastguard Worker      */
1801*495ae853SAndroid Build Coastguard Worker     frame_info_t s_frame_info;
1802*495ae853SAndroid Build Coastguard Worker 
1803*495ae853SAndroid Build Coastguard Worker     /*
1804*495ae853SAndroid Build Coastguard Worker      * NOTE NOT PERSISTANT INSIDE FUNCTIONS
1805*495ae853SAndroid Build Coastguard Worker      * Min sad for current MB
1806*495ae853SAndroid Build Coastguard Worker      * will be populated initially
1807*495ae853SAndroid Build Coastguard Worker      * Once a sad less than eq to u4_min_sad is reached, the value will be copied
1808*495ae853SAndroid Build Coastguard Worker      * to the cariable
1809*495ae853SAndroid Build Coastguard Worker      */
1810*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_min_sad;
1811*495ae853SAndroid Build Coastguard Worker 
1812*495ae853SAndroid Build Coastguard Worker     /*
1813*495ae853SAndroid Build Coastguard Worker      * indicates weather we have rached minimum sa or not
1814*495ae853SAndroid Build Coastguard Worker      */
1815*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_min_sad_reached;
1816*495ae853SAndroid Build Coastguard Worker 
1817*495ae853SAndroid Build Coastguard Worker     /**
1818*495ae853SAndroid Build Coastguard Worker      * Current error code
1819*495ae853SAndroid Build Coastguard Worker      */
1820*495ae853SAndroid Build Coastguard Worker     WORD32 i4_error_code;
1821*495ae853SAndroid Build Coastguard Worker 
1822*495ae853SAndroid Build Coastguard Worker     /*
1823*495ae853SAndroid Build Coastguard Worker      * Enables or disables computation of recon
1824*495ae853SAndroid Build Coastguard Worker      */
1825*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_compute_recon;
1826*495ae853SAndroid Build Coastguard Worker 
1827*495ae853SAndroid Build Coastguard Worker     /*
1828*495ae853SAndroid Build Coastguard Worker      * Temporary buffers to be used for subpel computation
1829*495ae853SAndroid Build Coastguard Worker      */
1830*495ae853SAndroid Build Coastguard Worker     UWORD8 *apu1_subpel_buffs[SUBPEL_BUFF_CNT];
1831*495ae853SAndroid Build Coastguard Worker 
1832*495ae853SAndroid Build Coastguard Worker     /*
1833*495ae853SAndroid Build Coastguard Worker      * Buffer holding best sub pel values
1834*495ae853SAndroid Build Coastguard Worker      */
1835*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_best_subpel_buf;
1836*495ae853SAndroid Build Coastguard Worker 
1837*495ae853SAndroid Build Coastguard Worker     /*
1838*495ae853SAndroid Build Coastguard Worker      * Stride for buffer holding best sub pel
1839*495ae853SAndroid Build Coastguard Worker      */
1840*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_bst_spel_buf_strd;
1841*495ae853SAndroid Build Coastguard Worker 
1842*495ae853SAndroid Build Coastguard Worker     /*
1843*495ae853SAndroid Build Coastguard Worker      * SVC spatial layer ID
1844*495ae853SAndroid Build Coastguard Worker      */
1845*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_spatial_layer_id;
1846*495ae853SAndroid Build Coastguard Worker } isvce_process_ctxt_t;
1847*495ae853SAndroid Build Coastguard Worker 
1848*495ae853SAndroid Build Coastguard Worker typedef UWORD8 FT_CORE_CODING(isvce_process_ctxt_t *ps_proc);
1849*495ae853SAndroid Build Coastguard Worker 
1850*495ae853SAndroid Build Coastguard Worker typedef WORD32 FT_FIND_SKIP_PARAMS(isvce_process_ctxt_t *, WORD32);
1851*495ae853SAndroid Build Coastguard Worker 
1852*495ae853SAndroid Build Coastguard Worker typedef void FT_ME_ALGORITHM(isvce_process_ctxt_t *);
1853*495ae853SAndroid Build Coastguard Worker 
1854*495ae853SAndroid Build Coastguard Worker typedef struct enc_loop_fxns_t
1855*495ae853SAndroid Build Coastguard Worker {
1856*495ae853SAndroid Build Coastguard Worker     /**
1857*495ae853SAndroid Build Coastguard Worker      * luma core coding function pointer
1858*495ae853SAndroid Build Coastguard Worker      */
1859*495ae853SAndroid Build Coastguard Worker     FT_CORE_CODING *apf_luma_energy_compaction[MAX_MBTYPES];
1860*495ae853SAndroid Build Coastguard Worker 
1861*495ae853SAndroid Build Coastguard Worker     /**
1862*495ae853SAndroid Build Coastguard Worker      * chroma core coding function pointer
1863*495ae853SAndroid Build Coastguard Worker      */
1864*495ae853SAndroid Build Coastguard Worker     FT_CORE_CODING *apf_chroma_energy_compaction[2];
1865*495ae853SAndroid Build Coastguard Worker 
1866*495ae853SAndroid Build Coastguard Worker     /**
1867*495ae853SAndroid Build Coastguard Worker      * forward transform for intra blk of mb type 16x16
1868*495ae853SAndroid Build Coastguard Worker      */
1869*495ae853SAndroid Build Coastguard Worker     FT_LUMA_16X16_RESI_TRANS_DCTRANS_QUANT
1870*495ae853SAndroid Build Coastguard Worker     *pf_resi_trans_dctrans_quant_16x16;
1871*495ae853SAndroid Build Coastguard Worker 
1872*495ae853SAndroid Build Coastguard Worker     /**
1873*495ae853SAndroid Build Coastguard Worker      * inverse transform for intra blk of mb type 16x16
1874*495ae853SAndroid Build Coastguard Worker      */
1875*495ae853SAndroid Build Coastguard Worker     FT_LUMA_16X16_IDCTRANS_IQUANT_ITRANS_RECON
1876*495ae853SAndroid Build Coastguard Worker     *pf_idctrans_iquant_itrans_recon_16x16;
1877*495ae853SAndroid Build Coastguard Worker 
1878*495ae853SAndroid Build Coastguard Worker     /**
1879*495ae853SAndroid Build Coastguard Worker      * forward transform for 4x4 blk luma
1880*495ae853SAndroid Build Coastguard Worker      */
1881*495ae853SAndroid Build Coastguard Worker     FT_RESI_TRANS_QUANT *apf_resi_trans_quant_4x4[NUM_RESI_TRANS_QUANT_VARIANTS];
1882*495ae853SAndroid Build Coastguard Worker 
1883*495ae853SAndroid Build Coastguard Worker     /**
1884*495ae853SAndroid Build Coastguard Worker      * forward transform for 4x4 blk luma
1885*495ae853SAndroid Build Coastguard Worker      */
1886*495ae853SAndroid Build Coastguard Worker     FT_RESI_TRANS_QUANT
1887*495ae853SAndroid Build Coastguard Worker     *apf_resi_trans_quant_chroma_4x4[NUM_RESI_TRANS_QUANT_VARIANTS];
1888*495ae853SAndroid Build Coastguard Worker 
1889*495ae853SAndroid Build Coastguard Worker     /*
1890*495ae853SAndroid Build Coastguard Worker      * hadamard transform and quant for a 4x4 block
1891*495ae853SAndroid Build Coastguard Worker      */
1892*495ae853SAndroid Build Coastguard Worker     FT_HADAMARD_QUANT *pf_hadamard_quant_4x4;
1893*495ae853SAndroid Build Coastguard Worker 
1894*495ae853SAndroid Build Coastguard Worker     /*
1895*495ae853SAndroid Build Coastguard Worker      *  hadamard transform and quant for a 4x4 block
1896*495ae853SAndroid Build Coastguard Worker      */
1897*495ae853SAndroid Build Coastguard Worker     FT_HADAMARD_QUANT *pf_hadamard_quant_2x2_uv;
1898*495ae853SAndroid Build Coastguard Worker 
1899*495ae853SAndroid Build Coastguard Worker     /**
1900*495ae853SAndroid Build Coastguard Worker      * inverse transform for 4x4 blk
1901*495ae853SAndroid Build Coastguard Worker      */
1902*495ae853SAndroid Build Coastguard Worker     FT_IQ_IT_RECON *apf_iquant_itrans_recon_4x4[NUM_IQ_IT_RECON_VARIANTS];
1903*495ae853SAndroid Build Coastguard Worker 
1904*495ae853SAndroid Build Coastguard Worker     /**
1905*495ae853SAndroid Build Coastguard Worker      * inverse transform for chroma 4x4 blk
1906*495ae853SAndroid Build Coastguard Worker      */
1907*495ae853SAndroid Build Coastguard Worker     FT_IQ_IT_RECON *apf_iquant_itrans_recon_chroma_4x4[NUM_IQ_IT_RECON_VARIANTS];
1908*495ae853SAndroid Build Coastguard Worker 
1909*495ae853SAndroid Build Coastguard Worker     /**
1910*495ae853SAndroid Build Coastguard Worker      * inverse transform for 4x4 blk with only single dc coeff
1911*495ae853SAndroid Build Coastguard Worker      */
1912*495ae853SAndroid Build Coastguard Worker     FT_IQ_IT_RECON *apf_iquant_itrans_recon_4x4_dc[NUM_IQ_IT_RECON_VARIANTS];
1913*495ae853SAndroid Build Coastguard Worker 
1914*495ae853SAndroid Build Coastguard Worker     /**
1915*495ae853SAndroid Build Coastguard Worker      * inverse transform for chroma 4x4 blk with only single dc coeff
1916*495ae853SAndroid Build Coastguard Worker      */
1917*495ae853SAndroid Build Coastguard Worker     FT_IQ_IT_RECON
1918*495ae853SAndroid Build Coastguard Worker     *apf_iquant_itrans_recon_chroma_4x4_dc[NUM_IQ_IT_RECON_VARIANTS];
1919*495ae853SAndroid Build Coastguard Worker 
1920*495ae853SAndroid Build Coastguard Worker     /*
1921*495ae853SAndroid Build Coastguard Worker      * Inverse hadamard transform and iquant for a 4x4 block
1922*495ae853SAndroid Build Coastguard Worker      */
1923*495ae853SAndroid Build Coastguard Worker     FT_IHADAMARD_SCALING *pf_ihadamard_scaling_4x4;
1924*495ae853SAndroid Build Coastguard Worker 
1925*495ae853SAndroid Build Coastguard Worker     /*
1926*495ae853SAndroid Build Coastguard Worker      * Inverse hadamard transform and iquant for a 4x4 block
1927*495ae853SAndroid Build Coastguard Worker      */
1928*495ae853SAndroid Build Coastguard Worker     FT_IHADAMARD_SCALING *pf_ihadamard_scaling_2x2_uv;
1929*495ae853SAndroid Build Coastguard Worker 
1930*495ae853SAndroid Build Coastguard Worker     /**
1931*495ae853SAndroid Build Coastguard Worker      * forward transform for 8x8 blk
1932*495ae853SAndroid Build Coastguard Worker      */
1933*495ae853SAndroid Build Coastguard Worker     FT_RESI_TRANS_QUANT *apf_resi_trans_quant_8x8[NUM_RESI_TRANS_QUANT_VARIANTS];
1934*495ae853SAndroid Build Coastguard Worker 
1935*495ae853SAndroid Build Coastguard Worker     /**
1936*495ae853SAndroid Build Coastguard Worker      * inverse transform for 8x8 blk
1937*495ae853SAndroid Build Coastguard Worker      */
1938*495ae853SAndroid Build Coastguard Worker     FT_IQ_IT_RECON *apf_iquant_itrans_recon_8x8[NUM_IQ_IT_RECON_VARIANTS];
1939*495ae853SAndroid Build Coastguard Worker 
1940*495ae853SAndroid Build Coastguard Worker     FT_IQ_IT_RECON *pf_zcbf_iquant_itrans_recon_4x4;
1941*495ae853SAndroid Build Coastguard Worker 
1942*495ae853SAndroid Build Coastguard Worker     FT_IQ_IT_RECON *pf_chroma_zcbf_iquant_itrans_recon_4x4;
1943*495ae853SAndroid Build Coastguard Worker 
1944*495ae853SAndroid Build Coastguard Worker } enc_loop_fxns_t;
1945*495ae853SAndroid Build Coastguard Worker 
1946*495ae853SAndroid Build Coastguard Worker typedef struct inter_pred_fxns_t
1947*495ae853SAndroid Build Coastguard Worker {
1948*495ae853SAndroid Build Coastguard Worker     FT_INTER_PRED_LUMA *pf_inter_pred_luma_copy;
1949*495ae853SAndroid Build Coastguard Worker 
1950*495ae853SAndroid Build Coastguard Worker     FT_INTER_PRED_LUMA *pf_inter_pred_luma_horz;
1951*495ae853SAndroid Build Coastguard Worker 
1952*495ae853SAndroid Build Coastguard Worker     FT_INTER_PRED_LUMA *pf_inter_pred_luma_vert;
1953*495ae853SAndroid Build Coastguard Worker 
1954*495ae853SAndroid Build Coastguard Worker     FT_INTER_PRED_LUMA_BILINEAR *pf_inter_pred_luma_bilinear;
1955*495ae853SAndroid Build Coastguard Worker 
1956*495ae853SAndroid Build Coastguard Worker     FT_INTER_PRED_CHROMA *pf_inter_pred_chroma;
1957*495ae853SAndroid Build Coastguard Worker } inter_pred_fxns_t;
1958*495ae853SAndroid Build Coastguard Worker 
1959*495ae853SAndroid Build Coastguard Worker typedef struct mem_fxns_t
1960*495ae853SAndroid Build Coastguard Worker {
1961*495ae853SAndroid Build Coastguard Worker     FT_MEMCPY *pf_mem_cpy_mul8;
1962*495ae853SAndroid Build Coastguard Worker 
1963*495ae853SAndroid Build Coastguard Worker     FT_MEMSET *pf_mem_set_mul8;
1964*495ae853SAndroid Build Coastguard Worker 
1965*495ae853SAndroid Build Coastguard Worker     FT_COPY_2D *pf_copy_2d;
1966*495ae853SAndroid Build Coastguard Worker 
1967*495ae853SAndroid Build Coastguard Worker     FT_MEMSET_2D *pf_memset_2d;
1968*495ae853SAndroid Build Coastguard Worker 
1969*495ae853SAndroid Build Coastguard Worker     FT_NONZERO_CHECKER *pf_nonzero_checker;
1970*495ae853SAndroid Build Coastguard Worker 
1971*495ae853SAndroid Build Coastguard Worker } mem_fxns_t;
1972*495ae853SAndroid Build Coastguard Worker 
1973*495ae853SAndroid Build Coastguard Worker typedef struct isa_dependent_fxns_t
1974*495ae853SAndroid Build Coastguard Worker {
1975*495ae853SAndroid Build Coastguard Worker     enc_loop_fxns_t s_enc_loop_fxns;
1976*495ae853SAndroid Build Coastguard Worker 
1977*495ae853SAndroid Build Coastguard Worker     inter_pred_fxns_t s_inter_pred_fxns;
1978*495ae853SAndroid Build Coastguard Worker 
1979*495ae853SAndroid Build Coastguard Worker     mem_fxns_t s_mem_fxns;
1980*495ae853SAndroid Build Coastguard Worker } isa_dependent_fxns_t;
1981*495ae853SAndroid Build Coastguard Worker 
1982*495ae853SAndroid Build Coastguard Worker /**
1983*495ae853SAndroid Build Coastguard Worker  * Reference set containing pointers to MV buf and pic buf
1984*495ae853SAndroid Build Coastguard Worker  */
1985*495ae853SAndroid Build Coastguard Worker typedef struct
1986*495ae853SAndroid Build Coastguard Worker {
1987*495ae853SAndroid Build Coastguard Worker     /** Picture count */
1988*495ae853SAndroid Build Coastguard Worker     WORD32 i4_pic_cnt;
1989*495ae853SAndroid Build Coastguard Worker 
1990*495ae853SAndroid Build Coastguard Worker     /** POC */
1991*495ae853SAndroid Build Coastguard Worker     WORD32 i4_poc;
1992*495ae853SAndroid Build Coastguard Worker 
1993*495ae853SAndroid Build Coastguard Worker     /** picture buffer */
1994*495ae853SAndroid Build Coastguard Worker     svc_au_buf_t *ps_pic_buf;
1995*495ae853SAndroid Build Coastguard Worker 
1996*495ae853SAndroid Build Coastguard Worker     /** mv buffer */
1997*495ae853SAndroid Build Coastguard Worker     svc_au_data_t *ps_svc_au_data;
1998*495ae853SAndroid Build Coastguard Worker 
1999*495ae853SAndroid Build Coastguard Worker } isvce_ref_set_t;
2000*495ae853SAndroid Build Coastguard Worker 
2001*495ae853SAndroid Build Coastguard Worker typedef struct isvce_codec_t
2002*495ae853SAndroid Build Coastguard Worker {
2003*495ae853SAndroid Build Coastguard Worker     /**
2004*495ae853SAndroid Build Coastguard Worker      * downscaler context
2005*495ae853SAndroid Build Coastguard Worker      */
2006*495ae853SAndroid Build Coastguard Worker     downscaler_ctxt_t s_scaler;
2007*495ae853SAndroid Build Coastguard Worker 
2008*495ae853SAndroid Build Coastguard Worker     svc_ilp_data_t s_svc_ilp_data;
2009*495ae853SAndroid Build Coastguard Worker 
2010*495ae853SAndroid Build Coastguard Worker     nalu_descriptors_t as_nalu_descriptors[MAX_NUM_SPATIAL_LAYERS];
2011*495ae853SAndroid Build Coastguard Worker 
2012*495ae853SAndroid Build Coastguard Worker     isa_dependent_fxns_t s_isa_dependent_fxns;
2013*495ae853SAndroid Build Coastguard Worker 
2014*495ae853SAndroid Build Coastguard Worker #if ENABLE_MODE_STAT_VISUALISER
2015*495ae853SAndroid Build Coastguard Worker     /* Resolves circular dependency with mode_stat_visualiser_t */
2016*495ae853SAndroid Build Coastguard Worker     void *ps_mode_stat_visualiser;
2017*495ae853SAndroid Build Coastguard Worker #endif
2018*495ae853SAndroid Build Coastguard Worker 
2019*495ae853SAndroid Build Coastguard Worker     /** enable constrained intra prediction */
2020*495ae853SAndroid Build Coastguard Worker     UWORD32 au4_constrained_intra_pred[MAX_NUM_SPATIAL_LAYERS];
2021*495ae853SAndroid Build Coastguard Worker 
2022*495ae853SAndroid Build Coastguard Worker     /**
2023*495ae853SAndroid Build Coastguard Worker      * Id of current pic (input order)
2024*495ae853SAndroid Build Coastguard Worker      */
2025*495ae853SAndroid Build Coastguard Worker     WORD32 i4_poc;
2026*495ae853SAndroid Build Coastguard Worker 
2027*495ae853SAndroid Build Coastguard Worker     /**
2028*495ae853SAndroid Build Coastguard Worker      * Number of encode frame API calls made
2029*495ae853SAndroid Build Coastguard Worker      * This variable must only be used for context selection [Read only]
2030*495ae853SAndroid Build Coastguard Worker      */
2031*495ae853SAndroid Build Coastguard Worker     WORD32 i4_encode_api_call_cnt;
2032*495ae853SAndroid Build Coastguard Worker 
2033*495ae853SAndroid Build Coastguard Worker     /**
2034*495ae853SAndroid Build Coastguard Worker      * Number of pictures encoded
2035*495ae853SAndroid Build Coastguard Worker      */
2036*495ae853SAndroid Build Coastguard Worker     WORD32 i4_pic_cnt;
2037*495ae853SAndroid Build Coastguard Worker 
2038*495ae853SAndroid Build Coastguard Worker     /**
2039*495ae853SAndroid Build Coastguard Worker      * Number of threads created
2040*495ae853SAndroid Build Coastguard Worker      */
2041*495ae853SAndroid Build Coastguard Worker     WORD32 i4_proc_thread_cnt;
2042*495ae853SAndroid Build Coastguard Worker 
2043*495ae853SAndroid Build Coastguard Worker     /**
2044*495ae853SAndroid Build Coastguard Worker      * Mutex used to keep the control calls thread-safe
2045*495ae853SAndroid Build Coastguard Worker      */
2046*495ae853SAndroid Build Coastguard Worker     void *pv_ctl_mutex;
2047*495ae853SAndroid Build Coastguard Worker 
2048*495ae853SAndroid Build Coastguard Worker     /**
2049*495ae853SAndroid Build Coastguard Worker      * Current active config parameters
2050*495ae853SAndroid Build Coastguard Worker      */
2051*495ae853SAndroid Build Coastguard Worker     isvce_cfg_params_t s_cfg;
2052*495ae853SAndroid Build Coastguard Worker 
2053*495ae853SAndroid Build Coastguard Worker     /**
2054*495ae853SAndroid Build Coastguard Worker      * Array containing the config parameter sets
2055*495ae853SAndroid Build Coastguard Worker      */
2056*495ae853SAndroid Build Coastguard Worker     isvce_cfg_params_t as_cfg[MAX_ACTIVE_CONFIG_PARAMS];
2057*495ae853SAndroid Build Coastguard Worker 
2058*495ae853SAndroid Build Coastguard Worker     /**
2059*495ae853SAndroid Build Coastguard Worker      * Color format used by encoder internally
2060*495ae853SAndroid Build Coastguard Worker      */
2061*495ae853SAndroid Build Coastguard Worker     IV_COLOR_FORMAT_T e_codec_color_format;
2062*495ae853SAndroid Build Coastguard Worker 
2063*495ae853SAndroid Build Coastguard Worker     /**
2064*495ae853SAndroid Build Coastguard Worker      * recon stride
2065*495ae853SAndroid Build Coastguard Worker      * (strides for luma and chroma are the same)
2066*495ae853SAndroid Build Coastguard Worker      */
2067*495ae853SAndroid Build Coastguard Worker     WORD32 i4_rec_strd;
2068*495ae853SAndroid Build Coastguard Worker 
2069*495ae853SAndroid Build Coastguard Worker     /**
2070*495ae853SAndroid Build Coastguard Worker      * Flag to enable/disable deblocking of a frame
2071*495ae853SAndroid Build Coastguard Worker      */
2072*495ae853SAndroid Build Coastguard Worker     WORD32 u4_disable_deblock_level;
2073*495ae853SAndroid Build Coastguard Worker 
2074*495ae853SAndroid Build Coastguard Worker     /**
2075*495ae853SAndroid Build Coastguard Worker      * Number of continuous frames where deblocking was disabled
2076*495ae853SAndroid Build Coastguard Worker      */
2077*495ae853SAndroid Build Coastguard Worker     WORD32 u4_disable_deblock_level_cnt;
2078*495ae853SAndroid Build Coastguard Worker 
2079*495ae853SAndroid Build Coastguard Worker     /**
2080*495ae853SAndroid Build Coastguard Worker      * frame type
2081*495ae853SAndroid Build Coastguard Worker      */
2082*495ae853SAndroid Build Coastguard Worker     PIC_TYPE_T pic_type;
2083*495ae853SAndroid Build Coastguard Worker 
2084*495ae853SAndroid Build Coastguard Worker     /**
2085*495ae853SAndroid Build Coastguard Worker      * frame qp
2086*495ae853SAndroid Build Coastguard Worker      */
2087*495ae853SAndroid Build Coastguard Worker     UWORD32 au4_frame_qp[MAX_NUM_SPATIAL_LAYERS];
2088*495ae853SAndroid Build Coastguard Worker 
2089*495ae853SAndroid Build Coastguard Worker     /**
2090*495ae853SAndroid Build Coastguard Worker      * Enable inital QP calculation based on BPP and GPP
2091*495ae853SAndroid Build Coastguard Worker      */
2092*495ae853SAndroid Build Coastguard Worker     UWORD8 u1_enable_init_qp;
2093*495ae853SAndroid Build Coastguard Worker 
2094*495ae853SAndroid Build Coastguard Worker     /**
2095*495ae853SAndroid Build Coastguard Worker      * frame num
2096*495ae853SAndroid Build Coastguard Worker      */
2097*495ae853SAndroid Build Coastguard Worker     WORD32 i4_frame_num;
2098*495ae853SAndroid Build Coastguard Worker 
2099*495ae853SAndroid Build Coastguard Worker     /**
2100*495ae853SAndroid Build Coastguard Worker      *  slice_type
2101*495ae853SAndroid Build Coastguard Worker      */
2102*495ae853SAndroid Build Coastguard Worker     WORD32 i4_slice_type;
2103*495ae853SAndroid Build Coastguard Worker 
2104*495ae853SAndroid Build Coastguard Worker     /*
2105*495ae853SAndroid Build Coastguard Worker      * Force current frame to specific type
2106*495ae853SAndroid Build Coastguard Worker      */
2107*495ae853SAndroid Build Coastguard Worker     IV_PICTURE_CODING_TYPE_T force_curr_frame_type;
2108*495ae853SAndroid Build Coastguard Worker 
2109*495ae853SAndroid Build Coastguard Worker     /**
2110*495ae853SAndroid Build Coastguard Worker      *  IDR pic
2111*495ae853SAndroid Build Coastguard Worker      */
2112*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_is_idr;
2113*495ae853SAndroid Build Coastguard Worker 
2114*495ae853SAndroid Build Coastguard Worker     /**
2115*495ae853SAndroid Build Coastguard Worker      *  idr_pic_id
2116*495ae853SAndroid Build Coastguard Worker      */
2117*495ae853SAndroid Build Coastguard Worker     WORD32 i4_idr_pic_id;
2118*495ae853SAndroid Build Coastguard Worker 
2119*495ae853SAndroid Build Coastguard Worker     /**
2120*495ae853SAndroid Build Coastguard Worker      * Flush mode
2121*495ae853SAndroid Build Coastguard Worker      */
2122*495ae853SAndroid Build Coastguard Worker     WORD32 i4_flush_mode;
2123*495ae853SAndroid Build Coastguard Worker 
2124*495ae853SAndroid Build Coastguard Worker     /**
2125*495ae853SAndroid Build Coastguard Worker      * Encode header mode
2126*495ae853SAndroid Build Coastguard Worker      */
2127*495ae853SAndroid Build Coastguard Worker     WORD32 i4_header_mode;
2128*495ae853SAndroid Build Coastguard Worker 
2129*495ae853SAndroid Build Coastguard Worker     /**
2130*495ae853SAndroid Build Coastguard Worker      * Flag to indicate if header has already
2131*495ae853SAndroid Build Coastguard Worker      * been generated when i4_api_call_cnt 0
2132*495ae853SAndroid Build Coastguard Worker      */
2133*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_header_generated;
2134*495ae853SAndroid Build Coastguard Worker 
2135*495ae853SAndroid Build Coastguard Worker     /**
2136*495ae853SAndroid Build Coastguard Worker      * Encode generate header
2137*495ae853SAndroid Build Coastguard Worker      */
2138*495ae853SAndroid Build Coastguard Worker     WORD32 i4_gen_header;
2139*495ae853SAndroid Build Coastguard Worker 
2140*495ae853SAndroid Build Coastguard Worker     /**
2141*495ae853SAndroid Build Coastguard Worker      * To signal successful completion of init
2142*495ae853SAndroid Build Coastguard Worker      */
2143*495ae853SAndroid Build Coastguard Worker     WORD32 i4_init_done;
2144*495ae853SAndroid Build Coastguard Worker 
2145*495ae853SAndroid Build Coastguard Worker     /**
2146*495ae853SAndroid Build Coastguard Worker      * To signal that at least one picture was decoded
2147*495ae853SAndroid Build Coastguard Worker      */
2148*495ae853SAndroid Build Coastguard Worker     WORD32 i4_first_pic_done;
2149*495ae853SAndroid Build Coastguard Worker 
2150*495ae853SAndroid Build Coastguard Worker     /**
2151*495ae853SAndroid Build Coastguard Worker      * Reset flag - Codec is reset if this flag is set
2152*495ae853SAndroid Build Coastguard Worker      */
2153*495ae853SAndroid Build Coastguard Worker     WORD32 i4_reset_flag;
2154*495ae853SAndroid Build Coastguard Worker 
2155*495ae853SAndroid Build Coastguard Worker     /**
2156*495ae853SAndroid Build Coastguard Worker      * Current error code
2157*495ae853SAndroid Build Coastguard Worker      */
2158*495ae853SAndroid Build Coastguard Worker     WORD32 i4_error_code;
2159*495ae853SAndroid Build Coastguard Worker 
2160*495ae853SAndroid Build Coastguard Worker     /**
2161*495ae853SAndroid Build Coastguard Worker      * threshold residue
2162*495ae853SAndroid Build Coastguard Worker      */
2163*495ae853SAndroid Build Coastguard Worker     WORD32 u4_thres_resi;
2164*495ae853SAndroid Build Coastguard Worker 
2165*495ae853SAndroid Build Coastguard Worker     /**
2166*495ae853SAndroid Build Coastguard Worker      * disable intra inter gating
2167*495ae853SAndroid Build Coastguard Worker      */
2168*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_inter_gate;
2169*495ae853SAndroid Build Coastguard Worker 
2170*495ae853SAndroid Build Coastguard Worker     /**
2171*495ae853SAndroid Build Coastguard Worker      * Holds mem records passed during init.
2172*495ae853SAndroid Build Coastguard Worker      * This will be used to return the mem records during retrieve call
2173*495ae853SAndroid Build Coastguard Worker      */
2174*495ae853SAndroid Build Coastguard Worker     iv_mem_rec_t *ps_mem_rec_backup;
2175*495ae853SAndroid Build Coastguard Worker 
2176*495ae853SAndroid Build Coastguard Worker     /**
2177*495ae853SAndroid Build Coastguard Worker      * Flag to determine if the entropy thread is active
2178*495ae853SAndroid Build Coastguard Worker      */
2179*495ae853SAndroid Build Coastguard Worker     volatile ISVCE_ENTROPY_THREAD_STATES_T ae_entropy_thread_exit_state[MAX_CTXT_SETS];
2180*495ae853SAndroid Build Coastguard Worker 
2181*495ae853SAndroid Build Coastguard Worker     /**
2182*495ae853SAndroid Build Coastguard Worker      * Mutex used to keep the entropy calls thread-safe
2183*495ae853SAndroid Build Coastguard Worker      */
2184*495ae853SAndroid Build Coastguard Worker     void *pv_entropy_mutex;
2185*495ae853SAndroid Build Coastguard Worker 
2186*495ae853SAndroid Build Coastguard Worker     /**
2187*495ae853SAndroid Build Coastguard Worker      * Job queue buffer base
2188*495ae853SAndroid Build Coastguard Worker      */
2189*495ae853SAndroid Build Coastguard Worker     void *pv_proc_jobq_buf, *pv_entropy_jobq_buf;
2190*495ae853SAndroid Build Coastguard Worker 
2191*495ae853SAndroid Build Coastguard Worker     /**
2192*495ae853SAndroid Build Coastguard Worker      * Job Queue mem tab size
2193*495ae853SAndroid Build Coastguard Worker      */
2194*495ae853SAndroid Build Coastguard Worker     WORD32 i4_proc_jobq_buf_size, i4_entropy_jobq_buf_size;
2195*495ae853SAndroid Build Coastguard Worker 
2196*495ae853SAndroid Build Coastguard Worker     /**
2197*495ae853SAndroid Build Coastguard Worker      * Memory for svc_au_data buffer manager
2198*495ae853SAndroid Build Coastguard Worker      */
2199*495ae853SAndroid Build Coastguard Worker     void *pv_svc_au_data_store_mgr_base;
2200*495ae853SAndroid Build Coastguard Worker 
2201*495ae853SAndroid Build Coastguard Worker     /**
2202*495ae853SAndroid Build Coastguard Worker      * svc_au_data buffer manager
2203*495ae853SAndroid Build Coastguard Worker      */
2204*495ae853SAndroid Build Coastguard Worker     void *pv_svc_au_data_store_mgr;
2205*495ae853SAndroid Build Coastguard Worker 
2206*495ae853SAndroid Build Coastguard Worker     /**
2207*495ae853SAndroid Build Coastguard Worker      * Pointer to svc_au_data structure array
2208*495ae853SAndroid Build Coastguard Worker      */
2209*495ae853SAndroid Build Coastguard Worker     svc_au_data_t *ps_svc_au_data;
2210*495ae853SAndroid Build Coastguard Worker 
2211*495ae853SAndroid Build Coastguard Worker     /**
2212*495ae853SAndroid Build Coastguard Worker      * Base address for svc_au_data
2213*495ae853SAndroid Build Coastguard Worker      */
2214*495ae853SAndroid Build Coastguard Worker     svc_au_data_t *ps_svc_au_data_base;
2215*495ae853SAndroid Build Coastguard Worker 
2216*495ae853SAndroid Build Coastguard Worker     /**
2217*495ae853SAndroid Build Coastguard Worker      * svc_au_data size
2218*495ae853SAndroid Build Coastguard Worker      */
2219*495ae853SAndroid Build Coastguard Worker     WORD32 i4_svc_au_data_size;
2220*495ae853SAndroid Build Coastguard Worker 
2221*495ae853SAndroid Build Coastguard Worker     /**
2222*495ae853SAndroid Build Coastguard Worker      * Memory for Picture buffer manager for reference pictures
2223*495ae853SAndroid Build Coastguard Worker      */
2224*495ae853SAndroid Build Coastguard Worker     void *pv_ref_buf_mgr_base;
2225*495ae853SAndroid Build Coastguard Worker 
2226*495ae853SAndroid Build Coastguard Worker     /**
2227*495ae853SAndroid Build Coastguard Worker      * Picture buffer manager for reference pictures
2228*495ae853SAndroid Build Coastguard Worker      */
2229*495ae853SAndroid Build Coastguard Worker     void *pv_ref_buf_mgr;
2230*495ae853SAndroid Build Coastguard Worker 
2231*495ae853SAndroid Build Coastguard Worker     /**
2232*495ae853SAndroid Build Coastguard Worker      * Number of reference buffers added to the buffer manager
2233*495ae853SAndroid Build Coastguard Worker      */
2234*495ae853SAndroid Build Coastguard Worker     WORD32 i4_ref_buf_cnt;
2235*495ae853SAndroid Build Coastguard Worker 
2236*495ae853SAndroid Build Coastguard Worker     /**
2237*495ae853SAndroid Build Coastguard Worker      * Pointer to Pic Buf structure array
2238*495ae853SAndroid Build Coastguard Worker      */
2239*495ae853SAndroid Build Coastguard Worker     svc_au_buf_t *ps_pic_buf;
2240*495ae853SAndroid Build Coastguard Worker 
2241*495ae853SAndroid Build Coastguard Worker     /**
2242*495ae853SAndroid Build Coastguard Worker      * Base address for Picture buffer
2243*495ae853SAndroid Build Coastguard Worker      */
2244*495ae853SAndroid Build Coastguard Worker     svc_au_buf_t *ps_pic_buf_base;
2245*495ae853SAndroid Build Coastguard Worker 
2246*495ae853SAndroid Build Coastguard Worker     /**
2247*495ae853SAndroid Build Coastguard Worker      * Total pic buffer size allocated
2248*495ae853SAndroid Build Coastguard Worker      */
2249*495ae853SAndroid Build Coastguard Worker     WORD32 i4_total_pic_buf_size;
2250*495ae853SAndroid Build Coastguard Worker 
2251*495ae853SAndroid Build Coastguard Worker     /**
2252*495ae853SAndroid Build Coastguard Worker      * Memory for Buffer manager for output buffers
2253*495ae853SAndroid Build Coastguard Worker      */
2254*495ae853SAndroid Build Coastguard Worker     void *pv_out_buf_mgr_base;
2255*495ae853SAndroid Build Coastguard Worker 
2256*495ae853SAndroid Build Coastguard Worker     /**
2257*495ae853SAndroid Build Coastguard Worker      * Buffer manager for output buffers
2258*495ae853SAndroid Build Coastguard Worker      */
2259*495ae853SAndroid Build Coastguard Worker     void *pv_out_buf_mgr;
2260*495ae853SAndroid Build Coastguard Worker 
2261*495ae853SAndroid Build Coastguard Worker     /**
2262*495ae853SAndroid Build Coastguard Worker      * Current output buffer's buffer ID
2263*495ae853SAndroid Build Coastguard Worker      */
2264*495ae853SAndroid Build Coastguard Worker     WORD32 i4_out_buf_id;
2265*495ae853SAndroid Build Coastguard Worker 
2266*495ae853SAndroid Build Coastguard Worker     /**
2267*495ae853SAndroid Build Coastguard Worker      * Number of output buffers added to the buffer manager
2268*495ae853SAndroid Build Coastguard Worker      */
2269*495ae853SAndroid Build Coastguard Worker     WORD32 i4_out_buf_cnt;
2270*495ae853SAndroid Build Coastguard Worker 
2271*495ae853SAndroid Build Coastguard Worker     /**
2272*495ae853SAndroid Build Coastguard Worker      * Memory for Picture buffer manager for input buffers
2273*495ae853SAndroid Build Coastguard Worker      */
2274*495ae853SAndroid Build Coastguard Worker     void *pv_inp_buf_mgr_base;
2275*495ae853SAndroid Build Coastguard Worker 
2276*495ae853SAndroid Build Coastguard Worker     /**
2277*495ae853SAndroid Build Coastguard Worker      * Picture buffer manager for input buffers
2278*495ae853SAndroid Build Coastguard Worker      */
2279*495ae853SAndroid Build Coastguard Worker     void *pv_inp_buf_mgr;
2280*495ae853SAndroid Build Coastguard Worker 
2281*495ae853SAndroid Build Coastguard Worker     /**
2282*495ae853SAndroid Build Coastguard Worker      * Current input buffer's buffer ID
2283*495ae853SAndroid Build Coastguard Worker      */
2284*495ae853SAndroid Build Coastguard Worker     WORD32 i4_inp_buf_id;
2285*495ae853SAndroid Build Coastguard Worker 
2286*495ae853SAndroid Build Coastguard Worker     /**
2287*495ae853SAndroid Build Coastguard Worker      * Number of input buffers added to the buffer manager
2288*495ae853SAndroid Build Coastguard Worker      */
2289*495ae853SAndroid Build Coastguard Worker     WORD32 i4_inp_buf_cnt;
2290*495ae853SAndroid Build Coastguard Worker 
2291*495ae853SAndroid Build Coastguard Worker     /**
2292*495ae853SAndroid Build Coastguard Worker      * Pointer to dpb manager structure
2293*495ae853SAndroid Build Coastguard Worker      */
2294*495ae853SAndroid Build Coastguard Worker     void *pv_dpb_mgr;
2295*495ae853SAndroid Build Coastguard Worker 
2296*495ae853SAndroid Build Coastguard Worker     /**
2297*495ae853SAndroid Build Coastguard Worker      * Pointer to base of Sequence parameter set structure array
2298*495ae853SAndroid Build Coastguard Worker      */
2299*495ae853SAndroid Build Coastguard Worker     sps_t *ps_sps_base;
2300*495ae853SAndroid Build Coastguard Worker 
2301*495ae853SAndroid Build Coastguard Worker     /**
2302*495ae853SAndroid Build Coastguard Worker      * Pointer to base of Picture parameter set structure array
2303*495ae853SAndroid Build Coastguard Worker      */
2304*495ae853SAndroid Build Coastguard Worker     pps_t *ps_pps_base;
2305*495ae853SAndroid Build Coastguard Worker 
2306*495ae853SAndroid Build Coastguard Worker     /**
2307*495ae853SAndroid Build Coastguard Worker      * Pointer to base of svc_nalu_ext structure array
2308*495ae853SAndroid Build Coastguard Worker      */
2309*495ae853SAndroid Build Coastguard Worker     svc_nalu_ext_t *ps_svc_nalu_ext_base;
2310*495ae853SAndroid Build Coastguard Worker 
2311*495ae853SAndroid Build Coastguard Worker     /**
2312*495ae853SAndroid Build Coastguard Worker      * Pointer to base of subset sequence parameter set structure array
2313*495ae853SAndroid Build Coastguard Worker      */
2314*495ae853SAndroid Build Coastguard Worker     subset_sps_t *ps_subset_sps_base;
2315*495ae853SAndroid Build Coastguard Worker 
2316*495ae853SAndroid Build Coastguard Worker     /**
2317*495ae853SAndroid Build Coastguard Worker      * Pointer to base of slice header structure array
2318*495ae853SAndroid Build Coastguard Worker      */
2319*495ae853SAndroid Build Coastguard Worker     slice_header_t *ps_slice_hdr_base;
2320*495ae853SAndroid Build Coastguard Worker 
2321*495ae853SAndroid Build Coastguard Worker     /**
2322*495ae853SAndroid Build Coastguard Worker      * Pointer to base of SVC slice header structure array
2323*495ae853SAndroid Build Coastguard Worker      */
2324*495ae853SAndroid Build Coastguard Worker     svc_slice_header_t *ps_svc_slice_hdr_base;
2325*495ae853SAndroid Build Coastguard Worker 
2326*495ae853SAndroid Build Coastguard Worker     /**
2327*495ae853SAndroid Build Coastguard Worker      * packed residue coeff data size for 1 row of mbs
2328*495ae853SAndroid Build Coastguard Worker      */
2329*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_size_coeff_data;
2330*495ae853SAndroid Build Coastguard Worker 
2331*495ae853SAndroid Build Coastguard Worker     /**
2332*495ae853SAndroid Build Coastguard Worker      * packed header data size for 1 row of mbs
2333*495ae853SAndroid Build Coastguard Worker      */
2334*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_size_header_data;
2335*495ae853SAndroid Build Coastguard Worker 
2336*495ae853SAndroid Build Coastguard Worker     /**
2337*495ae853SAndroid Build Coastguard Worker      * Processing context - One for each processing thread
2338*495ae853SAndroid Build Coastguard Worker      * Create two sets, each set used for alternate frames
2339*495ae853SAndroid Build Coastguard Worker      */
2340*495ae853SAndroid Build Coastguard Worker     isvce_process_ctxt_t as_process[MAX_PROCESS_CTXT];
2341*495ae853SAndroid Build Coastguard Worker 
2342*495ae853SAndroid Build Coastguard Worker     /**
2343*495ae853SAndroid Build Coastguard Worker      * Thread handle for each of the processing threads
2344*495ae853SAndroid Build Coastguard Worker      */
2345*495ae853SAndroid Build Coastguard Worker     void *apv_proc_thread_handle[MAX_PROCESS_THREADS];
2346*495ae853SAndroid Build Coastguard Worker 
2347*495ae853SAndroid Build Coastguard Worker     /**
2348*495ae853SAndroid Build Coastguard Worker      * Thread created flag for each of the processing threads
2349*495ae853SAndroid Build Coastguard Worker      */
2350*495ae853SAndroid Build Coastguard Worker     WORD32 ai4_process_thread_created[MAX_PROCESS_THREADS];
2351*495ae853SAndroid Build Coastguard Worker 
2352*495ae853SAndroid Build Coastguard Worker     /**
2353*495ae853SAndroid Build Coastguard Worker      * Void pointer to process job context
2354*495ae853SAndroid Build Coastguard Worker      */
2355*495ae853SAndroid Build Coastguard Worker     void *pv_proc_jobq, *pv_entropy_jobq;
2356*495ae853SAndroid Build Coastguard Worker 
2357*495ae853SAndroid Build Coastguard Worker     /**
2358*495ae853SAndroid Build Coastguard Worker      * Number of MBs processed together for better instruction cache handling
2359*495ae853SAndroid Build Coastguard Worker      */
2360*495ae853SAndroid Build Coastguard Worker     WORD32 i4_proc_nmb;
2361*495ae853SAndroid Build Coastguard Worker 
2362*495ae853SAndroid Build Coastguard Worker     /**
2363*495ae853SAndroid Build Coastguard Worker      * Previous POC lsb
2364*495ae853SAndroid Build Coastguard Worker      */
2365*495ae853SAndroid Build Coastguard Worker     WORD32 i4_prev_poc_lsb;
2366*495ae853SAndroid Build Coastguard Worker 
2367*495ae853SAndroid Build Coastguard Worker     /**
2368*495ae853SAndroid Build Coastguard Worker      * Previous POC msb
2369*495ae853SAndroid Build Coastguard Worker      */
2370*495ae853SAndroid Build Coastguard Worker     WORD32 i4_prev_poc_msb;
2371*495ae853SAndroid Build Coastguard Worker 
2372*495ae853SAndroid Build Coastguard Worker     /**
2373*495ae853SAndroid Build Coastguard Worker      * Max POC lsb that has arrived till now
2374*495ae853SAndroid Build Coastguard Worker      */
2375*495ae853SAndroid Build Coastguard Worker     WORD32 i4_max_prev_poc_lsb;
2376*495ae853SAndroid Build Coastguard Worker 
2377*495ae853SAndroid Build Coastguard Worker     /**
2378*495ae853SAndroid Build Coastguard Worker      * Context for format conversion
2379*495ae853SAndroid Build Coastguard Worker      */
2380*495ae853SAndroid Build Coastguard Worker     fmt_conv_t s_fmt_conv;
2381*495ae853SAndroid Build Coastguard Worker 
2382*495ae853SAndroid Build Coastguard Worker     /**
2383*495ae853SAndroid Build Coastguard Worker      * Absolute pic order count
2384*495ae853SAndroid Build Coastguard Worker      */
2385*495ae853SAndroid Build Coastguard Worker     WORD32 i4_abs_pic_order_cnt;
2386*495ae853SAndroid Build Coastguard Worker 
2387*495ae853SAndroid Build Coastguard Worker     /**
2388*495ae853SAndroid Build Coastguard Worker      *  Pic order count of lsb
2389*495ae853SAndroid Build Coastguard Worker      */
2390*495ae853SAndroid Build Coastguard Worker     WORD32 i4_pic_order_cnt_lsb;
2391*495ae853SAndroid Build Coastguard Worker 
2392*495ae853SAndroid Build Coastguard Worker     /**
2393*495ae853SAndroid Build Coastguard Worker      * Array giving current picture being processed in each context set
2394*495ae853SAndroid Build Coastguard Worker      */
2395*495ae853SAndroid Build Coastguard Worker     WORD32 ai4_pic_cnt[MAX_CTXT_SETS];
2396*495ae853SAndroid Build Coastguard Worker 
2397*495ae853SAndroid Build Coastguard Worker     /*
2398*495ae853SAndroid Build Coastguard Worker      * Min sad to search for
2399*495ae853SAndroid Build Coastguard Worker      */
2400*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_min_sad;
2401*495ae853SAndroid Build Coastguard Worker 
2402*495ae853SAndroid Build Coastguard Worker     /**
2403*495ae853SAndroid Build Coastguard Worker      * Reference picture set
2404*495ae853SAndroid Build Coastguard Worker      */
2405*495ae853SAndroid Build Coastguard Worker     isvce_ref_set_t as_ref_set[MAX_DPB_SIZE + MAX_CTXT_SETS];
2406*495ae853SAndroid Build Coastguard Worker 
2407*495ae853SAndroid Build Coastguard Worker     /*
2408*495ae853SAndroid Build Coastguard Worker      * Air pic cnt
2409*495ae853SAndroid Build Coastguard Worker      * Contains the number of pictures that have been encoded with air
2410*495ae853SAndroid Build Coastguard Worker      * This value is moudulo air refresh period
2411*495ae853SAndroid Build Coastguard Worker      */
2412*495ae853SAndroid Build Coastguard Worker     WORD32 i4_air_pic_cnt;
2413*495ae853SAndroid Build Coastguard Worker 
2414*495ae853SAndroid Build Coastguard Worker     /*
2415*495ae853SAndroid Build Coastguard Worker      * Intra refresh map
2416*495ae853SAndroid Build Coastguard Worker      * Stores the frames at which intra refresh should occur for a MB
2417*495ae853SAndroid Build Coastguard Worker      */
2418*495ae853SAndroid Build Coastguard Worker     UWORD16 *pu2_intr_rfrsh_map;
2419*495ae853SAndroid Build Coastguard Worker 
2420*495ae853SAndroid Build Coastguard Worker     /*
2421*495ae853SAndroid Build Coastguard Worker      * Indicates if the current frame is used as a reference frame
2422*495ae853SAndroid Build Coastguard Worker      */
2423*495ae853SAndroid Build Coastguard Worker     UWORD32 u4_is_curr_frm_ref;
2424*495ae853SAndroid Build Coastguard Worker 
2425*495ae853SAndroid Build Coastguard Worker     /*
2426*495ae853SAndroid Build Coastguard Worker      * Indicates if there can be non reference frames in the stream
2427*495ae853SAndroid Build Coastguard Worker      */
2428*495ae853SAndroid Build Coastguard Worker     WORD32 i4_non_ref_frames_in_stream;
2429*495ae853SAndroid Build Coastguard Worker 
2430*495ae853SAndroid Build Coastguard Worker     /*
2431*495ae853SAndroid Build Coastguard Worker      * Memory for color space conversion for luma plane
2432*495ae853SAndroid Build Coastguard Worker      */
2433*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_y_csc_buf_base;
2434*495ae853SAndroid Build Coastguard Worker 
2435*495ae853SAndroid Build Coastguard Worker     /*
2436*495ae853SAndroid Build Coastguard Worker      * Memory for color space conversion foe chroma plane
2437*495ae853SAndroid Build Coastguard Worker      */
2438*495ae853SAndroid Build Coastguard Worker     UWORD8 *pu1_uv_csc_buf_base;
2439*495ae853SAndroid Build Coastguard Worker 
2440*495ae853SAndroid Build Coastguard Worker     /**
2441*495ae853SAndroid Build Coastguard Worker      * Function pointers for intra pred leaf level functions luma
2442*495ae853SAndroid Build Coastguard Worker      */
2443*495ae853SAndroid Build Coastguard Worker     pf_intra_pred apf_intra_pred_16_l[MAX_I16x16];
2444*495ae853SAndroid Build Coastguard Worker     pf_intra_pred apf_intra_pred_8_l[MAX_I8x8];
2445*495ae853SAndroid Build Coastguard Worker     pf_intra_pred apf_intra_pred_4_l[MAX_I4x4];
2446*495ae853SAndroid Build Coastguard Worker 
2447*495ae853SAndroid Build Coastguard Worker     /**
2448*495ae853SAndroid Build Coastguard Worker      * Function pointers for intra pred leaf level functions chroma
2449*495ae853SAndroid Build Coastguard Worker      */
2450*495ae853SAndroid Build Coastguard Worker     pf_intra_pred apf_intra_pred_c[MAX_CH_I8x8];
2451*495ae853SAndroid Build Coastguard Worker 
2452*495ae853SAndroid Build Coastguard Worker     /**
2453*495ae853SAndroid Build Coastguard Worker      * deblock vertical luma edge with blocking strength 4
2454*495ae853SAndroid Build Coastguard Worker      */
2455*495ae853SAndroid Build Coastguard Worker     ih264_deblk_edge_bs4_ft *pf_deblk_luma_vert_bs4;
2456*495ae853SAndroid Build Coastguard Worker 
2457*495ae853SAndroid Build Coastguard Worker     /**
2458*495ae853SAndroid Build Coastguard Worker      * deblock vertical chroma edge with blocking strength 4
2459*495ae853SAndroid Build Coastguard Worker      */
2460*495ae853SAndroid Build Coastguard Worker     ih264_deblk_chroma_edge_bs4_ft *pf_deblk_chroma_vert_bs4;
2461*495ae853SAndroid Build Coastguard Worker 
2462*495ae853SAndroid Build Coastguard Worker     /**
2463*495ae853SAndroid Build Coastguard Worker      * deblock vertical luma edge with blocking strength less than 4
2464*495ae853SAndroid Build Coastguard Worker      */
2465*495ae853SAndroid Build Coastguard Worker     ih264_deblk_edge_bslt4_ft *pf_deblk_luma_vert_bslt4;
2466*495ae853SAndroid Build Coastguard Worker 
2467*495ae853SAndroid Build Coastguard Worker     /**
2468*495ae853SAndroid Build Coastguard Worker      * deblock vertical chroma edge with blocking strength less than 4
2469*495ae853SAndroid Build Coastguard Worker      */
2470*495ae853SAndroid Build Coastguard Worker     ih264_deblk_chroma_edge_bslt4_ft *pf_deblk_chroma_vert_bslt4;
2471*495ae853SAndroid Build Coastguard Worker 
2472*495ae853SAndroid Build Coastguard Worker     /**
2473*495ae853SAndroid Build Coastguard Worker      * deblock horizontal luma edge with blocking strength 4
2474*495ae853SAndroid Build Coastguard Worker      */
2475*495ae853SAndroid Build Coastguard Worker     ih264_deblk_edge_bs4_ft *pf_deblk_luma_horz_bs4;
2476*495ae853SAndroid Build Coastguard Worker 
2477*495ae853SAndroid Build Coastguard Worker     /**
2478*495ae853SAndroid Build Coastguard Worker      * deblock horizontal chroma edge with blocking strength 4
2479*495ae853SAndroid Build Coastguard Worker      */
2480*495ae853SAndroid Build Coastguard Worker     ih264_deblk_chroma_edge_bs4_ft *pf_deblk_chroma_horz_bs4;
2481*495ae853SAndroid Build Coastguard Worker 
2482*495ae853SAndroid Build Coastguard Worker     /**
2483*495ae853SAndroid Build Coastguard Worker      * deblock horizontal luma edge with blocking strength less than 4
2484*495ae853SAndroid Build Coastguard Worker      */
2485*495ae853SAndroid Build Coastguard Worker     ih264_deblk_edge_bslt4_ft *pf_deblk_luma_horz_bslt4;
2486*495ae853SAndroid Build Coastguard Worker 
2487*495ae853SAndroid Build Coastguard Worker     /**
2488*495ae853SAndroid Build Coastguard Worker      * deblock horizontal chroma edge with blocking strength less than 4
2489*495ae853SAndroid Build Coastguard Worker      */
2490*495ae853SAndroid Build Coastguard Worker     ih264_deblk_chroma_edge_bslt4_ft *pf_deblk_chroma_horz_bslt4;
2491*495ae853SAndroid Build Coastguard Worker 
2492*495ae853SAndroid Build Coastguard Worker     /**
2493*495ae853SAndroid Build Coastguard Worker      * functions for padding
2494*495ae853SAndroid Build Coastguard Worker      */
2495*495ae853SAndroid Build Coastguard Worker     pf_pad pf_pad_top;
2496*495ae853SAndroid Build Coastguard Worker     pf_pad pf_pad_bottom;
2497*495ae853SAndroid Build Coastguard Worker     pf_pad pf_pad_left_luma;
2498*495ae853SAndroid Build Coastguard Worker     pf_pad pf_pad_left_chroma;
2499*495ae853SAndroid Build Coastguard Worker     pf_pad pf_pad_right_luma;
2500*495ae853SAndroid Build Coastguard Worker     pf_pad pf_pad_right_chroma;
2501*495ae853SAndroid Build Coastguard Worker 
2502*495ae853SAndroid Build Coastguard Worker     /**
2503*495ae853SAndroid Build Coastguard Worker      * fn ptrs for compute sad routines
2504*495ae853SAndroid Build Coastguard Worker      */
2505*495ae853SAndroid Build Coastguard Worker     ime_compute_sad_ft *apf_compute_sad_16x16[2];
2506*495ae853SAndroid Build Coastguard Worker     ime_compute_sad_ft *pf_compute_sad_16x8;
2507*495ae853SAndroid Build Coastguard Worker 
2508*495ae853SAndroid Build Coastguard Worker     /**
2509*495ae853SAndroid Build Coastguard Worker      * Function pointer for computing ME
2510*495ae853SAndroid Build Coastguard Worker      * 1 for PSLICE and 1 for BSLICE
2511*495ae853SAndroid Build Coastguard Worker      */
2512*495ae853SAndroid Build Coastguard Worker     FT_ME_ALGORITHM *apf_compute_me[2];
2513*495ae853SAndroid Build Coastguard Worker 
2514*495ae853SAndroid Build Coastguard Worker     /**
2515*495ae853SAndroid Build Coastguard Worker      * Function pointers for computing SKIP parameters
2516*495ae853SAndroid Build Coastguard Worker      */
2517*495ae853SAndroid Build Coastguard Worker     FT_FIND_SKIP_PARAMS *apf_find_skip_params_me[2];
2518*495ae853SAndroid Build Coastguard Worker 
2519*495ae853SAndroid Build Coastguard Worker     /**
2520*495ae853SAndroid Build Coastguard Worker      * intra mode eval -encoder level function
2521*495ae853SAndroid Build Coastguard Worker      */
2522*495ae853SAndroid Build Coastguard Worker     pf_evaluate_intra_modes pf_ih264e_evaluate_intra16x16_modes;
2523*495ae853SAndroid Build Coastguard Worker     pf_evaluate_intra_modes pf_ih264e_evaluate_intra_chroma_modes;
2524*495ae853SAndroid Build Coastguard Worker     pf_evaluate_intra_4x4_modes pf_ih264e_evaluate_intra_4x4_modes;
2525*495ae853SAndroid Build Coastguard Worker 
2526*495ae853SAndroid Build Coastguard Worker     /* Half pel generation function - encoder level
2527*495ae853SAndroid Build Coastguard Worker      *
2528*495ae853SAndroid Build Coastguard Worker      */
2529*495ae853SAndroid Build Coastguard Worker     pf_sixtapfilter_horz pf_ih264e_sixtapfilter_horz;
2530*495ae853SAndroid Build Coastguard Worker     pf_sixtap_filter_2dvh_vert pf_ih264e_sixtap_filter_2dvh_vert;
2531*495ae853SAndroid Build Coastguard Worker 
2532*495ae853SAndroid Build Coastguard Worker     /**
2533*495ae853SAndroid Build Coastguard Worker      * color space conversion from YUV 420P to YUV 420Sp
2534*495ae853SAndroid Build Coastguard Worker      */
2535*495ae853SAndroid Build Coastguard Worker     pf_fmt_conv_420p_to_420sp pf_ih264e_conv_420p_to_420sp;
2536*495ae853SAndroid Build Coastguard Worker 
2537*495ae853SAndroid Build Coastguard Worker     /**
2538*495ae853SAndroid Build Coastguard Worker      * color space conversion from YUV 420P to YUV 420Sp
2539*495ae853SAndroid Build Coastguard Worker      */
2540*495ae853SAndroid Build Coastguard Worker     pf_fmt_conv_422ile_to_420sp pf_ih264e_fmt_conv_422i_to_420sp;
2541*495ae853SAndroid Build Coastguard Worker 
2542*495ae853SAndroid Build Coastguard Worker     /**
2543*495ae853SAndroid Build Coastguard Worker      * write mb layer for a given slice I, P, B
2544*495ae853SAndroid Build Coastguard Worker      */
2545*495ae853SAndroid Build Coastguard Worker     IH264E_ERROR_T (*pf_write_mb_syntax_layer[2][3])(isvce_entropy_ctxt_t *ps_ent_ctxt);
2546*495ae853SAndroid Build Coastguard Worker 
2547*495ae853SAndroid Build Coastguard Worker     /**
2548*495ae853SAndroid Build Coastguard Worker      * Output buffer
2549*495ae853SAndroid Build Coastguard Worker      */
2550*495ae853SAndroid Build Coastguard Worker     isvce_out_buf_t as_out_buf[MAX_CTXT_SETS];
2551*495ae853SAndroid Build Coastguard Worker 
2552*495ae853SAndroid Build Coastguard Worker     /**
2553*495ae853SAndroid Build Coastguard Worker      * recon buffer
2554*495ae853SAndroid Build Coastguard Worker      */
2555*495ae853SAndroid Build Coastguard Worker     isvce_rec_buf_t as_rec_buf[MAX_CTXT_SETS];
2556*495ae853SAndroid Build Coastguard Worker 
2557*495ae853SAndroid Build Coastguard Worker     /**
2558*495ae853SAndroid Build Coastguard Worker      * rate control context
2559*495ae853SAndroid Build Coastguard Worker      */
2560*495ae853SAndroid Build Coastguard Worker     isvce_rate_control_ctxt_t s_rate_control;
2561*495ae853SAndroid Build Coastguard Worker 
2562*495ae853SAndroid Build Coastguard Worker     /**
2563*495ae853SAndroid Build Coastguard Worker      * input buffer queue
2564*495ae853SAndroid Build Coastguard Worker      */
2565*495ae853SAndroid Build Coastguard Worker     isvce_inp_buf_t as_inp_list[SVC_MAX_NUM_INP_FRAMES];
2566*495ae853SAndroid Build Coastguard Worker 
2567*495ae853SAndroid Build Coastguard Worker     /**
2568*495ae853SAndroid Build Coastguard Worker      * Flag to indicate if any IDR requests are pending
2569*495ae853SAndroid Build Coastguard Worker      */
2570*495ae853SAndroid Build Coastguard Worker     WORD32 i4_pending_idr_flag;
2571*495ae853SAndroid Build Coastguard Worker 
2572*495ae853SAndroid Build Coastguard Worker     /**
2573*495ae853SAndroid Build Coastguard Worker      *Flag to indicate if we have recived the last input frame
2574*495ae853SAndroid Build Coastguard Worker      */
2575*495ae853SAndroid Build Coastguard Worker     WORD32 i4_last_inp_buff_received;
2576*495ae853SAndroid Build Coastguard Worker 
2577*495ae853SAndroid Build Coastguard Worker     /*
2578*495ae853SAndroid Build Coastguard Worker      * Max num reference frames to be signaled in SPS
2579*495ae853SAndroid Build Coastguard Worker      */
2580*495ae853SAndroid Build Coastguard Worker     WORD32 i4_max_num_reference_frames;
2581*495ae853SAndroid Build Coastguard Worker 
2582*495ae853SAndroid Build Coastguard Worker     /**
2583*495ae853SAndroid Build Coastguard Worker      * backup sei params for comparison
2584*495ae853SAndroid Build Coastguard Worker      */
2585*495ae853SAndroid Build Coastguard Worker     sei_params_t s_sei;
2586*495ae853SAndroid Build Coastguard Worker } isvce_codec_t;
2587*495ae853SAndroid Build Coastguard Worker 
2588*495ae853SAndroid Build Coastguard Worker #endif
2589