summaryrefslogtreecommitdiff
path: root/src/gen9_hevc_enc_kernels.h
blob: ea2abe792a0a644b9f24eaf30eab2316ee9d6f0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
/*
 * Copyright © 2017 Intel Corporation
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sub license, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice (including the
 * next paragraph) shall be included in all copies or substantial portions
 * of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
 * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWAR OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 * Authors:
 *    Chen, Peng <chen.c.peng@intel.com>
 *
 */

#ifndef GEN9_HEVC_ENCODER_KERNELS_H
#define GEN9_HEVC_ENCODER_KERNELS_H

// Scaling kernel parameters
typedef enum _gen9_hevc_binding_table_offset_scaling {
    GEN9_HEVC_SCALING_FRAME_SRC_Y_INDEX                      = 0,
    GEN9_HEVC_SCALING_FRAME_DST_Y_INDEX                      = 1,
    GEN9_HEVC_SCALING_FRAME_MBVPROCSTATS_DST_INDEX           = 4,
    GEN9_HEVC_SCALING_NUM_SURFACES                           = 6
} gen9_hevc_binding_table_offset_scaling;

typedef struct _gen9_hevc_scaling4x_curbe_data {
    struct {
        unsigned int   input_picture_width  : 16;
        unsigned int   input_picture_height : 16;
    } dw0;

    struct {
        unsigned int   input_y_bti;
    } dw1;

    struct {
        unsigned int   output_y_bti;
    } dw2;

    struct {
        unsigned int reserved;
    } dw3;

    struct {
        unsigned int reserved;
    } dw4;

    struct {
        unsigned int flatness_threshold;
    } dw5;

    struct {
        unsigned int enable_mb_flatness_check;
    } dw6;

    struct {
        unsigned int enable_mb_variance_output;
    } dw7;

    struct {
        unsigned int enable_mb_pixel_average_output;
    } dw8;

    struct {
        unsigned int reserved;
    } dw9;

    struct {
        unsigned int mbv_proc_stat_bti;
    } dw10;

    struct {
        unsigned int reserved;
    } dw11;
} gen9_hevc_scaling4x_curbe_data;

typedef struct _gen9_hevc_scaling2x_curbe_data {
    struct {
        unsigned int   input_picture_width  : 16;
        unsigned int   input_picture_height : 16;
    } dw0;

    /* dw1-dw7 */
    unsigned int reserved1[7];

    struct {
        unsigned int input_y_bti;
    } dw8;

    struct {
        unsigned int output_y_bti;
    } dw9;
} gen9_hevc_scaling2x_curbe_data;

// ME kernel parameters
typedef enum _gen9_hevc_binding_table_offset_me {
    GEN9_HEVC_ME_MV_DATA_SURFACE_INDEX       = 0,
    GEN9_HEVC_ME_16X_MV_DATA_SURFACE_INDEX   = 1,
    GEN9_HEVC_ME_32X_MV_DATA_SURFACE_INDEX   = 1,
    GEN9_HEVC_ME_DISTORTION_SURFACE_INDEX    = 2,
    GEN9_HEVC_ME_BRC_DISTORTION_INDEX        = 3,
    GEN9_HEVC_ME_RESERVED0_INDEX             = 4,
    GEN9_HEVC_ME_CURR_FOR_FWD_REF_INDEX      = 5,
    GEN9_HEVC_ME_FWD_REF_IDX0_INDEX          = 6,
    GEN9_HEVC_ME_RESERVED1_INDEX             = 7,
    GEN9_HEVC_ME_FWD_REF_IDX1_INDEX          = 8,
    GEN9_HEVC_ME_RESERVED2_INDEX             = 9,
    GEN9_HEVC_ME_FWD_REF_IDX2_INDEX          = 10,
    GEN9_HEVC_ME_RESERVED3_INDEX             = 11,
    GEN9_HEVC_ME_FWD_REF_IDX3_INDEX          = 12,
    GEN9_HEVC_ME_RESERVED4_INDEX             = 13,
    GEN9_HEVC_ME_FWD_REF_IDX4_INDEX          = 14,
    GEN9_HEVC_ME_RESERVED5_INDEX             = 15,
    GEN9_HEVC_ME_FWD_REF_IDX5_INDEX          = 16,
    GEN9_HEVC_ME_RESERVED6_INDEX             = 17,
    GEN9_HEVC_ME_FWD_REF_IDX6_INDEX          = 18,
    GEN9_HEVC_ME_RESERVED7_INDEX             = 19,
    GEN9_HEVC_ME_FWD_REF_IDX7_INDEX          = 20,
    GEN9_HEVC_ME_RESERVED8_INDEX             = 21,
    GEN9_HEVC_ME_CURR_FOR_BWD_REF_INDEX      = 22,
    GEN9_HEVC_ME_BWD_REF_IDX0_INDEX          = 23,
    GEN9_HEVC_ME_RESERVED9_INDEX             = 24,
    GEN9_HEVC_ME_BWD_REF_IDX1_INDEX          = 25,
    GEN9_HEVC_ME_VDENC_STREAMIN_INDEX        = 26,
    GEN9_HEVC_ME_NUM_SURFACES_INDEX          = 27
} gen9_hevc_binding_table_offset_me;

struct gen9_search_path_delta {
    char gen9_search_path_delta_x: 4;
    char gen9_search_path_delta_y: 4;
};

