ipa: rpi: Use centralised libipa helpers
Use the centralised libipa helpers rather than open coding common functions. Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
This commit is contained in:
parent
1cc6d926ac
commit
d5217b1602
1 changed files with 6 additions and 4 deletions
|
@ -12,6 +12,8 @@
|
|||
|
||||
#include <libcamera/base/log.h>
|
||||
|
||||
#include "libipa/colours.h"
|
||||
|
||||
#include "../awb_status.h"
|
||||
#include "../device_status.h"
|
||||
#include "../histogram.h"
|
||||
|
@ -694,11 +696,11 @@ static double computeInitialY(StatisticsPtr &stats, AwbStatus const &awb,
|
|||
double ySum;
|
||||
/* Factor in the AWB correction if needed. */
|
||||
if (stats->agcStatsPos == Statistics::AgcStatsPos::PreWb) {
|
||||
ySum = rSum * awb.gainR * .299 +
|
||||
gSum * awb.gainG * .587 +
|
||||
bSum * awb.gainB * .114;
|
||||
ySum = ipa::rec601LuminanceFromRGB(rSum * awb.gainR,
|
||||
gSum * awb.gainG,
|
||||
bSum * awb.gainB);
|
||||
} else
|
||||
ySum = rSum * .299 + gSum * .587 + bSum * .114;
|
||||
ySum = ipa::rec601LuminanceFromRGB(rSum, gSum, bSum);
|
||||
|
||||
return ySum / pixelSum / (1 << 16);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue