1*495ae853SAndroid Build Coastguard Worker /****************************************************************************** 2*495ae853SAndroid Build Coastguard Worker * 3*495ae853SAndroid Build Coastguard Worker * Copyright (C) 2021 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 * @file 23*495ae853SAndroid Build Coastguard Worker * imvcd.h 24*495ae853SAndroid Build Coastguard Worker * 25*495ae853SAndroid Build Coastguard Worker * @brief 26*495ae853SAndroid Build Coastguard Worker * This file contains all the necessary structure and enumeration 27*495ae853SAndroid Build Coastguard Worker * definitions needed for the Application Program Interface(API) of the 28*495ae853SAndroid Build Coastguard Worker * Ittiam MVC Decoder 29*495ae853SAndroid Build Coastguard Worker * 30*495ae853SAndroid Build Coastguard Worker ******************************************************************************* 31*495ae853SAndroid Build Coastguard Worker */ 32*495ae853SAndroid Build Coastguard Worker 33*495ae853SAndroid Build Coastguard Worker #ifndef _IMVCD_H_ 34*495ae853SAndroid Build Coastguard Worker #define _IMVCD_H_ 35*495ae853SAndroid Build Coastguard Worker #include <stdbool.h> 36*495ae853SAndroid Build Coastguard Worker 37*495ae853SAndroid Build Coastguard Worker #include "ih264_typedefs.h" 38*495ae853SAndroid Build Coastguard Worker #include "iv.h" 39*495ae853SAndroid Build Coastguard Worker #include "ivd.h" 40*495ae853SAndroid Build Coastguard Worker 41*495ae853SAndroid Build Coastguard Worker /* Extern functions */ 42*495ae853SAndroid Build Coastguard Worker extern IV_API_CALL_STATUS_T imvcd_api_function(iv_obj_t *ps_dec_hdl, void *pv_ip, void *pv_op); 43*495ae853SAndroid Build Coastguard Worker 44*495ae853SAndroid Build Coastguard Worker /* Typedefs */ 45*495ae853SAndroid Build Coastguard Worker typedef enum IMVCD_CTL_SUB_CMDS 46*495ae853SAndroid Build Coastguard Worker { 47*495ae853SAndroid Build Coastguard Worker IMVCD_CTL_SET_NUM_CORES = IVD_CMD_CTL_CODEC_SUBCMD_START, 48*495ae853SAndroid Build Coastguard Worker IMVCD_CTL_SET_PROCESSOR = IVD_CMD_CTL_CODEC_SUBCMD_START + 1, 49*495ae853SAndroid Build Coastguard Worker IMVCD_CTL_GET_VUI_PARAMS = IVD_CMD_CTL_CODEC_SUBCMD_START + 2, 50*495ae853SAndroid Build Coastguard Worker IMVCD_CTL_DEGRADE = IVD_CMD_CTL_CODEC_SUBCMD_START + 3, 51*495ae853SAndroid Build Coastguard Worker 52*495ae853SAndroid Build Coastguard Worker } IMVCD_CTL_SUB_CMDS; 53*495ae853SAndroid Build Coastguard Worker 54*495ae853SAndroid Build Coastguard Worker typedef struct imvcd_create_ip_t 55*495ae853SAndroid Build Coastguard Worker { 56*495ae853SAndroid Build Coastguard Worker ivd_create_ip_t s_ivd_ip; 57*495ae853SAndroid Build Coastguard Worker 58*495ae853SAndroid Build Coastguard Worker } imvcd_create_ip_t; 59*495ae853SAndroid Build Coastguard Worker 60*495ae853SAndroid Build Coastguard Worker typedef struct imvcd_create_op_t 61*495ae853SAndroid Build Coastguard Worker { 62*495ae853SAndroid Build Coastguard Worker ivd_create_op_t s_ivd_op; 63*495ae853SAndroid Build Coastguard Worker 64*495ae853SAndroid Build Coastguard Worker } imvcd_create_op_t; 65*495ae853SAndroid Build Coastguard Worker 66*495ae853SAndroid Build Coastguard Worker typedef struct imvcd_delete_ip_t 67*495ae853SAndroid Build Coastguard Worker { 68*495ae853SAndroid Build Coastguard Worker ivd_delete_ip_t s_ivd_ip; 69*495ae853SAndroid Build Coastguard Worker 70*495ae853SAndroid Build Coastguard Worker } imvcd_delete_ip_t; 71*495ae853SAndroid Build Coastguard Worker 72*495ae853SAndroid Build Coastguard Worker typedef struct imvcd_delete_op_t 73*495ae853SAndroid Build Coastguard Worker { 74*495ae853SAndroid Build Coastguard Worker ivd_delete_op_t s_ivd_op; 75*495ae853SAndroid Build Coastguard Worker 76*495ae853SAndroid Build Coastguard Worker } imvcd_delete_op_t; 77*495ae853SAndroid Build Coastguard Worker 78*495ae853SAndroid Build Coastguard Worker typedef struct imvcd_video_decode_ip_t 79*495ae853SAndroid Build Coastguard Worker { 80*495ae853SAndroid Build Coastguard Worker ivd_video_decode_ip_t s_ivd_ip; 81*495ae853SAndroid Build Coastguard Worker 82*495ae853SAndroid Build Coastguard Worker } imvcd_video_decode_ip_t; 83*495ae853SAndroid Build Coastguard Worker 84*495ae853SAndroid Build Coastguard Worker typedef struct imvcd_video_decode_op_t 85*495ae853SAndroid Build Coastguard Worker { 86*495ae853SAndroid Build Coastguard Worker ivd_video_decode_op_t s_ivd_op; 87*495ae853SAndroid Build Coastguard Worker 88*495ae853SAndroid Build Coastguard Worker iv_yuv_buf_t *ps_view_disp_bufs; 89*495ae853SAndroid Build Coastguard Worker 90*495ae853SAndroid Build Coastguard Worker } imvcd_video_decode_op_t; 91*495ae853SAndroid Build Coastguard Worker 92*495ae853SAndroid Build Coastguard Worker typedef struct imvcd_set_config_ip_t 93*495ae853SAndroid Build Coastguard Worker { 94*495ae853SAndroid Build Coastguard Worker ivd_ctl_set_config_ip_t s_ivd_ip; 95*495ae853SAndroid Build Coastguard Worker } imvcd_set_config_ip_t; 96*495ae853SAndroid Build Coastguard Worker 97*495ae853SAndroid Build Coastguard Worker typedef struct imvcd_set_config_op_t 98*495ae853SAndroid Build Coastguard Worker { 99*495ae853SAndroid Build Coastguard Worker ivd_ctl_set_config_op_t s_ivd_op; 100*495ae853SAndroid Build Coastguard Worker } imvcd_set_config_op_t; 101*495ae853SAndroid Build Coastguard Worker 102*495ae853SAndroid Build Coastguard Worker typedef struct imvcd_set_num_cores_ip_t 103*495ae853SAndroid Build Coastguard Worker { 104*495ae853SAndroid Build Coastguard Worker UWORD32 u4_size; 105*495ae853SAndroid Build Coastguard Worker 106*495ae853SAndroid Build Coastguard Worker IVD_API_COMMAND_TYPE_T e_cmd; 107*495ae853SAndroid Build Coastguard Worker 108*495ae853SAndroid Build Coastguard Worker IVD_CONTROL_API_COMMAND_TYPE_T e_sub_cmd; 109*495ae853SAndroid Build Coastguard Worker 110*495ae853SAndroid Build Coastguard Worker UWORD32 u4_num_cores; 111*495ae853SAndroid Build Coastguard Worker } imvcd_set_num_cores_ip_t; 112*495ae853SAndroid Build Coastguard Worker 113*495ae853SAndroid Build Coastguard Worker typedef struct imvcd_set_num_cores_op_t 114*495ae853SAndroid Build Coastguard Worker { 115*495ae853SAndroid Build Coastguard Worker UWORD32 u4_size; 116*495ae853SAndroid Build Coastguard Worker 117*495ae853SAndroid Build Coastguard Worker UWORD32 u4_error_code; 118*495ae853SAndroid Build Coastguard Worker } imvcd_set_num_cores_op_t; 119*495ae853SAndroid Build Coastguard Worker 120*495ae853SAndroid Build Coastguard Worker typedef struct imvcd_set_arch_ip_t 121*495ae853SAndroid Build Coastguard Worker { 122*495ae853SAndroid Build Coastguard Worker UWORD32 u4_size; 123*495ae853SAndroid Build Coastguard Worker 124*495ae853SAndroid Build Coastguard Worker IVD_API_COMMAND_TYPE_T e_cmd; 125*495ae853SAndroid Build Coastguard Worker 126*495ae853SAndroid Build Coastguard Worker IVD_CONTROL_API_COMMAND_TYPE_T e_sub_cmd; 127*495ae853SAndroid Build Coastguard Worker 128*495ae853SAndroid Build Coastguard Worker IVD_ARCH_T e_arch; 129*495ae853SAndroid Build Coastguard Worker 130*495ae853SAndroid Build Coastguard Worker IVD_SOC_T e_soc; 131*495ae853SAndroid Build Coastguard Worker 132*495ae853SAndroid Build Coastguard Worker } imvcd_set_arch_ip_t; 133*495ae853SAndroid Build Coastguard Worker 134*495ae853SAndroid Build Coastguard Worker typedef struct imvcd_set_arch_op_t 135*495ae853SAndroid Build Coastguard Worker { 136*495ae853SAndroid Build Coastguard Worker UWORD32 u4_size; 137*495ae853SAndroid Build Coastguard Worker 138*495ae853SAndroid Build Coastguard Worker UWORD32 u4_error_code; 139*495ae853SAndroid Build Coastguard Worker } imvcd_set_arch_op_t; 140*495ae853SAndroid Build Coastguard Worker 141*495ae853SAndroid Build Coastguard Worker typedef struct imvcd_set_degrade_mode_ip_t 142*495ae853SAndroid Build Coastguard Worker { 143*495ae853SAndroid Build Coastguard Worker UWORD32 u4_size; 144*495ae853SAndroid Build Coastguard Worker 145*495ae853SAndroid Build Coastguard Worker IVD_API_COMMAND_TYPE_T e_cmd; 146*495ae853SAndroid Build Coastguard Worker 147*495ae853SAndroid Build Coastguard Worker IVD_CONTROL_API_COMMAND_TYPE_T e_sub_cmd; 148*495ae853SAndroid Build Coastguard Worker 149*495ae853SAndroid Build Coastguard Worker /** 150*495ae853SAndroid Build Coastguard Worker * Pictures that are are degraded 151*495ae853SAndroid Build Coastguard Worker * 0 : No degrade 152*495ae853SAndroid Build Coastguard Worker * 1 : Only on non-reference frames 153*495ae853SAndroid Build Coastguard Worker * 2 : Use interval specified by u4_nondegrade_interval 154*495ae853SAndroid Build Coastguard Worker * 3 : All non-key frames 155*495ae853SAndroid Build Coastguard Worker * 4 : All frames 156*495ae853SAndroid Build Coastguard Worker */ 157*495ae853SAndroid Build Coastguard Worker WORD32 i4_degrade_pics; 158*495ae853SAndroid Build Coastguard Worker 159*495ae853SAndroid Build Coastguard Worker /** 160*495ae853SAndroid Build Coastguard Worker * Interval for pictures which are completely decoded without any degradation 161*495ae853SAndroid Build Coastguard Worker */ 162*495ae853SAndroid Build Coastguard Worker WORD32 i4_nondegrade_interval; 163*495ae853SAndroid Build Coastguard Worker 164*495ae853SAndroid Build Coastguard Worker /** 165*495ae853SAndroid Build Coastguard Worker * bit position (lsb is zero): Type of degradation 166*495ae853SAndroid Build Coastguard Worker * 1 : Disable deblocking 167*495ae853SAndroid Build Coastguard Worker * 2 : Faster inter prediction filters 168*495ae853SAndroid Build Coastguard Worker * 3 : Fastest inter prediction filters 169*495ae853SAndroid Build Coastguard Worker */ 170*495ae853SAndroid Build Coastguard Worker WORD32 i4_degrade_type; 171*495ae853SAndroid Build Coastguard Worker 172*495ae853SAndroid Build Coastguard Worker } imvcd_set_degrade_mode_ip_t; 173*495ae853SAndroid Build Coastguard Worker 174*495ae853SAndroid Build Coastguard Worker typedef struct imvcd_set_degrade_mode_op_t 175*495ae853SAndroid Build Coastguard Worker { 176*495ae853SAndroid Build Coastguard Worker UWORD32 u4_size; 177*495ae853SAndroid Build Coastguard Worker 178*495ae853SAndroid Build Coastguard Worker UWORD32 u4_error_code; 179*495ae853SAndroid Build Coastguard Worker } imvcd_set_degrade_mode_op_t; 180*495ae853SAndroid Build Coastguard Worker 181*495ae853SAndroid Build Coastguard Worker typedef struct imvcd_flush_dec_ip_t 182*495ae853SAndroid Build Coastguard Worker { 183*495ae853SAndroid Build Coastguard Worker ivd_ctl_flush_ip_t s_ivd_ip; 184*495ae853SAndroid Build Coastguard Worker } imvcd_flush_dec_ip_t; 185*495ae853SAndroid Build Coastguard Worker 186*495ae853SAndroid Build Coastguard Worker typedef struct imvcd_flush_dec_op_t 187*495ae853SAndroid Build Coastguard Worker { 188*495ae853SAndroid Build Coastguard Worker ivd_ctl_flush_op_t s_ivd_op; 189*495ae853SAndroid Build Coastguard Worker } imvcd_flush_dec_op_t; 190*495ae853SAndroid Build Coastguard Worker 191*495ae853SAndroid Build Coastguard Worker typedef struct imvcd_get_buf_info_ip_t 192*495ae853SAndroid Build Coastguard Worker { 193*495ae853SAndroid Build Coastguard Worker ivd_ctl_getbufinfo_ip_t s_ivd_ip; 194*495ae853SAndroid Build Coastguard Worker } imvcd_get_buf_info_ip_t; 195*495ae853SAndroid Build Coastguard Worker 196*495ae853SAndroid Build Coastguard Worker typedef struct ivd_mvc_buf_info_t 197*495ae853SAndroid Build Coastguard Worker { 198*495ae853SAndroid Build Coastguard Worker UWORD16 u2_num_views; 199*495ae853SAndroid Build Coastguard Worker } ivd_mvc_buf_info_t; 200*495ae853SAndroid Build Coastguard Worker 201*495ae853SAndroid Build Coastguard Worker typedef struct imvcd_get_buf_info_op_t 202*495ae853SAndroid Build Coastguard Worker { 203*495ae853SAndroid Build Coastguard Worker ivd_ctl_getbufinfo_op_t s_ivd_op; 204*495ae853SAndroid Build Coastguard Worker 205*495ae853SAndroid Build Coastguard Worker ivd_mvc_buf_info_t s_mvc_buf_info; 206*495ae853SAndroid Build Coastguard Worker 207*495ae853SAndroid Build Coastguard Worker } imvcd_get_buf_info_op_t; 208*495ae853SAndroid Build Coastguard Worker 209*495ae853SAndroid Build Coastguard Worker typedef struct imvcd_get_vui_ip_t 210*495ae853SAndroid Build Coastguard Worker { 211*495ae853SAndroid Build Coastguard Worker UWORD32 u4_size; 212*495ae853SAndroid Build Coastguard Worker 213*495ae853SAndroid Build Coastguard Worker IVD_API_COMMAND_TYPE_T e_cmd; 214*495ae853SAndroid Build Coastguard Worker 215*495ae853SAndroid Build Coastguard Worker IVD_CONTROL_API_COMMAND_TYPE_T e_sub_cmd; 216*495ae853SAndroid Build Coastguard Worker 217*495ae853SAndroid Build Coastguard Worker } imvcd_get_vui_ip_t; 218*495ae853SAndroid Build Coastguard Worker 219*495ae853SAndroid Build Coastguard Worker typedef struct imvcd_get_vui_op_t 220*495ae853SAndroid Build Coastguard Worker { 221*495ae853SAndroid Build Coastguard Worker bool b_is_vui_available; 222*495ae853SAndroid Build Coastguard Worker 223*495ae853SAndroid Build Coastguard Worker UWORD32 u4_error_code; 224*495ae853SAndroid Build Coastguard Worker 225*495ae853SAndroid Build Coastguard Worker UWORD8 u1_aspect_ratio_idc; 226*495ae853SAndroid Build Coastguard Worker 227*495ae853SAndroid Build Coastguard Worker UWORD16 u2_sar_width; 228*495ae853SAndroid Build Coastguard Worker 229*495ae853SAndroid Build Coastguard Worker UWORD16 u2_sar_height; 230*495ae853SAndroid Build Coastguard Worker 231*495ae853SAndroid Build Coastguard Worker UWORD8 u1_overscan_appropriate_flag; 232*495ae853SAndroid Build Coastguard Worker 233*495ae853SAndroid Build Coastguard Worker UWORD8 u1_video_format; 234*495ae853SAndroid Build Coastguard Worker 235*495ae853SAndroid Build Coastguard Worker UWORD8 u1_video_full_range_flag; 236*495ae853SAndroid Build Coastguard Worker 237*495ae853SAndroid Build Coastguard Worker UWORD8 u1_colour_primaries; 238*495ae853SAndroid Build Coastguard Worker 239*495ae853SAndroid Build Coastguard Worker UWORD8 u1_tfr_chars; 240*495ae853SAndroid Build Coastguard Worker 241*495ae853SAndroid Build Coastguard Worker UWORD8 u1_matrix_coeffs; 242*495ae853SAndroid Build Coastguard Worker 243*495ae853SAndroid Build Coastguard Worker UWORD8 u1_cr_top_field; 244*495ae853SAndroid Build Coastguard Worker 245*495ae853SAndroid Build Coastguard Worker UWORD8 u1_cr_bottom_field; 246*495ae853SAndroid Build Coastguard Worker 247*495ae853SAndroid Build Coastguard Worker UWORD32 u4_num_units_in_tick; 248*495ae853SAndroid Build Coastguard Worker 249*495ae853SAndroid Build Coastguard Worker UWORD32 u4_time_scale; 250*495ae853SAndroid Build Coastguard Worker 251*495ae853SAndroid Build Coastguard Worker UWORD8 u1_fixed_frame_rate_flag; 252*495ae853SAndroid Build Coastguard Worker 253*495ae853SAndroid Build Coastguard Worker UWORD8 u1_nal_hrd_params_present; 254*495ae853SAndroid Build Coastguard Worker 255*495ae853SAndroid Build Coastguard Worker UWORD8 u1_vcl_hrd_params_present; 256*495ae853SAndroid Build Coastguard Worker 257*495ae853SAndroid Build Coastguard Worker UWORD8 u1_low_delay_hrd_flag; 258*495ae853SAndroid Build Coastguard Worker 259*495ae853SAndroid Build Coastguard Worker UWORD8 u1_pic_struct_present_flag; 260*495ae853SAndroid Build Coastguard Worker 261*495ae853SAndroid Build Coastguard Worker UWORD8 u1_bitstream_restriction_flag; 262*495ae853SAndroid Build Coastguard Worker 263*495ae853SAndroid Build Coastguard Worker UWORD8 u1_mv_over_pic_boundaries_flag; 264*495ae853SAndroid Build Coastguard Worker 265*495ae853SAndroid Build Coastguard Worker UWORD32 u4_max_bytes_per_pic_denom; 266*495ae853SAndroid Build Coastguard Worker 267*495ae853SAndroid Build Coastguard Worker UWORD32 u4_max_bits_per_mb_denom; 268*495ae853SAndroid Build Coastguard Worker 269*495ae853SAndroid Build Coastguard Worker UWORD32 u4_log2_max_mv_length_horz; 270*495ae853SAndroid Build Coastguard Worker 271*495ae853SAndroid Build Coastguard Worker UWORD32 u4_log2_max_mv_length_vert; 272*495ae853SAndroid Build Coastguard Worker 273*495ae853SAndroid Build Coastguard Worker UWORD32 u4_num_reorder_frames; 274*495ae853SAndroid Build Coastguard Worker 275*495ae853SAndroid Build Coastguard Worker UWORD32 u4_max_dec_frame_buffering; 276*495ae853SAndroid Build Coastguard Worker 277*495ae853SAndroid Build Coastguard Worker } imvcd_get_vui_op_t; 278*495ae853SAndroid Build Coastguard Worker 279*495ae853SAndroid Build Coastguard Worker #endif 280