/* SPDX-License-Identifier: LGPL-2.1-only OR BSD-3-Clause */
/******************************************************************************
 *
 * This file is provided under a dual license.  When you use or
 * distribute this software, you may choose to be licensed under
 * version 2.1 of the GNU Lesser General Public License
 * ("LGPLv2.1 License") or BSD License.
 *
 * LGPLv2.1 License
 *
 * Copyright(C) 2019 MediaTek Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of version 2.1 of the GNU Lesser General Public
 * License as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html for more
 * details.
 *
 * BSD LICENSE
 *
 * Copyright(C) 2019 MediaTek Inc.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 *  * Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *  * Neither the name of the copyright holder nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *****************************************************************************/

/*-----------------------------------------------------------------------------
 */

/** @file pe_table.h
 *  
 *  
 */

#ifndef _PE_TABLE_H_
#define _PE_TABLE_H_

///////////////////////////////////////////////////////////////////////////////////
// The following is quality item setting.
// Remember to update QUALITY_ITEM_BEGIN/QUALITY_ITEM_END,
//      if QUALITY_ITEM table is changed.

enum
{
    //  General
    QUALITY_CONTRAST,
    QUALITY_CONTRAST_MSB,
    QUALITY_BRIGHTNESS,
    QUALITY_SATURATION,
    QUALITY_SATURATION_MSB,
    QUALITY_HUE,
    QUALITY_BACKLIGHT,

    //  HSHARP
    QUALITY_HSHARP_LOW,
    QUALITY_HSHARP_LOW_NEG,
    QUALITY_HSHARP_MID,
    QUALITY_HSHARP_MID_NEG,
    QUALITY_HSHARP_HIGH,
    QUALITY_HSHARP_HIGH_NEG,
    QUALITY_HSHARP_LOW_CORING,
    QUALITY_HSHARP_MID_CORING,
    QUALITY_HSHARP_HIGH_CORING,
    QUALITY_HSHARP_LOW_LIMIT_POS,
    QUALITY_HSHARP_LOW_LIMIT_NEG,
    QUALITY_HSHARP_MID_LIMIT_POS,
    QUALITY_HSHARP_MID_LIMIT_NEG,
    QUALITY_HSHARP_HIGH_LIMIT_POS,
    QUALITY_HSHARP_HIGH_LIMIT_NEG,
    QUALITY_HSHARP_CLIP_POS_EN,
    QUALITY_HSHARP_CLIP_NEG_EN,
    QUALITY_HSHARP_GB_CLIP_POS_EN_L,
    QUALITY_HSHARP_GB_CLIP_NEG_EN_L,
    QUALITY_HSHARP_GB_CLIP_POS_EN_M,
    QUALITY_HSHARP_GB_CLIP_NEG_EN_M,
    QUALITY_HSHARP_GB_CLIP_POS_EN_H,
    QUALITY_HSHARP_GB_CLIP_NEG_EN_H,
    QUALITY_HSHARP_CLIP_FRONT_THR_LOW,
    QUALITY_HSHARP_CLIP_FRONT_THR_HIGH,
    QUALITY_HSHARP_CLIP_POS,
    QUALITY_HSHARP_CLIP_NEG,
    QUALITY_HSHARP_SOFT_CLIP_GAIN,
    QUALITY_HSHARP_LC_LOW,
    QUALITY_HSHARP_LC_LOW_NEG,
    QUALITY_HSHARP_LC_MID,
    QUALITY_HSHARP_LC_MID_NEG,
    QUALITY_HSHARP_LC_HIGH,
    QUALITY_HSHARP_LC_HIGH_NEG,
    QUALITY_HSHARP_LC_LOW_CORING,
    QUALITY_HSHARP_LC_MID_CORING,
    QUALITY_HSHARP_LC_HIGH_CORING,
    QUALITY_HSHARP_LC_LOW_LIMIT_POS,
    QUALITY_HSHARP_LC_LOW_LIMIT_NEG,
    QUALITY_HSHARP_LC_MID_LIMIT_POS,
    QUALITY_HSHARP_LC_MID_LIMIT_NEG,
    QUALITY_HSHARP_LC_HIGH_LIMIT_POS,
    QUALITY_HSHARP_LC_HIGH_LIMIT_NEG,
    QUALITY_HSHARP_LC_CLIP_POS_EN,
    QUALITY_HSHARP_LC_CLIP_NEG_EN,
    QUALITY_HSHARP_LC_TABLE_SEL,
    QUALITY_HSHARP_LC_TABLE_GAIN,
    QUALITY_HSHARP_LC_TABLE_OFFSET,
    QUALITY_HSHARP_AC_LPF_EN,
    QUALITY_HSHARP_AC_LPF_COEF,

/*	// IRR  			//for Sony
    QUALITY_IRR_EN,
    QUALITY_IRR_FILTER,
    QUALITY_IRR_FILTER_CLIP,
    QUALITY_IRR_LEVEL,
    QUALITY_IRR_TAP,
    QUALITY_IRR_EDGE_TH,
    QUALITY_IRR_EDGE_SLOPE,
    QUALITY_IRR_LF_TH,
    QUALITY_IRR_LF_SLOPE,
    QUALITY_IRR_HF_TH,
    QUALITY_IRR_HF_SLOPE,
    QUALITY_IRR_RIPPLE_TH,
    QUALITY_IRR_DEACY_ER,
    QUALITY_IRR_DEACY_TH,
    QUALITY_IRR_FLAT_TH,
    QUALITY_IRR_FLAT_SLOPE,
    QUALITY_IRR_FLAT_LEVEL,  
*/
    //  TDSHARP
    QUALITY_TDSHARP_COR_ZERO_H1,
    QUALITY_TDSHARP_COR_ZERO_H2,
    QUALITY_TDSHARP_COR_ZERO_H3,
    QUALITY_TDSHARP_COR_ZERO_D1,
    QUALITY_TDSHARP_COR_ZERO_D2,
    QUALITY_TDSHARP_COR_ZERO_D3,
    QUALITY_TDSHARP_COR_ZERO_V1,
    QUALITY_TDSHARP_COR_ZERO_V2,
    QUALITY_TDSHARP_COR_ZERO_V3,
    QUALITY_TDSHARP_COR_RATIO_H1,
    QUALITY_TDSHARP_COR_RATIO_H2,
    QUALITY_TDSHARP_COR_RATIO_H3,
    QUALITY_TDSHARP_COR_RATIO_D1,
    QUALITY_TDSHARP_COR_RATIO_D2,
    QUALITY_TDSHARP_COR_RATIO_D3,
    QUALITY_TDSHARP_COR_RATIO_V1,
    QUALITY_TDSHARP_COR_RATIO_V2,
    QUALITY_TDSHARP_COR_RATIO_V3,
    QUALITY_TDSHARP_COR_THR_H1,
    QUALITY_TDSHARP_COR_THR_H2,
    QUALITY_TDSHARP_COR_THR_H3,
    QUALITY_TDSHARP_COR_THR_D1,
    QUALITY_TDSHARP_COR_THR_D2,
    QUALITY_TDSHARP_COR_THR_D3,
    QUALITY_TDSHARP_COR_THR_V1,
    QUALITY_TDSHARP_COR_THR_V2,
    QUALITY_TDSHARP_COR_THR_V3,
    QUALITY_TDSHARP_GAIN_H1,
    QUALITY_TDSHARP_GAIN_H2,
    QUALITY_TDSHARP_GAIN_H3,
    QUALITY_TDSHARP_GAIN_D1,
    QUALITY_TDSHARP_GAIN_D2,
    QUALITY_TDSHARP_GAIN_D3,
    QUALITY_TDSHARP_GAIN_V1,
    QUALITY_TDSHARP_GAIN_V2,
    QUALITY_TDSHARP_GAIN_V3,
    QUALITY_TDSHARP_LIMIT_H1,
    QUALITY_TDSHARP_LIMIT_H2,
    QUALITY_TDSHARP_LIMIT_H3,
    QUALITY_TDSHARP_LIMIT_D1,
    QUALITY_TDSHARP_LIMIT_D2,
    QUALITY_TDSHARP_LIMIT_D3,
    QUALITY_TDSHARP_LIMIT_V1,
    QUALITY_TDSHARP_LIMIT_V2,
    QUALITY_TDSHARP_LIMIT_V3,
    QUALITY_TDSHARP_LIMIT_RATIO_H1,
    QUALITY_TDSHARP_LIMIT_RATIO_H2,
    QUALITY_TDSHARP_LIMIT_RATIO_H3,
    QUALITY_TDSHARP_LIMIT_RATIO_D1,
    QUALITY_TDSHARP_LIMIT_RATIO_D2,
    QUALITY_TDSHARP_LIMIT_RATIO_D3,
    QUALITY_TDSHARP_LIMIT_RATIO_V1,
    QUALITY_TDSHARP_LIMIT_RATIO_V2,
    QUALITY_TDSHARP_LIMIT_RATIO_V3,
    QUALITY_TDSHARP_BOUND_H1,
    QUALITY_TDSHARP_BOUND_H2,
    QUALITY_TDSHARP_BOUND_H3,
    QUALITY_TDSHARP_BOUND_D1,
    QUALITY_TDSHARP_BOUND_D2,
    QUALITY_TDSHARP_BOUND_D3,
    QUALITY_TDSHARP_BOUND_V1,
    QUALITY_TDSHARP_BOUND_V2,
    QUALITY_TDSHARP_BOUND_V3,
    QUALITY_TDSHARP_EDF_GAIN_EN,
    QUALITY_TDSHARP_EDF_SEL,
    QUALITY_TDSHARP_COMBINE_MODE,
    QUALITY_TDSHARP_TDS_V_FILTER_SEL,
    QUALITY_TDSHARP_TDS_H_FILTER_SEL,
    QUALITY_TDSHARP_EDGE_RANK_SEL,
    QUALITY_TDSHARP_DETAIL_RANK_SEL,
    QUALITY_TDSHARP_FLAT_STEP,
    QUALITY_TDSHARP_FLAT_TH,
    QUALITY_TDSHARP_DETAIL_STEP,
    QUALITY_TDSHARP_DETAIL_TH,
    QUALITY_TDSHARP_EDGE_STEP,
    QUALITY_TDSHARP_EDGE_TH,
    QUALITY_TDSHARP_CLIP_RATIO_H,
    QUALITY_TDSHARP_CLIP_THR_H,
    QUALITY_TDSHARP_EDGE_GAIN_H,
    QUALITY_TDSHARP_DETAIL_GAIN_H, 
    QUALITY_TDSHARP_CLIP_RATIO_V,
    QUALITY_TDSHARP_CLIP_THR_V,
    QUALITY_TDSHARP_EDGE_GAIN_V,
    QUALITY_TDSHARP_DETAIL_GAIN_V,  
    QUALITY_TDSHARP_CLIP_RATIO_D,
    QUALITY_TDSHARP_CLIP_THR_D,
    QUALITY_TDSHARP_EDGE_GAIN_D,
    QUALITY_TDSHARP_DETAIL_GAIN_D, 
    QUALITY_TDSHARP_EDF_FLAT_TH,
    QUALITY_TDSHARP_EDF_FLAT_SLOPE,
    QUALITY_TDSHARP_EDF_DETAIL_RISE_TH,
    QUALITY_TDSHARP_EDF_DETAIL_RISE_SLOPE,
    QUALITY_TDSHARP_EDF_DETAIL_FALL_TH,
    QUALITY_TDSHARP_EDF_DETAIL_FALL_SLOPE,
    QUALITY_TDSHARP_EDF_EDGE_TH,
    QUALITY_TDSHARP_EDF_EDGE_SLOPE,
    QUALITY_TDSHARP_EDF_FLAT_GAIN_H,
    QUALITY_TDSHARP_EDF_DETAIL_GAIN_H,
    QUALITY_TDSHARP_EDF_EDGE_GAIN_H,
    QUALITY_TDSHARP_EDF_EDGE_GAIN_H_NEG,
    QUALITY_TDSHARP_EDF_FLAT_GAIN_D,
    QUALITY_TDSHARP_EDF_DETAIL_GAIN_D,
    QUALITY_TDSHARP_EDF_EDGE_GAIN_D,
    QUALITY_TDSHARP_EDF_EDGE_GAIN_D_NEG,
    QUALITY_TDSHARP_EDF_FLAT_GAIN_V,
    QUALITY_TDSHARP_EDF_DETAIL_GAIN_V,
    QUALITY_TDSHARP_EDF_EDGE_GAIN_V,
    QUALITY_TDSHARP_EDF_EDGE_GAIN_V_NEG,
    QUALITY_TDSHARP_TDS_TAP_MODE,
    QUALITY_TDSHARP_TDS_TAP_EN,
    QUALITY_TDSHARP_TDS_TAP_CLIP_EN,
    QUALITY_TDSHARP_TDS_TAP_LIMIT,
    QUALITY_TDSHARP_TDS_TAP_RATIO,
    QUALITY_TDSHARP_TDS_TAP_SRATIO,
    QUALITY_TDSHARP_TDS_VERT_TAP_APT_EN,
    QUALITY_TDSHARP_TDS_VERT_TAP_APT_SLOPE,
    QUALITY_TDSHARP_TDS_VERT_TAP_APT_EDGE,
    QUALITY_TDSHARP_TDS_VERT_TAP_APT_DIFF,
    QUALITY_TDSHARP_TDS_VERT_TAP_APT_BACK,
    QUALITY_TDSHARP_TDS_HORIZ_TAP_APT_EN,
    QUALITY_TDSHARP_TDS_HORIZ_TAP_APT_SLOPE,
    QUALITY_TDSHARP_TDS_HORIZ_TAP_APT_EDGE,
    QUALITY_TDSHARP_TDS_HORIZ_TAP_APT_DIFF,
    QUALITY_TDSHARP_TDS_HORIZ_TAP_APT_BACK_0,
    QUALITY_TDSHARP_TDS_HORIZ_TAP_APT_BACK_1,
    QUALITY_TDSHARP_TDS_HORIZ_TAP_APT_BACK_2,
    QUALITY_TDSHARP_TDS_HORIZ_TAP_APT_BACK_3,
    QUALITY_TDSHARP_TDS_HORIZ_TAP_APT_BACK_H2,
    QUALITY_TDSHARP_TDS_HORIZ_TAP_APT_EDGE_H2,
    //  LTI
    QUALITY_LTI_FLT_LTI_H1,
    QUALITY_LTI_COR_ZERO_LTI_H1,
    QUALITY_LTI_COR_RATIO_LTI_H1,
    QUALITY_LTI_COR_THR_LTI_H1,
    QUALITY_LTI_GAIN_LTI_H1,
    QUALITY_LTI_LIMIT_LTI_H1,
    QUALITY_LTI_LIMIT_RATIO_LTI_H1,
    QUALITY_LTI_BOUND_LTI_H1,
    QUALITY_LTI_CLIP_RATIO_LTI_H1,
    QUALITY_LTI_CLIP_THR_LTI_H1,
    QUALITY_LTI_FLT_LTI_H2,
    QUALITY_LTI_COR_ZERO_LTI_H2,
    QUALITY_LTI_COR_RATIO_LTI_H2,
    QUALITY_LTI_COR_THR_LTI_H2,
    QUALITY_LTI_GAIN_LTI_H2,
    QUALITY_LTI_LIMIT_LTI_H2,
    QUALITY_LTI_LIMIT_RATIO_LTI_H2,
    QUALITY_LTI_BOUND_LTI_H2,
    QUALITY_LTI_CLIP_RATIO_LTI_H2,
    QUALITY_LTI_CLIP_THR_LTI_H2,
    QUALITY_LTI_FLT_LTI_V,
    QUALITY_LTI_COR_ZERO_LTI_V,
    QUALITY_LTI_COR_RATIO_LTI_V,
    QUALITY_LTI_COR_THR_LTI_V,
    QUALITY_LTI_GAIN_LTI_V,
    QUALITY_LTI_LIMIT_LTI_V,
    QUALITY_LTI_LIMIT_RATIO_LTI_V,
    QUALITY_LTI_BOUND_LTI_V,
    QUALITY_LTI_CLIP_RATIO_LTI_V,
    QUALITY_LTI_CLIP_THR_LTI_V,

