summaryrefslogtreecommitdiff
path: root/src/ipa/rkisp1/algorithms/dpcc.cpp
AgeCommit message (Collapse)Author
2023-03-08[RFC] ipa: rkisp1: dpcc: Generalize YAML parsingLaurent Pinchart
The DefectPixelClusterCorrection::init() function contains a large manually written piece of tuning data parsing code, with duplication of similar but slightly different sections. This is error-prone as copy and paste errors easily creep in and can be hard to spot. As an attempt to address this issue, replace that code with two generic functions tbat operate over a data table which describes the structure of the tuning data and where it fits in the ISP configuration structure (which maps directly to registers). At the same time, restructure the tuning data to group parameter per method, to organize the data in a set-method-parameter structure. The line-threshold and line-mad-factor parameters are grouped in a "lc" (line check) method, and the rnd-threshold and rnd-offset parameters in a "rnd" (rank neighbour difference) method. The other parameters (pg-factor, rg-factor and ro-limits) are directly specified in a "pg", "rg" or "ro" method respectively without a parameter name for simplicity. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> --- A few questions (hence the RFC): - Should methods that have a single parameter (e.g. "pg") have an explicit parameter name in YAML, to match methods that have multiple parameters ? This would result in pg: green: factor: 10 red-blue: factor: 10 instead of pg: green: 10 red-blue: 10 - Should the method names be spelled out fully in YAML, instead of being abbreviated to 2 or 3 letters ? - Is this actually worth it ?
2022-10-01ipa: rkisp1: Remove initialized_ flags from algorithmsLaurent Pinchart
Multiple algorithms have an initialized_ flag that they set to true at the end of the init() function, and check at the beginning of prepare() to skip preparation. This serves no real purpose, as the flag can only be false if init() fails, in which case the IPA module initialization as a whole will fail. Drop the initialized_ flags. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-09-28ipa: rkisp1: Use frame number passed to Algorithm::prepare()Laurent Pinchart
Now that the Algorithm::prepare() function takes a frame number, we can use it to replace the IPAActiveState::frameCount member. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-09-28ipa: rkisp1: Rename frameContext to activeStateKieran Bingham
The RkISP1 IPA module creates a single instance of its IPAFrameContext structure, effectively using it more as an active state than a per-frame context. To prepare for the introduction of a real per-frame context, move all the members of the IPAFrameContext structure to a new IPAActiveState structure. The IPAFrameContext becomes effectively unused at runtime, and will be populated back with per-frame data after converting the RkISP1 IPA module to using a frame context queue. The IPAActiveState structure will slowly morph into a different entity as individual algorithm get later ported to the frame context API. While at it, fix a typo in the documentation of the Agc::computeExposure() function that incorrectly refers to the frame context instead of the global context. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-09-28ipa: libipa: algorithm: prepare(): Pass frame and frame ContextKieran Bingham
Pass the current frame number, and the current FrameContext for calls to prepare. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-07-28ipa: rkisp1: Add support of Defect Pixel Cluster Correction controlFlorian Sylvestre
The Defect Pixel Cluster Correction algorithm is responsible to minimize the impact of defective pixels. The on-the-fly method is actually used, based on coefficient provided by the tuning file. Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>