[v6,0/6] ipa: simple: Introduce metadata reporting
mbox series

Message ID 20250327185945.159481-1-mzamazal@redhat.com
Headers show
Series
  • ipa: simple: Introduce metadata reporting
Related show

Message

Milan Zamazal March 27, 2025, 6:59 p.m. UTC
Provide metadata reporting for the software ISP.  This means reporting
metadata itself from software ISP and adding relevant values to the
metadata.

Running ‘cam’ with --metadata now produces something like the following:

  SensorBlackLevels = [ 4096, 4096, 4096, 4096 ]
  ColourGains = [ 0.001153, 0.001145 ]
  ExposureTime = 66578
  AnalogueGain = 10.666667
  SensorTimestamp = 5466162537000

Changes in v6:
- Frame info is always added for requests, whether software ISP is used
  or not.
- SimpleCameraData::completeRequest method merged into
  tryCompleteRequest + related arrangements regarding the metadata
  check.
- Constructor added to SimpleFrameInfo and used as suggested by Laurent.

Changes in v5:
- Updated for current master.

Changes in v4:
- SimpleCameraData::completeRequest just returns if frame info is not
  found.
- SimpleCameraData::completeRequest split to completeRequest and
  tryCompleteRequest and checkCompleted argument removed.
- SoftwareIsp::saveMetadata replaced by a lambda function.
- blackLevels array initialization reflowed to 72 columns.
- exposureTime converted to the right unit.
- maybe_unused removed from a used argument.
- Metadata is taken from frame contexts rather than from active states.

Changes in v3:
- Don't use dynamic allocation for SimpleFrames entries.
- A tentative patch to add exposure/gain to metadata.

Changes in v2:
- Taken over from Kieran.
- Updated for master.
- Black level is reported as uint16_t, according to the control
  documentation.
- Contrast value is reported in metadata.
- The metadata used to proces the image is reported rather than the
  metadata determined from the image.
- Metadata is reported using a new signal rather than (ab)using
  setIspParams; this change is less or more needed due to changed simple
  IPA structure since v1.
- Frame -> request mapping is introduced to make sure the metadata is
  assigned to the right request.

Kieran Bingham (3):
  ipa: simple: softisp: Extend to pass metadata
  ipa: simple: Report the ColourGains in metadata
  ipa: simple: Report black levels in metadata

Milan Zamazal (3):
  libcamera: software_isp: Track frames and requests
  ipa: simple: Report contrast in metadata
  ipa: simple: Report exposure in metadata

 .../internal/software_isp/software_isp.h      |  2 +
 include/libcamera/ipa/soft.mojom              |  4 +-
 src/ipa/simple/algorithms/agc.cpp             | 11 ++-
 src/ipa/simple/algorithms/awb.cpp             | 21 +++-
 src/ipa/simple/algorithms/awb.h               |  6 +-
 src/ipa/simple/algorithms/blc.cpp             | 11 ++-
 src/ipa/simple/algorithms/lut.cpp             | 15 ++-
 src/ipa/simple/algorithms/lut.h               |  5 +
 src/ipa/simple/ipa_context.h                  | 11 ++-
 src/ipa/simple/soft_simple.cpp                | 24 +++--
 src/libcamera/pipeline/simple/simple.cpp      | 96 ++++++++++++++++++-
 src/libcamera/software_isp/software_isp.cpp   | 29 ++++--
 12 files changed, 207 insertions(+), 28 deletions(-)