typedef struct _gen9_hevc_me_curbe_data {
    struct {
        unsigned int skip_mode_enable: 1;
        unsigned int adaptive_enable: 1;
        unsigned int bi_mix_dis: 1;
        unsigned int reserved0: 2;
        unsigned int early_ime_success_enable: 1;
        unsigned int reserved1: 1;
        unsigned int t8x8_flag_for_inter_enable: 1;
        unsigned int reserved2: 16;
        unsigned int early_ime_stop: 8;
    } dw0;

    struct {
        unsigned int max_num_mvs: 6;
        unsigned int reserved0: 10;
        unsigned int bi_weight: 6;
        unsigned int reserved1: 6;
        unsigned int uni_mix_disable: 1;
        unsigned int reserved2: 3;
    } dw1;

    struct {
        unsigned int max_len_sp: 8;
        unsigned int max_num_su: 8;
        unsigned int reserved0: 16;
    } dw2;

    struct {
        unsigned int src_size: 2;
        unsigned int reserved0: 2;
        unsigned int mb_type_remap: 2;
        unsigned int src_access: 1;
        unsigned int ref_access: 1;
        unsigned int search_ctrl: 3;
        unsigned int dual_search_path_option: 1;
        unsigned int sub_pel_mode: 2;
        unsigned int skip_type: 1;
        unsigned int disable_field_cache_allocation: 1;
        unsigned int inter_chroma_mode: 1;
        unsigned int ft_enable: 1;
        unsigned int bme_disable_fbr: 1;
        unsigned int block_based_skip_enable: 1;
        unsigned int inter_sad: 2;
        unsigned int intra_sad: 2;
        unsigned int sub_mb_part_mask: 7;
        unsigned int reserved1: 1;
    } dw3;

    struct {
        unsigned int reserved0: 8;
        unsigned int picture_height_minus1: 8;
        unsigned int picture_width: 8;
        unsigned int reserved1: 8;
    } dw4;

    struct {
        unsigned int reserved0: 8;
        unsigned int qp_prime_y: 8;
        unsigned int ref_width: 8;
        unsigned int ref_height: 8;
    } dw5;

    struct {
        unsigned int reserved0: 3;
        unsigned int write_distortions: 1;
        unsigned int use_mv_from_prev_step: 1;
        unsigned int reserved1: 3;
        unsigned int super_combine_dist: 8;
        unsigned int max_vmvr: 16;
    } dw6;

    struct {
        unsigned int reserved0: 16;
        unsigned int mv_cost_scale_factor: 2;
        unsigned int bilinear_enable: 1;
        unsigned int src_field_polarity: 1;
        unsigned int weightedsad_harr: 1;
        unsigned int ac_only_haar: 1;
        unsigned int ref_id_cost_mode: 1;
        unsigned int reserved1: 1;
        unsigned int skip_center_mask: 8;
    } dw7;

    struct {
        unsigned int mode_0_cost: 8;
        unsigned int mode_1_cost: 8;
        unsigned int mode_2_cost: 8;
        unsigned int mode_3_cost: 8;
    } dw8;

    struct {
        unsigned int mode_4_cost: 8;
        unsigned int mode_5_cost: 8;
        unsigned int mode_6_cost: 8;
        unsigned int mode_7_cost: 8;
    } dw9;

    struct {
        unsigned int mode_8_cost: 8;
        unsigned int mode_9_cost: 8;
        unsigned int ref_id_cost: 8;
        unsigned int chroma_intra_mode_cost: 8;
    } dw10;

    struct {
        unsigned int mv_0_cost: 8;
        unsigned int mv_1_cost: 8;
        unsigned int mv_2_cost: 8;
        unsigned int mv_3_cost: 8;
    } dw11;

    struct {
        unsigned int mv_4_cost: 8;
        unsigned int mv_5_cost: 8;
        unsigned int mv_6_cost: 8;
        unsigned int mv_7_cost: 8;
    } dw12;

    struct {
        unsigned int num_ref_idx_l0_minus1: 8;
        unsigned int num_ref_idx_l1_minus1: 8;
        unsigned int ref_streamin_cost: 8;
        unsigned int roi_enable: 3;
        unsigned int reserved0: 5;
    } dw13;

    struct {
        unsigned int l0_ref_pic_polarity_bits: 8;
        unsigned int l1_ref_pic_polarity_bits: 2;
        unsigned int reserved: 22;
    } dw14;

    struct {
        unsigned int prev_mv_read_pos_factor : 8;
        unsigned int mv_shift_factor : 8;
        unsigned int reserved: 16;
    } dw15;

    struct {
        struct gen9_search_path_delta sp_delta_0;
        struct gen9_search_path_delta sp_delta_1;
        struct gen9_search_path_delta sp_delta_2;
        struct gen9_search_path_delta sp_delta_3;
    } dw16;

    struct {
        struct gen9_search_path_delta sp_delta_4;
        struct gen9_search_path_delta sp_delta_5;
        struct gen9_search_path_delta sp_delta_6;
        struct gen9_search_path_delta sp_delta_7;
    } dw17;

    struct {
        struct gen9_search_path_delta sp_delta_8;
        struct gen9_search_path_delta sp_delta_9;
        struct gen9_search_path_delta sp_delta_10;
        struct gen9_search_path_delta sp_delta_11;
    } dw18;

    struct {
        struct gen9_search_path_delta sp_delta_12;
        struct gen9_search_path_delta sp_delta_13;
        struct gen9_search_path_delta sp_delta_14;
        struct gen9_search_path_delta sp_delta_15;
    } dw19;

    struct {
        struct gen9_search_path_delta sp_delta_16;
        struct gen9_search_path_delta sp_delta_17;
        struct gen9_search_path_delta sp_delta_18;
        struct gen9_search_path_delta sp_delta_19;
    } dw20;

    struct {
        struct gen9_search_path_delta sp_delta_20;
        struct gen9_search_path_delta sp_delta_21;
        struct gen9_search_path_delta sp_delta_22;
        struct gen9_search_path_delta sp_delta_23;
    } dw21;

    struct {
        struct gen9_search_path_delta sp_delta_24;
        struct gen9_search_path_delta sp_delta_25;
        struct gen9_search_path_delta sp_delta_26;
        struct gen9_search_path_delta sp_delta_27;
    } dw22;

    struct {
        struct gen9_search_path_delta sp_delta_28;
        struct gen9_search_path_delta sp_delta_29;
        struct gen9_search_path_delta sp_delta_30;
        struct gen9_search_path_delta sp_delta_31;
    } dw23;

    struct {
        struct gen9_search_path_delta sp_delta_32;
        struct gen9_search_path_delta sp_delta_33;
        struct gen9_search_path_delta sp_delta_34;
        struct gen9_search_path_delta sp_delta_35;
    } dw24;

    struct {
        struct gen9_search_path_delta sp_delta_36;
        struct gen9_search_path_delta sp_delta_37;
        struct gen9_search_path_delta sp_delta_38;
        struct gen9_search_path_delta sp_delta_39;
    } dw25;

    struct {
        struct gen9_search_path_delta sp_delta_40;
        struct gen9_search_path_delta sp_delta_41;
        struct gen9_search_path_delta sp_delta_42;
        struct gen9_search_path_delta sp_delta_43;
    } dw26;

    struct {
        struct gen9_search_path_delta sp_delta_44;
        struct gen9_search_path_delta sp_delta_45;
        struct gen9_search_path_delta sp_delta_46;
        struct gen9_search_path_delta sp_delta_47;
    } dw27;

    struct {
        struct gen9_search_path_delta sp_delta_48;
        struct gen9_search_path_delta sp_delta_49;
        struct gen9_search_path_delta sp_delta_50;
        struct gen9_search_path_delta sp_delta_51;
    } dw28;

    struct {
        struct gen9_search_path_delta sp_delta_52;
        struct gen9_search_path_delta sp_delta_53;
        struct gen9_search_path_delta sp_delta_54;
        struct gen9_search_path_delta sp_delta_55;
    } dw29;

    struct {
        unsigned int actual_mb_width: 16;
        unsigned int actual_mb_height: 16;
    } dw30;

    struct {
        unsigned int reserved0;
    } dw31;

    struct {
        unsigned int _4x_memv_output_data_surf_index;
    } dw32;

    struct {
        unsigned int _16x_32x_memv_input_data_surf_index;
    } dw33;

    struct {
        unsigned int _4x_me_output_dist_surf_index;
    } dw34;

    struct {
        unsigned int _4x_me_output_brc_dist_surf_index;
    } dw35;

    struct {
        unsigned int vme_fwd_inter_pred_surf_index;
    } dw36;

    struct {
        unsigned int vme_bdw_inter_pred_surf_index;
    } dw37;

    struct {
        unsigned int vdenc_stream_in_surf_index;
    } dw38;
} gen9_hevc_me_curbe_data;

// MBENC kernel paramerters

typedef struct _gen9_hevc_mbenc_control_region {
    unsigned short reserved0[2];
    unsigned short start_y_current_slice;
    unsigned short start_y_next_slice;
    unsigned short x_offset;
    unsigned short reserved1[2];
    unsigned short y_offset;
    unsigned int reserverd2[4];
    unsigned int alignment[8];
} gen9_hevc_mbenc_control_region;

#define GEN9_HEVC_ENC_REGION_START_Y_OFFSET                  (32)
#define GEN9_HEVC_ENC_CONCURRENT_SURFACE_HEIGHT              (32)

typedef struct _gen9_hevc_mbenc_downscaling2x_curbe_data {
    struct {
        unsigned int pic_width: 16;
        unsigned int pic_height: 16;
    } dw0;

    struct {
        unsigned int reserved;
    } dw1;

    struct {
        unsigned int reserved;
    } dw2;

    struct {
        unsigned int reserved;
    } dw3;

    struct {
        unsigned int  reserved;
    } dw4;

    struct {
        unsigned int reserved;
    } dw5;

    struct {
        unsigned int reserved;
    } dw6;

    struct {
        unsigned int reserved;
    } dw7;

    struct {
        unsigned int bti_src_y;
    } dw8;

    struct {
        unsigned int bit_dst_y;
    } dw9;
} gen9_hevc_mbenc_downscaling2x_curbe_data;

typedef struct _gen9_hevc_mbenc_32x32_pu_mode_curbe_data {
    struct {
        unsigned int frame_width: 16;
        unsigned int frame_height: 16;
    } dw0;

    struct {
        unsigned int slice_type: 2;
        unsigned int pu_type: 2;
        unsigned int reserved0: 1;
        unsigned int lcu_type: 1;
        unsigned int reserverd1: 18;
        unsigned int brc_enable: 1;
        unsigned int lcu_brc_enable: 1;
        unsigned int roi_enable: 1;
        unsigned int fast_surveillance_flag: 1;
        unsigned int reserverd2: 3;
        unsigned int enable_debug_dump: 1;
    } dw1;

    struct {
        unsigned int lambda;
    } dw2;

    struct {
        unsigned int mode_cost_32x32;
    } dw3;

    struct {
        unsigned int early_exit;
    } dw4;

    struct {
        unsigned int reserved;
    } dw5;

    struct {
        unsigned int reserved;
    } dw6;

    struct {
        unsigned int reserved;
    } dw7;

    struct {
        unsigned int bti_32x32_pu_output;
    } dw8;

    struct {
        unsigned int bti_src_y;
    } dw9;

    struct {
        unsigned int bti_src_y2x;
    } dw10;

    struct {
        unsigned int bti_slice_map;
    } dw11;

    struct {
        unsigned int bti_src_y2x_vme;
    } dw12;

    struct {
        unsigned int bti_brc_input;
    } dw13;

    struct {
        unsigned int bti_lcu_qp_surface;
    } dw14;

    struct {
        unsigned int bti_brc_data;
    } dw15;

    struct {
        unsigned int bti_kernel_debug;
    } dw16;
} gen9_hevc_mbenc_32x32_pu_mode_curbe_data;

