⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 drvanalog_inline.h

📁 mstar 776 开发的车载dvd
💻 H
字号:
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2006-2007 MStar Semiconductor, Inc.
// All rights reserved.
//
// Unless otherwise stipulated in writing, any and all information contained
// herein regardless in any format shall remain the sole proprietary of
// MStar Semiconductor Inc. and be kept in strict confidence
// (¨MStar Confidential Information〃) by the recipient.
// Any unauthorized act including without limitation unauthorized disclosure,
// copying, use, reproduction, sale, distribution, modification, disassembling,
// reverse engineering and compiling of the contents of MStar Confidential
// Information is unlawful and strictly prohibited. MStar hereby reserves the
// rights to any and all damages, losses, costs and expenses resulting therefrom.
//
////////////////////////////////////////////////////////////////////////////////

#ifndef  _DRV_ANALOG_INLINE_H_
#define  _DRV_ANALOG_INLINE_H_
#include "Board.h"

/********************************************************************************/
/*                           Macro                                              */
/********************************************************************************/

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
// Scaling Ratio Macro

#define H_PreScalingDownRatio(Input, Output)     ( (((U32)Output) * 1048576ul + Input)/ (Input) ) //Old scaling
#define H_PreScalingDownRatioAdv(Input, Output)  ( (((U32)Input-1) * 1048576ul + Output/2)/ (Output-1) ) //Advance scaling

#define V_PreScalingDownRatio(Input, Output)     ( (((U32)Output) * 1048576ul + Input/2)/ (Input) ) //Input/2,round up/down

#if 0
#define ScalingDownInvert_Shift                  (10ul)
#define H_PrePostScalingDownInvert(Input, Ratio) ( ((((U32)Input) * (Ratio>>12) - Input/2) * ScalingDownInvert_Shift) / 256ul )
#define V_PrePostScalingDownInvert(Input, Ratio) ( ((((U32)Input) * (Ratio>>12) - Input/2) * ScalingDownInvert_Shift) / 256ul )
#else // Kent from Lola 2007.04.06
#define H_PrePostScalingDownInvert(Input, Ratio) ( (((float)Input) * Ratio - Input/2)/ 1048576ul )
#define V_PrePostScalingDownInvert(Input, Ratio) ( (((float)Input) * Ratio - Input/2)/ 1048576ul )
#endif

#define H_PostScalingRatio(Input, Output)        ( ((float)Input-1) * 1048576ul / (Output-1) + 1 )
#define V_PostScalingRatio(Input, Output)        ( ((float)Input-1) * 1048576ul / (Output-1) + 1 )

#define H_PostScalingDownRatio(Input, Output)    H_PreScalingDownRatio(Input, Output)    //Old scaling
#define H_PostScalingDownRatioAdv(Input, Output) H_PreScalingDownRatioAdv(Input, Output) //Advance scaling

//------------------------------------------------------------------------------
// Mode Index Macro

#define IS_SRC_D1_MODE(x)       ((x == MD_720x480_60I) || (x == MD_720x576_50I))
#define IS_SRC_D2_MODE(x)       ((x == MD_720x480_60P) || (x = MD_720x576_50P))
#define IS_SRC_D3_MODE(x)       ((x == MD_1920x1080_60I) || (x == MD_1920x1080_50I))
#define IS_SRC_D4_MODE(x)       ((x == MD_1280x720_60P) || (x == MD_1280x720_50P))
#define IS_SRC_D5_MODE(x)       ((x== MD_1920x1080_60P) || (x == MD_1920x1080_50P) || (x == MD_1920x1080_24P) || (x == MD_1920x1080_30P))


//------------------------------------------------------------------------------
// Deinterlace Mode Macro

#define IS_SRC_USE_MEM(srcInfo)  (srcInfo.u8MemoryMode != MS_MEM_FMT_NO_USE)
#define IS_SRC_USE_2DDI(srcInfo) ((srcInfo.u8DeInterlaceMode == MS_DEINT_2DDI_BOB) || (srcInfo.u8DeInterlaceMode == MS_DEINT_2P5DDI))// kevin 080131

//------------------------------------------------------------------------------
// Others
#define IsSrcColorSpaceYUV()    (g_SrcInfo.u16ColorFinetuneFlag&FINETUNE_USE_YUV_SPACE)
#define IsColorMatrixYUV2RGB()  (g_SrcInfo.u16ColorFinetuneFlag&FINETUNE_MATRIX_YUV2RGB)

//------------------------------------------------------------------------------
// Debug Level

#define SCALER_DBG_LEVEL_NONE     0x00000000
#define SCALER_DBG_LEVEL_API      0x00000001
#define SCALER_DBG_LEVEL_DRV      0x00000002
#define SCALER_DBG_LEVEL_VD       0x00000004
#define SCALER_DBG_LEVEL_AUTO     0x00000008
#define SCALER_DBG_LEVEL_HDMI     0x00000010
#define SCALER_DBG_LEVEL_HDCP     0x00000020
#define SCALER_DBG_LEVEL_MONITOR  0x00000040
#define SCALER_DBG_LEVEL_ACE      0x00000080
#define SCALER_DBG_LEVEL_ASSERT   0x40000000
#define SCALER_DBG_LEVEL_ERROR    0x80000000
#define SCALER_DBG_LEVEL_ALL      0xFFFFFFFF

#define SCALER_DEBUG_LEVEL       SCALER_DBG_LEVEL_API//(SCALER_DBG_LEVEL_ASSERT)

#if (SCALER_DEBUG_LEVEL & SCALER_DBG_LEVEL_API)
#define SCALER_A_DBG(P)           P
#else
#define SCALER_A_DBG(P)
#endif

#if (SCALER_DEBUG_LEVEL & SCALER_DBG_LEVEL_DRV)
#define SCALER_D_DBG(P)           P
#else
#define SCALER_D_DBG(P)
#endif

#if (SCALER_DEBUG_LEVEL * SCALER_DBG_LEVEL_ACE)
#define SCALER_ACE_DBG(P)           P
#else
#define SCALER_ACE_DBG(p)
#endif

#if (SCALER_DEBUG_LEVEL & SCALER_DBG_LEVEL_AUTO)
#define AUTO_DBG(P)           P
#else
#define AUTO_DBG(P)
#endif

#if (SCALER_DEBUG_LEVEL & SCALER_DBG_LEVEL_VD)
#define VD_DBG(P)           P
#else
#define VD_DBG(P)
#endif

#if (SCALER_DEBUG_LEVEL & SCALER_DBG_LEVEL_HDMI)
#define HDMI_DBG(P)           P
#else
#define HDMI_DBG(P)
#endif

#if (SCALER_DEBUG_LEVEL & SCALER_DBG_LEVEL_HDCP)
#define HDCP_DBG(P)           P
#else
#define HDCP_DBG(P)
#endif

#if (SCALER_DEBUG_LEVEL & SCALER_DBG_LEVEL_MONITOR)
#define MONITOR_DBG(P)           P
#else
#define MONITOR_DBG(P)
#endif

#if (SCALER_DEBUG_LEVEL & SCALER_DBG_LEVEL_ASSERT)
#define ASSERT(expr)    (void)((expr) || printf("ASSERT %s %d\n", __FILE__, (int)__LINE__))
#else
#define ASSERT(expr)
#endif

#if (SCALER_DEBUG_LEVEL & SCALER_DBG_LEVEL_ERROR)
#define SCALER_E_DBG(P)           P
#else
#define SCALER_E_DBG(P)
#endif

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -