Index: branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1315)
+++ branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1316)
@@ -363,46 +363,49 @@
         {
           case PPS_EXT__REXT:
-            assert(!bSkipTrailingExtensionBits);
-
-            if (pcPPS->getUseTransformSkip())
             {
-              READ_UVLC( uiCode, "log2_max_transform_skip_block_size_minus2");
-              pcPPS->setTransformSkipLog2MaxSize(uiCode+2);
+              TComPPSRExt &ppsRangeExtension = pcPPS->getPpsRangeExtension();
+              assert(!bSkipTrailingExtensionBits);
+
+              if (pcPPS->getUseTransformSkip())
+              {
+                READ_UVLC( uiCode, "log2_max_transform_skip_block_size_minus2");
+                ppsRangeExtension.setLog2MaxTransformSkipBlockSize(uiCode+2);
+              }
+
+              READ_FLAG( uiCode, "cross_component_prediction_enabled_flag");
+              ppsRangeExtension.setCrossComponentPredictionEnabledFlag(uiCode != 0);
+
+              READ_FLAG( uiCode, "chroma_qp_offset_list_enabled_flag");
+              if (uiCode == 0)
+              {
+                ppsRangeExtension.clearChromaQpOffsetList();
+                ppsRangeExtension.setDiffCuChromaQpOffsetDepth(0);
+              }
+              else
+              {
+                READ_UVLC(uiCode, "diff_cu_chroma_qp_offset_depth"); ppsRangeExtension.setDiffCuChromaQpOffsetDepth(uiCode);
+                UInt tableSizeMinus1 = 0;
+                READ_UVLC(tableSizeMinus1, "chroma_qp_offset_list_len_minus1");
+                assert(tableSizeMinus1 < MAX_QP_OFFSET_LIST_SIZE);
+
+                for (Int cuChromaQpOffsetIdx = 0; cuChromaQpOffsetIdx <= (tableSizeMinus1); cuChromaQpOffsetIdx++)
+                {
+                  Int cbOffset;
+                  Int crOffset;
+                  READ_SVLC(cbOffset, "cb_qp_offset_list[i]");
+                  assert(cbOffset >= -12 && cbOffset <= 12);
+                  READ_SVLC(crOffset, "cr_qp_offset_list[i]");
+                  assert(crOffset >= -12 && crOffset <= 12);
+                  // table uses +1 for index (see comment inside the function)
+                  ppsRangeExtension.setChromaQpOffsetListEntry(cuChromaQpOffsetIdx+1, cbOffset, crOffset);
+                }
+                assert(ppsRangeExtension.getChromaQpOffsetListLen() == tableSizeMinus1 + 1);
+              }
+
+              READ_UVLC( uiCode, "log2_sao_offset_scale_luma");
+              ppsRangeExtension.setLog2SaoOffsetScale(CHANNEL_TYPE_LUMA, uiCode);
+              READ_UVLC( uiCode, "log2_sao_offset_scale_chroma");
+              ppsRangeExtension.setLog2SaoOffsetScale(CHANNEL_TYPE_CHROMA, uiCode);
             }
-
-            READ_FLAG( uiCode, "cross_component_prediction_enabled_flag");
-            pcPPS->setUseCrossComponentPrediction(uiCode != 0);
-
-            READ_FLAG( uiCode, "chroma_qp_offset_list_enabled_flag");
-            if (uiCode == 0)
-            {
-              pcPPS->clearChromaQpAdjTable();
-              pcPPS->setMaxCuChromaQpAdjDepth(0);
-            }
-            else
-            {
-              READ_UVLC(uiCode, "diff_cu_chroma_qp_offset_depth"); pcPPS->setMaxCuChromaQpAdjDepth(uiCode);
-              UInt tableSizeMinus1 = 0;
-              READ_UVLC(tableSizeMinus1, "chroma_qp_offset_list_len_minus1");
-              assert(tableSizeMinus1 < MAX_QP_OFFSET_LIST_SIZE);
-
-              for (Int cuChromaQpOffsetIdx = 0; cuChromaQpOffsetIdx <= (tableSizeMinus1); cuChromaQpOffsetIdx++)
-              {
-                Int cbOffset;
-                Int crOffset;
-                READ_SVLC(cbOffset, "cb_qp_offset_list[i]");
-                assert(cbOffset >= -12 && cbOffset <= 12); 
-                READ_SVLC(crOffset, "cr_qp_offset_list[i]");
-                assert(crOffset >= -12 && crOffset <= 12);
-                // table uses +1 for index (see comment inside the function)
-                pcPPS->setChromaQpAdjTableAt(cuChromaQpOffsetIdx+1, cbOffset, crOffset);
-              }
-              assert(pcPPS->getChromaQpAdjTableSize() == tableSizeMinus1 + 1);
-            }
-
-            READ_UVLC( uiCode, "log2_sao_offset_scale_luma");
-            pcPPS->setSaoOffsetBitShift(CHANNEL_TYPE_LUMA, uiCode);
-            READ_UVLC( uiCode, "log2_sao_offset_scale_chroma");
-            pcPPS->setSaoOffsetBitShift(CHANNEL_TYPE_CHROMA, uiCode);
             break;
 
@@ -986,14 +989,16 @@
           case SPS_EXT__REXT:
             assert(!bSkipTrailingExtensionBits);
-
-            READ_FLAG( uiCode, "transform_skip_rotation_enabled_flag");     pcSPS->setUseResidualRotation                    (uiCode != 0);
-            READ_FLAG( uiCode, "transform_skip_context_enabled_flag");      pcSPS->setUseSingleSignificanceMapContext        (uiCode != 0);
-            READ_FLAG( uiCode, "implicit_rdpcm_enabled_flag");              pcSPS->setUseResidualDPCM(RDPCM_SIGNAL_IMPLICIT, (uiCode != 0));
-            READ_FLAG( uiCode, "explicit_rdpcm_enabled_flag");              pcSPS->setUseResidualDPCM(RDPCM_SIGNAL_EXPLICIT, (uiCode != 0));
-            READ_FLAG( uiCode, "extended_precision_processing_flag");       pcSPS->setUseExtendedPrecision                   (uiCode != 0);
-            READ_FLAG( uiCode, "intra_smoothing_disabled_flag");            pcSPS->setDisableIntraReferenceSmoothing         (uiCode != 0);
-            READ_FLAG( uiCode, "high_precision_offsets_enabled_flag");      pcSPS->setUseHighPrecisionPredictionWeighting    (uiCode != 0);
-            READ_FLAG( uiCode, "persistent_rice_adaptation_enabled_flag");  pcSPS->setUseGolombRiceParameterAdaptation       (uiCode != 0);
-            READ_FLAG( uiCode, "cabac_bypass_alignment_enabled_flag");      pcSPS->setAlignCABACBeforeBypass                 (uiCode != 0);
+            {
+              TComSPSRExt &spsRangeExtension = pcSPS->getSpsRangeExtension();
+              READ_FLAG( uiCode, "transform_skip_rotation_enabled_flag");     spsRangeExtension.setTransformSkipRotationEnabledFlag(uiCode != 0);
+              READ_FLAG( uiCode, "transform_skip_context_enabled_flag");      spsRangeExtension.setTransformSkipContextEnabledFlag (uiCode != 0);
+              READ_FLAG( uiCode, "implicit_rdpcm_enabled_flag");              spsRangeExtension.setRdpcmEnabledFlag(RDPCM_SIGNAL_IMPLICIT, (uiCode != 0));
+              READ_FLAG( uiCode, "explicit_rdpcm_enabled_flag");              spsRangeExtension.setRdpcmEnabledFlag(RDPCM_SIGNAL_EXPLICIT, (uiCode != 0));
+              READ_FLAG( uiCode, "extended_precision_processing_flag");       spsRangeExtension.setExtendedPrecisionProcessingFlag (uiCode != 0);
+              READ_FLAG( uiCode, "intra_smoothing_disabled_flag");            spsRangeExtension.setIntraSmoothingDisabledFlag      (uiCode != 0);
+              READ_FLAG( uiCode, "high_precision_offsets_enabled_flag");      spsRangeExtension.setHighPrecisionOffsetsEnabledFlag (uiCode != 0);
+              READ_FLAG( uiCode, "persistent_rice_adaptation_enabled_flag");  spsRangeExtension.setPersistentRiceAdaptationEnabledFlag (uiCode != 0);
+              READ_FLAG( uiCode, "cabac_bypass_alignment_enabled_flag");      spsRangeExtension.setCabacBypassAlignmentEnabledFlag  (uiCode != 0);
+            }
             break;
 #if SVC_EXTENSION
@@ -1850,5 +1855,5 @@
     }
 
