From fc155ef90435039add81ad016b17fbd87a8a5122 Mon Sep 17 00:00:00 2001
From: Johannes Sauer <sauer@ient.rwth-aachen.de>
Date: Wed, 9 Oct 2019 11:37:03 +0200
Subject: [PATCH] removed trailing whitespaces

---
 source/App/DecoderApp/DecApp.cpp              |  4 +--
 source/App/EncoderApp/EncApp.cpp              |  6 ++--
 source/App/EncoderApp/EncAppCfg.cpp           | 34 +++++++++----------
 source/App/EncoderApp/EncAppCfg.h             |  6 ++--
 source/App/Parcat/parcat.cpp                  |  4 +--
 source/Lib/CommonLib/AlfParameters.h          |  2 +-
 source/Lib/CommonLib/InterPrediction.cpp      |  4 +--
 source/Lib/CommonLib/InterpolationFilter.h    |  4 +--
 source/Lib/CommonLib/NAL.h                    |  2 +-
 source/Lib/CommonLib/Picture.cpp              |  8 ++---
 source/Lib/CommonLib/SEI.h                    |  2 +-
 source/Lib/CommonLib/Slice.cpp                | 28 +++++++--------
 source/Lib/CommonLib/Slice.h                  | 12 +++----
 source/Lib/CommonLib/TypeDef.h                |  4 +--
 .../Lib/CommonLib/x86/AdaptiveLoopFilterX86.h | 10 +++---
 source/Lib/DecoderLib/DecLib.cpp              |  8 ++---
 source/Lib/DecoderLib/SEIread.cpp             |  2 +-
 source/Lib/DecoderLib/SEIread.h               |  2 +-
 source/Lib/DecoderLib/VLCReader.cpp           | 32 ++++++++---------
 source/Lib/EncoderLib/Analyze.h               |  6 ++--
 .../Lib/EncoderLib/EncAdaptiveLoopFilter.cpp  |  6 ++--
 source/Lib/EncoderLib/EncAdaptiveLoopFilter.h |  4 +--
 source/Lib/EncoderLib/EncCfg.h                | 10 +++---
 source/Lib/EncoderLib/EncCu.cpp               |  6 ++--
 source/Lib/EncoderLib/EncGOP.cpp              | 20 +++++------
 source/Lib/EncoderLib/EncLib.cpp              | 16 ++++-----
 source/Lib/EncoderLib/SEIwrite.h              |  2 +-
 source/Lib/EncoderLib/VLCWriter.cpp           | 14 ++++----
 source/Lib/Utilities/VideoIOYuv.cpp           |  2 +-
 29 files changed, 130 insertions(+), 130 deletions(-)

diff --git a/source/App/DecoderApp/DecApp.cpp b/source/App/DecoderApp/DecApp.cpp
index 8177c7dbf..a9f84ef96 100644
--- a/source/App/DecoderApp/DecApp.cpp
+++ b/source/App/DecoderApp/DecApp.cpp
@@ -173,7 +173,7 @@ uint32_t DecApp::decode()
         {
 #if JVET_O0610_DETECT_AUD
           // check if new picture was detected at an access unit delimiter NALU
-          if(nalu.m_nalUnitType != NAL_UNIT_ACCESS_UNIT_DELIMITER) 
+          if(nalu.m_nalUnitType != NAL_UNIT_ACCESS_UNIT_DELIMITER)
           {
             msg( ERROR, "Error: New picture detected without access unit delimiter. VVC requires the presence of access unit delimiters.\n");
           }
@@ -683,7 +683,7 @@ void DecApp::xFlushOutput( PicList* pcListPic )
           m_cColourRemapping.outputColourRemapPic (pcPic, m_seiMessageFileStream);
         }
 #endif
-                                         
+
         // update POC of display order
         m_iPOCLastDisplay = pcPic->getPOC();
 
diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp
index fdae7c868..d2cc65f5e 100644
--- a/source/App/EncoderApp/EncApp.cpp
+++ b/source/App/EncoderApp/EncApp.cpp
@@ -168,7 +168,7 @@ void EncApp::xInitLibCfg()
   m_cEncLib.setIntraPeriod                                       ( m_iIntraPeriod );
   m_cEncLib.setDecodingRefreshType                               ( m_iDecodingRefreshType );
   m_cEncLib.setGOPSize                                           ( m_iGOPSize );
-#if JVET_N0494_DRAP  
+#if JVET_N0494_DRAP
   m_cEncLib.setDrapPeriod                                        ( m_drapPeriod );
 #endif
   m_cEncLib.setReWriteParamSets                                  ( m_rewriteParamSets );
@@ -323,9 +323,9 @@ void EncApp::xInitLibCfg()
   m_cEncLib.setDMVR                                              ( m_DMVR );
   m_cEncLib.setMMVD                                              ( m_MMVD );
   m_cEncLib.setMmvdDisNum                                        (m_MmvdDisNum);
-#if !JVET_O1136_TS_BDPCM_SIGNALLING 
+#if !JVET_O1136_TS_BDPCM_SIGNALLING
   m_cEncLib.setRDPCM                                             ( m_RdpcmMode );
-#endif  
+#endif
 #if JVET_O0119_BASE_PALETTE_444
   m_cEncLib.setPLTMode                                           ( m_PLTMode );
 #endif
diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp
index 0ff2cf023..37675e22a 100644
--- a/source/App/EncoderApp/EncAppCfg.cpp
+++ b/source/App/EncoderApp/EncAppCfg.cpp
@@ -180,7 +180,7 @@ EncAppCfg::~EncAppCfg()
     m_targetPivotValue = NULL;
   }
 #endif
-  
+
 #if ENABLE_TRACING
   tracing_uninit(g_trace_ctx);
 #endif
@@ -965,9 +965,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   ("AffineAmvrEncOpt",                                m_AffineAmvrEncOpt,                               false, "Enable encoder optimization of affine AMVR")
   ("DMVR",                                            m_DMVR,                                           false, "Decoder-side Motion Vector Refinement")
   ("MmvdDisNum",                                      m_MmvdDisNum,                                     8,     "Number of MMVD Distance Entries")
-#if !JVET_O1136_TS_BDPCM_SIGNALLING    
+#if !JVET_O1136_TS_BDPCM_SIGNALLING
   ( "RDPCM",                                          m_RdpcmMode,                                       false, "RDPCM")
-#endif    
+#endif
 #if JVET_O0119_BASE_PALETTE_444
   ("PLT",                                             m_PLTMode,                                           0u, "PLTMode (0x1:enabled, 0x0:disabled)  [default: disabled]")
 #endif
@@ -1465,7 +1465,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   po::setDefaults(opts);
   po::ErrorReporter err;
   const list<const char*>& argv_unhandled = po::scanArgv(opts, argc, (const char**) argv, err);
-   
+
 #if JVET_O1164_RPR
   m_rprEnabled = m_scalingRatioHor != 1.0 || m_scalingRatioVer != 1.0;
   if( m_fractionOfFrames != 1.0 )
@@ -1671,8 +1671,8 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
   {
     m_subProfile[i] = cfg_SubProfile.values[i];
   }
-#endif 
-  
+#endif
+
 #if JVET_O0143_BOTTOM_RIGHT_BRICK_IDX_DELTA
   if (m_tileUniformSpacingFlag)
   {
@@ -2339,7 +2339,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
     }
   }
 #endif
-  
+
   m_reshapeCW.binCW.resize(3);
   m_reshapeCW.rspFps = m_iFrameRate;
 #if !JVET_O0432_LMCS_ENCODER
@@ -2487,9 +2487,9 @@ bool EncAppCfg::xCheckParameter()
     xConfirmPara( m_Triangle, "Triangle is only allowed with NEXT profile" );
     xConfirmPara(m_DMVR, "DMVR only allowed with NEXT profile");
     xConfirmPara(m_MmvdDisNum, "Number of distance MMVD entry setting only allowed with NEXT profile");
-#if !JVET_O1136_TS_BDPCM_SIGNALLING    
+#if !JVET_O1136_TS_BDPCM_SIGNALLING
     xConfirmPara(m_RdpcmMode, "RDPCM only allowed with NEXT profile");
-#endif    
+#endif
 #if JVET_O0376_SPS_JOINTCBCR_FLAG
     xConfirmPara(m_JointCbCrMode, "JointCbCr only allowed with NEXT profile");
 #endif
@@ -2674,7 +2674,7 @@ bool EncAppCfg::xCheckParameter()
     xConfirmPara( !m_recoveryPointSEIEnabled,                                               "When using RecoveryPointSEI messages as RA points, recoveryPointSEI must be enabled" );
   }
 #endif
-  
+
   if (m_isField)
   {
 #if JVET_O0041_FRAME_FIELD_SEI
@@ -3435,8 +3435,8 @@ bool EncAppCfg::xCheckParameter()
     m_PPSTemporalMVPEnabledIdc = m_TMVPModeId == 2 ? 0: ( int(m_TMVPModeId == 1 ? 1: 0) + 1);
     m_PPSMvdL1ZeroIdc = 0;
     m_PPSCollocatedFromL0Idc = 0;
-    m_PPSSixMinusMaxNumMergeCandPlus1 = 6 - m_maxNumMergeCand + 1; 
-    m_PPSFiveMinusMaxNumSubblockMergeCandPlus1 = 5 - m_maxNumAffineMergeCand + 1; 
+    m_PPSSixMinusMaxNumMergeCandPlus1 = 6 - m_maxNumMergeCand + 1;
+    m_PPSFiveMinusMaxNumSubblockMergeCandPlus1 = 5 - m_maxNumAffineMergeCand + 1;
     m_PPSMaxNumMergeCandMinusMaxNumTriangleCandPlus1 = 0;
     break;
   default:
@@ -3482,7 +3482,7 @@ bool EncAppCfg::xCheckParameter()
     xConfirmPara(m_vuiParametersPresentFlag && m_chromaLocInfoPresentFlag && (m_chromaSampleLocTypeTopField != m_chromaSampleLocTypeBottomField ), "When chromaResamplingFilterSEI is enabled, ChromaSampleLocTypeTopField has to be equal to ChromaSampleLocTypeBottomField" );
   }
 #endif
-  
+
   if ( m_RCEnableRateControl )
   {
     if ( m_RCForceIntraQP )
@@ -3536,7 +3536,7 @@ bool EncAppCfg::xCheckParameter()
     xConfirmPara(m_timeCodeSEINumTs > MAX_TIMECODE_SEI_SETS, "Number of time sets cannot exceed 3");
   }
 #endif
-  
+
 #if HEVC_SEI
 #if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
   xConfirmPara(m_preferredTransferCharacteristics > 255, "transfer_characteristics_idc should not be greater than 255.");
@@ -3635,7 +3635,7 @@ void EncAppCfg::xPrintParameter()
   msg( DETAILS, "Motion search range                    : %d\n", m_iSearchRange );
   msg( DETAILS, "Intra period                           : %d\n", m_iIntraPeriod );
   msg( DETAILS, "Decoding refresh type                  : %d\n", m_iDecodingRefreshType );
-#if JVET_N0494_DRAP 
+#if JVET_N0494_DRAP
   msg( DETAILS, "DRAP period                            : %d\n", m_drapPeriod );
 #endif
 #if QP_SWITCHING_FOR_PARALLEL
@@ -3818,9 +3818,9 @@ void EncAppCfg::xPrintParameter()
     msg( VERBOSE, "AffineAmvrEncOpt:%d ", m_AffineAmvrEncOpt );
     msg(VERBOSE, "DMVR:%d ", m_DMVR);
     msg(VERBOSE, "MmvdDisNum:%d ", m_MmvdDisNum);
-#if !JVET_O1136_TS_BDPCM_SIGNALLING    
+#if !JVET_O1136_TS_BDPCM_SIGNALLING
     msg(VERBOSE, "RDPCM:%d ", m_RdpcmMode );
-#endif    
+#endif
 #if JVET_O0376_SPS_JOINTCBCR_FLAG
     msg(VERBOSE, "JointCbCr:%d ", m_JointCbCrMode);
 #endif
diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h
index 3e907d0b1..36b98506f 100644
--- a/source/App/EncoderApp/EncAppCfg.h
+++ b/source/App/EncoderApp/EncAppCfg.h
@@ -255,7 +255,7 @@ protected:
 #if HEVC_SEI
   SEIMasteringDisplay m_masteringDisplay;
 #endif
-  
+
   bool      m_bUseAdaptiveQP;                                 ///< Flag for enabling QP adaptation based on a psycho-visual model
   int       m_iQPAdaptationRange;                             ///< dQP range by QP adaptation
 #if ENABLE_QPA
@@ -309,7 +309,7 @@ protected:
   bool      m_DMVR;
   bool      m_MMVD;
   int       m_MmvdDisNum;
-#if !JVET_O1136_TS_BDPCM_SIGNALLING  
+#if !JVET_O1136_TS_BDPCM_SIGNALLING
   bool      m_RdpcmMode;
 #endif
 #if JVET_O0119_BASE_PALETTE_444
@@ -639,7 +639,7 @@ protected:
 #if HEVC_SEI
   std::string m_colourRemapSEIFileRoot;
 #endif
-  
+
   std::string m_summaryOutFilename;                           ///< filename to use for producing summary output file.
   std::string m_summaryPicFilenameBase;                       ///< Base filename to use for producing summary picture output files. The actual filenames used will have I.txt, P.txt and B.txt appended.
   uint32_t        m_summaryVerboseness;                           ///< Specifies the level of the verboseness of the text output.
diff --git a/source/App/Parcat/parcat.cpp b/source/App/Parcat/parcat.cpp
index cdd01eb6e..3913e5da5 100644
--- a/source/App/Parcat/parcat.cpp
+++ b/source/App/Parcat/parcat.cpp
@@ -198,7 +198,7 @@ const char * NALU_TYPE[] =
 {
 #if JVET_O0179
     "NAL_UNIT_CODED_SLICE_TRAIL",
-    "NAL_UNIT_CODED_SLICE_STSA", 
+    "NAL_UNIT_CODED_SLICE_STSA",
     "NAL_UNIT_CODED_SLICE_RASL",
     "NAL_UNIT_CODED_SLICE_RADL",
     "NAL_UNIT_RESERVED_VCL_4",
@@ -217,7 +217,7 @@ const char * NALU_TYPE[] =
     "NAL_UNIT_RESERVED_IRAP_VCL13",
     "NAL_UNIT_RESERVED_VCL14",
     "NAL_UNIT_RESERVED_VCL15",
-    "NAL_UNIT_SPS", 
+    "NAL_UNIT_SPS",
     "NAL_UNIT_PPS",
     "NAL_UNIT_APS",
     "NAL_UNIT_ACCESS_UNIT_DELIMITER",
diff --git a/source/Lib/CommonLib/AlfParameters.h b/source/Lib/CommonLib/AlfParameters.h
index 49d09a0d3..e6e80fd04 100644
--- a/source/Lib/CommonLib/AlfParameters.h
+++ b/source/Lib/CommonLib/AlfParameters.h
@@ -269,7 +269,7 @@ struct AlfParam
     if( memcmp( newFilterFlag, other.newFilterFlag, sizeof( newFilterFlag ) ) )
     {
       return false;
-    }    
+    }
     if( numAlternativesChroma != other.numAlternativesChroma )
     {
       return false;
diff --git a/source/Lib/CommonLib/InterPrediction.cpp b/source/Lib/CommonLib/InterPrediction.cpp
index 8d07944ef..3a79afcb4 100644
--- a/source/Lib/CommonLib/InterPrediction.cpp
+++ b/source/Lib/CommonLib/InterPrediction.cpp
@@ -2127,14 +2127,14 @@ void InterPrediction::xPrefetch(PredictionUnit& pu, PelUnitBuf &pcPad, RefPicLis
 #if JVET_O1164_PS
     if( pu.cs->sps->getWrapAroundEnabledFlag() )
     {
-      wrapRef = wrapClipMv( cMv, pu.blocks[0].pos(), pu.blocks[0].size(), pu.cs->sps, pu.cs->pps );   
+      wrapRef = wrapClipMv( cMv, pu.blocks[0].pos(), pu.blocks[0].size(), pu.cs->sps, pu.cs->pps );
     }
     else
     {
       clipMv( cMv, pu.lumaPos(), pu.lumaSize(), *pu.cs->sps, *pu.cs->pps );
     }
 #else
-    if( pu.cs->sps->getWrapAroundEnabledFlag() ) 
+    if( pu.cs->sps->getWrapAroundEnabledFlag() )
     {
       wrapRef = wrapClipMv( cMv, pu.blocks[0].pos(), pu.blocks[0].size(), pu.cs->sps);
     }
diff --git a/source/Lib/CommonLib/InterpolationFilter.h b/source/Lib/CommonLib/InterpolationFilter.h
index abb6f2ded..03079addd 100644
--- a/source/Lib/CommonLib/InterpolationFilter.h
+++ b/source/Lib/CommonLib/InterpolationFilter.h
@@ -61,9 +61,9 @@ public:
 #endif
   static const TFilterCoeff m_lumaFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA]; ///< Luma filter taps
   static const TFilterCoeff m_chromaFilter[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_CHROMA]; ///< Chroma filter taps
-#if JVET_O1164_RPR  
+#if JVET_O1164_RPR
 private:
-#endif  
+#endif
 #if JVET_O0057_ALTHPELIF
   static const TFilterCoeff m_lumaAltHpelIFilter[NTAPS_LUMA]; ///< Luma filter taps
 #endif
diff --git a/source/Lib/CommonLib/NAL.h b/source/Lib/CommonLib/NAL.h
index 022d5d887..a49968a68 100644
--- a/source/Lib/CommonLib/NAL.h
+++ b/source/Lib/CommonLib/NAL.h
@@ -69,7 +69,7 @@ struct NALUnit
     NalUnitType nalUnitType,
     int         temporalId = 0,
 #if JVET_O0179
-    uint32_t nuhReservedZeroBit = 0, 
+    uint32_t nuhReservedZeroBit = 0,
     uint32_t forbiddenZeroBit = 0,
 #endif
     int         nuhLayerId = 0)
