summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/controller/pwl.cpp
AgeCommit message (Collapse)Author
2020-12-11ipa: raspberrypi: Compute inverse of piecewise linear functionDavid Plowman
Add a method to the piecewise linear function (Pwl) class to compute the inverse of a given Pwl. If the input function is non-monotonic we can only produce a best effort "pseudo" inverse, and we signal this to the caller. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-29ipa: raspberrypi: Rename the controller namespace from Rpi to RpiControllerNaushir Patuck
This avoids a namespace clash with the RPi namespace used by the ipa and pipeline handlers, and cleans up the syntax slightly. There are no functional changes in this commit. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-05-11libcamera: ipa: Raspberry Pi IPANaushir Patuck
Initial implementation of the Raspberry Pi (BCM2835) libcamera IPA and associated libraries. All code is licensed under the BSD-2-Clause terms. Copyright (c) 2019-2020 Raspberry Pi Trading Ltd. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
ss="hl pps">"../denoise_status.h" #include "../noise_status.h" #include "sdn.h" using namespace RPiController; using namespace libcamera; LOG_DEFINE_CATEGORY(RPiSdn) /* * Calculate settings for the spatial denoise block using the noise profile in * the image metadata. */ #define NAME "rpi.sdn" Sdn::Sdn(Controller *controller) : DenoiseAlgorithm(controller), mode_(DenoiseMode::ColourOff) { } char const *Sdn::name() const { return NAME; } int Sdn::read(const libcamera::YamlObject &params) { deviation_ = params["deviation"].get<double>(3.2); strength_ = params["strength"].get<double>(0.75); return 0; } void Sdn::initialise() { } void Sdn::prepare(Metadata *imageMetadata) { struct NoiseStatus noiseStatus = {}; noiseStatus.noiseSlope = 3.0; /* in case no metadata */ if (imageMetadata->get("noise.status", noiseStatus) != 0) LOG(RPiSdn, Warning) << "no noise profile found"; LOG(RPiSdn, Debug) << "Noise profile: constant " << noiseStatus.noiseConstant << " slope " << noiseStatus.noiseSlope; struct DenoiseStatus status; status.noiseConstant = noiseStatus.noiseConstant * deviation_; status.noiseSlope = noiseStatus.noiseSlope * deviation_; status.strength = strength_; status.mode = static_cast<std::underlying_type_t<DenoiseMode>>(mode_); imageMetadata->set("denoise.status", status); LOG(RPiSdn, Debug) << "programmed constant " << status.noiseConstant << " slope " << status.noiseSlope << " strength " << status.strength; } void Sdn::setMode(DenoiseMode mode) { /* We only distinguish between off and all other modes. */ mode_ = mode; } /* Register algorithm with the system. */ static Algorithm *create(Controller *controller) { return (Algorithm *)new Sdn(controller); } static RegisterAlgorithm reg(NAME, &create);