[x265] [PATCH V2] pps: simplify deblocking signaling, disable slice override

Steve Borho steve at borho.org
Thu Jul 17 19:48:57 CEST 2014


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1405619325 18000
#      Thu Jul 17 12:48:45 2014 -0500
# Node ID 3e4616cffc90acc9ca076b9df76bd09570cb32f2
# Parent  6d0c8efbe3ed26cf80446cba6d56fbd9f5a2d957
pps: simplify deblocking signaling, disable slice override

Disable slice override of deblock-enable state and offsets - we do no such thing
and attempts at using these in the past have not been effective.

diff -r 6d0c8efbe3ed -r 3e4616cffc90 source/Lib/TLibCommon/TComSlice.h
--- a/source/Lib/TLibCommon/TComSlice.h	Thu Jul 17 02:38:35 2014 -0500
+++ b/source/Lib/TLibCommon/TComSlice.h	Thu Jul 17 12:48:45 2014 -0500
@@ -273,7 +273,6 @@
     uint32_t encCABACTableIdx;          // Used to transmit table selection across slices
 
     bool     bDeblockingFilterControlPresent;
-    bool     bDeblockingFilterOverrideEnabled;
     bool     bPicDisableDeblockingFilter;
     int      deblockingFilterBetaOffsetDiv2;
     int      deblockingFilterTcOffsetDiv2;
diff -r 6d0c8efbe3ed -r 3e4616cffc90 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Thu Jul 17 02:38:35 2014 -0500
+++ b/source/encoder/encoder.cpp	Thu Jul 17 12:48:45 2014 -0500
@@ -1206,15 +1206,13 @@
     pps->bTransformSkipEnabled = m_param->bEnableTransformSkip;
     pps->bSignHideEnabled = m_param->bEnableSignHiding;
 
-    m_loopFilterOffsetInPPS = 0;
-    m_loopFilterBetaOffsetDiv2 = 0;
-    m_loopFilterTcOffsetDiv2 = 0;
-
-    pps->bDeblockingFilterControlPresent = !m_param->bEnableLoopFilter;
+    /* If offsets are ever configured, enable bDeblockingFilterControlPresent and set
+     * deblockingFilterBetaOffsetDiv2 / deblockingFilterTcOffsetDiv2 */
+    bool bDeblockOffsetInPPS = 0;
+    pps->bDeblockingFilterControlPresent = !m_param->bEnableLoopFilter || bDeblockOffsetInPPS;
     pps->bPicDisableDeblockingFilter = !m_param->bEnableLoopFilter;
-    pps->bDeblockingFilterOverrideEnabled = !m_loopFilterOffsetInPPS;
-    pps->deblockingFilterBetaOffsetDiv2 = m_loopFilterBetaOffset;
-    pps->deblockingFilterTcOffsetDiv2 = m_loopFilterTcOffset;
+    pps->deblockingFilterBetaOffsetDiv2 = 0;
+    pps->deblockingFilterTcOffsetDiv2 = 0;
 
     // options affected by parallelization
     pps->bEntropyCodingSyncEnabled = m_param->bEnableWavefront;
diff -r 6d0c8efbe3ed -r 3e4616cffc90 source/encoder/encoder.h
--- a/source/encoder/encoder.h	Thu Jul 17 02:38:35 2014 -0500
+++ b/source/encoder/encoder.h	Thu Jul 17 12:48:45 2014 -0500
@@ -130,12 +130,6 @@
     uint32_t           m_quadtreeTULog2MaxSize;
     uint32_t           m_quadtreeTULog2MinSize;
 
-    //====== Loop/Deblock Filter ========
-    bool               m_loopFilterOffsetInPPS;
-    int                m_loopFilterBetaOffset;
-    int                m_loopFilterBetaOffsetDiv2;
-    int                m_loopFilterTcOffset;
-    int                m_loopFilterTcOffsetDiv2;
     int                m_maxNumOffsetsPerPic;
     int                m_maxCuDQPDepth;
 
