From e5172cc3d57c90c03ef81c860f9856452afed693 Mon Sep 17 00:00:00 2001 From: Hao Yao Date: Wed, 10 Dec 2025 11:25:43 +0800 Subject: [PATCH] PTL release for iot on 2025-12-10 Signed-off-by: Hao Yao --- .../ipu75xa/FragmentsConfigurator.cpp | 55 ++++++-- .../ipu_desc/ipu75xa/FragmentsConfigurator.h | 4 +- .../ipu75xa/GraphResolutionConfigurator.cpp | 126 ++++++------------ .../ipu75xa/GraphResolutionConfigurator.h | 5 +- .../Ipu75xaStaticGraphDataPreloadAutogen.h | 2 +- .../Ipu75xaStaticGraphReaderAutogen.cpp | 15 +++ .../ipu75xa/Ipu75xaStaticGraphReaderAutogen.h | 1 + ...anifest_db_ipu7_psys_cb_bbps_descriptors.h | 2 +- ...anifest_db_ipu7_psys_cb_lbff_descriptors.h | 2 +- .../ipu_desc/ipu7x/FragmentsConfigurator.cpp | 55 ++++++-- .../ipu_desc/ipu7x/FragmentsConfigurator.h | 4 +- .../ipu7x/GraphResolutionConfigurator.cpp | 126 ++++++------------ .../ipu7x/GraphResolutionConfigurator.h | 5 +- .../Ipu7xStaticGraphDataPreloadAutogen.h | 2 +- .../ipu7x/Ipu7xStaticGraphReaderAutogen.cpp | 15 +++ .../ipu7x/Ipu7xStaticGraphReaderAutogen.h | 1 + ...anifest_db_ipu7_psys_cb_bbps_descriptors.h | 2 +- ...anifest_db_ipu7_psys_cb_lbff_descriptors.h | 2 +- 18 files changed, 224 insertions(+), 200 deletions(-) diff --git a/modules/ipu_desc/ipu75xa/FragmentsConfigurator.cpp b/modules/ipu_desc/ipu75xa/FragmentsConfigurator.cpp index 4d71c04..f1a1545 100644 --- a/modules/ipu_desc/ipu75xa/FragmentsConfigurator.cpp +++ b/modules/ipu_desc/ipu75xa/FragmentsConfigurator.cpp @@ -27,8 +27,7 @@ #include "FragmentsConfigurator.h" #include -Ipu8FragmentsConfigurator::Ipu8FragmentsConfigurator(IStaticGraphConfig* staticGraph, OuterNode* node, uint32_t upscalerWidthGranularity) - : _staticGraph(staticGraph), _node(node), _upscalerWidthGranularity(upscalerWidthGranularity) +Ipu8FragmentsConfigurator::Ipu8FragmentsConfigurator(IStaticGraphConfig* staticGraph, OuterNode* node) : _staticGraph(staticGraph), _node(node) { } @@ -390,16 +389,15 @@ StaticGraphStatus Ipu8FragmentsConfigurator::configFragmentsUpscaler(StaticGraph auto scaleFactorW = static_cast(resInfo->input_width - resInfo->input_crop.left - resInfo->input_crop.right) / resInfo->output_width; auto scaleFactorH = static_cast(resInfo->input_height - resInfo->input_crop.top - resInfo->input_crop.bottom) / resInfo->output_height; auto scaleFactor = std::max(scaleFactorW, scaleFactorH); - uint32_t upscalerWidthGranularity = _upscalerWidthGranularity; - uint16_t inputUnits = static_cast((resInfo->input_width - resInfo->input_crop.left - resInfo->input_crop.right) / upscalerWidthGranularity); + + int32_t croppedInputWidth = resInfo->input_width - resInfo->input_crop.left - resInfo->input_crop.right; + int32_t outputWidth = resInfo->output_width; // We would like to keep upscalerWidthGranularity as large as possible in order to minimize the number of pixels that cannot be used for upscaling // (upscalerWidthGranularity is divided to stripes, so the larger it is the more accurately we can divide) - while (inputUnits % 4 == 0) - { - inputUnits /= 2; - upscalerWidthGranularity *= 2; - } + // Find the largest granularity that divides both + uint32_t upscalerWidthGranularity = calculateGcd(static_cast(croppedInputWidth), static_cast(outputWidth)); + uint16_t inputUnits = static_cast(croppedInputWidth / upscalerWidthGranularity); int32_t leftPixel = runKernel->resolution_info->input_crop.left; int32_t rightPixel = static_cast(runKernel->resolution_info->input_width - runKernel->resolution_info->input_crop.right); @@ -510,7 +508,7 @@ StaticGraphStatus Ipu8FragmentsConfigurator::configFragmentsUpscaler(StaticGraph outputStartX += kernelFragments[stripe].upscalerFragDesc.fragmentInputCropLeft; - outputStartX = GRA_ROUND_UP(static_cast(ceil(static_cast(outputStartX) / scaleFactor)), 2); + outputStartX = GRA_ROUND_DOWN(static_cast(floor(static_cast(outputStartX) / scaleFactor)), 2); _outputStartX[runKernel->kernel_uuid][stripe] = outputStartX; } @@ -780,6 +778,31 @@ StaticGraphStatus Ipu8FragmentsConfigurator::configFragmentsTnrFeeder(StaticGrap } } + // Update system API offsets + +#ifdef STATIC_GRAPH_USE_IA_LEGACY_TYPES + if (runKernel->system_api.size != ((GRA_ROUND_UP(sizeof(SystemApiRecordHeader), 4)) + (sizeof(StaticGraphKernelSystemApiIoBuffer1_4)))) + { + // TODO log error + return StaticGraphStatus::SG_ERROR; + } +#endif + + auto systemApiHeader = static_cast(runKernel->system_api.data); + if (systemApiHeader->systemApiUuid != GraphResolutionConfiguratorHelper::getRunKernelIoBufferSystemApiUuid()) + { + // TODO log error + return StaticGraphStatus::SG_ERROR; + } + + StaticGraphKernelSystemApiIoBuffer1_4* systemApi = reinterpret_cast + (static_cast(runKernel->system_api.data) + GRA_ROUND_UP(sizeof(SystemApiRecordHeader), 4)); + + for (uint8_t stripe = 0; stripe < _node->numberOfFragments; stripe++) + { + systemApi->x_output_offset_per_stripe[stripe] = _outputStartX[runKernel->kernel_uuid][stripe]; + } + return StaticGraphStatus::SG_OK; } @@ -890,3 +913,15 @@ StaticGraphStatus Ipu8FragmentsConfigurator::copyFragments(StaticGraphRunKernel* return StaticGraphStatus::SG_OK; } + +// Find the greatest common divisor, curtesy of CoPilot +uint32_t Ipu8FragmentsConfigurator::calculateGcd(uint32_t a, uint32_t b) +{ + while (b != 0) + { + uint32_t t = b; + b = a % b; + a = t; + } + return a; +} \ No newline at end of file diff --git a/modules/ipu_desc/ipu75xa/FragmentsConfigurator.h b/modules/ipu_desc/ipu75xa/FragmentsConfigurator.h index 41fc1c1..0afe80d 100644 --- a/modules/ipu_desc/ipu75xa/FragmentsConfigurator.h +++ b/modules/ipu_desc/ipu75xa/FragmentsConfigurator.h @@ -34,7 +34,7 @@ class Ipu8FragmentsConfigurator static const int32_t MIN_STRIPE_WIDTH_BEFORE_TNR = 128; static const int32_t MIN_STRIPE_WIDTH_AFTER_TNR = 64; static const int32_t UPSCALER_MAX_OUTPUT_WIDTH = 4672; - Ipu8FragmentsConfigurator(IStaticGraphConfig* staticGraph, OuterNode* node, uint32_t upscalerWidthGranularity); + Ipu8FragmentsConfigurator(IStaticGraphConfig* staticGraph, OuterNode* node); StaticGraphStatus configureFragments(std::vector& smurfKernels); @@ -55,13 +55,13 @@ class Ipu8FragmentsConfigurator uint32_t getPlaneStartAddress(uint32_t sumOfPrevWidths, FormatType formatType, uint8_t plane); uint16_t alignToFormatRestrictions(uint16_t size, FormatType bufferFormat); bool validateDownscalerOutputWidth(StaticGraphFragmentDesc* stripe, uint16_t addition, int32_t stripeIndex, double scaleFactor, StaticGraphRunKernel* runKernel); + uint32_t calculateGcd(uint32_t a, uint32_t b); OuterNode* _node = nullptr; IStaticGraphConfig* _staticGraph = nullptr; // Fragments binaries do not contain output start x, so we keep them here std::map> _outputStartX; - uint32_t _upscalerWidthGranularity = 1; // Save TNR resolutions for feeder configurations StaticGraphFragmentDesc* _tnrScalerFragments = nullptr; diff --git a/modules/ipu_desc/ipu75xa/GraphResolutionConfigurator.cpp b/modules/ipu_desc/ipu75xa/GraphResolutionConfigurator.cpp index dcdc115..10b4598 100644 --- a/modules/ipu_desc/ipu75xa/GraphResolutionConfigurator.cpp +++ b/modules/ipu_desc/ipu75xa/GraphResolutionConfigurator.cpp @@ -1189,7 +1189,7 @@ Ipu8GraphResolutionConfigurator::Ipu8GraphResolutionConfigurator(IStaticGraphCon if (_node != nullptr && _node->GetNumberOfFragments() > 1) { - _fragmentsConfigurator = new Ipu8FragmentsConfigurator(_staticGraph, _node, _upscalerStepW); + _fragmentsConfigurator = new Ipu8FragmentsConfigurator(_staticGraph, _node); } #endif @@ -1434,10 +1434,14 @@ StaticGraphStatus Ipu8GraphResolutionConfigurator::getDownscalerInputRoi(const R // Translate the ROI to input, using res hist of output ResolutionRoi pipeInputRoi; - pipeInputRoi.left = static_cast(((outputLeft + _originalCropOfOutput.left) * _widthIn2OutScale) + _originaHistoryOfOutput.left); - pipeInputRoi.right = static_cast(((outputRight + _originalCropOfOutput.right) * _widthIn2OutScale) + _originaHistoryOfOutput.right); - pipeInputRoi.top = static_cast(((outputTop + _originalCropOfOutput.top) * _heightIn2OutScale) + _originaHistoryOfOutput.top); - pipeInputRoi.bottom = static_cast(((outputBottom + _originalCropOfOutput.bottom) * _heightIn2OutScale) + _originaHistoryOfOutput.bottom); + // _widthIn2OutScale and _heightIn2OutScale are relative to pipe input. History is relative to full sensor resolution + double widthHistScale = _widthIn2OutScale / _sensorHorizontalScaling; + double heightHistScale = _heightIn2OutScale / _sensorVerticalScaling; + + pipeInputRoi.left = static_cast(((outputLeft + _originalCropOfOutput.left) * widthHistScale) + _originaHistoryOfOutput.left); + pipeInputRoi.right = static_cast(((outputRight + _originalCropOfOutput.right) * widthHistScale) + _originaHistoryOfOutput.right); + pipeInputRoi.top = static_cast(((outputTop + _originalCropOfOutput.top) * heightHistScale) + _originaHistoryOfOutput.top); + pipeInputRoi.bottom = static_cast(((outputBottom + _originalCropOfOutput.bottom) * heightHistScale) + _originaHistoryOfOutput.bottom); // Translate ROI on input to ROI as input to downscaler double scaleWidth = static_cast(_downscalerRunKernel->resolution_history->input_width @@ -1483,8 +1487,7 @@ StaticGraphStatus Ipu8GraphResolutionConfigurator::updateRunKernelOfScalers(Reso ret = StaticGraphStatus::SG_ERROR; } - StaticGraphKernelResCrop EmptyCrop = { 0, 0, 0, 0 }; - if (updateRunKernelCropper(_cropperRunKernel, roi, dsOutputWidth, dsOutputHeight, outputWidth, outputHeight, downscalerCropHist) != StaticGraphStatus::SG_OK) + if (updateRunKernelCropper(_cropperRunKernel, roi, _downscalerRunKernel->resolution_info, outputWidth, outputHeight) != StaticGraphStatus::SG_OK) { ret = StaticGraphStatus::SG_ERROR; } @@ -1496,8 +1499,7 @@ StaticGraphStatus Ipu8GraphResolutionConfigurator::updateRunKernelOfScalers(Reso updateRunKernelPassThrough(_downscalerRunKernel, inputWidth, inputHeight); // Configure ESPA crop to output resolution (TNR ROI) - if (updateRunKernelCropper(_cropperRunKernel, roi, inputWidth, inputHeight, outputWidth, outputHeight, - downscalerCropHist) != StaticGraphStatus::SG_OK) + if (updateRunKernelCropper(_cropperRunKernel, roi, _downscalerRunKernel->resolution_info, outputWidth, outputHeight) != StaticGraphStatus::SG_OK) { ret = StaticGraphStatus::SG_ERROR; } @@ -1564,7 +1566,8 @@ StaticGraphStatus Ipu8GraphResolutionConfigurator::updateRunKernelOfScalers(Reso return ret; } -StaticGraphStatus Ipu8GraphResolutionConfigurator::updateRunKernelDownScaler(StaticGraphRunKernel* runKernel, ResolutionRoi& roi, uint32_t& outputWidth, uint32_t& outputHeight) +StaticGraphStatus Ipu8GraphResolutionConfigurator::updateRunKernelDownScaler(StaticGraphRunKernel* runKernel, ResolutionRoi& roi, + uint32_t& outputWidth, uint32_t& outputHeight) { StaticGraphStatus ret = StaticGraphStatus::SG_OK; @@ -1605,67 +1608,35 @@ StaticGraphStatus Ipu8GraphResolutionConfigurator::updateRunKernelDownScaler(Sta } StaticGraphStatus Ipu8GraphResolutionConfigurator::updateRunKernelCropper(StaticGraphRunKernel* runKernel, ResolutionRoi& roi, - uint32_t inputWidth, uint32_t inputHeight, - uint32_t outputWidth, uint32_t outputHeight, - StaticGraphKernelResCrop& downscalerCropHist) + StaticGraphKernelRes* downscalerResInfo, + uint32_t outputWidth, uint32_t outputHeight) { - - runKernel->resolution_info->input_width = inputWidth; - runKernel->resolution_info->input_height = inputHeight; + runKernel->resolution_info->input_width = downscalerResInfo->output_width; + runKernel->resolution_info->input_height = downscalerResInfo->output_height; runKernel->resolution_info->output_width = outputWidth; runKernel->resolution_info->output_height = outputHeight; - runKernel->resolution_info->input_crop.left = 0; - runKernel->resolution_info->input_crop.right = 0; - runKernel->resolution_info->input_crop.top = 0; - runKernel->resolution_info->input_crop.bottom = 0; + // Configure to crop the required amount. + int32_t totalHorizontalCrop = runKernel->resolution_info->input_width - outputWidth; - // In certain cases need to adjust negative and/or odd crop values. - if (downscalerCropHist.left & 1) - { - downscalerCropHist.left = downscalerCropHist.left - 1; - } - if (downscalerCropHist.right & 1) - { - downscalerCropHist.right = downscalerCropHist.right - 1; - } - if (downscalerCropHist.top & 1) - { - downscalerCropHist.top = downscalerCropHist.top - 1; - } - if (downscalerCropHist.bottom & 1) - { - downscalerCropHist.bottom = downscalerCropHist.bottom - 1; - } + // Now crop to TNR size if any more cropping is required, according to the required ROI + uint32_t cropLeft = roi.left; + uint32_t cropRight = roi.right; - // Configure to crop the required amount. First try to use the original DS cropping (Remove padding) - int32_t totalHorizontalCrop = inputWidth - outputWidth; - - int32_t originalDsCrop = downscalerCropHist.left < 0 ? -downscalerCropHist.left : 0; - if (totalHorizontalCrop >= originalDsCrop && originalDsCrop > 0) + if (downscalerResInfo->input_crop.right > 0) { - runKernel->resolution_info->input_crop.left = originalDsCrop; - totalHorizontalCrop -= originalDsCrop; - - // Padding was handled, no need to handle again - downscalerCropHist.left = 0; + double scale = static_cast(downscalerResInfo->output_width) / + (downscalerResInfo->input_width - downscalerResInfo->input_crop.left - downscalerResInfo->input_crop.right); + cropRight -= GRA_ROUND_UP(static_cast(downscalerResInfo->input_crop.right * scale), 2); } - originalDsCrop = downscalerCropHist.right < 0 ? -downscalerCropHist.right : 0; - if (totalHorizontalCrop >= originalDsCrop && originalDsCrop > 0) - { - runKernel->resolution_info->input_crop.right = originalDsCrop; - totalHorizontalCrop -= originalDsCrop; - - // Padding was handled, no need to handle again - downscalerCropHist.right = 0; - } + // Calculate the crop after downscale, relatively to the desired crop before the downscale + cropLeft = (cropLeft + cropRight) == 0 ? 0 : + GRA_ROUND_DOWN(static_cast(GRA_ROUND(static_cast(cropLeft) / (cropLeft + cropRight) * totalHorizontalCrop)), 2); - // Now crop symmetrically to TNR size if any more cropping is required - // :TODO: fix this for PTZ with striping since should take roi into account - runKernel->resolution_info->input_crop.left += GRA_ROUND_DOWN(static_cast(static_cast(totalHorizontalCrop)) / 2, 2); - runKernel->resolution_info->input_crop.right += (totalHorizontalCrop - GRA_ROUND_DOWN(static_cast(static_cast(totalHorizontalCrop)) / 2, 2)); + runKernel->resolution_info->input_crop.left = cropLeft; + runKernel->resolution_info->input_crop.right = totalHorizontalCrop - cropLeft; if (roi.left < static_cast(runKernel->resolution_info->input_crop.left)) { @@ -1678,33 +1649,24 @@ StaticGraphStatus Ipu8GraphResolutionConfigurator::updateRunKernelCropper(Static runKernel->resolution_info->input_crop.right = roi.right; } - // Configure to crop the required amount. First try to use the original DS cropping (Remove padding) - int32_t totalVerticalCrop = inputHeight - outputHeight; + int32_t totalVerticalCrop = runKernel->resolution_info->input_height - outputHeight; - originalDsCrop = downscalerCropHist.top < 0 ? -downscalerCropHist.top : 0; - if (totalVerticalCrop >= originalDsCrop && originalDsCrop > 0) - { - runKernel->resolution_info->input_crop.top = originalDsCrop; - totalVerticalCrop -= originalDsCrop; + // Now crop to TNR size if any more cropping is required, according to the required ROI + uint32_t cropTop = roi.top; + uint32_t cropBottom = roi.bottom; - // Padding was handled, no need to handle again - downscalerCropHist.top = 0; - } - - originalDsCrop = downscalerCropHist.bottom < 0 ? -downscalerCropHist.bottom : 0; - if (totalVerticalCrop >= originalDsCrop && originalDsCrop > 0) + if (downscalerResInfo->input_crop.bottom > 0) { - runKernel->resolution_info->input_crop.bottom = originalDsCrop; - totalVerticalCrop -= originalDsCrop; - - // Padding was handled, no need to handle again - downscalerCropHist.bottom = 0; + double scale = static_cast(downscalerResInfo->output_height) / + (downscalerResInfo->input_height - downscalerResInfo->input_crop.top - downscalerResInfo->input_crop.bottom); + cropBottom -= GRA_ROUND_UP(static_cast(downscalerResInfo->input_crop.bottom * scale), 2); } - // Now crop symmetrically to TNR size if any more cropping is required - // :TODO: fix this for PTZ with striping since should take roi into account - runKernel->resolution_info->input_crop.top += GRA_ROUND_DOWN(static_cast(static_cast(totalVerticalCrop)) / 2, 2); - runKernel->resolution_info->input_crop.bottom += (totalVerticalCrop - GRA_ROUND_DOWN(static_cast(static_cast(totalVerticalCrop)) / 2, 2)); + cropTop = (cropTop + cropBottom) == 0 ? 0 : + GRA_ROUND_DOWN(static_cast(GRA_ROUND(static_cast(cropTop) / (cropTop + cropBottom) * totalVerticalCrop)), 2); + + runKernel->resolution_info->input_crop.top = cropTop; + runKernel->resolution_info->input_crop.bottom = totalVerticalCrop - cropTop; if (roi.top < static_cast(runKernel->resolution_info->input_crop.top)) { diff --git a/modules/ipu_desc/ipu75xa/GraphResolutionConfigurator.h b/modules/ipu_desc/ipu75xa/GraphResolutionConfigurator.h index 85a7f7a..3105f94 100644 --- a/modules/ipu_desc/ipu75xa/GraphResolutionConfigurator.h +++ b/modules/ipu_desc/ipu75xa/GraphResolutionConfigurator.h @@ -27,7 +27,7 @@ #pragma once #include #include -#include +#include #define _USE_MATH_DEFINES #define GRA_ROUND_UP(a,b) (((a) + ((b)-1)) / (b) * (b)) @@ -213,8 +213,7 @@ class Ipu8GraphResolutionConfigurator : public GraphResolutionConfigurator StaticGraphStatus updateRunKernelDownScaler(StaticGraphRunKernel* runKernel, ResolutionRoi& roi, uint32_t& outputWidth, uint32_t& outputHeight); StaticGraphStatus updateRunKernelUpScaler(StaticGraphRunKernel* runKernel, ResolutionRoi& roi, StaticGraphKernelResCrop& cropperKernelCrop, uint32_t outputWidth, uint32_t outputHeight); - StaticGraphStatus updateRunKernelCropper(StaticGraphRunKernel* runKernel, ResolutionRoi& roi, uint32_t inputWidth, uint32_t inputHeight, - uint32_t outputWidth, uint32_t outputHeight, StaticGraphKernelResCrop& downscalerCropHist); + StaticGraphStatus updateRunKernelCropper(StaticGraphRunKernel* runKernel, ResolutionRoi& roi, StaticGraphKernelRes* downscalerResInfo, uint32_t outputWidth, uint32_t outputHeight); StaticGraphStatus updateRunKernelSmurf(SmurfKernelInfo* smurfInfo); StaticGraphStatus SanityCheck(); diff --git a/modules/ipu_desc/ipu75xa/Ipu75xaStaticGraphDataPreloadAutogen.h b/modules/ipu_desc/ipu75xa/Ipu75xaStaticGraphDataPreloadAutogen.h index 8ea81a0..a1a6da4 100644 --- a/modules/ipu_desc/ipu75xa/Ipu75xaStaticGraphDataPreloadAutogen.h +++ b/modules/ipu_desc/ipu75xa/Ipu75xaStaticGraphDataPreloadAutogen.h @@ -28,7 +28,7 @@ #ifndef DATA_RANGE_H_ #define DATA_RANGE_H_ -#include +#include #include #include diff --git a/modules/ipu_desc/ipu75xa/Ipu75xaStaticGraphReaderAutogen.cpp b/modules/ipu_desc/ipu75xa/Ipu75xaStaticGraphReaderAutogen.cpp index 6665bf4..bfe7c0e 100644 --- a/modules/ipu_desc/ipu75xa/Ipu75xaStaticGraphReaderAutogen.cpp +++ b/modules/ipu_desc/ipu75xa/Ipu75xaStaticGraphReaderAutogen.cpp @@ -85,6 +85,21 @@ std::pair StaticGraphReader::GetGraphConfi return std::make_pair(_binaryHeader.numberOfResolutions, _graphConfigurationHeaders); } +GraphConfigurationKey* StaticGraphReader::GetFdGraphConfigurationKey(GraphConfigurationKey& settingsKey) const +{ + for (uint32_t i = 0; i < _binaryHeader.numberOfResolutions; i++) + { + if (settingsKey.attributes == _graphConfigurationHeaders[i].settingsKey.attributes && + (((settingsKey.preview.width != 0 && _graphConfigurationHeaders[i].settingsKey.preview.width == settingsKey.preview.width && _graphConfigurationHeaders[i].settingsKey.preview.height == settingsKey.preview.height) || + (settingsKey.video.width != 0 && _graphConfigurationHeaders[i].settingsKey.video.width == settingsKey.video.width && _graphConfigurationHeaders[i].settingsKey.video.height == settingsKey.video.height)) && + _graphConfigurationHeaders[i].settingsKey.postProcessingVideo.width != 0)) + { + return &_graphConfigurationHeaders[i].settingsKey; + } + } + return NULL; +} + StaticGraphStatus StaticGraphReader::GetStaticGraphConfig(GraphConfigurationKey& settingsKey, IStaticGraphConfig** graph) { if (!_graphConfigurationHeaders || !_sensorModes || !_configurationData) diff --git a/modules/ipu_desc/ipu75xa/Ipu75xaStaticGraphReaderAutogen.h b/modules/ipu_desc/ipu75xa/Ipu75xaStaticGraphReaderAutogen.h index b01c5f2..036cc39 100644 --- a/modules/ipu_desc/ipu75xa/Ipu75xaStaticGraphReaderAutogen.h +++ b/modules/ipu_desc/ipu75xa/Ipu75xaStaticGraphReaderAutogen.h @@ -82,6 +82,7 @@ class StaticGraphReader StaticGraphStatus Init(StaticReaderBinaryData& binaryGraphSettings); StaticGraphStatus GetStaticGraphConfig(GraphConfigurationKey& settingsKey, IStaticGraphConfig** graph); std::pair GetGraphConfigurationHeaders() const; + GraphConfigurationKey* GetFdGraphConfigurationKey(GraphConfigurationKey& settingsKey) const; static const uint32_t staticGraphCommonHashCode = 1110027246; // autogenerated private: void GetSinkMappingConfiguration(GraphConfigurationHeader* baseGraphConfigurationHeader, VirtualSinkMapping* baseSinkMappingConfiguration, diff --git a/modules/ipu_desc/ipu75xa/ipu_manifest_db_ipu7_psys_cb_bbps_descriptors.h b/modules/ipu_desc/ipu75xa/ipu_manifest_db_ipu7_psys_cb_bbps_descriptors.h index 0d834d3..63387dd 100644 --- a/modules/ipu_desc/ipu75xa/ipu_manifest_db_ipu7_psys_cb_bbps_descriptors.h +++ b/modules/ipu_desc/ipu75xa/ipu_manifest_db_ipu7_psys_cb_bbps_descriptors.h @@ -28,7 +28,7 @@ #ifndef IPU_MANIFEST_DB_IPU7_PSYS_CB_BBPS_DESCRIPTORS_H #define IPU_MANIFEST_DB_IPU7_PSYS_CB_BBPS_DESCRIPTORS_H -#include +#include #include "cb_payload_descriptor.h" static payload_descriptor_t BBPS_0_descriptors = { diff --git a/modules/ipu_desc/ipu75xa/ipu_manifest_db_ipu7_psys_cb_lbff_descriptors.h b/modules/ipu_desc/ipu75xa/ipu_manifest_db_ipu7_psys_cb_lbff_descriptors.h index 19c8a97..b52af9a 100644 --- a/modules/ipu_desc/ipu75xa/ipu_manifest_db_ipu7_psys_cb_lbff_descriptors.h +++ b/modules/ipu_desc/ipu75xa/ipu_manifest_db_ipu7_psys_cb_lbff_descriptors.h @@ -28,7 +28,7 @@ #ifndef IPU_MANIFEST_DB_IPU7_PSYS_CB_LBFF_DESCRIPTORS_H #define IPU_MANIFEST_DB_IPU7_PSYS_CB_LBFF_DESCRIPTORS_H -#include +#include #include "cb_payload_descriptor.h" static payload_descriptor_t lbff_0_descriptors = { diff --git a/modules/ipu_desc/ipu7x/FragmentsConfigurator.cpp b/modules/ipu_desc/ipu7x/FragmentsConfigurator.cpp index 4d71c04..f1a1545 100644 --- a/modules/ipu_desc/ipu7x/FragmentsConfigurator.cpp +++ b/modules/ipu_desc/ipu7x/FragmentsConfigurator.cpp @@ -27,8 +27,7 @@ #include "FragmentsConfigurator.h" #include -Ipu8FragmentsConfigurator::Ipu8FragmentsConfigurator(IStaticGraphConfig* staticGraph, OuterNode* node, uint32_t upscalerWidthGranularity) - : _staticGraph(staticGraph), _node(node), _upscalerWidthGranularity(upscalerWidthGranularity) +Ipu8FragmentsConfigurator::Ipu8FragmentsConfigurator(IStaticGraphConfig* staticGraph, OuterNode* node) : _staticGraph(staticGraph), _node(node) { } @@ -390,16 +389,15 @@ StaticGraphStatus Ipu8FragmentsConfigurator::configFragmentsUpscaler(StaticGraph auto scaleFactorW = static_cast(resInfo->input_width - resInfo->input_crop.left - resInfo->input_crop.right) / resInfo->output_width; auto scaleFactorH = static_cast(resInfo->input_height - resInfo->input_crop.top - resInfo->input_crop.bottom) / resInfo->output_height; auto scaleFactor = std::max(scaleFactorW, scaleFactorH); - uint32_t upscalerWidthGranularity = _upscalerWidthGranularity; - uint16_t inputUnits = static_cast((resInfo->input_width - resInfo->input_crop.left - resInfo->input_crop.right) / upscalerWidthGranularity); + + int32_t croppedInputWidth = resInfo->input_width - resInfo->input_crop.left - resInfo->input_crop.right; + int32_t outputWidth = resInfo->output_width; // We would like to keep upscalerWidthGranularity as large as possible in order to minimize the number of pixels that cannot be used for upscaling // (upscalerWidthGranularity is divided to stripes, so the larger it is the more accurately we can divide) - while (inputUnits % 4 == 0) - { - inputUnits /= 2; - upscalerWidthGranularity *= 2; - } + // Find the largest granularity that divides both + uint32_t upscalerWidthGranularity = calculateGcd(static_cast(croppedInputWidth), static_cast(outputWidth)); + uint16_t inputUnits = static_cast(croppedInputWidth / upscalerWidthGranularity); int32_t leftPixel = runKernel->resolution_info->input_crop.left; int32_t rightPixel = static_cast(runKernel->resolution_info->input_width - runKernel->resolution_info->input_crop.right); @@ -510,7 +508,7 @@ StaticGraphStatus Ipu8FragmentsConfigurator::configFragmentsUpscaler(StaticGraph outputStartX += kernelFragments[stripe].upscalerFragDesc.fragmentInputCropLeft; - outputStartX = GRA_ROUND_UP(static_cast(ceil(static_cast(outputStartX) / scaleFactor)), 2); + outputStartX = GRA_ROUND_DOWN(static_cast(floor(static_cast(outputStartX) / scaleFactor)), 2); _outputStartX[runKernel->kernel_uuid][stripe] = outputStartX; } @@ -780,6 +778,31 @@ StaticGraphStatus Ipu8FragmentsConfigurator::configFragmentsTnrFeeder(StaticGrap } } + // Update system API offsets + +#ifdef STATIC_GRAPH_USE_IA_LEGACY_TYPES + if (runKernel->system_api.size != ((GRA_ROUND_UP(sizeof(SystemApiRecordHeader), 4)) + (sizeof(StaticGraphKernelSystemApiIoBuffer1_4)))) + { + // TODO log error + return StaticGraphStatus::SG_ERROR; + } +#endif + + auto systemApiHeader = static_cast(runKernel->system_api.data); + if (systemApiHeader->systemApiUuid != GraphResolutionConfiguratorHelper::getRunKernelIoBufferSystemApiUuid()) + { + // TODO log error + return StaticGraphStatus::SG_ERROR; + } + + StaticGraphKernelSystemApiIoBuffer1_4* systemApi = reinterpret_cast + (static_cast(runKernel->system_api.data) + GRA_ROUND_UP(sizeof(SystemApiRecordHeader), 4)); + + for (uint8_t stripe = 0; stripe < _node->numberOfFragments; stripe++) + { + systemApi->x_output_offset_per_stripe[stripe] = _outputStartX[runKernel->kernel_uuid][stripe]; + } + return StaticGraphStatus::SG_OK; } @@ -890,3 +913,15 @@ StaticGraphStatus Ipu8FragmentsConfigurator::copyFragments(StaticGraphRunKernel* return StaticGraphStatus::SG_OK; } + +// Find the greatest common divisor, curtesy of CoPilot +uint32_t Ipu8FragmentsConfigurator::calculateGcd(uint32_t a, uint32_t b) +{ + while (b != 0) + { + uint32_t t = b; + b = a % b; + a = t; + } + return a; +} \ No newline at end of file diff --git a/modules/ipu_desc/ipu7x/FragmentsConfigurator.h b/modules/ipu_desc/ipu7x/FragmentsConfigurator.h index 41fc1c1..0afe80d 100644 --- a/modules/ipu_desc/ipu7x/FragmentsConfigurator.h +++ b/modules/ipu_desc/ipu7x/FragmentsConfigurator.h @@ -34,7 +34,7 @@ class Ipu8FragmentsConfigurator static const int32_t MIN_STRIPE_WIDTH_BEFORE_TNR = 128; static const int32_t MIN_STRIPE_WIDTH_AFTER_TNR = 64; static const int32_t UPSCALER_MAX_OUTPUT_WIDTH = 4672; - Ipu8FragmentsConfigurator(IStaticGraphConfig* staticGraph, OuterNode* node, uint32_t upscalerWidthGranularity); + Ipu8FragmentsConfigurator(IStaticGraphConfig* staticGraph, OuterNode* node); StaticGraphStatus configureFragments(std::vector& smurfKernels); @@ -55,13 +55,13 @@ class Ipu8FragmentsConfigurator uint32_t getPlaneStartAddress(uint32_t sumOfPrevWidths, FormatType formatType, uint8_t plane); uint16_t alignToFormatRestrictions(uint16_t size, FormatType bufferFormat); bool validateDownscalerOutputWidth(StaticGraphFragmentDesc* stripe, uint16_t addition, int32_t stripeIndex, double scaleFactor, StaticGraphRunKernel* runKernel); + uint32_t calculateGcd(uint32_t a, uint32_t b); OuterNode* _node = nullptr; IStaticGraphConfig* _staticGraph = nullptr; // Fragments binaries do not contain output start x, so we keep them here std::map> _outputStartX; - uint32_t _upscalerWidthGranularity = 1; // Save TNR resolutions for feeder configurations StaticGraphFragmentDesc* _tnrScalerFragments = nullptr; diff --git a/modules/ipu_desc/ipu7x/GraphResolutionConfigurator.cpp b/modules/ipu_desc/ipu7x/GraphResolutionConfigurator.cpp index dcdc115..10b4598 100644 --- a/modules/ipu_desc/ipu7x/GraphResolutionConfigurator.cpp +++ b/modules/ipu_desc/ipu7x/GraphResolutionConfigurator.cpp @@ -1189,7 +1189,7 @@ Ipu8GraphResolutionConfigurator::Ipu8GraphResolutionConfigurator(IStaticGraphCon if (_node != nullptr && _node->GetNumberOfFragments() > 1) { - _fragmentsConfigurator = new Ipu8FragmentsConfigurator(_staticGraph, _node, _upscalerStepW); + _fragmentsConfigurator = new Ipu8FragmentsConfigurator(_staticGraph, _node); } #endif @@ -1434,10 +1434,14 @@ StaticGraphStatus Ipu8GraphResolutionConfigurator::getDownscalerInputRoi(const R // Translate the ROI to input, using res hist of output ResolutionRoi pipeInputRoi; - pipeInputRoi.left = static_cast(((outputLeft + _originalCropOfOutput.left) * _widthIn2OutScale) + _originaHistoryOfOutput.left); - pipeInputRoi.right = static_cast(((outputRight + _originalCropOfOutput.right) * _widthIn2OutScale) + _originaHistoryOfOutput.right); - pipeInputRoi.top = static_cast(((outputTop + _originalCropOfOutput.top) * _heightIn2OutScale) + _originaHistoryOfOutput.top); - pipeInputRoi.bottom = static_cast(((outputBottom + _originalCropOfOutput.bottom) * _heightIn2OutScale) + _originaHistoryOfOutput.bottom); + // _widthIn2OutScale and _heightIn2OutScale are relative to pipe input. History is relative to full sensor resolution + double widthHistScale = _widthIn2OutScale / _sensorHorizontalScaling; + double heightHistScale = _heightIn2OutScale / _sensorVerticalScaling; + + pipeInputRoi.left = static_cast(((outputLeft + _originalCropOfOutput.left) * widthHistScale) + _originaHistoryOfOutput.left); + pipeInputRoi.right = static_cast(((outputRight + _originalCropOfOutput.right) * widthHistScale) + _originaHistoryOfOutput.right); + pipeInputRoi.top = static_cast(((outputTop + _originalCropOfOutput.top) * heightHistScale) + _originaHistoryOfOutput.top); + pipeInputRoi.bottom = static_cast(((outputBottom + _originalCropOfOutput.bottom) * heightHistScale) + _originaHistoryOfOutput.bottom); // Translate ROI on input to ROI as input to downscaler double scaleWidth = static_cast(_downscalerRunKernel->resolution_history->input_width @@ -1483,8 +1487,7 @@ StaticGraphStatus Ipu8GraphResolutionConfigurator::updateRunKernelOfScalers(Reso ret = StaticGraphStatus::SG_ERROR; } - StaticGraphKernelResCrop EmptyCrop = { 0, 0, 0, 0 }; - if (updateRunKernelCropper(_cropperRunKernel, roi, dsOutputWidth, dsOutputHeight, outputWidth, outputHeight, downscalerCropHist) != StaticGraphStatus::SG_OK) + if (updateRunKernelCropper(_cropperRunKernel, roi, _downscalerRunKernel->resolution_info, outputWidth, outputHeight) != StaticGraphStatus::SG_OK) { ret = StaticGraphStatus::SG_ERROR; } @@ -1496,8 +1499,7 @@ StaticGraphStatus Ipu8GraphResolutionConfigurator::updateRunKernelOfScalers(Reso updateRunKernelPassThrough(_downscalerRunKernel, inputWidth, inputHeight); // Configure ESPA crop to output resolution (TNR ROI) - if (updateRunKernelCropper(_cropperRunKernel, roi, inputWidth, inputHeight, outputWidth, outputHeight, - downscalerCropHist) != StaticGraphStatus::SG_OK) + if (updateRunKernelCropper(_cropperRunKernel, roi, _downscalerRunKernel->resolution_info, outputWidth, outputHeight) != StaticGraphStatus::SG_OK) { ret = StaticGraphStatus::SG_ERROR; } @@ -1564,7 +1566,8 @@ StaticGraphStatus Ipu8GraphResolutionConfigurator::updateRunKernelOfScalers(Reso return ret; } -StaticGraphStatus Ipu8GraphResolutionConfigurator::updateRunKernelDownScaler(StaticGraphRunKernel* runKernel, ResolutionRoi& roi, uint32_t& outputWidth, uint32_t& outputHeight) +StaticGraphStatus Ipu8GraphResolutionConfigurator::updateRunKernelDownScaler(StaticGraphRunKernel* runKernel, ResolutionRoi& roi, + uint32_t& outputWidth, uint32_t& outputHeight) { StaticGraphStatus ret = StaticGraphStatus::SG_OK; @@ -1605,67 +1608,35 @@ StaticGraphStatus Ipu8GraphResolutionConfigurator::updateRunKernelDownScaler(Sta } StaticGraphStatus Ipu8GraphResolutionConfigurator::updateRunKernelCropper(StaticGraphRunKernel* runKernel, ResolutionRoi& roi, - uint32_t inputWidth, uint32_t inputHeight, - uint32_t outputWidth, uint32_t outputHeight, - StaticGraphKernelResCrop& downscalerCropHist) + StaticGraphKernelRes* downscalerResInfo, + uint32_t outputWidth, uint32_t outputHeight) { - - runKernel->resolution_info->input_width = inputWidth; - runKernel->resolution_info->input_height = inputHeight; + runKernel->resolution_info->input_width = downscalerResInfo->output_width; + runKernel->resolution_info->input_height = downscalerResInfo->output_height; runKernel->resolution_info->output_width = outputWidth; runKernel->resolution_info->output_height = outputHeight; - runKernel->resolution_info->input_crop.left = 0; - runKernel->resolution_info->input_crop.right = 0; - runKernel->resolution_info->input_crop.top = 0; - runKernel->resolution_info->input_crop.bottom = 0; + // Configure to crop the required amount. + int32_t totalHorizontalCrop = runKernel->resolution_info->input_width - outputWidth; - // In certain cases need to adjust negative and/or odd crop values. - if (downscalerCropHist.left & 1) - { - downscalerCropHist.left = downscalerCropHist.left - 1; - } - if (downscalerCropHist.right & 1) - { - downscalerCropHist.right = downscalerCropHist.right - 1; - } - if (downscalerCropHist.top & 1) - { - downscalerCropHist.top = downscalerCropHist.top - 1; - } - if (downscalerCropHist.bottom & 1) - { - downscalerCropHist.bottom = downscalerCropHist.bottom - 1; - } + // Now crop to TNR size if any more cropping is required, according to the required ROI + uint32_t cropLeft = roi.left; + uint32_t cropRight = roi.right; - // Configure to crop the required amount. First try to use the original DS cropping (Remove padding) - int32_t totalHorizontalCrop = inputWidth - outputWidth; - - int32_t originalDsCrop = downscalerCropHist.left < 0 ? -downscalerCropHist.left : 0; - if (totalHorizontalCrop >= originalDsCrop && originalDsCrop > 0) + if (downscalerResInfo->input_crop.right > 0) { - runKernel->resolution_info->input_crop.left = originalDsCrop; - totalHorizontalCrop -= originalDsCrop; - - // Padding was handled, no need to handle again - downscalerCropHist.left = 0; + double scale = static_cast(downscalerResInfo->output_width) / + (downscalerResInfo->input_width - downscalerResInfo->input_crop.left - downscalerResInfo->input_crop.right); + cropRight -= GRA_ROUND_UP(static_cast(downscalerResInfo->input_crop.right * scale), 2); } - originalDsCrop = downscalerCropHist.right < 0 ? -downscalerCropHist.right : 0; - if (totalHorizontalCrop >= originalDsCrop && originalDsCrop > 0) - { - runKernel->resolution_info->input_crop.right = originalDsCrop; - totalHorizontalCrop -= originalDsCrop; - - // Padding was handled, no need to handle again - downscalerCropHist.right = 0; - } + // Calculate the crop after downscale, relatively to the desired crop before the downscale + cropLeft = (cropLeft + cropRight) == 0 ? 0 : + GRA_ROUND_DOWN(static_cast(GRA_ROUND(static_cast(cropLeft) / (cropLeft + cropRight) * totalHorizontalCrop)), 2); - // Now crop symmetrically to TNR size if any more cropping is required - // :TODO: fix this for PTZ with striping since should take roi into account - runKernel->resolution_info->input_crop.left += GRA_ROUND_DOWN(static_cast(static_cast(totalHorizontalCrop)) / 2, 2); - runKernel->resolution_info->input_crop.right += (totalHorizontalCrop - GRA_ROUND_DOWN(static_cast(static_cast(totalHorizontalCrop)) / 2, 2)); + runKernel->resolution_info->input_crop.left = cropLeft; + runKernel->resolution_info->input_crop.right = totalHorizontalCrop - cropLeft; if (roi.left < static_cast(runKernel->resolution_info->input_crop.left)) { @@ -1678,33 +1649,24 @@ StaticGraphStatus Ipu8GraphResolutionConfigurator::updateRunKernelCropper(Static runKernel->resolution_info->input_crop.right = roi.right; } - // Configure to crop the required amount. First try to use the original DS cropping (Remove padding) - int32_t totalVerticalCrop = inputHeight - outputHeight; + int32_t totalVerticalCrop = runKernel->resolution_info->input_height - outputHeight; - originalDsCrop = downscalerCropHist.top < 0 ? -downscalerCropHist.top : 0; - if (totalVerticalCrop >= originalDsCrop && originalDsCrop > 0) - { - runKernel->resolution_info->input_crop.top = originalDsCrop; - totalVerticalCrop -= originalDsCrop; + // Now crop to TNR size if any more cropping is required, according to the required ROI + uint32_t cropTop = roi.top; + uint32_t cropBottom = roi.bottom; - // Padding was handled, no need to handle again - downscalerCropHist.top = 0; - } - - originalDsCrop = downscalerCropHist.bottom < 0 ? -downscalerCropHist.bottom : 0; - if (totalVerticalCrop >= originalDsCrop && originalDsCrop > 0) + if (downscalerResInfo->input_crop.bottom > 0) { - runKernel->resolution_info->input_crop.bottom = originalDsCrop; - totalVerticalCrop -= originalDsCrop; - - // Padding was handled, no need to handle again - downscalerCropHist.bottom = 0; + double scale = static_cast(downscalerResInfo->output_height) / + (downscalerResInfo->input_height - downscalerResInfo->input_crop.top - downscalerResInfo->input_crop.bottom); + cropBottom -= GRA_ROUND_UP(static_cast(downscalerResInfo->input_crop.bottom * scale), 2); } - // Now crop symmetrically to TNR size if any more cropping is required - // :TODO: fix this for PTZ with striping since should take roi into account - runKernel->resolution_info->input_crop.top += GRA_ROUND_DOWN(static_cast(static_cast(totalVerticalCrop)) / 2, 2); - runKernel->resolution_info->input_crop.bottom += (totalVerticalCrop - GRA_ROUND_DOWN(static_cast(static_cast(totalVerticalCrop)) / 2, 2)); + cropTop = (cropTop + cropBottom) == 0 ? 0 : + GRA_ROUND_DOWN(static_cast(GRA_ROUND(static_cast(cropTop) / (cropTop + cropBottom) * totalVerticalCrop)), 2); + + runKernel->resolution_info->input_crop.top = cropTop; + runKernel->resolution_info->input_crop.bottom = totalVerticalCrop - cropTop; if (roi.top < static_cast(runKernel->resolution_info->input_crop.top)) { diff --git a/modules/ipu_desc/ipu7x/GraphResolutionConfigurator.h b/modules/ipu_desc/ipu7x/GraphResolutionConfigurator.h index 85a7f7a..3105f94 100644 --- a/modules/ipu_desc/ipu7x/GraphResolutionConfigurator.h +++ b/modules/ipu_desc/ipu7x/GraphResolutionConfigurator.h @@ -27,7 +27,7 @@ #pragma once #include #include -#include +#include #define _USE_MATH_DEFINES #define GRA_ROUND_UP(a,b) (((a) + ((b)-1)) / (b) * (b)) @@ -213,8 +213,7 @@ class Ipu8GraphResolutionConfigurator : public GraphResolutionConfigurator StaticGraphStatus updateRunKernelDownScaler(StaticGraphRunKernel* runKernel, ResolutionRoi& roi, uint32_t& outputWidth, uint32_t& outputHeight); StaticGraphStatus updateRunKernelUpScaler(StaticGraphRunKernel* runKernel, ResolutionRoi& roi, StaticGraphKernelResCrop& cropperKernelCrop, uint32_t outputWidth, uint32_t outputHeight); - StaticGraphStatus updateRunKernelCropper(StaticGraphRunKernel* runKernel, ResolutionRoi& roi, uint32_t inputWidth, uint32_t inputHeight, - uint32_t outputWidth, uint32_t outputHeight, StaticGraphKernelResCrop& downscalerCropHist); + StaticGraphStatus updateRunKernelCropper(StaticGraphRunKernel* runKernel, ResolutionRoi& roi, StaticGraphKernelRes* downscalerResInfo, uint32_t outputWidth, uint32_t outputHeight); StaticGraphStatus updateRunKernelSmurf(SmurfKernelInfo* smurfInfo); StaticGraphStatus SanityCheck(); diff --git a/modules/ipu_desc/ipu7x/Ipu7xStaticGraphDataPreloadAutogen.h b/modules/ipu_desc/ipu7x/Ipu7xStaticGraphDataPreloadAutogen.h index d5914c8..360d764 100644 --- a/modules/ipu_desc/ipu7x/Ipu7xStaticGraphDataPreloadAutogen.h +++ b/modules/ipu_desc/ipu7x/Ipu7xStaticGraphDataPreloadAutogen.h @@ -28,7 +28,7 @@ #ifndef DATA_RANGE_H_ #define DATA_RANGE_H_ -#include +#include #include #include diff --git a/modules/ipu_desc/ipu7x/Ipu7xStaticGraphReaderAutogen.cpp b/modules/ipu_desc/ipu7x/Ipu7xStaticGraphReaderAutogen.cpp index 56c2287..a7fb20a 100644 --- a/modules/ipu_desc/ipu7x/Ipu7xStaticGraphReaderAutogen.cpp +++ b/modules/ipu_desc/ipu7x/Ipu7xStaticGraphReaderAutogen.cpp @@ -85,6 +85,21 @@ std::pair StaticGraphReader::GetGraphConfi return std::make_pair(_binaryHeader.numberOfResolutions, _graphConfigurationHeaders); } +GraphConfigurationKey* StaticGraphReader::GetFdGraphConfigurationKey(GraphConfigurationKey& settingsKey) const +{ + for (uint32_t i = 0; i < _binaryHeader.numberOfResolutions; i++) + { + if (settingsKey.attributes == _graphConfigurationHeaders[i].settingsKey.attributes && + (((settingsKey.preview.width != 0 && _graphConfigurationHeaders[i].settingsKey.preview.width == settingsKey.preview.width && _graphConfigurationHeaders[i].settingsKey.preview.height == settingsKey.preview.height) || + (settingsKey.video.width != 0 && _graphConfigurationHeaders[i].settingsKey.video.width == settingsKey.video.width && _graphConfigurationHeaders[i].settingsKey.video.height == settingsKey.video.height)) && + _graphConfigurationHeaders[i].settingsKey.postProcessingVideo.width != 0)) + { + return &_graphConfigurationHeaders[i].settingsKey; + } + } + return NULL; +} + StaticGraphStatus StaticGraphReader::GetStaticGraphConfig(GraphConfigurationKey& settingsKey, IStaticGraphConfig** graph) { if (!_graphConfigurationHeaders || !_sensorModes || !_configurationData) diff --git a/modules/ipu_desc/ipu7x/Ipu7xStaticGraphReaderAutogen.h b/modules/ipu_desc/ipu7x/Ipu7xStaticGraphReaderAutogen.h index 0c0109d..6dbd970 100644 --- a/modules/ipu_desc/ipu7x/Ipu7xStaticGraphReaderAutogen.h +++ b/modules/ipu_desc/ipu7x/Ipu7xStaticGraphReaderAutogen.h @@ -82,6 +82,7 @@ class StaticGraphReader StaticGraphStatus Init(StaticReaderBinaryData& binaryGraphSettings); StaticGraphStatus GetStaticGraphConfig(GraphConfigurationKey& settingsKey, IStaticGraphConfig** graph); std::pair GetGraphConfigurationHeaders() const; + GraphConfigurationKey* GetFdGraphConfigurationKey(GraphConfigurationKey& settingsKey) const; static const uint32_t staticGraphCommonHashCode = 3011642587; // autogenerated private: void GetSinkMappingConfiguration(GraphConfigurationHeader* baseGraphConfigurationHeader, VirtualSinkMapping* baseSinkMappingConfiguration, diff --git a/modules/ipu_desc/ipu7x/ipu_manifest_db_ipu7_psys_cb_bbps_descriptors.h b/modules/ipu_desc/ipu7x/ipu_manifest_db_ipu7_psys_cb_bbps_descriptors.h index 6fed178..c6be035 100644 --- a/modules/ipu_desc/ipu7x/ipu_manifest_db_ipu7_psys_cb_bbps_descriptors.h +++ b/modules/ipu_desc/ipu7x/ipu_manifest_db_ipu7_psys_cb_bbps_descriptors.h @@ -28,7 +28,7 @@ #ifndef IPU_MANIFEST_DB_IPU7_PSYS_CB_BBPS_DESCRIPTORS_H #define IPU_MANIFEST_DB_IPU7_PSYS_CB_BBPS_DESCRIPTORS_H -#include +#include #include "cb_payload_descriptor.h" static payload_descriptor_t BBPS_0_descriptors = { diff --git a/modules/ipu_desc/ipu7x/ipu_manifest_db_ipu7_psys_cb_lbff_descriptors.h b/modules/ipu_desc/ipu7x/ipu_manifest_db_ipu7_psys_cb_lbff_descriptors.h index ee61b7f..c6097ed 100644 --- a/modules/ipu_desc/ipu7x/ipu_manifest_db_ipu7_psys_cb_lbff_descriptors.h +++ b/modules/ipu_desc/ipu7x/ipu_manifest_db_ipu7_psys_cb_lbff_descriptors.h @@ -28,7 +28,7 @@ #ifndef IPU_MANIFEST_DB_IPU7_PSYS_CB_LBFF_DESCRIPTORS_H #define IPU_MANIFEST_DB_IPU7_PSYS_CB_LBFF_DESCRIPTORS_H -#include +#include #include "cb_payload_descriptor.h" static payload_descriptor_t lbff_0_descriptors = {