    // PBC
    QUALITY_PBC_PBC1_EN,
    QUALITY_PBC_PBC1_EDGE_EN,
    QUALITY_PBC_PBC1_EDGE_SLOPE,
    QUALITY_PBC_PBC1_LPF_EN,
    QUALITY_PBC_PBC1_LPF_LEVEL,    
    QUALITY_PBC_PBC1_CORING_H1,
    QUALITY_PBC_PBC1_CORING_H2,
    QUALITY_PBC_PBC1_CORING_H3,
    QUALITY_PBC_PBC1_CORING_D1,
    QUALITY_PBC_PBC1_CORING_D2,
    QUALITY_PBC_PBC1_CORING_D3,
    QUALITY_PBC_PBC1_CORING_V1,
    QUALITY_PBC_PBC1_CORING_V2,
    QUALITY_PBC_PBC1_CORING_V3,
    QUALITY_PBC_PBC1_GAIN_H1,
    QUALITY_PBC_PBC1_GAIN_H2,
    QUALITY_PBC_PBC1_GAIN_H3,
    QUALITY_PBC_PBC1_GAIN_D1,
    QUALITY_PBC_PBC1_GAIN_D2,
    QUALITY_PBC_PBC1_GAIN_D3,
    QUALITY_PBC_PBC1_GAIN_V1,
    QUALITY_PBC_PBC1_GAIN_V2,
    QUALITY_PBC_PBC1_GAIN_V3,
    QUALITY_PBC_PBC1_LIMIT_H1,
    QUALITY_PBC_PBC1_LIMIT_H2,
    QUALITY_PBC_PBC1_LIMIT_H3,
    QUALITY_PBC_PBC1_LIMIT_D1,
    QUALITY_PBC_PBC1_LIMIT_D2,
    QUALITY_PBC_PBC1_LIMIT_D3,
    QUALITY_PBC_PBC1_LIMIT_V1,
    QUALITY_PBC_PBC1_LIMIT_V2,
    QUALITY_PBC_PBC1_LIMIT_V3,
    QUALITY_PBC_PBC2_EN,
    QUALITY_PBC_PBC2_EDGE_EN,
    QUALITY_PBC_PBC2_EDGE_SLOPE,
    QUALITY_PBC_PBC2_LPF_EN,
    QUALITY_PBC_PBC2_LPF_LEVEL,    
    QUALITY_PBC_PBC2_CORING_H1,
    QUALITY_PBC_PBC2_CORING_H2,
    QUALITY_PBC_PBC2_CORING_H3,
    QUALITY_PBC_PBC2_CORING_D1,
    QUALITY_PBC_PBC2_CORING_D2,
    QUALITY_PBC_PBC2_CORING_D3,
    QUALITY_PBC_PBC2_CORING_V1,
    QUALITY_PBC_PBC2_CORING_V2,
    QUALITY_PBC_PBC2_CORING_V3,
    QUALITY_PBC_PBC2_GAIN_H1,
    QUALITY_PBC_PBC2_GAIN_H2,
    QUALITY_PBC_PBC2_GAIN_H3,
    QUALITY_PBC_PBC2_GAIN_D1,
    QUALITY_PBC_PBC2_GAIN_D2,
    QUALITY_PBC_PBC2_GAIN_D3,
    QUALITY_PBC_PBC2_GAIN_V1,
    QUALITY_PBC_PBC2_GAIN_V2,
    QUALITY_PBC_PBC2_GAIN_V3,
    QUALITY_PBC_PBC2_LIMIT_H1,
    QUALITY_PBC_PBC2_LIMIT_H2,
    QUALITY_PBC_PBC2_LIMIT_H3,
    QUALITY_PBC_PBC2_LIMIT_D1,
    QUALITY_PBC_PBC2_LIMIT_D2,
    QUALITY_PBC_PBC2_LIMIT_D3,
    QUALITY_PBC_PBC2_LIMIT_V1,
    QUALITY_PBC_PBC2_LIMIT_V2,
    QUALITY_PBC_PBC2_LIMIT_V3,
    QUALITY_PBC_PBC3_EN,
    QUALITY_PBC_PBC3_EDGE_EN,
    QUALITY_PBC_PBC3_EDGE_SLOPE,
    QUALITY_PBC_PBC3_LPF_EN,
    QUALITY_PBC_PBC3_LPF_LEVEL,    
    QUALITY_PBC_PBC3_CORING_H1,
    QUALITY_PBC_PBC3_CORING_H2,
    QUALITY_PBC_PBC3_CORING_H3,
    QUALITY_PBC_PBC3_CORING_D1,
    QUALITY_PBC_PBC3_CORING_D2,
    QUALITY_PBC_PBC3_CORING_D3,
    QUALITY_PBC_PBC3_CORING_V1,
    QUALITY_PBC_PBC3_CORING_V2,
    QUALITY_PBC_PBC3_CORING_V3,
    QUALITY_PBC_PBC3_GAIN_H1,
    QUALITY_PBC_PBC3_GAIN_H2,
    QUALITY_PBC_PBC3_GAIN_H3,
    QUALITY_PBC_PBC3_GAIN_D1,
    QUALITY_PBC_PBC3_GAIN_D2,
    QUALITY_PBC_PBC3_GAIN_D3,
    QUALITY_PBC_PBC3_GAIN_V1,
    QUALITY_PBC_PBC3_GAIN_V2,
    QUALITY_PBC_PBC3_GAIN_V3,
    QUALITY_PBC_PBC3_LIMIT_H1,
    QUALITY_PBC_PBC3_LIMIT_H2,
    QUALITY_PBC_PBC3_LIMIT_H3,
    QUALITY_PBC_PBC3_LIMIT_D1,
    QUALITY_PBC_PBC3_LIMIT_D2,
    QUALITY_PBC_PBC3_LIMIT_D3,
    QUALITY_PBC_PBC3_LIMIT_V1,
    QUALITY_PBC_PBC3_LIMIT_V2,
    QUALITY_PBC_PBC3_LIMIT_V3,

    //TDSHARPALL
    QUALITY_TDSHARPALL_COR_ZERO,
    QUALITY_TDSHARPALL_COR_RATIO,
    QUALITY_TDSHARPALL_COR_THR,
    QUALITY_TDSHARPALL_GAIN_POS,
    QUALITY_TDSHARPALL_GAIN_NEG,
    QUALITY_TDSHARPALL_LIMIT,
    QUALITY_TDSHARPALL_LIMIT_RATIO,
    QUALITY_TDSHARPALL_BOUND,
    QUALITY_TDSHARPALL_CLIP_RATIO,
    QUALITY_TDSHARPALL_CLIP_POS,
    QUALITY_TDSHARPALL_CLIP_NEG,
    QUALITY_TDSHARPALL_SAT_PROC,
    QUALITY_TDSHARPALL_AC_LPF_COE,
    QUALITY_TDSHARPALL_YLEV_EN,    
    QUALITY_TDSHARPALL_YLEV_ALPHA,
    QUALITY_TDSHARPALL_YLEV_SEL,
    QUALITY_TDSHARPALL_YLEV_ADAP_ENA,    
    QUALITY_TDSHARPALL_YLEV_ADL_ENA,
    QUALITY_TDSHARPALL_YLEV_APL_ENA,    
    QUALITY_TDSHARPALL_YLEV_ADL_GAIN,
    QUALITY_TDSHARPALL_YLEV_APL_ZERO,
    QUALITY_TDSHARPALL_YLEV_APL_THR,        
    QUALITY_TDSHARPALL_YLEV_P1,
    QUALITY_TDSHARPALL_YLEV_P2,
    QUALITY_TDSHARPALL_YLEV_P3,
    QUALITY_TDSHARPALL_YLEV_P4,
    QUALITY_TDSHARPALL_YLEV_G1,
    QUALITY_TDSHARPALL_YLEV_G2,
    QUALITY_TDSHARPALL_YLEV_G3,
    QUALITY_TDSHARPALL_YLEV_G4,      

