aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc/mediatek/vdec/include/vdec_info_mpeg.h
blob: 9539020f1d24e9c19251355cd7f54eedbb4d4532 (plain) (blame)
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
#ifndef _VDEC_INFO_MPEG_H_
#define _VDEC_INFO_MPEG_H_

//#include "drv_config.h"
#include "chip_ver.h"

#include "type.h"
#include <mach/mt_typedefs.h>

enum Vop_Coding_Type
{
    VCT_I = 0x0,
    VCT_P = 0x1,
    VCT_B = 0x2,
    VCT_S = 0x3
};


enum Sprite_Enable
{
    SPRITE_NOT_USED = 0x0,
    STATIC          = 0x1,
    GMC             = 0x2
};

typedef struct _VDEC_INFO_MPEG_DIR_MODE_T_
{
    UINT32 u4Trd;
    UINT32 u4Trb;
    UINT32 u4Trdi;
    UINT32 u4Trbi;
    UINT32 u4TFrm;
} VDEC_INFO_MPEG_DIR_MODE_T;


typedef struct _VDEC_INFO_MPEG_VFIFO_PRM_T_
{
#if (CONFIG_CHIP_VER_CURR >= CONFIG_CHIP_VER_MT8560)
    UINT32 u4CodeType;                ///< Video decoding type
#endif
    ULONG u4VFifoSa;                 ///< Video Fifo memory start address
    ULONG u4VFifoEa;                 ///< Video Fifo memory end address
} VDEC_INFO_MPEG_VFIFO_PRM_T;


typedef struct _VDEC_INFO_MPEG_BS_INIT_PRM_T_
{
    ULONG u4ReadPointer;
    ULONG u4WritePointer;
    ULONG u4VFifoSa;                 ///< Video Fifo memory start address
    ULONG u4VFifoEa;                 ///< Video Fifo memory end address
} VDEC_INFO_MPEG_BS_INIT_PRM_T;


typedef struct _VDEC_INFO_MPEG_QANTMATRIX_T_
{
    UCHAR ucQuantMatrix[64];                           ///< Quantization matrix array
} VDEC_INFO_MPEG_QANTMATRIX_T;


typedef struct _VDEC_INFO_MPEG2_PIC_PRM_T_
{
    // Picture structure: FRM_PIC, TOP_FLD_PIC, BTM_FLD_PIC
    UCHAR  ucPicStruct;
    // picture coding type: I_TYPE, B_TYPE, P_TYPE
    UCHAR  ucPicCdTp;
    // frame_pred_frame_dct
    UCHAR  ucFrmPredFrmDct;
    // concealment_motion_vectors
    UCHAR  ucConcMotVec;
    // q_scale_type
    UCHAR  ucQScaleType;
    // top field first
    UCHAR  ucTopFldFirst;
    // full_pel_forward_vector
    UCHAR  ucFullPelFordVec;
    // full_pel_backward_vector
    UCHAR  ucFullPelBackVec;
    // intra_vld_format
    UCHAR  ucIntraVlcFmt;
    // intra_dc_precision
    UCHAR  ucIntraDcPre;
    // alternate_scan
    UCHAR  ucAltScan;

    UCHAR  pucfcode[2][2];
    UCHAR  ucFordFCode;
    UCHAR  ucBackFCode;
} VDEC_INFO_MPEG2_PIC_PRM_T;


typedef struct _VDEC_INFO_DIVX3_PIC_PRM_T_
{
    UCHAR  ucAltIAcChromDct;
    UCHAR  ucAltIAcChromDctIdx;
    UCHAR  ucAltIAcLumDct;
    UCHAR  ucAltIAcLumDctIdx;
    UCHAR  ucAltIDcDct;
    UCHAR  ucHasSkip;
    UCHAR  ucAltPAcDct;
    UCHAR  ucAltPAcDctIdx;
    UCHAR  ucAltPDcDct;
    UCHAR  ucAltMv;
    UCHAR  ucFrameMode;
    UCHAR  ucSliceBoundary[5];
} VDEC_INFO_DIVX3_PIC_PRM_T;


typedef struct _VDEC_INFO_MPEG4_VOL_PRM_T_
{
    UCHAR  ucShortVideoHeader;
    UINT16 u2VopTimeIncrementResolution;
    UCHAR  ucInterlaced;
    UCHAR  ucQuantType;
    UCHAR  ucQuarterSample;
    UCHAR  ucResyncMarkerDisable;
    UCHAR  ucDataPartitioned;
    UCHAR  ucReversibleVlc;
    UCHAR  ucSourceFormat; // for short video header
    UCHAR  ucSorenson;      //Sorenson H263
} VDEC_INFO_MPEG4_VOL_PRM_T;


typedef struct _VDEC_INFO_MPEG_GMC_PRM_T_
{
    UCHAR  ucEffectiveWarpingPoints;
    INT32   i4GmcYMvX;
    INT32   i4GmcYMvY;
    INT32   i4GmcCMvX;
    INT32   i4GmcCMvY;
} VDEC_INFO_MPEG_GMC_PRM_T;


typedef struct _VDEC_INFO_MPEG4_VOP_PRM_T_
{
    UCHAR  ucIntraDcVlcThr;
    UCHAR  fgTopFldFirst;
    UCHAR  ucFordFCode;
    UCHAR  ucBackFCode;
    UCHAR  ucBRefCdTp;
    UCHAR  fgAlternateVerticalScanFlag;
    VDEC_INFO_MPEG_DIR_MODE_T *prDirMd;   // for direct mode
    VDEC_INFO_MPEG_GMC_PRM_T *prGmcPrm;
} VDEC_INFO_MPEG4_VOP_PRM_T;


