summaryrefslogtreecommitdiffstats
path: root/common/ih264_structs.h
blob: 0a7c940a1cb895e5da4703a5e8a4277740362083 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
/******************************************************************************
 *
 * Copyright (C) 2015 The Android Open Source Project
 *
 * 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.
 *
 *****************************************************************************
 * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
*/

/**
 *******************************************************************************
 * @file
 *  ih264_structs.h
 *
 * @brief
 *  Structure definitions used in the code
 *
 * @author
 *  Ittiam
 *
 * @par List of Functions:
 *
 * @remarks
 *  None
 *
 *******************************************************************************
 */

#ifndef _IH264_STRUCTS_H_
#define _IH264_STRUCTS_H_

/** MB Type info for Intra MBs */
typedef struct
{
    UWORD32             u4_num_mbpart;
    MBPART_PREDMODE_T   e_mbpart_predmode;
    MBMODES_I16x16      e_intra_predmode;
    UWORD32             u4_cpb_chroma;
    UWORD32             u4_cpb_luma;
}intra_mbtype_info_t;

/** MB Type info for Inter MBs */
typedef struct
{
    UWORD32                 u4_num_mbpart;
    MBPART_PREDMODE_T       e_mbpart_predmode_0;
    MBPART_PREDMODE_T       e_mbpart_predmode_1;
    UWORD32                 u4_mbpart_wd;
    UWORD32                 u4_mbpart_ht;
}inter_mbtype_info_t;


/** Sub MB Type info for Inter MBs */
typedef struct
{
    UWORD32                 u4_num_mbpart;
    MBPART_PREDMODE_T       e_mbpart_predmode;
    UWORD32                 u4_mbpart_wd;
    UWORD32                 u4_mbpart_ht;
}submbtype_info_t;

/**
 * Picture buffer
 */
typedef struct
{
    UWORD8* pu1_luma;
    UWORD8* pu1_chroma;

    WORD32 i4_abs_poc;
    WORD32 i4_poc_lsb;


    /** Lower 32 bit of time stamp */
    UWORD32 u4_timestamp_low;

    /** Upper 32 bit of time stamp */
    UWORD32 u4_timestamp_high;

    WORD32 i4_used_as_ref;

    /**
     * frame_num in the slice header
     */
    WORD32 i4_frame_num;

    /**
     * Long-term frame idx
     * TODO: store in frame_num
     */
    WORD32 i4_long_term_frame_idx;

    /*
     *  0: Top Field
     *  1: Bottom Field
     */
    WORD8   i1_field_type;

    /**
     * buffer ID from frame buffer manager
     */
    WORD32 i4_buf_id;

} pic_buf_t;


/**
 * Reference List
 */
typedef struct
{
    void *pv_pic_buf;

    void *pv_mv_buf;

} ref_list_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
{

    /**
     *  Motion Vectors
     */
    pu_mv_t     s_mv;

    /**
     *  PU X position in terms of min PU (4x4) units
     */
    UWORD32     b2_pos_x        : 2;

    /**
     *  PU Y position in terms of min PU (4x4) units
     */
    UWORD32     b2_pos_y        : 2;

    /**
     *  PU width in pixels = (b2_wd + 1) << 2
     */
    UWORD32     b2_wd           : 2;

    /**
     *  PU height in pixels = (b2_ht + 1) << 2
     */
    UWORD32     b2_ht           : 2;

    /**
     *  Intra or Inter flag for each partition - 0 or 1
     */
    UWORD32     b1_intra_flag   : 1;

    /**
     *  PRED_L0, PRED_L1, PRED_BI
     */
    UWORD32     b2_pred_mode    : 2;

} pu_t;


/**
 * MB information to be stored for entire frame
 */
typedef struct
{
    /**
     * Transform sizes 0: 4x4, 1: 8x8,
     */
    UWORD32     b1_trans_size : 1;

    /**
     * CBP - 4 bits for Y, 1 for U and 1 for V
     */
    UWORD32     b6_cbp: 6;

    /**
     * Intra pred sizes  0: 4x4, 1: 8x8, 2: 16x16
     */
    UWORD32     b2_intra_pred_size : 2;

    /**
     * Flag to signal if the current MB is IPCM
     */
    UWORD32     b1_ipcm : 1;

}mb_t;

