1 // Copyright (c) 2017-2018 Intel Corporation
2 //
3 // Permission is hereby granted, free of charge, to any person obtaining a copy
4 // of this software and associated documentation files (the "Software"), to deal
5 // in the Software without restriction, including without limitation the rights
6 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 // copies of the Software, and to permit persons to whom the Software is
8 // furnished to do so, subject to the following conditions:
9 //
10 // The above copyright notice and this permission notice shall be included in all
11 // copies or substantial portions of the Software.
12 //
13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 // SOFTWARE.
20 
21 #ifndef __MFXSTRUCTURESPRO_H__
22 #define __MFXSTRUCTURESPRO_H__
23 #include "mfxstructures.h"
24 
25 #ifdef _MSVC_LANG
26 #pragma warning(disable: 4201)
27 #endif
28 
29 #ifdef __cplusplus
30 extern "C"
31 {
32 #endif
33 
34 /* Frame Parameters for AVC */
35 typedef struct {
36     mfxU32  CucId;
37     mfxU32  CucSz;
38     mfxU8   FrameType;
39     mfxU8   FrameType2nd;
40     mfxU8   reserved1a;
41     mfxU8   RecFrameLabel;
42     mfxU8   DecFrameLabel;
43     mfxU8   VppFrameLabel;
44     mfxU16  NumMb;
45     mfxU16  FrameWinMbMinus1;
46     mfxU16  FrameHinMbMinus1;
47     mfxU8   CurrFrameLabel;
48     mfxU8   NumRefFrame;
49 
50     union {
51         mfxU16  CodecFlags;
52         struct {
53             mfxU16  FieldPicFlag    :1;
54             union {
55                 mfxU16  MbaffFrameFlag      :1;
56                 mfxU16  SecondFieldPicFlag  :1;
57             };
58             mfxU16  ResColorTransFlag   :1;
59             mfxU16  SPforSwitchFlag     :1;
60             mfxU16  ChromaFormatIdc     :2;
61             mfxU16  RefPicFlag          :1;
62             mfxU16  ConstraintIntraFlag :1;
63             mfxU16  WeightedPredFlag    :1;
64             mfxU16  WeightedBipredIdc   :2;
65             mfxU16  MbsConsecutiveFlag  :1;
66             mfxU16  FrameMbsOnlyFlag    :1;
67             mfxU16  Transform8x8Flag    :1;
68             mfxU16  NoMinorBipredFlag   :1;
69             mfxU16  IntraPicFlag        :1;
70         };
71     };
72 
73     union {
74         mfxU16  ExtraFlags;
75         struct {
76             mfxU16  EntropyCodingModeFlag   :1;
77             mfxU16  Direct8x8InferenceFlag  :1;
78             mfxU16  TransCoeffFlag          :1;
79             mfxU16  reserved2b              :1;
80             mfxU16  ZeroDeltaPicOrderFlag   :1;
81             mfxU16  GapsInFrameNumAllowed   :1;
82             mfxU16  reserved3c              :2;
83             mfxU16  PicOrderPresent         :1;
84             mfxU16  RedundantPicCntPresent  :1;
85             mfxU16  ScalingListPresent      :1;
86             mfxU16  SliceGroupMapPresent    :1;
87             mfxU16  ILDBControlPresent      :1;
88             mfxU16  MbCodePresent           :1;
89             mfxU16  MvDataPresent           :1;
90             mfxU16  ResDataPresent          :1;
91         };
92     };
93 
94     mfxI8   PicInitQpMinus26;
95     mfxI8   PicInitQsMinus26;
96 
97     mfxI8   ChromaQp1stOffset;
98     mfxI8   ChromaQp2ndOffset;
99     mfxU8   NumRefIdxL0Minus1;
100     mfxU8   NumRefIdxL1Minus1;
101 
102     mfxU8   BitDepthLumaMinus8;
103     mfxU8   BitDepthChromaMinus8;
104 
105     mfxU8   Log2MaxFrameCntMinus4;
106     mfxU8   PicOrderCntType;
107 
108     mfxU8   Log2MaxPicOrdCntMinus4;
109     mfxU8   NumSliceGroupMinus1;
110 
111     mfxU8   SliceGroupMapType;
112     mfxU8   SliceGroupXRateMinus1;
113 
114     union {
115         mfxU8   RefFrameListP[16];
116         mfxU8   RefFrameListB[2][8];
117     };
118 
119     mfxU32  MinFrameSize;
120     mfxU32  MaxFrameSize;
121 } mfxFrameParamAVC;
122 
123 /* Frame Parameters for MPEG-2 */
124 typedef struct {
125     mfxU32  CucId;
126     mfxU32  CucSz;
127     mfxU8   FrameType;
128     mfxU8   FrameType2nd;
129     mfxU8   reserved1a;
130     mfxU8   RecFrameLabel;
131     mfxU8   DecFrameLabel;
132     mfxU8   VppFrameLabel;
133     mfxU16  NumMb;
134     mfxU16  FrameWinMbMinus1;
135     mfxU16  FrameHinMbMinus1;
136     mfxU8   CurrFrameLabel;
137     mfxU8   NumRefFrame;
138 
139     union {
140         mfxU16  CodecFlags;
141         struct {
142             mfxU16  FieldPicFlag        :1;
143             mfxU16  InterlacedFrameFlag :1;
144             mfxU16  SecondFieldFlag     :1;
145             mfxU16  BottomFieldFlag     :1;
146             mfxU16  ChromaFormatIdc     :2;
147             mfxU16  RefPicFlag          :1;
148             mfxU16  BackwardPredFlag    :1;
149             mfxU16  ForwardPredFlag     :1;
150             mfxU16  NoResidDiffs        :1;
151             mfxU16  reserved3c          :2;
152             mfxU16  FrameMbsOnlyFlag    :1;
153             mfxU16  BrokenLinkFlag      :1;
154             mfxU16  CloseEntryFlag      :1;
155             mfxU16  IntraPicFlag        :1;
156         };
157     };
158 
159     union {
160         mfxU16  ExtraFlags;
161         struct {
162             mfxU16  reserved4d          :4;
163             mfxU16  MvGridAndChroma     :4;
164             mfxU16  reserved5e          :8;
165         };
166     };
167 
168     mfxU16  reserved6f;
169     mfxU16  BitStreamFcodes;
170 
171     union {
172         mfxU16  BitStreamPCEelement;
173         struct {
174             mfxU16    reserved7g            :3;
175             mfxU16    ProgressiveFrame      :1;
176             mfxU16    Chroma420type         :1;
177             mfxU16    RepeatFirstField      :1;
178             mfxU16    AlternateScan         :1;
179             mfxU16    IntraVLCformat        :1;
180             mfxU16    QuantScaleType        :1;
181             mfxU16    ConcealmentMVs        :1;
182             mfxU16    FrameDCTprediction    :1;
183             mfxU16    TopFieldFirst         :1;
184             mfxU16    PicStructure          :2;
185             mfxU16    IntraDCprecision      :2;
186         };
187     };
188 
189     mfxU8   BSConcealmentNeed;
190     mfxU8   BSConcealmentMethod;
191     mfxU16  TemporalReference;
192     mfxU32  VBVDelay;
193 
194     union{
195         mfxU8   RefFrameListP[16];
196         mfxU8   RefFrameListB[2][8];
197     };
198 
199     mfxU32  MinFrameSize;
200     mfxU32  MaxFrameSize;
201 } mfxFrameParamMPEG2;
202 
203 typedef union {
204     mfxFrameParamAVC    AVC;
205     mfxFrameParamMPEG2  MPEG2;
206 } mfxFrameParam;
207 
208 
209 #ifdef __cplusplus
210 } // extern "C"
211 #endif
212 
213 #endif
214 
215