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