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

📄 color_au07_at.c

📁 mstar 776 开发的车载dvd
💻 C
📖 第 1 页 / 共 5 页
字号:

#include "color.h"

//------------------------------------------------------------------------------
// sRGB Transform Matrix
//------------------------------------------------------------------------------
code short tSRGB[3][3] =
{
    { 1096,   -43,  -28 }, // R  1.0694, -0.0424, -0.0270
    {  -21,   1063, -18 }, // G -0.0204,  1.0376, -0.0172
    {   -1,   34,   991 }  // B -0.0009,  0.0330,  0.9679
};

//------------------------------------------------------------------------------
// Color Correcttion Matrix
//------------------------------------------------------------------------------
// Smooth ( )
// R Array (0,0), G Array (0,0), B Array (0,0)
// R Adj. (0), G Adj. (0), B Adj. (0)
code short tDefaultColorCorrectionMatrix[][3]=
{
   0x03CE, 0x0019, 0x0019, 0x001A, 0x03CC, 0x001A, 0x0019, 0x0019,
   0x03CE,-0x0738, 0x006E,-0x0036, 0x00D2,-0x054D, 0x079A,-0x0228,
  -0x07A4, 0x041F, 0x04D1,-0x0732, 0x0020, 0x0346,-0x010B, 0x07A4,
  -0x0831, 0x0100,-0x0000, 0x0000,-0x0000,-0x0032,-0x0034,-0x0032,
};

// Smooth (X)
// R Array (0,0), G Array (0,0), B Array (0,0)
// R Adj. (0), G Adj. (0), B Adj. (0)
code short tVideoColorCorrectionMatrix[][3]=
{
   0x03CE, 0x0019, 0x0019, 0x001A, 0x03CC, 0x001A, 0x0019, 0x0019,
   0x03CE,-0x0738, 0x006E,-0x0036, 0x00D2,-0x054D, 0x079A,-0x0228,
  -0x07A4, 0x041F, 0x04D1,-0x0732, 0x0020, 0x0346,-0x010B, 0x07A4,
  -0x0831, 0x0100,-0x0000, 0x0000,-0x0000,-0x0032,-0x0034,-0x0032,
};

// Smooth (X)
// R Array (0,0), G Array (0,0), B Array (0,0)
// R Adj. (0), G Adj. (0), B Adj. (0)
code short tHDTVColorCorrectionMatrix[][3]=
{
   0x03CE, 0x0019, 0x0019, 0x001A, 0x03CC, 0x001A, 0x0019, 0x0019,
   0x03CE,-0x0738, 0x006E,-0x0036, 0x00D2,-0x054D, 0x079A,-0x0228,
  -0x07A4, 0x041F, 0x04D1,-0x0732, 0x0020, 0x0346,-0x010B, 0x07A4,
  -0x0831, 0x0100,-0x0000, 0x0000,-0x0000,-0x0032,-0x0034,-0x0032,
};

// Smooth (X)
// R Array (0,0), G Array (0,0), B Array (0,0)
// R Adj. (0), G Adj. (0), B Adj. (0)
code short tSDTVColorCorrectionMatrix[][3]=
{
   0x03CE, 0x0019, 0x0019, 0x001A, 0x03CC, 0x001A, 0x0019, 0x0019,
   0x03CE,-0x0738, 0x006E,-0x0036, 0x00D2,-0x054D, 0x079A,-0x0228,
  -0x07A4, 0x041F, 0x04D1,-0x0732, 0x0020, 0x0346,-0x010B, 0x07A4,
  -0x0831, 0x0100,-0x0000, 0x0000,-0x0000,-0x0032,-0x0034,-0x0032,
};

// Smooth (X)
// R Array (0,0), G Array (0,0), B Array (0,0)
// R Adj. (0), G Adj. (0), B Adj. (0)
code short tATVColorCorrectionMatrix[][3]=
{
   0x03CE, 0x0019, 0x0019, 0x001A, 0x03CC, 0x001A, 0x0019, 0x0019,
   0x03CE,-0x0738, 0x006E,-0x0036, 0x00D2,-0x054D, 0x079A,-0x0228,
  -0x07A4, 0x041F, 0x04D1,-0x0732, 0x0020, 0x0346,-0x010B, 0x07A4,
  -0x0831, 0x0100,-0x0000, 0x0000,-0x0000,-0x0032,-0x0034,-0x0032,
};

