diff --git a/include/libcamera/internal/software_isp/swisp_stats.h b/include/libcamera/internal/software_isp/swisp_stats.h
index 3c9860185..f8816209f 100644
--- a/include/libcamera/internal/software_isp/swisp_stats.h
+++ b/include/libcamera/internal/software_isp/swisp_stats.h
@@ -10,6 +10,8 @@
 #include <array>
 #include <stdint.h>
 
+#include "libcamera/internal/vector.h"
+
 namespace libcamera {
 
 /**
@@ -26,17 +28,24 @@ struct SwIspStats {
 	 */
 	bool valid;
 	/**
-	 * \brief Holds the sum of all sampled red pixels
+	 * \brief Holds the sum of red channels of all the sampled pixels
 	 */
 	uint64_t sumR_;
 	/**
-	 * \brief Holds the sum of all sampled green pixels
+	 * \brief Holds the sum of green channels of all the sampled pixels
 	 */
 	uint64_t sumG_;
 	/**
-	 * \brief Holds the sum of all sampled blue pixels
+	 * \brief Holds the sum of blue channels of all the sampled pixels
 	 */
 	uint64_t sumB_;
+	/**
+	 * \brief Return the sums of colour channels of all the sampled pixels
+	 */
+	RGB<uint64_t> rgbSum() const
+	{
+		return RGB<uint64_t>({ sumR_, sumG_, sumB_ });
+	}
 	/**
 	 * \brief Number of bins in the yHistogram
 	 */
@@ -46,7 +55,7 @@ struct SwIspStats {
 	 */
 	using Histogram = std::array<uint32_t, kYHistogramSize>;
 	/**
-	 * \brief A histogram of luminance values
+	 * \brief A histogram of luminance values of all the sampled pixels
 	 */
 	Histogram yHistogram;
 };
diff --git a/src/ipa/simple/algorithms/awb.cpp b/src/ipa/simple/algorithms/awb.cpp
index 0080865aa..4c8bfd2de 100644
--- a/src/ipa/simple/algorithms/awb.cpp
+++ b/src/ipa/simple/algorithms/awb.cpp
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 /*
- * Copyright (C) 2024, Red Hat Inc.
+ * Copyright (C) 2024-2026 Red Hat Inc.
  *
  * Auto white balance
  */
@@ -73,9 +73,7 @@ void Awb::process(IPAContext &context,
 		histogram.begin(), histogram.end(), uint64_t(0));
 	const uint64_t offset = blackLevel * nPixels;
 	const uint64_t minValid = 1;
-	const uint64_t sumR = stats->sumR_ > offset / 4 ? stats->sumR_ - offset / 4 : minValid;
-	const uint64_t sumG = stats->sumG_ > offset / 2 ? stats->sumG_ - offset / 2 : minValid;
-	const uint64_t sumB = stats->sumB_ > offset / 4 ? stats->sumB_ - offset / 4 : minValid;
+	const RGB<uint64_t> sum = (stats->rgbSum() - offset).max(minValid);
 
 	/*
 	 * Calculate red and blue gains for AWB.
@@ -83,9 +81,9 @@ void Awb::process(IPAContext &context,
 	 */
 	auto &gains = context.activeState.awb.gains;
 	gains = { {
-		sumR <= sumG / 4 ? 4.0f : static_cast<float>(sumG) / sumR,
+		sum.r() <= sum.g() / 4 ? 4.0f : static_cast<float>(sum.g()) / sum.r(),
 		1.0,
-		sumB <= sumG / 4 ? 4.0f : static_cast<float>(sumG) / sumB,
+		sum.b() <= sum.g() / 4 ? 4.0f : static_cast<float>(sum.g()) / sum.b(),
 	} };
 
 	RGB<double> rgbGains{ { 1 / gains.r(), 1 / gains.g(), 1 / gains.b() } };
