lin
2025-07-30 fcd736bf35fd93b563e9bbf594f2aa7b62028cc9
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
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
/******************************************************************************
*
* Copyright (C) 2012 Ittiam Systems Pvt Ltd, Bangalore
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************/
 
/**
 *******************************************************************************
 * @file
 *  ihevc_structs.h
 *
 * @brief
 *  Structure definitions used in the code
 *
 * @author
 *  Ittiam
 *
 * @par List of Functions:
 *
 * @remarks
 *  None
 *
 *******************************************************************************
 */
 
#ifndef _IHEVC_STRUCTS_H_
#define _IHEVC_STRUCTS_H_
 
 
/**
 * Buffering Period SEI parameters Info
 */
typedef struct
{
    /**
     * specifies SPS Id active for the coded picture assosiated
     * with the bp message.
     */
    UWORD8  u1_bp_seq_parameter_set_id;
 
    /**
     * Derived from Hrd parameters
     */
    UWORD8  u1_sub_pic_cpb_params_present_flag;
 
    /**
     * specifies the presence of the initial_alt_cpb_removal_delay[ i ]
     * and initial_alt_cpb_removal_offset[ i ] syntax elements
     */
    UWORD8  u1_rap_cpb_params_present_flag;
 
    /**
     * cbp removal delay used in buffering period SEI
     */
    UWORD32 u4_cpb_delay_offset;
 
    /**
     * dbp removal delay used in buffering period SEI
     */
    UWORD32 u4_dpb_delay_offset;
 
    /**
     * concatanation flag
     */
    UWORD8 u1_concatenation_flag;
 
    /**
     * delata cbp removal delay
     */
    UWORD32 u4_au_cpb_removal_delay_delta_minus1;
 
    /**
     * specify the default initial CPB removal delays, respectively,
     * for the CPB when the NAL HRD parameters are in use
     */
    UWORD32 au4_nal_initial_cpb_removal_delay[MAX_CPB_CNT];
 
    /**
     * specify the alternate initial CPB removal delays, respectively,
     * for the CPB when the NAL HRD parameters are in use
     */
    UWORD32 au4_nal_initial_alt_cpb_removal_delay[MAX_CPB_CNT];
 
    /**
     * specify the initial CPB removal delay offset, respectively,
     * for the CPB when the NAL HRD parameters are in use
     */
    UWORD32 au4_nal_initial_cpb_removal_delay_offset[MAX_CPB_CNT];
 
    /**
     * specify the alternate initial CPB removal delays offsets, respectively,
     * for the CPB when the NAL HRD parameters are in use
     */
    UWORD32 au4_nal_initial_alt_cpb_removal_delay_offset[MAX_CPB_CNT];
 
    /**
     * specify the default initial CPB removal delays, respectively,
     * for the CPB when the VCL HRD parameters are in use
     */
    UWORD32 au4_vcl_initial_cpb_removal_delay[MAX_CPB_CNT];
 
    /**
     * specify the initial alt CPB removal delays , respectively,
     * for the CPB when the VCL HRD parameters are in use
     */
    UWORD32 au4_vcl_initial_alt_cpb_removal_delay[MAX_CPB_CNT];
 
    /**
     * specify the initial CPB removal delay offset, respectively,
     * for the CPB when the VCL HRD parameters are in use
     */
    UWORD32 au4_vcl_initial_cpb_removal_delay_offset[MAX_CPB_CNT];
 
    /**
     * specify the alternate initial CPB removal delays offsets, respectively,
     * for the CPB when the VCL HRD parameters are in use
     */
    UWORD32 au4_vcl_initial_alt_cpb_removal_delay_offset[MAX_CPB_CNT];
 
    /**
     * Inital CPB removal delay
     */
    UWORD32 u4_initial_cpb_removal_delay_length;
 
    /**
     * CPB cnt for corr. sublayer
     */
    UWORD32 u4_cpb_cnt;
 
 
    /**
     * VBV buffer size used in buffering period SEI
     */
    UWORD32 u4_buffer_size_sei;
 
    /**
     * Encoder buffer fullness  used in buffering period SEI
     */
    UWORD32 u4_dbf_sei;
 
    /**
     * target bitrate used in buffering period SEI
     */
    UWORD32 u4_target_bit_rate_sei;
 
}buf_period_sei_params_t;
 
 
/**
 * Picture Timing SEI parameters Info
 */
typedef struct
{
    /**
     * derived from vui parameters
     */
    UWORD8 u1_frame_field_info_present_flag;
 
    /**
     * indicates whether a picture should be displayed as a
     * frame or as one or more fields
     */
    UWORD32 u4_pic_struct;
 
    UWORD32 u4_source_scan_type;
 
    /**
     * if 1, indicates if the current pic is a duplicte pic in output order
     */
    UWORD8 u1_duplicate_flag;
 
    /**
     * specifies the number clock ticks between the nominal CPB removal time
     * au associated with the pt SEI message and
     * the preceding au in decoding order that contained a bp SEI message
     */
    UWORD32 u4_au_cpb_removal_delay_minus1;
 
    /**
     * compute the DPB output time of the picture
     */
    UWORD32 u4_pic_dpb_output_delay;
 
    UWORD32 u4_pic_dpb_output_du_delay;
 
    /**
     * specifies the number of decoding units in the access unit
     * the picture timing SEI message is associated with
     */
    UWORD32 u4_num_decoding_units_minus1;
 
    /**
     * if 1 specifies that the du_common_cpb_removal_delay_increment_minus1 is present
     */
    UWORD8 u1_du_common_cpb_removal_delay_flag;
 
    /**
     * specifies the duration, in units of clock sub-ticks,
     * between the nominal CPB removal times of any two consecutive decoding units
     * in decoding order in the access unit associated with the pt_SEI message
     */
    UWORD32 u4_du_common_cpb_removal_delay_increment_minus1; //same as u4_du_cpb_removal_delay_increment_minus1
 
    /**
     * specifies the number of NAL units in the decoding unit of the access unit
     * the picture timing SEI message is associated with.
     * range from 0 to (pic size in ctby - 1)
     */
    UWORD32 au4_num_nalus_in_du_minus1[4320 / MIN_CTB_SIZE];
 
    /**
     * specifies the duration, in units of clock sub-ticks,
     * between the nominal CPB removal times of the ( i + 1 )-th decoding unit and the i-th decoding unit,
     * in decoding order, in the access unit associated with the pt_SEI message
     */
    UWORD32 au4_du_cpb_removal_delay_increment_minus1[4320 / MIN_CTB_SIZE];
 
}pic_timing_sei_params_t;
 
/**
 * Structure to hold Recovery point SEI parameters Info
 */
typedef struct
{
    /**
     * specifies the recovery point of output pictures in output order
     */
    WORD32 i4_recovery_poc_cnt;
 
    UWORD8 u1_exact_match_flag;
 
    /**
     * indicates the presence or absence of a broken link in the NAL unit
     * stream at the location of the recovery point SEI message
     */
 
    UWORD8 u1_broken_link_flag;
 
}recovery_point_sei_params_t;
 
/**
 * Structure to hold Mastering Display Colour Volume SEI
 */
typedef struct
{
    /**
     * Array to store the display_primaries_x values
     */
    UWORD16 au2_display_primaries_x[3];
 
    /**
     * Array to store the display_primaries_y values
     */
    UWORD16 au2_display_primaries_y[3];
 
    /**
     * Variable to store the white point x value
     */
    UWORD16 u2_white_point_x;
 
    /**
     * Variable to store the white point y value
     */
    UWORD16 u2_white_point_y;
 
    /**
     * Variable to store the max display mastering luminance value
     */
    UWORD32 u4_max_display_mastering_luminance;
 
    /**
     * Variable to store the min display mastering luminance value
     */
    UWORD32 u4_min_display_mastering_luminance;
 
}mastering_dis_col_vol_sei_params_t;
 
/**
 * Structure to hold active parameter parameter set SEI parameters Info
 */
typedef struct
{
    /*
    * active vps id
    */
 
    UWORD8 u1_active_video_parameter_set_id;
 
    /*
     * default set to zero.
     */
    UWORD8 u1_self_contained_cvs_flag;
 
    UWORD8 u1_no_parameter_set_update_flag;
 
    UWORD8 u1_num_sps_ids_minus1;
 
    /*
     * active sps id
     */
    UWORD8 au1_active_seq_parameter_set_id[15];
 
    UWORD32 au4_layer_sps_idx[64];
 
}active_parameter_set_sei_param_t;
 
/**
 * Structure to hold SEI Hash values
 */
typedef struct
{
    /*
     * SEI Hash values for each color component
     */
    UWORD8 au1_sei_hash[3][16];
 
}hash_sei_param_t;
 
/**
 * Structure to hold user data registered SEI param Info
 */
typedef struct
{
    /**
     * Contains country code by Annex A of Recommendation ITU-T T.35
     */
    UWORD8 u1_itu_t_t35_country_code;
 
    /**
     * Contains country code by Annex B of Recommendation ITU-T T.35
     */
    UWORD8 u1_itu_t_t35_country_code_extension_byte;
 
    /**
     * Contains data registered as specified in Recommendation ITU-T T.35
     */
    UWORD8 u1_itu_t_t35_payload_byte[MAX_USERDATA_PAYLOAD];
 
    /**
     * Valid payload size present in this buffer
     */
    WORD32 i4_valid_payload_size;
 
    /**
     * Total payload size incase payloadSize > IHEVCD_MAX_USERDATA_PAYLOAD
     */
    WORD32 i4_payload_size;
}user_data_registered_itu_t_t35_t;
 
/**
 * Structure to hold time code SEI param info
 */