// Smooth (X)
// R Array (0,0), G Array (0,0), B Array (0,0)
// R Adj. (0), G Adj. (0), B Adj. (0)
code short tYPbPrColorCorrectionMatrix[][3]=
{
   0x03CE, 0x0019, 0x0019, 0x001A, 0x03CC, 0x001A, 0x0019, 0x0019,
   0x03CE,-0x0738, 0x006E,-0x0036, 0x00D2,-0x054D, 0x079A,-0x0228,
  -0x07A4, 0x041F, 0x04D1,-0x0732, 0x0020, 0x0346,-0x010B, 0x07A4,
  -0x0831, 0x0100,-0x0000, 0x0000,-0x0000,-0x0032,-0x0034,-0x0032,
};

//------------------------------------------------------------------------------
// DLC Curve
//------------------------------------------------------------------------------
code U8 g_DLC_CURVE_Default_TBL[] =
{
    0x07,0x17,0x27,0x37,0x47,0x57,0x67,0x77,0x87,0x97,0xA7,0xB7,0xC7,0xD7,0xE7,0xF7
};

code U8 g_DLC_CURVE_00_TBL[] =
{
    0x04,0x0E,0x18,0x28,0x3F,0x5F,0x76,0x8C,0x9C,0xA8,0xB2,0xBA,0xC7,0xD7,0xE7,0xF7,
};

code U8 g_DLC_CURVE_01_TBL[] =
{
    0x04,0x0E,0x18,0x28,0x3F,0x5F,0x76,0x8C,0x9C,0xA8,0xB2,0xBA,0xC7,0xD7,0xE7,0xF7,
};

//------------------------------------------------------------------------------
// Default Tables
//------------------------------------------------------------------------------
code MS_REG_TYPE g_ACE_COMB_DEFAULT_TBL[11] =
{
    {BK_COMB_60,    0x00}, // Comb IF compenstaion
    {BK_COMB_70,    0xD0}, // Auto chroma gain mode
    {BK_COMB_73,    0x80}, // Contrast adjustment coefficient
    {BK_COMB_74,    0x80}, // Brightness adjustment coefficient
    {BK_COMB_75,    0x80}, // Saturation adjustment coefficient
    {BK_COMB_78,    0x80}, // Chroma gain value for manu chroma gain
    {BK_COMB_82,    0x6A}, // Cr gain for U/V demodulation
//    {BK_COMB_83,    0x11}, // CTI mode, Cb/Cr LPF Mode
    {BK_COMB_83,    0x04}, // CTI mode, Cb/Cr LPF Mode  // kevin 20070831
    {BK_COMB_9A,    0x33}, // AMP_YDIFF_V1 Gain
    {BK_COMB_9D,    0x00}, // Entropy H2
    {ACE_TABLE_END, 0xFF}  // End
};

code MS_REG16_TYPE g_ACE_DeBlocking_DEFAULT_TBL[18] =
{
    {_PK(0x0C, 0x10), 0x0000}, // DBNR enable, active threshold
    {_PK(0x0C, 0x11), 0x0006}, // DBNR strength, alpha step
    {_PK(0x0C, 0x14), 0xCDEF}, // DBNR LUT_0123
    {_PK(0x0C, 0x15), 0x89AB}, // DBNR_LUT_4567
    {_PK(0x0C, 0x16), 0x4567}, // DBNR_LUT_89AB
    {_PK(0x0C, 0x17), 0x0123}, // DBNR_LUT_CDEF
    {_PK(0x0C, 0x18), 0x0000}, // De-blocking H counter initial value 1
    {_PK(0x0C, 0x19), 0x0000}, // De-blocking H counter initial value 2
    {_PK(0x0C, 0x1A), 0x0000}, // De-blocking V counter initial value 1
    {_PK(0x0C, 0x1B), 0x0400}, // De-blocking V counter initial value 2
    {_PK(0x0C, 0x1C), 0x0000}, // De-blocking H counter ratio 1
    {_PK(0x0C, 0x1D), 0x0100}, // De-blocking H counter ratio 2
    {_PK(0x0C, 0x1E), 0x0000}, // De-blocking V counter ratio 1
    {_PK(0x0C, 0x1F), 0x0100}, // De-blocking V counter ratio 2
    {_PK(0x0C, 0x1F), 0x0808}, // H/V block width
    {_PK(0x0C, 0x29), 0x0006}, // H block left/right boundary
    {_PK(0x0C, 0x2A), 0x0006}, // V block left/right boundary
    {ACE_TABLE_END  , 0xFFFF}  // End
};

