Changeset 1316 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibDecoder


Ignore:
Timestamp:
21 Jul 2015, 20:08:08 (10 years ago)
Author:
seregin
Message:

port rev 4391

Location:
branches/SHM-dev/source/Lib/TLibDecoder
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1307 r1316  
    363363        {
    364364          case PPS_EXT__REXT:
    365             assert(!bSkipTrailingExtensionBits);
    366 
    367             if (pcPPS->getUseTransformSkip())
    368365            {
    369               READ_UVLC( uiCode, "log2_max_transform_skip_block_size_minus2");
    370               pcPPS->setTransformSkipLog2MaxSize(uiCode+2);
     366              TComPPSRExt &ppsRangeExtension = pcPPS->getPpsRangeExtension();
     367              assert(!bSkipTrailingExtensionBits);
     368
     369              if (pcPPS->getUseTransformSkip())
     370              {
     371                READ_UVLC( uiCode, "log2_max_transform_skip_block_size_minus2");
     372                ppsRangeExtension.setLog2MaxTransformSkipBlockSize(uiCode+2);
     373              }
     374
     375              READ_FLAG( uiCode, "cross_component_prediction_enabled_flag");
     376              ppsRangeExtension.setCrossComponentPredictionEnabledFlag(uiCode != 0);
     377
     378              READ_FLAG( uiCode, "chroma_qp_offset_list_enabled_flag");
     379              if (uiCode == 0)
     380              {
     381                ppsRangeExtension.clearChromaQpOffsetList();
     382                ppsRangeExtension.setDiffCuChromaQpOffsetDepth(0);
     383              }
     384              else
     385              {
     386                READ_UVLC(uiCode, "diff_cu_chroma_qp_offset_depth"); ppsRangeExtension.setDiffCuChromaQpOffsetDepth(uiCode);
     387                UInt tableSizeMinus1 = 0;
     388                READ_UVLC(tableSizeMinus1, "chroma_qp_offset_list_len_minus1");
     389                assert(tableSizeMinus1 < MAX_QP_OFFSET_LIST_SIZE);
     390
     391                for (Int cuChromaQpOffsetIdx = 0; cuChromaQpOffsetIdx <= (tableSizeMinus1); cuChromaQpOffsetIdx++)
     392                {
     393                  Int cbOffset;
     394                  Int crOffset;
     395                  READ_SVLC(cbOffset, "cb_qp_offset_list[i]");
     396                  assert(cbOffset >= -12 && cbOffset <= 12);
     397                  READ_SVLC(crOffset, "cr_qp_offset_list[i]");
     398                  assert(crOffset >= -12 && crOffset <= 12);
     399                  // table uses +1 for index (see comment inside the function)
     400                  ppsRangeExtension.setChromaQpOffsetListEntry(cuChromaQpOffsetIdx+1, cbOffset, crOffset);
     401                }
     402                assert(ppsRangeExtension.getChromaQpOffsetListLen() == tableSizeMinus1 + 1);
     403              }
     404
     405              READ_UVLC( uiCode, "log2_sao_offset_scale_luma");
     406              ppsRangeExtension.setLog2SaoOffsetScale(CHANNEL_TYPE_LUMA, uiCode);
     407              READ_UVLC( uiCode, "log2_sao_offset_scale_chroma");
     408              ppsRangeExtension.setLog2SaoOffsetScale(CHANNEL_TYPE_CHROMA, uiCode);
    371409            }
    372 
    373             READ_FLAG( uiCode, "cross_component_prediction_enabled_flag");
    374             pcPPS->setUseCrossComponentPrediction(uiCode != 0);
    375 
    376             READ_FLAG( uiCode, "chroma_qp_offset_list_enabled_flag");
    377             if (uiCode == 0)
    378             {
    379               pcPPS->clearChromaQpAdjTable();
    380               pcPPS->setMaxCuChromaQpAdjDepth(0);
    381             }
    382             else
    383             {
    384               READ_UVLC(uiCode, "diff_cu_chroma_qp_offset_depth"); pcPPS->setMaxCuChromaQpAdjDepth(uiCode);
    385               UInt tableSizeMinus1 = 0;
    386               READ_UVLC(tableSizeMinus1, "chroma_qp_offset_list_len_minus1");
    387               assert(tableSizeMinus1 < MAX_QP_OFFSET_LIST_SIZE);
    388 
    389               for (Int cuChromaQpOffsetIdx = 0; cuChromaQpOffsetIdx <= (tableSizeMinus1); cuChromaQpOffsetIdx++)
    390               {
    391                 Int cbOffset;
    392                 Int crOffset;
    393                 READ_SVLC(cbOffset, "cb_qp_offset_list[i]");
    394                 assert(cbOffset >= -12 && cbOffset <= 12);
    395                 READ_SVLC(crOffset, "cr_qp_offset_list[i]");
    396                 assert(crOffset >= -12 && crOffset <= 12);
    397                 // table uses +1 for index (see comment inside the function)
    398                 pcPPS->setChromaQpAdjTableAt(cuChromaQpOffsetIdx+1, cbOffset, crOffset);
    399               }
    400               assert(pcPPS->getChromaQpAdjTableSize() == tableSizeMinus1 + 1);
    401             }
    402 
    403             READ_UVLC( uiCode, "log2_sao_offset_scale_luma");
    404             pcPPS->setSaoOffsetBitShift(CHANNEL_TYPE_LUMA, uiCode);
    405             READ_UVLC( uiCode, "log2_sao_offset_scale_chroma");
    406             pcPPS->setSaoOffsetBitShift(CHANNEL_TYPE_CHROMA, uiCode);
    407410            break;
    408411
     
    986989          case SPS_EXT__REXT:
    987990            assert(!bSkipTrailingExtensionBits);
    988 
    989             READ_FLAG( uiCode, "transform_skip_rotation_enabled_flag");     pcSPS->setUseResidualRotation                    (uiCode != 0);
    990             READ_FLAG( uiCode, "transform_skip_context_enabled_flag");      pcSPS->setUseSingleSignificanceMapContext        (uiCode != 0);
    991             READ_FLAG( uiCode, "implicit_rdpcm_enabled_flag");              pcSPS->setUseResidualDPCM(RDPCM_SIGNAL_IMPLICIT, (uiCode != 0));
    992             READ_FLAG( uiCode, "explicit_rdpcm_enabled_flag");              pcSPS->setUseResidualDPCM(RDPCM_SIGNAL_EXPLICIT, (uiCode != 0));
    993             READ_FLAG( uiCode, "extended_precision_processing_flag");       pcSPS->setUseExtendedPrecision                   (uiCode != 0);
    994             READ_FLAG( uiCode, "intra_smoothing_disabled_flag");            pcSPS->setDisableIntraReferenceSmoothing         (uiCode != 0);
    995             READ_FLAG( uiCode, "high_precision_offsets_enabled_flag");      pcSPS->setUseHighPrecisionPredictionWeighting    (uiCode != 0);
    996             READ_FLAG( uiCode, "persistent_rice_adaptation_enabled_flag");  pcSPS->setUseGolombRiceParameterAdaptation       (uiCode != 0);
    997             READ_FLAG( uiCode, "cabac_bypass_alignment_enabled_flag");      pcSPS->setAlignCABACBeforeBypass                 (uiCode != 0);
     991            {
     992              TComSPSRExt &spsRangeExtension = pcSPS->getSpsRangeExtension();
     993              READ_FLAG( uiCode, "transform_skip_rotation_enabled_flag");     spsRangeExtension.setTransformSkipRotationEnabledFlag(uiCode != 0);
     994              READ_FLAG( uiCode, "transform_skip_context_enabled_flag");      spsRangeExtension.setTransformSkipContextEnabledFlag (uiCode != 0);
     995              READ_FLAG( uiCode, "implicit_rdpcm_enabled_flag");              spsRangeExtension.setRdpcmEnabledFlag(RDPCM_SIGNAL_IMPLICIT, (uiCode != 0));
     996              READ_FLAG( uiCode, "explicit_rdpcm_enabled_flag");              spsRangeExtension.setRdpcmEnabledFlag(RDPCM_SIGNAL_EXPLICIT, (uiCode != 0));
     997              READ_FLAG( uiCode, "extended_precision_processing_flag");       spsRangeExtension.setExtendedPrecisionProcessingFlag (uiCode != 0);
     998              READ_FLAG( uiCode, "intra_smoothing_disabled_flag");            spsRangeExtension.setIntraSmoothingDisabledFlag      (uiCode != 0);
     999              READ_FLAG( uiCode, "high_precision_offsets_enabled_flag");      spsRangeExtension.setHighPrecisionOffsetsEnabledFlag (uiCode != 0);
     1000              READ_FLAG( uiCode, "persistent_rice_adaptation_enabled_flag");  spsRangeExtension.setPersistentRiceAdaptationEnabledFlag (uiCode != 0);
     1001              READ_FLAG( uiCode, "cabac_bypass_alignment_enabled_flag");      spsRangeExtension.setCabacBypassAlignmentEnabledFlag  (uiCode != 0);
     1002            }
    9981003            break;
    9991004#if SVC_EXTENSION
     
    18501855    }
    18511856
    1852     if (pps->getChromaQpAdjTableSize() > 0)
     1857    if (pps->getPpsRangeExtension().getChromaQpOffsetListEnabledFlag())
    18531858    {
    18541859      READ_FLAG(uiCode, "cu_chroma_qp_offset_enabled_flag"); pcSlice->setUseChromaQpAdj(uiCode != 0);
     
    24832488        READ_SVLC( wp[COMPONENT_Y].iOffset, iNumRef==0?"luma_offset_l0[i]":"luma_offset_l1[i]" );
    24842489#if SVC_EXTENSION
    2485         Int range=sps->getUseHighPrecisionPredictionWeighting() ? (1<<pcSlice->getBitDepth(CHANNEL_TYPE_LUMA))/2 : 128;
     2490        Int range=sps->getSpsRangeExtension().getHighPrecisionOffsetsEnabledFlag() ? (1<<pcSlice->getBitDepth(CHANNEL_TYPE_LUMA))/2 : 128;       
    24862491#else
    2487         Int range=sps->getUseHighPrecisionPredictionWeighting() ? (1<<sps->getBitDepth(CHANNEL_TYPE_LUMA))/2 : 128;
     2492        Int range=sps->getSpsRangeExtension().getHighPrecisionOffsetsEnabledFlag() ? (1<<sps->getBitDepth(CHANNEL_TYPE_LUMA))/2 : 128;
    24882493#endif
    24892494        assert( wp[0].iOffset >= -range );
     
    25002505        {
    25012506#if SVC_EXTENSION
    2502           Int range=sps->getUseHighPrecisionPredictionWeighting() ? (1<<pcSlice->getBitDepth(CHANNEL_TYPE_CHROMA))/2 : 128;
     2507          Int range=sps->getSpsRangeExtension().getHighPrecisionOffsetsEnabledFlag() ? (1<<pcSlice->getBitDepth(CHANNEL_TYPE_CHROMA))/2 : 128;
    25032508#else
    2504           Int range=sps->getUseHighPrecisionPredictionWeighting() ? (1<<sps->getBitDepth(CHANNEL_TYPE_CHROMA))/2 : 128;
     2509          Int range=sps->getSpsRangeExtension().getHighPrecisionOffsetsEnabledFlag() ? (1<<sps->getBitDepth(CHANNEL_TYPE_CHROMA))/2 : 128;
    25052510#endif
    25062511          for ( Int j=1 ; j<numValidComp ; j++ )
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp

    r1315 r1316  
    244244    }
    245245
    246     if( uiDepth == pps.getMaxCuChromaQpAdjDepth() && pcCU->getSlice()->getUseChromaQpAdj() )
     246    if( uiDepth == pps.getPpsRangeExtension().getDiffCuChromaQpOffsetDepth() && pcCU->getSlice()->getUseChromaQpAdj() )
    247247    {
    248248      setIsChromaQpAdjCoded(true);
     
    286286  }
    287287
    288   if( uiDepth <= pps.getMaxCuChromaQpAdjDepth() && pcCU->getSlice()->getUseChromaQpAdj() )
     288  if( uiDepth <= pps.getPpsRangeExtension().getDiffCuChromaQpOffsetDepth() && pcCU->getSlice()->getUseChromaQpAdj() )
    289289  {
    290290    setIsChromaQpAdjCoded(true);
     
    576576  Bool  bLeftAvail  = false;
    577577
    578   const Bool bUseFilteredPredictions=TComPrediction::filteringIntraReferenceSamples(compID, uiChFinalMode, uiWidth, uiHeight, chFmt, pcCU->getSlice()->getSPS()->getDisableIntraReferenceSmoothing());
     578  const Bool bUseFilteredPredictions=TComPrediction::filteringIntraReferenceSamples(compID, uiChFinalMode, uiWidth, uiHeight, chFmt, pcCU->getSlice()->getSPS()->getSpsRangeExtension().getIntraSmoothingDisabledFlag());
    579579
    580580#ifdef DEBUG_STRING
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp

    r1315 r1316  
    851851  TComDataCU *pcCU = rTu.getCU();
    852852
    853   if( isLuma(compID) || !pcCU->getSlice()->getPPS()->getUseCrossComponentPrediction() )
     853  if( isLuma(compID) || !pcCU->getSlice()->getPPS()->getPpsRangeExtension().getCrossComponentPredictionEnabledFlag() )
    854854  {
    855855    return;
     
    983983#endif
    984984
    985   Int tableSize = cu->getSlice()->getPPS()->getChromaQpAdjTableSize();
    986 
    987   /* cu_chroma_qp_adjustment_flag */
     985  Int chromaQpOffsetListLen = cu->getSlice()->getPPS()->getPpsRangeExtension().getChromaQpOffsetListLen();
     986
     987  // cu_chroma_qp_offset_flag
    988988  m_pcTDecBinIf->decodeBin( symbol, m_ChromaQpAdjFlagSCModel.get( 0, 0, 0 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) );
    989989
    990   if (symbol && tableSize > 1)
    991   {
    992     /* cu_chroma_qp_adjustment_idc */
    993     xReadUnaryMaxSymbol( symbol,  &m_ChromaQpAdjIdcSCModel.get( 0, 0, 0 ), 0, tableSize - 1 RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) );
     990  if (symbol && chromaQpOffsetListLen > 1)
     991  {
     992    // cu_chroma_qp_offset_idx
     993    xReadUnaryMaxSymbol( symbol,  &m_ChromaQpAdjIdcSCModel.get( 0, 0, 0 ), 0, chromaQpOffsetListLen - 1 RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) );
    994994    symbol++;
    995995  }
     
    11131113  }
    11141114
    1115   if (!TUCompRectHasAssociatedTransformSkipFlag(rTu.getRect(component), pcCU->getSlice()->getPPS()->getTransformSkipLog2MaxSize()))
     1115  if (!TUCompRectHasAssociatedTransformSkipFlag(rTu.getRect(component), pcCU->getSlice()->getPPS()->getPpsRangeExtension().getLog2MaxTransformSkipBlockSize()))
    11161116  {
    11171117    return;
     
    12861286
    12871287  const ChannelType  channelType       = toChannelType(compID);
    1288   const Bool         extendedPrecision = sps.getUseExtendedPrecision();
    1289 
    1290   const Bool         alignCABACBeforeBypass = sps.getAlignCABACBeforeBypass();
     1288  const Bool         extendedPrecision = sps.getSpsRangeExtension().getExtendedPrecisionProcessingFlag();
     1289
     1290  const Bool         alignCABACBeforeBypass = sps.getSpsRangeExtension().getCabacBypassAlignmentEnabledFlag();
    12911291  const Int          maxLog2TrDynamicRange  = sps.getMaxLog2TrDynamicRange(channelType);
    12921292
     
    13511351  //--------------------------------------------------------------------------------------------------
    13521352
    1353   const Bool  bUseGolombRiceParameterAdaptation = sps.getUseGolombRiceParameterAdaptation();
     1353  const Bool  bUseGolombRiceParameterAdaptation = sps.getSpsRangeExtension().getPersistentRiceAdaptationEnabledFlag();
    13541354        UInt &currentGolombRiceStatistic        = m_golombRiceAdaptationStatistics[rTu.getGolombRiceStatisticsIndex(compID)];
    13551355
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r1307 r1316  
    433433
    434434#if RExt__HIGH_BIT_DEPTH_SUPPORT==0
    435     if (sps->getUseExtendedPrecision() || sps->getBitDepth(CHANNEL_TYPE_LUMA)>12 || sps->getBitDepth(CHANNEL_TYPE_CHROMA)>12 )
     435    if (sps->getSpsRangeExtension().getExtendedPrecisionProcessingFlag() || sps->getBitDepth(CHANNEL_TYPE_LUMA)>12 || sps->getBitDepth(CHANNEL_TYPE_CHROMA)>12 )
    436436    {
    437437      printf("High bit depth support must be enabled at compile-time in order to decode this bitstream\n");
     
    604604    // Initialise the various objects for the new set of settings
    605605#if SVC_EXTENSION
    606     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) );
     606    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) );
    607607#else
    608     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) );
     608    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) );
    609609#endif
    610610    m_cLoopFilter.create( sps->getMaxTotalCUDepth() );
Note: See TracChangeset for help on using the changeset viewer.