	// Quality Table of FREQ_ANALYZER
    QUALITY_FREQ_ANALYZER_VHPF_DEAD_ZONE,
    QUALITY_FREQ_ANALYZER_HHPF_DEAD_ZONE,
    QUALITY_FREQ_ANALYZER_HHPF_NORMALIZ,
    QUALITY_FREQ_ANALYZER_HBPF_DEAD_ZONE,
    QUALITY_FREQ_ANALYZER_HBPF_NORMALIZ,

    // Quality Table of TDSHARP_3D
    QUALITY_TDSHARP_3D_FS_HGAIN,
    QUALITY_TDSHARP_3D_FS_DGAIN,
    QUALITY_TDSHARP_3D_FS_VGAIN,
    QUALITY_TDSHARP_3D_TTD_HGAIN,
    QUALITY_TDSHARP_3D_TTD_DGAIN,
    QUALITY_TDSHARP_3D_TTD_VGAIN,
    QUALITY_TDSHARP_3D_SBS_HGAIN,
    QUALITY_TDSHARP_3D_SBS_DGAIN,
    QUALITY_TDSHARP_3D_SBS_VGAIN,
    QUALITY_TDSHARP_3D_TB_HGAIN,
    QUALITY_TDSHARP_3D_TB_DGAIN,
    QUALITY_TDSHARP_3D_TB_VGAIN,
    QUALITY_TDSHARP_3D_SS_HGAIN,
    QUALITY_TDSHARP_3D_SS_DGAIN,
    QUALITY_TDSHARP_3D_SS_VGAIN,
    QUALITY_TDSHARP_3D_RD_HGAIN,
    QUALITY_TDSHARP_3D_RD_DGAIN,
    QUALITY_TDSHARP_3D_RD_VGAIN,
    QUALITY_TDSHARP_3D_LI_HGAIN,
    QUALITY_TDSHARP_3D_LI_DGAIN,
    QUALITY_TDSHARP_3D_LI_VGAIN,
    QUALITY_TDSHARP_3D_CB_HGAIN,
    QUALITY_TDSHARP_3D_CB_DGAIN,
    QUALITY_TDSHARP_3D_CB_VGAIN,
    QUALITY_TDSHARP_3D_DA_HGAIN,
    QUALITY_TDSHARP_3D_DA_DGAIN,
    QUALITY_TDSHARP_3D_DA_VGAIN,

    QUALITY_TDSHARP_3D_FS_HCLIP,
    QUALITY_TDSHARP_3D_FS_DCLIP,
    QUALITY_TDSHARP_3D_FS_VCLIP,
    QUALITY_TDSHARP_3D_TTD_HCLIP,
    QUALITY_TDSHARP_3D_TTD_DCLIP,
    QUALITY_TDSHARP_3D_TTD_VCLIP,
    QUALITY_TDSHARP_3D_SBS_HCLIP,
    QUALITY_TDSHARP_3D_SBS_DCLIP,
    QUALITY_TDSHARP_3D_SBS_VCLIP,
    QUALITY_TDSHARP_3D_TB_HCLIP,
    QUALITY_TDSHARP_3D_TB_DCLIP,
    QUALITY_TDSHARP_3D_TB_VCLIP,
    QUALITY_TDSHARP_3D_SS_HCLIP,
    QUALITY_TDSHARP_3D_SS_DCLIP,
    QUALITY_TDSHARP_3D_SS_VCLIP,
    QUALITY_TDSHARP_3D_RD_HCLIP,
    QUALITY_TDSHARP_3D_RD_DCLIP,
    QUALITY_TDSHARP_3D_RD_VCLIP,
    QUALITY_TDSHARP_3D_LI_HCLIP,
    QUALITY_TDSHARP_3D_LI_DCLIP,
    QUALITY_TDSHARP_3D_LI_VCLIP,
    QUALITY_TDSHARP_3D_CB_HCLIP,
    QUALITY_TDSHARP_3D_CB_DCLIP,
    QUALITY_TDSHARP_3D_CB_VCLIP,
    QUALITY_TDSHARP_3D_DA_HCLIP,
    QUALITY_TDSHARP_3D_DA_DCLIP,
    QUALITY_TDSHARP_3D_DA_VCLIP,

    //  CTIF
    QUALITY_CTIF_ENA,
    QUALITY_CTIF_HD,
    QUALITY_CTIF_LPF1,
    QUALITY_CTIF_LPF1_SEL,
    QUALITY_CTIF_FLPF,
    QUALITY_CTIF_FLPF_SEL,
    QUALITY_CTIF_U_WND_SZ,
    QUALITY_CTIF_V_WND_SZ,
    QUALITY_CTIF_U_STB_GAIN,
    QUALITY_CTIF_V_STB_GAIN,
    QUALITY_CTIF_U_STB_OFST1,
    QUALITY_CTIF_V_STB_OFST1,
    QUALITY_CTIF_U_STB_OFST2,
    QUALITY_CTIF_V_STB_OFST2,
    QUALITY_CTIF_FLAT_GAIN,
    QUALITY_CTIF_FLAT_OFST1,
    QUALITY_CTIF_FLAT_OFST2,
    QUALITY_CTIF_COR,

    //  CTIR
    QUALITY_CTIR_ENA,
    QUALITY_CTIR_HD,
    QUALITY_CTIR_LPF1,
    QUALITY_CTIR_LPF1_SEL,
    QUALITY_CTIR_FLPF,
    QUALITY_CTIR_FLPF_SEL,
    QUALITY_CTIR_U_WND_SZ,
    QUALITY_CTIR_V_WND_SZ,
    QUALITY_CTIR_U_STB_GAIN,
    QUALITY_CTIR_V_STB_GAIN,
    QUALITY_CTIR_U_STB_OFST1,
    QUALITY_CTIR_V_STB_OFST1,
    QUALITY_CTIR_U_STB_OFST2,
    QUALITY_CTIR_V_STB_OFST2,
    QUALITY_CTIR_FLAT_GAIN,
    QUALITY_CTIR_FLAT_OFST1,
    QUALITY_CTIR_FLAT_OFST2,
    QUALITY_CTIR_COR,
    
    // CBE
    QUALITY_CBE_WEI_IT3,
    QUALITY_CBE_WEI_IT5,
    
	// IRR
	QUALITY_IRR_EN,
	QUALITY_IRR_FILTER,
	QUALITY_IRR_FILTER_CLIP,
	QUALITY_IRR_LEVEL,
	QUALITY_IRR_TAP,
	QUALITY_IRR_EDGE_TH,
	QUALITY_IRR_EDGE_SLOPE,
	QUALITY_IRR_LF_TH,
	QUALITY_IRR_LF_SLOPE,
	QUALITY_IRR_HF_TH,
	QUALITY_IRR_HF_SLOPE,
	QUALITY_IRR_RIPPLE_TH,
	QUALITY_IRR_DEACY_ER,
	QUALITY_IRR_DEACY_TH,
	QUALITY_IRR_FLAT_TH,
	QUALITY_IRR_FLAT_SLOPE,
	QUALITY_IRR_FLAT_LEVEL,  

    // 2DNR
    QUALITY_2DNR_NX_BNR_GAIN,
    QUALITY_2DNR_NX_MNR_GAIN,
    QUALITY_2DNR_NX_MNR_EDGE_TH,
    QUALITY_2DNR_NX_MNR_LERE_GAIN,
    QUALITY_2DNR_NX_MNR_LERF_GAIN,
    QUALITY_2DNR_NX_MNR_LFRE_GAIN,
    QUALITY_2DNR_NX_MNR_UEDE_GAIN,
    QUALITY_2DNR_NX_MNR_UEDF_GAIN,
    QUALITY_2DNR_NX_MNR_UFDE_GAIN,
    QUALITY_2DNR_NX_MNR_GROUPING_STR,
    QUALITY_2DNR_NX_MNR_STR_GAIN,
    QUALITY_2DNR_NX_SNR_GAIN_Y,
    QUALITY_2DNR_NX_SNR_GAIN_C,
    QUALITY_2DNR_NX_SNR_COST_TH_DIR_ADAP,
    QUALITY_2DNR_NX_SNR_NOISE_COST_MODE,
    QUALITY_2DNR_NX_SNR_NOISE_REMOVAL_AUTO_TH_EDGE_STR,
    QUALITY_2DNR_NX_SNR_NOISE_REMOVAL_AUTO_TH_GENERAL_STR,
    QUALITY_2DNR_NR_SNR_MANUAL_AUTO_RATIO,
    QUALITY_2DNR_SNR_THM_SEL,
    QUALITY_2DNR_SNR_THM_GAIN,
    QUALITY_2DNR_SNR_THM_OFST,
    QUALITY_2DNR_NX_SNR_CHROMA_PRESERVATION,
    QUALITY_2DNR_NX_SNR_DEAD_ZONE_BRIGHT,
    QUALITY_2DNR_NX_SNR_DEAD_ZONE_DARK,
    QUALITY_2DNR_NX_SNR_DEAD_ZONE_TRANSITION,
    QUALITY_2DNR_NX_RNR_SNR_THD_RATIO,
    QUALITY_2DNR_RNR_MAX_TH,
    QUALITY_2DNR_BNR_RNR_TH,
    QUALITY_2DNR_SNR_NL_THD_MIN,
    QUALITY_2DNR_SNR_NL_THD_MAX,
    QUALITY_2DNR_SNR_NL_GAIN_MIN,
    QUALITY_2DNR_SNR_NL_GAIN_MAX,
    QUALITY_2DNR_DNR1_FILTER_EN,
    QUALITY_2DNR_DNR1_H_MM_TH,
    QUALITY_2DNR_DNR1_V_MM_TH,
    QUALITY_2DNR_DNR1_DOT_MAX_AMP_TH,