typedef struct
{
    /**
     * Number of sets of clock timestamp syntax elements present for the current picture
     */
    UWORD8 u1_num_clock_ts;
 
    /**
     * Indicates presenc of associated set of clock timestamps
     */
    UWORD8 au1_clock_timestamp_flag[MAX_NUM_CLOCK_TS];
 
    /**
     * Used in calculating clockTimestamp[i]
     */
    UWORD8 au1_units_field_based_flag[MAX_NUM_CLOCK_TS];
 
    /**
     * Specifies the method of dropping values of the n_frames[i] syntax element
     */
    UWORD8 au1_counting_type[MAX_NUM_CLOCK_TS];
 
    /**
     * Specifies that the n_frames[i] syntax element is followed by seconds_value[i],
     * minutes_value[i] and hours_value[i]
     */
    UWORD8 au1_full_timestamp_flag[MAX_NUM_CLOCK_TS];
 
    /**
     * Indicates the discontinuity in clockTimestamp
     */
    UWORD8 au1_discontinuity_flag[MAX_NUM_CLOCK_TS];
 
    /**
     * Specifies the skipping of one or more values of n_frames[i]
     */
    UWORD8 au1_cnt_dropped_flag[MAX_NUM_CLOCK_TS];
 
    /**
     * Specifies the value of nFrames used to compute clockTimestamp[i]
     */
    UWORD16 au2_n_frames[MAX_NUM_CLOCK_TS];
 
    /**
     * Specifies the presence of seconds_value[i] and minutes_flag[i]
     */
    UWORD8 au1_seconds_flag[MAX_NUM_CLOCK_TS];
 
    /**
     * Specifies the presence of minutes_value[i] and hours_flag[i]
     */
    UWORD8 au1_minutes_flag[MAX_NUM_CLOCK_TS];
 
    /**
     * Specifies the presence of hours_value[i]
     */
    UWORD8 au1_hours_flag[MAX_NUM_CLOCK_TS];
 
    /**
     * Specifies the value of sS used to compute clockTimestamp[i]
     */
    UWORD8 au1_seconds_value[MAX_NUM_CLOCK_TS];
 
    /**
     * Specifies the value of mM used to compute clockTimestamp[i]
     */
    UWORD8 au1_minutes_value[MAX_NUM_CLOCK_TS];
 
    /**
     * Specifies the value of hH used to compute clockTimestamp[i]
     */
    UWORD8 au1_hours_value[MAX_NUM_CLOCK_TS];
 
    /**
     * Specifies the length in bits of the time_offset_value[i]
     */
    UWORD8 au1_time_offset_length[MAX_NUM_CLOCK_TS];
 
    /**
     * pecifies the value of tOffset used to compute clockTimestamp[i]
     */
    UWORD8 au1_time_offset_value[MAX_NUM_CLOCK_TS];
 
}time_code_t;
 
/**
 *  @brief    Structure for Content Light Level Info
 *
 */
typedef struct
{
    /**
     * 16bit unsigned number which indicates the maximum pixel intensity of all samples in bit-stream in units of 1 candela per square metre
     */
    UWORD16 u2_sei_max_cll;
 
    /**
     * 16bit unsigned number which indicates the average pixel intensity of all samples in bit-stream in units of 1 candela per square metre
     */
    UWORD16 u2_sei_avg_cll;
 
}content_light_level_info_sei_params_t;
 
 
/**
 * Structure to hold SEI parameters Info
 */
typedef struct
{
 
    WORD8 i1_sei_parameters_present_flag;
 
    WORD8 i1_aud_present_flag;
 
    WORD8 i1_buf_period_params_present_flag;
 
    WORD8 i1_pic_timing_params_present_flag;
 
    WORD8 i1_recovery_point_params_present_flag;
 
    WORD8 i1_active_parameter_set;
 
    WORD8 i4_sei_mastering_disp_colour_vol_params_present_flags;
 
    WORD8 i1_sei_cll_enable;
 
    /* Enable/Disable SEI Hash on the Decoded picture & Hash type */
    /* < 3 : Checksum, 2 : CRC, 1 : MD5, 0 : disable >            */
    /* Other values are not supported                             */
    WORD8 i1_decoded_pic_hash_sei_flag;
 
    /* number of user data e.g. CC data, BAR data, AFD data etc */
    WORD32 i4_sei_user_data_cnt;
 
    WORD8 i1_user_data_registered_present_flag;
 
    WORD8 i1_time_code_present_flag;
 
    buf_period_sei_params_t  s_buf_period_sei_params;
 
    pic_timing_sei_params_t  s_pic_timing_sei_params;
 
    recovery_point_sei_params_t s_recovery_point_params;
 
    active_parameter_set_sei_param_t s_active_parameter_set_sei_params;
 
    hash_sei_param_t    s_hash_sei_params;
 
    content_light_level_info_sei_params_t s_cll_info_sei_params;
 
    mastering_dis_col_vol_sei_params_t s_mastering_dis_col_vol_sei_params;
 
    user_data_registered_itu_t_t35_t as_user_data_registered_itu_t_t35[USER_DATA_MAX];
 
    time_code_t s_time_code;
} sei_params_t;
 
 
/**
 * Sub-layer HRD parameters Info
 */
typedef struct
{
    /**
     * (together with bit_rate_scale) specifies the
     * maximum input bit rate for the i-th CPB
     */
    UWORD32 au4_bit_rate_value_minus1[MAX_CPB_CNT];
    /**
     * together with cpb_size_scale to specify the
     * CPB size when the CPB operates at the access unit level.
     */
    UWORD32 au4_cpb_size_value_minus1[MAX_CPB_CNT];
 
    /**
     * together with cpb_size_du_scale to specify the CPB size
     * when the CPB operates at sub-picture level
     */
    UWORD32 au4_cpb_size_du_value_minus1[MAX_CPB_CNT];
 
    /**
     * specifies the maximum input bit rate for the i-th CPB when the CPB
     * operates at the sub-picture level. bit_rate_du_value_minus1[ i ]
     * shall be in the range of 0 to 2^32 - 2
     */
    UWORD32 au4_bit_rate_du_value_minus1[MAX_CPB_CNT];
 
    /**
     * if 1, specifies that the HSS operates in a constant bit rate (CBR) mode
     * if 0, specifies that the HSS operates in a intermittent bit rate (CBR) mode
     */
    UWORD8  au1_cbr_flag[32];
 
}sub_lyr_hrd_params_t;
 
/**
 * HRD parameters Info
 */
typedef struct
{
    /**
     * Indicates the presence of the
     * num_units_in_ticks, time_scale flag
     */
    UWORD8 u1_timing_info_present_flag;
 
    /**
     * Number of units that
     * correspond to one increment of the
     * clock. Indicates the  resolution
     */
    UWORD32 u4_num_units_in_tick;
 
    /**
     * The number of time units that pass in one second
     */
    UWORD32 u4_time_scale;
 
    /**
     * Nal- hrd parameters flag
     */
    UWORD8 u1_nal_hrd_parameters_present_flag;
 
    /**
     * VCL- hrd parameters flag
     */
    UWORD8 u1_vcl_hrd_parameters_present_flag;
 
    /**
     * Indicates the presence of NAL-HRD params or VCL_HRD params
     * in the bitstream
     */
    UWORD8 u1_cpbdpb_delays_present_flag;
 
    /**
     * specifies that sub-picture level CPB removal delay parameters are
     * present in picture timing SEI messages
     */
    UWORD8 u1_sub_pic_cpb_params_present_flag;
 
    /**
     * specify the clock sub-tick
     * (the minimum interval of time that can be represented in the coded data when sub_pic_cpb_params_present_flag is equal to 1)
     */
    UWORD8 u1_tick_divisor_minus2;
 
    /**
     * specifies the length, in bits for the du cpb delay syntax in pt_sei
     */
    UWORD8 u1_du_cpb_removal_delay_increment_length_minus1;
 
    /**
     * Indicates presence of sub_pic_cpb_params in pic timing sei
     */
    UWORD8 u1_sub_pic_cpb_params_in_pic_timing_sei_flag;
 
    /**
     * specifies the length, in bits, of the pic_dpb_output_du_delay syntax
     * element in the picture timing SEI message and the
     * pic_spt_dpb_output_du_delay syntax element in the decoding unit
     * information SEI message
     */
    UWORD8 u1_dpb_output_delay_du_length_minus1;
 
    /**
     * (together with bit_rate_value_minus1) specifies the
     * maximum input bit rate of the i-th CPB
     */
    UWORD32 u4_bit_rate_scale;
 
    /**
     * (together with cpb_size_du_value_minus1) specfies
     * CPB size of the i-th CPB when the CPB operates
     * at the access unit level
     */
    UWORD32 u4_cpb_size_scale;
 
    /**
     * (together with cpb_size_du_value_minus1) specfies
     * CPB size of the i-th CPB when the CPB operates
     * at the sub-picture level
     */
    UWORD32 u4_cpb_size_du_scale;
 
 
    /**
     * specifies the length, in bits for initial cpb delay (nal/vcl)sysntax in bp sei
     */
    UWORD8  u1_initial_cpb_removal_delay_length_minus1;
 
    /**
     * specifies the length, in bits for the au cpb delay syntax in pt_sei
     */
    UWORD8  u1_au_cpb_removal_delay_length_minus1;
 
    /**
     * specifies the length, in bits, of the pic_dpb_output_delay syntax element in the pt SEI message
     */
    UWORD8  u1_dpb_output_delay_length_minus1;
 
    /**
     * if 1, , for the highest temporal sub-layers, the temporal distance between the HRD output times
     * of consecutive pictures in output order is constrained refer to Table E-6
     */
    UWORD8 au1_fixed_pic_rate_general_flag[VPS_MAX_SUB_LAYERS];
 
    UWORD8 au1_fixed_pic_rate_within_cvs_flag[VPS_MAX_SUB_LAYERS];
 
    /**
     * if 1, , for the highest temporal sub-layers, the temporal distance (in clock ticks) between the
     * element units that specify HRD output times of consecutive pictures in output order is constrained
     * refer to Table E-6
     */
    UWORD16 au2_elemental_duration_in_tc_minus1[VPS_MAX_SUB_LAYERS];
 
    /**
     * specifies the HRD operational mode
     */
    UWORD8 au1_low_delay_hrd_flag[VPS_MAX_SUB_LAYERS];
 
    /**
     * 1 specifies the number of alternative CPB specifications in the
     * bitstream of the cvs when HighestTid is equal to i
     */
    UWORD8 au1_cpb_cnt_minus1[VPS_MAX_SUB_LAYERS];
 
 
    /**
     * VUI level Sub-layer HRD parameters
     */
    sub_lyr_hrd_params_t as_sub_layer_hrd_params[VPS_MAX_SUB_LAYERS];
 
}hrd_params_t;
 
/**
 * Structure to hold VUI parameters Info
 */
