msm_vidc.h 12 KB

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