/*****************************************************************************/
/* Info from last TU row of MB is stored in a row level neighbour buffer    */
/* , which will be used for Boundary Strength computation                    */
/*****************************************************************************/
/**
 *  MB neighbor info
 */
typedef struct
{
    /**
     *  Slice index of the mb
     */
    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 u1_qp;

} mb_top_ny_info_t;

/**
 *  MB level context
 */
typedef struct _mb_ctxt_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 MB
     */
    /*  If not available, this will be set to NULL   */
    struct _mb_ctxt_t *ps_mb_left;

    /**
     *  Pointer to top-left MB
     */
    /* If not available, this will be set to NULL   */
    mb_top_ny_info_t *ps_mb_ny_topleft;

    /**
     *  Pointer to top MB
     */
    /* If not available, this will be set to NULL  */
    mb_top_ny_info_t *ps_mb_ny_top;

    /**
     *  Pointer to top-right MB
     */
    /* If not available, this will be set to NULL */
    mb_top_ny_info_t *ps_mb_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 MB       */
    /* 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 MB address with    */
    /* number of minTUs in a MB, it is stored here for faster access.       */
    /* Can be removed if storage of MB 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 MB level                        */
    /*************************************************************************/
    WORD32 i4_tu_cnt;

    /**
     *  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 MB belongs to
     */
    WORD32 i4_slice_idx;

    /**
     *  MB column position
     */
    WORD32 i4_pos_x;

    /**
     *  MB 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 MB
     */
    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                                       */
    /*************************************************************************/
} mb_ctxt_t;

/*************************************************************************/
/* The following describes how each of the CU cases are handled          */
/*************************************************************************/

/*************************************************************************/
/* For SKIP MB                                                           */
/* One Inter PU with appropriate MV                                      */
/* One TU which says CBP is zero and size is 16x16                       */
/*************************************************************************/

/*************************************************************************/
/* For Inter MB                                                          */
/* M Inter PU with appropriate MVs (M between 1 to 4)                    */
/* Number of TUs derived based on transform size                         */
/*************************************************************************/

/*************************************************************************/
/* For Intra MB                                                          */
/* Number of TUs derived based on transform size                         */
/* N Intra Modes are signaled along with coeff data at the start        */
/*************************************************************************/

/*************************************************************************/
/* For Intra PCM MB                                                      */
/* One TU which says ipcm is 1                                           */
/*************************************************************************/



/**
 * Structure to hold quantization parameters of an mb
 */
typedef struct
{

    /*
     * mb qp
     */
    UWORD8 u1_mb_qp;

    /*
     * mb qp / 6
     */
    UWORD8 u1_qp_div;

    /*
     * mb qp mod 6
     */
    UWORD8 u1_qp_rem;

    /*
     * QP bits
     */
    UWORD8  u1_qbits;

    /*
     * forward scale matrix
     */
    const UWORD16 *pu2_scale_mat;

    /*
     * threshold matrix for quantization
     */
    UWORD16 *pu2_thres_mat;

    /*
     * Threshold to compare the sad with
     */
    UWORD16 *pu2_sad_thrsh;

    /*
     * qp dependent rounding constant
     */
    UWORD32 u4_dead_zone;

    /*
     *  inverse scale matrix
     */
    const UWORD16 *pu2_iscale_mat;

    /*
     * Weight matrix in iquant
     */
    UWORD16 *pu2_weigh_mat;

}quant_params_t;

/**
 * Structure to hold Profile tier level info for a given layer
 */

typedef struct
{
    /**
     *  NAL unit type
     */
    WORD8 i1_nal_unit_type;

    /**
     * NAL ref idc
     */
    WORD8 i1_nal_ref_idc;


} nal_header_t;

/**
 * HRD parameters Info
 */
