vic42.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597
  1. /*
  2. * Copyright © 2018 NVIDIA Corporation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  18. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  19. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  20. * OTHER DEALINGS IN THE SOFTWARE.
  21. */
  22. #ifndef VIC42_H
  23. #define VIC42_H
  24. #include <stdint.h>
  25. #define NVC5B6_VIDEO_COMPOSITOR_SET_APPLICATION_ID 0x00000200
  26. #define NVC5B6_VIDEO_COMPOSITOR_EXECUTE 0x00000300
  27. #define NVC5B6_VIDEO_COMPOSITOR_SET_CONTROL_PARAMS 0x00000704
  28. #define NVC5B6_VIDEO_COMPOSITOR_SET_CONFIG_STRUCT_OFFSET 0x00000708
  29. #define NVC5B6_VIDEO_COMPOSITOR_SET_FILTER_STRUCT_OFFSET 0x0000070c
  30. #define NVC5B6_VIDEO_COMPOSITOR_SET_HIST_OFFSET 0x00000714
  31. #define NVC5B6_VIDEO_COMPOSITOR_SET_OUTPUT_SURFACE_LUMA_OFFSET 0x00000720
  32. #define NVC5B6_VIDEO_COMPOSITOR_SET_SURFACE0_LUMA_OFFSET(slot) (0x00001200 + (slot) * 0x00000060)
  33. #define NVC5B6_VIDEO_COMPOSITOR_SET_SURFACE0_CHROMA_U_OFFSET(slot) (0x00001204 + (slot) * 0x00000060)
  34. #define NVC5B6_VIDEO_COMPOSITOR_SET_SURFACE0_CHROMA_V_OFFSET(slot) (0x00001208 + (slot) * 0x00000060)
  35. #define NVC5B6_VIDEO_COMPOSITOR_SET_SURFACE1_LUMA_OFFSET(slot) (0x0000120c + (slot) * 0x00000060)
  36. #define NVC5B6_VIDEO_COMPOSITOR_SET_SURFACE1_CHROMA_U_OFFSET(slot) (0x00001210 + (slot) * 0x00000060)
  37. #define NVC5B6_VIDEO_COMPOSITOR_SET_SURFACE1_CHROMA_V_OFFSET(slot) (0x00001214 + (slot) * 0x00000060)
  38. #define NVC5B6_VIDEO_COMPOSITOR_SET_SURFACE2_LUMA_OFFSET(slot) (0x00001218 + (slot) * 0x00000060)
  39. #define NVC5B6_VIDEO_COMPOSITOR_SET_SURFACE2_CHROMA_U_OFFSET(slot) (0x0000121c + (slot) * 0x00000060)
  40. #define NVC5B6_VIDEO_COMPOSITOR_SET_SURFACE2_CHROMA_V_OFFSET(slot) (0x00001220 + (slot) * 0x00000060)
  41. #define NVC5B6_VIDEO_COMPOSITOR_SET_SURFACE3_LUMA_OFFSET(slot) (0x00001224 + (slot) * 0x00000060)
  42. #define NVC5B6_VIDEO_COMPOSITOR_SET_SURFACE3_CHROMA_U_OFFSET(slot) (0x00001228 + (slot) * 0x00000060)
  43. #define NVC5B6_VIDEO_COMPOSITOR_SET_SURFACE3_CHROMA_V_OFFSET(slot) (0x0000122c + (slot) * 0x00000060)
  44. #define NVC5B6_VIDEO_COMPOSITOR_SET_SURFACE4_LUMA_OFFSET(slot) (0x00001230 + (slot) * 0x00000060)
  45. #define NVC5B6_VIDEO_COMPOSITOR_SET_SURFACE4_CHROMA_U_OFFSET(slot) (0x00001234 + (slot) * 0x00000060)
  46. #define NVC5B6_VIDEO_COMPOSITOR_SET_SURFACE4_CHROMA_V_OFFSET(slot) (0x00001238 + (slot) * 0x00000060)
  47. #define NVC5B6_VIDEO_COMPOSITOR_SET_SURFACE5_LUMA_OFFSET(slot) (0x0000123c + (slot) * 0x00000060)
  48. #define NVC5B6_VIDEO_COMPOSITOR_SET_SURFACE5_CHROMA_U_OFFSET(slot) (0x00001240 + (slot) * 0x00000060)
  49. #define NVC5B6_VIDEO_COMPOSITOR_SET_SURFACE5_CHROMA_V_OFFSET(slot) (0x00001244 + (slot) * 0x00000060)
  50. #define NVC5B6_VIDEO_COMPOSITOR_SET_SURFACE6_LUMA_OFFSET(slot) (0x00001248 + (slot) * 0x00000060)
  51. #define NVC5B6_VIDEO_COMPOSITOR_SET_SURFACE6_CHROMA_U_OFFSET(slot) (0x0000124c + (slot) * 0x00000060)
  52. #define NVC5B6_VIDEO_COMPOSITOR_SET_SURFACE6_CHROMA_V_OFFSET(slot) (0x00001250 + (slot) * 0x00000060)
  53. #define NVC5B6_VIDEO_COMPOSITOR_SET_SURFACE7_LUMA_OFFSET(slot) (0x00001254 + (slot) * 0x00000060)
  54. #define NVC5B6_VIDEO_COMPOSITOR_SET_SURFACE7_CHROMA_U_OFFSET(slot) (0x00001258 + (slot) * 0x00000060)
  55. #define NVC5B6_VIDEO_COMPOSITOR_SET_SURFACE7_CHROMA_V_OFFSET(slot) (0x0000125c + (slot) * 0x00000060)
  56. typedef struct {
  57. uint64_t SlotEnable : 1; /* 0 */
  58. uint64_t DeNoise : 1; /* 1 */
  59. uint64_t AdvancedDenoise : 1; /* 2 */
  60. uint64_t CadenceDetect : 1; /* 3 */
  61. uint64_t MotionMap : 1; /* 4 */
  62. uint64_t MMapCombine : 1; /* 5 */
  63. uint64_t IsEven : 1; /* 6 */
  64. uint64_t ChromaEven : 1; /* 7 */
  65. uint64_t CurrentFieldEnable : 1; /* 8 */
  66. uint64_t PrevFieldEnable : 1; /* 9 */
  67. uint64_t NextFieldEnable : 1; /* 10 */
  68. uint64_t NextNrFieldEnable : 1; /* 11 */
  69. uint64_t CurMotionFieldEnable : 1; /* 12 */
  70. uint64_t PrevMotionFieldEnable : 1; /* 13 */
  71. uint64_t PpMotionFieldEnable : 1; /* 14 */
  72. uint64_t CombMotionFieldEnable : 1; /* 15 */
  73. uint64_t FrameFormat : 4; /* 19..16 */
  74. uint64_t FilterLengthY : 2; /* 21..20 */
  75. uint64_t FilterLengthX : 2; /* 23..22 */
  76. uint64_t Panoramic : 12; /* 35..24 */
  77. uint64_t ChromaUpLengthY : 2; /* 37..36 */
  78. uint64_t ChromaUpLengthX : 2; /* 39..38 */
  79. uint64_t reserved1 : 18; /* 57..40 */
  80. uint64_t DetailFltClamp : 6; /* 63..58 */
  81. uint64_t FilterNoise : 10; /* 73..64 */
  82. uint64_t FilterDetail : 10; /* 83..74 */
  83. uint64_t ChromaNoise : 10; /* 93..84 */
  84. uint64_t ChromaDetail : 10; /* 103..94 */
  85. uint64_t DeinterlaceMode : 4; /* 107..104 */
  86. uint64_t MotionAccumWeight : 3; /* 110..108 */
  87. uint64_t NoiseIir : 11; /* 121..111 */
  88. uint64_t LightLevel : 4; /* 125..122 */
  89. uint64_t reserved4 : 2; /* 127..126 */
  90. /* 128 */
  91. uint64_t SoftClampLow : 10; /* 9..0 */
  92. uint64_t SoftClampHigh : 10; /* 19..10 */
  93. uint64_t reserved5 : 12; /* 31..20 */
  94. uint64_t reserved6 : 2; /* 33..32 */
  95. uint64_t PlanarAlpha : 8; /* 41..34 */
  96. uint64_t ConstantAlpha : 1; /* 42 */
  97. uint64_t StereoInterleave : 3; /* 45..43 */
  98. uint64_t ClipEnabled : 1; /* 46 */
  99. uint64_t ClearRectMask : 8; /* 54..47 */
  100. uint64_t DegammaMode : 2; /* 56..55 */
  101. uint64_t reserved7 : 1; /* 57 */
  102. uint64_t DecompressEnable : 1; /* 58 */
  103. uint64_t DecompressKind : 4; /* 62..59 */
  104. uint64_t reserved9 : 1; /* 63 */
  105. uint64_t DecompressCtbCount : 8; /* 71..64 */
  106. uint64_t DecompressZbcColor : 32; /* 103..72 */
  107. uint64_t reserved12 : 24; /* 127..104 */
  108. /* 256 */
  109. uint64_t SourceRectLeft : 30; /* 29..0 */
  110. uint64_t reserved14 : 2; /* 31..30 */
  111. uint64_t SourceRectRight : 30; /* 61..32 */
  112. uint64_t reserved15 : 2; /* 63..62 */
  113. uint64_t SourceRectTop : 30; /* 93..64 */
  114. uint64_t reserved16 : 2; /* 95..94 */
  115. uint64_t SourceRectBottom : 30; /* 125..96 */
  116. uint64_t reserved17 : 2; /* 127..126 */
  117. /* 384 */
  118. uint64_t DestRectLeft : 14; /* 13..0 */
  119. uint64_t reserved18 : 2; /* 15..14 */
  120. uint64_t DestRectRight : 14; /* 29..16 */
  121. uint64_t reserved19 : 2; /* 31..30 */
  122. uint64_t DestRectTop : 14; /* 45..32 */
  123. uint64_t reserved20 : 2; /* 47..46 */
  124. uint64_t DestRectBottom : 14; /* 61..48 */
  125. uint64_t reserved21 : 2; /* 63..62 */
  126. uint64_t B16ScalerEnable : 1; /* 64 */
  127. uint64_t reserved22 : 31; /* 95..65 */
  128. uint64_t reserved23 : 32; /* 127..96 */
  129. } SlotConfig;
  130. typedef struct {
  131. uint64_t SlotPixelFormat : 7; /* 6..0 */
  132. uint64_t SlotChromaLocHORIZ : 2; /* 8..7 */
  133. uint64_t SlotChromaLocVert : 2; /* 10..9 */
  134. uint64_t SlotBlkKind : 4; /* 14..11 */
  135. uint64_t SlotBlkHeight : 4; /* 18..15 */
  136. uint64_t SlotCacheWidth : 3; /* 21..19 */
  137. uint64_t reserved0 : 10; /* 31..22 */
  138. uint64_t SlotSurfaceWidth : 14; /* 45..32 */
  139. uint64_t SlotSurfaceHeight : 14; /* 59..46 */
  140. uint64_t reserved1 : 4; /* 63..60 */
  141. uint64_t SlotLumaWidth : 14; /* 77..64 */
  142. uint64_t SlotLumaHeight : 14; /* 91..78 */
  143. uint64_t reserved2 : 4; /* 95..92 */
  144. uint64_t SlotChromaWidth : 14; /* 109..96 */
  145. uint64_t SlotChromaHeight : 14; /* 123..110 */
  146. uint64_t reserved3 : 4; /* 127..124 */
  147. } SlotSurfaceConfig;
  148. typedef struct {
  149. uint64_t luma_coeff0 : 20; /* 19..0 */
  150. uint64_t luma_coeff1 : 20; /* 39..20 */
  151. uint64_t luma_coeff2 : 20; /* 59..40 */
  152. uint64_t luma_r_shift : 4; /* 63..60 */
  153. uint64_t luma_coeff3 : 20; /* 83..64 */
  154. uint64_t LumaKeyLower : 10; /* 93..84 */
  155. uint64_t LumaKeyUpper : 10; /* 103..94 */
  156. uint64_t LumaKeyEnabled : 1; /* 104 */
  157. uint64_t reserved0 : 2; /* 106..105 */
  158. uint64_t reserved1 : 21; /* 127..107 */
  159. } LumaKeyStruct;
  160. typedef struct {
  161. uint64_t matrix_coeff00 : 20; /* 19..0 */
  162. uint64_t matrix_coeff10 : 20; /* 39..20 */
  163. uint64_t matrix_coeff20 : 20; /* 59..40 */
  164. uint64_t matrix_r_shift : 4; /* 63..60 */
  165. uint64_t matrix_coeff01 : 20; /* 83..64 */
  166. uint64_t matrix_coeff11 : 20; /* 103..84 */
  167. uint64_t matrix_coeff21 : 20; /* 123..104 */
  168. uint64_t reserved0 : 3; /* 126..124 */
  169. uint64_t matrix_enable : 1; /* 127 */
  170. /* 128 */
  171. uint64_t matrix_coeff02 : 20; /* 19..0 */
  172. uint64_t matrix_coeff12 : 20; /* 39..20 */
  173. uint64_t matrix_coeff22 : 20; /* 59..40 */
  174. uint64_t reserved1 : 4; /* 63..60 */
  175. uint64_t matrix_coeff03 : 20; /* 83..64 */
  176. uint64_t matrix_coeff13 : 20; /* 103..84 */
  177. uint64_t matrix_coeff23 : 20; /* 123..104 */
  178. uint64_t reserved2 : 4; /* 127..124 */
  179. } MatrixStruct;
  180. typedef struct {
  181. uint64_t ClearRect0Left : 14; /* 13..0 */
  182. uint64_t reserved0 : 2; /* 15..14 */
  183. uint64_t ClearRect0Right : 14; /* 29..16 */
  184. uint64_t reserved1 : 2; /* 31..30 */
  185. uint64_t ClearRect0Top : 14; /* 45..32 */
  186. uint64_t reserved2 : 2; /* 47..46 */
  187. uint64_t ClearRect0Bottom : 14; /* 61..48 */
  188. uint64_t reserved3 : 2; /* 63..62 */
  189. uint64_t ClearRect1Left : 14; /* 77..64 */
  190. uint64_t reserved4 : 2; /* 79..78 */
  191. uint64_t ClearRect1Right : 14; /* 93..80 */
  192. uint64_t reserved5 : 2; /* 95..94 */
  193. uint64_t ClearRect1Top : 14; /* 109..96 */
  194. uint64_t reserved6 : 2; /* 111..110 */
  195. uint64_t ClearRect1Bottom : 14; /* 125..112 */
  196. uint64_t reserved7 : 2; /* 127..126 */
  197. } ClearRectStruct;
  198. typedef struct {
  199. uint64_t reserved0 : 2; /* 1..0 */
  200. uint64_t AlphaK1 : 8; /* 9..2 */
  201. uint64_t reserved1 : 6; /* 17..10 */
  202. uint64_t AlphaK2 : 8; /* 25..18 */
  203. uint64_t reserved2 : 6; /* 31..26 */
  204. uint64_t SrcFactCMatchSelect : 3; /* 34..32 */
  205. uint64_t reserved3 : 1; /* 35 */
  206. uint64_t DstFactCMatchSelect : 3; /* 38..36 */
  207. uint64_t reserved4 : 1; /* 39 */
  208. uint64_t SrcFactAMatchSelect : 3; /* 42..40 */
  209. uint64_t reserved5 : 1; /* 43 */
  210. uint64_t DstFactAMatchSelect : 3; /* 46..44 */
  211. uint64_t reserved6 : 1; /* 47 */
  212. uint64_t reserved7 : 4; /* 51..48 */
  213. uint64_t reserved8 : 4; /* 55..52 */
  214. uint64_t reserved9 : 4; /* 59..56 */
  215. uint64_t reserved10 : 4; /* 63..60 */
  216. uint64_t reserved11 : 2; /* 65..64 */
  217. uint64_t OverrideR : 10; /* 75..66 */
  218. uint64_t OverrideG : 10; /* 85..76 */
  219. uint64_t OverrideB : 10; /* 95..86 */
  220. uint64_t reserved12 : 2; /* 97..96 */
  221. uint64_t OverrideA : 8; /* 105..98 */
  222. uint64_t reserved13 : 2; /* 107..106 */
  223. uint64_t UseOverrideR : 1; /* 108 */
  224. uint64_t UseOverrideG : 1; /* 109 */
  225. uint64_t UseOverrideB : 1; /* 110 */
  226. uint64_t UseOverrideA : 1; /* 111 */
  227. uint64_t MaskR : 1; /* 112 */
  228. uint64_t MaskG : 1; /* 113 */
  229. uint64_t MaskB : 1; /* 114 */
  230. uint64_t MaskA : 1; /* 115 */
  231. uint64_t reserved14 : 12; /* 127..116 */
  232. } BlendingSlotStruct;
  233. typedef struct {
  234. uint64_t AlphaFillMode : 3; /* 2..0 */
  235. uint64_t AlphaFillSlot : 3; /* 5..3 */
  236. uint64_t reserved0 : 2; /* 6..5 */
  237. uint64_t BackgroundAlpha : 8; /* 15..7 */
  238. uint64_t BackgroundR : 10; /* 25..16 */
  239. uint64_t BackgroundG : 10; /* 35..26 */
  240. uint64_t BackgroundB : 10; /* 45..36 */
  241. uint64_t RegammaMode : 2; /* 47..46 */
  242. uint64_t OutputFlipX : 1; /* 48 */
  243. uint64_t OutputFlipY : 1; /* 49 */
  244. uint64_t OutputTranspose : 1; /* 50 */
  245. uint64_t reserved1 : 1; /* 51 */
  246. uint64_t reserved2 : 12; /* 63..52 */
  247. uint64_t TargetRectLeft : 14; /* 77..64 */
  248. uint64_t reserved3 : 2; /* 79..78 */
  249. uint64_t TargetRectRight : 14; /* 93..80 */
  250. uint64_t reserved4 : 2; /* 95..94 */
  251. uint64_t TargetRectTop : 14; /* 109..96 */
  252. uint64_t reserved5 : 2; /* 111..110 */
  253. uint64_t TargetRectBottom : 14; /* 125..112 */
  254. uint64_t reserved6 : 2; /* 127..126 */
  255. } OutputConfig;
  256. typedef struct {
  257. uint64_t OutPixelFormat : 7; /* 6..0 */
  258. uint64_t OutChromaLocHoriz : 2; /* 8..7 */
  259. uint64_t OutChromaLocVert : 2; /* 10..9 */
  260. uint64_t OutBlkKind : 4; /* 14..11 */
  261. uint64_t OutBlkHeight : 4; /* 18..15 */
  262. uint64_t reserved0 : 3; /* 21..19 */
  263. uint64_t reserved1 : 10; /* 31..22 */
  264. uint64_t OutSurfaceWidth : 14; /* 45..32 */
  265. uint64_t OutSurfaceHeight : 14; /* 59..46 */
  266. uint64_t reserved2 : 4; /* 63..60 */
  267. uint64_t OutLumaWidth : 14; /* 77..64 */
  268. uint64_t OutLumaHeight : 14; /* 91..78 */
  269. uint64_t reserved3 : 4; /* 95..92 */
  270. uint64_t OutChromaWidth : 14; /* 109..96 */
  271. uint64_t OutChromaHeight : 14; /* 123..110 */
  272. uint64_t reserved4 : 4; /* 127..124 */
  273. } OutputSurfaceConfig;
  274. typedef struct {
  275. uint64_t f00 : 10; /* 9..0 */
  276. uint64_t f10 : 10; /* 19..10 */
  277. uint64_t f20 : 10; /* 29..20 */
  278. uint64_t reserved0 : 2; /* 31..30 */
  279. uint64_t f01 : 10; /* 41..32 */
  280. uint64_t f11 : 10; /* 51..42 */
  281. uint64_t f21 : 10; /* 61..52 */
  282. uint64_t reserved1 : 2; /* 63..62 */
  283. uint64_t f02 : 10; /* 73..64 */
  284. uint64_t f12 : 10; /* 83..74 */
  285. uint64_t f22 : 10; /* 93..84 */
  286. uint64_t reserved2 : 2; /* 95..94 */
  287. uint64_t f03 : 10; /* 105..96 */
  288. uint64_t f13 : 10; /* 115..106 */
  289. uint64_t f23 : 10; /* 125..116 */
  290. uint64_t reserved3 : 2; /* 127..126 */
  291. } FilterCoeffStruct;
  292. typedef struct {
  293. uint64_t DownsampleHoriz : 11; /* 10..0 */
  294. uint64_t reserved0 : 5; /* 15..11 */
  295. uint64_t DownsampleVert : 11; /* 26..16 */
  296. uint64_t reserved1 : 5; /* 31..27 */
  297. uint64_t reserved2 : 32; /* 63..32 */
  298. uint64_t reserved3 : 32; /* 95..64 */
  299. uint64_t reserved4 : 32; /* 127..96 */
  300. } PipeConfig;
  301. typedef struct {
  302. uint64_t OldCadence : 32; /* 31..0 */
  303. uint64_t OldDiff : 32; /* 63..32 */
  304. uint64_t OldWeave : 32; /* 95..64 */
  305. uint64_t OlderWeave : 32; /* 127..96 */
  306. } SlotHistoryBuffer;
  307. typedef struct {
  308. uint64_t crc0 : 32; /* 31..0 */
  309. uint64_t crc1 : 32; /* 63..32 */
  310. uint64_t crc2 : 32; /* 95..64 */
  311. uint64_t crc3 : 32; /* 127..96 */
  312. } PartitionCrcStruct;
  313. typedef struct {
  314. uint64_t crc0 : 32; /* 31..0 */
  315. uint64_t crc1 : 32; /* 63..32 */
  316. } SlotCrcStruct;
  317. typedef struct {
  318. uint64_t ErrorStatus : 32; /* 31..0 */
  319. uint64_t CycleCount : 32; /* 63..32 */
  320. uint64_t reserved0 : 32; /* 95..64 */
  321. uint64_t reserved1 : 32; /* 127..96 */
  322. } StatusStruct;
  323. typedef struct {
  324. uint64_t coeff_0 : 10; /* 9..0 */
  325. uint64_t reserved0 : 6; /* 15..10 */
  326. uint64_t coeff_1 : 10; /* 25..16 */
  327. uint64_t reserved1 : 6; /* 31..26 */
  328. uint64_t coeff_2 : 10; /* 41..32 */
  329. uint64_t reserved2 : 6; /* 47..42 */
  330. uint64_t coeff_3 : 10; /* 57..48 */
  331. uint64_t reserved3 : 6; /* 63..58 */
  332. } CoeffPhaseParamStruct;
  333. typedef struct {
  334. uint64_t GeoTranEn : 1; /* 0 */
  335. uint64_t GeoTranMode : 2; /* 2..1 */
  336. uint64_t IPTMode : 1; /* 3 */
  337. uint64_t PixelFilterType : 2; /* 5..4 */
  338. uint64_t PixelFormat : 7; /* 12..6 */
  339. uint64_t CacheWidth : 3; /* 15..13 */
  340. uint64_t SrcBlkKind : 4; /* 19..16 */
  341. uint64_t SrcBlkHeight : 4; /* 23..20 */
  342. uint64_t DestBlkKind : 4; /* 27..24 */
  343. uint64_t DestBlkHeight : 4; /* 31..28 */
  344. uint64_t MskBitMapEn : 1; /* 32 */
  345. uint64_t MaskedPixelFillMode : 1; /* 33 */
  346. uint64_t XSobelMode : 2; /* 35..34 */
  347. uint64_t SubFrameEn : 1; /* 36 */
  348. uint64_t reserved0 : 3; /* 39..37 */
  349. uint64_t XSobelBlkKind : 4; /* 43..40 */
  350. uint64_t XSobelBlkHeight : 4; /* 47..44 */
  351. uint64_t XSobelDSBlkKind : 4; /* 51..48 */
  352. uint64_t XSobelDSBlkHeight : 4; /* 55..52 */
  353. uint64_t reserved1 : 8; /* 63..56 */
  354. uint64_t NonFixedPatchEn : 1; /* 64 */
  355. uint64_t HorRegionNum : 2; /* 66..65 */
  356. uint64_t VerRegionNum : 2; /* 68..67 */
  357. uint64_t reserved2 : 3; /* 71..69 */
  358. uint64_t log2HorSpace_0 : 3; /* 74..72 */
  359. uint64_t log2VerSpace_0 : 3; /* 77..75 */
  360. uint64_t log2HorSpace_1 : 3; /* 80..78 */
  361. uint64_t log2VerSpace_1 : 3; /* 83..81 */
  362. uint64_t log2HorSpace_2 : 3; /* 86..84 */
  363. uint64_t log2VerSpace_2 : 3; /* 89..87 */
  364. uint64_t log2HorSpace_3 : 3; /* 92..90 */
  365. uint64_t log2VerSpace_3 : 3; /* 95..93 */
  366. uint64_t horRegionWidth_0 : 14; /* 109..96 */
  367. uint64_t reserved3 : 2; /* 111..110 */
  368. uint64_t horRegionWidth_1 : 14; /* 125..112 */
  369. uint64_t reserved4 : 2; /* 127..126 */
  370. uint64_t horRegionWidth_2 : 14; /* 141..128 */
  371. uint64_t reserved5 : 2; /* 143..142 */
  372. uint64_t horRegionWidth_3 : 14; /* 157..144 */
  373. uint64_t reserved6 : 2; /* 159..158 */
  374. uint64_t verRegionHeight_0 : 14; /* 173..160 */
  375. uint64_t reserved7 : 2; /* 175..174 */
  376. uint64_t verRegionHeight_1 : 14; /* 189..176 */
  377. uint64_t reserved8 : 2; /* 191..190 */
  378. uint64_t verRegionHeight_2 : 14; /* 205..192 */
  379. uint64_t reserved9 : 2; /* 207..206 */
  380. uint64_t verRegionHeight_3 : 14; /* 221..208 */
  381. uint64_t reserved10 : 2; /* 223..222 */
  382. uint64_t IPT_M11 : 32; /* 255..224 */
  383. uint64_t IPT_M12 : 32; /* 287..256 */
  384. uint64_t IPT_M13 : 32; /* 319..288 */
  385. uint64_t IPT_M21 : 32; /* 351..320 */
  386. uint64_t IPT_M22 : 32; /* 383..352 */
  387. uint64_t IPT_M23 : 32; /* 415..384 */
  388. uint64_t IPT_M31 : 32; /* 447..416 */
  389. uint64_t IPT_M32 : 32; /* 479..448 */
  390. uint64_t IPT_M33 : 32; /* 511..480 */
  391. uint64_t SourceRectLeft : 14; /* 525..512 */
  392. uint64_t reserved11 : 2; /* 527..526 */
  393. uint64_t SourceRectRight : 14; /* 541..528 */
  394. uint64_t reserved12 : 2; /* 543..542 */
  395. uint64_t SourceRectTop : 14; /* 557..544 */
  396. uint64_t reserved13 : 2; /* 559..558 */
  397. uint64_t SourceRectBottom : 14; /* 573..560 */
  398. uint64_t reserved14; /* 575..574 */
  399. uint64_t SrcImgWidth : 14; /* 589..576 */
  400. uint64_t reserved15 : 2; /* 591..590 */
  401. uint64_t SrcImgHeight : 14; /* 605..592 */
  402. uint64_t reserved16 : 2; /* 607..606 */
  403. uint64_t SrcSfcLumaWidth : 14; /* 621..608 */
  404. uint64_t reserved17 : 2; /* 623..622 */
  405. uint64_t SrcSfcLumaHeight : 14; /* 637..624 */
  406. uint64_t reserved18 : 2; /* 639..638 */
  407. uint64_t SrcSfcChromaWidth : 14; /* 653..640 */
  408. uint64_t reserved19 : 2; /* 655..654 */
  409. uint64_t SrcSfcChromaHeight : 14; /* 669..656 */
  410. uint64_t reserved20 : 2; /* 671..670 */
  411. uint64_t DestRectLeft : 14; /* 685..672 */
  412. uint64_t reserved21 : 2; /* 687..686 */
  413. uint64_t DestRectRight : 14; /* 701..688 */
  414. uint64_t reserved22 : 2; /* 703..702 */
  415. uint64_t DestRectTop : 14; /* 717..704 */
  416. uint64_t reserved23 : 2; /* 719..718 */
  417. uint64_t DestRectBottom : 14; /* 733..720 */
  418. uint64_t reserved24 : 2; /* 735..734 */
  419. uint64_t SubFrameRectTop : 14; /* 749..736 */
  420. uint64_t reserved25 : 2; /* 751..750 */
  421. uint64_t SubFrameRectBottom : 14; /* 765..752 */
  422. uint64_t reserved26 : 2; /* 767..766 */
  423. uint64_t DestSfcLumaWidth : 14; /* 781..768 */
  424. uint64_t reserved27 : 2; /* 783..782 */
  425. uint64_t DestSfcLumaHeight : 14; /* 797..784 */
  426. uint64_t reserved28 : 2; /* 799..798 */
  427. uint64_t DestSfcChromaWidth : 14; /* 813..800 */
  428. uint64_t reserved29 : 2; /* 815..814 */
  429. uint64_t DestSfcChromaHeight : 14; /* 829..816 */
  430. uint64_t reserved30 : 2; /* 831..830 */
  431. uint64_t SparseWarpMapWidth : 14; /* 845..832 */
  432. uint64_t reserved31 : 2; /* 847..846 */
  433. uint64_t SparseWarpMapHeight : 14; /* 861..848 */
  434. uint64_t reserved32 : 2; /* 863..862 */
  435. uint64_t SparseWarpMapStride : 14; /* 877..864 */
  436. uint64_t reserved33 : 2; /* 879..878 */
  437. uint64_t MaskBitMapWidth : 14; /* 893..880 */
  438. uint64_t reserved34 : 2; /* 895..894 */
  439. uint64_t MaskBitMapHeight : 14; /* 909..896 */
  440. uint64_t reserved35 : 2; /* 911..910 */
  441. uint64_t MaskBitMapStride : 14; /* 925..912 */
  442. uint64_t reserved36 : 2; /* 927..926 */
  443. uint64_t XSobelWidth : 14; /* 941..928 */
  444. uint64_t reserved37 : 2; /* 943..942 */
  445. uint64_t XSobelHeight : 14; /* 957..944 */
  446. uint64_t reserved38 : 2; /* 959..958 */
  447. uint64_t XSobelStride : 14; /* 973..960 */
  448. uint64_t reserved39 : 2; /* 975..974 */
  449. uint64_t DSStride : 14; /* 989..976 */
  450. uint64_t reserved40 : 2; /* 991..990 */
  451. uint64_t XSobelTopOffset : 32; /* 1023..992 */
  452. uint64_t reserved41 : 32; /* 1055..1024 */
  453. uint64_t maskY : 16; /* 1071..1056 */
  454. uint64_t maskU : 16; /* 1087..1072 */
  455. uint64_t maskV : 16; /* 1103..1088 */
  456. uint64_t reserved42 : 16; /* 1119..1104 */
  457. } GeoTranConfigParamStruct;
  458. typedef struct {
  459. uint64_t TNR3En : 1; /* 0 */
  460. uint64_t BetaBlendingEn : 1; /* 1 */
  461. uint64_t AlphaBlendingEn : 1; /* 2 */
  462. uint64_t AlphaSmoothEn : 1; /* 3 */
  463. uint64_t TempAlphaRestrictEn : 1; /* 4 */
  464. uint64_t AlphaClipEn : 1; /* 5 */
  465. uint64_t BFRangeEn : 1; /* 6 */
  466. uint64_t BFDomainEn : 1; /* 7 */
  467. uint64_t BFRangeLumaShift : 4; /* 11..8 */
  468. uint64_t BFRangeChromaShift : 4; /* 15..12 */
  469. uint64_t SADMultiplier : 6; /* 21..16 */
  470. uint64_t reserved1 : 2; /* 23..22 */
  471. uint64_t SADWeightLuma : 6; /* 29..24 */
  472. uint64_t reserved2 : 2; /* 31..30 */
  473. uint64_t TempAlphaRestrictIncCap : 11; /* 42..32 */
  474. uint64_t reserved3 : 5; /* 47..43 */
  475. uint64_t AlphaScaleIIR : 11; /* 58..48 */
  476. uint64_t reserved4 : 5; /* 63..59 */
  477. uint64_t AlphaClipMaxLuma : 11; /* 74..64 */
  478. uint64_t reserved5 : 5; /* 79..75 */
  479. uint64_t AlphaClipMinLuma : 11; /* 90..80 */
  480. uint64_t reserved6 : 5; /* 95..91 */
  481. uint64_t AlphaClipMaxChroma : 11; /* 106..96 */
  482. uint64_t reserved7 : 5; /* 111..107 */
  483. uint64_t AlphaClipMinChroma : 11; /* 122..112 */
  484. uint64_t reserved8 : 5; /* 127..123 */
  485. uint64_t BetaCalcMaxBeta : 11; /* 138..128 */
  486. uint64_t reserved9 : 5; /* 143..139 */
  487. uint64_t BetaCalcMinBeta : 11; /* 154..144 */
  488. uint64_t reserved10 : 5; /* 159..155 */
  489. uint64_t BetaCalcBetaX1 : 11; /* 170..160 */
  490. uint64_t reserved11 : 5; /* 175..171 */
  491. uint64_t BetaCalcBetaX2 : 11; /* 186..176 */
  492. uint64_t reserved12 : 5; /* 191..187 */
  493. uint64_t BetaCalcStepBeta : 11; /* 202..192 */
  494. uint64_t reserved13 : 5; /* 207..203 */
  495. uint64_t reserved14 : 16; /* 223..208 */
  496. uint64_t BFDomainLumaCoeffC00 : 7; /* 230..224 */
  497. uint64_t reserved15 : 1; /* 231 */
  498. uint64_t BFDomainLumaCoeffC01 : 7; /* 238..232 */
  499. uint64_t reserved16 : 1; /* 239 */
  500. uint64_t BFDomainLumaCoeffC02 : 7; /* 246..240 */
  501. uint64_t reserved17 : 1; /* 247 */
  502. uint64_t BFDomainLumaCoeffC11 : 7; /* 254..248 */
  503. uint64_t reserved18 : 1; /* 255 */
  504. uint64_t BFDomainLumaCoeffC12 : 7; /* 262..256 */
  505. uint64_t reserved19 : 1; /* 263 */
  506. uint64_t BFDomainLumaCoeffC22 : 7; /* 270..264 */
  507. uint64_t reserved20 : 1; /* 271 */
  508. uint64_t reserved21 : 16; /* 287..272 */
  509. uint64_t BFDomainChromaCoeffC00 : 7; /* 294..288 */
  510. uint64_t reserved22 : 1; /* 295 */
  511. uint64_t BFDomainChromaCoeffC01 : 7; /* 302..296 */
  512. uint64_t reserved23 : 1; /* 303 */
  513. uint64_t BFDomainChromaCoeffC02 : 7; /* 310..304 */
  514. uint64_t reserved24 : 1; /* 311 */
  515. uint64_t BFDomainChromaCoeffC11 : 7; /* 318..312 */
  516. uint64_t reserved25 : 1; /* 319 */
  517. uint64_t BFDomainChromaCoeffC12 : 7; /* 326..320 */
  518. uint64_t reserved26 : 1; /* 327 */
  519. uint64_t BFDomainChromaCoeffC22 : 7; /* 334..328 */
  520. uint64_t reserved27 : 1; /* 335 */
  521. uint64_t reserved28 : 16; /* 351..336 */
  522. uint64_t LeftBufSize : 32; /* 383..352 */
  523. uint64_t TopBufSize : 32; /* 415..384 */
  524. uint64_t AlphaSufStride : 14; /* 429..416 */
  525. uint64_t reserved29 : 18; /* 447..430 */
  526. } TNR3ConfigParamStruct;
  527. typedef struct {
  528. uint64_t item0 : 7; /* 6..0 */
  529. uint64_t reserved0 : 9; /* 15..7 */
  530. uint64_t item1 : 7; /* 22..16 */
  531. uint64_t reserved1 : 9; /* 31..23 */
  532. uint64_t item2 : 7; /* 38..32 */
  533. uint64_t reserved2 : 9; /* 47..39 */
  534. uint64_t item3 : 7; /* 54..48 */
  535. uint64_t reserved3 : 9; /* 63..55 */
  536. } BFRangeTableItems;
  537. typedef struct {
  538. SlotConfig slotConfig;
  539. SlotSurfaceConfig slotSurfaceConfig;
  540. LumaKeyStruct lumaKeyStruct;
  541. MatrixStruct colorMatrixStruct;
  542. MatrixStruct gamutMatrixStruct;
  543. BlendingSlotStruct blendingSlotStruct;
  544. } SlotStruct;
  545. typedef struct {
  546. FilterCoeffStruct filterCoeffStruct[520];
  547. } FilterStruct;
  548. typedef struct {
  549. PipeConfig pipeConfig;
  550. OutputConfig outputConfig;
  551. OutputSurfaceConfig outputSurfaceConfig;
  552. MatrixStruct outColorMatrixStruct;
  553. ClearRectStruct clearRectStruct[4];
  554. SlotStruct slotStruct[16];
  555. } ConfigStruct;
  556. typedef struct {
  557. PartitionCrcStruct partitionCrcStruct[2];
  558. } InterfaceCrcStruct;
  559. typedef struct {
  560. SlotCrcStruct slotCrcStruct[16];
  561. } InputCrcStruct;
  562. typedef struct {
  563. GeoTranConfigParamStruct paramConfig;
  564. CoeffPhaseParamStruct FilterCoeff[17];
  565. TNR3ConfigParamStruct tnr3Config;
  566. BFRangeTableItems BFRangeTableLuma[16];
  567. BFRangeTableItems BFRangeTableChroma[16];
  568. } GeoTranConfigStruct;
  569. #endif