diff --git a/cfg/nonCTC-SliceConfigExamples/subpicture_4Slice2VerSubPic.cfg b/cfg/nonCTC-SliceConfigExamples/subpicture_4Slice2VerSubPic.cfg
index 041edbea93efc0e590ba9883af469b24ef8fc0f1..e022ae23f5590ec87f9683e8541a5af1b51dda44 100644
--- a/cfg/nonCTC-SliceConfigExamples/subpicture_4Slice2VerSubPic.cfg
+++ b/cfg/nonCTC-SliceConfigExamples/subpicture_4Slice2VerSubPic.cfg
@@ -19,8 +19,8 @@ SubPicWidth                             : 4 3           # specifies the width of
 SubPicHeight                          	: 4 4           # specifies the height of the i-th subpicture in units of CtbSizeY
 SubPicTreatedAsPicFlag                  : 1 1           # equal to 1 specifies that the i-th subpicture of each coded picture in the CLVS is treated as a picture in the decoding process excluding in-loop filtering operations
 LoopFilterAcrossSubpicEnabledFlag       : 0 0           # equal to 1 specifies that in-loop filtering operations may be performed across the boundaries of the i-th subpicture in each coded picture in the CLVS
-SubPicIdPresentFlag                     : 0
-SubPicIdSignallingPresentFlag           : 0
+SubPicIdPresentFlag                     : 0             # equal to 1 specifies that the subpicture ID mapping is explicitly signalled, either in the SPS or in the PPSs
+SubPicIdSignallingPresentFlag           : 0             # specifies that subpicture ID mapping is signalled in the SPS(0: OFF, 1: ON)
 SubPicIdLen                             : 0             # the number of bits used to represent the syntax element sps_subpic_id[ i ]
 SubPicId                                : 0             # subpicture ID of the i-th subpicture
 
diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp
index ad2cd7220fbbf4a0f4f5c28d82e1a08dcdb3aaef..97669c0af606f16d61d8ed286e3d9d2f84e86159 100644
--- a/source/Lib/CommonLib/Slice.cpp
+++ b/source/Lib/CommonLib/Slice.cpp
@@ -2634,6 +2634,13 @@ void PPS::initSubPic(const SPS &sps)
 {
   CHECK(getNumSubPics() > MAX_NUM_SUB_PICS, "Number of sub-pictures in picture exceeds valid range");
   m_subPics.resize(getNumSubPics());
+  // m_ctuSize,  m_picWidthInCtu, and m_picHeightInCtu might not be initialized yet.
+  if (m_ctuSize == 0 || m_picWidthInCtu == 0 || m_picHeightInCtu == 0)
+  {
+    m_ctuSize = sps.getCTUSize();
+    m_picWidthInCtu = (m_picWidthInLumaSamples + m_ctuSize - 1) / m_ctuSize;
+    m_picHeightInCtu = (m_picHeightInLumaSamples + m_ctuSize - 1) / m_ctuSize;
+  }
   for (int i=0; i< getNumSubPics(); i++)
   {
     m_subPics[i].setSubPicIdx(i);
@@ -2667,13 +2674,6 @@ void PPS::initSubPic(const SPS &sps)
     if (m_numSlicesInPic == 1)
     {
       CHECK(getNumSubPics() != 1, "only one slice in picture, but number of subpic is not one");
-      // m_ctuSize,  m_picWidthInCtu, and m_picHeightInCtu might not be initialized yet.
-      if (m_ctuSize == 0 || m_picWidthInCtu == 0 || m_picHeightInCtu == 0)
-      {
-        m_ctuSize = sps.getCTUSize();
-        m_picWidthInCtu = (m_picWidthInLumaSamples + m_ctuSize - 1) / m_ctuSize;
-        m_picHeightInCtu = (m_picHeightInLumaSamples + m_ctuSize - 1) / m_ctuSize;
-      }
       m_subPics[i].addAllCtusInPicToSubPic(0, getPicWidthInCtu(), 0, getPicHeightInCtu(), getPicWidthInCtu());
     }
     else