PvaOperatorTypes.h#

Fully qualified name: public/src/operator/include/PvaOperatorTypes.h

File members: public/src/operator/include/PvaOperatorTypes.h

/*
 * SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
 *
 * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
 * property and proprietary rights in and to this material, related
 * documentation and any modifications thereto. Any use, reproduction,
 * disclosure or distribution of this material and related documentation
 * without an express license agreement from NVIDIA CORPORATION or
 * its affiliates is strictly prohibited.
 */

#ifndef PVA_OPERATOR_TYPES_H
#define PVA_OPERATOR_TYPES_H

#include <stdbool.h>
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef enum
{
    PVA_ERODE = 0,
    PVA_DILATE = 1,
} PVAMorphologyType;

typedef enum
{
    PVA_SPLIT_RGBA8_TO_U8 = 0,

    PVA_MERGE_U8_TO_RGBA8 = 1
} PVAMixChannelsCode;

typedef enum
{
    PVA_DIST_L1 = 0,
    PVA_DIST_L2,
    PVA_DIST_HAMMING
} PVADistanceType;

typedef enum
{
    PVA_INTERPOLATION_NN = 0,
    PVA_INTERPOLATION_LINEAR
} PVAInterpolationType;

typedef enum
{
    PVA_WARP_TRANSFORMATION_PERSPECTIVE = 0,
    PVA_WARP_TRANSFORMATION_AFFINE = 1,
} PVAWarpTransformationType;

#define PVA_MAX_BF_MATCHES_PER_DESCRIPTOR (3)

#define PVA_MAX_BF_DESCRIPTOR_COUNT (4096)

#define PVA_BRIEF_DESCRIPTOR_ARRAY_LENGTH (32)

typedef struct
{
    uint8_t data[PVA_BRIEF_DESCRIPTOR_ARRAY_LENGTH];
} PVABriefDescriptor;

typedef struct PVABFMatchesTypeRec
{
    int16_t refIndex[PVA_MAX_BF_MATCHES_PER_DESCRIPTOR];

    int16_t distance[PVA_MAX_BF_MATCHES_PER_DESCRIPTOR];
} PVABFMatchesType;

typedef enum
{
    PVA_IMAGE_STAT_FLAG_PIXEL_COUNT = (1u << 0),
    PVA_IMAGE_STAT_FLAG_SUM = (1u << 1),
    PVA_IMAGE_STAT_FLAG_MEAN = ((1u << 2) | PVA_IMAGE_STAT_FLAG_SUM | PVA_IMAGE_STAT_FLAG_PIXEL_COUNT),
    PVA_IMAGE_STAT_FLAG_VARIANCE = ((1u << 3) | PVA_IMAGE_STAT_FLAG_MEAN),
    PVA_IMAGE_STAT_FLAG_COVARIANCE = ((1u << 4) | PVA_IMAGE_STAT_FLAG_VARIANCE)
} PVAImageStatFlag;

typedef struct
{
    int pixelCount;
    float sum[4];
    float mean[4];
    float covariance[4][4];
} PVAImageStatOutput;

typedef enum
{
    PVA_GMM_DATA_TYPE_FP32,
    PVA_GMM_DATA_TYPE_FP16
} PVAGMMDataType;

typedef enum
{
    PVA_BATCH_FFT_WINDOW_HANNING,
    PVA_BATCH_FFT_WINDOW_USER_DEFINED,
} PVABatchFFTWindowType;

typedef struct PVARangeFFTParamsRec
{
    PVABatchFFTWindowType windowType;
} PVARangeFFTParams;

typedef enum
{
    PVA_DOPPLER_FFT_OUTPUT_LAYOUT_DOPPLER_RX_RANGE = 0,
    PVA_DOPPLER_FFT_OUTPUT_LAYOUT_RANGE_RX_DOPPLER = 1,
    PVA_DOPPLER_FFT_OUTPUT_LAYOUT_RANGE_DOPPLER_RX = 2
} PVADopplerFFTOutputLayout;

typedef struct PVADopplerFFTParamsRec
{
    PVABatchFFTWindowType windowType;
    PVADopplerFFTOutputLayout outputLayout;
} PVADopplerFFTParams;

typedef enum
{
    PVA_FLIP_HORIZONTAL = 0,
    PVA_FLIP_VERTICAL = 1,
    PVA_FLIP_BOTH = 2
} PVAFlipDirection;

typedef enum
{
    PVA_CFAR_CA = 0,
    PVA_CFAR_CA_OS = 1,
    PVA_CFAR_CA_GO = 2,
    PVA_CFAR_CA_SO = 3
} PVARadarCFARType;

typedef enum
{
    PVA_CFAR_HORIZONTAL_THRESHOLD_UNIFORM = 0,
    PVA_CFAR_HORIZONTAL_THRESHOLD_PER_ROW = 1,
} PvaRadarCFARHorizontalThresholdType;

typedef struct PvaRadarCFARHorizontalThresholdRec
{
    PvaRadarCFARHorizontalThresholdType type;
    union
    {
        float uniform;
        const float *perRow;
    } value;
} PvaRadarCFARHorizontalThreshold;