typedef struct _VDEC_INFO_M4V_DEC_PRM_T_
{
    VDEC_INFO_MPEG4_VOL_PRM_T *prVol;
    VDEC_INFO_MPEG4_VOP_PRM_T *prVop;
} VDEC_INFO_M4V_DEC_PRM_T;


typedef struct _VDEC_INFO_MPEG4_WORK_BUF_SA_T_
{
    ULONG  u4DcacSa;
    ULONG  u4MvecSa;
    ULONG  u4Bmb1Sa;
    ULONG  u4Bmb2Sa;
    ULONG  u4BcodeSa;
    ULONG  u4VldWrapperSa;
    ULONG  u4PPWrapperSa;
    //6589NEW 2.4, 2.5, 4.1
    ULONG  u4DataPartitionSa;
    ULONG  u4NotCodedSa;
    ULONG  u4MvDirectSa;
} VDEC_INFO_MPEG4_WORK_BUF_SA_T;


#if (CONFIG_CHIP_VER_CURR >= CONFIG_CHIP_VER_MT8580)
typedef struct _VDEC_INFO_MPEG4_WORK_BUF_SZ_T_
{
    UINT32  u4DcacSize;
    UINT32  u4BcodeSize;
    UINT32  u4MVSize;
    UINT32  u4MB1Size;
    UINT32  u4MB2Size;
    //6589NEW 2.3, 2.6
    UINT32  u4DataPartitionSize;
    UINT32  u4NotCodedSize;
} VDEC_INFO_MPEG4_WORK_BUF_SZ_T;
#endif


typedef struct _VDEC_INFO_MPEG4_DEC_PRM_T_
{
    // common for MPEG4 and DivX3
    UCHAR  ucVopCdTp;  // in MPEG4 VOP layer
    UCHAR  ucVopQuant; // in MPEG4 VOP layer
    UCHAR  ucVopRoundingType; // in MPEG4 VOP layer

    // for unrestricted mv
    UINT32 u4UmvPicW;
    UINT32 u4UmvPicH;
    UINT32 u4QPelType;
    UINT32 u4CMvType;
    VDEC_INFO_MPEG4_WORK_BUF_SA_T rMpeg4WorkBufSa;
#if (CONFIG_CHIP_VER_CURR >= CONFIG_CHIP_VER_MT8580)
    VDEC_INFO_MPEG4_WORK_BUF_SZ_T rMpeg4WorkBufSize;
#endif
    union
    {
        VDEC_INFO_DIVX3_PIC_PRM_T rDx3DecPrm;
        VDEC_INFO_M4V_DEC_PRM_T rM4vDecPrm;
    } rDep;
} VDEC_INFO_MPEG4_DEC_PRM_T;


typedef struct _VDEC_INFO_MPEG_FRAME_BUF_SA_T_
{
    ULONG  u4Pic0YSa;
    ULONG  u4Pic0CSa;
    ULONG  u4Pic1YSa;
    ULONG  u4Pic1CSa;
    ULONG  u4Pic2YSa;
    ULONG  u4Pic2CSa;
} VDEC_INFO_MPEG_FRAME_BUF_SA_T;


typedef struct _VDEC_INFO_MPEG_PP_INFO_T_
{
    BOOL     fgPpEnable;
    BOOL     fgPpDemoEn;
    UINT8    u1PpLevel;
    UINT8    au1MBqp[4];
    UINT32  u4PpYBufSa;
    UINT32  u4PpCBufSa;
} VDEC_INFO_MPEG_PP_INFO_T;


typedef struct _VDEC_INFO_MPEG_DEC_PRM_T_
{
    // MPEG version: 1, 2, 3, 4 (3: DivX 3.11)
    UCHAR  ucMpegVer;
    UCHAR  ucDecFld;
    UINT32  u4FRefBufIdx;

    // Decode picture setting
    BOOL    fgB21Mode;
    BOOL    fgRetErr;
    BOOL    fgIgnoreVdo;
    BOOL    fgDec2ndFld;
    UINT32 u4DecXOff;
    UINT32 u4DecYOff;
    UINT32 u4DecW;
    UINT32 u4DecH;
    UINT32 u4MaxMbl;
    UINT32 u4BBufStart;
    UINT32 u4DramPicSize;
    UINT32 u4DramPicArea;
    VDEC_INFO_MPEG_FRAME_BUF_SA_T rMpegFrameBufSa;
    VDEC_INFO_MPEG_PP_INFO_T rMpegPpInfo;
    union
    {
        VDEC_INFO_MPEG2_PIC_PRM_T rMp2PicPrm;
        VDEC_INFO_MPEG4_DEC_PRM_T rMp4DecPrm;
    } rPicLayer;
} VDEC_INFO_MPEG_DEC_PRM_T;


typedef struct _VDEC_HAL_DEC_MPEG_ERR_INFO_T_
{
    UINT32 u4MpegErrCnt;                                ///< Video decode error count
    UINT32 u4MpegErrRow;                                ///< Video decode error mb row
    UINT32 u4MpegErrType;                               ///< Video decode error type
    UINT16 u2MpegMBErrCnt;
} VDEC_INFO_MPEG_ERR_INFO_T;

#endif //#ifndef _VDEC_INFO_MPEG_H_