	// 3DNR
	QUALITY_3DNR_MCNR_ENABLE,
    QUALITY_3DNR_MCNR11_NOISE_METER_ENABLE,
    QUALITY_3DNR_TNR_ACNR_STRENGTH,
    QUALITY_3DNR_TNR_DCNR_ALPHA,
    QUALITY_3DNR_NR_IIR_MAX_WEI,
    QUALITY_3DNR_NR_IIR_MAX_WEI_E,
    QUALITY_3DNR_NR_NL_THD_MIN,
    QUALITY_3DNR_NR_NL_THD_MAX,
    QUALITY_3DNR_NR_TBL_THD_1,
    QUALITY_3DNR_NR_TBL_THD_2,
    QUALITY_3DNR_NR_TBL_THD_3,
    QUALITY_3DNR_NR_TBL_THD_4,
    QUALITY_3DNR_NR_TBL_THD_5,
    QUALITY_3DNR_NR_TBL_THD_6,
    QUALITY_3DNR_NR_TBL_THD_7,
    QUALITY_3DNR_NR_TBL_THD_8,
    QUALITY_3DNR_NR_TBL_THD_E_1,
    QUALITY_3DNR_NR_TBL_THD_E_2,
    QUALITY_3DNR_NR_TBL_THD_E_3,
    QUALITY_3DNR_NR_TBL_THD_E_4,
    QUALITY_3DNR_NR_TBL_THD_E_5,
    QUALITY_3DNR_NR_TBL_THD_E_6,
    QUALITY_3DNR_NR_TBL_THD_E_7,
    QUALITY_3DNR_NR_TBL_THD_E_8,
    QUALITY_3DNR_NR_TBL_THD_AUTO1_MIN_1,
    QUALITY_3DNR_NR_TBL_THD_AUTO1_MIN_2,
    QUALITY_3DNR_NR_TBL_THD_AUTO1_MIN_3,
    QUALITY_3DNR_NR_TBL_THD_AUTO1_MIN_4,
    QUALITY_3DNR_NR_TBL_THD_AUTO1_MIN_5,
    QUALITY_3DNR_NR_TBL_THD_AUTO1_MIN_6,
    QUALITY_3DNR_NR_TBL_THD_AUTO1_MIN_7,
    QUALITY_3DNR_NR_TBL_THD_AUTO1_MIN_8,
    QUALITY_3DNR_NR_TBL_THD_AUTO1_MAX_1,
    QUALITY_3DNR_NR_TBL_THD_AUTO1_MAX_2,
    QUALITY_3DNR_NR_TBL_THD_AUTO1_MAX_3,
    QUALITY_3DNR_NR_TBL_THD_AUTO1_MAX_4,
    QUALITY_3DNR_NR_TBL_THD_AUTO1_MAX_5,
    QUALITY_3DNR_NR_TBL_THD_AUTO1_MAX_6,
    QUALITY_3DNR_NR_TBL_THD_AUTO1_MAX_7,
    QUALITY_3DNR_NR_TBL_THD_AUTO1_MAX_8,
    QUALITY_3DNR_NR_TBL_THD_AUTO2_MIN_1,
    QUALITY_3DNR_NR_TBL_THD_AUTO2_MIN_2,
    QUALITY_3DNR_NR_TBL_THD_AUTO2_MIN_3,
    QUALITY_3DNR_NR_TBL_THD_AUTO2_MIN_4,
    QUALITY_3DNR_NR_TBL_THD_AUTO2_MIN_5,
    QUALITY_3DNR_NR_TBL_THD_AUTO2_MIN_6,
    QUALITY_3DNR_NR_TBL_THD_AUTO2_MIN_7,
    QUALITY_3DNR_NR_TBL_THD_AUTO2_MIN_8,
    QUALITY_3DNR_NR_TBL_THD_AUTO2_MAX_1,
    QUALITY_3DNR_NR_TBL_THD_AUTO2_MAX_2,
    QUALITY_3DNR_NR_TBL_THD_AUTO2_MAX_3,
    QUALITY_3DNR_NR_TBL_THD_AUTO2_MAX_4,
    QUALITY_3DNR_NR_TBL_THD_AUTO2_MAX_5,
    QUALITY_3DNR_NR_TBL_THD_AUTO2_MAX_6,
    QUALITY_3DNR_NR_TBL_THD_AUTO2_MAX_7,
    QUALITY_3DNR_NR_TBL_THD_AUTO2_MAX_8,
    QUALITY_3DNR_NR_TBL_MA_0,
    QUALITY_3DNR_NR_TBL_MA_1,
    QUALITY_3DNR_NR_TBL_MA_2,
    QUALITY_3DNR_NR_TBL_MA_3,
    QUALITY_3DNR_NR_TBL_MA_4,
    QUALITY_3DNR_NR_TBL_MA_5,
    QUALITY_3DNR_NR_TBL_MA_6,
    QUALITY_3DNR_NR_TBL_MA_7,
    QUALITY_3DNR_NR_TBL_MA_E_0,
    QUALITY_3DNR_NR_TBL_MA_E_1,
    QUALITY_3DNR_NR_TBL_MA_E_2,
    QUALITY_3DNR_NR_TBL_MA_E_3,
    QUALITY_3DNR_NR_TBL_MA_E_4,
    QUALITY_3DNR_NR_TBL_MA_E_5,
    QUALITY_3DNR_NR_TBL_MA_E_6,
    QUALITY_3DNR_NR_TBL_MA_E_7,
    QUALITY_3DNR_NR_TBL_MA_AUTO1_MIN_0,
    QUALITY_3DNR_NR_TBL_MA_AUTO1_MIN_1,
    QUALITY_3DNR_NR_TBL_MA_AUTO1_MIN_2,
    QUALITY_3DNR_NR_TBL_MA_AUTO1_MIN_3,
    QUALITY_3DNR_NR_TBL_MA_AUTO1_MIN_4,
    QUALITY_3DNR_NR_TBL_MA_AUTO1_MIN_5,
    QUALITY_3DNR_NR_TBL_MA_AUTO1_MIN_6,
    QUALITY_3DNR_NR_TBL_MA_AUTO1_MIN_7,
    QUALITY_3DNR_NR_TBL_MA_AUTO1_MAX_0,
    QUALITY_3DNR_NR_TBL_MA_AUTO1_MAX_1,
    QUALITY_3DNR_NR_TBL_MA_AUTO1_MAX_2,
    QUALITY_3DNR_NR_TBL_MA_AUTO1_MAX_3,
    QUALITY_3DNR_NR_TBL_MA_AUTO1_MAX_4,
    QUALITY_3DNR_NR_TBL_MA_AUTO1_MAX_5,
    QUALITY_3DNR_NR_TBL_MA_AUTO1_MAX_6,
    QUALITY_3DNR_NR_TBL_MA_AUTO1_MAX_7,
    QUALITY_3DNR_NR_TBL_MA_AUTO2_MIN_0,
    QUALITY_3DNR_NR_TBL_MA_AUTO2_MIN_1,
    QUALITY_3DNR_NR_TBL_MA_AUTO2_MIN_2,
    QUALITY_3DNR_NR_TBL_MA_AUTO2_MIN_3,
    QUALITY_3DNR_NR_TBL_MA_AUTO2_MIN_4,
    QUALITY_3DNR_NR_TBL_MA_AUTO2_MIN_5,
    QUALITY_3DNR_NR_TBL_MA_AUTO2_MIN_6,
    QUALITY_3DNR_NR_TBL_MA_AUTO2_MIN_7,
    QUALITY_3DNR_NR_TBL_MA_AUTO2_MAX_0,
    QUALITY_3DNR_NR_TBL_MA_AUTO2_MAX_1,
    QUALITY_3DNR_NR_TBL_MA_AUTO2_MAX_2,
    QUALITY_3DNR_NR_TBL_MA_AUTO2_MAX_3,
    QUALITY_3DNR_NR_TBL_MA_AUTO2_MAX_4,
    QUALITY_3DNR_NR_TBL_MA_AUTO2_MAX_5,
    QUALITY_3DNR_NR_TBL_MA_AUTO2_MAX_6,
    QUALITY_3DNR_NR_TBL_MA_AUTO2_MAX_7,
    QUALITY_3DNR_NR_TBL_C_0,
    QUALITY_3DNR_NR_TBL_C_1,
    QUALITY_3DNR_NR_TBL_C_2,
    QUALITY_3DNR_NR_TBL_C_3,
    QUALITY_3DNR_NR_TBL_C_4,
    QUALITY_3DNR_NR_TBL_C_5,
    QUALITY_3DNR_NR_TBL_C_6,
    QUALITY_3DNR_NR_TBL_C_7,
    QUALITY_3DNR_NR_TBL_C_E_0,
    QUALITY_3DNR_NR_TBL_C_E_1,
    QUALITY_3DNR_NR_TBL_C_E_2,
    QUALITY_3DNR_NR_TBL_C_E_3,
    QUALITY_3DNR_NR_TBL_C_E_4,
    QUALITY_3DNR_NR_TBL_C_E_5,
    QUALITY_3DNR_NR_TBL_C_E_6,
    QUALITY_3DNR_NR_TBL_C_E_7,
    QUALITY_3DNR_NR_MOVINGTXR_SUB_WEI_BASE_DFT,
    QUALITY_3DNR_NR_MOVINGTXR_SUB_WEI_NL_NAG_GAIN_DFT,
    QUALITY_3DNR_TNR_MA_NOISE_ADD_WEI_BASE,
    QUALITY_3DNR_TNR_MA_NOISE_ADD_WEI_NL_GAIN,
    QUALITY_3DNR_TNR_MA_PRTRBTN_ADD_WEI_BASE,
    QUALITY_3DNR_TNR_MA_PRTRBTN_ADD_WEI_STILL_GAIN,
    QUALITY_3DNR_TNR_STILL_GMV_ASSIST_DE_PRTRBTN,
    QUALITY_3DNR_TNR_CS_NOISE_ADD_WEI_BASE,
    QUALITY_3DNR_TNR_CS_NOISE_ADD_WEI_NL_GAIN,
    QUALITY_3DNR_TNR_CHROMA_MOVINGTXR_SUB_WEI_MAX,
    QUALITY_3DNR_TNR_CHROMA_DC_ADD_WEI_MAX,
    QUALITY_3DNR_TNR_CHROMA_DC_DIFF_BND,
    QUALITY_3DNR_DNR0_EN,
    QUALITY_3DNR_DNR0_H_MM_TH,
    QUALITY_3DNR_DNR0_V_MM_TH,
    QUALITY_3DNR_DNR0_DOT_MAX_AMP_TH,

	// LCN  for Sony
    QUALITY_LCN_BYP,
    QUALITY_LCN_LIRE_GAIN,
    QUALITY_LCN_LIRE_YTH,
    QUALITY_LCN_LIRE_YSLOPE,
    QUALITY_LCN_LIRE_STH,
    QUALITY_LCN_LIRE_SSLOPE,
    QUALITY_LCN_LSAT_GAIN,
    QUALITY_LCN_LSAT_STH,
    QUALITY_LCN_LSAT_SSLOPE,
    
    // Adaptive Luma 
    QUALITY_AL_ON_1_OFF_0,
    QUALITY_AL2_AL_VERSION,
    QUALITY_AL2_HISTOGRAM_MODE,
    QUALITY_AL2_C_SHP_DSR_EN,
    // Adaptive Luma Version 1: MID
    QUALITY_AL_GAIN,
    QUALITY_AL_OFFSET,
    QUALITY_AL_LIMIT,
    // Adaptive Luma Version 2; MID
    QUALITY_AL2_WEIGHT1,
	QUALITY_AL2_WEIGHT2,    
    QUALITY_AL2_MID_AC_GAIN,
	QUALITY_AL2_MID_DC_GAIN,    
    // Adaptive Luma Version 1: Black Stretch
    QUALITY_AL_BWS_BLACK_ON_1_OFF_0,
    QUALITY_AL_BWS_BLACK_LEVEL,
    QUALITY_AL_BWS_BLACK_GAIN,
    QUALITY_AL_BWS_BLACK_OFFSET,
    QUALITY_AL_BWS_BLACK_RATIO,
    QUALITY_AL_BWS_BLACK_LIMIT,
    // Adaptive Luma Version 2: Black Stretch
    QUALITY_AL2_BWS_BK_EN,
	QUALITY_AL2_BWS_BK_LEVEL,
	QUALITY_AL2_BWS_BK_AC_GAIN_RATIO,
	QUALITY_AL2_BWS_BK_DC_GAIN_RATIO,
	QUALITY_AL2_BWS_BK_ADPTLMT_EN,
	QUALITY_AL2_BWS_BK_RATIO,
	QUALITY_AL2_BWS_BK_STROFT_EN,
	QUALITY_AL2_BWS_BK_OFST_L,
	QUALITY_AL2_BWS_BK_OFST_H,
	QUALITY_AL2_BWS_BK_OFST_TH_L,
	QUALITY_AL2_BWS_BK_OFST_TH_H,
    // Adaptive Luma Version 1: White Stretch
    QUALITY_AL_BWS_WHITE_ON_1_OFF_0,
    QUALITY_AL_BWS_WHITE_LEVEL,
    QUALITY_AL_BWS_WHITE_GAIN,
    QUALITY_AL_BWS_WHITE_OFFSET,
    QUALITY_AL_BWS_WHITE_RATIO,
    QUALITY_AL_BWS_WHITE_LIMIT,
    // Adaptive Luma Version 2: White Stretch
    QUALITY_AL2_BWS_WT_EN,
	QUALITY_AL2_BWS_WT_LEVEL,
	QUALITY_AL2_BWS_WT_AC_GAIN_RATIO,
	QUALITY_AL2_BWS_WT_DC_GAIN_RATIO,
	QUALITY_AL2_BWS_WT_ADPTLMT_EN,
	QUALITY_AL2_BWS_WT_RATIO,
	QUALITY_AL2_BWS_WT_STROFT_EN,
	QUALITY_AL2_BWS_WT_OFST_L,
	QUALITY_AL2_BWS_WT_OFST_H,
	QUALITY_AL2_BWS_WT_OFST_TH_L,
	QUALITY_AL2_BWS_WT_OFST_TH_H,
    // Adaptive Luma Version 1: Dynamic Black Stretch
    QUALITY_AL_DYNBS_EN,
    QUALITY_AL_DYNBS_RANGE,
    QUALITY_AL_DYNBS_PXL_THD1,
    QUALITY_AL_DYNBS_PXL_THD2,
    QUALITY_AL_DYNBS_DIST_THDH,
    QUALITY_AL_DYNBS_DIST_THDM,
    QUALITY_AL_DYNBS_DIST_THDL,
    QUALITY_AL_DYNBS_LMT_BTM,
    QUALITY_AL_DYNBS_LMT_TOP,
    QUALITY_AL_DYNBS_GAIN_BTM,
    QUALITY_AL_DYNBS_GAIN_TOP,
    QUALITY_AL_DYNBS_OFST_BTM,
    QUALITY_AL_DYNBS_OFST_TOP,
    QUALITY_AL_BWS_KEEP_MID_ONOFF,
    QUALITY_AL_BWS_KEEP_MID_X_LVL,
    QUALITY_AL_BWS_KEEP_MID_Y_POS,   
    // Adaptive Luma: Common setting
    QUALITY_ALCOM_YGAMMA_DECAY_BRIGHT,
    QUALITY_ALCOM_YGAMMA_DECAY_LO,
    QUALITY_ALCOM_YGAMMA_DECAY_HI,
    QUALITY_ALCOM_YGAMMA_SEL,
    QUALITY_ALCOM_YGAMMA_MID_SEL,
	QUALITY_ALCOM_YGAMMA_SKIN_MID_SEL,
    QUALITY_ALCOM_SKIN_LUMA_BYP,
    QUALITY_ALCOM_CURVE_WEIGHT,
    QUALITY_ALCOM_BLEND_METHOD,
    QUALITY_ALCOM_WIN_HBOUND,
    QUALITY_ALCOM_WIN_VBOUND,