typedef struct _gen9_hevc_mbenc_16x16_sad_curbe_data {
    struct {
        unsigned int frame_width: 16;
        unsigned int frame_height: 16;
    } dw0;

    struct {
        unsigned int log2_max_cu_size: 8;
        unsigned int log2_min_cu_size: 8;
        unsigned int log2_min_tu_size: 8;
        unsigned int enable_intra_early_exit: 1;
        unsigned int reserved: 7;
    } dw1;

    struct {
        unsigned int slice_type: 2;
        unsigned int sim_flag_for_inter: 1;
        unsigned int fast_surveillance_flag: 1;
        unsigned int reserved: 28;
    } dw2;

    struct {
        unsigned int reserved;
    } dw3;

    struct {
        unsigned int reserved;
    } dw4;

    struct {
        unsigned int reserved;
    } dw5;

    struct {
        unsigned int reserved;
    } dw6;

    struct {
        unsigned int reserved;
    } dw7;

    struct {
        unsigned int bti_src_y;
    } dw8;

    struct {
        unsigned int bti_sad_16x16_pu_output;
    } dw9;

    struct {
        unsigned int bti_32x32_pu_mode_decision;
    } dw10;

    struct {
        unsigned int bti_slice_map;
    } dw11;

    struct {
        unsigned int bti_simplest_intra;
    } dw12;

    struct {
        unsigned int bti_debug;
    } dw13;
} gen9_hevc_mbenc_16x16_sad_curbe_data;

typedef struct _gen9_hevc_enc_16x16_pu_curbe_data {
    struct {
        unsigned int frame_width: 16;
        unsigned int frame_height: 16;
    } dw0;

    struct {
        unsigned int log2_max_cu_size: 8;
        unsigned int log2_min_cu_size: 8;
        unsigned int log2_min_tu_size: 8;
        unsigned int slice_qp: 8;
    } dw1;

    struct {
        unsigned int fixed_point_lambda_pred_mode;
    } dw2;

    struct {
        unsigned int lambda_scaling_factor: 8;
        unsigned int slice_type: 2;
        unsigned int reserved0: 6;
        unsigned int widi_intra_refresh_en: 2;
        unsigned int enable_rolling_intra: 1;
        unsigned int half_update_mixed_lcu: 1;
        unsigned int reserved1: 4;
        unsigned int enable_intra_early_exit: 1;
        unsigned int brc_enable: 1;
        unsigned int lcu_brc_enable: 1;
        unsigned int roi_enable: 1;
        unsigned int fast_surveillance_flag: 1;
        unsigned int reserved2: 3;
    } dw3;

    struct {
        unsigned int penalty_for_intra_8x8_non_dc_pred_mode: 8;
        unsigned int intra_compute_type: 8;
        unsigned int avc_intra_8x8_mask: 8;
        unsigned int intra_sad_adjust: 8;
    } dw4;

    struct {
        unsigned int fixed_point_lambda_cu_mode_for_cost_calculation;
    } dw5;

    struct {
        unsigned int screen_content_flag: 1;
        unsigned int reserved: 31;
    } dw6;

    struct {
        unsigned int mode_cost_intra_non_pred: 8;
        unsigned int mode_cost_intra_16x16: 8;
        unsigned int mode_cost_intra_8x8: 8;
        unsigned int mode_cost_intra_4x4: 8;
    } dw7;

    struct {
        unsigned int fixed_point_lambda_cu_mode_for_luma;
    } dw8;

    struct {
        unsigned int widi_intra_refresh_mb_num: 16;
        unsigned int widi_intra_refresh_unit_in_mb: 8;
        unsigned int widi_intra_refresh_qp_delta: 8;
    } dw9;

    struct {
        unsigned int haar_transform_mode: 2;
        unsigned int simplified_flag_for_inter: 1;
        unsigned int reserved: 29;
    } dw10;

    struct {
        unsigned int reserved;
    } dw11;

    struct {
        unsigned int reserved;
    } dw12;

    struct {
        unsigned int reserved;
    } dw13;

    struct {
        unsigned int reserved;
    } dw14;

    struct {
        unsigned int reserved;
    } dw15;

    struct {
        unsigned int bti_src_y;
    } dw16;

    struct {
        unsigned int bti_sad_16x16_pu;
    } dw17;

    struct {
        unsigned int bti_pak_object;
    } dw18;

    struct {
        unsigned int bti_sad_32x32_pu_mode;
    } dw19;

    struct {
        unsigned int bti_vme_mode_8x8;
    } dw20;

    struct {
        unsigned int bti_slice_map;
    } dw21;

    struct {
        unsigned int bti_vme_src;
    } dw22;

    struct {
        unsigned int bti_brc_input;
    } dw23;

    struct {
        unsigned int bti_simplest_intra;
    } dw24;

    struct {
        unsigned int bti_lcu_qp_surface;
    } dw25;


    struct {
        unsigned int bti_brc_data;
    } dw26;

    struct {
        unsigned int bti_debug;
    } dw27;
} gen9_hevc_enc_16x16_pu_curbe_data;

typedef struct _gen9_hevc_mbenc_8x8_pu_curbe_data {
    struct {
        unsigned int frame_width: 16;
        unsigned int frame_height: 16;
    } dw0;

    struct {
        unsigned int slice_type: 2;
        unsigned int pu_type: 2;
        unsigned int dc_filter_flag: 1;
        unsigned int angle_refine_flag: 1;
        unsigned int lcu_type: 1;
        unsigned int screen_content_flag: 1;
        unsigned int widi_intra_refresh_en: 2;
        unsigned int enable_rolling_intra: 1;
        unsigned int half_update_mixed_lcu: 1;
        unsigned int reserved0: 4;
        unsigned int qp_value: 8;
        unsigned int enable_intra_early_exit: 1;
        unsigned int brc_enable: 1;
        unsigned int lcu_brc_enable: 1;
        unsigned int roi_enable: 1;
        unsigned int fast_surveillance_flag: 1;
        unsigned int reserved1: 2;
        unsigned int enable_debug_dump: 1;
    } dw1;

    struct {
        unsigned int luma_lambda;
    } dw2;

    struct {
        unsigned int chroma_lambda;
    } dw3;

    struct {
        unsigned int harr_trans_form_flag: 2;
        unsigned int simplified_flag_for_inter: 1;
        unsigned int reserved: 29;
    } dw4;

    struct {
        unsigned int widi_intra_refresh_mb_num: 16;
        unsigned int widi_intra_refresh_unit_in_mb: 8;
        unsigned int widi_intra_refresh_qp_delta: 8;
    } dw5;

    struct {
        unsigned int reserved;
    } dw6;

    struct {
        unsigned int reserved;
    } dw7;

    struct {
        unsigned int bti_src_y;
    } dw8;

    struct {
        unsigned int bti_slice_map;
    } dw9;

    struct {
        unsigned int bti_vme_8x8_mode;
    } dw10;

    struct {
        unsigned int bti_intra_mode;
    } dw11;

    struct {
        unsigned int bti_brc_input;
    } dw12;

    struct {
        unsigned int bti_simplest_intra;
    } dw13;

    struct {
        unsigned int bti_lcu_qp_surface;
    } dw14;

    struct {
        unsigned int bti_brc_data;
    } dw15;

    struct {
        unsigned int bti_debug;
    } dw16;
} gen9_hevc_mbenc_8x8_pu_curbe_data;

