[libcamera-devel] [RFC PATCH 3/5] ipa: rpi: cam_helper_imx708: Only pass embedded buffer in parseEmbeddedData()
Naushir Patuck
naush at raspberrypi.com
Fri Jun 30 14:58:46 CEST 2023
Hi Umang,
Thank you for your work.
On Fri, 30 Jun 2023 at 13:03, Umang Jain <umang.jain at ideasonboard.com> wrote:
>
> Only the embedded data section should be passed while parsing the
> embedded data through parseEmbeddedData().
>
> Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
> ---
> src/ipa/rpi/cam_helper/cam_helper_imx708.cpp | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp b/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp
> index d0382d63..6c3b54ed 100644
> --- a/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp
> +++ b/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp
> @@ -40,6 +40,8 @@ constexpr std::initializer_list<uint32_t> registerList =
> { expHiReg, expLoReg, gainHiReg, gainLoReg, lineLengthHiReg,
> lineLengthLoReg, frameLengthHiReg, frameLengthLoReg, temperatureReg };
>
> +/* No. of lines of embedded data on IMX708. */
> +constexpr uint32_t embeddedDataLinesImx708 = 2;
> /* PDAF data is expect to occupy the third scanline of embedded data. */
> constexpr uint32_t pdafLineOffsetImx708 = 2;
You only need one of these const values correct?
Perhaps these should be private members in the class like the other consts.
Also you can remove the imx708 suffix.
>
> @@ -109,10 +111,13 @@ void CamHelperImx708::prepare(libcamera::Span<const uint8_t> buffer, Metadata &m
> return;
> }
>
> - parseEmbeddedData(buffer, metadata);
> + size_t bytesPerLine = (mode_.width * mode_.bitdepth) >> 3;
> +
> + libcamera::Span<const uint8_t> embeddedData{ buffer.data(),
> + embeddedDataLinesImx708 * bytesPerLine };
> + parseEmbeddedData(embeddedData, metadata);
>
> /* Parse sensor-specific PDAF data. */
> - size_t bytesPerLine = (mode_.width * mode_.bitdepth) >> 3;
> size_t pdafDataOffset = pdafLineOffsetImx708 * bytesPerLine;
>
> if (buffer.size() > pdafDataOffset) {
> --
> 2.39.1
>
More information about the libcamera-devel
mailing list