summaryrefslogtreecommitdiff
path: root/src/ipa/ipu3/ipu3.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-12-06 16:24:43 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-12-07 19:09:35 +0200
commite7888073718aadd7c35a78f88792a73a4e3a8300 (patch)
treec0cbddf20813f9a511f8321b8ada4a71f94b64ab /src/ipa/ipu3/ipu3.cpp
parentf413f944d789911c9ded831ac45a7674c129ceba (diff)
libcamera: Use utils::abs_diff()
Use the new utils::abs_diff() function where appropriate to replace manual implementations. While at it fix a header ordering issue in src/libcamera/pipeline/raspberrypi/raspberrypi.cpp. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Diffstat (limited to 'src/ipa/ipu3/ipu3.cpp')
-rw-r--r--src/ipa/ipu3/ipu3.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp
index 76182587..3d307708 100644
--- a/src/ipa/ipu3/ipu3.cpp
+++ b/src/ipa/ipu3/ipu3.cpp
@@ -354,7 +354,7 @@ void IPAIPU3::calculateBdsGrid(const Size &bdsOutputSize)
kMaxGridWidth);
width = width << shift;
- uint32_t error = std::abs(static_cast<int>(width - bdsOutputSize.width));
+ uint32_t error = utils::abs_diff(width, bdsOutputSize.width);
if (error >= minError)
continue;
@@ -370,7 +370,7 @@ void IPAIPU3::calculateBdsGrid(const Size &bdsOutputSize)
kMaxGridHeight);
height = height << shift;
- uint32_t error = std::abs(static_cast<int>(height - bdsOutputSize.height));
+ uint32_t error = utils::abs_diff(height, bdsOutputSize.height);
if (error >= minError)
continue;