From 77c69b3e1b43ba407fadc22e0b64121f1bfb631b Mon Sep 17 00:00:00 2001 From: zhoubinjia Date: Tue, 1 Sep 2026 12:35:16 +0800 Subject: [PATCH] fix: denoise error --- .../mgc_full_resolution_denoise_jni.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/main/cpp/mgc_denoise_static/mgc_full_resolution_denoise_jni.cpp b/app/src/main/cpp/mgc_denoise_static/mgc_full_resolution_denoise_jni.cpp index 8cfa87f2..2af184aa 100644 --- a/app/src/main/cpp/mgc_denoise_static/mgc_full_resolution_denoise_jni.cpp +++ b/app/src/main/cpp/mgc_denoise_static/mgc_full_resolution_denoise_jni.cpp @@ -1126,6 +1126,15 @@ Java_com_hinnka_mycamera_raw_MgcFullResolutionDenoise_nativeDenoiseRgba16f( return LogStageFailure("pecan_luma", pecan_result); } pecan_ms = elapsed_ms(pecan_start); + } else { + // ChromaDenoise owns only the Cb/Cr planes. The original MGC pipeline always + // follows it with Pecan, which supplies Y in the shared destination buffer. + // When Photon independently disables luma denoise, preserve the unfiltered Y + // emitted by RawToYuv before handing the completed three-plane image to YuvToRgb. + std::copy_n( + planar_b.get(), + pixel_count, + planar_a.get()); } if (run_diagnostics) {