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 8 9 struct msm_vidc_extradata_header { 10 unsigned int size; 11 unsigned int:32; /** Keeping binary compatibility */ 12 unsigned int:32; /* with firmware and OpenMAX IL **/ 13 unsigned int type; /* msm_vidc_extradata_type */ 14 unsigned int data_size; 15 unsigned char data[1]; 16 }; 17 18 struct msm_vidc_interlace_payload { 19 unsigned int format; 20 unsigned int color_format; 21 }; 22 23 struct msm_vidc_framerate_payload { 24 unsigned int frame_rate; 25 }; 26 27 struct msm_vidc_ts_payload { 28 unsigned int timestamp_lo; 29 unsigned int timestamp_hi; 30 }; 31 32 struct msm_vidc_concealmb_payload { 33 unsigned int num_mbs; 34 }; 35 36 struct msm_vidc_recoverysei_payload { 37 unsigned int flags; 38 }; 39 40 struct msm_vidc_aspect_ratio_payload { 41 unsigned int size; 42 unsigned int version; 43 unsigned int port_index; 44 unsigned int aspect_width; 45 unsigned int aspect_height; 46 }; 47 48 struct msm_vidc_mpeg2_seqdisp_payload { 49 unsigned int video_format; 50 unsigned int color_descp; 51 unsigned int color_primaries; 52 unsigned int transfer_char; 53 unsigned int matrix_coeffs; 54 unsigned int disp_width; 55 unsigned int disp_height; 56 }; 57 58 struct msm_vidc_input_crop_payload { 59 unsigned int size; 60 unsigned int version; 61 unsigned int port_index; 62 unsigned int left; 63 unsigned int top; 64 unsigned int width; 65 unsigned int height; 66 }; 67 68 struct msm_vidc_digital_zoom_payload { 69 unsigned int size; 70 unsigned int version; 71 unsigned int port_index; 72 unsigned int zoom_width; 73 unsigned int zoom_height; 74 }; 75 76 struct msm_vidc_extradata_index { 77 unsigned int type; 78 union { 79 struct msm_vidc_input_crop_payload input_crop; 80 struct msm_vidc_digital_zoom_payload digital_zoom; 81 struct msm_vidc_aspect_ratio_payload aspect_ratio; 82 }; 83 }; 84 85 struct msm_vidc_panscan_window { 86 unsigned int panscan_height_offset; 87 unsigned int panscan_width_offset; 88 unsigned int panscan_window_width; 89 unsigned int panscan_window_height; 90 }; 91 92 struct msm_vidc_panscan_window_payload { 93 unsigned int num_panscan_windows; 94 struct msm_vidc_panscan_window wnd[1]; 95 }; 96 97 struct msm_vidc_stream_userdata_payload { 98 unsigned int type; 99 unsigned int data[1]; 100 }; 101 102 struct msm_vidc_frame_qp_payload { 103 unsigned int frame_qp; 104 }; 105 106 struct msm_vidc_frame_bits_info_payload { 107 unsigned int frame_bits; 108 unsigned int header_bits; 109 }; 110 111 struct msm_vidc_s3d_frame_packing_payload { 112 unsigned int fpa_id; 113 unsigned int cancel_flag; 114 unsigned int fpa_type; 115 unsigned int quin_cunx_flag; 116 unsigned int content_interprtation_type; 117 unsigned int spatial_flipping_flag; 118 unsigned int frame0_flipped_flag; 119 unsigned int field_views_flag; 120 unsigned int current_frame_is_frame0_flag; 121 unsigned int frame0_self_contained_flag; 122 unsigned int frame1_self_contained_flag; 123 unsigned int frame0_graid_pos_x; 124 unsigned int frame0_graid_pos_y; 125 unsigned int frame1_graid_pos_x; 126 unsigned int frame1_graid_pos_y; 127 unsigned int fpa_reserved_byte; 128 unsigned int fpa_repetition_period; 129 unsigned int fpa_extension_flag; 130 }; 131 132 struct msm_vidc_vqzip_sei_payload { 133 unsigned int size; 134 unsigned int data[1]; 135 }; 136 137 struct msm_vidc_yuv_stats_payload { 138 unsigned int frame_qp; 139 unsigned int texture; 140 unsigned int luma_in_q16; 141 unsigned int frame_difference; 142 }; 143 144 struct msm_vidc_roi_qp_payload { 145 int upper_qp_offset; 146 int lower_qp_offset; 147 unsigned int b_roi_info; 148 int mbi_info_size; 149 unsigned int data[1]; 150 }; 151 152 enum msm_vidc_extradata_type { 153 MSM_VIDC_EXTRADATA_NONE = 0x00000000, 154 MSM_VIDC_EXTRADATA_MB_QUANTIZATION = 0x00000001, 155 MSM_VIDC_EXTRADATA_INTERLACE_VIDEO = 0x00000002, 156 MSM_VIDC_EXTRADATA_VC1_FRAMEDISP = 0x00000003, 157 MSM_VIDC_EXTRADATA_VC1_SEQDISP = 0x00000004, 158 MSM_VIDC_EXTRADATA_TIMESTAMP = 0x00000005, 159 MSM_VIDC_EXTRADATA_S3D_FRAME_PACKING = 0x00000006, 160 MSM_VIDC_EXTRADATA_FRAME_RATE = 0x00000007, 161 MSM_VIDC_EXTRADATA_PANSCAN_WINDOW = 0x00000008, 162 MSM_VIDC_EXTRADATA_RECOVERY_POINT_SEI = 0x00000009, 163 MSM_VIDC_EXTRADATA_MPEG2_SEQDISP = 0x0000000D, 164 MSM_VIDC_EXTRADATA_STREAM_USERDATA = 0x0000000E, 165 MSM_VIDC_EXTRADATA_FRAME_QP = 0x0000000F, 166 MSM_VIDC_EXTRADATA_FRAME_BITS_INFO = 0x00000010, 167 MSM_VIDC_EXTRADATA_VQZIP_SEI = 0x00000011, 168 MSM_VIDC_EXTRADATA_ROI_QP = 0x00000013, 169 MSM_VIDC_EXTRADATA_INPUT_CROP = 0x0700000E, 170 MSM_VIDC_EXTRADATA_DIGITAL_ZOOM = 0x07000010, 171 MSM_VIDC_EXTRADATA_MULTISLICE_INFO = 0x7F100000, 172 MSM_VIDC_EXTRADATA_NUM_CONCEALED_MB = 0x7F100001, 173 MSM_VIDC_EXTRADATA_INDEX = 0x7F100002, 174 MSM_VIDC_EXTRADATA_ASPECT_RATIO = 0x7F100003, 175 MSM_VIDC_EXTRADATA_METADATA_LTR = 0x7F100004, 176 MSM_VIDC_EXTRADATA_METADATA_FILLER = 0x7FE00002, 177 MSM_VIDC_EXTRADATA_METADATA_MBI = 0x7F100005, 178 MSM_VIDC_EXTRADATA_YUVSTATS_INFO = 0x7F100007, 179 }; 180 enum msm_vidc_interlace_type { 181 MSM_VIDC_INTERLACE_FRAME_PROGRESSIVE = 0x01, 182 MSM_VIDC_INTERLACE_INTERLEAVE_FRAME_TOPFIELDFIRST = 0x02, 183 MSM_VIDC_INTERLACE_INTERLEAVE_FRAME_BOTTOMFIELDFIRST = 0x04, 184 MSM_VIDC_INTERLACE_FRAME_TOPFIELDFIRST = 0x08, 185 MSM_VIDC_INTERLACE_FRAME_BOTTOMFIELDFIRST = 0x10, 186 }; 187 188 /* enum msm_vidc_framepack_type */ 189 #define MSM_VIDC_FRAMEPACK_CHECKERBOARD 0x00 190 #define MSM_VIDC_FRAMEPACK_COLUMN_INTERLEAVE 0x01 191 #define MSM_VIDC_FRAMEPACK_ROW_INTERLEAVE 0x02 192 #define MSM_VIDC_FRAMEPACK_SIDE_BY_SIDE 0x03 193 #define MSM_VIDC_FRAMEPACK_TOP_BOTTOM 0x04 194 #define MSM_VIDC_FRAMEPACK_TEMPORAL_INTERLEAVE 0x05 195 196 enum msm_vidc_recovery_sei { 197 MSM_VIDC_FRAME_RECONSTRUCTION_INCORRECT = 0x0, 198 MSM_VIDC_FRAME_RECONSTRUCTION_CORRECT = 0x01, 199 MSM_VIDC_FRAME_RECONSTRUCTION_APPROXIMATELY_CORRECT = 0x02, 200 }; 201 enum msm_vidc_userdata_type { 202 MSM_VIDC_USERDATA_TYPE_FRAME = 0x1, 203 MSM_VIDC_USERDATA_TYPE_TOP_FIELD = 0x2, 204 MSM_VIDC_USERDATA_TYPE_BOTTOM_FIELD = 0x3, 205 }; 206 207 enum msm_vidc_pixel_depth { 208 MSM_VIDC_BIT_DEPTH_8, 209 MSM_VIDC_BIT_DEPTH_10, 210 MSM_VIDC_BIT_DEPTH_UNSUPPORTED = 0XFFFFFFFF, 211 }; 212 #endif 213