//------------------------------------------------------------------------------
// DTV-HD Color Fine-Tune Tables
//------------------------------------------------------------------------------
// COMB - Default

// SNR
code MS_REG16_TYPE g_ACE_SNR_HD_TBL[7] =
{
    {_PK(0x0C, 0x30), 0x0301},	// SNR enable, active threshold
    {_PK(0x0C, 0x31), 0x0006}, // SNR strength, alpha step
    {_PK(0x0C, 0x34), 0xFFFF}, // SNR LUT_0123
    {_PK(0x0C, 0x35), 0x469C}, // SNR_LUT_4567
    {_PK(0x0C, 0x36), 0x0012}, // SNR_LUT_89AB
    {_PK(0x0C, 0x37), 0x0000}, // SNR_LUT_CDEF
    {ACE_TABLE_END  , 0xFFFF}  // End
};

// DeBlocking
code MS_REG16_TYPE g_ACE_DeBlocking_HD_TBL[18] =
{
    {_PK(0x0C, 0x10), 0x0307}, // DBNR enable, active threshold
    {_PK(0x0C, 0x11), 0x0007}, // DBNR strength, alpha step
    {_PK(0x0C, 0x14), 0xCDEF}, // DBNR LUT_0123
    {_PK(0x0C, 0x15), 0x89AB}, // DBNR_LUT_4567
    {_PK(0x0C, 0x16), 0x4567}, // DBNR_LUT_89AB
    {_PK(0x0C, 0x17), 0x0123}, // DBNR_LUT_CDEF
    {_PK(0x0C, 0x18), 0x0000}, // De-blocking H counter initial value 1
    {_PK(0x0C, 0x19), 0x0000}, // De-blocking H counter initial value 2
    {_PK(0x0C, 0x1A), 0x0000}, // De-blocking V counter initial value 1
    {_PK(0x0C, 0x1B), 0x0000}, // De-blocking V counter initial value 2
    {_PK(0x0C, 0x1C), 0x0000}, // De-blocking H counter ratio 1
    {_PK(0x0C, 0x1D), 0x0100}, // De-blocking H counter ratio 2
    {_PK(0x0C, 0x1E), 0x0000}, // De-blocking V counter ratio 1
    {_PK(0x0C, 0x1F), 0x0100}, // De-blocking V counter ratio 2
    {_PK(0x0C, 0x28), 0x0808}, // H/V block width
    {_PK(0x0C, 0x29), 0x0006}, // H block left/right boundary
    {_PK(0x0C, 0x2A), 0x0006}, // V block left/right boundary
    {ACE_TABLE_END  , 0xFFFF}  // End
};

// V-Peaking
code MS_REG16_TYPE g_ACE_VPeaking_HD_TBL[10] =
{
    //{_PK(0x02, 0x2C), 0x3024}, // CTI low-pass & band-pass filter coefficient, setp
    {_PK(0x02, 0x2C), 0x3064}, // CTI low-pass & band-pass filter coefficient, setp // kevin 20070831
    {_PK(0x02, 0x2D), 0x8888},	// CTI coring threshold, median filter, enable
    {_PK(0x07, 0x1E), 0x0000},	// Vertical C low pass filter enable
    {_PK(0x0C, 0x60), 0x0027},	// Vpeaking enable, vertical filter enable, coring threahold step
    {_PK(0x0C, 0x61), 0x0C08}, // Vpeaking vertical coefficient & step
    {_PK(0x0C, 0x62), 0x0021}, // Vpeaking coring threshold 1 & 2, vertical threshold
    {_PK(0x0C, 0x63), 0x1001}, // Vpeaking term1 & 2 select, shapness adjust
    {_PK(0x0C, 0x70), 0x0480}, // Vpeaking vertical overshoot limitation
    {_PK(0x0C, 0x71), 0x0480}, // Vpeaking vertical undershoot limitation
    {ACE_TABLE_END  , 0xFFFF}  // End
};