    //RGB Gain offset
    QUALITY_R_GAIN,    
    QUALITY_G_GAIN,   
    QUALITY_B_GAIN,
    QUALITY_R_GAIN_MSB,   
    QUALITY_G_GAIN_MSB,
    QUALITY_B_GAIN_MSB, 
    QUALITY_R_OFFSET, 
    QUALITY_G_OFFSET,  
    QUALITY_B_OFFSET,
    QUALITY_R_OFFSET_MSB,       
    QUALITY_G_OFFSET_MSB,      
    QUALITY_B_OFFSET_MSB,

    //Blue stretch
    QUALITY_BLUE_STRETCH_ENABLE,
    QUALITY_BLUE_STRETCH_GAIN_R,
    QUALITY_BLUE_STRETCH_GAIN_G,
    QUALITY_BLUE_STRETCH_GAIN_B,
    QUALITY_BLUE_STRETCH_LUMA_THD,
    QUALITY_BLUE_STRETCH_SAT_THD,
    QUALITY_BLUE_STRETCH_GAIN2_ENABLE,
    QUALITY_BLUE_STRETCH_BASE_1,
    QUALITY_BLUE_STRETCH_GAIN_R_1,
    QUALITY_BLUE_STRETCH_GAIN_G_1,
    QUALITY_BLUE_STRETCH_GAIN_B_1,
    QUALITY_BLUE_STRETCH_BASE_2,
    QUALITY_BLUE_STRETCH_GAIN_R_2,
    QUALITY_BLUE_STRETCH_GAIN_G_2,
    QUALITY_BLUE_STRETCH_GAIN_B_2,
    QUALITY_BLUE_STRETCH_BASE_3,
    QUALITY_BLUE_STRETCH_GAIN_R_3,
    QUALITY_BLUE_STRETCH_GAIN_G_3,
    QUALITY_BLUE_STRETCH_GAIN_B_3,
    QUALITY_BLUE_STRETCH_BASE_4,
    QUALITY_BLUE_STRETCH_GAIN_R_4,
    QUALITY_BLUE_STRETCH_GAIN_G_4,
    QUALITY_BLUE_STRETCH_GAIN_B_4, 

    //GAMMA
    QUALITY_GAMMA_CURVE_SEL,

    //SCE
    QUALITY_SCE_LUMA_GAIN,
    QUALITY_SCE_SAT_GAIN,
    QUALITY_SCE_HUE_GAIN,

    QUALITY_CBOOST_ONOFF,
    QUALITY_CBOOST_MINUS_EN,
    QUALITY_CBOOST_GAIN,
    QUALITY_CBOOST_RNG_SEL,
    QUALITY_CBOOST_LMT_U,
    QUALITY_CBOOST_LMT_L,  
/*			// for sony
    QUALITY_LCN_BYP,
    QUALITY_LCN_LIRE_GAIN,
    QUALITY_LCN_LIRE_YTH,
    QUALITY_LCN_LIRE_YSLOPE,
    QUALITY_LCN_LIRE_STH,
    QUALITY_LCN_LIRE_SSLOPE,
    QUALITY_LCN_LSAT_GAIN,
    QUALITY_LCN_LSAT_STH,
    QUALITY_LCN_LSAT_SSLOPE,
*/
    QUALITY_SKIN_ONOFF,
    QUALITY_SKIN_YMIN,
    QUALITY_SKIN_YMAX,
    QUALITY_SKIN_YSLOPE,
    QUALITY_SKIN_SMIN,
    QUALITY_SKIN_SMAX,
    QUALITY_SKIN_SSLOPE,
    QUALITY_SKIN_HMIN,
    QUALITY_SKIN_HMAX,
    QUALITY_SKIN_HSLOPE,
    
    //Y BITPLUS
    QUALITY_Y_BITPLUS_EN,
    QUALITY_Y_BITPLUS_RANDOM_EN,
    QUALITY_Y_BITPLUS_SHIFT,
    QUALITY_Y_BITPLUS_YRANGE,
    QUALITY_Y_BITPLUS_P1,
    QUALITY_Y_BITPLUS_P2,
    QUALITY_Y_BITPLUS_P3,
    QUALITY_Y_BITPLUS_P4,
    QUALITY_Y_BITPLUS_Q1,
    QUALITY_Y_BITPLUS_Q2,
    QUALITY_Y_BITPLUS_Q3,
    QUALITY_Y_BITPLUS_Q4,
    QUALITY_Y_BITPLUS_G12,
    QUALITY_Y_BITPLUS_G23,
    QUALITY_Y_BITPLUS_G34,
    
    //S BITPLUS
    QUALITY_S_BITPLUS_EN,
    QUALITY_S_BITPLUS_RANDOM_EN,
    QUALITY_S_BITPLUS_SHIFT,
    QUALITY_S_BITPLUS_YRANGE,
    QUALITY_S_BITPLUS_P1,
    QUALITY_S_BITPLUS_P2,
    QUALITY_S_BITPLUS_P3,
    QUALITY_S_BITPLUS_P4,
    QUALITY_S_BITPLUS_Q1,
    QUALITY_S_BITPLUS_Q2,
    QUALITY_S_BITPLUS_Q3,
    QUALITY_S_BITPLUS_Q4,
    QUALITY_S_BITPLUS_G12,
    QUALITY_S_BITPLUS_G23,
    QUALITY_S_BITPLUS_G34,

    //SKIN_LUMA
    QUALITY_SKIN_LUMA_GAIN,
    QUALITY_SKIN_SAT_GAIN,
    QUALITY_SKIN_HUE_GAIN,    

    //DEPTH
    QUALITY_DEPTH_TTD_SCALAR,
    QUALITY_DEPTH_TDDC_GLOBAL,
    QUALITY_DEPTH_TDDC_LOCAL,

    //PROTRUDE
    QUALITY_PROTRUDE_GLOBAL_SFT,

    //MODULE ONOFF
    QUALITY_MODULE_ONOFF_SNR,
    QUALITY_MODULE_ONOFF_MNR,
    QUALITY_MODULE_ONOFF_BNR,
    QUALITY_MODULE_ONOFF_TNR,    
    QUALITY_MODULE_ONOFF_SUPER_RES,
    QUALITY_MODULE_ONOFF_DERING,
    QUALITY_MODULE_ONOFF_CTI,
    QUALITY_MODULE_ONOFF_LTI,
    QUALITY_MODULE_ONOFF_SHARPNESS,
    QUALITY_MODULE_ONOFF_SCE,
    QUALITY_MODULE_ONOFF_MATRIX,
    QUALITY_MODULE_ONOFF_BLUE_STRETCH,
    QUALITY_MODULE_ONOFF_XVYCC,
    QUALITY_MODULE_ONOFF_RGB_GAIN,
    QUALITY_MODULE_ONOFF_RGB_OFFSET,
    QUALITY_MODULE_ONOFF_GAMMA,
    QUALITY_MODULE_ONOFF_LCDIM,
    QUALITY_MODULE_ONOFF_OD,

    QUALITY_MAX
};

#define QUALITY_SHARP_BEGIN         		QUALITY_HSHARP_LOW
#ifdef CC_MAPLE_CUST_DRV
#define QUALITY_SHARP_END                   QUALITY_CBE_WEI_IT5    
#else
#define QUALITY_SHARP_END                   QUALITY_TDSHARP_3D_DA_VCLIP
#endif

#define QUALITY_SHARP_H_BEGIN				QUALITY_TDSHARP_GAIN_H1
#define QUALITY_SHARP_H_END        			QUALITY_TDSHARP_GAIN_H3

#define QUALITY_SHARP_V_BEGIN   			QUALITY_TDSHARP_GAIN_V1
#define QUALITY_SHARP_V_END          		QUALITY_TDSHARP_GAIN_V2

#define QUALITY_SHARP_D_BEGIN   			QUALITY_TDSHARP_GAIN_D1
#define QUALITY_SHARP_D_END          		QUALITY_TDSHARP_GAIN_D3

#define QUALITY_LTI_BEGIN                   QUALITY_LTI_FLT_LTI_H1
#define QUALITY_LTI_END                     QUALITY_LTI_CLIP_THR_LTI_V

#define QUALITY_CTI_BEGIN				    QUALITY_CTIF_ENA
#define QUALITY_CTI_END						QUALITY_CTIR_COR

#define QUALITY_CBE_BEGIN				    QUALITY_CBE_WEI_IT3
#define QUALITY_CBE_END						QUALITY_CBE_WEI_IT5

#define QUALITY_TNR_BEGIN				    QUALITY_2DNR_NX_SNR_GAIN_Y	//QUALITY_3DNR_TNR_ACNR_STRENGTH
#define QUALITY_TNR_END				    	QUALITY_LCN_LSAT_SSLOPE   //QUALITY_3DNR_DNR0_DOT_MAX_AMP_TH

#define QUALITY_SNR_BEGIN			        QUALITY_IRR_EN	//QUALITY_2DNR_NX_SNR_GAIN_Y
#define QUALITY_SNR_END				    	QUALITY_2DNR_NX_MNR_STR_GAIN	//QUALITY_2DNR_DNR1_DOT_MAX_AMP_TH

#define QUALITY_ANR_BEGIN			        QUALITY_ANR_SAT_LV0
#define QUALITY_ANR_END				        QUALITY_ANR_MOEDGE_TBL0_LV7
#define QUALITY_ANR_SIZE_PER_LV             (QUALITY_ANR_SAT_LV1-QUALITY_ANR_SAT_LV0)

#define QUALITY_MPEGNR_BEGIN				QUALITY_IRR_EN//QUALITY_2DNR_NX_BNR_GAIN
#define QUALITY_MPEGNR_END					QUALITY_2DNR_NX_MNR_STR_GAIN

#define QUALITY_AL_BEGIN                    QUALITY_AL_ON_1_OFF_0
#define QUALITY_AL_END                      QUALITY_ALCOM_WIN_VBOUND

