From e105957d1a18d63c67da8ac0eb68c71e496fc47f Mon Sep 17 00:00:00 2001
From: Xiang Li <xlxiangli@tencent.com>
Date: Mon, 26 Nov 2018 11:49:35 -0800
Subject: [PATCH] Fix compiling error with PCM after SIZE_2Nx2N is cleaned.

---
 source/Lib/CommonLib/dtrace_blockstatistics.cpp | 6 +++---
 source/Lib/DecoderLib/CABACReader.cpp           | 4 ++--
 source/Lib/EncoderLib/CABACWriter.cpp           | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/source/Lib/CommonLib/dtrace_blockstatistics.cpp b/source/Lib/CommonLib/dtrace_blockstatistics.cpp
index 49241d5b..a780c6a5 100644
--- a/source/Lib/CommonLib/dtrace_blockstatistics.cpp
+++ b/source/Lib/CommonLib/dtrace_blockstatistics.cpp
@@ -561,7 +561,7 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
         // prediction mode and partitioning data
         DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, cu, GetBlockStatisticName(BlockStatistic::PredMode), cu.predMode);
 
-        if (CU::isIntra(cu) && cu.partSize == SIZE_2Nx2N)
+        if (CU::isIntra(cu))
         {
           if (!(!sps.getUsePCM() || cu.lumaSize().width > (1 << sps.getPCMLog2MaxSize()) || cu.lumaSize().width < (1 << sps.getPCMLog2MinSize())))
           {
@@ -585,7 +585,7 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
           DTRACE_BLOCK_SCALAR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_CODED, cu, GetBlockStatisticName(BlockStatistic::TransQuantBypassFlag_Chroma), cu.transQuantBypass);
         }
 
-        if (CU::isIntra(cu) && cu.partSize == SIZE_2Nx2N)
+        if (CU::isIntra(cu))
         {
           if (!(!sps.getUsePCM() || cu.lumaSize().width > (1 << sps.getPCMLog2MaxSize()) || cu.lumaSize().width < (1 << sps.getPCMLog2MinSize())))
           {
@@ -651,7 +651,7 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
 #if JVET_L0632_AFFINE_MERGE
               if (!cu.cs->slice->isIntra() && cu.cs->sps->getSpsNext().getUseAffine() && cu.lumaSize().width > 8 && cu.lumaSize().height > 8)
 #else
-              if (!(cu.cs->slice->isIntra() || !cu.cs->sps->getSpsNext().getUseAffine() || cu.partSize != SIZE_2Nx2N)
+              if (!(cu.cs->slice->isIntra() || !cu.cs->sps->getSpsNext().getUseAffine())
                 && !(!cu.firstPU->mergeFlag && !(cu.lumaSize().width > 8 && cu.lumaSize().height > 8))
                 && !(cu.firstPU->mergeFlag && !PU::isAffineMrgFlagCoded(*cu.firstPU)))
 #endif
diff --git a/source/Lib/DecoderLib/CABACReader.cpp b/source/Lib/DecoderLib/CABACReader.cpp
index d29fa7b3..29fa8027 100644
--- a/source/Lib/DecoderLib/CABACReader.cpp
+++ b/source/Lib/DecoderLib/CABACReader.cpp
@@ -707,7 +707,7 @@ bool CABACReader::coding_unit( CodingUnit &cu, Partitioner &partitioner, CUCtx&
 
 #if JVET_L0209_PCM
   // pcm samples
-  if( CU::isIntra(cu) && cu.partSize == SIZE_2Nx2N )
+  if( CU::isIntra(cu) )
   {
     pcm_flag( cu, partitioner );
     if( cu.ipcm )
@@ -1417,7 +1417,7 @@ void CABACReader::affine_flag( CodingUnit& cu )
     }
   }
 #else
-  if( cu.cs->slice->isIntra() || !cu.cs->sps->getSpsNext().getUseAffine() || cu.partSize != SIZE_2Nx2N )
+  if( cu.cs->slice->isIntra() || !cu.cs->sps->getSpsNext().getUseAffine() )
   {
     return;
   }
diff --git a/source/Lib/EncoderLib/CABACWriter.cpp b/source/Lib/EncoderLib/CABACWriter.cpp
index fbe47cdf..576b5cd9 100644
--- a/source/Lib/EncoderLib/CABACWriter.cpp
+++ b/source/Lib/EncoderLib/CABACWriter.cpp
@@ -631,7 +631,7 @@ void CABACWriter::coding_unit( const CodingUnit& cu, Partitioner& partitioner, C
 
 #if JVET_L0209_PCM
   // pcm samples
-  if( CU::isIntra(cu) && cu.partSize == SIZE_2Nx2N )
+  if( CU::isIntra(cu) )
   {
     pcm_data( cu, partitioner );
     if( cu.ipcm )
@@ -1419,7 +1419,7 @@ void CABACWriter::affine_flag( const CodingUnit& cu )
     }
   }
 #else
-  if( cu.cs->slice->isIntra() || !cu.cs->sps->getSpsNext().getUseAffine() || cu.partSize != SIZE_2Nx2N )
+  if( cu.cs->slice->isIntra() || !cu.cs->sps->getSpsNext().getUseAffine() )
   {
     return;
   }
-- 
GitLab