-    if (pps->getChromaQpAdjTableSize() > 0)
+    if (pps->getPpsRangeExtension().getChromaQpOffsetListEnabledFlag())
     {
       READ_FLAG(uiCode, "cu_chroma_qp_offset_enabled_flag"); pcSlice->setUseChromaQpAdj(uiCode != 0);
@@ -2483,7 +2488,7 @@
         READ_SVLC( wp[COMPONENT_Y].iOffset, iNumRef==0?"luma_offset_l0[i]":"luma_offset_l1[i]" );
 #if SVC_EXTENSION
-        Int range=sps->getUseHighPrecisionPredictionWeighting() ? (1<<pcSlice->getBitDepth(CHANNEL_TYPE_LUMA))/2 : 128;
+        Int range=sps->getSpsRangeExtension().getHighPrecisionOffsetsEnabledFlag() ? (1<<pcSlice->getBitDepth(CHANNEL_TYPE_LUMA))/2 : 128;        
 #else
-        Int range=sps->getUseHighPrecisionPredictionWeighting() ? (1<<sps->getBitDepth(CHANNEL_TYPE_LUMA))/2 : 128;
+        Int range=sps->getSpsRangeExtension().getHighPrecisionOffsetsEnabledFlag() ? (1<<sps->getBitDepth(CHANNEL_TYPE_LUMA))/2 : 128;
 #endif
         assert( wp[0].iOffset >= -range );
@@ -2500,7 +2505,7 @@
         {
 #if SVC_EXTENSION
-          Int range=sps->getUseHighPrecisionPredictionWeighting() ? (1<<pcSlice->getBitDepth(CHANNEL_TYPE_CHROMA))/2 : 128;
+          Int range=sps->getSpsRangeExtension().getHighPrecisionOffsetsEnabledFlag() ? (1<<pcSlice->getBitDepth(CHANNEL_TYPE_CHROMA))/2 : 128;
 #else
-          Int range=sps->getUseHighPrecisionPredictionWeighting() ? (1<<sps->getBitDepth(CHANNEL_TYPE_CHROMA))/2 : 128;
+          Int range=sps->getSpsRangeExtension().getHighPrecisionOffsetsEnabledFlag() ? (1<<sps->getBitDepth(CHANNEL_TYPE_CHROMA))/2 : 128;
 #endif
           for ( Int j=1 ; j<numValidComp ; j++ )
Index: branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp	(revision 1315)
+++ branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp	(revision 1316)
@@ -244,5 +244,5 @@
     }
 
-    if( uiDepth == pps.getMaxCuChromaQpAdjDepth() && pcCU->getSlice()->getUseChromaQpAdj() )
+    if( uiDepth == pps.getPpsRangeExtension().getDiffCuChromaQpOffsetDepth() && pcCU->getSlice()->getUseChromaQpAdj() )
     {
       setIsChromaQpAdjCoded(true);
@@ -286,5 +286,5 @@
   }
 
-  if( uiDepth <= pps.getMaxCuChromaQpAdjDepth() && pcCU->getSlice()->getUseChromaQpAdj() )
+  if( uiDepth <= pps.getPpsRangeExtension().getDiffCuChromaQpOffsetDepth() && pcCU->getSlice()->getUseChromaQpAdj() )
   {
     setIsChromaQpAdjCoded(true);
@@ -576,5 +576,5 @@
   Bool  bLeftAvail  = false;
 
-  const Bool bUseFilteredPredictions=TComPrediction::filteringIntraReferenceSamples(compID, uiChFinalMode, uiWidth, uiHeight, chFmt, pcCU->getSlice()->getSPS()->getDisableIntraReferenceSmoothing());
+  const Bool bUseFilteredPredictions=TComPrediction::filteringIntraReferenceSamples(compID, uiChFinalMode, uiWidth, uiHeight, chFmt, pcCU->getSlice()->getSPS()->getSpsRangeExtension().getIntraSmoothingDisabledFlag());
 
 #ifdef DEBUG_STRING
Index: branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 1315)
+++ branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 1316)
@@ -851,5 +851,5 @@
   TComDataCU *pcCU = rTu.getCU();
 