diff -r 6d0c8efbe3ed -r 3e4616cffc90 source/encoder/entropy.cpp
--- a/source/encoder/entropy.cpp	Thu Jul 17 02:38:35 2014 -0500
+++ b/source/encoder/entropy.cpp	Thu Jul 17 12:48:45 2014 -0500
@@ -731,8 +731,8 @@
     WRITE_FLAG(pps->bDeblockingFilterControlPresent, "deblocking_filter_control_present_flag");
     if (pps->bDeblockingFilterControlPresent)
     {
-        WRITE_FLAG(pps->bDeblockingFilterOverrideEnabled, "deblocking_filter_override_enabled_flag");
-        WRITE_FLAG(pps->bPicDisableDeblockingFilter,      "pps_disable_deblocking_filter_flag");
+        WRITE_FLAG(0,                                "deblocking_filter_override_enabled_flag");
+        WRITE_FLAG(pps->bPicDisableDeblockingFilter, "pps_disable_deblocking_filter_flag");
         if (!pps->bPicDisableDeblockingFilter)
         {
             WRITE_SVLC(pps->deblockingFilterBetaOffsetDiv2, "pps_beta_offset_div2");
@@ -1102,22 +1102,6 @@
     int code = slice->getSliceQp() - 26;
     WRITE_SVLC(code, "slice_qp_delta");
 
-    if (slice->getPPS()->bDeblockingFilterControlPresent)
-    {
-        if (slice->getPPS()->bDeblockingFilterOverrideEnabled)
-            WRITE_FLAG(slice->getDeblockingFilterOverrideFlag(), "deblocking_filter_override_flag");
-
-        if (slice->getDeblockingFilterOverrideFlag())
-        {
-            WRITE_FLAG(slice->getDeblockingFilterDisable(), "slice_disable_deblocking_filter_flag");
-            if (!slice->getDeblockingFilterDisable())
-            {
-                WRITE_SVLC(slice->getDeblockingFilterBetaOffsetDiv2(), "slice_beta_offset_div2");
-                WRITE_SVLC(slice->getDeblockingFilterTcOffsetDiv2(),   "slice_tc_offset_div2");
-            }
-        }
-    }
-
     bool isSAOEnabled = (!slice->getSPS()->bUseSAO) ? (false) : (slice->getSaoEnabledFlag() || slice->getSaoEnabledFlagChroma());
     bool isDBFEnabled = (!slice->getDeblockingFilterDisable());
 
diff -r 6d0c8efbe3ed -r 3e4616cffc90 source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp	Thu Jul 17 02:38:35 2014 -0500
+++ b/source/encoder/frameencoder.cpp	Thu Jul 17 12:48:45 2014 -0500
@@ -190,25 +190,6 @@
         m_isReferenced = (pic->m_lowres.sliceType == X265_TYPE_BREF);
 
     slice->setReferenced(m_isReferenced);
-
-    if (slice->getPPS()->bDeblockingFilterControlPresent)
-    {
-        slice->setDeblockingFilterOverrideFlag(!m_top->m_loopFilterOffsetInPPS);
-        slice->setDeblockingFilterDisable(!m_param->bEnableLoopFilter);
-        if (!slice->getDeblockingFilterDisable())
-        {
-            slice->setDeblockingFilterBetaOffsetDiv2(m_top->m_loopFilterBetaOffset);
-            slice->setDeblockingFilterTcOffsetDiv2(m_top->m_loopFilterTcOffset);
-        }
-    }
-    else
-    {
-        slice->setDeblockingFilterOverrideFlag(false);
-        slice->setDeblockingFilterDisable(false);
-        slice->setDeblockingFilterBetaOffsetDiv2(0);
-        slice->setDeblockingFilterTcOffsetDiv2(0);
-    }
-
     slice->setMaxNumMergeCand(m_param->maxNumMergeCand);
 }
 


More information about the x265-devel mailing list