Praneeth Paladugu | 6e6fbdb | 2017-01-16 15:43:01 -0800 | [diff] [blame] | 1 | #ifndef __MSM_VIDC_H__ |
| 2 | #define __MSM_VIDC_H__ |
| 3 | |
| 4 | #include <linux/types.h> |
| 5 | |
| 6 | #define MSM_VIDC_HAL_INTERLACE_COLOR_FORMAT_NV12 0x2 |
| 7 | #define MSM_VIDC_HAL_INTERLACE_COLOR_FORMAT_NV12_UBWC 0x8002 |
Chinmay Sawarkar | c9c28ba | 2017-02-07 19:16:02 -0800 | [diff] [blame] | 8 | #define MSM_VIDC_4x_1 0x1 |
Praneeth Paladugu | 6e6fbdb | 2017-01-16 15:43:01 -0800 | [diff] [blame] | 9 | |
| 10 | struct msm_vidc_extradata_header { |
| 11 | unsigned int size; |
| 12 | unsigned int:32; /** Keeping binary compatibility */ |
| 13 | unsigned int:32; /* with firmware and OpenMAX IL **/ |
| 14 | unsigned int type; /* msm_vidc_extradata_type */ |
| 15 | unsigned int data_size; |
| 16 | unsigned char data[1]; |
| 17 | }; |
| 18 | |
| 19 | struct msm_vidc_interlace_payload { |
| 20 | unsigned int format; |
| 21 | unsigned int color_format; |
| 22 | }; |
| 23 | |
| 24 | struct msm_vidc_framerate_payload { |
| 25 | unsigned int frame_rate; |
| 26 | }; |
| 27 | |
| 28 | struct msm_vidc_ts_payload { |
| 29 | unsigned int timestamp_lo; |
| 30 | unsigned int timestamp_hi; |
| 31 | }; |
| 32 | |
| 33 | struct msm_vidc_concealmb_payload { |
| 34 | unsigned int num_mbs; |
| 35 | }; |
| 36 | |
| 37 | struct msm_vidc_recoverysei_payload { |
| 38 | unsigned int flags; |
| 39 | }; |
| 40 | |
| 41 | struct msm_vidc_aspect_ratio_payload { |
| 42 | unsigned int size; |
| 43 | unsigned int version; |
| 44 | unsigned int port_index; |
| 45 | unsigned int aspect_width; |
| 46 | unsigned int aspect_height; |
| 47 | }; |
| 48 | |
| 49 | struct msm_vidc_mpeg2_seqdisp_payload { |
| 50 | unsigned int video_format; |
| 51 | unsigned int color_descp; |
| 52 | unsigned int color_primaries; |
| 53 | unsigned int transfer_char; |
| 54 | unsigned int matrix_coeffs; |
| 55 | unsigned int disp_width; |
| 56 | unsigned int disp_height; |
| 57 | }; |
| 58 | |
| 59 | struct msm_vidc_vc1_seqdisp_payload { |
| 60 | unsigned int prog_seg_format; |
| 61 | unsigned int uv_sampl_fmt; |
| 62 | unsigned int color_format; |
| 63 | unsigned int color_primaries; |
| 64 | unsigned int transfer_char; |
| 65 | unsigned int matrix_coeffs; |
| 66 | unsigned int aspect_ratio; |
| 67 | unsigned int aspect_horiz; |
| 68 | unsigned int aspect_vert; |
| 69 | }; |
| 70 | |
| 71 | struct msm_vidc_input_crop_payload { |
| 72 | unsigned int size; |
| 73 | unsigned int version; |
| 74 | unsigned int port_index; |
| 75 | unsigned int left; |
| 76 | unsigned int top; |
| 77 | unsigned int width; |
| 78 | unsigned int height; |
| 79 | }; |
| 80 | |
Chinmay Sawarkar | c9c28ba | 2017-02-07 19:16:02 -0800 | [diff] [blame] | 81 | struct msm_vidc_misr_info { |
| 82 | unsigned int misr_dpb_luma; |
| 83 | unsigned int misr_dpb_chroma; |
| 84 | unsigned int misr_opb_luma; |
| 85 | unsigned int misr_opb_chroma; |
| 86 | }; |
Praneeth Paladugu | 6e6fbdb | 2017-01-16 15:43:01 -0800 | [diff] [blame] | 87 | struct msm_vidc_output_crop_payload { |
| 88 | unsigned int size; |
| 89 | unsigned int version; |
| 90 | unsigned int port_index; |
| 91 | unsigned int left; |
| 92 | unsigned int top; |
| 93 | unsigned int display_width; |
| 94 | unsigned int display_height; |
| 95 | unsigned int width; |
| 96 | unsigned int height; |
Chinmay Sawarkar | c9c28ba | 2017-02-07 19:16:02 -0800 | [diff] [blame] | 97 | unsigned int frame_num; |
| 98 | unsigned int bit_depth_y; |
| 99 | unsigned int bit_depth_c; |
| 100 | struct msm_vidc_misr_info misr_info[2]; |
Praneeth Paladugu | 6e6fbdb | 2017-01-16 15:43:01 -0800 | [diff] [blame] | 101 | }; |
| 102 | |
| 103 | |
| 104 | struct msm_vidc_digital_zoom_payload { |
| 105 | unsigned int size; |
| 106 | unsigned int version; |
| 107 | unsigned int port_index; |
| 108 | unsigned int zoom_width; |
| 109 | unsigned int zoom_height; |
| 110 | }; |
| 111 | |
| 112 | struct msm_vidc_extradata_index { |
| 113 | unsigned int type; |
| 114 | union { |
| 115 | struct msm_vidc_input_crop_payload input_crop; |
| 116 | struct msm_vidc_digital_zoom_payload digital_zoom; |
| 117 | struct msm_vidc_aspect_ratio_payload aspect_ratio; |
| 118 | }; |
| 119 | }; |
| 120 | |
| 121 | struct msm_vidc_panscan_window { |
| 122 | unsigned int panscan_height_offset; |
| 123 | unsigned int panscan_width_offset; |
| 124 | unsigned int panscan_window_width; |
| 125 | unsigned int panscan_window_height; |
| 126 | }; |
| 127 | |
| 128 | struct msm_vidc_panscan_window_payload { |
| 129 | unsigned int num_panscan_windows; |
| 130 | struct msm_vidc_panscan_window wnd[1]; |
| 131 | }; |
| 132 | |
| 133 | struct msm_vidc_stream_userdata_payload { |
| 134 | unsigned int type; |
| 135 | unsigned int data[1]; |
| 136 | }; |
| 137 | |
| 138 | struct msm_vidc_frame_qp_payload { |
| 139 | unsigned int frame_qp; |
| 140 | }; |
| 141 | |
| 142 | struct msm_vidc_frame_bits_info_payload { |
| 143 | unsigned int frame_bits; |
| 144 | unsigned int header_bits; |
| 145 | }; |
| 146 | |
| 147 | struct msm_vidc_s3d_frame_packing_payload { |
| 148 | unsigned int fpa_id; |
| 149 | unsigned int cancel_flag; |
| 150 | unsigned int fpa_type; |
| 151 | unsigned int quin_cunx_flag; |
| 152 | unsigned int content_interprtation_type; |
| 153 | unsigned int spatial_flipping_flag; |
| 154 | unsigned int frame0_flipped_flag; |
| 155 | unsigned int field_views_flag; |
| 156 | unsigned int current_frame_is_frame0_flag; |
| 157 | unsigned int frame0_self_contained_flag; |
| 158 | unsigned int frame1_self_contained_flag; |
| 159 | unsigned int frame0_graid_pos_x; |
| 160 | unsigned int frame0_graid_pos_y; |
| 161 | unsigned int frame1_graid_pos_x; |
| 162 | unsigned int frame1_graid_pos_y; |
| 163 | unsigned int fpa_reserved_byte; |
| 164 | unsigned int fpa_repetition_period; |
| 165 | unsigned int fpa_extension_flag; |
| 166 | }; |
| 167 | |
| 168 | struct msm_vidc_vqzip_sei_payload { |
| 169 | unsigned int size; |
| 170 | unsigned int data[1]; |
| 171 | }; |
| 172 | |
| 173 | struct msm_vidc_yuv_stats_payload { |
| 174 | unsigned int frame_qp; |
| 175 | unsigned int texture; |
| 176 | unsigned int luma_in_q16; |
| 177 | unsigned int frame_difference; |
| 178 | }; |
| 179 | |
| 180 | struct msm_vidc_vpx_colorspace_payload { |
| 181 | unsigned int color_space; |
| 182 | unsigned int yuv_range_flag; |
| 183 | unsigned int sumsampling_x; |
| 184 | unsigned int sumsampling_y; |
| 185 | }; |
| 186 | |
| 187 | struct msm_vidc_roi_qp_payload { |
| 188 | int upper_qp_offset; |
| 189 | int lower_qp_offset; |
| 190 | unsigned int b_roi_info; |
| 191 | int mbi_info_size; |
| 192 | unsigned int data[1]; |
| 193 | }; |
| 194 | |
| 195 | struct msm_vidc_mastering_display_colour_sei_payload { |
| 196 | unsigned int nDisplayPrimariesX[3]; |
| 197 | unsigned int nDisplayPrimariesY[3]; |
| 198 | unsigned int nWhitePointX; |
| 199 | unsigned int nWhitePointY; |
| 200 | unsigned int nMaxDisplayMasteringLuminance; |
| 201 | unsigned int nMinDisplayMasteringLuminance; |
| 202 | }; |
| 203 | |
| 204 | struct msm_vidc_content_light_level_sei_payload { |
| 205 | unsigned int nMaxContentLight; |
| 206 | unsigned int nMaxPicAverageLight; |
| 207 | }; |
| 208 | |
| 209 | struct msm_vidc_vui_display_info_payload { |
| 210 | unsigned int video_signal_present_flag; |
| 211 | unsigned int video_format; |
| 212 | unsigned int bit_depth_y; |
| 213 | unsigned int bit_depth_c; |
| 214 | unsigned int video_full_range_flag; |
| 215 | unsigned int color_description_present_flag; |
| 216 | unsigned int color_primaries; |
| 217 | unsigned int transfer_characteristics; |
| 218 | unsigned int matrix_coefficients; |
| 219 | unsigned int chroma_location_info_present_flag; |
| 220 | unsigned int chroma_format_idc; |
| 221 | unsigned int separate_color_plane_flag; |
| 222 | unsigned int chroma_sample_loc_type_top_field; |
| 223 | unsigned int chroma_sample_loc_type_bottom_field; |
| 224 | }; |
| 225 | |
| 226 | enum msm_vidc_extradata_type { |
| 227 | MSM_VIDC_EXTRADATA_NONE = 0x00000000, |
| 228 | MSM_VIDC_EXTRADATA_MB_QUANTIZATION = 0x00000001, |
| 229 | MSM_VIDC_EXTRADATA_INTERLACE_VIDEO = 0x00000002, |
| 230 | MSM_VIDC_EXTRADATA_TIMESTAMP = 0x00000005, |
| 231 | MSM_VIDC_EXTRADATA_S3D_FRAME_PACKING = 0x00000006, |
| 232 | MSM_VIDC_EXTRADATA_FRAME_RATE = 0x00000007, |
| 233 | MSM_VIDC_EXTRADATA_PANSCAN_WINDOW = 0x00000008, |
| 234 | MSM_VIDC_EXTRADATA_RECOVERY_POINT_SEI = 0x00000009, |
| 235 | MSM_VIDC_EXTRADATA_MPEG2_SEQDISP = 0x0000000D, |
| 236 | MSM_VIDC_EXTRADATA_STREAM_USERDATA = 0x0000000E, |
| 237 | MSM_VIDC_EXTRADATA_FRAME_QP = 0x0000000F, |
| 238 | MSM_VIDC_EXTRADATA_FRAME_BITS_INFO = 0x00000010, |
| 239 | MSM_VIDC_EXTRADATA_VQZIP_SEI = 0x00000011, |
| 240 | MSM_VIDC_EXTRADATA_ROI_QP = 0x00000013, |
Manikanta Sivapala | e7a8e84 | 2016-09-14 17:32:25 +0530 | [diff] [blame] | 241 | #define MSM_VIDC_EXTRADATA_VPX_COLORSPACE_INFO \ |
| 242 | MSM_VIDC_EXTRADATA_VPX_COLORSPACE_INFO |
| 243 | MSM_VIDC_EXTRADATA_VPX_COLORSPACE_INFO = 0x00000014, |
Praneeth Paladugu | 6e6fbdb | 2017-01-16 15:43:01 -0800 | [diff] [blame] | 244 | #define MSM_VIDC_EXTRADATA_MASTERING_DISPLAY_COLOUR_SEI \ |
| 245 | MSM_VIDC_EXTRADATA_MASTERING_DISPLAY_COLOUR_SEI |
| 246 | MSM_VIDC_EXTRADATA_MASTERING_DISPLAY_COLOUR_SEI = 0x00000015, |
| 247 | #define MSM_VIDC_EXTRADATA_CONTENT_LIGHT_LEVEL_SEI \ |
| 248 | MSM_VIDC_EXTRADATA_CONTENT_LIGHT_LEVEL_SEI |
| 249 | MSM_VIDC_EXTRADATA_CONTENT_LIGHT_LEVEL_SEI = 0x00000016, |
| 250 | #define MSM_VIDC_EXTRADATA_PQ_INFO \ |
| 251 | MSM_VIDC_EXTRADATA_PQ_INFO |
| 252 | MSM_VIDC_EXTRADATA_PQ_INFO = 0x00000017, |
| 253 | MSM_VIDC_EXTRADATA_INPUT_CROP = 0x0700000E, |
| 254 | #define MSM_VIDC_EXTRADATA_OUTPUT_CROP \ |
| 255 | MSM_VIDC_EXTRADATA_OUTPUT_CROP |
| 256 | MSM_VIDC_EXTRADATA_OUTPUT_CROP = 0x0700000F, |
| 257 | MSM_VIDC_EXTRADATA_DIGITAL_ZOOM = 0x07000010, |
Praneeth Paladugu | 6e6fbdb | 2017-01-16 15:43:01 -0800 | [diff] [blame] | 258 | MSM_VIDC_EXTRADATA_MULTISLICE_INFO = 0x7F100000, |
| 259 | MSM_VIDC_EXTRADATA_NUM_CONCEALED_MB = 0x7F100001, |
| 260 | MSM_VIDC_EXTRADATA_INDEX = 0x7F100002, |
| 261 | MSM_VIDC_EXTRADATA_ASPECT_RATIO = 0x7F100003, |
| 262 | MSM_VIDC_EXTRADATA_METADATA_LTR = 0x7F100004, |
| 263 | MSM_VIDC_EXTRADATA_METADATA_FILLER = 0x7FE00002, |
| 264 | MSM_VIDC_EXTRADATA_METADATA_MBI = 0x7F100005, |
| 265 | #define MSM_VIDC_EXTRADATA_VUI_DISPLAY_INFO \ |
| 266 | MSM_VIDC_EXTRADATA_VUI_DISPLAY_INFO |
| 267 | MSM_VIDC_EXTRADATA_VUI_DISPLAY_INFO = 0x7F100006, |
| 268 | MSM_VIDC_EXTRADATA_YUVSTATS_INFO = 0x7F100007, |
| 269 | }; |
| 270 | enum msm_vidc_interlace_type { |
| 271 | MSM_VIDC_INTERLACE_FRAME_PROGRESSIVE = 0x01, |
| 272 | MSM_VIDC_INTERLACE_INTERLEAVE_FRAME_TOPFIELDFIRST = 0x02, |
| 273 | MSM_VIDC_INTERLACE_INTERLEAVE_FRAME_BOTTOMFIELDFIRST = 0x04, |
| 274 | MSM_VIDC_INTERLACE_FRAME_TOPFIELDFIRST = 0x08, |
| 275 | MSM_VIDC_INTERLACE_FRAME_BOTTOMFIELDFIRST = 0x10, |
| 276 | }; |
| 277 | |
| 278 | /* enum msm_vidc_framepack_type */ |
| 279 | #define MSM_VIDC_FRAMEPACK_CHECKERBOARD 0x00 |
| 280 | #define MSM_VIDC_FRAMEPACK_COLUMN_INTERLEAVE 0x01 |
| 281 | #define MSM_VIDC_FRAMEPACK_ROW_INTERLEAVE 0x02 |
| 282 | #define MSM_VIDC_FRAMEPACK_SIDE_BY_SIDE 0x03 |
| 283 | #define MSM_VIDC_FRAMEPACK_TOP_BOTTOM 0x04 |
| 284 | #define MSM_VIDC_FRAMEPACK_TEMPORAL_INTERLEAVE 0x05 |
| 285 | |
| 286 | enum msm_vidc_recovery_sei { |
| 287 | MSM_VIDC_FRAME_RECONSTRUCTION_INCORRECT = 0x0, |
| 288 | MSM_VIDC_FRAME_RECONSTRUCTION_CORRECT = 0x01, |
| 289 | MSM_VIDC_FRAME_RECONSTRUCTION_APPROXIMATELY_CORRECT = 0x02, |
| 290 | }; |
| 291 | enum msm_vidc_userdata_type { |
| 292 | MSM_VIDC_USERDATA_TYPE_FRAME = 0x1, |
| 293 | MSM_VIDC_USERDATA_TYPE_TOP_FIELD = 0x2, |
| 294 | MSM_VIDC_USERDATA_TYPE_BOTTOM_FIELD = 0x3, |
| 295 | }; |
| 296 | |
| 297 | /* See colour_primaries of ISO/IEC 14496 for significance */ |
| 298 | enum msm_vidc_h264_color_primaries_values { |
| 299 | MSM_VIDC_RESERVED_1 = 0, |
| 300 | MSM_VIDC_BT709_5 = 1, |
| 301 | MSM_VIDC_UNSPECIFIED = 2, |
| 302 | MSM_VIDC_RESERVED_2 = 3, |
| 303 | MSM_VIDC_BT470_6_M = 4, |
| 304 | MSM_VIDC_BT601_6_625 = 5, |
| 305 | MSM_VIDC_BT470_6_BG = MSM_VIDC_BT601_6_625, |
| 306 | MSM_VIDC_BT601_6_525 = 6, |
| 307 | MSM_VIDC_SMPTE_240M = 7, |
| 308 | MSM_VIDC_GENERIC_FILM = 8, |
| 309 | MSM_VIDC_BT2020 = 9, |
| 310 | }; |
| 311 | |
| 312 | enum msm_vidc_vp9_color_primaries_values { |
| 313 | MSM_VIDC_CS_UNKNOWN, |
| 314 | MSM_VIDC_CS_BT_601, |
| 315 | MSM_VIDC_CS_BT_709, |
| 316 | MSM_VIDC_CS_SMPTE_170, |
| 317 | MSM_VIDC_CS_SMPTE_240, |
| 318 | MSM_VIDC_CS_BT_2020, |
| 319 | MSM_VIDC_CS_RESERVED, |
| 320 | MSM_VIDC_CS_RGB, |
| 321 | }; |
| 322 | |
| 323 | enum msm_vidc_h264_matrix_coeff_values { |
| 324 | MSM_VIDC_MATRIX_RGB = 0, |
| 325 | MSM_VIDC_MATRIX_BT_709_5 = 1, |
| 326 | MSM_VIDC_MATRIX_UNSPECIFIED = 2, |
| 327 | MSM_VIDC_MATRIX_RESERVED = 3, |
| 328 | MSM_VIDC_MATRIX_FCC_47 = 4, |
| 329 | MSM_VIDC_MATRIX_601_6_625 = 5, |
| 330 | MSM_VIDC_MATRIX_BT470_BG = MSM_VIDC_MATRIX_601_6_625, |
| 331 | MSM_VIDC_MATRIX_601_6_525 = 6, |
| 332 | MSM_VIDC_MATRIX_SMPTE_170M = MSM_VIDC_MATRIX_601_6_525, |
| 333 | MSM_VIDC_MATRIX_SMPTE_240M = 7, |
| 334 | MSM_VIDC_MATRIX_Y_CG_CO = 8, |
| 335 | MSM_VIDC_MATRIX_BT_2020 = 9, |
| 336 | MSM_VIDC_MATRIX_BT_2020_CONST = 10, |
| 337 | }; |
| 338 | |
| 339 | enum msm_vidc_h264_transfer_chars_values { |
| 340 | MSM_VIDC_TRANSFER_RESERVED_1 = 0, |
| 341 | MSM_VIDC_TRANSFER_BT709_5 = 1, |
| 342 | MSM_VIDC_TRANSFER_UNSPECIFIED = 2, |
| 343 | MSM_VIDC_TRANSFER_RESERVED_2 = 3, |
| 344 | MSM_VIDC_TRANSFER_BT_470_6_M = 4, |
| 345 | MSM_VIDC_TRANSFER_BT_470_6_BG = 5, |
| 346 | MSM_VIDC_TRANSFER_601_6_625 = 6, |
| 347 | MSM_VIDC_TRANSFER_601_6_525 = MSM_VIDC_TRANSFER_601_6_625, |
| 348 | MSM_VIDC_TRANSFER_SMPTE_240M = 7, |
| 349 | MSM_VIDC_TRANSFER_LINEAR = 8, |
| 350 | MSM_VIDC_TRANSFER_LOG_100_1 = 9, |
| 351 | MSM_VIDC_TRANSFER_LOG_100_SQRT10_1 = 10, |
| 352 | MSM_VIDC_TRANSFER_IEC_61966 = 11, |
| 353 | MSM_VIDC_TRANSFER_BT_1361 = 12, |
| 354 | MSM_VIDC_TRANSFER_SRGB = 13, |
| 355 | MSM_VIDC_TRANSFER_BT_2020_10 = 14, |
| 356 | MSM_VIDC_TRANSFER_BT_2020_12 = 15, |
| 357 | }; |
| 358 | |
| 359 | enum msm_vidc_pixel_depth { |
| 360 | MSM_VIDC_BIT_DEPTH_8, |
| 361 | MSM_VIDC_BIT_DEPTH_10, |
| 362 | MSM_VIDC_BIT_DEPTH_UNSUPPORTED = 0XFFFFFFFF, |
| 363 | }; |
| 364 | |
| 365 | enum msm_vidc_video_format { |
| 366 | MSM_VIDC_COMPONENT, |
| 367 | MSM_VIDC_PAL, |
| 368 | MSM_VIDC_NTSC, |
| 369 | MSM_VIDC_SECAM, |
| 370 | MSM_VIDC_MAC, |
| 371 | MSM_VIDC_UNSPECIFIED_FORMAT, |
| 372 | MSM_VIDC_RESERVED_1_FORMAT, |
| 373 | MSM_VIDC_RESERVED_2_FORMAT, |
| 374 | }; |
| 375 | |
| 376 | enum msm_vidc_color_desc_flag { |
| 377 | MSM_VIDC_COLOR_DESC_NOT_PRESENT, |
| 378 | MSM_VIDC_COLOR_DESC_PRESENT, |
| 379 | }; |
| 380 | |
| 381 | /*enum msm_vidc_pic_struct */ |
| 382 | #define MSM_VIDC_PIC_STRUCT_MAYBE_INTERLACED 0x0 |
| 383 | #define MSM_VIDC_PIC_STRUCT_PROGRESSIVE 0x1 |
| 384 | |
Praneeth Paladugu | 7fbd279 | 2017-01-27 13:39:03 -0800 | [diff] [blame] | 385 | /*default when layer ID isn't specified*/ |
| 386 | #define MSM_VIDC_ALL_LAYER_ID 0xFF |
| 387 | |
Praneeth Paladugu | 6e6fbdb | 2017-01-16 15:43:01 -0800 | [diff] [blame] | 388 | #endif |