typedef struct
{
    /**
     * indicates the presence of aspect_ratio
     */
    UWORD8 u1_aspect_ratio_info_present_flag;
 
    /**
     * specifies the aspect ratio of the luma samples
     */
    UWORD8 u1_aspect_ratio_idc;
 
    /**
     *  width of the luma samples. user dependent
     */
    UWORD16 u2_sar_width;
 
    /**
     *  hieght of the luma samples. user dependent
     */
    UWORD16 u2_sar_height;
 
    /**
     * if 1, specifies that the overscan_appropriate_flag is present
     * if 0, the preferred display method for the video signal is unspecified
     */
    UWORD8 u1_overscan_info_present_flag;
 
    /**
     * if 1,indicates that the cropped decoded pictures output
     * are suitable for display using overscan
     */
    UWORD8 u1_overscan_appropriate_flag;
 
    /**
     * if 1 specifies that video_format, video_full_range_flag and
     * colour_description_present_flag are present
     */
    UWORD8 u1_video_signal_type_present_flag;
 
    /**
     *
     */
    UWORD8 u1_video_format;
 
    /**
     * indicates the black level and range of the luma and chroma signals
     */
    UWORD8 u1_video_full_range_flag;
 
    /**
     * if 1,to 1 specifies that colour_primaries, transfer_characteristics
     * and matrix_coefficients are present
     */
    UWORD8 u1_colour_description_present_flag;
 
    /**
     * indicates the chromaticity coordinates of the source primaries
     */
    UWORD8 u1_colour_primaries;
 
    /**
     * indicates the opto-electronic transfer characteristic of the source picture
     */
    UWORD8 u1_transfer_characteristics;
 
    /**
     * the matrix coefficients used in deriving luma and chroma signals
     * from the green, blue, and red primaries
     */
    UWORD8 u1_matrix_coefficients;
 
    /**
     * if 1, specifies that chroma_sample_loc_type_top_field and
     * chroma_sample_loc_type_bottom_field are present
     */
    UWORD8 u1_chroma_loc_info_present_flag;
 
    /**
     * location of chroma samples
     */
    UWORD8 u1_chroma_sample_loc_type_top_field;
 
    UWORD8 u1_chroma_sample_loc_type_bottom_field;
 
    /**
     * if 1, indicates that the value of all decoded chroma samples is
     * equal to 1 << ( BitDepthC - 1 )
     */
    UWORD8 u1_neutral_chroma_indication_flag;
 
    /**
     * 1 indicates that the coded video sequence conveys pictures that represent fields
     * 0 indicates the pictures that represents field
     */
    UWORD8 u1_field_seq_flag;
 
    /**
     * specifies that picture timing SEI messages are present for every picture
     */
    UWORD8 u1_frame_field_info_present_flag;
 
    /**
     * 1 indicates that the default display window parameters follow next in the VUI
     */
    UWORD8 u1_default_display_window_flag;
 
    /**
     * specify the samples of the pictures in the coded video sequence
     * that are within the default display window,
     * in terms of a rectangular region specified in picture coordinates for display
     */
    UWORD32 u4_def_disp_win_left_offset;
 
    UWORD32 u4_def_disp_win_right_offset;
 
    UWORD32 u4_def_disp_win_top_offset;
 
    UWORD32 u4_def_disp_win_bottom_offset;
 
    /**
     * to 1 specifies that the syntax structure hrd_parameters is present in the vui_parameters syntax structue
     */
    UWORD8 u1_vui_hrd_parameters_present_flag;
 
    /**
     * VUI level HRD parameters
     */
    hrd_params_t s_vui_hrd_parameters;
 
    /**
     * Indicates the presence of the
     * num_units_in_ticks, time_scale flag
     */
    UWORD8 u1_vui_timing_info_present_flag;
 
    /**
     * Number of units that
     * correspond to one increment of the
     * clock. Indicates the  resolution
     */
    UWORD32 u4_vui_num_units_in_tick;
 
    /**
     * The number of time units that pass in one second
     */
    UWORD32 u4_vui_time_scale;
    /**
     * if 1, indicates that the POC for each picture in the coded video sequence (cvs) (not the first picture), in decoding order,
     * is proportional to the output time of the picture relative to that of the first picture in the cvs
     */
    UWORD8 u1_poc_proportional_to_timing_flag;
 
    /**
     * num_ticks_poc_diff_one_minus1 plus 1 specifies the number of clock ticks
     * corresponding to a difference of poc values equal to 1
     */
    UWORD32 u4_num_ticks_poc_diff_one_minus1;
 
    /**
     * 1, specifies that the following cvs bitstream restriction parameters are present
     */
    UWORD8 u1_bitstream_restriction_flag;
 
    /**
     *  if 1, indicates that each pps that is active in the cvs has
     *  the same value of the tile syntax elements
     */
    UWORD8 u1_tiles_fixed_structure_flag;
 
    /**
     * if 0, indicates that no pel outside the pic boundaries and
     * no sub-pels derived using pels outside the pic boundaries is used for inter prediction
     */
    UWORD8 u1_motion_vectors_over_pic_boundaries_flag;
 
    /**
     * if 1, indicates
     * all P/B slices belonging to the same pic have an identical refpic list0,
     * all B slices that belong to the same picture have an identical refpic list1.
     */
    UWORD8 u1_restricted_ref_pic_lists_flag;
 
    /**
     * min_spatial_segmentation_idc, when not equal to 0, establishes a bound on the maximum possible size of distinct
     * coded spatial segmentation regions in the pictures of the CVS. When min_spatial_segmentation_idc is not present, it is
     * inferred to be equal to 0. The value of min_spatial_segmentation_idc shall be in the range of 0 to 4095, inclusive.
     *
     * can be used by a decoder to calculate the maximum number of luma samples to be processed by one processing thread
     *
     * If tiles=0 and entropy_sync=0 then
     *     no slice shall exceed ( 4 * PicSizeInSamplesY ) / minSpatialSegmentationTimes4 luma samples
     *
     * If tiles=1 and entropy_sync=0 then
     *     no tile shall exceed ( 4 * PicSizeInSamplesY ) / minSpatialSegmentationTimes4 luma samples
     *
     * If tiles=0 and entropy_sync=1 then
     *     ( 2 * pic_height_in_luma_samples + pic_width_in_luma_samples ) * CtbSizeY
     *             <= ( 4 * PicSizeInSamplesY ) / minSpatialSegmentationTimes4
     */
    UWORD32 u4_min_spatial_segmentation_idc;
    /**
     * Indicates a number of bytes not exceeded by the sum of the sizes of the VCL NAL units
     * associated with any coded picture
     */
    UWORD8 u1_max_bytes_per_pic_denom;
 
    /**
     * Indicates an upper bound for the number of bits of coding_unit() data
     */
    UWORD8 u1_max_bits_per_mincu_denom;
 
    /**
     * Indicate the maximum absolute value of a decoded horizontal MV component
     * in quarter-pel luma units
     */
    UWORD8 u1_log2_max_mv_length_horizontal;
 
    /**
     * Indicate the maximum absolute value of a decoded vertical MV component
     * in quarter-pel luma units
     */
    UWORD8 u1_log2_max_mv_length_vertical;
}vui_t;
 
/**
 * Picture buffer
 */
typedef struct
{
    UWORD8 *pu1_luma;
    UWORD8 *pu1_chroma;
 
    WORD32 i4_abs_poc;
    WORD32 i4_poc_lsb;
    /** Used to store display Timestamp for current buffer */
    WORD32 u4_ts;
    UWORD8 u1_used_as_ref;
 
    /** Used to idicate if this buffer needed for output */
    UWORD8 u1_pic_output_flag;
 
    UWORD8 u1_free_delay_cnt;
 
    /**
     * buffer ID from buffer manager
     */
    UWORD8 u1_buf_id;
 
 
    // See IV_FLD_TYPE_T for all field types
    UWORD32 e4_fld_type;
 
    sei_params_t s_sei_params;
 
    WORD32 i4_vui_present;
 
    vui_t s_vui;
 
}pic_buf_t;
 
 
/**
 * Reference List
 */
typedef struct
{
    void *pv_pic_buf;
 
    void *pv_mv_buf;
 
    UWORD8 u1_used_as_ref;
 
}ref_list_t;
 
 
/**
 * SAO
 */
typedef struct
{
    /**
     * sao_type_idx_luma
     */
    UWORD32      b3_y_type_idx   : 3;
 
    /**
     * luma SaoOffsetVal[1]
     */
    WORD32      b4_y_offset_1   : 4;
 
    /**
     * luma SaoOffsetVal[2]
     */
    WORD32      b4_y_offset_2   : 4;
 
    /**
     * luma SaoOffsetVal[3]
     */
    WORD32      b4_y_offset_3   : 4;
 
    /**
     * luma SaoOffsetVal[4]
     */
    WORD32      b4_y_offset_4   : 4;
 
    /**
     * luma sao_band_position
     */
    UWORD32      b5_y_band_pos   : 5;
 
    WORD32                      : 0;
 
    /**
     * sao_type_idx_chroma
     */
    UWORD32      b3_cb_type_idx  : 3;
 
    /**
     * chroma SaoOffsetVal[1]
     */
    WORD32      b4_cb_offset_1  : 4;
 
    /**
     * chroma SaoOffsetVal[2]
     */
    WORD32      b4_cb_offset_2  : 4;
 
    /**
     * chroma SaoOffsetVal[3]
     */
    WORD32      b4_cb_offset_3  : 4;
 
    /**
     * chroma SaoOffsetVal[4]
     */
    WORD32      b4_cb_offset_4  : 4;
 
    /**
     * cb sao_band_position
     */
    UWORD32      b5_cb_band_pos  : 5;
 
    WORD32                      : 0;
 
    /**
     * sao_type_idx_chroma
     */
    UWORD32      b3_cr_type_idx  : 3;
 
    /**
     * chroma SaoOffsetVal[1]
     */
    WORD32      b4_cr_offset_1  : 4;
 
    /**
     * chroma SaoOffsetVal[2]
     */
    WORD32      b4_cr_offset_2  : 4;
 
    /**
     * chroma SaoOffsetVal[3]
     */
    WORD32      b4_cr_offset_3  : 4;
 
    /**
     * chroma SaoOffsetVal[4]
     */
    WORD32      b4_cr_offset_4  : 4;
 
    /**
     * cr sao_band_position
     */
    UWORD32      b5_cr_band_pos  : 5;
 
    WORD32                      : 0;
 
}sao_t;
 
/**
 * SAO
 */
typedef struct
{
    /**
     * sao_type_idx_luma
     */
    UWORD32      b3_y_type_idx   : 3;
 
    /**
     * luma SaoOffsetVal[1]
     */
    WORD32      b8_y_offset_1   : 8;
 
    /**
     * luma SaoOffsetVal[2]
     */
    WORD32      b8_y_offset_2   : 8;
 
    /**
     * luma SaoOffsetVal[3]
     */
    WORD32      b8_y_offset_3   : 8;
 
    /**
     * luma SaoOffsetVal[4]
     */
    WORD32      b8_y_offset_4   : 8;
 
    /**
     * luma sao_band_position
     */
    UWORD32      b5_y_band_pos   : 5;
 
    WORD32                      : 0;
 
    /**
     * sao_type_idx_chroma
     */
    UWORD32      b3_cb_type_idx  : 3;
 
    /**
     * chroma SaoOffsetVal[1]
     */
    WORD32      b8_cb_offset_1  : 8;
 
    /**
     * chroma SaoOffsetVal[2]
     */
    WORD32      b8_cb_offset_2  : 8;
 
    /**
     * chroma SaoOffsetVal[3]
     */
    WORD32      b8_cb_offset_3  : 8;
 
    /**
     * chroma SaoOffsetVal[4]
     */
    WORD32      b8_cb_offset_4  : 8;
 
    /**
     * cb sao_band_position
     */
    UWORD32      b5_cb_band_pos  : 5;
 
    WORD32                      : 0;
 
    /**
     * sao_type_idx_chroma
     */
    UWORD32      b3_cr_type_idx  : 3;
 
    /**
     * chroma SaoOffsetVal[1]
     */
    WORD32      b8_cr_offset_1  : 8;
 
    /**
     * chroma SaoOffsetVal[2]
     */
    WORD32      b8_cr_offset_2  : 8;
 
    /**
     * chroma SaoOffsetVal[3]
     */
    WORD32      b8_cr_offset_3  : 8;
 
    /**
     * chroma SaoOffsetVal[4]
     */
    WORD32      b8_cr_offset_4  : 8;
 
    /**
     * cr sao_band_position
     */
    UWORD32      b5_cr_band_pos  : 5;
 
    WORD32                      : 0;
 
}sao_10bd_t;
 