typedef struct _gen9_hevc_mbenc_8x8_pu_fmode_curbe_data {
    struct {
        unsigned int frame_width: 16;
        unsigned int frame_height: 16;
    } dw0;

    struct {
        unsigned int slice_type: 2;
        unsigned int pu_type: 2;
        unsigned int pak_reording_flag: 1;
        unsigned int reserved0: 1;
        unsigned int lcu_type: 1;
        unsigned int screen_content_flag: 1;
        unsigned int widi_intra_refresh_en: 2;
        unsigned int enable_rolling_intra: 1;
        unsigned int half_update_mixed_lcu: 1;
        unsigned int reserved1: 12;
        unsigned int enable_intra_early_exit: 1;
        unsigned int brc_enable: 1;
        unsigned int lcu_brc_enable: 1;
        unsigned int roi_enable: 1;
        unsigned int fast_surveillance_flag: 1;
        unsigned int reserved2: 2;
        unsigned int enable_debug_dump: 1;
    } dw1;

    struct {
        unsigned int luma_lambda;
    } dw2;

    struct {
        unsigned int lambda_for_dist_calculation;
    } dw3;

    struct {
        unsigned int mode_cost_for_8x8_pu_tu8;
    } dw4;

    struct {
        unsigned int mode_cost_for_8x8_pu_tu4;
    } dw5;

    struct {
        unsigned int satd_16x16_pu_threshold: 16;
        unsigned int bias_factor_toward_8x8: 16;
    } dw6;

    struct {
        unsigned int qp: 16;
        unsigned int qp_for_inter: 16;
    } dw7;

    struct {
        unsigned int simplified_flag_for_inter: 1;
        unsigned int reserved0: 7;
        unsigned int kbl_control_flag: 1;
        unsigned int reserved1: 23;
    } dw8;

    struct {
        unsigned int widi_intra_refresh_mb_num: 16;
        unsigned int widi_intra_refresh_unit_in_mb: 8;
        unsigned int widi_intra_refresh_qp_delta: 8;
    } dw9;

    struct {
        unsigned int reserved;
    } dw10;

    struct {
        unsigned int reserved;
    } dw11;

    struct {
        unsigned int reserved;
    } dw12;

    struct {
        unsigned int reserved;
    } dw13;

    struct {
        unsigned int reserved;
    } dw14;

    struct {
        unsigned int reserved;
    } dw15;

    struct {
        unsigned int bti_pak_object;
    } dw16;

    struct {
        unsigned int bti_vme_8x8_mode;
    } dw17;

    struct {
        unsigned int bti_intra_mode;
    } dw18;

    struct {
        unsigned int bti_pak_command;
    } dw19;

    struct {
        unsigned int bti_slice_map;
    } dw20;

    struct {
        unsigned int bti_intra_dist;
    } dw21;

    struct {
        unsigned int bti_brc_input;
    } dw22;

    struct {
        unsigned int bti_simplest_intra;
    } dw23;

    struct {
        unsigned int bti_lcu_qp_surface;
    } dw24;

    struct {
        unsigned int bti_brc_data;
    } dw25;

    struct {
        unsigned int bti_debug;
    } dw26;
} gen9_hevc_mbenc_8x8_pu_fmode_curbe_data;

typedef struct _gen9_hevc_mbenc_b_32x32_pu_intra_curbe_data {
    struct {
        unsigned int frame_width: 16;
        unsigned int frame_height: 16;
    } dw0;

    struct {
        unsigned int slice_type: 2;
        unsigned int reserved0: 6;
        unsigned int log2_min_tu_size: 8;
        unsigned int flags: 8;
        unsigned int enable_intra_early_exit: 1;
        unsigned int hme_enable: 1;
        unsigned int fast_surveillance_flag: 1;
        unsigned int reserved1: 4;
        unsigned int enable_debug_dump: 1;
    } dw1;

    struct {
        unsigned int qp_value: 16;
        unsigned int qp_multiplier: 16;
    } dw2;

    struct {
        unsigned int reserved;
    } dw3;

    struct {
        unsigned int reserved;
    } dw4;

    struct {
        unsigned int reserved;
    } dw5;

    struct {
        unsigned int reserved;
    } dw6;

    struct {
        unsigned int reserved;
    } dw7;

    struct {
        unsigned int bti_per_32x32_pu_intra_checck;
    } dw8;

    struct {
        unsigned int bti_src_y;
    } dw9;

    struct {
        unsigned int bti_src_y2x;
    } dw10;

    struct {
        unsigned int bti_slice_map;
    } dw11;

    struct {
        unsigned int bti_vme_y2x;
    } dw12;

    struct {
        unsigned int bti_simplest_intra;
    } dw13;

    struct {
        unsigned int bti_hme_mv_pred;

    } dw14;

    struct {
        unsigned int bti_hme_dist;
    } dw15;

    struct {
        unsigned int bti_lcu_skip;
    } dw16;

    struct {
        unsigned int bti_debug;
    } dw17;
} gen9_hevc_mbenc_b_32x32_pu_intra_curbe_data;