typedef struct
{
    /**
     * Specifies the number of alternative CPB specifications in the
     * bitstream
     */
    UWORD8 u1_cpb_cnt_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) specifies
    * CPB size of the i-th CPB when the CPB operates
    * at the access unit level
    */
    UWORD32 u4_cpb_size_scale;

    /**
     *  (together with bit_rate_scale) specifies the
     *  maximum input bit rate for the i-th CPB
     */
    UWORD32 au4_bit_rate_value_minus1[32];
    /**
     *  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[32];

    /**
     * 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];


    /**
    * specifies the length, in bits for initial cpb delay (nal/vcl)syntax in bp sei
    */
    UWORD8  u1_initial_cpb_removal_delay_length_minus1;

    /**
    * specifies the length, in bits for the cpb delay syntax in pt_sei
    */
    UWORD8  u1_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;

    /**
     * Specifies length of the time offset parameter
     */
    UWORD8  u1_time_offset_length;

}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;

    /**
    *  Height 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;

    /**
    * pal, secam, ntsc, ...
    */
    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;

    /**
    *   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;

    /**
     *   Flag indicating that time difference between two frames is a constant
     */
    UWORD8 u1_fixed_frame_rate_flag;

    /**
     *   Indicates the presence of NAL HRD parameters
     */
    UWORD8 u1_nal_hrd_parameters_present_flag;

    /**
     *   NAL level HRD parameters
     */
    hrd_params_t s_nal_hrd_parameters;

    /**
     *   Indicates the presence of VCL HRD parameters
     */
    UWORD8 u1_vcl_hrd_parameters_present_flag;

    /**
     *   VCL level HRD parameters
     */
    hrd_params_t s_vcl_hrd_parameters;

    /**
     *  Specifies the HRD operational mode
     */
    UWORD8 u1_low_delay_hrd_flag;

    /**
     * Indicates presence of SEI messages which include pic_struct syntax element
     */
    UWORD8 u1_pic_struct_present_flag;

    /**
    * 1, specifies that the following cvs bitstream restriction parameters are present
    */
    UWORD8 u1_bitstream_restriction_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;

    /**
    * 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_mb_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;

    /**
     *  Max number of frames that are not synchronized in display and decode order
     */
    UWORD8 u1_num_reorder_frames;

    /**
     * specifies required size of the HRD DPB in units of frame buffers.
     */
     UWORD8 u1_max_dec_frame_buffering;

} vui_t;


/**
 * Structure to hold SPS info
 */
