1*495ae853SAndroid Build Coastguard Worker /****************************************************************************** 2*495ae853SAndroid Build Coastguard Worker * 3*495ae853SAndroid Build Coastguard Worker * Copyright (C) 2015 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 * ih264e_structs.h 25*495ae853SAndroid Build Coastguard Worker * 26*495ae853SAndroid Build Coastguard Worker * @brief 27*495ae853SAndroid Build Coastguard Worker * Structure definitions used in the encoder 28*495ae853SAndroid Build Coastguard Worker * 29*495ae853SAndroid Build Coastguard Worker * @author 30*495ae853SAndroid Build Coastguard Worker * Harish 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 _IH264E_STRUCTS_H_ 39*495ae853SAndroid Build Coastguard Worker #define _IH264E_STRUCTS_H_ 40*495ae853SAndroid Build Coastguard Worker 41*495ae853SAndroid Build Coastguard Worker /*****************************************************************************/ 42*495ae853SAndroid Build Coastguard Worker /* Structure definitions */ 43*495ae853SAndroid Build Coastguard Worker /*****************************************************************************/ 44*495ae853SAndroid Build Coastguard Worker 45*495ae853SAndroid Build Coastguard Worker typedef struct _codec_t codec_t; 46*495ae853SAndroid Build Coastguard Worker typedef struct _proc_t process_ctxt_t; 47*495ae853SAndroid Build Coastguard Worker 48*495ae853SAndroid Build Coastguard Worker /*****************************************************************************/ 49*495ae853SAndroid Build Coastguard Worker /* Function type definitions */ 50*495ae853SAndroid Build Coastguard Worker /*****************************************************************************/ 51*495ae853SAndroid Build Coastguard Worker 52*495ae853SAndroid Build Coastguard Worker /** 53*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 54*495ae853SAndroid Build Coastguard Worker * @brief intra prediction filters leaf level 55*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 56*495ae853SAndroid Build Coastguard Worker */ 57*495ae853SAndroid Build Coastguard Worker typedef void (*pf_intra_pred)(UWORD8 *pu1_src, UWORD8 *pu1_dst, 58*495ae853SAndroid Build Coastguard Worker WORD32 src_strd, WORD32 dst_strd, 59*495ae853SAndroid Build Coastguard Worker WORD32 ui_neighboravailability); 60*495ae853SAndroid Build Coastguard Worker 61*495ae853SAndroid Build Coastguard Worker /** 62*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 63*495ae853SAndroid Build Coastguard Worker * @brief inter prediction filters leaf level 64*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 65*495ae853SAndroid Build Coastguard Worker */ 66*495ae853SAndroid Build Coastguard Worker 67*495ae853SAndroid Build Coastguard Worker typedef void (*pf_inter_pred_luma_bilinear)(UWORD8 *pu1_src1, UWORD8 *pu1_src2, UWORD8 *pu1_dst, 68*495ae853SAndroid Build Coastguard Worker WORD32 src_strd1, WORD32 src_strd2, WORD32 dst_strd, 69*495ae853SAndroid Build Coastguard Worker WORD32 height, WORD32 width); 70*495ae853SAndroid Build Coastguard Worker 71*495ae853SAndroid Build Coastguard Worker /** 72*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 73*495ae853SAndroid Build Coastguard Worker * @brief fwd transform leaf level 74*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 75*495ae853SAndroid Build Coastguard Worker */ 76*495ae853SAndroid Build Coastguard Worker typedef void (*pf_trans_quant)(UWORD8*pu1_src, UWORD8 *pu1_pred, WORD16 *pi2_out, 77*495ae853SAndroid Build Coastguard Worker WORD32 i4_src_stride, UWORD32 u4_pred_stride, UWORD32 u4_dst_stride, 78*495ae853SAndroid Build Coastguard Worker const UWORD16 *pu2_scale_mat, const UWORD16 *pu2_thresh_mat, 79*495ae853SAndroid Build Coastguard Worker UWORD32 u4_qbit, UWORD32 u4_round_fact, UWORD8 *pu1_nnz); 80*495ae853SAndroid Build Coastguard Worker 81*495ae853SAndroid Build Coastguard Worker typedef void (*pf_iquant_itrans)(WORD16 *pi2_src, UWORD8 *pu1_pred, UWORD8 *pu1_out, 82*495ae853SAndroid Build Coastguard Worker WORD32 i4_src_stride, UWORD32 u4_pred_stride, UWORD32 u4_out_stride, 83*495ae853SAndroid Build Coastguard Worker const UWORD16 *pu2_iscale_mat, const UWORD16 *pu2_weigh_mat, 84*495ae853SAndroid Build Coastguard Worker UWORD32 qp_div, WORD32 *pi4_tmp); 85*495ae853SAndroid Build Coastguard Worker 86*495ae853SAndroid Build Coastguard Worker /** 87*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 88*495ae853SAndroid Build Coastguard Worker * @brief Padding leaf level 89*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 90*495ae853SAndroid Build Coastguard Worker */ 91*495ae853SAndroid Build Coastguard Worker typedef void (*pf_pad)(UWORD8 *pu1_src, WORD32 src_strd, WORD32 wd, WORD32 pad_size); 92*495ae853SAndroid Build Coastguard Worker 93*495ae853SAndroid Build Coastguard Worker /** 94*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 95*495ae853SAndroid Build Coastguard Worker * @brief memory handling leaf level 96*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 97*495ae853SAndroid Build Coastguard Worker */ 98*495ae853SAndroid Build Coastguard Worker typedef void (*pf_memcpy)(UWORD8 *pu1_dst, UWORD8 *pu1_src, UWORD32 num_bytes); 99*495ae853SAndroid Build Coastguard Worker 100*495ae853SAndroid Build Coastguard Worker typedef void (*pf_memset)(UWORD8 *pu1_dst, UWORD8 value, UWORD32 num_bytes); 101*495ae853SAndroid Build Coastguard Worker 102*495ae853SAndroid Build Coastguard Worker typedef void (*pf_memcpy_mul8)(UWORD8 *pu1_dst, UWORD8 *pu1_src, UWORD32 num_bytes); 103*495ae853SAndroid Build Coastguard Worker 104*495ae853SAndroid Build Coastguard Worker typedef void (*pf_memset_mul8)(UWORD8 *pu1_dst, UWORD8 value, UWORD32 num_bytes); 105*495ae853SAndroid Build Coastguard Worker 106*495ae853SAndroid Build Coastguard Worker /** 107*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 108*495ae853SAndroid Build Coastguard Worker * @brief Sad computation 109*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 110*495ae853SAndroid Build Coastguard Worker */ 111*495ae853SAndroid Build Coastguard Worker typedef void (*pf_compute_sad)(UWORD8 *pu1_src, UWORD8 *pu1_est, 112*495ae853SAndroid Build Coastguard Worker UWORD32 src_strd, UWORD32 est_strd, 113*495ae853SAndroid Build Coastguard Worker WORD32 i4_max_sad, WORD32 *pi4_mb_distortion); 114*495ae853SAndroid Build Coastguard Worker 115*495ae853SAndroid Build Coastguard Worker /** 116*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 117*495ae853SAndroid Build Coastguard Worker * @brief Intra mode eval:encoder level 118*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 119*495ae853SAndroid Build Coastguard Worker */ 120*495ae853SAndroid Build Coastguard Worker typedef void (*pf_evaluate_intra_modes)(UWORD8 *pu1_src, UWORD8 *pu1_ngbr_pels_i16, UWORD8 *pu1_dst, 121*495ae853SAndroid Build Coastguard Worker UWORD32 src_strd, UWORD32 dst_strd, 122*495ae853SAndroid Build Coastguard Worker WORD32 u4_n_avblty, UWORD32 *u4_intra_mode, 123*495ae853SAndroid Build Coastguard Worker WORD32 *pu4_sadmin, 124*495ae853SAndroid Build Coastguard Worker UWORD32 u4_valid_intra_modes); 125*495ae853SAndroid Build Coastguard Worker 126*495ae853SAndroid Build Coastguard Worker typedef void (*pf_evaluate_intra_4x4_modes)(UWORD8 *pu1_src, UWORD8 *pu1_ngbr_pels, UWORD8 *pu1_dst, 127*495ae853SAndroid Build Coastguard Worker UWORD32 src_strd, UWORD32 dst_strd, 128*495ae853SAndroid Build Coastguard Worker WORD32 u4_n_avblty, UWORD32 *u4_intra_mode, 129*495ae853SAndroid Build Coastguard Worker WORD32 *pu4_sadmin, 130*495ae853SAndroid Build Coastguard Worker UWORD32 u4_valid_intra_modes, UWORD32 u4_lambda, 131*495ae853SAndroid Build Coastguard Worker UWORD32 u4_predictd_mode); 132*495ae853SAndroid Build Coastguard Worker 133*495ae853SAndroid Build Coastguard Worker /** 134*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 135*495ae853SAndroid Build Coastguard Worker * @brief half_pel generation :encoder level 136*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 137*495ae853SAndroid Build Coastguard Worker */ 138*495ae853SAndroid Build Coastguard Worker typedef void (*pf_sixtapfilter_horz)(UWORD8 *pu1_src, UWORD8 *pu1_dst, 139*495ae853SAndroid Build Coastguard Worker WORD32 src_strd, WORD32 dst_strd); 140*495ae853SAndroid Build Coastguard Worker 141*495ae853SAndroid Build Coastguard Worker typedef void (*pf_sixtap_filter_2dvh_vert)(UWORD8 *pu1_src, UWORD8 *pu1_dst1, UWORD8 *pu1_dst2, 142*495ae853SAndroid Build Coastguard Worker WORD32 src_strd, WORD32 dst_strd, 143*495ae853SAndroid Build Coastguard Worker WORD32 *pi16_pred1, 144*495ae853SAndroid Build Coastguard Worker WORD32 pi16_pred1_strd); 145*495ae853SAndroid Build Coastguard Worker /** 146*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 147*495ae853SAndroid Build Coastguard Worker * @brief color space conversion 148*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 149*495ae853SAndroid Build Coastguard Worker */ 150*495ae853SAndroid Build Coastguard Worker typedef void (*pf_fmt_conv_420p_to_420sp)(UWORD8 *pu1_y_src, UWORD8 *pu1_u_src, UWORD8 *pu1_v_src, 151*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_y_dst, UWORD8 *pu1_uv_dst, 152*495ae853SAndroid Build Coastguard Worker UWORD16 u2_height, UWORD16 u2_width, 153*495ae853SAndroid Build Coastguard Worker UWORD16 src_y_strd, UWORD16 src_u_strd, UWORD16 src_v_strd, 154*495ae853SAndroid Build Coastguard Worker UWORD16 dst_y_strd, UWORD16 dst_uv_strd, 155*495ae853SAndroid Build Coastguard Worker UWORD32 convert_uv_only); 156*495ae853SAndroid Build Coastguard Worker 157*495ae853SAndroid Build Coastguard Worker typedef void (*pf_fmt_conv_422ile_to_420sp)(UWORD8 *pu1_y_buf, UWORD8 *pu1_u_buf, UWORD8 *pu1_v_buf, 158*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_422i_buf, 159*495ae853SAndroid Build Coastguard Worker WORD32 u4_y_width, WORD32 u4_y_height, WORD32 u4_y_stride, 160*495ae853SAndroid Build Coastguard Worker WORD32 u4_u_stride, WORD32 u4_v_stride, 161*495ae853SAndroid Build Coastguard Worker WORD32 u4_422i_stride); 162*495ae853SAndroid Build Coastguard Worker 163*495ae853SAndroid Build Coastguard Worker 164*495ae853SAndroid Build Coastguard Worker 165*495ae853SAndroid Build Coastguard Worker /** 166*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 167*495ae853SAndroid Build Coastguard Worker * @brief ME evaluation 168*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 169*495ae853SAndroid Build Coastguard Worker */ 170*495ae853SAndroid Build Coastguard Worker typedef void ih264e_compute_me_ft(process_ctxt_t *); 171*495ae853SAndroid Build Coastguard Worker 172*495ae853SAndroid Build Coastguard Worker /** 173*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 174*495ae853SAndroid Build Coastguard Worker * @brief SKIP decision 175*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 176*495ae853SAndroid Build Coastguard Worker */ 177*495ae853SAndroid Build Coastguard Worker typedef WORD32 ih264e_skip_params_ft(process_ctxt_t *, WORD32); 178*495ae853SAndroid Build Coastguard Worker 179*495ae853SAndroid Build Coastguard Worker 180*495ae853SAndroid Build Coastguard Worker /*****************************************************************************/ 181*495ae853SAndroid Build Coastguard Worker /* Enums */ 182*495ae853SAndroid Build Coastguard Worker /*****************************************************************************/ 183*495ae853SAndroid Build Coastguard Worker 184*495ae853SAndroid Build Coastguard Worker /** 185*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 186*495ae853SAndroid Build Coastguard Worker * @enum CODEC_STATE_T 187*495ae853SAndroid Build Coastguard Worker * @brief codec state 188*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 189*495ae853SAndroid Build Coastguard Worker */ 190*495ae853SAndroid Build Coastguard Worker typedef enum 191*495ae853SAndroid Build Coastguard Worker { 192*495ae853SAndroid Build Coastguard Worker INIT_DONE, 193*495ae853SAndroid Build Coastguard Worker HEADER_DONE, 194*495ae853SAndroid Build Coastguard Worker FIRST_FRAME_DONE, 195*495ae853SAndroid Build Coastguard Worker } CODEC_STATE_T; 196*495ae853SAndroid Build Coastguard Worker 197*495ae853SAndroid Build Coastguard Worker 198*495ae853SAndroid Build Coastguard Worker /** 199*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 200*495ae853SAndroid Build Coastguard Worker * @enum JOBQ_CMD_T 201*495ae853SAndroid Build Coastguard Worker * @brief list of job commands (used during job instantiation) 202*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 203*495ae853SAndroid Build Coastguard Worker */ 204*495ae853SAndroid Build Coastguard Worker typedef enum 205*495ae853SAndroid Build Coastguard Worker { 206*495ae853SAndroid Build Coastguard Worker CMD_PROCESS, 207*495ae853SAndroid Build Coastguard Worker CMD_ENTROPY, 208*495ae853SAndroid Build Coastguard Worker CMD_FMTCONV, 209*495ae853SAndroid Build Coastguard Worker CMD_ME, 210*495ae853SAndroid Build Coastguard Worker }JOBQ_CMD_T; 211*495ae853SAndroid Build Coastguard Worker 212*495ae853SAndroid Build Coastguard Worker 213*495ae853SAndroid Build Coastguard Worker /*****************************************************************************/ 214*495ae853SAndroid Build Coastguard Worker /* Structures */ 215*495ae853SAndroid Build Coastguard Worker /*****************************************************************************/ 216*495ae853SAndroid Build Coastguard Worker 217*495ae853SAndroid Build Coastguard Worker /** 218*495ae853SAndroid Build Coastguard Worker * PU information 219*495ae853SAndroid Build Coastguard Worker */ 220*495ae853SAndroid Build Coastguard Worker typedef struct 221*495ae853SAndroid Build Coastguard Worker { 222*495ae853SAndroid Build Coastguard Worker /** 223*495ae853SAndroid Build Coastguard Worker * Motion Vector 224*495ae853SAndroid Build Coastguard Worker */ 225*495ae853SAndroid Build Coastguard Worker mv_t s_mv; 226*495ae853SAndroid Build Coastguard Worker 227*495ae853SAndroid Build Coastguard Worker /** 228*495ae853SAndroid Build Coastguard Worker * Ref index 229*495ae853SAndroid Build Coastguard Worker */ 230*495ae853SAndroid Build Coastguard Worker WORD8 i1_ref_idx; 231*495ae853SAndroid Build Coastguard Worker 232*495ae853SAndroid Build Coastguard Worker } enc_pu_mv_t; 233*495ae853SAndroid Build Coastguard Worker 234*495ae853SAndroid Build Coastguard Worker 235*495ae853SAndroid Build Coastguard Worker /* 236*495ae853SAndroid Build Coastguard Worker * Total Pu info for an MB 237*495ae853SAndroid Build Coastguard Worker */ 238*495ae853SAndroid Build Coastguard Worker typedef struct 239*495ae853SAndroid Build Coastguard Worker { 240*495ae853SAndroid Build Coastguard Worker 241*495ae853SAndroid Build Coastguard Worker /* Array with ME info for all lists */ 242*495ae853SAndroid Build Coastguard Worker enc_pu_mv_t s_me_info[2]; 243*495ae853SAndroid Build Coastguard Worker 244*495ae853SAndroid Build Coastguard Worker /** 245*495ae853SAndroid Build Coastguard Worker * PU X position in terms of min PU (4x4) units 246*495ae853SAndroid Build Coastguard Worker */ 247*495ae853SAndroid Build Coastguard Worker UWORD32 b4_pos_x : 4; 248*495ae853SAndroid Build Coastguard Worker 249*495ae853SAndroid Build Coastguard Worker /** 250*495ae853SAndroid Build Coastguard Worker * PU Y position in terms of min PU (4x4) units 251*495ae853SAndroid Build Coastguard Worker */ 252*495ae853SAndroid Build Coastguard Worker UWORD32 b4_pos_y : 4; 253*495ae853SAndroid Build Coastguard Worker 254*495ae853SAndroid Build Coastguard Worker /** 255*495ae853SAndroid Build Coastguard Worker * PU width in pixels = (b4_wd + 1) << 2 256*495ae853SAndroid Build Coastguard Worker */ 257*495ae853SAndroid Build Coastguard Worker UWORD32 b4_wd : 2; 258*495ae853SAndroid Build Coastguard Worker 259*495ae853SAndroid Build Coastguard Worker /** 260*495ae853SAndroid Build Coastguard Worker * PU height in pixels = (b4_ht + 1) << 2 261*495ae853SAndroid Build Coastguard Worker */ 262*495ae853SAndroid Build Coastguard Worker UWORD32 b4_ht : 2; 263*495ae853SAndroid Build Coastguard Worker 264*495ae853SAndroid Build Coastguard Worker /** 265*495ae853SAndroid Build Coastguard Worker * Intra or Inter flag for each partition - 0 or 1 266*495ae853SAndroid Build Coastguard Worker */ 267*495ae853SAndroid Build Coastguard Worker UWORD32 b1_intra_flag : 1; 268*495ae853SAndroid Build Coastguard Worker 269*495ae853SAndroid Build Coastguard Worker /** 270*495ae853SAndroid Build Coastguard Worker * PRED_L0, PRED_L1, PRED_BI 271*495ae853SAndroid Build Coastguard Worker */ 272*495ae853SAndroid Build Coastguard Worker UWORD32 b2_pred_mode : 2; 273*495ae853SAndroid Build Coastguard Worker 274*495ae853SAndroid Build Coastguard Worker 275*495ae853SAndroid Build Coastguard Worker } enc_pu_t; 276*495ae853SAndroid Build Coastguard Worker 277*495ae853SAndroid Build Coastguard Worker 278*495ae853SAndroid Build Coastguard Worker typedef struct 279*495ae853SAndroid Build Coastguard Worker { 280*495ae853SAndroid Build Coastguard Worker /** Descriptor of raw buffer */ 281*495ae853SAndroid Build Coastguard Worker iv_raw_buf_t s_raw_buf; 282*495ae853SAndroid Build Coastguard Worker 283*495ae853SAndroid Build Coastguard Worker /** Lower 32bits of time stamp corresponding to the above buffer */ 284*495ae853SAndroid Build Coastguard Worker UWORD32 u4_timestamp_low; 285*495ae853SAndroid Build Coastguard Worker 286*495ae853SAndroid Build Coastguard Worker /** Upper 32bits of time stamp corresponding to the above buffer */ 287*495ae853SAndroid Build Coastguard Worker UWORD32 u4_timestamp_high; 288*495ae853SAndroid Build Coastguard Worker 289*495ae853SAndroid Build Coastguard Worker /** Flag to indicate if the current buffer is last buffer */ 290*495ae853SAndroid Build Coastguard Worker UWORD32 u4_is_last; 291*495ae853SAndroid Build Coastguard Worker 292*495ae853SAndroid Build Coastguard Worker /** Flag to indicate if mb info is sent along with input buffer */ 293*495ae853SAndroid Build Coastguard Worker UWORD32 u4_mb_info_type; 294*495ae853SAndroid Build Coastguard Worker 295*495ae853SAndroid Build Coastguard Worker /** Flag to indicate the size of mb info structure */ 296*495ae853SAndroid Build Coastguard Worker UWORD32 u4_mb_info_size; 297*495ae853SAndroid Build Coastguard Worker 298*495ae853SAndroid Build Coastguard Worker /** Buffer containing mb info if mb_info_type is non-zero */ 299*495ae853SAndroid Build Coastguard Worker void *pv_mb_info; 300*495ae853SAndroid Build Coastguard Worker 301*495ae853SAndroid Build Coastguard Worker /** Flag to indicate if pic info is sent along with input buffer */ 302*495ae853SAndroid Build Coastguard Worker UWORD32 u4_pic_info_type; 303*495ae853SAndroid Build Coastguard Worker 304*495ae853SAndroid Build Coastguard Worker /** Buffer containing pic info if mb_info_type is non-zero */ 305*495ae853SAndroid Build Coastguard Worker void *pv_pic_info; 306*495ae853SAndroid Build Coastguard Worker 307*495ae853SAndroid Build Coastguard Worker /** SEI CCV params flag */ 308*495ae853SAndroid Build Coastguard Worker UWORD8 u1_sei_ccv_params_present_flag; 309*495ae853SAndroid Build Coastguard Worker 310*495ae853SAndroid Build Coastguard Worker /** SEI CCV params info */ 311*495ae853SAndroid Build Coastguard Worker sei_ccv_params_t s_sei_ccv; 312*495ae853SAndroid Build Coastguard Worker 313*495ae853SAndroid Build Coastguard Worker /** SEI SII params flag */ 314*495ae853SAndroid Build Coastguard Worker UWORD8 u1_sei_sii_params_present_flag; 315*495ae853SAndroid Build Coastguard Worker 316*495ae853SAndroid Build Coastguard Worker /** SEI SII params info */ 317*495ae853SAndroid Build Coastguard Worker sei_sii_params_t s_sei_sii; 318*495ae853SAndroid Build Coastguard Worker 319*495ae853SAndroid Build Coastguard Worker }inp_buf_t; 320*495ae853SAndroid Build Coastguard Worker 321*495ae853SAndroid Build Coastguard Worker typedef struct 322*495ae853SAndroid Build Coastguard Worker { 323*495ae853SAndroid Build Coastguard Worker /** Descriptor of bitstream buffer */ 324*495ae853SAndroid Build Coastguard Worker iv_bits_buf_t s_bits_buf; 325*495ae853SAndroid Build Coastguard Worker 326*495ae853SAndroid Build Coastguard Worker /** Lower 32bits of time stamp corresponding to the above buffer */ 327*495ae853SAndroid Build Coastguard Worker UWORD32 u4_timestamp_low; 328*495ae853SAndroid Build Coastguard Worker 329*495ae853SAndroid Build Coastguard Worker /** Upper 32bits of time stamp corresponding to the above buffer */ 330*495ae853SAndroid Build Coastguard Worker UWORD32 u4_timestamp_high; 331*495ae853SAndroid Build Coastguard Worker 332*495ae853SAndroid Build Coastguard Worker /** Flag to indicate if the current buffer is last buffer */ 333*495ae853SAndroid Build Coastguard Worker UWORD32 u4_is_last; 334*495ae853SAndroid Build Coastguard Worker 335*495ae853SAndroid Build Coastguard Worker }out_buf_t; 336*495ae853SAndroid Build Coastguard Worker 337*495ae853SAndroid Build Coastguard Worker typedef struct 338*495ae853SAndroid Build Coastguard Worker { 339*495ae853SAndroid Build Coastguard Worker /** Descriptor of picture buffer */ 340*495ae853SAndroid Build Coastguard Worker pic_buf_t s_pic_buf; 341*495ae853SAndroid Build Coastguard Worker 342*495ae853SAndroid Build Coastguard Worker /** Lower 32bits of time stamp corresponding to the above buffer */ 343*495ae853SAndroid Build Coastguard Worker UWORD32 u4_timestamp_low; 344*495ae853SAndroid Build Coastguard Worker 345*495ae853SAndroid Build Coastguard Worker /** Upper 32bits of time stamp corresponding to the above buffer */ 346*495ae853SAndroid Build Coastguard Worker UWORD32 u4_timestamp_high; 347*495ae853SAndroid Build Coastguard Worker 348*495ae853SAndroid Build Coastguard Worker /** Flag to indicate if the current buffer is last buffer */ 349*495ae853SAndroid Build Coastguard Worker UWORD32 u4_is_last; 350*495ae853SAndroid Build Coastguard Worker 351*495ae853SAndroid Build Coastguard Worker /** Picture count corresponding to current picture */ 352*495ae853SAndroid Build Coastguard Worker WORD32 i4_pic_cnt; 353*495ae853SAndroid Build Coastguard Worker 354*495ae853SAndroid Build Coastguard Worker }rec_buf_t; 355*495ae853SAndroid Build Coastguard Worker 356*495ae853SAndroid Build Coastguard Worker typedef struct 357*495ae853SAndroid Build Coastguard Worker { 358*495ae853SAndroid Build Coastguard Worker /** maximum width for which codec should request memory requirements */ 359*495ae853SAndroid Build Coastguard Worker UWORD32 u4_max_wd; 360*495ae853SAndroid Build Coastguard Worker 361*495ae853SAndroid Build Coastguard Worker /** maximum height for which codec should request memory requirements */ 362*495ae853SAndroid Build Coastguard Worker UWORD32 u4_max_ht; 363*495ae853SAndroid Build Coastguard Worker 364*495ae853SAndroid Build Coastguard Worker /** Maximum number of reference frames */ 365*495ae853SAndroid Build Coastguard Worker UWORD32 u4_max_ref_cnt; 366*495ae853SAndroid Build Coastguard Worker 367*495ae853SAndroid Build Coastguard Worker /** Maximum number of reorder frames */ 368*495ae853SAndroid Build Coastguard Worker UWORD32 u4_max_reorder_cnt; 369*495ae853SAndroid Build Coastguard Worker 370*495ae853SAndroid Build Coastguard Worker /** Maximum level supported */ 371*495ae853SAndroid Build Coastguard Worker UWORD32 u4_max_level; 372*495ae853SAndroid Build Coastguard Worker 373*495ae853SAndroid Build Coastguard Worker /** Input color format */ 374*495ae853SAndroid Build Coastguard Worker IV_COLOR_FORMAT_T e_inp_color_fmt; 375*495ae853SAndroid Build Coastguard Worker 376*495ae853SAndroid Build Coastguard Worker /** Flag to enable/disable recon */ 377*495ae853SAndroid Build Coastguard Worker UWORD32 u4_enable_recon; 378*495ae853SAndroid Build Coastguard Worker 379*495ae853SAndroid Build Coastguard Worker /** Flag to enable/disable quality metrics */ 380*495ae853SAndroid Build Coastguard Worker UWORD32 u4_enable_quality_metrics; 381*495ae853SAndroid Build Coastguard Worker 382*495ae853SAndroid Build Coastguard Worker /** Recon color format */ 383*495ae853SAndroid Build Coastguard Worker IV_COLOR_FORMAT_T e_recon_color_fmt; 384*495ae853SAndroid Build Coastguard Worker 385*495ae853SAndroid Build Coastguard Worker /** Encoder Speed preset - Value between 0 (slowest) and 100 (fastest) */ 386*495ae853SAndroid Build Coastguard Worker IVE_SPEED_CONFIG u4_enc_speed_preset; 387*495ae853SAndroid Build Coastguard Worker 388*495ae853SAndroid Build Coastguard Worker /** Rate control mode */ 389*495ae853SAndroid Build Coastguard Worker IVE_RC_MODE_T e_rc_mode; 390*495ae853SAndroid Build Coastguard Worker 391*495ae853SAndroid Build Coastguard Worker /** Maximum frame rate to be supported */ 392*495ae853SAndroid Build Coastguard Worker UWORD32 u4_max_framerate; 393*495ae853SAndroid Build Coastguard Worker 394*495ae853SAndroid Build Coastguard Worker /** Maximum bitrate to be supported */ 395*495ae853SAndroid Build Coastguard Worker UWORD32 u4_max_bitrate; 396*495ae853SAndroid Build Coastguard Worker 397*495ae853SAndroid Build Coastguard Worker /** Maximum number of consecutive B frames */ 398*495ae853SAndroid Build Coastguard Worker UWORD32 u4_num_bframes; 399*495ae853SAndroid Build Coastguard Worker 400*495ae853SAndroid Build Coastguard Worker /** Content type Interlaced/Progressive */ 401*495ae853SAndroid Build Coastguard Worker IV_CONTENT_TYPE_T e_content_type; 402*495ae853SAndroid Build Coastguard Worker 403*495ae853SAndroid Build Coastguard Worker /** Maximum search range to be used in X direction */ 404*495ae853SAndroid Build Coastguard Worker UWORD32 u4_max_srch_rng_x; 405*495ae853SAndroid Build Coastguard Worker 406*495ae853SAndroid Build Coastguard Worker /** Maximum search range to be used in Y direction */ 407*495ae853SAndroid Build Coastguard Worker UWORD32 u4_max_srch_rng_y; 408*495ae853SAndroid Build Coastguard Worker 409*495ae853SAndroid Build Coastguard Worker /** Slice Mode */ 410*495ae853SAndroid Build Coastguard Worker IVE_SLICE_MODE_T e_slice_mode; 411*495ae853SAndroid Build Coastguard Worker 412*495ae853SAndroid Build Coastguard Worker /** Slice parameter */ 413*495ae853SAndroid Build Coastguard Worker UWORD32 u4_slice_param; 414*495ae853SAndroid Build Coastguard Worker 415*495ae853SAndroid Build Coastguard Worker /** Processor architecture */ 416*495ae853SAndroid Build Coastguard Worker IV_ARCH_T e_arch; 417*495ae853SAndroid Build Coastguard Worker 418*495ae853SAndroid Build Coastguard Worker /** SOC details */ 419*495ae853SAndroid Build Coastguard Worker IV_SOC_T e_soc; 420*495ae853SAndroid Build Coastguard Worker 421*495ae853SAndroid Build Coastguard Worker /** Input width to be sent in bitstream */ 422*495ae853SAndroid Build Coastguard Worker UWORD32 u4_disp_wd; 423*495ae853SAndroid Build Coastguard Worker 424*495ae853SAndroid Build Coastguard Worker /** Input height to be sent in bitstream */ 425*495ae853SAndroid Build Coastguard Worker UWORD32 u4_disp_ht; 426*495ae853SAndroid Build Coastguard Worker 427*495ae853SAndroid Build Coastguard Worker /** Input width */ 428*495ae853SAndroid Build Coastguard Worker UWORD32 u4_wd; 429*495ae853SAndroid Build Coastguard Worker 430*495ae853SAndroid Build Coastguard Worker /** Input height */ 431*495ae853SAndroid Build Coastguard Worker UWORD32 u4_ht; 432*495ae853SAndroid Build Coastguard Worker 433*495ae853SAndroid Build Coastguard Worker /** Input stride */ 434*495ae853SAndroid Build Coastguard Worker UWORD32 u4_strd; 435*495ae853SAndroid Build Coastguard Worker 436*495ae853SAndroid Build Coastguard Worker /** Source frame rate */ 437*495ae853SAndroid Build Coastguard Worker UWORD32 u4_src_frame_rate; 438*495ae853SAndroid Build Coastguard Worker 439*495ae853SAndroid Build Coastguard Worker /** Target frame rate */ 440*495ae853SAndroid Build Coastguard Worker UWORD32 u4_tgt_frame_rate; 441*495ae853SAndroid Build Coastguard Worker 442*495ae853SAndroid Build Coastguard Worker /** Target bitrate in kilobits per second */ 443*495ae853SAndroid Build Coastguard Worker UWORD32 u4_target_bitrate; 444*495ae853SAndroid Build Coastguard Worker 445*495ae853SAndroid Build Coastguard Worker /** Force current frame type */ 446*495ae853SAndroid Build Coastguard Worker IV_PICTURE_CODING_TYPE_T e_frame_type; 447*495ae853SAndroid Build Coastguard Worker 448*495ae853SAndroid Build Coastguard Worker /** Encoder mode */ 449*495ae853SAndroid Build Coastguard Worker IVE_ENC_MODE_T e_enc_mode; 450*495ae853SAndroid Build Coastguard Worker 451*495ae853SAndroid Build Coastguard Worker /** Set initial Qp for I pictures */ 452*495ae853SAndroid Build Coastguard Worker UWORD32 u4_i_qp; 453*495ae853SAndroid Build Coastguard Worker 454*495ae853SAndroid Build Coastguard Worker /** Set initial Qp for P pictures */ 455*495ae853SAndroid Build Coastguard Worker UWORD32 u4_p_qp; 456*495ae853SAndroid Build Coastguard Worker 457*495ae853SAndroid Build Coastguard Worker /** Set initial Qp for B pictures */ 458*495ae853SAndroid Build Coastguard Worker UWORD32 u4_b_qp; 459*495ae853SAndroid Build Coastguard Worker 460*495ae853SAndroid Build Coastguard Worker /** Set minimum Qp for I pictures */ 461*495ae853SAndroid Build Coastguard Worker UWORD32 u4_i_qp_min; 462*495ae853SAndroid Build Coastguard Worker 463*495ae853SAndroid Build Coastguard Worker /** Set maximum Qp for I pictures */ 464*495ae853SAndroid Build Coastguard Worker UWORD32 u4_i_qp_max; 465*495ae853SAndroid Build Coastguard Worker 466*495ae853SAndroid Build Coastguard Worker /** Set minimum Qp for P pictures */ 467*495ae853SAndroid Build Coastguard Worker UWORD32 u4_p_qp_min; 468*495ae853SAndroid Build Coastguard Worker 469*495ae853SAndroid Build Coastguard Worker /** Set maximum Qp for P pictures */ 470*495ae853SAndroid Build Coastguard Worker UWORD32 u4_p_qp_max; 471*495ae853SAndroid Build Coastguard Worker 472*495ae853SAndroid Build Coastguard Worker /** Set minimum Qp for B pictures */ 473*495ae853SAndroid Build Coastguard Worker UWORD32 u4_b_qp_min; 474*495ae853SAndroid Build Coastguard Worker 475*495ae853SAndroid Build Coastguard Worker /** Set maximum Qp for B pictures */ 476*495ae853SAndroid Build Coastguard Worker UWORD32 u4_b_qp_max; 477*495ae853SAndroid Build Coastguard Worker 478*495ae853SAndroid Build Coastguard Worker /** Adaptive intra refresh mode */ 479*495ae853SAndroid Build Coastguard Worker IVE_AIR_MODE_T e_air_mode; 480*495ae853SAndroid Build Coastguard Worker 481*495ae853SAndroid Build Coastguard Worker /** Adaptive intra refresh period in frames */ 482*495ae853SAndroid Build Coastguard Worker UWORD32 u4_air_refresh_period; 483*495ae853SAndroid Build Coastguard Worker 484*495ae853SAndroid Build Coastguard Worker /** VBV buffer delay */ 485*495ae853SAndroid Build Coastguard Worker UWORD32 u4_vbv_buffer_delay; 486*495ae853SAndroid Build Coastguard Worker 487*495ae853SAndroid Build Coastguard Worker /** VBV buffer size */ 488*495ae853SAndroid Build Coastguard Worker UWORD32 u4_vbv_buf_size; 489*495ae853SAndroid Build Coastguard Worker 490*495ae853SAndroid Build Coastguard Worker /** Number of cores to be used */ 491*495ae853SAndroid Build Coastguard Worker UWORD32 u4_num_cores; 492*495ae853SAndroid Build Coastguard Worker 493*495ae853SAndroid Build Coastguard Worker /** ME speed preset - Value between 0 (slowest) and 100 (fastest) */ 494*495ae853SAndroid Build Coastguard Worker UWORD32 u4_me_speed_preset; 495*495ae853SAndroid Build Coastguard Worker 496*495ae853SAndroid Build Coastguard Worker /** Flag to enable/disable half pel motion estimation */ 497*495ae853SAndroid Build Coastguard Worker UWORD32 u4_enable_hpel; 498*495ae853SAndroid Build Coastguard Worker 499*495ae853SAndroid Build Coastguard Worker /** Flag to enable/disable quarter pel motion estimation */ 500*495ae853SAndroid Build Coastguard Worker UWORD32 u4_enable_qpel; 501*495ae853SAndroid Build Coastguard Worker 502*495ae853SAndroid Build Coastguard Worker /** Flag to enable/disable intra 4x4 analysis */ 503*495ae853SAndroid Build Coastguard Worker UWORD32 u4_enable_intra_4x4; 504*495ae853SAndroid Build Coastguard Worker 505*495ae853SAndroid Build Coastguard Worker /** Flag to enable/disable intra 8x8 analysis */ 506*495ae853SAndroid Build Coastguard Worker UWORD32 u4_enable_intra_8x8; 507*495ae853SAndroid Build Coastguard Worker 508*495ae853SAndroid Build Coastguard Worker /** Flag to enable/disable intra 16x16 analysis */ 509*495ae853SAndroid Build Coastguard Worker UWORD32 u4_enable_intra_16x16; 510*495ae853SAndroid Build Coastguard Worker 511*495ae853SAndroid Build Coastguard Worker /** Flag to enable/disable fast SAD approximation */ 512*495ae853SAndroid Build Coastguard Worker UWORD32 u4_enable_fast_sad; 513*495ae853SAndroid Build Coastguard Worker 514*495ae853SAndroid Build Coastguard Worker /*flag to enable/disable alternate reference frames */ 515*495ae853SAndroid Build Coastguard Worker UWORD32 u4_enable_alt_ref; 516*495ae853SAndroid Build Coastguard Worker 517*495ae853SAndroid Build Coastguard Worker /*Flag to enable/disable computation of SATDQ in ME*/ 518*495ae853SAndroid Build Coastguard Worker UWORD32 u4_enable_satqd; 519*495ae853SAndroid Build Coastguard Worker 520*495ae853SAndroid Build Coastguard Worker /*Minimum SAD to search for*/ 521*495ae853SAndroid Build Coastguard Worker WORD32 i4_min_sad; 522*495ae853SAndroid Build Coastguard Worker 523*495ae853SAndroid Build Coastguard Worker /** Maximum search range in X direction for farthest reference */ 524*495ae853SAndroid Build Coastguard Worker UWORD32 u4_srch_rng_x; 525*495ae853SAndroid Build Coastguard Worker 526*495ae853SAndroid Build Coastguard Worker /** Maximum search range in Y direction for farthest reference */ 527*495ae853SAndroid Build Coastguard Worker UWORD32 u4_srch_rng_y; 528*495ae853SAndroid Build Coastguard Worker 529*495ae853SAndroid Build Coastguard Worker /** I frame interval */ 530*495ae853SAndroid Build Coastguard Worker UWORD32 u4_i_frm_interval; 531*495ae853SAndroid Build Coastguard Worker 532*495ae853SAndroid Build Coastguard Worker /** IDR frame interval */ 533*495ae853SAndroid Build Coastguard Worker UWORD32 u4_idr_frm_interval; 534*495ae853SAndroid Build Coastguard Worker 535*495ae853SAndroid Build Coastguard Worker /** Disable deblock level (0: Enable completely, 3: Disable completely */ 536*495ae853SAndroid Build Coastguard Worker UWORD32 u4_disable_deblock_level; 537*495ae853SAndroid Build Coastguard Worker 538*495ae853SAndroid Build Coastguard Worker /** Profile */ 539*495ae853SAndroid Build Coastguard Worker IV_PROFILE_T e_profile; 540*495ae853SAndroid Build Coastguard Worker 541*495ae853SAndroid Build Coastguard Worker /** Lower 32bits of time stamp corresponding to input buffer, 542*495ae853SAndroid Build Coastguard Worker * from which this command takes effect */ 543*495ae853SAndroid Build Coastguard Worker UWORD32 u4_timestamp_low; 544*495ae853SAndroid Build Coastguard Worker 545*495ae853SAndroid Build Coastguard Worker /** Upper 32bits of time stamp corresponding to input buffer, 546*495ae853SAndroid Build Coastguard Worker * from which this command takes effect */ 547*495ae853SAndroid Build Coastguard Worker UWORD32 u4_timestamp_high; 548*495ae853SAndroid Build Coastguard Worker 549*495ae853SAndroid Build Coastguard Worker /** Flag to say if the current config parameter set is valid 550*495ae853SAndroid Build Coastguard Worker * Will be zero to start with and will be set to 1, when configured 551*495ae853SAndroid Build Coastguard Worker * Once encoder uses the parameter set, this will be set to zero */ 552*495ae853SAndroid Build Coastguard Worker UWORD32 u4_is_valid; 553*495ae853SAndroid Build Coastguard Worker 554*495ae853SAndroid Build Coastguard Worker /** Command associated with this config param set */ 555*495ae853SAndroid Build Coastguard Worker IVE_CONTROL_API_COMMAND_TYPE_T e_cmd; 556*495ae853SAndroid Build Coastguard Worker 557*495ae853SAndroid Build Coastguard Worker /** Input width in mbs */ 558*495ae853SAndroid Build Coastguard Worker UWORD32 i4_wd_mbs; 559*495ae853SAndroid Build Coastguard Worker 560*495ae853SAndroid Build Coastguard Worker /** Input height in mbs */ 561*495ae853SAndroid Build Coastguard Worker UWORD32 i4_ht_mbs; 562*495ae853SAndroid Build Coastguard Worker 563*495ae853SAndroid Build Coastguard Worker /** entropy coding mode flag */ 564*495ae853SAndroid Build Coastguard Worker UWORD32 u4_entropy_coding_mode; 565*495ae853SAndroid Build Coastguard Worker 566*495ae853SAndroid Build Coastguard Worker /** enable weighted prediction */ 567*495ae853SAndroid Build Coastguard Worker UWORD32 u4_weighted_prediction; 568*495ae853SAndroid Build Coastguard Worker 569*495ae853SAndroid Build Coastguard Worker /** enable constrained intra prediction */ 570*495ae853SAndroid Build Coastguard Worker UWORD32 u4_constrained_intra_pred; 571*495ae853SAndroid Build Coastguard Worker 572*495ae853SAndroid Build Coastguard Worker /** Pic info type */ 573*495ae853SAndroid Build Coastguard Worker UWORD32 u4_pic_info_type; 574*495ae853SAndroid Build Coastguard Worker /** 575*495ae853SAndroid Build Coastguard Worker * MB info type 576*495ae853SAndroid Build Coastguard Worker */ 577*495ae853SAndroid Build Coastguard Worker UWORD32 u4_mb_info_type; 578*495ae853SAndroid Build Coastguard Worker 579*495ae853SAndroid Build Coastguard Worker /** VUI structure */ 580*495ae853SAndroid Build Coastguard Worker vui_t s_vui; 581*495ae853SAndroid Build Coastguard Worker 582*495ae853SAndroid Build Coastguard Worker /** SEI structure */ 583*495ae853SAndroid Build Coastguard Worker sei_params_t s_sei; 584*495ae853SAndroid Build Coastguard Worker 585*495ae853SAndroid Build Coastguard Worker }cfg_params_t; 586*495ae853SAndroid Build Coastguard Worker 587*495ae853SAndroid Build Coastguard Worker 588*495ae853SAndroid Build Coastguard Worker 589*495ae853SAndroid Build Coastguard Worker /** Structure to hold format conversion context */ 590*495ae853SAndroid Build Coastguard Worker typedef struct 591*495ae853SAndroid Build Coastguard Worker { 592*495ae853SAndroid Build Coastguard Worker /** Current row for which format conversion should be done */ 593*495ae853SAndroid Build Coastguard Worker WORD32 i4_cur_row; 594*495ae853SAndroid Build Coastguard Worker 595*495ae853SAndroid Build Coastguard Worker /** Number of rows for which format conversion should be done */ 596*495ae853SAndroid Build Coastguard Worker WORD32 i4_num_rows; 597*495ae853SAndroid Build Coastguard Worker 598*495ae853SAndroid Build Coastguard Worker }fmt_conv_t; 599*495ae853SAndroid Build Coastguard Worker 600*495ae853SAndroid Build Coastguard Worker 601*495ae853SAndroid Build Coastguard Worker /** 602*495ae853SAndroid Build Coastguard Worker * Structure to represent a processing job entry 603*495ae853SAndroid Build Coastguard Worker */ 604*495ae853SAndroid Build Coastguard Worker typedef struct 605*495ae853SAndroid Build Coastguard Worker { 606*495ae853SAndroid Build Coastguard Worker /** 607*495ae853SAndroid Build Coastguard Worker * Command 608*495ae853SAndroid Build Coastguard Worker */ 609*495ae853SAndroid Build Coastguard Worker WORD32 i4_cmd; 610*495ae853SAndroid Build Coastguard Worker 611*495ae853SAndroid Build Coastguard Worker /** 612*495ae853SAndroid Build Coastguard Worker * MB x of the starting MB 613*495ae853SAndroid Build Coastguard Worker */ 614*495ae853SAndroid Build Coastguard Worker WORD16 i2_mb_x; 615*495ae853SAndroid Build Coastguard Worker 616*495ae853SAndroid Build Coastguard Worker /** 617*495ae853SAndroid Build Coastguard Worker * MB y of the starting MB 618*495ae853SAndroid Build Coastguard Worker */ 619*495ae853SAndroid Build Coastguard Worker 620*495ae853SAndroid Build Coastguard Worker WORD16 i2_mb_y; 621*495ae853SAndroid Build Coastguard Worker 622*495ae853SAndroid Build Coastguard Worker /** 623*495ae853SAndroid Build Coastguard Worker * Number of MBs that need to be processed in this job 624*495ae853SAndroid Build Coastguard Worker */ 625*495ae853SAndroid Build Coastguard Worker WORD16 i2_mb_cnt; 626*495ae853SAndroid Build Coastguard Worker 627*495ae853SAndroid Build Coastguard Worker /** 628*495ae853SAndroid Build Coastguard Worker * Process contexts base index 629*495ae853SAndroid Build Coastguard Worker * Will toggle between 0 and MAX_PROCESS_THREADS 630*495ae853SAndroid Build Coastguard Worker */ 631*495ae853SAndroid Build Coastguard Worker WORD16 i2_proc_base_idx; 632*495ae853SAndroid Build Coastguard Worker 633*495ae853SAndroid Build Coastguard Worker } job_t; 634*495ae853SAndroid Build Coastguard Worker 635*495ae853SAndroid Build Coastguard Worker 636*495ae853SAndroid Build Coastguard Worker /** 637*495ae853SAndroid Build Coastguard Worker ***************************************************************************** 638*495ae853SAndroid Build Coastguard Worker * @brief Structure to store psnr of the sequence 639*495ae853SAndroid Build Coastguard Worker ***************************************************************************** 640*495ae853SAndroid Build Coastguard Worker */ 641*495ae853SAndroid Build Coastguard Worker typedef struct { 642*495ae853SAndroid Build Coastguard Worker UWORD64 total_sse[3]; 643*495ae853SAndroid Build Coastguard Worker double global_psnr[3]; // total_sse / total_samples 644*495ae853SAndroid Build Coastguard Worker double total_psnr[3]; // sum (per_frame_sse / per_frame_samples) 645*495ae853SAndroid Build Coastguard Worker double avg_psnr[3]; // total_psnr / total_frames 646*495ae853SAndroid Build Coastguard Worker UWORD32 total_samples[3]; 647*495ae853SAndroid Build Coastguard Worker WORD32 total_frames; 648*495ae853SAndroid Build Coastguard Worker } quality_stats_t; 649*495ae853SAndroid Build Coastguard Worker 650*495ae853SAndroid Build Coastguard Worker 651*495ae853SAndroid Build Coastguard Worker 652*495ae853SAndroid Build Coastguard Worker /** 653*495ae853SAndroid Build Coastguard Worker * Structure to represent a MV Bank buffer 654*495ae853SAndroid Build Coastguard Worker */ 655*495ae853SAndroid Build Coastguard Worker typedef struct 656*495ae853SAndroid Build Coastguard Worker { 657*495ae853SAndroid Build Coastguard Worker /** 658*495ae853SAndroid Build Coastguard Worker * Pointer to hold num PUs each MB in a picture 659*495ae853SAndroid Build Coastguard Worker */ 660*495ae853SAndroid Build Coastguard Worker UWORD32 *pu4_mb_pu_cnt; 661*495ae853SAndroid Build Coastguard Worker 662*495ae853SAndroid Build Coastguard Worker /** 663*495ae853SAndroid Build Coastguard Worker * Pointer to hold enc_pu_t for each PU in a picture 664*495ae853SAndroid Build Coastguard Worker */ 665*495ae853SAndroid Build Coastguard Worker enc_pu_t *ps_pic_pu; 666*495ae853SAndroid Build Coastguard Worker 667*495ae853SAndroid Build Coastguard Worker /** 668*495ae853SAndroid Build Coastguard Worker * Pointer to hold PU map for each MB in a picture 669*495ae853SAndroid Build Coastguard Worker */ 670*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_pic_pu_map; 671*495ae853SAndroid Build Coastguard Worker 672*495ae853SAndroid Build Coastguard Worker /** 673*495ae853SAndroid Build Coastguard Worker * Pointer to hold the Slice map 674*495ae853SAndroid Build Coastguard Worker */ 675*495ae853SAndroid Build Coastguard Worker UWORD16 *pu1_pic_slice_map; 676*495ae853SAndroid Build Coastguard Worker 677*495ae853SAndroid Build Coastguard Worker /** 678*495ae853SAndroid Build Coastguard Worker * Absolute POC for the current MV Bank 679*495ae853SAndroid Build Coastguard Worker */ 680*495ae853SAndroid Build Coastguard Worker WORD32 i4_abs_poc; 681*495ae853SAndroid Build Coastguard Worker 682*495ae853SAndroid Build Coastguard Worker /** 683*495ae853SAndroid Build Coastguard Worker * Buffer Id 684*495ae853SAndroid Build Coastguard Worker */ 685*495ae853SAndroid Build Coastguard Worker WORD32 i4_buf_id; 686*495ae853SAndroid Build Coastguard Worker 687*495ae853SAndroid Build Coastguard Worker } mv_buf_t; 688*495ae853SAndroid Build Coastguard Worker 689*495ae853SAndroid Build Coastguard Worker 690*495ae853SAndroid Build Coastguard Worker /** 691*495ae853SAndroid Build Coastguard Worker * Reference set containing pointers to MV buf and pic buf 692*495ae853SAndroid Build Coastguard Worker */ 693*495ae853SAndroid Build Coastguard Worker typedef struct 694*495ae853SAndroid Build Coastguard Worker { 695*495ae853SAndroid Build Coastguard Worker /** Per pic PSNR */ 696*495ae853SAndroid Build Coastguard Worker quality_stats_t s_pic_quality_stats; 697*495ae853SAndroid Build Coastguard Worker 698*495ae853SAndroid Build Coastguard Worker /** Picture count */ 699*495ae853SAndroid Build Coastguard Worker WORD32 i4_pic_cnt; 700*495ae853SAndroid Build Coastguard Worker 701*495ae853SAndroid Build Coastguard Worker /** POC */ 702*495ae853SAndroid Build Coastguard Worker WORD32 i4_poc; 703*495ae853SAndroid Build Coastguard Worker 704*495ae853SAndroid Build Coastguard Worker /** picture buffer */ 705*495ae853SAndroid Build Coastguard Worker pic_buf_t *ps_pic_buf; 706*495ae853SAndroid Build Coastguard Worker 707*495ae853SAndroid Build Coastguard Worker /** mv buffer */ 708*495ae853SAndroid Build Coastguard Worker mv_buf_t *ps_mv_buf; 709*495ae853SAndroid Build Coastguard Worker 710*495ae853SAndroid Build Coastguard Worker }ref_set_t; 711*495ae853SAndroid Build Coastguard Worker 712*495ae853SAndroid Build Coastguard Worker typedef struct 713*495ae853SAndroid Build Coastguard Worker { 714*495ae853SAndroid Build Coastguard Worker 715*495ae853SAndroid Build Coastguard Worker /** 716*495ae853SAndroid Build Coastguard Worker * Pointer to current PPS 717*495ae853SAndroid Build Coastguard Worker */ 718*495ae853SAndroid Build Coastguard Worker pps_t *ps_pps; 719*495ae853SAndroid Build Coastguard Worker 720*495ae853SAndroid Build Coastguard Worker /** 721*495ae853SAndroid Build Coastguard Worker * Pointer to current SPS 722*495ae853SAndroid Build Coastguard Worker */ 723*495ae853SAndroid Build Coastguard Worker sps_t *ps_sps; 724*495ae853SAndroid Build Coastguard Worker 725*495ae853SAndroid Build Coastguard Worker /** 726*495ae853SAndroid Build Coastguard Worker * Pointer to current slice header structure 727*495ae853SAndroid Build Coastguard Worker */ 728*495ae853SAndroid Build Coastguard Worker slice_header_t *ps_slice_hdr; 729*495ae853SAndroid Build Coastguard Worker 730*495ae853SAndroid Build Coastguard Worker /** 731*495ae853SAndroid Build Coastguard Worker * MB's x position within a picture in raster scan in MB units 732*495ae853SAndroid Build Coastguard Worker */ 733*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_x; 734*495ae853SAndroid Build Coastguard Worker 735*495ae853SAndroid Build Coastguard Worker /** 736*495ae853SAndroid Build Coastguard Worker * MB's y position within a picture in raster scan in MB units 737*495ae853SAndroid Build Coastguard Worker */ 738*495ae853SAndroid Build Coastguard Worker 739*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_y; 740*495ae853SAndroid Build Coastguard Worker 741*495ae853SAndroid Build Coastguard Worker /** 742*495ae853SAndroid Build Coastguard Worker * Current PU structure - set to MB enc_pu_t pointer at the start of MB processing and incremented 743*495ae853SAndroid Build Coastguard Worker * for every TU 744*495ae853SAndroid Build Coastguard Worker */ 745*495ae853SAndroid Build Coastguard Worker enc_pu_t *ps_pu; 746*495ae853SAndroid Build Coastguard Worker 747*495ae853SAndroid Build Coastguard Worker /** 748*495ae853SAndroid Build Coastguard Worker * Pointer to frame level enc_pu_t for the current frame being parsed 749*495ae853SAndroid Build Coastguard Worker * where MVs and Intra pred modes will be updated 750*495ae853SAndroid Build Coastguard Worker */ 751*495ae853SAndroid Build Coastguard Worker enc_pu_t *ps_pic_pu; 752*495ae853SAndroid Build Coastguard Worker 753*495ae853SAndroid Build Coastguard Worker /** 754*495ae853SAndroid Build Coastguard Worker * Pointer to hold num PUs each MB in a picture 755*495ae853SAndroid Build Coastguard Worker */ 756*495ae853SAndroid Build Coastguard Worker UWORD32 *pu4_mb_pu_cnt; 757*495ae853SAndroid Build Coastguard Worker 758*495ae853SAndroid Build Coastguard Worker /** PU Index map per MB. The indices in this map are w.r.t picture pu array and not 759*495ae853SAndroid Build Coastguard Worker * w.r.t MB pu array. 760*495ae853SAndroid Build Coastguard Worker * This will be used during mv prediction and since neighbors will have different MB pu map 761*495ae853SAndroid Build Coastguard Worker * it will be easier if they all have indices w.r.t picture level PU array rather than MB level 762*495ae853SAndroid Build Coastguard Worker * PU array. 763*495ae853SAndroid Build Coastguard Worker * pu1_pic_pu_map is map w.r.t MB's enc_pu_t array 764*495ae853SAndroid Build Coastguard Worker */ 765*495ae853SAndroid Build Coastguard Worker UWORD32 *pu4_pic_pu_idx_map; 766*495ae853SAndroid Build Coastguard Worker 767*495ae853SAndroid Build Coastguard Worker /** 768*495ae853SAndroid Build Coastguard Worker * Pointer to pu_map for the current frame being parsed 769*495ae853SAndroid Build Coastguard Worker * where MVs and Intra pred modes will be updated 770*495ae853SAndroid Build Coastguard Worker */ 771*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_pic_pu_map; 772*495ae853SAndroid Build Coastguard Worker 773*495ae853SAndroid Build Coastguard Worker /** 774*495ae853SAndroid Build Coastguard Worker * PU count in current MB 775*495ae853SAndroid Build Coastguard Worker */ 776*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_pu_cnt; 777*495ae853SAndroid Build Coastguard Worker 778*495ae853SAndroid Build Coastguard Worker /** 779*495ae853SAndroid Build Coastguard Worker * PU count in current MB 780*495ae853SAndroid Build Coastguard Worker */ 781*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_start_pu_idx; 782*495ae853SAndroid Build Coastguard Worker 783*495ae853SAndroid Build Coastguard Worker /** 784*495ae853SAndroid Build Coastguard Worker * Top availability for current MB level 785*495ae853SAndroid Build Coastguard Worker */ 786*495ae853SAndroid Build Coastguard Worker UWORD8 u1_top_mb_avail; 787*495ae853SAndroid Build Coastguard Worker 788*495ae853SAndroid Build Coastguard Worker /** 789*495ae853SAndroid Build Coastguard Worker * Top right availability for current MB level 790*495ae853SAndroid Build Coastguard Worker */ 791*495ae853SAndroid Build Coastguard Worker UWORD8 u1_top_rt_mb_avail; 792*495ae853SAndroid Build Coastguard Worker /** 793*495ae853SAndroid Build Coastguard Worker * Top left availability for current MB level 794*495ae853SAndroid Build Coastguard Worker */ 795*495ae853SAndroid Build Coastguard Worker UWORD8 u1_top_lt_mb_avail; 796*495ae853SAndroid Build Coastguard Worker /** 797*495ae853SAndroid Build Coastguard Worker * left availability for current MB level 798*495ae853SAndroid Build Coastguard Worker */ 799*495ae853SAndroid Build Coastguard Worker UWORD8 u1_left_mb_avail; 800*495ae853SAndroid Build Coastguard Worker 801*495ae853SAndroid Build Coastguard Worker }mv_ctxt_t; 802*495ae853SAndroid Build Coastguard Worker 803*495ae853SAndroid Build Coastguard Worker typedef struct 804*495ae853SAndroid Build Coastguard Worker { 805*495ae853SAndroid Build Coastguard Worker /** 806*495ae853SAndroid Build Coastguard Worker * MB's x position within a picture in raster scan in MB units 807*495ae853SAndroid Build Coastguard Worker */ 808*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_x; 809*495ae853SAndroid Build Coastguard Worker 810*495ae853SAndroid Build Coastguard Worker /** 811*495ae853SAndroid Build Coastguard Worker * MB's y position within a picture in raster scan in MB units 812*495ae853SAndroid Build Coastguard Worker */ 813*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_y; 814*495ae853SAndroid Build Coastguard Worker 815*495ae853SAndroid Build Coastguard Worker /** 816*495ae853SAndroid Build Coastguard Worker * MB's x position within a Slice in raster scan in MB units 817*495ae853SAndroid Build Coastguard Worker */ 818*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_slice_x; 819*495ae853SAndroid Build Coastguard Worker 820*495ae853SAndroid Build Coastguard Worker /** 821*495ae853SAndroid Build Coastguard Worker * MB's y position within a Slice in raster scan in MB units 822*495ae853SAndroid Build Coastguard Worker */ 823*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_slice_y; 824*495ae853SAndroid Build Coastguard Worker 825*495ae853SAndroid Build Coastguard Worker /** 826*495ae853SAndroid Build Coastguard Worker * Vertical strength, Two bits per edge. 827*495ae853SAndroid Build Coastguard Worker * Stored in format. BS[15] | BS[14] | .. |BS[0] 828*495ae853SAndroid Build Coastguard Worker */ 829*495ae853SAndroid Build Coastguard Worker UWORD32 *pu4_pic_vert_bs; 830*495ae853SAndroid Build Coastguard Worker 831*495ae853SAndroid Build Coastguard Worker /** 832*495ae853SAndroid Build Coastguard Worker * Boundary strength, Two bits per edge. 833*495ae853SAndroid Build Coastguard Worker * Stored in format. BS[15] | BS[14] | .. |BS[0] 834*495ae853SAndroid Build Coastguard Worker */ 835*495ae853SAndroid Build Coastguard Worker UWORD32 *pu4_pic_horz_bs; 836*495ae853SAndroid Build Coastguard Worker 837*495ae853SAndroid Build Coastguard Worker /** 838*495ae853SAndroid Build Coastguard Worker * Qp array stored for each mb 839*495ae853SAndroid Build Coastguard Worker */ 840*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_pic_qp; 841*495ae853SAndroid Build Coastguard Worker 842*495ae853SAndroid Build Coastguard Worker }bs_ctxt_t; 843*495ae853SAndroid Build Coastguard Worker 844*495ae853SAndroid Build Coastguard Worker typedef struct 845*495ae853SAndroid Build Coastguard Worker { 846*495ae853SAndroid Build Coastguard Worker /** 847*495ae853SAndroid Build Coastguard Worker * MB's x position within a picture in raster scan in MB units 848*495ae853SAndroid Build Coastguard Worker */ 849*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_x; 850*495ae853SAndroid Build Coastguard Worker 851*495ae853SAndroid Build Coastguard Worker /** 852*495ae853SAndroid Build Coastguard Worker * MB's y position within a picture in raster scan in MB units 853*495ae853SAndroid Build Coastguard Worker */ 854*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_y; 855*495ae853SAndroid Build Coastguard Worker 856*495ae853SAndroid Build Coastguard Worker /** 857*495ae853SAndroid Build Coastguard Worker * structure that contains BS and QP frame level arrays 858*495ae853SAndroid Build Coastguard Worker */ 859*495ae853SAndroid Build Coastguard Worker bs_ctxt_t s_bs_ctxt; 860*495ae853SAndroid Build Coastguard Worker 861*495ae853SAndroid Build Coastguard Worker /** 862*495ae853SAndroid Build Coastguard Worker * Pointer to 0th luma pixel in current pic 863*495ae853SAndroid Build Coastguard Worker */ 864*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_cur_pic_luma; 865*495ae853SAndroid Build Coastguard Worker 866*495ae853SAndroid Build Coastguard Worker /** 867*495ae853SAndroid Build Coastguard Worker * Pointer to 0th chroma pixel in current pic 868*495ae853SAndroid Build Coastguard Worker */ 869*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_cur_pic_chroma; 870*495ae853SAndroid Build Coastguard Worker 871*495ae853SAndroid Build Coastguard Worker /** 872*495ae853SAndroid Build Coastguard Worker * Points to the array of slice indices which is used to identify the slice 873*495ae853SAndroid Build Coastguard Worker * to which each MB in a frame belongs. 874*495ae853SAndroid Build Coastguard Worker */ 875*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_slice_idx; 876*495ae853SAndroid Build Coastguard Worker 877*495ae853SAndroid Build Coastguard Worker }deblk_ctxt_t; 878*495ae853SAndroid Build Coastguard Worker 879*495ae853SAndroid Build Coastguard Worker 880*495ae853SAndroid Build Coastguard Worker /** 881*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 882*495ae853SAndroid Build Coastguard Worker * @brief Structure to hold data and flags for 'n' mb processing for 883*495ae853SAndroid Build Coastguard Worker * deblocking , padding and half pel generation. 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 * MB's x position last processed + 1 890*495ae853SAndroid Build Coastguard Worker */ 891*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_x; 892*495ae853SAndroid Build Coastguard Worker 893*495ae853SAndroid Build Coastguard Worker /** 894*495ae853SAndroid Build Coastguard Worker * MB's y position ,current processing. 895*495ae853SAndroid Build Coastguard Worker */ 896*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_y; 897*495ae853SAndroid Build Coastguard Worker 898*495ae853SAndroid Build Coastguard Worker /** 899*495ae853SAndroid Build Coastguard Worker * Number of MBs processed in a stretch 900*495ae853SAndroid Build Coastguard Worker */ 901*495ae853SAndroid Build Coastguard Worker WORD32 i4_n_mbs; 902*495ae853SAndroid Build Coastguard Worker 903*495ae853SAndroid Build Coastguard Worker }n_mb_process_ctxt_t; 904*495ae853SAndroid Build Coastguard Worker 905*495ae853SAndroid Build Coastguard Worker 906*495ae853SAndroid Build Coastguard Worker /** 907*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 908*495ae853SAndroid Build Coastguard Worker * @brief Structure to hold coefficient info for a 4x4 subblock. 909*495ae853SAndroid Build Coastguard Worker * The following can be used to type-cast coefficient data that is stored 910*495ae853SAndroid Build Coastguard Worker * per subblock. Note that though i2_level is shown as an array that 911*495ae853SAndroid Build Coastguard Worker * holds 16 coefficients, only the first few entries will be valid. Next 912*495ae853SAndroid Build Coastguard Worker * subblocks data starts after the valid number of coefficients. Number 913*495ae853SAndroid Build Coastguard Worker * of non-zero coefficients will be derived using number of non-zero bits 914*495ae853SAndroid Build Coastguard Worker * in sig coeff map 915*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 916*495ae853SAndroid Build Coastguard Worker */ 917*495ae853SAndroid Build Coastguard Worker typedef struct 918*495ae853SAndroid Build Coastguard Worker { 919*495ae853SAndroid Build Coastguard Worker /** 920*495ae853SAndroid Build Coastguard Worker * significant coefficient map and nnz are packed in 921*495ae853SAndroid Build Coastguard Worker * to msb (2 bytes) and lsb (2 bytes) respectively 922*495ae853SAndroid Build Coastguard Worker */ 923*495ae853SAndroid Build Coastguard Worker WORD32 i4_sig_map_nnz; 924*495ae853SAndroid Build Coastguard Worker 925*495ae853SAndroid Build Coastguard Worker /** 926*495ae853SAndroid Build Coastguard Worker * array of non zero residue coefficients 927*495ae853SAndroid Build Coastguard Worker */ 928*495ae853SAndroid Build Coastguard Worker WORD16 ai2_residue[16]; 929*495ae853SAndroid Build Coastguard Worker 930*495ae853SAndroid Build Coastguard Worker }tu_sblk_coeff_data_t; 931*495ae853SAndroid Build Coastguard Worker 932*495ae853SAndroid Build Coastguard Worker /** 933*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 934*495ae853SAndroid Build Coastguard Worker * @brief Structure contains few common state variables such as MB indices, 935*495ae853SAndroid Build Coastguard Worker * current SPS, PPS etc which are to be used in the entropy thread. By keeping 936*495ae853SAndroid Build Coastguard Worker * it a different structure it is being explicitly signaled that these 937*495ae853SAndroid Build Coastguard Worker * variables are specific to entropy threads context and other threads should 938*495ae853SAndroid Build Coastguard Worker * not update these elements 939*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 940*495ae853SAndroid Build Coastguard Worker */ 941*495ae853SAndroid Build Coastguard Worker typedef struct 942*495ae853SAndroid Build Coastguard Worker { 943*495ae853SAndroid Build Coastguard Worker /** 944*495ae853SAndroid Build Coastguard Worker * Pointer to the cabac context 945*495ae853SAndroid Build Coastguard Worker */ 946*495ae853SAndroid Build Coastguard Worker cabac_ctxt_t *ps_cabac; 947*495ae853SAndroid Build Coastguard Worker 948*495ae853SAndroid Build Coastguard Worker /** 949*495ae853SAndroid Build Coastguard Worker * start of frame / start of slice flag 950*495ae853SAndroid Build Coastguard Worker */ 951*495ae853SAndroid Build Coastguard Worker WORD32 i4_sof; 952*495ae853SAndroid Build Coastguard Worker 953*495ae853SAndroid Build Coastguard Worker /** 954*495ae853SAndroid Build Coastguard Worker * end of frame / end of slice flag 955*495ae853SAndroid Build Coastguard Worker */ 956*495ae853SAndroid Build Coastguard Worker WORD32 i4_eof; 957*495ae853SAndroid Build Coastguard Worker 958*495ae853SAndroid Build Coastguard Worker /** 959*495ae853SAndroid Build Coastguard Worker * generate header upon request 960*495ae853SAndroid Build Coastguard Worker */ 961*495ae853SAndroid Build Coastguard Worker WORD32 i4_gen_header; 962*495ae853SAndroid Build Coastguard Worker 963*495ae853SAndroid Build Coastguard Worker /** 964*495ae853SAndroid Build Coastguard Worker * seq_parameter_set_id 965*495ae853SAndroid Build Coastguard Worker */ 966*495ae853SAndroid Build Coastguard Worker UWORD32 u4_sps_id; 967*495ae853SAndroid Build Coastguard Worker 968*495ae853SAndroid Build Coastguard Worker /** 969*495ae853SAndroid Build Coastguard Worker * Pointer to base of sequence parameter set structure array 970*495ae853SAndroid Build Coastguard Worker */ 971*495ae853SAndroid Build Coastguard Worker sps_t *ps_sps_base; 972*495ae853SAndroid Build Coastguard Worker 973*495ae853SAndroid Build Coastguard Worker /** 974*495ae853SAndroid Build Coastguard Worker * pic_parameter_set_id 975*495ae853SAndroid Build Coastguard Worker */ 976*495ae853SAndroid Build Coastguard Worker UWORD32 u4_pps_id; 977*495ae853SAndroid Build Coastguard Worker 978*495ae853SAndroid Build Coastguard Worker /** 979*495ae853SAndroid Build Coastguard Worker * Pointer to base of Picture parameter set structure array 980*495ae853SAndroid Build Coastguard Worker */ 981*495ae853SAndroid Build Coastguard Worker pps_t *ps_pps_base; 982*495ae853SAndroid Build Coastguard Worker 983*495ae853SAndroid Build Coastguard Worker /** 984*495ae853SAndroid Build Coastguard Worker * Current slice idx 985*495ae853SAndroid Build Coastguard Worker */ 986*495ae853SAndroid Build Coastguard Worker WORD32 i4_cur_slice_idx; 987*495ae853SAndroid Build Coastguard Worker 988*495ae853SAndroid Build Coastguard Worker /** 989*495ae853SAndroid Build Coastguard Worker * Points to the array of slice indices which is used to identify the independent slice 990*495ae853SAndroid Build Coastguard Worker * to which each MB in a frame belongs. 991*495ae853SAndroid Build Coastguard Worker */ 992*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_slice_idx; 993*495ae853SAndroid Build Coastguard Worker 994*495ae853SAndroid Build Coastguard Worker /** 995*495ae853SAndroid Build Coastguard Worker * Pointer to base of slice header structure array 996*495ae853SAndroid Build Coastguard Worker */ 997*495ae853SAndroid Build Coastguard Worker slice_header_t *ps_slice_hdr_base; 998*495ae853SAndroid Build Coastguard Worker 999*495ae853SAndroid Build Coastguard Worker /** 1000*495ae853SAndroid Build Coastguard Worker * entropy status 1001*495ae853SAndroid Build Coastguard Worker */ 1002*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_entropy_map; 1003*495ae853SAndroid Build Coastguard Worker 1004*495ae853SAndroid Build Coastguard Worker /** 1005*495ae853SAndroid Build Coastguard Worker * MB's x position within a picture in raster scan in MB units 1006*495ae853SAndroid Build Coastguard Worker */ 1007*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_x; 1008*495ae853SAndroid Build Coastguard Worker 1009*495ae853SAndroid Build Coastguard Worker /** 1010*495ae853SAndroid Build Coastguard Worker * MB's y position within a picture in raster scan in MB units 1011*495ae853SAndroid Build Coastguard Worker */ 1012*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_y; 1013*495ae853SAndroid Build Coastguard Worker 1014*495ae853SAndroid Build Coastguard Worker /** 1015*495ae853SAndroid Build Coastguard Worker * MB start address 1016*495ae853SAndroid Build Coastguard Worker */ 1017*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_cnt; 1018*495ae853SAndroid Build Coastguard Worker 1019*495ae853SAndroid Build Coastguard Worker /** 1020*495ae853SAndroid Build Coastguard Worker * MB start address 1021*495ae853SAndroid Build Coastguard Worker */ 1022*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_start_add; 1023*495ae853SAndroid Build Coastguard Worker 1024*495ae853SAndroid Build Coastguard Worker /** 1025*495ae853SAndroid Build Coastguard Worker * MB end address 1026*495ae853SAndroid Build Coastguard Worker */ 1027*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_end_add; 1028*495ae853SAndroid Build Coastguard Worker 1029*495ae853SAndroid Build Coastguard Worker /** 1030*495ae853SAndroid Build Coastguard Worker * Input width in mbs 1031*495ae853SAndroid Build Coastguard Worker */ 1032*495ae853SAndroid Build Coastguard Worker WORD32 i4_wd_mbs; 1033*495ae853SAndroid Build Coastguard Worker 1034*495ae853SAndroid Build Coastguard Worker /** 1035*495ae853SAndroid Build Coastguard Worker * Input height in mbs 1036*495ae853SAndroid Build Coastguard Worker */ 1037*495ae853SAndroid Build Coastguard Worker WORD32 i4_ht_mbs; 1038*495ae853SAndroid Build Coastguard Worker 1039*495ae853SAndroid Build Coastguard Worker /** 1040*495ae853SAndroid Build Coastguard Worker * Bitstream structure 1041*495ae853SAndroid Build Coastguard Worker */ 1042*495ae853SAndroid Build Coastguard Worker bitstrm_t *ps_bitstrm; 1043*495ae853SAndroid Build Coastguard Worker 1044*495ae853SAndroid Build Coastguard Worker /** 1045*495ae853SAndroid Build Coastguard Worker * transform_8x8_mode_flag 1046*495ae853SAndroid Build Coastguard Worker */ 1047*495ae853SAndroid Build Coastguard Worker WORD8 i1_transform_8x8_mode_flag; 1048*495ae853SAndroid Build Coastguard Worker 1049*495ae853SAndroid Build Coastguard Worker /** 1050*495ae853SAndroid Build Coastguard Worker * entropy_coding_mode_flag 1051*495ae853SAndroid Build Coastguard Worker */ 1052*495ae853SAndroid Build Coastguard Worker WORD8 u1_entropy_coding_mode_flag; 1053*495ae853SAndroid Build Coastguard Worker 1054*495ae853SAndroid Build Coastguard Worker /** 1055*495ae853SAndroid Build Coastguard Worker * Pointer to the top row nnz for luma 1056*495ae853SAndroid Build Coastguard Worker */ 1057*495ae853SAndroid Build Coastguard Worker UWORD8 (*pu1_top_nnz_luma)[4]; 1058*495ae853SAndroid Build Coastguard Worker 1059*495ae853SAndroid Build Coastguard Worker /** 1060*495ae853SAndroid Build Coastguard Worker * left nnz for luma 1061*495ae853SAndroid Build Coastguard Worker */ 1062*495ae853SAndroid Build Coastguard Worker UWORD32 u4_left_nnz_luma; 1063*495ae853SAndroid Build Coastguard Worker 1064*495ae853SAndroid Build Coastguard Worker /** 1065*495ae853SAndroid Build Coastguard Worker * Pointer to zero runs before for the mb 1066*495ae853SAndroid Build Coastguard Worker */ 1067*495ae853SAndroid Build Coastguard Worker UWORD8 au1_zero_run[16]; 1068*495ae853SAndroid Build Coastguard Worker 1069*495ae853SAndroid Build Coastguard Worker /** 1070*495ae853SAndroid Build Coastguard Worker * Pointer to the top row nnz for chroma 1071*495ae853SAndroid Build Coastguard Worker */ 1072*495ae853SAndroid Build Coastguard Worker UWORD8 (*pu1_top_nnz_cbcr)[4]; 1073*495ae853SAndroid Build Coastguard Worker 1074*495ae853SAndroid Build Coastguard Worker /** 1075*495ae853SAndroid Build Coastguard Worker * left nnz for chroma 1076*495ae853SAndroid Build Coastguard Worker */ 1077*495ae853SAndroid Build Coastguard Worker UWORD8 u4_left_nnz_cbcr; 1078*495ae853SAndroid Build Coastguard Worker 1079*495ae853SAndroid Build Coastguard Worker /** 1080*495ae853SAndroid Build Coastguard Worker * Pointer frame level mb subblock coeff data 1081*495ae853SAndroid Build Coastguard Worker */ 1082*495ae853SAndroid Build Coastguard Worker void *pv_pic_mb_coeff_data; 1083*495ae853SAndroid Build Coastguard Worker 1084*495ae853SAndroid Build Coastguard Worker /** 1085*495ae853SAndroid Build Coastguard Worker * Pointer to mb subblock coeff data and number of subblocks and scan idx 1086*495ae853SAndroid Build Coastguard Worker * Incremented each time a coded subblock is processed 1087*495ae853SAndroid Build Coastguard Worker */ 1088*495ae853SAndroid Build Coastguard Worker void *pv_mb_coeff_data; 1089*495ae853SAndroid Build Coastguard Worker 1090*495ae853SAndroid Build Coastguard Worker /** 1091*495ae853SAndroid Build Coastguard Worker * Pointer frame level mb header data 1092*495ae853SAndroid Build Coastguard Worker */ 1093*495ae853SAndroid Build Coastguard Worker void *pv_pic_mb_header_data; 1094*495ae853SAndroid Build Coastguard Worker 1095*495ae853SAndroid Build Coastguard Worker /** 1096*495ae853SAndroid Build Coastguard Worker * Pointer to mb header data and 1097*495ae853SAndroid Build Coastguard Worker * incremented each time a coded mb is encoded 1098*495ae853SAndroid Build Coastguard Worker */ 1099*495ae853SAndroid Build Coastguard Worker void *pv_mb_header_data; 1100*495ae853SAndroid Build Coastguard Worker 1101*495ae853SAndroid Build Coastguard Worker /** 1102*495ae853SAndroid Build Coastguard Worker * Error code during parse stage 1103*495ae853SAndroid Build Coastguard Worker */ 1104*495ae853SAndroid Build Coastguard Worker IH264E_ERROR_T i4_error_code; 1105*495ae853SAndroid Build Coastguard Worker 1106*495ae853SAndroid Build Coastguard Worker /** 1107*495ae853SAndroid Build Coastguard Worker * Void pointer to job context 1108*495ae853SAndroid Build Coastguard Worker */ 1109*495ae853SAndroid Build Coastguard Worker void *pv_proc_jobq, *pv_entropy_jobq; 1110*495ae853SAndroid Build Coastguard Worker 1111*495ae853SAndroid Build Coastguard Worker /** 1112*495ae853SAndroid Build Coastguard Worker * Flag to signal end of frame 1113*495ae853SAndroid Build Coastguard Worker */ 1114*495ae853SAndroid Build Coastguard Worker WORD32 i4_end_of_frame; 1115*495ae853SAndroid Build Coastguard Worker 1116*495ae853SAndroid Build Coastguard Worker /** 1117*495ae853SAndroid Build Coastguard Worker * Abs POC count of the frame 1118*495ae853SAndroid Build Coastguard Worker */ 1119*495ae853SAndroid Build Coastguard Worker WORD32 i4_abs_pic_order_cnt; 1120*495ae853SAndroid Build Coastguard Worker 1121*495ae853SAndroid Build Coastguard Worker /** 1122*495ae853SAndroid Build Coastguard Worker * mb skip run 1123*495ae853SAndroid Build Coastguard Worker */ 1124*495ae853SAndroid Build Coastguard Worker WORD32 *pi4_mb_skip_run; 1125*495ae853SAndroid Build Coastguard Worker 1126*495ae853SAndroid Build Coastguard Worker /** 1127*495ae853SAndroid Build Coastguard Worker * Flag to signal end of sequence 1128*495ae853SAndroid Build Coastguard Worker */ 1129*495ae853SAndroid Build Coastguard Worker UWORD32 u4_is_last; 1130*495ae853SAndroid Build Coastguard Worker 1131*495ae853SAndroid Build Coastguard Worker /** 1132*495ae853SAndroid Build Coastguard Worker * Lower 32bits of time-stamp corresponding to the buffer being encoded 1133*495ae853SAndroid Build Coastguard Worker */ 1134*495ae853SAndroid Build Coastguard Worker UWORD32 u4_timestamp_low; 1135*495ae853SAndroid Build Coastguard Worker 1136*495ae853SAndroid Build Coastguard Worker /** 1137*495ae853SAndroid Build Coastguard Worker * Upper 32bits of time-stamp corresponding to the buffer being encoded 1138*495ae853SAndroid Build Coastguard Worker */ 1139*495ae853SAndroid Build Coastguard Worker UWORD32 u4_timestamp_high; 1140*495ae853SAndroid Build Coastguard Worker 1141*495ae853SAndroid Build Coastguard Worker /** 1142*495ae853SAndroid Build Coastguard Worker * Current Picture count - used for synchronization 1143*495ae853SAndroid Build Coastguard Worker */ 1144*495ae853SAndroid Build Coastguard Worker WORD32 i4_pic_cnt; 1145*495ae853SAndroid Build Coastguard Worker 1146*495ae853SAndroid Build Coastguard Worker /** 1147*495ae853SAndroid Build Coastguard Worker * Number of bits consumed by header for I and P mb types 1148*495ae853SAndroid Build Coastguard Worker */ 1149*495ae853SAndroid Build Coastguard Worker UWORD32 u4_header_bits[MAX_MB_TYPE]; 1150*495ae853SAndroid Build Coastguard Worker 1151*495ae853SAndroid Build Coastguard Worker /** 1152*495ae853SAndroid Build Coastguard Worker * Number of bits consumed by residue for I and P mb types 1153*495ae853SAndroid Build Coastguard Worker */ 1154*495ae853SAndroid Build Coastguard Worker UWORD32 u4_residue_bits[MAX_MB_TYPE]; 1155*495ae853SAndroid Build Coastguard Worker 1156*495ae853SAndroid Build Coastguard Worker } entropy_ctxt_t; 1157*495ae853SAndroid Build Coastguard Worker 1158*495ae853SAndroid Build Coastguard Worker /** 1159*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1160*495ae853SAndroid Build Coastguard Worker * @brief macro block info. 1161*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1162*495ae853SAndroid Build Coastguard Worker */ 1163*495ae853SAndroid Build Coastguard Worker typedef struct 1164*495ae853SAndroid Build Coastguard Worker { 1165*495ae853SAndroid Build Coastguard Worker /** 1166*495ae853SAndroid Build Coastguard Worker * mb type 1167*495ae853SAndroid Build Coastguard Worker */ 1168*495ae853SAndroid Build Coastguard Worker UWORD16 u2_is_intra; 1169*495ae853SAndroid Build Coastguard Worker 1170*495ae853SAndroid Build Coastguard Worker /** 1171*495ae853SAndroid Build Coastguard Worker * mb type 1172*495ae853SAndroid Build Coastguard Worker */ 1173*495ae853SAndroid Build Coastguard Worker UWORD16 u2_mb_type; 1174*495ae853SAndroid Build Coastguard Worker 1175*495ae853SAndroid Build Coastguard Worker /** 1176*495ae853SAndroid Build Coastguard Worker * csbp 1177*495ae853SAndroid Build Coastguard Worker */ 1178*495ae853SAndroid Build Coastguard Worker UWORD32 u4_csbp; 1179*495ae853SAndroid Build Coastguard Worker 1180*495ae853SAndroid Build Coastguard Worker /** 1181*495ae853SAndroid Build Coastguard Worker * mb distortion 1182*495ae853SAndroid Build Coastguard Worker */ 1183*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_distortion; 1184*495ae853SAndroid Build Coastguard Worker 1185*495ae853SAndroid Build Coastguard Worker }mb_info_t; 1186*495ae853SAndroid Build Coastguard Worker 1187*495ae853SAndroid Build Coastguard Worker /** 1188*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1189*495ae853SAndroid Build Coastguard Worker * @brief mb_hdr structures to access first few common elements of above 1190*495ae853SAndroid Build Coastguard Worker * structures 1191*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1192*495ae853SAndroid Build Coastguard Worker */ 1193*495ae853SAndroid Build Coastguard Worker 1194*495ae853SAndroid Build Coastguard Worker typedef struct 1195*495ae853SAndroid Build Coastguard Worker { 1196*495ae853SAndroid Build Coastguard Worker /** 1197*495ae853SAndroid Build Coastguard Worker * mb type and mode 1198*495ae853SAndroid Build Coastguard Worker */ 1199*495ae853SAndroid Build Coastguard Worker UWORD8 u1_mb_type_mode; 1200*495ae853SAndroid Build Coastguard Worker 1201*495ae853SAndroid Build Coastguard Worker /** 1202*495ae853SAndroid Build Coastguard Worker * CBP 1203*495ae853SAndroid Build Coastguard Worker */ 1204*495ae853SAndroid Build Coastguard Worker UWORD8 u1_cbp; 1205*495ae853SAndroid Build Coastguard Worker 1206*495ae853SAndroid Build Coastguard Worker /** 1207*495ae853SAndroid Build Coastguard Worker * MB qp delta 1208*495ae853SAndroid Build Coastguard Worker */ 1209*495ae853SAndroid Build Coastguard Worker UWORD8 u1_mb_qp_delta; 1210*495ae853SAndroid Build Coastguard Worker 1211*495ae853SAndroid Build Coastguard Worker /** 1212*495ae853SAndroid Build Coastguard Worker * Element to align structure to 2 byte boundary 1213*495ae853SAndroid Build Coastguard Worker */ 1214*495ae853SAndroid Build Coastguard Worker UWORD8 u1_pad; 1215*495ae853SAndroid Build Coastguard Worker }mb_hdr_common_t; 1216*495ae853SAndroid Build Coastguard Worker 1217*495ae853SAndroid Build Coastguard Worker /** 1218*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1219*495ae853SAndroid Build Coastguard Worker * @brief macro block info for I4x4 MB 1220*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1221*495ae853SAndroid Build Coastguard Worker */ 1222*495ae853SAndroid Build Coastguard Worker typedef struct 1223*495ae853SAndroid Build Coastguard Worker { 1224*495ae853SAndroid Build Coastguard Worker /** 1225*495ae853SAndroid Build Coastguard Worker * Common MB header params 1226*495ae853SAndroid Build Coastguard Worker */ 1227*495ae853SAndroid Build Coastguard Worker mb_hdr_common_t common; 1228*495ae853SAndroid Build Coastguard Worker 1229*495ae853SAndroid Build Coastguard Worker /** 1230*495ae853SAndroid Build Coastguard Worker * Sub block modes, 2 modes per byte 1231*495ae853SAndroid Build Coastguard Worker */ 1232*495ae853SAndroid Build Coastguard Worker UWORD8 au1_sub_blk_modes[8]; 1233*495ae853SAndroid Build Coastguard Worker }mb_hdr_i4x4_t; 1234*495ae853SAndroid Build Coastguard Worker 1235*495ae853SAndroid Build Coastguard Worker /** 1236*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1237*495ae853SAndroid Build Coastguard Worker * @brief macro block info for I8x8 MB 1238*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1239*495ae853SAndroid Build Coastguard Worker */ 1240*495ae853SAndroid Build Coastguard Worker typedef struct 1241*495ae853SAndroid Build Coastguard Worker { 1242*495ae853SAndroid Build Coastguard Worker /** 1243*495ae853SAndroid Build Coastguard Worker * Common MB header params 1244*495ae853SAndroid Build Coastguard Worker */ 1245*495ae853SAndroid Build Coastguard Worker mb_hdr_common_t common; 1246*495ae853SAndroid Build Coastguard Worker 1247*495ae853SAndroid Build Coastguard Worker 1248*495ae853SAndroid Build Coastguard Worker /** 1249*495ae853SAndroid Build Coastguard Worker * Sub block modes, 2 modes per byte 1250*495ae853SAndroid Build Coastguard Worker */ 1251*495ae853SAndroid Build Coastguard Worker UWORD8 au1_sub_blk_modes[2]; 1252*495ae853SAndroid Build Coastguard Worker }mb_hdr_i8x8_t; 1253*495ae853SAndroid Build Coastguard Worker 1254*495ae853SAndroid Build Coastguard Worker /** 1255*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1256*495ae853SAndroid Build Coastguard Worker * @brief macro block info for I16x16 MB 1257*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1258*495ae853SAndroid Build Coastguard Worker */ 1259*495ae853SAndroid Build Coastguard Worker typedef struct 1260*495ae853SAndroid Build Coastguard Worker { 1261*495ae853SAndroid Build Coastguard Worker /** 1262*495ae853SAndroid Build Coastguard Worker * Common MB header params 1263*495ae853SAndroid Build Coastguard Worker */ 1264*495ae853SAndroid Build Coastguard Worker mb_hdr_common_t common; 1265*495ae853SAndroid Build Coastguard Worker 1266*495ae853SAndroid Build Coastguard Worker }mb_hdr_i16x16_t; 1267*495ae853SAndroid Build Coastguard Worker 1268*495ae853SAndroid Build Coastguard Worker /** 1269*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1270*495ae853SAndroid Build Coastguard Worker * @brief macro block info for P16x16 MB 1271*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1272*495ae853SAndroid Build Coastguard Worker */ 1273*495ae853SAndroid Build Coastguard Worker typedef struct 1274*495ae853SAndroid Build Coastguard Worker { 1275*495ae853SAndroid Build Coastguard Worker /** 1276*495ae853SAndroid Build Coastguard Worker * Common MB header params 1277*495ae853SAndroid Build Coastguard Worker */ 1278*495ae853SAndroid Build Coastguard Worker mb_hdr_common_t common; 1279*495ae853SAndroid Build Coastguard Worker 1280*495ae853SAndroid Build Coastguard Worker /** 1281*495ae853SAndroid Build Coastguard Worker * MV 1282*495ae853SAndroid Build Coastguard Worker */ 1283*495ae853SAndroid Build Coastguard Worker WORD16 ai2_mv[2]; 1284*495ae853SAndroid Build Coastguard Worker }mb_hdr_p16x16_t; 1285*495ae853SAndroid Build Coastguard Worker 1286*495ae853SAndroid Build Coastguard Worker /** 1287*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1288*495ae853SAndroid Build Coastguard Worker * @brief macro block info for PSKIP MB 1289*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1290*495ae853SAndroid Build Coastguard Worker */ 1291*495ae853SAndroid Build Coastguard Worker typedef struct 1292*495ae853SAndroid Build Coastguard Worker { 1293*495ae853SAndroid Build Coastguard Worker /** 1294*495ae853SAndroid Build Coastguard Worker * Common MB header params 1295*495ae853SAndroid Build Coastguard Worker */ 1296*495ae853SAndroid Build Coastguard Worker mb_hdr_common_t common; 1297*495ae853SAndroid Build Coastguard Worker 1298*495ae853SAndroid Build Coastguard Worker }mb_hdr_pskip_t; 1299*495ae853SAndroid Build Coastguard Worker 1300*495ae853SAndroid Build Coastguard Worker /** 1301*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1302*495ae853SAndroid Build Coastguard Worker * @brief macro block info for B16x16 MB 1303*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1304*495ae853SAndroid Build Coastguard Worker */ 1305*495ae853SAndroid Build Coastguard Worker typedef struct 1306*495ae853SAndroid Build Coastguard Worker { 1307*495ae853SAndroid Build Coastguard Worker /** 1308*495ae853SAndroid Build Coastguard Worker * Common MB header params 1309*495ae853SAndroid Build Coastguard Worker */ 1310*495ae853SAndroid Build Coastguard Worker mb_hdr_common_t common; 1311*495ae853SAndroid Build Coastguard Worker 1312*495ae853SAndroid Build Coastguard Worker 1313*495ae853SAndroid Build Coastguard Worker /** 1314*495ae853SAndroid Build Coastguard Worker * MV 1315*495ae853SAndroid Build Coastguard Worker */ 1316*495ae853SAndroid Build Coastguard Worker WORD16 ai2_mv[2][2]; 1317*495ae853SAndroid Build Coastguard Worker }mb_hdr_b16x16_t; 1318*495ae853SAndroid Build Coastguard Worker 1319*495ae853SAndroid Build Coastguard Worker /** 1320*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1321*495ae853SAndroid Build Coastguard Worker * @brief macro block info for BDIRECT MB 1322*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1323*495ae853SAndroid Build Coastguard Worker */ 1324*495ae853SAndroid Build Coastguard Worker typedef struct 1325*495ae853SAndroid Build Coastguard Worker { 1326*495ae853SAndroid Build Coastguard Worker /** 1327*495ae853SAndroid Build Coastguard Worker * Common MB header params 1328*495ae853SAndroid Build Coastguard Worker */ 1329*495ae853SAndroid Build Coastguard Worker mb_hdr_common_t common; 1330*495ae853SAndroid Build Coastguard Worker 1331*495ae853SAndroid Build Coastguard Worker }mb_hdr_bdirect_t; 1332*495ae853SAndroid Build Coastguard Worker 1333*495ae853SAndroid Build Coastguard Worker /** 1334*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1335*495ae853SAndroid Build Coastguard Worker * @brief macro block info for PSKIP MB 1336*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1337*495ae853SAndroid Build Coastguard Worker */ 1338*495ae853SAndroid Build Coastguard Worker typedef struct 1339*495ae853SAndroid Build Coastguard Worker { 1340*495ae853SAndroid Build Coastguard Worker /** 1341*495ae853SAndroid Build Coastguard Worker * Common MB header params 1342*495ae853SAndroid Build Coastguard Worker */ 1343*495ae853SAndroid Build Coastguard Worker mb_hdr_common_t common; 1344*495ae853SAndroid Build Coastguard Worker 1345*495ae853SAndroid Build Coastguard Worker }mb_hdr_bskip_t; 1346*495ae853SAndroid Build Coastguard Worker 1347*495ae853SAndroid Build Coastguard Worker /** 1348*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1349*495ae853SAndroid Build Coastguard Worker * @brief Union of mb_hdr structures for size calculation 1350*495ae853SAndroid Build Coastguard Worker * and to access first few common elements 1351*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1352*495ae853SAndroid Build Coastguard Worker */ 1353*495ae853SAndroid Build Coastguard Worker 1354*495ae853SAndroid Build Coastguard Worker typedef union 1355*495ae853SAndroid Build Coastguard Worker { 1356*495ae853SAndroid Build Coastguard Worker mb_hdr_i4x4_t mb_hdr_i4x4; 1357*495ae853SAndroid Build Coastguard Worker mb_hdr_i8x8_t mb_hdr_i8x8; 1358*495ae853SAndroid Build Coastguard Worker mb_hdr_i16x16_t mb_hdr_i16x16; 1359*495ae853SAndroid Build Coastguard Worker mb_hdr_p16x16_t mb_hdr_p16x16; 1360*495ae853SAndroid Build Coastguard Worker mb_hdr_pskip_t mb_hdr_pskip; 1361*495ae853SAndroid Build Coastguard Worker mb_hdr_b16x16_t mb_hdr_b16x16; 1362*495ae853SAndroid Build Coastguard Worker mb_hdr_bdirect_t mb_hdr_bdirect; 1363*495ae853SAndroid Build Coastguard Worker mb_hdr_bskip_t mb_hdr_bskip; 1364*495ae853SAndroid Build Coastguard Worker }mb_hdr_t; 1365*495ae853SAndroid Build Coastguard Worker /** 1366*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1367*495ae853SAndroid Build Coastguard Worker * @brief structure presenting the neighbor availability of a mb 1368*495ae853SAndroid Build Coastguard Worker * or subblk or any other partition 1369*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1370*495ae853SAndroid Build Coastguard Worker */ 1371*495ae853SAndroid Build Coastguard Worker typedef struct 1372*495ae853SAndroid Build Coastguard Worker { 1373*495ae853SAndroid Build Coastguard Worker /** 1374*495ae853SAndroid Build Coastguard Worker * left blk/subblk/partition 1375*495ae853SAndroid Build Coastguard Worker */ 1376*495ae853SAndroid Build Coastguard Worker UWORD8 u1_mb_a; 1377*495ae853SAndroid Build Coastguard Worker 1378*495ae853SAndroid Build Coastguard Worker /** 1379*495ae853SAndroid Build Coastguard Worker * top blk/subblk/partition 1380*495ae853SAndroid Build Coastguard Worker */ 1381*495ae853SAndroid Build Coastguard Worker UWORD8 u1_mb_b; 1382*495ae853SAndroid Build Coastguard Worker 1383*495ae853SAndroid Build Coastguard Worker /** 1384*495ae853SAndroid Build Coastguard Worker * topright blk/subblk/partition 1385*495ae853SAndroid Build Coastguard Worker */ 1386*495ae853SAndroid Build Coastguard Worker UWORD8 u1_mb_c; 1387*495ae853SAndroid Build Coastguard Worker 1388*495ae853SAndroid Build Coastguard Worker /** 1389*495ae853SAndroid Build Coastguard Worker * topleft blk/subblk/partition 1390*495ae853SAndroid Build Coastguard Worker */ 1391*495ae853SAndroid Build Coastguard Worker UWORD8 u1_mb_d; 1392*495ae853SAndroid Build Coastguard Worker 1393*495ae853SAndroid Build Coastguard Worker }block_neighbors_t; 1394*495ae853SAndroid Build Coastguard Worker 1395*495ae853SAndroid Build Coastguard Worker /** 1396*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1397*495ae853SAndroid Build Coastguard Worker * @brief MB info related variables used during NMB processing 1398*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1399*495ae853SAndroid Build Coastguard Worker */ 1400*495ae853SAndroid Build Coastguard Worker typedef struct 1401*495ae853SAndroid Build Coastguard Worker { 1402*495ae853SAndroid Build Coastguard Worker UWORD32 u4_mb_type; 1403*495ae853SAndroid Build Coastguard Worker UWORD32 u4_min_sad; 1404*495ae853SAndroid Build Coastguard Worker UWORD32 u4_min_sad_reached; 1405*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_cost; 1406*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_distortion; 1407*495ae853SAndroid Build Coastguard Worker 1408*495ae853SAndroid Build Coastguard Worker enc_pu_mv_t as_skip_mv[4]; 1409*495ae853SAndroid Build Coastguard Worker 1410*495ae853SAndroid Build Coastguard Worker enc_pu_mv_t as_pred_mv[2]; 1411*495ae853SAndroid Build Coastguard Worker 1412*495ae853SAndroid Build Coastguard Worker block_neighbors_t s_ngbr_avbl; 1413*495ae853SAndroid Build Coastguard Worker 1414*495ae853SAndroid Build Coastguard Worker /* 1415*495ae853SAndroid Build Coastguard Worker * Buffer to hold best subpel buffer in each MB of NMB 1416*495ae853SAndroid Build Coastguard Worker */ 1417*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_best_sub_pel_buf; 1418*495ae853SAndroid Build Coastguard Worker 1419*495ae853SAndroid Build Coastguard Worker /* 1420*495ae853SAndroid Build Coastguard Worker * Stride for subpel buffer 1421*495ae853SAndroid Build Coastguard Worker */ 1422*495ae853SAndroid Build Coastguard Worker UWORD32 u4_bst_spel_buf_strd; 1423*495ae853SAndroid Build Coastguard Worker 1424*495ae853SAndroid Build Coastguard Worker }mb_info_nmb_t; 1425*495ae853SAndroid Build Coastguard Worker 1426*495ae853SAndroid Build Coastguard Worker /** 1427*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1428*495ae853SAndroid Build Coastguard Worker * @brief Pixel processing thread context 1429*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 1430*495ae853SAndroid Build Coastguard Worker */ 1431*495ae853SAndroid Build Coastguard Worker struct _proc_t 1432*495ae853SAndroid Build Coastguard Worker { 1433*495ae853SAndroid Build Coastguard Worker /** 1434*495ae853SAndroid Build Coastguard Worker * entropy context 1435*495ae853SAndroid Build Coastguard Worker */ 1436*495ae853SAndroid Build Coastguard Worker entropy_ctxt_t s_entropy; 1437*495ae853SAndroid Build Coastguard Worker 1438*495ae853SAndroid Build Coastguard Worker /** 1439*495ae853SAndroid Build Coastguard Worker * me context 1440*495ae853SAndroid Build Coastguard Worker */ 1441*495ae853SAndroid Build Coastguard Worker me_ctxt_t s_me_ctxt; 1442*495ae853SAndroid Build Coastguard Worker 1443*495ae853SAndroid Build Coastguard Worker /** 1444*495ae853SAndroid Build Coastguard Worker * Pointer to codec context 1445*495ae853SAndroid Build Coastguard Worker */ 1446*495ae853SAndroid Build Coastguard Worker codec_t *ps_codec; 1447*495ae853SAndroid Build Coastguard Worker 1448*495ae853SAndroid Build Coastguard Worker /** 1449*495ae853SAndroid Build Coastguard Worker * N mb process contest 1450*495ae853SAndroid Build Coastguard Worker */ 1451*495ae853SAndroid Build Coastguard Worker n_mb_process_ctxt_t s_n_mb_ctxt; 1452*495ae853SAndroid Build Coastguard Worker 1453*495ae853SAndroid Build Coastguard Worker /** 1454*495ae853SAndroid Build Coastguard Worker * Source pointer to current MB luma 1455*495ae853SAndroid Build Coastguard Worker */ 1456*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_src_buf_luma; 1457*495ae853SAndroid Build Coastguard Worker 1458*495ae853SAndroid Build Coastguard Worker /** 1459*495ae853SAndroid Build Coastguard Worker * Source pointer to current MB chroma 1460*495ae853SAndroid Build Coastguard Worker */ 1461*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_src_buf_chroma; 1462*495ae853SAndroid Build Coastguard Worker 1463*495ae853SAndroid Build Coastguard Worker /** 1464*495ae853SAndroid Build Coastguard Worker * Recon pointer to current MB luma 1465*495ae853SAndroid Build Coastguard Worker */ 1466*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_rec_buf_luma; 1467*495ae853SAndroid Build Coastguard Worker 1468*495ae853SAndroid Build Coastguard Worker /** 1469*495ae853SAndroid Build Coastguard Worker * Recon pointer to current MB chroma 1470*495ae853SAndroid Build Coastguard Worker */ 1471*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_rec_buf_chroma; 1472*495ae853SAndroid Build Coastguard Worker 1473*495ae853SAndroid Build Coastguard Worker /** 1474*495ae853SAndroid Build Coastguard Worker * Ref pointer to current MB luma 1475*495ae853SAndroid Build Coastguard Worker */ 1476*495ae853SAndroid Build Coastguard Worker UWORD8 *apu1_ref_buf_luma[MAX_REF_PIC_CNT]; 1477*495ae853SAndroid Build Coastguard Worker 1478*495ae853SAndroid Build Coastguard Worker /** 1479*495ae853SAndroid Build Coastguard Worker * Ref pointer to current MB chroma 1480*495ae853SAndroid Build Coastguard Worker */ 1481*495ae853SAndroid Build Coastguard Worker UWORD8 *apu1_ref_buf_chroma[MAX_REF_PIC_CNT]; 1482*495ae853SAndroid Build Coastguard Worker 1483*495ae853SAndroid Build Coastguard Worker /** 1484*495ae853SAndroid Build Coastguard Worker * pointer to luma plane of input buffer (base :: mb (0,0)) 1485*495ae853SAndroid Build Coastguard Worker */ 1486*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_src_buf_luma_base; 1487*495ae853SAndroid Build Coastguard Worker 1488*495ae853SAndroid Build Coastguard Worker /** 1489*495ae853SAndroid Build Coastguard Worker * pointer to luma plane of reconstructed buffer (base :: mb (0,0)) 1490*495ae853SAndroid Build Coastguard Worker */ 1491*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_rec_buf_luma_base; 1492*495ae853SAndroid Build Coastguard Worker 1493*495ae853SAndroid Build Coastguard Worker /** 1494*495ae853SAndroid Build Coastguard Worker * pointer to luma plane of ref buffer (base :: mb (0,0)) 1495*495ae853SAndroid Build Coastguard Worker */ 1496*495ae853SAndroid Build Coastguard Worker UWORD8 *apu1_ref_buf_luma_base[MAX_REF_PIC_CNT]; 1497*495ae853SAndroid Build Coastguard Worker 1498*495ae853SAndroid Build Coastguard Worker /** 1499*495ae853SAndroid Build Coastguard Worker * pointer to chroma plane of input buffer (base :: mb (0,0)) 1500*495ae853SAndroid Build Coastguard Worker */ 1501*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_src_buf_chroma_base; 1502*495ae853SAndroid Build Coastguard Worker 1503*495ae853SAndroid Build Coastguard Worker /* 1504*495ae853SAndroid Build Coastguard Worker * Buffer for color space conversion of luma 1505*495ae853SAndroid Build Coastguard Worker */ 1506*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_y_csc_buf; 1507*495ae853SAndroid Build Coastguard Worker 1508*495ae853SAndroid Build Coastguard Worker /* 1509*495ae853SAndroid Build Coastguard Worker * Buffer for color space conversion of luma 1510*495ae853SAndroid Build Coastguard Worker */ 1511*495ae853SAndroid Build Coastguard Worker 1512*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_uv_csc_buf; 1513*495ae853SAndroid Build Coastguard Worker 1514*495ae853SAndroid Build Coastguard Worker /** 1515*495ae853SAndroid Build Coastguard Worker * pointer to chroma plane of reconstructed buffer (base :: mb (0,0)) 1516*495ae853SAndroid Build Coastguard Worker */ 1517*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_rec_buf_chroma_base; 1518*495ae853SAndroid Build Coastguard Worker 1519*495ae853SAndroid Build Coastguard Worker /** 1520*495ae853SAndroid Build Coastguard Worker * pointer to chroma plane of reconstructed buffer (base :: mb (0,0)) 1521*495ae853SAndroid Build Coastguard Worker */ 1522*495ae853SAndroid Build Coastguard Worker UWORD8 *apu1_ref_buf_chroma_base[MAX_REF_PIC_CNT]; 1523*495ae853SAndroid Build Coastguard Worker 1524*495ae853SAndroid Build Coastguard Worker /** 1525*495ae853SAndroid Build Coastguard Worker * Pointer to ME NMB info 1526*495ae853SAndroid Build Coastguard Worker */ 1527*495ae853SAndroid Build Coastguard Worker mb_info_nmb_t *ps_nmb_info; 1528*495ae853SAndroid Build Coastguard Worker 1529*495ae853SAndroid Build Coastguard Worker mb_info_nmb_t *ps_cur_mb; 1530*495ae853SAndroid Build Coastguard Worker 1531*495ae853SAndroid Build Coastguard Worker /** 1532*495ae853SAndroid Build Coastguard Worker * source luma stride 1533*495ae853SAndroid Build Coastguard Worker */ 1534*495ae853SAndroid Build Coastguard Worker WORD32 i4_src_strd; 1535*495ae853SAndroid Build Coastguard Worker 1536*495ae853SAndroid Build Coastguard Worker /** 1537*495ae853SAndroid Build Coastguard Worker * source chroma stride 1538*495ae853SAndroid Build Coastguard Worker */ 1539*495ae853SAndroid Build Coastguard Worker WORD32 i4_src_chroma_strd; 1540*495ae853SAndroid Build Coastguard Worker 1541*495ae853SAndroid Build Coastguard Worker /** 1542*495ae853SAndroid Build Coastguard Worker * recon stride & ref stride 1543*495ae853SAndroid Build Coastguard Worker * (strides for luma and chroma are the same) 1544*495ae853SAndroid Build Coastguard Worker */ 1545*495ae853SAndroid Build Coastguard Worker WORD32 i4_rec_strd; 1546*495ae853SAndroid Build Coastguard Worker 1547*495ae853SAndroid Build Coastguard Worker /** 1548*495ae853SAndroid Build Coastguard Worker * Offset for half pel x plane from the pic buf 1549*495ae853SAndroid Build Coastguard Worker */ 1550*495ae853SAndroid Build Coastguard Worker UWORD32 u4_half_x_offset; 1551*495ae853SAndroid Build Coastguard Worker 1552*495ae853SAndroid Build Coastguard Worker /** 1553*495ae853SAndroid Build Coastguard Worker * Offset for half pel y plane from half x plane 1554*495ae853SAndroid Build Coastguard Worker */ 1555*495ae853SAndroid Build Coastguard Worker UWORD32 u4_half_y_offset; 1556*495ae853SAndroid Build Coastguard Worker 1557*495ae853SAndroid Build Coastguard Worker /** 1558*495ae853SAndroid Build Coastguard Worker * Offset for half pel xy plane from half y plane 1559*495ae853SAndroid Build Coastguard Worker */ 1560*495ae853SAndroid Build Coastguard Worker UWORD32 u4_half_xy_offset; 1561*495ae853SAndroid Build Coastguard Worker 1562*495ae853SAndroid Build Coastguard Worker /** 1563*495ae853SAndroid Build Coastguard Worker * pred buffer pointer (temp buffer 1) 1564*495ae853SAndroid Build Coastguard Worker */ 1565*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_pred_mb; 1566*495ae853SAndroid Build Coastguard Worker 1567*495ae853SAndroid Build Coastguard Worker /** 1568*495ae853SAndroid Build Coastguard Worker * pred buffer pointer (prediction buffer for intra 16x16 1569*495ae853SAndroid Build Coastguard Worker */ 1570*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_pred_mb_intra_16x16; 1571*495ae853SAndroid Build Coastguard Worker 1572*495ae853SAndroid Build Coastguard Worker /** 1573*495ae853SAndroid Build Coastguard Worker * pred buffer pointer (prediction buffer for intra 16x16_plane 1574*495ae853SAndroid Build Coastguard Worker */ 1575*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_pred_mb_intra_16x16_plane; 1576*495ae853SAndroid Build Coastguard Worker 1577*495ae853SAndroid Build Coastguard Worker /** 1578*495ae853SAndroid Build Coastguard Worker * pred buffer pointer (prediction buffer for intra chroma 1579*495ae853SAndroid Build Coastguard Worker */ 1580*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_pred_mb_intra_chroma; 1581*495ae853SAndroid Build Coastguard Worker 1582*495ae853SAndroid Build Coastguard Worker /** 1583*495ae853SAndroid Build Coastguard Worker * pred buffer pointer (prediction buffer for intra chroma plane 1584*495ae853SAndroid Build Coastguard Worker */ 1585*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_pred_mb_intra_chroma_plane; 1586*495ae853SAndroid Build Coastguard Worker 1587*495ae853SAndroid Build Coastguard Worker /** 1588*495ae853SAndroid Build Coastguard Worker * temp. reference buffer ptr for intra 4x4 when rdopt is on 1589*495ae853SAndroid Build Coastguard Worker */ 1590*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_ref_mb_intra_4x4; 1591*495ae853SAndroid Build Coastguard Worker 1592*495ae853SAndroid Build Coastguard Worker /** 1593*495ae853SAndroid Build Coastguard Worker * prediction buffer stride 1594*495ae853SAndroid Build Coastguard Worker */ 1595*495ae853SAndroid Build Coastguard Worker WORD32 i4_pred_strd; 1596*495ae853SAndroid Build Coastguard Worker 1597*495ae853SAndroid Build Coastguard Worker /** 1598*495ae853SAndroid Build Coastguard Worker * transform buffer pointer (temp buffer 2) 1599*495ae853SAndroid Build Coastguard Worker */ 1600*495ae853SAndroid Build Coastguard Worker WORD16 *pi2_res_buf; 1601*495ae853SAndroid Build Coastguard Worker 1602*495ae853SAndroid Build Coastguard Worker /** 1603*495ae853SAndroid Build Coastguard Worker * temp. transform buffer ptr for intra 4x4 when rdopt is on 1604*495ae853SAndroid Build Coastguard Worker */ 1605*495ae853SAndroid Build Coastguard Worker WORD16 *pi2_res_buf_intra_4x4; 1606*495ae853SAndroid Build Coastguard Worker 1607*495ae853SAndroid Build Coastguard Worker /** 1608*495ae853SAndroid Build Coastguard Worker * transform buffer stride 1609*495ae853SAndroid Build Coastguard Worker */ 1610*495ae853SAndroid Build Coastguard Worker WORD32 i4_res_strd; 1611*495ae853SAndroid Build Coastguard Worker 1612*495ae853SAndroid Build Coastguard Worker /** 1613*495ae853SAndroid Build Coastguard Worker * scratch buffer for inverse transform (temp buffer 3) 1614*495ae853SAndroid Build Coastguard Worker */ 1615*495ae853SAndroid Build Coastguard Worker void *pv_scratch_buff; 1616*495ae853SAndroid Build Coastguard Worker 1617*495ae853SAndroid Build Coastguard Worker /** 1618*495ae853SAndroid Build Coastguard Worker * frame num 1619*495ae853SAndroid Build Coastguard Worker */ 1620*495ae853SAndroid Build Coastguard Worker WORD32 i4_frame_num; 1621*495ae853SAndroid Build Coastguard Worker 1622*495ae853SAndroid Build Coastguard Worker /** 1623*495ae853SAndroid Build Coastguard Worker * start address of frame / sub-frame 1624*495ae853SAndroid Build Coastguard Worker */ 1625*495ae853SAndroid Build Coastguard Worker WORD32 i4_frame_strt_add; 1626*495ae853SAndroid Build Coastguard Worker 1627*495ae853SAndroid Build Coastguard Worker /** 1628*495ae853SAndroid Build Coastguard Worker * IDR pic 1629*495ae853SAndroid Build Coastguard Worker */ 1630*495ae853SAndroid Build Coastguard Worker UWORD32 u4_is_idr; 1631*495ae853SAndroid Build Coastguard Worker 1632*495ae853SAndroid Build Coastguard Worker /** 1633*495ae853SAndroid Build Coastguard Worker * idr_pic_id 1634*495ae853SAndroid Build Coastguard Worker */ 1635*495ae853SAndroid Build Coastguard Worker UWORD32 u4_idr_pic_id; 1636*495ae853SAndroid Build Coastguard Worker 1637*495ae853SAndroid Build Coastguard Worker /** 1638*495ae853SAndroid Build Coastguard Worker * Input width in mbs 1639*495ae853SAndroid Build Coastguard Worker */ 1640*495ae853SAndroid Build Coastguard Worker WORD32 i4_wd_mbs; 1641*495ae853SAndroid Build Coastguard Worker 1642*495ae853SAndroid Build Coastguard Worker /** 1643*495ae853SAndroid Build Coastguard Worker * Input height in mbs 1644*495ae853SAndroid Build Coastguard Worker */ 1645*495ae853SAndroid Build Coastguard Worker WORD32 i4_ht_mbs; 1646*495ae853SAndroid Build Coastguard Worker 1647*495ae853SAndroid Build Coastguard Worker /** 1648*495ae853SAndroid Build Coastguard Worker * slice_type 1649*495ae853SAndroid Build Coastguard Worker */ 1650*495ae853SAndroid Build Coastguard Worker WORD32 i4_slice_type; 1651*495ae853SAndroid Build Coastguard Worker 1652*495ae853SAndroid Build Coastguard Worker /** 1653*495ae853SAndroid Build Coastguard Worker * Current slice idx 1654*495ae853SAndroid Build Coastguard Worker */ 1655*495ae853SAndroid Build Coastguard Worker WORD32 i4_cur_slice_idx; 1656*495ae853SAndroid Build Coastguard Worker 1657*495ae853SAndroid Build Coastguard Worker /** 1658*495ae853SAndroid Build Coastguard Worker * MB's x position within a picture in raster scan in MB units 1659*495ae853SAndroid Build Coastguard Worker */ 1660*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_x; 1661*495ae853SAndroid Build Coastguard Worker 1662*495ae853SAndroid Build Coastguard Worker /** 1663*495ae853SAndroid Build Coastguard Worker * MB's y position within a picture in raster scan in MB units 1664*495ae853SAndroid Build Coastguard Worker */ 1665*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_y; 1666*495ae853SAndroid Build Coastguard Worker 1667*495ae853SAndroid Build Coastguard Worker /** 1668*495ae853SAndroid Build Coastguard Worker * MB's x position within a Slice in raster scan in MB units 1669*495ae853SAndroid Build Coastguard Worker */ 1670*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_slice_x; 1671*495ae853SAndroid Build Coastguard Worker 1672*495ae853SAndroid Build Coastguard Worker /** 1673*495ae853SAndroid Build Coastguard Worker * MB's y position within a Slice in raster scan in MB units 1674*495ae853SAndroid Build Coastguard Worker */ 1675*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_slice_y; 1676*495ae853SAndroid Build Coastguard Worker 1677*495ae853SAndroid Build Coastguard Worker /** 1678*495ae853SAndroid Build Coastguard Worker * mb type 1679*495ae853SAndroid Build Coastguard Worker */ 1680*495ae853SAndroid Build Coastguard Worker UWORD32 u4_mb_type; 1681*495ae853SAndroid Build Coastguard Worker 1682*495ae853SAndroid Build Coastguard Worker /** 1683*495ae853SAndroid Build Coastguard Worker * is intra 1684*495ae853SAndroid Build Coastguard Worker */ 1685*495ae853SAndroid Build Coastguard Worker UWORD32 u4_is_intra; 1686*495ae853SAndroid Build Coastguard Worker 1687*495ae853SAndroid Build Coastguard Worker /** 1688*495ae853SAndroid Build Coastguard Worker * mb neighbor availability pointer 1689*495ae853SAndroid Build Coastguard Worker */ 1690*495ae853SAndroid Build Coastguard Worker block_neighbors_t *ps_ngbr_avbl; 1691*495ae853SAndroid Build Coastguard Worker 1692*495ae853SAndroid Build Coastguard Worker /** 1693*495ae853SAndroid Build Coastguard Worker * lambda (lagrange multiplier for cost computation) 1694*495ae853SAndroid Build Coastguard Worker */ 1695*495ae853SAndroid Build Coastguard Worker UWORD32 u4_lambda; 1696*495ae853SAndroid Build Coastguard Worker 1697*495ae853SAndroid Build Coastguard Worker /** 1698*495ae853SAndroid Build Coastguard Worker * mb distortion 1699*495ae853SAndroid Build Coastguard Worker */ 1700*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_distortion; 1701*495ae853SAndroid Build Coastguard Worker 1702*495ae853SAndroid Build Coastguard Worker /** 1703*495ae853SAndroid Build Coastguard Worker * mb cost 1704*495ae853SAndroid Build Coastguard Worker */ 1705*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_cost; 1706*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_intra_cost; 1707*495ae853SAndroid Build Coastguard Worker 1708*495ae853SAndroid Build Coastguard Worker /********************************************************************/ 1709*495ae853SAndroid Build Coastguard Worker /* i4_ngbr_avbl_mb_16 - ngbr avbl of curr mb */ 1710*495ae853SAndroid Build Coastguard Worker /* i4_ngbr_avbl_sb_8 - ngbr avbl of all 8x8 sub blocks of curr mb */ 1711*495ae853SAndroid Build Coastguard Worker /* i4_ngbr_avbl_sb_4 - ngbr avbl of all 4x4 sub blocks of curr mb */ 1712*495ae853SAndroid Build Coastguard Worker /* i4_ngbr_avbl_mb_c - chroma ngbr avbl of curr mb */ 1713*495ae853SAndroid Build Coastguard Worker /********************************************************************/ 1714*495ae853SAndroid Build Coastguard Worker WORD32 i4_ngbr_avbl_16x16_mb; 1715*495ae853SAndroid Build Coastguard Worker WORD32 ai4_neighbor_avail_8x8_subblks[4]; 1716*495ae853SAndroid Build Coastguard Worker UWORD8 au1_ngbr_avbl_4x4_subblks[16]; 1717*495ae853SAndroid Build Coastguard Worker WORD32 i4_chroma_neighbor_avail_8x8_mb; 1718*495ae853SAndroid Build Coastguard Worker 1719*495ae853SAndroid Build Coastguard Worker /** 1720*495ae853SAndroid Build Coastguard Worker * array to store the mode of mb sub blocks 1721*495ae853SAndroid Build Coastguard Worker */ 1722*495ae853SAndroid Build Coastguard Worker UWORD8 au1_intra_luma_mb_4x4_modes[16]; 1723*495ae853SAndroid Build Coastguard Worker 1724*495ae853SAndroid Build Coastguard Worker /** 1725*495ae853SAndroid Build Coastguard Worker * array to store the predicted mode of mb sub blks 1726*495ae853SAndroid Build Coastguard Worker */ 1727*495ae853SAndroid Build Coastguard Worker UWORD8 au1_predicted_intra_luma_mb_4x4_modes[16]; 1728*495ae853SAndroid Build Coastguard Worker 1729*495ae853SAndroid Build Coastguard Worker /** 1730*495ae853SAndroid Build Coastguard Worker * macro block intra 16x16 mode 1731*495ae853SAndroid Build Coastguard Worker */ 1732*495ae853SAndroid Build Coastguard Worker UWORD8 u1_l_i16_mode; 1733*495ae853SAndroid Build Coastguard Worker 1734*495ae853SAndroid Build Coastguard Worker /** 1735*495ae853SAndroid Build Coastguard Worker * array to store the mode of the macro block intra 8x8 4 modes 1736*495ae853SAndroid Build Coastguard Worker */ 1737*495ae853SAndroid Build Coastguard Worker UWORD8 au1_intra_luma_mb_8x8_modes[4]; 1738*495ae853SAndroid Build Coastguard Worker 1739*495ae853SAndroid Build Coastguard Worker /** 1740*495ae853SAndroid Build Coastguard Worker * intra chroma mb mode 1741*495ae853SAndroid Build Coastguard Worker */ 1742*495ae853SAndroid Build Coastguard Worker UWORD8 u1_c_i8_mode; 1743*495ae853SAndroid Build Coastguard Worker 1744*495ae853SAndroid Build Coastguard Worker /********************************************************************/ 1745*495ae853SAndroid Build Coastguard Worker /* array to store pixels from the neighborhood for intra prediction */ 1746*495ae853SAndroid Build Coastguard Worker /* i16 - 16 left pels + 1 top left pel + 16 top pels = 33 pels */ 1747*495ae853SAndroid Build Coastguard Worker /* i8 - 8 lpels + 1 tlpels + 8 tpels + 8 tr pels = 25 pels */ 1748*495ae853SAndroid Build Coastguard Worker /* i4 - 4 lpels + 1 tlpels + 4 tpels + 4 tr pels = 13 pels */ 1749*495ae853SAndroid Build Coastguard Worker /* ic - 8 left pels + 1 top left pel + 8 top pels )*2 */ 1750*495ae853SAndroid Build Coastguard Worker /********************************************************************/ 1751*495ae853SAndroid Build Coastguard Worker UWORD8 au1_ngbr_pels[34]; 1752*495ae853SAndroid Build Coastguard Worker 1753*495ae853SAndroid Build Coastguard Worker /** 1754*495ae853SAndroid Build Coastguard Worker * array for 8x8 intra pels filtering (temp buff 4) 1755*495ae853SAndroid Build Coastguard Worker */ 1756*495ae853SAndroid Build Coastguard Worker UWORD8 au1_neighbor_pels_i8x8_unfiltered[25]; 1757*495ae853SAndroid Build Coastguard Worker 1758*495ae853SAndroid Build Coastguard Worker /** 1759*495ae853SAndroid Build Coastguard Worker * Number of sub partitons in the inter pred MB 1760*495ae853SAndroid Build Coastguard Worker */ 1761*495ae853SAndroid Build Coastguard Worker UWORD32 u4_num_sub_partitions; 1762*495ae853SAndroid Build Coastguard Worker 1763*495ae853SAndroid Build Coastguard Worker /** 1764*495ae853SAndroid Build Coastguard Worker * Pointer to hold num PUs each MB in a picture 1765*495ae853SAndroid Build Coastguard Worker */ 1766*495ae853SAndroid Build Coastguard Worker UWORD32 *pu4_mb_pu_cnt; 1767*495ae853SAndroid Build Coastguard Worker 1768*495ae853SAndroid Build Coastguard Worker /** 1769*495ae853SAndroid Build Coastguard Worker * Pointer to the array of structures having motion vectors, size 1770*495ae853SAndroid Build Coastguard Worker * and position of sub partitions 1771*495ae853SAndroid Build Coastguard Worker */ 1772*495ae853SAndroid Build Coastguard Worker enc_pu_t *ps_pu; 1773*495ae853SAndroid Build Coastguard Worker 1774*495ae853SAndroid Build Coastguard Worker /** 1775*495ae853SAndroid Build Coastguard Worker * Pointer to the pu of current co-located MB in list 1 1776*495ae853SAndroid Build Coastguard Worker */ 1777*495ae853SAndroid Build Coastguard Worker enc_pu_t *ps_colpu; 1778*495ae853SAndroid Build Coastguard Worker 1779*495ae853SAndroid Build Coastguard Worker /** 1780*495ae853SAndroid Build Coastguard Worker * predicted motion vector 1781*495ae853SAndroid Build Coastguard Worker */ 1782*495ae853SAndroid Build Coastguard Worker enc_pu_mv_t *ps_skip_mv; 1783*495ae853SAndroid Build Coastguard Worker 1784*495ae853SAndroid Build Coastguard Worker /** 1785*495ae853SAndroid Build Coastguard Worker * predicted motion vector 1786*495ae853SAndroid Build Coastguard Worker */ 1787*495ae853SAndroid Build Coastguard Worker enc_pu_mv_t *ps_pred_mv; 1788*495ae853SAndroid Build Coastguard Worker 1789*495ae853SAndroid Build Coastguard Worker /** 1790*495ae853SAndroid Build Coastguard Worker * top row mb syntax information base 1791*495ae853SAndroid Build Coastguard Worker * In normal working scenarios, for a given context set, 1792*495ae853SAndroid Build Coastguard Worker * the mb syntax info pointer is identical across all process threads. 1793*495ae853SAndroid Build Coastguard Worker * But when the hard bound on slices are enabled, in multi core, frame 1794*495ae853SAndroid Build Coastguard Worker * is partitioned in to sections equal to set number of cores and each 1795*495ae853SAndroid Build Coastguard Worker * partition is run independently. In this scenario, a ctxt set will alone 1796*495ae853SAndroid Build Coastguard Worker * appear to run multiple frames at a time. For this to occur, the common 1797*495ae853SAndroid Build Coastguard Worker * pointers across the proc ctxt should disappear. 1798*495ae853SAndroid Build Coastguard Worker * 1799*495ae853SAndroid Build Coastguard Worker * This is done by allocating MAX_PROCESS_THREADS memory and distributing 1800*495ae853SAndroid Build Coastguard Worker * across individual ctxts when byte bnd per slice is enabled. 1801*495ae853SAndroid Build Coastguard Worker */ 1802*495ae853SAndroid Build Coastguard Worker mb_info_t *ps_top_row_mb_syntax_ele_base; 1803*495ae853SAndroid Build Coastguard Worker 1804*495ae853SAndroid Build Coastguard Worker /** 1805*495ae853SAndroid Build Coastguard Worker * top row mb syntax information 1806*495ae853SAndroid Build Coastguard Worker */ 1807*495ae853SAndroid Build Coastguard Worker mb_info_t *ps_top_row_mb_syntax_ele; 1808*495ae853SAndroid Build Coastguard Worker 1809*495ae853SAndroid Build Coastguard Worker /** 1810*495ae853SAndroid Build Coastguard Worker * left mb syntax information 1811*495ae853SAndroid Build Coastguard Worker */ 1812*495ae853SAndroid Build Coastguard Worker mb_info_t s_left_mb_syntax_ele; 1813*495ae853SAndroid Build Coastguard Worker 1814*495ae853SAndroid Build Coastguard Worker /** 1815*495ae853SAndroid Build Coastguard Worker * top left mb syntax information 1816*495ae853SAndroid Build Coastguard Worker */ 1817*495ae853SAndroid Build Coastguard Worker mb_info_t s_top_left_mb_syntax_ele; 1818*495ae853SAndroid Build Coastguard Worker 1819*495ae853SAndroid Build Coastguard Worker /** 1820*495ae853SAndroid Build Coastguard Worker * top left mb syntax information 1821*495ae853SAndroid Build Coastguard Worker */ 1822*495ae853SAndroid Build Coastguard Worker 1823*495ae853SAndroid Build Coastguard Worker mb_info_t s_top_left_mb_syntax_ME; 1824*495ae853SAndroid Build Coastguard Worker 1825*495ae853SAndroid Build Coastguard Worker /** 1826*495ae853SAndroid Build Coastguard Worker * left mb motion vector 1827*495ae853SAndroid Build Coastguard Worker */ 1828*495ae853SAndroid Build Coastguard Worker enc_pu_t s_left_mb_pu_ME; 1829*495ae853SAndroid Build Coastguard Worker 1830*495ae853SAndroid Build Coastguard Worker /** 1831*495ae853SAndroid Build Coastguard Worker * top left mb motion vector 1832*495ae853SAndroid Build Coastguard Worker */ 1833*495ae853SAndroid Build Coastguard Worker enc_pu_t s_top_left_mb_pu_ME; 1834*495ae853SAndroid Build Coastguard Worker 1835*495ae853SAndroid Build Coastguard Worker /** 1836*495ae853SAndroid Build Coastguard Worker * mb neighbor availability pointer 1837*495ae853SAndroid Build Coastguard Worker */ 1838*495ae853SAndroid Build Coastguard Worker block_neighbors_t s_ngbr_avbl; 1839*495ae853SAndroid Build Coastguard Worker 1840*495ae853SAndroid Build Coastguard Worker /** 1841*495ae853SAndroid Build Coastguard Worker * In case the macroblock type is intra, the intra modes of all 1842*495ae853SAndroid Build Coastguard Worker * partitions for the left mb are stored in the array below 1843*495ae853SAndroid Build Coastguard Worker */ 1844*495ae853SAndroid Build Coastguard Worker UWORD8 au1_left_mb_intra_modes[16]; 1845*495ae853SAndroid Build Coastguard Worker 1846*495ae853SAndroid Build Coastguard Worker /** 1847*495ae853SAndroid Build Coastguard Worker * In case the macroblock type is intra, the intra modes of all 1848*495ae853SAndroid Build Coastguard Worker * partitions for the top mb are stored in the array below 1849*495ae853SAndroid Build Coastguard Worker * 1850*495ae853SAndroid Build Coastguard Worker * In normal working scenarios, for a given context set, 1851*495ae853SAndroid Build Coastguard Worker * the mb syntax info pointer is identical across all process threads. 1852*495ae853SAndroid Build Coastguard Worker * But when the hard bound on slices are enabled, in multi core, frame 1853*495ae853SAndroid Build Coastguard Worker * is partitioned in to sections equal to set number of cores and each 1854*495ae853SAndroid Build Coastguard Worker * partition is run independently. In this scenario, a ctxt set will alone 1855*495ae853SAndroid Build Coastguard Worker * appear to run multiple frames at a time. For this to occur, the common 1856*495ae853SAndroid Build Coastguard Worker * pointers across the proc ctxt should disappear. 1857*495ae853SAndroid Build Coastguard Worker * 1858*495ae853SAndroid Build Coastguard Worker * This is done by allocating MAX_PROCESS_THREADS memory and distributing 1859*495ae853SAndroid Build Coastguard Worker * across individual ctxts when byte bnd per slice is enabled. 1860*495ae853SAndroid Build Coastguard Worker */ 1861*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_top_mb_intra_modes_base; 1862*495ae853SAndroid Build Coastguard Worker 1863*495ae853SAndroid Build Coastguard Worker /** 1864*495ae853SAndroid Build Coastguard Worker * In case the macroblock type is intra, the intra modes of all 1865*495ae853SAndroid Build Coastguard Worker * partitions for the top mb are stored in the array below 1866*495ae853SAndroid Build Coastguard Worker */ 1867*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_top_mb_intra_modes; 1868*495ae853SAndroid Build Coastguard Worker 1869*495ae853SAndroid Build Coastguard Worker /** 1870*495ae853SAndroid Build Coastguard Worker * left mb motion vector 1871*495ae853SAndroid Build Coastguard Worker */ 1872*495ae853SAndroid Build Coastguard Worker enc_pu_t s_left_mb_pu; 1873*495ae853SAndroid Build Coastguard Worker 1874*495ae853SAndroid Build Coastguard Worker /** 1875*495ae853SAndroid Build Coastguard Worker * top left mb motion vector 1876*495ae853SAndroid Build Coastguard Worker */ 1877*495ae853SAndroid Build Coastguard Worker enc_pu_t s_top_left_mb_pu; 1878*495ae853SAndroid Build Coastguard Worker 1879*495ae853SAndroid Build Coastguard Worker /** 1880*495ae853SAndroid Build Coastguard Worker * top row motion vector info 1881*495ae853SAndroid Build Coastguard Worker * 1882*495ae853SAndroid Build Coastguard Worker * In normal working scenarios, for a given context set, 1883*495ae853SAndroid Build Coastguard Worker * the top row pu pointer is identical across all process threads. 1884*495ae853SAndroid Build Coastguard Worker * But when the hard bound on slices are enabled, in multi core, frame 1885*495ae853SAndroid Build Coastguard Worker * is partitioned in to sections equal to set number of cores and each 1886*495ae853SAndroid Build Coastguard Worker * partition is run independently. In this scenario, a ctxt set will alone 1887*495ae853SAndroid Build Coastguard Worker * appear to run multiple frames at a time. For this to occur, the common 1888*495ae853SAndroid Build Coastguard Worker * pointers across the proc ctxt should disappear. 1889*495ae853SAndroid Build Coastguard Worker * 1890*495ae853SAndroid Build Coastguard Worker * This is done by allocating MAX_PROCESS_THREADS memory and distributing 1891*495ae853SAndroid Build Coastguard Worker * across individual ctxts when byte bnd per slice is enabled. 1892*495ae853SAndroid Build Coastguard Worker */ 1893*495ae853SAndroid Build Coastguard Worker enc_pu_t *ps_top_row_pu_base; 1894*495ae853SAndroid Build Coastguard Worker 1895*495ae853SAndroid Build Coastguard Worker /** 1896*495ae853SAndroid Build Coastguard Worker * top row motion vector info 1897*495ae853SAndroid Build Coastguard Worker */ 1898*495ae853SAndroid Build Coastguard Worker enc_pu_t *ps_top_row_pu; 1899*495ae853SAndroid Build Coastguard Worker 1900*495ae853SAndroid Build Coastguard Worker enc_pu_t *ps_top_row_pu_ME; 1901*495ae853SAndroid Build Coastguard Worker 1902*495ae853SAndroid Build Coastguard Worker /** 1903*495ae853SAndroid Build Coastguard Worker * coded block pattern 1904*495ae853SAndroid Build Coastguard Worker */ 1905*495ae853SAndroid Build Coastguard Worker UWORD32 u4_cbp; 1906*495ae853SAndroid Build Coastguard Worker 1907*495ae853SAndroid Build Coastguard Worker /** 1908*495ae853SAndroid Build Coastguard Worker * csbp 1909*495ae853SAndroid Build Coastguard Worker */ 1910*495ae853SAndroid Build Coastguard Worker UWORD32 u4_csbp; 1911*495ae853SAndroid Build Coastguard Worker 1912*495ae853SAndroid Build Coastguard Worker /** 1913*495ae853SAndroid Build Coastguard Worker * number of non zero coeffs 1914*495ae853SAndroid Build Coastguard Worker */ 1915*495ae853SAndroid Build Coastguard Worker UWORD32 au4_nnz[5]; 1916*495ae853SAndroid Build Coastguard Worker 1917*495ae853SAndroid Build Coastguard Worker /** 1918*495ae853SAndroid Build Coastguard Worker * number of non zero coeffs for intra 4x4 when rdopt is on 1919*495ae853SAndroid Build Coastguard Worker */ 1920*495ae853SAndroid Build Coastguard Worker UWORD32 au4_nnz_intra_4x4[4]; 1921*495ae853SAndroid Build Coastguard Worker 1922*495ae853SAndroid Build Coastguard Worker /** 1923*495ae853SAndroid Build Coastguard Worker * frame qp & mb qp 1924*495ae853SAndroid Build Coastguard Worker */ 1925*495ae853SAndroid Build Coastguard Worker UWORD32 u4_frame_qp, u4_mb_qp; 1926*495ae853SAndroid Build Coastguard Worker 1927*495ae853SAndroid Build Coastguard Worker /** 1928*495ae853SAndroid Build Coastguard Worker * mb qp previous 1929*495ae853SAndroid Build Coastguard Worker */ 1930*495ae853SAndroid Build Coastguard Worker UWORD32 u4_mb_qp_prev; 1931*495ae853SAndroid Build Coastguard Worker 1932*495ae853SAndroid Build Coastguard Worker /** 1933*495ae853SAndroid Build Coastguard Worker * quantization parameters for luma & chroma planes 1934*495ae853SAndroid Build Coastguard Worker */ 1935*495ae853SAndroid Build Coastguard Worker quant_params_t *ps_qp_params[3]; 1936*495ae853SAndroid Build Coastguard Worker 1937*495ae853SAndroid Build Coastguard Worker /** 1938*495ae853SAndroid Build Coastguard Worker * Pointer frame level mb subblock coeff data 1939*495ae853SAndroid Build Coastguard Worker */ 1940*495ae853SAndroid Build Coastguard Worker void *pv_pic_mb_coeff_data; 1941*495ae853SAndroid Build Coastguard Worker 1942*495ae853SAndroid Build Coastguard Worker /** 1943*495ae853SAndroid Build Coastguard Worker * Pointer to mb subblock coeff data and number of subblocks and scan idx 1944*495ae853SAndroid Build Coastguard Worker * Incremented each time a coded subblock is processed 1945*495ae853SAndroid Build Coastguard Worker */ 1946*495ae853SAndroid Build Coastguard Worker void *pv_mb_coeff_data; 1947*495ae853SAndroid Build Coastguard Worker 1948*495ae853SAndroid Build Coastguard Worker /** 1949*495ae853SAndroid Build Coastguard Worker * Pointer frame level mb header data 1950*495ae853SAndroid Build Coastguard Worker */ 1951*495ae853SAndroid Build Coastguard Worker void *pv_pic_mb_header_data; 1952*495ae853SAndroid Build Coastguard Worker 1953*495ae853SAndroid Build Coastguard Worker /** 1954*495ae853SAndroid Build Coastguard Worker * Pointer to mb header data and 1955*495ae853SAndroid Build Coastguard Worker * incremented each time a coded mb is encoded 1956*495ae853SAndroid Build Coastguard Worker */ 1957*495ae853SAndroid Build Coastguard Worker void *pv_mb_header_data; 1958*495ae853SAndroid Build Coastguard Worker 1959*495ae853SAndroid Build Coastguard Worker /** 1960*495ae853SAndroid Build Coastguard Worker * Signal that pic_init is called first time 1961*495ae853SAndroid Build Coastguard Worker */ 1962*495ae853SAndroid Build Coastguard Worker WORD32 i4_first_pic_init; 1963*495ae853SAndroid Build Coastguard Worker 1964*495ae853SAndroid Build Coastguard Worker /** 1965*495ae853SAndroid Build Coastguard Worker * Current MV Bank's buffer ID 1966*495ae853SAndroid Build Coastguard Worker */ 1967*495ae853SAndroid Build Coastguard Worker WORD32 i4_cur_mv_bank_buf_id; 1968*495ae853SAndroid Build Coastguard Worker 1969*495ae853SAndroid Build Coastguard Worker /** 1970*495ae853SAndroid Build Coastguard Worker * Void pointer to job context 1971*495ae853SAndroid Build Coastguard Worker */ 1972*495ae853SAndroid Build Coastguard Worker void *pv_proc_jobq, *pv_entropy_jobq; 1973*495ae853SAndroid Build Coastguard Worker 1974*495ae853SAndroid Build Coastguard Worker /** 1975*495ae853SAndroid Build Coastguard Worker * Number of MBs to be processed in the current Job 1976*495ae853SAndroid Build Coastguard Worker */ 1977*495ae853SAndroid Build Coastguard Worker WORD32 i4_mb_cnt; 1978*495ae853SAndroid Build Coastguard Worker 1979*495ae853SAndroid Build Coastguard Worker /** 1980*495ae853SAndroid Build Coastguard Worker * ID for the current context - Used for debugging 1981*495ae853SAndroid Build Coastguard Worker */ 1982*495ae853SAndroid Build Coastguard Worker WORD32 i4_id; 1983*495ae853SAndroid Build Coastguard Worker 1984*495ae853SAndroid Build Coastguard Worker /** 1985*495ae853SAndroid Build Coastguard Worker * Pointer to current picture buffer structure 1986*495ae853SAndroid Build Coastguard Worker */ 1987*495ae853SAndroid Build Coastguard Worker pic_buf_t *ps_cur_pic; 1988*495ae853SAndroid Build Coastguard Worker 1989*495ae853SAndroid Build Coastguard Worker /** 1990*495ae853SAndroid Build Coastguard Worker * Pointer to current picture's mv buffer structure 1991*495ae853SAndroid Build Coastguard Worker */ 1992*495ae853SAndroid Build Coastguard Worker mv_buf_t *ps_cur_mv_buf; 1993*495ae853SAndroid Build Coastguard Worker 1994*495ae853SAndroid Build Coastguard Worker /** 1995*495ae853SAndroid Build Coastguard Worker * Flag to indicate if ps_proc was initialized at least once in a frame. 1996*495ae853SAndroid Build Coastguard Worker * This is needed to handle cases where a core starts to handle format 1997*495ae853SAndroid Build Coastguard Worker * conversion jobs directly 1998*495ae853SAndroid Build Coastguard Worker */ 1999*495ae853SAndroid Build Coastguard Worker WORD32 i4_init_done; 2000*495ae853SAndroid Build Coastguard Worker 2001*495ae853SAndroid Build Coastguard Worker /** 2002*495ae853SAndroid Build Coastguard Worker * Process status: one byte per MB 2003*495ae853SAndroid Build Coastguard Worker */ 2004*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_proc_map; 2005*495ae853SAndroid Build Coastguard Worker 2006*495ae853SAndroid Build Coastguard Worker /** 2007*495ae853SAndroid Build Coastguard Worker * Deblk status: one byte per MB 2008*495ae853SAndroid Build Coastguard Worker */ 2009*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_deblk_map; 2010*495ae853SAndroid Build Coastguard Worker 2011*495ae853SAndroid Build Coastguard Worker /** 2012*495ae853SAndroid Build Coastguard Worker * Process status: one byte per MB 2013*495ae853SAndroid Build Coastguard Worker */ 2014*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_me_map; 2015*495ae853SAndroid Build Coastguard Worker 2016*495ae853SAndroid Build Coastguard Worker /* 2017*495ae853SAndroid Build Coastguard Worker * Intra refresh mask. 2018*495ae853SAndroid Build Coastguard Worker * Indicates if an Mb is coded in intra mode within the current AIR interval 2019*495ae853SAndroid Build Coastguard Worker * NOTE Refreshes after each AIR period 2020*495ae853SAndroid Build Coastguard Worker * NOTE The map is shared between process 2021*495ae853SAndroid Build Coastguard Worker */ 2022*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_is_intra_coded; 2023*495ae853SAndroid Build Coastguard Worker 2024*495ae853SAndroid Build Coastguard Worker /** 2025*495ae853SAndroid Build Coastguard Worker * Disable deblock level (0: Enable completely, 3: Disable completely 2026*495ae853SAndroid Build Coastguard Worker */ 2027*495ae853SAndroid Build Coastguard Worker UWORD32 u4_disable_deblock_level; 2028*495ae853SAndroid Build Coastguard Worker 2029*495ae853SAndroid Build Coastguard Worker /** 2030*495ae853SAndroid Build Coastguard Worker * Pointer to the structure that contains deblock context 2031*495ae853SAndroid Build Coastguard Worker */ 2032*495ae853SAndroid Build Coastguard Worker deblk_ctxt_t s_deblk_ctxt; 2033*495ae853SAndroid Build Coastguard Worker 2034*495ae853SAndroid Build Coastguard Worker /** 2035*495ae853SAndroid Build Coastguard Worker * Points to the array of slice indices which is used to identify the independent 2036*495ae853SAndroid Build Coastguard Worker * slice to which each MB in a frame belongs. 2037*495ae853SAndroid Build Coastguard Worker */ 2038*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_slice_idx; 2039*495ae853SAndroid Build Coastguard Worker 2040*495ae853SAndroid Build Coastguard Worker /** 2041*495ae853SAndroid Build Coastguard Worker * Pointer to base of slice header structure array 2042*495ae853SAndroid Build Coastguard Worker */ 2043*495ae853SAndroid Build Coastguard Worker slice_header_t *ps_slice_hdr_base; 2044*495ae853SAndroid Build Coastguard Worker 2045*495ae853SAndroid Build Coastguard Worker /** 2046*495ae853SAndroid Build Coastguard Worker * Number of mb's to process in one loop 2047*495ae853SAndroid Build Coastguard Worker */ 2048*495ae853SAndroid Build Coastguard Worker WORD32 i4_nmb_ntrpy; 2049*495ae853SAndroid Build Coastguard Worker 2050*495ae853SAndroid Build Coastguard Worker /** 2051*495ae853SAndroid Build Coastguard Worker * Number of mb's to process in one loop 2052*495ae853SAndroid Build Coastguard Worker */ 2053*495ae853SAndroid Build Coastguard Worker UWORD32 u4_nmb_me; 2054*495ae853SAndroid Build Coastguard Worker 2055*495ae853SAndroid Build Coastguard Worker /** 2056*495ae853SAndroid Build Coastguard Worker * Structure for current input buffer 2057*495ae853SAndroid Build Coastguard Worker */ 2058*495ae853SAndroid Build Coastguard Worker inp_buf_t s_inp_buf; 2059*495ae853SAndroid Build Coastguard Worker 2060*495ae853SAndroid Build Coastguard Worker /** 2061*495ae853SAndroid Build Coastguard Worker * api call cnt 2062*495ae853SAndroid Build Coastguard Worker */ 2063*495ae853SAndroid Build Coastguard Worker WORD32 i4_encode_api_call_cnt; 2064*495ae853SAndroid Build Coastguard Worker 2065*495ae853SAndroid Build Coastguard Worker /** 2066*495ae853SAndroid Build Coastguard Worker * Current Picture count - used for synchronization 2067*495ae853SAndroid Build Coastguard Worker */ 2068*495ae853SAndroid Build Coastguard Worker WORD32 i4_pic_cnt; 2069*495ae853SAndroid Build Coastguard Worker 2070*495ae853SAndroid Build Coastguard Worker /** 2071*495ae853SAndroid Build Coastguard Worker * Intermediate buffer for interpred leaf level functions 2072*495ae853SAndroid Build Coastguard Worker */ 2073*495ae853SAndroid Build Coastguard Worker WORD32 ai16_pred1[HP_BUFF_WD * HP_BUFF_HT]; 2074*495ae853SAndroid Build Coastguard Worker 2075*495ae853SAndroid Build Coastguard Worker /** 2076*495ae853SAndroid Build Coastguard Worker * Reference picture for the current picture 2077*495ae853SAndroid Build Coastguard Worker * TODO: Only 2 reference assumed currently 2078*495ae853SAndroid Build Coastguard Worker */ 2079*495ae853SAndroid Build Coastguard Worker pic_buf_t *aps_ref_pic[MAX_REF_PIC_CNT]; 2080*495ae853SAndroid Build Coastguard Worker 2081*495ae853SAndroid Build Coastguard Worker /** 2082*495ae853SAndroid Build Coastguard Worker * Reference MV buff for the current picture 2083*495ae853SAndroid Build Coastguard Worker */ 2084*495ae853SAndroid Build Coastguard Worker mv_buf_t *aps_mv_buf[MAX_REF_PIC_CNT]; 2085*495ae853SAndroid Build Coastguard Worker 2086*495ae853SAndroid Build Coastguard Worker /** 2087*495ae853SAndroid Build Coastguard Worker * frame info used by RC 2088*495ae853SAndroid Build Coastguard Worker */ 2089*495ae853SAndroid Build Coastguard Worker frame_info_t s_frame_info; 2090*495ae853SAndroid Build Coastguard Worker 2091*495ae853SAndroid Build Coastguard Worker /* 2092*495ae853SAndroid Build Coastguard Worker * NOTE NOT PERSISTANT INSIDE FUNCTIONS 2093*495ae853SAndroid Build Coastguard Worker * Min sad for current MB 2094*495ae853SAndroid Build Coastguard Worker * will be populated initially 2095*495ae853SAndroid Build Coastguard Worker * Once a sad less than eq to u4_min_sad is reached, the value will be copied to the cariable 2096*495ae853SAndroid Build Coastguard Worker */ 2097*495ae853SAndroid Build Coastguard Worker UWORD32 u4_min_sad; 2098*495ae853SAndroid Build Coastguard Worker 2099*495ae853SAndroid Build Coastguard Worker /* 2100*495ae853SAndroid Build Coastguard Worker * indicates weather we have rached minimum sa or not 2101*495ae853SAndroid Build Coastguard Worker */ 2102*495ae853SAndroid Build Coastguard Worker UWORD32 u4_min_sad_reached; 2103*495ae853SAndroid Build Coastguard Worker 2104*495ae853SAndroid Build Coastguard Worker /** 2105*495ae853SAndroid Build Coastguard Worker * Current error code 2106*495ae853SAndroid Build Coastguard Worker */ 2107*495ae853SAndroid Build Coastguard Worker WORD32 i4_error_code; 2108*495ae853SAndroid Build Coastguard Worker 2109*495ae853SAndroid Build Coastguard Worker /* 2110*495ae853SAndroid Build Coastguard Worker * Enables or disables computation of recon 2111*495ae853SAndroid Build Coastguard Worker */ 2112*495ae853SAndroid Build Coastguard Worker UWORD32 u4_compute_recon; 2113*495ae853SAndroid Build Coastguard Worker 2114*495ae853SAndroid Build Coastguard Worker /* 2115*495ae853SAndroid Build Coastguard Worker * Temporary buffers to be used for subpel computation 2116*495ae853SAndroid Build Coastguard Worker */ 2117*495ae853SAndroid Build Coastguard Worker UWORD8 *apu1_subpel_buffs[SUBPEL_BUFF_CNT]; 2118*495ae853SAndroid Build Coastguard Worker 2119*495ae853SAndroid Build Coastguard Worker /* 2120*495ae853SAndroid Build Coastguard Worker * Buffer holding best sub pel values 2121*495ae853SAndroid Build Coastguard Worker */ 2122*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_best_subpel_buf; 2123*495ae853SAndroid Build Coastguard Worker 2124*495ae853SAndroid Build Coastguard Worker /* 2125*495ae853SAndroid Build Coastguard Worker * Stride for buffer holding best sub pel 2126*495ae853SAndroid Build Coastguard Worker */ 2127*495ae853SAndroid Build Coastguard Worker UWORD32 u4_bst_spel_buf_strd; 2128*495ae853SAndroid Build Coastguard Worker 2129*495ae853SAndroid Build Coastguard Worker }; 2130*495ae853SAndroid Build Coastguard Worker 2131*495ae853SAndroid Build Coastguard Worker /** 2132*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 2133*495ae853SAndroid Build Coastguard Worker * @brief Rate control related variables 2134*495ae853SAndroid Build Coastguard Worker ****************************************************************************** 2135*495ae853SAndroid Build Coastguard Worker */ 2136*495ae853SAndroid Build Coastguard Worker typedef struct 2137*495ae853SAndroid Build Coastguard Worker { 2138*495ae853SAndroid Build Coastguard Worker void *pps_rate_control_api; 2139*495ae853SAndroid Build Coastguard Worker 2140*495ae853SAndroid Build Coastguard Worker void *pps_frame_time; 2141*495ae853SAndroid Build Coastguard Worker 2142*495ae853SAndroid Build Coastguard Worker void *pps_time_stamp; 2143*495ae853SAndroid Build Coastguard Worker 2144*495ae853SAndroid Build Coastguard Worker void *pps_pd_frm_rate; 2145*495ae853SAndroid Build Coastguard Worker 2146*495ae853SAndroid Build Coastguard Worker /** 2147*495ae853SAndroid Build Coastguard Worker * frame rate pull down 2148*495ae853SAndroid Build Coastguard Worker */ 2149*495ae853SAndroid Build Coastguard Worker WORD32 pre_encode_skip[MAX_CTXT_SETS]; 2150*495ae853SAndroid Build Coastguard Worker 2151*495ae853SAndroid Build Coastguard Worker /** 2152*495ae853SAndroid Build Coastguard Worker * skip frame (cbr) 2153*495ae853SAndroid Build Coastguard Worker */ 2154*495ae853SAndroid Build Coastguard Worker WORD32 post_encode_skip[MAX_CTXT_SETS]; 2155*495ae853SAndroid Build Coastguard Worker 2156*495ae853SAndroid Build Coastguard Worker /** 2157*495ae853SAndroid Build Coastguard Worker * rate control type 2158*495ae853SAndroid Build Coastguard Worker */ 2159*495ae853SAndroid Build Coastguard Worker rc_type_e e_rc_type; 2160*495ae853SAndroid Build Coastguard Worker 2161*495ae853SAndroid Build Coastguard Worker /** 2162*495ae853SAndroid Build Coastguard Worker * pic type 2163*495ae853SAndroid Build Coastguard Worker */ 2164*495ae853SAndroid Build Coastguard Worker picture_type_e e_pic_type; 2165*495ae853SAndroid Build Coastguard Worker 2166*495ae853SAndroid Build Coastguard Worker /** 2167*495ae853SAndroid Build Coastguard Worker * intra cnt in previous frame 2168*495ae853SAndroid Build Coastguard Worker */ 2169*495ae853SAndroid Build Coastguard Worker WORD32 num_intra_in_prev_frame; 2170*495ae853SAndroid Build Coastguard Worker 2171*495ae853SAndroid Build Coastguard Worker /** 2172*495ae853SAndroid Build Coastguard Worker * avg activity of prev frame 2173*495ae853SAndroid Build Coastguard Worker */ 2174*495ae853SAndroid Build Coastguard Worker WORD32 i4_avg_activity; 2175*495ae853SAndroid Build Coastguard Worker 2176*495ae853SAndroid Build Coastguard Worker }rate_control_ctxt_t; 2177*495ae853SAndroid Build Coastguard Worker 2178*495ae853SAndroid Build Coastguard Worker /** 2179*495ae853SAndroid Build Coastguard Worker * Codec context 2180*495ae853SAndroid Build Coastguard Worker */ 2181*495ae853SAndroid Build Coastguard Worker struct _codec_t 2182*495ae853SAndroid Build Coastguard Worker { 2183*495ae853SAndroid Build Coastguard Worker /** 2184*495ae853SAndroid Build Coastguard Worker * Id of current pic (input order) 2185*495ae853SAndroid Build Coastguard Worker */ 2186*495ae853SAndroid Build Coastguard Worker WORD32 i4_poc; 2187*495ae853SAndroid Build Coastguard Worker 2188*495ae853SAndroid Build Coastguard Worker /** 2189*495ae853SAndroid Build Coastguard Worker * Number of encode frame API calls made 2190*495ae853SAndroid Build Coastguard Worker * This variable must only be used for context selection [Read only] 2191*495ae853SAndroid Build Coastguard Worker */ 2192*495ae853SAndroid Build Coastguard Worker WORD32 i4_encode_api_call_cnt; 2193*495ae853SAndroid Build Coastguard Worker 2194*495ae853SAndroid Build Coastguard Worker /** 2195*495ae853SAndroid Build Coastguard Worker * Number of pictures encoded 2196*495ae853SAndroid Build Coastguard Worker */ 2197*495ae853SAndroid Build Coastguard Worker WORD32 i4_pic_cnt; 2198*495ae853SAndroid Build Coastguard Worker 2199*495ae853SAndroid Build Coastguard Worker /** 2200*495ae853SAndroid Build Coastguard Worker * Number of threads created 2201*495ae853SAndroid Build Coastguard Worker */ 2202*495ae853SAndroid Build Coastguard Worker WORD32 i4_proc_thread_cnt; 2203*495ae853SAndroid Build Coastguard Worker 2204*495ae853SAndroid Build Coastguard Worker /** 2205*495ae853SAndroid Build Coastguard Worker * Mutex used to keep the control calls thread-safe 2206*495ae853SAndroid Build Coastguard Worker */ 2207*495ae853SAndroid Build Coastguard Worker void *pv_ctl_mutex; 2208*495ae853SAndroid Build Coastguard Worker 2209*495ae853SAndroid Build Coastguard Worker /** 2210*495ae853SAndroid Build Coastguard Worker * Current active config parameters 2211*495ae853SAndroid Build Coastguard Worker */ 2212*495ae853SAndroid Build Coastguard Worker cfg_params_t s_cfg; 2213*495ae853SAndroid Build Coastguard Worker 2214*495ae853SAndroid Build Coastguard Worker /** 2215*495ae853SAndroid Build Coastguard Worker * Array containing the config parameter sets 2216*495ae853SAndroid Build Coastguard Worker */ 2217*495ae853SAndroid Build Coastguard Worker cfg_params_t as_cfg[MAX_ACTIVE_CONFIG_PARAMS]; 2218*495ae853SAndroid Build Coastguard Worker 2219*495ae853SAndroid Build Coastguard Worker /** 2220*495ae853SAndroid Build Coastguard Worker * Color format used by encoder internally 2221*495ae853SAndroid Build Coastguard Worker */ 2222*495ae853SAndroid Build Coastguard Worker IV_COLOR_FORMAT_T e_codec_color_format; 2223*495ae853SAndroid Build Coastguard Worker 2224*495ae853SAndroid Build Coastguard Worker /** 2225*495ae853SAndroid Build Coastguard Worker * recon stride 2226*495ae853SAndroid Build Coastguard Worker * (strides for luma and chroma are the same) 2227*495ae853SAndroid Build Coastguard Worker */ 2228*495ae853SAndroid Build Coastguard Worker WORD32 i4_rec_strd; 2229*495ae853SAndroid Build Coastguard Worker 2230*495ae853SAndroid Build Coastguard Worker /** 2231*495ae853SAndroid Build Coastguard Worker * Flag to enable/disable deblocking of a frame 2232*495ae853SAndroid Build Coastguard Worker */ 2233*495ae853SAndroid Build Coastguard Worker WORD32 i4_disable_deblk_pic; 2234*495ae853SAndroid Build Coastguard Worker 2235*495ae853SAndroid Build Coastguard Worker /** 2236*495ae853SAndroid Build Coastguard Worker * Number of continuous frames where deblocking was disabled 2237*495ae853SAndroid Build Coastguard Worker */ 2238*495ae853SAndroid Build Coastguard Worker WORD32 i4_disable_deblk_pic_cnt; 2239*495ae853SAndroid Build Coastguard Worker 2240*495ae853SAndroid Build Coastguard Worker /** 2241*495ae853SAndroid Build Coastguard Worker * frame type 2242*495ae853SAndroid Build Coastguard Worker */ 2243*495ae853SAndroid Build Coastguard Worker PIC_TYPE_T pic_type; 2244*495ae853SAndroid Build Coastguard Worker 2245*495ae853SAndroid Build Coastguard Worker /** 2246*495ae853SAndroid Build Coastguard Worker * frame qp 2247*495ae853SAndroid Build Coastguard Worker */ 2248*495ae853SAndroid Build Coastguard Worker UWORD32 u4_frame_qp; 2249*495ae853SAndroid Build Coastguard Worker 2250*495ae853SAndroid Build Coastguard Worker /** 2251*495ae853SAndroid Build Coastguard Worker * frame num 2252*495ae853SAndroid Build Coastguard Worker */ 2253*495ae853SAndroid Build Coastguard Worker WORD32 i4_frame_num; 2254*495ae853SAndroid Build Coastguard Worker 2255*495ae853SAndroid Build Coastguard Worker /** 2256*495ae853SAndroid Build Coastguard Worker * frame num backup (used in post enc skip case) 2257*495ae853SAndroid Build Coastguard Worker */ 2258*495ae853SAndroid Build Coastguard Worker WORD32 i4_restore_frame_num; 2259*495ae853SAndroid Build Coastguard Worker 2260*495ae853SAndroid Build Coastguard Worker /** 2261*495ae853SAndroid Build Coastguard Worker * slice_type 2262*495ae853SAndroid Build Coastguard Worker */ 2263*495ae853SAndroid Build Coastguard Worker WORD32 i4_slice_type; 2264*495ae853SAndroid Build Coastguard Worker 2265*495ae853SAndroid Build Coastguard Worker /* 2266*495ae853SAndroid Build Coastguard Worker * Force current frame to specific type 2267*495ae853SAndroid Build Coastguard Worker */ 2268*495ae853SAndroid Build Coastguard Worker IV_PICTURE_CODING_TYPE_T force_curr_frame_type; 2269*495ae853SAndroid Build Coastguard Worker 2270*495ae853SAndroid Build Coastguard Worker /** 2271*495ae853SAndroid Build Coastguard Worker * IDR pic 2272*495ae853SAndroid Build Coastguard Worker */ 2273*495ae853SAndroid Build Coastguard Worker UWORD32 u4_is_idr; 2274*495ae853SAndroid Build Coastguard Worker 2275*495ae853SAndroid Build Coastguard Worker /** 2276*495ae853SAndroid Build Coastguard Worker * idr_pic_id 2277*495ae853SAndroid Build Coastguard Worker */ 2278*495ae853SAndroid Build Coastguard Worker WORD32 i4_idr_pic_id; 2279*495ae853SAndroid Build Coastguard Worker 2280*495ae853SAndroid Build Coastguard Worker /** 2281*495ae853SAndroid Build Coastguard Worker * Flush mode 2282*495ae853SAndroid Build Coastguard Worker */ 2283*495ae853SAndroid Build Coastguard Worker WORD32 i4_flush_mode; 2284*495ae853SAndroid Build Coastguard Worker 2285*495ae853SAndroid Build Coastguard Worker /** 2286*495ae853SAndroid Build Coastguard Worker * Encode header mode 2287*495ae853SAndroid Build Coastguard Worker */ 2288*495ae853SAndroid Build Coastguard Worker WORD32 i4_header_mode; 2289*495ae853SAndroid Build Coastguard Worker 2290*495ae853SAndroid Build Coastguard Worker /** 2291*495ae853SAndroid Build Coastguard Worker * Flag to indicate if header has already 2292*495ae853SAndroid Build Coastguard Worker * been generated when i4_api_call_cnt 0 2293*495ae853SAndroid Build Coastguard Worker */ 2294*495ae853SAndroid Build Coastguard Worker UWORD32 u4_header_generated; 2295*495ae853SAndroid Build Coastguard Worker 2296*495ae853SAndroid Build Coastguard Worker /** 2297*495ae853SAndroid Build Coastguard Worker * Encode generate header 2298*495ae853SAndroid Build Coastguard Worker */ 2299*495ae853SAndroid Build Coastguard Worker WORD32 i4_gen_header; 2300*495ae853SAndroid Build Coastguard Worker 2301*495ae853SAndroid Build Coastguard Worker /** 2302*495ae853SAndroid Build Coastguard Worker * To signal successful completion of init 2303*495ae853SAndroid Build Coastguard Worker */ 2304*495ae853SAndroid Build Coastguard Worker WORD32 i4_init_done; 2305*495ae853SAndroid Build Coastguard Worker 2306*495ae853SAndroid Build Coastguard Worker /** 2307*495ae853SAndroid Build Coastguard Worker * To signal that at least one picture was decoded 2308*495ae853SAndroid Build Coastguard Worker */ 2309*495ae853SAndroid Build Coastguard Worker WORD32 i4_first_pic_done; 2310*495ae853SAndroid Build Coastguard Worker 2311*495ae853SAndroid Build Coastguard Worker /** 2312*495ae853SAndroid Build Coastguard Worker * Reset flag - Codec is reset if this flag is set 2313*495ae853SAndroid Build Coastguard Worker */ 2314*495ae853SAndroid Build Coastguard Worker WORD32 i4_reset_flag; 2315*495ae853SAndroid Build Coastguard Worker 2316*495ae853SAndroid Build Coastguard Worker /** 2317*495ae853SAndroid Build Coastguard Worker * Current error code 2318*495ae853SAndroid Build Coastguard Worker */ 2319*495ae853SAndroid Build Coastguard Worker WORD32 i4_error_code; 2320*495ae853SAndroid Build Coastguard Worker 2321*495ae853SAndroid Build Coastguard Worker /** 2322*495ae853SAndroid Build Coastguard Worker * threshold residue 2323*495ae853SAndroid Build Coastguard Worker */ 2324*495ae853SAndroid Build Coastguard Worker WORD32 u4_thres_resi; 2325*495ae853SAndroid Build Coastguard Worker 2326*495ae853SAndroid Build Coastguard Worker /** 2327*495ae853SAndroid Build Coastguard Worker * disable intra inter gating 2328*495ae853SAndroid Build Coastguard Worker */ 2329*495ae853SAndroid Build Coastguard Worker UWORD32 u4_inter_gate; 2330*495ae853SAndroid Build Coastguard Worker 2331*495ae853SAndroid Build Coastguard Worker /** 2332*495ae853SAndroid Build Coastguard Worker * Holds mem records passed during init. 2333*495ae853SAndroid Build Coastguard Worker * This will be used to return the mem records during retrieve call 2334*495ae853SAndroid Build Coastguard Worker */ 2335*495ae853SAndroid Build Coastguard Worker iv_mem_rec_t *ps_mem_rec_backup; 2336*495ae853SAndroid Build Coastguard Worker 2337*495ae853SAndroid Build Coastguard Worker /** 2338*495ae853SAndroid Build Coastguard Worker * Flag to determine if the entropy thread is active 2339*495ae853SAndroid Build Coastguard Worker */ 2340*495ae853SAndroid Build Coastguard Worker volatile UWORD32 au4_entropy_thread_active[MAX_CTXT_SETS]; 2341*495ae853SAndroid Build Coastguard Worker 2342*495ae853SAndroid Build Coastguard Worker /** 2343*495ae853SAndroid Build Coastguard Worker * Mutex used to keep the entropy calls thread-safe 2344*495ae853SAndroid Build Coastguard Worker */ 2345*495ae853SAndroid Build Coastguard Worker void *pv_entropy_mutex; 2346*495ae853SAndroid Build Coastguard Worker 2347*495ae853SAndroid Build Coastguard Worker /** 2348*495ae853SAndroid Build Coastguard Worker * Job queue buffer base 2349*495ae853SAndroid Build Coastguard Worker */ 2350*495ae853SAndroid Build Coastguard Worker void *pv_proc_jobq_buf, *pv_entropy_jobq_buf; 2351*495ae853SAndroid Build Coastguard Worker 2352*495ae853SAndroid Build Coastguard Worker /** 2353*495ae853SAndroid Build Coastguard Worker * Job Queue mem tab size 2354*495ae853SAndroid Build Coastguard Worker */ 2355*495ae853SAndroid Build Coastguard Worker WORD32 i4_proc_jobq_buf_size, i4_entropy_jobq_buf_size; 2356*495ae853SAndroid Build Coastguard Worker 2357*495ae853SAndroid Build Coastguard Worker /** 2358*495ae853SAndroid Build Coastguard Worker * Memory for MV Bank buffer manager 2359*495ae853SAndroid Build Coastguard Worker */ 2360*495ae853SAndroid Build Coastguard Worker void *pv_mv_buf_mgr_base; 2361*495ae853SAndroid Build Coastguard Worker 2362*495ae853SAndroid Build Coastguard Worker /** 2363*495ae853SAndroid Build Coastguard Worker * MV Bank buffer manager 2364*495ae853SAndroid Build Coastguard Worker */ 2365*495ae853SAndroid Build Coastguard Worker void *pv_mv_buf_mgr; 2366*495ae853SAndroid Build Coastguard Worker 2367*495ae853SAndroid Build Coastguard Worker /** 2368*495ae853SAndroid Build Coastguard Worker * Pointer to MV Buf structure array 2369*495ae853SAndroid Build Coastguard Worker */ 2370*495ae853SAndroid Build Coastguard Worker void *ps_mv_buf; 2371*495ae853SAndroid Build Coastguard Worker 2372*495ae853SAndroid Build Coastguard Worker /** 2373*495ae853SAndroid Build Coastguard Worker * Base address for Motion Vector bank buffer 2374*495ae853SAndroid Build Coastguard Worker */ 2375*495ae853SAndroid Build Coastguard Worker void *pv_mv_bank_buf_base; 2376*495ae853SAndroid Build Coastguard Worker 2377*495ae853SAndroid Build Coastguard Worker /** 2378*495ae853SAndroid Build Coastguard Worker * MV Bank size allocated 2379*495ae853SAndroid Build Coastguard Worker */ 2380*495ae853SAndroid Build Coastguard Worker WORD32 i4_total_mv_bank_size; 2381*495ae853SAndroid Build Coastguard Worker 2382*495ae853SAndroid Build Coastguard Worker /** 2383*495ae853SAndroid Build Coastguard Worker * Memory for Picture buffer manager for reference pictures 2384*495ae853SAndroid Build Coastguard Worker */ 2385*495ae853SAndroid Build Coastguard Worker void *pv_ref_buf_mgr_base; 2386*495ae853SAndroid Build Coastguard Worker 2387*495ae853SAndroid Build Coastguard Worker /** 2388*495ae853SAndroid Build Coastguard Worker * Picture buffer manager for reference pictures 2389*495ae853SAndroid Build Coastguard Worker */ 2390*495ae853SAndroid Build Coastguard Worker void *pv_ref_buf_mgr; 2391*495ae853SAndroid Build Coastguard Worker 2392*495ae853SAndroid Build Coastguard Worker /** 2393*495ae853SAndroid Build Coastguard Worker * Number of reference buffers added to the buffer manager 2394*495ae853SAndroid Build Coastguard Worker */ 2395*495ae853SAndroid Build Coastguard Worker WORD32 i4_ref_buf_cnt; 2396*495ae853SAndroid Build Coastguard Worker 2397*495ae853SAndroid Build Coastguard Worker /** 2398*495ae853SAndroid Build Coastguard Worker * Pointer to Pic Buf structure array 2399*495ae853SAndroid Build Coastguard Worker */ 2400*495ae853SAndroid Build Coastguard Worker void *ps_pic_buf; 2401*495ae853SAndroid Build Coastguard Worker 2402*495ae853SAndroid Build Coastguard Worker /** 2403*495ae853SAndroid Build Coastguard Worker * Base address for Picture buffer 2404*495ae853SAndroid Build Coastguard Worker */ 2405*495ae853SAndroid Build Coastguard Worker void *pv_pic_buf_base; 2406*495ae853SAndroid Build Coastguard Worker 2407*495ae853SAndroid Build Coastguard Worker /** 2408*495ae853SAndroid Build Coastguard Worker * Total pic buffer size allocated 2409*495ae853SAndroid Build Coastguard Worker */ 2410*495ae853SAndroid Build Coastguard Worker WORD32 i4_total_pic_buf_size; 2411*495ae853SAndroid Build Coastguard Worker 2412*495ae853SAndroid Build Coastguard Worker /** 2413*495ae853SAndroid Build Coastguard Worker * Memory for Buffer manager for output buffers 2414*495ae853SAndroid Build Coastguard Worker */ 2415*495ae853SAndroid Build Coastguard Worker void *pv_out_buf_mgr_base; 2416*495ae853SAndroid Build Coastguard Worker 2417*495ae853SAndroid Build Coastguard Worker /** 2418*495ae853SAndroid Build Coastguard Worker * Buffer manager for output buffers 2419*495ae853SAndroid Build Coastguard Worker */ 2420*495ae853SAndroid Build Coastguard Worker void *pv_out_buf_mgr; 2421*495ae853SAndroid Build Coastguard Worker 2422*495ae853SAndroid Build Coastguard Worker /** 2423*495ae853SAndroid Build Coastguard Worker * Current output buffer's buffer ID 2424*495ae853SAndroid Build Coastguard Worker */ 2425*495ae853SAndroid Build Coastguard Worker WORD32 i4_out_buf_id; 2426*495ae853SAndroid Build Coastguard Worker 2427*495ae853SAndroid Build Coastguard Worker /** 2428*495ae853SAndroid Build Coastguard Worker * Number of output buffers added to the buffer manager 2429*495ae853SAndroid Build Coastguard Worker */ 2430*495ae853SAndroid Build Coastguard Worker WORD32 i4_out_buf_cnt; 2431*495ae853SAndroid Build Coastguard Worker 2432*495ae853SAndroid Build Coastguard Worker /** 2433*495ae853SAndroid Build Coastguard Worker * Memory for Picture buffer manager for input buffers 2434*495ae853SAndroid Build Coastguard Worker */ 2435*495ae853SAndroid Build Coastguard Worker void *pv_inp_buf_mgr_base; 2436*495ae853SAndroid Build Coastguard Worker 2437*495ae853SAndroid Build Coastguard Worker /** 2438*495ae853SAndroid Build Coastguard Worker * Picture buffer manager for input buffers 2439*495ae853SAndroid Build Coastguard Worker */ 2440*495ae853SAndroid Build Coastguard Worker void *pv_inp_buf_mgr; 2441*495ae853SAndroid Build Coastguard Worker 2442*495ae853SAndroid Build Coastguard Worker /** 2443*495ae853SAndroid Build Coastguard Worker * Current input buffer's buffer ID 2444*495ae853SAndroid Build Coastguard Worker */ 2445*495ae853SAndroid Build Coastguard Worker WORD32 i4_inp_buf_id; 2446*495ae853SAndroid Build Coastguard Worker 2447*495ae853SAndroid Build Coastguard Worker /** 2448*495ae853SAndroid Build Coastguard Worker * Number of input buffers added to the buffer manager 2449*495ae853SAndroid Build Coastguard Worker */ 2450*495ae853SAndroid Build Coastguard Worker WORD32 i4_inp_buf_cnt; 2451*495ae853SAndroid Build Coastguard Worker 2452*495ae853SAndroid Build Coastguard Worker /** 2453*495ae853SAndroid Build Coastguard Worker * Current input buffer 2454*495ae853SAndroid Build Coastguard Worker */ 2455*495ae853SAndroid Build Coastguard Worker pic_buf_t *ps_inp_buf; 2456*495ae853SAndroid Build Coastguard Worker 2457*495ae853SAndroid Build Coastguard Worker /** 2458*495ae853SAndroid Build Coastguard Worker * Pointer to dpb manager structure 2459*495ae853SAndroid Build Coastguard Worker */ 2460*495ae853SAndroid Build Coastguard Worker void *pv_dpb_mgr; 2461*495ae853SAndroid Build Coastguard Worker 2462*495ae853SAndroid Build Coastguard Worker /** 2463*495ae853SAndroid Build Coastguard Worker * Pointer to base of Sequence parameter set structure array 2464*495ae853SAndroid Build Coastguard Worker */ 2465*495ae853SAndroid Build Coastguard Worker sps_t *ps_sps_base; 2466*495ae853SAndroid Build Coastguard Worker 2467*495ae853SAndroid Build Coastguard Worker /** 2468*495ae853SAndroid Build Coastguard Worker * Pointer to base of Picture parameter set structure array 2469*495ae853SAndroid Build Coastguard Worker */ 2470*495ae853SAndroid Build Coastguard Worker pps_t *ps_pps_base; 2471*495ae853SAndroid Build Coastguard Worker 2472*495ae853SAndroid Build Coastguard Worker /** 2473*495ae853SAndroid Build Coastguard Worker * seq_parameter_set_id 2474*495ae853SAndroid Build Coastguard Worker */ 2475*495ae853SAndroid Build Coastguard Worker WORD32 i4_sps_id; 2476*495ae853SAndroid Build Coastguard Worker 2477*495ae853SAndroid Build Coastguard Worker /** 2478*495ae853SAndroid Build Coastguard Worker * pic_parameter_set_id 2479*495ae853SAndroid Build Coastguard Worker */ 2480*495ae853SAndroid Build Coastguard Worker WORD32 i4_pps_id; 2481*495ae853SAndroid Build Coastguard Worker 2482*495ae853SAndroid Build Coastguard Worker /** 2483*495ae853SAndroid Build Coastguard Worker * Pointer to base of slice header structure array 2484*495ae853SAndroid Build Coastguard Worker */ 2485*495ae853SAndroid Build Coastguard Worker slice_header_t *ps_slice_hdr_base; 2486*495ae853SAndroid Build Coastguard Worker 2487*495ae853SAndroid Build Coastguard Worker /** 2488*495ae853SAndroid Build Coastguard Worker * packed residue coeff data size for 1 row of mbs 2489*495ae853SAndroid Build Coastguard Worker */ 2490*495ae853SAndroid Build Coastguard Worker UWORD32 u4_size_coeff_data; 2491*495ae853SAndroid Build Coastguard Worker 2492*495ae853SAndroid Build Coastguard Worker /** 2493*495ae853SAndroid Build Coastguard Worker * packed header data size for 1 row of mbs 2494*495ae853SAndroid Build Coastguard Worker */ 2495*495ae853SAndroid Build Coastguard Worker UWORD32 u4_size_header_data; 2496*495ae853SAndroid Build Coastguard Worker 2497*495ae853SAndroid Build Coastguard Worker /** 2498*495ae853SAndroid Build Coastguard Worker * Processing context - One for each processing thread 2499*495ae853SAndroid Build Coastguard Worker * Create two sets, each set used for alternate frames 2500*495ae853SAndroid Build Coastguard Worker */ 2501*495ae853SAndroid Build Coastguard Worker process_ctxt_t as_process[MAX_PROCESS_CTXT]; 2502*495ae853SAndroid Build Coastguard Worker 2503*495ae853SAndroid Build Coastguard Worker /** 2504*495ae853SAndroid Build Coastguard Worker * Thread handle for each of the processing threads 2505*495ae853SAndroid Build Coastguard Worker */ 2506*495ae853SAndroid Build Coastguard Worker void *apv_proc_thread_handle[MAX_PROCESS_THREADS]; 2507*495ae853SAndroid Build Coastguard Worker 2508*495ae853SAndroid Build Coastguard Worker /** 2509*495ae853SAndroid Build Coastguard Worker * Structure for global PSNR 2510*495ae853SAndroid Build Coastguard Worker */ 2511*495ae853SAndroid Build Coastguard Worker quality_stats_t s_global_quality_stats; 2512*495ae853SAndroid Build Coastguard Worker 2513*495ae853SAndroid Build Coastguard Worker /** 2514*495ae853SAndroid Build Coastguard Worker * Thread created flag for each of the processing threads 2515*495ae853SAndroid Build Coastguard Worker */ 2516*495ae853SAndroid Build Coastguard Worker WORD32 ai4_process_thread_created[MAX_PROCESS_THREADS]; 2517*495ae853SAndroid Build Coastguard Worker 2518*495ae853SAndroid Build Coastguard Worker /** 2519*495ae853SAndroid Build Coastguard Worker * Void pointer to process job context 2520*495ae853SAndroid Build Coastguard Worker */ 2521*495ae853SAndroid Build Coastguard Worker void *pv_proc_jobq, *pv_entropy_jobq; 2522*495ae853SAndroid Build Coastguard Worker 2523*495ae853SAndroid Build Coastguard Worker /** 2524*495ae853SAndroid Build Coastguard Worker * Number of MBs processed together for better instruction cache handling 2525*495ae853SAndroid Build Coastguard Worker */ 2526*495ae853SAndroid Build Coastguard Worker WORD32 i4_proc_nmb; 2527*495ae853SAndroid Build Coastguard Worker 2528*495ae853SAndroid Build Coastguard Worker /** 2529*495ae853SAndroid Build Coastguard Worker * Previous POC lsb 2530*495ae853SAndroid Build Coastguard Worker */ 2531*495ae853SAndroid Build Coastguard Worker WORD32 i4_prev_poc_lsb; 2532*495ae853SAndroid Build Coastguard Worker 2533*495ae853SAndroid Build Coastguard Worker /** 2534*495ae853SAndroid Build Coastguard Worker * Previous POC msb 2535*495ae853SAndroid Build Coastguard Worker */ 2536*495ae853SAndroid Build Coastguard Worker WORD32 i4_prev_poc_msb; 2537*495ae853SAndroid Build Coastguard Worker 2538*495ae853SAndroid Build Coastguard Worker /** 2539*495ae853SAndroid Build Coastguard Worker * Max POC lsb that has arrived till now 2540*495ae853SAndroid Build Coastguard Worker */ 2541*495ae853SAndroid Build Coastguard Worker WORD32 i4_max_prev_poc_lsb; 2542*495ae853SAndroid Build Coastguard Worker 2543*495ae853SAndroid Build Coastguard Worker /** 2544*495ae853SAndroid Build Coastguard Worker * Context for format conversion 2545*495ae853SAndroid Build Coastguard Worker */ 2546*495ae853SAndroid Build Coastguard Worker fmt_conv_t s_fmt_conv; 2547*495ae853SAndroid Build Coastguard Worker 2548*495ae853SAndroid Build Coastguard Worker /** 2549*495ae853SAndroid Build Coastguard Worker * Absolute pic order count 2550*495ae853SAndroid Build Coastguard Worker */ 2551*495ae853SAndroid Build Coastguard Worker WORD32 i4_abs_pic_order_cnt; 2552*495ae853SAndroid Build Coastguard Worker 2553*495ae853SAndroid Build Coastguard Worker /** 2554*495ae853SAndroid Build Coastguard Worker * Pic order count of lsb 2555*495ae853SAndroid Build Coastguard Worker */ 2556*495ae853SAndroid Build Coastguard Worker WORD32 i4_pic_order_cnt_lsb; 2557*495ae853SAndroid Build Coastguard Worker 2558*495ae853SAndroid Build Coastguard Worker /** 2559*495ae853SAndroid Build Coastguard Worker * Array giving current picture being processed in each context set 2560*495ae853SAndroid Build Coastguard Worker */ 2561*495ae853SAndroid Build Coastguard Worker WORD32 ai4_pic_cnt[MAX_CTXT_SETS]; 2562*495ae853SAndroid Build Coastguard Worker 2563*495ae853SAndroid Build Coastguard Worker /* 2564*495ae853SAndroid Build Coastguard Worker * Min sad to search for 2565*495ae853SAndroid Build Coastguard Worker */ 2566*495ae853SAndroid Build Coastguard Worker UWORD32 u4_min_sad; 2567*495ae853SAndroid Build Coastguard Worker 2568*495ae853SAndroid Build Coastguard Worker /** 2569*495ae853SAndroid Build Coastguard Worker * Reference picture set 2570*495ae853SAndroid Build Coastguard Worker */ 2571*495ae853SAndroid Build Coastguard Worker ref_set_t as_ref_set[MAX_DPB_SIZE + MAX_CTXT_SETS]; 2572*495ae853SAndroid Build Coastguard Worker 2573*495ae853SAndroid Build Coastguard Worker 2574*495ae853SAndroid Build Coastguard Worker /* 2575*495ae853SAndroid Build Coastguard Worker * Air pic cnt 2576*495ae853SAndroid Build Coastguard Worker * Contains the number of pictures that have been encoded with air 2577*495ae853SAndroid Build Coastguard Worker * This value is moudulo air refresh period 2578*495ae853SAndroid Build Coastguard Worker */ 2579*495ae853SAndroid Build Coastguard Worker WORD32 i4_air_pic_cnt; 2580*495ae853SAndroid Build Coastguard Worker 2581*495ae853SAndroid Build Coastguard Worker /* 2582*495ae853SAndroid Build Coastguard Worker * Intra refresh map 2583*495ae853SAndroid Build Coastguard Worker * Stores the frames at which intra refresh should occur for a MB 2584*495ae853SAndroid Build Coastguard Worker */ 2585*495ae853SAndroid Build Coastguard Worker UWORD16 *pu2_intr_rfrsh_map; 2586*495ae853SAndroid Build Coastguard Worker 2587*495ae853SAndroid Build Coastguard Worker /* 2588*495ae853SAndroid Build Coastguard Worker * Intra MB Cost Map 2589*495ae853SAndroid Build Coastguard Worker * Stores the intra cost of all mb of a frame 2590*495ae853SAndroid Build Coastguard Worker */ 2591*495ae853SAndroid Build Coastguard Worker WORD32 *pi4_mb_intra_cost; 2592*495ae853SAndroid Build Coastguard Worker 2593*495ae853SAndroid Build Coastguard Worker /* 2594*495ae853SAndroid Build Coastguard Worker * Indicates if the current frame is used as a reference frame 2595*495ae853SAndroid Build Coastguard Worker */ 2596*495ae853SAndroid Build Coastguard Worker UWORD32 u4_is_curr_frm_ref; 2597*495ae853SAndroid Build Coastguard Worker 2598*495ae853SAndroid Build Coastguard Worker /* 2599*495ae853SAndroid Build Coastguard Worker * Indicates if there can be non reference frames in the stream 2600*495ae853SAndroid Build Coastguard Worker */ 2601*495ae853SAndroid Build Coastguard Worker WORD32 i4_non_ref_frames_in_stream; 2602*495ae853SAndroid Build Coastguard Worker 2603*495ae853SAndroid Build Coastguard Worker /* 2604*495ae853SAndroid Build Coastguard Worker * Memory for color space conversion for luma plane 2605*495ae853SAndroid Build Coastguard Worker */ 2606*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_y_csc_buf_base; 2607*495ae853SAndroid Build Coastguard Worker 2608*495ae853SAndroid Build Coastguard Worker /* 2609*495ae853SAndroid Build Coastguard Worker * Memory for color space conversion foe chroma plane 2610*495ae853SAndroid Build Coastguard Worker */ 2611*495ae853SAndroid Build Coastguard Worker UWORD8 *pu1_uv_csc_buf_base; 2612*495ae853SAndroid Build Coastguard Worker 2613*495ae853SAndroid Build Coastguard Worker /** 2614*495ae853SAndroid Build Coastguard Worker * Function pointers for intra pred leaf level functions luma 2615*495ae853SAndroid Build Coastguard Worker */ 2616*495ae853SAndroid Build Coastguard Worker pf_intra_pred apf_intra_pred_16_l[MAX_I16x16]; 2617*495ae853SAndroid Build Coastguard Worker pf_intra_pred apf_intra_pred_8_l[MAX_I8x8]; 2618*495ae853SAndroid Build Coastguard Worker pf_intra_pred apf_intra_pred_4_l[MAX_I4x4]; 2619*495ae853SAndroid Build Coastguard Worker 2620*495ae853SAndroid Build Coastguard Worker /** 2621*495ae853SAndroid Build Coastguard Worker * Function pointers for intra pred leaf level functions chroma 2622*495ae853SAndroid Build Coastguard Worker */ 2623*495ae853SAndroid Build Coastguard Worker pf_intra_pred apf_intra_pred_c[MAX_CH_I8x8]; 2624*495ae853SAndroid Build Coastguard Worker 2625*495ae853SAndroid Build Coastguard Worker /** 2626*495ae853SAndroid Build Coastguard Worker * luma core coding function pointer 2627*495ae853SAndroid Build Coastguard Worker */ 2628*495ae853SAndroid Build Coastguard Worker UWORD8 (*luma_energy_compaction[4])(process_ctxt_t *ps_proc); 2629*495ae853SAndroid Build Coastguard Worker 2630*495ae853SAndroid Build Coastguard Worker /** 2631*495ae853SAndroid Build Coastguard Worker * chroma core coding function pointer 2632*495ae853SAndroid Build Coastguard Worker */ 2633*495ae853SAndroid Build Coastguard Worker UWORD8 (*chroma_energy_compaction[2])(process_ctxt_t *ps_proc); 2634*495ae853SAndroid Build Coastguard Worker 2635*495ae853SAndroid Build Coastguard Worker /** 2636*495ae853SAndroid Build Coastguard Worker * forward transform for intra blk of mb type 16x16 2637*495ae853SAndroid Build Coastguard Worker */ 2638*495ae853SAndroid Build Coastguard Worker ih264_luma_16x16_resi_trans_dctrans_quant_ft *pf_resi_trans_dctrans_quant_16x16; 2639*495ae853SAndroid Build Coastguard Worker 2640*495ae853SAndroid Build Coastguard Worker /** 2641*495ae853SAndroid Build Coastguard Worker * inverse transform for intra blk of mb type 16x16 2642*495ae853SAndroid Build Coastguard Worker */ 2643*495ae853SAndroid Build Coastguard Worker ih264_luma_16x16_idctrans_iquant_itrans_recon_ft *pf_idctrans_iquant_itrans_recon_16x16; 2644*495ae853SAndroid Build Coastguard Worker 2645*495ae853SAndroid Build Coastguard Worker /** 2646*495ae853SAndroid Build Coastguard Worker * forward transform for 4x4 blk luma 2647*495ae853SAndroid Build Coastguard Worker */ 2648*495ae853SAndroid Build Coastguard Worker ih264_resi_trans_quant_ft *pf_resi_trans_quant_4x4; 2649*495ae853SAndroid Build Coastguard Worker 2650*495ae853SAndroid Build Coastguard Worker /** 2651*495ae853SAndroid Build Coastguard Worker * forward transform for 4x4 blk luma 2652*495ae853SAndroid Build Coastguard Worker */ 2653*495ae853SAndroid Build Coastguard Worker ih264_resi_trans_quant_ft *pf_resi_trans_quant_chroma_4x4; 2654*495ae853SAndroid Build Coastguard Worker 2655*495ae853SAndroid Build Coastguard Worker /* 2656*495ae853SAndroid Build Coastguard Worker * hadamard transform and quant for a 4x4 block 2657*495ae853SAndroid Build Coastguard Worker */ 2658*495ae853SAndroid Build Coastguard Worker ih264_hadamard_quant_ft *pf_hadamard_quant_4x4; 2659*495ae853SAndroid Build Coastguard Worker 2660*495ae853SAndroid Build Coastguard Worker /* 2661*495ae853SAndroid Build Coastguard Worker * hadamard transform and quant for a 4x4 block 2662*495ae853SAndroid Build Coastguard Worker */ 2663*495ae853SAndroid Build Coastguard Worker ih264_hadamard_quant_ft *pf_hadamard_quant_2x2_uv; 2664*495ae853SAndroid Build Coastguard Worker 2665*495ae853SAndroid Build Coastguard Worker /** 2666*495ae853SAndroid Build Coastguard Worker * inverse transform for 4x4 blk 2667*495ae853SAndroid Build Coastguard Worker */ 2668*495ae853SAndroid Build Coastguard Worker ih264_iquant_itrans_recon_ft *pf_iquant_itrans_recon_4x4; 2669*495ae853SAndroid Build Coastguard Worker 2670*495ae853SAndroid Build Coastguard Worker /** 2671*495ae853SAndroid Build Coastguard Worker * inverse transform for chroma 4x4 blk 2672*495ae853SAndroid Build Coastguard Worker */ 2673*495ae853SAndroid Build Coastguard Worker ih264_iquant_itrans_recon_chroma_ft *pf_iquant_itrans_recon_chroma_4x4; 2674*495ae853SAndroid Build Coastguard Worker 2675*495ae853SAndroid Build Coastguard Worker /** 2676*495ae853SAndroid Build Coastguard Worker * inverse transform for 4x4 blk with only single dc coeff 2677*495ae853SAndroid Build Coastguard Worker */ 2678*495ae853SAndroid Build Coastguard Worker ih264_iquant_itrans_recon_ft *pf_iquant_itrans_recon_4x4_dc; 2679*495ae853SAndroid Build Coastguard Worker 2680*495ae853SAndroid Build Coastguard Worker /** 2681*495ae853SAndroid Build Coastguard Worker * inverse transform for chroma 4x4 blk with only single dc coeff 2682*495ae853SAndroid Build Coastguard Worker */ 2683*495ae853SAndroid Build Coastguard Worker ih264_iquant_itrans_recon_chroma_ft *pf_iquant_itrans_recon_chroma_4x4_dc; 2684*495ae853SAndroid Build Coastguard Worker 2685*495ae853SAndroid Build Coastguard Worker /* 2686*495ae853SAndroid Build Coastguard Worker * Inverse hadamard transform and iquant for a 4x4 block 2687*495ae853SAndroid Build Coastguard Worker */ 2688*495ae853SAndroid Build Coastguard Worker ih264_ihadamard_scaling_ft *pf_ihadamard_scaling_4x4; 2689*495ae853SAndroid Build Coastguard Worker 2690*495ae853SAndroid Build Coastguard Worker /* 2691*495ae853SAndroid Build Coastguard Worker * Inverse hadamard transform and iquant for a 4x4 block 2692*495ae853SAndroid Build Coastguard Worker */ 2693*495ae853SAndroid Build Coastguard Worker ih264_ihadamard_scaling_ft *pf_ihadamard_scaling_2x2_uv; 2694*495ae853SAndroid Build Coastguard Worker 2695*495ae853SAndroid Build Coastguard Worker /* 2696*495ae853SAndroid Build Coastguard Worker * Function for interleave copy* 2697*495ae853SAndroid Build Coastguard Worker */ 2698*495ae853SAndroid Build Coastguard Worker ih264_interleave_copy_ft *pf_interleave_copy; 2699*495ae853SAndroid Build Coastguard Worker 2700*495ae853SAndroid Build Coastguard Worker /** 2701*495ae853SAndroid Build Coastguard Worker * forward transform for 8x8 blk 2702*495ae853SAndroid Build Coastguard Worker */ 2703*495ae853SAndroid Build Coastguard Worker ih264_resi_trans_quant_ft *pf_resi_trans_quant_8x8; 2704*495ae853SAndroid Build Coastguard Worker 2705*495ae853SAndroid Build Coastguard Worker /** 2706*495ae853SAndroid Build Coastguard Worker * inverse transform for 8x8 blk 2707*495ae853SAndroid Build Coastguard Worker */ 2708*495ae853SAndroid Build Coastguard Worker /** 2709*495ae853SAndroid Build Coastguard Worker * inverse transform for 4x4 blk 2710*495ae853SAndroid Build Coastguard Worker */ 2711*495ae853SAndroid Build Coastguard Worker ih264_iquant_itrans_recon_ft *pf_iquant_itrans_recon_8x8; 2712*495ae853SAndroid Build Coastguard Worker 2713*495ae853SAndroid Build Coastguard Worker /** 2714*495ae853SAndroid Build Coastguard Worker * forward transform for chroma MB 2715*495ae853SAndroid Build Coastguard Worker */ 2716*495ae853SAndroid Build Coastguard Worker ih264_chroma_8x8_resi_trans_dctrans_quant_ft *pf_resi_trans_dctrans_quant_8x8_chroma; 2717*495ae853SAndroid Build Coastguard Worker 2718*495ae853SAndroid Build Coastguard Worker /** 2719*495ae853SAndroid Build Coastguard Worker * inverse transform for chroma MB 2720*495ae853SAndroid Build Coastguard Worker */ 2721*495ae853SAndroid Build Coastguard Worker ih264_idctrans_iquant_itrans_recon_ft *pf_idctrans_iquant_itrans_recon_8x8_chroma; 2722*495ae853SAndroid Build Coastguard Worker 2723*495ae853SAndroid Build Coastguard Worker /** 2724*495ae853SAndroid Build Coastguard Worker * deblock vertical luma edge with blocking strength 4 2725*495ae853SAndroid Build Coastguard Worker */ 2726*495ae853SAndroid Build Coastguard Worker ih264_deblk_edge_bs4_ft *pf_deblk_luma_vert_bs4; 2727*495ae853SAndroid Build Coastguard Worker 2728*495ae853SAndroid Build Coastguard Worker /** 2729*495ae853SAndroid Build Coastguard Worker * deblock vertical chroma edge with blocking strength 4 2730*495ae853SAndroid Build Coastguard Worker */ 2731*495ae853SAndroid Build Coastguard Worker ih264_deblk_chroma_edge_bs4_ft *pf_deblk_chroma_vert_bs4; 2732*495ae853SAndroid Build Coastguard Worker 2733*495ae853SAndroid Build Coastguard Worker /** 2734*495ae853SAndroid Build Coastguard Worker * deblock vertical luma edge with blocking strength less than 4 2735*495ae853SAndroid Build Coastguard Worker */ 2736*495ae853SAndroid Build Coastguard Worker ih264_deblk_edge_bslt4_ft *pf_deblk_luma_vert_bslt4; 2737*495ae853SAndroid Build Coastguard Worker 2738*495ae853SAndroid Build Coastguard Worker /** 2739*495ae853SAndroid Build Coastguard Worker * deblock vertical chroma edge with blocking strength less than 4 2740*495ae853SAndroid Build Coastguard Worker */ 2741*495ae853SAndroid Build Coastguard Worker ih264_deblk_chroma_edge_bslt4_ft *pf_deblk_chroma_vert_bslt4; 2742*495ae853SAndroid Build Coastguard Worker 2743*495ae853SAndroid Build Coastguard Worker /** 2744*495ae853SAndroid Build Coastguard Worker * deblock horizontal luma edge with blocking strength 4 2745*495ae853SAndroid Build Coastguard Worker */ 2746*495ae853SAndroid Build Coastguard Worker ih264_deblk_edge_bs4_ft *pf_deblk_luma_horz_bs4; 2747*495ae853SAndroid Build Coastguard Worker 2748*495ae853SAndroid Build Coastguard Worker /** 2749*495ae853SAndroid Build Coastguard Worker * deblock horizontal chroma edge with blocking strength 4 2750*495ae853SAndroid Build Coastguard Worker */ 2751*495ae853SAndroid Build Coastguard Worker ih264_deblk_chroma_edge_bs4_ft *pf_deblk_chroma_horz_bs4; 2752*495ae853SAndroid Build Coastguard Worker 2753*495ae853SAndroid Build Coastguard Worker /** 2754*495ae853SAndroid Build Coastguard Worker * deblock horizontal luma edge with blocking strength less than 4 2755*495ae853SAndroid Build Coastguard Worker */ 2756*495ae853SAndroid Build Coastguard Worker ih264_deblk_edge_bslt4_ft *pf_deblk_luma_horz_bslt4; 2757*495ae853SAndroid Build Coastguard Worker 2758*495ae853SAndroid Build Coastguard Worker /** 2759*495ae853SAndroid Build Coastguard Worker * deblock horizontal chroma edge with blocking strength less than 4 2760*495ae853SAndroid Build Coastguard Worker */ 2761*495ae853SAndroid Build Coastguard Worker ih264_deblk_chroma_edge_bslt4_ft *pf_deblk_chroma_horz_bslt4; 2762*495ae853SAndroid Build Coastguard Worker 2763*495ae853SAndroid Build Coastguard Worker 2764*495ae853SAndroid Build Coastguard Worker /** 2765*495ae853SAndroid Build Coastguard Worker * functions for padding 2766*495ae853SAndroid Build Coastguard Worker */ 2767*495ae853SAndroid Build Coastguard Worker pf_pad pf_pad_top; 2768*495ae853SAndroid Build Coastguard Worker pf_pad pf_pad_bottom; 2769*495ae853SAndroid Build Coastguard Worker pf_pad pf_pad_left_luma; 2770*495ae853SAndroid Build Coastguard Worker pf_pad pf_pad_left_chroma; 2771*495ae853SAndroid Build Coastguard Worker pf_pad pf_pad_right_luma; 2772*495ae853SAndroid Build Coastguard Worker pf_pad pf_pad_right_chroma; 2773*495ae853SAndroid Build Coastguard Worker 2774*495ae853SAndroid Build Coastguard Worker /** 2775*495ae853SAndroid Build Coastguard Worker * Inter pred leaf level functions 2776*495ae853SAndroid Build Coastguard Worker */ 2777*495ae853SAndroid Build Coastguard Worker ih264_inter_pred_luma_ft *pf_inter_pred_luma_copy; 2778*495ae853SAndroid Build Coastguard Worker ih264_inter_pred_luma_ft *pf_inter_pred_luma_horz; 2779*495ae853SAndroid Build Coastguard Worker ih264_inter_pred_luma_ft *pf_inter_pred_luma_vert; 2780*495ae853SAndroid Build Coastguard Worker pf_inter_pred_luma_bilinear pf_inter_pred_luma_bilinear; 2781*495ae853SAndroid Build Coastguard Worker ih264_inter_pred_chroma_ft *pf_inter_pred_chroma; 2782*495ae853SAndroid Build Coastguard Worker 2783*495ae853SAndroid Build Coastguard Worker /** 2784*495ae853SAndroid Build Coastguard Worker * fn ptrs for compute sad routines 2785*495ae853SAndroid Build Coastguard Worker */ 2786*495ae853SAndroid Build Coastguard Worker ime_compute_sad_ft *apf_compute_sad_16x16[2]; 2787*495ae853SAndroid Build Coastguard Worker ime_compute_sad_ft *pf_compute_sad_16x8; 2788*495ae853SAndroid Build Coastguard Worker 2789*495ae853SAndroid Build Coastguard Worker 2790*495ae853SAndroid Build Coastguard Worker /** 2791*495ae853SAndroid Build Coastguard Worker * Function pointer for computing ME 2792*495ae853SAndroid Build Coastguard Worker * 1 for PSLICE and 1 for BSLICE 2793*495ae853SAndroid Build Coastguard Worker */ 2794*495ae853SAndroid Build Coastguard Worker ih264e_compute_me_ft *apf_compute_me[2]; 2795*495ae853SAndroid Build Coastguard Worker 2796*495ae853SAndroid Build Coastguard Worker /** 2797*495ae853SAndroid Build Coastguard Worker * Function pointers for computing SKIP parameters 2798*495ae853SAndroid Build Coastguard Worker */ 2799*495ae853SAndroid Build Coastguard Worker ih264e_skip_params_ft *apf_find_skip_params_me[2]; 2800*495ae853SAndroid Build Coastguard Worker 2801*495ae853SAndroid Build Coastguard Worker /** 2802*495ae853SAndroid Build Coastguard Worker * fn ptrs for memory handling operations 2803*495ae853SAndroid Build Coastguard Worker */ 2804*495ae853SAndroid Build Coastguard Worker pf_memcpy pf_mem_cpy; 2805*495ae853SAndroid Build Coastguard Worker pf_memset pf_mem_set; 2806*495ae853SAndroid Build Coastguard Worker pf_memcpy_mul8 pf_mem_cpy_mul8; 2807*495ae853SAndroid Build Coastguard Worker pf_memset_mul8 pf_mem_set_mul8; 2808*495ae853SAndroid Build Coastguard Worker 2809*495ae853SAndroid Build Coastguard Worker /** 2810*495ae853SAndroid Build Coastguard Worker * intra mode eval -encoder level function 2811*495ae853SAndroid Build Coastguard Worker */ 2812*495ae853SAndroid Build Coastguard Worker pf_evaluate_intra_modes pf_ih264e_evaluate_intra16x16_modes; 2813*495ae853SAndroid Build Coastguard Worker pf_evaluate_intra_modes pf_ih264e_evaluate_intra_chroma_modes; 2814*495ae853SAndroid Build Coastguard Worker pf_evaluate_intra_4x4_modes pf_ih264e_evaluate_intra_4x4_modes; 2815*495ae853SAndroid Build Coastguard Worker 2816*495ae853SAndroid Build Coastguard Worker /* Half pel generation function - encoder level 2817*495ae853SAndroid Build Coastguard Worker * 2818*495ae853SAndroid Build Coastguard Worker */ 2819*495ae853SAndroid Build Coastguard Worker pf_sixtapfilter_horz pf_ih264e_sixtapfilter_horz; 2820*495ae853SAndroid Build Coastguard Worker pf_sixtap_filter_2dvh_vert pf_ih264e_sixtap_filter_2dvh_vert; 2821*495ae853SAndroid Build Coastguard Worker 2822*495ae853SAndroid Build Coastguard Worker /** 2823*495ae853SAndroid Build Coastguard Worker * color space conversion from YUV 420P to YUV 420Sp 2824*495ae853SAndroid Build Coastguard Worker */ 2825*495ae853SAndroid Build Coastguard Worker pf_fmt_conv_420p_to_420sp pf_ih264e_conv_420p_to_420sp; 2826*495ae853SAndroid Build Coastguard Worker 2827*495ae853SAndroid Build Coastguard Worker 2828*495ae853SAndroid Build Coastguard Worker /** 2829*495ae853SAndroid Build Coastguard Worker * color space conversion from YUV 420P to YUV 420Sp 2830*495ae853SAndroid Build Coastguard Worker */ 2831*495ae853SAndroid Build Coastguard Worker pf_fmt_conv_422ile_to_420sp pf_ih264e_fmt_conv_422i_to_420sp; 2832*495ae853SAndroid Build Coastguard Worker 2833*495ae853SAndroid Build Coastguard Worker /** 2834*495ae853SAndroid Build Coastguard Worker * write mb layer for a given slice I, P, B 2835*495ae853SAndroid Build Coastguard Worker */ 2836*495ae853SAndroid Build Coastguard Worker IH264E_ERROR_T (*pf_write_mb_syntax_layer[2][3]) ( entropy_ctxt_t *ps_ent_ctxt ); 2837*495ae853SAndroid Build Coastguard Worker 2838*495ae853SAndroid Build Coastguard Worker /** 2839*495ae853SAndroid Build Coastguard Worker * Output buffer 2840*495ae853SAndroid Build Coastguard Worker */ 2841*495ae853SAndroid Build Coastguard Worker out_buf_t as_out_buf[MAX_CTXT_SETS]; 2842*495ae853SAndroid Build Coastguard Worker 2843*495ae853SAndroid Build Coastguard Worker /** 2844*495ae853SAndroid Build Coastguard Worker * recon buffer 2845*495ae853SAndroid Build Coastguard Worker */ 2846*495ae853SAndroid Build Coastguard Worker rec_buf_t as_rec_buf[MAX_CTXT_SETS]; 2847*495ae853SAndroid Build Coastguard Worker 2848*495ae853SAndroid Build Coastguard Worker /** 2849*495ae853SAndroid Build Coastguard Worker * rate control context 2850*495ae853SAndroid Build Coastguard Worker */ 2851*495ae853SAndroid Build Coastguard Worker rate_control_ctxt_t s_rate_control; 2852*495ae853SAndroid Build Coastguard Worker 2853*495ae853SAndroid Build Coastguard Worker /** 2854*495ae853SAndroid Build Coastguard Worker * input buffer queue 2855*495ae853SAndroid Build Coastguard Worker */ 2856*495ae853SAndroid Build Coastguard Worker inp_buf_t as_inp_list[MAX_NUM_INP_FRAMES]; 2857*495ae853SAndroid Build Coastguard Worker 2858*495ae853SAndroid Build Coastguard Worker /** 2859*495ae853SAndroid Build Coastguard Worker * Flag to indicate if any IDR requests are pending 2860*495ae853SAndroid Build Coastguard Worker */ 2861*495ae853SAndroid Build Coastguard Worker WORD32 i4_pending_idr_flag; 2862*495ae853SAndroid Build Coastguard Worker 2863*495ae853SAndroid Build Coastguard Worker /** 2864*495ae853SAndroid Build Coastguard Worker *Flag to indicate if we have recived the last input frame 2865*495ae853SAndroid Build Coastguard Worker */ 2866*495ae853SAndroid Build Coastguard Worker WORD32 i4_last_inp_buff_received; 2867*495ae853SAndroid Build Coastguard Worker 2868*495ae853SAndroid Build Coastguard Worker /** 2869*495ae853SAndroid Build Coastguard Worker * backup sei params for comparison 2870*495ae853SAndroid Build Coastguard Worker */ 2871*495ae853SAndroid Build Coastguard Worker sei_params_t s_sei; 2872*495ae853SAndroid Build Coastguard Worker 2873*495ae853SAndroid Build Coastguard Worker }; 2874*495ae853SAndroid Build Coastguard Worker 2875*495ae853SAndroid Build Coastguard Worker #endif /* _IH264E_STRUCTS_H_ */ 2876