/**
 * Motion vector
 */
typedef struct
{
    /**
     * Horizontal Motion Vector
     */
    WORD16 i2_mvx;
 
    /**
     * Vertical Motion Vector
     */
    WORD16 i2_mvy;
}mv_t;
 
/*****************************************************************************/
/* Following results in packed 48 bit structure. If mv_t included            */
/*  ref_pic_buf_id, then 8 bits will be wasted for each mv for aligning.     */
/*  Also using mv_t as elements directly instead of a pointer to l0 and l1   */
/*  mvs. Since pointer takes 4 bytes and MV itself is 4 bytes. It does not   */
/*  really help using pointers.                                              */
/*****************************************************************************/
 
/**
 * PU Motion Vector info
 */
typedef struct
{
    /**
     *  L0 Motion Vector
     */
    mv_t s_l0_mv;
 
    /**
     *  L1 Motion Vector
     */
    mv_t s_l1_mv;
 
    /**
     *  L0 Ref index
     */
    WORD8   i1_l0_ref_idx;
 
    /**
     *  L1 Ref index
     */
    WORD8   i1_l1_ref_idx;
 
    /**
     *  L0 Ref Pic Buf ID
     */
    WORD8 i1_l0_ref_pic_buf_id;
 
    /**
     *  L1 Ref Pic Buf ID
     */
    WORD8 i1_l1_ref_pic_buf_id;
 
}pu_mv_t;
 
/**
 * PU information
 */
typedef struct
{
 
    /**
     *  PU motion vectors
     */
    pu_mv_t     mv;
 
    /**
     *  PU X position in terms of min PU (4x4) units
     */
    UWORD32     b4_pos_x        : 4;
 
    /**
     *  PU Y position in terms of min PU (4x4) units
     */
    UWORD32     b4_pos_y        : 4;
 
    /**
     *  PU width in pixels = (b4_wd + 1) << 2
     */
    UWORD32     b4_wd           : 4;
 
    /**
     *  PU height in pixels = (b4_ht + 1) << 2
     */
    UWORD32     b4_ht           : 4;
 
    /**
     *  Intra or Inter flag for each partition - 0 or 1
     */
    UWORD32     b1_intra_flag   : 1;
 
 
    /**
     *  PRED_L0, PRED_L1, PRED_BI - Initialized in parsing only for MVP case
     */
    UWORD32     b2_pred_mode    : 2;
 
 
    /**
     *  Merge flag for each partition - 0 or 1
     */
    UWORD32     b1_merge_flag   : 1;
 
    /**
     *  Merge index for each partition - 0 to 4
     */
    UWORD32     b3_merge_idx    : 3;
 
    /*************************************************************************/
    /* Following two flags can be overloaded with b3_merge_idx if there      */
    /* is need for additional bits                                           */
    /*************************************************************************/
 
    /**
     *  If merge is zero, following gives presence of mvd for L0 MV
     */
    UWORD32     b1_l0_mvp_idx   : 1;
 
    /**
     *  If merge is zero, following gives presence of mvd for L1 MV
     */
    UWORD32     b1_l1_mvp_idx   : 1;
 
    /**
     * Partition mode - Needed during MV merge stage
     * Note: Part mode can be derived using pu_wd, pu_ht and minCB size
     * If there is a need for bits, the following can be removed at the cost
     * of more control code in MV Merge
     */
    UWORD32      b3_part_mode    : 3;
 
    /**
     * Partition index - Needed during MV merge stage
     */
    UWORD32      b2_part_idx     : 2;
 
}pu_t;
 
/**
 * TU information
 */
typedef struct
{
    /**
     *  TU X position in terms of min TU (4x4) units
     */
    UWORD32      b4_pos_x            : 4;
 
    /**
     *  TU Y position in terms of min TU (4x4) units
     */
    UWORD32     b4_pos_y            : 4;
 
    /*************************************************************************/
    /* Luma TU size (width or height) = 1 << (b3_size + 2)                   */
    /*   i.e. 0 : 4, 1 : 8, 2: 16, 3: 32, 4: 64                              */
    /* Note: Though 64 x 64 TU is not possible, this size is supported to    */
    /* signal SKIP CUs or PCM CUs etc where transform is not called          */
    /* Chroma width will be half of luma except for 4x4 luma                 */
    /*************************************************************************/
    /**
     * Luma TU size (width or height)
     */
    UWORD32     b3_size             : 3; //To be changed.
 
    /*************************************************************************/
    /* Chroma present : For 4x4 Luma TUs only the fourth one contains Cb     */
    /* Cr info. For the first three TUs in 8x8 (for 4x4 luma) this will      */
    /* be zero. For all the other cases this will be 1                       */
    /*************************************************************************/
    /**
     * 4x4 Luma TUs only the fourth one contains cb,cr
     * TODO: Check if this is really needed, cb_cbf and cr_cbf should be enough
     */
 
    /**
     *  Y CBF
     */
    UWORD32      b1_y_cbf            : 1;
 
    /**
     *  Cb CBF
     */
    UWORD32      b1_cb_cbf           : 1;
 
#ifdef ENABLE_MAIN_REXT_PROFILE
    UWORD32      b1_cb_cbf_subtu1          : 1;
#endif
 
    /**
     *  Cr CBF
     */
    UWORD32     b1_cr_cbf           : 1;
 
#ifdef ENABLE_MAIN_REXT_PROFILE
    UWORD32     b1_cr_cbf_subtu1          : 1;
#endif
 
    /**
     *  Flag to indicate if it is the first TU in a CU
     */
    UWORD32     b1_first_tu_in_cu       : 1;
 
    /**
     *  Transform quant bypass flag
     */
    UWORD32     b1_transquant_bypass  : 1;
 
    /**
     *  Y Qp
     */
    //UWORD32     b6_qp               : 6; // BUG_FIX related to nighbour QP's in case of negative QP for HBD.
    WORD32     b7_qp               : 7;
 
 
    /**
     *  Luma Intra Mode 0 - 34
     */
    UWORD32    b6_luma_intra_mode      : 6;
 
    /*************************************************************************/
    /* Chroma Intra Mode Index 0 - 4: Actual mode (0, 1, 10, 26, 34, X) to be*/
    /* derived using luma_intra_mode and the following                       */
    /*************************************************************************/
    /**
     * Chroma Intra Mode Index 0 - 4
     */
    UWORD32    b3_chroma_intra_mode_idx    : 3;
 
}tu_t;
 
/**
 * CU information
 */
typedef struct
{
 
    /**
     *  CU X position in terms of min CU (8x8) units
     */
    UWORD32 b3_cu_pos_x :3;
 
    /**
     *  CU Y position in terms of min CU (8x8) units
     */
    UWORD32 b3_cu_pos_y :3;
 
    /**
     *  CU size in terms of min CU (8x8) units
     */
    UWORD32 b4_cu_size :4;
 
    /**
     *  transquant bypass flag ; 0 for this encoder
     */
    UWORD32 b1_tq_bypass_flag :1;
 
    /**
     *  CU skip flag
     */
    UWORD32 b1_skip_flag :1;
 
    /**
     *  intra / inter CU flag
     */
    UWORD32 b1_pred_mode_flag :1;
 
    /**
     *  indicates partition information for CU
     *  For intra 0 : for 2Nx2N / 1 for NxN iff CU=minCBsize
     *  For inter 0 : @sa PART_SIZE_E
     */
    UWORD32 b3_part_mode :3;
 
    /**
     *  0 for this encoder
     */
    UWORD32 b1_pcm_flag :1;
 
    /**
     *  only applicable for intra cu
     */
    UWORD32 b3_chroma_intra_pred_mode :3;
 
    /**
     * only applicable for intra cu
     */
    UWORD32 b1_prev_intra_luma_pred_flag0 :1;
 
    /**
     * only applicable for intra cu and pred_mode=NxN
     */
    UWORD32 b1_prev_intra_luma_pred_flag1 :1;
 
    /**
     * only applicable for intra cu and pred_mode=NxN
     */
    UWORD32 b1_prev_intra_luma_pred_flag2 :1;
 
    /**
     * only applicable for intra cu and pred_mode=NxN
     */
    UWORD32 b1_prev_intra_luma_pred_flag3 :1;
 
    /**
     *  only applicable for luma intra cu
     */
    UWORD32 b2_mpm_idx0 :2;
 
    /**
     *  only applicable for intra cu and pred_mode=NxN
     */
    UWORD32 b2_mpm_idx1 :2;
 
    /**
     *  only applicable for intra cu and pred_mode=NxN
     */
    UWORD32 b2_mpm_idx2 :2;
 
    /**
     *  only applicable for intra cu and pred_mode=NxN
     */
    UWORD32 b2_mpm_idx3 :2;
 
    /**
     *  only applicable for intra cu
     */
    UWORD32 b5_rem_intra_pred_mode0 :5;
 
    /**
     *  only applicable for intra cu and pred_mode=NxN
     */
    UWORD32 b5_rem_intra_pred_mode1 :5;
 
    /**
     *  only applicable for intra cu and pred_mode=NxN
     */
    UWORD32 b5_rem_intra_pred_mode2 :5;
 
    /**
     *  only applicable for intra cu and pred_mode=NxN
     */
    UWORD32 b5_rem_intra_pred_mode3 :5;
 
    /**
     *  no residue flag for cu
     */
    UWORD32 b1_no_residual_syntax_flag :1;
 
}cu_t;
 
/*****************************************************************************/
/* Since the following data will be accessed linearly (no random access      */
/*  is needed for this) there is no need to store a frame level offset for   */
/*  each CTB's TU data. Only a pointer to this is stored in CTB's structure  */
/*****************************************************************************/
 
typedef struct
{
    /*************************************************************************/
    /* Number of TUs filled in as_tu                                         */
    /* Having the first entry as 32 bit data, helps in keeping each of       */
    /* the structures aligned to 32 bits at CTB level                        */
    /*************************************************************************/
    /**
     * Number of TUs filled in as_tu
     */
    WORD32 i4_tu_cnt;
 
    /**
     *  Array to map each min TU unit to a corresponding entry in as_tu
     */
    UWORD8 au1_tu_map[MAX_TU_IN_CTB];
 
    /*************************************************************************/
    /* TU level information                                                  */
    /* Though the allocation for as_pu as done to handle worst case data,    */
    /* only valid number of TUs will be filled in the following array.       */
    /* Next CTB starts after the valid as_tu entries                         */
    /*************************************************************************/
    /**
     *  TU level information
     */
    tu_t as_tu[MAX_TU_IN_CTB];
 
}ctb_tu_list_t;
 
/*****************************************************************************/
/* Info from last TU row of CTB is stored in a row level neighbour buffer    */
/* , which will be used for Boundary Strength computation                    */
/*****************************************************************************/
/**
 *  CTB neighbor info
 */