typedef struct
{
    /**
     *  profile_idc
     */
    UWORD8 u1_profile_idc;

    /** constraint_set0_flag */
    UWORD8 u1_constraint_set0_flag;

    /** constraint_set1_flag */
    UWORD8 u1_constraint_set1_flag;

    /** constraint_set2_flag */
    UWORD8 u1_constraint_set2_flag;

    /** constraint_set3_flag */
    UWORD8 u1_constraint_set3_flag;

    /**
     *  level_idc
     */
    UWORD8 u1_level_idc;

    /**
     *  seq_parameter_set_id
     */
    UWORD8 u1_sps_id;


    /**
     *  chroma_format_idc
     */
    UWORD8 u1_chroma_format_idc;

    /**
     *  residual_colour_transform_flag
     */
    WORD8 i1_residual_colour_transform_flag;

    /**
     *  bit_depth_luma_minus8
     */
    WORD8 i1_bit_depth_luma;

    /**
     *  bit_depth_chroma_minus8
     */
    WORD8 i1_bit_depth_chroma;

    /**
     *  qpprime_y_zero_transform_bypass_flag
     */
    WORD8 i1_qpprime_y_zero_transform_bypass_flag;

    /**
     *  seq_scaling_matrix_present_flag
     */
    WORD8 i1_seq_scaling_matrix_present_flag;

    /**
     *  seq_scaling_list_present_flag
     */
    WORD8 ai1_seq_scaling_list_present_flag[8];

    /**
     *  log2_max_frame_num_minus4
     */
    WORD8 i1_log2_max_frame_num;

    /**
     *  MaxFrameNum in the standard
     *  1 << i1_log2_max_frame_num
     */
    WORD32 i4_max_frame_num;

    /**
     *  pic_order_cnt_type
     */
    WORD8 i1_pic_order_cnt_type;

    /**
     *  log2_max_pic_order_cnt_lsb_minus4
     */
    WORD8 i1_log2_max_pic_order_cnt_lsb;

    /**
     * MaxPicOrderCntLsb in the standard.
     * 1 << log2_max_pic_order_cnt_lsb_minus4
     */
    WORD32 i4_max_pic_order_cnt_lsb;

    /**
     *  delta_pic_order_always_zero_flag
     */
    WORD8 i1_delta_pic_order_always_zero_flag;

    /**
     *  offset_for_non_ref_pic
     */
    WORD32 i4_offset_for_non_ref_pic;

    /**
     *  offset_for_top_to_bottom_field
     */
    WORD32 i4_offset_for_top_to_bottom_field;

    /**
     *  num_ref_frames_in_pic_order_cnt_cycle
     */
    UWORD8 u1_num_ref_frames_in_pic_order_cnt_cycle;

    /**
     * Offset_for_ref_frame
     */
    WORD32 ai4_offset_for_ref_frame[256];

    /**
     *  max_num_ref_frames
     */
    UWORD8 u1_max_num_ref_frames;

    /**
     *  gaps_in_frame_num_value_allowed_flag
     */
    WORD8 i1_gaps_in_frame_num_value_allowed_flag;

    /**
     *  pic_width_in_mbs_minus1
     */
    WORD16 i2_pic_width_in_mbs_minus1;

    /**
     *  pic_height_in_map_units_minus1
     */
    WORD16 i2_pic_height_in_map_units_minus1;

    /**
     *  frame_mbs_only_flag
     */
    WORD8 i1_frame_mbs_only_flag;

    /**
     *  mb_adaptive_frame_field_flag
     */
    WORD8 i1_mb_adaptive_frame_field_flag;

    /**
     *  direct_8x8_inference_flag
     */
    WORD8 i1_direct_8x8_inference_flag;

    /**
     *  frame_cropping_flag
     */
    WORD8 i1_frame_cropping_flag;

    /**
     *  frame_crop_left_offset
     */
    WORD16 i2_frame_crop_left_offset;

    /**
     *  frame_crop_right_offset
     */
    WORD16 i2_frame_crop_right_offset;

    /**
     *  frame_crop_top_offset
     */
    WORD16 i2_frame_crop_top_offset;

    /**
     *  frame_crop_bottom_offset
     */
    WORD16 i2_frame_crop_bottom_offset;

    /**
     *  vui_parameters_present_flag
     */
    WORD8 i1_vui_parameters_present_flag;

    /**
     * vui_parameters_Structure_info
     */
    vui_t s_vui_parameters;

    /**
     * Flag to give status of SPS structure
     */
    WORD8 i1_sps_valid;

    /**
     * Coded Picture width
     */
    WORD32 i2_pic_wd;

    /**
     * Coded Picture height
     */
    WORD32 i2_pic_ht;

    /**
     *  Picture width in MB units
     */

    WORD16 i2_pic_wd_in_mb;

    /**
     *  Picture height in MB units
     */

    WORD16 i2_pic_ht_in_mb;

    /**
     * useDefaultScalingMatrixFlag
     */
    WORD8 ai1_use_default_scaling_matrix_flag[8];

    /**
     * 4x4 Scaling lists after inverse zig zag scan
     */
    UWORD16 au2_4x4_weight_scale[6][16];

    /**
     * 4x4 Scaling lists after inverse zig zag scan
     */
    UWORD16 au2_8x8_weight_scale[2][64];

} sps_t;


/**
 * Structure to hold PPS info
 */
