@class NSObject, NSArray, FRCScaler; @protocol MTLComputePipelineState, OS_os_log; @interface OpticalFlowAnalyzer : FRCMetalBase { id _flowStatisticsKernel; id _crossFlowStatisticsKernel; id _motionHistogramsKernel; id _backwarpStatisticsKernel; NSObject *_logger; unsigned long long _framesToInterpolate; struct { long long value; int timescale; unsigned int flags; long long epoch; } _timeGap; NSArray *_firstFaceHandLegRectangles; NSArray *_secondFaceHandLegRectangles; float _consistentFlowRandomness; float _signErrFlowRandomness; float _signAreaFlowRandomness; float _zigzagFlowRandomness; float _flowDeformation; float _flowDeformationSum; float _prevFlowRandomnessErr; float _prevFlowRandomnessArea; BOOL _prevFlowDeformation; BOOL _isLargeRandomnessErr; struct { BOOL consistency; BOOL randomness; BOOL deformation; BOOL backwarp; } _safeToInterpolate; struct CGRect { struct CGPoint { double x; double y; } origin; struct CGSize { double width; double height; } size; } _cleanRectFlow8x8; float jsonConsistencyAreaThreshold; float jsonConsistencyAreaPercentageThreshold; float jsonConsistencyROIAreaPercentageThreshold; float jsonConsistencyFrameScoreThresholdOnDemand; float jsonConsistencyAreaPercentageThresholdOnDemand; float jsonConsistencySafeThresholdsForDownsampled[8]; float jsonConsistencySafeThresholdsForNonDownsampled[8]; float jsonConsistencySafeThresholdsForDownsampledDelta[8]; float jsonConsistencySafeThresholdsForNonDownsampledDelta[8]; float jsonConsistencyVerticalStripAreaPercentageThreshold; float jsonConsistencyVerticalStripScoreThreshold; float jsonConsistencyHorizontalStripAreaPercentageThreshold; float jsonConsistencyHorizontalStripScoreThreshold; float consistencySafeThresholdsScale; float consistencySafeThresholdsScaleForLargeRandomnessErr; float jsonRandomnessScoreThreshold; float jsonRandomnessScoreThresholdLow; float jsonRandomnessAreaThreshold; float jsonRandomnessAreaPercentageThresholdHigh; float jsonRandomnessAreaPercentageThresholdLow; float jsonRandomnessErrThreshold; float jsonRandomnessAreaScale; float randomnessAreaScale; float jsonRandomnessErrorChangeRatioThreshold; float jsonRandomnessAreaChangeRatioThreshold; float jsonRandomnessErrorChangeRatioThresholdForCameraMotion; float jsonRandomnessAreaChangeRatioThresholdForCameraMotion; float jsonRandomnessErrorChangeRatioThresholdForStatic; float jsonRandomnessAreaChangeRatioThresholdForStatic; float randomnessErrorChangeRatioThreshold; float randomnessAreaChangeRatioThreshold; float jsonConsistentRandomFlowThreshold; float jsonConsistentRandomFlowResetAreaChangeRatio; float jsonZigzagRandomFlowThreshold; float jsonDeformationRatioThreshold; float jsonDeformationFlowThreshold; float jsonDeformationFlowSumThreshold; float jsonHistogramsAnalysisLargeObjectSizeThreshold; float jsonHistogramsAnalysisSmallObjectSizeThreshold; float jsonSideMotionDominanceThreshold; unsigned int jsonSideMotionPixelCountThreshold; float jsonConsistencySafeThresholdsForDownsampledSloMo[12]; float jsonConsistencySafeThresholdsForNonDownsampledSloMo[12]; float jsonDeformationFlowThresholdForSloMo; float jsonDeformationFlowSumThresholdForSloMo; float jsonBackwarpAreaPercentageThreshold; float jsonBackwarpFrameScoreThreshold; float jsonBackwarpROIScoreThreshold; float jsonBackwarpScoreHighThreshold; float jsonBackwarpAreaPercentageHighThreshold; float jsonBackwarpAreaThreshold; float jsonBackwarpFrameScoreThresholdOnDemand; float jsonBackwarpAreaPercentageThresholdOnDemand; BOOL _hasCameraMotion; BOOL _hasDominantMovingLargeObjects; BOOL _hasDominantMovingSmallObjects; BOOL _hasStaticBackground; struct { BOOL hasStaticBackground; int dominantDirection; int relativeDominantDirection; long long hasSpecialMotion; BOOL hasCameraRotaion; } _motionHistogramsAnalysis; struct { BOOL hasStaticBackground; int dominantDirection; int relativeDominantDirection; long long hasSpecialMotion; BOOL hasCameraRotaion; } _prevMotionHistogramsAnalysis; struct { unsigned int frameMagnitude[8]; unsigned int frameDirection[8]; unsigned int topLeftDirection[4]; unsigned int topRightDirection[4]; unsigned int bottomLeftDirection[4]; unsigned int bottomRightDirection[4]; unsigned int numLowMotionOppositeDirectionBlocks; unsigned int areaLowMotionOppositeDirectionBlocks; unsigned int leftSideDirection[4]; unsigned int rightSideDirection[4]; unsigned int leftSideAverageMagnitude; unsigned int rightSideAverageMagnitude; unsigned int topSideDirection[4]; unsigned int bottomSideDirection[4]; unsigned int topSideAverageMagnitude; unsigned int bottomSideAverageMagnitude; } _motionHistograms; unsigned long long _size; struct __CVBuffer { } *_donwsampledSourceBuffer; } @property (nonatomic) long long usage; @property (nonatomic) BOOL inputScaling; @property (nonatomic) BOOL opticalFlowDownsampling; @property (nonatomic) long long inputRotation; @property (nonatomic) unsigned long long useCase; @property (nonatomic) BOOL isSmallDrops; @property (nonatomic) BOOL isContinuousDrops; @property (nonatomic) BOOL shouldRunFlowAnalysis; @property (nonatomic) BOOL shouldRunCrossFlowAnalysis; @property (nonatomic) BOOL shouldRunDetection; @property (nonatomic) BOOL shouldRunBackwarpGating; @property (nonatomic) unsigned char timesDidRunDetection; @property (weak, nonatomic) FRCScaler *scaler; @property (readonly, nonatomic) BOOL isSafeToInterpolate; @property (readonly, nonatomic) BOOL isSafeToInterpolateForInteractiveMode; @property (nonatomic) BOOL handDetectionEnabled; @property (nonatomic) BOOL bodyDetectionEnabled; @property (nonatomic) BOOL humanDetectionEnabled; @property (nonatomic) BOOL animalFaceDetectionEnabled; @property (nonatomic) long long retimingRecipe; @property (readonly, nonatomic) unsigned long long gatingCause; @property (readonly, nonatomic) float flowConsistencyFrameScore; @property (readonly, nonatomic) float flowConsistencyROIScore; @property (readonly, nonatomic) float confidenceScore; @property (readonly, nonatomic) float confidenceScoreOnDemand; @property (nonatomic) char *deformationBinaryMap; @property (nonatomic) int *deformationBlockRanges; @property (nonatomic) char *consistencyMap; @property (nonatomic) char *backwarpLossMap; @property (nonatomic) int *backwarpBlockRanges; @property (nonatomic) BOOL visualizationEnabled; - (id)init; - (void)reset; - (void)dealloc; - (void).cxx_destruct; - (void)setupMetal; - (void)analyzeAggregatedStatistics:(struct { struct { long long x0; int x1; unsigned int x2; long long x3; } x0; unsigned long long x1; float x2; float x3; float x4; float x5; float x6; float x7; float x8; float x9; float x10; unsigned long long x11; float *x12; unsigned long long x13; float *x14; unsigned long long x15; float *x16; unsigned long long x17; float *x18; unsigned long long x19; float *x20; unsigned long long x21; float *x22; unsigned long long x23; float *x24; unsigned long long x25; float *x26; unsigned long long x27; float *x28; unsigned long long x29; float *x30; } *)a0; - (struct { float x0; float x1; float x2; float x3; float x4; })analyzeBackwarpForward:(struct __CVBuffer { } *)a0 backward:(struct __CVBuffer { } *)a1 flowResFirst:(struct __CVBuffer { } *)a2 flowResSecond:(struct __CVBuffer { } *)a3; - (void)analyzeDeformation; - (struct { float x0; float x1; float x2; })analyzeFlowRandomnessWithPrevFlowBackward:(struct __CVBuffer { } *)a0 forward:(struct __CVBuffer { } *)a1 lastFrameDuration:(struct { long long x0; int x1; unsigned int x2; long long x3; })a2 lastNumberOfFrames:(unsigned long long)a3 flowResFrame:(struct __CVBuffer { } *)a4; - (void)analyzeMotionHistograms; - (struct { struct { long long x0; int x1; unsigned int x2; long long x3; } x0; unsigned long long x1; float x2; float x3; float x4; float x5; float x6; float x7; float x8; float x9; float x10; unsigned long long x11; float *x12; unsigned long long x13; float *x14; unsigned long long x15; float *x16; unsigned long long x17; float *x18; unsigned long long x19; float *x20; unsigned long long x21; float *x22; unsigned long long x23; float *x24; unsigned long long x25; float *x26; unsigned long long x27; float *x28; unsigned long long x29; float *x30; })analyzeOpticalFlowForward:(struct __CVBuffer { } *)a0 backward:(struct __CVBuffer { } *)a1 flowResFrame:(struct __CVBuffer { } *)a2; - (unsigned int)averageMagnitude:(unsigned int *)a0; - (struct { float x0; float x1; float x2; float x3; float x4; })calcBackwarpStatisticsForwardLossTexture:(id)a0 backwardLossTexture:(id)a1 faceHandLegRectangles:(id)a2; - (struct { float x0; float x1; float x2; })calcCrossFlowStatisticsPrevBackwardFlowTexture:(id)a0 forwardFlowTexture:(id)a1 frameTexture:(id)a2 flowScaleBuffer:(id)a3; - (struct { struct { long long x0; int x1; unsigned int x2; long long x3; } x0; unsigned long long x1; float x2; float x3; float x4; float x5; float x6; float x7; float x8; float x9; float x10; unsigned long long x11; float *x12; unsigned long long x13; float *x14; unsigned long long x15; float *x16; unsigned long long x17; float *x18; unsigned long long x19; float *x20; unsigned long long x21; float *x22; unsigned long long x23; float *x24; unsigned long long x25; float *x26; unsigned long long x27; float *x28; unsigned long long x29; float *x30; })calcFlowStatisticsForwardFlowTexture:(id)a0 backwardFlowTexture:(id)a1 faceHandLegRectangles:(id)a2 frameTexture:(id)a3; - (void)calcMotionHistogramForwardFlowTexture:(id)a0 frameTexture:(id)a1; - (void)calcStripConsistency:(float *)a0 stripSize:(unsigned long long)a1 numStrips:(unsigned int)a2; - (BOOL)checkSafetyByBlockConsistency:(struct { struct { long long x0; int x1; unsigned int x2; long long x3; } x0; unsigned long long x1; float x2; float x3; float x4; float x5; float x6; float x7; float x8; float x9; float x10; unsigned long long x11; float *x12; unsigned long long x13; float *x14; unsigned long long x15; float *x16; unsigned long long x17; float *x18; unsigned long long x19; float *x20; unsigned long long x21; float *x22; unsigned long long x23; float *x24; unsigned long long x25; float *x26; unsigned long long x27; float *x28; unsigned long long x29; float *x30; } *)a0; - (BOOL)checkSafetyByScoreAndArea:(struct { struct { long long x0; int x1; unsigned int x2; long long x3; } x0; unsigned long long x1; float x2; float x3; float x4; float x5; float x6; float x7; float x8; float x9; float x10; unsigned long long x11; float *x12; unsigned long long x13; float *x14; unsigned long long x15; float *x16; unsigned long long x17; float *x18; unsigned long long x19; float *x20; unsigned long long x21; float *x22; unsigned long long x23; float *x24; unsigned long long x25; float *x26; unsigned long long x27; float *x28; unsigned long long x29; float *x30; } *)a0; - (BOOL)checkSafetyByStripConsistency:(struct { struct { long long x0; int x1; unsigned int x2; long long x3; } x0; unsigned long long x1; float x2; float x3; float x4; float x5; float x6; float x7; float x8; float x9; float x10; unsigned long long x11; float *x12; unsigned long long x13; float *x14; unsigned long long x15; float *x16; unsigned long long x17; float *x18; unsigned long long x19; float *x20; unsigned long long x21; float *x22; unsigned long long x23; float *x24; unsigned long long x25; float *x26; unsigned long long x27; float *x28; unsigned long long x29; float *x30; } *)a0; - (float)computeBackwarpConfidenceFromScore:(float)a0 scoreThreshold:(float)a1 scoreHighThreshold:(float)a2 areaRatio:(float)a3 areaRatioThreshold:(float)a4 areaRatioHighThreshold:(float)a5 large_area:(BOOL)a6; - (float)computeConsistencyConfidenceFromScore:(float)a0 scoreThreshold:(float)a1 areaRatio:(float)a2 areaRatioThreshold:(float)a3; - (void)convertOctantDirectionHistogram:(int *)a0 toPerpendicularQuadrantHistogram:(unsigned int *)a1; - (BOOL)detectCameraRotation; - (void)detectDominantDirection; - (int)detectDominantDirectionInROI:(unsigned int *)a0; - (long long)detectSpecialMotion; - (BOOL)detectStaticBackground; - (id)extractFaceHandLegInfoFromBuffer:(struct __CVBuffer { } *)a0; - (id)findFaceHandLegBlocksFromRectangles:(id)a0 blockWidth:(unsigned long long)a1 blockHeight:(unsigned long long)a2; - (void)isSafeToInterpolateForBackwarpGatingWithFlowForward:(struct __CVBuffer { } *)a0 flowBackward:(struct __CVBuffer { } *)a1 flowResFirst:(struct __CVBuffer { } *)a2 flowResSecond:(struct __CVBuffer { } *)a3; - (void)isSafeToInterpolateForConsistencyGatingWithFlowForward:(struct __CVBuffer { } *)a0 flowBackward:(struct __CVBuffer { } *)a1 flowResFrame:(struct __CVBuffer { } *)a2; - (void)isSafeToInterpolateForDeformationGating; - (void)isSafeToInterpolateForRandomnessGatingWithPrevFlowBackward:(struct __CVBuffer { } *)a0 flowForward:(struct __CVBuffer { } *)a1 lastFrameDuration:(struct { long long x0; int x1; unsigned int x2; long long x3; })a2 lastNumberOfFrames:(unsigned long long)a3 flowResFrame:(struct __CVBuffer { } *)a4; - (void)modulateGatingParametersFromMotionHistogramsAnalysis; - (void)modulateGatingParametersWithFlowForward:(struct __CVBuffer { } *)a0 flowResFrame:(struct __CVBuffer { } *)a1; - (void)prepareGatingFrameDropDetector:(id)a0 numberOfFrames:(unsigned long long)a1 timeGap:(struct { long long x0; int x1; unsigned int x2; long long x3; })a2 isContinuousDrops:(BOOL)a3 enableFlowAnalysis:(BOOL)a4 enableCrossFlowAnalysis:(BOOL)a5 cleanRectFirst:(struct CGRect { struct CGPoint { double x0; double x1; } x0; struct CGSize { double x0; double x1; } x1; })a6 cleanRectSecond:(struct CGRect { struct CGPoint { double x0; double x1; } x0; struct CGSize { double x0; double x1; } x1; })a7; - (void)printFaceHandLegRectangles:(id)a0; - (void)printSideHistograms; - (void)printStripScores:(struct { struct { long long x0; int x1; unsigned int x2; long long x3; } x0; unsigned long long x1; float x2; float x3; float x4; float x5; float x6; float x7; float x8; float x9; float x10; unsigned long long x11; float *x12; unsigned long long x13; float *x14; unsigned long long x15; float *x16; unsigned long long x17; float *x18; unsigned long long x19; float *x20; unsigned long long x21; float *x22; unsigned long long x23; float *x24; unsigned long long x25; float *x26; unsigned long long x27; float *x28; unsigned long long x29; float *x30; } *)a0; - (struct { float x0; float x1; float x2; float x3; float x4; })processBackwarpStats:(struct { float x0; } *)a0 blockWidth:(unsigned long long)a1 blockHeight:(unsigned long long)a2 faceHandLegBoundingBoxBlocks:(id)a3; - (struct { struct { long long x0; int x1; unsigned int x2; long long x3; } x0; unsigned long long x1; float x2; float x3; float x4; float x5; float x6; float x7; float x8; float x9; float x10; unsigned long long x11; float *x12; unsigned long long x13; float *x14; unsigned long long x15; float *x16; unsigned long long x17; float *x18; unsigned long long x19; float *x20; unsigned long long x21; float *x22; unsigned long long x23; float *x24; unsigned long long x25; float *x26; unsigned long long x27; float *x28; unsigned long long x29; float *x30; })processGPUOutputs:(struct { float x0; } *)a0 blockWidth:(unsigned long long)a1 blockHeight:(unsigned long long)a2 faceHandLegBoundingBoxBlocks:(id)a3; - (void)processGPUOutputsHistograms:(struct { int x0[8]; int x1[8]; } *)a0 blockWidth:(unsigned long long)a1 blockHeight:(unsigned long long)a2; - (void)processGPUOutputsHistogramsForDeformation:(struct { int x0[8]; int x1[8]; } *)a0 blockWidth:(unsigned long long)a1 blockHeight:(unsigned long long)a2; - (struct { float x0; float x1; float x2; })processGPUOutputsRandomness:(struct { float x0; } *)a0 blockWidth:(unsigned long long)a1 blockHeight:(unsigned long long)a2; - (void)runDetectionFromFirstBuffer:(struct __CVBuffer { } *)a0 secondBuffer:(struct __CVBuffer { } *)a1; - (void)runGatingWithPrevFlowBackward:(struct __CVBuffer { } *)a0 flowForward:(struct __CVBuffer { } *)a1 flowBackward:(struct __CVBuffer { } *)a2 lastFrameDuration:(struct { long long x0; int x1; unsigned int x2; long long x3; })a3 lastNumberOfFrames:(unsigned long long)a4 flowResFrame:(struct __CVBuffer { } *)a5 flowResFirst:(struct __CVBuffer { } *)a6 flowResSecond:(struct __CVBuffer { } *)a7; - (struct { float x0; float x1; float x2; })safeThresholdWithtimeGap:(struct { long long x0; int x1; unsigned int x2; long long x3; })a0 isDownsampled:(BOOL)a1; - (void)setDetectorsFromDefaults; - (void)updateGatingStats; @end