////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2020-2021 Qualcomm Technologies, Inc.
// All Rights Reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @file chiswispdefs.h
/// @brief Define Qualcomm Technologies, Inc. SW-ISP proprietary data for defining internal data structures
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef CHISWISPDEFS_H
#define CHISWISPDEFS_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)

/// @brief Max SW BEStats Num
static const INT32  MaxSWBEStatsNum            = 768;         ///< Max ROIs for SW BEStats is 32x24

static const UINT8  SWBEChIndexCount           = 4;           ///< Maximum index for channel type

static const UINT32 IPE_MAX_PASSES             = 4;           ///< Number of multi pass

static const UINT16 MaxGamma16Entries          = 65;          ///< Maximum number of Gamma16 entries

static const UINT16 GTM10LUTSize               = 176;

/// @brief SWISP SW BEStats config associated with vendor tag
typedef struct
{
    UINT8  statsBitWidth;                            ///< Stats bitwidth
    UINT32 horizontalNum;                            ///< Number of horizontal regions
    UINT32 verticalNum;                              ///< Number of vertical regions
    UINT32 regionHeight;                             ///< Height of each stats subgrid region
    UINT32 regionWidth;                              ///< Width of each stats subgrid region
    UINT32 channelGainThreshold[SWBEChIndexCount];   ///< Max gain threshold for each channel
}SWISPBEStatsConfig;

/// @brief SWISP SW BEStats generated data associated with vendor tag
typedef struct
{
    UINT32  ChRSum;         ///< RSum of Tintless BG Stats
    UINT32  ChBSum;         ///< BSum of Tintless BG Stats
    UINT32  ChGrSum;        ///< GreenRed sum of the pixel
    UINT32  ChGbSum;        ///< GreenBlue sum of the pixel
    UINT16  ChRCount;       ///< Red count of the pixel
    UINT16  ChBCount;       ///< Blue count of the pixel
    UINT16  ChGrCount;      ///< GreenRed count of the pixel
    UINT16  ChGbCount;      ///< GreenBlue count of the pixel
}SWISPBEStats;

/// @ brief scratch buffer data
struct SWISPScratchBufferData
{
    UINT32 scratchBufferSize;           ///< scratch Buffer size
    UINT32 pdiOffset[IPE_MAX_PASSES];   ///< pdi offset
    UINT32 pdiSize [IPE_MAX_PASSES];    ///< pdi size
    UINT32 tfiOffset[IPE_MAX_PASSES];   ///< tfi offset
    UINT32 tfiSize[IPE_MAX_PASSES];     ///< tfi size
    UINT32 tfrOffset[IPE_MAX_PASSES];   ///< tfr offset
    UINT32 tfrSize[IPE_MAX_PASSES];     ///< tfr size
    UINT32 lmciOffset[IPE_MAX_PASSES];  ///< lmci offset
    UINT32 lmciSize[IPE_MAX_PASSES];    ///< lmci size
};

/// @brief This structures encapsulate Gamma G Channel Output
struct GammaInfo
{
    BOOL    isGammaValid;              ///< Is Valid Gamm Entries
    UINT32  gammaG[MaxGamma16Entries]; ///< Gamm Green Entries
};

#pragma pack(pop)

#ifdef __cplusplus
}
#endif // __cplusplus

#endif // CHISWISPDEFS_H