typedef struct
{
    /**
     *  pic_parameter_set_id
     */
    UWORD8 u1_pps_id;

    /**
     *  seq_parameter_set_id
     */
    UWORD8 u1_sps_id;

    /**
     *   Entropy coding : 0-VLC; 1 - CABAC
     */
    UWORD8 u1_entropy_coding_mode_flag;

    /*
     * Pic order present flag
     */
    UWORD8 u1_pic_order_present_flag;

    /*
     * Number of slice groups
     */
    UWORD8 u1_num_slice_groups;

    /*
     * Slice group map type
     */
    UWORD8 u1_slice_group_map_type;

    /*
     * Maximum reference picture index in the reference list 0 : range [0 - 31]
     */
    WORD8 i1_num_ref_idx_l0_default_active;

    /*
     * Maximum reference picture index in the reference list 1 : range [0 - 31]
     */
    WORD8 i1_num_ref_idx_l1_default_active;

    /**
     *  weighted_pred_flag
     */
    WORD8 i1_weighted_pred_flag;

    /**
     *  weighted_bipred_flag
     */
    WORD8 i1_weighted_bipred_idc;

    /**
     *  pic_init_qp_minus26
     */
    WORD8 i1_pic_init_qp;

    /**
     *  pic_init_qs_minus26
     */
    WORD8 i1_pic_init_qs;

    /*
     * Chroma QP offset w.r.t QPY {-12,12}
     */
    WORD8  i1_chroma_qp_index_offset;

    /**
     *  deblocking_filter_control_present_flag
     */
    WORD8 i1_deblocking_filter_control_present_flag;

    /**
     *  constrained_intra_pred_flag
     */
    WORD8 i1_constrained_intra_pred_flag;

    /**
     *  redundant_pic_cnt_present_flag
     */
    WORD8 i1_redundant_pic_cnt_present_flag;

    /**
     *  transform_8x8_mode_flag
     */
    WORD8 i1_transform_8x8_mode_flag;

    /**
     *  pic_scaling_matrix_present_flag
     */
    WORD8 i1_pic_scaling_matrix_present_flag;

    /*
     *  Second chroma QP offset
     */
    WORD8  i1_second_chroma_qp_index_offset;


    /**
     * useDefaultScalingMatrixFlag
     */
    WORD8 ai1_use_default_scaling_matrix_flag[8];

    /**
     * 4x4 Scaling lists after inverse zig zag scan
     */
    UWORD16 au2_4x4_weight_scale[6][16];

    /**
     * 4x4 Scaling lists after inverse zig zag scan
     */
    UWORD16 au2_8x8_weight_scale[2][64];


    /**
     *  pic_scaling_list_present_flag
     */
    WORD8 ai1_pic_scaling_list_present_flag[8];

    /**
     * Flag to give status of PPS structure
     */
    WORD8   i1_pps_valid;


} pps_t;

/**
 * MMCO commands and params.
 */
typedef struct
{
    /* memory management control operation command */
    UWORD8 u1_memory_management_control_operation;

    /*
     * Contains difference of pic nums of short-term pic/frame
     * 1. To signal it as "unused for reference" if mmco = 1
     * 2. To signal it as "used for long-term reference" if mmco = 3
     */
    UWORD32 u4_difference_of_pic_nums_minus1;

    /* Long-term pic num to be set as "unused for reference" */
    UWORD8 u1_long_term_pic_num;

    /*
     * Assign a long-term idx to a picture as follows
     * 1. Assign to a short-term pic if mmco = 3
     * 2. Assign to the current pic if mmco = 6
     */
    UWORD8 u1_long_term_frame_idx;

    /*
     * The max long-term idx. The long-term pics having idx above
     * are set as "unused for reference
     */
    UWORD8 u1_max_long_term_frame_idx_plus1;

}mmco_prms_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;

    /* Modification required in list0 */
    WORD8 i1_modification_of_pic_nums_idc_l0[MAX_MODICATION_IDC];

    /*
     * The absolute difference between the picture number of
     * the picture being moved to the current index in
     * list0 and the picture number prediction value
     */
    UWORD32 u4_abs_diff_pic_num_minus1_l0[MAX_MODICATION_IDC];

    /*
     * The long-term picture number of the picture being moved
     * to the current index in list0
     */
    UWORD8 u1_long_term_pic_num_l0[MAX_MODICATION_IDC];

    /* ref_pic_list_modification_flag_l1 */
    WORD8 i1_ref_pic_list_modification_flag_l1;

    /* Modification required in list1 */
    WORD8 i1_modification_of_pic_nums_idc_l1[MAX_MODICATION_IDC];

    /*
     * The absolute difference between the picture number of
     * the picture being moved to the current index in
     * list1 and the picture number prediction value
     */
    UWORD32 u4_abs_diff_pic_num_minus1_l1[MAX_MODICATION_IDC];

    /*
     * The long-term picture number of the picture being moved
     * to the current index in list1
     */
   UWORD8 u1_long_term_pic_num_l1[MAX_MODICATION_IDC];
}rplm_t;

