@@ -14,6 +14,7 @@
#include <stdint.h>
#include "libcamera/internal/matrix.h"
+#include "libcamera/internal/vector.h"
namespace libcamera {
@@ -56,6 +57,11 @@ struct DebayerParams {
* Per frame CCM values as calcualted by the IPA
*/
Matrix<float, 3, 3> ccm; /**< Per frame colour correction matrix for GPUISP */
+
+ /*
+ * Per frame blacklevel gains calculated by the IPA
+ */
+ RGB<float> blackLevel; /**< Blacklevel gains for GPUISP */
};
} /* namespace libcamera */
@@ -47,6 +47,19 @@ int BlackLevel::configure(IPAContext &context,
return 0;
}
+void BlackLevel::prepare(IPAContext &context,
+ [[maybe_unused]] const uint32_t frame,
+ [[maybe_unused]] IPAFrameContext &frameContext,
+ DebayerParams *params)
+{
+ const std::array<float, 3> blackLevel { context.activeState.blc.level / 255.0f,
+ context.activeState.blc.level / 255.0f,
+ context.activeState.blc.level / 255.0f };
+
+ /* Latch the blacklevel gain so GPUISP can apply. */
+ params->blackLevel = RGB<float>(blackLevel);
+}
+
void BlackLevel::process(IPAContext &context,
[[maybe_unused]] const uint32_t frame,
IPAFrameContext &frameContext,
@@ -24,6 +24,10 @@ public:
int init(IPAContext &context, const YamlObject &tuningData) override;
int configure(IPAContext &context, const IPAConfigInfo &configInfo) override;
+ void prepare(IPAContext &context,
+ const uint32_t frame,
+ IPAFrameContext &frameContext,
+ DebayerParams *params) override;
void process(IPAContext &context, const uint32_t frame,
IPAFrameContext &frameContext,
const SwIspStats *stats,
Populate black level gain in blacklevel::prepare(). A copy is made of the gain value in the DebayerParams structure. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> --- .../internal/software_isp/debayer_params.h | 6 ++++++ src/ipa/simple/algorithms/blc.cpp | 13 +++++++++++++ src/ipa/simple/algorithms/blc.h | 4 ++++ 3 files changed, 23 insertions(+)