typedef struct _gen9_hevc_mbenc_b_mb_enc_curbe_data {
    struct {
        unsigned int skip_mode_en: 1;
        unsigned int adaptive_en: 1;
        unsigned int bi_mix_dis: 1;
        unsigned int reserved0: 2;
        unsigned int early_ime_success_enable: 1;
        unsigned int reserved1: 1;
        unsigned int t_8x8_flag_for_inter_en: 1;
        unsigned int reserved2: 16;
        unsigned int early_ime_stop: 8;
    } dw0;

    struct {
        unsigned int max_num_mvs: 6;
        unsigned int reserved0: 10;
        unsigned int bi_weight: 6;
        unsigned int reserved1: 6;
        unsigned int uni_mix_disable: 1;
        unsigned int reserved2: 3;
    } dw1;

    struct {
        unsigned int len_sp: 8;
        unsigned int max_num_su: 8;
        unsigned int pic_width: 16;
    } dw2;

    struct {
        unsigned int src_size: 2;
        unsigned int reserved0: 2;
        unsigned int mb_type_remap: 2;
        unsigned int src_access: 1;
        unsigned int ref_access: 1;
        unsigned int search_ctrl: 3;
        unsigned int dual_search_path_option: 1;
        unsigned int sub_pel_mode: 2;
        unsigned int skip_type: 1;
        unsigned int disable_field_cache_alloc: 1;
        unsigned int inter_chroma_mode: 1;
        unsigned int ft_enable: 1;
        unsigned int bme_disable_fbr: 1;
        unsigned int block_based_skip_enable: 1;
        unsigned int inter_sad: 2;
        unsigned int intra_sad: 2;
        unsigned int sub_mb_part_mask: 7;
        unsigned int reserved1: 1;
    } dw3;

    struct {
        unsigned int pic_height_minus1: 16;
        unsigned int reserved0: 8;
        unsigned int enable_debug: 1;
        unsigned int reserved1: 3;
        unsigned int hme_enable: 1;
        unsigned int slice_type: 2;
        unsigned int use_actual_ref_qp_value: 1;
    } dw4;

    struct {
        unsigned int reserved: 16;
        unsigned int ref_width: 8;
        unsigned int ref_height: 8;
    } dw5;

    struct {
        unsigned int frame_width: 16;
        unsigned int frame_height: 16;
    } dw6;

    struct {
        unsigned int intra_part_mask: 5;
        unsigned int non_skip_zmv_added: 1;
        unsigned int non_skip_mode_added: 1;
        unsigned int luma_intra_src_corner_swap: 1;
        unsigned int reserved0: 8;
        unsigned int mv_cost_scale_factor: 2;
        unsigned int bilinear_enable: 1;
        unsigned int reserved1: 1;
        unsigned int weighted_sad_haar: 1;
        unsigned int aconly_haar: 1;
        unsigned int refid_cost_mode: 1;
        unsigned int reserved2: 1;
        unsigned int skip_center_mask: 8;
    } dw7;

    struct {
        unsigned int mode0_cost: 8;
        unsigned int mode1_cost: 8;
        unsigned int mode2_cost: 8;
        unsigned int mode3_cost: 8;
    } dw8;

    struct {
        unsigned int mode4_cost: 8;
        unsigned int mode5_cost: 8;
        unsigned int mode6_cost: 8;
        unsigned int mode7_cost: 8;
    } dw9;

    struct {
        unsigned int mode8_cost: 8;
        unsigned int mode9_cost: 8;
        unsigned int ref_id_cost: 8;
        unsigned int chroma_intra_mode_cost: 8;
    } dw10;

    struct {
        unsigned int mv0_cost: 8;
        unsigned int mv1_cost: 8;
        unsigned int mv2_cost: 8;
        unsigned int mv3_cost: 8;
    } dw11;

    struct {
        unsigned int mv4_cost: 8;
        unsigned int mv5_cost: 8;
        unsigned int mv6_cost: 8;
        unsigned int mv7_cost: 8;
    } dw12;

    struct {
        unsigned int qp_prime_y: 8;
        unsigned int qp_prime_cb: 8;
        unsigned int qp_prime_cr: 8;
        unsigned int target_size_in_word: 8;
    } dw13;

    struct {
        unsigned int sic_fwd_trans_coeff_thread_0: 16;
        unsigned int sic_fwd_trans_coeff_thread_1: 8;
        unsigned int sic_fwd_trans_coeff_thread_2: 8;
    } dw14;

    struct {
        unsigned int sic_fwd_trans_coeff_thread_3: 8;
        unsigned int sic_fwd_trans_coeff_thread_4: 8;
        unsigned int sic_fwd_trans_coeff_thread_5: 8;
        unsigned int sic_fwd_trans_coeff_thread_6: 8;
    } dw15;

    struct {
        struct gen9_search_path_delta sp_delta_0;
        struct gen9_search_path_delta sp_delta_1;
        struct gen9_search_path_delta sp_delta_2;
        struct gen9_search_path_delta sp_delta_3;
    } dw16;

    struct {
        struct gen9_search_path_delta sp_delta_4;
        struct gen9_search_path_delta sp_delta_5;
        struct gen9_search_path_delta sp_delta_6;
        struct gen9_search_path_delta sp_delta_7;
    } dw17;

    struct {
        struct gen9_search_path_delta sp_delta_8;
        struct gen9_search_path_delta sp_delta_9;
        struct gen9_search_path_delta sp_delta_10;
        struct gen9_search_path_delta sp_delta_11;
    } dw18;

    struct {
        struct gen9_search_path_delta sp_delta_12;
        struct gen9_search_path_delta sp_delta_13;
        struct gen9_search_path_delta sp_delta_14;
        struct gen9_search_path_delta sp_delta_15;
    } dw19;

    struct {
        struct gen9_search_path_delta sp_delta_16;
        struct gen9_search_path_delta sp_delta_17;
        struct gen9_search_path_delta sp_delta_18;
        struct gen9_search_path_delta sp_delta_19;
    } dw20;

    struct {
        struct gen9_search_path_delta sp_delta_20;
        struct gen9_search_path_delta sp_delta_21;
        struct gen9_search_path_delta sp_delta_22;
        struct gen9_search_path_delta sp_delta_23;
    } dw21;

    struct {
        struct gen9_search_path_delta sp_delta_24;
        struct gen9_search_path_delta sp_delta_25;
        struct gen9_search_path_delta sp_delta_26;
        struct gen9_search_path_delta sp_delta_27;
    } dw22;

    struct {
        struct gen9_search_path_delta sp_delta_28;
        struct gen9_search_path_delta sp_delta_29;
        struct gen9_search_path_delta sp_delta_30;
        struct gen9_search_path_delta sp_delta_31;
    } dw23;

    struct {
        struct gen9_search_path_delta sp_delta_32;
        struct gen9_search_path_delta sp_delta_33;
        struct gen9_search_path_delta sp_delta_34;
        struct gen9_search_path_delta sp_delta_35;
    } dw24;

    struct {
        struct gen9_search_path_delta sp_delta_36;
        struct gen9_search_path_delta sp_delta_37;
        struct gen9_search_path_delta sp_delta_38;
        struct gen9_search_path_delta sp_delta_39;
    } dw25;

    struct {
        struct gen9_search_path_delta sp_delta_40;
        struct gen9_search_path_delta sp_delta_41;
        struct gen9_search_path_delta sp_delta_42;
        struct gen9_search_path_delta sp_delta_43;
    } dw26;

    struct {
        struct gen9_search_path_delta sp_delta_44;
        struct gen9_search_path_delta sp_delta_45;
        struct gen9_search_path_delta sp_delta_46;
        struct gen9_search_path_delta sp_delta_47;
    } dw27;

    struct {
        struct gen9_search_path_delta sp_delta_48;
        struct gen9_search_path_delta sp_delta_49;
        struct gen9_search_path_delta sp_delta_50;
        struct gen9_search_path_delta sp_delta_51;
    } dw28;

    struct {
        struct gen9_search_path_delta sp_delta_52;
        struct gen9_search_path_delta sp_delta_53;
        struct gen9_search_path_delta sp_delta_54;
        struct gen9_search_path_delta sp_delta_55;
    } dw29;

    struct {
        unsigned int intra_4x4_mode_mask: 9;
        unsigned int reserved0: 7;
        unsigned int intra_8x8_mode_mask: 9;
        unsigned int reserved1: 7;
    } dw30;

    struct {
        unsigned int intra_16x16_mode_mask: 4;
        unsigned int intra_chroma_mode_mask: 4;
        unsigned int intra_chmpute_type: 2;
        unsigned int reserved: 22;
    } dw31;

    struct {
        unsigned int skip_val: 16;
        unsigned int multi_pred_l0_disable: 8;
        unsigned int multi_pred_l1_disable: 8;
    } dw32;

    struct {
        unsigned int intra_16x16_nondc_pred_penalty: 8;
        unsigned int intra_8x8_nondc_pred_penalty: 8;
        unsigned int intra_4x4_nondc_pred_penalty: 8;
        unsigned int reserved: 8;
    } dw33;

    struct {
        float lambda_me;
    } dw34;

    struct {
        unsigned int simp_intra_inter_threashold: 16;
        unsigned int mode_cost_sp: 8;
        unsigned int widi_intra_refresh_en: 2;
        unsigned int widi_first_intra_refresh: 1;
        unsigned int enable_rolling_intra: 1;
        unsigned int half_update_mixed_lcu: 1;
        unsigned int reserved: 3;
    } dw35;

    struct {
        unsigned int num_refidx_l0_minus_one: 8;
        unsigned int hme_combined_extra_sus: 8;
        unsigned int num_refidx_l1_minus_one: 8;
        unsigned int power_saving: 1;
        unsigned int brc_enable: 1;
        unsigned int lcu_brc_enable: 1;
        unsigned int roi_enable: 1;
        unsigned int fast_surveillance_flag: 1;
        unsigned int check_all_fractional_enable: 1;
        unsigned int hme_combined_over_lap: 2;
    } dw36;

    struct {
        unsigned int actual_qp_refid0_list0: 8;
        unsigned int actual_qp_refid1_list0: 8;
        unsigned int actual_qp_refid2_list0: 8;
        unsigned int actual_qp_refid3_list0: 8;
    } dw37;

    struct {
        unsigned int widi_num_intra_refresh_off_frames: 16;
        unsigned int widi_num_frame_in_gob: 16;
    } dw38;

    struct {
        unsigned int actual_qp_refid0_list1: 8;
        unsigned int actual_qp_refid1_list1: 8;
        unsigned int ref_cost: 16;
    } dw39;

    struct {
        unsigned int reserved;
    } dw40;

    struct {
        unsigned int reserved;
    } dw41;

    struct {
        unsigned int reserved;
    } dw42;

    struct {
        unsigned int reserved;
    } dw43;

    struct {
        unsigned int max_num_merge_candidates: 4;
        unsigned int max_num_ref_list0: 4;
        unsigned int max_num_ref_list1: 4;
        unsigned int reserved: 4;
        unsigned int max_vmvr: 16;
    } dw44;

    struct {
        unsigned int temporal_mvp_enable_flag: 1;
        unsigned int reserved: 7;
        unsigned int log2_parallel_merge_level: 8;
        unsigned int hme_combine_len_pslice: 8;
        unsigned int hme_combine_len_bslice: 8;
    } dw45;

    struct {
        unsigned int log2_min_tu_size: 8;
        unsigned int log2_max_tu_size: 8;
        unsigned int log2_min_cu_size: 8;
        unsigned int log2_max_cu_size: 8;
    } dw46;

    struct {
        unsigned int num_regions_in_slice: 8;
        unsigned int type_of_walking_pattern: 4;
        unsigned int chroma_flatness_check_flag: 1;
        unsigned int enable_intra_early_exit: 1;
        unsigned int skip_intra_krn_flag: 1;
        unsigned int screen_content_flag: 1;
        unsigned int is_low_delay: 1;
        unsigned int collocated_from_l0_flag: 1;
        unsigned int arbitary_slice_flag: 1;
        unsigned int multi_slice_flag: 1;
        unsigned int reserved: 4;
        unsigned int is_curr_ref_l0_long_term: 1;
        unsigned int is_curr_ref_l1_long_term: 1;
        unsigned int num_region_minus1: 6;
    } dw47;

    struct {
        unsigned int current_td_l0_0: 16;
        unsigned int current_td_l0_1: 16;
    } dw48;

    struct {
        unsigned int current_td_l0_2: 16;
        unsigned int current_td_l0_3: 16;
    } dw49;

    struct {
        unsigned int current_td_l1_0: 16;
        unsigned int current_td_l1_1: 16;
    } dw50;

    struct {
        unsigned int widi_intra_refresh_mb_num: 16;
        unsigned int widi_intra_refresh_unit_in_mb: 8;
        unsigned int widi_intra_refresh_qp_delta: 8;
    } dw51;

    struct {
        unsigned int num_of_units_in_region: 16;
        unsigned int max_height_in_region: 16;
    } dw52;

    struct {
        unsigned int widi_intra_refresh_ref_width: 8;
        unsigned int widi_intra_refresh_ref_height: 8;
        unsigned int reserved: 16;
    } dw53;

    struct {
        unsigned int reserved;
    } dw54;

    struct {
        unsigned int reserved;
    } dw55;

    struct {
        unsigned int bti_cu_record;
    } dw56;

    struct {
        unsigned int bti_pak_cmd;
    } dw57;

    struct {
        unsigned int bti_src_y;
    } dw58;

    struct {
        unsigned int bti_intra_dist;
    } dw59;

    struct {
        unsigned int bti_min_dist;
    } dw60;

    struct {
        unsigned int bti_hme_mv_pred_fwd_bwd_surf_index;
    } dw61;

    struct {
        unsigned int bti_hme_dist_surf_index;
    } dw62;

    struct {
        unsigned int bti_slice_map;
    } dw63;

    struct {
        unsigned int bti_vme_saved_uni_sic;
    } dw64;

    struct {
        unsigned int bti_simplest_intra;
    } dw65;

    struct {
        unsigned int bti_collocated_refframe;
    } dw66;

    struct {
        unsigned int bti_reserved;
    } dw67;

    struct {
        unsigned int bti_brc_input;
    } dw68;

    struct {
        unsigned int bti_lcu_qp;
    } dw69;

    struct {
        unsigned int bti_brc_data;
    } dw70;

    struct {
        unsigned int bti_vme_inter_prediction_surf_index;
    } dw71;

    union {
        unsigned int bti_vme_inter_prediction_b_surf_index;

        unsigned int bti_concurrent_thread_map;
    } dw72;

    union {
        unsigned int bti_concurrent_thread_map;

        unsigned int bti_mb_data_cur_frame;
    } dw73;

    union {
        unsigned int bti_mb_data_cur_frame;

        unsigned int bti_mvp_cur_frame;
    } dw74;

    union {
        unsigned int bti_mvp_cur_frame;

        unsigned int bti_debug;
    } dw75;

    struct {
        unsigned int bti_debug;
    } dw76;
} gen9_hevc_mbenc_b_mb_enc_curbe_data;

