From ea8b761899ecf91cbd4f8b83e85d8444b1b94c80 Mon Sep 17 00:00:00 2001 From: Xiujun Wang Date: Wed, 23 Sep 2026 13:29:45 +0800 Subject: [PATCH] sao: use the Cr SAO type when filtering the Cr plane generateChromaOffsets() passes the Cb SAO type to applyPixelOffsets() while processing the Cr plane. HEVC shares the chroma SAO type between Cb and Cr, and x265 sets both values identically, so this does not change the output. Pass the already-computed Cr SAO type for plane 2 to make the argument match the plane being processed and avoid relying on that invariant. --- source/encoder/sao.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/encoder/sao.cpp b/source/encoder/sao.cpp index 63acd48af..7d4bc957a 100644 --- a/source/encoder/sao.cpp +++ b/source/encoder/sao.cpp @@ -718,7 +718,7 @@ void SAO::generateChromaOffsets(SaoCtuParam* ctuParam[3], int idxY, int idxX) m_offsetEo[2][edgeType] = (int8_t)offset[s_eoTable[edgeType]]; } } - applyPixelOffsets(addr, typeIdxCb, 2); + applyPixelOffsets(addr, typeIdxCr, 2); } std::swap(m_tmpL1[1], m_tmpL2[1]);