-  if( isLuma(compID) || !pcCU->getSlice()->getPPS()->getUseCrossComponentPrediction() )
+  if( isLuma(compID) || !pcCU->getSlice()->getPPS()->getPpsRangeExtension().getCrossComponentPredictionEnabledFlag() )
   {
     return;
@@ -983,13 +983,13 @@
 #endif
 
-  Int tableSize = cu->getSlice()->getPPS()->getChromaQpAdjTableSize();
-
-  /* cu_chroma_qp_adjustment_flag */
+  Int chromaQpOffsetListLen = cu->getSlice()->getPPS()->getPpsRangeExtension().getChromaQpOffsetListLen();
+
+  // cu_chroma_qp_offset_flag
   m_pcTDecBinIf->decodeBin( symbol, m_ChromaQpAdjFlagSCModel.get( 0, 0, 0 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) );
 
-  if (symbol && tableSize > 1)
-  {
-    /* cu_chroma_qp_adjustment_idc */
-    xReadUnaryMaxSymbol( symbol,  &m_ChromaQpAdjIdcSCModel.get( 0, 0, 0 ), 0, tableSize - 1 RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) );
+  if (symbol && chromaQpOffsetListLen > 1)
+  {
+    // cu_chroma_qp_offset_idx
+    xReadUnaryMaxSymbol( symbol,  &m_ChromaQpAdjIdcSCModel.get( 0, 0, 0 ), 0, chromaQpOffsetListLen - 1 RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) );
     symbol++;
   }