#define QUALITY_AL_BS_BEGIN                 QUALITY_AL_BWS_BLACK_ON_1_OFF_0
#define QUALITY_AL_BS_END                   QUALITY_AL2_BWS_BK_OFST_TH_H

#define QUALITY_AL_WS_BEGIN                 QUALITY_AL_BWS_WHITE_ON_1_OFF_0
#define QUALITY_AL_WS_END                   QUALITY_AL2_BWS_WT_OFST_TH_H

#define QUALITY_BS_BEGIN 					QUALITY_BLUE_STRETCH_ENABLE
#define QUALITY_BS_END 						QUALITY_BLUE_STRETCH_GAIN_B_4

#define QUALITY_GAMMA_BEGIN     			QUALITY_GAMMA_CURVE_SEL
#define QUALITY_GAMMA_END       			QUALITY_GAMMA_CURVE_SEL

#define QUALITY_SCE_BEGIN     				QUALITY_SCE_LUMA_GAIN
#define QUALITY_SCE_END       				QUALITY_S_BITPLUS_G34

#define QUALITY_SKIN_BEGIN     			    QUALITY_SKIN_LUMA_GAIN
#define QUALITY_SKIN_END       			    QUALITY_SKIN_HUE_GAIN

#define QUALITY_DEPTH_BEGIN     		    QUALITY_DEPTH_TTD_SCALAR
#define QUALITY_DEPTH_END       			QUALITY_DEPTH_TDDC_LOCAL

#define QUALITY_PROTRUDE_BEGIN     			QUALITY_PROTRUDE_GLOBAL_SFT
#define QUALITY_PROTRUDE_END       			QUALITY_PROTRUDE_GLOBAL_SFT

#define QUALITY_DISTANCE_BEGIN     			0  //TBD
#define QUALITY_DISTANCE_END       			0  //TBD

#define QUALITY_MODULE_ONOFF_BEGIN          QUALITY_MODULE_ONOFF_SNR
#define QUALITY_MODULE_ONOFF_END            QUALITY_MODULE_ONOFF_OD

// End of QUALITY_ITEM setting.

//for Sony delete Auto2 registers.
#define QUALITY_3DNR_NR_TBL_THD_AUTO_MIN_1 	QUALITY_3DNR_NR_TBL_THD_AUTO1_MIN_1
#define QUALITY_3DNR_NR_TBL_THD_AUTO_MIN_2 	QUALITY_3DNR_NR_TBL_THD_AUTO1_MIN_2
#define QUALITY_3DNR_NR_TBL_THD_AUTO_MIN_3 	QUALITY_3DNR_NR_TBL_THD_AUTO1_MIN_3
#define QUALITY_3DNR_NR_TBL_THD_AUTO_MIN_4 	QUALITY_3DNR_NR_TBL_THD_AUTO1_MIN_4
#define QUALITY_3DNR_NR_TBL_THD_AUTO_MIN_5 	QUALITY_3DNR_NR_TBL_THD_AUTO1_MIN_5
#define QUALITY_3DNR_NR_TBL_THD_AUTO_MIN_6 	QUALITY_3DNR_NR_TBL_THD_AUTO1_MIN_6
#define QUALITY_3DNR_NR_TBL_THD_AUTO_MIN_7 	QUALITY_3DNR_NR_TBL_THD_AUTO1_MIN_7
#define QUALITY_3DNR_NR_TBL_THD_AUTO_MIN_8 	QUALITY_3DNR_NR_TBL_THD_AUTO1_MIN_8

#define QUALITY_3DNR_NR_TBL_THD_AUTO_MAX_1	QUALITY_3DNR_NR_TBL_THD_AUTO1_MAX_1
#define QUALITY_3DNR_NR_TBL_THD_AUTO_MAX_2	QUALITY_3DNR_NR_TBL_THD_AUTO1_MAX_2
#define QUALITY_3DNR_NR_TBL_THD_AUTO_MAX_3	QUALITY_3DNR_NR_TBL_THD_AUTO1_MAX_3
#define QUALITY_3DNR_NR_TBL_THD_AUTO_MAX_4	QUALITY_3DNR_NR_TBL_THD_AUTO1_MAX_4
#define QUALITY_3DNR_NR_TBL_THD_AUTO_MAX_5	QUALITY_3DNR_NR_TBL_THD_AUTO1_MAX_5
#define QUALITY_3DNR_NR_TBL_THD_AUTO_MAX_6	QUALITY_3DNR_NR_TBL_THD_AUTO1_MAX_6
#define QUALITY_3DNR_NR_TBL_THD_AUTO_MAX_7	QUALITY_3DNR_NR_TBL_THD_AUTO1_MAX_7
#define QUALITY_3DNR_NR_TBL_THD_AUTO_MAX_8	QUALITY_3DNR_NR_TBL_THD_AUTO1_MAX_8

#define QUALITY_3DNR_NR_TBL_MA_AUTO_MIN_0	QUALITY_3DNR_NR_TBL_MA_AUTO1_MIN_0
#define QUALITY_3DNR_NR_TBL_MA_AUTO_MIN_1	QUALITY_3DNR_NR_TBL_MA_AUTO1_MIN_1
#define QUALITY_3DNR_NR_TBL_MA_AUTO_MIN_2	QUALITY_3DNR_NR_TBL_MA_AUTO1_MIN_2
#define QUALITY_3DNR_NR_TBL_MA_AUTO_MIN_3	QUALITY_3DNR_NR_TBL_MA_AUTO1_MIN_3
#define QUALITY_3DNR_NR_TBL_MA_AUTO_MIN_4	QUALITY_3DNR_NR_TBL_MA_AUTO1_MIN_4
#define QUALITY_3DNR_NR_TBL_MA_AUTO_MIN_5	QUALITY_3DNR_NR_TBL_MA_AUTO1_MIN_5
#define QUALITY_3DNR_NR_TBL_MA_AUTO_MIN_6	QUALITY_3DNR_NR_TBL_MA_AUTO1_MIN_6
#define QUALITY_3DNR_NR_TBL_MA_AUTO_MIN_7	QUALITY_3DNR_NR_TBL_MA_AUTO1_MIN_7

#define QUALITY_3DNR_NR_TBL_MA_AUTO_MAX_0	QUALITY_3DNR_NR_TBL_MA_AUTO1_MAX_0
#define QUALITY_3DNR_NR_TBL_MA_AUTO_MAX_1	QUALITY_3DNR_NR_TBL_MA_AUTO1_MAX_1
#define QUALITY_3DNR_NR_TBL_MA_AUTO_MAX_2	QUALITY_3DNR_NR_TBL_MA_AUTO1_MAX_2
#define QUALITY_3DNR_NR_TBL_MA_AUTO_MAX_3	QUALITY_3DNR_NR_TBL_MA_AUTO1_MAX_3
#define QUALITY_3DNR_NR_TBL_MA_AUTO_MAX_4	QUALITY_3DNR_NR_TBL_MA_AUTO1_MAX_4
#define QUALITY_3DNR_NR_TBL_MA_AUTO_MAX_5	QUALITY_3DNR_NR_TBL_MA_AUTO1_MAX_5
#define QUALITY_3DNR_NR_TBL_MA_AUTO_MAX_6	QUALITY_3DNR_NR_TBL_MA_AUTO1_MAX_6
#define QUALITY_3DNR_NR_TBL_MA_AUTO_MAX_7	QUALITY_3DNR_NR_TBL_MA_AUTO1_MAX_7

enum
{
    PQ_CONTRAST,
    PQ_BRIGHTNESS,
    PQ_SATURATION,
    PQ_HUE,
    PQ_MAX
};

enum
{
    SCE_BRI = 0,
    SCE_HUE,
    SCE_SAT,
    SCE_MAX
};

// XVYCC R/W Mode
enum
{
    OFF_MODE,
    RGB_MODE,
    R_MODE,
    G_MODE,
    B_MODE
};

///////////////////////////////////////////////////////////////////////////////////
extern UINT8 QUALITY_TBL[QUALITY_MAX];
UINT16 wReadQualityTable(UINT16 wAddr);
void wWriteQualityTable(UINT16 wAddr, UINT16 wData);

// For flash PQ architecture.
#define FROM_DFT		0xFFFF

/* Define the maximum number of items in custom quality table.
#ifndef CUSTOM_QTY_TBL_DIM
    #define CUSTOM_QTY_TBL_DIM	1024 // Change dimension number in drv_opt, not here.
#endif */

#ifdef SUPPORT_2ND_FLASHPQ
    #define FLASHPQ_NUM 2
#else
    #define FLASHPQ_NUM 1
#endif

#define VIDEO_GAIN_DFT              0x200
#define VIDEO_EXT_GAIN_DFT      0x254
#define VIDEO_EXT_GAIN_MAX      0x3FF
#define VIDEO_OFST_DFT              0x0
#define VIDEO_EXT_OFST_DFT      0x3C0
#define VIDEO_EXT_OFST_MAX      0x3FF
#define VIDEO_EXT_APL_UPPER_BOUND	200
#define VIDEO_EXT_APL_LOWER_BOUND	80
#define VIDEO_EXT_FIND_MAX_HIST_INDEX_TH	80
#define	ADAPTIVE_BACKLIGHT_FIND_MAX_HIST_INDEX_TH	1000

#define VIDEO_EXT_FRAME_COUNT	48

enum
{
    ADP_BACKLIGHT_HIGH_IDX = 0,
    ADP_BACKLIGHT_MIDDLE_IDX,
    ADP_BACKLIGHT_LOW_IDX,
    ADP_BACKLIGHT_END_IDX
};

/**
 * @ DFT_QTY	denotes the min, max, and default HW values of corresponding quality item.
 * 				These values are default setting for all of the video timing.
 */
enum
{
    DFT_QTY_MIN = 0,
    DFT_QTY_MAX,
    DFT_QTY_DFT,
    DFT_QTY_REFERENCE,
    DFT_QTY_ITEM,
    DFT_QTY_DIM
};

//typedef
typedef struct
{
    UINT8 bDftQtyMin;
    UINT8 bDftQtyMax;
    UINT8 bDftQtyDft;
    UINT16 wDftQtyRefenence;
    UINT16 wQtyItem;    
}tagDFT_QTY;

/**
 * @ MDY_QTY	denotes the min, max, and default HW values of corresponding quality item.
 * 				These values are dedicated to MDY_QTY_INDEX video timing.
 */
enum
{
    MDY_QTY_MIN = 0,
    MDY_QTY_MAX,
    MDY_QTY_DFT,
    MDY_QTY_INDEX,
    MDY_QTY_ITEM,
    MDY_QTY_DIM
};

/**
 * @ QTY_IDX_RANGE	denotes the range of quality index timing.
 */
enum
{
    QTY_IDX_RANGE_BEGIN = 0,
    QTY_IDX_RANGE_END,
    QTY_IDX_RANGE_DIM
};

enum
{
    REGISTER_CALLBACK,
    REGISTER_PATH,
    REGISTER_ON_OFF,
    REGISTER_APPLY_TIME,
    REGISTER_DIM,
};

enum
{
    DEMO_MODE_ARG_COMB,
    DEMO_MODE_ARG_HSHARP,
    DEMO_MODE_ARG_NR,
    DEMO_MODE_ARG_DI,
    DEMO_MODE_ARG_MJC,
    DEMO_MODE_BEFORE_SCALER_END
};

enum
{
    DEMO_MODE_ARG_2DSHARP,
    DEMO_MODE_ARG_MLC,
    DEMO_MODE_AFTER_SCALER_END
};

enum
{
	BL_STATE_POWEROFF,
    BL_STATE_POWERON,
    BL_STATE_OUTPUT_FR_CHANGE,
};

#define DFT_GAMMA_TABLE_SIZE	768     // 256*3
#define DFT_SCE_TABLE_SIZE		1456    // 360*4 + 16 (chroma comp)
#define DFT_QTY_TABLE_SIZE		256
#define DFT_QTY_TIMING_SIZE		12

