From c1c0f554051200ea051e5e31ee286e5f5e83c744 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Mon, 10 May 2021 23:02:43 +0530 Subject: aiq: Provide initial Intel AIQ Wrapper support The AIQ class is the entry point for running IPA algorithms for the requested frame and handles the statistics being generated. It comprises of wrapping the ia_aiq_*_run() functions and provide helper functions that take in the input parameters and location for their results after the run. These results(AiqResults) can be used for subsequent runs and setting statistics as required. Signed-off-by: Kieran Bingham Signed-off-by: Umang Jain --- aiq/aiq.h | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 aiq/aiq.h (limited to 'aiq/aiq.h') diff --git a/aiq/aiq.h b/aiq/aiq.h new file mode 100644 index 0000000..fcd02d2 --- /dev/null +++ b/aiq/aiq.h @@ -0,0 +1,72 @@ +/* SPDX-License-Identifier: Apache-2.0 */ +/* + * Copyright (C) 2021, Google Inc. + * + * aiq.h - Intel IA Imaging library C++ wrapper + * + * To simplify naming, and prevent confusion the wrapper is named simply aiq + * rather than ia_aiq. + */ + +#include + +#include +#include +#include + +#include + +#include "aiq_input_parameters.h" +#include "aiq_results.h" +#include "binary_data.h" +#include "stats/ipa_ipu3_stats.h" + +#ifndef IPA_IPU3_AIQ_H +#define IPA_IPU3_AIQ_H + +namespace libcamera { + +namespace ipa::ipu3::aiq { + +class AIQ +{ +public: + AIQ(); + ~AIQ(); + + int init(BinaryData &aiqb, BinaryData &nvm, BinaryData &aiqd); + int configure(); + int setStatistics(unsigned int frame, + int64_t timestamp, AiqResults &results, + const ipu3_uapi_stats_3a *stats); + + int run2a(unsigned int frame, AiqInputParameters ¶ms, + AiqResults &results); + +private: + std::string decodeError(ia_err err); + + int aeRun(ia_aiq_ae_input_params &aeParams, AiqResults &results); + int afRun(ia_aiq_af_input_params &afParams, AiqResults &results); + int afBracketRun(ia_aiq_af_bracket_input_params &afBracketParams, + AiqResults &results); + int awbRun(ia_aiq_awb_input_params &awbParams, AiqResults &results); + int dsdRun(ia_aiq_dsd_input_params &dsdParams, AiqResults &results); + int gbceRun(ia_aiq_gbce_input_params &gbceParams, AiqResults &results); + int parameterAdapterRun(ia_aiq_pa_input_params &paParams, + AiqResults &results); + int shadingAdapterRun(ia_aiq_sa_input_params &saParams, + AiqResults &results); + + ia_aiq *aiq_; + ia_cmc_t *iaCmc_; + std::string version_; + + IPAIPU3Stats *aiqStats_; +}; + +} /* namespace ipa::ipu3::aiq */ + +} /* namespace libcamera */ + +#endif /* IPA_IPU3_AIQ_H */ -- cgit v1.2.1