• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2018 Intel Corporation. All Rights Reserved.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the
6  * "Software"), to deal in the Software without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sub license, and/or sell copies of the Software, and to
9  * permit persons to whom the Software is furnished to do so, subject to
10  * the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the
13  * next paragraph) shall be included in all copies or substantial portions
14  * of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
19  * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
20  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  */
24 
25 /**
26 * \file avcstreamoutdemo.h
27 *
28 * This file contains the decode streamout layout.
29 */
30 
31 #ifndef _AVC_STREAMOUT_DEMO_H_
32 #define _AVC_STREAMOUT_DEMO_H_
33 
34 typedef signed dw;
35 
36 /*
37  * avc streamout layout
38 */
39 typedef struct {
40     // dw 0
41     union {
42         struct {
43             dw   InterMbMode             : 2;    // Valid only if IntraMbFlag is inter.
44             dw   MbSkipFlag              : 1;    // Cuurently always set to 0
45             dw                           : 1;    // MBZ
46             dw   IntraMbMode             : 2;    // Valid for Inter MB, Used in conjunction with MbType
47             dw                           : 1;    // MBZ
48             dw   MbPolarity              : 1;    // FieldMB polarity
49             dw   MbType5Bits             : 5;    // Matches best MB mode. In H.264 spec: Table 7-11 for Intra; Table 7-14 for Inter.
50             dw   IntraMbFlag             : 1;    // Set if MB is intra, unset if MB is inter
51             dw   MbFieldFlag             : 1;    // Set if field MB, unset if frame MB
52             dw   Transform8x8Flag        : 1;    // Set if current MB uses 8x8 transforms
53             dw                           : 1;    // MBZ
54             dw   CodedPatternDC          : 3;    // AVC Only. Indicates whether DC coeffs are sent. Y is most significant bit.
55             dw   EdgeFilterFlag          : 3;    // AVC.
56             dw                           : 1;    // MBZ
57             dw   PackedMvNum             : 8;    // Debug only. Specifies number of MVs in packed motion vector form
58         };
59         struct {
60             dw   Value;
61         };
62     } DW0;
63 
64     // dw 1
65     union {
66         struct {
67             dw   MbXCnt                  : 16;   // Horizontal Origin of MB in dest piture in units of MBs
68             dw   MbYCnt                  : 16;   // Vertical Origin of MB in dest piture in units of MBs
69         };
70         struct {
71             dw   Value;
72         };
73     } DW1;
74 
75     // dw 2
76     union {
77         struct {
78             dw   CbpAcY                  : 16;   // Coded block pattern for Y.
79             dw   CbpAcU                  : 4;    // Coded block pattern for U
80             dw   CbpAcV                  : 4;    // Coded block pattern for V
81             dw                           : 6;    // Reserved
82             dw   LastMBOfSliceFlag       : 1;    // Indicates current MB is last in slice. Data not right
83             dw   ConcealMBFlag           : 1;    // Specifies in MB is a conceal MB.
84         };
85         struct {
86             dw   Value;
87         };
88     } DW2;
89 
90     // dw 3
91     union {
92         struct {
93             dw   QpPrimeY                : 7;    // AVC: Per-MB QP for luma.
94             dw   QScaleType              : 1;    // MPEG2 only
95             dw   MbClock16               : 8;    // MB compute clocks in 16-clock units
96             dw   NzCoefCountMB           : 9;    // All coded coefficients in MB
97             dw                           : 3;    // Reserved
98             dw   Skip8x8Pattern          : 4;    // AVC Only. Indicates which of the 8x8 sub-blocks uses predicted MVs
99         };
100         struct {
101             dw   Value;
102         };
103     } DW3;
104 
105 
106     // dw 4
107     union {
108         struct {
109             dw   LumaIntraPredModes0     : 16;   // AVC only
110             dw   LumaIntraPredModes1     : 16;   // AVC only
111         } Intra;
112         struct {
113             dw   SubMbShape              : 8;    // Indicates sub-block partitioning for each 8x8 sub-block
114             dw   SubMbPredModes          : 8;    // Indicates prediction mode for each 8x8 sub-block
115             dw                           : 16;   // Reserved
116         } Inter;
117         struct {
118             dw   Value;
119         };
120     } DW4;
121 
122     // dw 5
123     union {
124         struct {
125             dw   LumaIntraPredModes2     : 16;   // AVC only
126             dw   LumaIntraPredModes3     : 16;   // AVC only
127         } Intra;
128         struct {
129             dw   FrameStorIDL0_0     : 8;
130             dw   FrameStorIDL0_1     : 8;
131             dw   FrameStorIDL0_2     : 8;
132             dw   FrameStorIDL0_3     : 8;
133         } Inter;
134         struct {
135             dw   Value;
136         };
137     } DW5;
138 
139     // dw 6
140     union {
141         struct {
142             dw   MbIntraStruct           : 8;    // Indicates which neighbours can be used for intra-prediction
143             dw                           : 24;   // Reserved
144         } Intra;
145         struct {
146             dw   FrameStorIDL1_0     : 8;
147             dw   FrameStorIDL1_1     : 8;
148             dw   FrameStorIDL1_2     : 8;
149             dw   FrameStorIDL1_3     : 8;
150         } Inter;
151         struct {
152             dw   Value;
153         };
154     } DW6;
155 
156     // dw 7
157     union {
158         struct {
159             dw   SubBlockCodeTypeY0      : 2;    // VC-1. Specifies if 8x8, 8x4, 4x8, 4x4
160             dw   SubBlockCodeTypeY1      : 2;    // VC-1. Specifies if 8x8, 8x4, 4x8, 4x4
161             dw   SubBlockCodeTypeY2      : 2;    // VC-1. Specifies if 8x8, 8x4, 4x8, 4x4
162             dw   SubBlockCodeTypeY3      : 2;    // VC-1. Specifies if 8x8, 8x4, 4x8, 4x4
163             dw   SubBlockCodeTypeU       : 2;    // VC-1. Specifies if 8x8, 8x4, 4x8, 4x4
164             dw   SubBlockCodeTypeV       : 2;    // VC-1. Specifies if 8x8, 8x4, 4x8, 4x4
165             dw                           : 8;
166             dw   MvFieldSelect           : 4;    // Field polatity for VC-1 and MPEG2
167             dw                           : 8;
168         };
169         struct {
170             dw   Value;
171         };
172     } DW7;
173 
174     // dw 8-15 for inter MBs only
175     union {
176         struct {
177             dw   MvFwd_x                : 16;   // x-component of fwd MV for 8x8 or 4x4 sub-block
178             dw   MvFwd_y                : 16;   // y-component of fwd MV for 8x8 or 4x4 sub-block
179             dw   MvBwd_x                : 16;   // x-component of bwd MV for 8x8 or 4x4 sub-block
180             dw   MvBwd_y                : 16;   // y-component of bwd MV for 8x8 or 4x4 sub-block
181         };
182         struct {
183             dw   Value[2];
184         };
185     } QW8[4];
186 
187 } VADecStreamOutData;
188 #endif /*_AVC_STREAMOUT_DEMO_H_*/
189