Revert "feat: detail-adaptive Sabre rejection"

This reverts commit f64681a651.
This commit is contained in:
zhoubinjia committed 2026-09-20 16:56:11 +08:00
1 parent 2920908585
commit 11a17f48a6
5 files changed
+45 -279

No files matched your search

@@ -408,26 +408,7 @@ internal object GlesMgcRawSabreShaders {
motionPrior) {
robustnessBoost = uExtraMotionRobustnessBoost;
}
// Keep the symmetric V25 bicubic guides: an identical texture must not reject
// itself. Tighten only the measured-structure allowance, not the noise floor or
// the color-difference thresholds shared with Spatial/YUV. All values here have
// already been converted from guide alpha and scaled for the bicubic filter.
float detailNoise = greenOnly
? max(referenceNoise.y, currentNoise.y)
: max(
dot(referenceNoise, vec3(1.0 / 3.0)),
dot(currentNoise, vec3(1.0 / 3.0))
);
float detailConfidence = smoothstep(
${MgcSabreRejectionTuning.SABRE_DETAIL_VARIANCE_RATIO_START} * detailNoise,
${MgcSabreRejectionTuning.SABRE_DETAIL_VARIANCE_RATIO_END} * detailNoise,
pixelVariance
);
pixelVariance *= mix(
2.0,
${MgcSabreRejectionTuning.SABRE_DETAIL_VARIANCE_SCALE},
detailConfidence
);
pixelVariance *= 2.0;
vec3 combinedNoise = referenceNoise + currentNoise;
vec3 difference = current.rgb - reference.rgb;
vec3 differenceSquared = max(
@@ -2224,9 +2224,6 @@ internal class GlesMgcRawSpatialStacker(
"forceReferenceColorRgb=${sabreKernelParameters.forceReferenceColorRgb} " +
"mergeGradientThreshold=${PhotonCoreImagingTuning.fusion.mergeGradientThreshold ?: "adaptive"} " +
"guideColorSpace=sqrt noiseLut=qmc64x10 rejectionGuideFilter=bicubic-both-frames " +
"detailVarianceScale=${MgcSabreRejectionTuning.SABRE_DETAIL_VARIANCE_SCALE} " +
"detailVarianceNoiseRatio=${MgcSabreRejectionTuning.SABRE_DETAIL_VARIANCE_RATIO_START}.." +
"${MgcSabreRejectionTuning.SABRE_DETAIL_VARIANCE_RATIO_END} " +
"alignmentInputGain=${referenceCalibration.alignmentGain} " +
"alignmentDomain=signed-s16",
)
@@ -1,6 +1,6 @@
package com.hinnka.mycamera.processor
/** MGC V25 rejection defaults, resolution scaling, and Photon Classic-Sabre detail tuning. */
/** MGC 9.7.047 V25 Sabre/Spatial rejection defaults and runtime resolution scaling. */
internal object MgcSabreRejectionTuning {
data class FlowVariationThresholds(
val unblockerReduction: Float,
@@ -12,17 +12,6 @@ internal object MgcSabreRejectionTuning {
const val EXTRA_MOTION_ROBUSTNESS_BOOST = 6f
const val MOTION_ROBUSTNESS_VARIANCE_THRESHOLD = 25f
/**
* Photon Classic-Sabre tuning, not shared with Spatial/YUV rejection. Keep V25's measured
* variance allowance near the noise floor, then tighten it only when BOTH guides contain
* structure well above BOTH noise estimates. The bicubic comparison and noise floor remain
* unchanged; this reduces admission of residual misalignment without restoring asymmetric
* guide filtering. Ratios refer to variance, not amplitude SNR.
*/
const val SABRE_DETAIL_VARIANCE_RATIO_START = 8f
const val SABRE_DETAIL_VARIANCE_RATIO_END = 32f
const val SABRE_DETAIL_VARIANCE_SCALE = 1.25f
private const val REFERENCE_GUIDE_WIDTH = 2016f
private const val BASE_FLOW_VARIATION_THRESHOLD = 1e-4f
/**