typedef struct
{
    /**
     *  Slice index of the ctb
     */
    UWORD16 u2_slice_idx;
 
    /*************************************************************************/
    /* CBF of bottom TU row (replicated in 4 pixel boundary)                 */
    /* MSB contains CBF of first TU in the last row and LSB contains CBF     */
    /* of last TU in the last row                                            */
    /*************************************************************************/
    /**
     * CBF of bottom TU row
     */
    UWORD16 u2_packed_cbf;
 
    /*************************************************************************/
    /* QP of bottom TU row (replicated at 8 pixel boundary (Since QP can     */
    /* not change at less than min CU granularity)                           */
    /*************************************************************************/
    /**
     * QP of bottom TU row
     */
    UWORD8 au1_qp[MAX_CU_IN_CTB_ROW];
 
}ctb_top_ny_info_t;
 
/**
 *  CTB level info
 */
typedef struct _ctb_t
{
    /*************************************************************************/
    /* Tile boundary can be detected by looking at tile start x and tile     */
    /* start y.  And based on the tile, slice and frame boundary the         */
    /* following will be initialized.                                        */
    /*************************************************************************/
    /**
     *  Pointer to left CTB
     */
    /*  If not available, this will be set to NULL   */
    struct _ctb_t *ps_ctb_left;
 
    /**
     *  Pointer to top-left CTB
     */
    /* If not available, this will be set to NULL   */
    ctb_top_ny_info_t *ps_ctb_ny_topleft;
 
    /**
     *  Pointer to top CTB
     */
    /* If not available, this will be set to NULL  */
    ctb_top_ny_info_t *ps_ctb_ny_top;
 
    /**
     *  Pointer to top-right CTB
     */
    /* If not available, this will be set to NULL */
    ctb_top_ny_info_t *ps_ctb_ny_topright;
 
    /*************************************************************************/
    /* Pointer to PU data.                                                   */
    /* This points to a MV Bank stored at frame level. Though this           */
    /* pointer can be derived by reading offset at frame level, it is        */
    /* stored here for faster access. Can be removed if storage of CTB       */
    /* structure is critical                                                 */
    /*************************************************************************/
    /**
     * Pointer to PU data
     */
    pu_t *ps_pu;
 
    /*************************************************************************/
    /* Pointer to a PU map stored at frame level,                            */
    /* Though this pointer can be derived by multiplying CTB adress with     */
    /* number of minTUs in a CTB, it is stored here for faster access.       */
    /* Can be removed if storage of CTB structure is critical                */
    /*************************************************************************/
    /**
     * Pointer to a PU map stored at frame level
     */
    UWORD8 *pu1_pu_map;
 
    /**
     *  Number of TUs filled in as_tu
     */
    /*************************************************************************/
    /* Having the first entry as 32 bit data, helps in keeping each of       */
    /* the structures aligned to 32 bits at CTB level                        */
    /*************************************************************************/
    WORD32 i4_tu_cnt;
 
    /**
     *  Array to map each min TU unit to a corresponding entry in as_tu
     */
    UWORD8 *pu1_tu_map;
 
    /**
     *  TU level information
     */
    /*************************************************************************/
    /* Though the allocation for as_pu as done to handle worst case data,    */
    /* only valid number of TUs will be filled in the following array.       */
    /* Next CTB starts after the valid as_tu entries                         */
    /*************************************************************************/
    tu_t *ps_tu;
 
    /**
     *  Pointer to transform coeff data
     */
    /*************************************************************************/
    /* Following format is repeated for every coded TU                       */
    /* Luma Block                                                            */
    /* num_coeffs      : 16 bits                                             */
    /* zero_cols       : 8 bits ( 1 bit per 4 columns)                       */
    /* sig_coeff_map   : ((TU Size * TU Size) + 31) >> 5 number of WORD32s   */
    /* coeff_data      : Non zero coefficients                               */
    /* Cb Block (only for last TU in 4x4 case else for every luma TU)        */
    /* num_coeffs      : 16 bits                                             */
    /* zero_cols       : 8 bits ( 1 bit per 4 columns)                       */
    /* sig_coeff_map   : ((TU Size * TU Size) + 31) >> 5 number of WORD32s   */
    /* coeff_data      : Non zero coefficients                               */
    /* Cr Block (only for last TU in 4x4 case else for every luma TU)        */
    /* num_coeffs      : 16 bits                                             */
    /* zero_cols       : 8 bits ( 1 bit per 4 columns)                       */
    /* sig_coeff_map   : ((TU Size * TU Size) + 31) >> 5 number of WORD32s   */
    /* coeff_data      : Non zero coefficients                               */
    /*************************************************************************/
    void            *pv_coeff_data;
 
    /**
     *  Slice to which the CTB belongs to
     */
    WORD32 i4_slice_idx;
 
    /**
     *  CTB column position
     */
    WORD32 i4_pos_x;
 
    /**
     *  CTB row position
     */
    WORD32 i4_pos_y;
 
    /**
     *  Number of PUs filled in ps_pu
     */
    WORD32 i4_pu_cnt;
 
    /**
     *  Index of current PU being processed in ps_pu
     */
    /*  Scratch variable set to 0 at the start of any PU processing function */
    WORD32 i4_pu_idx;
 
    /**
     * Vertical Boundary strength
     */
    /* Two bits per edge.
    Stored in format. BS[15] | BS[14] | .. |BS[0]*/
    UWORD32 *pu4_vert_bs;
 
    /**
     * Horizontal Boundary strength
     */
 
    /* Two bits per edge.
    Stored in format. BS[15] | BS[14] | .. |BS[0]*/
    UWORD32 *pu4_horz_bs;
 
    /**
     *  Qp array stored for each 8x8 pixels
     */
    UWORD8 *pu1_qp;
 
    /**
     *  Pointer to current frame's pu_t array
     */
    pu_t *ps_frm_pu;
 
    /**
     * Pointer to current frame's pu_t index array, which stores starting index
     * of pu_t for every CTB
     */
    UWORD32 *pu4_frm_pu_idx;
 
    /**
     *  Pointer to current frame's pu map array
     */
    UWORD8 *pu1_frm_pu_map;
 
    /*************************************************************************/
    /* Need to add encoder specific elements for identifying the order of    */
    /* coding for CU, TU and PU if any                                       */
    /*************************************************************************/
}ctb_t;
 
/*****************************************************************************/
/* The following can be used to typecast coefficient data that is stored     */
/*  per subblock. Note that though i2_level is shown as an array that        */
/*  holds 16 coefficients, only the first few entries will be valid. Next    */
/*  subblocks data starts after the valid number of coefficients. Number     */
/*  of non-zero coefficients will be derived using number of non-zero bits   */
/*  in sig coeff map                                                         */
/*****************************************************************************/
/**
 * Structure to hold coefficient info for a 4x4 subblock
 */
typedef struct
{
    /**
     * sub block position
     */
    UWORD16 u2_subblk_pos;
 
    /**
     * significant coefficient map
     */
    UWORD16 u2_sig_coeff_map;
 
    /**
     * holds 16 coefficients
     */
    WORD16  ai2_level[SUBBLK_COEFF_CNT];
}tu_sblk_coeff_data_t;
 
 
/*************************************************************************/
/* The following describes how each of the CU cases are handled          */
/*************************************************************************/
 
/*************************************************************************/
/* For SKIP CU                                                           */
/* One Inter PU with appropriate MV                                      */
/* One TU which says Y, Cb and Cr CBF is zero with size equal to CB size */
/*************************************************************************/
 
/*************************************************************************/
/* For Inter CU                                                          */
/* M Inter PU with appropriate MVs (M between 1 to 4)                    */
/* N TU (N is number of TU in CU)                                        */
/*************************************************************************/
 
/*************************************************************************/
/* For Intra CU                                                          */
/* N TU (N is number of TU in CU)                                        */
/* N Intra PU with appropriate pred modes for luma and chroma            */
/*************************************************************************/
 
/*************************************************************************/
/* For Intra PCM CU                                                      */
/* One TU which says transquant bypass is 1  with size equal to CB size  */
/* 1 Intra PU with pcm flag set to 1(which ensures no intra pred is done)*/
/*************************************************************************/
 
/*************************************************************************/
/* For a CU where cu_transquant_bypass_flag is 1                         */
/* One TU which says transquant bypass is 1  with size equal to CB size  */
/* N Intra/Inter PUs                                                     */
/*************************************************************************/
 
/*************************************************************************/
/* For a CU where no_residual_syntax_flag is 1                           */
/* One TU which says Y, Cb, Cr CBF is 0  with size equal to CB size      */
/* N Inter PUs                                                           */
/*************************************************************************/
 
 
/**
 * Structure giving information about the tile
 */
typedef struct
{
    /* X position of the tile in the current frame in CTB units */
    UWORD8 u1_pos_x;
 
    /* Y position of the tile in the current frame in CTB units */
    UWORD8 u1_pos_y;
 
    /* Tile width in CTB units */
    UWORD16 u2_wd;
 
    /* Tile height in CTB units */
    UWORD16 u2_ht;
 
}tile_t;
 
/**
 * Structure to hold Profile tier level info for a given layer
 */
 
typedef struct
{
    /**
     *  NAL unit type
     */
    WORD8 i1_nal_unit_type;
 
    /**
     *  NAL temporal id
     */
    WORD8 i1_nuh_temporal_id;
}nal_header_t;
 
/**
 * Structure to hold Profile tier level info for a given layer
 */
 
typedef struct
{
    /**
     *  profile_space
     */
    WORD8 i1_profile_space;
 
    /**
     *  tier_flag
     */
    WORD8 i1_tier_flag;
 
    /**
     *  profile_idc
     */
    WORD8 i1_profile_idc;
 
    /**
     *  profile_compatibility_flag[]
     */
    WORD8 ai1_profile_compatibility_flag[MAX_PROFILE_COMPATBLTY];
 
    /**
     * progressive_source_flag
     */
    WORD8 i1_general_progressive_source_flag;
 
    /**
     * interlaced_source_flag
     */
    WORD8 i1_general_interlaced_source_flag;
 
    /**
     * non_packed_constraint_flag
     */
    WORD8 i1_general_non_packed_constraint_flag;
 
    /**
     * frame_only_constraint_flag
     */
    WORD8 i1_frame_only_constraint_flag;
 
    /**
     * general_max_12bit_constraint_flag
     */
    WORD8 i1_general_max_12bit_constraint_flag;
 
    /**
     * general_max_10bit_constraint_flag
     */
    WORD8 i1_general_max_10bit_constraint_flag;
 
    /**
     * general_max_8bit_constraint_flag
     */
    WORD8 i1_general_max_8bit_constraint_flag;
 
    /**
     * general_max_422chroma_constraint_flag
     */
    WORD8 i1_general_max_422chroma_constraint_flag;
 
    /**
     * general_max_420chroma_constraint_flag
     */
    WORD8 i1_general_max_420chroma_constraint_flag;
 
    /**
     * general_max_monochrome_constraint_flag
     */
    WORD8 i1_general_max_monochrome_constraint_flag;
 
    /**
     * general_intra_constraint_flag
     */
    WORD8 i1_general_intra_constraint_flag;
 
    /**
     * general_one_picture_only_constraint_flag
     */
    WORD8 i1_general_one_picture_only_constraint_flag;
 
    /**
     * general_lower_bit_rate_constraint_flag
     */
    WORD8 i1_general_lower_bit_rate_constraint_flag;
 
    /**
     *  level_idc
     */
    UWORD8 u1_level_idc;
}profile_tier_lvl_t;
 
