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

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @file chivendortag.h
/// @brief Define Qualcomm Technologies, Inc. Vendor tag information
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef CHIVENDORTAG_H
#define CHIVENDORTAG_H

#include "camxcdktypes.h"
#include "chicommontypes.h"
#include "chituningmodeparam.h"

#include "chi.h"
#include "GeoLib.h"
#include <unordered_map>

#ifdef __cplusplus

extern "C"
{
#endif // __cplusplus

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

/** @addtogroup chi_common_vendor_tags
@{ */

/// Maximum number of nodes for a field of view.
#define MAX_NODES_NUMBER              4

/// Maximum number of streams for a camera.
#define MAX_NUM_STREAMS               11

/// Maximum number of detected faces.
static const UINT8 FDMaxFaces        = 10;

/// @brief Max Num of cameras in a group for same ISP
static const UINT8 MaxGroupedCameras = 4;

/// @brief Max Num of Contexts for a camera in a group for same ISP
static constexpr UINT8 MaxContextIdPerCamera = 1;

/// @brief Max Num of Groups supported
static const UINT8 MaxISPGroups      = 10;

///@brief Max streams per camera
static const UINT8 MaxStreamConfig   = 4;

/// Maximum number of linked cameras.
static const UINT32 MaxLinkedCameras = 4;

/// Maximum number of entries in an array required in AllNodeCropInfo.
static const UINT32 MaxCropInfoEntries = 30;

/// Maximum number of related cameras.
static const UINT   MaxDevicePerLogicalCamera    = 8;

/// Defines an invalid index.
static const UINT32 InvalidIndex = 0xFFFFFFFF;

/// Defines Invalid 8bit Index
static const UINT8 InvalidIndexU8 = 0xFF;

/// Defines the invalid or unknown mode.
static const UINT32 INVALID_MODE = 0xFFFFFFFF;

/// Maximum number of CHI sub-requests.
static const UINT ChiMaxNumSubRequests = 3;

/// Defines the size of the SupportedFeature string buffer.
static const UINT ChiNodeSupportedFeatureBufferSize = 64;

/// Defines the maximum buffer size of 3A debug data memory (4 MB).
static const UINT MaxDebugDataSize3A = 4 * 1024 * 1024;

/// Defines the maximum buffer size of tuning debug metadata memory (3 MB, includes multiple IPE instances).
static const UINT MaxDebugDataSizeTuningMeta = 3 * 1024 * 1024;

/// Maps from a CHI stream pointer to a physical camera index.
///  @newpage
typedef std::unordered_map<CHISTREAM*, UINT> ChiStreamToCameraIdMap;

/// Maximum number of per stream HDR mode
///  @newpage
static const UINT32 MaxPerStreamHDRModes = 64;

/// Maximum number of accumulated debug data tuning meta pointers
static const UINT32 MaxNumAccumulateDebugDataPtrs = 6;

// Number of GTM131 Y ratio
static const UINT32 YRatioGTMLUTSize = 256;

/// Maximum number of customized debug data size
static const UINT32 MaxNumCustomizedDebugDataSize = 200;

///@brief Enumeration describing sensor mode
typedef enum
{
    NoSync = 0,
    MasterMode,
    SlaveMode,
} SensorSyncMode;

/// @brief Valid sensor status types.
typedef enum
{
    SensorNoPerf = 0,
    SensorActive,
    SensorStandby,
} SensorPerfCtrl;

/// @brief Describes the use case modes for Electronic Image Stabilization (EIS).
enum class ImageStabilizationMode
{
    NoEIS                    = 0, ///< No stabilization mode.
    EIS2PreviewVideo         = 1, ///< EIS2 preview and video modes.
    EIS2PreviewEIS3Video     = 2, ///< EIS2 preview and EIS3 video modes.
    EIS2Preview4KEIS3Video   = 3, ///< EIS2 preview and 4K EIS3 video modes.
    DMEIS2PreviewVideo       = 4, ///< Descriptor-based Motion Estimation mode.
    MaxImageStablizationMode = 5, ///< Maximum number of mode types.
};

/// @brief Priority mode settings for manual exposure.
enum class ISOExposureTimePriorityMode
{
    DisablePriority = -1,
    ISOPriority,
    ExposureTimePriority,
    GainPriority
};

/// @brief Available ISO modes.
enum ISOModes
{
    ISOModeAuto,
    ISOModeDeblur,
    ISOMode100,
    ISOMode200,
    ISOMode400,
    ISOMode800,
    ISOMode1600,
    ISOMode3200,
    ISOModeEnd
};

/// @brief Valid buffer input types.
typedef enum
{
    BUFFER_FULL,                ///< Buffer is full sized; there is no downscaling.
    BUFFER_DS4,                 ///< Buffer is downscaled by 4.
    BUFFER_DS16,                ///< Buffer is downscaled by 16.
    BUFFER_FD,                  ///< Buffer is for face detection; there is no downscaling.
    MAX_BUFFER_INPUT_TYPES      ///< Maximum number of input types.
} BufferInputType;

/// @brief Valid buffer usage types.
enum class BufferUsageType
{
    PREVIEW,
    VIDEO,
    MAX_USAGE_TYPES
};

//@brief Structure describing the grouped Cameras for same ISP
typedef struct
{
    UINT groupID;                          ///< Group ID of this camera.
    UINT numCameras;                       ///< Number of cameras in a group
    UINT cameraIDs[MaxGroupedCameras];     ///< Camera ID's of all the grouped cameras
    UINT numberOfContextPerCam[MaxGroupedCameras];                                  ///< Number of contexts per multicontext camera, MaxContextIdPerCamera = 1 currently
    UINT contextID[MaxGroupedCameras][MaxContextIdPerCamera];                       ///< contextId's per multicontext camera, MaxContextIdPerCamera = 1 currently
    UINT numberOfStreamsPerContext[MaxGroupedCameras][MaxContextIdPerCamera];       ///< num of streams per context per camera, MaxContextIdPerCamera = 1 currently
    UINT statsEnabledCameraID;             ///< CameraID which has stats
}ISPGroup;

///@brief Structure describing the grouped Cameras info
typedef struct{
   UINT       numGroups;              ///< Number of groups
   ISPGroup   group[MaxISPGroups];    ///< Camera Group Info for each group
}ISPGroupsInfo;

///@brief Structure describing the stream config needed from fwk
typedef struct
{
   UINT            width;                  ///< width per stream
   UINT            height;                 ///< height per stream
   UINT            frameRate;              ///< Max Frame Rate supported
}ISPCameraStreamConfig;

///@brief Structure describing the camera config needed from fwk
typedef struct
{
   UINT                  cameraID;                        ///< Camera ID
   UINT                  numStreams;                      ///< number of streams per camera
   ISPCameraStreamConfig streamConfig[MaxStreamConfig];   ///< stream config associated with that camera
   UINT                  operationMode;                   ///< Operation Mode
   UINT                  isStatsNeeded;                   ///< Stats needed for this camera or not
   UINT                  remosaicType;                    ///< Remosaic Type
   UINT                  HDRMode;                         ///< HDR modes like SHDR, MFHDR, QHDR etc.
   UINT                  numHDRExposure;                  ///< HDR Exposure Type
   UINT                  isHDRVideoMode;                  ///< If HDR video is supported in future
   UINT                  reserved[6];
}ISPCameraConfig;

///@brief Structure describing the camera config grouped together
typedef struct
{
   UINT                   groupID;                           ///< Group ID
   UINT                   numCameras;                        ///< number of Cameras grouped together
   ISPCameraConfig        cameraConfig[MaxGroupedCameras];   ///< Config for each camera
}ISPGroupCameraConfigs;

///@brief Structure describing the group config for all groups
typedef struct
{
   UINT                   numGroups;            ///< number of groups
   ISPGroupCameraConfigs  groups[MaxISPGroups]; ///< Grouped camera config info
}ISPGroupsConfig;

/// @brief Structure describing Sensor Information
typedef struct
{
    UINT             sensorID;
    UINT             sensorMode;
    UINT             numberOfContexts;                                   ///< Number of contexts for the sensor
    UINT             contextID[MaxContextIdPerCamera];                   ///< contextId's for the sensor
    UINT             numberOfStreamsPerContext[MaxContextIdPerCamera];   ///< num of streams per context per camera
    UINT             isStatsNeeded;
} IspSensorConfig;

/// @brief Structure describing Grouped Sensor Information
typedef struct
{
    UINT             groupID;
    UINT             numCameras;
    IspSensorConfig  configs[MaxGroupedCameras];
} IspSensorGroup;

/// @brief Structure describing Grouped Sensor Information for all groups
typedef struct
{
    UINT            numGroups;
    IspSensorGroup  groupInfo[MaxISPGroups];
} IspSensorGroupConfig;
/// @brief Describes the configuration of the sensor hardware in Synchronization mode.
///  - Vendor tag section name -- com.qti.chi.multicamerasensorconfig
///  - Vendor tag tag name -- sensorsyncmodeconfig
typedef struct
{
    BOOL           isValid;        ///< Indicates whether the Synchronization mode metadata is valid.
                                   ///
                                   ///  @valuesbul
                                   ///  - 0 -- FALSE
                                   ///  - 1 -- TRUE @tablebulletend

    SensorSyncMode sensorSyncMode; ///< Synchronization mode for the sensor.
} SensorSyncModeMetadata;

/// @brief Describing external recovery info
typedef struct
{
    UINT32    externalRecoveryEnabled;
    UINT32    recoveryTimeout;
}ExternalRecoveryinfo;

/// @brief Valid seamless in-sensor control states.
typedef enum
{
    None    = 0,
    InSensorHDR3ExpStart,
    InSensorHDR3ExpEnabled,
    InSensorHDR3ExpStop
} SeamlessInSensorState;

/// @brief Valid seamless in-sensor zoom states.
typedef enum
{
    InSensorZoomNone  = 0,
    InSensorZoomBinning,
    InSensorZoomCrop,
} InSensorZoomState;

/// @brief Valid seamless no-remosaic zoom states.
typedef enum
{
    NoNemosaicZoomNone  = 0,
    NoNemosaicZoomBinning,
    NoNemosaicZoomCrop,
} NoRemosaicZoomState;

/// @brief Valid seamless bit switch states.
typedef enum
{
    BitSwitchBinning,     ///< Sensor need switch to binning mode
    BitSwitchIDCG,        ///< Sensor need switch to IDCG mode
} BitSwitchState;

/// @brief Describes the Bayer input and output image size for alignment.
typedef struct
{
    UINT32 inputWidth;    ///< Bayer input width with a margin.
    UINT32 inputHeight;   ///< Bayer input height with a margin.
    UINT32 outputWidth;   ///< Bayer output width without a margin.
    UINT32 outputHeight;  ///< Bayer output height without a margin.
} BayerAlignmentSize;

/// @brief Describes the Bayer alignment offset.
typedef struct
{
    INT32 marginOffsetX;    ///< Margin offset for the X coordinate.
    INT32 marginOffsetY;    ///< Margin offset for the Y coordinate.
} BayerAlignmentOffset;

/// @brief Dimensions of an image.
typedef struct
{
    INT                   width;                        ///< Width of the image.
    INT                   height;                       ///< Height of the image.
} ImageSizeData;

/// @brief Dimensions of a reference crop window.
typedef struct
{
    INT32 width;       ///< Width of the window.
    INT32 height;      ///< Height of the window.
} RefCropWindowSize;

/// @brief Information about a shift offset.
typedef struct
{
    INT32                horizonalShift;               ///< X coordinate of the pixel.
    INT32                verticalShift;                ///< Y coordinate of the pixel.
} ImageShiftData;

/// @brief Dimensions of a weighted region used for focusing and metering areas.
typedef struct
{
    INT32                xMin;                           ///< Top left X coordinate of the region.
    INT32                yMin;                           ///< Top left Y coordinate of the region.
    INT32                xMax;                           ///< Width of the region.
    INT32                yMax;                           ///< Height of the region.
    INT32                weight;                         ///< Weight of the region.
} WeightedRegion;

/// @brief Information about a weighted region used for focusing and metering areas.
typedef struct
{
    UINT8                numFaces;                       ///< Number of faces that are detected.
    UINT8                faceScore[FDMaxFaces];          ///< List of face confidence scores for detected faces.
    CHIRECT              faceRect[FDMaxFaces];           ///< List of face rectangle information for detected faces.
} FDMetadataResults;

/// @brief Information about Low Power mode.
typedef struct
{
    UINT32                cameraId;                     ///< Camera ID of the selected frame.

    BOOL                  isEnabled;                    ///< Indicates whether the camera is active.
                                                        ///
                                                        ///  @valuesbul
                                                        ///  - 0 -- FALSE
                                                        ///  - 1 -- TRUE (active) @tablebulletend
} LowPowerModeData;

/// @brief Information about the camera metadata required by the spatial alignment transform (SAT) node.
typedef struct
{
    BOOL                  isValid;                      ///< Indicates whether this metadata is valid.
                                                        ///
                                                        ///  @valuesbul
                                                        ///  - 0 -- FALSE
                                                        ///  - 1 -- TRUE @tablebulletend

    UINT32                cameraId;                     ///< Unique identifier of the camera to which this metadata belongs.
    CHIRECT               pipelineCropRegion;           ///< Pipeline-specific crop region.
    CHIRECT               ifeLimitCropRegion;           ///< Maximum crop region that the IFE can apply.
    CHIRECT               fovRectIFE;                   ///< IFE FOV with respect to the active sensor array.
    CHIRECT               fovRectIPE;                   ///< IPE FOV with respect to the active sensor array.
    CHIRECT               ifeAppliedCrop;               ///< Crop region applied by the IFE.
    CHIRECT               sensorIFEAppliedCrop;         ///< Crop region applied by both the sensor and IFE.
    CHIRECT               ifeResidualCrop;              ///< Crop region that remains after IFE processing.
    WeightedRegion        afFocusROI;                   ///< Focus region of interest for AF.
    FLOAT                 lux;                          ///< LUX value.
    INT32                 focusDistCm;                  ///< Focus distance in centimeters.
    UINT32                afState;                      ///< Autofocus state.
    INT32                 isoSensitivity;               ///< Indicates the ISO value.
    INT64                 exposureTime;                 ///< Length of time the sensor is exposed to light.
    UINT64                sensorTimestamp;              ///< Timestamp from the sensor.
    FDMetadataResults     fdMetadata;                   ///< Face detection metadata.
    CHIRECT               userCropRegion;               ///< Translated HAL crop W.R.T this physical camera.
} CameraMetadata;

/// @brief Types of multi-camera input ports.
enum class MultiCameraPortType
{
    Full             = 0,  ///< Full port.
    DS4              = 1,  ///< Port is downscaled by 4.
    DS16             = 2,  ///< Port is downscaled by 16.
    DisplayFull      = 3,  ///< Display full port.
    DisplayDS4       = 4,  ///< Display DS4 port.
    DisplayDS16      = 5,  ///< Display DS16 port.
    FullLong         = 6,  ///< Full long port.
    FullLongDS4      = 7,  ///< Full long DS4 port.
    FullLongDS16     = 8,  ///< Full long DS16 port.
    FullShort        = 9,  ///< Full short port.
    FullShortDS4     = 10, ///< Full short DS4 port.
    FullShortDS16    = 11, ///< Full short DS16 port.
    DisplayLong      = 12, ///< Display long port.
    DisplayLongDS4   = 13, ///< Display long DS4 port.
    DisplayLongDS16  = 14, ///< Display long DS16 port.
    DisplayShort     = 15, ///< Display short port.
    DisplayShortDS4  = 16, ///< Display short DS4.
    DisplayShortDS16 = 17, ///< Display short DS16.
    FullMipiLong     = 18, ///< Full mipi12 long port
    FullMipiShort    = 19, ///< Full mipi12 short port
    FD               = 20, ///< Face Detection port.
    MaxPortType      = 21, ///< Maximum number of ports.
};

/// @brief Parameters for mapping a physical camera ID to a node input port.
typedef struct
{
    CHILINKNODEDESCRIPTOR nodeDescriptor;      ///< Information about the node descriptor.
    UINT                  physicalCameraId;    ///< Identifier of the physical camera associated with this node descriptor.
    BufferInputType       bufferDownscaleType; ///< Type of buffer input.
    BufferUsageType       bufferUsageType;     ///< Type of buffer usage: preview or video.
    MultiCameraPortType   portType;            ///< Type of multi-camera input port.
} PhysicalCameraInputConfiguration;

/// @brief Contains a list of physical camera ID-to-node input mappings.
typedef struct
{
    UINT                             numConfigurations;                     ///< Number of physical camera input
                                                                            ///  configurations.
    ImageStabilizationMode           imageStabilizationMode;                ///< Stabilization mode of the video image.
    PhysicalCameraInputConfiguration configuration[MaxPhysicalCameraInput]; ///< Array of physical camera ID-to-node input
                                                                            ///  properties.
} ChiMultiCameraConfig;

/// @brief Records whether a physical camera's parameter is different from a logical camera's parameter.
typedef struct
{
    UINT               cameraId;             ///< Unique identifier of the physical camera.

    BOOL               isDiff;               ///< Flag that indicates whether the physical camera's parameter is different
                                             ///  from the logical camera's parameter.
                                             ///
                                             ///  @valuesbul
                                             ///  - 0 -- FALSE
                                             ///  - 1 -- TRUE @tablebulletend
} PhysicalLogicalDiffMap;

/// @brief Contains a list of physical-logical dimension differences mappings.
typedef struct
{
    UINT                     numCam;                                     ///< Number of cameras.
    PhysicalLogicalDiffMap   fullDimensionDiffMap[MaxNumImageSensors];   ///< Array of MCX real-time feature full output
                                                                         ///  physical stream compared to configuration logical
                                                                         ///  stream dimension different map.
} ChiMultiCamDimensionDiffMap;

/// @brief  Structure representing physical camera information required by Instant zoom
typedef struct
{
    UINT      physicalCameraId;                    ///< Physical camera Id
    UINT      subSensorMode;                       ///< SubSensorMode
    BOOL      isActive;                            ///< Is the camera active
    BOOL      canBeMaster;                         ///< Can the physical camera be master.
    ChiRect   appliedInstantZoomCropRegion;        ///< Zoom crop based on the Instant zoom ratio
    ChiRect   cropRegionAppliedInRealTimePipeline; ///< Crop region applied by IFE node w.r.t physical camera domain
    FLOAT     zoomRatioAppliedInRealTimePipeline;  ///< Zoom Ratio applied by IFE node WRT logical camera domain
}ChiInstantZoomInfoOfPhyicalCam;

/// @brief  Structure representing information required by Instant zoom
typedef struct
{
    UINT                           requestId;                                            ///< RequestId the entry belongs to.
    UINT                           reqIdOfZoomRatioAppliedForInstantZoom;                ///< Request Id of instant zoom ratio
                                                                                         ///  selected for current request.
    FLOAT                          appliedInstantZoomRatio;                              ///< Logical instant zoom crop ratio
    UINT                           controlSettingsOverride;                              ///< CONTROL_SETTINGS_OVERRIDE
                                                                                         ///  of the requestId above.
    ChiInstantZoomInfoOfPhyicalCam instantZoomInfoOfPhysicalCam[MaxDevicePerLogicalCamera]; ///< Corresponding Instant Zoom
                                                                                            ///  info per active camera
    UINT                           numberOfInstantZoomInfoOfPhyicalCam;                     ///< Number of
                                                                                            ///  InstantZoomInfoOfPhysicalCam
} SATInstantZoomInfo;

/// @brief Metadata information for multi-camera SAT input.
typedef struct
{
    UINT32                frameId;                                       ///< Unique identifier of the frame.
    UINT8                 numInputs;                                     ///< Number of input metadata buffers.
    CameraMetadata        cameraMetadata[MaxDevicePerLogicalCamera];     ///< Array of camera metadata for SAT.

    BOOL                  isSnapshot;                                    ///< Indicates whether the metadata is for a snapshot
                                                                         ///  or preview.
                                                                         ///
                                                                         ///  @valuesbul
                                                                         ///  - 0 -- Preview
                                                                         ///  - 1 -- Snapshot @tablebulletend

    UINT32                masterCameraId;                                ///< Identifier of the master camera for input
                                                                         ///  metadata.
    UINT32                slaveCameraId;                                 ///< Identifier of the slave camera for input metadata

#ifndef DOXYGEN_SHOULD_SKIP_THIS
#if (defined(CAMX_ANDROID_API) && (CAMX_ANDROID_API > 29)) // Greater than Android-Q
    FLOAT                 controlZoomRatio;                              ///< Logical control zoom ratio
#else
    CHIRECTINT            userCropRegion;                                ///< Logical overall user crop region
#endif // Greater than Android-Q
#endif /* DOXYGEN_SHOULD_SKIP_THIS */

    BOOL                  canSwitchMasterCameraId;     ///< Indicates whether the offline master can be switched within
                                                       ///  the current frame.
                                                       ///
                                                       ///  @valuesbul
                                                       ///  - 0 -- FALSE (cannot be switched)
                                                       ///  - 1 -- TRUE (can be switched) @tablebulletend
    BOOL                  isZoomRatioOverriden;        ///< Indicator whether the zoom ratio of the current request has
                                                       ///  been overriden.
    SATInstantZoomInfo    satInstantZoomInfo;          ///< Instant zoom info for SAT node to update residual crop.
} InputMetadataOpticalZoom;

/// @brief Contains SAT input meta data for multi-camera operations.
typedef struct
{
    UINT32                 frameId;                            ///< Unique identifier of the frame.
    FLOAT                  currentRealtimeZoomRatio;           ///< Current real-time zoom ratio that is not affected by the
                                                               ///  offline frame delay.
    UINT32                 currentRealtimeActiveCameraMask;    ///< Mask for the real-time active camera.
    UINT32                 currentRealtimeMasterCameraId;      ///< Identifier for the real-time master camera.

    BOOL                   fastTransitionFlag;                 ///< Indicates whether the request requires fast transition.
                                                               ///
                                                               ///  @valuesbul
                                                               ///  - 0 -- FALSE
                                                               ///  - 1 -- TRUE @tablebulletend
} RealtimeMetadataOpticalZoom;

/// @brief Metadata information about multi-camera SAT output.
typedef struct
{
    UINT32                 offlineSATMasterCameraId;                ///< Identifier for the current frame's master camera used
                                                                    ///  for the offline SAT pipeline.
    UINT32                 offlineSATSlaveCameraId;                 ///< Identifier for the current frame's slave camera used
                                                                    ///  for the offline SAT pipeline.
    UINT32                 recommendMasterCameraId;                 ///< Identifier for the recommended camera's master camera
                                                                    ///  for the next matched filter loss (MFL) decision.

    UINT32                 nextOfflineSATMasterCameraId;             ///< Master camera ID used for the offline SAT
                                                                     ///  pipeline for the next request.
                                                                     ///
                                                                     ///  This field is only applicable if
                                                                     ///  canSwitchOfflineMaster is set
                                                                     ///  to FALSE by the caller.

    ImageShiftData         outputShift[MaxDevicePerLogicalCamera];  ///< Array of frame shift values due to spatial alignment
                                                                    ///  per camera. This array is with respect to the per
                                                                    ///  camera active array size coordinate system.

    UINT8                 numLinkedCameras;                         ///< Number of linked physical cameras.
    LowPowerModeData      lowPowerMode[MaxDevicePerLogicalCamera];  ///< Array of Low Power modes of the output.
    FLOAT                 mappedViewRatio;                          ///< Actual zoom ratio after it is mapped.
} OutputMetadataOpticalZoom;

/// @brief Indicates which output port one physical camera in a camera group is to use.
enum class SATCameraGroup
{
    CameraOutputGroupFullPrimary   = 0,  ///< Group in which a physical camera bypasses the source buffer from the full input
                                         ///< port to SATOutputPortType::DefaultFull.
    CameraOutputGroupFullSecondary = 1,  ///< Group in which a physical camera bypasses a source buffer from the full input
                                         ///< port to SATOutputPortType::FullSecondary.
    NumberOfCameraGroup            = 2,  ///< Number of camera groups.
    InvalidCameraGroup             = 3,  ///< Group indicating an invalid camera group.
};

/// @brief Parameters for configuring a camera.
struct CameraConfiguration
{
    UINT32              cameraId;                ///< Unique identifier of the camera.
    FLOAT               transitionZoomRatioLow;  ///< Minimum transition zoom ratio at which the camera will be active.
    FLOAT               transitionZoomRatioHigh; ///< Maximum transition zoom ratio at which the camera will be active.

    BOOL                enableSmoothTransition;  ///< Indicates whether smooth transition is enabled for the camera during SAT.
                                                 ///
                                                 ///  @valuesbul
                                                 ///  - 0 -- FALSE
                                                 ///  - 1 -- TRUE @tablebulletend

    CHISENSORCAPS       sensorCaps;              ///< Capabilities related to the imaging characteristics of the device.
    CHILENSCAPS         lensCaps;                ///< Capabilities related to the lens characteristics of the device.
    CHISENSORMODEINFO   sensorModeInfo;          ///< Information about the Sensor mode.

    BOOL                bIsMCXUsecase;           ///< Indicates whether this is an MCX use case.
                                                 ///
                                                 ///  @valuesbul
                                                 ///  - 0 -- FALSE
                                                 ///  - 1 -- TRUE @tablebulletend

    BOOL                bHasInSensorCapability;  ///< Indicates whether this sensor has in-sensor mode capability.
                                                 ///
                                                 ///  @valuesbul
                                                 ///  - 0 -- FALSE
                                                 ///  - 1 -- TRUE @tablebulletend

    FLOAT               inSensorSwitchRatio;     ///< Ratio of the non-insensor mode and insensor mode switch in the sensor
                                                 ///  hardware.
    SATCameraGroup      cameraGroup;             ///< Indicates which output port one physical camera in a camera group
                                                 ///  is to use.
};

/// @brief Valid SAT one-frame delay use cases.
typedef enum /** @cond */ SATOneFrameDelayUsecase /** @endcond */
{
    nonOneFrameDelayUsecase,                       ///< Frame delay is not enabled.
    isHDROneFrameDelayUsecase,                     ///< Indicates whether the frame delay is applied on an HDR use case.
    isResolutionUpscaleOneFrameDelayUsecase        ///< Indicates whether the frame delay is applied on a resolution upscale
                                                   ///  use case.
} SATONEFRAMEDELAYUSECASE;

/// @brief Contains the SAT one frame delay use case.
typedef struct /** @cond */ SATOneFrameDelayInfo /** @endcond */
{
    SATONEFRAMEDELAYUSECASE SATOneFrameDelayUsecase;  ///< Indicates the use case on which the frame delay is applied.
} SATONEFRAMEDELAYINFO;

/// @brief Parameters for configuring multiple physical cameras.
struct CameraConfigs
{
    UINT32               numPhysicalCameras;                         ///< Number of physical cameras.
    CameraConfiguration  cameraConfigs[MaxDevicePerLogicalCamera];   ///< Physical configuration of the cameras.
    UINT32               primaryCameraId;                            ///< Unique identifier of the primary camera in a
                                                                     ///  specified logical camera.

    BOOL                 enableSATFusion;                            ///< Indicates whether SAT fusion is enabled.
                                                                     ///
                                                                     ///  @valuesbul
                                                                     ///  - 0 -- FALSE
                                                                     ///  - 1 -- TRUE @tablebulletend

    SATONEFRAMEDELAYINFO SATOneFramedelayInfo;                       ///< Information about a SAT one frame delay.
    UINT32               defaultMasterCameraIdx;                     ///< Default index for the master camera.
};

/// @brief Metadata information for multi-camera Real Time Bokeh (RTB) input.
typedef struct
{
    UINT32                frameId;                                     ///< Unique identifier of the frame.
    UINT32                blurLevel;                                   ///< Blur intensity value to be applied to the Bokeh.
    UINT32                blurMinValue;                                ///< Minimum value for the blur intensity.
    UINT32                blurMaxValue;                                ///< Maximum value for the blur intensity.
    UINT32                masterCameraId;                              ///< Master camera ID for input metadata.
    CameraMetadata        cameraMetadata[MaxDevicePerLogicalCamera];   ///< Camera metadata for the RTB.
    UINT8                 numLinkedCameras;                            ///< Number of linked physical cameras.

#ifndef DOXYGEN_SHOULD_SKIP_THIS
#if (defined(CAMX_ANDROID_API) && (CAMX_ANDROID_API > 29)) // Greater than Android-Q
    FLOAT                 controlZoomRatio;                            ///< Logical control zoom ratio
#else
    CHIRECTINT            userCropRegion;                              ///< Overall user crop region
#endif // Greater than Android-Q
#endif /* DOXYGEN_SHOULD_SKIP_THIS */

    BOOL                  isSnapshot;                                  ///< Indicates whether the metadata is for a snapshot
                                                                       ///  or preview.
                                                                       ///
                                                                       ///  @valuesbul
                                                                       ///  - 0 -- Preview
                                                                       ///  - 1 -- Snapshot @tablebulletend
} InputMetadataBokeh;

/// @brief Metadata information for multi-camera RTB output.
typedef struct
{
    UINT32                masterCameraId;                   ///< Unique identifier of the master camera.
    UINT32                activeMap;                        ///< Map that indicates which pipeline is active.
    UINT32                depthEffectInfo;                  ///< Status information about the depth effect.
} OutputMetadataBokeh;

/// @brief Identifies the dual cameras.
typedef struct
{
    UINT32                currentCameraId;               ///< Unique identifier of the current camera.
    UINT32                logicalCameraId;               ///< Unique identifier of the logical camera.
    UINT32                masterCameraId;                ///< Unique identifier of the master camera.
} MultiCameraIds;

/// @brief Low Power mode information for dual cameras.
typedef struct
{
    UINT32                isLPMEnabled;                             ///< Indicates the status of Low Power mode.
    UINT32                isSlaveOperational;                       ///< Indicates whether a slave is operational when Low
                                                                    ///  Power mode is enabled.
    LowPowerModeData      lowPowerMode[MaxDevicePerLogicalCamera];  ///< Low Power mode information for all real-time
                                                                    ///  pipelines.
    UINT8                 numLinkedCameras;                         ///< Number of linked physical cameras.
} LowPowerModeInfo;

/// @brief Synchronization mode information for dual cameras.
typedef struct
{
    BOOL                  isSyncModeEnabled;    ///< Indicates whether Synchronization mode information is used to synchronize
                                                ///  both frames.
                                                ///
                                                ///  @valuesbul
                                                ///  - 0 -- FALSE
                                                ///  - 1 -- TRUE @tablebulletend

    BOOL                  need3ASync;           ///< Indicates whether a camera requires 3A synchronization.
                                                ///
                                                ///  @valuesbul
                                                ///  - 0 -- FALSE
                                                ///  - 1 -- TRUE @tablebulletend
} SyncModeInfo;

/// @brief Information about a crop region for a capture request.
typedef struct
{
    CHIRECTINT            userCropRegion;                ///< Overall user crop region coordinates, width, and height.
    CHIRECT               dzWindowNoMargin;              ///< User crop region without a SAT margin. This value is for an
                                                         ///  individual sensor.
    CHIRECT               pipelineCropRegion;            ///< Pipeline-specific crop region: coordinates, width, and height.
    CHIRECT               ifeLimitCropRegion;            ///< Maximum crop region that the IFE can apply.
} CaptureRequestCropRegions;

/// @brief Information for Feature2 active cameras.
typedef struct
{
    UINT32      cameraId;                           ///< Unique identifier of the camera.

    BOOL        isActive;                           ///< Indicates whether the camera is active.
                                                    ///
                                                    ///  @valuesbul
                                                    /// - 0 -- FALSE
                                                    ///  - 1 -- TRUE @tablebulletend
} Feature2ActiveCameras;

/// @brief Metadata for Feature2 active cameras.
typedef struct /** @cond */ CameraIdToSubSensorMode_t /** @endcond */
{
    UINT32      cameraIdx     = INVALID_MODE;        ///< Mapped Camera index.
    UINT32      subSensorMode = INVALID_MODE;        ///< Mapped Sub-sensor mode.
} CameraIdToSubSensorMode;

/// @brief Information for a Feature2 multiple camera controller (MCC) result.
struct Feature2ControllerResult
{
    BOOL                     isValid;                                    ///< Indicates whether the result is valid.
                                                                         ///
                                                                         ///  @valuesbul
                                                                         ///  - 0 -- FALSE
                                                                         ///  - 1 -- TRUE @tablebulletend

    BOOL                     isQCFASnapshot;                             ///< Indicate whether a Quadra CFA snapshot is
                                                                         ///  requested.
                                                                         ///
                                                                         ///  @valuesbul
                                                                         ///  - 0 -- FALSE
                                                                         ///  - 1 -- TRUE @tablebulletend

    BOOL                     isSnapshotFusion;                           ///< Indicates whether the snapshot fusion is enabled.
                                                                         ///
                                                                         ///  @valuesbul
                                                                         ///  - 0 -- FALSE
                                                                         ///  - 1 -- TRUE @tablebulletend

    UINT32                   masterCameraId;                             ///< Unique identifier of the master camera.
    Feature2ActiveCameras    activeCameras[MaxDevicePerLogicalCamera];   ///< Camera information that indicates the Low Power
                                                                         ///  mode status.
    UINT32                   numActiveCameras;                           ///< Number of active cameras in the activeCameras
                                                                         ///  array.
    UINT32                   activeMap;                                  ///< Map that indicates which pipeline is active.
    ChiStreamToCameraIdMap   streamToPhyIdMap;                           ///< Updated Map from a stream pointer to the
                                                                         ///  physical camera ID. For logical streams, this
                                                                         ///  value is InvalidCameraId.
    UINT32                   activeLogicalMap;                           ///< Active map to indicate which cameras are active
                                                                         ///  for logical cameras.
    UINT32                   activePhysicalMap;                          ///< Active map to indicate which cameras are active
                                                                         ///  for physical cameras.
    UINT32                   auxActiveCameraMap;                         ///< Active mask for the auxiliary camera.
    UINT32                   dummyRequestMask;                           ///< Extra mask for handling a hard transition.
    BOOL                     needLogicalDummyRequest;                    ///< Extra logical dummy request,
                                                                         ///  will apply for all active sensors.

    BOOL                     perRequestSyncEnable;                       ///< Indicates whether synchronization is enabled
                                                                         ///  for the request.
                                                                         ///
                                                                         ///  @valuesbul
                                                                         ///  - 0 -- FALSE
                                                                         ///  - 1 -- TRUE @tablebulletend

    CameraIdToSubSensorMode  cameraIndexToSubSensorMode[MaxDevicePerLogicalCamera];  ///< Array of mappings from Camera Index
                                                                                     ///  to SubSensor mode.

#ifndef DOXYGEN_SHOULD_SKIP_THIS

    BOOL operator<(
        const Feature2ControllerResult& rRHS
        ) const
    {
        BOOL isLess = FALSE;

        if (isValid < rRHS.isValid)
        {
            isLess = TRUE;
        }
        else if ((isValid == rRHS.isValid) &&
                 (isSnapshotFusion < rRHS.isSnapshotFusion))
        {
            isLess = TRUE;
        }
        else if ((isValid == rRHS.isValid) &&
                 (isSnapshotFusion == rRHS.isSnapshotFusion) &&
                 (masterCameraId < rRHS.masterCameraId))
        {
            isLess = TRUE;
        }
        else if ((isValid == rRHS.isValid) &&
                 (isSnapshotFusion == rRHS.isSnapshotFusion) &&
                 (masterCameraId == rRHS.masterCameraId) &&
                 (activeMap < rRHS.activeMap))
        {
            isLess = TRUE;
        }
        else if ((isValid == rRHS.isValid) &&
                 (isSnapshotFusion == rRHS.isSnapshotFusion) &&
                 (masterCameraId == rRHS.masterCameraId) &&
                 (activeMap == rRHS.activeMap) &&
                 (activeLogicalMap < rRHS.activeLogicalMap))
        {
            isLess = TRUE;
        }
        else if ((isValid == rRHS.isValid) &&
                 (isSnapshotFusion == rRHS.isSnapshotFusion) &&
                 (masterCameraId == rRHS.masterCameraId) &&
                 (activeMap == rRHS.activeMap) &&
                 (activeLogicalMap == rRHS.activeLogicalMap) &&
                 (activePhysicalMap < rRHS.activePhysicalMap))
        {
            isLess = TRUE;
        }

        return isLess;
    }

#endif /* DOXYGEN_SHOULD_SKIP_THIS */

};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Structure for camera status info
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
struct CameraStatusInfo
{
    UINT32   masterFwCameraId;                           ///< Camera Fw Id for the master camera
    UINT32   numActiveCameras;                           ///< Number of active Cameras in the activeCameras array
    UINT32   activeCameras[MaxDevicePerLogicalCamera];   ///< List of active Cameras with respect to framework ID
};

/// @brief Information parameters for gamma correction.
typedef struct
{
    BOOL    isGammaValid;              ///< Indicates whether gamma correction entries are valid.
                                       ///
                                       ///  @valuesbul
                                       ///  - 0 -- FALSE
                                       ///  - 1 -- TRUE @tablebulletend

    UINT32  gammaG[65];                ///< Array of gamma green entries.
} GAMMAINFO;

/// @brief Contains configuration data for noise reduction mapping (NRM).
typedef struct
{
    // parameters for NRM10
    INT    abf_mapping_en;                                        ///< Enable flag for Auto Back Focus mapping.
    INT    anr_mapping_en;                                        ///< Enable flag for Adaptative Noise reduction mapping.
    INT    bpc_mapping_en;                                        ///< Enable flag for Bad Pixel Correction mapping.
    FLOAT  abf_edge_softness_offset;                              ///< Edge softness offset for Auto Back Focus.
    FLOAT  abf_strength_offset;                                   ///< Strength offset for Auto Back Focus.
    FLOAT  anr_luma_threshold_scale[4];                           ///< Luma threshold scale for adaptative noise reduction.
    FLOAT  anr_chroma_threshold_scale[4];                         ///< Chroma threshold scale for adaptative noise reduction.
    FLOAT  anr_luma_threshold_offset[4];                          ///< Luma threshold offset for adaptative noise reduction.
    FLOAT  anr_chroma_threshold_offset[4];                        ///< Chroma threshold offset for adaptative noise reduction.

    FLOAT  anr_dcblend2_luma_strength_scale[4];                   ///< Luma strength scale for adaptative noise reduction.
    FLOAT  anr_dcblend2_chroma_strength_scale[4];                 ///< Chroma strength scale for adaptative noise reduction.
    FLOAT  anr_dcblend2_luma_strength_offset[4];                  ///< Luma strength offset for adaptative noise reduction.
    FLOAT  anr_dcblend2_chroma_strength_offset[4];                ///< Chroma strength offset for adaptative noise reduction.
    FLOAT  bpc_fmax_offset;                                       ///< Maximum offset for Bad Pixel Correction.
    FLOAT  bpc_fmin_offset;                                       ///< Minimum offset for Bad Pixel Correction.
    FLOAT  abf_noise_std_lut_scale;                               ///< Scaling factor for ABF noise profile.
    FLOAT  anr_final_blender_luma_min_strength_high_freq_scale;   ///< Scaling factor for ANR luma final blending.
    FLOAT  anr_final_blender_chroma_min_strength_high_freq_scale; ///< Scaling factor for ANR chroma final blending.

    // new parameters added in NRM 11
    INT    alsc_mapping_en;                                       ///< Enable flag for ALSC mapping.
    FLOAT  alsc_adaptive_gain_low_scale;                          ///< Scaling factor for ALSC adaptive gain low.
    FLOAT  alsc_adaptive_gain_high_scale;                         ///< Scaling factor for ALSC adaptive gain high.
    UINT   alsc_adaptive_min_en;                                  ///< ALSC adaptive min enable.
} NRMConfigData;

/// @brief Contains configuration parameters for NRM.
typedef struct
{
    BOOL            nrmModuleEnable;       ///< Indicates whether the NRM module is enabled.
                                           ///
                                           ///  @valuesbul
                                           ///  - 0 -- FALSE
                                           ///  - 1 -- TRUE @tablebulletend

    BOOL            nrmDataChanged;        ///< Indicates whether the NRM data changed.
                                           ///
                                           ///  @valuesbul
                                           ///  - 0 -- FALSE
                                           ///  - 1 -- TRUE @tablebulletend

    NRMConfigData   nrmCfgData;            ///< Configuration data.
} NRMConfigs;

/// @brief Describes the JPEG's EXIF application header data for OEMs.
typedef struct
{
    SIZE_T  size;   ///< Size (in bytes) of the header data buffer.
    VOID*   pData;  ///< Pointer to the header data buffer.
} OEMJPEGEXIFAppData;

/// @brief Information about a metadata buffer owner.
typedef struct /** @cond */ MetadataOwnerInfo /** @endcond */
{
    UINT32                  cameraId;    ///< Unique identifier of the camera that owns this metadata buffer.
} METADATAOWNERINFO;

/// @brief Stream-specific metadata for a specified stream.
typedef struct
{
    VOID*              pSinkStreamPrivateInfo;        ///< Pointer to the private information (see CHISTREAM::pPrivateInfo) of
                                                      ///  the sink stream from which this stream buffer is generated.
    INT                streamType;                    ///< Type of stream (optional).
    VOID*              pParentSinkStreamPrivateInfo;  ///< Pointer to the private information (see CHISTREAM::pPrivateInfo) of
                                                      ///  the parent stream.
    UINT               requestCropIndex;              ///< Index of the crop entry in the payload of a request for crop
                                                      ///  information.
    INT                index[MaxPerBufferMetadata];   ///< Index of the data entry that corresponds to each metadata buffer.
} StreamMapMetaEntry;

/// @brief Contains a list of streams and their index map.
typedef struct
{
    UINT               streamMapEntryCount;                        ///< Number of valid streams.
    StreamMapMetaEntry streamMapEntry[MaxOutputStreamsPerRequest]; ///< Mapping of each stream to its index in the metadata
                                                                   ///  buffer.
} StreamMapMeta;

/// @brief Describes which streams CamX can internally share with downstream CamX nodes.
typedef struct
{
    SIZE_T     numSharedSinkTargets;                 ///< Number of entries in pStreams.
    CHISTREAM* pStreams[MaxOutputStreamsPerRequest]; ///< NULL if invalid, or a pointer to a shared sink stream.
} SharedSinkTargetInfo;

/// @brief Exposure type information for a sub-request.
typedef struct
{
    BOOL isEnabled; ///< Indicates whether the exposure type is enabled.
                    ///
                    ///  @valuesbul
                    ///  - 0 -- FALSE
                    ///  - 1 -- TRUE @tablebulletend
} SubRequestData;

/// @brief Contains data for multi-frame requests.
typedef struct
{
    UINT            numSubRequests;                             ///< Number of sub-requests for a multi-frame request.
    UINT            numExposures;                               ///< Number of exposures for a multi-frame request.
    SubRequestData  subRequestDataMap[ChiMaxNumSubRequests];    ///< Array of mappings indexed by the exposure type to
                                                                ///  determine if that exposure type is enabled in the current
                                                                ///  request.
} MultiFrameData;

/// @brief Contains the current field of view and residual crop information for a stream.
typedef struct
{
    CHIRectangle cropWRTActiveArray;    ///< Crop window with respect to the active pixel array.
    CHIRectangle cropWRTSensor;         ///< Crop window with respect to the sensor output window(also accounts for CSID crop).
    CHIRectangle cropWRTInput;          ///< Crop window of a node with respect to the input frame dimension.
    CHIRectangle cropWRTOutput;         ///< Crop window of a node with respect to the output frame dimension for a specific
                                        ///  port.
    CHIDimension frameDimension;        ///< Dimensions of the frame.
    FLOAT        preScaleRatio;         ///< Pre scale ratio
} StreamCropInfo;

/// @brief Contains information about the publisher of metadata for a node.
typedef struct
{
    UINT   nodeType;                ///< Node that publishes the metadata.
    UINT   portId;                  ///< Unique identifier of the port associated with the metadata.
    UINT   instanceId;              ///< Unique identifier of the node instance.
    INT    previousEntry;           ///< Index of the previous entry.
} StreamMetaPublisherInfo;

/// @brief Contains a graph of the stream crop information.
typedef struct
{
    StreamCropInfo          streamCropInfo;         ///< Port crop information per port per node.
    StreamMetaPublisherInfo publisherInfo;          ///< Information about the publisher of this crop metadata.
    CHIDimension            inputframeDimension;    ///< Dimensions of the input frame.
    CHIDimension            outputframeDimension;   ///< Dimensions of the output frame.
} StreamCropLinkInfo;

/// @brief Contains stream crop information associated with each request.
typedef struct
{
    UINT               streamCropCount;                       ///< Number of valid entries in the stream crop array.
    StreamCropLinkInfo streamCropArray[MaxCropInfoEntries];   ///< Array of port cropping information per port per node.
} RequestCropInfo;

/// @brief Describes the multi-camera callback modes.
typedef enum : INT8
{
    McxCbModeDefault,            ///< Default behavior as CTS. This mode must service every stream in the request.
    McxCbModePrimaryOnly,        ///< Only streams from the primary camera are serviced.
    McxCbModeMasterOnly,         ///< Only streams from the master camera are serviced.
    McxCbModeAllActiveStreams,   ///< All streams from the active camera are serviced.
    McxCbModeLogicalMasterSlave, ///< One master and multiple slave logical streams are configured by the application.
} ChiMcxCbMode;

/// @brief Describes the multi-camera callback-related information.
typedef struct
{
    ChiMcxCbMode    mode;               ///< Callback modes.

    BOOL            isRawZSLCbEnabled;  ///< Flag that indicates whether a Raw ZSL callback is enabled.
                                        ///
                                        ///  @valuesbul
                                        ///  - 0 -- FALSE
                                        ///  - 1 -- TRUE @tablebulletend
} ChiMcxCallbackInfo;

/// @brief Valid binning modes for the CSID.
enum class CSIDBinningMode
{
    HorizontalBinning   = 0,    ///< Horizontal binning (Bayer binning).
    QCFABinning         = 1,    ///< Quadra CFA binning.
};

/// @brief Binning configuration parameters for the IFE CSID.
typedef struct
{
    BOOL            isBinningEnabled;   ///< Indicates whether CSID binning is enabled.
                                        ///
                                        ///  @valuesbul
                                        ///  - 0 -- FALSE
                                        ///  - 1 -- TRUE @tablebulletend

    CSIDBinningMode binningMode;        ///< Indicates the Binning mode.
                                        ///
                                        ///  @valuesbul
                                        ///  - 0 -- Horizontal or vertical binning
                                        ///  - 1 -- Quadra CFA binning @tablebulletend
} CSIDBinningInfo;

/// @brief Snapshot output dimensions.
typedef struct
{
    UINT32  width;  ///< Width of the snapshot output.
    UINT32  height; ///< Height of the snapshot output.
} GeoLibStreamOutput;

/// @brief Contains parameters for ISP ADRC.
typedef struct
{
    BOOL  bIsADRCEnabled;                                      ///< Indicates whether ADRC is enabled.
                                                               ///
                                                               ///  @valuesbul
                                                               ///  - 0 -- FALSE
                                                               ///  - 1 -- TRUE @tablebulletend

    FLOAT GTMPercentage;                                       ///< Global tonal map percentage.
    FLOAT DRCGain;                                             ///< Gain for dynamic range compression to be applied to the
                                                               ///  ISP ADRC.
    FLOAT DRCDarkGain;                                         ///< Dark gain for dynamic range compression.
}ISPADRCParams;

/// @brief Parameters for vendor stream mapping.
struct StreamMap
{
    UINT32     width;                    ///< Width of the stream.
    UINT32     height;                   ///< Height of the stream.
    INT32      format;                   ///< Format of the stream.
    INT32      sequenceIndex;            ///< Index of the stream order.
    UINT32     streamIntent;             ///< Indicate whether this stream is a preview or a snapshot.
    UINT32     cameraIndex;              ///< Index of the camera: 0, 1, or 2.
    INT32      isPhysicalStream;         ///< Indicates whether this stream is from a physical camera.
    INT32      isThumbnailPostView;      ///< Indicates whether this stream is a snapshot post-view stream.
    INT32      reserved[8];              ///< Padding reserved for future use. Must be initialized to NULL.
};

/// @brief Contains dynamic FPS configuration parameters.
struct DynamicFpsConfig
{
    // Do not add more fields to this structure as vendor tag size is defined as an array of floats
    // Avoiding change to the vendor tag type as customers are already using type FLOAT
    FLOAT   count;     ///< Number of parameters.
    FLOAT   fps[4];    ///< Array of frames per second.
};

/// @brief Array of debug dump configuration parameters.
typedef struct
{
    CHAR dumpFileName[MaxNumImageSensors][128];    ///< File name to be used for the dump file.
} DumpFileName;

/// @brief Contains parameters for the depth conversion library.
typedef struct
{
    CHAR*   libraryName;            ///< Pointer to the name of the library
    CHAR*   preprocLibraryName;     ///< Pointer to the name of the preproclibrary.
    UINT32  depthOutputFormatCount; ///< Number of depth output formats.
    UINT32  depthOutputFormatID;    ///< Identifier of the depth output format.
    VOID*   depthOutputFormat;      ///< Pointer to the list of depth output formats.
} ChiDepthConversionLibInfo;

/// @brief Ideal Raw information received on a per request basis.
typedef struct
{
    BOOL        isIdealRaw;             ///< Indicates whether ideal Raw output is requested.
                                        ///
                                        ///  @valuesbul
                                        ///  - 0 -- FALSE
                                        ///  - 1 -- TRUE @tablebulletend

    INT32       idealRawType;           ///< Indicates the type of ideal Raw output.
                                        ///
                                        ///  @valuesbul
                                        ///  - 0 -- MIPI Raw
                                        ///  - 1 -- IFE Ideal Raw
                                        ///  - 2 -- BPS Ideal Raw @tablebulletend
} IdealRawInfo;

/// @brief Valid full field of view (FOV) port types, where video is the full FOV port.
enum class FullFOVPortType
{
    VideoPort       = 0,    ///< Full FOV VideoPort type.
    DisplayPort     = 1,    ///< Full FOV DisplayPort type.
};

/// @brief Describes information for forcing full FOV.
typedef struct
{
    BOOL                forceFullFOVEnabled;     ///< Indicates whether forcing of a full FOV is enabled.
                                                 ///
                                                 ///  @valuesbul
                                                 ///  - 0 -- FALSE
                                                 ///  - 1 -- TRUE @tablebulletend

    FullFOVPortType     fullFOVPortType;         ///< Indicates the type of full FOV port.
                                                 ///
                                                 ///  @valuesbul
                                                 ///  - 0 -- #VideoPort
                                                 ///  - 1 -- #DisplayPort @tablebulletend
} ForceFullFOVInfo;

/// @brief Defines the multi-camera 3A synchronization types.
enum MultiCamera3ASyncType
{
    MultiCamera3ASyncDisabled,      ///< 3A synchronization is disabled.
    MultiCamera3ASyncQTI,           ///< 3A synchronization for QTI
    MultiCamera3ASyncSingleton,     ///< 3A synchronization for Single Tone mode.
};

/// @brief Active camera information on a per request basis.
typedef struct
{
    UINT   numActiveCameras;                            ///< Number of active cameras.
    UINT32 activeCameras[MaxDevicePerLogicalCamera];    ///< Array of active cameras with respect to the framework ID.
} ActiveCameraInfo;

/// @brief Switch controller for a smooth transition.
typedef struct
{
    BOOL         isFallback;  ///< Flag that indicates whether to perform a fallback.
                              ///
                              ///  @valuesbul
                              ///  - 0 -- FALSE
                              ///  - 1 -- TRUE @tablebulletend

    UINT32       afDistance;  ///< Autofocus distance.
    CHIRECT      afROI;       ///< Autofocus region of interest.
} SATSwitchController;

/// @brief Describes Software Multi Frame (SWMF) tuning parameters on a per request basis.
struct SWMFandAIDETuningParams
{
    bool   enableGyroRefinement;                 ///< Indicates whether gyro is enabled for an image registration decision.
                                                 ///
                                                 ///  @valuesbul
                                                 ///  - 0 -- FALSE
                                                 ///  - 1 -- TRUE @tablebulletend

    UINT32 imageRegDesc;                         ///< Specifies the image registration descriptor selector.
                                                 ///
                                                 ///  @valuesbul
                                                 ///  - 0 -- BLOCK_DESCRIPTOR,
                                                 ///  - 1 -- INVARIANT_DESCRIPTOR @tablebulletend

    UINT32 imageRegMode;                         ///< Specifies the image registration accuracy mode.
                                                 ///
                                                 ///  @valuesbul
                                                 ///  - 0 -- FAST
                                                 ///  - 1 -- PRECISE @tablebulletend

    float  deghostingStrength;                   ///< Controls the amount of de-ghosting during temporal blending.
                                                 ///
                                                 ///  @values 0 through 1.(default = 0.5)

    float  localMotionSmoothingStrength;         ///< Controls the amount of spatial smoothing on local motion areas.
                                                 ///
                                                 ///  @values 0 through 1.(default = 1.0)

    float  dtfSpatialYStrength;                  ///< Controls the amount of DTF Y spatial smoothing.
                                                 ///
                                                 ///  @values 00 through 0.5.(default = 0.0)

    float  dtfSpatialChromaStrength;             ///< Controls the amount of DTF chroma spatial smoothing.
                                                 ///
                                                 ///  @values 0 through 0.5.(default = 0.0)

    float  spatioTemporalDenoiseBalanceStrength; ///< Controls balancing of spatio-temporal de-noise.
                                                 ///
                                                 ///  @values 0 through 1

    float  sharpnessStrength;                    ///< Controls sharpening of a blended frame.
                                                 ///
                                                 ///  @values 0 through 1

    float  sharpnessScoreThreshold;              ///< Controls the frame rejection threshold based on the score of the sharpest
                                                 ///  frame.

    float  denoiseStrength;                      ///< Indicates the de-noising strength.
                                                 ///
                                                 ///  @values 0.0 through 1.0 (default = 0.5)
};

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief HWMFNR Tuning parameters on per request basis
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
struct HWMFNRandAIDE2TuningParams
{
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /// denoising_strength
    ///
    /// Tuning Level:  must_tune
    /// Description:   Control trade-off between noise reduction and detail preservation. Higher value results in less noise,
    ///                but also results in less texture/detail. Lower value results in the opposite.
    /// Type:          float
    /// Default Value: 0.5
    /// Range:         [0,1.0]
    /// Bit Depth:     0uQ0
    /// Notes:         none
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    float  denoiseStrength;                      ///< Denoising strength: 0.0-1.0 (default = 0.5)

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /// color_saturation
    ///
    /// Tuning Level:  never_tune
    /// Description:   Control color saturation. Higher value means more saturation and lower value means less saturation(Not
    ///                used : Future usage)
    /// Type:          float
    /// Default Value: 0
    /// Range:         [-0.5,0.5]
    /// Bit Depth:     0uQ0
    /// Notes:         none
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    float  color_saturation;

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /// tone
    ///
    /// Tuning Level:  never_tune
    /// Description:   Control contrast enhancement. Higher value means more local contrast enhancement(Not used : Future usage)
    /// Type:          float
    /// Default Value: 0
    /// Range:         [0,1]
    /// Bit Depth:     0uQ0
    /// Notes:         none
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    float  tone;

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /// detail_enhancement
    ///
    /// Tuning Level:  never_tune
    /// Description:   Control detail enhancement. Higher value means more detail enhancement(Not used : Future usage)
    /// Type:          float
    /// Default Value: 0
    /// Range:         [0,1]
    /// Bit Depth:     0uQ0
    /// Notes:         none
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    float  detail_enhancement;

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /// vrt_enhance_factor
    ///
    /// Tuning Level:  must_tune
    /// Description:   Control the strength of the video enhancement.
    /// Type:          float
    /// Default Value: 0.5
    /// Range:         [0,1.0]
    /// Bit Depth:     0uQ0
    /// Notes:         none
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    float  vrt_enhance_factor;

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /// vrt_gain_modulation_threshold_y
    ///
    /// Tuning Level:  must_tune
    /// Description:   Control the boost at lower tones in order to suppress noise and other artifacts in luma channel
    /// Type:          uint
    /// Default Value: 1
    /// Range:         [0,255]
    /// Bit Depth:     0uQ0
    /// Notes:         none
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    UINT  vrt_gain_modulation_threshold_y;

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /// vrt_gain_modulation_threshold_uv
    ///
    /// Tuning Level:  must_tune
    /// Description:   Control the boost at lower tones in order to suppress noise and other artifacts in chroma channel
    /// Type:          uint
    /// Default Value: 1
    /// Range:         [0,255]
    /// Bit Depth:     0uQ0
    /// Notes:         none
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    UINT  vrt_gain_modulation_threshold_uv;
};

/// @brief Metadata for the CVP encoder.
typedef struct
{
    DOUBLE  fullResTransform[9];        ///< Intermediate 3x3 transform generated by RANSAC.
    DOUBLE  coarseTransform[9];         ///< Intermediate 3x3 transform generated by RANSAC.
    INT32   fullResTransformQ16[9];     ///< Final 3x3 transform in Q16 format.
    INT32   coarseTransformQ16[9];      ///< Final 3x3 transform in Q16 format.
    UINT32  fullResWidth;               ///< Full resolution width.
    UINT32  fullResHeight;              ///< Full resolution height.
    UINT32  processedWidth;             ///< Width of the processed metadata.
    UINT32  processedHeight;            ///< Height of the processed metadata.
    UINT32  nIsValid;                   ///< Flag that indicates whether the metadata is valid (1).
    UINT32  nFrameSumGradient;          ///< Frame-level sum gradient.
    UINT32  nFrameSumSquareGradient1;   ///< Frame-level sum square gradient1.
    UINT32  nFrameSumSquareGradient2;   ///< Frame-level sum square gradient2.
    UINT16  nLumaHist[8];               ///< Luma histogram.
    INT32   nMVxSum;                    ///< Cumulative sum of MVx.
    INT32   nMVySum;                    ///< Cumulative sum of MVy.
    UINT32  nNumMVs;                    ///< NumMVs.
    UINT32  nVersionNum;                ///< Version number.
    INT32   nTransformConfidence;       ///< RANSAC transform confidence.
    UINT32  nCostSum;                   ///< Sum of all 8x8 blocks.
    UINT32  reserved[184];              ///< Padding reserved for future use. Must be initialized to NULL.
} CVPEncoderMetaData;

/// @brief Valid pipeline synchronization modes.
enum PipelineSyncMode
{
    PipelineSyncDisabled,   ///< Synchronization is disabled.
    PipelineSyncEnabled     ///< Synchronization is enabled.
};

/// @brief Defines the quality of ideal Raw mode.
enum IdealRawMode
{
    IDEAL_RAW_OFF = 0,
    IDEAL_RAW_QUALITY_HIGH,
    IDEAL_RAW_QUALITY_LOW
};

/// @brief Defines the Blur modes.
typedef enum /** @cond */ BlurMode /** @endcond */
{
    BlurModeOff = 0,
    Blur,                   ///< Legacy Blur mode.
    ShapeBlur,              ///< Blur mode for a shape. This mode can support multiple blur shapes.
    ExtremeShapeBlur,       ///< Blur mode for an extreme shape. This mode can support multiple blur shapes and has a larger
                            ///  blur effect.
} BLURMODE;

/// @brief Defines the blur shape for SBlur (Shape Blur) and extreme SBlur.
typedef enum /** @cond */ BlurShape /** @endcond */
{
    Circle = 0,             ///< Disk1, the circular shape of a blur effect.
    Rhombus,                ///< Rhombus shape of a blur effect.
    Heart,                  ///< Heart shape of a blur effect.

    Disk2 = 101,            ///< Disk2, the circular shape of a blur effect but with a different size from Disk1.
} BLURSHAPE;

/// @brief Defines the blur effects.
typedef enum /** @cond */ BlurEffect /** @endcond */
{
    BlurEffectNone = 0,   ///< Blur only.
    BlurEffectLuma,       ///< Blur plus Luma suppression.
    BlurEffectChroma,     ///< Blur plus Chroma suppression.
    BlurEffectMax,
} BLUREFFECT;

/// @brief Contains parameters for SFE companding.
typedef struct
{
    BOOL isCompandFromSFE;           ///< Indicates whether SFE companding is enabled.
                                     ///
                                     ///  @valuesbul
                                     ///  - 0 -- FALSE
                                     ///  - 1 -- TRUE @tablebulletend

    UINT BPSDecompandInputBPP;       ///< BPP information that the BPS uses to decompand the SFE output.
} SFECompandInfo;

/// @brief Defines the versions of Geolib still frame configuration.
enum GeoLibAPIVersion
{
    GeoLibAPIVersion1 = 1,        ///< GeoLib for Kona/Lahaina (480-based)
    GeoLibAPIVersion2 = 2,        ///< GeoLib for Waipio/Filmore (680-based)
    GeoLibAPIVersion3 = 3,        ///< GeoLib for Kailua (780-based)
};

/// Version 1 mapping of a Geolib 2 structure (GeoLib2IcaPassMapping).
struct GeoLibIcaPassMappingContainer
{
    GeoLibIcaPassMapping mappingAnchor;                         ///< ICA mapping for the Anchor stage.
    GeoLibIcaPassMapping mappingBlend;                          ///< ICA mapping for the Blending stage.
    GeoLibIcaPassMapping mappingEqualize;                       ///< ICA mapping for the Equalize stage.
    GeoLibIcaPassMapping mappingFinal;                          ///< ICA mapping for the Final stage.
};

/// Version 1 mapping of a Geolib 2 structure (GeoLib2IpeStripingConfigContainer).
struct GeoLibIpeStripingConfigContainer
{
    GeoLibIpeStripingConfig configAnchor;                       ///< Striping configuration for the Anchor stage.
    GeoLibIpeStripingConfig configBlend;                        ///< Striping configuration for the Blend stsage.
    GeoLibIpeStripingConfig configEqualize;                     ///< Striping configuration for the Equalize stage.
    GeoLibIpeStripingConfig configFinal;                        ///< Striping configuration for the Final stage.
};

/// @brief Parameters used to configure a Geolib still frame for version 1. (Kona/Lahaina)
struct StillFrameConfigV1
{
    GeoLibStillFrameConfig frameConfig;                 ///< Contains the configuration for the Geolib still frame.
};

/// @brief Parameters used to configure a Geolib still frame for version 2. (Waipio/Filmore)
struct StillFrameConfigV2
{
    GeoLibStillFlowMode                 flowMode;               ///< Geolib Flow mode for version 2 (Waipio/Filmore).
    GeoLibMultiFrameMode                mfMode;                 ///< Multi-frame mode.
    GeoLibCropAndScale                  bpsOutFullCrop;         ///< Version 1 mapping of GeoLibCropAndScale.
    GeoLibCropAndScale                  bpsRegCropAndScale;     ///< Version 1 mapping of bpsRegCropAndScale.
    GeoLibIcaMapping                    cvpIcaMapping;          ///< Version 1 of EVA ICA mapping.
    GeoLibIcaPassMappingContainer       ica1Mapping;            ///< Version 1 of ICA 1 mapping.
    GeoLibIcaPassMappingContainer       ica2Mapping;            ///< Version 1 of ICA 2 mapping.
    GeoLibIpeStripingConfigContainer    ipeStripingInputs;      ///< Version 1 mapping of striping inputs.
    GeoLib2StillMFFrameConfig           frameConfig;            ///< 680 version (Waipio/Filmore) still frame configuration.
};

/// @brief Parameters used to configure a Geolib still frame for version 3. (Kailua)
struct StillFrameConfigV3
{
    GeoLibStillFlowMode                 flowMode;               ///< GeoLib flow mode
    GeoLibMultiFrameMode                mfMode;                 ///< Multi-frame mode.
    GeoLibCropAndScale                  bpsOutFullCrop;         ///< Version 1 mapping of GeoLibCropAndScale.
    GeoLibCropAndScale                  bpsRegCropAndScale;     ///< Version 1 mapping of bpsRegCropAndScale.
    GeoLibIcaMapping                    evaIcaMapping;          ///< Version 1 of EVA ICA mapping.
    GeoLibIcaPassMappingContainer       ica1Mapping;            ///< Version 1 of ICA 1 mapping.
    GeoLibIcaPassMappingContainer       ica2Mapping;            ///< Version 1 of ICA 2 mapping.
    GeoLibIpeStripingConfigContainer    ipeStripingInputs;      ///< Version 1 mapping of striping inputs.
    GeoLib2StillFrameConfig             frameConfig;            ///< 780 version (Kailua) still frame configuration.
};

/// @brief Top-level structure that encapsulates Geolib still frame configuration.
struct GeoLibStillFrameConfigWrapper
{
    GeoLibAPIVersion apiVersion;                        ///< Configuration version.

/// @brief Configuration union for different versions
    union
    {
        StillFrameConfigV1 configureV1;                 ///< Configuration structure for version 1.
        StillFrameConfigV2 configureV2;                 ///< Configuration structure for version 2.
        StillFrameConfigV3 configureV3;                 ///< Configuration structure for version 3.
    };
};

/// @brief Defines indices for CHI exposure types.
typedef enum
{
    ChiExposureIndexShort        = 0,
    ChiExposureIndexLong         = 1,
    ChiExposureIndexSafe         = 2,
    ChiExposureIndexCount        = 3,
} ChiExposureIndex;

/// @brief Contains information for a QLL frame.
typedef struct
{
    BOOL            isQLLMode;                            ///< Indicates whether QLL mode is ON or OFF.
                                                          ///
                                                          ///  @valuesbul
                                                          ///  - 0 -- OFF
                                                          ///  - 1 -- ON @tablebulletend

    UINT64          maxLongFrameExposureTime;             ///< Maximum exposure time for the long frame in nanoseconds.

    UINT16          frameCount[ChiExposureIndexCount];    ///< QLL decision for the number of frames to use.
                                                          ///
                                                          ///  Only the long and short indices will be used, where the short
                                                          ///  short index is always 1.
    UINT64          requestID;                            ///< Unique identifier for the processed frame request.
} QLLData;

/// @brief Information about the per stream HDR10 mode.
struct ChiPerStreamHDRMode
{
    UINT64        streamID;   ///< Unique stream ID for this HDR10 mode.
    StreamHDRMode mode;       ///< HDR10 mode for this stream ID.
};

/// @brief Information about combined per stream HDR mode.
struct ChiStreamHDRModeMap
{
    UINT32              numStreamHDRModes;                        ///< Number of individual stream HDR modes
    ChiPerStreamHDRMode perStreamHDRMode[MaxPerStreamHDRModes];   ///< Array of per stream HDR modes.
};

/// @brief Information about combined per stream tuning mode parameters
struct DebugDataTuningMetaArray
{
    UINT32    numDebugDataPtrs;                                    ///< Number of valid debug data ponters
    DebugData perPipelineDebugData[MaxNumAccumulateDebugDataPtrs]; ///< Array of per stream tuning modes
};

struct GTMCurveDataVendorTag
{
    DOUBLE   YratioBaseProp[YRatioGTMLUTSize + 1];    ///< manual curve, +1 is for slope calculation of the last
    FLOAT    ManualCurveStrength;                     ///< manual curve strength
};

struct CustomizedDebugDataArray
{
    UINT32   numDebugData;                               ///< Number of customized debug data tags
    UINT16   DebugDataID[MaxNumCustomizedDebugDataSize]; ///< Array of debug data tag ID
};

/** @} *//* end_addtogroup chi_common_vendor_tags */
#pragma pack(pop)

#ifdef __cplusplus
}
#endif // __cplusplus

#endif // CHIVENDORTAG_H