#define QTY_TBL_REF_INDEX_SHIFT 14
#define FLASHPQ_ID		"PQHD"  // size: TBL_HEAD_ID_SIZE
#define FLASHPQ_ID_EX	"PQEX"  // size: TBL_HEAD_ID_SIZE
#define GAMMA_ID		"GAID"  // size: TBL_HEAD_ID_SIZE
#define SCE_ID			"SCID"  // size: TBL_HEAD_ID_SIZE
#define QTY_ID			"QTID"  // size: TBL_HEAD_ID_SIZE
#define OD_ID			"ODID"  // size: TBL_HEAD_ID_SIZE
#define PANEL_ID        "PSID"  // size: TBL_HEAD_ID_SIZE
#define RAW_ID			"RWID"  // size: TBL_HEAD_ID_SIZE
#define RAW_SUB_ID		"RSID"  // size: TBL_HEAD_ID_SIZE
#define REG_TABLE_ID	"RTID"  // size: TBL_HEAD_ID_SIZE
#define DATA_TABLE_ID	"RDID"	// size: TBL_HEAD_ID_SIZE
#define QTY_ITEM		"QUALITY ITEMS"
#define FLASH_PANEL_HASH     0x764E5E0C

#define QTY_ITEM_MAX	0xFFFF

#define TBL_FILE_ID_SIZE	6
#define FILE_HEAD_VER_SIZE	10

#define TBL_HEAD_ID_SIZE	    4
#define TBL_HEAD_CFG_SIZE	    4
#define TBL_HEAD_SCRIPT_SIZE	24
#define TBL_HEAD_DATE_SIZE		12
#define TBL_HEAD_HASH			4
#define TBL_HEAD_SIZE (TBL_HEAD_ID_SIZE+TBL_HEAD_CFG_SIZE+TBL_HEAD_SCRIPT_SIZE+TBL_HEAD_DATE_SIZE+TBL_HEAD_HASH)
#define TBL_LONG_PANEL_NAME_SIZE	48

#define TIMING_SCRIPT_SIZE	16
#define SMARTPIC_SCRIPT_SIZE	    16

typedef struct tagFileHead
{
    UINT8 bID[TBL_FILE_ID_SIZE];
	UINT8 bNumOfSmartPic;
    UINT8 bChipID;
    UINT16 wNumOfGamma;
    UINT16 wSizeOfGammaTable;
    UINT16 wNumOfSCE;
    UINT16 wSizeOfSCETable;
    UINT16 wNumOfQty;
    UINT16 wSizeOfQtyTable;
    UINT8 bNumOfTiming;
    UINT8 bQtyXmlVer[FILE_HEAD_VER_SIZE];
    UINT8 bRes;
    UINT16 wConfigOfOd;
    UINT16 wNumOfOd;
    UINT16 wSizeOfOdTable;    
    UINT16 wNumOfPanelTable;
    UINT16 wSizeOfPanelTable;
    // If add new items, should remove the size from bReserved
    // to keep the FILE HEAD 16 byte align
    UINT16 bFlashPQPassword;
    UINT32 dwConfigWord;
    UINT8 bNumOfSCEModel;
    UINT8 bNumOfSCESource;
	UINT16 wNumOfRawDataTable;
	UINT16 wRawDataTableSize;
    UINT8 bReserved[10];
} FLASH_PQ_FILE_HEAD;

typedef struct tagFlashTimAttribute
{
    //TIMnRO
    UINT16 u2FPTimr0He;
    UINT16 u2FPTimr0Hs;
    
    //TIMnR1
    UINT8 u1FPTimr1Hmrsel;
    UINT8 u1FPTimr1Hminv;
    UINT8 u1FPTimr1Hmnotgl;
    UINT8 u1FPTimr1Hmlcnt;
    UINT8 u1FPTimr1Hmhcnt;
    
    //TIMnR2
    UINT8 u1FPTimr2Htcsel;
    UINT16 u2FPTimr2Htf;
    UINT16 u2FPTimr2Htr;
    
    //TIMnR3
    UINT16 u2FPTimr3Ve;
    UINT16 u2FPTimr3Vs;
    
    //TIMnR4
    UINT8 u1FPTimr4Vmrsel;
    UINT8 u1FPTimr4Vminv;
    UINT8 u1FPTimr4Vmnotgl;
    UINT8 u1FPTimr4Vmlcnt;
    UINT8 u1FPTimr4Vmhcnt;
    
    //TIMnR5
    UINT8 u1FPTimr5Vtcsel;
    UINT16 u2FPTimr5Vtf;
    UINT16 u2FPTimr5Vtr;
    
    //TIMnR6
    UINT8 u1FPTimr6Tcinv;
    UINT8 u1FPTimr6LosEn;
    UINT8 u1FPTimr6PolEn;
    UINT8 u1FPTimr6HContEn;
    UINT8 u1FPTimr6Tcopr;
    
    //TIMnR7
    UINT8 u1FPTimr7Ften;
    UINT8 u1FPTimr7Fposttglen;
    UINT8 u1FPTimr7Fpretglen;
    UINT16 u2FPTimr7Ftf;
    UINT16 u2FPTimr7Ftr;

} PANEL_FLASH_TIM_ATTRIBUTE_T;

typedef struct tagFlashPanel
{
   
//TCON1
    //GR0
    UINT16 u2FPGr0TctgFcr;

    //GR4
    UINT8 u1FPGr4TgMuxselB15;
    UINT8 u1FPGr4TgMuxselB14;
    UINT8 u1FPGr4TgMuxselB13;
    UINT8 u1FPGr4TgMuxselB12;
    UINT8 u1FPGr4TgMuxselB11;
    UINT8 u1FPGr4TgMuxselB10;
    UINT8 u1FPGr4TgMuxselB9;
    UINT8 u1FPGr4TgMuxselB8;
    
    //GR5
    UINT8 u1FPGr5TgMuxselB7;
    UINT8 u1FPGr5TgMuxselB6;
    UINT8 u1FPGr5TgMuxselB5;
    UINT8 u1FPGr5TgMuxselB4;
    UINT8 u1FPGr5TgMuxselB3;
    UINT8 u1FPGr5TgMuxselB2;
    UINT8 u1FPGr5TgMuxselB1;
    UINT8 u1FPGr5TgMuxselB0;
    
    //GR6
    UINT8 u1FPGr6TgMode15;
    UINT8 u1FPGr6TgMode14;
    UINT8 u1FPGr6TgMode13;
    UINT8 u1FPGr6TgMode12;
    UINT8 u1FPGr6TgMode11;
    UINT8 u1FPGr6TgMode10;
    UINT8 u1FPGr6TgMode9;
    UINT8 u1FPGr6TgMode8;
    UINT8 u1FPGr6TgMode7;
    UINT8 u1FPGr6TgMode6;
    UINT8 u1FPGr6TgMode5;
    UINT8 u1FPGr6TgMode4;
    UINT8 u1FPGr6TgMode3;
    UINT8 u1FPGr6TgMode2;
    UINT8 u1FPGr6TgMode1;
    UINT8 u1FPGr6TgMode0;
    
    //TCSEL0
    UINT8 u1FPTcsel0TgOutsel15;
    UINT8 u1FPTcsel0TgOutsel14;
    UINT8 u1FPTcsel0TgOutsel13;
    UINT8 u1FPTcsel0TgOutsel12;
    UINT8 u1FPTcsel0TgOutsel11;
    UINT8 u1FPTcsel0TgOutsel10;
    UINT8 u1FPTcsel0TgOutsel9;
    UINT8 u1FPTcsel0TgOutsel8;
    
    //TCSEL1
    UINT8 u1FPTcsel1TgOutsel7;
    UINT8 u1FPTcsel1TgOutsel6;
    UINT8 u1FPTcsel1TgOutsel5;
    UINT8 u1FPTcsel1TgOutsel4;
    UINT8 u1FPTcsel1TgOutsel3;
    UINT8 u1FPTcsel1TgOutsel2;
    UINT8 u1FPTcsel1TgOutsel1;
    UINT8 u1FPTcsel1TgOutsel0;

    //TIM0RO ~ TIMBR7
    PANEL_FLASH_TIM_ATTRIBUTE_T rFPTim0;
    PANEL_FLASH_TIM_ATTRIBUTE_T rFPTim1;
    PANEL_FLASH_TIM_ATTRIBUTE_T rFPTim2;
    PANEL_FLASH_TIM_ATTRIBUTE_T rFPTim3;
    PANEL_FLASH_TIM_ATTRIBUTE_T rFPTim4;
    PANEL_FLASH_TIM_ATTRIBUTE_T rFPTim5;
    PANEL_FLASH_TIM_ATTRIBUTE_T rFPTim6;
    PANEL_FLASH_TIM_ATTRIBUTE_T rFPTim7;
    PANEL_FLASH_TIM_ATTRIBUTE_T rFPTim8;
    PANEL_FLASH_TIM_ATTRIBUTE_T rFPTim9;
    PANEL_FLASH_TIM_ATTRIBUTE_T rFPTimA;
    PANEL_FLASH_TIM_ATTRIBUTE_T rFPTimB;

//MLVDS
    UINT8 u1FPRgMlvdsRst9;
    UINT8 u1FPRgMlvdsRst8;
    UINT8 u1FPRgMlvdsRst7;
    UINT8 u1FPRgMlvdsRst6;
    UINT8 u1FPRgMlvdsRst5;
    UINT8 u1FPRgMlvdsRst4;
    UINT8 u1FPRgMlvdsRst3;
    UINT8 u1FPRgMlvdsRst2;
    UINT8 u1FPRgMlvdsRst1;
    UINT8 u1FPRgMlvdsRst0;

    UINT32 u4Reserve1;

//EPI
    //EPI_B0
    UINT8 u1FPRgPnSel;

    //EPI_B1
    UINT8 u1FPRgSwapOut5Sel;
    UINT8 u1FPRgSwapOut4Sel;
    UINT8 u1FPRgSwapOut3Sel;
    UINT8 u1FPRgSwapOut2Sel;
    UINT8 u1FPRgSwapOut1Sel;
    UINT8 u1FPRgSwapOut0Sel;

    //EPI_B7
    UINT8 u1FPRgCtrl2Self5;
    UINT8 u1FPRgCtrl2Self4;
    UINT8 u1FPRgCtrl2Self3;
    UINT8 u1FPRgCtrl2Self2;
    UINT8 u1FPRgCtrl2Self1;
    UINT8 u1FPRgCtrl2Self0;
    UINT8 u1FPRgCtrl1Self5;
    UINT8 u1FPRgCtrl1Self4;
    UINT8 u1FPRgCtrl1Self3;
    UINT8 u1FPRgCtrl1Self2;
    UINT8 u1FPRgCtrl1Self1;
    UINT8 u1FPRgCtrl1Self0;

    UINT8 u1Reserve2;

    //EPI_T0
    UINT16 u2FPRgCtr2RgcEn;
    UINT8 u1FPRgTco15Sel;
    UINT8 u1FPRgTco14Sel;
    UINT8 u1FPRgTco13Sel;
    UINT8 u1FPRgTco12Sel;
    UINT8 u1FPRgTco11Sel;
    UINT8 u1FPRgTco10Sel;
    UINT8 u1FPRgTco9Sel;
    UINT8 u1FPRgTco8Sel;
    UINT8 u1FPRgTco7Sel;
    UINT8 u1FPRgTco6Sel;
    UINT8 u1FPRgTco5Sel;
    UINT8 u1FPRgTco4Sel;
    UINT8 u1FPRgTco3Sel;
    UINT8 u1FPRgTco2Sel;
    UINT8 u1FPRgTco1Sel;
    UINT8 u1FPRgTco0Sel;

    UINT16 u2Reserve3;

    //EPI_T1
    UINT32 u4FPRgCtrStartDummy;
    UINT8 u1FPRgCtrStartInd;
    //EPI_T2
    UINT8 u1FPRgCtr1SoeStart;
    UINT16 u2FPRgCtr1Dummy;    
    UINT16 u2FPRgCtr1SoeWidth;    
    //EPI_T3
    UINT16 u2FPRgCtr2Rev2;
    UINT8 u1FPRgCtr2Polc;
    UINT8 u1FPRgCtr2GmaEn2;
    UINT8 u1FPRgCtr2GmaEn1;
    UINT8 u1FPRgCtr2Csc;
    UINT8 u1FPRgCtr2Gsp;
    UINT8 u1FPRgCtr2Rev1;
    UINT8 u1FPRgCtr2Pwrc2;
    UINT8 u1FPRgCtr2Pwrc1;
    UINT8 u1FPRgCtr2Ltd2;
    UINT8 u1FPRgCtr2Ltd1;
    UINT8 u1FPRgCtr2H2dot;
    UINT8 u1FPRgCtr2Mode;
    UINT8 u1FPRgCtr2Pol; 
    //EPI_T4
    UINT8 u1FPRgDataStartInd;
    UINT16 u2Reserve4;    
    UINT32 u4FPRgDataStartDummy;

    //EPI_T20
    UINT32 u4FPRgCtrl10;
    UINT32 u4FPRgCtrl11;
    UINT32 u4FPRgCtrl12;
    UINT32 u4FPRgCtrl13;
    UINT32 u4FPRgCtrl14;
    UINT32 u4FPRgCtrl15;
    UINT32 u4FPRgCtrl20;
    UINT32 u4FPRgCtrl21;
    UINT32 u4FPRgCtrl22;
    UINT32 u4FPRgCtrl23;
    UINT32 u4FPRgCtrl24;
    UINT32 u4FPRgCtrl25;

//Swing and Skew
    UINT8 u1FPRgLVDSBTvo;
    UINT8 u1FPRgLVDSBTvcm;

    UINT8 u1FPRgLVDSATvo;
    UINT8 u1FPRgLVDSATvcm;

    UINT8 u1FPRgVpllDlyData;

    UINT8 u1Reserve[16];

}PANEL_FLASH_DATA_ATTRIBUTE_T;

