xref: /utopia/UTPA2-700.0.x/modules/vdec_v2/drv/mvd_ex/drvMVD_EX.h (revision 53ee8cc121a030b8d368113ac3e966b4705770ef)
1 //<MStar Software>
2 //******************************************************************************
3 // MStar Software
4 // Copyright (c) 2010 - 2012 MStar Semiconductor, Inc. All rights reserved.
5 // All software, firmware and related documentation herein ("MStar Software") are
6 // intellectual property of MStar Semiconductor, Inc. ("MStar") and protected by
7 // law, including, but not limited to, copyright law and international treaties.
8 // Any use, modification, reproduction, retransmission, or republication of all
9 // or part of MStar Software is expressly prohibited, unless prior written
10 // permission has been granted by MStar.
11 //
12 // By accessing, browsing and/or using MStar Software, you acknowledge that you
13 // have read, understood, and agree, to be bound by below terms ("Terms") and to
14 // comply with all applicable laws and regulations:
15 //
16 // 1. MStar shall retain any and all right, ownership and interest to MStar
17 //    Software and any modification/derivatives thereof.
18 //    No right, ownership, or interest to MStar Software and any
19 //    modification/derivatives thereof is transferred to you under Terms.
20 //
21 // 2. You understand that MStar Software might include, incorporate or be
22 //    supplied together with third party`s software and the use of MStar
23 //    Software may require additional licenses from third parties.
24 //    Therefore, you hereby agree it is your sole responsibility to separately
25 //    obtain any and all third party right and license necessary for your use of
26 //    such third party`s software.
27 //
28 // 3. MStar Software and any modification/derivatives thereof shall be deemed as
29 //    MStar`s confidential information and you agree to keep MStar`s
30 //    confidential information in strictest confidence and not disclose to any
31 //    third party.
32 //
33 // 4. MStar Software is provided on an "AS IS" basis without warranties of any
34 //    kind. Any warranties are hereby expressly disclaimed by MStar, including
35 //    without limitation, any warranties of merchantability, non-infringement of
36 //    intellectual property rights, fitness for a particular purpose, error free
37 //    and in conformity with any international standard.  You agree to waive any
38 //    claim against MStar for any loss, damage, cost or expense that you may
39 //    incur related to your use of MStar Software.
40 //    In no event shall MStar be liable for any direct, indirect, incidental or
41 //    consequential damages, including without limitation, lost of profit or
42 //    revenues, lost or damage of data, and unauthorized system use.
43 //    You agree that this Section 4 shall still apply without being affected
44 //    even if MStar Software has been modified by MStar in accordance with your
45 //    request or instruction for your use, except otherwise agreed by both
46 //    parties in writing.
47 //
48 // 5. If requested, MStar may from time to time provide technical supports or
49 //    services in relation with MStar Software to you for your use of
50 //    MStar Software in conjunction with your or your customer`s product
51 //    ("Services").
52 //    You understand and agree that, except otherwise agreed by both parties in
53 //    writing, Services are provided on an "AS IS" basis and the warranty
54 //    disclaimer set forth in Section 4 above shall apply.
55 //
56 // 6. Nothing contained herein shall be construed as by implication, estoppels
57 //    or otherwise:
58 //    (a) conferring any license or right to use MStar name, trademark, service
59 //        mark, symbol or any other identification;
60 //    (b) obligating MStar or any of its affiliates to furnish any person,
61 //        including without limitation, you and your customers, any assistance
62 //        of any kind whatsoever, or any information; or
63 //    (c) conferring any license or right under any intellectual property right.
64 //
65 // 7. These terms shall be governed by and construed in accordance with the laws
66 //    of Taiwan, R.O.C., excluding its conflict of law rules.
67 //    Any and all dispute arising out hereof or related hereto shall be finally
68 //    settled by arbitration referred to the Chinese Arbitration Association,
69 //    Taipei in accordance with the ROC Arbitration Law and the Arbitration
70 //    Rules of the Association by three (3) arbitrators appointed in accordance
71 //    with the said Rules.
72 //    The place of arbitration shall be in Taipei, Taiwan and the language shall
73 //    be English.
74 //    The arbitration award shall be final and binding to both parties.
75 //
76 //******************************************************************************
77 //<MStar Software>
78 ////////////////////////////////////////////////////////////////////////////////
79 //
80 // Copyright (c) 2008-2009 MStar Semiconductor, Inc.
81 // All rights reserved.
82 //
83 // Unless otherwise stipulated in writing, any and all information contained
84 // herein regardless in any format shall remain the sole proprietary of
85 // MStar Semiconductor Inc. and be kept in strict confidence
86 // ("MStar Confidential Information") by the recipient.
87 // Any unauthorized act including without limitation unauthorized disclosure,
88 // copying, use, reproduction, sale, distribution, modification, disassembling,
89 // reverse engineering and compiling of the contents of MStar Confidential
90 // Information is unlawful and strictly prohibited. MStar hereby reserves the
91 // rights to any and all damages, losses, costs and expenses resulting therefrom.
92 //
93 ////////////////////////////////////////////////////////////////////////////////
94 
95 ///////////////////////////////////////////////////////////////////////////////////////////////////
96 ///
97 /// @file  drvMVD.h
98 /// @brief MPEG-2/4 Video Decoder header file
99 /// @author MStar Semiconductor Inc.
100 ///////////////////////////////////////////////////////////////////////////////////////////////////
101 
102 #ifndef _DRV_MVD_H_
103 #define _DRV_MVD_H_
104 
105 
106 
107 
108 ////////////////////////////////////////////////////////////////////////////////
109 // Include List
110 ////////////////////////////////////////////////////////////////////////////////
111 
112 #ifdef __cplusplus
113 extern "C"
114 {
115 #endif
116 
117 #if !defined(MSOS_TYPE_NUTTX) || defined(SUPPORT_X_MODEL_FEATURE)
118 
119 #include "drvmvd_cc.h"
120 ////////////////////////////////////////////////////////////////////////////////
121 // Constant & Macro Definition
122 ////////////////////////////////////////////////////////////////////////////////
123 /// Version string.
124 #define MVD_DRV_VERSION                 /* Character String for DRV/API version             */  \
125     MSIF_TAG,                           /* 'MSIF'                                           */  \
126     MSIF_CLASS,                         /* '00'                                             */  \
127     MSIF_CUS,                           /* 0x0000                                           */  \
128     MSIF_MOD,                           /* 0x0000                                           */  \
129     MSIF_CHIP,                                                                                  \
130     MSIF_CPU,                                                                                   \
131     {'M','V','D','_'},                  /* IP__                                             */  \
132     {'0','A'},                          /* 0.0 ~ Z.Z                                        */  \
133     {'0','1'},                          /* 00 ~ 99                                          */  \
134     {'0','0','6','4','1','6','6','7'},  /* CL#                                              */  \
135     MSIF_OS
136 
137 #define MIU_SEL_0         0
138 #define MIU_SEL_1         1
139 #define MIU_SEL_2         2
140 #define MIU_SEL_3         3
141 
142 
143 #define MST_MODE_TRUE     1
144 #define MST_MODE_FALSE    0
145 
146 ////////////////////////////////////////////////////////////////////////////////
147 // Type & Structure Declaration
148 ////////////////////////////////////////////////////////////////////////////////
149 /// MVD's capability
150 typedef struct _MVD_Caps
151 {
152     MS_BOOL bMPEG2;
153     MS_BOOL bMPEG4;
154     MS_BOOL bVC1;
155 } MVD_Caps;
156 
157 /// MVD driver info.
158 typedef struct _MVD_DrvInfo
159 {
160     MS_U32 u32Resource;
161     MS_U32 u32DeviceNum;
162     MS_U32 u32FWVersion;
163     MVD_Caps stCaps;
164 } MVD_DrvInfo;
165 
166 /// Firmware status
167 typedef enum _MVD_DecStat
168 {
169     E_MVD_STAT_IDLE             = 0x00,
170     E_MVD_STAT_FIND_STARTCODE   = 0x01,//start code
171     E_MVD_STAT_FIND_SPECIALCODE = 0x11,//special code [00_00_01_C5_ab_08_06_27]
172                                        //for flush data using
173     E_MVD_STAT_FIND_FRAMEBUFFER = 0x02,
174     //fw is trying to find empty FB to continue decoding.
175     //if hang in this state, please check "vsync" or AVSync.
176     E_MVD_STAT_WAIT_DECODEDONE  = 0x03,
177     E_MVD_STAT_DECODE_DONE      = 0x04,
178     E_MVD_STAT_WAIT_VDFIFO      = 0x05,
179     E_MVD_STAT_INIT_SUCCESS     = 0x06,
180     E_MVD_STAT_UNKNOWN          = 0xff,
181 } MVD_DecStat;
182 
183 /// MVD driver status
184 typedef struct _MVD_DrvStatus
185 {
186 //    MS_U32      u32FWVer;
187     MVD_DecStat eDecStat;
188 //    MS_BOOL     bIsBusy;
189     MS_U8       u8LastFWCmd;
190 } MVD_DrvStatus;
191 
192 /// MVD stream types for dual decoders
193 typedef enum
194 {
195     E_MVD_DRV_STREAM_NONE = 0,
196     E_MVD_DRV_MAIN_STREAM,
197     E_MVD_DRV_SUB_STREAM,
198     E_MVD_DRV_STREAM_MAX = E_MVD_DRV_SUB_STREAM,
199 } MVD_DRV_StreamType;
200 
201 /// Enumerate CodecType that MVD supports
202 typedef enum _MVD_CodecType
203 {
204     E_MVD_CODEC_MPEG2                    = 0x10,
205     E_MVD_CODEC_MPEG4                    = 0x00,
206     E_MVD_CODEC_MPEG4_SHORT_VIDEO_HEADER = 0x01,
207     E_MVD_CODEC_DIVX311                  = 0x02,
208     E_MVD_CODEC_FLV                      = 0x03,
209     E_MVD_CODEC_VC1_ADV                  = 0x04,
210     E_MVD_CODEC_VC1_MAIN                 = 0x05,
211     E_MVD_CODEC_UNKNOWN                  = 0xff
212 } MVD_CodecType;
213 
214 /// Mode of MVD input source
215 typedef enum _MVD_SrcMode
216 {
217     E_MVD_FILE_MODE       = 0x00,
218     E_MVD_SLQ_MODE        = 0x01,
219     E_MVD_TS_MODE         = 0x02,
220     E_MVD_SLQ_TBL_MODE    = 0x03,
221     E_MVD_TS_FILE_MODE    = 0x04,
222     E_MVD_SRC_UNKNOWN     = 0x05
223 } MVD_SrcMode;
224 
225 /// AVSync mode for file playback
226 typedef enum
227 {
228     E_MVD_TIMESTAMP_FREERUN  = 0,  ///Player didn't set PTS/DTS, so display freerun
229     E_MVD_TIMESTAMP_PTS      = 1,  ///Player set PTS to MVD decoder
230     E_MVD_TIMESTAMP_DTS      = 2,  ///Player set DTS to MVD decoder
231     E_MVD_TIMESTAMP_STS      = 3,  ///SortedTimeStamp means decoder should sort timestamp
232     E_MVD_TIMESTAMP_PTS_RVU  = 4,  ///Player set PTS to MVD decoder
233     E_MVD_TIMESTAMP_DTS_RVU  = 5,  ///Player set DTS to MVD decoder
234     E_MVD_TIMESTAMP_NEW_STS  = 6,  ///Player set PTS to MVD decoder
235 } MVD_TIMESTAMP_TYPE;
236 
237 /// ErrCode obtained from firmware
238 typedef enum _MVD_ErrCode
239 {
240     E_MVD_ERR_UNKNOWN            = 0,
241     E_MVD_ERR_SHAPE              = 1,
242     E_MVD_ERR_USED_SPRITE        = 2,
243     E_MVD_ERR_NOT_8_BIT          = 3,   //error_status : bits per pixel
244     E_MVD_ERR_NERPRED_ENABLE     = 4,
245     E_MVD_ERR_REDUCED_RES_ENABLE = 5,
246     E_MVD_ERR_SCALABILITY        = 6,
247     E_MVD_ERR_OTHER              = 7,
248     E_MVD_ERR_H263_ERROR         = 8,
249     E_MVD_ERR_RES_NOT_SUPPORT    = 9,   //error_status : none
250     E_MVD_ERR_MPEG4_NOT_SUPPORT  = 10,  //error_status : none
251     E_MVD_ERR_PROFILE_NOT_SUPPORT= 11,   //error_status : none
252     E_MVD_ERR_RCV_ERROR_OCCUR= 12   //error_status : none
253 } MVD_ErrCode;
254 
255 /// Detailed error status when error occurs
256 typedef enum _MVD_ErrStatus
257 {
258     //error_status for E_MVD_ERR_SHAPE
259     E_MVD_ERR_SHAPE_RECTANGULAR    = 0x10,
260     E_MVD_ERR_SHAPE_BINARY         = 0x11,
261     E_MVD_ERR_SHAPE_BINARY_ONLY    = 0x12,
262     E_MVD_ERR_SHAPE_GRAYSCALE      = 0x13,
263 
264     //error_status for E_MVD_ERR_USED_SPRITE
265     E_MVD_ERR_USED_SPRITE_UNUSED   = 0x20, //sprite not used
266     E_MVD_ERR_USED_SPRITE_STATIC   = 0x21,
267     E_MVD_ERR_USED_SPRITE_GMC      = 0x22,
268     E_MVD_ERR_USED_SPRITE_RESERVED = 0x23,
269 
270     E_MVD_ERR_STATUS_NONE          = 0x77,
271     E_MVD_ERR_STATUS_UNKOWN        = 0x00,
272 } MVD_ErrStatus;
273 
274 /// Picture type of MPEG video
275 typedef enum _MVD_PicType
276 {
277     E_MVD_PIC_I = 0,
278     E_MVD_PIC_P = 1,
279     E_MVD_PIC_B = 2,
280     E_MVD_PIC_UNKNOWN = 0xf,
281 } MVD_PicType;
282 
283 /// Mode of frame rate conversion
284 typedef enum _MVD_FrcMode {
285     E_MVD_FRC_NORMAL = 0,
286     E_MVD_FRC_DISP_TWICE = 1,
287     E_MVD_FRC_3_2_PULLDOWN = 2,
288     E_MVD_FRC_PAL_TO_NTSC = 3,
289     E_MVD_FRC_NTSC_TO_PAL = 4,
290     E_MVD_FRC_DISP_ONEFIELD = 5,//Removed, call MDrv_MVD_EnableDispOneField() instead.
291 } MVD_FrcMode;
292 
293 /// MVD play mode
294 typedef enum
295 {
296     E_MVD_PLAY          = 0x00,
297     E_MVD_STEPDISP      = 0x01,
298     E_MVD_PAUSE         = 0x02,
299     E_MVD_FASTFORWARD   = 0x03,
300     E_MVD_BACKFORWARD   = 0x04,
301     E_MVD_UNKNOWMODE    = 0xff
302 } MVD_PlayMode;
303 
304 /// Store the packet information used for SLQ table file mode
305 typedef struct
306 {
307     MS_VIRT u32StAddr;    ///< Packet offset from bitstream buffer base address. unit: byte.
308     MS_U32 u32Length;    ///< Packet size. unit: byte.
309     MS_U32 u32TimeStamp; ///< Packet time stamp. unit: ms.
310     MS_U32 u32ID_L;      ///< Packet ID low part.
311     MS_U32 u32ID_H;      ///< Packet ID high part.
312 } MVD_PacketInfo;
313 
314 ///MVD frame info data structure
315 typedef struct
316 {
317     MS_U16  u16HorSize;
318     MS_U16  u16VerSize;
319     MS_U32  u32FrameRate;
320     MS_U8   u8AspectRate;
321     MS_U8   u8Interlace;
322     MS_U8   u8AFD;
323     MS_U16  u16par_width;
324     MS_U16  u16par_height;
325     MS_U16  u16SarWidth;
326     MS_U16  u16SarHeight;
327     MS_U16  u16CropRight;
328     MS_U16  u16CropLeft;
329     MS_U16  u16CropBottom;
330     MS_U16  u16CropTop;
331     MS_U16  u16Pitch;
332     MS_U16  u16PTSInterval;
333     MS_U8   u8MPEG1;
334     MS_U8   u8PlayMode;
335     MS_U8   u8FrcMode;
336     MS_VIRT  u32DynScalingAddr;    ///Dynamic scaling address
337     MS_U8   u8DynScalingDepth;    ///Dynamic scaling depth
338     MS_U32  u32DynScalingBufSize;    ///Dynamic scaling BufSize
339     MS_BOOL bEnableMIUSel;        ///Dynamic scaling DS buffer on miu1 or miu0
340 } MVD_FrameInfo;
341 
342 /// MVD AVSync Configuration
343 typedef struct
344 {
345     MS_U32  u32Delay;       //unit: ms
346     MS_U16  u16Tolerance;   //unit: ms
347     MS_BOOL bEnable;
348     MS_U8   u8Rsvd;         //reserved
349 } MVD_AVSyncCfg;
350 
351 /// MVD Command arguments
352 typedef struct
353 {
354     MS_U8 Arg0;    ///< argument 0
355     MS_U8 Arg1;    ///< argument 1
356     MS_U8 Arg2;    ///< argument 2
357     MS_U8 Arg3;    ///< argument 3
358     MS_U8 Arg4;    ///< argument 4
359     MS_U8 Arg5;    ///< argument 5
360 } MVD_CmdArg;
361 
362 /// MVD commands needing handshake
363 typedef enum
364 {
365     MVD_HANDSHAKE_PAUSE,
366     MVD_HANDSHAKE_SLQ_RST,
367     MVD_HANDSHAKE_STOP,
368     MVD_HANDSHAKE_SKIP_DATA,
369     MVD_HANDSHAKE_SKIP_TO_PTS,
370     MVD_HANDSHAKE_SINGLE_STEP,
371     MVD_HANDSHAKE_SCALER_INFO,
372     MVD_HANDSHAKE_GET_NXTDISPFRM,
373     MVD_HANDSHAKE_PARSER_RST,
374     MVD_HANDSHAKE_RST_CC608,
375     MVD_HANDSHAKE_RST_CC708
376 } MVD_HANDSHAKE_CMD;
377 
378 
379 
380 typedef enum
381 {
382     E_MVD_FB_REDUCTION_NONE = 0,        ///< FB reduction disable
383     E_MVD_FB_REDUCTION_1_2 = 1,         ///< FB reduction 1/2
384     E_MVD_FB_REDUCTION_1_4 = 2,         ///< FB reduction 1/4
385 } MVD_FB_Reduction_Type;
386 
387 typedef struct
388 {
389     MVD_FB_Reduction_Type LumaFBReductionMode;     ///< Luma frame buffer reduction mode.
390     MVD_FB_Reduction_Type ChromaFBReductionMode;   ///< Chroma frame buffer reduction mode.
391     MS_U8                 u8EnableAutoMode;        /// 0: Disable, 1: Enable
392     MS_U8                 u8ReservedByte;          /// Reserved byte
393 } MVD_FB_Reduction;
394 
395 /// Configuration of MVD firmware
396 typedef struct
397 {
398     MVD_CodecType    eCodecType;        ///< Specify the active codec type
399     MVD_SrcMode      eSrcMode;          ///< Specify the input source
400     MS_U8            bDisablePESParsing;///< MVD parser enable/disable
401     MS_BOOL          bNotReload;        ///< TRUE to not allow loading f/w after the 1st init to speed up.
402     MVD_FB_Reduction stFBReduction;     ///< MVD Frame buffer reduction type
403     MS_U16           u16FBReduceValue;
404     MS_U8            u8FBMode;          ///driver internal attribute: SD or HD
405     MS_U8            u8FBNum;           ///driver internal attribute: # of frames in FB
406     MS_VIRT           u32FBUsedSize;     ///driver internal attribute: used size
407 } MVD_FWCfg;
408 
409 /// The type of fw binary input source
410 typedef enum
411 {
412     E_MVD_FW_SOURCE_NONE,       ///< No input fw.
413     E_MVD_FW_SOURCE_DRAM,       ///< input source from DRAM.
414     E_MVD_FW_SOURCE_FLASH,      ///< input source from FLASH.
415 } MVD_FWSrcType;
416 
417 /// Configuration of memory layout
418 typedef struct
419 {
420     MVD_FWSrcType eFWSrcType;         //!< the input FW source type.
421     MS_VIRT     u32FWSrcVAddr;         //!< virtual address of input FW binary in DRAM
422     MS_PHY u32FWBinAddr;          //!< physical address in Flash/DRAM of FW code
423     MS_VIRT     u32FWBinSize;
424     MS_PHY u32FWCodeAddr;
425     MS_VIRT     u32FWCodeSize;
426     MS_PHY u32FBAddr;
427     MS_VIRT     u32FBSize;
428     MS_PHY u32BSAddr;
429     MS_VIRT     u32BSSize;
430     MS_PHY u32DrvBufAddr;
431     MS_VIRT     u32DrvBufSize;
432     MS_PHY u32DynSacalingBufAddr;
433     MS_VIRT     u32DynSacalingBufSize;
434     MS_PHY u32Miu1BaseAddr;
435     MS_PHY u32Miu2BaseAddr;
436     MS_PHY u32Miu3BaseAddr;
437     MS_BOOL    bFWMiuSel;
438     MS_BOOL    bHWMiuSel;
439     MS_U8      u8FWMiuSel;
440     MS_U8      u8HWMiuSel;
441     MS_BOOL    bEnableDynScale;       /// dynamic scaling control bit
442     MS_BOOL    bSupportSDModeOnly;    /// Config from IP Check
443 } MVD_MEMCfg;
444 
445 /// Return value of MVD driver
446 typedef enum
447 {
448     E_MVD_RET_OK            = 1,
449     E_MVD_RET_FAIL          = 0,
450     E_MVD_RET_INVALID_PARAM = 2,
451     E_MVD_RET_QUEUE_FULL    = 3,
452     E_MVD_RET_TIME_OUT      = 4
453 } E_MVD_Result;
454 
455 /// Mode of trick decoding
456 typedef enum
457 {
458     E_MVD_TRICK_DEC_ALL = 0,
459     E_MVD_TRICK_DEC_IP,
460     E_MVD_TRICK_DEC_I,
461     E_MVD_TRICK_DEC_UNKNOWN
462 } MVD_TrickDec;
463 
464 /// Speed type of playing
465 typedef enum
466 {
467     E_MVD_SPEED_DEFAULT = 0,
468     E_MVD_SPEED_FAST,
469     E_MVD_SPEED_SLOW,
470     E_MVD_SPEED_TYPE_UNKNOWN
471 } MVD_SpeedType;
472 
473 /// MVD pattern type
474 typedef enum
475 {
476     E_MVD_PATTERN_FLUSH = 0,           ///< Used after MDrv_MVD_Flush().
477     E_MVD_PATTERN_FILEEND,             ///< Used for file end.
478 } MVD_PatternType;
479 
480 /// MVD frame info structure
481 typedef struct
482 {
483     MS_PHY u32LumaAddr;    ///< The start physical of luma data. Unit: byte.
484     MS_PHY u32ChromaAddr;  ///< The start physcal of chroma data. Unit: byte.
485     MS_U32 u32TimeStamp;       ///< Time stamp(DTS, PTS) of current displayed frame. Unit: 90khz.
486     MS_U32 u32ID_L;            ///< low part of ID number set by MDrv_MVD_PushQueue().
487     MS_U32 u32ID_H;            ///< high part of ID number set by MDrv_MVD_PushQueue().
488     MS_U16 u16Pitch;           ///< The pitch of current frame.
489     MS_U16 u16Width;           ///< pixel width of current frame.
490     MS_U16 u16Height;          ///< pixel height of current frame.
491     MS_U16 u16FrmIdx;          ///< index of current frame.
492     MVD_PicType eFrmType;     ///< picture type: I, P, B frame
493 } MVD_FrmInfo;
494 
495 /// MVD extension display info structure
496 typedef struct
497 {
498     MS_U16 u16VSize;         /// vertical size from sequene_display_extension
499     MS_U16 u16HSize;         /// horizontal size from sequene_display_extension
500     MS_U16 u16VOffset;       /// vertical offset from picture_display_extension
501     MS_U16 u16HOffset;       /// horizontal offset from picture_display_extension
502 } MVD_ExtDispInfo;
503 
504 /// Type of frame info that can be queried
505 typedef enum
506 {
507     E_MVD_FRMINFO_DISPLAY=0,   ///< Displayed frame.
508     E_MVD_FRMINFO_DECODE =1,   ///< Decoded frame.
509     E_MVD_FRMINFO_NEXT_DISPLAY =2,///< Next frame to be displayed.
510 } MVD_FrmInfoType;
511 
512 typedef enum {
513     E_MVD_FRAME_FLIP    = 0,
514     E_MVD_FRAME_RELEASE = 1,
515 } MVD_FrmOpt;
516 
517 ///MVD set debug mode
518 typedef enum
519 {
520     E_MVD_EX_DBG_MODE_ORI = 0,
521     E_MVD_EX_DBG_MODE_BYPASS_INSERT_START_CODE , 	/// for UT
522     E_MVD_EX_DBG_MODE_BYPASS_DIVX_MC_PATCH,			/// for UT
523     E_MVD_EX_DBG_MODE_NUM
524 } MVD_DbgMode;
525 
526 typedef struct
527 {
528 	union
529 	{
530 		struct
531 		{
532 			MS_U32 bBypassInsertStartCode : 1;  // TRUE: for bypass insert start code for UT...
533 			MS_U32 bBypassDivxMCPatch : 1;      // TRUE: for bypass divx MC patch for UT...
534 		};
535 		MS_U32 value;
536 	};
537 }MVD_DbgModeCfg;
538 
539 /// Attributes used by drvMVD & halMVD
540 /// Updated by halMVD, read-only for drvMVD
541 typedef struct
542 {
543     MS_BOOL         bAVSyncOn;
544     MS_BOOL         bDropErrFrm;
545     MS_BOOL         bDropDispfrm;
546     MS_BOOL         bDecodeIFrame;
547     MS_BOOL         bStepDecode;
548     MS_BOOL         bStepDisp;
549     MS_BOOL         bStep2Pts;
550     MS_BOOL         bSkip2Pts;
551     MS_BOOL         bEnableLastFrmShow;
552     MS_BOOL         bSlqTblSync;
553     MS_U8           u8MstMode; //MStreamer mode=1; Non-MSt mode=0.
554     MS_U8           u8McuMode; //MCU mode=1;
555     MS_U8           u8DynScalingDepth;
556     MVD_TrickDec    eTrickMode;
557     MVD_FrcMode     eFrcMode;
558     MVD_TIMESTAMP_TYPE eFileSyncMode;
559     MVD_SpeedType   ePreSpeedType;
560     MS_VIRT          u32UsrDataRd;
561     MS_U32          u32IntCnt;      /// interrupt ocurred counter
562     MVD_AVSyncCfg   stSyncCfg;
563     MVD_DbgModeCfg  stDbgModeCfg;
564     MS_BOOL         bExternalDSBuf;
565 } MVD_CtrlCfg;
566 
567 /// MVD time code structure
568 typedef struct
569 {
570     MS_U8   u8TimeCodeHr;   ///<  time_code_hours
571     MS_U8   u8TimeCodeMin;  ///<  time_code_minutes
572     MS_U8   u8TimeCodeSec;  ///<  time_code_seconds
573     MS_U8   u8TimeCodePic;  ///<  time_code_pictures
574 
575     MS_U8   u8DropFrmFlag;  ///<  drop_frame_flag
576     MS_U8   u8Reserved[3];  ///<  reserved fields for 4-byte alignment
577 } MVD_TimeCode;
578 
579 /// Format of CC (Closed Caption)
580 typedef enum _MVD_CCFormat
581 {
582     E_MVD_CC_NONE       = 0x00,
583     E_MVD_CC_608        = 0x01, //For CC608 or 157
584     E_MVD_CC_708        = 0x02, //For CC708
585     E_MVD_CC_UNPACKED   = 0x03,
586 } MVD_CCFormat;
587 
588 /// Type of CC
589 typedef enum _MVD_CCType
590 {
591     E_MVD_CC_TYPE_NONE = 0,
592     E_MVD_CC_TYPE_NTSC_FIELD1 = 1,
593     E_MVD_CC_TYPE_NTSC_FIELD2 = 2,
594     E_MVD_CC_TYPE_DTVCC = 3,
595     E_MVD_CC_TYPE_NTSC_TWOFIELD = 4,
596 } MVD_CCType;
597 
598 /// Data structure of CC Configuration
599 typedef struct
600 {
601     MVD_CCFormat eFormat;
602     MVD_CCType   eType;
603     MS_VIRT       u32BufStAdd;
604     MS_U32       u32BufSize;
605 } MVD_CCCfg;
606 
607 /// Info. of user data
608 typedef struct
609 {
610     MS_U32 u32Pts;
611     MS_U8  u8PicStruct;           /* picture_structure*/
612     MS_U8  u8PicType;             /* picture type: 1->I picture, 2->P,3->B */
613     MS_U8  u8TopFieldFirst;       /* Top field first: 1 if top field first*/
614     MS_U8  u8RptFirstField;       /* Repeat first field: 1 if repeat field first*/
615 
616     MS_U16 u16TmpRef;            /* Temporal reference of the picture*/
617     MS_U8  u8ByteCnt;
618     MS_U8  u8Reserve;
619 
620     MS_U32 u32DataBuf;
621 } MVD_UsrDataInfo;
622 
623 /// MVD interrupt events
624 typedef enum
625 {
626     E_MVD_EVENT_DISABLE_ALL    = 0,           ///< unregister all events notification
627     E_MVD_EVENT_USER_DATA      = BIT(0),      ///< found user data
628     E_MVD_EVENT_DISP_VSYNC     = BIT(1),      ///< vsync interrupt
629     E_MVD_EVENT_PIC_FOUND      = BIT(2),      ///<
630     E_MVD_EVENT_FIRST_FRAME    = BIT(3),      ///< first frame decoded
631     E_MVD_EVENT_DISP_RDY       = BIT(4),      ///< MVD ready to display.
632     E_MVD_EVENT_SEQ_FOUND      = BIT(5),      ///< found sequence header
633     //E_MVD_EVENT_DEC_CC_FOUND = BIT(6),      ///< MVD found one user data with decoded frame.
634     E_MVD_EVENT_DEC_DATA_ERR   = BIT(7),      ///< ES Data error.
635     E_MVD_EVENT_UNMUTE         = BIT(8),      ///< video unmute
636     E_MVD_EVENT_USER_DATA_DISP = BIT(9),      ///< found user data in display order
637     E_MVD_EVENT_DEC_ERR        = BIT(10),     ///< MVD HW found decode error.
638     E_MVD_EVENT_DEC_I          = BIT(11),     ///< MVD HW decode I frame.
639     E_MVD_EVENT_DEC_ONE_FRAME  = BIT(15),     ///< Decode one frame done
640     E_MVD_EVENT_XC_LOW_DEALY   = BIT(16),     ///< speed up the un-mute screen on XC.
641 } MVD_Event;
642 
643 /// MVD clock speed
644 typedef enum
645 {
646     E_MVD_EX_CLOCK_SPEED_NONE = 0,
647     E_MVD_EX_CLOCK_SPEED_HIGHEST,
648     E_MVD_EX_CLOCK_SPEED_HIGH,
649     E_MVD_EX_CLOCK_SPEED_MEDIUM,
650     E_MVD_EX_CLOCK_SPEED_LOW,
651     E_MVD_EX_CLOCK_SPEED_LOWEST,
652     E_MVD_EX_CLOCK_SPEED_DEFAULT,
653 } MVD_EX_ClockSpeed;
654 
655 //MVD CRC value
656 typedef struct
657 {
658     MS_U32 u32HSize;
659     MS_U32 u32VSize;
660     MS_U32 u32Strip;
661     MS_VIRT u32YStartAddr;
662     MS_VIRT u32UVStartAddr;
663 }MVD_CrcIn;
664 
665 typedef struct
666 {
667     MS_U32 u32YCrc;
668     MS_U32 u32UVCrc;
669 }MVD_CrcOut;
670 
671 typedef struct
672 {
673     MS_VIRT  u32DSBufAddr;       // Buffer Address
674     MS_U32  u32DSBufSize;       // Buffer Size
675 }MVD_EX_ExternalDSBuf;
676 
677 
678 typedef struct
679 {
680     MS_BOOL bHWBufferReMapping;
681 } MVD_Pre_Ctrl;
682 
683 
684 typedef void (*MVD_InterruptCb)(MS_U32 u32CbData);
685 
686 ////////////////////////////////////////////////////////////////////////////////
687 // Function Prototype Declaration
688 ////////////////////////////////////////////////////////////////////////////////
689 E_MVD_Result MDrv_MVD_SetCfg(MS_U32 u32Id, MVD_FWCfg* fwCfg, MVD_MEMCfg* memCfg);
690 MS_U32 MDrv_MVD_GetFWVer(MS_U32 u32Id);
691 void MDrv_MVD_SetDbgLevel(MS_U8 level);
692 const MVD_DrvInfo* MDrv_MVD_GetInfo(void);
693 E_MVD_Result MDrv_MVD_GetLibVer(const MSIF_Version **ppVersion);
694 
695 void MDrv_MVD_SetCodecInfo(MS_U32 u32Id, MVD_CodecType u8CodecType, MVD_SrcMode u8BSProviderMode, MS_U8 bDisablePESParsing);
696 void MDrv_MVD_SetDivXCfg(MS_U32 u32Id, MS_U8 u8MvAdjust, MS_U8 u8IdctSel);
697 
698 void MDrv_MVD_SetFrameBuffAddr(MS_U32 u32Id, MS_VIRT u32addr);
699 void MDrv_MVD_GetFrameInfo(MS_U32 u32Id, MVD_FrameInfo *pinfo );
700 void MDrv_MVD_SetOverflowTH(MS_U32 u32Id, MS_U32 u32Threshold);
701 void MDrv_MVD_SetUnderflowTH(MS_U32 u32Id, MS_U32 u32Threshold);
702 
703 void MDrv_MVD_RstIFrameDec(MS_U32 u32Id,MVD_CodecType eCodecType);
704 MS_BOOL MDrv_MVD_GetIsIFrameDecoding(MS_U32 u32Id);
705 
706 MS_U8 MDrv_MVD_GetSyncStatus(MS_U32 u32Id);
707 MS_BOOL MDrv_MVD_GetIsFreerun(MS_U32 u32Id);
708 MS_U8 MDrv_MVD_GetIsIPicFound(MS_U32 u32Id);
709 
710 MS_BOOL MDrv_MVD_DecodeIFrame(MS_U32 u32Id, MS_PHY u32FrameBufAddr, MS_PHY u32StreamBufAddr, MS_PHY u32StreamBufEndAddr );
711 MS_BOOL MDrv_MVD_GetValidStreamFlag(MS_U32 u32Id);
712 MS_U32 MDrv_MVD_GetChromaFormat(MS_U32 u32Id);
713 //for MM
714 void MDrv_MVD_SetFrameInfo(MS_U32 u32Id, MVD_FrameInfo *pinfo );
715 void MDrv_MVD_GetErrInfo(MS_U32 u32Id, MVD_ErrCode *errCode, MVD_ErrStatus *errStatus);
716 MS_U32 MDrv_MVD_GetSkipPicCounter(MS_U32 u32Id);
717 
718 void MDrv_MVD_SetSLQWritePtr(MS_U32 u32Id, MS_BOOL bCheckData);
719 MS_U32 MDrv_MVD_GetSLQReadPtr(MS_U32 u32Id);
720 
721 MVD_PicType MDrv_MVD_GetPicType(MS_U32 u32Id);
722 MS_U32 MDrv_MVD_GetBitsRate(MS_U32 u32Id);
723 MS_U8 MDrv_MVD_GetVideoRange(MS_U32 u32Id);
724 MS_BOOL MDrv_MVD_GetLowDelayFlag(MS_U32 u32Id);
725 MS_BOOL MDrv_MVD_GetIs32PullDown(MS_U32 u32Id);
726 MS_BOOL MDrv_MVD_GetIsDynScalingEnabled(MS_U32 u32Id);
727 MS_S32 MDrv_MVD_GetPtsStcDiff(MS_U32 u32Id);
728 
729 void MDrv_MVD_Pause(MS_U32 u32Id);
730 void MDrv_MVD_Resume(MS_U32 u32Id);
731 MS_BOOL MDrv_MVD_StepDisp(MS_U32 u32Id);
732 MS_BOOL MDrv_MVD_IsStepDispDone(MS_U32 u32Id);
733 MS_BOOL MDrv_MVD_StepDecode(MS_U32 u32Id);
734 MS_BOOL MDrv_MVD_IsStepDecodeDone(MS_U32 u32Id);
735 MS_BOOL MDrv_MVD_SeekToPTS(MS_U32 u32Id, MS_U32 u32Pts);
736 MS_BOOL MDrv_MVD_IsStep2PtsDone(MS_U32 u32Id);
737 MS_BOOL MDrv_MVD_SkipToPTS(MS_U32 u32Id, MS_U32 u32Pts);
738 MS_BOOL MDrv_MVD_TrickPlay(MS_U32 u32Id, MVD_TrickDec trickDec, MS_U8 u8DispDuration);
739 void MDrv_MVD_EnableForcePlay(MS_U32 u32Id);
740 
741 void MDrv_MVD_RegSetBase(MS_VIRT u32RegBaseAddr);
742 E_MVD_Result MDrv_MVD_GetFreeStream(MS_U32 *pu32Id, MVD_DRV_StreamType eStreamType);
743 MS_BOOL MDrv_MVD_Init(MS_U32 u32Id,MVD_CodecType eCodecType);
744 MS_BOOL MDrv_MVD_Exit(MS_U32 u32Id);
745 E_MVD_Result MDrv_MVD_Rst(MS_U32 u32Id,MVD_CodecType eCodecType);
746 
747 void MDrv_MVD_Play(MS_U32 u32Id);
748 void MDrv_MVD_SetAVSync(MS_U32 u32Id, MS_BOOL bEnable, MS_U32 u32Delay);
749 void MDrv_MVD_SetAVSyncThreshold(MS_U32 u32Id, MS_U32 u32Th);
750 void MDrv_MVD_SetAVSyncFreerunThreshold(MS_U32 u32Id, MS_U32 u32Th);
751 MS_U32 MDrv_MVD_GetAVSyncDelay(MS_U32 u32Id);
752 MS_BOOL MDrv_MVD_GetIsAVSyncOn(MS_U32 u32Id);
753 MS_BOOL MDrv_MVD_GetIsSyncRep(MS_U32 u32Id);
754 MS_BOOL MDrv_MVD_GetIsSyncSkip(MS_U32 u32Id);
755 MS_BOOL MDrv_MVD_ChangeAVsync(MS_U32 u32Id, MS_BOOL bEnable, MS_U16 u16PTS);
756 MS_BOOL MDrv_MVD_DispCtrl(MS_U32 u32Id, MS_BOOL bDecOrder, MS_BOOL bDropErr, MS_BOOL bDropDisp, MVD_FrcMode eFrcMode);
757 MS_BOOL MDrv_MVD_DispRepeatField(MS_U32 u32Id, MS_BOOL bEnable);
758 MS_U8 MDrv_MVD_GetColorFormat(MS_U32 u32Id);
759 MS_U8 MDrv_MVD_GetMatrixCoef(MS_U32 u32Id);
760 MS_U8 MDrv_MVD_GetActiveFormat(MS_U32 u32Id);
761 MS_U8 MDrv_MVD_GetDispRdy(MS_U32 u32Id);
762 MS_BOOL MDrv_MVD_Is1stFrmRdy(MS_U32 u32Id);
763 MS_U32 MDrv_MVD_GetGOPCount(MS_U32 u32Id);
764 MS_U32 MDrv_MVD_GetPicCounter(MS_U32 u32Id);
765 MS_U32 MDrv_MVD_GetParserByteCnt(MS_U32 u32Id);
766 MVD_DecStat MDrv_MVD_GetDecodeStatus(MS_U32 u32Id);
767 MS_U8 MDrv_MVD_GetLastCmd(MS_U32 u32Id);
768 MS_U32 MDrv_MVD_GetVldErrCount(MS_U32 u32Id);
769 MS_BOOL MDrv_MVD_DropErrorFrame(MS_U32 u32Id, MS_BOOL bDrop);
770 MS_BOOL MDrv_MVD_MVDCommand ( MS_U8 u8cmd, MVD_CmdArg *pstCmdArg );
771 MS_BOOL MDrv_MVD_SkipData(MS_U32 u32Id);
772 MS_BOOL MDrv_MVD_SkipToIFrame(MS_U32 u32Id);
773 MS_BOOL MDrv_MVD_GetCaps(MVD_Caps* pCaps);
774 MS_BOOL MDrv_MVD_GetFrmRateIsSupported(MS_U32 u32Id);
775 
776 E_MVD_Result MDrv_MVD_DisableErrConceal(MS_U32 u32Id, MS_BOOL bDisable);
777 E_MVD_Result MDrv_MVD_PushQueue(MS_U32 u32Id, MVD_PacketInfo* pInfo);
778 E_MVD_Result MDrv_MVD_FlushQueue(MS_U32 u32Id);
779 MS_BOOL MDrv_MVD_FlushDisplayBuf(MS_U32 u32Id);
780 MS_U32 MDrv_MVD_GetQueueVacancy(MS_U32 u32Id, MS_BOOL bCached);
781 MS_U32 MDrv_MVD_GetESReadPtr(MS_U32 u32Id);
782 MS_U32 MDrv_MVD_GetESWritePtr(MS_U32 u32Id);
783 E_MVD_Result MDrv_MVD_EnableLastFrameShow(MS_U32 u32Id, MS_BOOL bEnable);
784 E_MVD_Result MDrv_MVD_IsDispFinish(MS_U32 u32Id);
785 E_MVD_Result MDrv_MVD_SetSpeed(MS_U32 u32Id, MVD_SpeedType eSpeedType, MS_U8 u8Multiple);
786 E_MVD_Result MDrv_MVD_ResetPTS(MS_U32 u32Id, MS_U32 u32PtsBase);
787 MS_U32 MDrv_MVD_GetPTS(MS_U32 u32Id);
788 MS_U64 MDrv_MVD_GetU64PTS(MS_U32 u32Id);
789 MS_U32 MDrv_MVD_GetNextPTS(MS_U32 u32Id);
790 MVD_TrickDec MDrv_MVD_GetTrickMode(MS_U32 u32Id);
791 MS_BOOL MDrv_MVD_IsPlaying(MS_U32 u32Id);
792 MS_BOOL MDrv_MVD_IsIdle(MS_U32 u32Id);
793 MS_BOOL MDrv_MVD_IsSeqChg(MS_U32 u32Id);
794 E_MVD_Result MDrv_MVD_DbgSetData(MS_U32 u32Id, MS_VIRT u32Addr, MS_U32 u32Data);
795 E_MVD_Result MDrv_MVD_DbgGetData(MS_U32 u32Id, MS_VIRT u32Addr, MS_U32* u32Data);
796 MS_U8 MDrv_MVD_GetDecodedFrameIdx (MS_U32 u32Id);
797 MS_BOOL MDrv_MVD_SetFileModeAVSync(MS_U32 u32Id, MVD_TIMESTAMP_TYPE eSyncMode);
798 MS_BOOL MDrv_MVD_IsAllBufferEmpty(MS_U32 u32Id);
799 MS_BOOL MDrv_MVD_GenPattern(MS_U32 u32Id, MVD_PatternType ePattern, MS_PHY u32PAddr, MS_U32* pu32Size);
800 MS_U32 MDrv_MVD_GetPatternInfo(void);
801 E_MVD_Result MDrv_MVD_SetDynScalingParam(MS_U32 u32Id, MS_PHY u32StAddr, MS_VIRT u32Size);
802 MS_BOOL MDrv_MVD_SetVirtualBox(MS_U32 u32Id, MS_U16 u16Width, MS_U16 u16Height);
803 MS_BOOL MDrv_MVD_SetBlueScreen(MS_U32 u32Id, MS_BOOL bEn);
804 MS_BOOL MDrv_MVD_EnableInt(MS_U32 u32Id, MS_U32 bEn);
805 E_MVD_Result MDrv_MVD_EnableDispOneField(MS_U32 u32Id, MS_BOOL bEn);
806 E_MVD_Result MDrv_MVD_GetExtDispInfo(MS_U32 u32Id, MVD_ExtDispInfo* pInfo);
807 E_MVD_Result MDrv_MVD_GetFrmInfo(MS_U32 u32Id, MVD_FrmInfoType eType, MVD_FrmInfo* pInfo);
808 E_MVD_Result MDrv_MVD_GetTimeCode(MS_U32 u32Id, MVD_FrmInfoType eType, MVD_TimeCode* pInfo);
809 MS_BOOL MDrv_MVD_GetUsrDataIsAvailable(MS_U32 u32Id);
810 MS_BOOL MDrv_MVD_GetUsrDataInfo(MS_U32 u32Id, MVD_UsrDataInfo* pUsrInfo);
811 E_MVD_Result MDrv_MVD_SetFreezeDisp(MS_U32 u32Id, MS_BOOL bEn);
812 MS_U32 MDrv_MVD_GetDispCount(MS_U32 u32Id);
813 E_MVD_Result MDrv_MVD_GetXcLowDelayIntState(MS_U32 u32Id);
814 E_MVD_Result MDrv_MVD_SetFdMaskDelayCount(MS_U32 u32Id, MS_U16 u16Cnt);
815 E_MVD_Result MDrv_MVD_SetOutputFRCMode(MS_U32 u32Id, MS_U8 u8FrameRate, MS_U8 u8Interlace);
816 E_MVD_Result MDrv_MVD_SetFRCDropType(MS_U32 u32Id, MS_U8 u8DropType);
817 E_MVD_Result MDrv_MVD_SetDisableSeqChange(MS_U32 u32Id, MS_BOOL bEnable);
818 
819 MS_BOOL MDrv_MVD_SetMStreamerMode(MS_U32 u32Id, MS_U8 u8Mode);
820 MS_BOOL MDrv_MVD_SetMcuMode(MS_U32 u32Id, MS_U8 u8Mode);
821 MS_BOOL MDrv_MVD_FrameFlip(MS_U32 u32Id, MS_U8 u8FrmIdx);
822 MS_BOOL MDrv_MVD_FrameRelease(MS_U32 u32Id, MS_U8 u8FrmIdx);
823 MS_BOOL MDrv_MVD_FrameCapture(MS_U32 u32Id, MS_U8 u8FrmIdx, MS_BOOL bEnable);
824 MS_BOOL MDrv_MVD_ReleaseFdMask(MS_U32 u32Id, MS_BOOL bRls);
825 MS_BOOL MDrv_MVD_ParserRstDone(MS_U32 u32Id, MS_BOOL bEnable);
826 MS_BOOL MDrv_MVD_SetVSizeAlign(MS_U32 u32Id, MS_BOOL bEnable);
827 E_MVD_Result MDrv_MVD_SetAutoMute(MS_U32 u32Id, MS_BOOL bEnable);
828 
829 MS_BOOL MDrv_MVD_SetSkipRepeatMode(MS_U32 u32Id, MS_U8 u8Mode);
830 MS_BOOL MDrv_MVD_SetSingleDecodeMode(MS_BOOL bEnable);
831 MS_BOOL MDrv_MVD_FlushPTSBuf(MS_U32 u32Id,MS_BOOL bEnable);
832 MS_BOOL MDrv_MVD_ShowDecodeOrder(MS_U32 u32Id, MS_U8 u8Mode);
833 E_MVD_Result MDrv_MVD_GetCrcValue(MS_U32 u32Id, MVD_CrcIn *pCrcIn, MVD_CrcOut *pCrcOut);
834 E_MVD_Result MDrv_MVD_SetDbgMode(MS_U32 u32Id, MVD_DbgMode enDbgMode, MS_BOOL bEn);
835 MS_BOOL MDrv_MVD_SuspendDynamicScale(MS_U32 u32Id, MS_BOOL bEnable);
836 MS_U8 MDrv_MVD_GetSuspendDynamicScale(MS_U32 u32Id);
837 void MDrv_MVD_DbgDump(MS_U32 u32Id);
838 MS_U32 MDrv_MVD_GetDivxVer(MS_U32 u32Id);
839 MS_BOOL MDrv_MVD_SetIdctMode(MS_U32 u32Id, MS_U8 u8Mode);
840 E_MVD_Result MDrv_MVD_Init_Share_Mem(void);
841 MS_BOOL MDrv_MVD_PreSetCodecType(MS_U32 u32Id,MVD_CodecType eMvdCodecType ,MS_BOOL *bHDMode);
842 E_MVD_Result MDrv_MVD_SetXCLowDelayPara(MS_U32 u32Id,MS_U32 u32Para);
843 void MDrv_MVD_Drop_One_PTS(MS_U32 u32Id);
844 
845 #define MVD_ENABLE_ISR
846 
847 #ifdef MVD_ENABLE_ISR
848 E_MVD_Result MDrv_MVD_SetIsrEvent(MS_U32 u32Id, MS_U32 eEvent, MVD_InterruptCb fnHandler);
849 MS_U32 MDrv_MVD_GetIsrEvent(MS_U32 u32Id);
850 #else
851 #define MDrv_MVD_SetIsrEvent(x, y, z) (E_MVD_RET_OK)
852 #define MDrv_MVD_GetIsrEvent(x)     (MS_U32)0
853 #endif
854 MS_U32 MDrv_MVD_GetSLQNum(MS_U32 u32Id);
855 MS_U32 MDrv_MVD_GetDispQNum(MS_U32 u32Id);
856 
857 E_MVD_Result MDrv_MVD_EX_SetMVDClockSpeed(MVD_EX_ClockSpeed eClockSpeed);
858 MS_BOOL MDrv_MVD_ShowFirstFrameDirect(MS_U32 u32Id,MS_BOOL bEnable);
859 E_MVD_Result MDrv_MVD_SetSelfSeqChange(MS_U32 u32Id, MS_BOOL bEnable);
860 MS_U8 MDrv_MVD_GetESBufferStatus(MS_U32 u32Id);
861 E_MVD_Result MDrv_MVD_SetExternalDSBuffer(MS_U32 u32Id, MVD_EX_ExternalDSBuf *pExternalBuf);
862 MS_BOOL MDrv_MVD_Field_Polarity_Display_One_field(MS_U32 u32Id, MS_BOOL bEnable,MS_U8 top_bottom);
863 
864 MS_BOOL MDrv_MVD_SetShareMemoryBase(MS_U32 u32Id, MS_U32 u32base);
865 MS_U32 MDrv_MVD_GetShareMemoryOffset(MS_U32 u32Id, MS_U32 *u32base);
866 MS_BOOL MDrv_MVD_EnableVPUSecurityMode(MS_BOOL enable);
867 MS_BOOL MDrv_MVD_GetSupport2ndMVOPInterface(void);
868 MS_BOOL MDrv_MVD_REE_RegisterMBX(void);
869 MS_BOOL MDrv_MVD_REE_SetSHMBaseAddr(void);
870 MS_U32 MDrv_MVD_GetVsyncBridgeAddr(MS_U32 u32Id);
871 
872 
873 MS_BOOL MDrv_MVD_SetExternal_CC608_Buffer(MS_U32 u32Id, MS_U32 u32base,MS_U8 u8size);
874 MS_BOOL MDrv_MVD_SetExternal_CC708_Buffer(MS_U32 u32Id, MS_U32 u32base,MS_U8 u8size);
875 MS_BOOL MDrv_MVD_SetPrebufferSize(MS_U32 u32Id, MS_U32 size);
876 E_MVD_Result MDrv_MVD_HWBuffer_ReMappingMode(MS_U32 u32Id,MS_BOOL bEnable);
877 void MDrv_MVD_REE_GetSHMInformation(MS_VIRT* u32SHMAddr,MS_U32* u32VsyncSHMOffset);
878 E_MVD_Result MDrv_MVD_SetTimeIncPredictParam(MS_U32 u32Id,MS_U32 u32Para);
879 MS_BOOL MDrv_MVD_SetDcodeTimeoutParam(MS_U32 u32Id,MS_BOOL enable,MS_U32 u32timeout);
880 MS_BOOL MDrv_MVD_SetFramebufferAutoMode(MS_U32 u32Id,MS_BOOL bEnable);
881 E_MVD_Result MDrv_MVD_Set_Smooth_Rewind(MS_U32 u32Id, MS_U8 bEnable);
882 E_MVD_Result MDrv_MVD_IsAlive(MS_U32 u32Id);
883 E_MVD_Result MDrv_MVD_Set_Err_Tolerance(MS_U32 u32Id, MS_U16 u16Para);
884 void MDrv_MVD_EnableAutoInsertDummyPattern(MS_U32 u32Id, MS_BOOL bEnable);
885 E_MVD_Result MDrv_MVD_PVR_Seamless_mode(MS_U32 u32Id, MS_U8 u8Arg);
886 E_MVD_Result MDrv_MVD_SetDispFinishMode(MS_U32 u32Id,MS_U8 u8Mode);
887 
888 
889 #endif
890 
891 #ifdef __cplusplus
892 }
893 #endif
894 
895 #endif
896