typedef struct _gen9_hevc_mbenc_b_pak_curbe_data {
    struct {
        unsigned int frame_width: 16;
        unsigned int frame_height: 16;
    } dw0;

    struct {
        unsigned int qp: 8;
        unsigned int reserved: 8;
        unsigned int max_vmvr: 16;
    } dw1;

    struct {
        unsigned int slice_type: 2;
        unsigned int reserved0: 6;
        unsigned int simplest_intra_enable: 1;
        unsigned int brc_enable: 1;
        unsigned int lcu_brc_enable: 1;
        unsigned int roi_enable: 1;
        unsigned int fast_surveillance_flag: 1;
        unsigned int enable_rolling_intra: 1;
        unsigned int reserved1: 2;
        unsigned int kbl_control_flag: 1;
        unsigned int reserved2: 14;
        unsigned int screen_content: 1;
    } dw2;

    struct {
        unsigned int widi_intra_refresh_mb_num: 16;
        unsigned int widi_intra_refresh_unit_in_mb: 8;
        unsigned int widi_intra_refresh_qp_delta: 8;
    } dw3;

    struct {
        unsigned int reserved;
    } dw4_15[12];

    struct {
        unsigned int bti_cu_record;
    } dw16;

    struct {
        unsigned int bti_pak_obj;
    } dw17;

    struct {
        unsigned int bti_slice_map;
    } dw18;

    struct {
        unsigned int bti_brc_input;
    } dw19;

    struct {
        unsigned int bti_lcu_qp;
    } dw20;

    struct {
        unsigned int bti_brc_data;
    } dw21;

    struct {
        unsigned int bti_mb_data;
    } dw22;

    struct {
        unsigned int bti_mvp_surface;
    } dw23;

    struct {
        unsigned int bti_debug;
    } dw24;
} gen9_hevc_mbenc_b_pak_curbe_data;

typedef enum _GEN9_HEVC_DOWNSCALE_STAGE {
    HEVC_ENC_DS_DISABLED                         = 0,
    HEVC_ENC_2xDS_STAGE                          = 1,
    HEVC_ENC_4xDS_STAGE                          = 2,
    HEVC_ENC16xDS_STAGE                          = 3,
    HEVC_ENC_2xDS_4xDS_STAGE                     = 4,
    HEVC_ENC_32xDS_STAGE                         = 5
} GEN9_HEVC_DOWNSCALE_STAGE;

typedef struct _gen95_hevc_mbenc_ds_combined_curbe_data {
    struct {
        unsigned int pak_bitdepth_chroma: 8;
        unsigned int pak_bitdepth_luma: 8;
        unsigned int enc_bitdepth_chroma: 8;
        unsigned int enc_bitdepth_luma: 7;
        unsigned int rounding_value: 1;
    } dw0;

    struct {
        unsigned int pic_format: 8;
        unsigned int pic_convert_flag: 1;
        unsigned int pic_down_scale: 3;
        unsigned int pic_mb_stat_output_cntrl: 1;
        unsigned int mbz: 19;
    } dw1;

    struct {
        unsigned int orig_pic_width: 16;
        unsigned int orig_pic_height: 16;
    } dw2;

    struct {
        unsigned int bti_surface_p010;
    } dw3;

    struct {
        unsigned int bti_surface_nv12;
    } dw4;

    struct {
        unsigned int bti_src_y_4xdownscaled;
    } dw5;

    struct {
        unsigned int bti_surf_mbstate;
    } dw6;

    struct {
        unsigned int bit_src_y_2xdownscaled;
    } dw7;
} gen95_hevc_mbenc_ds_combined_curbe_data;

#define GEN9_HEVC_AVBR_ACCURACY      30
#define GEN9_HEVC_AVBR_CONVERGENCE   150

typedef enum _GEN9_HEVC_BRC_INIT_FLAGS {
    HEVC_BRCINIT_ISCBR                       = 0x0010,
    HEVC_BRCINIT_ISVBR                       = 0x0020,
    HEVC_BRCINIT_ISAVBR                      = 0x0040,
    HEVC_BRCINIT_ISQVBR                      = 0x0080,
    HEVC_BRCINIT_FIELD_PIC                   = 0x0100,
    HEVC_BRCINIT_ISICQ                       = 0x0200,
    HEVC_BRCINIT_ISVCM                       = 0x0400,
    HEVC_BRCINIT_IGNORE_PICTURE_HEADER_SIZE  = 0x2000,
    HEVC_BRCINIT_ISCQP                       = 0x4000,
    HEVC_BRCINIT_DISABLE_MBBRC               = 0x8000
} GEN9_HEVC_BRCINIT_FLAGS;

