msm_vidc_enc.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700
  1. #ifndef _MSM_VIDC_ENC_H_
  2. #define _MSM_VIDC_ENC_H_
  3. #include <linux/types.h>
  4. #include <linux/ioctl.h>
  5. /** STATUS CODES*/
  6. /* Base value for status codes */
  7. #define VEN_S_BASE 0x00000000
  8. #define VEN_S_SUCCESS (VEN_S_BASE)/* Success */
  9. #define VEN_S_EFAIL (VEN_S_BASE+1)/* General failure */
  10. #define VEN_S_EFATAL (VEN_S_BASE+2)/* Fatal irrecoverable failure*/
  11. #define VEN_S_EBADPARAM (VEN_S_BASE+3)/* Error passed parameters*/
  12. /*Command called in invalid state*/
  13. #define VEN_S_EINVALSTATE (VEN_S_BASE+4)
  14. #define VEN_S_ENOSWRES (VEN_S_BASE+5)/* Insufficient OS resources*/
  15. #define VEN_S_ENOHWRES (VEN_S_BASE+6)/*Insufficient HW resources */
  16. #define VEN_S_EBUFFREQ (VEN_S_BASE+7)/* Buffer requirements were not met*/
  17. #define VEN_S_EINVALCMD (VEN_S_BASE+8)/* Invalid command called */
  18. #define VEN_S_ETIMEOUT (VEN_S_BASE+9)/* Command timeout. */
  19. /*Re-attempt was made when multiple invocation not supported for API.*/
  20. #define VEN_S_ENOREATMPT (VEN_S_BASE+10)
  21. #define VEN_S_ENOPREREQ (VEN_S_BASE+11)/*Pre-requirement is not met for API*/
  22. #define VEN_S_ECMDQFULL (VEN_S_BASE+12)/*Command queue is full*/
  23. #define VEN_S_ENOTSUPP (VEN_S_BASE+13)/*Command not supported*/
  24. #define VEN_S_ENOTIMPL (VEN_S_BASE+14)/*Command not implemented.*/
  25. #define VEN_S_ENOTPMEM (VEN_S_BASE+15)/*Buffer is not from PMEM*/
  26. #define VEN_S_EFLUSHED (VEN_S_BASE+16)/*returned buffer was flushed*/
  27. #define VEN_S_EINSUFBUF (VEN_S_BASE+17)/*provided buffer size insufficient*/
  28. #define VEN_S_ESAMESTATE (VEN_S_BASE+18)
  29. #define VEN_S_EINVALTRANS (VEN_S_BASE+19)
  30. #define VEN_INTF_VER 1
  31. /*Asynchronous messages from driver*/
  32. #define VEN_MSG_INDICATION 0
  33. #define VEN_MSG_INPUT_BUFFER_DONE 1
  34. #define VEN_MSG_OUTPUT_BUFFER_DONE 2
  35. #define VEN_MSG_NEED_OUTPUT_BUFFER 3
  36. #define VEN_MSG_FLUSH_INPUT_DONE 4
  37. #define VEN_MSG_FLUSH_OUPUT_DONE 5
  38. #define VEN_MSG_START 6
  39. #define VEN_MSG_STOP 7
  40. #define VEN_MSG_PAUSE 8
  41. #define VEN_MSG_RESUME 9
  42. #define VEN_MSG_STOP_READING_MSG 10
  43. #define VEN_MSG_LTRUSE_FAILED 11
  44. #define VEN_MSG_HW_OVERLOAD 12
  45. #define VEN_MSG_MAX_CLIENTS 13
  46. /*Buffer flags bits masks*/
  47. #define VEN_BUFFLAG_EOS 0x00000001
  48. #define VEN_BUFFLAG_ENDOFFRAME 0x00000010
  49. #define VEN_BUFFLAG_SYNCFRAME 0x00000020
  50. #define VEN_BUFFLAG_EXTRADATA 0x00000040
  51. #define VEN_BUFFLAG_CODECCONFIG 0x00000080
  52. /*Post processing flags bit masks*/
  53. #define VEN_EXTRADATA_NONE 0x001
  54. #define VEN_EXTRADATA_QCOMFILLER 0x002
  55. #define VEN_EXTRADATA_SLICEINFO 0x100
  56. #define VEN_EXTRADATA_LTRINFO 0x200
  57. #define VEN_EXTRADATA_MBINFO 0x400
  58. /*ENCODER CONFIGURATION CONSTANTS*/
  59. /*Encoded video frame types*/
  60. #define VEN_FRAME_TYPE_I 1/* I frame type */
  61. #define VEN_FRAME_TYPE_P 2/* P frame type */
  62. #define VEN_FRAME_TYPE_B 3/* B frame type */
  63. /*Video codec types*/
  64. #define VEN_CODEC_MPEG4 1/* MPEG4 Codec */
  65. #define VEN_CODEC_H264 2/* H.264 Codec */
  66. #define VEN_CODEC_H263 3/* H.263 Codec */
  67. /*Video codec profile types.*/
  68. #define VEN_PROFILE_MPEG4_SP 1/* 1 - MPEG4 SP profile */
  69. #define VEN_PROFILE_MPEG4_ASP 2/* 2 - MPEG4 ASP profile */
  70. #define VEN_PROFILE_H264_BASELINE 3/* 3 - H264 Baseline profile */
  71. #define VEN_PROFILE_H264_MAIN 4/* 4 - H264 Main profile */
  72. #define VEN_PROFILE_H264_HIGH 5/* 5 - H264 High profile */
  73. #define VEN_PROFILE_H263_BASELINE 6/* 6 - H263 Baseline profile */
  74. /*Video codec profile level types.*/
  75. #define VEN_LEVEL_MPEG4_0 0x1/* MPEG4 Level 0 */
  76. #define VEN_LEVEL_MPEG4_1 0x2/* MPEG4 Level 1 */
  77. #define VEN_LEVEL_MPEG4_2 0x3/* MPEG4 Level 2 */
  78. #define VEN_LEVEL_MPEG4_3 0x4/* MPEG4 Level 3 */
  79. #define VEN_LEVEL_MPEG4_4 0x5/* MPEG4 Level 4 */
  80. #define VEN_LEVEL_MPEG4_5 0x6/* MPEG4 Level 5 */
  81. #define VEN_LEVEL_MPEG4_3b 0x7/* MPEG4 Level 3b */
  82. #define VEN_LEVEL_MPEG4_6 0x8/* MPEG4 Level 6 */
  83. #define VEN_LEVEL_H264_1 0x9/* H.264 Level 1 */
  84. #define VEN_LEVEL_H264_1b 0xA/* H.264 Level 1b */
  85. #define VEN_LEVEL_H264_1p1 0xB/* H.264 Level 1.1 */
  86. #define VEN_LEVEL_H264_1p2 0xC/* H.264 Level 1.2 */
  87. #define VEN_LEVEL_H264_1p3 0xD/* H.264 Level 1.3 */
  88. #define VEN_LEVEL_H264_2 0xE/* H.264 Level 2 */
  89. #define VEN_LEVEL_H264_2p1 0xF/* H.264 Level 2.1 */
  90. #define VEN_LEVEL_H264_2p2 0x10/* H.264 Level 2.2 */
  91. #define VEN_LEVEL_H264_3 0x11/* H.264 Level 3 */
  92. #define VEN_LEVEL_H264_3p1 0x12/* H.264 Level 3.1 */
  93. #define VEN_LEVEL_H264_3p2 0x13/* H.264 Level 3.2 */
  94. #define VEN_LEVEL_H264_4 0x14/* H.264 Level 4 */
  95. #define VEN_LEVEL_H263_10 0x15/* H.263 Level 10 */
  96. #define VEN_LEVEL_H263_20 0x16/* H.263 Level 20 */
  97. #define VEN_LEVEL_H263_30 0x17/* H.263 Level 30 */
  98. #define VEN_LEVEL_H263_40 0x18/* H.263 Level 40 */
  99. #define VEN_LEVEL_H263_45 0x19/* H.263 Level 45 */
  100. #define VEN_LEVEL_H263_50 0x1A/* H.263 Level 50 */
  101. #define VEN_LEVEL_H263_60 0x1B/* H.263 Level 60 */
  102. #define VEN_LEVEL_H263_70 0x1C/* H.263 Level 70 */
  103. /*Entropy coding model selection for H.264 encoder.*/
  104. #define VEN_ENTROPY_MODEL_CAVLC 1
  105. #define VEN_ENTROPY_MODEL_CABAC 2
  106. /*Cabac model number (0,1,2) for encoder.*/
  107. #define VEN_CABAC_MODEL_0 1/* CABAC Model 0. */
  108. #define VEN_CABAC_MODEL_1 2/* CABAC Model 1. */
  109. #define VEN_CABAC_MODEL_2 3/* CABAC Model 2. */
  110. /*Deblocking filter control type for encoder.*/
  111. #define VEN_DB_DISABLE 1/* 1 - Disable deblocking filter*/
  112. #define VEN_DB_ALL_BLKG_BNDRY 2/* 2 - All blocking boundary filtering*/
  113. #define VEN_DB_SKIP_SLICE_BNDRY 3/* 3 - Filtering except sliceboundary*/
  114. /*Different methods of Multi slice selection.*/
  115. #define VEN_MSLICE_OFF 1
  116. #define VEN_MSLICE_CNT_MB 2 /*number of MBscount per slice*/
  117. #define VEN_MSLICE_CNT_BYTE 3 /*number of bytes count per slice.*/
  118. #define VEN_MSLICE_GOB 4 /*Multi slice by GOB for H.263 only.*/
  119. /*Different modes for Rate Control.*/
  120. #define VEN_RC_OFF 1
  121. #define VEN_RC_VBR_VFR 2
  122. #define VEN_RC_VBR_CFR 3
  123. #define VEN_RC_CBR_VFR 4
  124. #define VEN_RC_CBR_CFR 5
  125. /*Different modes for flushing buffers*/
  126. #define VEN_FLUSH_INPUT 1
  127. #define VEN_FLUSH_OUTPUT 2
  128. #define VEN_FLUSH_ALL 3
  129. /*Different input formats for YUV data.*/
  130. #define VEN_INPUTFMT_NV12 1/* NV12 Linear */
  131. #define VEN_INPUTFMT_NV21 2/* NV21 Linear */
  132. #define VEN_INPUTFMT_NV12_16M2KA 3/* NV12 Linear */
  133. /*Different allowed rotation modes.*/
  134. #define VEN_ROTATION_0 1/* 0 degrees */
  135. #define VEN_ROTATION_90 2/* 90 degrees */
  136. #define VEN_ROTATION_180 3/* 180 degrees */
  137. #define VEN_ROTATION_270 4/* 270 degrees */
  138. /*IOCTL timeout values*/
  139. #define VEN_TIMEOUT_INFINITE 0xffffffff
  140. /*Different allowed intra refresh modes.*/
  141. #define VEN_IR_OFF 1
  142. #define VEN_IR_CYCLIC 2
  143. #define VEN_IR_RANDOM 3
  144. /*IOCTL BASE CODES Not to be used directly by the client.*/
  145. /* Base value for ioctls that are not related to encoder configuration.*/
  146. #define VEN_IOCTLBASE_NENC 0x800
  147. /* Base value for encoder configuration ioctls*/
  148. #define VEN_IOCTLBASE_ENC 0x850
  149. struct venc_ioctl_msg{
  150. void __user *in;
  151. void __user *out;
  152. };
  153. /*NON ENCODER CONFIGURATION IOCTLs*/
  154. /*IOCTL params:SET: InputData - unsigned long, OutputData - NULL*/
  155. #define VEN_IOCTL_SET_INTF_VERSION \
  156. _IOW(VEN_IOCTLBASE_NENC, 0, struct venc_ioctl_msg)
  157. /*IOCTL params:CMD: InputData - venc_timeout, OutputData - venc_msg*/
  158. #define VEN_IOCTL_CMD_READ_NEXT_MSG \
  159. _IOWR(VEN_IOCTLBASE_NENC, 1, struct venc_ioctl_msg)
  160. /*IOCTL params:CMD: InputData - NULL, OutputData - NULL*/
  161. #define VEN_IOCTL_CMD_STOP_READ_MSG _IO(VEN_IOCTLBASE_NENC, 2)
  162. /*IOCTL params:SET: InputData - venc_allocatorproperty, OutputData - NULL
  163. GET: InputData - NULL, OutputData - venc_allocatorproperty*/
  164. #define VEN_IOCTL_SET_INPUT_BUFFER_REQ \
  165. _IOW(VEN_IOCTLBASE_NENC, 3, struct venc_ioctl_msg)
  166. #define VEN_IOCTL_GET_INPUT_BUFFER_REQ \
  167. _IOR(VEN_IOCTLBASE_NENC, 4, struct venc_ioctl_msg)
  168. /*IOCTL params:CMD: InputData - venc_bufferpayload, OutputData - NULL*/
  169. #define VEN_IOCTL_CMD_ALLOC_INPUT_BUFFER \
  170. _IOW(VEN_IOCTLBASE_NENC, 5, struct venc_ioctl_msg)
  171. /*IOCTL params:CMD: InputData - venc_bufferpayload, OutputData - NULL*/
  172. #define VEN_IOCTL_SET_INPUT_BUFFER \
  173. _IOW(VEN_IOCTLBASE_NENC, 6, struct venc_ioctl_msg)
  174. /*IOCTL params: CMD: InputData - venc_bufferpayload, OutputData - NULL*/
  175. #define VEN_IOCTL_CMD_FREE_INPUT_BUFFER \
  176. _IOW(VEN_IOCTLBASE_NENC, 7, struct venc_ioctl_msg)
  177. /*IOCTL params:SET: InputData - venc_allocatorproperty, OutputData - NULL
  178. GET: InputData - NULL, OutputData - venc_allocatorproperty*/
  179. #define VEN_IOCTL_SET_OUTPUT_BUFFER_REQ \
  180. _IOW(VEN_IOCTLBASE_NENC, 8, struct venc_ioctl_msg)
  181. #define VEN_IOCTL_GET_OUTPUT_BUFFER_REQ \
  182. _IOR(VEN_IOCTLBASE_NENC, 9, struct venc_ioctl_msg)
  183. /*IOCTL params:CMD: InputData - venc_bufferpayload, OutputData - NULL*/
  184. #define VEN_IOCTL_CMD_ALLOC_OUTPUT_BUFFER \
  185. _IOW(VEN_IOCTLBASE_NENC, 10, struct venc_ioctl_msg)
  186. /*IOCTL params:CMD: InputData - venc_bufferpayload, OutputData - NULL*/
  187. #define VEN_IOCTL_SET_OUTPUT_BUFFER \
  188. _IOW(VEN_IOCTLBASE_NENC, 11, struct venc_ioctl_msg)
  189. /*IOCTL params:CMD: InputData - venc_bufferpayload, OutputData - NULL.*/
  190. #define VEN_IOCTL_CMD_FREE_OUTPUT_BUFFER \
  191. _IOW(VEN_IOCTLBASE_NENC, 12, struct venc_ioctl_msg)
  192. /* Asynchronous respone message code:* VEN_MSG_START*/
  193. #define VEN_IOCTL_CMD_START _IO(VEN_IOCTLBASE_NENC, 13)
  194. /*IOCTL params:CMD: InputData - venc_buffer, OutputData - NULL
  195. Asynchronous respone message code:VEN_MSG_INPUT_BUFFER_DONE*/
  196. #define VEN_IOCTL_CMD_ENCODE_FRAME \
  197. _IOW(VEN_IOCTLBASE_NENC, 14, struct venc_ioctl_msg)
  198. /*IOCTL params:CMD: InputData - venc_buffer, OutputData - NULL
  199. Asynchronous response message code:VEN_MSG_OUTPUT_BUFFER_DONE*/
  200. #define VEN_IOCTL_CMD_FILL_OUTPUT_BUFFER \
  201. _IOW(VEN_IOCTLBASE_NENC, 15, struct venc_ioctl_msg)
  202. /*IOCTL params:CMD: InputData - venc_bufferflush, OutputData - NULL
  203. * Asynchronous response message code:VEN_MSG_INPUT_BUFFER_DONE*/
  204. #define VEN_IOCTL_CMD_FLUSH \
  205. _IOW(VEN_IOCTLBASE_NENC, 16, struct venc_ioctl_msg)
  206. /*Asynchronous respone message code:VEN_MSG_PAUSE*/
  207. #define VEN_IOCTL_CMD_PAUSE _IO(VEN_IOCTLBASE_NENC, 17)
  208. /*Asynchronous respone message code:VEN_MSG_RESUME*/
  209. #define VEN_IOCTL_CMD_RESUME _IO(VEN_IOCTLBASE_NENC, 18)
  210. /* Asynchronous respone message code:VEN_MSG_STOP*/
  211. #define VEN_IOCTL_CMD_STOP _IO(VEN_IOCTLBASE_NENC, 19)
  212. #define VEN_IOCTL_SET_RECON_BUFFER \
  213. _IOW(VEN_IOCTLBASE_NENC, 20, struct venc_ioctl_msg)
  214. #define VEN_IOCTL_FREE_RECON_BUFFER \
  215. _IOW(VEN_IOCTLBASE_NENC, 21, struct venc_ioctl_msg)
  216. #define VEN_IOCTL_GET_RECON_BUFFER_SIZE \
  217. _IOW(VEN_IOCTLBASE_NENC, 22, struct venc_ioctl_msg)
  218. /*ENCODER PROPERTY CONFIGURATION & CAPABILITY IOCTLs*/
  219. /*IOCTL params:SET: InputData - venc_basecfg, OutputData - NULL
  220. GET: InputData - NULL, OutputData - venc_basecfg*/
  221. #define VEN_IOCTL_SET_BASE_CFG \
  222. _IOW(VEN_IOCTLBASE_ENC, 1, struct venc_ioctl_msg)
  223. #define VEN_IOCTL_GET_BASE_CFG \
  224. _IOR(VEN_IOCTLBASE_ENC, 2, struct venc_ioctl_msg)
  225. /*IOCTL params:SET: InputData - venc_switch, OutputData - NULL
  226. GET: InputData - NULL, OutputData - venc_switch*/
  227. #define VEN_IOCTL_SET_LIVE_MODE \
  228. _IOW(VEN_IOCTLBASE_ENC, 3, struct venc_ioctl_msg)
  229. #define VEN_IOCTL_GET_LIVE_MODE \
  230. _IOR(VEN_IOCTLBASE_ENC, 4, struct venc_ioctl_msg)
  231. /*IOCTL params:SET: InputData - venc_profile, OutputData - NULL
  232. GET: InputData - NULL, OutputData - venc_profile*/
  233. #define VEN_IOCTL_SET_CODEC_PROFILE \
  234. _IOW(VEN_IOCTLBASE_ENC, 5, struct venc_ioctl_msg)
  235. #define VEN_IOCTL_GET_CODEC_PROFILE \
  236. _IOR(VEN_IOCTLBASE_ENC, 6, struct venc_ioctl_msg)
  237. /*IOCTL params:SET: InputData - ven_profilelevel, OutputData - NULL
  238. GET: InputData - NULL, OutputData - ven_profilelevel*/
  239. #define VEN_IOCTL_SET_PROFILE_LEVEL \
  240. _IOW(VEN_IOCTLBASE_ENC, 7, struct venc_ioctl_msg)
  241. #define VEN_IOCTL_GET_PROFILE_LEVEL \
  242. _IOR(VEN_IOCTLBASE_ENC, 8, struct venc_ioctl_msg)
  243. /*IOCTL params:SET: InputData - venc_switch, OutputData - NULL
  244. GET: InputData - NULL, OutputData - venc_switch*/
  245. #define VEN_IOCTL_SET_SHORT_HDR \
  246. _IOW(VEN_IOCTLBASE_ENC, 9, struct venc_ioctl_msg)
  247. #define VEN_IOCTL_GET_SHORT_HDR \
  248. _IOR(VEN_IOCTLBASE_ENC, 10, struct venc_ioctl_msg)
  249. /*IOCTL params: SET: InputData - venc_sessionqp, OutputData - NULL
  250. GET: InputData - NULL, OutputData - venc_sessionqp*/
  251. #define VEN_IOCTL_SET_SESSION_QP \
  252. _IOW(VEN_IOCTLBASE_ENC, 11, struct venc_ioctl_msg)
  253. #define VEN_IOCTL_GET_SESSION_QP \
  254. _IOR(VEN_IOCTLBASE_ENC, 12, struct venc_ioctl_msg)
  255. /*IOCTL params:SET: InputData - venc_intraperiod, OutputData - NULL
  256. GET: InputData - NULL, OutputData - venc_intraperiod*/
  257. #define VEN_IOCTL_SET_INTRA_PERIOD \
  258. _IOW(VEN_IOCTLBASE_ENC, 13, struct venc_ioctl_msg)
  259. #define VEN_IOCTL_GET_INTRA_PERIOD \
  260. _IOR(VEN_IOCTLBASE_ENC, 14, struct venc_ioctl_msg)
  261. /* Request an Iframe*/
  262. #define VEN_IOCTL_CMD_REQUEST_IFRAME _IO(VEN_IOCTLBASE_ENC, 15)
  263. /*IOCTL params:GET: InputData - NULL, OutputData - venc_capability*/
  264. #define VEN_IOCTL_GET_CAPABILITY \
  265. _IOR(VEN_IOCTLBASE_ENC, 16, struct venc_ioctl_msg)
  266. /*IOCTL params:GET: InputData - NULL, OutputData - venc_seqheader*/
  267. #define VEN_IOCTL_GET_SEQUENCE_HDR \
  268. _IOR(VEN_IOCTLBASE_ENC, 17, struct venc_ioctl_msg)
  269. /*IOCTL params:SET: InputData - venc_entropycfg, OutputData - NULL
  270. GET: InputData - NULL, OutputData - venc_entropycfg*/
  271. #define VEN_IOCTL_SET_ENTROPY_CFG \
  272. _IOW(VEN_IOCTLBASE_ENC, 18, struct venc_ioctl_msg)
  273. #define VEN_IOCTL_GET_ENTROPY_CFG \
  274. _IOR(VEN_IOCTLBASE_ENC, 19, struct venc_ioctl_msg)
  275. /*IOCTL params:SET: InputData - venc_dbcfg, OutputData - NULL
  276. GET: InputData - NULL, OutputData - venc_dbcfg*/
  277. #define VEN_IOCTL_SET_DEBLOCKING_CFG \
  278. _IOW(VEN_IOCTLBASE_ENC, 20, struct venc_ioctl_msg)
  279. #define VEN_IOCTL_GET_DEBLOCKING_CFG \
  280. _IOR(VEN_IOCTLBASE_ENC, 21, struct venc_ioctl_msg)
  281. /*IOCTL params:SET: InputData - venc_intrarefresh, OutputData - NULL
  282. GET: InputData - NULL, OutputData - venc_intrarefresh*/
  283. #define VEN_IOCTL_SET_INTRA_REFRESH \
  284. _IOW(VEN_IOCTLBASE_ENC, 22, struct venc_ioctl_msg)
  285. #define VEN_IOCTL_GET_INTRA_REFRESH \
  286. _IOR(VEN_IOCTLBASE_ENC, 23, struct venc_ioctl_msg)
  287. /*IOCTL params:SET: InputData - venc_multiclicecfg, OutputData - NULL
  288. GET: InputData - NULL, OutputData - venc_multiclicecfg*/
  289. #define VEN_IOCTL_SET_MULTI_SLICE_CFG \
  290. _IOW(VEN_IOCTLBASE_ENC, 24, struct venc_ioctl_msg)
  291. #define VEN_IOCTL_GET_MULTI_SLICE_CFG \
  292. _IOR(VEN_IOCTLBASE_ENC, 25, struct venc_ioctl_msg)
  293. /*IOCTL params:SET: InputData - venc_ratectrlcfg, OutputData - NULL
  294. GET: InputData - NULL, OutputData - venc_ratectrlcfg*/
  295. #define VEN_IOCTL_SET_RATE_CTRL_CFG \
  296. _IOW(VEN_IOCTLBASE_ENC, 26, struct venc_ioctl_msg)
  297. #define VEN_IOCTL_GET_RATE_CTRL_CFG \
  298. _IOR(VEN_IOCTLBASE_ENC, 27, struct venc_ioctl_msg)
  299. /*IOCTL params:SET: InputData - venc_voptimingcfg, OutputData - NULL
  300. GET: InputData - NULL, OutputData - venc_voptimingcfg*/
  301. #define VEN_IOCTL_SET_VOP_TIMING_CFG \
  302. _IOW(VEN_IOCTLBASE_ENC, 28, struct venc_ioctl_msg)
  303. #define VEN_IOCTL_GET_VOP_TIMING_CFG \
  304. _IOR(VEN_IOCTLBASE_ENC, 29, struct venc_ioctl_msg)
  305. /*IOCTL params:SET: InputData - venc_framerate, OutputData - NULL
  306. GET: InputData - NULL, OutputData - venc_framerate*/
  307. #define VEN_IOCTL_SET_FRAME_RATE \
  308. _IOW(VEN_IOCTLBASE_ENC, 30, struct venc_ioctl_msg)
  309. #define VEN_IOCTL_GET_FRAME_RATE \
  310. _IOR(VEN_IOCTLBASE_ENC, 31, struct venc_ioctl_msg)
  311. /*IOCTL params:SET: InputData - venc_targetbitrate, OutputData - NULL
  312. GET: InputData - NULL, OutputData - venc_targetbitrate*/
  313. #define VEN_IOCTL_SET_TARGET_BITRATE \
  314. _IOW(VEN_IOCTLBASE_ENC, 32, struct venc_ioctl_msg)
  315. #define VEN_IOCTL_GET_TARGET_BITRATE \
  316. _IOR(VEN_IOCTLBASE_ENC, 33, struct venc_ioctl_msg)
  317. /*IOCTL params:SET: InputData - venc_rotation, OutputData - NULL
  318. GET: InputData - NULL, OutputData - venc_rotation*/
  319. #define VEN_IOCTL_SET_ROTATION \
  320. _IOW(VEN_IOCTLBASE_ENC, 34, struct venc_ioctl_msg)
  321. #define VEN_IOCTL_GET_ROTATION \
  322. _IOR(VEN_IOCTLBASE_ENC, 35, struct venc_ioctl_msg)
  323. /*IOCTL params:SET: InputData - venc_headerextension, OutputData - NULL
  324. GET: InputData - NULL, OutputData - venc_headerextension*/
  325. #define VEN_IOCTL_SET_HEC \
  326. _IOW(VEN_IOCTLBASE_ENC, 36, struct venc_ioctl_msg)
  327. #define VEN_IOCTL_GET_HEC \
  328. _IOR(VEN_IOCTLBASE_ENC, 37, struct venc_ioctl_msg)
  329. /*IOCTL params:SET: InputData - venc_switch, OutputData - NULL
  330. GET: InputData - NULL, OutputData - venc_switch*/
  331. #define VEN_IOCTL_SET_DATA_PARTITION \
  332. _IOW(VEN_IOCTLBASE_ENC, 38, struct venc_ioctl_msg)
  333. #define VEN_IOCTL_GET_DATA_PARTITION \
  334. _IOR(VEN_IOCTLBASE_ENC, 39, struct venc_ioctl_msg)
  335. /*IOCTL params:SET: InputData - venc_switch, OutputData - NULL
  336. GET: InputData - NULL, OutputData - venc_switch*/
  337. #define VEN_IOCTL_SET_RVLC \
  338. _IOW(VEN_IOCTLBASE_ENC, 40, struct venc_ioctl_msg)
  339. #define VEN_IOCTL_GET_RVLC \
  340. _IOR(VEN_IOCTLBASE_ENC, 41, struct venc_ioctl_msg)
  341. /*IOCTL params:SET: InputData - venc_switch, OutputData - NULL
  342. GET: InputData - NULL, OutputData - venc_switch*/
  343. #define VEN_IOCTL_SET_AC_PREDICTION \
  344. _IOW(VEN_IOCTLBASE_ENC, 42, struct venc_ioctl_msg)
  345. #define VEN_IOCTL_GET_AC_PREDICTION \
  346. _IOR(VEN_IOCTLBASE_ENC, 43, struct venc_ioctl_msg)
  347. /*IOCTL params:SET: InputData - venc_qprange, OutputData - NULL
  348. GET: InputData - NULL, OutputData - venc_qprange*/
  349. #define VEN_IOCTL_SET_QP_RANGE \
  350. _IOW(VEN_IOCTLBASE_ENC, 44, struct venc_ioctl_msg)
  351. #define VEN_IOCTL_GET_QP_RANGE \
  352. _IOR(VEN_IOCTLBASE_ENC, 45, struct venc_ioctl_msg)
  353. #define VEN_IOCTL_GET_NUMBER_INSTANCES \
  354. _IOR(VEN_IOCTLBASE_ENC, 46, struct venc_ioctl_msg)
  355. #define VEN_IOCTL_SET_METABUFFER_MODE \
  356. _IOW(VEN_IOCTLBASE_ENC, 47, struct venc_ioctl_msg)
  357. /*IOCTL params:SET: InputData - unsigned int, OutputData - NULL.*/
  358. #define VEN_IOCTL_SET_EXTRADATA \
  359. _IOW(VEN_IOCTLBASE_ENC, 48, struct venc_ioctl_msg)
  360. /*IOCTL params:GET: InputData - NULL, OutputData - unsigned int.*/
  361. #define VEN_IOCTL_GET_EXTRADATA \
  362. _IOR(VEN_IOCTLBASE_ENC, 49, struct venc_ioctl_msg)
  363. /*IOCTL params:SET: InputData - NULL, OutputData - NULL.*/
  364. #define VEN_IOCTL_SET_SLICE_DELIVERY_MODE \
  365. _IO(VEN_IOCTLBASE_ENC, 50)
  366. #define VEN_IOCTL_SET_H263_PLUSPTYPE \
  367. _IOW(VEN_IOCTLBASE_ENC, 51, struct venc_ioctl_msg)
  368. /*IOCTL params:SET: InputData - venc_range, OutputData - NULL.*/
  369. #define VEN_IOCTL_SET_CAPABILITY_LTRCOUNT \
  370. _IOW(VEN_IOCTLBASE_ENC, 52, struct venc_ioctl_msg)
  371. /*IOCTL params:GET: InputData - NULL, OutputData - venc_range.*/
  372. #define VEN_IOCTL_GET_CAPABILITY_LTRCOUNT \
  373. _IOR(VEN_IOCTLBASE_ENC, 53, struct venc_ioctl_msg)
  374. /*IOCTL params:SET: InputData - venc_ltrmode, OutputData - NULL.*/
  375. #define VEN_IOCTL_SET_LTRMODE \
  376. _IOW(VEN_IOCTLBASE_ENC, 54, struct venc_ioctl_msg)
  377. /*IOCTL params:GET: InputData - NULL, OutputData - venc_ltrmode.*/
  378. #define VEN_IOCTL_GET_LTRMODE \
  379. _IOR(VEN_IOCTLBASE_ENC, 55, struct venc_ioctl_msg)
  380. /*IOCTL params:SET: InputData - venc_ltrcount, OutputData - NULL.*/
  381. #define VEN_IOCTL_SET_LTRCOUNT \
  382. _IOW(VEN_IOCTLBASE_ENC, 56, struct venc_ioctl_msg)
  383. /*IOCTL params:GET: InputData - NULL, OutputData - venc_ltrcount.*/
  384. #define VEN_IOCTL_GET_LTRCOUNT \
  385. _IOR(VEN_IOCTLBASE_ENC, 57, struct venc_ioctl_msg)
  386. /*IOCTL params:SET: InputData - venc_ltrperiod, OutputData - NULL.*/
  387. #define VEN_IOCTL_SET_LTRPERIOD \
  388. _IOW(VEN_IOCTLBASE_ENC, 58, struct venc_ioctl_msg)
  389. /*IOCTL params:GET: InputData - NULL, OutputData - venc_ltrperiod.*/
  390. #define VEN_IOCTL_GET_LTRPERIOD \
  391. _IOR(VEN_IOCTLBASE_ENC, 59, struct venc_ioctl_msg)
  392. /*IOCTL params:SET: InputData - venc_ltruse, OutputData - NULL.*/
  393. #define VEN_IOCTL_SET_LTRUSE \
  394. _IOW(VEN_IOCTLBASE_ENC, 60, struct venc_ioctl_msg)
  395. /*IOCTL params:GET: InputData - NULL, OutputData - venc_ltruse.*/
  396. #define VEN_IOCTL_GET_LTRUSE \
  397. _IOR(VEN_IOCTLBASE_ENC, 61, struct venc_ioctl_msg)
  398. /*IOCTL params:SET: InputData - venc_ltrmark, OutputData - NULL.*/
  399. #define VEN_IOCTL_SET_LTRMARK \
  400. _IOW(VEN_IOCTLBASE_ENC, 62, struct venc_ioctl_msg)
  401. /*IOCTL params:GET: InputData - NULL, OutputData - venc_ltrmark.*/
  402. #define VEN_IOCTL_GET_LTRMARK \
  403. _IOR(VEN_IOCTLBASE_ENC, 63, struct venc_ioctl_msg)
  404. /*IOCTL params:SET: InputData - unsigned int, OutputData - NULL*/
  405. #define VEN_IOCTL_SET_SPS_PPS_FOR_IDR \
  406. _IOW(VEN_IOCTLBASE_ENC, 64, struct venc_ioctl_msg)
  407. struct venc_range {
  408. unsigned long max;
  409. unsigned long min;
  410. unsigned long step_size;
  411. };
  412. struct venc_switch{
  413. unsigned char status;
  414. };
  415. struct venc_allocatorproperty{
  416. unsigned long mincount;
  417. unsigned long maxcount;
  418. unsigned long actualcount;
  419. unsigned long datasize;
  420. unsigned long suffixsize;
  421. unsigned long alignment;
  422. unsigned long bufpoolid;
  423. };
  424. struct venc_bufferpayload{
  425. unsigned char *pbuffer;
  426. size_t sz;
  427. int fd;
  428. unsigned int offset;
  429. unsigned int maped_size;
  430. unsigned long filled_len;
  431. };
  432. struct venc_buffer{
  433. unsigned char *ptrbuffer;
  434. unsigned long sz;
  435. unsigned long len;
  436. unsigned long offset;
  437. long long timestamp;
  438. unsigned long flags;
  439. void *clientdata;
  440. };
  441. struct venc_basecfg{
  442. unsigned long input_width;
  443. unsigned long input_height;
  444. unsigned long dvs_width;
  445. unsigned long dvs_height;
  446. unsigned long codectype;
  447. unsigned long fps_num;
  448. unsigned long fps_den;
  449. unsigned long targetbitrate;
  450. unsigned long inputformat;
  451. };
  452. struct venc_profile{
  453. unsigned long profile;
  454. };
  455. struct ven_profilelevel{
  456. unsigned long level;
  457. };
  458. struct venc_sessionqp{
  459. unsigned long iframeqp;
  460. unsigned long pframqp;
  461. };
  462. struct venc_qprange{
  463. unsigned long maxqp;
  464. unsigned long minqp;
  465. };
  466. struct venc_plusptype {
  467. unsigned long plusptype_enable;
  468. };
  469. struct venc_intraperiod{
  470. unsigned long num_pframes;
  471. unsigned long num_bframes;
  472. };
  473. struct venc_seqheader{
  474. unsigned char *hdrbufptr;
  475. unsigned long bufsize;
  476. unsigned long hdrlen;
  477. };
  478. struct venc_capability{
  479. unsigned long codec_types;
  480. unsigned long maxframe_width;
  481. unsigned long maxframe_height;
  482. unsigned long maxtarget_bitrate;
  483. unsigned long maxframe_rate;
  484. unsigned long input_formats;
  485. unsigned char dvs;
  486. };
  487. struct venc_entropycfg{
  488. unsigned longentropysel;
  489. unsigned long cabacmodel;
  490. };
  491. struct venc_dbcfg{
  492. unsigned long db_mode;
  493. unsigned long slicealpha_offset;
  494. unsigned long slicebeta_offset;
  495. };
  496. struct venc_intrarefresh{
  497. unsigned long irmode;
  498. unsigned long mbcount;
  499. };
  500. struct venc_multiclicecfg{
  501. unsigned long mslice_mode;
  502. unsigned long mslice_size;
  503. };
  504. struct venc_bufferflush{
  505. unsigned long flush_mode;
  506. };
  507. struct venc_ratectrlcfg{
  508. unsigned long rcmode;
  509. };
  510. struct venc_voptimingcfg{
  511. unsigned long voptime_resolution;
  512. };
  513. struct venc_framerate{
  514. unsigned long fps_denominator;
  515. unsigned long fps_numerator;
  516. };
  517. struct venc_targetbitrate{
  518. unsigned long target_bitrate;
  519. };
  520. struct venc_rotation{
  521. unsigned long rotation;
  522. };
  523. struct venc_timeout{
  524. unsigned long millisec;
  525. };
  526. struct venc_headerextension{
  527. unsigned long header_extension;
  528. };
  529. struct venc_msg{
  530. unsigned long statuscode;
  531. unsigned long msgcode;
  532. struct venc_buffer buf;
  533. unsigned long msgdata_size;
  534. };
  535. struct venc_recon_addr{
  536. unsigned char *pbuffer;
  537. unsigned long buffer_size;
  538. unsigned long pmem_fd;
  539. unsigned long offset;
  540. };
  541. struct venc_recon_buff_size{
  542. int width;
  543. int height;
  544. int size;
  545. int alignment;
  546. };
  547. struct venc_ltrmode {
  548. unsigned long ltr_mode;
  549. };
  550. struct venc_ltrcount {
  551. unsigned long ltr_count;
  552. };
  553. struct venc_ltrperiod {
  554. unsigned long ltr_period;
  555. };
  556. struct venc_ltruse {
  557. unsigned long ltr_id;
  558. unsigned long ltr_frames;
  559. };
  560. #endif /* _MSM_VIDC_ENC_H_ */