typedef struct PvaRadarCFARParamsRec
{
    int32_t numHorTrain;
    int32_t numHorGuard;
    int32_t numVerTrain;
    int32_t numVerGuard;
    PvaRadarCFARHorizontalThreshold horizontalThreshold;
    float verticalThresholdFactor;
    bool isHorizontalCyclicPadding;
    bool isVerticalCyclicPadding;
    bool enablePeakGrouping;
} PvaRadarCFARParams;

typedef enum
{
    PVA_4_CONNECTIVITY = 0,
    PVA_8_CONNECTIVITY = 1,
} PVAConnectivityType;

typedef struct
{
    int32_t numDopplerFolds;
    PVADopplerFFTOutputLayout rangeDopplerFormat;
} PVASnapshotExtractionParams;

typedef enum
{
    PVA_BARTLETT_AZ_FROM_NEIGHBORHOOD = 0,
    PVA_BARTLETT_AZ_FROM_EL0 = 1
} PVABartlettAzSource;

typedef enum
{
    PVA_BARTLETT_AZ_NEIGHBORHOOD_0 = 0,
    PVA_BARTLETT_AZ_NEIGHBORHOOD_1 = 1,
    PVA_BARTLETT_AZ_NEIGHBORHOOD_2 = 2
} PVABartlettAzNeighborhood;

typedef struct
{
    bool enableSeparable;

    PVABartlettAzNeighborhood azNeighborhood;

    PVABartlettAzSource azSource;

    uint64_t azChannelMask;
} PVASeparableBartlettParams;

typedef struct
{
    // Bartlett Beamforming parameters
    bool enableInterpolation;
    bool enablePowerOutput;

    // Separable Bartlett parameters (optional optimization)
    PVASeparableBartlettParams separableParams;
} PVADoaBartlettBeamformingParams;

/* =========================================================================
 * Custom Radar Operator Types (DOA DA FFT, Peak Detection, DOA Angle FFT,
 * Target Processing)
 * ========================================================================= */

#define PVA_RADAR_RX_ANTENNA_COUNT (4)

#define PVA_RADAR_TX_ANTENNA_COUNT (4)

#define PVA_RADAR_DOPPLER_FOLD_COUNT (8)

#define PVA_RADAR_MAX_TARGET_COUNT (8192)

#define PVA_RADAR_PEAKDET_NUM_PEAK_INDICES (3)

#define PVA_RADAR_NUM_TARGET_DETECTION_PROPERTIES (7)

#define PVA_RADAR_NUM_ANTENNA_ELEMENTS (8)

#define PVA_RADAR_NUM_TOTAL_ANTENNA_ELEMENTS (2 * PVA_RADAR_NUM_ANTENNA_ELEMENTS)

typedef struct
{
    int32_t nr;
    int32_t repeatFold;
    int32_t nofSnap;
    int32_t nofAperture;
    int32_t nofAFFT;
    float dis;
    float fs;
    int32_t nofSamples;
    float PRI;
    int32_t nofRamps;
    float deltaV;
    int32_t apUpperInd[PVA_RADAR_NUM_ANTENNA_ELEMENTS];
    int32_t apUpper[PVA_RADAR_NUM_ANTENNA_ELEMENTS];
    int32_t apLowerInd[PVA_RADAR_NUM_ANTENNA_ELEMENTS];
    int32_t apLower[PVA_RADAR_NUM_ANTENNA_ELEMENTS];
    float disE;
    float contVFast;
    float contVSlow;
    float contR;
    int32_t calibVectorQbits;
    int32_t fftQbits;
} PVARadarGP;

typedef enum
{
    PVA_ANGLE_ESTIMATION_PRECISION_LOW     = 0,
    PVA_ANGLE_ESTIMATION_PRECISION_DEFAULT = 1,
    PVA_ANGLE_ESTIMATION_PRECISION_HIGH    = 2
} PVADoaAngleFFTPrecision;

typedef struct
{
    float wavelength;
    float sweepTime;
    float rangeResolution;
    int32_t numChirps;
    bool fftShiftedDoppler;
    bool enableRvDecoupling;
    bool enableQuadraticInterpolation;

    // =========================================================================
    // RV Decoupling Parameters (only used when enableRvDecoupling is true)
    // Base FMCW radar parameters - derived values are computed internally
    // by the operator (following the DOA operator pattern).
    // =========================================================================

    float fs;
    int32_t nofSamples;
    float PRI;
    float deltaV;
    float contR;
    float contVFast;
    float contVSlow;

    // =========================================================================
    // Coordinate System Options (for spherical-to-Cartesian conversion)
    // =========================================================================

    int32_t longitudinalAxis;
    int32_t groundProjection;
} PVATargetProcessingParams;

typedef struct
{
    // DoA Angle FFT parameters
    int32_t numVirtualAzimuthElements;
    int32_t numVirtualElevationElements;
    PVADoaAngleFFTPrecision angleEstimationPrecision;
    bool enableLocalPeakDetection;
} PVADoaAngleFFTParams;

#ifdef __cplusplus
}
#endif

#endif /* PVA_OPERATOR_TYPES_H */