xref: /utopia/UTPA2-700.0.x/projects/tmplib/include/apiXC_Ace.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   apiXC_ACE.h
98 /// @brief  ACE API layer Interface
99 /// @author MStar Semiconductor Inc.
100 /// CL 227231+:In box case, there is no need to do YUV2RGB transform.
101 ///////////////////////////////////////////////////////////////////////////////////////////////////
102 
103 /*! \defgroup Video Video modules
104 
105  *  \defgroup XC_BE XC_BE modules
106  *  \ingroup Video
107 
108     ACE is used for    \n
109     1. control the picture quality,include brightness, contrast, CSC ,etc.\n
110     2. MWE function.\n
111     For more information,see \link ACE ACE interface (apiXC_ACE.h) \endlink
112 
113  *  \defgroup ACE ACE interface (apiXC_ACE.h)
114  *  \ingroup XC_BE
115 
116     ACE is used for
117 
118     1.control the picture quality,include brightness, contrast, CSC ,etc.
119     2.MWE function.
120 
121  *  \defgroup ACE_INIT ACE init control
122  *  \ingroup ACE
123 
124  *! \defgroup ACE_FEATURE ACE feature operation
125  *  \ingroup ACE
126 
127  *! \defgroup ACE_INFO ACE Infomation pool
128  *  \ingroup ACE
129 
130  *! \defgroup ACE_ToBeModified ACE api to be modified
131  *  \ingroup ACE
132 
133  *! \defgroup ACE_ToBeRemove ACE api to be removed
134  *  \ingroup ACE
135  */
136 
137 #ifndef _API_XC_ACE_H_
138 #define _API_XC_ACE_H_
139 
140 #include "MsDevice.h"
141 #include "MsCommon.h"
142 
143 #ifdef __cplusplus
144 extern "C"
145 {
146 #endif
147 
148 //-------------------------------------------------------------------------------------------------
149 //  Macro and Define
150 //-------------------------------------------------------------------------------------------------
151 
152 //-------------------------------------------------------------------------------------------------
153 //  Type and Structure
154 //-------------------------------------------------------------------------------------------------
155 #define MSIF_ACE_LIB_CODE               {'A','C','E','_'}
156 #define MSIF_ACE_LIBVER                 {'0','0'}
157 #define MSIF_ACE_BUILDNUM               {'5','9'}
158 #define MSIF_ACE_CHANGELIST             {'0','0','6','2','1','0','5','3'}
159 #define XC_ACE_API_VERSION              /* Character String for DRV/API version             */  \
160     MSIF_TAG,                           /* 'MSIF'                                           */  \
161     MSIF_CLASS,                         /* '00'                                             */  \
162     MSIF_CUS,                           /* 0x0000                                           */  \
163     MSIF_MOD,                           /* 0x0000                                           */  \
164     MSIF_CHIP,                                                                                  \
165     MSIF_CPU,                                                                                   \
166     MSIF_ACE_LIB_CODE,                  /* IP__                                             */  \
167     MSIF_ACE_LIBVER,                    /* 0.0 ~ Z.Z                                        */  \
168     MSIF_ACE_BUILDNUM,                  /* 00 ~ 99                                          */  \
169     MSIF_ACE_CHANGELIST,                /* CL#                                              */  \
170     MSIF_OS
171 
172 
173 #define XC_ACE_HDR_VERSION  1
174 
175 /*!
176    The color information setting.
177 */
178 typedef enum
179 {
180     /// Version
181     E_XC_ACE_INFO_TYPE_VERSION,
182     /// Contrast
183     E_XC_ACE_INFO_TYPE_CONTRAST,
184     /// R Gain
185     E_XC_ACE_INFO_TYPE_R_GAIN,
186     /// G Gain
187     E_XC_ACE_INFO_TYPE_G_GAIN,
188     /// B Gain
189     E_XC_ACE_INFO_TYPE_B_GAIN,
190     /// Saturation
191     E_XC_ACE_INFO_TYPE_SATURATION,
192     /// Hue
193     E_XC_ACE_INFO_TYPE_HUE,
194     /// Color correction XY R
195     E_XC_ACE_INFO_TYPE_COLOR_CORRECTION_XY_R,
196     /// Color correction XY G
197     E_XC_ACE_INFO_TYPE_COLOR_CORRECTION_XY_G,
198     /// Color correction XY B
199     E_XC_ACE_INFO_TYPE_COLOR_CORRECTION_XY_B,
200     /// Color correction Offset R
201     E_XC_ACE_INFO_TYPE_COLOR_CORRECTION_OFFSET_R,
202     /// Color correction Offset G
203     E_XC_ACE_INFO_TYPE_COLOR_CORRECTION_OFFSET_G,
204     /// Color correction Offset B
205     E_XC_ACE_INFO_TYPE_COLOR_CORRECTION_OFFSET_B,
206     /// R Brightness
207     E_XC_ACE_INFO_TYPE_BRIGHTNESS_R,
208     /// G Brightness
209     E_XC_ACE_INFO_TYPE_BRIGHTNESS_G,
210     /// B Brightness
211     E_XC_ACE_INFO_TYPE_BRIGHTNESS_B,
212 
213     /// Dummy
214     E_XC_ACE_INFO_TYPE_DUMMY
215 } E_XC_ACE_INFOTYPE;
216 
217 /*!
218     The convert method of YUV to RGB
219 */
220 typedef enum
221 {
222     /// YUV to RGB matrix - Use Std CSCM for SDTV
223     E_XC_ACE_YUV_TO_RGB_MATRIX_SDTV,
224     /// YUV to RGB matrix - Use Std CSCM for HDTV
225     E_XC_ACE_YUV_TO_RGB_MATRIX_HDTV,
226     /// Use user define CSCM, specified by tUserYVUtoRGBMatrix
227     E_XC_ACE_YUV_TO_RGB_MATRIX_USER,
228 } E_XC_ACE_YUVTORGBTYPE;
229 
230 /*!
231    The Effect Settings of Multi Window
232 */
233 typedef enum
234 {
235     /// off
236     E_XC_ACE_MWE_MODE_OFF,
237     /// H split, reference window at right side,default
238     E_XC_ACE_MWE_MODE_H_SPLIT,
239     /// Move
240     E_XC_ACE_MWE_MODE_MOVE,
241     /// Zoom
242     E_XC_ACE_MWE_MODE_ZOOM,
243     /// H Scan
244     E_XC_ACE_MWE_MODE_H_SCAN,
245     /// H split, reference window at left side
246     E_XC_ACE_MWE_MODE_H_SPLIT_LEFT,
247     /// The number of Scaler ACE MWE functoin
248     E_XC_ACE_MWE_MODE_NUMS,
249 } E_XC_ACE_MWE_FUNC;
250 
251 /*!
252    The Result of XC_ACE function call.
253 */
254 typedef enum
255 {
256     /// fail
257     E_XC_ACE_FAIL = 0,
258     /// ok
259     E_XC_ACE_OK = 1,
260     /// get base address failed when initialize panel driver
261     E_XC_ACE_GET_BASEADDR_FAIL,
262     /// obtain mutex timeout when calling this function
263     E_XC_ACE_OBTAIN_RESOURCE_FAIL,
264 } E_XC_ACE_RESULT;
265 
266 
267 typedef enum
268 {
269     E_XC_ACE_MWE_MIRROR_NORMAL,
270     E_XC_ACE_MWE_MIRROR_H_ONLY,
271     E_XC_ACE_MWE_MIRROR_V_ONLY,
272     E_XC_ACE_MWE_MIRROR_HV,
273     E_XC_ACE_MWE_MIRROR_MAX,
274 }E_XC_ACE_MWE_MIRROR_TYPE;
275 
276 /*!
277    obosolte!! use XC_ACE_color_temp_ex2 instead
278 */
279 typedef struct
280 {
281     /// red color offset
282     MS_U8 cRedOffset;
283     /// green color offset
284     MS_U8 cGreenOffset;
285     /// blue color offset
286     MS_U8 cBlueOffset;
287 
288     /// red color
289     MS_U8 cRedColor;
290     /// green color
291     MS_U8 cGreenColor;
292     /// blue color
293     MS_U8 cBlueColor;
294 
295     /// scale 100 value of red color
296     MS_U8 cRedScaleValue;
297     /// scale 100 value of green color
298     MS_U8 cGreenScaleValue;
299     /// scale 100 value of blue color
300     MS_U8 cBlueScaleValue;
301 } XC_ACE_color_temp;
302 
303 /*!
304    obosolte!! use XC_ACE_color_temp_ex2 instead
305 */
306 typedef struct
307 {
308     /// red color offset
309     MS_U16 cRedOffset;
310     /// green color offset
311     MS_U16 cGreenOffset;
312     /// blue color offset
313     MS_U16 cBlueOffset;
314 
315     /// red color
316     MS_U8 cRedColor;
317     /// green color
318     MS_U8 cGreenColor;
319     /// blue color
320     MS_U8 cBlueColor;
321 
322     /// scale 100 value of red color
323     MS_U8 cRedScaleValue;
324     /// scale 100 value of green color
325     MS_U8 cGreenScaleValue;
326     /// scale 100 value of blue color
327     MS_U8 cBlueScaleValue;
328 } XC_ACE_color_temp_ex;
329 
330 /*!
331    The color temp settings ex2.
332 */
333 typedef struct
334 {
335     /// red color offset
336     MS_U16 cRedOffset;
337     /// green color offset
338     MS_U16 cGreenOffset;
339     /// blue color offset
340     MS_U16 cBlueOffset;
341 
342     /// red color
343     MS_U16 cRedColor;
344     /// green color
345     MS_U16 cGreenColor;
346     /// blue color
347     MS_U16 cBlueColor;
348 
349     /// scale 100 value of red color
350     MS_U16 cRedScaleValue;
351     /// scale 100 value of green color
352     MS_U16 cGreenScaleValue;
353     /// scale 100 value of blue color
354     MS_U16 cBlueScaleValue;
355 } XC_ACE_color_temp_ex2;
356 
357 //----------------------------
358 // XC ACE initialize
359 //----------------------------
360 /*!
361    The ACE initialze DATA.
362 */
363 typedef struct __attribute__((packed))
364 {
365     MS_BOOL    eWindow;                  ///< initial eWindow
366 
367     MS_S16*    S16ColorCorrectionMatrix; ///< initial Color Correction Matrix
368 #if !defined (__aarch64__)
369     MS_U32 u32AlignmentDummy0;
370 #endif
371     MS_S16*    S16RGB;                   ///< initial RGB
372 #if !defined (__aarch64__)
373     MS_U32 u32AlignmentDummy1;
374 #endif
375     MS_U16     u16MWEHstart;             ///< initial Horizontal start
376 
377 
378     MS_U16     u16MWEVstart;             ///< initial Vertical start
379 
380     MS_U16     u16MWEWidth;              ///< initial MWE Width
381 
382     MS_U16     u16MWEHeight;             ///< initial MWE Height
383 
384     MS_U16     u16MWE_Disp_Hstart;       ///< initial MWE Display Horizontal start
385 
386     MS_U16     u16MWE_Disp_Vstart;       ///< initial MWE Display Vertical start
387 
388     MS_U16     u16MWE_Disp_Width;        ///< initial MWE Display width
389 
390     MS_U16     u16MWE_Disp_Height;       ///< initial MWE Display height
391 
392     MS_BOOL    bMWE_Enable;              ///< Enable or not
393 } XC_ACE_InitData;
394 
395 /*!
396    The XC_ACE library infomation.
397 */
398 typedef struct
399 {
400 
401 } XC_ACE_ApiInfo;
402 
403 /*!
404    The XC_ACE status infomation.
405 */
406 typedef struct
407 {
408     /// Scaler ACE API status
409     XC_ACE_InitData ACEinit;
410 } XC_ACE_ApiStatus;
411 
412 
413 /*!
414    The XC_ACE DNR parameters settings.
415 */
416 typedef enum
417 {
418     /// NR ONOFF
419     E_ACE_DNR_NR_ONOFF,
420     /// SNR
421     E_ACE_DNR_SNR,
422     /// Spike NR 0
423     E_ACE_DNR_SPIKE_NR_0,
424     /// Spike NR 1
425     E_ACE_DNR_SPIKE_NR_1,
426     /// Gray ground gain
427     E_ACE_DNR_GRAY_GROUND_GAIN,
428     /// Gray ground EN
429     E_ACE_DNR_GRAY_GROUND_EN,
430     /// Peaking bank coring
431     E_ACE_DNR_PEAKING_BANK_CORING,
432     /// Guassin SNR threshold
433     E_ACE_DNR_GUASSIN_SNR_THRESHOLD,
434     /// Motion
435     E_ACE_DNR_MOTION,
436     /// Peaking coring threshold
437     E_ACE_DNR_PEAKING_CORING_THRESHOLD,
438     /// Sharpness adjust
439     E_ACE_DNR_SHARPNESS_ADJUST,
440     /// NM V
441     E_ACE_DNR_NM_V,
442     /// GNR 0
443     E_ACE_DNR_GNR_0,
444     /// GNR 1
445     E_ACE_DNR_GNR_1,
446     /// CP
447     E_ACE_DNR_CP,
448     /// DP
449     E_ACE_DNR_DP,
450     /// NM H 0
451     E_ACE_DNR_NM_H_0,
452     /// HM H 1
453     E_ACE_DNR_NM_H_1,
454     /// SC coring
455     E_ACE_DNR_SC_CORING,
456     /// NM
457     E_ACE_DNR_SNR_NM,
458 }XC_ACE_DNR_Param;
459 
460 typedef enum
461 {
462     E_ACE_IHC_COLOR_R,
463     E_ACE_IHC_COLOR_G,
464     E_ACE_IHC_COLOR_B,
465     E_ACE_IHC_COLOR_C,
466     E_ACE_IHC_COLOR_M,
467     E_ACE_IHC_COLOR_Y,
468     E_ACE_IHC_COLOR_F,
469     E_ACE_IHC_COLOR_MAX,
470 }XC_ACE_IHC_COLOR_TYPE;
471 
472 typedef enum
473 {
474     E_ACE_ICC_COLOR_R,
475     E_ACE_ICC_COLOR_G,
476     E_ACE_ICC_COLOR_B,
477     E_ACE_ICC_COLOR_C,
478     E_ACE_ICC_COLOR_M,
479     E_ACE_ICC_COLOR_Y,
480     E_ACE_ICC_COLOR_F,
481     E_ACE_ICC_COLOR_MAX,
482 }XC_ACE_ICC_COLOR_TYPE;
483 
484 typedef enum
485 {
486     E_ACE_IBC_COLOR_R,
487     E_ACE_IBC_COLOR_G,
488     E_ACE_IBC_COLOR_B,
489     E_ACE_IBC_COLOR_C,
490     E_ACE_IBC_COLOR_M,
491     E_ACE_IBC_COLOR_Y,
492     E_ACE_IBC_COLOR_F,
493     E_ACE_IBC_COLOR_MAX,
494 }XC_ACE_IBC_COLOR_TYPE;
495 
496 #define ACE_INFOEX_MODE_POST_RGB_GAIN           0x1
497 #define ACE_INFOEX_MODE_POST_RGB_OFFSET         0x2
498 typedef struct
499 {
500     MS_U32 u32Mode;
501     MS_U32 u32Reserved;
502 }XC_ACE_InfoEx;
503 
504 //--------------------------------------------------------------------------------------------------
505 // MWE Load Visual Effect Table related
506 //--------------------------------------------------------------------------------------------------
507 #define ACE_TABINFO_VERSION                0
508 
509 #define ACE_TABINFO_REG_ADDR_SIZE          (2)
510 #define ACE_TABINFO_REG_MASK_SIZE          (1)
511 #define ACE_TABINFO_REG_DATA_SIZE          (2)
512 
513 typedef struct
514 {
515     MS_U8 *pTable;
516     MS_U8 u8TabCols;
517     MS_U8 u8TabRows;
518     MS_U8 u8TabIdx;
519     MS_U32 u32ACE_TabInfo_version; //Version of current structure, including the content of pTable
520 }XC_ACE_TAB_Info;
521 //--------------------------------------------------------------------------------------------------
522 
523 //------------------------------
524 // Weave Type: used for 3D
525 //------------------------------
526 typedef enum
527 {
528     E_ACE_WEAVETYPE_NONE        = 0x00,
529     E_ACE_WEAVETYPE_H          = 0x01,
530     E_ACE_WEAVETYPE_V          = 0x02,
531     E_ACE_WEAVETYPE_DUALVIEW    = 0x04,
532     E_ACE_WEAVETYPE_NUM,
533 }XC_ACE_WEAVETYPE;
534 
535 typedef struct
536 {
537     MS_U8      u8ColorPrimaries;
538     MS_U8      u8TransferCharacteristics;
539     MS_U8      u8MatrixCoefficients;
540 } XC_ACE_HDRMetadataMpegVUI;
541 
542 ///HDR Code////
543 typedef struct
544 {
545     MS_U16 u16Smin; // 0.10
546     MS_U16 u16Smed; // 0.10
547     MS_U16 u16Smax; // 0.10
548     MS_U16 u16Tmin; // 0.10
549     MS_U16 u16Tmed; // 0.10
550     MS_U16 u16Tmax; // 0.10
551     MS_U16 u16MidSourceOffset;
552     MS_U16 u16MidTargetOffset;
553     MS_U16 u16MidSourceRatio;
554     MS_U16 u16MidTargetRatio;
555 } XC_ACE_HDRToneMappingData;
556 
557 typedef struct
558 {
559     MS_U16 u16tRx; // target Rx
560     MS_U16 u16tRy; // target Ry
561     MS_U16 u16tGx; // target Gx
562     MS_U16 u16tGy; // target Gy
563     MS_U16 u16tBx; // target Bx
564     MS_U16 u16tBy; // target By
565     MS_U16 u16tWx; // target Wx
566     MS_U16 u16tWy; // target Wy
567 } XC_ACE_HDRGamutMappingData;
568 
569 typedef struct
570 {
571     MS_U8      u8EOTF; // 0:SDR gamma, 1:HDR gamma, 2:SMPTE ST2084, 3:Future EOTF, 4-7:Reserved
572     MS_U16     u16Rx; // display primaries Rx
573     MS_U16     u16Ry; // display primaries Ry
574     MS_U16     u16Gx; // display primaries Gx
575     MS_U16     u16Gy; // display primaries Gy
576     MS_U16     u16Bx; // display primaries Bx
577     MS_U16     u16By; // display primaries By
578     MS_U16     u16Wx; // display primaries Wx
579     MS_U16     u16Wy; // display primaries Wy
580     MS_U16     u16Lmax; // max display mastering luminance
581     MS_U16     u16Lmin; // min display mastering luminance
582     MS_U16     u16MaxCLL; // maximum content light level
583     MS_U16     u16MaxFALL; // maximum frame-average light level
584 } XC_ACE_HDRMetadataHdmiTxInfoFrame;
585 
586 /*!
587  *  Initial  HDR   Settings
588  */
589 typedef struct
590 {
591     /// HDR Version Info
592     MS_U16 u16HDRVerInfo;
593     /// HDR init Length
594     MS_U16 u16HDRInitLength;
595     /// HDR Enable
596     MS_BOOL bHDREnable;
597     /// HDR Function Select
598     MS_U16 u16HDRFunctionSelect;
599     /// HDR Metadata Mpeg VUI
600     XC_ACE_HDRMetadataMpegVUI ACE_HDRMetadataMpegVUI;
601     //HDR Tone Mapping Data
602     XC_ACE_HDRToneMappingData ACE_HDRToneMappingData;
603     //HDR Gamut Mapping Data
604     XC_ACE_HDRGamutMappingData ACE_HDRGamutMappingData;
605     //HDR Metadata Hdmi Tx Info Frame
606     XC_ACE_HDRMetadataHdmiTxInfoFrame ACE_HDRMetadataHdmiTxInfoFrame;
607 
608 } XC_ACE_HDRinit;
609 
610 
611 //-------------------------------------------------------------------------------------------------
612 //  Function and Variable
613 //-------------------------------------------------------------------------------------------------
614 #define XC_ACE_BYPASS_COLOR_GAIN  128 //necessary for HW color tempture adjustment,
615                                       //used after T2, i.e: T3/T4/T7/T8/Janus..
616 
617 /********************************************************************************/
618 /*                   msAPI_ACE.c                   */
619 /********************************************************************************/
620 
621 //-------------------------------------------------------------------------------------------------
622 /// ACE Initiation
623 /// @ingroup ACE_INIT
624 /// @param  pstXC_ACE_InitData                  \b IN: @ref XC_ACE_InitData
625 /// @param  u32InitDataLen                      \b IN: The Length of pstXC_ACE_InitData.
626 /// @return @ref MS_BOOL
627 //-------------------------------------------------------------------------------------------------
628 MS_BOOL MApi_XC_ACE_Init(XC_ACE_InitData *pstXC_ACE_InitData, MS_U32 u32InitDataLen);
629 
630 
631 //-------------------------------------------------------------------------------------------------
632 /// ACE Exit
633 /// @ingroup ACE_INIT
634 /// @return @ref MS_BOOL
635 //-------------------------------------------------------------------------------------------------
636 MS_BOOL MApi_XC_ACE_Exit(void);
637 
638 //-------------------------------------------------------------------------------------------------
639 /// ACE DMS
640 /// @ingroup ACE_FEATURE
641 /// @param  eWindow                 \b IN: Indicates the window where the ACE function applies to.
642 /// @param  bisATV                  \b IN: Whether the active input source is or not ATV.
643 //-------------------------------------------------------------------------------------------------
644 void    MApi_XC_ACE_DMS(MS_BOOL eWindow, MS_BOOL bisATV);
645 
646 //-------------------------------------------------------------------------------------------------
647 /// Set PC YUV to RGB
648 /// @ingroup ACE_FEATURE
649 /// @param  eWindow                  \b IN: Indicates the window where the ACE function applies to.
650 /// @param  bEnable                  \b IN: Enable or Disalbe the function.
651 //-------------------------------------------------------------------------------------------------
652 void    MApi_XC_ACE_SetPCYUV2RGB(MS_BOOL eWindow, MS_BOOL bEnable);
653 
654 //-------------------------------------------------------------------------------------------------
655 /// Select YUV to RGB Matrix, if the ucMatrix type is ACE_YUV_TO_RGB_MATRIX_USER, then apply the
656 /// psUserYUVtoRGBMatrix supplied by user.
657 /// @ingroup ACE_FEATURE
658 /// @param  eWindow                       \b IN: Indicates the window where the ACE function applies to.
659 /// @param  ucMatrix                      \b IN: @ref E_ACE_YUVTORGBInfoType.
660 /// @param  psUserYUVtoRGBMatrix          \b IN: User-Defined color transformed matrix.
661 //-------------------------------------------------------------------------------------------------
662 void    MApi_XC_ACE_SelectYUVtoRGBMatrix(MS_BOOL eWindow, MS_U8 ucMatrix, MS_S16* psUserYUVtoRGBMatrix);
663 
664 //-------------------------------------------------------------------------------------------------
665 /// Set color correction table
666 /// @ingroup ACE_FEATURE
667 /// @param  bScalerWin                      \b IN: Indicates the window where the ACE function
668 ///                                                 applies to, 0: Main Window, 1: Sub Window.
669 //-------------------------------------------------------------------------------------------------
670 void    MApi_XC_ACE_SetColorCorrectionTable( MS_BOOL bScalerWin);
671 
672 //-------------------------------------------------------------------------------------------------
673 /// Set PCs RGB table
674 /// @ingroup ACE_FEATURE
675 /// @param  bScalerWin                      \b IN: Indicates the window where the ACE function
676 ///                                                 applies to, 0: Main Window, 1: Sub Window.
677 //-------------------------------------------------------------------------------------------------
678 void    MApi_XC_ACE_SetPCsRGBTable( MS_BOOL bScalerWin);
679 
680 //-------------------------------------------------------------------------------------------------
681 /// Get color matrix
682 /// @ingroup ACE_FEATURE
683 /// @param  eWindow                      \b IN: Indicates the window where the ACE function applies to.
684 /// @param  pu16Matrix                   \b OUT: a MS_U16 matrix represents current color matrix
685 //-------------------------------------------------------------------------------------------------
686 void    MApi_XC_ACE_GetColorMatrix(MS_BOOL eWindow, MS_U16* pu16Matrix);
687 
688 //-------------------------------------------------------------------------------------------------
689 /// Set color matrix
690 /// @ingroup ACE_FEATURE
691 /// @param  eWindow                      \b IN: Indicates the window where the ACE function applies to.
692 /// @param  pu16Matrix                   \b IN: The Matrix given to set the color transformation.
693 //-------------------------------------------------------------------------------------------------
694 void    MApi_XC_ACE_SetColorMatrix( MS_BOOL eWindow, MS_U16* pu16Matrix);
695 
696 //-------------------------------------------------------------------------------------------------
697 /// Set Bypass Color Matrix
698 /// @ingroup ACE_FEATURE
699 /// @param bEnable      \b IN:  Enable : Bypass Set Color Matrix
700 /// @return @ref E_XC_ACE_RESULT
701 //-------------------------------------------------------------------------------------------------
702 E_XC_ACE_RESULT MApi_XC_ACE_SetBypassColorMatrix(MS_BOOL bEnable );
703 
704 //-------------------------------------------------------------------------------------------------
705 /// Set IHC value
706 /// @ingroup ACE_FEATURE
707 /// @param  bScalerWin                   \b IN: Indicates the window where the ACE function applies to.
708 /// @param  eIHC                         \b IN: Indicates the color to be set.
709 /// @param  u8Val                        \b IN: The value set to the color(0 ~ 127).
710 /// @return @ref MS_BOOL
711 //-------------------------------------------------------------------------------------------------
712 // MS_BOOL MApi_XC_ACE_SetIHC(MS_BOOL bScalerWin, XC_ACE_IHC_COLOR_TYPE eIHC, MS_U8 u8Val);
713 
714 //-------------------------------------------------------------------------------------------------
715 /// Set ICC value
716 /// @ingroup ACE_FEATURE
717 /// @param  bScalerWin                   \b IN: Indicates the window where the ACE function applies to.
718 /// @param  eICC                         \b IN: Indicates the color to be set.
719 /// @param  u8Val                        \b IN: The value set to the color(0 ~ 32).
720 /// @return @ref MS_BOOL
721 //-------------------------------------------------------------------------------------------------
722 // MS_BOOL SYMBOL_WEAK MApi_XC_ACE_SetICC(MS_BOOL bScalerWin, XC_ACE_ICC_COLOR_TYPE eICC, MS_U8 u8Val);
723 
724 //-------------------------------------------------------------------------------------------------
725 /// Set IBC value
726 /// @ingroup ACE_FEATURE
727 /// @param  bScalerWin                   \b IN: Indicates the window where the ACE function applies to.
728 /// @param  eIBC                         \b IN: Indicates the color to be set.
729 /// @param  u8Val                        \b IN: The value set to the color(0 ~ 127).
730 /// @return @ref MS_BOOL
731 //-------------------------------------------------------------------------------------------------
732 // MS_BOOL SYMBOL_WEAK MApi_XC_ACE_SetIBC(MS_BOOL bScalerWin, XC_ACE_IBC_COLOR_TYPE eIBC, MS_U8 u8Val);
733 
734 //-------------------------------------------------------------------------------------------------
735 /// Patch DTG color checker
736 /// @ingroup ACE_FEATURE
737 // @param  u8Mode                       \b IN: TBD
738 //-------------------------------------------------------------------------------------------------
739 void    MApi_XC_ACE_PatchDTGColorChecker( MS_U8 u8Mode);
740 
741 //-------------------------------------------------------------------------------------------------
742 /// Get ACE information
743 /// @ingroup ACE_Tobemodified
744 /// @param  bWindow                      \b IN: Indicates the window where the ACE function
745 ///                                              applies to, 0: Main Window, 1: Sub Window.
746 /// @param  eXCACEInfoType                \b IN: Specify the information type users interested in.
747 /// @return @ref MS_U16
748 //-------------------------------------------------------------------------------------------------
749 MS_U16  MApi_XC_ACE_GetACEInfo( MS_BOOL bWindow, E_XC_ACE_INFOTYPE eXCACEInfoType );
750 
751 //-------------------------------------------------------------------------------------------------
752 /// Get ACE extra information
753 /// @ingroup ACE_Tobemodified
754 /// @param  bWindow                      \b IN: Indicates the window where the ACE function
755 ///                                              applies to, 0: Main Window, 1: Sub Window.
756 /// @param  XC_ACE_InfoEx                \b OUT: Specify the extra information returned by driver.
757 //-------------------------------------------------------------------------------------------------
758 // void MApi_XC_ACE_GetACEInfoEx( MS_BOOL bWindow, XC_ACE_InfoEx *pInfoEx);
759 
760 /********************************************************************************/
761 /*                   msAPI_ACE_Ext.c                   */
762 /********************************************************************************/
763 //-------------------------------------------------------------------------------------------------
764 /// Picture set contrast
765 /// @ingroup ACE_FEATURE
766 /// @param  eWindow                       \b IN: Indicates the window where the ACE function applies to.
767 /// @param  bUseYUVSpace                  \b IN: Use YUV format or RGB format.
768 /// @param  u8Contrast                    \b IN: Contrase value given by user.
769 //-------------------------------------------------------------------------------------------------
770 void    MApi_XC_ACE_PicSetContrast( MS_BOOL eWindow, MS_BOOL bUseYUVSpace, MS_U8 u8Contrast);
771 
772 //-------------------------------------------------------------------------------------------------
773 /// Picture set brightness
774 /// @ingroup ACE_Tobemodified
775 /// @param  u8Brightness_R                    \b IN: R value given by user.
776 /// @param  u8Brightness_G                    \b IN: G value given by user.
777 /// @param  u8Brightness_B                    \b IN: B value given by user.
778 //-------------------------------------------------------------------------------------------------
779 void    MApi_XC_ACE_PicSetBrightness( MS_BOOL eWindow, MS_U8 u8Brightness_R, MS_U8 u8Brightness_G, MS_U8 u8Brightness_B);
780 
781 //-------------------------------------------------------------------------------------------------
782 /// Picture set precise brightness
783 /// @ingroup ACE_Tobemodified
784 /// @param  u16Brightness_R                    \b IN: R value given by user.
785 /// @param  u16Brightness_G                    \b IN: G value given by user.
786 /// @param  u16Brightness_B                    \b IN: B value given by user.
787 //-------------------------------------------------------------------------------------------------
788 void MApi_XC_ACE_PicSetBrightnessPrecise(MS_BOOL eWindow, MS_U16 u16Brightness_R, MS_U16 u16Brightness_G, MS_U16 u16Brightness_B);
789 
790 //-------------------------------------------------------------------------------------------------
791 /// This function will set Pre Y Offset
792 /// @ingroup ACE_FEATURE
793 ///@param eWindow           \b IN: Window type
794 ///@param u8PreYOffset      \b IN: Pre Y Offset value
795 /// @return @ref E_XC_ACE_RESULT
796 //-------------------------------------------------------------------------------------------------
797 // E_XC_ACE_RESULT MApi_XC_ACE_PicSetPreYOffset(MS_BOOL eWindow, MS_U8 u8PreYOffset);
798 
799 //-------------------------------------------------------------------------------------------------
800 /// This function will get Pre Y Offset
801 /// @ingroup ACE_FEATURE
802 ///@param eWindow           \b IN: Window type
803 /// @return @ref MS_U8
804 //-------------------------------------------------------------------------------------------------
805 // MS_U8 MApi_XC_ACE_PicGetPreYOffset(MS_BOOL eWindow);
806 
807 //-------------------------------------------------------------------------------------------------
808 /// Picture set Hue
809 /// @ingroup ACE_FEATURE
810 /// @param  eWindow                  \b IN: Indicates the window where the ACE function applies to.
811 /// @param  bUseYUVSpace             \b IN: Use YUV format or RGB format.
812 /// @param  u8Hue                    \b IN: Hue value given by user.
813 //-------------------------------------------------------------------------------------------------
814 void    MApi_XC_ACE_PicSetHue( MS_BOOL eWindow, MS_BOOL bUseYUVSpace, MS_U8 u8Hue );
815 
816 //-------------------------------------------------------------------------------------------------
817 /// Skip Wait Vsync
818 /// @ingroup ACE_FEATURE
819 /// @param eWindow               \b IN: Enable
820 /// @param Skip wait Vsync      \b IN: Disable wait Vsync
821 /// @return @ref E_XC_ACE_RESULT
822 //-------------------------------------------------------------------------------------------------
823 E_XC_ACE_RESULT MApi_XC_ACE_SkipWaitVsync( MS_BOOL eWindow,MS_BOOL bIsSkipWaitVsyn);
824 
825 //-------------------------------------------------------------------------------------------------
826 /// Picture set Saturation
827 /// @ingroup ACE_FEATURE
828 /// @param  eWindow                  \b IN: Indicates the window where the ACE function applies to.
829 /// @param  bUseYUVSpace             \b IN: Use YUV format or RGB format.
830 /// @param  u8Saturation             \b IN: Saturation value given by user.
831 //-------------------------------------------------------------------------------------------------
832 void    MApi_XC_ACE_PicSetSaturation(MS_BOOL eWindow, MS_BOOL bUseYUVSpace, MS_U8 u8Saturation );
833 
834 //-------------------------------------------------------------------------------------------------
835 /// Adjust sharpness
836 /// @ingroup ACE_FEATURE
837 /// @param  eWindow                  \b IN: Indicates the window where the ACE function applies to.
838 /// @param u8Sharpness                \b IN: sharpness value : 0~0x3f
839 //-------------------------------------------------------------------------------------------------
840 void    MApi_XC_ACE_PicSetSharpness(  MS_BOOL eWindow, MS_U8 u8Sharpness );
841 
842 //-------------------------------------------------------------------------------------------------
843 /// Picture set color temp.
844 /// @ingroup ACE_ToBeModified
845 /// @param  eWindow                  \b IN: Indicates the window where the ACE function applies to.
846 /// @param  bUseYUVSpace             \b IN: Use YUV format or RGB format.
847 /// @param  pstColorTemp             \b IN: Color temp info given by user.
848 //-------------------------------------------------------------------------------------------------
849 void    MApi_XC_ACE_PicSetColorTemp( MS_BOOL eWindow, MS_BOOL bUseYUVSpace, XC_ACE_color_temp* pstColorTemp);
850 
851 //-------------------------------------------------------------------------------------------------
852 /// Picture set color temp ex.
853 /// @ingroup ACE_ToBeModified
854 /// @param  eWindow                  \b IN: Indicates the window where the ACE function applies to.
855 /// @param  bUseYUVSpace             \b IN: Use YUV format or RGB format.
856 /// @param  pstColorTemp             \b IN: Color temp info given by user.
857 //-------------------------------------------------------------------------------------------------
858 // void    MApi_XC_ACE_PicSetColorTempEx( MS_BOOL eWindow, MS_BOOL bUseYUVSpace, XC_ACE_color_temp_ex* pstColorTemp);
859 
860 //-------------------------------------------------------------------------------------------------
861 /// Picture set post color temp
862 /// @ingroup ACE_ToBeModified
863 /// V02. Change the fields in XC_ACE_color_temp_ex structure to MS_U16
864 /// @param  eWindow                  \b IN: Indicates the window where the ACE function applies to.
865 /// @param  pstColorTemp             \b IN: Color temp info given by user.
866 //-------------------------------------------------------------------------------------------------
867 void MApi_XC_ACE_PicSetPostColorTemp_V02(MS_BOOL eWindow, XC_ACE_color_temp_ex2* pstColorTemp);
868 
869 #ifndef _API_XC_ACE_C_
870 // Projects without ENABLE_NEW_COLORTEMP_METHOD defined will set ENABLE_NEW_COLORTEMP_METHOD to 0
871 #ifndef ENABLE_NEW_COLORTEMP_METHOD
872   #define ENABLE_NEW_COLORTEMP_METHOD 0
873 #endif
874 
875 #ifndef ENABLE_PRECISE_RGBBRIGHTNESS
876   #define ENABLE_PRECISE_RGBBRIGHTNESS 0
877 #endif
878 
879 #if ENABLE_NEW_COLORTEMP_METHOD
880     #if ENABLE_PRECISE_RGBBRIGHTNESS
881         #define MApi_XC_ACE_PicSetColorTemp(x, y, z) MApi_XC_ACE_PicSetPostColorTemp2Ex(x, y, z)
882     #else
883         #define MApi_XC_ACE_PicSetColorTemp(x, y, z) MApi_XC_ACE_PicSetPostColorTemp2(x, y, z)
884     #endif
885 #else
886     #if ENABLE_PRECISE_RGBBRIGHTNESS
887         #define MApi_XC_ACE_PicSetColorTemp(x, y, z) MApi_XC_ACE_PicSetColorTempEx(x, y, z)
888     #endif
889 #endif
890 
891 #define MApi_XC_ACE_PicSetBrightnessInVsync(bWin, x, y, z) {MApi_XC_WaitOutputVSync(2, 100, bWin); MApi_XC_ACE_PicSetBrightness(bWin, x, y, z);}
892 #define MApi_XC_ACE_PicSetBrightnessPreciseInVsync(bWin, x, y, z) {MApi_XC_WaitOutputVSync(2, 100, bWin); MApi_XC_ACE_PicSetBrightnessPrecise(bWin, x, y, z);}
893 
894 #endif
895 
896 //-------------------------------------------------------------------------------------------------
897 /// Set Flesh tone
898 /// @ingroup ACE_FEATURE
899 /// @param  eWindow                  \b IN: Indicates the window where the ACE function applies to.
900 /// @param  bEn                      \b IN: @ref MS_BOOL
901 /// @param  u8FleshTone              \b IN: Flesh Tone Value
902 //-------------------------------------------------------------------------------------------------
903 // void    MApi_XC_ACE_SetFleshTone(MS_BOOL eWindow, MS_BOOL bEn, MS_U8 u8FleshTone);
904 
905 //-------------------------------------------------------------------------------------------------
906 /// black adjsutment
907 /// @ingroup ACE_FEATURE
908 /// @param  eWindow                           \b IN: window type.
909 /// @param  u8BlackAdjust                     \b IN: adjust value given.
910 //-------------------------------------------------------------------------------------------------
911 // void    MApi_XC_ACE_SetBlackAdjust(MS_BOOL eWindow, MS_U8 u8BlackAdjust);
912 
913 //-------------------------------------------------------------------------------------------------
914 /// Set the IHC sram
915 /// @ingroup ACE_FEATURE
916 /// @param  pBuf                            \b IN: sram data
917 /// @param  u16ByteSize                     \b IN: size of sram
918 /// @return @ref MS_BOOL
919 //-------------------------------------------------------------------------------------------------
920 MS_BOOL MApi_XC_ACE_Set_IHC_SRAM(MS_U16 *pBuf, MS_U16 u16ByteSize);
921 
922 //-------------------------------------------------------------------------------------------------
923 /// Set the ICC sram
924 /// @ingroup ACE_FEATURE
925 /// @param  pBuf                            \b IN: sram data
926 /// @param  u16ByteSize                     \b IN: size of sram
927 /// @return @ref MS_BOOL
928 //-------------------------------------------------------------------------------------------------
929 MS_BOOL MApi_XC_ACE_Set_ICC_SRAM(MS_U16 *pBuf, MS_U16 u16ByteSize);
930 
931 /********************************************************************************/
932 /*                  MWE function                  */
933 /********************************************************************************/
934 
935 //-------------------------------------------------------------------------------------------------
936 /// Enable MWE
937 /// @ingroup ACE_FEATURE
938 /// @param  bEnable                     \b IN: @ref MS_BOOL
939 //-------------------------------------------------------------------------------------------------
940 void    MApi_XC_ACE_EnableMWE(MS_BOOL bEnable);
941 
942 //-------------------------------------------------------------------------------------------------
943 /// MWE Clone Main Window Visual Effect
944 /// @ingroup ACE_FEATURE
945 //-------------------------------------------------------------------------------------------------
946 void MApi_XC_ACE_MWECloneVisualEffect(void);
947 
948 //-------------------------------------------------------------------------------------------------
949 /// MWE Apply Visual Effect From Reg Table
950 /// @ingroup ACE_FEATURE
951 /// @param  pMWETable                 \b IN: MWE table
952 /// @return @ref MS_BOOL
953 //-------------------------------------------------------------------------------------------------
954 MS_BOOL MApi_XC_ACE_MWESetRegTable(XC_ACE_TAB_Info *pMWETable);
955 
956 //-------------------------------------------------------------------------------------------------
957 /// Flag for MWE Visual Effect Coming From Reg Table
958 /// @ingroup ACE_FEATURE
959 /// @param  bEnable                     \b IN: @ref MS_BOOL
960 /// @return @ref MS_BOOL
961 //-------------------------------------------------------------------------------------------------
962 MS_BOOL MApi_XC_ACE_SetMWELoadFromPQ(MS_BOOL bEnable);
963 
964 //-------------------------------------------------------------------------------------------------
965 /// MWE status
966 /// @ingroup ACE_INFO
967 /// @return @ref MS_BOOL
968 //-------------------------------------------------------------------------------------------------
969 MS_BOOL MApi_XC_ACE_MWEStatus(void);
970 
971 //-------------------------------------------------------------------------------------------------
972 /// MWE Handle
973 /// @ingroup ACE_FEATURE
974 //-------------------------------------------------------------------------------------------------
975 // void    MApi_XC_ACE_MWEHandle( void );
976 
977 //-------------------------------------------------------------------------------------------------
978 /// MWE function selection
979 /// @ingroup ACE_FEATURE
980 /// @param  eWindow                 \b IN: Indicates the window where the ACE function applies to.
981 /// @param  mwe_func                     \b IN: @ref E_XC_ACE_MWE_FUNC
982 //-------------------------------------------------------------------------------------------------
983 void    MApi_XC_ACE_MWEFuncSel( MS_BOOL eWindow, E_XC_ACE_MWE_FUNC  mwe_func);
984 
985 //-------------------------------------------------------------------------------------------------
986 /// MWE set display window
987 /// @ingroup ACE_FEATURE
988 /// @param  u16MWE_Disp_Hstart             \b IN: Horizotal position of start point. 0:means leftest position.
989 /// @param  u16MWE_Disp_Vstart             \b IN: Vertical position of start point, 0: mean up most position.
990 /// @param  u16MWE_Disp_Width              \b IN: Width of display window.
991 /// @param  u16MWE_Disp_Height             \b IN: Height of display winodw.
992 //-------------------------------------------------------------------------------------------------
993 void    MApi_XC_ACE_MWESetDispWin(MS_U16 u16MWE_Disp_Hstart, MS_U16 u16MWE_Disp_Vstart, MS_U16 u16MWE_Disp_Width, MS_U16 u16MWE_Disp_Height);
994 
995 //-------------------------------------------------------------------------------------------------
996 /// 3D clone main and sub window's PQmap
997 /// @ingroup ACE_FEATURE
998 /// @param  enWeaveType             \b IN: Output WeaveType
999 //-------------------------------------------------------------------------------------------------
1000 void MApi_XC_ACE_3DClonePQMap(XC_ACE_WEAVETYPE enWeaveType);
1001 
1002 /********************************************************************************/
1003 /*                  DynamicNR function                                          */
1004 /********************************************************************************/
1005 
1006 //-------------------------------------------------------------------------------------------------
1007 /// DNR Blending NR table
1008 /// @ingroup ACE_ToBeModified
1009 /// @param  pu8NewNR              \b IN: new NR target values.
1010 /// @param  u8Weight              \b IN: Blending weighting.
1011 /// @param  u8Step                \b IN: maxmium step size.
1012 /// @param  pu16PreY0             \b IN: previous NR value 0.
1013 /// @param  pu16PreY1             \b IN: previous NR value 1.
1014 /// @param  pu8NRTBL              \b OUT: The new NR Table.
1015 //-------------------------------------------------------------------------------------------------
1016 void   MApi_XC_ACE_DNR_Blending_NRTbl(MS_U8 *pu8NewNR, MS_U8 u8Weight, MS_U8 u8Step, MS_U16 *pu16PreY0, MS_U16 *pu16PreY1, MS_U8 *pu8NRTBL);
1017 
1018 //-------------------------------------------------------------------------------------------------
1019 /// DNR Blending MISC
1020 /// @ingroup ACE_ToBeModified
1021 /// @param  u8NewItem              \b IN: New DNR blending target value.
1022 /// @param  u16PreItem             \b IN: previous value.
1023 /// @param  u8Weight               \b IN: Blending weighting.
1024 /// @param  u8Step                 \b IN: Maxmium step size.
1025 /// @return @ref MS_U16           \b return new DNR blending value.
1026 //-------------------------------------------------------------------------------------------------
1027 MS_U16 MApi_XC_ACE_DNR_Blending_MISC(MS_U8 u8NewItem, MS_U16 u16PreItem, MS_U8 u8Weight, MS_U8 u8Step);
1028 
1029 //-------------------------------------------------------------------------------------------------
1030 /// DNR Blending
1031 /// @ingroup ACE_ToBeModified
1032 /// @param  u8NewItem              \b IN: New DNR blending target value.
1033 /// @param  u16PreItem             \b IN: previous value.
1034 /// @param  u8Weight               \b IN: Blending weighting.
1035 /// @return @ref MS_U8           \b return new DNR blending value.
1036 //-------------------------------------------------------------------------------------------------
1037 MS_U8  MApi_XC_ACE_DNR_Blending(MS_U8 u8NewItem, MS_U16 u16PreItem, MS_U8 u8Weight);
1038 
1039 //-------------------------------------------------------------------------------------------------
1040 /// DNR get precision shift
1041 /// @ingroup ACE_FEATURE
1042 /// @return @ref MS_U16           \b return shift value.
1043 //-------------------------------------------------------------------------------------------------
1044 MS_U16 MApi_XC_ACE_DNR_Get_PrecisionShift(void);
1045 
1046 //-------------------------------------------------------------------------------------------------
1047 /// DNR get motion weight
1048 /// @ingroup ACE_FEATURE
1049 /// @param  u8CurMotion                 \b IN: current motion value
1050 /// @param  u8PreMotion                 \b IN: previous motion value
1051 /// @param  u8CurMotionLvl              \b IN: current motion catalog-level
1052 /// @param  u8PreMotionLvl              \b IN: previous motion catalog-level
1053 /// @param  u8DeFlick_Thre              \b IN: de-flick threshold.
1054 /// @param  u8DeFilick_Step             \b IN: de-flick step size.
1055 /// @return @ref MS_U8                    \b Return motion weight
1056 //-------------------------------------------------------------------------------------------------
1057 MS_U8  MApi_XC_ACE_DNR_GetMotion_Weight(MS_U8 u8CurMotion, MS_U8 u8PreMotion, MS_U8 u8CurMotionLvl, MS_U8 u8PreMotionLvl, MS_U8 u8DeFlick_Thre, MS_U8 u8DeFilick_Step);
1058 
1059 //-------------------------------------------------------------------------------------------------
1060 /// DNR get Luma weight
1061 /// @ingroup ACE_FEATURE
1062 /// @param  u8CurAvgLuma                 \b IN: current avergae luma
1063 /// @param  u8PreAvgLuam                 \b IN: previous average luma
1064 /// @param  u8CurLumaLvl                 \b IN: current avergae luma catalog-level
1065 /// @param  u8PreLumaLvl                 \b IN: previous avergae luma catalog-level
1066 /// @param  u8DeFlick_Th                 \b IN: de-flick threshold.
1067 /// @param  u8DeFlick_Step               \b IN: de-flick step size.
1068 /// @return @ref MS_U8                    \b Return luma weight
1069 //-------------------------------------------------------------------------------------------------
1070 MS_U8  MApi_XC_ACE_DNR_GetLuma_Weight(MS_U8 u8CurAvgLuma, MS_U8 u8PreAvgLuam, MS_U8 u8CurLumaLvl, MS_U8 u8PreLumaLvl, MS_U8 u8DeFlick_Th,  MS_U8 u8DeFlick_Step);
1071 
1072 //-------------------------------------------------------------------------------------------------
1073 /// DNR get noise weight
1074 /// @ingroup ACE_FEATURE
1075 /// @param  u8CurNoise                 \b IN: current noise.
1076 /// @param  u8PreNoise                 \b IN: previous noise.
1077 /// @param  u8Range                    \b IN: noise threshold, if difference between PreNoise and
1078 ///                                          CurNoise > this value, then the stable status is down
1079 ///                                          -grade for 1 degree.
1080 /// @param  u8DeFlick_Th              \b IN: de-flick threshold.
1081 /// @param  u8DeFlick_Step            \b IN: de-flick step size.
1082 /// @return @ref MS_U8                 \b Return  Noise weighting value.
1083 //-------------------------------------------------------------------------------------------------
1084 MS_U8  MApi_XC_ACE_DNR_GetNoise_Weight(MS_U8 u8CurNoise, MS_U8 u8PreNoise, MS_U8 u8Range, MS_U8 u8DeFlick_Th, MS_U8 u8DeFlick_Step);
1085 
1086 //-------------------------------------------------------------------------------------------------
1087 /// DNR get motion degree, lower one means its more like a still video.
1088 /// @ingroup ACE_FEATURE
1089 /// @return @ref MS_U8                    \b Return motion degree value.
1090 //-------------------------------------------------------------------------------------------------
1091 MS_U8  MApi_XC_ACE_DNR_GetMotion(void);
1092 
1093 //-------------------------------------------------------------------------------------------------
1094 /// DNR init motion
1095 /// @ingroup ACE_INIT
1096 //-------------------------------------------------------------------------------------------------
1097 void   MApi_XC_ACE_DNR_Init_Motion(void);
1098 
1099 //-------------------------------------------------------------------------------------------------
1100 /// DNR init luma
1101 /// @ingroup ACE_INIT
1102 //-------------------------------------------------------------------------------------------------
1103 void   MApi_XC_ACE_DNR_Init_Luma(void);
1104 
1105 //-------------------------------------------------------------------------------------------------
1106 /// DNR init noise
1107 /// @ingroup ACE_INIT
1108 //-------------------------------------------------------------------------------------------------
1109 void   MApi_XC_ACE_DNR_Init_Noise(void);
1110 
1111 //-------------------------------------------------------------------------------------------------
1112 /// Set parameter of a DNR item specified by user.
1113 /// @ingroup ACE_FEATURE
1114 /// @param  eWindow                 \b IN: Indicates the window where the ACE function applies to.
1115 /// @param  eParam                 \b IN: @ref XC_ACE_DNR_Param
1116 /// @param  u16val                 \b IN: Setting value of DNR item.
1117 //-------------------------------------------------------------------------------------------------
1118 void   MApi_XC_ACE_DNR_SetParam(MS_BOOL eWindow, XC_ACE_DNR_Param eParam, MS_U16 u16val);
1119 
1120 //-------------------------------------------------------------------------------------------------
1121 /// Set Set HDR Init
1122 /// @ingroup ACE_FEATURE
1123 // @param  pstACE_HDRInitData             \b IN: HDR Init Info
1124 //-------------------------------------------------------------------------------------------------
1125 MS_BOOL SYMBOL_WEAK MApi_XC_ACE_SetHDRInit(XC_ACE_HDRinit *pstACE_HDRInitData);
1126 
1127 //-------------------------------------------------------------------------------------------------
1128 /// Get parameter of a DNR item specified by user.
1129 /// @ingroup ACE_FEATURE
1130 /// @param  eWindow                 \b IN: Indicates the window where the ACE function applies to.
1131 /// @param  eParam                 \b IN: @ref XC_ACE_DNR_Param
1132 /// @return @ref MS_U8
1133 //-------------------------------------------------------------------------------------------------
1134 MS_U8  MApi_XC_ACE_DNR_GetParam(MS_BOOL eWindow, XC_ACE_DNR_Param eParam);
1135 
1136 //-------------------------------------------------------------------------------------------------
1137 /// Set NR table
1138 /// @ingroup ACE_FEATURE
1139 /// @param  pu8Tbl                 \b IN: NR table given by user.
1140 //-------------------------------------------------------------------------------------------------
1141 void   MApi_XC_ACE_DNR_SetNRTbl(MS_U8 *pu8Tbl);
1142 
1143 // must have functions
1144 //-------------------------------------------------------------------------------------------------
1145 /// Get version (without Mutex protect)
1146 /// @ingroup ACE_INFO
1147 /// @param  ppVersion                 \b OUT: Version information of ACE lib.
1148 /// @return @ref E_XC_ACE_RESULT
1149 //-------------------------------------------------------------------------------------------------
1150 // E_XC_ACE_RESULT MApi_XC_ACE_GetLibVer(const MSIF_Version **ppVersion);
1151 
1152 //-------------------------------------------------------------------------------------------------
1153 /// Get info from driver (without Mutex protect)
1154 /// @ingroup ACE_INFO
1155 /// @return XC_ACE_ApiInfo
1156 //-------------------------------------------------------------------------------------------------
1157 // const XC_ACE_ApiInfo * MApi_XC_ACE_GetInfo(void);
1158 
1159 //-------------------------------------------------------------------------------------------------
1160 /// Get panel current status
1161 /// @ingroup ACE_INFO
1162 /// @param  pDrvStatus                 \b IN: @ref XC_ACE_ApiStatus
1163 /// @param  bWindow                    \b IN: Indicates the window where the ACE function
1164 ///                                           applies to, 0: Main Window, 1: Sub Window.
1165 /// @return @ref MS_BOOL
1166 //-------------------------------------------------------------------------------------------------
1167 // MS_BOOL MApi_XC_ACE_GetStatus(XC_ACE_ApiStatus *pDrvStatus, MS_BOOL bWindow);
1168 
1169 //-------------------------------------------------------------------------------------------------
1170 /// Set debug level (without Mutex protect)
1171 /// @ingroup ACE_INFO
1172 /// @param  u16DbgSwitch                 \b IN: debug switch value, use TRUE/FALSE to turn on/off.
1173 /// @return @ref MS_BOOL
1174 //-------------------------------------------------------------------------------------------------
1175 MS_BOOL MApi_XC_ACE_SetDbgLevel(MS_U16 u16DbgSwitch);
1176 
1177 //-------------------------------------------------------------------------------------------------
1178 /// Set Color correction table
1179 /// @ingroup ACE_FEATURE
1180 /// @param  u16DbgSwitch                 \b IN: debug switch value, use TRUE/FALSE to turn on/off.
1181 //-------------------------------------------------------------------------------------------------
1182 void MApi_XC_ACE_ColorCorrectionTable( MS_BOOL bScalerWin, MS_S16 *psColorCorrectionTable );
1183 
1184 //-------------------------------------------------------------------------------------------------
1185 /// Set Color Matrix
1186 /// @ingroup ACE_FEATURE
1187 /// @param  u16DbgSwitch                 \b IN: debug switch value, use TRUE/FALSE to turn on/off.
1188 //-------------------------------------------------------------------------------------------------
1189 void MApi_XC_ACE_SetColorMatrixControl( MS_BOOL bScalerWin, MS_BOOL bEnable );
1190 
1191 //-------------------------------------------------------------------------------------------------
1192 /// Set RG channel range
1193 /// @ingroup ACE_FEATURE
1194 /// @param  u16DbgSwitch                 \b IN: debug switch value, use TRUE/FALSE to turn on/off.
1195 //-------------------------------------------------------------------------------------------------
1196 void MApi_XC_ACE_SetRBChannelRange( MS_BOOL bScalerWin, MS_BOOL bRange );
1197 
1198 //-------------------------------------------------------------------------------------------------
1199 /// Ace power state control for fastboot
1200 /// @ingroup ACE_INIT
1201 /// @param  u16PowerState                 \b IN: power state
1202 /// @return @ref MS_U32                    \b Return  result of power state control.
1203 //-------------------------------------------------------------------------------------------------
1204 MS_U32 MApi_XC_ACE_SetPowerState(EN_POWER_MODE enPowerState);
1205 
1206 //////////////////////////////////////////////
1207 // Below functions are obosolted ! Please do not use them if you do not use them yet.
1208 //////////////////////////////////////////////
1209 
1210 //-------------------------------------------------------------------------------------------------
1211 ///-obosolte!! use MApi_XC_ACE_PicSetPostColorTemp_V02 instead
1212 /// @ingroup ACE_ToBeRemove
1213 //-------------------------------------------------------------------------------------------------
1214 void MApi_XC_ACE_PicSetPostColorTemp(MS_BOOL eWindow, XC_ACE_color_temp* pstColorTemp);
1215 
1216 //-------------------------------------------------------------------------------------------------
1217 ///-obosolte!! use MApi_XC_ACE_PicSetPostColorTemp_V02 instead
1218 /// @ingroup ACE_ToBeRemove
1219 //-------------------------------------------------------------------------------------------------
1220 // void MApi_XC_ACE_PicSetPostColorTempEx(MS_BOOL eWindow, XC_ACE_color_temp_ex* pstColorTemp);
1221 
1222 //-------------------------------------------------------------------------------------------------
1223 ///-obosolte!! use MApi_XC_ACE_PicSetPostColorTempWithBypassACESetting instead
1224 /// @ingroup ACE_ToBeRemove
1225 //-------------------------------------------------------------------------------------------------
1226 void MApi_XC_ACE_PicSetPostColorTemp2(MS_BOOL eWindow, MS_BOOL bUseYUVSpace, XC_ACE_color_temp* pstColorTemp);
1227 
1228 //*************************************************************************
1229 ///-obosolte!! Please bypass color temp by using MApi_XC_ACE_PicSetColorTemp and then set post color temp by using MApi_XC_ACE_PicSetPostColorTemp_V02
1230 /// @ingroup ACE_ToBeRemove
1231 //*************************************************************************
1232 // void MApi_XC_ACE_PicSetPostColorTemp2Ex(MS_BOOL eWindow, MS_BOOL bUseYUVSpace, XC_ACE_color_temp_ex* pstColorTemp);
1233 
1234 
1235 
1236 #ifdef __cplusplus
1237 }
1238 #endif
1239 
1240 #endif // _API_XC_ACE_H_
1241 
1242