/**
 * Structure to hold Profile tier level info for all layers
 */
typedef struct
{
    /**
     *  Profile and tier information for general
     */
    profile_tier_lvl_t s_ptl_gen;
 
    /**
     *  sub_layer_profile_present_flag[]
     */
    WORD8 ai1_sub_layer_profile_present_flag[VPS_MAX_SUB_LAYERS - 1];
 
    /**
     *  sub_layer_level_present_flag[]
     */
    WORD8 ai1_sub_layer_level_present_flag[VPS_MAX_SUB_LAYERS - 1];
 
    /**
     *  Profile and tier information for sub layers
     */
    profile_tier_lvl_t as_ptl_sub[VPS_MAX_SUB_LAYERS - 1];
 
}profile_tier_lvl_info_t;
 
/**
 * Structure to hold short term reference picture set info
 */
typedef struct
{
    /**
     *  delta_poc_s0_minus1[ i ] and delta_poc_s1_minus1[ i ]
     */
    WORD16 ai2_delta_poc[MAX_DPB_SIZE];
 
    /**
     *  inter_ref_pic_set_prediction_flag
     */
    WORD8 i1_inter_ref_pic_set_prediction_flag;
 
    /**
     *  num_negative_pics
     */
    WORD8 i1_num_neg_pics;
 
    /**
     *  num_positive_pics
     */
    WORD8 i1_num_pos_pics;
 
    /**
     *  used_by_curr_pic_s0_flag[ i ] and used_by_curr_pic_s1_flag[i]
     */
    WORD8 ai1_used[MAX_DPB_SIZE];
 
    /**
     *  Ref Idc
     */
    WORD8 ai1_ref_idc[MAX_DPB_SIZE];
 
    /**
     *  Sum of positive and negative pics for each refence
     */
    WORD8 i1_num_delta_pocs;
 
    /**
     *  Number of ref_idc
     */
    WORD8 i1_num_ref_idc;
}stref_picset_t;
 
/**
 * Structure to hold weighted prediction info such as weights and offsets
 */
typedef struct
{
    /** luma_log2_weight_denom */
    WORD8 i1_luma_log2_weight_denom;
 
    /** delta_chroma_log2_weight_denom */
    WORD8 i1_chroma_log2_weight_denom;
 
#ifdef ENABLE_MAIN_REXT_PROFILE
    /** WpOffsetBdShiftY */
    WORD8 i1_wp_ofst_bd_shift_luma;
 
    /** WpOffsetBdShiftC */
    WORD8 i1_wp_ofst_bd_shift_chroma;
 
    /** WpOffsetHalfRangeY */
    WORD32 i4_wp_ofst_half_rng_luma;
 
    /** WpOffsetHalfRangeC */
    WORD32 i4_wp_ofst_half_rng_chroma;
#endif
 
    /** luma_weight_l0_flag[ i ] */
    WORD8 i1_luma_weight_l0_flag[MAX_DPB_SIZE];
 
    /** chroma_weight_l0_flag[ i ] */
    WORD8 i1_chroma_weight_l0_flag[MAX_DPB_SIZE];
 
    /** delta_luma_weight_l0[ i ] */
    WORD16 i2_luma_weight_l0[MAX_DPB_SIZE];
 
    /** luma_offset_l0[ i ] */
    WORD16 i2_luma_offset_l0[MAX_DPB_SIZE];
 
    /** delta_chroma_weight_l0[ i ][ j ] */
    WORD16 i2_chroma_weight_l0_cb[MAX_DPB_SIZE];
 
    /** delta_chroma_offset_l0[ i ][ j ] */
    WORD16 i2_chroma_offset_l0_cb[MAX_DPB_SIZE];
 
    /** delta_chroma_weight_l0[ i ][ j ] */
    WORD16 i2_chroma_weight_l0_cr[MAX_DPB_SIZE];
 
    /** delta_chroma_offset_l0[ i ][ j ] */
    WORD16 i2_chroma_offset_l0_cr[MAX_DPB_SIZE];
 
    /** luma_weight_l1_flag[ i ] */
    WORD8 i1_luma_weight_l1_flag[MAX_DPB_SIZE];
 
    /** chroma_weight_l1_flag[ i ] */
    WORD8 i1_chroma_weight_l1_flag[MAX_DPB_SIZE];
 
    /** delta_luma_weight_l1[ i ] */
    WORD16 i2_luma_weight_l1[MAX_DPB_SIZE];
 
    /** luma_offset_l1[ i ] */
    WORD16 i2_luma_offset_l1[MAX_DPB_SIZE];
 
    /** delta_chroma_weight_l1[ i ][ j ] */
    WORD16 i2_chroma_weight_l1_cb[MAX_DPB_SIZE];
 
    /** delta_chroma_offset_l1[ i ][ j ] */
    WORD16 i2_chroma_offset_l1_cb[MAX_DPB_SIZE];
 
    /** delta_chroma_weight_l1[ i ][ j ] */
    WORD16 i2_chroma_weight_l1_cr[MAX_DPB_SIZE];
 
    /** delta_chroma_offset_l1[ i ][ j ] */
    WORD16 i2_chroma_offset_l1_cr[MAX_DPB_SIZE];
 
}pred_wt_ofst_t;
 
 
/**
 * Structure to hold Reference picture list modification info
 */
typedef struct
{
    /* ref_pic_list_modification_flag_l0 */
    WORD8 i1_ref_pic_list_modification_flag_l0;
 
    /* list_entry_l0[ i ] */
    WORD8 i1_list_entry_l0[16];
 
    /* ref_pic_list_modification_flag_l1 */
    WORD8 i1_ref_pic_list_modification_flag_l1;
 
    /* list_entry_l1[ i ] */
    WORD8 i1_list_entry_l1[16];
 
    /* Reference POC values for L0,L1 */
    WORD32 i4_ref_poc_l0[16];
    WORD32 i4_ref_poc_l1[16];
}rplm_t;
 
 
/**
 * Structure to hold VPS info
 */
typedef struct
{
    /**
     *  video_parameter_set_id
     */
    WORD8 i1_vps_id;
 
    /**
     *  vps_temporal_id_nesting_flag
     */
    WORD8 i1_vps_temporal_id_nesting_flag;
    /**
     * sub_layer_ordering_info_present_flag
     */
    WORD8 i1_sub_layer_ordering_info_present_flag;
    /**
     *  vps_max_sub_layers_minus1
     */
    WORD8 i1_vps_max_sub_layers;
 
    /**
     *  vps_max_dec_pic_buffering
     */
    WORD8 ai1_vps_max_dec_pic_buffering[VPS_MAX_SUB_LAYERS];
 
    /**
     *  vps_max_num_reorder_pics
     */
    WORD8 ai1_vps_max_num_reorder_pics[VPS_MAX_SUB_LAYERS];
 
    /**
     *  vps_max_latency_increase
     */
    WORD8 ai1_vps_max_latency_increase[VPS_MAX_SUB_LAYERS];
 
    /**
     *  vps_num_hrd_parameters
     */
    WORD8 i1_vps_num_hrd_parameters;
 
    /**
     * vps_max_nuh_reserved_zero_layer_id
     */
    WORD8 i1_vps_max_nuh_reserved_zero_layer_id;
 
    /**
     * vps_num_op_sets
     */
    WORD8 i1_vps_num_op_sets;
 
    /**
     * layer_id_included_flag
     */
    //WORD8 ai1_layer_id_included_flag[2][MAX_NUH_LAYERS];
    /**
     *  Profile, Tier and Level info
     */
    profile_tier_lvl_info_t s_ptl;
 
    /**
     * bit_rate_info_present_flag[i]
     */
    WORD8 ai1_bit_rate_info_present_flag[VPS_MAX_SUB_LAYERS];
 
    /**
     * pic_rate_info_present_flag[i]
     */
    WORD8 ai1_pic_rate_info_present_flag[VPS_MAX_SUB_LAYERS];
 
    /**
     * avg_bit_rate[i]
     */
    UWORD16 au2_avg_bit_rate[VPS_MAX_SUB_LAYERS];
 
    /**
     * max_bit_rate[i]
     */
    UWORD16 au2_max_bit_rate[VPS_MAX_SUB_LAYERS];
 
    /**
     * constant_pic_rate_idc[i]
     */
    WORD8 ai1_constant_pic_rate_idc[VPS_MAX_SUB_LAYERS];
 
    /**
     * avg_pic_rate[i]
     */
    UWORD16 au2_avg_pic_rate[VPS_MAX_SUB_LAYERS];
}vps_t;
 
 
/**
 * Structure to hold SPS info
 */