// Post-Scaling
code MS_REG16_TYPE g_ACE_PostScaling_HD_TBL[3] =
{
    {_PK(0x02, 0x0A), 0x0000}, // Y delay enable, Y/C delay pipe step
    {_PK(0x07, 0x0A), 0xC242}, // Y/G & C/RB vertical scaling, Y/G & C/RB horizontal scaling
    {ACE_TABLE_END  , 0xFFFF}  // End
};

// H-Peaking
code MS_REG16_TYPE g_ACE_HPeaking_HD_TBL[23] =
{
//    {_PK(0x19, 0x10), 0x0F71}, // Peaking enable
    {_PK(0x19, 0x10), 0x0F61}, // Peaking enable    // kevin 20070831
    {_PK(0x19, 0x11), 0x0004}, // Band 1~4 coefficient step
//    {_PK(0x19, 0x13), 0x1831}, // coring threshold 1/2, user sharpness adjust
    {_PK(0x19, 0x13), 0x0B21}, // coring threshold 1/2, user sharpness adjust   // kevin 20070831
//    {_PK(0x19, 0x18), 0x1820}, // Band 1/2 coefficient
    {_PK(0x19, 0x18), 0x1430}, // Band 1/2 coefficient  // kevin 20070831
//    {_PK(0x19, 0x19), 0x1014}, // Band 3/4 coefficient
    {_PK(0x19, 0x19), 0x0E12}, // Band 3/4 coefficient  // kevin 20070831
    {_PK(0x19, 0x1C), 0x00E4}, // Peaking term 1~4 select
//    {_PK(0x19, 0x20), 0x20A0}, // Band 1/2 overshoot limit
    {_PK(0x19, 0x20), 0x40A0}, // Band 1/2 overshoot limit  // kevin 20070831
//    {_PK(0x19, 0x21), 0x0204}, // Band 3/4 overshoot limit
    {_PK(0x19, 0x21), 0x0808}, // Band 3/4 overshoot limit  // kevin 20070831
//    {_PK(0x19, 0x24), 0x20A0}, // Band 1/2 undershoot limit
    {_PK(0x19, 0x24), 0x40A0}, // Band 1/2 undershoot limit // kevin 20070831
//    {_PK(0x19, 0x25), 0x0204}, // Band 3/4 undershoot limit
    {_PK(0x19, 0x25), 0x0810}, // Band 3/4 undershoot limit // kevin 20070831
    {_PK(0x19, 0x30), 0x2000}, // Coring step
    {_PK(0x19, 0x31), 0x000F}, // Band1~4 differential adaptive enable
    {_PK(0x19, 0x32), 0x0068}, // Horizontal differential adaptive gain step
    {_PK(0x19, 0x33), 0x0003}, // Band 1~4 coring threshold
    {_PK(0x19, 0x40), 0x2728}, // Horizontal differential adaptive LUT 0/1
    {_PK(0x19, 0x41), 0x2526}, // Horizontal differential adaptive LUT 2/3
    {_PK(0x19, 0x42), 0x2324}, // Horizontal differential adaptive LUT 4/5
    {_PK(0x19, 0x43), 0x2122}, // Horizontal differential adaptive LUT 6/7
    {_PK(0x19, 0x44), 0x1F20}, // Horizontal differential adaptive LUT 8/9
    {_PK(0x19, 0x45), 0x1D1E}, /// Horizontal differential adaptive LUT 10/11
    {_PK(0x19, 0x46), 0x1B1C}, // Horizontal differential adaptive LUT 12/13
    {_PK(0x19, 0x47), 0x191A}, // Horizontal differential adaptive LUT 14/15
    {ACE_TABLE_END  , 0xFFFF}  // End
};

