From dd07bc205d854d0c7a2e89070d5bf1620e181379 Mon Sep 17 00:00:00 2001
From: nanh <nanh@qti.qualcomm.com>
Date: Wed, 7 Oct 2020 01:05:45 -0700
Subject: [PATCH] JVET-S0121 aspect 2: Remove the condition check of
 pps_deblocking_filter_override_enabled_flag for the signalling of
 ph_deblocking_params_present_flag

---
 source/Lib/CommonLib/TypeDef.h      | 2 ++
 source/Lib/DecoderLib/VLCReader.cpp | 8 ++++++++
 source/Lib/EncoderLib/VLCWriter.cpp | 7 +++++++
 3 files changed, 17 insertions(+)

diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h
index 69a3d9b790..e427f2fac0 100644
--- a/source/Lib/CommonLib/TypeDef.h
+++ b/source/Lib/CommonLib/TypeDef.h
@@ -52,6 +52,8 @@
 
 // clang-format off
 //########### place macros to be removed in next cycle below this line ###############
+#define JVET_S0121_ASPECT2                                1 // JVET-S0121 aspect 2: Remove the condition check of pps_deblocking_filter_override_enabled_flag for the signalling of ph_deblocking_params_present_flag
+
 #define JVET_S0058_GCI                                    1 // no_mtt_constraint_flag and no_weightedpred_constraint_flag
 
 #define JVET_R0341_GCI                                    1 // JVET-R0341: on constraint flag for local chroma QP control
diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp
index 33a25a1888..c97d8cee58 100644
--- a/source/Lib/DecoderLib/VLCReader.cpp
+++ b/source/Lib/DecoderLib/VLCReader.cpp
@@ -3578,6 +3578,13 @@ void HLSyntaxReader::parsePictureHeader( PicHeader* picHeader, ParameterSetManag
   // deblocking filter controls
   if (pps->getDeblockingFilterControlPresentFlag())
   {
+#if JVET_S0121_ASPECT2
+    if ( pps->getDbfInfoInPhFlag() )
+    {
+      READ_FLAG( uiCode, "ph_deblocking_filter_override_flag" );
+      picHeader->setDeblockingFilterOverrideFlag( uiCode != 0 );
+    }
+#else
     if(pps->getDeblockingFilterOverrideEnabledFlag())
     {
       if (pps->getDbfInfoInPhFlag())
@@ -3590,6 +3597,7 @@ void HLSyntaxReader::parsePictureHeader( PicHeader* picHeader, ParameterSetManag
         picHeader->setDeblockingFilterOverrideFlag(false);
       }
     }
+#endif
     else
     {
       picHeader->setDeblockingFilterOverrideFlag(false);
diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp
index 34d6fa2282..bd0f1e4abb 100644
--- a/source/Lib/EncoderLib/VLCWriter.cpp
+++ b/source/Lib/EncoderLib/VLCWriter.cpp
@@ -2285,6 +2285,12 @@ WRITE_FLAG(picHeader->getGdrOrIrapPicFlag(), "ph_gdr_or_irap_pic_flag");
   // deblocking filter controls
   if (pps->getDeblockingFilterControlPresentFlag())
   {
+#if JVET_S0121_ASPECT2
+    if ( pps->getDbfInfoInPhFlag() )
+    {
+      WRITE_FLAG( picHeader->getDeblockingFilterOverrideFlag(), "ph_deblocking_filter_override_flag" );
+    }
+#else
     if(pps->getDeblockingFilterOverrideEnabledFlag())
     {
       if (pps->getDbfInfoInPhFlag())
@@ -2296,6 +2302,7 @@ WRITE_FLAG(picHeader->getGdrOrIrapPicFlag(), "ph_gdr_or_irap_pic_flag");
         picHeader->setDeblockingFilterOverrideFlag(false);
       }
     }
+#endif
     else
     {
       picHeader->setDeblockingFilterOverrideFlag(false);
-- 
GitLab