typedef struct
{
    /**
     * pic_width_in_luma_samples
     */
    WORD16 i2_pic_width_in_luma_samples;
 
    /**
     *  pic_height_in_luma_samples
     */
    WORD16 i2_pic_height_in_luma_samples;
 
    /**
     *  pic_crop_left_offset
     */
    WORD16 i2_pic_crop_left_offset;
 
    /**
     *  pic_crop_right_offset
     */
    WORD16 i2_pic_crop_right_offset;
 
    /**
     *  pic_crop_top_offset
     */
    WORD16 i2_pic_crop_top_offset;
 
    /**
     *  pic_crop_bottom_offset
     */
    WORD16 i2_pic_crop_bottom_offset;
 
    /**
     *  seq_parameter_set_id
     */
    WORD8 i1_sps_id;
 
    /**
     *  video_parameter_set_id
     */
    WORD8 i1_vps_id;
 
    /**
     *  sps_max_sub_layers_minus1
     */
    WORD8 i1_sps_max_sub_layers;
 
    /**
     *  chroma_format_idc
     */
    WORD8 i1_chroma_format_idc;
 
    /**
     * Bit depth of luma samples
     */
    WORD8 i1_bit_depth_luma_minus8;
 
    /**
     * Bit depth of chrma samples
     */
    WORD8 i1_bit_depth_chroma_minus8;
 
    /* separate_colour_plane_flag */
    WORD8 i1_separate_colour_plane_flag;
 
    /**
     *  pic_cropping_flag
     */
    WORD8 i1_pic_cropping_flag;
 
    /**
     *  pcm_enabled_flag
     */
    WORD8 i1_pcm_enabled_flag;
 
    /**
     *  pcm_sample_bit_depth_luma
     */
    WORD8 i1_pcm_sample_bit_depth_luma;
 
    /**
     *  pcm_sample_bit_depth_chroma
     */
    WORD8 i1_pcm_sample_bit_depth_chroma;
 
    /**
     *  log2_max_pic_order_cnt_lsb_minus4
     */
    WORD8 i1_log2_max_pic_order_cnt_lsb;
    /**
     * sps_sub_layer_ordering_info_present_flag
     */
    WORD8 i1_sps_sub_layer_ordering_info_present_flag;
    /**
     *  sps_max_dec_pic_buffering
     */
    WORD8 ai1_sps_max_dec_pic_buffering[SPS_MAX_SUB_LAYERS];
 
    /**
     *  sps_max_num_reorder_pics
     */
    WORD8 ai1_sps_max_num_reorder_pics[SPS_MAX_SUB_LAYERS];
 
    /**
     *  sps_max_latency_increase
     */
    WORD8 ai1_sps_max_latency_increase[SPS_MAX_SUB_LAYERS];
 
    /**
     *  log2_min_coding_block_size_minus3
     */
    WORD8 i1_log2_min_coding_block_size;
 
    /**
     *  log2_diff_max_min_coding_block_size
     */
    WORD8 i1_log2_diff_max_min_coding_block_size;
 
    /**
     *  log2_min_transform_block_size_minus2
     */
    WORD8 i1_log2_min_transform_block_size;
 
    /**
     *  log2_diff_max_min_transform_block_size
     */
    WORD8 i1_log2_diff_max_min_transform_block_size;
 
    /**
     *  log2_min_pcm_coding_block_size_minus3
     */
    WORD8 i1_log2_min_pcm_coding_block_size;
 
    /**
     *  log2_diff_max_min_pcm_coding_block_size
     */
    WORD8 i1_log2_diff_max_min_pcm_coding_block_size;
 
    /**
     *  max_transform_hierarchy_depth_inter
     */
    WORD8 i1_max_transform_hierarchy_depth_inter;
 
    /**
     *  max_transform_hierarchy_depth_intra
     */
    WORD8 i1_max_transform_hierarchy_depth_intra;
 
    /**
     *  scaling_list_enable_flag
     */
    WORD8 i1_scaling_list_enable_flag;
 
    /**
     *  sps_scaling_list_data_present_flag
     */
    WORD8 i1_sps_scaling_list_data_present_flag;
 
    /**
     *  amp_enabled_flag
     */
    WORD8 i1_amp_enabled_flag;
 
    /**
     *  sample_adaptive_offset_enabled_flag
     */
    WORD8 i1_sample_adaptive_offset_enabled_flag;
 
    /**
     *  pcm_loop_filter_disable_flag
     */
    WORD8 i1_pcm_loop_filter_disable_flag;
 
    /**
     *  sps_temporal_id_nesting_flag
     */
    WORD8 i1_sps_temporal_id_nesting_flag;
 
    /**
     *  num_short_term_ref_pic_sets
     */
    WORD8 i1_num_short_term_ref_pic_sets;
 
    /**
     *  long_term_ref_pics_present_flag
     */
    WORD8 i1_long_term_ref_pics_present_flag;
 
    /**
     *  num_long_term_ref_pics_sps
     */
    WORD8 i1_num_long_term_ref_pics_sps;
 
    /**
     *  lt_ref_pic_poc_lsb_sps[]
     */
    UWORD16 au2_lt_ref_pic_poc_lsb_sps[MAX_LTREF_PICS_SPS];
 
    /**
     *  used_by_curr_pic_lt_sps_flag[]
     */
    WORD8 ai1_used_by_curr_pic_lt_sps_flag[MAX_LTREF_PICS_SPS];
 
    /**
     *  sps_temporal_mvp_enable_flag
     */
    WORD8 i1_sps_temporal_mvp_enable_flag;
 
    /**
     * strong_intra_smoothing_enable_flag
     */
    WORD8 i1_strong_intra_smoothing_enable_flag;
 
    /**
     *  vui_parameters_present_flag
     */
    WORD8 i1_vui_parameters_present_flag;
 
    /**
     * vui parameters Structure info
     */
    vui_t s_vui_parameters;
 
    /**
     *  Log2(CTB Size) in luma units
     */
 
    WORD8 i1_log2_ctb_size;
 
    /**
     * Maximum transform block size
     */
    WORD8 i1_log2_max_transform_block_size;
 
    /**
     *  Picture width in CTB units
     */
 
    WORD16 i2_pic_wd_in_ctb;
 
    /**
     *  Picture height in CTB units
     */
 
    WORD16 i2_pic_ht_in_ctb;
 
    /**
     * Picture width in min CB units
     */
 
    WORD16 i2_pic_wd_in_min_cb;
 
    /**
     *  Picture height in min CB units
     */
 
    WORD16 i2_pic_ht_in_min_cb;
 
    /**
     *  Picture size in CTB units
     */
    WORD32 i4_pic_size_in_ctb;
 
    /**
     *  Profile, Tier and Level info
     */
 
    profile_tier_lvl_info_t s_ptl;
 
    /**
     *  Short term reference pic set
     */
    stref_picset_t as_stref_picset[MAX_STREF_PICS_SPS];
 
    /**
     *  Pointer to scaling matrix
     */
    /*************************************************************************/
    /* Contanis the matrice in the following order in a 1D buffer            */
    /* Intra 4 x 4 Y, 4 x 4 U, 4 x 4 V                                       */
    /* Inter 4 x 4 Y, 4 x 4 U, 4 x 4 V                                       */
    /* Intra 8 x 8 Y, 8 x 8 U, 8 x 8 V                                       */
    /* Inter 8 x 8 Y, 8 x 8 U, 8 x 8 V                                       */
    /* Intra 16x16 Y, 16x16 U, 16x16 V                                       */
    /* Inter 16x16 Y, 16x16 U, 16x16 V                                       */
    /* Intra 32x32 Y                                                         */
    /* Inter 32x32 Y                                                         */
    /*************************************************************************/
    WORD16 *pi2_scaling_mat;
 
#ifdef ENABLE_MAIN_REXT_PROFILE
 
    /**
     * transform_skip_rotation_enabled_flag
     */
    WORD8 i1_transform_skip_rotation_enabled_flag;
 
    /**
     * transform_skip_context_enabled_flag
     */
    WORD8 i1_transform_skip_context_enabled_flag;
 
    /**
     * implicit_rdpcm_enabled_flag
     */
    WORD8 i1_implicit_rdpcm_enabled_flag;
 
    /**
     * explicit_rdpcm_enabled_flag
     */
    WORD8 i1_explicit_rdpcm_enabled_flag;
 
    /**
     * extended_precision_processing_flag
     */
    WORD8 i1_extended_precision_processing_flag;
 
    /**
     * intra_smoothing_disabled_flag
     */
    WORD8   i1_intra_smoothing_disabled_flag;
 
    /**
     * high_precision_offsets_enabled_flag
     */
    WORD8   i1_use_high_precision_pred_wt;
 
    /**
     * fast_rice_adaptation_enabled_flag
     */
    WORD8   i1_fast_rice_adaptation_enabled_flag;
 
    /**
     * cabac_bypass_alignment_enabled_flag
     */
    WORD8   i1_align_cabac_before_bypass;
#endif
 
    /*
     * Flag indicating if the SPS is parsed
     */
    WORD8 i1_sps_valid;
 
}sps_t;
 
/**
 * Structure to hold PPS info
 */