/**
 * Structure to hold Slice Header info
 */
typedef struct
{

    /*
     *  nal_unit_type
     */
    WORD8  i1_nal_unit_type;

    /*
     *  nal_unit_idc
     */
    WORD8  i1_nal_unit_idc;

    /*
     *  first_mb_in_slice
     */
    UWORD16   u2_first_mb_in_slice;

    /*
     *  slice_type
     */
    UWORD8   u1_slice_type;

    /*
     *  pic_parameter_set_id
     */
    UWORD8   u1_pps_id;

    /*
     *  frame_num
     */
    WORD32 i4_frame_num;

    /*
     *  field_pic_flag
     */
    WORD8   i1_field_pic_flag;

    /*
     *  bottom_field_flag
     */
    WORD8   i1_bottom_field_flag;

    /*
     *  second_field
     */
    WORD8   i1_second_field_flag;

    /*
     *  idr_pic_id
     */
    UWORD16 u2_idr_pic_id ;

    /*
     *  pic_order_cnt_lsb
     */
    UWORD16 i4_pic_order_cnt_lsb;

    /*
     *  delta_pic_order_cnt_bottom
     */
    WORD32  i4_delta_pic_order_cnt_bottom;

    /*
     *  delta_pic_order_cnt
     */
    WORD32   ai4_delta_pic_order_cnt[2];

    /*
     *  redundant_pic_cnt
     */
    UWORD8   u1_redundant_pic_cnt;

    /*
     *  direct_spatial_mv_pred_flag
     */
    UWORD8   u1_direct_spatial_mv_pred_flag;

    /*
     *  num_ref_idx_active_override_flag
     */
    UWORD8   u1_num_ref_idx_active_override_flag;

    /*
     *  num_ref_idx_l0_active
     */
    WORD8   i1_num_ref_idx_l0_active;

    /*
     *  num_ref_idx_l1_active_minus1
     */
    WORD8   i1_num_ref_idx_l1_active;

    /*
     * ref_pic_list_reordering_flag_l0
     */
    UWORD8  u1_ref_idx_reordering_flag_l0;

    /*
     * ref_pic_list_reordering_flag_l1
     */
    UWORD8  u1_ref_idx_reordering_flag_l1;

    /**
     *  Reference prediction list modification
     */
    rplm_t s_rplm;

    /**
     * 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];

    /*
     * no_output_of_prior_pics_flag
     */
    UWORD8   u1_no_output_of_prior_pics_flag;

    /*
     * long_term_reference_flag
     */
    UWORD8   u1_long_term_reference_flag;

    /*
     * adaptive_ref_pic_marking_mode_flag
     */
    UWORD8   u1_adaptive_ref_pic_marking_mode_flag;

    /*
     * Array to structures to store mmco commands
     * and parameters.
     */
    mmco_prms_t as_mmco_prms[MAX_MMCO_COMMANDS];

    /*
     *  entropy_coding_mode_flag
     */
    WORD8   u1_entropy_coding_mode_flag;

    /*
     *  cabac_init_idc
     */
    WORD8   i1_cabac_init_idc;

    /*
     *  i1_slice_qp
     */
    WORD8   i1_slice_qp;

    /*
     *  sp_for_switch_flag
     */
    UWORD8   u1_sp_for_switch_flag;

    /*
     *  slice_qs_delta
     */
    UWORD8   u1_slice_qs;

    /*
     *  disable_deblocking_filter_idc
     */
    WORD8   u1_disable_deblocking_filter_idc;

    /*
     *  slice_alpha_c0_offset_div2
     */
    WORD8   i1_slice_alpha_c0_offset_div2;

    /*
     *  slice_beta_offset_div2
     */
    WORD8   i1_slice_beta_offset_div2;

    /*
     *  num_slice_groups_minus1
     */
    WORD8   u1_num_slice_groups_minus1;

    /*
     *  slice_group_change_cycle
     */
    WORD8   u1_slice_group_change_cycle;

    /**
     * Start MB X
     */
    UWORD16 i2_mb_x;

    /**
     * Start MB Y
     */
    UWORD16 i2_mb_y;

    /**
     * Absolute POC. Contains minimum of top and bottom POC.
     */
    WORD32 i4_abs_pic_order_cnt;

    /**
     *  Absolute top POC. Contains top poc for frame or top
     *  field. Invalid for bottom field.
     */
    WORD32 i4_abs_top_pic_order_cnt;

    /**
     *  Absolute top POC. Contains bottom poc for frame or bottom
     *  field. Invalid for top field.
     */
    WORD32 i4_abs_bottom_pic_order_cnt;

    /** Flag signaling if the current slice is ref slice */
    UWORD8 i1_nal_ref_idc;

    /** Flag to indicate if the current slice is MBAFF Frame */
    UWORD8 u1_mbaff_frame_flag;

    /** luma_log2_weight_denom */
    UWORD8 u1_luma_log2_weight_denom;

    /** chroma_log2_weight_denom */
    UWORD8 u1_chroma_log2_weight_denom;

    /** luma_weight_l0_flag */
    UWORD8 au1_luma_weight_l0_flag[MAX_DPB_SIZE];

    /** luma_weight_l0 : (-128, 127 )is the range of weights
     * when weighted pred is enabled, 128 is default value */
    WORD16 ai2_luma_weight_l0[MAX_DPB_SIZE];

    /** luma_offset_l0 : (-128, 127 )is the range of offset
     * when weighted pred is enabled, 0 is default value */
    WORD8 ai1_luma_offset_l0[MAX_DPB_SIZE];

    /** chroma_weight_l0_flag */
    UWORD8 au1_chroma_weight_l0_flag[MAX_DPB_SIZE];

    /** chroma_weight_l0 : (-128, 127 )is the range of weights
     * when weighted pred is enabled, 128 is default value*/
    WORD16 ai2_chroma_weight_l0[MAX_DPB_SIZE][2];

    /** chroma_offset_l0 : (-128, 127 )is the range of offset
     * when weighted pred is enabled, 0 is default value*/
    WORD8 ai1_chroma_offset_l0[MAX_DPB_SIZE][2];

    /** luma_weight_l0_flag */
    UWORD8 au1_luma_weight_l1_flag[MAX_DPB_SIZE];

    /** luma_weight_l1 : (-128, 127 )is the range of weights
     * when weighted pred is enabled, 128 is default value */
    WORD16 ai2_luma_weight_l1[MAX_DPB_SIZE];

    /** luma_offset_l1 : (-128, 127 )is the range of offset
     * when weighted pred is enabled, 0 is default value */
    WORD8 ai1_luma_offset_l1[MAX_DPB_SIZE];

    /** chroma_weight_l1_flag */
    UWORD8 au1_chroma_weight_l1_flag[MAX_DPB_SIZE];

    /** chroma_weight_l1 : (-128, 127 )is the range of weights
     * when weighted pred is enabled, 128 is default value */
    WORD16 ai2_chroma_weight_l1[MAX_DPB_SIZE][2];

    /** chroma_offset_l1 :(-128, 127 )is the range of offset
     * when weighted pred is enabled, 0 is default value */
    WORD8 ai1_chroma_offset_l1[MAX_DPB_SIZE][2];
}slice_header_t;


