[00/11] Bayer re-processing
mbox series

Message ID 20251210164055.17856-1-david.plowman@raspberrypi.com
Headers show
Series
  • Bayer re-processing
Related show

Message

David Plowman Dec. 10, 2025, 4:15 p.m. UTC
Hi everyone

As I mentioned to some of you last week, I'm keen actually to make
some more progress with Bayer re-processing, with a view to it
becoming a bona fide feature. So here it is again, this time as a
regular "PATCH" rather than an "RFC".

The changes over the RFC version are only minor. Apart from a rebase,
a couple of things have been fixed, and a couple of things slightly
adjusted in relatively minor ways. But the gist of it is the
same. Therefore we have:

* A "memory camera" that is the gateway to Bayer re-processing. These
  are made on demand rather than at startup. It's possible that a
  pipeline handler could supprt any number of "memory cameras" (or
  none). A memory camera has to be passed something that tells it
  how to reprocess the image.

* There are now "input streams", and a camera configuration can have a
  "raw input stream" which supplies the buffer to be re-processed.

* The Raspberry Pi pipeline handler handles these configurations
  correctly.

As before, if anyone wants to try it out, there's a working branch
here:

https://github.com/davidplowman/libcamera/tree/reprocessing

and a demo program that converts a DNG to a JPEG, in the most
lightningest speed you have ever witnessed, here:

https:://github.com/davidplowman/libcamera-apps/blob/reprocessing/apps/rpicam_convert.cpp

Looking foward to everyone's feedback.

Thanks!
David

David Plowman (11):
  libcamera: Infrastructure to ask for "memory" cameras
  libcamera: Add a direction (input or output) to the stream
    configuration
  libcamera: sensor: Add CameraSensorMemory class
  pipeline: rpi: Add PipelineHandlerBase::bayerToMbusCode
  ipa: rpi: cam_helper: Add CamHelperDefault class
  libcamera: pipeline: rpi: Allow creation of the first "memory" camera
  pipeline: rpi: Allow generation of raw input configurations
  libcamera: Don't wait for input streams to complete
  ipa: rpi: Support memory cameras
  pipeline: rpi: Support memory cameras
  pipline: rpi: Support memory cameras processing requests

 include/libcamera/camera_manager.h            |   4 +
 include/libcamera/internal/camera_manager.h   |   5 +
 include/libcamera/internal/camera_sensor.h    |   2 +
 .../libcamera/internal/camera_sensor_memory.h | 110 ++++
 include/libcamera/internal/meson.build        |   1 +
 include/libcamera/internal/pipeline_handler.h |   8 +
 include/libcamera/stream.h                    |  10 +
 src/ipa/rpi/cam_helper/cam_helper_default.cpp |  45 ++
 src/ipa/rpi/cam_helper/meson.build            |   1 +
 src/ipa/rpi/common/ipa_base.cpp               | 135 +++--
 src/ipa/rpi/common/ipa_base.h                 |   5 +
 src/libcamera/camera_manager.cpp              |  64 +++
 .../pipeline/rpi/common/pipeline_base.cpp     | 144 +++++-
 .../pipeline/rpi/common/pipeline_base.h       |   6 +-
 src/libcamera/pipeline/rpi/pisp/pisp.cpp      | 471 ++++++++++++------
 src/libcamera/pipeline_handler.cpp            |  23 +
 src/libcamera/request.cpp                     |   4 +-
 src/libcamera/sensor/camera_sensor_memory.cpp | 241 +++++++++
 src/libcamera/sensor/meson.build              |   1 +
 src/libcamera/stream.cpp                      |   6 +-
 20 files changed, 1084 insertions(+), 202 deletions(-)
 create mode 100644 include/libcamera/internal/camera_sensor_memory.h
 create mode 100644 src/ipa/rpi/cam_helper/cam_helper_default.cpp
 create mode 100644 src/libcamera/sensor/camera_sensor_memory.cpp