[0/2] libcamera: Vector right-shift operators and SwStatsCpu use site
mbox series

Message ID 177826797798.345005.11618565886801750854@jetm.me
Headers show
Series
  • libcamera: Vector right-shift operators and SwStatsCpu use site
Related show

Message

Javier Tia May 8, 2026, 7:19 p.m. UTC
Small follow-up suggested by Barnabás and Laurent during review of the
sumShift_ cleanup in the OV2740 v2 series:

  https://patchwork.libcamera.org/project/libcamera/list/?series=5926

Patch 1/2 adds operator>> and operator>>= to the Vector class.
Patch 2/2 uses the new operator in SwStatsCpu::finishFrame() to
collapse the three per-component right-shifts on RGB<uint64_t>::sum_
into a single sum_ >>= sumShift_ statement.

Depends on the v2 OV2740 series above (specifically v2 1/3, which
removes the if (sumShift_) guard around the three right-shifts that
2/2 here further simplifies). It does not apply on top of master
without v2.

Javier Tia (2):
  libcamera: libipa: Add right-shift operators to Vector
  libcamera: software_isp: Use Vector operator>>= in finishFrame

 include/libcamera/internal/vector.h        | 15 +++++++++++++++
 src/libcamera/software_isp/swstats_cpu.cpp |  4 +---
 2 files changed, 16 insertions(+), 3 deletions(-)