@@ -1113,5 +1113,5 @@
   }
 
-  if (!TUCompRectHasAssociatedTransformSkipFlag(rTu.getRect(component), pcCU->getSlice()->getPPS()->getTransformSkipLog2MaxSize()))
+  if (!TUCompRectHasAssociatedTransformSkipFlag(rTu.getRect(component), pcCU->getSlice()->getPPS()->getPpsRangeExtension().getLog2MaxTransformSkipBlockSize()))
   {
     return;
@@ -1286,7 +1286,7 @@
 
   const ChannelType  channelType       = toChannelType(compID);
-  const Bool         extendedPrecision = sps.getUseExtendedPrecision();
-
-  const Bool         alignCABACBeforeBypass = sps.getAlignCABACBeforeBypass();
+  const Bool         extendedPrecision = sps.getSpsRangeExtension().getExtendedPrecisionProcessingFlag();
+
+  const Bool         alignCABACBeforeBypass = sps.getSpsRangeExtension().getCabacBypassAlignmentEnabledFlag();
   const Int          maxLog2TrDynamicRange  = sps.getMaxLog2TrDynamicRange(channelType);
 
@@ -1351,5 +1351,5 @@
   //--------------------------------------------------------------------------------------------------
 
-  const Bool  bUseGolombRiceParameterAdaptation = sps.getUseGolombRiceParameterAdaptation();
+  const Bool  bUseGolombRiceParameterAdaptation = sps.getSpsRangeExtension().getPersistentRiceAdaptationEnabledFlag();
         UInt &currentGolombRiceStatistic        = m_golombRiceAdaptationStatistics[rTu.getGolombRiceStatisticsIndex(compID)];
 
Index: branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1315)
+++ branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1316)
@@ -433,5 +433,5 @@
 
 #if RExt__HIGH_BIT_DEPTH_SUPPORT==0
-    if (sps->getUseExtendedPrecision() || sps->getBitDepth(CHANNEL_TYPE_LUMA)>12 || sps->getBitDepth(CHANNEL_TYPE_CHROMA)>12 )
+    if (sps->getSpsRangeExtension().getExtendedPrecisionProcessingFlag() || sps->getBitDepth(CHANNEL_TYPE_LUMA)>12 || sps->getBitDepth(CHANNEL_TYPE_CHROMA)>12 )
     {
       printf("High bit depth support must be enabled at compile-time in order to decode this bitstream\n");
@@ -604,7 +604,7 @@
     // Initialise the various objects for the new set of settings
 #if SVC_EXTENSION
-    m_cSAO.create( pSlice->getPicWidthInLumaSamples(), pSlice->getPicHeightInLumaSamples(), pSlice->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) );
+    m_cSAO.create( pSlice->getPicWidthInLumaSamples(), pSlice->getPicHeightInLumaSamples(), pSlice->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), pps->getPpsRangeExtension().getLog2SaoOffsetScale(CHANNEL_TYPE_LUMA), pps->getPpsRangeExtension().getLog2SaoOffsetScale(CHANNEL_TYPE_CHROMA) );
 #else
-    m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) );
+    m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), pps->getPpsRangeExtension().getLog2SaoOffsetScale(CHANNEL_TYPE_LUMA), pps->getPpsRangeExtension().getLog2SaoOffsetScale(CHANNEL_TYPE_CHROMA) );
 #endif
     m_cLoopFilter.create( sps->getMaxTotalCUDepth() );
