////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
// All rights reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @file  chiispstatsdefs.h
///
/// @brief Qualcomm Technologies, Inc. 3A/ISP Stats definitions
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef CHIISPSTATSDEFS_H
#define CHIISPSTATSDEFS_H

#include "chistatsproperty.h"
#include "camxdefs.h"
#include "camxcdktypes.h"

#ifdef __cplusplus

extern "C"
{
#endif // __cplusplus

/// @brief Data structures that are exposed to OEM must be packed to have the expected layout.
#pragma pack(push, CDK_PACK_SIZE)

/// @todo (CAMX-1838) move hardware dependent parameters from common header
/// @brief BHist HW data
static const UINT32 MaxBHistBinNum                      = 1024; ///< Max stats number for Bayer Histogram
static const UINT32 StatsBHistBinSize                   = 4;    ///< Max Bayer Histogram bin size
static const UINT32 MaxBHistChannelNum                  = 4;    ///< Max channel number for bhist

/// @brief AWB BG HW data
static const INT32 MaxAWBBGStatsNum                     = 3888; ///< Max ROIs for AWB BG is 72x54,
                                                                ///  usually we only use 64x48

/// @brief AWBR GS HW data
static const INT32 MaxGSStatsNum                        = 1024; ///< Max ROIs for AWBR GS is 32x32

/// @brief tintless BG HW data
static const UINT32 MaxTintlessBGStatsNum               = 3072; ///< Max ROIs for Tintless BG is 64x48

/// @brief ALSC BG HW data
static const UINT32 MaxALSCBGStatsNum                   = 3072; ///< Max ROIs for ALSC BG is 64x48

/// @brief tintless BG HW data
static constexpr UINT32 MaxIRBGStatsNum                 = 3072; ///< Max ROIs for IR BG is 64x48????

/// @brief HDRBE HW data
static const UINT32 MaxHDRBEStatsNum                    = 3072; ///< Max ROIs for HDR BE is 64x48

/// @brief AECBE HW data
static const UINT32 MaxAECBEStatsNum                    = 4096; ///< Max ROIs for HDR BE is 64x64

/// @brief IHist HW data
static const UINT32 NumIHistBins                        = 256;  ///< Number of Bins in Image Histogram

/// @brief HDRBHist HW data
static const UINT32 MaxHDRBHistChannelNum               = 3;    ///< Max channel number for HDR BHist
static const UINT32 NumHDRBHistBins                     = 256;  ///< Number of Bins used in HDR Bayer Histogram
static const UINT32 StatsHDRBHistBinSize                = 4;    ///< Max HDR Bayer Histogram bin size (bytes)

/// @brief RS & CS HW data
static const UINT32 MaxCSHorizRegions                   = 1560; ///< Max number of CS horizontal regions
static const UINT32 MaxCSVertRegions                    = 4;    ///< Max number of CS vertical regions
static const UINT32 MaxRSHorizRegions                   = 16;   ///< Maximum number of RS Horizontal regions
static const UINT32 MaxRSVertRegions                    = 1024; ///< Maximum number of RS vertical regions
static const UINT32 MaxRS16HorizRegions                 = 8;    ///< Maximum number of RS v1.6 Horizontal regions
static const UINT32 MaxRS16VertRegions                  = 1024; ///< Maximum number of RS v1.6 vertical regions

/// @brief LTM DC HW data
static const UINT32 MaxLTMDCSize                        = 130 * 3;  ///< 13 x 10 x 3 entries Maximum num of LTM DC data size

/// @brief LTM Hist HW data
static constexpr UINT32 MaxLTMHistSize                  = 25 * 19;  ///< 25 x 19 entries Maximum num of LTM Hist data size

/// @brief TMC constants, shared with systems team
static const UINT32 MAX_TMC_LUT_KNEE_LENGTH_TMC10       = 4;    ///< Maximum TMC LUT knee length for TMC10
static const UINT32 MAX_TMC_LUT_KNEE_LENGTH_TMC11       = 5;    ///< Maximum TMC LUT knee length for TMC11
static const UINT32 MAX_TMC_LUT_KNEE_LENGTH_TMC12       = 5;    ///< Maximum TMC LUT knee length for TMC12
static const UINT32 MAX_TMC_LUT_KNEE_LENGTH_TMC13       = 5;    ///< Maximum TMC LUT knee length for TMC13
static const UINT32 MAX_TMC_LUT_KNEE_LENGTH_TMC141      = 7;    ///< Maximum TMC LUT knee length for TMC14

static const UINT32 MAX_TMC_LUT_COEF_SIZE               = 6;    ///< Maximum TMC LUT coef size
static const UINT32 MAX_TMC_LUT_PCHIP_COEF_SIZE         = 9;    ///< Maximum TMC LUT PCHIP coef size
static const UINT32 MAX_TMC_LUT_PCHIP_COEF_SIZE_TMC141  = 15;   ///< Maximum TMC LUT PCHIP coef size for tmc14

static const UINT32 MAX_TMC_CONTRAST_CURVE              = 1024; ///< Maximum TMC contrast curve
static const UINT32 MAX_TMC_HIST_BIN_NUM                = 1024; ///< Maximum TMC histogram bin number

static const UINT32 MAX_TMC_CURVES                      = 2;    ///< Maximum number of TMC curve

/// @brief HDR10+ Hist HW data
static const UINT32 MaxHHistBinNum          = 1024;     ///< Max stats number for Bayer Histogram

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief This enumeration represents what type of stats are collected.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef enum
{
    ISPStatsTypeUndefined,                      ///< Undefined
    ISPStatsTypeBF,                             ///< BF stats
    ISPStatsTypeCAF,                            ///< CAF stats
    ISPStatsTypeDualPDHWPDAF,                   ///< Dual PD HW PDAF
    ISPStatsTypeDualPDHWPDAFSecondary,          ///< Secondary dual PD HW PDAF for synced buffer
    ISPStatsTypeHDRBE,                          ///< HDR BE stats
    ISPStatsTypeAECBE,                          ///< BE stats
    ISPStatsTypeBHist,                          ///< BHistogram stats
    ISPStatsTypeHDRBHist,                       ///< HDR BHistogram stats
    ISPStatsTypeRS,                             ///< RS stats
    ISPStatsTypeBayerRS,                        ///< Bayer RS stats
    ISPStatsTypeCS,                             ///< CS stats
    ISPStatsTypeAWBBG,                          ///< AWB BG stats
    ISPStatsTypeTintlessBG,                     ///< Tintless BG stats
    ISPStatsTypeIHist,                          ///< Image Histogram stats
    ISPStatsTypeRDIPDAF,                        ///< RDIPDAF
    ISPStatsTypeRDIPDAF2,                       ///< RDIPDAF2
    ISPStatsTypePDAFType3,                      ///< PDAF Type3
    ISPStatsTypeBPSAWBBG,                       ///< BPS AWB BG stats
    ISPStatsTypeRDIRaw,                         ///< RDI Raw buffer for advance sparse PD
    ISPStatsTypeRDIStats,                       ///< RDI stats
    ISPStatsTypeLCRHWStats,                     ///< LCR HW stats
    ISPStatsTypeBPSRegYUV,                      ///< YUV frame to be processed in StatsParser
    ISPStatsTypeLongHDRBE,                      ///< Long HDRBE
    ISPStatsTypeLongAECBE,                      ///< Long BE
    ISPStatsTypeLongBHist,                      ///< Long BHIST
    ISPStatsTypeLongHDRBHist,                   ///< Long HDRBHIST
    ISPStatsTypeLongRS,                         ///< Long RS
    ISPStatsTypeLongBayerRS,                    ///< Long Bayer RS
    ISPStatsTypeLongAWBBG,                      ///< Long AWBBG
    ISPStatsTypeLongBF,                         ///< Long BF
    ISPStatsTypeLongCAF,                        ///< Long CAF
    ISPStatsTypeShortHDRBE,                     ///< Short HDRBE
    ISPStatsTypeShortAECBE,                     ///< Short BE
    ISPStatsTypeShortBHist,                     ///< Short BHIST
    ISPStatsTypeShortHDRBHist,                  ///< Short HDRBHIST
    ISPStatsTypeShortRS,                        ///< SHORT RS
    ISPStatsTypeShortBayerRS,                   ///< SHORT Bayer RS
    ISPStatsTypeShortAWBBG,                     ///< Short AWBBG
    ISPStatsTypeShortBF,                        ///< Short BF
    ISPStatsTypeShortCAF,                       ///< Short CAF
    ISPStatsTypeLongTintlessBG,                 ///< Long Tintless BG stats
    ISPStatsTypeShortTintlessBG,                ///< Short Tintless BG stats
    ISPStatsTypeLongIHist,                      ///< Long Image Histogram stats
    ISPStatsTypeShortIHist,                     ///< Short Image Histogram stats
    ISPStatsTypeRDISensorMeta,                  ///< Sensor meta data for temperature, OIS info etc.
    ISPStatsTypeLongBPSAWBBG,                   ///< Long BPS AWB BG Stats
    ISPStatsTypeBFW,                            ///< BFW Stats
    ISPStatsTypeShortBFW,                       ///< BFW Stats
    ISPStatsTypeLongBFW,                        ///< BFW Stats
    ISPStatsTypeLTMDC,                          ///< LTM DC stats
    ISPStatsTypePreProcessedPDHWPDAF,           ///< Pre-Processed PD stat from PD HW
    ISPStatsTypePreProcessedPDHWPDAFSecondary,  ///< Secondary pre-Processed PD stat from PD HW for synced buffer
    ISPStatsTypeT3RDIPD,                        ///< T3 raw PD pixel stat
    ISPStatsTypeDualPDHWPDAFExposure1,          ///< Exposure1 Dual PD HW PDAF
    ISPStatsTypeDualPDHWPDAFExposure2,          ///< Exposure2 Dual PD HW PDAF
    ISPStatsTypeDualPDHWPDAFExposure3,          ///< Exposure3 Dual PD HW PDAF
    ISPStatsTypeDualPDHWPDAFSecondaryExposure1, ///< Secondary exposure1 Dual PD HW PDAF for synced buffer
    ISPStatsTypePreProcessedPDHWPDAFExposure1,  ///< Exposure1 Pre-Processed PD stat from PD HW
    ISPStatsTypePreProcessedPDHWPDAFExposure2,  ///< Exposure2 Pre-Processed PD stat from PD HW
    ISPStatsTypePreProcessedPDHWPDAFExposure3,  ///< Exposure3 Pre-Processed PD stat from PD HW
    ISPStatsTypeLCRHWExposure1,                 ///< Exposure1 LCR HW stats
    ISPStatsTypeLCRHWExposure2,                 ///< Exposure2 LCR HW stats
    ISPStatsTypeLCRHWExposure3,                 ///< Exposure3 LCR HW stats
    ISPStatsTypeRDIPDAFExposure1,               ///< Exposure1 RAW PD pixel
    ISPStatsTypeRDIPDAFExposure2,               ///< Exposure2 RAW PD pixel
    ISPStatsTypeRDIPDAFExposure3,               ///< Exposure3 RAW PD pixel
    ISPStatsTypeRDIPDAF2Exposure1,              ///< Exposure1 RAW PD pixel
    ISPStatsTypeRDIPDAF2Exposure2,              ///< Exposure2 RAW PD pixel
    ISPStatsTypeRDIPDAF2Exposure3,              ///< Exposure3 RAW PD pixel
    ISPStatsTypeT3RDIPDExposure1,               ///< Exposure1 RAW PD pixel for type 3 sensor
    ISPStatsTypeT3RDIPDExposure2,               ///< Exposure2 RAW PD pixel for type 3 sensor
    ISPStatsTypeT3RDIPDExposure3,               ///< Exposure3 RAW PD pixel for type 3 sensor
    ISPStatsTypeRDIRawExposure1,                ///< RDI Raw buffer for advance sparse PD/LCR SW. Only one exposure support
    ISPStatsTypeAECBHist,                       ///< AEC Bhist
    ISPStatsTypeLongAECBHist,                   ///< Long AEC Bhist
    ISPStatsTypeShortAECBHist,                  ///< Short AEC Bhist
    ISPStatsTypeHDR10PLUS,                      ///< HDR10 plus stats
    ISPStatsTypeParsedPDHWPDAF,                 ///< Parsed PD HW output
    ISPStatsTypeParsedPDHWPDAFSecondary,        ///< Secondary parsed PD HW output for synced buffer
    ISPStatsTypeParsedPDHWPDAFExposure1,        ///< Exposure1 Parsed PD HW output
    ISPStatsTypeParsedPDHWPDAFExposure2,        ///< Exposure2 Parsed PD HW output
    ISPStatsTypeParsedPDHWPDAFExposure3,        ///< Exposure3 Parsed PD HW output
    ISPStats4ChannelBHist,                      ///< Parse Stats for 4Channel BHist
    ISPStatsType2ChannelLongAECBHist,           ///< Parse Stats for AEB Mode
    ISPStatsTypeALSCBG,                         ///< ALSC BG stats
    ISPStatsTypeLongALSCBG,                     ///< Long ALSC BG stats
    ISPStatsTypeShortALSCBG,                    ///< Short ALSC BG stats
    ISPStatsTypeGSstats,                        ///< Grid stats
    ISPStatsTypeParsedPDHWPDAFSecondaryExposure1,       ///< Secondary exposure1 Parsed PD HW output for synced buffer
    ISPStatsTypePreProcessedPDHWPDAFSecondaryExposure1, ///< Secondary exposure1 Pre-Processed PD stat from PD HW
                                                        ///  for synced buffer
    ISPStatsTypeRDIPDAF3,                       ///< RDIPDAF3
    ISPStatsTypeRDIPDAF3Exposure1,              ///< Exposure1 RAW PD pixel
    ISPStatsTypeRDIPDAF3Exposure2,              ///< Exposure2 RAW PD pixel
    ISPStatsTypeRDIPDAF3Exposure3,              ///< Exposure3 RAW PD pixel
    ISPStatsTypeMuxerProcessedGSstats,
    ISPStatsTypeGTMBHist,                       ///< GTM Bhist Stats
    ISPStatsTypeAECBEIR,                        ///< AEC IR BE
    ISPStatsTypeAECBHistIR,                     ///< AEC IR Bhist
    ISPStatsTypeAWBBGIR,                        ///< AWB IR BG
    ISPStatsTypeMax,                                    ///< Max type of stats available
} ISPStatsType;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief This enumeration represents which pixels to be used for HDR mode stats collection
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef enum
{
    StatsHDRModeExposureAll,      ///< All pixels
    StatsHDRModeExposureLong,     ///< Long pixels
    StatsHDRModeExposureShort,    ///< Short pixels
} StatsHDRMode;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief This enumeration represents id saturated stats are collected.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef enum
{
    BGExtendedFieldsNone,         ///< No saturation
    BGExtendedFieldsSaturated,    ///< Saturated
} BGExtendedFields;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief This structure is used to pass the calculated Bayer grid statistics from the ISP.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef struct
{
    UINT32 regionHorizNum;                             ///< Horizontal number of regions for the BG. 64, max 72.
    UINT32 regionVertNum;                              ///< Vertical number of regions for the BG. 48, max 54.
    UINT32 regionPixelCnt;                             ///< The count of the region pixels.
    UINT32 regionHeight;                               ///< The height of each region.
    UINT32 regionWidth;                                ///< The width of each region.
    UINT16 redMax;                                     ///< The max for red channel.
    UINT16 blueMax;                                    ///< The max for blue channel.
    UINT16 greenRedMax;                                ///< The max for green-red channel.
    UINT16 greenBlueMax;                               ///< The max for green-blue channel.
    UINT32 redSum[MaxAWBBGStatsNum];                   ///< Array with the sums for the red pixels.
    UINT32 blueSum[MaxAWBBGStatsNum];                  ///< Array with the sums for the blue pixels.
    UINT32 greenRedSum[MaxAWBBGStatsNum];              ///< Array with the sums for the green-red pixels.
    UINT32 greenBlueSum[MaxAWBBGStatsNum];             ///< Array with the sums for the green-blue pixels.
    UINT32 redNum[MaxAWBBGStatsNum];                   ///< Array with the number of the red pixels.
    UINT32 blueNum[MaxAWBBGStatsNum];                  ///< Array with the number of the blue pixels.
    UINT32 greenRedNum[MaxAWBBGStatsNum];              ///< Array with the number of the green-red pixels.
    UINT32 greenBlueNum[MaxAWBBGStatsNum];             ///< Array with the number of the green-blue pixels.

    UINT32 redSaturatedSum[MaxAWBBGStatsNum];          ///< Array with the saturated sums for the red pixels.
    UINT32 blueSaturatedSum[MaxAWBBGStatsNum];         ///< Array with the saturated sums for the blue pixels.
    UINT32 greenRedSaturatedSum[MaxAWBBGStatsNum];     ///< Array with the saturated sums for the green-red pixels.
    UINT32 greenBlueSaturatedSum[MaxAWBBGStatsNum];    ///< Array with the saturated sums for the green-blue pixels.
    UINT32 redSaturatredNum[MaxAWBBGStatsNum];         ///< Array with the number of the saturated red pixels.
    UINT32 blueSaturatedNum[MaxAWBBGStatsNum];         ///< Array with the number of the saturated blue pixels.
    UINT32 greenRedSaturatedNum[MaxAWBBGStatsNum];     ///< Array with the number of the saturated green-red pixels.
    UINT32 greenBlueSaturatedNum[MaxAWBBGStatsNum];    ///< Array with the number of the saturated green-blue pixels.

    UINT32 extendedFields;                             ///< Represents whether certain extended fields are present.
                                                       ///  BGExtendedFields lists the possible supported fields.
} BGStatsOutput;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief this structure is used to pass the calculated Bayer grid statistics from the ISP.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

typedef struct
{
    ColorChannel    channelType;                        ///< the channel type
    UINT32          numBins;                            ///< Num of bins containing valid data
    UINT32          BHistogramStats[MaxBHistBinNum];    ///< Array containing the histogram values
    UINT64          requestID;                          ///< frame for which stats were generated
    BOOL            uniform;                            ///< Select bin uniformity
} ParsedBHistStatsOutput;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief this structure is used to pass the calculated HDR10+ hist statistics from the IPE.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef struct {
    UINT32  maxrbg_hist_stats[MaxHHistBinNum];  // hist of stats,  10b
    UINT32  max_r;                              // max r value
    UINT32  max_g;                              // max g value
    UINT32  max_b;                              // max b value
} HDR10PFrameBHist;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief this structure is used to pass the calculated Bayer grid statistics from the ISP.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

typedef struct
{
    UINT32            numBins;            ///< Num of bins containing valid data
    HDR10PFrameBHist  HHistogramStats;    ///< Array containing the histogram values
    UINT64            requestID;          ///< frame for which stats were generated
} ParsedHDR10pStatsOutput;


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Image histogram statistics data
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef struct
{
    UINT16 YCCHistogram[NumIHistBins];      ///< Array containing the either the Y, Cb or Cr histogram values
    UINT16 greenHistogram[NumIHistBins];    ///< Array containing the green histogram values
    UINT16 blueHistogram[NumIHistBins];     ///< Array containing the blue histogram values
    UINT16 redHistogram[NumIHistBins];      ///< Array containing the red histogram values
} IHistStatsOutput;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief This structure is used to pass the parsed stats
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef struct
{
    IHistStatsOutput    imageHistogram; ///< Image histogram statistics data
    UINT32              numBins;        ///< Number of bins per channel
    UINT64              requestID;      ///< frame for which stats were generated
} ParsedIHistStatsOutput;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief HDR Bayer Histogram statistics data
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef struct
{
    UINT32  redHistogram[NumHDRBHistBins];      ///< Array containing the red histogram values.
    UINT32  greenHistogram[NumHDRBHistBins];    ///< Array containing the green histogram values.
    UINT32  blueHistogram[NumHDRBHistBins];     ///< Array containing the blue histogram values.
} HDRBHistStatsOutput;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief This structure is used to pass the parsed HDR Bayer Histogram (HDRBHist) stats from stats parser.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef struct
{
    HDRBHistStatsOutput HDRBHistStats;  ///< HDR Bayer Histogram statistics data
    UINT32              numBins;        ///< Number of bins per channel
    UINT64              requestID;      ///< frame for which stats were generated
} ParsedHDRBHistStatsOutput;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief This structure is used to pass the parsed LTMDC stats from stats parser.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef struct
{
    UINT32 LTMDCStats[MaxLTMDCSize];  ///< LTMDC statistics data
} LTMDCStatsOutput;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief This structure is used to pass the parsed HDR Bayer Histogram (HDRBHist) stats from stats parser.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef struct
{
    LTMDCStatsOutput LTMDCStats;    ///< LTM DC Statics data
    UINT64           requestID;     ///< frame for which stats were generated
} IFELTMDCStatsOutput;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 /// @brief This structure is used to pass the parsed LTMHist stats from stats parser.
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 typedef struct
 {
     UINT32 LTMHistStats[MaxLTMHistSize];  ///< LTMDCHist statistics data
 } LTMHistStatsOutput;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief This structure is used to pass the parsed HDR Bayer Histogram (HDRBHist) stats from stats parser.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef struct
{
    LTMDCStatsOutput   LTMDCStats;    ///< LTM DC Statics data
    LTMHistStatsOutput LTMHistStats;  ///< LTM DC Statics data
    UINT64             requestID;     ///< frame for which stats were generated
} IFELTMDCHistStatsOutput;

/// @brief This structure is populated with per channel parsed AWB BG stats non-saturation information.
typedef struct
{
    UINT64      RSum;           ///< Red sum of the pixel
    UINT64      BSum;           ///< Blue sum of the pixel
    union
    {
        UINT64  GRSum;          ///< GreenRed sum of the pixel
        UINT64  GSum;           ///< Green sum of the pixel
    };
    UINT64      GBSum;          ///< GreenBlue sum of the pixel
    UINT64      YSum;           ///< Y sum of the pixel

    UINT16      RCount;         ///< Red count of the pixel
    UINT16      BCount;         ///< Blue count of the pixel
    union
    {
        UINT16  GRCount;        ///< GreenRed count of the pixel
        UINT16  GCount;         ///< Green count of the pixel
    };
    UINT16      GBCount;        ///< GreenBlue count of the pixel
    UINT16      YCount;         ///< Y count of the pixel
} AWBBGChannelData;

/// @brief This structure is populated with per channel parsed AWB BG stats with saturation information.

typedef struct AWBBGChannelDataWithSat_S : public AWBBGChannelData
{
    UINT64    saturatedRSum;    ///< Red saturated sum of the pixel
    UINT64    saturatedBSum;    ///< Blue saturated sum of the pixel
    UINT64    saturatedGRSum;   ///< GreenRed saturated sum of the pixel
    UINT64    saturatedGBSum;   ///< GreenBlue saturated sum of the pixel
    UINT64    saturatedYSum;    ///< Y saturated sum of the pixel

    UINT16    saturatedRCount;  ///< Red saturated count of the pixel
    UINT16    saturatedBCount;  ///< Blue saturated count of the pixel
    UINT16    saturatedGRCount; ///< GreenRed saturated count of the pixel
    UINT16    saturatedGBCount; ///< GreenBlue saturated count of the pixel
    UINT16    saturatedYCount;  ///< Y saturated count of the pixel
} AWBBGChannelDataWithSat;


/// @brief This structure is used to pass the parsed AWB Bayer Grid (AWB BG) stats from stats parser.
typedef struct ParsedAWBBGStatsOutput_t
{
    struct
    {
        UINT32      usesY       : 1;
        UINT32      hasSatInfo  : 1;
        UINT32      reserved    : 30;
    } flags;

    UINT32  numROIs;                                    ///< number of valid entries
    UINT32  horizontal_num;                             ///< number of horizontal entries
    UINT32  vertical_num;                               ///< number of vertical entries
    UINT32  channelGainThreshold[ChannelIndexCount];    ///< Channel Gain Threshold
    FLOAT   BLStretchFactor;                            ///< Stretch factor for IFE stats prior to BLS.
    UINT32  m_statsBitWidth;                            ///< Stats Bit Width

    inline AWBBGChannelData* GetChannelData(UINT32 index, UINT32 hasSatInfo)
    {
        if (hasSatInfo)
        {
            return &m_channelDataWithSat[index];
        }
        else
        {
            return &m_channelData[index];
        }
    }

    inline AWBBGChannelData* GetChannelData(UINT32 index)
    {
        if (flags.hasSatInfo)
        {
            return  &m_channelDataWithSat[index];
        }
        else
        {
            return &m_channelData[index];
        }
    }

    inline VOID * GetChannelDataArray()
    {
        return &m_channelData;
    }

    inline UINT32 GetChannelGainThreshold(UINT32 index)
    {
        return channelGainThreshold[index];
    }

    inline VOID SetChannelGainThreshold(const UINT32 threshold[])
    {
        channelGainThreshold[ChannelIndexR]  = threshold[ChannelIndexR];
        channelGainThreshold[ChannelIndexB]  = threshold[ChannelIndexB];
        channelGainThreshold[ChannelIndexGR] = threshold[ChannelIndexGR];
        channelGainThreshold[ChannelIndexGB] = threshold[ChannelIndexGB];
    }

    inline VOID SetChannelData(AWBBGChannelData* pAWBBGChannelData, UINT32 index, UINT32 hasSatInfo)
    {
        if (hasSatInfo)
        {
            m_channelDataWithSat[index] = *(static_cast<AWBBGChannelDataWithSat*>(pAWBBGChannelData));
        }
        else
        {
            m_channelData[index] = *pAWBBGChannelData;
        }
    }

    inline VOID SetStatsBitWidth(UINT32 bitWidth)
    {
        m_statsBitWidth = bitWidth;
    }

private:
    union {
      AWBBGChannelData            m_channelData[MaxAWBBGStatsNum];            ///< the stats data
      AWBBGChannelDataWithSat     m_channelDataWithSat[MaxAWBBGStatsNum];     ///< the stats data
    };
} ParsedAWBBGStatsOutput;

typedef AWBBGChannelData        ALSCBGChannelData;
typedef AWBBGChannelDataWithSat ALSCBGChannelDataWithSat;
typedef ParsedAWBBGStatsOutput  ParsedALSCBGStatsOutput;

/// @brief This structure is populated with per channel parsed AWB-R GS stats non-saturation information.
typedef struct
{
    UINT64      RSum;           ///< Red sum of the pixel
    UINT64      BSum;           ///< Blue sum of the pixel
    UINT64      GSum;           ///< Green sum of the pixel
    UINT64      YSum;           ///< Y sum of the pixel
    UINT16      RCount;         ///< Red count of the pixel
    UINT16      BCount;         ///< Blue count of the pixel
    UINT16      GCount;         ///< Green count of the pixel
    UINT16      YCount;         ///< Y count of the pixel
} GSStatsChannelData;

/// @brief This structure is used to pass the parsed AWB-R (Grid stats) from stats parser.
typedef struct ParsedGSStatsOutput_t
{
    UINT32  numROIs;                                    ///< number of valid entries
    UINT32  horizontal_num;                             ///< number of horizontal entries
    UINT32  vertical_num;                               ///< number of vertical entries
    UINT32  channelGainThreshold[ChannelIndexCount];    ///< Channel Gain Threshold

    inline GSStatsChannelData* GetChannelData(UINT32 index)
    {
            return &m_channelData[index];
    }

    inline VOID * GetChannelDataArray()
    {
        return &m_channelData;
    }

    inline UINT32 GetChannelGainThreshold(UINT32 index)
    {
        return channelGainThreshold[index];
    }

    inline VOID SetChannelGainThreshold(UINT32 threshold[])
    {
        channelGainThreshold[ChannelIndexR]  = threshold[ChannelIndexR];
        channelGainThreshold[ChannelIndexB]  = threshold[ChannelIndexB];
        channelGainThreshold[ChannelIndexG]  = threshold[ChannelIndexG];
    }

    inline VOID SetChannelData(GSStatsChannelData* pGSStatsChannelData, UINT32 index)
    {
        m_channelData[index] = *pGSStatsChannelData;
    }

private:
    union {
      GSStatsChannelData          m_channelData[MaxGSStatsNum];            ///< the stats data
    };
} ParsedGSStatsOutput;

CAMX_BEGIN_PACKED
/// @brief This structure is used to pass the Tintless less BG non-saturation stats per Region.
typedef struct TintlessBGStatsInfo
{
    UINT64      RSum;           ///< Red sum of the pixel
    UINT64      BSum;           ///< Blue sum of the pixel
    union
    {
        UINT64  GRSum;          ///< GreenRed sum of the pixel
        UINT64  GSum;           ///< Green sum of the pixel
    };
    UINT64      GBSum;          ///< GreenBlue sum of the pixel
    UINT64      YSum;           ///< Y sum of the pixel

    UINT16      RCount;         ///< Red count of the pixel
    UINT16      BCount;         ///< Blue count of the pixel
    union
    {
        UINT16  GRCount;        ///< GreenRed count of the pixel
        UINT16  GCount;         ///< Green count of the pixel
    };
    UINT16      GBCount;        ///< GreenBlue count of the pixel
    UINT16      YCount;         ///< Y count of the pixel
}CAMX_PACKED TintlessBGStatsInfo;


/// @brief This structure is used to pass the Tintless less BG stats with saturation per Region.
typedef struct TintlessBGStatsInfoWithSat : public TintlessBGStatsInfo
{
    UINT64 SaturationRSum;  ///< Red saturated sum of the pixel
    UINT64 SaturationBSum;  ///< Blue saturated sum of the pixel
    UINT64 SaturationGRSum; ///< GreenRed saturated sum of the pixel
    UINT64 SaturationGBSum; ///< GreenBlue saturated sum of the pixel
    UINT64 SaturationYSum;  ///< Y saturated sum of the pixel


    UINT16 SaturationRCount;  ///< Red saturated count of the pixel
    UINT16 SaturationBCount;  ///< Blue saturated count of the pixel
    UINT16 SaturationGRCount; ///< GreenRed saturated count of the pixel
    UINT16 SaturationGBCount; ///< GreenBlue saturated count of the pixel
    UINT16 SaturationYCount;  ///< Y saturated count of the pixel

} CAMX_PACKED TintlessBGStatsInfoWithSat;

CAMX_END_PACKED

/// @brief This structure is used to pass the parsed Tintless Bayer Grid (TintlessBG) stats from stats parser.
typedef struct ParsedTintlessBGStatsOutput_t
{
    struct
    {
        UINT32 hasYStats           : 1;  ///< Has Y channel Stats
        UINT32 hasSaturationPixels : 1;  ///< Has Saturated Pixels
        UINT32 reserved            : 30; ///< Reserved Fileds
    } m_flags;

    UINT32  m_numOfRegions;                ///< Total number of stats regions
    UINT32  m_statsBitWidth;               ///< Stats Bit Width
    UINT32  m_channelGainThreshold[ChannelIndexCount];  //< Channel Gain Threshold
    FLOAT   BLStretchFactor;               ///< Stretch factor for IFE stats prior to BLS.

    inline const TintlessBGStatsInfo* GetTintlessBGStatsInfo(UINT32 index) const
    {
        if (0 == m_flags.hasSaturationPixels)
        {
            return &m_stats[index];
        }
        else
        {
            return &m_statsWithSat[index];
        }
    }

    inline TintlessBGStatsInfo* GetMutableTintlessBGStatsInfo(UINT32 index)
    {
        if (0 == m_flags.hasSaturationPixels)
        {
            return &m_stats[index];
        }
        else
        {
            return &m_statsWithSat[index];
        }
    }

    inline UINT32 GetChannelGainThreshold(UINT32 index)
    {
        return m_channelGainThreshold[index];
    }

    inline VOID SetChannelGainThreshold(const UINT32 channelGainThreshold[])
    {
        m_channelGainThreshold[ChannelIndexR] = channelGainThreshold[ChannelIndexR];
        m_channelGainThreshold[ChannelIndexB] = channelGainThreshold[ChannelIndexB];
        m_channelGainThreshold[ChannelIndexGR] = channelGainThreshold[ChannelIndexGR];
        m_channelGainThreshold[ChannelIndexGB] = channelGainThreshold[ChannelIndexGB];
    }

    inline UINT32 GetStatsBitWidth()
    {
        return m_statsBitWidth;
    }

    inline VOID SetStatsBitWidth(UINT32 bitWidth)
    {
        m_statsBitWidth = bitWidth;
    }

    inline VOID* GetTintlessBGStatsInfoArray()
    {
        return m_stats;
    }

    inline VOID SetTintlessBGStatsInfo(UINT32 index, const TintlessBGStatsInfo* in)
    {
        if (NULL != in)
        {
            if (0 == m_flags.hasSaturationPixels)
            {
                m_stats[index] = *in;
            }
            else
            {
                m_statsWithSat[index] = *(reinterpret_cast<const TintlessBGStatsInfoWithSat*>(in));
            }
        }
    }

private:
    union
    {
        TintlessBGStatsInfoWithSat  m_statsWithSat[MaxTintlessBGStatsNum]; ///< Array of TintlessBG saturation stats Info
        TintlessBGStatsInfo         m_stats[MaxTintlessBGStatsNum];        ///< Array of TintlessBG full stats info
    };
} ParsedTintlessBGStatsOutput;

/// @brief This structure is used to pass the IR BG non-saturation stats per Region.
typedef struct
{
    UINT64      RSum;           ///< Red sum of the pixel
    UINT64      BSum;           ///< Blue sum of the pixel
    union
    {
        UINT64  GRSum;          ///< GreenRed sum of the pixel
        UINT64  GSum;           ///< Green sum of the pixel
    };
    UINT64      GBSum;          ///< GreenBlue sum of the pixel
    UINT64      YSum;           ///< Y sum of the pixel

    UINT16      RCount;         ///< Red count of the pixel
    UINT16      BCount;         ///< Blue count of the pixel
    union
    {
        UINT16  GRCount;        ///< GreenRed count of the pixel
        UINT16  GCount;         ///< Green count of the pixel
    };
    UINT16      GBCount;        ///< GreenBlue count of the pixel
    UINT16      YCount;         ///< Y count of the pixel
}IRBGChannelData;

/// @brief This structure is used to pass the IR BG stats with saturated per Region.
typedef struct IRBGChannelDataWithSat_S : public IRBGChannelData
{
    UINT64 saturatedRSum;  ///< Red saturated sum of the pixel
    UINT64 saturatedBSum;  ///< Blue saturated sum of the pixel
    UINT64 saturatedGRSum; ///< GreenRed saturated sum of the pixel
    UINT64 saturatedGBSum; ///< GreenBlue saturated sum of the pixel
    UINT64 saturatedYSum;  ///< Y saturated sum of the pixel

    UINT16 saturatedRCount;  ///< Red saturated count of the pixel
    UINT16 saturatedBCount;  ///< Blue saturated count of the pixel
    UINT16 saturatedGRCount; ///< GreenRed saturated count of the pixel
    UINT16 saturatedGBCount; ///< GreenBlue saturated count of the pixel
    UINT16 saturatedYCount;  ///< Y saturated count of the pixel

} CAMX_PACKED IRBGChannelDataWithSat;

/// @brief This structure is used to pass the parsed IR Bayer Grid (IRBG) stats from stats parser.
struct ParsedIRBGStatsOutput //k2c_debug: should i use class or struct?
{
public:
    struct ParsedIRBGStatsFlags
    {
        UINT32 hasYStats           : 1;  ///< Has Y channel Stats
        UINT32 hasSaturationPixels : 1;  ///< Has Saturated Pixels
        UINT32 reserved            : 30; ///< Reserved Fileds
    };
    ParsedIRBGStatsFlags m_flags;

    UINT32  m_numROIs;                            ///< Total number of stats regions
    UINT32  m_statsBitWidth;                           ///< Stats Bit Width
    UINT32  m_channelGainThreshold[ChannelIndexCount]; ///< Channel Gain Threshold
    FLOAT   BLStretchFactor;                           ///< Stretch factor for IFE stats prior to BLS.

    inline const IRBGChannelData* GetIRBGChannelData(UINT32 index) const
    {
        if (0 == m_flags.hasSaturationPixels)
        {
            return &m_stats[index];
        }
        else
        {
            return &m_statsWithSat[index];
        }
    }

    inline IRBGChannelData* GetMutableIRBGChannelData(UINT32 index)
    {
        if (0 == m_flags.hasSaturationPixels)
        {
            return &m_stats[index];
        }
        else
        {
            return &m_statsWithSat[index];
        }
    }

    inline  constexpr UINT32 GetChannelGainThreshold(UINT32 index)
    {
        return m_channelGainThreshold[index];
    }

    inline VOID SetChannelGainThreshold(const UINT32 channelGainThreshold[])
    {
        m_channelGainThreshold[ChannelIndexR]  = channelGainThreshold[ChannelIndexR];
        m_channelGainThreshold[ChannelIndexB]  = channelGainThreshold[ChannelIndexB];
        m_channelGainThreshold[ChannelIndexGR] = channelGainThreshold[ChannelIndexGR];
        m_channelGainThreshold[ChannelIndexGB] = channelGainThreshold[ChannelIndexGB];
    }

    inline constexpr UINT32 GetStatsBitWidth()
    {
        return m_statsBitWidth;
    }

    inline  const VOID SetStatsBitWidth(UINT32 bitWidth)
    {
        m_statsBitWidth = bitWidth;
    }

    inline constexpr VOID* GetChannelDataArray()
    {
        return m_stats;
    }

    inline VOID SetIRBGChannelData(UINT32 index, const IRBGChannelData* in)
    {
        if (NULL != in)
        {
            if (0 == m_flags.hasSaturationPixels)
            {
                m_stats[index] = *in;
            }
            else
            {
                m_statsWithSat[index] = *(reinterpret_cast<const IRBGChannelDataWithSat*>(in));
            }
        }
    }

private:
    union
    {
        IRBGChannelDataWithSat  m_statsWithSat[MaxIRBGStatsNum]; ///< Array of IRBG saturation stats Info
        IRBGChannelData         m_stats[MaxIRBGStatsNum];        ///< Array of IRBG full stats info
    };
};

/// @brief This structure is populated with per channel parsed HDR BE stats non-saturation information.
typedef struct
{
    UINT64      RSum;           ///< Red sum of the pixel
    UINT64      BSum;           ///< Blue sum of the pixel
    union
    {
        UINT64  GRSum;          ///< GreenRed sum of the pixel
        UINT64  GSum;           ///< Green sum of the pixel
    };
    UINT64      GBSum;          ///< GreenBlue sum of the pixel
    UINT64      YSum;           ///< Y sum of the pixel

    UINT16      RCount;         ///< Red count of the pixel
    UINT16      BCount;         ///< Blue count of the pixel
    union
    {
        UINT16  GRCount;        ///< GreenRed count of the pixel
        UINT16  GCount;         ///< Green count of the pixel
    };
    UINT16      GBCount;        ///< GreenBlue count of the pixel
    UINT16      YCount;         ///< Y count of the pixel
} HDRBEChannelData;

/// @brief This structure is populated with per channel parsed HDR BE stats with saturation information.
typedef struct HDRBEChannelDataWithSat_S : public HDRBEChannelData
{
    UINT64    saturatedRSum;    ///< Red saturated sum of the pixel
    UINT64    saturatedBSum;    ///< Blue saturated sum of the pixel
    UINT64    saturatedGRSum;   ///< GreenRed saturated sum of the pixel
    UINT64    saturatedGBSum;   ///< GreenBlue saturated sum of the pixel
    UINT64    saturatedYSum;    ///< Y saturated sum of the pixel

    UINT16    saturatedRCount;  ///< Red saturated count of the pixel
    UINT16    saturatedBCount;  ///< Blue saturated count of the pixel
    UINT16    saturatedGRCount; ///< GreenRed saturated count of the pixel
    UINT16    saturatedGBCount; ///< GreenBlue saturated count of the pixel
    UINT16    saturatedYCount;  ///< Y saturated sum of the pixel

} HDRBEChannelDataWithSat;

/// @brief This structure is used to pass the calculated HDR Bayer Exposure (HDR BE) statistics from the ISP.
typedef struct ParsedHDRBEStatsOutput_t
{
    struct
    {
        UINT32      usesY       : 1;
        UINT32      hasSatInfo  : 1;
        UINT32      reserved    : 30;
    } flags;

    UINT32 numROIs;                          ///< number of valid entries
    FLOAT  BLStretchFactor;                  ///< Stretch factor for IFE stats prior to BLS.

    inline HDRBEChannelData  GetChannelData(UINT32 index, UINT32 hasSatInfo)
    {
        if (hasSatInfo)
        {
            return  m_channelDataWithSat[index];
        }
        else
        {
            return m_channelData[index];
        }
    }

    inline HDRBEChannelData GetChannelData(UINT32 index)
    {
        if (flags.hasSatInfo)
        {
            return  m_channelDataWithSat[index];
        }
        else
        {
            return m_channelData[index];
        }
    }

    inline VOID * GetChannelDataArray()
    {
        return &m_channelData;
    }

    inline VOID SetChannelData(HDRBEChannelData* pHDRBEChannelData, UINT32 index, UINT32 hasSatInfo)
    {
        if (hasSatInfo)
        {
            m_channelDataWithSat[index] = *(static_cast<HDRBEChannelDataWithSat*>(pHDRBEChannelData));
        }
        else
        {
            m_channelData[index] = *pHDRBEChannelData;
        }
    }

private:
    union {
      HDRBEChannelData           m_channelData[MaxHDRBEStatsNum];           ///< the stats data
      HDRBEChannelDataWithSat    m_channelDataWithSat[MaxHDRBEStatsNum];    ///< the stats data
    };
} ParsedHDRBEStatsOutput;

/// @brief This structure is used to pass the calculated HDR Bayer Exposure (HDR BE) statistics from the ISP.
typedef struct ParsedBEStatsOutput_t
{
    struct
    {
        UINT32      usesY       : 1;
        UINT32      hasSatInfo  : 1;
        UINT32      reserved    : 30;
    } flags;

    UINT32              numROIs;                          ///< number of valid entries

    inline HDRBEChannelData  GetChannelData(UINT32 index, UINT32 hasSatInfo)
    {
        if (hasSatInfo)
        {
            return  m_channelDataWithSat[index];
        }
        else
        {
            return m_channelData[index];
        }
    }

    inline HDRBEChannelData GetChannelData(UINT32 index)
    {
        if (flags.hasSatInfo)
        {
            return  m_channelDataWithSat[index];
        }
        else
        {
            return m_channelData[index];
        }
    }

    inline VOID * GetChannelDataArray()
    {
        return &m_channelData;
    }

    inline VOID SetChannelData(HDRBEChannelData* pHDRBEChannelData, UINT32 index, UINT32 hasSatInfo)
    {
        if (hasSatInfo)
        {
            m_channelDataWithSat[index] = *(static_cast<HDRBEChannelDataWithSat*>(pHDRBEChannelData));
        }
        else
        {
            m_channelData[index] = *pHDRBEChannelData;
        }
    }

private:
    union {
      HDRBEChannelData           m_channelData[MaxAECBEStatsNum];           ///< the stats data
      HDRBEChannelDataWithSat    m_channelDataWithSat[MaxAECBEStatsNum];    ///< the stats data
    };
} ParsedBEStatsOutput;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief This structure is used to pass the calculated Bayer Focus (BF) statistics from the ISP.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef struct
{
    UINT64                  frameTag;                                 ///< 64-bit frame-tag programmed by SW for the region
    UINT64                  horizontal1Sum[BFMaxROIRegions];          ///< Sum of pixels in H1 filter
    UINT64                  horizontal2Sum[BFMaxROIRegions];          ///< Sum of pixels in H2 filter
    UINT64                  verticalSum[BFMaxROIRegions];             ///< Sum of pixels in V filter
    UINT64                  horizontal1Sharpness[BFMaxROIRegions];    ///< Sharpness of pixels in H1 filter
    UINT64                  horizontal2Sharpness[BFMaxROIRegions];    ///< Sharpness of pixels in H2 filter
    UINT64                  verticalSharpness[BFMaxROIRegions];       ///< Sharpness of pixels in V filter
    UINT32                  horizontal1Num[BFMaxROIRegions];          ///< Number of pixels in H1 filter
    UINT32                  horizontal2Num[BFMaxROIRegions];          ///< Number of pixels in H2 filter
    UINT32                  verticalNum[BFMaxROIRegions];             ///< Number of pixels in V filter
    UINT32                  regionID[BFMaxROIRegions];                ///< Region ID
    UINT32                  region[BFMaxROIRegions];                  ///< Region is the primary/secondary
    UINT32                  numOfROIRegions;                          ///< Number of BF ROI regions
    UINT32                  gridWidth[BFMaxROIRegions];               ///< Each grid Width
    UINT32                  gridHeight[BFMaxROIRegions];              ///< Each grid Height
    UINT32                  hCount;                                   ///< Number of horizontal regions
    UINT32                  vCount;                                   ///< Number of vertical regions
} ParsedBFStatsOutput;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief This structure is used to pass the calculated Bayer Focus 2.7 (BF) statistics from the ISP.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef struct
{
    UINT64                  frameTag;                                   ///< 64-bit frame-tag programmed by SW for the region
    UINT64                  horizontal1Sum[BF27MaxROIRegions];          ///< Sum of pixels in H1 filter
    UINT64                  horizontal2Sum[BF27MaxROIRegions];          ///< Sum of pixels in H2 filter
    UINT64                  verticalSum[BF27MaxROIRegions];             ///< Sum of pixels in V filter
    UINT64                  horizontal1Sharpness[BF27MaxROIRegions];    ///< Sharpness of pixels in H1 filter
    UINT64                  horizontal2Sharpness[BF27MaxROIRegions];    ///< Sharpness of pixels in H2 filter
    UINT64                  verticalSharpness[BF27MaxROIRegions];       ///< Sharpness of pixels in V filter
    UINT32                  horizontal1Num[BF27MaxROIRegions];          ///< Number of pixels in H1 filter
    UINT32                  horizontal2Num[BF27MaxROIRegions];          ///< Number of pixels in H2 filter
    UINT32                  verticalNum[BF27MaxROIRegions];             ///< Number of pixels in V filter
    UINT32                  regionID[BF27MaxROIRegions];                ///< Region ID
    UINT32                  region[BF27MaxROIRegions];                  ///< Region is the primary/secondary
    UINT32                  numOfROIRegions;                            ///< Number of BF ROI regions
    UINT32                  gridWidth[BF27MaxROIRegions];               ///< Each grid Width
    UINT32                  gridHeight[BF27MaxROIRegions];              ///< Each grid Height
    UINT32                  hCount;                                     ///< Number of horizontal regions
    UINT32                  vCount;                                     ///< Number of vertical regions
} ParsedBF27StatsOutput;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief This structure is used to pass the calculated Contrast Focus (CAF) statistics from the ISP.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef struct
{
    UINT64                  horizontal1Sum[CAFMaxGridRegions];          ///< Sum of pixels in H1 filter
    UINT64                  horizontal2Sum[CAFMaxGridRegions];          ///< Sum of pixels in H2 filter
    UINT64                  verticalSum[CAFMaxGridRegions];             ///< Sum of pixels in V filter
    UINT64                  horizontal1Sharpness[CAFMaxGridRegions];    ///< Sharpness of pixels in H1 filter
    UINT64                  horizontal2Sharpness[CAFMaxGridRegions];    ///< Sharpness of pixels in H2 filter
    UINT64                  verticalSharpness[CAFMaxGridRegions];       ///< Sharpness of pixels in V filter
    UINT32                  horizontal1Num[CAFMaxGridRegions];          ///< Number of pixels in H1 filter
    UINT32                  horizontal2Num[CAFMaxGridRegions];          ///< Number of pixels in H2 filter
    UINT32                  verticalNum[CAFMaxGridRegions];             ///< Number of pixels in V filter
    UINT32                  regionID[CAFMaxGridRegions];                ///< Region ID
    UINT32                  region[CAFMaxGridRegions];                  ///< Region is the primary/secondary
    UINT32                  numOfROIRegions;                           ///< Number of CAF ROI regions
    UINT32                  gridWidth[CAFMaxGridRegions];              ///< Each grid Width
    UINT32                  gridHeight[CAFMaxGridRegions];             ///< Each grid Height
    UINT32                  hCount;                                    ///< Number of horizontal regions
    UINT32                  vCount;                                    ///< Number of vertical regions
} ParsedCAFStatsOutput;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief This structure is used to pass the calculated Bayer Floatinf Window (BFW) statistics from the ISP.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef struct
{
    UINT64                  unsaturatedRSum[BFWMaxRoiRgnCount];       ///< Sum of R  region unsaturated
    UINT64                  unsaturatedGrSum[BFWMaxRoiRgnCount];      ///< Sum of Gr region unsaturated
    UINT64                  unsaturatedGbSum[BFWMaxRoiRgnCount];      ///< Sum of Gb region unsaturated
    UINT64                  unsaturatedBSum[BFWMaxRoiRgnCount];       ///< Sum of B  region unsaturated
    UINT64                  unsaturatedYSum[BFWMaxRoiRgnCount];       ///< Sum of Y  region unsaturated
    UINT64                  saturatedRSum[BFWMaxRoiRgnCount];         ///< Sum of R  region saturated
    UINT64                  saturatedGrSum[BFWMaxRoiRgnCount];        ///< Sum of Gr region saturated
    UINT64                  saturatedGbSum[BFWMaxRoiRgnCount];        ///< Sum of Gb region saturated
    UINT64                  saturatedBSum[BFWMaxRoiRgnCount];         ///< Sum of B  region saturated
    UINT64                  saturatedYSum[BFWMaxRoiRgnCount];         ///< Sum of Y  region saturated
    UINT16                  unsaturatedRCount[BFWMaxRoiRgnCount];     ///< Count of R  region unsaturated
    UINT16                  unsaturatedGrCount[BFWMaxRoiRgnCount];    ///< Count of Gr region unsaturated
    UINT16                  unsaturatedGbCount[BFWMaxRoiRgnCount];    ///< Count of Gb region unsaturated
    UINT16                  unsaturatedBCount[BFWMaxRoiRgnCount];     ///< Count of B  region unsaturated
    UINT16                  unsaturatedYCount[BFWMaxRoiRgnCount];     ///< Count of Y  region unsaturated
    UINT16                  saturatedRCount[BFWMaxRoiRgnCount];       ///< Count of R  region saturated
    UINT16                  saturatedGrCount[BFWMaxRoiRgnCount];      ///< Count of Gr region saturated
    UINT16                  saturatedGbCount[BFWMaxRoiRgnCount];      ///< Count of Gb region saturated
    UINT16                  saturatedBCount[BFWMaxRoiRgnCount];       ///< Count of B  region saturated
    UINT16                  saturatedYCount[BFWMaxRoiRgnCount];       ///< Count of Y  region saturated
    UINT16                  numOfROIRegions;                          ///< Number of BF ROI regions
    UINT16                  regionID[BFWMaxRoiRgnCount];              ///< Region ID
} ParsedBFWStatsOutput;


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief This structure is used to pass the calculated Column Sum (CS) statistics from the ISP.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
struct ParsedCSStatsOutput
{
    UINT64  frameTag;                                       ///< 64-bit frame - tag programmed by SW for the region
    UINT32  columnSum[MaxCSHorizRegions][MaxCSVertRegions]; ///< Array containing column sum of pixel values
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief This structure is used to pass the calculated Row Sum (RS) statistics from the ISP.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
struct ParsedRSStatsOutput
{
    UINT64  frameTag;                                             ///< 64-bit frame - tag programmed by SW for the region
    UINT32  rowSum[MaxRSHorizRegions][MaxRSVertRegions];          ///< Array containing row sum of pixel values;
    UINT32  pixelCount[MaxRS16HorizRegions][MaxRS16VertRegions];  ///< Array containing pixel count
    UINT32  calculatedShiftByISP;                                 ///< Value of default Shift calculated by ISP
    UINT32  actualShift;                                          ///< Value of actual Shift provided by 3A
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief this structure is used to pass the region statistics from the ISP stats modules.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef struct
{
    BOOL    isValid;              ///< Is this valid
    UINT32  horizRegionsStart;    ///< Start of the horizontal region
    UINT32  horizRegionsEnd;      ///< End of the horizontal region
    UINT32  horizRegionsTotal;    ///< Number of horizontal regions
    UINT32  vertRegionsTotal;     ///< Number of vertical regions
} ISPRegionsStatsParams;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief this structure is used to pass the ROI statistics from the ISP stats modules.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
typedef struct
{
    UINT32 regionWidth;          ///< Region width
    UINT32 regionHeight;         ///< Region height
    UINT32 regionHorizOffset;    ///< Region horizontal offset
    UINT32 regionVertOffset;     ///< Region vertical offset
    UINT32 regionHorizNum;       ///< Number of horizontal regions
    UINT32 regionVertNum;        ///< Number of vertical regions
    UINT16 redMax;               ///< max R
    UINT16 greenRedMax;          ///< max Gr
    UINT16 blueMax;              ///< max B
    UINT16 greenBlueMax;         ///< max Gb
} ISPStatsROIParams;

/// @brief Structure to pass the AWB BG configuration to ISP and write back if any adjustment made by ISP
typedef struct
{
    BGBEConfig  AWBBGConfig;    ///< AWB BG configuration from stats and this can be overwritten if the requested
                                ///  configuration cannot be fulfilled in the case of hardware limitations or certain
                                ///  conflicting requirements.
    BOOL        isAdjusted;     ///< Indicate if IFE made any adjustment for the requested configuration data.
    UINT32      regionWidth;    ///< AWB individual region width
    UINT32      regionHeight;   ///< AWB individual region height
} ISPAWBBGStatsConfig;

/// @brief Structure to pass the HDR BE configuration to ISP and write back if any adjustment made be ISP
typedef struct
{
    BGBEConfig  HDRBEConfig;    ///< HDR BE configuration from stats and this can be overwritten if the requested
                                ///  configuration cannot be fulfilled in the case of hardware limitations or certain
                                ///  conflicting requirements.
    BOOL        isAdjusted;     ///< Indicate if IFE made any adjustment for the requested configuration data.
    UINT32      regionWidth;    ///< HDR BE individual region width
    UINT32      regionHeight;   ///< HDR BE individual region height
} ISPHDRBEStatsConfig;

/// @brief Structure to pass the AEC BE configuration to ISP and write back if any adjustment made be ISP
typedef struct
{
    BGBEConfig  AECBEConfig;    ///< AEC BE configuration from stats and this can be overwritten if the requested
                                ///  configuration cannot be fulfilled in the case of hardware limitations or certain
                                ///  conflicting requirements.
    BOOL        isAdjusted;     ///< Indicate if IFE made any adjustment for the requested configuration data.
    UINT32      regionWidth;    ///< AEC BE individual region width
    UINT32      regionHeight;   ///< AEC BE individual region height
} ISPAECBEStatsConfig;


/// @brief Structure to pass the Image Histogram configuration to ISP and write back if any adjustment made by ISP
typedef struct
{
    HDRBHistConfig  HDRBHistConfig; ///< HDR BHist configuration from stats and this can be overwritten if the requested
                                    ///  configuration cannot be fulfilled in the case of hardware limitations or certain
                                    ///  conflicting requirements.
    UINT32          numBins;        ///< Number of bins in the histograms.
    BOOL            isAdjusted;     ///< Indicate if IFE made any adjustment for the requested configuration data.
    UINT64          requestID;      ///< frame for which stats were generated
} ISPHDRBHistStatsConfig;

/// @brief Structure to pass the BF configuration to ISP and write back if any adjustment made be ISP
typedef struct
{
    AFConfigParams  BFConfig;   ///< BF stats configuration from stats and this can be overwritten if the requested
                                ///  configuration cannot be fulfilled in the case of hardware limitations or certain
                                ///  conflicting requirements.
    BOOL            isAdjusted; ///< Indicate if IFE made any adjustment for the requested configuration data.
} ISPBFStatsConfig;

/// @brief Structure to pass the CAF configuration to ISP and write back if any adjustment made be ISP
typedef struct
{
    CAFConfigParams  CAFConfig;  ///< CAF stats configuration from stats and this can be overwritten if the requested
                                 ///  configuration cannot be fulfilled in the case of hardware limitations or certain
                                 ///  conflicting requirements.
    BOOL             isAdjusted; ///< Indicate if IFE made any adjustment for the requested configuration data.
} ISPCAFStatsConfig;

/// @brief Structure to pass the LTMDC configuration to ISP and write back if any adjustment made be ISP
typedef struct
{
    BOOL   DCEnable;              ///< flag for DC enable
    UINT8  DCConvStartCellX;      ///< Convolution start cell
    UINT8  DCConvEndCellX;        ///< Convolution end cell
} ISPLTMDCStatsConfig;


/// @brief Structure to pass the BFW configuration to ISP and write back if any adjustment made be ISP
typedef struct
{
    BFWStatsConfigParams  BFWConfig;  ///< BFW stats configuration from stats and this can be overwritten if the requested
                                      ///  configuration cannot be fulfilled in the case of hardware limitations or certain
                                      ///  conflicting requirements.
    BOOL                  isAdjusted; ///< Indicate if IFE made any adjustment for the requested configuration data.
} ISPBFWStatsConfig;

/// @brief Structure to pass the Image Histogram configuration to ISP and write back if any adjustment made by ISP
typedef struct
{
    IHistStatsConfig    IHistConfig;    ///< Image Histogram configuration from stats and this can be overwritten if the
                                        ///  requested configuration cannot be fulfilled in the case of hardware limitations or
                                        ///  certain conflicting requirements.
    UINT32              numBins;        ///< Number of bins in the histograms.
    UINT64              requestID;      ///< frame for which stats were generated
} ISPIHistStatsConfig;

/// @brief Structure to pass the BHist configuration to ISP and write back if any adjustment made be ISP
typedef struct
{
    BHistConfig BHistConfig;    ///< BHist stats configuration from stats and this can be overwritten if the requested
                                ///  configuration cannot be fulfilled in the case of hardware limitations or certain
                                ///  conflicting requirements.
    UINT32      numBins;        ///< Num of bins containing valid data
    BOOL        isAdjusted;     ///< Indicate if IFE made any adjustment for the requested configuration data.
    UINT64      requestID;      ///< frame for which stats were generated
} ISPBHistStatsConfig;

/// @brief Structure to pass the BHist configuration to ISP and write back if any adjustment made be ISP
typedef struct
{
    BHistConfig BHistConfig;    ///< BHist stats configuration from stats and this can be overwritten if the requested
                                ///  configuration cannot be fulfilled in the case of hardware limitations or certain
                                ///  conflicting requirements.
    UINT32      numBins;        ///< Num of bins containing valid data
    BOOL        isAdjusted;     ///< Indicate if IFE made any adjustment for the requested configuration data.
    UINT64      requestID;      ///< frame for which stats were generated
} ISPAECBHistStatsConfig;

typedef struct
{
   BHistConfig BHistConfig;    ///< BHist stats configuration from stats and this can be overwritten if the requested
                               ///  configuration cannot be fulfilled in the case of hardware limitations or certain
                               ///  conflicting requirements.
   UINT32      numBins;        ///< Num of bins containing valid data
   BOOL        isAdjusted;     ///< Indicate if IFE made any adjustment for the requested configuration data.
   UINT64      requestID;      ///< frame for which stats were generated
} ISPIRBHistStatsConfig;


/// @brief Structure to pass the IR BG configuration to ISP and write back if any adjustment made by ISP
typedef struct
{
    BGBEConfig  IRBGConfig;    ///< IR BG configuration from stats and this can be overwritten if the requested
                               ///  configuration cannot be fulfilled in the case of hardware limitations or certain
                               ///  conflicting requirements.
    BOOL        isAdjusted;    ///< Indicate if IFE made any adjustment for the requested configuration data.
    UINT32      regionWidth;    ///< IR BG individual region width
    UINT32      regionHeight;   ///< IR BG individual region height
} ISPIRBGStatsConfig;

/// @brief Structure to pass the CS stats configuration to ISP and write back if any adjustment made by ISP
struct ISPCSStatsConfig
{
    CSStatsConfig    CSConfig;   ///< CS stats configuration
};

/// @brief Structure to pass the RS stats configuration to ISP and write back if any adjustment made be ISP
typedef struct
{
    AFDStatsRSConfig    RSConfig;   ///< RS stats configuration from stats and this can be overwritten if the requested
                                    ///  configuration cannot be fulfilled in the case of hardware limitations or certain
                                    ///  conflicting requirements.
    UINT32  statsRgnWidth;          ///< RS config region width
    UINT32  statsRgnHeight;         ///< RS Config region height
    UINT32  statsHOffset;           ///< RS config ROI horizontal offset
    UINT32  statsVOffset;           ///< RS config ROI vertical offset
    BOOL    isAdjusted;             ///< Indicate if IFE made any adjustment for the requested configuration data.
    INT32   bitDepth;               ///< RS Output - Input bits
    UINT32  activeStatsRgnWidth;    ///< Scaled active RS stats width w.r.t. CAMIF
    UINT32  activeStatsRgnHeight;   ///< Scaled active RS stats height w.r.t CAMIF
    UINT32  statsFirstRgnWidth;     ///< Bayer RS config first stripe region width
    UINT32  statsLastRgnWidth;      ///< Bayer RS config last stripe region width
} ISPRSStatsConfig;

/// @brief Structure to pass the TintlessBG configuration to ISP and write back if any adjustment made by ISP
typedef struct
{
    BGBEConfig tintlessBGConfig; ///< TintlessBG configuration from stats and this can be overwritten if the requested
                                 ///  configuration cannot be fulfilled in the case of hardware limitations or certain
                                 ///  conflicting requirements.
    BOOL       isAdjusted;       ///< Indicate if IFE made any adjustment for the requested configuration data.
} ISPTintlessBGStatsConfig;

/// @brief Structure to pass the ALSCBG configuration to ISP and write back if any adjustment made by ISP
typedef struct
{
    BGBEConfig ALSCBGConfig;     ///< ALSCBG configuration from stats and this can be overwritten if the requested
                                 ///  configuration cannot be fulfilled in the case of hardware limitations or certain
                                 ///  conflicting requirements.
    BOOL       isAdjusted;       ///< Indicate if IFE made any adjustment for the requested configuration data.
} ISPALSCBGStatsConfig;

/// @brief Union of Knee points for TMC.
// NOWHINE NC004c : Shared file with system team so uses non-CamX file naming
union KneePointsTMC
{
    struct KneePoints10
    {
        FLOAT  kneeX[MAX_TMC_LUT_KNEE_LENGTH_TMC10];                ///< kneex TMC10
        FLOAT  kneeY[MAX_TMC_LUT_KNEE_LENGTH_TMC10];                ///< kneey TMC10
    } KneePointsTMC10;

    struct KneePoints11
    {
        FLOAT  kneeX[MAX_TMC_LUT_KNEE_LENGTH_TMC11];                ///< kneex TMC11
        FLOAT  kneeY[MAX_TMC_LUT_KNEE_LENGTH_TMC11];                ///< kneey TMC11
    } KneePointsTMC11;

    struct KneePoints12
    {
        FLOAT  kneeX[MAX_TMC_LUT_KNEE_LENGTH_TMC12];                ///< kneex TMC12
        FLOAT  kneeY[MAX_TMC_LUT_KNEE_LENGTH_TMC12];                ///< kneey TMC12
    } KneePointsTMC12;

    struct KneePoints13
    {
        FLOAT  kneeX[MAX_TMC_LUT_KNEE_LENGTH_TMC13];                ///< kneex TMC13
        FLOAT  kneeY[MAX_TMC_LUT_KNEE_LENGTH_TMC13];                ///< kneey TMC13
    } KneePointsTMC13;

    struct KneePoints141
    {
        FLOAT  kneeX[MAX_TMC_LUT_KNEE_LENGTH_TMC141];                ///< kneex TMC14
        FLOAT  kneeY[MAX_TMC_LUT_KNEE_LENGTH_TMC141];                ///< kneey TMC14
    } KneePointsTMC141;
};

/// @brief This structures encapsulate WB and GTM output for TMC
struct WBandGTMOutputForTMC
{
    UINT8      GTMCompensationEnable;                               ///< Enable GTM Compensation from WB
    FLOAT      GTMRatioKnee;                                        ///< Ratio for GTM Knee ponts from WB
    FLOAT      scaleRatioWB_prev;                                   ///< WB prev Ratio
    FLOAT      scaleRatioWB_current;                                ///< WB current Ratio
};

// Define the struct for ADRC debug used in ADRCData
// NOWHINE NC004c : Shared file with system team so uses non-CamX file naming
struct TMCOutputDebugData
{
    FLOAT        anchorKneeX[7];           ///<
    FLOAT        anchorKneeY[7];           ///<
    FLOAT        anchorKneeX_GTM[7];       ///<
    FLOAT        anchorKneeY_GTM[7];       ///<
    FLOAT        anchorKneeX_LTM[7];       ///<
    FLOAT        anchorKneeY_LTM[7];       ///<
    FLOAT        pKneeX[7];                ///<
    FLOAT        pKneeY[7];                ///<
    FLOAT        pKneeX_GTM[7];            ///<
    FLOAT        pKneeY_GTM[7];            ///<
    FLOAT        pKneeX_LTM[7];            ///<
    FLOAT        pKneeY_LTM[7];            ///<
};

/// @brief Input Data to all GTM and LTM Module for TMC.
// NOWHINE NC004c : Shared file with system team so uses non-CamX file naming
struct TMCOutputData
{
    UINT32        enable;                                                            ///< global enable
    BOOL          isChanged;                                                         ///< Indicates if TMC output has changed
    UINT32        version;                                                           ///< TMC version
    UINT32        chipsetVersion;                                                    ///< Chipset version
    UINT32        gtmEnable;                                                         ///< gtm enable
    UINT32        ltmEnable;                                                         ///< ltm enable
    KneePointsTMC kneePoints;                                                        ///< knee points
    FLOAT         drcGainDark;                                                       ///< drcGainDark
    FLOAT         gtmPercentage;                                                     ///< GtmPercentage
    FLOAT         ltmPercentage;                                                     ///< LtmPercentage
    // Valid for TMC version 1.0
    FLOAT         coefficient[MAX_TMC_LUT_COEF_SIZE];                                ///< coefficient

    // Valid for TMC version 1.1 / 1.2
    // TMC1.1 and 1.2 support to calculate the enhance curve with input stats and two curve models.
    // In addition, TMC1.2 also supports to have its calculated output from previous frame for interpolation
    // and have more smoooth curve.
    UINT32        curveModel;                                                        ///< curve model
    FLOAT         pchipCoefficient[MAX_TMC_LUT_PCHIP_COEF_SIZE];                     ///< PCHIP curve
    FLOAT         contrastEnhanceCurve[MAX_TMC_CONTRAST_CURVE];                      ///< contrast enhance Curve
    FLOAT         contrastHEBright;                                                  ///< contrast HE bright
    FLOAT         contrastHEDark;                                                    ///< contrast HE Dark

    // Valid for TMC version 1.2
    FLOAT         currentCalculatedHistogram[MAX_TMC_HIST_BIN_NUM];                  ///< Output histogram of current frame
    FLOAT         currentCalculatedCDF[MAX_TMC_HIST_BIN_NUM];                        ///< Output CDF of current frame
    FLOAT         previousCalculatedHistogram[MAX_TMC_HIST_BIN_NUM];                 ///< Output histogram of previous frame
    FLOAT         previousCalculatedCDF[MAX_TMC_HIST_BIN_NUM];                       ///< Output CDF of previous frame

    // Valid for TMC version 1.3
    FLOAT         currentCalculatedFaceLevel;                                        ///< Current calculated face level

    FLOAT         BGMidStatsSatRatio;                                                ///< AWB BG Stats Sat Ratio
    FLOAT         BGMidStatsDarkRatio;                                               ///< AWB BG Stats Dark Ratio

    // Valid for TMC version 1.4
    FLOAT         gtmPercentage14[MAX_TMC_CURVES];                                   ///< GtmPercentage
    FLOAT         ltmPercentage14[MAX_TMC_CURVES];                                   ///< LtmPercentage
    FLOAT         contrastHEBright14[MAX_TMC_CURVES];                                ///< contrast HE bright
    FLOAT         contrastHEDark14[MAX_TMC_CURVES];                                  ///< contrast HE Dark
    KneePointsTMC kneePoints_TMC141;                                                 ///< knee points
    KneePointsTMC kneePoints_TMC141_GTM;                                             ///< knee points
    KneePointsTMC kneePoints_TMC141_LTM;                                             ///< knee points
    FLOAT         pchipCoefficient_TMC141[MAX_TMC_LUT_PCHIP_COEF_SIZE_TMC141];       ///< PCHIP curve TMC 1.4
    FLOAT         pchipCoefficient_TMC141_GTM[MAX_TMC_LUT_PCHIP_COEF_SIZE_TMC141];   ///< PCHIP curve TMC 1.4
    FLOAT         pchipCoefficient_TMC141_LTM[MAX_TMC_LUT_PCHIP_COEF_SIZE_TMC141];   ///< PCHIP curve TMC 1.4
    FLOAT         contrastEnhanceCurve_TMC141[MAX_TMC_CONTRAST_CURVE];               ///< contrast enhance Curve
    FLOAT         contrastEnhanceCurve_TMC141_GTM[MAX_TMC_CONTRAST_CURVE];           ///< contrast enhance Curve
    FLOAT         contrastEnhanceCurve_TMC141_LTM[MAX_TMC_CONTRAST_CURVE];           ///< contrast enhance Curve
    FLOAT         faceAdjRatioPrev;                                                  ///< Face Adjust Ratio
    UINT32        enableHistFusion;                                                  ///< Enable Histogram fusion
    UINT32        bypassHistogram;                                                   ///< Bypass histogram
    UINT32        bypassLTM;                                                         ///< Bypass LTM
    UINT32        bypassRefinement;                                                  ///< Bypass Refinement
    FLOAT         subLTMPercentage;                                                  ///< Sub LTM Percentage
    FLOAT         sceneChangeLevel;                                                  ///< Flag for scene change

    UINT8         highlightKeepEnable;                                               ///< Hightlight keep enable
    UINT8         GTMCompensationEnable;                                             ///< Enable GTM Compensation from WB
    FLOAT         GTMRatioKnee;                                                      ///< Ratio for GTM Knee ponts from WB
    FLOAT         WBScaleRatioPrev;                                                  ///< WB scale Ratio Prev
    FLOAT         WBScaleRatio;                                                      ///< WB scale Ratio
    UINT32        overideKneeX;                                                      ///< override Knee X

    // ADRC debug Data
    TMCOutputDebugData debugData;                        ///< ADRC debug Data

    // these were added for tmc142
    UINT32        en_tmc_refinement;                     ///< enable tmc refinement
    FLOAT         LTM_LA_curve[65];                      ///< ltm luma adaption curve
    FLOAT         LTM_scale_curve[65];                   ///< ltm scale curve
    FLOAT         LTM_LCE_curve[65];                     ///< ltm lce curve
    FLOAT         tmc_reserve_lut[65];                   ///< reserve lut

    // Add new members at the end of the struct and to ADRCData
};

#pragma pack(pop)

#ifdef __cplusplus
}
#endif // __cplusplus

#endif // CHIISPSTATSDEFS_H