// Y-Adjust
code MS_REG16_TYPE g_ACE_YAdjust_HD_TBL[2] =
{
    {_PK(0x1A, 0x0F), 0x0006}, // Y adjust  // kevin 20070831
    {ACE_TABLE_END  , 0xFFFF}  // End
};

// FCC
code MS_REG16_TYPE g_ACE_FCC_HD_TBL[10] =
{
    //{_PK(0x18, 0x10), 0x0015},	// Flesh control enable, Gray guard enable
    {_PK(0x18, 0x10), 0x0000},	// Flesh control enable, Gray guard enable  // kevin 20070831
    {_PK(0x18, 0x18), 0xA073}, // Flesh tone cb/cr target
    {_PK(0x18, 0x1A), 0x70A5}, // FCC region 3 cb/cr target
    {_PK(0x18, 0x1B), 0xB353}, // FCC region 4 cb/cr target
    {_PK(0x18, 0x20), 0x4884}, // Flesh control strength
    {_PK(0x18, 0x21), 0x5888}, // Gray guard sttength
    {_PK(0x18, 0x24), 0xBAA6}, // Flesh range cr/cb up/down distance
    {_PK(0x18, 0x25), 0xFBFB}, // Region 4 range cr/cb up/down distance
    {_PK(0x18, 0x27), 0xAAFF}, // Gray range cr/cr up/down ditance
    {ACE_TABLE_END  , 0xFFFF}  // End
};

// ICC
code MS_REG16_TYPE g_ACE_ICC_HD_TBL[6] =
{
//    {_PK(0x18, 0x30), 0x00C0}, // ICC enable and cbcr to uv enable
    {_PK(0x18, 0x30), 0x0080}, // ICC enable and cbcr to uv enable  // kevin 20070831
    {_PK(0x18, 0x31), 0x2020}, // ICC saturation adjustment of R/G
    {_PK(0x18, 0x32), 0xC0C0}, // ICC saturation adjustment of B/C
    {_PK(0x18, 0x33), 0x2020}, // ICC saturation adjustment of M/Y
    {_PK(0x18, 0x34), 0x0040}, // ICC saturation adjustment of F
    {ACE_TABLE_END  , 0xFFFF}  // End
};

// IBC
code MS_REG16_TYPE g_ACE_IBC_HD_TBL[7] =
{
//    {_PK(0x18, 0x40), 0x00A2}, // IBC coring threshold, IBC Y adjust LPF enable, IBC enable
    {_PK(0x18, 0x40), 0x0000}, // IBC coring threshold, IBC Y adjust LPF enable, IBC enable // kevin 20070831
    {_PK(0x18, 0x41), 0x1820}, // IBC Y adjustment of R/G
    {_PK(0x18, 0x42), 0x2830}, // IBC Y adjustment of B/C
    {_PK(0x18, 0x43), 0x1818}, // IBC Y adjustment of M/Y
    {_PK(0x18, 0x44), 0x0018}, // IBC Y adjustment of F
    {_PK(0x18, 0x48), 0x6600}, // IBC weight min limit of Y/C
    {ACE_TABLE_END  , 0xFFFF}  // End
};

// IHC
code MS_REG16_TYPE g_ACE_IHC_HD_TBL[6] =
{
//    {_PK(0x18, 0x60), 0x0080}, // IHC enable
    {_PK(0x18, 0x60), 0x0000}, // IHC enable    // kevin 20070831
    {_PK(0x18, 0x61), 0x0000}, // IHC hue adjustment of R/G
    {_PK(0x18, 0x62), 0x0000}, // IHC hue adjustment of B/C
    {_PK(0x18, 0x63), 0x1800}, // IHC hue adjustment of M/Y
    {_PK(0x18, 0x64), 0x0000}, // IHC hue adjustment of F

⌨️ 快捷键说明

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