// BRC kernel paramerters
typedef struct _gen9_hevc_brc_init_reset_curbe_data {
    struct {
        unsigned int profile_level_max_frame;
    } dw0;

    struct {
        unsigned int init_buf_full;
    } dw1;

    struct {
        unsigned int buf_size;
    } dw2;

    struct {
        unsigned int targe_bit_rate;
    } dw3;

    struct {
        unsigned int maximum_bit_rate;
    } dw4;

    struct {
        unsigned int minimum_bit_rate;
    } dw5;

    struct {
        unsigned int frame_rate_m;
    } dw6;

    struct {
        unsigned int frame_rate_d;
    } dw7;

    struct {
        unsigned int brc_flag: 16;
        unsigned int brc_param_a: 16;
    } dw8;

    struct {
        unsigned int brc_param_b: 16;
        unsigned int frame_width: 16;
    } dw9;

    struct {
        unsigned int frame_height: 16;
        unsigned int avbr_accuracy: 16;
    } dw10;

    struct {
        unsigned int avbr_convergence: 16;
        unsigned int minimum_qp: 16;
    } dw11;

    struct {
        unsigned int maximum_qp: 16;
        unsigned int number_slice: 16;
    } dw12;

    struct {
        unsigned int reserved: 16;
        unsigned int brc_param_c: 16;
    } dw13;

    struct {
        unsigned int brc_param_d: 16;
        unsigned int max_brc_level: 16;
    } dw14;

    struct {
        unsigned int reserved;
    } dw15;

    struct {
        unsigned int instant_rate_threshold0_pframe: 8;
        unsigned int instant_rate_threshold1_pframe: 8;
        unsigned int instant_rate_threshold2_pframe: 8;
        unsigned int instant_rate_threshold3_pframe: 8;
    } dw16;

    struct {
        unsigned int instant_rate_threshold0_bframe: 8;
        unsigned int instant_rate_threshold1_bframe: 8;
        unsigned int instant_rate_threshold2_bframe: 8;
        unsigned int instant_rate_threshold3_bframe: 8;
    } dw17;

    struct {
        unsigned int instant_rate_threshold0_iframe: 8;
        unsigned int instant_rate_threshold1_iframe: 8;
        unsigned int instant_rate_threshold2_iframe: 8;
        unsigned int instant_rate_threshold3_iframe: 8;
    } dw18;

    struct {
        unsigned int deviation_threshold0_pbframe: 8;
        unsigned int deviation_threshold1_pbframe: 8;
        unsigned int deviation_threshold2_pbframe: 8;
        unsigned int deviation_threshold3_pbframe: 8;
    } dw19;

    struct {
        unsigned int deviation_threshold4_pbframe: 8;
        unsigned int deviation_threshold5_pbframe: 8;
        unsigned int deviation_threshold6_pbframe: 8;
        unsigned int deviation_threshold7_pbframe: 8;
    } dw20;

    struct {
        unsigned int deviation_threshold0_vbr_control: 8;
        unsigned int deviation_threshold1_vbr_control: 8;
        unsigned int deviation_threshold2_vbr_control: 8;
        unsigned int deviation_threshold3_vbr_control: 8;
    } dw21;

    struct {
        unsigned int deviation_threshold4_vbr_control: 8;
        unsigned int deviation_threshold5_vbr_control: 8;
        unsigned int deviation_threshold6_vbr_control: 8;
        unsigned int deviation_threshold7_vbr_control: 8;
    } dw22;

    struct {
        unsigned int deviation_threshold0_iframe: 8;
        unsigned int deviation_threshold1_iframe: 8;
        unsigned int deviation_threshold2_iframe: 8;
        unsigned int deviation_threshold3_iframe: 8;
    } dw23;

    struct {
        unsigned int deviation_threshold4_iframe: 8;
        unsigned int deviation_threshold5_iframe: 8;
        unsigned int deviation_threshold6_iframe: 8;
        unsigned int deviation_threshold7_iframe: 8;
    } dw24;

    struct {
        unsigned int acqp_buffer: 8;
        unsigned int intra_sad_transform: 8;
        unsigned int reserved: 16;
    } dw25;

    struct {
        unsigned int   reserved;
    } dw26;

    struct {
        unsigned int   reserved;
    } dw27;

    struct {
        unsigned int   reserved;
    } dw28;

    struct {
        unsigned int   reserved;
    } dw29;

    struct {
        unsigned int   reserved;
    } dw30;

    struct {
        unsigned int   reserved;
    } dw31;
} gen9_hevc_brc_initreset_curbe_data;

// BRC Flag in BRC Update Kernel
typedef enum _GEN9_HEVC_BRC_UPDATE_FLAG {
    HEVC_BRC_UPDATE_IS_FIELD                  = 0x01,
    HEVC_BRC_UPDATE_IS_MBAFF                  = (0x01 << 1),
    HEVC_BRC_UPDATE_IS_BOTTOM_FIELD           = (0x01 << 2),
    HEVC_BRC_UPDATE_IS_ACTUALQP               = (0x01 << 6),
    HEVC_BRC_UPDATE_IS_REFERENCE              = (0x01 << 7)
} GEN9_HEVC_BRC_UPDATE_FLAG;

typedef enum _GEN9_HEVC_BRC_UPDATE_FRAME_TYPE {
    HEVC_BRC_FTYPE_P_OR_LB = 0,
    HEVC_BRC_FTYPE_B       = 1,
    HEVC_BRC_FTYPE_I       = 2,
    HEVC_BRC_FTYPE_B1      = 3,
    HEVC_BRC_FTYPE_B2      = 4
} GEN9_HEVC_BRC_UPDATE_FRAME_TYPE;

typedef struct _GEN9_HEVC_PAK_STATES {
    unsigned int HEVC_ENC_BYTECOUNT_FRAME;
    unsigned int HEVC_ENC_BYTECOUNT_FRAME_NOHEADER;
    unsigned int HEVC_ENC_IMAGE_STATUS_CONTROL;
    unsigned int reserved0;
    unsigned int HEVC_ENC_IMAGE_STATUS_CONTROL_FOR_LAST_PASS;
    unsigned int reserved1[3];
} GEN9_HEVC_PAK_STATES;

typedef struct _gen9_hevc_brc_udpate_curbe_data {
    struct {
        unsigned int target_size;
    } dw0;

    struct {
        unsigned int frame_number;
    } dw1;

    struct {
        unsigned int picture_header_size;
    } dw2;

    struct {
        unsigned int start_gadj_frame0: 16;
        unsigned int start_gadj_frame1: 16;
    } dw3;

    struct {
        unsigned int start_gadj_frame2: 16;
        unsigned int start_gadj_frame3: 16;
    } dw4;

    struct {
        unsigned int target_size_flag: 8;
        unsigned int brc_flag: 8;
        unsigned int max_num_paks: 8;
        unsigned int curr_frame_type: 8;
    } dw5;

    struct {
        unsigned int num_skipped_frames: 8;
        unsigned int cqp_value: 8;
        unsigned int roi_flag: 8;
        unsigned int roi_ratio: 8;
    } dw6;

    struct {
        unsigned int frame_width_in_lcu: 8;
        unsigned int reserved: 24;
    } dw7;

    struct {
        unsigned int start_global_adjust_mult0: 8;
        unsigned int start_global_adjust_mult1: 8;
        unsigned int start_global_adjust_mult2: 8;
        unsigned int start_global_adjust_mult3: 8;
    } dw8;

    struct {
        unsigned int start_global_adjust_mult4: 8;
        unsigned int start_global_adjust_divd0: 8;
        unsigned int start_global_adjust_divd1: 8;
        unsigned int start_global_adjust_divd2: 8;
    } dw9;

    struct {
        unsigned int start_global_adjust_divd3: 8;
        unsigned int start_global_adjust_divd4: 8;
        unsigned int qp_threshold0: 8;
        unsigned int qp_threshold1: 8;
    } dw10;

    struct {
        unsigned int qp_threshold2: 8;
        unsigned int qp_threshold3: 8;
        unsigned int g_rate_ratio_threshold0: 8;
        unsigned int g_rate_ratio_threshold1: 8;
    } dw11;

    struct {
        unsigned int g_rate_ratio_threshold2: 8;
        unsigned int g_rate_ratio_threshold3: 8;
        unsigned int g_rate_ratio_threshold4: 8;
        unsigned int g_rate_ratio_threshold5: 8;
    } dw12;

    struct {
        unsigned int g_rate_ratio_threshold6: 8;
        unsigned int g_rate_ratio_threshold7: 8;
        unsigned int g_rate_ratio_threshold8: 8;
        unsigned int g_rate_ratio_threshold9: 8;
    } dw13;

    struct {
        unsigned int g_rate_ratio_threshold10: 8;
        unsigned int g_rate_ratio_threshold11: 8;
        unsigned int g_rate_ratio_threshold12: 8;
        unsigned int parallel_mode: 8;
    } dw14;

    struct {
        unsigned int size_of_skipped_frames;
    } dw15;
} gen9_hevc_brc_udpate_curbe_data;