typedef struct tagSWInfo
{
    UINT32 dwSwGammaEnable;
    UINT32 dwSwSceEnable;
    UINT32 dwSwQtyEnable;
    UINT32 dwSwQtyMinMaxEnable;
    UINT32 dwSwQtySmartPicEnable;
    UINT32 dwSwQtySmartPicNewModeEnable;
}FLASH_PQ_SW_INFO;

typedef struct tagFlashInfo
{
    UINT32 dwFlashBasePartition;
    UINT32 dwFlashBaseAddress;
    UINT32 dwFlashOffset;
    UINT32 dwFlashBlockSize;
}FLASH_PQ_FLASH_INFO;

typedef struct tagTblHead
{
    UINT8 bID[TBL_HEAD_ID_SIZE];
    UINT8 bConfig[TBL_HEAD_CFG_SIZE];
    UINT8 bScript[TBL_HEAD_SCRIPT_SIZE];
    UINT8 bDate[TBL_HEAD_DATE_SIZE];
	UINT8 bHash[TBL_HEAD_HASH];
} FLASH_PQ_TABLE_HEAD;

typedef struct tagTblHead_Ex
{
	UINT8 bID[TBL_HEAD_ID_SIZE];
	UINT8 bConfig[TBL_HEAD_CFG_SIZE];
	UINT8 bScript[TBL_LONG_PANEL_NAME_SIZE];
	UINT8 bSubScript[TBL_LONG_PANEL_NAME_SIZE];
	UINT8 bDate[TBL_HEAD_DATE_SIZE];
	UINT8 bHash[TBL_HEAD_HASH];
	UINT8 bReserved[8];	
} FLASH_GAMMA_SCE_TABLE_HEAD_EX;

typedef struct tagLongPanelName
{
    UINT8 bScript[TBL_LONG_PANEL_NAME_SIZE];
}PANEL_LONG_NAME;

typedef struct tagRawDataTblSubHead
{
	UINT8 bID[TBL_HEAD_ID_SIZE];
	UINT16 u2Index;
	UINT16 u2CaseNum;
	UINT16 u2RegNum;
	UINT16 u2DataSize;   
	UINT32 u4TblOffset;
	UINT8 bScript[TBL_HEAD_SCRIPT_SIZE];	
	UINT8 bReserved[8];
} RAWDATA_SUBHEADER;

typedef struct tagRawDataTblHead
{
    UINT8 bID[TBL_HEAD_ID_SIZE];
	UINT8 bDataVersion[FILE_HEAD_VER_SIZE];	
	UINT8 bReserved[2];
} RAWDATA_HEADER;

enum RESERVED_BYTE
{
    RES_SUPPORT_QTY_TIMING_DESCRIPT = 0x01,	// [0]
    RES_02		                    = 0x02, // [1]
    RES_SUPPORT_QTY_MAX_MIN			= 0x04, // [2]
    RES_SUPPORT_SMARTPIC_DESCRIPT   = 0x08,	// [3]
    RES_SUPPORT_QTY_HASH			= 0x10,	// [4]
    RES_SUPPORT_LONG_PANEL_NAME = 0x20,              // [5]
    RES_40 = 0x40,              // [6]
    RES_80 = 0x80,              // [7]
};

enum FEATURE_CONFIG
{
    FC_SUPPORT_SCE_BY_SOURCE = 0x01,  // [0]
    FC_02 = 0x02, // [1]
    FC_04 = 0x04, // [2]
    FC_08 = 0x08, // [3]
    FC_10 = 0x10, // [4]
    FC_20 = 0x20, // [5]
    FC_40 = 0x40, // [6]
    FC_80 = 0x80, // [7]
};
enum HEAD_INFO
{
	HD_ID,
	HD_SCRIPT,
	HD_SUB_SCRIPT,
	HD_DATE,
	HD_HASH
	
};
enum FLASHPQ_TYPE
{
    TYPE_PQ_HEADER = 0,
    TYPE_GAMMA_HEADER,
    TYPE_SCE_HEADER,
    TYPE_QTY_HEADER,
    TYPE_QTY_DESCRIPT,
    TYPE_QTY_CONTENT,
    TYPE_OD_HEADER,
    TYPE_SMARTPIC_DESCRIPT,
    TYPE_PANEL_HEADER,
    TYPE_RAWDATA_HEADER,
    TYPE_FILE_END
};

enum FLASHPQ_VER
{
    FLASHPQ_XML_VER,
    FLASHPQ_GAMMA_VER,
    FLASHPQ_SCE_VER,
    FLASHPQ_QTY_VER,    
    FLASHPQ_OD_VER
};

typedef enum
{
	RAWDATA_TBL_HEAD = 0,
	RAWDATA_REG_TBL_HEAD,
	RAWDATA_REG_TBL_CONTENT,
	RAWDATA_DATA_TBL_HEAD,
	RAWDATA_DATA_TBL_SCRIPT,
	RAWDATA_DATA_TBL_CONTENT,
	RAWDATA_TBL_END,
} RAWDATA_TYPE;

typedef struct
{
    UINT16 u2RegNum;    
    UINT16 u2DataSize;
    UINT32* pRegTbl;
    UINT8*  pDataTbl;
} RAWDATA_INFO;

/** 
 *  min, max, default values of UI video quality item.
 */
typedef struct _PE_UI_RANGE_T
{
    INT32 i4Min;
    INT32 i4Max;
    INT32 i4Dft;
} PE_UI_RANGE_T;

// Video plane argument.
// Don't forget to sync with MTVDO_ARG_TYPE_T in mtvdo.h
// and ucPeUiType in api_peui.c
typedef enum
{
	PE_ARG_BRIGHTNESS=0,
	PE_ARG_CONTRAST,
	PE_ARG_HUE,
	PE_ARG_SATURATION,
	PE_ARG_CTI,
	PE_ARG_SHARPNESS,
	PE_ARG_SHARPNESS_H,
	PE_ARG_SHARPNESS_V,
	PE_ARG_LTI,
	PE_ARG_R_GAIN,
	PE_ARG_G_GAIN,
	PE_ARG_B_GAIN,
	PE_ARG_R_OFFSET,
	PE_ARG_G_OFFSET,
	PE_ARG_B_OFFSET,
	PE_ARG_NR,
	PE_ARG_GAMMA,
	PE_ARG_WHITE_PEAK_LMT,
	PE_ARG_SCE,
	PE_ARG_SKIN_COLOR,
	PE_ARG_ADAPTIVE_LUMA,
	PE_ARG_BACK_LIGHT_LVL,
	PE_ARG_ADAPTIVE_BACK_LIGHT,
	PE_ARG_3D_NR,
	PE_ARG_DEMO,
	PE_ARG_DI_FILM_MODE,
	PE_ARG_DI_MA,
	PE_ARG_DI_EDGE_PRESERVE,
	PE_ARG_MJC_MODE,
	PE_ARG_MJC_EFFECT,
	PE_ARG_MJC_DEMO,
	PE_ARG_XVYCC,
	PE_ARG_WCG,
	PE_ARG_GAME_MODE,
	PE_ARG_BLUE_STRETCH,
	PE_ARG_MPEG_NR,
	PE_ARG_BLACK_STRETCH,
	PE_ARG_WHITE_STRETCH,
	PE_ARG_SHARPNESS_ON_OFF,
    PE_ARG_SUPERRESOLUTION_ON_OFF,	
	PE_ARG_OPC_CURVE,
	PE_ARG_LCDIM,	
	PE_ARG_TDTV_PACKING,
	PE_ARG_TDTV_INVERSE,
	PE_ARG_TDTV_DEPTH,
	PE_ARG_TDTV_3D_TO_2D,
	PE_ARG_TDTV_FPR,
	PE_ARG_TDTV_PROTRUDE,
	PE_ARG_TDTV_DISTANCE,
	PE_ARG_TDTV_OSD_DEPTH,	
	PE_ARG_MODULE_ONOFF,
	PE_ARG_NS
} PE_ARG_TYPE;

// Video update by register event.
typedef enum
{
    PE_EVENT_START,
    // PreProc : Before Scaler
	PE_EVENT_COLOR_TRANSFORM,	
    // PostProc : Before MJC
	PE_EVENT_SCE,       // This is the first item before MJC, don't change this position 
    PE_EVENT_SCE_PAT,
	PE_EVENT_SCALER_H,
	PE_EVENT_SCALER_V,
    PE_EVENT_SCALER_PE,
	PE_EVENT_LUMA_CURVE,
	PE_EVENT_LUMA_SEC_CURVE,
	PE_EVENT_SHARPNESS,
 	PE_EVENT_XVYCC,
	PE_EVENT_XVYCC2,
 	PE_EVENT_XVYCC_GAMMA, 	
 	PE_EVENT_XVYCC_ANTIGAMMA, 	
 	PE_EVENT_XVYCC_MATRIX, 	
	PE_EVENT_XVRGB_GAIN,
	// Outsatage : After MJC 
	// Note : RGB gain offset and Gamma already have double buffer
	PE_EVENT_OPC_CURVE, // This is the first item after MJC, don't change this position	
	PE_EVENT_OD,    // apply OD table	
	PE_EVENT_DITHER,
    PE_EVENT_NS                      
} PE_EVENT_TYPE;

typedef struct _PE_UI_RANGE_ITEM
{
    PE_ARG_TYPE rPQItemType;
    PE_UI_RANGE_T rPQItemRange;
} PE_UI_RANGE_ITEM;

typedef struct _PE_UI_RANGE_TBL
{
    PE_UI_RANGE_ITEM** ptUiPicMinMaxDftTbl;
    UINT8 bSmartPicNum;
    UINT8 bUIPQItemNum;
} PE_UI_RANGE_TBL;

#define PE_EVENT_BEFORE_SCALER      PE_EVENT_SCE
#define PE_EVENT_BEFORE_MJC         PE_EVENT_OPC_CURVE

#endif /* _PE_TABLE_H_ */