/*****************************************************************************/
/* The following can be used to type cast 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 2x2 chroma DC transform
 */
typedef struct
{
    /**
     * significant coefficient map
     */
    UWORD8 u1_sig_coeff_map;

    /**
     * sub block position
     */
    UWORD8 u1_subblk_pos;

    /**
     * holds coefficients
     */
    WORD16  ai2_level[2 * 2];
}tu_sblk2x2_coeff_data_t;

/**
 * Structure to hold coefficient info for a 4x4 transform
 */
typedef struct
{
    /**
     * significant coefficient map
     */
    UWORD16 u2_sig_coeff_map;

    /**
     * sub block position
     */
    UWORD16 u2_subblk_pos;

    /**
     * holds coefficients
     */
    WORD16  ai2_level[SUBBLK_COEFF_CNT];
}tu_sblk4x4_coeff_data_t;

/**
 * Structure to hold coefficient info for a 8x8 transform
 */
typedef struct
{

    /**
     * significant coefficient map
     */
    UWORD32 au4_sig_coeff_map[2];

    /**
     * sub block position
     */
    UWORD16 u2_subblk_pos;

    /**
     * holds coefficients
     */
    WORD16  ai2_level[TRANS_SIZE_8 * TRANS_SIZE_8];
}tu_blk8x8_coeff_data_t;