typedef struct _gen9_hevc_brc_coarse_intra_curbe_data {
    struct {
        unsigned int picture_width_in_luma_samples: 16;
        unsigned int picture_height_in_luma_samples: 16;
    } dw0;

    struct {
        unsigned int src_size: 2;
        unsigned int reserved0: 12;
        unsigned int skip_type: 1;
        unsigned int reserved1: 1;
        unsigned int inter_chroma_mode: 1;
        unsigned int ft_enable: 1;
        unsigned int reserved2: 1;
        unsigned int blk_skip_enabled: 1;
        unsigned int inter_sad: 2;
        unsigned int intra_sad: 2;
        unsigned int reserved3: 8;
    } dw1;

    struct {
        unsigned int intra_park_mask: 5;
        unsigned int non_skip_zmv_added: 1;
        unsigned int non_skip_mode_added: 1;
        unsigned int intra_corner_swap: 1;
        unsigned int reserved0: 8;
        unsigned int mv_cost_scale_factor: 2;
        unsigned int bilinear_enable: 1;
        unsigned int reserved1: 1;
        unsigned int weighted_sad_haar: 1;
        unsigned int aconly_haar: 1;
        unsigned int refid_cost_mode: 1;
        unsigned int reserved2: 1;
        unsigned int skip_center_mask: 8;
    } dw2;

    struct {
        unsigned int reserved;
    } dw3;

    struct {
        unsigned int reserved;
    } dw4;

    struct {
        unsigned int reserved;
    } dw5;

    struct {
        unsigned int reserved;
    } dw6;

    struct {
        unsigned int reserved;
    } dw7;

    struct {
        unsigned int bti_src_y4;
    } dw8;

    struct {
        unsigned int bti_intra_dist;
    } dw9;

    struct {
        unsigned int bti_vme_intra;
    } dw10;
} gen9_hevc_brc_coarse_intra_curbe_data;

// gen9 kernel header strcutures
typedef struct _gen9_hevc_enc_kernel_header {
    unsigned int reserved: 6;
    unsigned int kernel_start_pointer: 26;
} gen9_hevc_enc_kernel_header;

typedef struct _gen9_hevc_enc_kernels_header {
    int kernel_count;
    gen9_hevc_enc_kernel_header HEVC_ENC_I_2xDownSampling_Kernel;
    gen9_hevc_enc_kernel_header HEVC_ENC_I_32x32_PU_ModeDecision_Kernel;
    gen9_hevc_enc_kernel_header HEVC_ENC_I_16x16_PU_SADComputation_Kernel;
    gen9_hevc_enc_kernel_header HEVC_ENC_I_16x16_PU_ModeDecision_Kernel;
    gen9_hevc_enc_kernel_header HEVC_ENC_I_8x8_PU_Kernel;
    gen9_hevc_enc_kernel_header HEVC_ENC_I_8x8_PU_FMode_Kernel;
    gen9_hevc_enc_kernel_header HEVC_ENC_PB_32x32_PU_IntraCheck;
    gen9_hevc_enc_kernel_header HEVC_ENC_PB_MB;
    gen9_hevc_enc_kernel_header HEVC_ENC_I_DS4HME;
    gen9_hevc_enc_kernel_header HEVC_ENC_P_HME;
    gen9_hevc_enc_kernel_header HEVC_ENC_B_HME;
    gen9_hevc_enc_kernel_header HEVC_ENC_I_COARSE;
    gen9_hevc_enc_kernel_header HEVC_ENC_BRC_Init;
    gen9_hevc_enc_kernel_header HEVC_ENC_BRC_Reset;
    gen9_hevc_enc_kernel_header HEVC_ENC_BRC_Update;
    gen9_hevc_enc_kernel_header HEVC_ENC_BRC_LCU_Update;
    gen9_hevc_enc_kernel_header HEVC_ENC_PB_Pak;
    gen9_hevc_enc_kernel_header HEVC_ENC_PB_Widi;
    gen9_hevc_enc_kernel_header HEVC_ENC_BRC_Blockcopy;
    gen9_hevc_enc_kernel_header HEVC_ENC_DS_Combined;
} gen9_hevc_enc_kernels_header;

typedef struct _gen9_hevc_enc_kernels_header_bxt {
    int kernel_count;
    gen9_hevc_enc_kernel_header HEVC_ENC_I_2xDownSampling_Kernel;
    gen9_hevc_enc_kernel_header HEVC_ENC_I_32x32_PU_ModeDecision_Kernel;
    gen9_hevc_enc_kernel_header HEVC_ENC_I_16x16_PU_SADComputation_Kernel;
    gen9_hevc_enc_kernel_header HEVC_ENC_I_16x16_PU_ModeDecision_Kernel;
    gen9_hevc_enc_kernel_header HEVC_ENC_I_8x8_PU_Kernel;
    gen9_hevc_enc_kernel_header HEVC_ENC_I_8x8_PU_FMode_Kernel;
    gen9_hevc_enc_kernel_header HEVC_ENC_PB_32x32_PU_IntraCheck;
    gen9_hevc_enc_kernel_header HEVC_ENC_PB_MB;
    gen9_hevc_enc_kernel_header HEVC_ENC_I_DS4HME;
    gen9_hevc_enc_kernel_header HEVC_ENC_P_HME;
    gen9_hevc_enc_kernel_header HEVC_ENC_B_HME;
    gen9_hevc_enc_kernel_header HEVC_ENC_I_COARSE;
    gen9_hevc_enc_kernel_header HEVC_ENC_BRC_Init;
    gen9_hevc_enc_kernel_header HEVC_ENC_BRC_Reset;
    gen9_hevc_enc_kernel_header HEVC_ENC_BRC_Update;
    gen9_hevc_enc_kernel_header HEVC_ENC_BRC_LCU_Update;
    gen9_hevc_enc_kernel_header HEVC_ENC_PB_Pak;
    gen9_hevc_enc_kernel_header HEVC_ENC_PB_Widi;
    gen9_hevc_enc_kernel_header HEVC_ENC_BRC_Blockcopy;
    gen9_hevc_enc_kernel_header HEVC_ENC_DS_Combined;
    gen9_hevc_enc_kernel_header HEVC_ENC_P_MB;
    gen9_hevc_enc_kernel_header HEVC_ENC_P_Widi;
} gen9_hevc_enc_kernels_header_bxt;

typedef enum _GEN9_HEVC_ENC_MBENC_KRNIDX {
    GEN9_HEVC_ENC_MBENC_2xSCALING = 0,
    GEN9_HEVC_ENC_MBENC_32x32MD,
    GEN9_HEVC_ENC_MBENC_16x16SAD,
    GEN9_HEVC_ENC_MBENC_16x16MD,
    GEN9_HEVC_ENC_MBENC_8x8PU,
    GEN9_HEVC_ENC_MBENC_8x8FMODE,
    GEN9_HEVC_ENC_MBENC_32x32INTRACHECK,
    GEN9_HEVC_ENC_MBENC_BENC,
    GEN9_HEVC_ENC_MBENC_BPAK,
    GEN9_HEVC_ENC_MBENC_WIDI,
    GEN9_HEVC_ENC_MBENC_NUM,
    GEN9_HEVC_ENC_MBENC_DS_COMBINED = GEN9_HEVC_ENC_MBENC_NUM,
    GEN95_HEVC_ENC_MBENC_NUM_KBL,
    GEN9_HEVC_MBENC_PENC = GEN95_HEVC_ENC_MBENC_NUM_KBL,
    GEN9_HEVC_MBENC_P_WIDI,
    GEN9_HEVC_MBENC_NUM_BXT,
    GEN8_HEVC_ENC_MBENC_TOTAL_NUM = GEN9_HEVC_MBENC_NUM_BXT
} GEN9_HEVC_ENC_MBENC_KRNIDX;

typedef enum _GEN9_HEVC_ENC_BRC_KRNIDX {
    GEN9_HEVC_ENC_BRC_COARSE_INTRA = 0,
    GEN9_HEVC_ENC_BRC_INIT,
    GEN9_HEVC_ENC_BRC_RESET,
    GEN9_HEVC_ENC_BRC_FRAME_UPDATE,
    GEN9_HEVC_ENC_BRC_LCU_UPDATE,
    GEN9_HEVC_ENC_BRC_NUM
} GEN9_HEVC_ENC_BRC_KRNIDX;

typedef enum _GEN9_ENC_ENC_OPERATION {
    GEN9_ENC_SCALING4X = 0,
    GEN9_ENC_SCALING2X,
    GEN9_ENC_ME,
    GEN9_ENC_BRC,
    GEN9_ENC_MBENC,
    GEN9_ENC_MBENC_WIDI,
    GEN9_ENC_RESETVLINESTRIDE,
    GEN9_ENC_MC,
    GEN9_ENC_MBPAK,
    GEN9_ENC_DEBLOCK,
    GEN9_ENC_PREPROC,
    GEN9_ENC_VDENC_ME,
    GEN9_ENC_WP,
    GEN9_ENC_SFD,
    GEN9_ENC_MBENC_I_LUMA,
    GEN9_ENC_MPU,
    GEN9_ENC_TPU,
    GEN9_ENC_SCALING_CONVERSION,
    GEN9_ENC_DYS
} GEN9_ENC_OPERATION;

#endif