diff options
author | Nick Hollinghurst <nick.hollinghurst@raspberrypi.com> | 2024-03-05 11:01:36 +0000 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2024-03-06 12:52:14 +0000 |
commit | caed5a551b9a1d590040e6aa92da56ffe5ff421e (patch) | |
tree | d6d248b9079a8f66324e9b92216460414dba4fcf /src/ipa/rpi/cam_helper/md_parser_smia.cpp | |
parent | a63af956acb9966180d79366f02dc505222e07f0 (diff) |
ipa: rpi: cam_helper: Extend embedded data parsing to RAW14 modes
Fix embedded data byte-skipping for 14-bit modes (4 out of 7 bytes
carry register data), and allow 14-bit modes in IMX708 PDAF parsing.
Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/ipa/rpi/cam_helper/md_parser_smia.cpp')
-rw-r--r-- | src/ipa/rpi/cam_helper/md_parser_smia.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ipa/rpi/cam_helper/md_parser_smia.cpp b/src/ipa/rpi/cam_helper/md_parser_smia.cpp index 210787ed..c5b806d7 100644 --- a/src/ipa/rpi/cam_helper/md_parser_smia.cpp +++ b/src/ipa/rpi/cam_helper/md_parser_smia.cpp @@ -86,10 +86,13 @@ MdParserSmia::ParseStatus MdParserSmia::findRegs(libcamera::Span<const uint8_t> while (1) { int tag = buffer[currentOffset++]; - if ((bitsPerPixel_ == 10 && - (currentOffset + 1 - currentLineStart) % 5 == 0) || - (bitsPerPixel_ == 12 && - (currentOffset + 1 - currentLineStart) % 3 == 0)) { + /* Non-dummy bytes come in even-sized blocks: skip can only ever follow tag */ + while ((bitsPerPixel_ == 10 && + (currentOffset + 1 - currentLineStart) % 5 == 0) || + (bitsPerPixel_ == 12 && + (currentOffset + 1 - currentLineStart) % 3 == 0) || + (bitsPerPixel_ == 14 && + (currentOffset - currentLineStart) % 7 >= 4)) { if (buffer[currentOffset++] != RegSkip) return BadDummy; } |