xref: /utopia/UTPA2-700.0.x/modules/vdec_v2/drv/hvd_ex/drvHVD_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   drvHVD.h
98 /// @brief  HVD Driver Interface
99 /// @author MStar Semiconductor Inc.
100 ///////////////////////////////////////////////////////////////////////////////////////////////////
101 
102 #ifndef _DRV_HVD_H_
103 #define _DRV_HVD_H_
104 
105 #ifdef __cplusplus
106 extern "C"
107 {
108 #endif
109 
110 #if !defined(MSOS_TYPE_NUTTX) || defined(SUPPORT_X_MODEL_FEATURE)
111 
112 //-------------------------------------------------------------------------------------------------
113 //  Driver Capability
114 //-------------------------------------------------------------------------------------------------
115 //-------------------------------------------------------------------------------------------------
116 //  Macro and Define
117 //-------------------------------------------------------------------------------------------------
118 #define MSIF_HVD_LIB_CODE                     {'H','V','D','_'}    //Lib code
119 #define MSIF_HVD_LIBVER                       {'0','C'}            //LIB version     0.0 ~ Z.Z
120 #define MSIF_HVD_BUILDNUM                     {'0','2'}            //Build Number    00 ~ 99
121 #define MSIF_HVD_CHANGELIST                   {'0','0','6','4','4','6','7','9'} //P4 ChangeList Number
122 
123 //------------------------------------------------------------------------------
124 /// @brief \b HVD_DRV_VERSION : HVD Version
125 //------------------------------------------------------------------------------
126 #define HVD_DRV_VERSION                 /* Character String for DRV/API version             */  \
127     MSIF_TAG,                           /* 'MSIF'                                           */  \
128     MSIF_CLASS,                         /* '00'                                             */  \
129     MSIF_CUS,                           /* 0x0000                                           */  \
130     MSIF_MOD,                           /* 0x0000                                           */  \
131     MSIF_CHIP,                                                                                  \
132     MSIF_CPU,                                                                                   \
133     MSIF_HVD_LIB_CODE,                  /* IP__                                             */  \
134     MSIF_HVD_LIBVER,                    /* 0.0 ~ Z.Z                                        */  \
135     MSIF_HVD_BUILDNUM,                  /* 00 ~ 99                                          */  \
136     MSIF_HVD_CHANGELIST,                /* CL#                                              */  \
137     MSIF_OS
138 
139 #define HVD_INIT_HW_MASK                            BMASK(3:0)         ///< HW Type
140     #define HVD_INIT_HW_AVC                             BITS(3:0, 0)   ///< HW deflaut: AVC 0X00
141     #define HVD_INIT_HW_AVS                             BITS(3:0, 1)   ///< HW : AVS 0X01
142     #define HVD_INIT_HW_RM                              BITS(3:0, 2)   ///< HW: RM 0X10
143     #define HVD_INIT_HW_MVC                             BITS(3:0, 3)   ///< HW: RM 0X11
144     #define HVD_INIT_HW_VP8                             BITS(3:0, 4)   ///< HW: VP8 0X100
145     #define HVD_INIT_HW_MJPEG                           BITS(3:0, 5)   ///< HW: MJPEG 0x101
146     #define HVD_INIT_HW_VP6                             BITS(3:0, 6)   ///< HW: VP6 0x110
147     #define HVD_INIT_HW_HEVC                            BITS(3:0, 7)   ///< HW: HEVC 0x111
148     #define HVD_INIT_HW_VP9                             BITS(3:0, 8)   ///< HW: VP9 0x1000
149 #define HVD_INIT_MAIN_MASK                          BMASK(5:4)         ///< main type
150     #define HVD_INIT_MAIN_FILE_RAW                      BITS(5:4, 0)   ///< main type: default: 0X00
151     #define HVD_INIT_MAIN_FILE_TS                       BITS(5:4, 1)   ///< main type: 0X01
152     #define HVD_INIT_MAIN_LIVE_STREAM                   BITS(5:4, 2)   ///< main type: 0X10
153 #define HVD_INIT_INPUT_MASK                         BMASK(6:6)         ///< process path for filling BBU table:  file mode. use drive; TSP: use tsp mode
154     #define HVD_INIT_INPUT_TSP                          BITS(6:6, 0)   ///< tsp input( default)
155     #define HVD_INIT_INPUT_DRV                          BITS(6:6, 1)   ///< driver input
156 #define HVD_INIT_START_CODE_MASK                    BMASK(7:7)         ///< AVC FILE MODE ONLY: mkv, mp4 container use.
157     #define HVD_INIT_START_CODE_REMAINED                BITS(7:7, 0)   ///< start code remained.(Defualt)
158     #define HVD_INIT_START_CODE_REMOVED                 BITS(7:7, 1)   ///< start code removed.
159 #define HVD_INIT_UTOPIA_ENVI                            BIT(8)         ///< check MIU sel and set it
160 #define HVD_INIT_DBG_FW                                 BIT(9)         ///< check FW is debug version or not
161 #define HVD_INIT_DUAL_ES_MASK                     BMASK(10:10)         ///< Dual ES buffer iput.
162     #define HVD_INIT_DUAL_ES_DISABLE                  BITS(10:10, 0)   ///< Disable Dual ES buffer input.
163     #define HVD_INIT_DUAL_ES_ENABLE                   BITS(10:10, 1)   ///< Enable Dual ES buffer input.
164 
165 //#define HVD_INIT_ENABLE_ISR_DISP            BIT( 8)        ///< enable display ISR. ISR occurs at every Vsync.
166 
167 #define HVD_RV_BROKEN_BY_US_MASK        0x80000000
168 
169 #define HVD_BBU_TAG_LIMITATION          0x200000
170 #define QUANTITY_AFTER_BROKEN_BY_US     4
171 #define QUANTITY_LENGTH                  0x1FFF00
172 #define MAX_QUANTITY                     (QUANTITY_LENGTH * QUANTITY_AFTER_BROKEN_BY_US)
173 #define MIN_BBU_VACANCY_PER_PUSH        2
174 #define MIN_BBU_VACANCY_FOR_4K2K         (MIN_BBU_VACANCY_PER_PUSH * QUANTITY_AFTER_BROKEN_BY_US)          // about 6MB
175 
176 #define HVD_MAX_DEC_NUM 2
177 
178 
179 
180 #define HVD_CCRB_PACKET_LENGTH      8
181 
182 #define T35_DVB_COUNTRY_CODE  0xB5
183 #define T35_DVB_PROVIDER_CODE 0x0031
184 
185 #define DTV_AFD_CODE   0x44544731
186 #define DTV_DTB1_CODE  0x47413934
187 
188 #define DTV_BAR_CODE 0x06
189 #define DTV_CC_CODE 0x03
190 #define DTV_DIRECTTV_CODE 0x2F
191 
192 #define MAX_NTSC_CC_ELE  4
193 #define MAX_NTSC_CC_BYTE (MAX_NTSC_CC_ELE << 2)
194 #define MAX_DTV_CC_BYTE  128
195 
196 #define CC_NTSC1    1
197 #define CC_NTSC2    2
198 #define CC_ATSC        4
199 #define CC_157      (CC_NTSC1|CC_NTSC2)
200 
201 #define USER_DATA_MODE_DVB_NORMAL                 0x00
202 #define USER_DATA_MODE_DIRECTTV_CC                0x01
203 #define USER_DATA_MODE_FRM_PACKING_ARRANGEMENT    0x02
204 #define USER_DATA_MODE_ATSC_CC_RAW                0x04
205 #define USER_DATA_MODE_EXTERNAL_CC_BUFFER         0x10
206 
207 #define MAX_608_CC_LEN 512
208 #define MAX_708_CC_LEN 512
209 
210 //-------------------------------------------------------------------------------------------------
211 //  Type and Structure
212 //-------------------------------------------------------------------------------------------------
213 typedef void (*HVD_InterruptCb)(void);
214 
215 
216 //-----------------------------------------------------------------------------
217 /// @brief \b Enum \b Name: EN_CC_HVD_INFO
218 /// @brief \b Enum \b Description:  The type of Close Caption Selector
219 typedef enum
220 {
221     HVD_EX_CC_SELECTOR_708_SW              = 0x0000,
222     HVD_EX_CC_SELECTOR_RINGBUFFER    = 0x0001
223 
224 } EN_CC_HVD_EX_INFO;
225 
226 //-----------------------------------------------------------------------------
227 /// @brief \b Enum \b Name: HVD_EX_Result
228 /// @brief \b Enum \b Description:  General result of HVD functions
229 //-----------------------------------------------------------------------------
230 typedef enum
231 {
232     E_HVD_EX_FAIL,                  ///< General fail cases.
233     E_HVD_EX_OK,                    ///< Action success.
234     E_HVD_EX_RET_INVALID_PARAMETER, ///< Function has invalid input.
235     E_HVD_EX_RET_ILLEGAL_ACCESS,    ///< Illegal access. like driver not initialized.
236     E_HVD_EX_RET_HARDWARE_BREAKDOWN,///< HW has no responses or impossible responses.
237     E_HVD_EX_RET_OUTOF_MEMORY,      ///< The input memory config is not enough.
238     E_HVD_EX_RET_UNSUPPORTED,       ///< Function is not supported by HVD driver.
239     E_HVD_EX_RET_TIMEOUT,           ///< Action timeout.
240     E_HVD_EX_RET_NOTREADY,          ///< Action not ready. User needs to call it again later.
241     E_HVD_EX_RET_MEMORY_OVERWIRTE,  ///< The input memory config may be overwrite.
242     E_HVD_EX_RET_QUEUE_FULL,        ///< HVD BBU queue or ES buffer is full.
243     E_HVD_EX_RET_RE_INIT,
244     E_HVD_EX_RET_NOT_RUNNING,
245 } HVD_EX_Result;
246 
247 //-----------------------------------------------------------------------------
248 /// @brief \b Enum \b Name: HVD_EX_GetPlayState
249 /// @brief \b Enum \b Description:  The current HVD play state.
250 //-----------------------------------------------------------------------------
251 typedef enum
252 {
253     E_HVD_EX_GSTATE_INIT,   ///< Before or during initialization.
254     E_HVD_EX_GSTATE_PLAY,   ///< playback.
255     E_HVD_EX_GSTATE_PAUSE,  ///< decode and display are all paused.
256     E_HVD_EX_GSTATE_STOP,   ///< after stop.
257 } HVD_EX_GetPlayState;
258 
259 //-----------------------------------------------------------------------------
260 /// @brief \b Enum \b Name: HVD_EX_SyncType
261 /// @brief \b Enum \b Description:  The current mode type of HVD synchronization .
262 //-----------------------------------------------------------------------------
263 typedef enum
264 {
265     E_HVD_EX_SYNC_ATS,  ///< Live stream, or TS file mode.
266     E_HVD_EX_SYNC_PTS,  ///< only for file mode, input time stamp is PTS.
267     E_HVD_EX_SYNC_DTS,  ///< only for file mode, input time stamp is DTS.
268     E_HVD_EX_SYNC_STS,  ///< only for file mode, input time stamp is random, output should be sorted.
269 } HVD_EX_SyncType;
270 
271 //-----------------------------------------------------------------------------
272 /// @brief \b Enum \b Name: HVD_EX_DispSpeed
273 /// @brief \b Enum \b Description:  The current mode type of HVD display speed
274 //-----------------------------------------------------------------------------
275 typedef enum
276 {
277     E_HVD_EX_DISP_SPEED_FF_32X     = 32,    ///< Speed fast forward 32x.
278     E_HVD_EX_DISP_SPEED_FF_16X     = 16,    ///< Speed fast forward 16x.
279     E_HVD_EX_DISP_SPEED_FF_8X      = 8,     ///< Speed fast forward 8x.
280     E_HVD_EX_DISP_SPEED_FF_4X      = 4,     ///< Speed fast forward 4x.
281     E_HVD_EX_DISP_SPEED_FF_2X      = 2,     ///< Speed fast forward 2x.
282     E_HVD_EX_DISP_SPEED_NORMAL_1X  = 1,     ///< Normal display speed.
283     E_HVD_EX_DISP_SPEED_SF_2X      = -2,    ///< Slow forward 2X.
284     E_HVD_EX_DISP_SPEED_SF_4X      = -4,    ///< Slow forward 4X.
285     E_HVD_EX_DISP_SPEED_SF_8X      = -8,    ///< Slow forward 8X.
286     E_HVD_EX_DISP_SPEED_SF_16X     = -16,   ///< Slow forward 16X.
287     E_HVD_EX_DISP_SPEED_SF_32X     = -32,   ///< Slow forward 32X.
288 } HVD_EX_DispSpeed;
289 
290 //-----------------------------------------------------------------------------
291 /// @brief \b Enum \b Name: HVD_EX_DropDisp
292 /// @brief \b Enum \b Description:  The current mode type of HVD dropping decoded frames.
293 //-----------------------------------------------------------------------------
294 typedef enum
295 {
296     E_HVD_EX_DROP_DISPLAY_AUTO = (1 << 0),       ///< automatic drop mode, drop frame if display queue is more than threshold
297     E_HVD_EX_DROP_DISPLAY_ONCE = (1 << 1),       ///< drop once, drop the number of non-ref frames
298 } HVD_EX_DropDisp;
299 
300 //-----------------------------------------------------------------------------
301 /// @brief \b Enum \b Name: HVD_EX_FrmRateConvMode
302 /// @brief \b Enum \b Description:  The current mode type of HVD frame rate convertion.
303 //-----------------------------------------------------------------------------
304 typedef enum
305 {
306     E_HVD_EX_FRC_MODE_NORMAL,       ///< Disable FRC mode.
307     E_HVD_EX_FRC_MODE_32PULLDOWN,   ///< 3:2 pulldown mode (ex. 24p a 60i or 60p)
308     E_HVD_EX_FRC_MODE_PAL2NTSC ,    ///< PALaNTSC conversion (50i a 60i)
309     E_HVD_EX_FRC_MODE_NTSC2PAL,     ///< NTSCaPAL conversion (60i a 50i)
310     E_HVD_EX_FRC_MODE_DISP_2X,      ///< output rate is twice of input rate (ex. 30p a 60p)
311     E_HVD_EX_FRC_MODE_24_TO_50,     ///< output rate 24P->50P 48I->50I
312     E_HVD_EX_FRC_MODE_50P_60P,      ///< output rate 50P ->60P
313     E_HVD_EX_FRC_MODE_60P_50P,      ///< output rate 60P ->50P
314 } HVD_EX_FrmRateConvMode;
315 
316 //-----------------------------------------------------------------------------
317 /// @brief \b Enum \b Name: HVD_EX_Codec
318 /// @brief \b Enum \b Description:  The supported codec type.
319 //-----------------------------------------------------------------------------
320 typedef enum
321 {
322     E_HVD_EX_AVC,
323     E_HVD_EX_AVS,
324     E_HVD_EX_RM,
325     E_HVD_EX_MVC,
326     E_HVD_EX_VP8,
327     E_HVD_EX_MJPEG,
328     E_HVD_EX_VP6,
329     E_HVD_EX_HEVC,
330     E_HVD_EX_VP9,
331     E_HVD_EX_NONE,
332 } HVD_EX_Codec;
333 
334 //-----------------------------------------------------------------------------
335 /// @brief \b Enum \b Name: HVD_EX_GetModeStatus
336 /// @brief \b Enum \b Description:  The available mode information supported by HVD.
337 //-----------------------------------------------------------------------------
338 typedef enum
339 {
340     E_HVD_EX_GMODE_IS_SHOW_ERR_FRM,
341     E_HVD_EX_GMODE_IS_REPEAT_LAST_FIELD,
342     E_HVD_EX_GMODE_IS_ERR_CONCEAL,
343     E_HVD_EX_GMODE_IS_SYNC_ON,
344     E_HVD_EX_GMODE_IS_PLAYBACK_FINISH,
345     E_HVD_EX_GMODE_SYNC_MODE,
346     E_HVD_EX_GMODE_SKIP_MODE,
347     E_HVD_EX_GMODE_DROP_MODE,
348     E_HVD_EX_GMODE_DISPLAY_SPEED,
349     E_HVD_EX_GMODE_FRC_MODE,
350     E_HVD_EX_GMODE_ISR_TYPE,
351     E_HVD_EX_GMODE_IS_STEP_DISPLAY = 0x0100,
352     E_HVD_EX_GMODE_STREAM_TYPE,
353 } HVD_EX_GetModeStatus;
354 
355 //-----------------------------------------------------------------------------
356 /// @brief \b Enum \b Name: HVD_EX_SkipDecode
357 /// @brief \b Enum \b Description:  The HVD decoding frame types.
358 //-----------------------------------------------------------------------------
359 typedef enum
360 {
361     E_HVD_EX_SKIP_DECODE_ALL,  ///< decode all frames
362     E_HVD_EX_SKIP_DECODE_I,    ///< decode I frames only
363     E_HVD_EX_SKIP_DECODE_IP,   ///< decode I and referenced frames only( skip non-ref frames)
364 } HVD_EX_SkipDecode;
365 
366 //-----------------------------------------------------------------------------
367 /// @brief \b Enum \b Name: HVD_EX_FrmType
368 /// @brief \b Enum \b Description:  The frame type.
369 //-----------------------------------------------------------------------------
370 typedef enum
371 {
372     E_HVD_EX_FRM_TYPE_I,        ///< I frame.
373     E_HVD_EX_FRM_TYPE_P,        ///< P frame.
374     E_HVD_EX_FRM_TYPE_B,        ///< B frame.
375     E_HVD_EX_FRM_TYPE_OTHER,    ///reservase
376 } HVD_EX_FrmType;
377 
378 //-----------------------------------------------------------------------------
379 /// @brief \b Enum \b Name: HVD_EX_FieldType
380 /// @brief \b Enum \b Description:  The Field type.
381 //-----------------------------------------------------------------------------
382 typedef enum
383 {
384     E_HVD_EX_FIELDTYPE_NONE,    ///< no field.
385     E_HVD_EX_FIELDTYPE_TOP,     ///< Top field only.
386     E_HVD_EX_FIELDTYPE_BOTTOM,  ///< Bottom field only.
387     E_HVD_EX_FIELDTYPE_BOTH,    ///< Both fields.
388 } HVD_EX_FieldType;
389 
390 //-----------------------------------------------------------------------------
391 /// @brief \b Enum \b Name: HVD_EX_UartLevel
392 /// @brief \b Enum \b Description:  The debug level of HVD.
393 //-----------------------------------------------------------------------------
394 typedef enum
395 {
396     E_HVD_EX_UART_LEVEL_NONE = 0,   ///< Disable all uart message.
397     E_HVD_EX_UART_LEVEL_ERR,        ///< Only output error message
398     E_HVD_EX_UART_LEVEL_INFO,       ///< output general message, and above.
399     E_HVD_EX_UART_LEVEL_DBG,        ///< output debug message, and above.
400     E_HVD_EX_UART_LEVEL_TRACE,      ///< output function trace message, and above.
401     E_HVD_EX_UART_LEVEL_FW,         ///< output FW message, and above.
402 } HVD_EX_UartLevel;
403 
404 //-----------------------------------------------------------------------------
405 /// @brief \b Enum \b Name: HVD_EX_PatternInfo
406 /// @brief \b Enum \b Description:  The information type of specific pattern.
407 //-----------------------------------------------------------------------------
408 typedef enum
409 {
410     E_HVD_EX_FLUSH_PATTERN_SIZE,    ///< flush pattern size.
411     E_HVD_EX_DUMMY_HW_FIFO,         ///< HW fifo size.
412 } HVD_EX_PatternInfo;
413 
414 //-----------------------------------------------------------------------------
415 /// @brief \b Enum \b Name: HVD_EX_DynamicScalingInfo
416 /// @brief \b Enum \b Description:  The information type of specific dynamic information.
417 //-----------------------------------------------------------------------------
418 typedef enum
419 {
420     E_HVD_EX_DS_BUF_MIUSEL,       ///< the HW MIU selection of the buffer of dynamic scaling. TRUE: MIU 1. FALSE: MIU 0.
421     E_HVD_EX_DS_BUF_ADDR,         ///< the start physical address of the buffer of dynamic scaling.
422     E_HVD_EX_DS_BUF_SIZE,         ///< the size of the buffer of dynamic scaling.
423     E_HVD_EX_DS_VECTOR_DEPTH,     ///< the required vector depth of the dynamic scaling.
424     E_HVD_EX_DS_INFO_ADDR,        ///< the scaler info buffer address of dynamic scaling.
425     E_HVD_EX_DS_IS_ENABLED,       ///< if dynamic scaling is enabled.
426 } HVD_EX_DynamicScalingInfo;
427 
428 typedef enum
429 {
430     E_HVD_EX_FLUSH_NONE = 0,
431     E_HVD_EX_FLUSH_RUNNING,     //HK -> FW
432     E_HVD_EX_FLUSH_DONE         //FW -> HK
433 
434 }HVD_EX_FlushStatus;
435 
436 
437 //-----------------------------------------------------------------------------
438 /// @brief \b Enum \b Name: HVD_EX_IsrEvent
439 /// @brief \b Enum \b Description:  The information type of ISR event.
440 //-----------------------------------------------------------------------------
441 typedef enum
442 {
443     E_HVD_EX_ISR_NONE = 0,                        ///< disable ISR
444     E_HVD_EX_ISR_DISP_ONE = BIT(0),               ///< HVD display one frame on screen.
445     E_HVD_EX_ISR_DISP_REPEAT = BIT(1),            ///< The current displayed frame is repeated frame.
446     E_HVD_EX_ISR_DISP_WITH_CC = BIT(2),           ///< Current displayed frame should be displayed with user data.
447     E_HVD_EX_ISR_DISP_FIRST_FRM = BIT(3),         ///< HVD display first frame on screen.
448 
449     E_HVD_EX_ISR_DEC_ONE = BIT(8),                ///< HVD decoded one frame done.
450     E_HVD_EX_ISR_DEC_I = BIT(9),                  ///< HVD decoded one I frame done.
451     E_HVD_EX_ISR_DEC_HW_ERR = BIT(10),            ///< HVD HW found decode error.
452     E_HVD_EX_ISR_DEC_CC_FOUND = BIT(11),          ///< HVD found one user data with decoded frame.
453     E_HVD_EX_ISR_DEC_DISP_INFO_CHANGE = BIT(12),  ///< HVD found display information change.
454     E_HVD_EX_ISR_DEC_DATA_ERR = BIT(13),          ///< HVD HW found decode error.
455     E_HVD_EX_ISR_DEC_FIRST_FRM = BIT(14),         ///< HVD decode first frame.
456     E_HVD_EX_ISR_DEC_SEQ_HDR_FOUND = BIT(15),         ///< HVD decode first frame.
457 } HVD_EX_IsrEvent;
458 
459 //-----------------------------------------------------------------------------
460 /// @brief \b Enum \b Name: HVD_EX_GetFrmInfoType
461 /// @brief \b Enum \b Description:  The information type of get frame information.
462 //-----------------------------------------------------------------------------
463 typedef enum
464 {
465     E_HVD_EX_GFRMINFO_DISPLAY = 0,  ///< Displayed frame.
466     E_HVD_EX_GFRMINFO_DECODE,       ///< Decoded frame.
467     E_HVD_EX_GFRMINFO_NEXT_DISPLAY, ///< Next frame to be displayed.
468     E_HVD_EX_GFRMINFO_DISPLAY_SUB,  ///< Displayed sub frame.
469     E_HVD_EX_GFRMINFO_DECODE_SUB,   ///< Decoded sub frame.
470     E_HVD_EX_GFRMINFO_LAST_DISPLAY
471 } HVD_EX_GetFrmInfoType;
472 
473 //-----------------------------------------------------------------------------
474 /// @brief \b Enum \b Name: HVD_EX_GDataType
475 /// @brief \b Enum \b Description:  The information type of get data
476 //-----------------------------------------------------------------------------
477 typedef enum
478 {
479     E_HVD_EX_GDATA_TYPE_DISP_CNT,
480     E_HVD_EX_GDATA_TYPE_SKIP_CNT,
481     E_HVD_EX_GDATA_TYPE_DROP_CNT,
482     E_HVD_EX_GDATA_TYPE_IDLE_CNT,
483     E_HVD_EX_GDATA_TYPE_VSYNC_CNT,
484     E_HVD_EX_GDATA_TYPE_MAIN_LOOP_CNT,
485     E_HVD_EX_GDATA_TYPE_AVC_LEVEL_IDC,
486     E_HVD_EX_GDATA_TYPE_DISP_Q_SIZE,
487     E_HVD_EX_GDATA_TYPE_ES_LEVEL,
488     E_HVD_EX_GDATA_TYPE_AVC_VUI_DISP_INFO,
489     E_HVD_EX_GDATA_TYPE_DISP_STC,
490     E_HVD_EX_GDATA_TYPE_USERDATA_IDX_TBL_SIZE,
491     E_HVD_EX_GDATA_TYPE_USERDATA_PACKET_SIZE,
492     E_HVD_EX_GDATA_TYPE_REAL_FRAMERATE,
493     E_HVD_EX_GDATA_TYPE_IS_ORI_INTERLACE_MODE,
494     E_HVD_EX_GDATA_TYPE_FRAME_MBS_ONLY_FLAG,
495     E_HVD_EX_GDATA_TYPE_FW_CODEC_TYPE,
496     E_HVD_EX_GDATA_TYPE_FRC_MODE,
497     E_HVD_EX_GDATA_TYPE_IS_LEAST_DISPQ_SIZE,
498     E_HVD_EX_GDATA_TYPE_FIELD_PIC_FLAG,
499     E_HVD_EX_GDATA_TYPE_VSYNC_BRIDGE_ADDR,
500     E_HVD_EX_GDATA_TYPE_FW_STATUS_FLAG,
501     E_HVD_EX_GDATA_TYPE_HVD_HW_MAX_PIXEL,
502 } HVD_EX_GDataType;
503 
504 //-----------------------------------------------------------------------------
505 /// @brief \b Enum \b Name: HVD_EX_GDataType
506 /// @brief \b Enum \b Description:  The type of set settings
507 //-----------------------------------------------------------------------------
508 typedef enum
509 {
510     E_HVD_EX_SSET_TIME_UNIT,            ///< set the HVD time unit of all interface. HVD_TimeUnit_Type
511     E_HVD_EX_SSET_PITCH,                ///< set the pitch of vsync.
512     E_HVD_EX_SSET_SYNC_EACH_FRM,        ///< HVD does sync action at every frame. TREU: turn on; FALSE: turn off.
513     E_HVD_EX_SSET_MAX_DEC_TICK,         ///< HVD limits the max decode ticks for one field.
514     E_HVD_EX_SSET_AUTO_FREE_ES,         ///< HVD frees the ES buffer data when ES is being fulled.
515     E_HVD_EX_SSET_MIN_FRAME_GAP,        ///< set HVD not to report error which is caused by the frame gap larger than min frame gap.
516     E_HVD_EX_SSET_DISABLE_DEBLOCKING,   ///< HVD will not do deblocking process.
517     E_HVD_EX_SSET_DISABLE_QUARTER_PIXEL,///< HVD will not do quarter pixel process.
518     E_HVD_EX_SSET_MIU_BURST_CNT_LEVEL,  ///< HVD MIU Burst Cnt, Arg 0~7: burst cnt level, 0xFFFFFFFF = Disable
519 } HVD_EX_SSettingsType;
520 
521 //-----------------------------------------------------------------------------
522 /// @brief \b Enum \b Name: HVD_EX_PatternType
523 /// @brief \b Enum \b Description:  The type of special pattern for specific purpose.
524 //-----------------------------------------------------------------------------
525 typedef enum
526 {
527     E_HVD_EX_PATTERN_FLUSH = 0,           ///< Used after MDrv_HVD_Flush().
528     E_HVD_EX_PATTERN_FILEEND,             ///< Used after MDrv_HVD_EX_SetDataEnd().
529 } HVD_EX_PatternType;
530 
531 //-----------------------------------------------------------------------------
532 /// @brief \b Enum \b Name: HVD_EX_ESLevel
533 /// @brief \b Enum \b Description:  The level of ES buffer.
534 //-----------------------------------------------------------------------------
535 typedef enum
536 {
537     E_HVD_EX_ES_LEVEL_NORMAL = 0,
538     E_HVD_EX_ES_LEVEL_UNDER = BIT(0),
539     E_HVD_EX_ES_LEVEL_OVER = BIT(1),
540 } HVD_EX_ESLevel;
541 
542 //-----------------------------------------------------------------------------
543 /// @brief \b Enum \b Name: HVD_EX_ErrorCode
544 /// @brief \b Enum \b Description:  The type of HVD error
545 //-----------------------------------------------------------------------------
546 typedef enum
547 {
548     E_HVD_EX_ERRCODE_GENERAL_BASE = 0x0000,
549     E_HVD_EX_ERRCODE_OUT_OF_SPEC,
550     E_HVD_EX_ERRCODE_UNKNOW_ERR,
551     E_HVD_EX_ERRCODE_HW_BREAK_DOWN,
552     E_HVD_EX_ERRCODE_HW_DEC_TIMEOUT,
553     E_HVD_EX_ERRCODE_OUT_OF_MEMORY,
554     E_HVD_EX_ERRCODE_UNKNOWN_CODEC,
555 
556     // AVC
557     E_HVD_EX_ERRCODE_AVC_BASE = 0x1000,
558     E_HVD_EX_ERRCODE_AVC_SPS_BROKEN,           // SPS is not valid
559     E_HVD_EX_ERRCODE_AVC_SPS_NOT_IN_SPEC,
560     E_HVD_EX_ERRCODE_AVC_SPS_NOT_ENOUGH_FRM,   // DPB size at specified level is smaller than the specified number of reference frames. This is not allowed
561     E_HVD_EX_ERRCODE_AVC_PPS_BROKEN,           // PPS is not valid
562     E_HVD_EX_ERRCODE_AVC_REF_LIST,
563     E_HVD_EX_ERRCODE_AVC_NO_REF,
564     E_HVD_EX_ERRCODE_AVC_RES,
565 
566     // AVS
567     E_HVD_EX_ERRCODE_AVS_BASE = (0x2000),
568     E_HVD_EX_ERRCODE_AVS_RES,
569 
570     // RM
571     E_HVD_EX_ERRCODE_RM_BASE = (0x3000),
572     E_HVD_EX_ERRCODE_RM_PACKET_HEADER,
573     E_HVD_EX_ERRCODE_RM_FRAME_HEADER,
574     E_HVD_EX_ERRCODE_RM_SLICE_HEADER,
575     E_HVD_EX_ERRCODE_RM_BYTE_CNT,
576     E_HVD_EX_ERRCODE_RM_DISP_TIMEOUT,
577     E_HVD_EX_ERRCODE_RM_NO_REF,
578     E_HVD_EX_ERRCODE_RM_RES,                    // out of supported resolution
579     E_HVD_EX_ERRCODE_RM_VLC,
580     E_HVD_EX_ERRCODE_RM_SIZE_OUT_FB_LAYOUT,
581 } HVD_EX_ErrorCode;
582 
583 //-----------------------------------------------------------------------------
584 /// @brief \b Enum \b Name: HVD_TurboInitLevel
585 /// @brief \b Enum \b Description:  The level of turbo init mode.
586 //-----------------------------------------------------------------------------
587 typedef enum
588 {
589     E_HVD_EX_TURBOINIT_NONE        = 0,     ///< Not omit any process.
590     E_HVD_EX_TURBOINIT_CHECK       = BIT(0),     ///< Omit checking.
591     E_HVD_EX_TURBOINIT_MEMORY      = BIT(1),     ///< Omit memory reset process.
592     E_HVD_EX_TURBOINIT_DISPLAY     = BIT(2),     ///< Omit FW display setup process.
593     E_HVD_EX_TURBOINIT_FW_RELOAD   = BIT(3), ///< Omit FW reload process.
594 } HVD_EX_TurboInitType;
595 
596 //-----------------------------------------------------------------------------
597 /// @brief \b Enum \b Name: HVD_EX_FWSourceType
598 /// @brief \b Enum \b Description:  The type of fw binary input source
599 //-----------------------------------------------------------------------------
600 typedef enum
601 {
602     E_HVD_EX_FW_SOURCE_NONE,       ///< No input FW; FW will be loaded by VDEC library.
603     E_HVD_EX_FW_SOURCE_DRAM,       ///< input source from DRAM.
604     E_HVD_EX_FW_SOURCE_FLASH,      ///< input source from FLASH.
605 } HVD_EX_FWSourceType;
606 
607 //-----------------------------------------------------------------------------
608 /// @brief \b Enum \b Name: HVD_EX_DumpStatus
609 /// @brief \b Enum \b Description:  The type of fw binary input source
610 //-----------------------------------------------------------------------------
611 typedef enum
612 {
613     E_HVD_EX_DUMP_STATUS_DRV   = BIT(0),       ///< Dump Driver status
614     E_HVD_EX_DUMP_STATUS_FW    = BIT(1),       ///< Dump firmware status
615     E_HVD_EX_DUMP_STATUS_HW    = BIT(2),       ///< Dump hardware status
616 } HVD_EX_DumpStatus;
617 
618 typedef enum
619 {
620     E_HVD_EX_DRV_STREAM_NONE = 0,
621     E_HVD_EX_DRV_MAIN_STREAM,
622     E_HVD_EX_DRV_SUB_STREAM,
623     E_HVD_EX_DRV_MVC_STREAM,
624 } HVD_EX_DRV_StreamType;
625 
626 typedef enum
627 {
628     E_HVD_EX_FB_REDUCTION_NONE = 0,        ///< FB reduction disable
629     E_HVD_EX_FB_REDUCTION_1_2 = 1,         ///< FB reduction 1/2
630     E_HVD_EX_FB_REDUCTION_1_4 = 2,         ///< FB reduction 1/4
631 } HVD_EX_FBReductionType;
632 
633 typedef enum
634 {
635     E_HVD_EX_CLOCK_SPEED_NONE = 0,
636     E_HVD_EX_CLOCK_SPEED_HIGHEST,
637     E_HVD_EX_CLOCK_SPEED_HIGH,
638     E_HVD_EX_CLOCK_SPEED_MEDIUM,
639     E_HVD_EX_CLOCK_SPEED_LOW,
640     E_HVD_EX_CLOCK_SPEED_LOWEST,
641     E_HVD_EX_CLOCK_SPEED_DEFAULT,
642 } HVD_EX_ClockSpeed;
643 
644 
645 typedef enum
646 {
647     E_HVD_EX_ES_BUF_STATUS_UNKNOWN   = 0,
648     E_HVD_EX_ES_BUF_STATUS_UNDERFLOW = 1,
649     E_HVD_EX_ES_BUF_STATUS_OVERFLOW  = 2,
650     E_HVD_EX_ES_BUF_STATUS_NORMAL    = 3,
651 
652 }HVD_EX_ES_Buf_Status;
653 
654 
655 //-----------------------------------------------------------------------------
656 /// @brief \b Struct \b Name: HVD_EX_DispInfo
657 /// @brief \b Struct \b Description:  Store the HVD driver information
658 //-----------------------------------------------------------------------------
659 typedef struct
660 {
661     MS_U16 u16HorSize;          ///< pixel width.
662     MS_U16 u16VerSize;          ///< pixel height.
663     MS_U32 u32FrameRate;    ///< 1000 times frames per second.
664     MS_U8 u8AspectRate;     ///< aspect ration ID.
665     MS_U8 u8Interlace;          ///< interlace content
666     MS_U8 u8AFD;            ///< AFD ID number
667     MS_U8 bChroma_idc_Mono;             ///< - TRUE: mono mode FALSE: colorful, not mono
668     MS_U16 u16SarWidth;            ///< Sample aspect width ratio.
669     MS_U16 u16SarHeight;           ///< Sample aspect height ratio.
670     MS_U16 u16CropRight;            ///< crop right.
671     MS_U16 u16CropLeft;             ///< crop left.
672     MS_U16 u16CropBottom;           ///< crop bottom.
673     MS_U16 u16CropTop;          ///< crop top.
674     MS_U16 u16Pitch;            ///< pitch
675     MS_U8  u8ColourPrimaries;   ///< Color Primaries in VUI
676     //****************************
677     MS_U8 reserved8_0;          ///< reserved.
678     //******************************
679 } HVD_EX_DispInfo;     //  bytes
680 
681 //-----------------------------------------------------------------------------
682 /// @brief \b Struct \b Name: HVD_EX_DrvInfo
683 /// @brief \b Struct \b Description:  Store the HVD driver information
684 //-----------------------------------------------------------------------------
685 typedef struct
686 {
687     MS_BOOL bAVC;       ///< - TRUE: HW does support AVC.  - FALSE: HW does not support AVC.
688     MS_BOOL bAVS;       ///< - TRUE: HW does support AVS.  - FALSE: HW does not support AVS.
689     MS_BOOL bRM;        ///< - TRUE: HW does support RM.  - FALSE: HW does not support RM.
690     MS_U32  FWversion;       ///<  FW version number.
691 } HVD_EX_DrvInfo;
692 
693 //-----------------------------------------------------------------------------
694 /// @brief \b Struct \b Name: HVD_EX_DrvStatus
695 /// @brief \b Struct \b Description:  Store the HVD driver status
696 //-----------------------------------------------------------------------------
697 typedef struct
698 {
699     MS_BOOL bInit;       ///< - TRUE: Initialization success.  - FALSE: Initialization failed or not initialized yet.
700     MS_BOOL bBusy;       ///< - TRUE: Driver is processing  - FALSE: Driver is Idle.
701 } HVD_EX_DrvStatus;
702 
703 //-----------------------------------------------------------------------------
704 /// @brief \b Struct \b Name: HVD_EX_RVInfo
705 /// @brief \b Struct \b Description:  RV file information
706 //-----------------------------------------------------------------------------
707 typedef struct
708 {
709     MS_U16 RV_Version;      ///< Real Video Bitstream version
710     MS_U16 ulNumSizes;      ///< Real Video Number sizes
711     MS_U16 ulPicSizes_w[8]; ///< Real Video file width
712     MS_U16 ulPicSizes_h[8]; ///< Real Video file height
713 } HVD_EX_RVInfo;
714 
715 typedef struct
716 {
717     HVD_EX_FBReductionType LumaFBReductionMode;     ///< Luma frame buffer reduction mode.
718     HVD_EX_FBReductionType ChromaFBReductionMode;   ///< Chroma frame buffer reduction mode.
719     MS_U8                 u8EnableAutoMode;        /// 0: Disable, 1: Enable
720 } HVD_EX_FBReduction;
721 
722 //-----------------------------------------------------------------------------
723 /// @brief \b Struct \b Name: HVD_EX_MemCfg
724 /// @brief \b Struct \b Description:  Store the HVD driver config
725 //-----------------------------------------------------------------------------
726 typedef struct
727 {
728     HVD_EX_FWSourceType eFWSourceType;             //!< the input FW source type.
729     MS_U32  u32FWBinaryVAddr;                //!<  virtual address of input FW binary in DRAM
730     MS_PHYADDR  u32FWBinaryAddr;                //!< the physical memory start address in Flash/DRAM memory of FW code
731     MS_U32  u32FWBinarySize;                //!< the FW code size
732     MS_U32 u32VLCBinaryVAddr;///< VLC table binary data buffer start address
733     MS_PHYADDR u32VLCBinaryAddr;///< VLC table binary data buffer start address
734     MS_U32 u32VLCBinarySize;///<VLC table binary data buffer size
735     MS_PHYADDR  u32MIU1BaseAddr;       //!< the physical memory start address of MIU 1 base address. 0: default value.
736     MS_U32  u32CodeBufVAddr;        //!< the virtual memory start address of code buffer
737     MS_PHYADDR  u32CodeBufAddr;         //!< the physical memory start address of code buffer
738     MS_U32  u32CodeBufSize;             //!< the code buffer size
739     MS_U32  u32FrameBufVAddr;           //!< the virtual memory start address of frame buffer
740     MS_PHYADDR  u32FrameBufAddr;            //!< the physical memory start address of frame buffer
741     MS_U32  u32FrameBufSize;                //!< the frame buffer size
742     MS_U32  u32BitstreamBufVAddr;           //!< the virtual memory start address of bit stream buffer
743     MS_PHYADDR  u32BitstreamBufAddr;                //!< the physical memory start address of bit stream buffer
744     MS_U32  u32BitstreamBufSize;            //!< the bit stream buffer size
745     MS_U32  u32DrvProcessBufVAddr;       //!< the virtual memory start address of driver process buffer
746     MS_PHYADDR  u32DrvProcessBufAddr;       //!< the physical memory start address of driver process buffer
747     MS_U32  u32DrvProcessBufSize;        //!< the driver process buffer size
748 } HVD_EX_MemCfg;
749 
750 //-----------------------------------------------------------------------------
751 /// @brief \b Struct \b Name: HVD_Init_Params
752 /// @brief \b Struct \b Description:  Store the initialization settings
753 //-----------------------------------------------------------------------------
754 typedef struct
755 {
756     MS_U32 u32ModeFlag;     ///< init mode flag, use HVD_INIT_* to setup HVD.
757     MS_U32 u32FrameRate;     ///< frame rate.
758     MS_U32 u32FrameRateBase;     ///< frame rate base. The value of u32FrameRate /u32FrameRateBase must be frames per sec.
759     MS_U8   u8MinFrmGap;    ///< set the min frame gap.
760     MS_U8   u8SyncType;         ///< HVD_EX_SyncType. sync type of current playback.
761     MS_U16 u16Pitch;   ///< not zero: specify the pitch. 0: use default value.
762     MS_U32 u32MaxDecTick;   ///< not zero: specify the max decode tick. 0: use default value.
763     MS_BOOL bSyncEachFrm;   ///< TRUE: sync STC at each frame. FALSE: not sync each frame.
764     MS_BOOL bAutoFreeES;   ///< TRUE: auto free ES buffer when ES buffer is full. FALSE: not do the auto free.
765     MS_BOOL bAutoPowerSaving;   ///< TRUE: auto power saving. FALSE: not do the auto power saving.
766     MS_BOOL bDynamicScaling;   ///< TRUE: enable Dynamic Scaling. FALSE: disable Dynamic Scaling.
767     MS_BOOL bFastDisplay;   ///< TRUE: enable Fast Display. FALSE: disable Fast Display.
768     MS_BOOL bUserData;   ///< TRUE: enable processing User data. FALSE: disable processing User data.
769     MS_U8 u8TurboInit;       ///< HVD_TurboInitLevel. set the turbo init mode.
770     MS_U8 u8TimeUnit;   ///< HVD_Time_Unit_Type.set the type of input/output time unit.
771     MS_U16 u16DecoderClock;      ///< HVD decoder clock speed. 0: default value. non-zero: any nearist clock.
772     MS_U16 u16ChipECONum;    ///< Chip revision, ECO number.
773     HVD_EX_RVInfo* pRVFileInfo;           ///< pointer to RV file info
774     HVD_EX_FBReduction stFBReduction; ///< HVD Frame buffer reduction type
775 } HVD_EX_InitSettings;
776 
777 //-----------------------------------------------------------------------------
778 /// @brief \b Struct \b Name: HVD_EX_PacketInfo
779 /// @brief \b Struct \b Description:  Store the packet information
780 //-----------------------------------------------------------------------------
781 typedef struct
782 {
783     MS_VIRT u32Staddr;     ///< Packet offset from bitstream buffer base address. unit: byte.
784     MS_VIRT u32Length;    ///< Packet size. unit: byte.
785     MS_VIRT u32Staddr2;     ///< Packet offset from bitstream buffer base address. unit: byte.
786     MS_VIRT u32Length2;    ///< Packet size. unit: byte.
787     MS_U32 u32TimeStamp;    ///< Packet time stamp. unit: ms.
788     MS_U32 u32ID_L;    ///< Packet ID low part.
789     MS_U32 u32ID_H;    ///< Packet ID high part.
790     MS_U32 u32AllocLength;    ///< Allocated Packet size. unit: byte.
791 } HVD_EX_PacketInfo;
792 
793 //-----------------------------------------------------------------------------
794 /// @brief \b Struct \b Name: HVD_EX_FrameInfo
795 /// @brief \b Struct \b Description:  Store the frame information
796 //-----------------------------------------------------------------------------
797 typedef struct
798 {
799     MS_PHYADDR u32LumaAddr;                 ///< The start physical of luma data. Unit: byte.
800     MS_PHYADDR u32ChromaAddr;               ///< The start physcal of chroma data. Unit: byte.
801     MS_U32 u32TimeStamp;                ///< Time stamp(DTS, PTS) of current displayed frame. Unit: 90khz.
802     MS_U32 u32ID_L;                     ///< low part of ID number decided by MDrv_HVD_EX_PushQueue().
803     MS_U32 u32ID_H;                     ///< high part of ID number decided by MDrv_HVD_EX_PushQueue().
804     MS_U16 u16Pitch;                        ///< The pitch of current frame.
805     MS_U16 u16Width;                        ///< pixel width of current frame.
806     MS_U16 u16Height;                       ///< pixel height of current frame.
807     HVD_EX_FrmType eFrmType;     ///< picture type: I, P, B frame
808     HVD_EX_FieldType  eFieldType;                 ///< none, top , bottom, both field
809     MS_U32 u32PrivateData;              //[STB]only for AVC
810     MS_PHYADDR u32LumaAddr_2bit;                 ///< The start offset of luma data. Unit: byte.
811     MS_PHYADDR u32ChromaAddr_2bit;               ///< The start offset of chroma data. Unit: byte.
812     MS_U16 u16Pitch_2bit;
813     MS_U8  u8LumaBitdepth;
814     MS_U8  u8ChromaBitdepth;
815 } HVD_EX_FrameInfo;
816 
817 //-----------------------------------------------------------------------------
818 /// @brief \b Struct \b Name: HVD_DISP_INFO_THRESHOLD
819 /// @brief \b Struct \b Description:  Store the disp information threshold
820 //-----------------------------------------------------------------------------
821 typedef struct
822 {
823     MS_U32 u32FrmrateUpBound;       //Framerate filter upper bound
824     MS_U32 u32FrmrateLowBound;      //Framerate filter lower bound
825     MS_U32 u32MvopUpBound;          //mvop filter upper bound
826     MS_U32 u32MvopLowBound;         //mvop filter lower bound
827 } HVD_EX_DispInfoThreshold;
828 
829 typedef struct
830 {
831     MS_U8  u8DecMod;
832     MS_U8  u8CodecCnt;
833     MS_U8  u8CodecType[HVD_MAX_DEC_NUM];
834     MS_U8  u8ArgSize;
835     MS_U32 u32Arg;
836 } HVD_EX_DecModCfg;
837 //-----------------------------------------------------------------------------
838 /// @brief \b Struct \b Name: HVD_UsrData_Info
839 /// @brief \b Struct \b Description:  Store the User Data information
840 //-----------------------------------------------------------------------------
841 typedef struct
842 {
843     MS_U32 u32Pts;
844     MS_U8  u8PicStruct;           // picture_structure
845     MS_U8  u8PicType;             // picture type: 1->I picture, 2->P,3->B
846     MS_U8  u8TopFieldFirst;       // Top field first: 1 if top field first
847     MS_U8  u8RptFirstField;       // Repeat first field: 1 if repeat field first
848 
849     MS_U32 u32DataBuf;            // User_Data data buffer address
850     MS_U16 u16TmpRef;             // Temporal reference of the picture
851     MS_U8  u8ByteCnt;             // User Data length
852     MS_U8  u8Reserve;             // Reserved
853 } HVD_EX_UserData_Info;
854 
855 typedef struct
856 {
857     MS_BOOL bvaild;
858     MS_BOOL bUsed;
859     MS_U8   u8Frm_packing_arr_cnl_flag;
860     MS_U8   u8Frm_packing_arr_type;
861     MS_U8   u8content_interpretation_type;
862     MS_U8   u1Quincunx_sampling_flag;
863     MS_U8   u1Spatial_flipping_flag;
864     MS_U8   u1Frame0_flipping_flag;
865     MS_U8   u1Field_views_flag;
866     MS_U8   u1Current_frame_is_frame0_flag;
867     MS_U8   u1Frame0_self_contained_flag;
868     MS_U8   u1Frame1_self_contained_flag;
869     MS_U8   u4Frame0_grid_position_x;
870     MS_U8   u4Frame0_grid_position_y;
871     MS_U8   u4Frame1_grid_position_x;
872     MS_U8   u4Frame1_grid_position_y;
873     MS_U16  u16CropRight;
874     MS_U16  u16CropLeft;
875     MS_U16  u16CropBottom;
876     MS_U16  u16CropTop;
877     MS_U8   u8payload_len;
878     MS_U8   u8WaitSPS;
879     MS_U8   u8Reserved01;
880     MS_U8   u8Reserved02;
881     MS_U32  u32payload;
882 }HVD_EX_FrmPackingSEI;
883 
884 typedef struct
885 {
886     MS_VIRT  u32DSBufAddr;       // Buffer Address
887     MS_U32  u32DSBufSize;       // Buffer Size
888 }HVD_EX_ExternalDSBuf;
889 
890 //-------------------------------------------------------------------------------------------------
891 //  Function and Variable
892 //-------------------------------------------------------------------------------------------------
893 void        MDrv_HVD_EX_SetCtrlsBase(MS_U32 u32Id);
894 void        MDrv_HVD_EX_MJPEG_InitSharemem(MS_U32 u32Id, MS_U32 u32CodeBufVAddr);
895 void        MDrv_HVD_EX_MJPEG_Exit(MS_U32 u32Id);
896 
897 void        MDrv_HVD_EX_SetOSRegBase(MS_U32 u32RegBaseAddr);
898 HVD_EX_Result  MDrv_HVD_EX_GetFreeStream(MS_U32 *pu32Id, HVD_EX_DRV_StreamType eStreamType);
899 HVD_EX_Result  MDrv_HVD_EX_Init(MS_U32 u32Id, HVD_EX_MemCfg *pStMemCfg, HVD_EX_InitSettings *pStInitSettings);
900 HVD_EX_Result  MDrv_HVD_EX_Rst(MS_U32 u32Id, MS_BOOL bErrHandle);
901 HVD_EX_Result  MDrv_HVD_EX_Play(MS_U32 u32Id);
902 HVD_EX_Result  MDrv_HVD_EX_Exit(MS_U32 u32Id);
903 HVD_EX_Result  MDrv_HVD_EX_Pause(MS_U32 u32Id);
904 HVD_EX_Result  MDrv_HVD_EX_Flush(MS_U32 u32Id, MS_BOOL bShowLast);
905 HVD_EX_Result  MDrv_HVD_EX_StepDisp(MS_U32 u32Id);
906 HVD_EX_Result  MDrv_HVD_EX_StepDecode(MS_U32 u32Id);
907 HVD_EX_Result  MDrv_HVD_EX_PushQueue(MS_U32 u32Id, HVD_EX_PacketInfo *pInfo);
908 HVD_EX_Result  MDrv_HVD_EX_PushQueue_Fire(MS_U32 u32Id);
909 HVD_EX_Result  MDrv_HVD_EX_DecodeIFrame(MS_U32 u32Id, MS_PHYADDR u32SrcSt, MS_VIRT u32SrcSize);
910 
911 HVD_EX_Result  MDrv_HVD_EX_SetDataEnd(MS_U32 u32Id, MS_BOOL bEnd);
912 HVD_EX_Result  MDrv_HVD_EX_SetDispErrFrm(MS_U32 u32Id, MS_BOOL bEnable);
913 HVD_EX_Result  MDrv_HVD_EX_SetDispRepeatField(MS_U32 u32Id, MS_BOOL bEnable);
914 HVD_EX_Result  MDrv_HVD_EX_SetSkipDecMode(MS_U32 u32Id, HVD_EX_SkipDecode eDecType);
915 HVD_EX_Result  MDrv_HVD_EX_SetDispSpeed(MS_U32 u32Id, HVD_EX_DispSpeed eSpeed);
916 HVD_EX_Result  MDrv_HVD_EX_SetSyncActive(MS_U32 u32Id, MS_BOOL bEnable);
917 HVD_EX_Result  MDrv_HVD_EX_SetDropMode(MS_U32 u32Id, HVD_EX_DropDisp eMode, MS_U32 u32Arg);
918 HVD_EX_Result  MDrv_HVD_EX_RstPTS(MS_U32 u32Id, MS_U32 u32PTS);
919 HVD_EX_Result  MDrv_HVD_EX_SetFrcMode(MS_U32 u32Id, HVD_EX_FrmRateConvMode eMode);
920 HVD_EX_Result  MDrv_HVD_EX_SetSyncTolerance(MS_U32 u32Id, MS_U32 u32Arg);
921 HVD_EX_Result  MDrv_HVD_EX_SetSyncVideoDelay(MS_U32 u32Id, MS_U32 u32Arg);
922 HVD_EX_Result  MDrv_HVD_EX_SetSyncFreeRunTH(MS_U32 u32Id, MS_U32 u32Arg);
923 HVD_EX_Result  MDrv_HVD_EX_SetSyncRepeatTH(MS_U32 u32Id, MS_U32 u32Arg);
924 HVD_EX_Result  MDrv_HVD_EX_SetErrConceal(MS_U32 u32Id, MS_BOOL u32Arg);
925 void        MDrv_HVD_EX_SetDbgLevel(HVD_EX_UartLevel elevel);
926 HVD_EX_Result  MDrv_HVD_EX_SeekToPTS(MS_U32 u32Id, MS_U32 u32PTS);
927 HVD_EX_Result  MDrv_HVD_EX_SkipToPTS(MS_U32 u32Id, MS_U32 u32PTS);
928 HVD_EX_Result  MDrv_HVD_EX_SetFreezeImg(MS_U32 u32Id, MS_BOOL bEnable);
929 HVD_EX_Result  MDrv_HVD_EX_SetBlueScreen(MS_U32 u32Id, MS_BOOL bEnable);
930 HVD_EX_Result  MDrv_HVD_EX_SetDispOneField(MS_U32 u32Id, MS_BOOL bEnable);
931 HVD_EX_Result  MDrv_HVD_EX_SetISREvent(MS_U32 u32Id, MS_U32 u32Event, HVD_InterruptCb fnISRHandler);
932 MS_BOOL     MDrv_HVD_EX_SetEnableISR(MS_U32 u32Id, MS_BOOL bEnable);
933 MS_BOOL     MDrv_HVD_EX_SetForceISR(MS_U32 u32Id, MS_BOOL bEnable);
934 MS_BOOL     MDrv_HVD_EX_SetMVOPDone(MS_U32 u32Id);
935 HVD_EX_Result  MDrv_HVD_EX_SetVirtualBox(MS_U32 u32Id, MS_U16 u16Width, MS_U16 u16Height);
936 HVD_EX_Result  MDrv_HVD_EX_SetDynScalingParam(MS_U32 u32Id, void *pStAddr, MS_U32 u32Size);
937 HVD_EX_Result  MDrv_HVD_EX_SetAutoRmLstZeroByte(MS_U32 u32Id, MS_BOOL bOn);
938 HVD_EX_Result  MDrv_HVD_EX_SetDispInfoTH(MS_U32 u32Id, HVD_EX_DispInfoThreshold *DispInfoTH);
939 HVD_EX_Result  MDrv_HVD_EX_SetFastDisplay(MS_U32 u32Id, MS_BOOL bFastDisplay);
940 HVD_EX_Result  MDrv_HVD_EX_SetIgnoreErrRef(MS_U32 u32Id, MS_BOOL bIgnore);
941 HVD_EX_Result  MDrv_HVD_EX_ForceFollowDTVSpec(MS_U32 u32Id, MS_BOOL bEnable);
942 
943 MS_BOOL     MDrv_HVD_EX_IsISROccured(MS_U32 u32Id);
944 MS_BOOL     MDrv_HVD_EX_IsDispFinish(MS_U32 u32Id);
945 MS_BOOL     MDrv_HVD_EX_IsFrameShowed(MS_U32 u32Id);
946 MS_BOOL     MDrv_HVD_EX_IsStepDecodeDone(MS_U32 u32Id);
947 HVD_EX_Result  MDrv_HVD_EX_CheckDispInfoRdy(MS_U32 u32Id);
948 MS_BOOL     MDrv_HVD_EX_IsDispInfoChg(MS_U32 u32Id);
949 MS_BOOL     MDrv_HVD_EX_IsIdle(MS_U32 u32Id);
950 MS_BOOL     MDrv_HVD_EX_IsSyncStart(MS_U32 u32Id);
951 MS_BOOL     MDrv_HVD_EX_IsSyncReach(MS_U32 u32Id);
952 MS_BOOL     MDrv_HVD_EX_IsLowDelay(MS_U32 u32Id);
953 MS_BOOL     MDrv_HVD_EX_IsIFrmFound(MS_U32 u32Id);
954 MS_BOOL     MDrv_HVD_EX_Is1stFrmRdy(MS_U32 u32Id);
955 MS_BOOL     MDrv_HVD_EX_IsAllBufferEmpty(MS_U32 u32Id);
956 HVD_EX_Result  MDrv_HVD_EX_IsAlive(MS_U32 u32Id);
957 
958 MS_U32      MDrv_HVD_EX_GetBBUVacancy(MS_U32 u32Id);
959 HVD_EX_Result  MDrv_HVD_EX_GetDispInfo(MS_U32 u32Id, HVD_EX_DispInfo *pInfo);
960 MS_U32      MDrv_HVD_EX_GetPTS(MS_U32 u32Id);
961 MS_U64      MDrv_HVD_EX_GetU64PTS(MS_U32 u32Id);
962 MS_U32      MDrv_HVD_EX_GetNextPTS(MS_U32 u32Id);
963 MS_U32      MDrv_HVD_EX_GetNextDispQPtr(MS_U32 u32Id);
964 MS_U32      MDrv_HVD_EX_GetDataErrCnt(MS_U32 u32Id);
965 MS_U32      MDrv_HVD_EX_GetDecErrCnt(MS_U32 u32Id);
966 MS_U32      MDrv_HVD_EX_GetESWritePtr(MS_U32 u32Id);
967 MS_U32      MDrv_HVD_EX_GetESReadPtr(MS_U32 u32Id);
968 MS_U32      MDrv_HVD_EX_GetESQuantity(MS_U32 u32Id);
969 MS_BOOL     MDrv_HVD_EX_GetCaps(HVD_EX_Codec u32Type);
970 MS_U32      MDrv_HVD_EX_GetErrCode(MS_U32 u32Id);
971 MS_U32      MDrv_HVD_EX_GetPlayMode(MS_U32 u32Id, HVD_EX_GetModeStatus eMode);
972 HVD_EX_GetPlayState MDrv_HVD_EX_GetPlayState(MS_U32 u32Id);
973 MS_U32      MDrv_HVD_EX_GetDecodeCnt(MS_U32 u32Id);
974 MS_U8       MDrv_HVD_EX_GetActiveFormat(MS_U32 u32Id);
975 const HVD_EX_DrvInfo *MDrv_HVD_EX_GetInfo(void);
976 HVD_EX_Result  MDrv_HVD_EX_GetLibVer(const MSIF_Version **ppVersion);
977 MS_BOOL     MDrv_HVD_EX_GetStatus(MS_U32 u32Id, HVD_EX_DrvStatus *pstatus);
978 HVD_EX_Result  MDrv_HVD_EX_GetFrmInfo(MS_U32 u32Id, HVD_EX_GetFrmInfoType eType, HVD_EX_FrameInfo *pInfo);
979 MS_BOOL     MDrv_HVD_EX_GetISRInfo(MS_U32 u32Id, MS_U32 *eType);
980 MS_U32      MDrv_HVD_EX_CalLumaSum(MS_U32 u32Id, HVD_EX_GetFrmInfoType eType);
981 MS_U32      MDrv_HVD_EX_GetUserData_Wptr(MS_U32 u32Id);
982 MS_U32      MDrv_HVD_EX_GetUserData_Packet(MS_U32 u32Id, MS_U32 u32Idx, MS_U32 *u32Size);
983 HVD_EX_Result  MDrv_HVD_EX_GenPattern(MS_U32 u32Id, HVD_EX_PatternType eType, MS_U32 u32VAddr, MS_U32 *u32Size);
984 MS_U32      MDrv_HVD_EX_GetPatternInfo(MS_U32 u32Id, HVD_EX_PatternInfo eType);
985 MS_U32      MDrv_HVD_EX_GetDynamicScalingInfo(MS_U32 u32Id, HVD_EX_DynamicScalingInfo eType);
986 MS_BOOL     MDrv_HVD_EX_GetFrmRateIsSupported(MS_U32 u32Id);
987 
988 MS_U32      MDrv_HVD_EX_GetData(MS_U32 u32Id, HVD_EX_GDataType eType);
989 MS_U32      MDrv_HVD_EX_GetMem_Dbg(MS_U32 u32Id, MS_VIRT u32Addr);
990 void        MDrv_HVD_EX_DbgDumpStatus(MS_U32 u32Id, HVD_EX_DumpStatus eFlag);
991 void        MDrv_HVD_EX_SetMem_Dbg(MS_U32 u32Id, MS_VIRT u32Addr, MS_U32 u32Arg);
992 HVD_EX_Result  MDrv_HVD_EX_SetCmd_Dbg(MS_U32 u32Id, MS_U32 u32Cmd, MS_U32 u32Arg);
993 HVD_EX_Result  MDrv_HVD_EX_SetSettings_Pro(MS_U32 u32Id, HVD_EX_SSettingsType eType, MS_U32 u32Arg);
994 HVD_EX_Result  MDrv_HVD_EX_SetBalanceBW(MS_U32 u32Id, MS_U8 u8QPCnt, MS_U8 u8DBCnt, MS_U8 u8Upper);
995 MS_S64      MDrv_HVD_EX_GetPtsStcDiff(MS_U32 u32Id);
996 MS_U32      MDrv_HVD_EX_GetDrvFwVer(void);
997 HVD_EX_Result  MDrv_HVD_EX_SetFdMaskDelayCnt(MS_U32 u32Id, MS_U8 u8DelayCnt);
998 HVD_EX_Result  MDrv_HVD_EX_SetOutputFRCMode(MS_U32 u32Id, MS_U8 u8FrameRate, MS_U8 u8Interlace);
999 HVD_EX_Result  MDrv_HVD_EX_DispFrame(MS_U32 u32Id, MS_U32 u32FrmIdx);
1000 HVD_EX_Result  MDrv_HVD_EX_FreeFrame(MS_U32 u32Id, MS_U32 u32FrmIdx);
1001 HVD_EX_Result  MDrv_HVD_EX_EnableDispQue(MS_U32 u32Id, MS_BOOL bEnable);
1002 HVD_EX_Result  MDrv_HVD_EX_EnableVSizeAlign(MS_U32 u32Id, MS_BOOL bEnable);
1003 HVD_EX_Result  MDrv_HVD_EX_ShowDecodeOrder(MS_U32 u32Id, MS_BOOL bEnable);
1004 HVD_EX_Result  MDrv_HVD_EX_Disp_Ignore_Crop(MS_U32 u32Id, MS_BOOL bEnable);
1005 HVD_EX_Result MDrv_HVD_EX_RmEnablePtsTbl(MS_U32 u32Id, MS_BOOL bEnable);
1006 HVD_EX_Result  MDrv_HVD_EX_SetFRCDropType(MS_U32 u32Id, MS_U8 u8DropType);
1007 MS_U32      MDrv_HVD_EX_GetDrvFwVer(void);
1008 MS_U32      MDrv_HVD_EX_GetFwVer(MS_U32 u32Id);
1009 HVD_EX_Result MDrv_HVD_EX_DispOutsideMode(MS_U32 u32Id, MS_BOOL bEnable);
1010 MS_BOOL MDrv_HVD_SetSingleDecodeMode(MS_BOOL bEnable);
1011 MS_BOOL MDrv_HVD_SetDecodeMode(HVD_EX_DecModCfg *pstCfg);
1012 void MDrv_HVD_EX_SetBurstMode(MS_U32 u32Id, MS_BOOL bBurst);
1013 HVD_EX_Result  MDrv_HVD_EX_ForceInterlaceMode(MS_U32 u32Id, MS_U8 u8Mode);
1014 HVD_EX_Result  MDrv_HVD_EX_Support_AVC2MVC(MS_U32 u32Id, MS_BOOL bEnable);
1015 HVD_EX_Result  MDrv_HVD_EX_3DLR_View_Exchange(MS_U32 u32Id, MS_BOOL bEnable);
1016 HVD_EX_Result  MDrv_HVD_EX_Enable_New_Slow_Motion(MS_U32 u32Id, MS_BOOL bEnable);
1017 HVD_EX_Result  MDrv_HVD_EX_SetDTVUserDataMode(MS_U32 u32Id,MS_U8 u8UserDataMode);
1018 MS_BOOL MDrv_HVD_EX_GetUsrDataIsAvailable(MS_U32 u32Id);
1019 HVD_EX_Result  MDrv_HVD_EX_GetUserDataInfo(MS_U32 u32Id,HVD_EX_UserData_Info* pUsrInfo);
1020 HVD_EX_Result  MDrv_HVD_EX_GetFrmPackingArrSEI(MS_U32 u32Id,HVD_EX_FrmPackingSEI *pFrmPacking);
1021 HVD_EX_Result  MDrv_HVD_EX_SuspendDynamicScale(MS_U32 u32Id, MS_BOOL bEnable);
1022 HVD_EX_Result  MDrv_HVD_EX_PushDispQWithRefNum(MS_U32 u32Id, MS_U8 u8Mode);
1023 HVD_EX_Result  MDrv_HVD_EX_IgnorePicOverrun(MS_U32 u32Id, MS_BOOL bEnable);
1024 HVD_EX_Result  MDrv_HVD_EX_DynamicScalingResvNBuffer(MS_U32 u32Id, MS_BOOL bEnable);
1025 HVD_EX_Result  MDrv_HVD_EX_CtlSpeedInDispOnly(MS_U32 u32Id, MS_BOOL bEnable);
1026 HVD_EX_Result  MDrv_HVD_EX_AVCSupportRefNumOverMaxDBPSize(MS_U32 u32Id, MS_BOOL bEnable);
1027 MS_U32 MDrv_HVD_EX_GetBBUQNum(MS_U32 u32Id);
1028 MS_U32 MDrv_HVD_EX_GetDispFrmNum(MS_U32 u32Id);
1029 HVD_EX_Result MDrv_HVD_Init_Share_Mem(void);
1030 HVD_EX_Result MDrv_HVD_EX_SetHVDClockSpeed(HVD_EX_ClockSpeed eClockSpeed);
1031 HVD_EX_Result MDrv_HVD_EX_SetVPUClockSpeed(HVD_EX_ClockSpeed eClockSpeed);
1032 HVD_EX_Result MDrv_HVD_EX_DSReportDispInfoChange(MS_U32 u32Id, MS_BOOL bEnable);
1033 HVD_EX_Result MDrv_HVD_EX_SetSecureMode(MS_U32 u32Id, MS_U32 u32SecureMode);
1034 HVD_EX_Result MDrv_HVD_EX_SupportRefNumOverMaxDpbSize(MS_U32 u32Id, MS_BOOL bEnable);
1035 HVD_EX_Result MDrv_HVD_EX_RVU_Setting_Mode(MS_U32 u32Id, MS_U32 u32Param);
1036 HVD_EX_Result MDrv_HVD_EX_FramerateHandling(MS_U32 u32Id, MS_U32 u32FrameRate);
1037 HVD_EX_Result MDrv_HVD_EX_DualNonBlockMode(MS_U32 u32Id, MS_BOOL bEnable);
1038 HVD_EX_Result MDrv_HVD_EX_IgnorePicStructDisplay(MS_U32 u32Id, MS_U32 param);
1039 HVD_EX_Result MDrv_HVD_EX_InputPtsFreerunMode(MS_U32 u32Id, MS_U32 param);
1040 HVD_EX_Result MDrv_HVD_EX_ErrConcealStartSlice1stMB(MS_U32 u32Id, MS_U32 param);
1041 HVD_EX_Result MDrv_HVD_EX_SetExternalDSBuffer(MS_U32 u32Id, HVD_EX_ExternalDSBuf *pExternalBuf);
1042 HVD_EX_Result MDrv_HVD_EX_SetHVDColBBUMode(MS_U32 u32Id, MS_U8 bEnable);
1043 
1044 HVD_EX_Result MDrv_HVD_EX_CC_Init(MS_U32 u32Id);
1045 HVD_EX_Result MDrv_HVD_EX_CC_SetCfg(MS_U32 u32Id, MS_U8 u8Operation, MS_U16 u16BufferSize, MS_U8 u8CC608);
1046 HVD_EX_Result MDrv_HVD_EX_CC_Set_RB_StartAddr(MS_U32 u32Id, MS_U32 u32StartPAddress, MS_U8 u8CC608);
1047 HVD_EX_Result MDrv_HVD_EX_CC_SyncRB_RdAddr2WrAddr(MS_U32 u32Id, MS_U8 u8CC608);
1048 HVD_EX_Result MDrv_HVD_EX_CC_Adv_RB_ReadAddr(MS_U32 u32Id, MS_U32 u32EachPacketSize, MS_U8 u8CC608);
1049 HVD_EX_Result MDrv_HVD_EX_CC_DisableParsing(MS_U32 u32Id, MS_U8 u8CC608);
1050 HVD_EX_Result MDrv_HVD_EX_CC_GetInfo(MS_U32 u32Id, MS_U32 selector, MS_U8 type, MS_U32 *p1, MS_U32 *p2);
1051 MS_BOOL MDrv_HVD_EX_CC_IsHvdRstDone(MS_U32 u32Id, MS_U8 type);
1052 MS_U8 MDrv_HVD_EX_CC_GetOverflowStatus(MS_U32 u32Id, MS_U8 u8CC608);
1053 MS_U32 MDrv_HVD_EX_CC_Get_RB_WriteAddr(MS_U32 u32Id, MS_U8 u8CC608);
1054 MS_U32 MDrv_HVD_EX_CC_Get_RB_ReadAddr(MS_U32 u32Id, MS_U8 u8CC608);
1055 MS_BOOL MDrv_HVD_EX_CC_InfoEnhanceMode(MS_U32 u32Id, MS_BOOL bEnable);
1056 HVD_EX_Result MDrv_HVD_EX_AutoExhaustESMode(MS_U32 u32Id, MS_U32 u32ESbound);
1057 MS_U32 MDrv_HVD_EX_GetESBufferStatus(MS_U32 u32Id);
1058 HVD_EX_Result MDrv_HVD_EX_ReturnInvalidAFD(MS_U32 u32Id, MS_BOOL bEnable);
1059 HVD_EX_Result MDrv_HVD_EX_AVCForceBrokenByUs(MS_U32 u32Id, MS_BOOL bEnable);
1060 HVD_EX_Result MDrv_HVD_EX_ShowFirstFrameDirect(MS_U32 u32Id, MS_BOOL bEnable);
1061 HVD_EX_Result MDrv_HVD_EX_AVCResizeDosDispPendBuf(MS_U32 u32Id, MS_U32 u32Size);
1062 HVD_EX_Result MDrv_HVD_EX_SetMinTspSize(MS_U32 u32Id, MS_U32 u32Size);
1063 HVD_EX_Result MDrv_HVD_EX_SetDmxFrameRate(MS_U32 u32Id, MS_U32 u32Value);
1064 HVD_EX_Result MDrv_HVD_EX_SetDmxFrameRateBase(MS_U32 u32Id, MS_U32 u32Value);
1065 MS_BOOL MDrv_HVD_EX_GetSupport2ndMVOPInterface(void);
1066 MS_BOOL MDrv_HVD_EX_SetVPUSecureMode(MS_BOOL bEnable);
1067 HVD_EX_Result MDrv_HVD_EX_SetExternal_CC608_Buffer(MS_U32 u32Id, MS_U32 u32Addr, MS_U32 u32Len);
1068 HVD_EX_Result MDrv_HVD_EX_SetExternal_CC708_Buffer(MS_U32 u32Id, MS_U32 u32Addr, MS_U32 u32Len);
1069 HVD_EX_Result MDrv_HVD_EX_OnePendingBufferMode(MS_U32 u32Id,MS_BOOL bEnable);
1070 HVD_EX_Result MDrv_HVD_EX_TsInBbuMode(MS_U32 u32Id,MS_BOOL bEnable);
1071 HVD_EX_Result MDrv_HVD_EX_IapGnBufShareBWMode(MS_U32 u32Id,MS_BOOL bEnable, MS_U32 u32IapGnBufAddr, MS_U32 u32IapGnBufSize);
1072 HVD_EX_Result MDrv_HVD_EX_SetPTSUsecMode(MS_U32 u32Id, MS_BOOL bEnable);
1073 HVD_EX_Result MDrv_HVD_EX_Set_Err_Tolerance(MS_U32 u32Id, MS_U32 u32Arg);
1074 HVD_EX_Result MDrv_HVD_EX_PVRTimeShiftSeamlessMode(MS_U32 u32Id, MS_U8 u8Arg);
1075 MS_U8 MDrv_HVD_EX_GetDSBufMiuSelect(MS_U32 u32Id);
1076 void MDrv_HVD_EX_BBU_Proc(MS_U32 u32Id);
1077 void MDrv_HVD_EX_BBU_StopProc(MS_U32 u32Id);
1078 MS_BOOL MDrv_HVD_EX_CHIP_Capability(void* pHWCap);
1079 
1080 #else
1081 MS_BOOL MDrv_HVD_EX_LoadCodeInSecure(MS_U32 addr);
1082 MS_BOOL MDrv_HVD_EX_SetLockDownRegister(void* param);
1083 #endif
1084 
1085 #ifdef __cplusplus
1086 }
1087 #endif
1088 
1089 
1090 #endif // _DRV_HVD_H_
1091 
1092