xref: /utopia/UTPA2-700.0.x/modules/ve/hal/curry/ve/include/mhal_tvencoder.h (revision 53ee8cc121a030b8d368113ac3e966b4705770ef)
1*53ee8cc1Swenshuai.xi //<MStar Software>
2*53ee8cc1Swenshuai.xi //******************************************************************************
3*53ee8cc1Swenshuai.xi // MStar Software
4*53ee8cc1Swenshuai.xi // Copyright (c) 2010 - 2012 MStar Semiconductor, Inc. All rights reserved.
5*53ee8cc1Swenshuai.xi // All software, firmware and related documentation herein ("MStar Software") are
6*53ee8cc1Swenshuai.xi // intellectual property of MStar Semiconductor, Inc. ("MStar") and protected by
7*53ee8cc1Swenshuai.xi // law, including, but not limited to, copyright law and international treaties.
8*53ee8cc1Swenshuai.xi // Any use, modification, reproduction, retransmission, or republication of all
9*53ee8cc1Swenshuai.xi // or part of MStar Software is expressly prohibited, unless prior written
10*53ee8cc1Swenshuai.xi // permission has been granted by MStar.
11*53ee8cc1Swenshuai.xi //
12*53ee8cc1Swenshuai.xi // By accessing, browsing and/or using MStar Software, you acknowledge that you
13*53ee8cc1Swenshuai.xi // have read, understood, and agree, to be bound by below terms ("Terms") and to
14*53ee8cc1Swenshuai.xi // comply with all applicable laws and regulations:
15*53ee8cc1Swenshuai.xi //
16*53ee8cc1Swenshuai.xi // 1. MStar shall retain any and all right, ownership and interest to MStar
17*53ee8cc1Swenshuai.xi //    Software and any modification/derivatives thereof.
18*53ee8cc1Swenshuai.xi //    No right, ownership, or interest to MStar Software and any
19*53ee8cc1Swenshuai.xi //    modification/derivatives thereof is transferred to you under Terms.
20*53ee8cc1Swenshuai.xi //
21*53ee8cc1Swenshuai.xi // 2. You understand that MStar Software might include, incorporate or be
22*53ee8cc1Swenshuai.xi //    supplied together with third party`s software and the use of MStar
23*53ee8cc1Swenshuai.xi //    Software may require additional licenses from third parties.
24*53ee8cc1Swenshuai.xi //    Therefore, you hereby agree it is your sole responsibility to separately
25*53ee8cc1Swenshuai.xi //    obtain any and all third party right and license necessary for your use of
26*53ee8cc1Swenshuai.xi //    such third party`s software.
27*53ee8cc1Swenshuai.xi //
28*53ee8cc1Swenshuai.xi // 3. MStar Software and any modification/derivatives thereof shall be deemed as
29*53ee8cc1Swenshuai.xi //    MStar`s confidential information and you agree to keep MStar`s
30*53ee8cc1Swenshuai.xi //    confidential information in strictest confidence and not disclose to any
31*53ee8cc1Swenshuai.xi //    third party.
32*53ee8cc1Swenshuai.xi //
33*53ee8cc1Swenshuai.xi // 4. MStar Software is provided on an "AS IS" basis without warranties of any
34*53ee8cc1Swenshuai.xi //    kind. Any warranties are hereby expressly disclaimed by MStar, including
35*53ee8cc1Swenshuai.xi //    without limitation, any warranties of merchantability, non-infringement of
36*53ee8cc1Swenshuai.xi //    intellectual property rights, fitness for a particular purpose, error free
37*53ee8cc1Swenshuai.xi //    and in conformity with any international standard.  You agree to waive any
38*53ee8cc1Swenshuai.xi //    claim against MStar for any loss, damage, cost or expense that you may
39*53ee8cc1Swenshuai.xi //    incur related to your use of MStar Software.
40*53ee8cc1Swenshuai.xi //    In no event shall MStar be liable for any direct, indirect, incidental or
41*53ee8cc1Swenshuai.xi //    consequential damages, including without limitation, lost of profit or
42*53ee8cc1Swenshuai.xi //    revenues, lost or damage of data, and unauthorized system use.
43*53ee8cc1Swenshuai.xi //    You agree that this Section 4 shall still apply without being affected
44*53ee8cc1Swenshuai.xi //    even if MStar Software has been modified by MStar in accordance with your
45*53ee8cc1Swenshuai.xi //    request or instruction for your use, except otherwise agreed by both
46*53ee8cc1Swenshuai.xi //    parties in writing.
47*53ee8cc1Swenshuai.xi //
48*53ee8cc1Swenshuai.xi // 5. If requested, MStar may from time to time provide technical supports or
49*53ee8cc1Swenshuai.xi //    services in relation with MStar Software to you for your use of
50*53ee8cc1Swenshuai.xi //    MStar Software in conjunction with your or your customer`s product
51*53ee8cc1Swenshuai.xi //    ("Services").
52*53ee8cc1Swenshuai.xi //    You understand and agree that, except otherwise agreed by both parties in
53*53ee8cc1Swenshuai.xi //    writing, Services are provided on an "AS IS" basis and the warranty
54*53ee8cc1Swenshuai.xi //    disclaimer set forth in Section 4 above shall apply.
55*53ee8cc1Swenshuai.xi //
56*53ee8cc1Swenshuai.xi // 6. Nothing contained herein shall be construed as by implication, estoppels
57*53ee8cc1Swenshuai.xi //    or otherwise:
58*53ee8cc1Swenshuai.xi //    (a) conferring any license or right to use MStar name, trademark, service
59*53ee8cc1Swenshuai.xi //        mark, symbol or any other identification;
60*53ee8cc1Swenshuai.xi //    (b) obligating MStar or any of its affiliates to furnish any person,
61*53ee8cc1Swenshuai.xi //        including without limitation, you and your customers, any assistance
62*53ee8cc1Swenshuai.xi //        of any kind whatsoever, or any information; or
63*53ee8cc1Swenshuai.xi //    (c) conferring any license or right under any intellectual property right.
64*53ee8cc1Swenshuai.xi //
65*53ee8cc1Swenshuai.xi // 7. These terms shall be governed by and construed in accordance with the laws
66*53ee8cc1Swenshuai.xi //    of Taiwan, R.O.C., excluding its conflict of law rules.
67*53ee8cc1Swenshuai.xi //    Any and all dispute arising out hereof or related hereto shall be finally
68*53ee8cc1Swenshuai.xi //    settled by arbitration referred to the Chinese Arbitration Association,
69*53ee8cc1Swenshuai.xi //    Taipei in accordance with the ROC Arbitration Law and the Arbitration
70*53ee8cc1Swenshuai.xi //    Rules of the Association by three (3) arbitrators appointed in accordance
71*53ee8cc1Swenshuai.xi //    with the said Rules.
72*53ee8cc1Swenshuai.xi //    The place of arbitration shall be in Taipei, Taiwan and the language shall
73*53ee8cc1Swenshuai.xi //    be English.
74*53ee8cc1Swenshuai.xi //    The arbitration award shall be final and binding to both parties.
75*53ee8cc1Swenshuai.xi //
76*53ee8cc1Swenshuai.xi //******************************************************************************
77*53ee8cc1Swenshuai.xi //<MStar Software>
78*53ee8cc1Swenshuai.xi ////////////////////////////////////////////////////////////////////////////////
79*53ee8cc1Swenshuai.xi //
80*53ee8cc1Swenshuai.xi // Copyright (c) 2006-2008 MStar Semiconductor, Inc.
81*53ee8cc1Swenshuai.xi // All rights reserved.
82*53ee8cc1Swenshuai.xi //
83*53ee8cc1Swenshuai.xi // Unless otherwise stipulated in writing, any and all information contained
84*53ee8cc1Swenshuai.xi // herein regardless in any format shall remain the sole proprietary of
85*53ee8cc1Swenshuai.xi // MStar Semiconductor Inc. and be kept in strict confidence
86*53ee8cc1Swenshuai.xi // (��MStar Confidential Information��) by the recipient.
87*53ee8cc1Swenshuai.xi // Any unauthorized act including without limitation unauthorized disclosure,
88*53ee8cc1Swenshuai.xi // copying, use, reproduction, sale, distribution, modification, disassembling,
89*53ee8cc1Swenshuai.xi // reverse engineering and compiling of the contents of MStar Confidential
90*53ee8cc1Swenshuai.xi // Information is unlawful and strictly prohibited. MStar hereby reserves the
91*53ee8cc1Swenshuai.xi // rights to any and all damages, losses, costs and expenses resulting therefrom.
92*53ee8cc1Swenshuai.xi //
93*53ee8cc1Swenshuai.xi ////////////////////////////////////////////////////////////////////////////////
94*53ee8cc1Swenshuai.xi #ifndef _MHALTVENCODER_H
95*53ee8cc1Swenshuai.xi #define _MHALTVENCODER_H
96*53ee8cc1Swenshuai.xi 
97*53ee8cc1Swenshuai.xi #ifdef __cplusplus
98*53ee8cc1Swenshuai.xi extern "C"
99*53ee8cc1Swenshuai.xi {
100*53ee8cc1Swenshuai.xi #endif
101*53ee8cc1Swenshuai.xi 
102*53ee8cc1Swenshuai.xi #include "MsCommon.h"
103*53ee8cc1Swenshuai.xi 
104*53ee8cc1Swenshuai.xi //-------------------------------------------------------------------------------------------------
105*53ee8cc1Swenshuai.xi //  Macro and Define
106*53ee8cc1Swenshuai.xi //-------------------------------------------------------------------------------------------------
107*53ee8cc1Swenshuai.xi //Video Encoder Capability
108*53ee8cc1Swenshuai.xi #define VE_SUPPORTED            TRUE
109*53ee8cc1Swenshuai.xi #define ENABLE_VE_SUBTITLE      TRUE
110*53ee8cc1Swenshuai.xi //Feature for: ve support isr from TVS(VE Source), and HW will report current VE Write frame index
111*53ee8cc1Swenshuai.xi #define VE_TVS_ISR_SUPPORT      FALSE
112*53ee8cc1Swenshuai.xi 
113*53ee8cc1Swenshuai.xi //Feature: predownscaling before TVS
114*53ee8cc1Swenshuai.xi #define VE_PRESCALE_SUPPORT     FALSE
115*53ee8cc1Swenshuai.xi 
116*53ee8cc1Swenshuai.xi #define ENABLE_VE_FIELD_INV       1
117*53ee8cc1Swenshuai.xi 
118*53ee8cc1Swenshuai.xi #define VE_DE_HEND_MASK 0x1FFF //0x3B13
119*53ee8cc1Swenshuai.xi #define VE_DE_VEND_MASK 0xFFF  //0x3B15
120*53ee8cc1Swenshuai.xi 
121*53ee8cc1Swenshuai.xi #define VE_MIU_WIDTH 32 //32bytes,256bits
122*53ee8cc1Swenshuai.xi 
123*53ee8cc1Swenshuai.xi #define BYTE_PER_WORD           8
124*53ee8cc1Swenshuai.xi 
125*53ee8cc1Swenshuai.xi //Video Encoder Capability
126*53ee8cc1Swenshuai.xi #define VE_SUPPORT_SOURCE_SCALER_OP 0
127*53ee8cc1Swenshuai.xi 
128*53ee8cc1Swenshuai.xi //VE customized table max size
129*53ee8cc1Swenshuai.xi #define VE_CUSTBL_MAX_SIZE 64 //4bytes * 16sets (include end of table)
130*53ee8cc1Swenshuai.xi 
131*53ee8cc1Swenshuai.xi //#define REG_CKG_VE_IN           0x1E38
132*53ee8cc1Swenshuai.xi #define CKG_VE_IN_GATED         BIT(0)
133*53ee8cc1Swenshuai.xi #define CKG_VE_IN_INVERT        BIT(1)
134*53ee8cc1Swenshuai.xi #define CKG_VE_IN_MASK          (BIT(5) | BIT(4) | BIT(3) | BIT(2))
135*53ee8cc1Swenshuai.xi #define CKG_VE_IN_ODCLK         (0 << 2)
136*53ee8cc1Swenshuai.xi #define CKG_VE_IN_EDCLK         (2 << 2)
137*53ee8cc1Swenshuai.xi #define CKG_VE_IN_FCLK          (4 << 2)
138*53ee8cc1Swenshuai.xi 
139*53ee8cc1Swenshuai.xi #define VE_NTSC_FRAME_SIZE  ((MS_U32)(720ul * 480ul)>>2) // 720*480*16bits/64bits
140*53ee8cc1Swenshuai.xi #define VE_PAL_FRAME_SIZE   ((MS_U32)(720ul * 576ul)>>2) // 720*576*16bits/64bits
141*53ee8cc1Swenshuai.xi 
142*53ee8cc1Swenshuai.xi  //VE out
143*53ee8cc1Swenshuai.xi #define VE_OUT_CVBS_YCC         0x00
144*53ee8cc1Swenshuai.xi #define VE_OUT_CVBS_YCbCr       0x01
145*53ee8cc1Swenshuai.xi #define VE_OUT_CVBS_RGB         0x02
146*53ee8cc1Swenshuai.xi #define VE_OUT_NONE             0xFF
147*53ee8cc1Swenshuai.xi 
148*53ee8cc1Swenshuai.xi #define VE_V_SCALE_DOWN_RATIO(IN, OUT)  (((MS_U32)(OUT) * 2048ul / (MS_U32)(IN))+1)
149*53ee8cc1Swenshuai.xi #define VE_H_SCALE_DOWN_RATIO(IN, OUT)  ((MS_U32)(OUT) * 2048ul / (MS_U32)(IN))
150*53ee8cc1Swenshuai.xi #define VE_V_SCALE_UP_RATIO(IN, OUT)  ((MS_U32)(IN - 1) * 0x10000ul / (MS_U32)(OUT - 1))
151*53ee8cc1Swenshuai.xi #define VE_H_SCALE_UP_RATIO(IN, OUT)  ((MS_U32)(IN - 1) * 0x10000ul/ (MS_U32)(OUT - 1))
152*53ee8cc1Swenshuai.xi 
153*53ee8cc1Swenshuai.xi typedef enum
154*53ee8cc1Swenshuai.xi {
155*53ee8cc1Swenshuai.xi     EN_VE_DEMODE         = 0x01,
156*53ee8cc1Swenshuai.xi     EN_VE_CCIR656_IN     = 0x02,
157*53ee8cc1Swenshuai.xi     EN_VE_RGB_IN         = 0x04,
158*53ee8cc1Swenshuai.xi     EN_VE_INVERSE_HSYNC  = 0x08,
159*53ee8cc1Swenshuai.xi }EN_VE_DISPLAY_STATUS;
160*53ee8cc1Swenshuai.xi 
161*53ee8cc1Swenshuai.xi //MV Type
162*53ee8cc1Swenshuai.xi typedef enum
163*53ee8cc1Swenshuai.xi {
164*53ee8cc1Swenshuai.xi     MS_VE_MV_NTSC_START = 0,
165*53ee8cc1Swenshuai.xi     MS_VE_MV_NTSC_TYPE1 = MS_VE_MV_NTSC_START,
166*53ee8cc1Swenshuai.xi     MS_VE_MV_NTSC_TYPE2,
167*53ee8cc1Swenshuai.xi     MS_VE_MV_NTSC_TYPE3,
168*53ee8cc1Swenshuai.xi     MS_VE_MV_NTSC_TEST_N01,
169*53ee8cc1Swenshuai.xi     MS_VE_MV_NTSC_TEST_N02,
170*53ee8cc1Swenshuai.xi     MS_VE_MV_NTSC_TYPE2_TTX,
171*53ee8cc1Swenshuai.xi     MS_VE_MV_NTSC_TEST_N01_TTX,
172*53ee8cc1Swenshuai.xi     MS_VE_MV_PAL_START = 0x10,
173*53ee8cc1Swenshuai.xi     MS_VE_MV_PAL_TYPE1 = MS_VE_MV_PAL_START,
174*53ee8cc1Swenshuai.xi     MS_VE_MV_PAL_TYPE2,
175*53ee8cc1Swenshuai.xi     MS_VE_MV_PAL_TYPE3,
176*53ee8cc1Swenshuai.xi     MS_VE_MV_PAL_TEST_P01,
177*53ee8cc1Swenshuai.xi     MS_VE_MV_PAL_TEST_P02,
178*53ee8cc1Swenshuai.xi     MS_VE_MV_PAL_TYPE2_TTX,
179*53ee8cc1Swenshuai.xi     MS_VE_MV_PAL_TEST_P01_TTX,
180*53ee8cc1Swenshuai.xi } MS_VE_MV_TYPE;
181*53ee8cc1Swenshuai.xi 
182*53ee8cc1Swenshuai.xi /*
183*53ee8cc1Swenshuai.xi  * This Enum type was defined base on DCS for composite (CVBS) and component outputs
184*53ee8cc1Swenshuai.xi  */
185*53ee8cc1Swenshuai.xi typedef enum
186*53ee8cc1Swenshuai.xi {
187*53ee8cc1Swenshuai.xi     MS_VE_DCS_TYPE_MIN = 0,
188*53ee8cc1Swenshuai.xi 
189*53ee8cc1Swenshuai.xi     MS_VE_DCS_CVBS_MIN = MS_VE_DCS_TYPE_MIN,
190*53ee8cc1Swenshuai.xi     MS_VE_DCS_CVBS_NTSC = MS_VE_DCS_CVBS_MIN,
191*53ee8cc1Swenshuai.xi     MS_VE_DCS_CVBS_PAL,
192*53ee8cc1Swenshuai.xi     MS_VE_DCS_CVBS_MAX = MS_VE_DCS_CVBS_PAL,
193*53ee8cc1Swenshuai.xi 
194*53ee8cc1Swenshuai.xi     MS_VE_DCS_COMPONENT_MIN = 0x10,
195*53ee8cc1Swenshuai.xi     MS_VE_DCS_COMPONENT_480I = MS_VE_DCS_COMPONENT_MIN,
196*53ee8cc1Swenshuai.xi     MS_VE_DCS_COMPONENT_480P,
197*53ee8cc1Swenshuai.xi     MS_VE_DCS_COMPONENT_576I,
198*53ee8cc1Swenshuai.xi     MS_VE_DCS_COMPONENT_576P,
199*53ee8cc1Swenshuai.xi     MS_VE_DCS_COMPONENT_720P_24,
200*53ee8cc1Swenshuai.xi     MS_VE_DCS_COMPONENT_720P_25,
201*53ee8cc1Swenshuai.xi     MS_VE_DCS_COMPONENT_720P_30,
202*53ee8cc1Swenshuai.xi     MS_VE_DCS_COMPONENT_720P_50,
203*53ee8cc1Swenshuai.xi     MS_VE_DCS_COMPONENT_720P_60,
204*53ee8cc1Swenshuai.xi     MS_VE_DCS_COMPONENT_1080I_50,
205*53ee8cc1Swenshuai.xi     MS_VE_DCS_COMPONENT_1080I_60,
206*53ee8cc1Swenshuai.xi     MS_VE_DCS_COMPONENT_1080P_24,
207*53ee8cc1Swenshuai.xi     MS_VE_DCS_COMPONENT_1080P_25,
208*53ee8cc1Swenshuai.xi     MS_VE_DCS_COMPONENT_1080P_30,
209*53ee8cc1Swenshuai.xi     MS_VE_DCS_COMPONENT_1080P_50,
210*53ee8cc1Swenshuai.xi     MS_VE_DCS_COMPONENT_1080P_60,
211*53ee8cc1Swenshuai.xi     MS_VE_DCS_COMPONENT_MAX = MS_VE_DCS_COMPONENT_1080P_60,
212*53ee8cc1Swenshuai.xi 
213*53ee8cc1Swenshuai.xi     MS_VE_DCS_TYPE_MAX = MS_VE_DCS_COMPONENT_MAX,
214*53ee8cc1Swenshuai.xi } MS_VE_DCS_TYPE;
215*53ee8cc1Swenshuai.xi 
216*53ee8cc1Swenshuai.xi //VE capability struct
217*53ee8cc1Swenshuai.xi typedef struct
218*53ee8cc1Swenshuai.xi {
219*53ee8cc1Swenshuai.xi     MS_BOOL bSupport_UpScale;
220*53ee8cc1Swenshuai.xi     MS_BOOL bSupport_CropMode;
221*53ee8cc1Swenshuai.xi     MS_BOOL bSupport_DolbyVerifier;
222*53ee8cc1Swenshuai.xi }MS_VE_Cap;
223*53ee8cc1Swenshuai.xi 
224*53ee8cc1Swenshuai.xi typedef enum
225*53ee8cc1Swenshuai.xi {
226*53ee8cc1Swenshuai.xi     MS_VE_DRAM_FORMAT_Y8C8 = 0,
227*53ee8cc1Swenshuai.xi     MS_VE_DRAM_FORMAT_Y8C8M4,
228*53ee8cc1Swenshuai.xi }MS_VE_DRAM_FORMAT;
229*53ee8cc1Swenshuai.xi 
230*53ee8cc1Swenshuai.xi typedef struct
231*53ee8cc1Swenshuai.xi {
232*53ee8cc1Swenshuai.xi     MS_U8   u8CPC[2];
233*53ee8cc1Swenshuai.xi     MS_U8   u8CPS[34];
234*53ee8cc1Swenshuai.xi }MS_VE_MV_ByteInfo;
235*53ee8cc1Swenshuai.xi 
236*53ee8cc1Swenshuai.xi typedef struct
237*53ee8cc1Swenshuai.xi {
238*53ee8cc1Swenshuai.xi     //Versioning
239*53ee8cc1Swenshuai.xi     MS_U32  u32VE_MV_BitControl_version;     ///<Version of current structure.
240*53ee8cc1Swenshuai.xi     MS_U32  u32VE_MV_BitControl_Length;      ///<Length of this structure, u32VE_MV_BitControl_Length=sizeof(MS_VE_MV_BitControl)
241*53ee8cc1Swenshuai.xi     //Data
242*53ee8cc1Swenshuai.xi     MS_BOOL bIsYPbPr;
243*53ee8cc1Swenshuai.xi     union
244*53ee8cc1Swenshuai.xi     {
245*53ee8cc1Swenshuai.xi         MS_U8              u8MV_ByteInfo[36];
246*53ee8cc1Swenshuai.xi         MS_VE_MV_ByteInfo  MV_ByteInfo;
247*53ee8cc1Swenshuai.xi     }__attribute__ ((__packed__)) ;
248*53ee8cc1Swenshuai.xi }MS_VE_MV_BitControl;
249*53ee8cc1Swenshuai.xi 
250*53ee8cc1Swenshuai.xi //-------------------------------------------------------------------------------------------------
251*53ee8cc1Swenshuai.xi //  Function and Variable
252*53ee8cc1Swenshuai.xi //-------------------------------------------------------------------------------------------------
253*53ee8cc1Swenshuai.xi 
254*53ee8cc1Swenshuai.xi void MDrv_VE_PowerOn(void);
255*53ee8cc1Swenshuai.xi void MDrv_VE_PowerOff(void);
256*53ee8cc1Swenshuai.xi void Hal_VE_set_fix_color_out(MS_BOOL ben, MS_U8 u8color_y, MS_U8 u8color_cb, MS_U8 u8color_cr);
257*53ee8cc1Swenshuai.xi 
258*53ee8cc1Swenshuai.xi void Hal_VE_set_wss_data(MS_BOOL ben, MS_U16 u16wssdata);
259*53ee8cc1Swenshuai.xi MS_U16 Hal_VE_get_wss_data(void);
260*53ee8cc1Swenshuai.xi void Hal_VE_set_color_convert(MS_VE_VIDEOSYS VideoSys, MS_U8 u8DACType);
261*53ee8cc1Swenshuai.xi 
262*53ee8cc1Swenshuai.xi void Hal_VE_init(void);
263*53ee8cc1Swenshuai.xi MS_BOOL Hal_VE_set_output_video_std(MS_VE_VIDEOSYS VideoSystem);
264*53ee8cc1Swenshuai.xi MS_VE_VIDEOSYS Hal_VE_Get_Output_Video_Std(void);
265*53ee8cc1Swenshuai.xi 
266*53ee8cc1Swenshuai.xi MS_BOOL Hal_VE_SetCusTable(MS_VE_VIDEOSYS VideoSystem, MS_U8* pu8Tbl, MS_U16 u16size);
267*53ee8cc1Swenshuai.xi void Hal_VE_EnableCusTable(MS_BOOL bEnable);
268*53ee8cc1Swenshuai.xi 
269*53ee8cc1Swenshuai.xi void Hal_VE_set_capture_window(MS_U16 u16hstart, MS_U16 u16hend, MS_U16 u16vstart, MS_U16 u16vend);
270*53ee8cc1Swenshuai.xi void Hal_VE_set_hsync_inverse(MS_BOOL bEn);
271*53ee8cc1Swenshuai.xi void Hal_VE_set_cvbs_buffer_out(MS_U16 u16chnl, MS_U16 u16mux, MS_U16 u16clamp, MS_U16 u16test);
272*53ee8cc1Swenshuai.xi void Hal_VE_set_frc(MS_BOOL bfulldrop, MS_U32 u32fullnum, MS_U32 u32emptynum, MS_BOOL binterlace, MS_BOOL b3FrameMode);
273*53ee8cc1Swenshuai.xi void Hal_VE_set_field_inverse(MS_BOOL ben);
274*53ee8cc1Swenshuai.xi void Hal_VE_set_ccir656_out_pal(MS_BOOL bpal);
275*53ee8cc1Swenshuai.xi void Hal_VE_sofeware_reset(MS_BOOL ben);
276*53ee8cc1Swenshuai.xi void Hal_VE_set_vbi(MS_BOOL ben);
277*53ee8cc1Swenshuai.xi void Hal_VE_set_reg_load(MS_BOOL ben);
278*53ee8cc1Swenshuai.xi void Hal_VE_set_ctrl(MS_U16 u16enval);
279*53ee8cc1Swenshuai.xi void Hal_VE_set_h_scaling(MS_BOOL ben, MS_U16 u16ratio);
280*53ee8cc1Swenshuai.xi void Hal_VE_set_v_scaling(MS_BOOL ben, MS_U16 u16ratio);
281*53ee8cc1Swenshuai.xi void Hal_VE_set_v_scaling_Traditional(MS_BOOL ben, MS_U16 u16ratio);
282*53ee8cc1Swenshuai.xi #define Hal_VE_set_v_initfactor(args...)
283*53ee8cc1Swenshuai.xi void Hal_VE_set_out_sel(MS_U8 u8out_sel);
284*53ee8cc1Swenshuai.xi void Hal_VE_set_source_sync_inv(MS_U8 u8val, MS_U8 u8Mask);
285*53ee8cc1Swenshuai.xi void Hal_VE_set_sog(MS_BOOL ben);
286*53ee8cc1Swenshuai.xi void Hal_VE_set_inputsource(PMS_VE_InputSrc_Info pInputSrcInfo);
287*53ee8cc1Swenshuai.xi void Hal_VE_set_mux(MS_U8 u8clk, MS_U8 u8data);
288*53ee8cc1Swenshuai.xi void Hal_VE_set_rgb_in(MS_BOOL ben);
289*53ee8cc1Swenshuai.xi void Hal_VE_set_ccir656_in(MS_BOOL ben);
290*53ee8cc1Swenshuai.xi void Hal_VE_set_source_interlace(MS_BOOL ben);
291*53ee8cc1Swenshuai.xi void Hal_VE_set_ve_on_off(MS_BOOL ben);
292*53ee8cc1Swenshuai.xi void Hal_VE_set_clk_on_off(MS_BOOL ben);
293*53ee8cc1Swenshuai.xi void Hal_VE_set_blackscreen(MS_BOOL ben);
294*53ee8cc1Swenshuai.xi MS_BOOL Hal_VE_is_blackscreen_enabled(void);
295*53ee8cc1Swenshuai.xi void Hal_VE_init_riu_base(MS_VIRT virtRiu_Base);
296*53ee8cc1Swenshuai.xi void Hal_VE_EnableTtx(MS_BOOL bEnable);
297*53ee8cc1Swenshuai.xi void Hal_VE_Set_ttx_Buffer(MS_PHY phyStartAddr, MS_U32 u32Size);
298*53ee8cc1Swenshuai.xi void Hal_VE_Clear_ttxReadDoneStatus(void);
299*53ee8cc1Swenshuai.xi MS_BOOL Hal_VE_Get_ttxReadDoneStatus(void);
300*53ee8cc1Swenshuai.xi void Hal_VE_Set_VbiTtxActiveLines(MS_U8 u8LinePerField);
301*53ee8cc1Swenshuai.xi void Hal_VE_SetVbiTtxRange(MS_U16 odd_start, MS_U16 odd_end,
302*53ee8cc1Swenshuai.xi                          MS_U16 even_start, MS_U16 enen_end);
303*53ee8cc1Swenshuai.xi void Hal_VE_Set_VbiTtxActiveLinesBitmap(MS_U32 u32Bitmap);
304*53ee8cc1Swenshuai.xi 
305*53ee8cc1Swenshuai.xi void Hal_VE_EnableCcSw(MS_BOOL bEnable);
306*53ee8cc1Swenshuai.xi void Hal_VE_SetCcRange(MS_U16 odd_start, MS_U16 odd_end, MS_U16 even_start, MS_U16 enen_end);
307*53ee8cc1Swenshuai.xi void Hal_VE_SendCcData(MS_BOOL bIsOdd, MS_U16 data);
308*53ee8cc1Swenshuai.xi 
309*53ee8cc1Swenshuai.xi void Hal_VE_Set_winodw_offset(MS_PHY phyOffsetAddr);
310*53ee8cc1Swenshuai.xi MS_U32 Hal_VE_ConvertARGB2YUV(MS_U32 u32aRGB);
311*53ee8cc1Swenshuai.xi VE_Result Hal_VE_SetFrameColor(MS_U32 u32aRGB);
312*53ee8cc1Swenshuai.xi void Hal_VE_Set_OSD(MS_BOOL bEnable);
313*53ee8cc1Swenshuai.xi VE_Result Hal_VE_Set_OSDLayer(MS_VE_OSD_LAYER_SEL eVideoOSDLayer);
314*53ee8cc1Swenshuai.xi MS_VE_OSD_LAYER_SEL Hal_VE_Get_OSDLayer(void);
315*53ee8cc1Swenshuai.xi VE_Result Hal_VE_Set_VideoAlpha(MS_U8 u8Val);
316*53ee8cc1Swenshuai.xi VE_Result Hal_VE_Get_VideoAlpha(MS_U8 *pu8Val);
317*53ee8cc1Swenshuai.xi void Hal_VE_Set_TestPattern(MS_BOOL ben);
318*53ee8cc1Swenshuai.xi 
319*53ee8cc1Swenshuai.xi void Hal_VE_W2BYTE_MSK(MS_U32 u32Reg, MS_U16 u16Val, MS_U16 u16Mask);
320*53ee8cc1Swenshuai.xi MS_U16 Hal_VE_R2BYTE_MSK(MS_U32 u32Reg, MS_U16 u16Mask);
321*53ee8cc1Swenshuai.xi void Hal_VE_CCIR_PAD_Sel(void);
322*53ee8cc1Swenshuai.xi 
323*53ee8cc1Swenshuai.xi //Dump Table
324*53ee8cc1Swenshuai.xi void Hal_VE_DumpTable(MS_U8 *pVeTable, MS_U8 u8TableType);
325*53ee8cc1Swenshuai.xi 
326*53ee8cc1Swenshuai.xi //Set MV
327*53ee8cc1Swenshuai.xi VE_Result Hal_VE_SetMV(MS_BOOL bEnable, MS_VE_MV_TYPE eMvType);
328*53ee8cc1Swenshuai.xi VE_Result Hal_VE_SetMV_BitControl(MS_BOOL bEnable, MS_VE_MV_BitControl MV_BitControl_Data);
329*53ee8cc1Swenshuai.xi 
330*53ee8cc1Swenshuai.xi //Set DCS
331*53ee8cc1Swenshuai.xi VE_Result Hal_VE_DCS_SetType(MS_BOOL bEnable, MS_VE_DCS_TYPE eDCSType);
332*53ee8cc1Swenshuai.xi VE_Result Hal_VE_DCS_SetActivationKey(MS_U8 *pu8ActivationKeyTbl, MS_U8 u8ActivationKeyTblSize);
333*53ee8cc1Swenshuai.xi 
334*53ee8cc1Swenshuai.xi MS_BOOL Hal_VE_DisableRegWrite_GetCaps(void);
335*53ee8cc1Swenshuai.xi 
336*53ee8cc1Swenshuai.xi // show internal color bar
337*53ee8cc1Swenshuai.xi void Hal_VE_ShowColorBar(MS_BOOL bEnable);
338*53ee8cc1Swenshuai.xi VE_Result Hal_VE_AdjustPositionBase(MS_S32 s32WAddrAdjustment, MS_S32 s32RAddrAdjustment);
339*53ee8cc1Swenshuai.xi void Hal_VE_set_field_size(MS_U16 u16FieldSize);
340*53ee8cc1Swenshuai.xi void Hal_VE_SelMIU(MS_BOOL bMIU1);
341*53ee8cc1Swenshuai.xi void Hal_VE_SetMemAddr(MS_PHY *pphyRDAddress, MS_PHY *pphyWRAddress);
342*53ee8cc1Swenshuai.xi VE_Result HAL_VE_SetFrameLock(MS_U32 u32IDclk, MS_U32 u32ODclk, MS_U32 u32InitPll, MS_BOOL bEnable);
343*53ee8cc1Swenshuai.xi VE_Result Hal_VE_GetCaps(MS_VE_Cap *cap);
344*53ee8cc1Swenshuai.xi void Hal_VE_set_h_upscaling(MS_BOOL ben, MS_U32 u32ratio);
345*53ee8cc1Swenshuai.xi void Hal_VE_set_v_upscaling(MS_BOOL ben, MS_U32 u32ratio);
346*53ee8cc1Swenshuai.xi MS_VE_DRAM_FORMAT Hal_VE_Get_DRAM_Format(void);
347*53ee8cc1Swenshuai.xi void Hal_VE_Set_DRAM_Format(MS_VE_DRAM_FORMAT fmt);
348*53ee8cc1Swenshuai.xi MS_U8 Hal_VE_Get_Pack_Num_Per_Line(void);
349*53ee8cc1Swenshuai.xi void Hal_VE_Set_Pack_Num_Per_Line(MS_U8 PackNumPerLine);
350*53ee8cc1Swenshuai.xi MS_U16 Hal_VE_Get_Field_Line_Number(void);
351*53ee8cc1Swenshuai.xi void Hal_VE_Set_Field_Line_Number(MS_U16 FieldLineNumber);
352*53ee8cc1Swenshuai.xi void Hal_VE_Set_Crop_OSD_Offset(MS_U16 hstart, MS_U16 vstart);
353*53ee8cc1Swenshuai.xi void Hal_VE_Set_VScale_Output_Line_Number(MS_U16 line);
354*53ee8cc1Swenshuai.xi void Hal_VE_Set_HScale_Output_Line_Number(MS_U16 line);
355*53ee8cc1Swenshuai.xi VE_Result Hal_VE_Adjust_FrameStart(MS_S16 pixel_offset);
356*53ee8cc1Swenshuai.xi VE_Result Hal_VE_set_wss525_data(MS_BOOL ben, MS_U32 u32wssdata);
357*53ee8cc1Swenshuai.xi MS_U32 Hal_VE_get_wss525_data(void);
358*53ee8cc1Swenshuai.xi void Hal_VE_OnOffWSS(MS_BOOL ben);
359*53ee8cc1Swenshuai.xi MS_BOOL Hal_VE_GetWSSStatus(void);
360*53ee8cc1Swenshuai.xi void Hal_VE_OnOffMV(MS_BOOL ben);
361*53ee8cc1Swenshuai.xi MS_BOOL Hal_VE_GetMVStatus(void);
362*53ee8cc1Swenshuai.xi void Hal_VE_OnOffDCS(MS_BOOL ben);
363*53ee8cc1Swenshuai.xi MS_BOOL Hal_VE_GetDCSStatus(void);
364*53ee8cc1Swenshuai.xi void Hal_VE_set_dolby_verifier_addr(MS_PHY u32Addr);
365*53ee8cc1Swenshuai.xi MS_U32 Hal_VE_get_dolby_verifier_buf_size(void);
366*53ee8cc1Swenshuai.xi #define Hal_VE_Set_PreHSD(args...)
367*53ee8cc1Swenshuai.xi VE_Result Hal_VE_ReloadSetting(void);
368*53ee8cc1Swenshuai.xi 
369*53ee8cc1Swenshuai.xi #ifdef __cplusplus
370*53ee8cc1Swenshuai.xi }
371*53ee8cc1Swenshuai.xi #endif
372*53ee8cc1Swenshuai.xi 
373*53ee8cc1Swenshuai.xi #endif
374*53ee8cc1Swenshuai.xi 
375