typedef struct
{
    /**
     *  Pointer to scaling matrix
     */
    /*************************************************************************/
    /* Contanis the matrice in the following order in a 1D buffer            */
    /* Intra 4 x 4 Y, 4 x 4 U, 4 x 4 V                                       */
    /* Inter 4 x 4 Y, 4 x 4 U, 4 x 4 V                                       */
    /* Intra 8 x 8 Y, 8 x 8 U, 8 x 8 V                                       */
    /* Inter 8 x 8 Y, 8 x 8 U, 8 x 8 V                                       */
    /* Intra 16x16 Y, 16x16 U, 16x16 V                                       */
    /* Inter 16x16 Y, 16x16 U, 16x16 V                                       */
    /* Intra 32x32 Y                                                         */
    /* Inter 32x32 Y                                                         */
    /*************************************************************************/
    WORD16 *pi2_scaling_mat;
 
    /**
     *  Pointer to an array containing tile info such as position, width, height
     *  of each tile
     */
 
    /* column_width_minus1[ i ] and row_height_minus1[ i ] */
    tile_t *ps_tile;
 
    /**
     *  pic_parameter_set_id
     */
    WORD8 i1_pps_id;
 
    /**
     *  seq_parameter_set_id
     */
    WORD8 i1_sps_id;
 
    /**
     *  sign_data_hiding_flag
     */
    WORD8 i1_sign_data_hiding_flag;
 
    /**
     *  cabac_init_present_flag
     */
    WORD8 i1_cabac_init_present_flag;
 
    /**
     *  num_ref_idx_l0_default_active_minus1
     */
    WORD8 i1_num_ref_idx_l0_default_active;
 
    /**
     * num_ref_idx_l1_default_active_minus1
     */
    WORD8 i1_num_ref_idx_l1_default_active;
 
    /**
     *  pic_init_qp_minus26
     */
    WORD8 i1_pic_init_qp;
 
    /**
     *  constrained_intra_pred_flag
     */
    WORD8 i1_constrained_intra_pred_flag;
 
    /**
     *  transform_skip_enabled_flag
     */
    WORD8 i1_transform_skip_enabled_flag;
 
    /**
     *  cu_qp_delta_enabled_flag
     */
    WORD8 i1_cu_qp_delta_enabled_flag;
 
    /**
     * diff_cu_qp_delta_depth
     */
    WORD8 i1_diff_cu_qp_delta_depth;
 
    /**
     *  pic_cb_qp_offset
     */
    WORD8 i1_pic_cb_qp_offset;
 
    /**
     *  pic_cr_qp_offset
     */
    WORD8 i1_pic_cr_qp_offset;
 
    /**
     *  pic_slice_level_chroma_qp_offsets_present_flag
     */
    WORD8 i1_pic_slice_level_chroma_qp_offsets_present_flag;
 
    /**
     *  weighted_pred_flag
     */
    WORD8 i1_weighted_pred_flag;
 
    /**
     *  weighted_bipred_flag
     */
    WORD8 i1_weighted_bipred_flag;
 
    /**
     *  output_flag_present_flag
     */
    WORD8 i1_output_flag_present_flag;
 
    /**
     *  transquant_bypass_enable_flag
     */
    WORD8 i1_transquant_bypass_enable_flag;
 
    /**
     *  dependent_slice_enabled_flag
     */
    WORD8 i1_dependent_slice_enabled_flag;
 
    /**
     *  tiles_enabled_flag
     */
    WORD8 i1_tiles_enabled_flag;
 
    /**
     *  entropy_coding_sync_enabled_flag
     */
    WORD8 i1_entropy_coding_sync_enabled_flag;
 
    /**
     * entropy_slice_enabled_flag
     */
    WORD8 i1_entropy_slice_enabled_flag;
 
    /**
     *  num_tile_columns_minus1
     */
    WORD8 i1_num_tile_columns;
 
    /**
     *  num_tile_rows_minus1
     */
    WORD8 i1_num_tile_rows;
 
    /**
     *  uniform_spacing_flag
     */
    WORD8 i1_uniform_spacing_flag;
 
    /**
     *  loop_filter_across_tiles_enabled_flag
     */
    WORD8 i1_loop_filter_across_tiles_enabled_flag;
 
    /**
     *  loop_filter_across_slices_enabled_flag
     */
    WORD8 i1_loop_filter_across_slices_enabled_flag;
 
    /**
     *  deblocking_filter_control_present_flag
     */
    WORD8 i1_deblocking_filter_control_present_flag;
 
    /**
     *  deblocking_filter_override_enabled_flag
     */
    WORD8 i1_deblocking_filter_override_enabled_flag;
 
    /**
     *  pic_disable_deblocking_filter_flag
     */
    WORD8 i1_pic_disable_deblocking_filter_flag;
 
    /**
     *  beta_offset_div2
     */
    WORD8 i1_beta_offset_div2;
 
    /**
     *  tc_offset_div2
     */
    WORD8 i1_tc_offset_div2;
 
    /**
     *  pps_scaling_list_data_present_flag
     */
    WORD8 i1_pps_scaling_list_data_present_flag;
 
    /**
     * lists_modification_present_flag
     */
    WORD8 i1_lists_modification_present_flag;
 
    /**
     * num_extra_slice_header_bits
     */
    WORD8 i1_num_extra_slice_header_bits;
 
    /**
     *  log2_parallel_merge_level_minus2
     */
    WORD8 i1_log2_parallel_merge_level;
 
    /**
     *  slice_header_extension_present_flag
     */
    WORD8 i1_slice_header_extension_present_flag;
 
    /**
     *  slice_extension_present_flag
     */
    WORD8 i1_slice_extension_present_flag;
 
    /**
     *  scaling_list_dc_coef_minus8
     */
    /*************************************************************************/
    /* DC value of the scaling list                                          */
    /* Only 16 x 16 and 32 x 32 scaling lists have valid entries.            */
    /* Entries stored for all sizes for uniformity.                          */
    /* Remaining will be initialized to default values if used               */
    /*************************************************************************/
    UWORD8 au1_scaling_list_dc_coef[TOTAL_SCALE_MAT_COUNT];
 
    /**
     * Log2MinCuQpDeltaSize
     */
    WORD8 i1_log2_min_cu_qp_delta_size;
 
#ifdef ENABLE_MAIN_REXT_PROFILE
    /**
     * log2_max_transform_skip_block_size_minus2
     */
    WORD32 i4_log2_max_transform_skip_block_size_minus2;
 
    /**
     * cross_component_prediction_enabled_flag
     */
    WORD8 i1_cross_component_prediction_enabled_flag;
 
    /**
     * chroma_qp_offset_list_enabled_flag
     */
    WORD8 i1_chroma_qp_offset_list_enabled_flag;
 
    /**
     * diff_cu_chroma_qp_offset_depth
     */
    WORD32 i4_diff_cu_chroma_qp_offset_depth;
 
    /**
     * chroma_qp_offset_list_len_minus1
     */
    WORD32 i4_chroma_qp_offset_list_len_minus1;
 
    /**
     * cb_qp_offset_list[]
     */
    WORD32 i4_cb_qp_offset_list[6];
 
    /**
     * cr_qp_offset_list[]
     */
    WORD32 i4_cr_qp_offset_list[6];
 
    /**
     * log2_sao_offset_scale_luma
     */
    WORD8 i1_log2_sao_ofst_scale_luma;
 
    /**
     * log2_sao_offset_scale_chroma
     */
    WORD8 i1_log2_sao_ofst_scale_chroma;
 
#endif
 
    /*
     * Flag indicating if the PPS is parsed
     */
    WORD8 i1_pps_valid;
 
}pps_t;
 
 
/**
 * Structure to hold slice header info
 */
typedef struct
{
    /**
     *  entry_point_offset[ i ]
     */
    WORD32 *pi4_entry_point_offset;
 
    /**
     *  poc_lsb_lt[ i ]
     */
    WORD32 ai4_poc_lsb_lt[MAX_DPB_SIZE];
 
    /**
     *  slice_header_extension_length
     */
    WORD16 i2_slice_header_extension_length;
 
    /**
     *  slice_address
     */
    WORD16 i2_slice_address;
 
    /**
     *  first_slice_in_pic_flag
     */
    WORD8 i1_first_slice_in_pic_flag;
 
    /* PPS id */
    WORD8 i1_pps_id;
    /**
     *  no_output_of_prior_pics_flag
     */
    WORD8 i1_no_output_of_prior_pics_flag;
 
    /**
     *  dependent_slice_flag
     */
    WORD8 i1_dependent_slice_flag;
 
    /**
     *  slice_type
     */
    WORD8 i1_slice_type;
 
    /**
     *  pic_output_flag
     */
    WORD8 i1_pic_output_flag;
 
    /**
     *  colour_plane_id
     */
    WORD8 i1_colour_plane_id;
 
    /**
     *  pic_order_cnt_lsb
     */
    WORD32 i4_pic_order_cnt_lsb;
 
    /**
     *  absolute pic_order_cnt
     */
    WORD32 i4_abs_pic_order_cnt;
 
    /**
     *  short_term_ref_pic_set_sps_flag
     */
    WORD8 i1_short_term_ref_pic_set_sps_flag;
 
    /**
     *  short_term_ref_pic_set_idx
     */
    WORD8 i1_short_term_ref_pic_set_idx;
 
    /**
     *  num_long_term_sps
     */
    WORD8 i1_num_long_term_sps;
 
    /**
     *  num_long_term_pics
     */
    WORD8 i1_num_long_term_pics;
 
    /**
     *  lt_idx_sps[ i ]
     */
    WORD8 ai1_lt_idx_sps[MAX_DPB_SIZE];
 
    /**
     *  used_by_curr_pic_lt_flag[ i ]
     */
    WORD8 ai1_used_by_curr_pic_lt_flag[MAX_DPB_SIZE];
 
    /**
     *  delta_poc_msb_present_flag[ i ]
     */
    WORD8 ai1_delta_poc_msb_present_flag[MAX_DPB_SIZE];
 
    /**
     *  delta_poc_msb_cycle_lt[ i ]
     */
    WORD8 ai1_delta_poc_msb_cycle_lt[MAX_DPB_SIZE];
 
    /**
     *  slice_sao_luma_flag
     */
    WORD8 i1_slice_sao_luma_flag;
 
    /**
     *  slice_sao_chroma_flag
     */
    WORD8 i1_slice_sao_chroma_flag;
 
    /**
     *  slice_temporal_mvp_enable_flag
     */
    WORD8 i1_slice_temporal_mvp_enable_flag;
 
    /**
     *  num_ref_idx_active_override_flag
     */
    WORD8 i1_num_ref_idx_active_override_flag;
 
    /**
     *  num_ref_idx_l0_active_minus1
     */
    WORD8 i1_num_ref_idx_l0_active;
 
    /**
     *  num_ref_idx_l1_active_minus1
     */
    WORD8 i1_num_ref_idx_l1_active;
 
    /**
     *  mvd_l1_zero_flag
     */
    WORD8 i1_mvd_l1_zero_flag;
 
    /**
     *  cabac_init_flag
     */
    WORD8 i1_cabac_init_flag;
 
    /**
     *  collocated_from_l0_flag
     */
    WORD8 i1_collocated_from_l0_flag;
 
    /**
     *  collocated_ref_idx
     */
    WORD8 i1_collocated_ref_idx;
 
    /**
     * five_minus_max_num_merge_cand
     */
    WORD8 i1_max_num_merge_cand;
 
    /**
     *  slice_qp_delta
     */
    WORD8 i1_slice_qp_delta;
 
    /**
     *  slice_cb_qp_offset
     */
    WORD8 i1_slice_cb_qp_offset;
 
    /**
     *  slice_cr_qp_offset
     */
    WORD8 i1_slice_cr_qp_offset;
 
    /**
     *  deblocking_filter_override_flag
     */
    WORD8 i1_deblocking_filter_override_flag;
 
    /**
     *  slice_disable_deblocking_filter_flag
     */
    WORD8 i1_slice_disable_deblocking_filter_flag;
 
    /**
     *  beta_offset_div2
     */
    WORD8 i1_beta_offset_div2;
 
    /**
     *  tc_offset_div2
     */
    WORD8 i1_tc_offset_div2;
 
    /**
     *  slice_loop_filter_across_slices_enabled_flag
     */
    WORD8 i1_slice_loop_filter_across_slices_enabled_flag;
 
    /**
     *  NUmber of entry point offsets
     */
    WORD32 i4_num_entry_point_offsets;
 
    /**
     *  offset_len_minus1
     */
    WORD8 i1_offset_len;
 
    /**
     *  Entry point offsets
     */
    WORD32 *pu4_entry_point_offset;
 
    /**
     * Short term reference picture set
     */
    stref_picset_t s_stref_picset;
 
    /**
     *  Weight and offset info for Weighted prediction
     */
    pred_wt_ofst_t s_wt_ofst;
 
    /**
     *  Reference prediction list modification
     */
    rplm_t s_rplm;
 
    /**
     *  First CTB' X pos : slice_address % i2_pic_wd_in_ctb
     */
    WORD16 i2_ctb_x;
 
    /**
     *  First CTB' Y pos : slice_address / i2_pic_wd_in_ctb
     */
    WORD16 i2_ctb_y;
 
    /**
     * L0 Reference pic lists
     */
    ref_list_t as_ref_pic_list0[MAX_DPB_SIZE];
 
    /**
     * L1 Reference pic lists
     */
    ref_list_t as_ref_pic_list1[MAX_DPB_SIZE];
 
    /**
     * NAL unit type of the slice
     */
    WORD8 i1_nal_unit_type;
 
    /**
     * Low delay check flag
     */
    WORD8 i1_low_delay_flag;
 
    /**
     * The last independent slice's start ctb_x
     * If the current slice is independent, it is the same as the current CTBs ctb_x
     */
    WORD16 i2_independent_ctb_x;
 
    /**
     * The last independent slice's start ctb_y
     * If the current slice is independent, it is the same as the current CTBs ctb_y
     */
    WORD16 i2_independent_ctb_y;
 
#ifdef ENABLE_MAIN_REXT_PROFILE
    /**
     * cu_chroma_qp_offset_enabled_flag
     */
    WORD8 i1_cu_chroma_qp_offset_enabled_flag;
#endif
 
    UWORD8 u1_parse_data_init_done;
 
    /**
     * Temporal ID in NAL header
     */
    WORD32 u4_nuh_temporal_id;
}slice_header_t;
 
 
 
 
 
 
 
 
#endif /* _IHEVC_STRUCTS_H_ */