diff --git a/source/Lib/CommonLib/Picture.cpp b/source/Lib/CommonLib/Picture.cpp
index 57bc7dad0..5a14825b3 100644
--- a/source/Lib/CommonLib/Picture.cpp
+++ b/source/Lib/CommonLib/Picture.cpp
@@ -1062,7 +1062,7 @@ void Picture::finalInit(const SPS& sps, const PPS& pps, APS** alfApss, APS* lmcs
   cs->pps     = &pps;
   memcpy(cs->alfApss, alfApss, sizeof(cs->alfApss));
   cs->lmcsAps = lmcsAps;
-#if JVET_O0299_APS_SCALINGLIST  
+#if JVET_O0299_APS_SCALINGLIST
   cs->scalinglistAps = scalingListAps;
 #endif
 
@@ -1227,7 +1227,7 @@ const TFilterCoeff DownsamplingFilterSRC[8][16][12] =
       {   0,   1,   4,    -10,  -3,  52,   73,  22,    -13,  -1,  4,  -1}, //12
       {   0,   1,   5,    -9,    -5,  48,   75,  25,    -13,  -2,  4,  -1}, //13
       //{   0,   1,   5,    -8,    -7,  44,   75,  28,    -12,  -3,  5,   0}, //14
-      {    0,   0,   5,    -8,   -7,  45,   75,  29,    -12,  -3,  5,  -1}  , //14 new coefficients in m24499  
+      {    0,   0,   5,    -8,   -7,  45,   75,  29,    -12,  -3,  5,  -1}  , //14 new coefficients in m24499
       {   0,   0,   5,    -7,    -9,  40,   76,  33,    -11,  -4,  5,   0}, //15
     },
     { // D = 2.5
@@ -1236,7 +1236,7 @@ const TFilterCoeff DownsamplingFilterSRC[8][16][12] =
       {   2,  -2,   -9,  2,   35,  58,   44,  9,   -8,  -4,    1,    0}, // 2
       {   1,  -2,   -9,  1,   34,  58,   46,  11,   -8,  -5,    1,    0}, // 3
       //{   1,  -1,   -8,  -1,   31,  57,   48,  13,   -8,  -5,    1,    0}, // 4
-      {   1,  -1,   -8,  -1,   31,  57,   47,  13,   -7,  -5,    1,    0},  // 4 new coefficients in m24499  
+      {   1,  -1,   -8,  -1,   31,  57,   47,  13,   -7,  -5,    1,    0},  // 4 new coefficients in m24499
       {   1,  -1,   -8,  -2,   29,  56,   49,  15,   -7,  -6,    1,    1}, // 5
       {   1,  0,   -8,  -3,   26,  55,   51,  17,   -7,  -6,    1,    1}, // 6
       {   1,  0,   -7,  -4,   24,  54,   52,  19,   -6,  -7,    1,    1}, // 7
@@ -1245,7 +1245,7 @@ const TFilterCoeff DownsamplingFilterSRC[8][16][12] =
       {   1,  1,   -6,  -7,   17,  51,   55,  26,   -3,  -8,    0,    1}, // 10
       {   1,  1,   -6,  -7,   15,  49,   56,  29,   -2,  -8,    -1,    1}, // 11
       //{   0,  1,   -5,  -8,   13,  48,   57,  31,   -1,  -8,    -1,    1}, // 12 new coefficients in m24499
-      {   0,  1,   -5,  -7,   13,  47,  57,  31,  -1,    -8,   -1,    1}, // 12   
+      {   0,  1,   -5,  -7,   13,  47,  57,  31,  -1,    -8,   -1,    1}, // 12
       {   0,  1,   -5,  -8,   11,  46,   58,  34,   1,    -9,    -2,    1}, // 13
       {   0,  1,   -4,  -8,   9,    44,   58,  35,   2,    -9,    -2,    2}, // 14
       {   0,  1,   -4,  -9,   7,    43,   58,  38,   4,    -9,    -3,    2}, // 15
diff --git a/source/Lib/CommonLib/SEI.h b/source/Lib/CommonLib/SEI.h
index 84bbc846a..08a167f33 100644
--- a/source/Lib/CommonLib/SEI.h
+++ b/source/Lib/CommonLib/SEI.h
@@ -386,7 +386,7 @@ public:
     , m_duplicateFlag(false)
   {}
   virtual ~SEIFrameFieldInfo() {}
-  
+
   bool m_fieldPicFlag;
   bool m_bottomFieldFlag;
   bool m_pairingIndicatedFlag;
diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp
index a6d215f23..6442458dc 100644
--- a/source/Lib/CommonLib/Slice.cpp
+++ b/source/Lib/CommonLib/Slice.cpp
@@ -78,7 +78,7 @@ Slice::Slice()
 , m_noOutputPriorPicsFlag         ( false )
 #if JVET_N0865_NONSYNTAX
 , m_noIncorrectPicOutputFlag      ( false )
-#else 
+#else
 , m_noRaslOutputFlag              ( false )
 #endif
 , m_handleCraAsCvsStartFlag            ( false )
@@ -905,7 +905,7 @@ void Slice::checkLeadingPictureRestrictions(PicList& rcListPic) const
     // When a picture is a leading picture, it shall precede, in decoding order,
     // all trailing pictures that are associated with the same IRAP picture.
 #if JVET_OO147_LEADING_PIC_CHECKING
-    if ((nalUnitType == NAL_UNIT_CODED_SLICE_RASL || nalUnitType == NAL_UNIT_CODED_SLICE_RADL) && 
+    if ((nalUnitType == NAL_UNIT_CODED_SLICE_RASL || nalUnitType == NAL_UNIT_CODED_SLICE_RADL) &&
         (pcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_RASL && pcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_RADL)  )
     {
       if (pcSlice->getAssociatedIRAPPOC() == this->getAssociatedIRAPPOC())
@@ -1255,14 +1255,14 @@ bool Slice::isPOCInRefPicList(const ReferencePictureList *rpl, int poc )
   return false;
 }
 
-bool Slice::isPocRestrictedByDRAP( int poc, bool precedingDRAPInDecodingOrder )  
-{ 
+bool Slice::isPocRestrictedByDRAP( int poc, bool precedingDRAPInDecodingOrder )
+{
   if (!getEnableDRAPSEI())
   {
     return false;
   }
-  return ( isDRAP() && poc != getAssociatedIRAPPOC() ) || 
-         ( cvsHasPreviousDRAP() && getPOC() > getLatestDRAPPOC() && (precedingDRAPInDecodingOrder || poc < getLatestDRAPPOC()) ); 
+  return ( isDRAP() && poc != getAssociatedIRAPPOC() ) ||
+         ( cvsHasPreviousDRAP() && getPOC() > getLatestDRAPPOC() && (precedingDRAPInDecodingOrder || poc < getLatestDRAPPOC()) );
 }
 
 void Slice::checkConformanceForDRAP( uint32_t temporalId )
@@ -1271,9 +1271,9 @@ void Slice::checkConformanceForDRAP( uint32_t temporalId )
   {
     return;
   }
- 
+
   if (isDRAP())
-  {    
+  {
     if (!(getNalUnitType() == NalUnitType::NAL_UNIT_CODED_SLICE_TRAIL ||
           getNalUnitType() == NalUnitType::NAL_UNIT_CODED_SLICE_STSA))
     {
@@ -1285,7 +1285,7 @@ void Slice::checkConformanceForDRAP( uint32_t temporalId )
     }
     for (int i = 0; i < getNumRefIdx(REF_PIC_LIST_0); i++)
     {
-      if (getRefPic(REF_PIC_LIST_0,i)->getPOC() != getAssociatedIRAPPOC()) 
+      if (getRefPic(REF_PIC_LIST_0,i)->getPOC() != getAssociatedIRAPPOC())
       {
         msg( WARNING, "Warning, non-conforming bitstream. The DRAP picture shall not include any pictures in the active "
                       "entries of its reference picture lists except the preceding IRAP picture in decoding order.\n");
@@ -1293,7 +1293,7 @@ void Slice::checkConformanceForDRAP( uint32_t temporalId )
     }
     for (int i = 0; i < getNumRefIdx(REF_PIC_LIST_1); i++)
     {
-      if (getRefPic(REF_PIC_LIST_1,i)->getPOC() != getAssociatedIRAPPOC()) 
+      if (getRefPic(REF_PIC_LIST_1,i)->getPOC() != getAssociatedIRAPPOC())
       {
         msg( WARNING, "Warning, non-conforming bitstream. The DRAP picture shall not include any pictures in the active "
                       "entries of its reference picture lists except the preceding IRAP picture in decoding order.\n");
@@ -1301,7 +1301,7 @@ void Slice::checkConformanceForDRAP( uint32_t temporalId )
     }
   }
 
-  if (cvsHasPreviousDRAP() && getPOC() > getLatestDRAPPOC()) 
+  if (cvsHasPreviousDRAP() && getPOC() > getLatestDRAPPOC())
   {
     for (int i = 0; i < getNumRefIdx(REF_PIC_LIST_0); i++)
     {
@@ -1350,7 +1350,7 @@ void Slice::createExplicitReferencePictureSetFromReference(PicList& rcListPic, c
     while (iterPic != rcListPic.end())
     {
       rpcPic = *(iterPic++);
-#if JVET_N0494_DRAP 
+#if JVET_N0494_DRAP
       if (!pRPL0->isRefPicLongterm(ii) && rpcPic->referenced && rpcPic->getPOC() == this->getPOC() - pRPL0->getRefPicIdentifier(ii) && !isPocRestrictedByDRAP(rpcPic->getPOC(), rpcPic->precedingDRAP))
 #else
       if (!pRPL0->isRefPicLongterm(ii) && rpcPic->referenced && rpcPic->getPOC() == this->getPOC() - pRPL0->getRefPicIdentifier(ii))
@@ -2656,7 +2656,7 @@ void Slice::scaleRefPicList( Picture *scaledRefPic[], APS** apss, APS* lmcsAps,
   }
 
   freeScaledRefPicList( scaledRefPic );
-  
+
   for( int refList = 0; refList < NUM_REF_PIC_LIST_01; refList++ )
   {
     if( refList == 1 && m_eSliceType != B_SLICE )
@@ -2680,7 +2680,7 @@ void Slice::scaleRefPicList( Picture *scaledRefPic[], APS** apss, APS* lmcsAps,
       else
       {
         int poc = m_apcRefPicList[refList][rIdx]->getPOC();
-        // check whether the reference picture has already been scaled 
+        // check whether the reference picture has already been scaled
         for( i = 0; i < MAX_NUM_REF; i++ )
         {
           if( scaledRefPic[i] != nullptr && scaledRefPic[i]->poc == poc )
diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h
index 5822eed98..0f0b23f5f 100644
--- a/source/Lib/CommonLib/Slice.h
+++ b/source/Lib/CommonLib/Slice.h
@@ -190,7 +190,7 @@ public:
     if( memcmp( m_scalingListCoef, other.m_scalingListCoef, sizeof( m_scalingListCoef ) ) )
     {
       return false;
-    }     
+    }
 
     return true;
   }
@@ -488,7 +488,7 @@ public:
     if( memcmp( reshaperModelBinCWDelta, other.reshaperModelBinCWDelta, sizeof( reshaperModelBinCWDelta ) ) )
     {
       return false;
-    }        
+    }
 
     return true;
   }
@@ -1380,7 +1380,7 @@ private:
   std::vector<int> m_numBrickRowsMinus2;
 #else
   std::vector<int> m_numBrickRowsMinus1;
-#endif 
+#endif
   std::vector<std::vector<int>> m_brickRowHeightMinus1;
   bool             m_singleBrickPerSliceFlag;
   bool             m_rectSliceFlag;
@@ -1635,7 +1635,7 @@ public:
   uint32_t                getPPSSixMinusMaxNumMergeCandPlus1() const                      { return m_PPSSixMinusMaxNumMergeCandPlus1;     }
   void                    setPPSSixMinusMaxNumMergeCandPlus1(uint32_t u)                  { m_PPSSixMinusMaxNumMergeCandPlus1 = u;        }
   uint32_t                getPPSFiveMinusMaxNumSubblockMergeCandPlus1() const             { return m_PPSFiveMinusMaxNumSubblockMergeCandPlus1; }
-  void                    setPPSFiveMinusMaxNumSubblockMergeCandPlus1(uint32_t u)         { m_PPSFiveMinusMaxNumSubblockMergeCandPlus1 = u; }  
+  void                    setPPSFiveMinusMaxNumSubblockMergeCandPlus1(uint32_t u)         { m_PPSFiveMinusMaxNumSubblockMergeCandPlus1 = u; }
   uint32_t                getPPSMaxNumMergeCandMinusMaxNumTriangleCandPlus1() const       { return m_PPSMaxNumMergeCandMinusMaxNumTriangleCandPlus1; }
   void                    setPPSMaxNumMergeCandMinusMaxNumTriangleCandPlus1(uint32_t u)   { m_PPSMaxNumMergeCandMinusMaxNumTriangleCandPlus1 = u; }
 #endif
@@ -2068,7 +2068,7 @@ public:
   void                        setLatestDRAPPOC ( int i )                             { m_latestDRAPPOC = i;                                          }
   int                         getLatestDRAPPOC () const                              { return m_latestDRAPPOC;                                       }
   bool                        cvsHasPreviousDRAP() const                             { return m_latestDRAPPOC != MAX_INT;                            }
-  bool                        isPocRestrictedByDRAP( int poc, bool precedingDRAPinDecodingOrder ); 
+  bool                        isPocRestrictedByDRAP( int poc, bool precedingDRAPinDecodingOrder );
   bool                        isPOCInRefPicList( const ReferencePictureList *rpl, int poc );
   void                        checkConformanceForDRAP( uint32_t temporalId );
 #endif
@@ -2387,7 +2387,7 @@ public:
   void checkAuApsContent( APS *aps, std::vector<int>& accessUnitApsNals )
   {
     int apsId = ( aps->getAPSId() << NUM_APS_TYPE_LEN ) + (int)aps->getAPSType();
-    
+
     if( std::find( accessUnitApsNals.begin(), accessUnitApsNals.end(), apsId ) != accessUnitApsNals.end() )
     {
       CHECK( m_paramsetMap.find( apsId ) == m_paramsetMap.end(), "APS does not exists" );
diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h
index 4d0b3c419..ca0072cd2 100644
--- a/source/Lib/CommonLib/TypeDef.h
+++ b/source/Lib/CommonLib/TypeDef.h
@@ -321,7 +321,7 @@
 
 #define JVET_O0179                                        1 // JVET_O0179: Implement NAL unit header syntax proposal B
 
-#define JVET_O0176_PROPOSAL3                              1 // JVET_O0176 check for rect_slice_flag 
+#define JVET_O0176_PROPOSAL3                              1 // JVET_O0176 check for rect_slice_flag
 
 #define JVET_O0181                                        1 // JVET_O0181: non_reference_picture_flag
 
@@ -1076,7 +1076,7 @@ enum NalUnitType
   NAL_UNIT_CODED_SLICE_RASL,        // 2
   NAL_UNIT_CODED_SLICE_RADL,        // 3
 
-  NAL_UNIT_RESERVED_VCL_4, 
+  NAL_UNIT_RESERVED_VCL_4,
   NAL_UNIT_RESERVED_VCL_5,
   NAL_UNIT_RESERVED_VCL_6,
   NAL_UNIT_RESERVED_VCL_7,
diff --git a/source/Lib/CommonLib/x86/AdaptiveLoopFilterX86.h b/source/Lib/CommonLib/x86/AdaptiveLoopFilterX86.h
index 3218a3c96..165febc77 100644
--- a/source/Lib/CommonLib/x86/AdaptiveLoopFilterX86.h
+++ b/source/Lib/CommonLib/x86/AdaptiveLoopFilterX86.h
@@ -128,12 +128,12 @@ static void simdDeriveClassificationBlk(AlfClassifier **classifier, int **laplac
       __m128i hv  = _mm_hadd_epi16(ver, hor);
       __m128i di  = _mm_hadd_epi16(di0, di1);
       int leftPos = blkDst.pos().x + j;
-      if ( ( leftPos > 0 ) && ( leftPos == alfBryList[2] ) ) //left: cut the left one value 
+      if ( ( leftPos > 0 ) && ( leftPos == alfBryList[2] ) ) //left: cut the left one value
       {
         hv = _mm_blend_epi16(hv, mmZero, 0x11);
         di = _mm_blend_epi16(di, mmZero, 0x11);
       }
-      else if ( ( leftPos > 0 ) && ( leftPos == alfBryList[3] ) ) //right: cut the right values 
+      else if ( ( leftPos > 0 ) && ( leftPos == alfBryList[3] ) ) //right: cut the right values
       {
         hv = _mm_blend_epi16(hv, mmZero, 0xEE);
         di = _mm_blend_epi16(di, mmZero, 0xEE);
@@ -158,7 +158,7 @@ static void simdDeriveClassificationBlk(AlfClassifier **classifier, int **laplac
 
 #if JVET_O0625_ALF_PADDING
       uint32_t horBlkStride = 8, horBlkStride2 = 8, verBlkStride = 8, verBlkStride2 = 8;
-      
+
       //left
       if ((alfBryList[2] != ALF_NONE_BOUNDARY) && (j + blkDst.pos().x == alfBryList[2]))
       {
@@ -201,7 +201,7 @@ static void simdDeriveClassificationBlk(AlfClassifier **classifier, int **laplac
         x7 = _mm_setzero_si128();
         if (((alfBryList[1] - 4) & (vbCTUHeight - 1)) == vbPos)  //between vb and bottom boundary
         {
-          x4 = _mm_setzero_si128();          
+          x4 = _mm_setzero_si128();
           verBlkStride2 = 4;
         }
         else
@@ -595,7 +595,7 @@ static void simdFilter5x5Blk(AlfClassifier **classifier, const PelUnitBuf &recDs
           __m128i xmm41Tmp = _mm_shuffle_epi8(cur, mmMask);
           xmm41 = _mm_blend_epi16(xmm41, xmm41Tmp, 0xC0);
           xmm51 = _mm_blend_epi16(xmm51, cur, 0x80);
-        }        
+        }
 #endif
         __m128i accumA = mmOffset;
         __m128i accumB = mmOffset;
diff --git a/source/Lib/DecoderLib/DecLib.cpp b/source/Lib/DecoderLib/DecLib.cpp
index 8d39c2367..ea4b4df3f 100644
--- a/source/Lib/DecoderLib/DecLib.cpp
+++ b/source/Lib/DecoderLib/DecLib.cpp
@@ -789,7 +789,7 @@ void DecLib::xCreateUnavailablePicture(int iUnavailablePoc, bool longTermFlag)
   cFillPic->getRecoBuf().Y().fill(yFill);
   cFillPic->getRecoBuf().Cb().fill(cFill);
   cFillPic->getRecoBuf().Cr().fill(cFill);
-   
+
   //  for(int ctuRsAddr=0; ctuRsAddr<cFillPic->getNumberOfCtusInFrame(); ctuRsAddr++)  { cFillPic->getCtu(ctuRsAddr)->initCtu(cFillPic, ctuRsAddr); }
   cFillPic->referenced = true;
   cFillPic->longTerm = longTermFlag;
@@ -1180,7 +1180,7 @@ void DecLib::xActivateParameterSets()
 #endif
 
   if( sps->getCTUSize() + 2 * ( 1 << sps->getLog2MinCodingBlockSize() ) > pps->getPicWidthInLumaSamples() )
-  {    
+  {
     CHECK( sps->getWrapAroundEnabledFlag(), "Wraparound shall be disabled when the value of ( CtbSizeY / MinCbSizeY + 1) is less than or equal to ( pic_width_in_luma_samples / MinCbSizeY - 1 )" );
   }
 #endif
@@ -1313,7 +1313,7 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
   {
 #if JVET_N0865_NONSYNTAX
     if ((m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_bFirstSliceInSequence) ||
-        (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getHandleCraAsCvsStartFlag()) || 
+        (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getHandleCraAsCvsStartFlag()) ||
         (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_GDR && m_bFirstSliceInSequence))
     {
       m_apcSlicePilot->setNoIncorrectPicOutputFlag(true);
@@ -1892,7 +1892,7 @@ void DecLib::xDecodeAPS(InputNALUnit& nalu)
   aps->setTemporalId(nalu.m_temporalId);
 #if JVET_O0245_VPS_DPS_APS
   aps->setLayerId( nalu.m_nuhLayerId );
-  m_parameterSetManager.checkAuApsContent( aps, m_accessUnitApsNals );  
+  m_parameterSetManager.checkAuApsContent( aps, m_accessUnitApsNals );
 #endif
   m_parameterSetManager.storeAPS(aps, nalu.getBitstream().getFifo());
 }
diff --git a/source/Lib/DecoderLib/SEIread.cpp b/source/Lib/DecoderLib/SEIread.cpp
index d7930cda8..357988dd0 100644
--- a/source/Lib/DecoderLib/SEIread.cpp
+++ b/source/Lib/DecoderLib/SEIread.cpp
@@ -845,7 +845,7 @@ void SEIReader::xParseSEIPictureTiming(SEIPictureTiming& sei, uint32_t payloadSi
     sei.m_numDecodingUnitsMinus1 = symbol;
     sei.m_numNalusInDuMinus1.resize(sei.m_numDecodingUnitsMinus1 + 1 );
     sei.m_duCpbRemovalDelayMinus1.resize( sei.m_numDecodingUnitsMinus1 + 1 );
-    
+
     sei_read_flag( pDecodedMessageOutputStream, symbol, "du_common_cpb_removal_delay_flag" );
     sei.m_duCommonCpbRemovalDelayFlag = symbol;
     if( sei.m_duCommonCpbRemovalDelayFlag )
diff --git a/source/Lib/DecoderLib/SEIread.h b/source/Lib/DecoderLib/SEIread.h
index dd17edc9e..351bc2956 100644
--- a/source/Lib/DecoderLib/SEIread.h
+++ b/source/Lib/DecoderLib/SEIread.h
@@ -129,7 +129,7 @@ protected:
 #endif
   void xParseSEIGreenMetadataInfo             (SEIGreenMetadataInfo& sei,             uint32_t payLoadSize,                     std::ostream *pDecodedMessageOutputStream);
 #endif
-  
+
   void sei_read_code(std::ostream *pOS, uint32_t uiLength, uint32_t& ruiCode, const char *pSymbolName);
   void sei_read_uvlc(std::ostream *pOS,                uint32_t& ruiCode, const char *pSymbolName);
   void sei_read_svlc(std::ostream *pOS,                int&  ruiCode, const char *pSymbolName);
diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp
index 4351690a3..c12d5cada 100644
--- a/source/Lib/DecoderLib/VLCReader.cpp
+++ b/source/Lib/DecoderLib/VLCReader.cpp
@@ -426,19 +426,19 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS, ParameterSetManager *parameterSetMana
     READ_CODE( 2, uiCode, "pps_collocated_from_l0_idc");       pcPPS->setPPSCollocatedFromL0Idc(uiCode);
     READ_UVLC( uiCode, "pps_six_minus_max_num_merge_cand_plus1"); pcPPS->setPPSSixMinusMaxNumMergeCandPlus1(uiCode);
     READ_UVLC( uiCode, "pps_five_minus_max_num_subblock_merge_cand_plus1"); pcPPS->setPPSFiveMinusMaxNumSubblockMergeCandPlus1(uiCode);
-    READ_UVLC( uiCode, "pps_max_num_merge_cand_minus_max_num_triangle_cand_plus1");pcPPS->setPPSMaxNumMergeCandMinusMaxNumTriangleCandPlus1(uiCode); 
-  } 
+    READ_UVLC( uiCode, "pps_max_num_merge_cand_minus_max_num_triangle_cand_plus1");pcPPS->setPPSMaxNumMergeCandMinusMaxNumTriangleCandPlus1(uiCode);
+  }
   else
   {
-    pcPPS->setPPSDepQuantEnabledIdc(0); 
+    pcPPS->setPPSDepQuantEnabledIdc(0);
     pcPPS->setPPSRefPicListSPSIdc0(0);
     pcPPS->setPPSRefPicListSPSIdc1(0);
     pcPPS->setPPSTemporalMVPEnabledIdc(0);
-    pcPPS->setPPSMvdL1ZeroIdc(0); 
-    pcPPS->setPPSCollocatedFromL0Idc(0); 
-    pcPPS->setPPSSixMinusMaxNumMergeCandPlus1(0); 
-    pcPPS->setPPSFiveMinusMaxNumSubblockMergeCandPlus1(0); 
-    pcPPS->setPPSMaxNumMergeCandMinusMaxNumTriangleCandPlus1(0); 
+    pcPPS->setPPSMvdL1ZeroIdc(0);
+    pcPPS->setPPSCollocatedFromL0Idc(0);
+    pcPPS->setPPSSixMinusMaxNumMergeCandPlus1(0);
+    pcPPS->setPPSFiveMinusMaxNumSubblockMergeCandPlus1(0);
+    pcPPS->setPPSMaxNumMergeCandMinusMaxNumTriangleCandPlus1(0);
   }
 #endif
 
@@ -605,7 +605,7 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS, ParameterSetManager *parameterSetMana
       std::vector<int> numBrickRowsMinus2(numTilesInPic);
 #else
       std::vector<int>  numBrickRowsMinus1 (numTilesInPic);
-#endif 
+#endif
       std::vector<std::vector<int>>  brickRowHeightMinus1 (numTilesInPic);
 #if JVET_O0452_PPS_BRICK_SIGNALING_CONDITION
       int m_maxCUHeight = parameterSetManager->getSPS(pcPPS->getSPSId())->getMaxCUHeight();
@@ -728,7 +728,7 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS, ParameterSetManager *parameterSetMana
       pcPPS->setNumBrickRowsMinus2(numBrickRowsMinus2);
 #else
       pcPPS->setNumBrickRowsMinus1(numBrickRowsMinus1);
-#endif 
+#endif
       pcPPS->setBrickRowHeightMinus1(brickRowHeightMinus1);
     }
     READ_FLAG (uiCode, "single_brick_per_slice_flag" );         pcPPS->setSingleBrickPerSliceFlag(uiCode == 1);
@@ -2272,7 +2272,7 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
         {
           uiCode = pps->getPPSRefPicListSPSIdc0() - 1;
         }
-#else   
+#else
         READ_FLAG(uiCode, "ref_pic_list_sps_flag[0]");
 #endif
       }
@@ -2586,9 +2586,9 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
       {
         uiCode = pps->getPPSMvdL1ZeroIdc() - 1;
       }
-#else   
+#else
       READ_FLAG( uiCode, "mvd_l1_zero_flag" );
-#endif      
+#endif
 
       pcSlice->setMvdL1ZeroFlag( (uiCode ? true : false) );
     }
@@ -2709,7 +2709,7 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
         {
           uiCode = pps->getPPSFiveMinusMaxNumSubblockMergeCandPlus1() - 1;
         }
-#else        
+#else
         READ_UVLC( uiCode, "five_minus_max_num_affine_merge_cand" );
 #endif
         pcSlice->setMaxNumAffineMergeCand( AFFINE_MRG_MAX_NUM_CANDS - uiCode );
@@ -3525,14 +3525,14 @@ int HLSyntaxReader::alfGolombDecode( const int k, const bool signed_val )
 #endif
   }
 
-  int symbol = ( ( 1 << numLeadingBits ) - 1 ) << k; 
+  int symbol = ( ( 1 << numLeadingBits ) - 1 ) << k;
   if ( numLeadingBits + k > 0)
   {
     uint32_t bins;
     READ_CODE( numLeadingBits + k, bins, "alf_coeff_abs_suffix" );
     symbol += bins;
   }
-  
+
   if ( signed_val && symbol != 0 )
   {
 #if RExt__DECODER_DEBUG_BIT_STATISTICS
diff --git a/source/Lib/EncoderLib/Analyze.h b/source/Lib/EncoderLib/Analyze.h
index 9d91de7a4..7c14684e8 100644
--- a/source/Lib/EncoderLib/Analyze.h
+++ b/source/Lib/EncoderLib/Analyze.h
@@ -541,18 +541,18 @@ public:
               for (int i = 0; i < 1; i++)
               {
                 dDeltaE[i] = getDeltaE() / (double)getNumPic();
-                
+
                 copy(reinterpret_cast<uint8_t *>(&dDeltaE[i]),
                      reinterpret_cast<uint8_t *>(&dDeltaE[i]) + sizeof(dDeltaE[i]),
                      reinterpret_cast<uint8_t *>(&xDeltaE[i]));
               }
-              
+
               double dPsnrL[MAX_NUM_COMPONENT];
               uint64_t xPsnrL[MAX_NUM_COMPONENT];
               for (int i = 0; i < 1; i++)
               {
                 dPsnrL[i] = getPsnrL() / (double)getNumPic();
-                
+
                 copy(reinterpret_cast<uint8_t *>(&dPsnrL[i]),
                      reinterpret_cast<uint8_t *>(&dPsnrL[i]) + sizeof(dPsnrL[i]),
                      reinterpret_cast<uint8_t *>(&xPsnrL[i]));
diff --git a/source/Lib/EncoderLib/EncAdaptiveLoopFilter.cpp b/source/Lib/EncoderLib/EncAdaptiveLoopFilter.cpp
index 6152eb229..1a1c782d6 100644
--- a/source/Lib/EncoderLib/EncAdaptiveLoopFilter.cpp
+++ b/source/Lib/EncoderLib/EncAdaptiveLoopFilter.cpp
@@ -2799,7 +2799,7 @@ void EncAdaptiveLoopFilter::deriveStatsForFiltering( PelUnitBuf& orgYuv, PelUnit
 }
 
 #if JVET_O0625_ALF_PADDING
-void EncAdaptiveLoopFilter::getBlkStats( AlfCovariance* alfCovariance, const AlfFilterShape& shape, AlfClassifier** classifier, Pel* org, const int orgStride, 
+void EncAdaptiveLoopFilter::getBlkStats( AlfCovariance* alfCovariance, const AlfFilterShape& shape, AlfClassifier** classifier, Pel* org, const int orgStride,
   Pel* rec, const int recStride, const CompArea& areaDst, const CompArea& area, const ChannelType channel, int vbCTUHeight, int vbPos, const int alfBryList[4] )
 #else
 void EncAdaptiveLoopFilter::getBlkStats(AlfCovariance* alfCovariance, const AlfFilterShape& shape, AlfClassifier** classifier, Pel* org, const int orgStride, Pel* rec, const int recStride, const CompArea& areaDst, const CompArea& area, const ChannelType channel, int vbCTUHeight, int vbPos)
@@ -2827,7 +2827,7 @@ void EncAdaptiveLoopFilter::getBlkStats(AlfCovariance* alfCovariance, const AlfF
     alfBryDist[1] = alfBryList[1] != ALF_NONE_BOUNDARY ? ( i + areaDst.y - alfBryList[1] ) : ALF_NONE_BOUNDARY;
 
     if ( vbDistance >= 0 && vbDistance < vbHeight && alfBryDist[1] >= -vbHeight && alfBryDist[1] < 0 )
-    { 
+    {
       /* between bottom boundary and ALF virtual boundary */
       if ( alfBryDist[1] < -vbHalfHeight )
       {
@@ -2932,7 +2932,7 @@ void EncAdaptiveLoopFilter::getBlkStats(AlfCovariance* alfCovariance, const AlfF
 }
 
 #if JVET_O0625_ALF_PADDING
-void EncAdaptiveLoopFilter::calcCovariance( int ELocal[MAX_NUM_ALF_LUMA_COEFF][MaxAlfNumClippingValues], const Pel *rec, const int stride, 
+void EncAdaptiveLoopFilter::calcCovariance( int ELocal[MAX_NUM_ALF_LUMA_COEFF][MaxAlfNumClippingValues], const Pel *rec, const int stride,
   const AlfFilterShape& shape, const int transposeIdx, const ChannelType channel, int vbDistance, const int alfBryDist[4] )
 #else
 void EncAdaptiveLoopFilter::calcCovariance(int ELocal[MAX_NUM_ALF_LUMA_COEFF][MaxAlfNumClippingValues], const Pel *rec, const int stride, const AlfFilterShape& shape, const int transposeIdx, const ChannelType channel, int vbDistance)
diff --git a/source/Lib/EncoderLib/EncAdaptiveLoopFilter.h b/source/Lib/EncoderLib/EncAdaptiveLoopFilter.h
index 1c8b05bdf..3b6c78879 100644
--- a/source/Lib/EncoderLib/EncAdaptiveLoopFilter.h
+++ b/source/Lib/EncoderLib/EncAdaptiveLoopFilter.h
@@ -316,9 +316,9 @@ private:
 #endif
   void   deriveStatsForFiltering( PelUnitBuf& orgYuv, PelUnitBuf& recYuv, CodingStructure& cs );
 #if JVET_O0625_ALF_PADDING
-  void   getBlkStats( AlfCovariance* alfCovariace, const AlfFilterShape& shape, AlfClassifier** classifier, Pel* org, const int orgStride, Pel* rec, 
+  void   getBlkStats( AlfCovariance* alfCovariace, const AlfFilterShape& shape, AlfClassifier** classifier, Pel* org, const int orgStride, Pel* rec,
     const int recStride, const CompArea& areaDst, const CompArea& area, const ChannelType channel, int vbCTUHeight, int vbPos, const int alfBryList[4] );
-  void   calcCovariance( int ELocal[MAX_NUM_ALF_LUMA_COEFF][MaxAlfNumClippingValues], const Pel *rec, const int stride, 
+  void   calcCovariance( int ELocal[MAX_NUM_ALF_LUMA_COEFF][MaxAlfNumClippingValues], const Pel *rec, const int stride,
     const AlfFilterShape& shape, const int transposeIdx, const ChannelType channel, int vbDistance, const int alfBryList[4] );
 #else
   void   getBlkStats(AlfCovariance* alfCovariace, const AlfFilterShape& shape, AlfClassifier** classifier, Pel* org, const int orgStride, Pel* rec, const int recStride, const CompArea& areaDst, const CompArea& area, const ChannelType channel, int vbCTUHeight, int vbPos);
diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h
index eb0e03aeb..3bfaa3d28 100644
--- a/source/Lib/EncoderLib/EncCfg.h
+++ b/source/Lib/EncoderLib/EncCfg.h
@@ -333,9 +333,9 @@ protected:
   bool      m_DMVR;
   bool      m_MMVD;
   int       m_MmvdDisNum;
-#if !JVET_O1136_TS_BDPCM_SIGNALLING  
+#if !JVET_O1136_TS_BDPCM_SIGNALLING
   bool      m_RdpcmMode;
-#endif  
+#endif
 #if JVET_O0119_BASE_PALETTE_444
   unsigned  m_PLTMode;
 #endif
@@ -735,7 +735,7 @@ protected:
   int                          m_cropOffsetRight;
   int                          m_cropOffsetBottom;
   bool                         m_calculateHdrMetrics;
-#endif  
+#endif
 #if JVET_O1164_RPR
   double      m_scalingRatioHor;
   double      m_scalingRatioVer;
@@ -1003,10 +1003,10 @@ public:
   bool      getMMVD                         ()         const { return m_MMVD; }
   void      setMmvdDisNum                   ( int b )        { m_MmvdDisNum = b; }
   int       getMmvdDisNum                   ()         const { return m_MmvdDisNum; }
- #if !JVET_O1136_TS_BDPCM_SIGNALLING 
+ #if !JVET_O1136_TS_BDPCM_SIGNALLING
   void      setRDPCM                     ( bool b )       { m_RdpcmMode = b; }
   bool      getRDPCM                     ()         const { return m_RdpcmMode; }
- #endif 
+ #endif
 #if JVET_O0119_BASE_PALETTE_444
   void      setPLTMode                   ( unsigned n)    { m_PLTMode = n; }
   unsigned  getPLTMode                   ()         const { return m_PLTMode; }
diff --git a/source/Lib/EncoderLib/EncCu.cpp b/source/Lib/EncoderLib/EncCu.cpp
index bdac789e0..44817b99a 100644
--- a/source/Lib/EncoderLib/EncCu.cpp
+++ b/source/Lib/EncoderLib/EncCu.cpp
@@ -1603,7 +1603,7 @@ void EncCu::xCheckModeSplit(CodingStructure *&tempCS, CodingStructure *&bestCS,
   if( chromaNotSplit )
   {
 #if JVET_O0050_LOCAL_DUAL_TREE
-    //Note: In local dual tree region, the chroma CU refers to the central luma CU's QP. 
+    //Note: In local dual tree region, the chroma CU refers to the central luma CU's QP.
     //If the luma CU QP shall be predQP (no residual in it and before it in the QG), it must be revised to predQP before encoding the chroma CU
     //Otherwise, the chroma CU uses predQP+deltaQP in encoding but is decoded as using predQP, thus causing encoder-decoded mismatch on chroma qp.
     if( tempCS->pps->getUseDQP() )
@@ -1638,7 +1638,7 @@ void EncCu::xCheckModeSplit(CodingStructure *&tempCS, CodingStructure *&bestCS,
           parentCS = parentCS->parent;
         }
       }
-      
+
       //revise luma CU qp before the first luma CU with residual in the SCIPU to predQP
       if( !deltaQpCodedBeforeThisNode )
       {
@@ -1646,7 +1646,7 @@ void EncCu::xCheckModeSplit(CodingStructure *&tempCS, CodingStructure *&bestCS,
         const CodingUnit* cuFirst = qgCS->getCU( CHANNEL_TYPE_LUMA );
         CHECK( cuFirst->lumaPos() != partitioner.currQgPos, "First cu of the Qg is wrong" );
         int predQp = CU::predictQP( *cuFirst, qgCS->prevQP[CHANNEL_TYPE_LUMA] );
-        
+
         //revise to predQP
         int firstCuHasResidual = (int)tempCS->cus.size();
         for( int i = 0; i < tempCS->cus.size(); i++ )
diff --git a/source/Lib/EncoderLib/EncGOP.cpp b/source/Lib/EncoderLib/EncGOP.cpp
index fda5990f9..e3302654e 100644
--- a/source/Lib/EncoderLib/EncGOP.cpp
+++ b/source/Lib/EncoderLib/EncGOP.cpp
@@ -542,7 +542,7 @@ void EncGOP::xWriteLeadingSEIOrdered (SEIMessages& seiMessages, SEIMessages& duI
   xWriteSEI(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps);
   xClearSEIs(currentMessages, !testWrite);
 #endif
-  
+
   // Buffering period SEI must always be following active parameter sets
   currentMessages = extractSeisByType(localMessages, SEI::BUFFERING_PERIOD);
   CHECK(!(currentMessages.size() <= 1), "Unspecified error");
@@ -573,7 +573,7 @@ void EncGOP::xWriteLeadingSEIOrdered (SEIMessages& seiMessages, SEIMessages& duI
   xWriteSEISeparately(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps);
   xClearSEIs(currentMessages, !testWrite);
 #endif
-  
+
   // And finally everything else one by one
   xWriteSEISeparately(NAL_UNIT_PREFIX_SEI, localMessages, accessUnit, itNalu, temporalId, sps);
   xClearSEIs(localMessages, !testWrite);
@@ -2350,11 +2350,11 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
       //  4) The current picture is a trailing picture
       pcSlice->setDRAP(m_pcEncLib->getDependentRAPIndicationSEIEnabled() && m_pcEncLib->getDrapPeriod() > 0 && !pcSlice->isIntra() &&
               pocCurr % m_pcEncLib->getDrapPeriod() == 0 && pocCurr > pcSlice->getAssociatedIRAPPOC());
-      
+
       if (pcSlice->isDRAP())
       {
         int pocCycle = 1 << (pcSlice->getSPS()->getBitsForPOC());
-        int deltaPOC = pocCurr > pcSlice->getAssociatedIRAPPOC() ? pocCurr - pcSlice->getAssociatedIRAPPOC() : pocCurr - ( pcSlice->getAssociatedIRAPPOC() & (pocCycle -1) ); 
+        int deltaPOC = pocCurr > pcSlice->getAssociatedIRAPPOC() ? pocCurr - pcSlice->getAssociatedIRAPPOC() : pocCurr - ( pcSlice->getAssociatedIRAPPOC() & (pocCycle -1) );
         CHECK(deltaPOC > (pocCycle >> 1), "Use a greater value for POC wraparound to enable a POC distance between IRAP and DRAP of " << deltaPOC << ".");
         m_latestDRAPPOC = pocCurr;
         pcSlice->setTLayer(0); // Force DRAP picture to have temporal layer 0
@@ -2378,7 +2378,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
       }
     }
 
-    if (pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPL0(), 0, false) != 0 || pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPL1(), 1, false) != 0 || 
+    if (pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPL0(), 0, false) != 0 || pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPL1(), 1, false) != 0 ||
         (m_pcEncLib->getDependentRAPIndicationSEIEnabled() && !pcSlice->isIRAP() && ( pcSlice->isDRAP() || !pcSlice->isPOCInRefPicList(pcSlice->getRPL0(), pcSlice->getAssociatedIRAPPOC())) ))
 #else
     if (pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPL0(), 0, false) != 0 || pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPL1(), 1, false) != 0)
@@ -2590,7 +2590,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
 
 
     pcSlice->setList1IdxToList0Idx();
-    
+
     if (m_pcEncLib->getTMVPModeId() == 2)
     {
 #if JVET_O0238_PPS_OR_SLICE
@@ -3209,7 +3209,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
       }
 
 #if JVET_O0299_APS_SCALINGLIST
-      // only 1 SCALING LIST data for 1 picture    
+      // only 1 SCALING LIST data for 1 picture
       if( pcSlice->getSPS()->getScalingListFlag() && ( m_pcCfg->getUseScalingListId() == SCALING_LIST_FILE_READ ) )
       {
         int apsId = pcSlice->getscalingListAPSId();
@@ -3420,7 +3420,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
         trailingSeiMessages.push_back(seiGreenMetadataInfo);
       }
 #endif
-      
+
       xWriteTrailingSEIMessages(trailingSeiMessages, accessUnit, pcSlice->getTLayer(), pcSlice->getSPS());
 
       printHash(m_pcCfg->getDecodedPictureHashSEIType(), digestStr);
@@ -4361,7 +4361,7 @@ void EncGOP::xCalculateAddPSNR(Picture* pcPic, PelUnitBuf cPicD, const AccessUni
       for (int i=0; i<1; i++)
       {
         msg(NOTICE, " [PSNRL%d %6.4lf dB]", (int)m_pcCfg->getWhitePointDeltaE(i), psnrL[i]);
-        
+
         if (m_pcEncLib->getPrintHexPsnr())
         {
           int64_t xpsnrL[MAX_NUM_COMPONENT];
@@ -4372,7 +4372,7 @@ void EncGOP::xCalculateAddPSNR(Picture* pcPic, PelUnitBuf cPicD, const AccessUni
                  reinterpret_cast<uint8_t *>(&xpsnrL[i]));
           }
           msg(NOTICE, " [xPSNRL%d %16" PRIx64 "]", (int)m_pcCfg->getWhitePointDeltaE(i), xpsnrL[0]);
-          
+
         }
       }
     }
diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp
index ccbb8e548..3a8641257 100644
--- a/source/Lib/EncoderLib/EncLib.cpp
+++ b/source/Lib/EncoderLib/EncLib.cpp
@@ -448,7 +448,7 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf )
 #if ER_CHROMA_QP_WCG_PPS
   if( m_wcgChromaQpControl.isEnabled() )
   {
-#if JVET_O0299_APS_SCALINGLIST  
+#if JVET_O0299_APS_SCALINGLIST
     xInitScalingLists( sps0, *m_apsMap.getPS( 1 ) );
     xInitScalingLists( sps0, aps0 );
 #else
@@ -561,7 +561,7 @@ void EncLib::xInitScalingLists(SPS &sps, PPS &pps)
   }
   else if(getUseScalingListId() == SCALING_LIST_FILE_READ)
   {
-#if JVET_O0299_APS_SCALINGLIST 
+#if JVET_O0299_APS_SCALINGLIST
     aps.getScalingList().setDefaultScalingList();
     CHECK( aps.getScalingList().xParseScalingList( getScalingListFileName() ), "Error Parsing Scaling List Input File" );
     aps.getScalingList().checkDcOfMatrix();
@@ -595,7 +595,7 @@ void EncLib::xInitScalingLists(SPS &sps, PPS &pps)
     THROW("error : ScalingList == " << getUseScalingListId() << " not supported\n");
   }
 
-#if JVET_O0299_APS_SCALINGLIST 
+#if JVET_O0299_APS_SCALINGLIST
   if( getUseScalingListId() == SCALING_LIST_FILE_READ )
 #else
   if (getUseScalingListId() == SCALING_LIST_FILE_READ && sps.getScalingListPresentFlag())
@@ -611,7 +611,7 @@ void EncLib::xInitScalingLists(SPS &sps, PPS &pps)
         {
           continue;
         }
-#if JVET_O0299_APS_SCALINGLIST 
+#if JVET_O0299_APS_SCALINGLIST
         aps.getScalingList().checkPredMode( sizeId, listId );
 #else
         sps.getScalingList().checkPredMode( sizeId, listId );
@@ -1864,7 +1864,7 @@ void  EncLib::xInitPPSforTiles(PPS &pps)
         numBrickRowsMinus2[tileIdx] = brickSplit.second.m_numSplits - 1;
 #else
         numBrickRowsMinus1[tileIdx]=brickSplit.second.m_numSplits;
-#endif 
+#endif
         brickRowHeightMinus1[tileIdx].resize(brickSplit.second.m_numSplits);
         for (int i=0; i<brickSplit.second.m_numSplits; i++)
         {
@@ -1879,7 +1879,7 @@ void  EncLib::xInitPPSforTiles(PPS &pps)
     pps.setNumBrickRowsMinus2(numBrickRowsMinus2);
 #else
     pps.setNumBrickRowsMinus1(numBrickRowsMinus1);
-#endif 
+#endif
     pps.setBrickRowHeightMinus1(brickRowHeightMinus1);
 
     // check brick dimensions
@@ -1944,9 +1944,9 @@ void  EncLib::xInitPPSforTiles(PPS &pps)
           int cumulativeHeight=0;
 #if JVET_O0173_O0176_O0338_NUMBRICK_M2
           for (int i = 0; i <= pps.getNumBrickRowsMinus2(tileIdx); i++)
-#else 
+#else
           for (int i = 0; i < pps.getNumBrickRowsMinus1(tileIdx); i++)
-#endif 
+#endif
           {
             cumulativeHeight += pps.getBrickRowHeightMinus1(tileIdx, i) + 1;
           }
diff --git a/source/Lib/EncoderLib/SEIwrite.h b/source/Lib/EncoderLib/SEIwrite.h
index 29068a543..6f5ea13b4 100644
--- a/source/Lib/EncoderLib/SEIwrite.h
+++ b/source/Lib/EncoderLib/SEIwrite.h
@@ -117,7 +117,7 @@ protected:
 #endif
   void xWriteSEIGreenMetadataInfo(const SEIGreenMetadataInfo &sei);
 #endif
-  
+
 #if !JVET_N0353_INDEP_BUFF_TIME_SEI
   void xWriteSEIpayloadData(OutputBitstream& bs, const SEI& sei, const SPS *sps);
 #else
diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp
index defbba35d..c820fea1b 100644
--- a/source/Lib/EncoderLib/VLCWriter.cpp
+++ b/source/Lib/EncoderLib/VLCWriter.cpp
@@ -383,11 +383,11 @@ void HLSWriter::codePPS( const PPS* pcPPS )
           WRITE_UVLC(pcPPS->getNumBrickRowsMinus2(i), "num_brick_rows_minus2 [i]");
           for (int j = 0; j <= pcPPS->getNumBrickRowsMinus2(i); j++)
             WRITE_UVLC(pcPPS->getBrickRowHeightMinus1(i, j), "brick_row_height_minus1 [i][j]");
-#else                    
+#else
           WRITE_UVLC( pcPPS->getNumBrickRowsMinus1(i), "num_brick_rows_minus1 [i]" );
           for(int j = 0; j < pcPPS->getNumBrickRowsMinus1(i); j++ )
             WRITE_UVLC( pcPPS->getBrickRowHeightMinus1(i,j), "brick_row_height_minus1 [i][j]" );
-#endif 
+#endif
         }
       }
     }
@@ -925,7 +925,7 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
 
 #if JVET_O1164_PS
   WRITE_UVLC( pcSPS->getMaxPicWidthInLumaSamples(), "pic_width_max_in_luma_samples" );
-  WRITE_UVLC( pcSPS->getMaxPicHeightInLumaSamples(), "pic_height_max_in_luma_samples" );  
+  WRITE_UVLC( pcSPS->getMaxPicHeightInLumaSamples(), "pic_height_max_in_luma_samples" );
 #else
   WRITE_UVLC( pcSPS->getPicWidthInLumaSamples (),   "pic_width_in_luma_samples" );
   WRITE_UVLC( pcSPS->getPicHeightInLumaSamples(),   "pic_height_in_luma_samples" );
@@ -1469,7 +1469,7 @@ void HLSWriter::codeSliceHeader         ( Slice* pcSlice )
         if (!pcSlice->getPPS()->getPPSRefPicListSPSIdc0())
         {
           WRITE_FLAG(pcSlice->getRPL0idx() != -1 ? 1 : 0, "ref_pic_list_sps_flag[0]");
-        } 
+        }
 #else
         WRITE_FLAG(pcSlice->getRPL0idx() != -1 ? 1 : 0, "ref_pic_list_sps_flag[0]");
 #endif
@@ -1538,7 +1538,7 @@ void HLSWriter::codeSliceHeader         ( Slice* pcSlice )
         if (!pcSlice->getPPS()->getPPSRefPicListSPSIdc1())
         {
           WRITE_FLAG(pcSlice->getRPL1idx() != -1 ? 1 : 0, "ref_pic_list_sps_flag[1]");
-        } 
+        }
 #else
           WRITE_FLAG(pcSlice->getRPL1idx() != -1 ? 1 : 0, "ref_pic_list_sps_flag[1]");
 #endif
@@ -1729,7 +1729,7 @@ void HLSWriter::codeSliceHeader         ( Slice* pcSlice )
 #endif
     {
       CHECK(pcSlice->getMaxNumMergeCand() > MRG_MAX_NUM_CANDS, "More merge candidates signalled than supported");
-#if JVET_O0238_PPS_OR_SLICE      
+#if JVET_O0238_PPS_OR_SLICE
       if (!pcSlice->getPPS()->getPPSSixMinusMaxNumMergeCandPlus1())
       {
         WRITE_UVLC(MRG_MAX_NUM_CANDS - pcSlice->getMaxNumMergeCand(), "six_minus_max_num_merge_cand");
@@ -1784,7 +1784,7 @@ void HLSWriter::codeSliceHeader         ( Slice* pcSlice )
       {
         CHECK(pcSlice->getMaxNumMergeCand() < pcSlice->getMaxNumTriangleCand(), "Incorrrect max number of triangle candidates!");
 #if JVET_O0238_PPS_OR_SLICE
-        if (!pcSlice->getPPS()->getPPSMaxNumMergeCandMinusMaxNumTriangleCandPlus1()) 
+        if (!pcSlice->getPPS()->getPPSMaxNumMergeCandMinusMaxNumTriangleCandPlus1())
         {
           WRITE_UVLC(pcSlice->getMaxNumMergeCand() - pcSlice->getMaxNumTriangleCand(), "max_num_merge_cand_minus_max_num_triangle_cand");
         }
diff --git a/source/Lib/Utilities/VideoIOYuv.cpp b/source/Lib/Utilities/VideoIOYuv.cpp
index 9bdcaec6c..91ca6bc05 100644
--- a/source/Lib/Utilities/VideoIOYuv.cpp
+++ b/source/Lib/Utilities/VideoIOYuv.cpp
@@ -682,7 +682,7 @@ static bool writePlane(ostream& fd, const Pel* src,
     }
 
 #if JVET_O1164_RPR
-    // here height444 and orgHeight are luma heights 
+    // here height444 and orgHeight are luma heights
     for( uint32_t y444 = height444; y444 < orgHeight; y444++ )
     {
       if( ( y444 & mask_y_file ) == 0 ) // if this is chroma, determine whether to skip every other row
-- 
GitLab