[x265] [PATCH 1 of 2] intra prediction: disable 64x64 analysis

chen chenm003 at 163.com
Tue Nov 17 16:16:29 CET 2015


In the HM, the Intra 64x64 will split into 4 of 32x32, it save mode bits.
disable 64x64 improve visual quality but drop compress performance

At 2015-11-17 17:56:31,deepthi at multicorewareinc.com wrote:
># HG changeset patch
># User Deepthi Nandakumar <deepthi at multicorewareinc.com>
># Date 1447661563 -19800
>#      Mon Nov 16 13:42:43 2015 +0530
># Node ID 409424e8b1bd19a5e70236d364ca8cb7e03b5274
># Parent  8cf2d6892443027bf04ade1965e12099decf608e
>intra prediction: disable 64x64 analysis
>
>In intra CUs, the predictions are applied for each TU sequentially (and not at the
>PU level). This patch turns off all 64x64 intra analysis/modes - to analyse which,
>previously, x265 averaged a 64x64 block to 32x32 and then did a prediction search
>on this averaged block. This is a bad idea for visual quality, and instead x265
>will perform 32x32 predictions sequentially.
>
>diff -r 8cf2d6892443 -r 409424e8b1bd source/encoder/analysis.cpp
>--- a/source/encoder/analysis.cpp	Fri Oct 23 19:50:49 2015 +0530
>+++ b/source/encoder/analysis.cpp	Mon Nov 16 13:42:43 2015 +0530
>@@ -259,7 +259,7 @@
>                 addSplitFlagCost(*md.bestMode, cuGeom.depth);
>         }
>     }
>-    else if (mightNotSplit)
>+    else if (cuGeom.log2CUSize != MAX_LOG2_CU_SIZE && mightNotSplit)
>     {
>         md.pred[PRED_INTRA].cu.initSubCU(parentCTU, cuGeom, qp);
>         checkIntra(md.pred[PRED_INTRA], cuGeom, SIZE_2Nx2N);
>@@ -614,7 +614,7 @@
>     if (mightNotSplit && depth >= minDepth)
>     {
>         int bTryAmp = m_slice->m_sps->maxAMPDepth > depth;
>-        int bTryIntra = (m_slice->m_sliceType != B_SLICE || m_param->bIntraInBFrames) && (!m_param->limitReferences || splitIntra);
>+        int bTryIntra = (m_slice->m_sliceType != B_SLICE || m_param->bIntraInBFrames) && (!m_param->limitReferences || splitIntra) && (cuGeom.log2CUSize != MAX_LOG2_CU_SIZE);
> 
>         if (m_slice->m_pps->bUseDQP && depth <= m_slice->m_pps->maxCuDQPDepth && m_slice->m_pps->maxCuDQPDepth != 0)
>             setLambdaFromQP(parentCTU, qp);
>@@ -1090,7 +1090,7 @@
>                     }
>                 }
>             }
>-            bool bTryIntra = m_slice->m_sliceType != B_SLICE || m_param->bIntraInBFrames;
>+            bool bTryIntra = (m_slice->m_sliceType != B_SLICE || m_param->bIntraInBFrames) && cuGeom.log2CUSize != MAX_LOG2_CU_SIZE;
>             if (m_param->rdLevel >= 3)
>             {
>                 /* Calculate RD cost of best inter option */
>@@ -1570,7 +1570,7 @@
>                 }
>             }
> 
>-            if (m_slice->m_sliceType != B_SLICE || m_param->bIntraInBFrames)
>+            if ((m_slice->m_sliceType != B_SLICE || m_param->bIntraInBFrames) && cuGeom.log2CUSize != MAX_LOG2_CU_SIZE)
>             {
>                 if (!m_param->limitReferences || splitIntra)
>                 {
>diff -r 8cf2d6892443 -r 409424e8b1bd source/encoder/search.cpp
>--- a/source/encoder/search.cpp	Fri Oct 23 19:50:49 2015 +0530
>+++ b/source/encoder/search.cpp	Mon Nov 16 13:42:43 2015 +0530
>@@ -1468,25 +1468,6 @@
>                 int scaleStride = stride;
>                 int costShift = 0;
> 
>-                if (tuSize > 32)
>-                {
>-                    // origin is 64x64, we scale to 32x32 and setup required parameters
>-                    primitives.scale2D_64to32(m_fencScaled, fenc, stride);
>-                    fenc = m_fencScaled;
>-
>-                    pixel nScale[129];
>-                    intraNeighbourBuf[1][0] = intraNeighbourBuf[0][0];
>-                    primitives.scale1D_128to64(nScale + 1, intraNeighbourBuf[0] + 1);
>-
>-                    memcpy(&intraNeighbourBuf[0][1], &nScale[1], 2 * 64 * sizeof(pixel));
>-                    memcpy(&intraNeighbourBuf[1][1], &nScale[1], 2 * 64 * sizeof(pixel));
>-
>-                    scaleTuSize = 32;
>-                    scaleStride = 32;
>-                    costShift = 2;
>-                    sizeIdx = 5 - 2; // log2(scaleTuSize) - 2
>-                }
>-
>                 m_entropyCoder.loadIntraDirModeLuma(m_rqt[depth].cur);
> 
>                 /* there are three cost tiers for intra modes:
>_______________________________________________
>x265-devel mailing list
>x265-devel at videolan.org
>https://mailman.videolan.org/listinfo/x265-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20151117/f9cdc827/attachment.html>


More information about the x265-devel mailing list