[{"id":29387,"web_url":"https://patchwork.libcamera.org/comment/29387/","msgid":"<crqd6gfkbzxdu4z5atephr4yrshegdpvn35aycyo6oiwld6rsg@osp3vlvvdk2o>","date":"2024-05-02T10:03:24","subject":"Re: [PATCH v1 3/5] ipa: rpi: Add HDR support","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"On Thu, May 02, 2024 at 09:09:23AM GMT, Naushir Patuck wrote:\n> Add support for the following HDR modes in the Raspberry Pi IPA:\n> - Night mode\n> - Single exposure mode\n> - Multi-exposure (merged and unmerged)\n>\n> The algorithm is updated to expect the HDR short channel to meter\n> explicitly for highlights. This means that it will not in general\n> under-expose the short channel more than is actually necessary.\n>\n> When images don't have much saturation, it's good to detect this so\n> that some of the boost we want to apply to the dark areas can be\n> implemented as regular gain. This means we can then adjust the tone\n> curve less, leading to less flat looking images.\n>\n> The impact on the HDR algorithm is then that this determines how we\n> build tonemaps dynamically. The highlights are more-or-less correct\n> now, so we have to build a power-type curve that gives us the\n> appropriately configured targets in the lower part of the histogram.\n>\n> We allow the tuning file to supply the maximum spatial gain value,\n> rather than the whole curve (though it can supply this if it\n> wants). Some parameter defaults are tweaked to be generally better\n> across the range of our cameras.\n>\n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n> Reviewed-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>  src/ipa/rpi/common/ipa_base.cpp             |  78 ++-\n>  src/ipa/rpi/common/ipa_base.h               |   7 +\n\nThese changes to the common IPA looks ok\n\nAcked-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nThe rest is your private stuff, so I trust you there ;)\n\n>  src/ipa/rpi/controller/rpi/hdr.cpp          | 112 +++-\n>  src/ipa/rpi/controller/rpi/hdr.h            |  10 +-\n>  src/ipa/rpi/vc4/data/imx219.json            | 607 ++++++++++---------\n>  src/ipa/rpi/vc4/data/imx219_noir.json       | 607 ++++++++++---------\n>  src/ipa/rpi/vc4/data/imx290.json            |  15 +-\n>  src/ipa/rpi/vc4/data/imx296.json            |  17 +-\n>  src/ipa/rpi/vc4/data/imx296_mono.json       |  17 +-\n>  src/ipa/rpi/vc4/data/imx378.json            |  15 +-\n>  src/ipa/rpi/vc4/data/imx477.json            | 615 ++++++++++----------\n>  src/ipa/rpi/vc4/data/imx477_noir.json       | 607 ++++++++++---------\n>  src/ipa/rpi/vc4/data/imx477_scientific.json |  15 +-\n>  src/ipa/rpi/vc4/data/imx477_v1.json         |  15 +-\n>  src/ipa/rpi/vc4/data/imx519.json            |  15 +-\n>  src/ipa/rpi/vc4/data/imx708.json            | 555 +++++++++---------\n>  src/ipa/rpi/vc4/data/imx708_noir.json       | 555 +++++++++---------\n>  src/ipa/rpi/vc4/data/imx708_wide.json       | 555 +++++++++---------\n>  src/ipa/rpi/vc4/data/imx708_wide_noir.json  | 555 +++++++++---------\n>  src/ipa/rpi/vc4/data/ov5647.json            | 611 +++++++++----------\n>  src/ipa/rpi/vc4/data/ov5647_noir.json       |  15 +-\n>  src/ipa/rpi/vc4/data/ov9281_mono.json       |   5 +-\n>  src/ipa/rpi/vc4/data/se327m12.json          |  15 +-\n>  src/ipa/rpi/vc4/data/uncalibrated.json      |   5 +-\n>  24 files changed, 3040 insertions(+), 2583 deletions(-)\n>\n> diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp\n> index 3c133c55943a..149a133ab662 100644\n> --- a/src/ipa/rpi/common/ipa_base.cpp\n> +++ b/src/ipa/rpi/common/ipa_base.cpp\n> @@ -25,7 +25,6 @@\n>  #include \"controller/contrast_algorithm.h\"\n>  #include \"controller/denoise_algorithm.h\"\n>  #include \"controller/hdr_algorithm.h\"\n> -#include \"controller/hdr_status.h\"\n>  #include \"controller/lux_status.h\"\n>  #include \"controller/sharpen_algorithm.h\"\n>  #include \"controller/statistics.h\"\n> @@ -104,9 +103,8 @@ LOG_DEFINE_CATEGORY(IPARPI)\n>  namespace ipa::RPi {\n>\n>  IpaBase::IpaBase()\n> -\t: controller_(), frameLengths_(FrameLengthsQueueSize, 0s), statsMetadataOutput_(false),\n> -\t  frameCount_(0), mistrustCount_(0), lastRunTimestamp_(0), firstStart_(true),\n> -\t  flickerState_({ 0, 0s })\n> +\t: controller_(), frameLengths_(FrameLengthsQueueSize, 0s), stitchSwapBuffers_(false), frameCount_(0),\n> +\t  mistrustCount_(0), lastRunTimestamp_(0), firstStart_(true), flickerState_({ 0, 0s })\n>  {\n>  }\n>\n> @@ -299,6 +297,8 @@ void IpaBase::start(const ControlList &controls, StartResult *result)\n>  \t\tresult->controls = std::move(ctrls);\n>  \t\tsetCameraTimeoutValue();\n>  \t}\n> +\t/* Make a note of this as it tells us the HDR status of the first few frames. */\n> +\thdrStatus_ = agcStatus.hdr;\n>\n>  \t/*\n>  \t * Initialise frame counts, and decide how many frames must be hidden or\n> @@ -402,11 +402,17 @@ void IpaBase::prepareIsp(const PrepareParams &params)\n>  \t * sensor exposure/gain changes. So fetch it from the metadata list\n>  \t * indexed by the IPA cookie returned, and put it in the current frame\n>  \t * metadata.\n> +\t *\n> +\t * Note if the HDR mode has changed, as things like tonemaps may need updating.\n>  \t */\n>  \tAgcStatus agcStatus;\n> +\tbool hdrChange = false;\n>  \tRPiController::Metadata &delayedMetadata = rpiMetadata_[params.delayContext];\n> -\tif (!delayedMetadata.get<AgcStatus>(\"agc.status\", agcStatus))\n> +\tif (!delayedMetadata.get<AgcStatus>(\"agc.status\", agcStatus)) {\n>  \t\trpiMetadata.set(\"agc.delayed_status\", agcStatus);\n> +\t\thdrChange = agcStatus.hdr.mode != hdrStatus_.mode;\n> +\t\thdrStatus_ = agcStatus.hdr;\n> +\t}\n>\n>  \t/*\n>  \t * This may overwrite the DeviceStatus using values from the sensor\n> @@ -417,7 +423,7 @@ void IpaBase::prepareIsp(const PrepareParams &params)\n>  \t/* Allow a 10% margin on the comparison below. */\n>  \tDuration delta = (frameTimestamp - lastRunTimestamp_) * 1.0ns;\n>  \tif (lastRunTimestamp_ && frameCount_ > dropFrameCount_ &&\n> -\t    delta < controllerMinFrameDuration * 0.9) {\n> +\t    delta < controllerMinFrameDuration * 0.9 && !hdrChange) {\n>  \t\t/*\n>  \t\t * Ensure we merge the previous frame's metadata with the current\n>  \t\t * frame. This will not overwrite exposure/gain values for the\n> @@ -454,7 +460,7 @@ void IpaBase::prepareIsp(const PrepareParams &params)\n>  \t\treportMetadata(ipaContext);\n>\n>  \t/* Ready to push the input buffer into the ISP. */\n> -\tprepareIspComplete.emit(params.buffers, false);\n> +\tprepareIspComplete.emit(params.buffers, stitchSwapBuffers_);\n>  }\n>\n>  void IpaBase::processStats(const ProcessParams &params)\n> @@ -695,14 +701,18 @@ static const std::map<int32_t, RPiController::AfAlgorithm::AfPause> AfPauseTable\n>\n>  static const std::map<int32_t, std::string> HdrModeTable = {\n>  \t{ controls::HdrModeOff, \"Off\" },\n> +\t{ controls::HdrModeMultiExposureUnmerged, \"MultiExposureUnmerged\" },\n>  \t{ controls::HdrModeMultiExposure, \"MultiExposure\" },\n>  \t{ controls::HdrModeSingleExposure, \"SingleExposure\" },\n> +\t{ controls::HdrModeNight, \"Night\" },\n>  };\n>\n>  void IpaBase::applyControls(const ControlList &controls)\n>  {\n>  \tusing RPiController::AgcAlgorithm;\n>  \tusing RPiController::AfAlgorithm;\n> +\tusing RPiController::ContrastAlgorithm;\n> +\tusing RPiController::DenoiseAlgorithm;\n>  \tusing RPiController::HdrAlgorithm;\n>\n>  \t/* Clear the return metadata buffer. */\n> @@ -1194,9 +1204,32 @@ void IpaBase::applyControls(const ControlList &controls)\n>  \t\t\t\tbreak;\n>  \t\t\t}\n>\n> -\t\t\tif (hdr->setMode(mode->second) == 0)\n> +\t\t\tif (hdr->setMode(mode->second) == 0) {\n>  \t\t\t\tagc->setActiveChannels(hdr->getChannels());\n> -\t\t\telse\n> +\n> +\t\t\t\t/* We also disable adpative contrast enhancement if HDR is running. */\n> +\t\t\t\tContrastAlgorithm *contrast =\n> +\t\t\t\t\tdynamic_cast<ContrastAlgorithm *>(controller_.getAlgorithm(\"contrast\"));\n> +\t\t\t\tif (contrast) {\n> +\t\t\t\t\tif (mode->second == \"Off\")\n> +\t\t\t\t\t\tcontrast->restoreCe();\n> +\t\t\t\t\telse\n> +\t\t\t\t\t\tcontrast->enableCe(false);\n> +\t\t\t\t}\n> +\n> +\t\t\t\tDenoiseAlgorithm *denoise =\n> +\t\t\t\t\tdynamic_cast<DenoiseAlgorithm *>(controller_.getAlgorithm(\"denoise\"));\n> +\t\t\t\tif (denoise) {\n> +\t\t\t\t\t/* \\todo - make the HDR mode say what denoise it wants? */\n> +\t\t\t\t\tif (mode->second == \"Night\")\n> +\t\t\t\t\t\tdenoise->setConfig(\"night\");\n> +\t\t\t\t\telse if (mode->second == \"SingleExposure\")\n> +\t\t\t\t\t\tdenoise->setConfig(\"hdr\");\n> +\t\t\t\t\t/* MultiExposure doesn't need extra extra denoise. */\n> +\t\t\t\t\telse\n> +\t\t\t\t\t\tdenoise->setConfig(\"normal\");\n> +\t\t\t\t}\n> +\t\t\t} else\n>  \t\t\t\tLOG(IPARPI, Warning)\n>  \t\t\t\t\t<< \"HDR mode \" << mode->second << \" not supported\";\n>\n> @@ -1354,12 +1387,31 @@ void IpaBase::reportMetadata(unsigned int ipaContext)\n>  \t\tlibcameraMetadata_.set(controls::AfPauseState, p);\n>  \t}\n>\n> -\tconst HdrStatus *hdrStatus = rpiMetadata.getLocked<HdrStatus>(\"hdr.status\");\n> -\tif (hdrStatus) {\n> -\t\tif (hdrStatus->channel == \"short\")\n> +\t/*\n> +\t * THe HDR algorithm sets the HDR channel into the agc.status at the time that those\n> +\t * AGC parameters were calculated several frames ago, so it comes back to us now in\n> +\t * the delayed_status. If this frame is too soon after a mode switch for the\n> +\t * delayed_status to be available, we use the HDR status that came out of the\n> +\t * switchMode call.\n> +\t */\n> +\tconst AgcStatus *agcStatus = rpiMetadata.getLocked<AgcStatus>(\"agc.delayed_status\");\n> +\tconst HdrStatus &hdrStatus = agcStatus ? agcStatus->hdr : hdrStatus_;\n> +\tif (!hdrStatus.mode.empty() && hdrStatus.mode != \"Off\") {\n> +\t\tint32_t hdrMode = controls::HdrModeOff;\n> +\t\tfor (auto const &[mode, name] : HdrModeTable) {\n> +\t\t\tif (hdrStatus.mode == name) {\n> +\t\t\t\thdrMode = mode;\n> +\t\t\t\tbreak;\n> +\t\t\t}\n> +\t\t}\n> +\t\tlibcameraMetadata_.set(controls::HdrMode, hdrMode);\n> +\n> +\t\tif (hdrStatus.channel == \"short\")\n>  \t\t\tlibcameraMetadata_.set(controls::HdrChannel, controls::HdrChannelShort);\n> -\t\telse if (hdrStatus->channel == \"long\")\n> +\t\telse if (hdrStatus.channel == \"long\")\n>  \t\t\tlibcameraMetadata_.set(controls::HdrChannel, controls::HdrChannelLong);\n> +\t\telse if (hdrStatus.channel == \"medium\")\n> +\t\t\tlibcameraMetadata_.set(controls::HdrChannel, controls::HdrChannelMedium);\n>  \t\telse\n>  \t\t\tlibcameraMetadata_.set(controls::HdrChannel, controls::HdrChannelNone);\n>  \t}\n> diff --git a/src/ipa/rpi/common/ipa_base.h b/src/ipa/rpi/common/ipa_base.h\n> index 4db4411eed7c..512d7e8fe778 100644\n> --- a/src/ipa/rpi/common/ipa_base.h\n> +++ b/src/ipa/rpi/common/ipa_base.h\n> @@ -22,6 +22,7 @@\n>  #include \"controller/agc_status.h\"\n>  #include \"controller/camera_mode.h\"\n>  #include \"controller/controller.h\"\n> +#include \"controller/hdr_status.h\"\n>  #include \"controller/metadata.h\"\n>\n>  namespace libcamera {\n> @@ -64,6 +65,12 @@ protected:\n>  \tControlList libcameraMetadata_;\n>  \tbool statsMetadataOutput_;\n>\n> +\t/* Remember the HDR status after a mode switch. */\n> +\tHdrStatus hdrStatus_;\n> +\n> +\t/* Whether the stitch block (if available) needs to swap buffers. */\n> +\tbool stitchSwapBuffers_;\n> +\n>  private:\n>  \t/* Number of metadata objects available in the context list. */\n>  \tstatic constexpr unsigned int numMetadataContexts = 16;\n> diff --git a/src/ipa/rpi/controller/rpi/hdr.cpp b/src/ipa/rpi/controller/rpi/hdr.cpp\n> index fb580548d068..28c2280a0fe2 100644\n> --- a/src/ipa/rpi/controller/rpi/hdr.cpp\n> +++ b/src/ipa/rpi/controller/rpi/hdr.cpp\n> @@ -7,6 +7,8 @@\n>\n>  #include \"hdr.h\"\n>\n> +#include <cmath>\n> +\n>  #include <libcamera/base/log.h>\n>\n>  #include \"../agc_status.h\"\n> @@ -39,25 +41,52 @@ void HdrConfig::read(const libcamera::YamlObject &params, const std::string &mod\n>  \t\tchannelMap[v.get<unsigned int>().value()] = k;\n>\n>  \t/* Lens shading related parameters. */\n> -\tif (params.contains(\"spatial_gain\")) {\n> -\t\tspatialGain.read(params[\"spatial_gain\"]);\n> -\t\tdiffusion = params[\"diffusion\"].get<unsigned int>(3);\n> -\t\t/* Clip to an arbitrary limit just to stop typos from killing the system! */\n> -\t\tconst unsigned int MAX_DIFFUSION = 15;\n> -\t\tif (diffusion > MAX_DIFFUSION) {\n> -\t\t\tdiffusion = MAX_DIFFUSION;\n> -\t\t\tLOG(RPiHdr, Warning) << \"Diffusion value clipped to \" << MAX_DIFFUSION;\n> -\t\t}\n> +\tif (params.contains(\"spatial_gain_curve\")) {\n> +\t\tspatialGainCurve.read(params[\"spatial_gain_curve\"]);\n> +\t} else if (params.contains(\"spatial_gain\")) {\n> +\t\tdouble spatialGain = params[\"spatial_gain\"].get<double>(2.0);\n> +\t\tspatialGainCurve.append(0.0, spatialGain);\n> +\t\tspatialGainCurve.append(0.01, spatialGain);\n> +\t\tspatialGainCurve.append(0.06, 1.0); /* maybe make this programmable? */\n> +\t\tspatialGainCurve.append(1.0, 1.0);\n> +\t}\n> +\n> +\tdiffusion = params[\"diffusion\"].get<unsigned int>(3);\n> +\t/* Clip to an arbitrary limit just to stop typos from killing the system! */\n> +\tconst unsigned int MAX_DIFFUSION = 15;\n> +\tif (diffusion > MAX_DIFFUSION) {\n> +\t\tdiffusion = MAX_DIFFUSION;\n> +\t\tLOG(RPiHdr, Warning) << \"Diffusion value clipped to \" << MAX_DIFFUSION;\n>  \t}\n>\n>  \t/* Read any tonemap parameters. */\n>  \ttonemapEnable = params[\"tonemap_enable\"].get<int>(0);\n> -\tdetailConstant = params[\"detail_constant\"].get<uint16_t>(50);\n> -\tdetailSlope = params[\"detail_slope\"].get<double>(8.0);\n> +\tdetailConstant = params[\"detail_constant\"].get<uint16_t>(0);\n> +\tdetailSlope = params[\"detail_slope\"].get<double>(0.0);\n>  \tiirStrength = params[\"iir_strength\"].get<double>(8.0);\n>  \tstrength = params[\"strength\"].get<double>(1.5);\n>  \tif (tonemapEnable)\n>  \t\ttonemap.read(params[\"tonemap\"]);\n> +\tspeed = params[\"speed\"].get<double>(1.0);\n> +\tif (params.contains(\"hi_quantile_targets\")) {\n> +\t\thiQuantileTargets = params[\"hi_quantile_targets\"].getList<double>().value();\n> +\t\tif (hiQuantileTargets.empty() || hiQuantileTargets.size() % 2)\n> +\t\t\tLOG(RPiHdr, Fatal) << \"hi_quantile_targets much be even and non-empty\";\n> +\t} else\n> +\t\thiQuantileTargets = { 0.95, 0.65, 0.5, 0.28, 0.3, 0.25 };\n> +\thiQuantileMaxGain = params[\"hi_quantile_max_gain\"].get<double>(1.6);\n> +\tif (params.contains(\"quantile_targets\")) {\n> +\t\tquantileTargets = params[\"quantile_targets\"].getList<double>().value();\n> +\t\tif (quantileTargets.empty() || quantileTargets.size() % 2)\n> +\t\t\tLOG(RPiHdr, Fatal) << \"quantile_targets much be even and non-empty\";\n> +\t} else\n> +\t\tquantileTargets = { 0.2, 0.03, 1.0, 0.15 };\n> +\tpowerMin = params[\"power_min\"].get<double>(0.65);\n> +\tpowerMax = params[\"power_max\"].get<double>(1.0);\n> +\tif (params.contains(\"contrast_adjustments\")) {\n> +\t\tcontrastAdjustments = params[\"contrast_adjustments\"].getList<double>().value();\n> +\t} else\n> +\t\tcontrastAdjustments = { 0.5, 0.75 };\n>\n>  \t/* Read any stitch parameters. */\n>  \tstitchEnable = params[\"stitch_enable\"].get<int>(0);\n> @@ -159,7 +188,7 @@ void Hdr::prepare(Metadata *imageMetadata)\n>  \t}\n>\n>  \tHdrConfig &config = it->second;\n> -\tif (config.spatialGain.empty())\n> +\tif (config.spatialGainCurve.empty())\n>  \t\treturn;\n>\n>  \tAlscStatus alscStatus{}; /* some compilers seem to require the braces */\n> @@ -205,10 +234,61 @@ bool Hdr::updateTonemap([[maybe_unused]] StatisticsPtr &stats, HdrConfig &config\n>  \t\treturn true;\n>\n>  \t/*\n> -\t * If we wanted to build or adjust tonemaps dynamically, this would be the place\n> -\t * to do it. But for now we seem to be getting by without.\n> +\t * Create a tonemap dynamically. We have three ingredients.\n> +\t *\n> +\t * 1. We have a list of \"hi quantiles\" and \"targets\". We use these to judge if\n> +\t * the image does seem to be reasonably saturated. If it isn't, we calculate\n> +\t * a gain that we will feed as a linear factor into the tonemap generation.\n> +\t * This prevents unsaturated images from beoming quite so \"flat\".\n> +\t *\n> +\t * 2. We have a list of quantile/target pairs for the bottom of the histogram.\n> +\t * We use these to calculate how much gain we must apply to the bottom of the\n> +\t * tonemap. We apply this gain as a power curve so as not to blow out the top\n> +\t * end.\n> +\t *\n> +\t * 3. Finally, when we generate the tonemap, we have some contrast adjustments\n> +\t * for the bottom because we know that power curves can start quite steeply and\n> +\t * cause a washed-out look.\n>  \t */\n>\n> +\t/* Compute the linear gain from the headroom for saturation at the top. */\n> +\tdouble gain = 10; /* arbitrary, but hiQuantileMaxGain will clamp it later */\n> +\tfor (unsigned int i = 0; i < config.hiQuantileTargets.size(); i += 2) {\n> +\t\tdouble quantile = config.hiQuantileTargets[i];\n> +\t\tdouble target = config.hiQuantileTargets[i + 1];\n> +\t\tdouble value = stats->yHist.interQuantileMean(quantile, 1.0) / 1024.0;\n> +\t\tdouble newGain = target / (value + 0.01);\n> +\t\tgain = std::min(gain, newGain);\n> +\t}\n> +\tgain = std::clamp(gain, 1.0, config.hiQuantileMaxGain);\n> +\n> +\t/* Compute the power curve from the amount of gain needed at the bottom. */\n> +\tdouble min_power = 2; /* arbitrary, but config.powerMax will clamp it later */\n> +\tfor (unsigned int i = 0; i < config.quantileTargets.size(); i += 2) {\n> +\t\tdouble quantile = config.quantileTargets[i];\n> +\t\tdouble target = config.quantileTargets[i + 1];\n> +\t\tdouble value = stats->yHist.interQuantileMean(0, quantile) / 1024.0;\n> +\t\tvalue = std::min(value * gain, 1.0);\n> +\t\tdouble power = log(target + 1e-6) / log(value + 1e-6);\n> +\t\tmin_power = std::min(min_power, power);\n> +\t}\n> +\tdouble power = std::clamp(min_power, config.powerMin, config.powerMax);\n> +\n> +\t/* Generate the tonemap, including the contrast adjustment factors. */\n> +\tPwl tonemap;\n> +\ttonemap.append(0, 0);\n> +\tfor (unsigned int i = 0; i <= 6; i++) {\n> +\t\tdouble x = 1 << (i + 9); /* x loops from 512 to 32768 inclusive */\n> +\t\tdouble y = pow(std::min(x * gain, 65535.0) / 65536.0, power) * 65536;\n> +\t\tif (i < config.contrastAdjustments.size())\n> +\t\t\ty *= config.contrastAdjustments[i];\n> +\t\tif (!tonemap_.empty())\n> +\t\t\ty = y * config.speed + tonemap_.eval(x) * (1 - config.speed);\n> +\t\ttonemap.append(x, y);\n> +\t}\n> +\ttonemap.append(65535, 65535);\n> +\ttonemap_ = tonemap;\n> +\n>  \treturn true;\n>  }\n>\n> @@ -255,7 +335,7 @@ static void averageGains(std::vector<double> &src, std::vector<double> &dst, con\n>\n>  void Hdr::updateGains(StatisticsPtr &stats, HdrConfig &config)\n>  {\n> -\tif (config.spatialGain.empty())\n> +\tif (config.spatialGainCurve.empty())\n>  \t\treturn;\n>\n>  \t/* When alternating exposures, only compute these gains for the short frame. */\n> @@ -270,7 +350,7 @@ void Hdr::updateGains(StatisticsPtr &stats, HdrConfig &config)\n>  \t\tdouble g = region.val.gSum / counted;\n>  \t\tdouble b = region.val.bSum / counted;\n>  \t\tdouble brightness = std::max({ r, g, b }) / 65535;\n> -\t\tgains_[0][i] = config.spatialGain.eval(brightness);\n> +\t\tgains_[0][i] = config.spatialGainCurve.eval(brightness);\n>  \t}\n>\n>  \t/* Ping-pong between the two gains_ buffers. */\n> diff --git a/src/ipa/rpi/controller/rpi/hdr.h b/src/ipa/rpi/controller/rpi/hdr.h\n> index 980aa3d1850d..ac855b223d97 100644\n> --- a/src/ipa/rpi/controller/rpi/hdr.h\n> +++ b/src/ipa/rpi/controller/rpi/hdr.h\n> @@ -26,7 +26,7 @@ struct HdrConfig {\n>  \tstd::map<unsigned int, std::string> channelMap;\n>\n>  \t/* Lens shading related parameters. */\n> -\tPwl spatialGain; /* Brightness to gain curve for different image regions. */\n> +\tPwl spatialGainCurve; /* Brightness to gain curve for different image regions. */\n>  \tunsigned int diffusion; /* How much to diffuse the gain spatially. */\n>\n>  \t/* Tonemap related parameters. */\n> @@ -36,6 +36,14 @@ struct HdrConfig {\n>  \tdouble iirStrength;\n>  \tdouble strength;\n>  \tPwl tonemap;\n> +\t/* These relate to adaptive tonemap calculation. */\n> +\tdouble speed;\n> +\tstd::vector<double> hiQuantileTargets; /* quantiles to check for unsaturated images */\n> +\tdouble hiQuantileMaxGain; /* the max gain we'll apply when unsaturated */\n> +\tstd::vector<double> quantileTargets; /* target values for histogram quantiles */\n> +\tdouble powerMin; /* minimum tonemap power */\n> +\tdouble powerMax; /* maximum tonemap power */\n> +\tstd::vector<double> contrastAdjustments; /* any contrast adjustment factors */\n>\n>  \t/* Stitch related parameters. */\n>  \tbool stitchEnable;\n> diff --git a/src/ipa/rpi/vc4/data/imx219.json b/src/ipa/rpi/vc4/data/imx219.json\n> index 54defc0b8ab8..a020b12f553f 100644\n> --- a/src/ipa/rpi/vc4/data/imx219.json\n> +++ b/src/ipa/rpi/vc4/data/imx219.json\n> @@ -131,282 +131,308 @@\n>          {\n>              \"rpi.agc\":\n>              {\n> -\t\t\"channels\":\n> -\t\t[\n> -\t\t    {\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.5,\n> -\t\t\t\t\t1000, 0.5\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.5,\n> -\t\t\t\t\t1000, 0.5\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"shadows\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.0,\n> -\t\t\t\t    \"q_hi\": 0.5,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.17,\n> -\t\t\t\t\t1000, 0.17\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t]\n> -\t\t    },\n> -\t\t    {\n> -\t\t\t\"base_ev\": 0.125,\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.5,\n> -\t\t\t\t\t1000, 0.5\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.5,\n> -\t\t\t\t\t1000, 0.5\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"shadows\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.0,\n> -\t\t\t\t    \"q_hi\": 0.5,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.17,\n> -\t\t\t\t\t1000, 0.17\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t]\n> -\t\t    },\n> -\t\t    {\n> -\t\t\t\"base_ev\": 1.5,\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.5,\n> -\t\t\t\t\t1000, 0.5\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.5,\n> -\t\t\t\t\t1000, 0.5\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"shadows\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.0,\n> -\t\t\t\t    \"q_hi\": 0.5,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.17,\n> -\t\t\t\t\t1000, 0.17\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t]\n> -\t\t    }\n> -\t\t]\n> -\t    }\n> +                \"channels\": [\n> +                    {\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.5,\n> +                                        1000, 0.5\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.5,\n> +                                        1000, 0.5\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"shadows\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.0,\n> +                                    \"q_hi\": 0.5,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.17,\n> +                                        1000, 0.17\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ]\n> +                    },\n> +                    {\n> +                        \"base_ev\": 0.125,\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.5,\n> +                                        1000, 0.5\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.5,\n> +                                        1000, 0.5\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"shadows\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.0,\n> +                                    \"q_hi\": 0.5,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.17,\n> +                                        1000, 0.17\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ]\n> +                    },\n> +                    {\n> +                        \"base_ev\": 1.5,\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.5,\n> +                                        1000, 0.5\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.5,\n> +                                        1000, 0.5\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"shadows\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.0,\n> +                                    \"q_hi\": 0.5,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.17,\n> +                                        1000, 0.17\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ]\n> +                    }\n> +                ]\n> +            }\n>          },\n>          {\n>              \"rpi.alsc\":\n> @@ -651,20 +677,19 @@\n>          {\n>              \"rpi.sharpen\": { }\n>          },\n> -\t{\n> -\t    \"rpi.hdr\":\n> -\t    {\n> -\t\t\"MultiExposure\":\n> -\t\t{\n> -\t\t    \"cadence\": [ 1, 2 ],\n> -\t\t    \"channel_map\": { \"short\": 1, \"long\": 2 }\n> -\t\t},\n> -\t\t\"SingleExposure\":\n> -\t\t{\n> -\t\t    \"cadence\": [ 1 ],\n> -\t\t    \"channel_map\": { \"short\": 1 }\n> -\t\t}\n> -\t    }\n> -\t}\n> +        {\n> +            \"rpi.hdr\":\n> +            {\n> +                \"MultiExposureUnmerged\":\n> +                {\n> +                    \"cadence\": [ 1, 2 ],\n> +                    \"channel_map\":\n> +                    {\n> +                        \"short\": 1,\n> +                        \"long\": 2\n> +                    }\n> +                }\n> +            }\n> +        }\n>      ]\n>  }\n> diff --git a/src/ipa/rpi/vc4/data/imx219_noir.json b/src/ipa/rpi/vc4/data/imx219_noir.json\n> index e823a90dffa8..d8bc963962a4 100644\n> --- a/src/ipa/rpi/vc4/data/imx219_noir.json\n> +++ b/src/ipa/rpi/vc4/data/imx219_noir.json\n> @@ -47,282 +47,308 @@\n>          {\n>              \"rpi.agc\":\n>              {\n> -\t\t\"channels\":\n> -\t\t[\n> -\t\t    {\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.5,\n> -\t\t\t\t\t1000, 0.5\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.5,\n> -\t\t\t\t\t1000, 0.5\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"shadows\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.0,\n> -\t\t\t\t    \"q_hi\": 0.5,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.17,\n> -\t\t\t\t\t1000, 0.17\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t]\n> -\t\t    },\n> -\t\t    {\n> -\t\t\t\"base_ev\": 0.125,\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.5,\n> -\t\t\t\t\t1000, 0.5\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.5,\n> -\t\t\t\t\t1000, 0.5\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"shadows\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.0,\n> -\t\t\t\t    \"q_hi\": 0.5,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.17,\n> -\t\t\t\t\t1000, 0.17\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t]\n> -\t\t    },\n> -\t\t    {\n> -\t\t\t\"base_ev\": 1.5,\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.5,\n> -\t\t\t\t\t1000, 0.5\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.5,\n> -\t\t\t\t\t1000, 0.5\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"shadows\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.0,\n> -\t\t\t\t    \"q_hi\": 0.5,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.17,\n> -\t\t\t\t\t1000, 0.17\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t]\n> -\t\t    }\n> -\t\t]\n> -\t    }\n> +                \"channels\": [\n> +                    {\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.5,\n> +                                        1000, 0.5\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.5,\n> +                                        1000, 0.5\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"shadows\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.0,\n> +                                    \"q_hi\": 0.5,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.17,\n> +                                        1000, 0.17\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ]\n> +                    },\n> +                    {\n> +                        \"base_ev\": 0.125,\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.5,\n> +                                        1000, 0.5\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.5,\n> +                                        1000, 0.5\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"shadows\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.0,\n> +                                    \"q_hi\": 0.5,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.17,\n> +                                        1000, 0.17\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ]\n> +                    },\n> +                    {\n> +                        \"base_ev\": 1.5,\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.5,\n> +                                        1000, 0.5\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.5,\n> +                                        1000, 0.5\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"shadows\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.0,\n> +                                    \"q_hi\": 0.5,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.17,\n> +                                        1000, 0.17\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ]\n> +                    }\n> +                ]\n> +            }\n>          },\n>          {\n>              \"rpi.alsc\":\n> @@ -585,20 +611,19 @@\n>          {\n>              \"rpi.sharpen\": { }\n>          },\n> -\t{\n> -\t    \"rpi.hdr\":\n> -\t    {\n> -\t\t\"MultiExposure\":\n> -\t\t{\n> -\t\t    \"cadence\": [ 1, 2 ],\n> -\t\t    \"channel_map\": { \"short\": 1, \"long\": 2 }\n> -\t\t},\n> -\t\t\"SingleExposure\":\n> -\t\t{\n> -\t\t    \"cadence\": [ 1 ],\n> -\t\t    \"channel_map\": { \"short\": 1 }\n> -\t\t}\n> -\t    }\n> -\t}\n> +        {\n> +            \"rpi.hdr\":\n> +            {\n> +                \"MultiExposureUnmerged\":\n> +                {\n> +                    \"cadence\": [ 1, 2 ],\n> +                    \"channel_map\":\n> +                    {\n> +                        \"short\": 1,\n> +                        \"long\": 2\n> +                    }\n> +                }\n> +            }\n> +        }\n>      ]\n>  }\n> diff --git a/src/ipa/rpi/vc4/data/imx290.json b/src/ipa/rpi/vc4/data/imx290.json\n> index 8a7cadba38a2..8f41bf519644 100644\n> --- a/src/ipa/rpi/vc4/data/imx290.json\n> +++ b/src/ipa/rpi/vc4/data/imx290.json\n> @@ -52,15 +52,24 @@\n>                  {\n>                      \"matrix\":\n>                      {\n> -                        \"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> +                        \"weights\":\n> +                        [\n> +                            1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                        ]\n>                      },\n>                      \"centre-weighted\":\n>                      {\n> -                        \"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> +                        \"weights\":\n> +                        [\n> +                            3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                        ]\n>                      },\n>                      \"spot\":\n>                      {\n> -                        \"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> +                        \"weights\":\n> +                        [\n> +                            2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                        ]\n>                      }\n>                  },\n>                  \"exposure_modes\":\n> diff --git a/src/ipa/rpi/vc4/data/imx296.json b/src/ipa/rpi/vc4/data/imx296.json\n> index 7621f759fc3f..8f24ce5b819a 100644\n> --- a/src/ipa/rpi/vc4/data/imx296.json\n> +++ b/src/ipa/rpi/vc4/data/imx296.json\n> @@ -135,15 +135,24 @@\n>                  {\n>                      \"centre-weighted\":\n>                      {\n> -                        \"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> +                        \"weights\":\n> +                        [\n> +                            3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                        ]\n>                      },\n>                      \"spot\":\n>                      {\n> -                        \"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> +                        \"weights\":\n> +                        [\n> +                            2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                        ]\n>                      },\n>                      \"matrix\":\n>                      {\n> -                        \"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> +                        \"weights\":\n> +                        [\n> +                            1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                        ]\n>                      }\n>                  },\n>                  \"exposure_modes\":\n> @@ -431,4 +440,4 @@\n>              }\n>          }\n>      ]\n> -}\n> +}\n> \\ No newline at end of file\n> diff --git a/src/ipa/rpi/vc4/data/imx296_mono.json b/src/ipa/rpi/vc4/data/imx296_mono.json\n> index d4140c81bf0d..fe331569938e 100644\n> --- a/src/ipa/rpi/vc4/data/imx296_mono.json\n> +++ b/src/ipa/rpi/vc4/data/imx296_mono.json\n> @@ -38,15 +38,24 @@\n>                  {\n>                      \"centre-weighted\":\n>                      {\n> -                        \"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> +                        \"weights\":\n> +                        [\n> +                            3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                        ]\n>                      },\n>                      \"spot\":\n>                      {\n> -                        \"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> +                        \"weights\":\n> +                        [\n> +                            2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                        ]\n>                      },\n>                      \"matrix\":\n>                      {\n> -                        \"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> +                        \"weights\":\n> +                        [\n> +                            1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                        ]\n>                      }\n>                  },\n>                  \"exposure_modes\":\n> @@ -228,4 +237,4 @@\n>              }\n>          }\n>      ]\n> -}\n> +}\n> \\ No newline at end of file\n> diff --git a/src/ipa/rpi/vc4/data/imx378.json b/src/ipa/rpi/vc4/data/imx378.json\n> index f7b68011b634..363b47e19888 100644\n> --- a/src/ipa/rpi/vc4/data/imx378.json\n> +++ b/src/ipa/rpi/vc4/data/imx378.json\n> @@ -133,15 +133,24 @@\n>                  {\n>                      \"centre-weighted\":\n>                      {\n> -                        \"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> +                        \"weights\":\n> +                        [\n> +                            3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                        ]\n>                      },\n>                      \"spot\":\n>                      {\n> -                        \"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> +                        \"weights\":\n> +                        [\n> +                            2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                        ]\n>                      },\n>                      \"matrix\":\n>                      {\n> -                        \"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> +                        \"weights\":\n> +                        [\n> +                            1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                        ]\n>                      }\n>                  },\n>                  \"exposure_modes\":\n> diff --git a/src/ipa/rpi/vc4/data/imx477.json b/src/ipa/rpi/vc4/data/imx477.json\n> index 853bfa67a9b7..fa25ee86004e 100644\n> --- a/src/ipa/rpi/vc4/data/imx477.json\n> +++ b/src/ipa/rpi/vc4/data/imx477.json\n> @@ -115,16 +115,16 @@\n>                  \"ct_curve\":\n>                  [\n>                      2360.0, 0.6009, 0.3093,\n> -                    2848.0, 0.5071, 0.4000,\n> +                    2848.0, 0.5071, 0.4,\n>                      2903.0, 0.4905, 0.4392,\n>                      3628.0, 0.4261, 0.5564,\n>                      3643.0, 0.4228, 0.5623,\n> -                    4660.0, 0.3529, 0.6800,\n> -                    5579.0, 0.3227, 0.7000,\n> -                    6125.0, 0.3129, 0.7100,\n> -                    6671.0, 0.3065, 0.7200,\n> -                    7217.0, 0.3014, 0.7300,\n> -                    7763.0, 0.2950, 0.7400,\n> +                    4660.0, 0.3529, 0.68,\n> +                    5579.0, 0.3227, 0.7,\n> +                    6125.0, 0.3129, 0.71,\n> +                    6671.0, 0.3065, 0.72,\n> +                    7217.0, 0.3014, 0.73,\n> +                    7763.0, 0.295, 0.74,\n>                      9505.0, 0.2524, 0.7856\n>                  ],\n>                  \"sensitivity_r\": 1.05,\n> @@ -136,282 +136,308 @@\n>          {\n>              \"rpi.agc\":\n>              {\n> -\t\t\"channels\":\n> -\t\t[\n> +                \"channels\": [\n>                      {\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.3,\n> -\t\t\t\t\t1000, 0.3\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.3,\n> -\t\t\t\t\t1000, 0.3\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"shadows\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.0,\n> -\t\t\t\t    \"q_hi\": 0.5,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.17,\n> -\t\t\t\t\t1000, 0.17\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t]\n> -\t\t    },\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.3,\n> +                                        1000, 0.3\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.3,\n> +                                        1000, 0.3\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"shadows\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.0,\n> +                                    \"q_hi\": 0.5,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.17,\n> +                                        1000, 0.17\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ]\n> +                    },\n>                      {\n> -\t\t\t\"base_ev\": 0.125,\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.3,\n> -\t\t\t\t\t1000, 0.3\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.3,\n> -\t\t\t\t\t1000, 0.3\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"shadows\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.0,\n> -\t\t\t\t    \"q_hi\": 0.5,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.17,\n> -\t\t\t\t\t1000, 0.17\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t]\n> -\t\t    },\n> +                        \"base_ev\": 0.125,\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.3,\n> +                                        1000, 0.3\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.3,\n> +                                        1000, 0.3\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"shadows\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.0,\n> +                                    \"q_hi\": 0.5,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.17,\n> +                                        1000, 0.17\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ]\n> +                    },\n>                      {\n> -\t\t\t\"base_ev\": 1.5,\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.3,\n> -\t\t\t\t\t1000, 0.3\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.3,\n> -\t\t\t\t\t1000, 0.3\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"shadows\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.0,\n> -\t\t\t\t    \"q_hi\": 0.5,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.17,\n> -\t\t\t\t\t1000, 0.17\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t]\n> -\t\t    }\n> -\t\t]\n> -\t    }\n> +                        \"base_ev\": 1.5,\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.3,\n> +                                        1000, 0.3\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.3,\n> +                                        1000, 0.3\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"shadows\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.0,\n> +                                    \"q_hi\": 0.5,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.17,\n> +                                        1000, 0.17\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ]\n> +                    }\n> +                ]\n> +            }\n>          },\n>          {\n>              \"rpi.alsc\":\n> @@ -656,20 +682,19 @@\n>          {\n>              \"rpi.sharpen\": { }\n>          },\n> -\t{\n> -\t    \"rpi.hdr\":\n> -\t    {\n> -\t\t\"MultiExposure\":\n> -\t\t{\n> -\t\t    \"cadence\": [ 1, 2 ],\n> -\t\t    \"channel_map\": { \"short\": 1, \"long\": 2 }\n> -\t\t},\n> -\t\t\"SingleExposure\":\n> -\t\t{\n> -\t\t    \"cadence\": [ 1 ],\n> -\t\t    \"channel_map\": { \"short\": 1 }\n> -\t\t}\n> -\t    }\n> -\t}\n> +        {\n> +            \"rpi.hdr\":\n> +            {\n> +                \"MultiExposureUnmerged\":\n> +                {\n> +                    \"cadence\": [ 1, 2 ],\n> +                    \"channel_map\":\n> +                    {\n> +                        \"short\": 1,\n> +                        \"long\": 2\n> +                    }\n> +                }\n> +            }\n> +        }\n>      ]\n>  }\n> \\ No newline at end of file\n> diff --git a/src/ipa/rpi/vc4/data/imx477_noir.json b/src/ipa/rpi/vc4/data/imx477_noir.json\n> index 143e20bd92d8..472f33fe1556 100644\n> --- a/src/ipa/rpi/vc4/data/imx477_noir.json\n> +++ b/src/ipa/rpi/vc4/data/imx477_noir.json\n> @@ -47,282 +47,308 @@\n>          {\n>              \"rpi.agc\":\n>              {\n> -\t\t\"channels\":\n> -\t\t[\n> -\t\t    {\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.3,\n> -\t\t\t\t\t1000, 0.3\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.3,\n> -\t\t\t\t\t1000, 0.3\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"shadows\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.0,\n> -\t\t\t\t    \"q_hi\": 0.5,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.17,\n> -\t\t\t\t\t1000, 0.17\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t]\n> -\t\t    },\n> -\t\t    {\n> -\t\t\t\"base_ev\": 0.125,\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.3,\n> -\t\t\t\t\t1000, 0.3\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.3,\n> -\t\t\t\t\t1000, 0.3\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"shadows\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.0,\n> -\t\t\t\t    \"q_hi\": 0.5,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.17,\n> -\t\t\t\t\t1000, 0.17\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t]\n> -\t\t    },\n> -\t\t    {\n> -\t\t\t\"base_ev\": 1.5,\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.3,\n> -\t\t\t\t\t1000, 0.3\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.3,\n> -\t\t\t\t\t1000, 0.3\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"shadows\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.0,\n> -\t\t\t\t    \"q_hi\": 0.5,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.17,\n> -\t\t\t\t\t1000, 0.17\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t]\n> -\t\t    }\n> -\t\t]\n> -\t    }\n> +                \"channels\": [\n> +                    {\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.3,\n> +                                        1000, 0.3\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.3,\n> +                                        1000, 0.3\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"shadows\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.0,\n> +                                    \"q_hi\": 0.5,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.17,\n> +                                        1000, 0.17\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ]\n> +                    },\n> +                    {\n> +                        \"base_ev\": 0.125,\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.3,\n> +                                        1000, 0.3\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.3,\n> +                                        1000, 0.3\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"shadows\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.0,\n> +                                    \"q_hi\": 0.5,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.17,\n> +                                        1000, 0.17\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ]\n> +                    },\n> +                    {\n> +                        \"base_ev\": 1.5,\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.3,\n> +                                        1000, 0.3\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.3,\n> +                                        1000, 0.3\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"shadows\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.0,\n> +                                    \"q_hi\": 0.5,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.17,\n> +                                        1000, 0.17\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ]\n> +                    }\n> +                ]\n> +            }\n>          },\n>          {\n>              \"rpi.alsc\":\n> @@ -612,20 +638,19 @@\n>          {\n>              \"rpi.sharpen\": { }\n>          },\n> -\t{\n> -\t    \"rpi.hdr\":\n> -\t    {\n> -\t\t\"MultiExposure\":\n> -\t\t{\n> -\t\t    \"cadence\": [ 1, 2 ],\n> -\t\t    \"channel_map\": { \"short\": 1, \"long\": 2 }\n> -\t\t},\n> -\t\t\"SingleExposure\":\n> -\t\t{\n> -\t\t    \"cadence\": [ 1 ],\n> -\t\t    \"channel_map\": { \"short\": 1 }\n> -\t\t}\n> -\t    }\n> -\t}\n> +        {\n> +            \"rpi.hdr\":\n> +            {\n> +                \"MultiExposureUnmerged\":\n> +                {\n> +                    \"cadence\": [ 1, 2 ],\n> +                    \"channel_map\":\n> +                    {\n> +                        \"short\": 1,\n> +                        \"long\": 2\n> +                    }\n> +                }\n> +            }\n> +        }\n>      ]\n>  }\n> diff --git a/src/ipa/rpi/vc4/data/imx477_scientific.json b/src/ipa/rpi/vc4/data/imx477_scientific.json\n> index 26c692fdbab9..9dc32eb1525c 100644\n> --- a/src/ipa/rpi/vc4/data/imx477_scientific.json\n> +++ b/src/ipa/rpi/vc4/data/imx477_scientific.json\n> @@ -148,15 +148,24 @@\n>                  {\n>                      \"centre-weighted\":\n>                      {\n> -                        \"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> +                        \"weights\":\n> +                        [\n> +                            3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                        ]\n>                      },\n>                      \"spot\":\n>                      {\n> -                        \"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> +                        \"weights\":\n> +                        [\n> +                            2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                        ]\n>                      },\n>                      \"matrix\":\n>                      {\n> -                        \"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> +                        \"weights\":\n> +                        [\n> +                            1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                        ]\n>                      }\n>                  },\n>                  \"exposure_modes\":\n> diff --git a/src/ipa/rpi/vc4/data/imx477_v1.json b/src/ipa/rpi/vc4/data/imx477_v1.json\n> index d64020091efa..55e4adc1961d 100644\n> --- a/src/ipa/rpi/vc4/data/imx477_v1.json\n> +++ b/src/ipa/rpi/vc4/data/imx477_v1.json\n> @@ -138,15 +138,24 @@\n>                  {\n>                      \"centre-weighted\":\n>                      {\n> -                        \"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> +                        \"weights\":\n> +                        [\n> +                            3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                        ]\n>                      },\n>                      \"spot\":\n>                      {\n> -                        \"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> +                        \"weights\":\n> +                        [\n> +                            2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                        ]\n>                      },\n>                      \"matrix\":\n>                      {\n> -                        \"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> +                        \"weights\":\n> +                        [\n> +                            1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                        ]\n>                      }\n>                  },\n>                  \"exposure_modes\":\n> diff --git a/src/ipa/rpi/vc4/data/imx519.json b/src/ipa/rpi/vc4/data/imx519.json\n> index 1b0a77476aab..ce19425683a6 100644\n> --- a/src/ipa/rpi/vc4/data/imx519.json\n> +++ b/src/ipa/rpi/vc4/data/imx519.json\n> @@ -133,15 +133,24 @@\n>                  {\n>                      \"centre-weighted\":\n>                      {\n> -                        \"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> +                        \"weights\":\n> +                        [\n> +                            3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                        ]\n>                      },\n>                      \"spot\":\n>                      {\n> -                        \"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> +                        \"weights\":\n> +                        [\n> +                            2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                        ]\n>                      },\n>                      \"matrix\":\n>                      {\n> -                        \"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> +                        \"weights\":\n> +                        [\n> +                            1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                        ]\n>                      }\n>                  },\n>                  \"exposure_modes\":\n> diff --git a/src/ipa/rpi/vc4/data/imx708.json b/src/ipa/rpi/vc4/data/imx708.json\n> index 26aafc95c584..4de6f0796fd0 100644\n> --- a/src/ipa/rpi/vc4/data/imx708.json\n> +++ b/src/ipa/rpi/vc4/data/imx708.json\n> @@ -139,255 +139,281 @@\n>          {\n>              \"rpi.agc\":\n>              {\n> -\t\t\"channels\":\n> -\t\t[\n> -\t\t    {\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 15000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 1.0, 2.0, 4.0, 6.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 6.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 1000, 30000, 60000, 90000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.2,\n> -\t\t\t\t\t1000, 0.2\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.2,\n> -\t\t\t\t\t1000, 0.2\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t],\n> -\t\t\t\"startup_frames\": 5,\n> -\t\t\t\"convergence_frames\": 6,\n> -\t\t\t\"speed\": 0.15\n> -\t\t    },\n> -\t\t    {\n> -\t\t\t\"base_ev\": 0.125,\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 15000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 1.0, 2.0, 4.0, 6.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 6.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 1000, 30000, 60000, 90000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.2,\n> -\t\t\t\t\t1000, 0.2\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.2,\n> -\t\t\t\t\t1000, 0.2\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t],\n> -\t\t\t\"startup_frames\": 5,\n> -\t\t\t\"convergence_frames\": 6,\n> -\t\t\t\"speed\": 0.15\n> -\t\t    },\n> -\t\t    {\n> -\t\t\t\"base_ev\": 1.5,\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 15000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 1.0, 2.0, 4.0, 6.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 6.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 1000, 30000, 60000, 90000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.2,\n> -\t\t\t\t\t1000, 0.2\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.2,\n> -\t\t\t\t\t1000, 0.2\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t],\n> -\t\t\t\"startup_frames\": 5,\n> -\t\t\t\"convergence_frames\": 6,\n> -\t\t\t\"speed\": 0.15\n> -\t\t    }\n> -\t\t]\n> -\t    }\n> +                \"channels\": [\n> +                    {\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 15000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 1.0, 2.0, 4.0, 6.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 6.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 1000, 30000, 60000, 90000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.2,\n> +                                        1000, 0.2\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.2,\n> +                                        1000, 0.2\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ],\n> +                        \"startup_frames\": 5,\n> +                        \"convergence_frames\": 6,\n> +                        \"speed\": 0.15\n> +                    },\n> +                    {\n> +                        \"base_ev\": 0.125,\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 15000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 1.0, 2.0, 4.0, 6.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 6.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 1000, 30000, 60000, 90000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.2,\n> +                                        1000, 0.2\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.2,\n> +                                        1000, 0.2\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ],\n> +                        \"startup_frames\": 5,\n> +                        \"convergence_frames\": 6,\n> +                        \"speed\": 0.15\n> +                    },\n> +                    {\n> +                        \"base_ev\": 1.5,\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 15000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 1.0, 2.0, 4.0, 6.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 6.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 1000, 30000, 60000, 90000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.2,\n> +                                        1000, 0.2\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.2,\n> +                                        1000, 0.2\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ],\n> +                        \"startup_frames\": 5,\n> +                        \"convergence_frames\": 6,\n> +                        \"speed\": 0.15\n> +                    }\n> +                ]\n> +            }\n>          },\n>          {\n>              \"rpi.alsc\":\n> @@ -627,20 +653,19 @@\n>                  \"map\": [ 0.0, 445, 15.0, 925 ]\n>              }\n>          },\n> -\t{\n> -\t    \"rpi.hdr\":\n> -\t    {\n> -\t\t\"MultiExposure\":\n> -\t\t{\n> -\t\t    \"cadence\": [ 1, 2 ],\n> -\t\t    \"channel_map\": { \"short\": 1, \"long\": 2 }\n> -\t\t},\n> -\t\t\"SingleExposure\":\n> -\t\t{\n> -\t\t    \"cadence\": [ 1 ],\n> -\t\t    \"channel_map\": { \"short\": 1 }\n> -\t\t}\n> -\t    }\n> -\t}\n> +        {\n> +            \"rpi.hdr\":\n> +            {\n> +                \"MultiExposureUnmerged\":\n> +                {\n> +                    \"cadence\": [ 1, 2 ],\n> +                    \"channel_map\":\n> +                    {\n> +                        \"short\": 1,\n> +                        \"long\": 2\n> +                    }\n> +                }\n> +            }\n> +        }\n>      ]\n> -}\n> +}\n> \\ No newline at end of file\n> diff --git a/src/ipa/rpi/vc4/data/imx708_noir.json b/src/ipa/rpi/vc4/data/imx708_noir.json\n> index 8259ca4d0411..7b7ee874f66a 100644\n> --- a/src/ipa/rpi/vc4/data/imx708_noir.json\n> +++ b/src/ipa/rpi/vc4/data/imx708_noir.json\n> @@ -139,255 +139,281 @@\n>          {\n>              \"rpi.agc\":\n>              {\n> -\t\t\"channels\":\n> -\t\t[\n> -\t\t    {\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 15000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 1.0, 2.0, 4.0, 6.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 6.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 1000, 30000, 60000, 90000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.2,\n> -\t\t\t\t\t1000, 0.2\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.2,\n> -\t\t\t\t\t1000, 0.2\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t],\n> -\t\t\t\"startup_frames\": 5,\n> -\t\t\t\"convergence_frames\": 6,\n> -\t\t\t\"speed\": 0.15\n> -\t\t    },\n> -\t\t    {\n> -\t\t\t\"base_ev\": 0.125,\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 15000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 1.0, 2.0, 4.0, 6.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 6.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 1000, 30000, 60000, 90000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.2,\n> -\t\t\t\t\t1000, 0.2\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.2,\n> -\t\t\t\t\t1000, 0.2\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t],\n> -\t\t\t\"startup_frames\": 5,\n> -\t\t\t\"convergence_frames\": 6,\n> -\t\t\t\"speed\": 0.15\n> -\t\t    },\n> -\t\t    {\n> -\t\t\t\"base_ev\": 1.5,\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 15000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 1.0, 2.0, 4.0, 6.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 6.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 1000, 30000, 60000, 90000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.2,\n> -\t\t\t\t\t1000, 0.2\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.2,\n> -\t\t\t\t\t1000, 0.2\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t],\n> -\t\t\t\"startup_frames\": 5,\n> -\t\t\t\"convergence_frames\": 6,\n> -\t\t\t\"speed\": 0.15\n> -\t\t    }\n> -\t\t]\n> -\t    }\n> +                \"channels\": [\n> +                    {\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 15000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 1.0, 2.0, 4.0, 6.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 6.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 1000, 30000, 60000, 90000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.2,\n> +                                        1000, 0.2\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.2,\n> +                                        1000, 0.2\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ],\n> +                        \"startup_frames\": 5,\n> +                        \"convergence_frames\": 6,\n> +                        \"speed\": 0.15\n> +                    },\n> +                    {\n> +                        \"base_ev\": 0.125,\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 15000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 1.0, 2.0, 4.0, 6.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 6.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 1000, 30000, 60000, 90000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.2,\n> +                                        1000, 0.2\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.2,\n> +                                        1000, 0.2\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ],\n> +                        \"startup_frames\": 5,\n> +                        \"convergence_frames\": 6,\n> +                        \"speed\": 0.15\n> +                    },\n> +                    {\n> +                        \"base_ev\": 1.5,\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 15000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 1.0, 2.0, 4.0, 6.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 6.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 1000, 30000, 60000, 90000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.2,\n> +                                        1000, 0.2\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.2,\n> +                                        1000, 0.2\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ],\n> +                        \"startup_frames\": 5,\n> +                        \"convergence_frames\": 6,\n> +                        \"speed\": 0.15\n> +                    }\n> +                ]\n> +            }\n>          },\n>          {\n>              \"rpi.alsc\":\n> @@ -726,20 +752,19 @@\n>                  \"map\": [ 0.0, 445, 15.0, 925 ]\n>              }\n>          },\n> -\t{\n> -\t    \"rpi.hdr\":\n> -\t    {\n> -\t\t\"MultiExposure\":\n> -\t\t{\n> -\t\t    \"cadence\": [ 1, 2 ],\n> -\t\t    \"channel_map\": { \"short\": 1, \"long\": 2 }\n> -\t\t},\n> -\t\t\"SingleExposure\":\n> -\t\t{\n> -\t\t    \"cadence\": [ 1 ],\n> -\t\t    \"channel_map\": { \"short\": 1 }\n> -\t\t}\n> -\t    }\n> -\t}\n> +        {\n> +            \"rpi.hdr\":\n> +            {\n> +                \"MultiExposureUnmerged\":\n> +                {\n> +                    \"cadence\": [ 1, 2 ],\n> +                    \"channel_map\":\n> +                    {\n> +                        \"short\": 1,\n> +                        \"long\": 2\n> +                    }\n> +                }\n> +            }\n> +        }\n>      ]\n> -}\n> +}\n> \\ No newline at end of file\n> diff --git a/src/ipa/rpi/vc4/data/imx708_wide.json b/src/ipa/rpi/vc4/data/imx708_wide.json\n> index 0f846ea29393..6f45aafc0997 100644\n> --- a/src/ipa/rpi/vc4/data/imx708_wide.json\n> +++ b/src/ipa/rpi/vc4/data/imx708_wide.json\n> @@ -129,255 +129,281 @@\n>          {\n>              \"rpi.agc\":\n>              {\n> -\t\t\"channels\":\n> -\t\t[\n> -\t\t    {\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 15000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 1.0, 2.0, 4.0, 6.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 6.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 1000, 30000, 60000, 90000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.2,\n> -\t\t\t\t\t1000, 0.2\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.2,\n> -\t\t\t\t\t1000, 0.2\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t],\n> -\t\t\t\"startup_frames\": 5,\n> -\t\t\t\"convergence_frames\": 6,\n> -\t\t\t\"speed\": 0.15\n> -\t\t    },\n> -\t\t    {\n> -\t\t\t\"base_ev\": 0.125,\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 15000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 1.0, 2.0, 4.0, 6.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 6.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 1000, 30000, 60000, 90000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.2,\n> -\t\t\t\t\t1000, 0.2\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.2,\n> -\t\t\t\t\t1000, 0.2\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t],\n> -\t\t\t\"startup_frames\": 5,\n> -\t\t\t\"convergence_frames\": 6,\n> -\t\t\t\"speed\": 0.15\n> -\t\t    },\n> -\t\t    {\n> -\t\t\t\"base_ev\": 1.5,\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 15000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 1.0, 2.0, 4.0, 6.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 6.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 1000, 30000, 60000, 90000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.2,\n> -\t\t\t\t\t1000, 0.2\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.2,\n> -\t\t\t\t\t1000, 0.2\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t],\n> -\t\t\t\"startup_frames\": 5,\n> -\t\t\t\"convergence_frames\": 6,\n> -\t\t\t\"speed\": 0.15\n> -\t\t    }\n> -\t\t]\n> -\t    }\n> +                \"channels\": [\n> +                    {\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 15000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 1.0, 2.0, 4.0, 6.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 6.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 1000, 30000, 60000, 90000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.2,\n> +                                        1000, 0.2\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.2,\n> +                                        1000, 0.2\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ],\n> +                        \"startup_frames\": 5,\n> +                        \"convergence_frames\": 6,\n> +                        \"speed\": 0.15\n> +                    },\n> +                    {\n> +                        \"base_ev\": 0.125,\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 15000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 1.0, 2.0, 4.0, 6.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 6.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 1000, 30000, 60000, 90000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.2,\n> +                                        1000, 0.2\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.2,\n> +                                        1000, 0.2\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ],\n> +                        \"startup_frames\": 5,\n> +                        \"convergence_frames\": 6,\n> +                        \"speed\": 0.15\n> +                    },\n> +                    {\n> +                        \"base_ev\": 1.5,\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 15000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 1.0, 2.0, 4.0, 6.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 6.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 1000, 30000, 60000, 90000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.2,\n> +                                        1000, 0.2\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.2,\n> +                                        1000, 0.2\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ],\n> +                        \"startup_frames\": 5,\n> +                        \"convergence_frames\": 6,\n> +                        \"speed\": 0.15\n> +                    }\n> +                ]\n> +            }\n>          },\n>          {\n>              \"rpi.alsc\":\n> @@ -638,20 +664,19 @@\n>                  \"map\": [ 0.0, 420, 35.0, 920 ]\n>              }\n>          },\n> -\t{\n> -\t    \"rpi.hdr\":\n> -\t    {\n> -\t\t\"MultiExposure\":\n> -\t\t{\n> -\t\t    \"cadence\": [ 1, 2 ],\n> -\t\t    \"channel_map\": { \"short\": 1, \"long\": 2 }\n> -\t\t},\n> -\t\t\"SingleExposure\":\n> -\t\t{\n> -\t\t    \"cadence\": [ 1 ],\n> -\t\t    \"channel_map\": { \"short\": 1 }\n> -\t\t}\n> -\t    }\n> -\t}\n> +        {\n> +            \"rpi.hdr\":\n> +            {\n> +                \"MultiExposureUnmerged\":\n> +                {\n> +                    \"cadence\": [ 1, 2 ],\n> +                    \"channel_map\":\n> +                    {\n> +                        \"short\": 1,\n> +                        \"long\": 2\n> +                    }\n> +                }\n> +            }\n> +        }\n>      ]\n> -}\n> +}\n> \\ No newline at end of file\n> diff --git a/src/ipa/rpi/vc4/data/imx708_wide_noir.json b/src/ipa/rpi/vc4/data/imx708_wide_noir.json\n> index f12ddbb61fcd..b9a5227e1acc 100644\n> --- a/src/ipa/rpi/vc4/data/imx708_wide_noir.json\n> +++ b/src/ipa/rpi/vc4/data/imx708_wide_noir.json\n> @@ -129,255 +129,281 @@\n>          {\n>              \"rpi.agc\":\n>              {\n> -\t\t\"channels\":\n> -\t\t[\n> -\t\t    {\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 15000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 1.0, 2.0, 4.0, 6.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 6.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 1000, 30000, 60000, 90000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.2,\n> -\t\t\t\t\t1000, 0.2\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.2,\n> -\t\t\t\t\t1000, 0.2\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t],\n> -\t\t\t\"startup_frames\": 5,\n> -\t\t\t\"convergence_frames\": 6,\n> -\t\t\t\"speed\": 0.15\n> -\t\t    },\n> -\t\t    {\n> -\t\t\t\"base_ev\": 0.125,\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 15000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 1.0, 2.0, 4.0, 6.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 6.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 1000, 30000, 60000, 90000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.2,\n> -\t\t\t\t\t1000, 0.2\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.2,\n> -\t\t\t\t\t1000, 0.2\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t],\n> -\t\t\t\"startup_frames\": 5,\n> -\t\t\t\"convergence_frames\": 6,\n> -\t\t\t\"speed\": 0.15\n> -\t\t    },\n> -\t\t    {\n> -\t\t\t\"base_ev\": 1.5,\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 15000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 1.0, 2.0, 4.0, 6.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 6.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 1000, 30000, 60000, 90000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.2,\n> -\t\t\t\t\t1000, 0.2\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.2,\n> -\t\t\t\t\t1000, 0.2\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t],\n> -\t\t\t\"startup_frames\": 5,\n> -\t\t\t\"convergence_frames\": 6,\n> -\t\t\t\"speed\": 0.15\n> -\t\t    }\n> -\t\t]\n> -\t    }\n> +                \"channels\": [\n> +                    {\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 15000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 1.0, 2.0, 4.0, 6.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 6.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 1000, 30000, 60000, 90000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.2,\n> +                                        1000, 0.2\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.2,\n> +                                        1000, 0.2\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ],\n> +                        \"startup_frames\": 5,\n> +                        \"convergence_frames\": 6,\n> +                        \"speed\": 0.15\n> +                    },\n> +                    {\n> +                        \"base_ev\": 0.125,\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 15000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 1.0, 2.0, 4.0, 6.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 6.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 1000, 30000, 60000, 90000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.2,\n> +                                        1000, 0.2\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.2,\n> +                                        1000, 0.2\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ],\n> +                        \"startup_frames\": 5,\n> +                        \"convergence_frames\": 6,\n> +                        \"speed\": 0.15\n> +                    },\n> +                    {\n> +                        \"base_ev\": 1.5,\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 15000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 1.0, 2.0, 4.0, 6.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 6.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 1000, 30000, 60000, 90000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.2,\n> +                                        1000, 0.2\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.2,\n> +                                        1000, 0.2\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ],\n> +                        \"startup_frames\": 5,\n> +                        \"convergence_frames\": 6,\n> +                        \"speed\": 0.15\n> +                    }\n> +                ]\n> +            }\n>          },\n>          {\n>              \"rpi.alsc\":\n> @@ -629,20 +655,19 @@\n>                  \"map\": [ 0.0, 420, 35.0, 920 ]\n>              }\n>          },\n> -\t{\n> -\t    \"rpi.hdr\":\n> -\t    {\n> -\t\t\"MultiExposure\":\n> -\t\t{\n> -\t\t    \"cadence\": [ 1, 2 ],\n> -\t\t    \"channel_map\": { \"short\": 1, \"long\": 2 }\n> -\t\t},\n> -\t\t\"SingleExposure\":\n> -\t\t{\n> -\t\t    \"cadence\": [ 1 ],\n> -\t\t    \"channel_map\": { \"short\": 1 }\n> -\t\t}\n> -\t    }\n> -\t}\n> +        {\n> +            \"rpi.hdr\":\n> +            {\n> +                \"MultiExposureUnmerged\":\n> +                {\n> +                    \"cadence\": [ 1, 2 ],\n> +                    \"channel_map\":\n> +                    {\n> +                        \"short\": 1,\n> +                        \"long\": 2\n> +                    }\n> +                }\n> +            }\n> +        }\n>      ]\n> -}\n> +}\n> \\ No newline at end of file\n> diff --git a/src/ipa/rpi/vc4/data/ov5647.json b/src/ipa/rpi/vc4/data/ov5647.json\n> index 4def9ffc2dcb..40c6059c862b 100644\n> --- a/src/ipa/rpi/vc4/data/ov5647.json\n> +++ b/src/ipa/rpi/vc4/data/ov5647.json\n> @@ -131,285 +131,309 @@\n>          {\n>              \"rpi.agc\":\n>              {\n> -\t\t\"channels\":\n> -\t\t[\n> -\t\t    {\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.5,\n> -\t\t\t\t\t1000, 0.5\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.5,\n> -\t\t\t\t\t1000, 0.5\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"shadows\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.0,\n> -\t\t\t\t    \"q_hi\": 0.5,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.17,\n> -\t\t\t\t\t1000, 0.17\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t],\n> -\t\t\t\"base_ev\": 1.25\n> -\t\t    },\n> -\t\t    {\n> -\t\t\t\"base_ev\": 0.125,\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.5,\n> -\t\t\t\t\t1000, 0.5\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.5,\n> -\t\t\t\t\t1000, 0.5\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"shadows\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.0,\n> -\t\t\t\t    \"q_hi\": 0.5,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.17,\n> -\t\t\t\t\t1000, 0.17\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t],\n> -\t\t\t\"base_ev\": 1.25\n> -\t\t    },\n> -\t\t    {\n> -\t\t\t\"base_ev\": 1.5,\n> -\t\t\t\"metering_modes\":\n> -\t\t\t{\n> -\t\t\t    \"centre-weighted\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"spot\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> -\t\t\t    },\n> -\t\t\t    \"matrix\":\n> -\t\t\t    {\n> -\t\t\t\t\"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"exposure_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"short\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> -\t\t\t    },\n> -\t\t\t    \"long\":\n> -\t\t\t    {\n> -\t\t\t\t\"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> -\t\t\t\t\"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> -\t\t\t    }\n> -\t\t\t},\n> -\t\t\t\"constraint_modes\":\n> -\t\t\t{\n> -\t\t\t    \"normal\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.5,\n> -\t\t\t\t\t1000, 0.5\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"highlight\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.5,\n> -\t\t\t\t\t1000, 0.5\n> -\t\t\t\t    ]\n> -\t\t\t\t},\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"UPPER\",\n> -\t\t\t\t    \"q_lo\": 0.98,\n> -\t\t\t\t    \"q_hi\": 1.0,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.8,\n> -\t\t\t\t\t1000, 0.8\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ],\n> -\t\t\t    \"shadows\": [\n> -\t\t\t\t{\n> -\t\t\t\t    \"bound\": \"LOWER\",\n> -\t\t\t\t    \"q_lo\": 0.0,\n> -\t\t\t\t    \"q_hi\": 0.5,\n> -\t\t\t\t    \"y_target\":\n> -\t\t\t\t    [\n> -\t\t\t\t\t0, 0.17,\n> -\t\t\t\t\t1000, 0.17\n> -\t\t\t\t    ]\n> -\t\t\t\t}\n> -\t\t\t    ]\n> -\t\t\t},\n> -\t\t\t\"y_target\":\n> -\t\t\t[\n> -\t\t\t    0, 0.16,\n> -\t\t\t    1000, 0.165,\n> -\t\t\t    10000, 0.17\n> -\t\t\t],\n> -\t\t\t\"base_ev\": 1.25\n> -\t\t    }\n> -\t\t]\n> -\t    }\n> +                \"channels\": [\n> +                    {\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.5,\n> +                                        1000, 0.5\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.5,\n> +                                        1000, 0.5\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"shadows\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.0,\n> +                                    \"q_hi\": 0.5,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.17,\n> +                                        1000, 0.17\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ],\n> +                        \"base_ev\": 1.25\n> +                    },\n> +                    {\n> +                        \"base_ev\": 1.25,\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.5,\n> +                                        1000, 0.5\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.5,\n> +                                        1000, 0.5\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"shadows\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.0,\n> +                                    \"q_hi\": 0.5,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.17,\n> +                                        1000, 0.17\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ]\n> +                    },\n> +                    {\n> +                        \"base_ev\": 1.25,\n> +                        \"metering_modes\":\n> +                        {\n> +                            \"centre-weighted\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"spot\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                                ]\n> +                            },\n> +                            \"matrix\":\n> +                            {\n> +                                \"weights\":\n> +                                [\n> +                                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                                ]\n> +                            }\n> +                        },\n> +                        \"exposure_modes\":\n> +                        {\n> +                            \"normal\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 66666 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"short\":\n> +                            {\n> +                                \"shutter\": [ 100, 5000, 10000, 20000, 33333 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 8.0 ]\n> +                            },\n> +                            \"long\":\n> +                            {\n> +                                \"shutter\": [ 100, 10000, 30000, 60000, 120000 ],\n> +                                \"gain\": [ 1.0, 2.0, 4.0, 6.0, 12.0 ]\n> +                            }\n> +                        },\n> +                        \"constraint_modes\":\n> +                        {\n> +                            \"normal\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.5,\n> +                                        1000, 0.5\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"highlight\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.5,\n> +                                        1000, 0.5\n> +                                    ]\n> +                                },\n> +                                {\n> +                                    \"bound\": \"UPPER\",\n> +                                    \"q_lo\": 0.98,\n> +                                    \"q_hi\": 1.0,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.8,\n> +                                        1000, 0.8\n> +                                    ]\n> +                                }\n> +                            ],\n> +                            \"shadows\": [\n> +                                {\n> +                                    \"bound\": \"LOWER\",\n> +                                    \"q_lo\": 0.0,\n> +                                    \"q_hi\": 0.5,\n> +                                    \"y_target\":\n> +                                    [\n> +                                        0, 0.17,\n> +                                        1000, 0.17\n> +                                    ]\n> +                                }\n> +                            ]\n> +                        },\n> +                        \"y_target\":\n> +                        [\n> +                            0, 0.16,\n> +                            1000, 0.165,\n> +                            10000, 0.17\n> +                        ]\n> +                    }\n> +                ]\n> +            }\n>          },\n>          {\n>              \"rpi.alsc\":\n> @@ -654,20 +678,19 @@\n>          {\n>              \"rpi.sharpen\": { }\n>          },\n> -\t{\n> -\t    \"rpi.hdr\":\n> -\t    {\n> -\t\t\"MultiExposure\":\n> -\t\t{\n> -\t\t    \"cadence\": [ 1, 2 ],\n> -\t\t    \"channel_map\": { \"short\": 1, \"long\": 2 }\n> -\t\t},\n> -\t\t\"SingleExposure\":\n> -\t\t{\n> -\t\t    \"cadence\": [ 1 ],\n> -\t\t    \"channel_map\": { \"short\": 1 }\n> -\t\t}\n> -\t    }\n> -\t}\n> +        {\n> +            \"rpi.hdr\":\n> +            {\n> +                \"MultiExposureUnmerged\":\n> +                {\n> +                    \"cadence\": [ 1, 2 ],\n> +                    \"channel_map\":\n> +                    {\n> +                        \"short\": 1,\n> +                        \"long\": 2\n> +                    }\n> +                }\n> +            }\n> +        }\n>      ]\n>  }\n> diff --git a/src/ipa/rpi/vc4/data/ov5647_noir.json b/src/ipa/rpi/vc4/data/ov5647_noir.json\n> index a6c6722f12a6..488b7119b17c 100644\n> --- a/src/ipa/rpi/vc4/data/ov5647_noir.json\n> +++ b/src/ipa/rpi/vc4/data/ov5647_noir.json\n> @@ -51,15 +51,24 @@\n>                  {\n>                      \"centre-weighted\":\n>                      {\n> -                        \"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> +                        \"weights\":\n> +                        [\n> +                            3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                        ]\n>                      },\n>                      \"spot\":\n>                      {\n> -                        \"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> +                        \"weights\":\n> +                        [\n> +                            2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                        ]\n>                      },\n>                      \"matrix\":\n>                      {\n> -                        \"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> +                        \"weights\":\n> +                        [\n> +                            1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                        ]\n>                      }\n>                  },\n>                  \"exposure_modes\":\n> diff --git a/src/ipa/rpi/vc4/data/ov9281_mono.json b/src/ipa/rpi/vc4/data/ov9281_mono.json\n> index 2b7292ec7e20..a9d05a01b53f 100644\n> --- a/src/ipa/rpi/vc4/data/ov9281_mono.json\n> +++ b/src/ipa/rpi/vc4/data/ov9281_mono.json\n> @@ -35,7 +35,10 @@\n>                  {\n>                      \"centre-weighted\":\n>                      {\n> -                        \"weights\": [ 4, 4, 4, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> +                        \"weights\":\n> +                        [\n> +                            4, 4, 4, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                        ]\n>                      }\n>                  },\n>                  \"exposure_modes\":\n> diff --git a/src/ipa/rpi/vc4/data/se327m12.json b/src/ipa/rpi/vc4/data/se327m12.json\n> index 8552ed92bce6..948169db2419 100644\n> --- a/src/ipa/rpi/vc4/data/se327m12.json\n> +++ b/src/ipa/rpi/vc4/data/se327m12.json\n> @@ -133,15 +133,24 @@\n>                  {\n>                      \"centre-weighted\":\n>                      {\n> -                        \"weights\": [ 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> +                        \"weights\":\n> +                        [\n> +                            3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                        ]\n>                      },\n>                      \"spot\":\n>                      {\n> -                        \"weights\": [ 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]\n> +                        \"weights\":\n> +                        [\n> +                            2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n> +                        ]\n>                      },\n>                      \"matrix\":\n>                      {\n> -                        \"weights\": [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]\n> +                        \"weights\":\n> +                        [\n> +                            1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n> +                        ]\n>                      }\n>                  },\n>                  \"exposure_modes\":\n> diff --git a/src/ipa/rpi/vc4/data/uncalibrated.json b/src/ipa/rpi/vc4/data/uncalibrated.json\n> index 7654defa6dfe..cdc56b323c2e 100644\n> --- a/src/ipa/rpi/vc4/data/uncalibrated.json\n> +++ b/src/ipa/rpi/vc4/data/uncalibrated.json\n> @@ -22,7 +22,10 @@\n>                  {\n>                      \"centre-weighted\":\n>                      {\n> -                        \"weights\": [ 4, 4, 4, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0 ]\n> +                        \"weights\":\n> +                        [\n> +                            4, 4, 4, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n> +                        ]\n>                      }\n>                  },\n>                  \"exposure_modes\":\n> --\n> 2.34.1\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 55C69C3220\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  2 May 2024 12:13:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 04E3563418;\n\tThu,  2 May 2024 14:13:54 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 548A2633EB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  2 May 2024 12:03:28 +0200 (CEST)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7329D3A3;\n\tThu,  2 May 2024 12:02:30 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"EAEyE2mG\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1714644150;\n\tbh=wTcwMTyuXEBekd4sMQ/KgDN6zDPYoGaUTtzqFjWRdtk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=EAEyE2mGvbJiRmGnWCIIm5OoDk0ALAAxe65Zvo0FBUjlxZyClAfS94WkHfMJ6l24G\n\tMHIJuYS4AzQkgR7/cOsWxvC9/K+NLyJX/pez5gcfTRO/77o4v41bk5TQTlEsKX4lfS\n\toIlz+29g1LofrCwy1OS9Jb06Aj0iL2YhsxJshaag=","Date":"Thu, 2 May 2024 12:03:24 +0200","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org, \n\tDavid Plowman <david.plowman@raspberrypi.com>","Subject":"Re: [PATCH v1 3/5] ipa: rpi: Add HDR support","Message-ID":"<crqd6gfkbzxdu4z5atephr4yrshegdpvn35aycyo6oiwld6rsg@osp3vlvvdk2o>","References":"<20240502080925.31730-1-naush@raspberrypi.com>\n\t<20240502080925.31730-4-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240502080925.31730-4-naush@raspberrypi.com>","X-Mailman-Approved-At":"Thu, 02 May 2024 14:13:52 +0200","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]