/**
 * Structure to hold coefficient info for a 16x16 IPCM MB
 */
typedef struct
{
    /**
     * holds coefficients
     */
    UWORD8  au1_level[MB_SIZE * MB_SIZE * 3 / 2];
}tu_ipcm_coeff_data_t;


typedef struct
{
    /**
     * Transform sizes 0: 4x4, 1: 8x8,
     */
    UWORD32     b1_trans_size : 1;

    /**
     * Flag to signal if the current MB is IPCM
     */
    UWORD32     b1_ipcm : 1;

    /**
     * Intra pred sizes  0: 4x4, 1: 8x8, 2: 16x16
     */
    UWORD32     b2_intra_pred_size : 2;

    /**
     * Chroma intra mode
     */
    UWORD32     b2_intra_chroma_pred_mode: 2;

    /**
     * Number of coded subblocks in the current MB, for which
     * tu data is sent. Maximum of 27 subblocks in the following
     * order.
     * 1 4x4 luma DC(for intra16x16),
     * 16 4x4 luma,
     * 2 2x2 chroma DC,
     * 8 4x4 chroma,
     */
    WORD32      b5_num_coded_sblks: 5;

    /**
     * Flag to signal if 4x4 subblock for DC values (in INTRA 16x16 MB)
     * is coded
     */
    UWORD32     b1_luma_dc_coded: 1;

    /**
     * Flag to signal if 4x4 subblock for DC values (in INTRA 16x16 MB)
     * is coded
     */
    UWORD32     b1_chroma_dc_coded: 1;

    /**
     * CSBP - 16 bits, 1 bit for each 4x4
     * for intra16x16 mb_type only ac coefficients are
     */
    UWORD32     b16_luma_csbp: 16;

    /**
     * CSBP - 16 bits, 1 bit for each 4x4
     * for intra16x16 mb_type only ac coefficients are
     */
    UWORD32     b8_chroma_csbp: 8;

    /**
     * Luma Intra pred modes,
     * Based on intra pred size either 16, 4 or 1 entry will be
     * populated below.
     */
    UWORD8     au1_luma_intra_modes[16];

}intra_mb_t;


typedef struct
{
    /**
     * Transform sizes 0: 4x4, 1: 8x8,
     */
    UWORD8     b1_trans_size : 1;


    /**
     * Skip flag
     */
    UWORD8     b1_skip : 1;


    /**
     * Number of coded subblocks in the current MB, for which
     * tu data is sent. Maximum of 26 subblocks in the following
     * order.
     * 16 4x4 luma,
     * 2 2x2 chroma DC,
     * 8 4x4 chroma,
     */
    WORD32      b5_num_coded_sblks: 5;

    /**
     * CSBP - 16 bits, 1 bit for each 4x4
     * for intra16x16 mb_type only ac coefficients are
     */
    UWORD32     b16_luma_csbp: 16;

    /**
     * CSBP - 16 bits, 1 bit for each 4x4
     * for intra16x16 mb_type only ac coefficients are
     */
    UWORD32     b16_chroma_csbp: 8;
}inter_mb_t;

#endif /* _IH264_STRUCTS_H_ */