Changeset 1316 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibDecoder
- Timestamp:
- 21 Jul 2015, 20:08:08 (10 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibDecoder
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1307 r1316 363 363 { 364 364 case PPS_EXT__REXT: 365 assert(!bSkipTrailingExtensionBits);366 367 if (pcPPS->getUseTransformSkip())368 365 { 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); 371 409 } 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 else383 {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);407 410 break; 408 411 … … 986 989 case SPS_EXT__REXT: 987 990 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 } 998 1003 break; 999 1004 #if SVC_EXTENSION … … 1850 1855 } 1851 1856 1852 if (pps->get ChromaQpAdjTableSize() > 0)1857 if (pps->getPpsRangeExtension().getChromaQpOffsetListEnabledFlag()) 1853 1858 { 1854 1859 READ_FLAG(uiCode, "cu_chroma_qp_offset_enabled_flag"); pcSlice->setUseChromaQpAdj(uiCode != 0); … … 2483 2488 READ_SVLC( wp[COMPONENT_Y].iOffset, iNumRef==0?"luma_offset_l0[i]":"luma_offset_l1[i]" ); 2484 2489 #if SVC_EXTENSION 2485 Int range=sps->get UseHighPrecisionPredictionWeighting() ? (1<<pcSlice->getBitDepth(CHANNEL_TYPE_LUMA))/2 : 128;2490 Int range=sps->getSpsRangeExtension().getHighPrecisionOffsetsEnabledFlag() ? (1<<pcSlice->getBitDepth(CHANNEL_TYPE_LUMA))/2 : 128; 2486 2491 #else 2487 Int range=sps->get UseHighPrecisionPredictionWeighting() ? (1<<sps->getBitDepth(CHANNEL_TYPE_LUMA))/2 : 128;2492 Int range=sps->getSpsRangeExtension().getHighPrecisionOffsetsEnabledFlag() ? (1<<sps->getBitDepth(CHANNEL_TYPE_LUMA))/2 : 128; 2488 2493 #endif 2489 2494 assert( wp[0].iOffset >= -range ); … … 2500 2505 { 2501 2506 #if SVC_EXTENSION 2502 Int range=sps->get UseHighPrecisionPredictionWeighting() ? (1<<pcSlice->getBitDepth(CHANNEL_TYPE_CHROMA))/2 : 128;2507 Int range=sps->getSpsRangeExtension().getHighPrecisionOffsetsEnabledFlag() ? (1<<pcSlice->getBitDepth(CHANNEL_TYPE_CHROMA))/2 : 128; 2503 2508 #else 2504 Int range=sps->get UseHighPrecisionPredictionWeighting() ? (1<<sps->getBitDepth(CHANNEL_TYPE_CHROMA))/2 : 128;2509 Int range=sps->getSpsRangeExtension().getHighPrecisionOffsetsEnabledFlag() ? (1<<sps->getBitDepth(CHANNEL_TYPE_CHROMA))/2 : 128; 2505 2510 #endif 2506 2511 for ( Int j=1 ; j<numValidComp ; j++ ) -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp
r1315 r1316 244 244 } 245 245 246 if( uiDepth == pps.get MaxCuChromaQpAdjDepth() && pcCU->getSlice()->getUseChromaQpAdj() )246 if( uiDepth == pps.getPpsRangeExtension().getDiffCuChromaQpOffsetDepth() && pcCU->getSlice()->getUseChromaQpAdj() ) 247 247 { 248 248 setIsChromaQpAdjCoded(true); … … 286 286 } 287 287 288 if( uiDepth <= pps.get MaxCuChromaQpAdjDepth() && pcCU->getSlice()->getUseChromaQpAdj() )288 if( uiDepth <= pps.getPpsRangeExtension().getDiffCuChromaQpOffsetDepth() && pcCU->getSlice()->getUseChromaQpAdj() ) 289 289 { 290 290 setIsChromaQpAdjCoded(true); … … 576 576 Bool bLeftAvail = false; 577 577 578 const Bool bUseFilteredPredictions=TComPrediction::filteringIntraReferenceSamples(compID, uiChFinalMode, uiWidth, uiHeight, chFmt, pcCU->getSlice()->getSPS()->get DisableIntraReferenceSmoothing());578 const Bool bUseFilteredPredictions=TComPrediction::filteringIntraReferenceSamples(compID, uiChFinalMode, uiWidth, uiHeight, chFmt, pcCU->getSlice()->getSPS()->getSpsRangeExtension().getIntraSmoothingDisabledFlag()); 579 579 580 580 #ifdef DEBUG_STRING -
branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp
r1315 r1316 851 851 TComDataCU *pcCU = rTu.getCU(); 852 852 853 if( isLuma(compID) || !pcCU->getSlice()->getPPS()->get UseCrossComponentPrediction() )853 if( isLuma(compID) || !pcCU->getSlice()->getPPS()->getPpsRangeExtension().getCrossComponentPredictionEnabledFlag() ) 854 854 { 855 855 return; … … 983 983 #endif 984 984 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 988 988 m_pcTDecBinIf->decodeBin( symbol, m_ChromaQpAdjFlagSCModel.get( 0, 0, 0 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) ); 989 989 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) ); 994 994 symbol++; 995 995 } … … 1113 1113 } 1114 1114 1115 if (!TUCompRectHasAssociatedTransformSkipFlag(rTu.getRect(component), pcCU->getSlice()->getPPS()->get TransformSkipLog2MaxSize()))1115 if (!TUCompRectHasAssociatedTransformSkipFlag(rTu.getRect(component), pcCU->getSlice()->getPPS()->getPpsRangeExtension().getLog2MaxTransformSkipBlockSize())) 1116 1116 { 1117 1117 return; … … 1286 1286 1287 1287 const ChannelType channelType = toChannelType(compID); 1288 const Bool extendedPrecision = sps.get UseExtendedPrecision();1289 1290 const Bool alignCABACBeforeBypass = sps.get AlignCABACBeforeBypass();1288 const Bool extendedPrecision = sps.getSpsRangeExtension().getExtendedPrecisionProcessingFlag(); 1289 1290 const Bool alignCABACBeforeBypass = sps.getSpsRangeExtension().getCabacBypassAlignmentEnabledFlag(); 1291 1291 const Int maxLog2TrDynamicRange = sps.getMaxLog2TrDynamicRange(channelType); 1292 1292 … … 1351 1351 //-------------------------------------------------------------------------------------------------- 1352 1352 1353 const Bool bUseGolombRiceParameterAdaptation = sps.get UseGolombRiceParameterAdaptation();1353 const Bool bUseGolombRiceParameterAdaptation = sps.getSpsRangeExtension().getPersistentRiceAdaptationEnabledFlag(); 1354 1354 UInt ¤tGolombRiceStatistic = m_golombRiceAdaptationStatistics[rTu.getGolombRiceStatisticsIndex(compID)]; 1355 1355 -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
r1307 r1316 433 433 434 434 #if RExt__HIGH_BIT_DEPTH_SUPPORT==0 435 if (sps->get UseExtendedPrecision() || 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 ) 436 436 { 437 437 printf("High bit depth support must be enabled at compile-time in order to decode this bitstream\n"); … … 604 604 // Initialise the various objects for the new set of settings 605 605 #if SVC_EXTENSION 606 m_cSAO.create( pSlice->getPicWidthInLumaSamples(), pSlice->getPicHeightInLumaSamples(), pSlice->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), pps->get SaoOffsetBitShift(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) ); 607 607 #else 608 m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTotalCUDepth(), pps->get SaoOffsetBitShift(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) ); 609 609 #endif 610 610 m_cLoopFilter.create( sps->getMaxTotalCUDepth() );
Note: See TracChangeset for help on using the changeset viewer.