[PATCH 3/4] ipa: Use Vector class from libcamera

Naushir Patuck naush at raspberrypi.com
Tue Feb 11 11:05:37 CET 2025


On Tue, 11 Feb 2025 at 09:46, Kieran Bingham
<kieran.bingham at ideasonboard.com> wrote:
>
> Quoting Stefan Klug (2025-02-06 14:10:10)
> > Now that there is a Vector class in libcamera, use that one.
> >
>
> I'm assuming that the next patch will confirm this is a complete
> conversion ;-)
>
> Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
>
>
> Naush/David, it's very minor but this series touches src/ipa/rpi. Could
> you confirm if you're ok with this please?

Looks fine to me!

Reviewed-by: Naushir Patuck <naush at raspberrypi.com>


>
>
> > Signed-off-by: Stefan Klug <stefan.klug at ideasonboard.com>
> > ---
> >  src/ipa/ipu3/algorithms/awb.h              | 2 +-
> >  src/ipa/libipa/colours.h                   | 2 +-
> >  src/ipa/libipa/pwl.h                       | 2 +-
> >  src/ipa/rkisp1/algorithms/awb.h            | 3 ++-
> >  src/ipa/rkisp1/ipa_context.h               | 2 +-
> >  src/ipa/rpi/controller/rpi/agc_channel.cpp | 7 ++++---
> >  6 files changed, 10 insertions(+), 8 deletions(-)
> >
> > diff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h
> > index 1916990a5364..dbf69c9073a1 100644
> > --- a/src/ipa/ipu3/algorithms/awb.h
> > +++ b/src/ipa/ipu3/algorithms/awb.h
> > @@ -13,7 +13,7 @@
> >
> >  #include <libcamera/geometry.h>
> >
> > -#include "libipa/vector.h"
> > +#include "libcamera/internal/vector.h"
> >
> >  #include "algorithm.h"
> >
> > diff --git a/src/ipa/libipa/colours.h b/src/ipa/libipa/colours.h
> > index fa6a8b575cc7..d39b2ca8b87e 100644
> > --- a/src/ipa/libipa/colours.h
> > +++ b/src/ipa/libipa/colours.h
> > @@ -9,7 +9,7 @@
> >
> >  #include <stdint.h>
> >
> > -#include "vector.h"
> > +#include "libcamera/internal/vector.h"
> >
> >  namespace libcamera {
> >
> > diff --git a/src/ipa/libipa/pwl.h b/src/ipa/libipa/pwl.h
> > index d4ec9f4f18fb..8fdc70538b93 100644
> > --- a/src/ipa/libipa/pwl.h
> > +++ b/src/ipa/libipa/pwl.h
> > @@ -12,7 +12,7 @@
> >  #include <utility>
> >  #include <vector>
> >
> > -#include "vector.h"
> > +#include "libcamera/internal/vector.h"
> >
> >  namespace libcamera {
> >
> > diff --git a/src/ipa/rkisp1/algorithms/awb.h b/src/ipa/rkisp1/algorithms/awb.h
> > index e424804861a6..34ec42cbb164 100644
> > --- a/src/ipa/rkisp1/algorithms/awb.h
> > +++ b/src/ipa/rkisp1/algorithms/awb.h
> > @@ -9,8 +9,9 @@
> >
> >  #include <optional>
> >
> > +#include "libcamera/internal/vector.h"
> > +
> >  #include "libipa/interpolator.h"
> > -#include "libipa/vector.h"
> >
> >  #include "algorithm.h"
> >
> > diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h
> > index 5d5b79fa615e..c765b928a55f 100644
> > --- a/src/ipa/rkisp1/ipa_context.h
> > +++ b/src/ipa/rkisp1/ipa_context.h
> > @@ -22,10 +22,10 @@
> >
> >  #include "libcamera/internal/debug_controls.h"
> >  #include "libcamera/internal/matrix.h"
> > +#include "libcamera/internal/vector.h"
> >
> >  #include <libipa/camera_sensor_helper.h>
> >  #include <libipa/fc_queue.h>
> > -#include <libipa/vector.h>
> >
> >  namespace libcamera {
> >
> > diff --git a/src/ipa/rpi/controller/rpi/agc_channel.cpp b/src/ipa/rpi/controller/rpi/agc_channel.cpp
> > index e79184b7ac74..a5562760e034 100644
> > --- a/src/ipa/rpi/controller/rpi/agc_channel.cpp
> > +++ b/src/ipa/rpi/controller/rpi/agc_channel.cpp
> > @@ -12,8 +12,9 @@
> >
> >  #include <libcamera/base/log.h>
> >
> > +#include "libcamera/internal/vector.h"
> > +
> >  #include "libipa/colours.h"
> > -#include "libipa/vector.h"
> >
> >  #include "../awb_status.h"
> >  #include "../device_status.h"
> > @@ -700,7 +701,7 @@ static double computeInitialY(StatisticsPtr &stats, AwbStatus const &awb,
> >          * Note that the weights are applied by the IPA to the statistics directly,
> >          * before they are given to us here.
> >          */
> > -       ipa::RGB<double> sum{ 0.0 };
> > +       RGB<double> sum{ 0.0 };
> >         double pixelSum = 0;
> >         for (unsigned int i = 0; i < stats->agcRegions.numRegions(); i++) {
> >                 auto &region = stats->agcRegions.get(i);
> > @@ -716,7 +717,7 @@ static double computeInitialY(StatisticsPtr &stats, AwbStatus const &awb,
> >
> >         /* Factor in the AWB correction if needed. */
> >         if (stats->agcStatsPos == Statistics::AgcStatsPos::PreWb)
> > -               sum *= ipa::RGB<double>{{ awb.gainR, awb.gainR, awb.gainB }};
> > +               sum *= RGB<double>{ { awb.gainR, awb.gainR, awb.gainB } };
> >
> >         double ySum = ipa::rec601LuminanceFromRGB(sum);
> >
> > --
> > 2.43.0
> >


More information about the libcamera-devel mailing list