[x265] [PATCH 4 of 5] predict: move 4:4:4 chroma sample filtering into initAdiPatternChroma()

Steve Borho steve at borho.org
Fri Feb 27 21:05:20 CET 2015


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1425065607 21600
#      Fri Feb 27 13:33:27 2015 -0600
# Node ID 184bb358472e8fc5e904dff5965aba7ecdfe7680
# Parent  4c25a661122b0df50bcf6fb3996bf0cc0bc213b9
predict: move 4:4:4 chroma sample filtering into initAdiPatternChroma()

diff -r 4c25a661122b -r 184bb358472e source/common/predict.cpp
--- a/source/common/predict.cpp	Fri Feb 27 13:27:40 2015 -0600
+++ b/source/common/predict.cpp	Fri Feb 27 13:33:27 2015 -0600
@@ -582,11 +582,11 @@
 
 void Predict::predIntraLumaAng(uint32_t dirMode, pixel* dst, intptr_t stride, uint32_t log2TrSize)
 {
+    int tuSize = 1 << log2TrSize;
     int sizeIdx = log2TrSize - 2;
-    int tuSize = 1 << log2TrSize;
-    int filter = !!(g_intraFilterFlags[dirMode] & tuSize);
     X265_CHECK(sizeIdx >= 0 && sizeIdx < 4, "intra block size is out of range\n");
 
+    int filter = !!(g_intraFilterFlags[dirMode] & tuSize);
     bool bFilter = log2TrSize <= 4;
     primitives.cu[sizeIdx].intra_pred[dirMode](dst, stride, intraNeighbourBuf[filter], dirMode, bFilter);
 }
@@ -597,15 +597,8 @@
     int sizeIdx = log2TrSizeC - 2;
     X265_CHECK(sizeIdx >= 0 && sizeIdx < 4, "intra block size is out of range\n");
 
-    pixel* srcBuf = intraNeighbourBuf[0];
-
-    if (chFmt == X265_CSP_I444 && (g_intraFilterFlags[dirMode] & tuSize))
-    {
-        primitives.cu[sizeIdx].intra_filter(intraNeighbourBuf[0], intraNeighbourBuf[1]);
-        srcBuf = intraNeighbourBuf[1];
-    }
-
-    primitives.cu[sizeIdx].intra_pred[dirMode](dst, stride, srcBuf, dirMode, 0);
+    int filter = !!(chFmt == X265_CSP_I444 && (g_intraFilterFlags[dirMode] & tuSize));
+    primitives.cu[sizeIdx].intra_pred[dirMode](dst, stride, intraNeighbourBuf[filter], dirMode, 0);
 }
 
 void Predict::initAdiPattern(const CUData& cu, const CUGeom& cuGeom, uint32_t puAbsPartIdx, const IntraNeighbors& intraNeighbors, int dirMode)
@@ -665,6 +658,9 @@
     intptr_t picStride = cu.m_encData->m_reconPic->m_strideC;
 
     fillReferenceSamples(adiOrigin, picStride, intraNeighbors, intraNeighbourBuf[0]);
+
+    if (m_csp == X265_CSP_I444)
+        primitives.cu[intraNeighbors.log2TrSize - 2].intra_filter(intraNeighbourBuf[0], intraNeighbourBuf[1]);
 }
 
 void Predict::initIntraNeighbors(const CUData& cu, uint32_t absPartIdx, uint32_t tuDepth, bool isLuma, IntraNeighbors *intraNeighbors)


More information about the x265-devel mailing list