Changeset 1356 in 3DVCSoftware for trunk/source/Lib/TLibDecoder/TDecTop.cpp
- Timestamp:
- 27 Oct 2015, 11:33:16 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibDecoder/TDecTop.cpp
r1321 r1356 59 59 m_iLog2Precision = LOG2_DISP_PREC_LUT; 60 60 m_uiBitDepthForLUT = 8; // fixed 61 m_receivedIdc = NULL; 62 m_vps = NULL; 61 m_receivedIdc = NULL; 62 m_vps = NULL; 63 63 } 64 64 … … 75 75 xDeleteArray( m_adBaseViewShiftLUT, MAX_NUM_LAYERS, MAX_NUM_LAYERS, 2 ); 76 76 xDeleteArray( m_aiBaseViewShiftLUT, MAX_NUM_LAYERS, MAX_NUM_LAYERS, 2 ); 77 xDeleteArray( m_receivedIdc, m_vps->getNumViews() ); 77 if ( m_receivedIdc != NULL ) 78 { 79 xDeleteArray( m_receivedIdc, m_vps->getNumViews() ); 80 } 78 81 } 79 82 … … 84 87 assert( !isInitialized() ); // Only one initialization currently supported 85 88 m_bInitialized = true; 86 m_vps = vps; 87 m_bCamParsVaryOverTime = false; 88 m_lastPoc = -1; 89 m_firstReceivedPoc = -2; 89 m_vps = vps; 90 m_bCamParsVaryOverTime = false; 91 m_lastPoc = -1; 92 m_firstReceivedPoc = -2; 90 93 91 94 for (Int i = 0; i <= vps->getMaxLayersMinus1(); i++) 92 95 { 93 Int curViewIdxInVps = m_vps->getVoiInVps( m_vps->getViewIndex( m_vps->getLayerIdInNuh( i ) ) ) ; 94 m_bCamParsVaryOverTime = m_bCamParsVaryOverTime || vps->getCpInSliceSegmentHeaderFlag( curViewIdxInVps ); 95 } 96 97 assert( m_receivedIdc == NULL ); 98 m_receivedIdc = new Int*[ m_vps->getNumViews() ]; 96 Int curViewIdxInVps = m_vps->getVoiInVps( m_vps->getViewIndex( m_vps->getLayerIdInNuh( i ) ) ) ; 97 m_bCamParsVaryOverTime = m_bCamParsVaryOverTime || vps->getCpInSliceSegmentHeaderFlag( curViewIdxInVps ); 98 } 99 100 assert( m_receivedIdc == NULL ); 101 m_receivedIdc = new Int*[ m_vps->getNumViews() ]; 99 102 for (Int i = 0; i < m_vps->getNumViews(); i++) 100 103 { 101 m_receivedIdc[i] = new Int[ m_vps->getNumViews() ]; 102 } 103 104 xResetReceivedIdc( true ); 104 m_receivedIdc[i] = new Int[ m_vps->getNumViews() ]; 105 } 106 107 xResetReceivedIdc( true ); 105 108 106 109 for (Int voiInVps = 0; voiInVps < m_vps->getNumViews(); voiInVps++ ) 107 110 { 108 if( !m_vps->getCpInSliceSegmentHeaderFlag( voiInVps ) ) 111 if( !m_vps->getCpInSliceSegmentHeaderFlag( voiInVps ) ) 109 112 { 110 113 for (Int baseVoiInVps = 0; baseVoiInVps < m_vps->getNumViews(); baseVoiInVps++ ) 111 { 114 { 112 115 if( m_vps->getCpPresentFlag( voiInVps, baseVoiInVps ) ) 113 116 { 114 m_receivedIdc [ baseVoiInVps ][ voiInVps ] = -1; 117 m_receivedIdc [ baseVoiInVps ][ voiInVps ] = -1; 115 118 m_aaiCodedScale [ baseVoiInVps ][ voiInVps ] = m_vps->getCodedScale (voiInVps) [ baseVoiInVps ]; 116 119 m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ] = m_vps->getCodedOffset (voiInVps) [ baseVoiInVps ]; 117 120 118 m_receivedIdc [ voiInVps ][ baseVoiInVps ] = -1; 121 m_receivedIdc [ voiInVps ][ baseVoiInVps ] = -1; 119 122 m_aaiCodedScale [ voiInVps ][ baseVoiInVps ] = m_vps->getInvCodedScale (voiInVps) [ baseVoiInVps ]; 120 123 m_aaiCodedOffset[ voiInVps ][ baseVoiInVps ] = m_vps->getInvCodedOffset(voiInVps) [ baseVoiInVps ]; … … 131 134 { 132 135 for (Int i = 0; i < m_vps->getNumViews(); i++) 133 { 136 { 134 137 for (Int j = 0; j < m_vps->getNumViews(); j++) 135 138 { 136 139 if ( overWriteFlag || ( m_receivedIdc[i][j] != -1 ) ) 137 140 { 138 m_receivedIdc[i][j] = 0; 139 } 141 m_receivedIdc[i][j] = 0; 142 } 140 143 } 141 144 } … … 171 174 } 172 175 173 Void 176 Void 174 177 CamParsCollector::xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Double****& radLUT, Int****& raiLUT) 175 178 { … … 234 237 if( m_firstReceivedPoc == -2 ) 235 238 { 236 m_firstReceivedPoc = curPoc; 237 } 238 239 Bool newPocFlag = ( m_lastPoc != curPoc ); 239 m_firstReceivedPoc = curPoc; 240 } 241 242 Bool newPocFlag = ( m_lastPoc != curPoc ); 240 243 241 244 if ( newPocFlag ) 242 { 245 { 243 246 if( m_lastPoc != -1 ) 244 247 { … … 246 249 } 247 250 248 xResetReceivedIdc( false ); 251 xResetReceivedIdc( false ); 249 252 m_lastPoc = pcSlice->getPOC(); 250 253 } 251 254 252 UInt voiInVps = m_vps->getVoiInVps(pcSlice->getViewIndex()); 255 UInt voiInVps = m_vps->getVoiInVps(pcSlice->getViewIndex()); 253 256 if( m_vps->getCpInSliceSegmentHeaderFlag( voiInVps ) ) // check consistency of slice parameters here 254 { 257 { 255 258 for( Int baseVoiInVps = 0; baseVoiInVps < m_vps->getNumViews(); baseVoiInVps++ ) 256 { 259 { 257 260 if ( m_vps->getCpPresentFlag( voiInVps, baseVoiInVps ) ) 258 261 { 259 262 if ( m_receivedIdc[ voiInVps ][ baseVoiInVps ] != 0 ) 260 { 263 { 261 264 AOF( m_aaiCodedScale [ voiInVps ][ baseVoiInVps ] == pcSlice->getInvCodedScale () [ baseVoiInVps ] ); 262 265 AOF( m_aaiCodedOffset[ voiInVps ][ baseVoiInVps ] == pcSlice->getInvCodedOffset() [ baseVoiInVps ] ); 263 266 } 264 267 else 265 { 266 m_receivedIdc [ voiInVps ][ baseVoiInVps ] = 1; 268 { 269 m_receivedIdc [ voiInVps ][ baseVoiInVps ] = 1; 267 270 m_aaiCodedScale [ voiInVps ][ baseVoiInVps ] = pcSlice->getInvCodedScale () [ baseVoiInVps ]; 268 271 m_aaiCodedOffset[ voiInVps ][ baseVoiInVps ] = pcSlice->getInvCodedOffset() [ baseVoiInVps ]; … … 270 273 } 271 274 if ( m_receivedIdc[ baseVoiInVps ][ voiInVps ] != 0 ) 272 { 275 { 273 276 AOF( m_aaiCodedScale [ baseVoiInVps ][ voiInVps ] == pcSlice->getCodedScale () [ baseVoiInVps ] ); 274 277 AOF( m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ] == pcSlice->getCodedOffset () [ baseVoiInVps ] ); 275 278 } 276 279 else 277 { 278 m_receivedIdc [ baseVoiInVps ][ voiInVps ] = 1; 280 { 281 m_receivedIdc [ baseVoiInVps ][ voiInVps ] = 1; 279 282 m_aaiCodedScale [ baseVoiInVps ][ voiInVps ] = pcSlice->getCodedScale () [ baseVoiInVps ]; 280 283 m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ] = pcSlice->getCodedOffset () [ baseVoiInVps ]; … … 283 286 } 284 287 } 285 } 288 } 286 289 } 287 290 … … 295 298 fprintf( m_pCodedScaleOffsetFile, "#ViewOrderIdx ViewIdVal\n" ); 296 299 fprintf( m_pCodedScaleOffsetFile, "#------------ -------------\n" ); 297 300 298 301 for( UInt voiInVps = 0; voiInVps < m_vps->getNumViews(); voiInVps++ ) 299 302 { … … 315 318 { 316 319 if ( m_receivedIdc[baseVoiInVps][voiInVps] != 0 ) 317 { 320 { 318 321 fprintf( m_pCodedScaleOffsetFile, "%12d %12d %12d %12d %12d %12d %12d\n", 319 iS, iE, m_vps->getViewOIdxList( voiInVps ), m_vps->getViewOIdxList( baseVoiInVps ), 320 m_aaiCodedScale [ baseVoiInVps ][ voiInVps ], 322 iS, iE, m_vps->getViewOIdxList( voiInVps ), m_vps->getViewOIdxList( baseVoiInVps ), 323 m_aaiCodedScale [ baseVoiInVps ][ voiInVps ], 321 324 m_aaiCodedOffset[ baseVoiInVps ][ voiInVps ], m_vps->getCpPrecision() ); 322 } 325 } 323 326 } 324 327 } … … 334 337 #if !NH_MV 335 338 , m_associatedIRAPType(NAL_UNIT_INVALID) 336 , m_pocCRA(0) 339 , m_pocCRA(0) 337 340 , m_pocRandomAccess(MAX_INT) 338 341 , m_cListPic() … … 426 429 fclose( g_hTrace ); 427 430 } 428 #endif 431 #endif 429 432 #endif 430 433 while (!m_prefixSEINALUs.empty()) … … 465 468 #endif 466 469 #if NH_MV 467 m_cCavlcDecoder.setDecTop( this ); 470 m_cCavlcDecoder.setDecTop( this ); 468 471 #endif 469 472 m_cGopDecoder.init( &m_cEntropyDecoder, &m_cSbacDecoder, &m_cBinCABAC, &m_cCavlcDecoder, &m_cSliceDecoder, &m_cLoopFilter, &m_cSAO); … … 653 656 #if NH_MV 654 657 const TComVPS* vps = m_parameterSetManager.getVPS(sps->getVPSId()); 655 assert (vps != 0); 656 // TBD: check the condition on m_firstPicInLayerDecodedFlag 658 assert (vps != 0); 659 // TBD: check the condition on m_firstPicInLayerDecodedFlag 657 660 if (!m_parameterSetManager.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP() || !m_firstPicInLayerDecodedFlag[m_layerId] , m_layerId ) ) 658 661 #else … … 671 674 { 672 675 //, it is a requirement of bitstream conformance that the value of update_rep_format_flag shall be equal to 0. 673 assert( sps->getUpdateRepFormatFlag() == false ); 674 } 675 sps->checkRpsMaxNumPics( vps, getLayerId() ); 676 677 // It is a requirement of bitstream conformance that, when the SPS is referred to by 678 // any current picture that belongs to an independent non-base layer, the value of 676 assert( sps->getUpdateRepFormatFlag() == false ); 677 } 678 sps->checkRpsMaxNumPics( vps, getLayerId() ); 679 680 // It is a requirement of bitstream conformance that, when the SPS is referred to by 681 // any current picture that belongs to an independent non-base layer, the value of 679 682 // MultiLayerExtSpsFlag derived from the SPS shall be equal to 0. 680 683 681 684 if ( m_layerId > 0 && vps->getNumRefLayers( m_layerId ) == 0 ) 682 { 683 assert( sps->getMultiLayerExtSpsFlag() == 0 ); 684 } 685 } 685 { 686 assert( sps->getMultiLayerExtSpsFlag() == 0 ); 687 } 688 } 689 #if NH_MV_SEI 690 m_seiReader.setLayerId ( newPic->getLayerId ( ) ); 691 m_seiReader.setDecOrder( newPic->getDecodingOrder( ) ); 692 #endif 686 693 #endif 687 694 … … 707 714 m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS()); 708 715 #else 709 m_pcPic = newPic; 716 m_pcPic = newPic; 710 717 #endif 711 718 … … 723 730 #if NH_MV 724 731 pSlice->setPic( m_pcPic ); 725 vps=pSlice->getVPS(); 732 vps=pSlice->getVPS(); 726 733 // The nuh_layer_id value of the NAL unit containing the PPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA. 727 assert( pps->getLayerId() == m_layerId || pps->getLayerId( ) == 0 || vps->getDependencyFlag( m_layerId, pps->getLayerId() ) ); 734 assert( pps->getLayerId() == m_layerId || pps->getLayerId( ) == 0 || vps->getDependencyFlag( m_layerId, pps->getLayerId() ) ); 728 735 // The nuh_layer_id value of the NAL unit containing the SPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA. 729 736 assert( sps->getLayerId() == m_layerId || sps->getLayerId( ) == 0 || vps->getDependencyFlag( m_layerId, sps->getLayerId() ) ); … … 775 782 { 776 783 #if NH_MV 777 assert( m_pcPic != NULL ); 778 assert( newPic == NULL ); 784 assert( m_pcPic != NULL ); 785 assert( newPic == NULL ); 779 786 #endif 780 787 // make the slice-pilot a real slice, and set up the slice-pilot for the next slice … … 832 839 InputNALUnit &nalu=*m_prefixSEINALUs.front(); 833 840 #if NH_MV 841 #if NH_MV_LAYERS_NOT_PRESENT_SEI 842 m_seiReader.parseSEImessage(&(nalu.getBitstream()), m_SEIs, nalu.m_nalUnitType, m_parameterSetManager.getActiveVPS(), m_parameterSetManager.getActiveSPS(getLayerId()), m_pDecodedSEIOutputStream); 843 #else 834 844 m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_SEIs, nalu.m_nalUnitType, m_parameterSetManager.getActiveSPS( getLayerId() ), m_pDecodedSEIOutputStream ); 845 #endif 835 846 #else 836 847 m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_SEIs, nalu.m_nalUnitType, m_parameterSetManager.getActiveSPS(), m_pDecodedSEIOutputStream ); … … 855 866 m_cEntropyDecoder.setBitstream (&(nalu.getBitstream())); 856 867 857 assert( nalu.m_nuhLayerId == m_layerId ); 868 assert( nalu.m_nuhLayerId == m_layerId ); 858 869 m_apcSlicePilot->initSlice(); // the slice pilot is an object to prepare for a new slice 859 870 // it is not associated with picture, sps or pps structures. 860 m_apcSlicePilot->setLayerId( nalu.m_nuhLayerId ); 861 m_cEntropyDecoder.decodeFirstSliceSegmentInPicFlag( m_apcSlicePilot ); 871 m_apcSlicePilot->setLayerId( nalu.m_nuhLayerId ); 872 m_cEntropyDecoder.decodeFirstSliceSegmentInPicFlag( m_apcSlicePilot ); 862 873 if ( m_apcSlicePilot->getFirstSliceSegementInPicFlag() ) 863 874 { 864 #endif 875 #endif 865 876 m_uiSliceIdx = 0; 866 877 } … … 908 919 if (m_apcSlicePilot->getRapPicFlag()) 909 920 { 910 if ((m_apcSlicePilot->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_apcSlicePilot->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP) || 921 if ((m_apcSlicePilot->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_apcSlicePilot->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP) || 911 922 (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_bFirstSliceInSequence) || 912 923 (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getHandleCraAsBlaFlag())) … … 924 935 else 925 936 { 926 m_apcSlicePilot->setNoOutputPriorPicsFlag(false); 937 m_apcSlicePilot->setNoOutputPriorPicsFlag(false); 927 938 } 928 939 … … 950 961 } 951 962 } 952 963 953 964 if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_craNoRaslOutputFlag) //Reset POC MSB when CRA has NoRaslOutputFlag equal to 1 954 965 { … … 1044 1055 { 1045 1056 //Check Multiview Main profile constraint in G.11.1.1 1046 // When ViewOrderIdx[ i ] derived according to any active VPS is equal to 1 1047 // for the layer with nuh_layer_id equal to i in subBitstream, 1048 // inter_view_mv_vert_constraint_flag shall be equal to 1 1057 // When ViewOrderIdx[ i ] derived according to any active VPS is equal to 1 1058 // for the layer with nuh_layer_id equal to i in subBitstream, 1059 // inter_view_mv_vert_constraint_flag shall be equal to 1 1049 1060 // in the sps_multilayer_extension( ) syntax structure in each active SPS for that layer. 1050 1061 if( pcSlice->getSPS()->getPTL()->getGeneralPTL()->getProfileIdc()==Profile::MULTIVIEWMAIN 1051 1062 && 1052 pcSlice->getVPS()->getViewOrderIdx(pcSlice->getVPS()->getLayerIdInNuh(getLayerId()))==1 1063 pcSlice->getVPS()->getViewOrderIdx(pcSlice->getVPS()->getLayerIdInNuh(getLayerId()))==1 1053 1064 ) 1054 1065 { … … 1061 1072 m_pcPic->setViewIndex( getViewIndex() ); 1062 1073 m_pcPic->setIsDepth ( getIsDepth () ); 1063 pcSlice->setIvPicLists( m_dpb ); 1064 #endif 1065 #endif 1066 1074 pcSlice->setIvPicLists( m_dpb ); 1075 #endif 1076 #endif 1077 1067 1078 // When decoding the slice header, the stored start and end addresses were actually RS addresses, not TS addresses. 1068 1079 // Now, having set up the maps, convert them to the correct form. … … 1097 1108 else 1098 1109 { 1099 assert( false ); 1110 assert( false ); 1100 1111 } 1101 1112 } … … 1104 1115 #endif 1105 1116 #if NH_3D_ARP 1106 pcSlice->setPocsInCurrRPSs(); 1117 pcSlice->setPocsInCurrRPSs(); 1107 1118 pcSlice->setARPStepNum(m_dpb); 1108 #endif 1119 #endif 1109 1120 #endif 1110 1121 … … 1191 1202 if ( decProcAnnexI() ) 1192 1203 { 1193 pcSlice->checkInCompPredRefLayers(); 1204 pcSlice->checkInCompPredRefLayers(); 1194 1205 } 1195 1206 #endif … … 1230 1241 TComSPS* sps = new TComSPS(); 1231 1242 #if NH_MV 1232 sps->setLayerId( getLayerId() ); 1243 sps->setLayerId( getLayerId() ); 1233 1244 #endif 1234 1245 #if O0043_BEST_EFFORT_DECODING … … 1246 1257 TComPPS* pps = new TComPPS(); 1247 1258 #if NH_MV 1248 pps->setLayerId( getLayerId() ); 1259 pps->setLayerId( getLayerId() ); 1249 1260 #endif 1250 1261 #if NH_3D_DLT … … 1304 1315 { 1305 1316 #if NH_MV 1306 m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_pcPic->getSEIs(), nalu.m_nalUnitType, m_parameterSetManager.getActiveSPS( getLayerId() ), m_pDecodedSEIOutputStream ); 1317 #if NH_MV_LAYERS_NOT_PRESENT_SEI 1318 m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_pcPic->getSEIs(), nalu.m_nalUnitType, m_parameterSetManager.getActiveVPS(), m_parameterSetManager.getActiveSPS(getLayerId()), m_pDecodedSEIOutputStream); 1319 #else 1320 m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_pcPic->getSEIs(), nalu.m_nalUnitType, m_parameterSetManager.getActiveSPS( getLayerId() ), m_pDecodedSEIOutputStream ); 1321 #endif 1307 1322 #else 1308 1323 m_seiReader.parseSEImessage( &(nalu.getBitstream()), m_pcPic->getSEIs(), nalu.m_nalUnitType, m_parameterSetManager.getActiveSPS(), m_pDecodedSEIOutputStream ); … … 1332 1347 case NAL_UNIT_CODED_SLICE_RASL_R: 1333 1348 #if NH_MV 1334 assert( false ); 1335 return 1; 1349 assert( false ); 1350 return 1; 1336 1351 #else 1337 1352 return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay); … … 1506 1521 { 1507 1522 //Output of this process is PicOrderCntVal, the picture order count of the current picture. 1508 // Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and 1523 // Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and 1509 1524 // motion vector prediction and for decoder conformance checking (see clause F.13.5). 1510 1525 … … 1513 1528 TComSlice* slice = m_apcSlicePilot; 1514 1529 const Int nuhLayerId = slice->getLayerId(); 1515 const TComVPS* vps = slice->getVPS(); 1516 const TComSPS* sps = slice->getSPS(); 1517 1518 Int pocDecrementedInDpbFlag = m_pocDecrementedInDpbFlag[ nuhLayerId ]; 1530 const TComVPS* vps = slice->getVPS(); 1531 const TComSPS* sps = slice->getSPS(); 1532 1533 Int pocDecrementedInDpbFlag = m_pocDecrementedInDpbFlag[ nuhLayerId ]; 1519 1534 1520 1535 if ( isFstPicOfAllLayOfPocResetPer ) 1521 1536 { 1522 // When the current picture is the first picture among all layers of a POC resetting period, 1537 // When the current picture is the first picture among all layers of a POC resetting period, 1523 1538 // the variable PocDecrementedInDPBFlag[ i ] is set equal to 0 for each value of i in the range of 0 to 62, inclusive. 1524 pocDecrementedInDpbFlag = false; 1539 pocDecrementedInDpbFlag = false; 1525 1540 } 1526 1541 1527 1542 // The variable pocResettingFlag is derived as follows: 1528 Bool pocResettingFlag; 1543 Bool pocResettingFlag; 1529 1544 if ( isPocResettingPicture ) 1530 1545 { 1531 //- If the current picture is a POC resetting picture, the following applies: 1546 //- If the current picture is a POC resetting picture, the following applies: 1532 1547 if( vps->getVpsPocLsbAlignedFlag() ) 1533 1548 { 1534 1549 // - If vps_poc_lsb_aligned_flag is equal to 0, pocResettingFlag is set equal to 1. 1535 pocResettingFlag = true; 1550 pocResettingFlag = true; 1536 1551 } 1537 1552 else if ( pocDecrementedInDpbFlag ) 1538 1553 { 1539 1554 // - Otherwise, if PocDecrementedInDPBFlag[ nuh_layer_id ] is equal to 1, pocResettingFlag is set equal to 0. 1540 pocResettingFlag = false; 1555 pocResettingFlag = false; 1541 1556 } 1542 1557 else 1543 1558 { 1544 1559 // - Otherwise, pocResettingFlag is set equal to 1. 1545 pocResettingFlag = true; 1560 pocResettingFlag = true; 1546 1561 } 1547 1562 } … … 1549 1564 { 1550 1565 // - Otherwise, pocResettingFlag is set equal to 0. 1551 pocResettingFlag = false; 1552 } 1553 1554 Int picOrderCntMsb; 1555 Int picOrderCntVal; 1566 pocResettingFlag = false; 1567 } 1568 1569 Int picOrderCntMsb; 1570 Int picOrderCntVal; 1556 1571 1557 1572 // Depending on pocResettingFlag, the following applies: … … 1561 1576 if( slice->getPocResetIdc() == 1 ) 1562 1577 { 1563 picOrderCntVal = slice->getSlicePicOrderCntLsb(); 1564 } 1565 else if (slice->getPocResetIdc() == 2 ) 1566 { 1567 picOrderCntVal = 0; 1578 picOrderCntVal = slice->getSlicePicOrderCntLsb(); 1579 } 1580 else if (slice->getPocResetIdc() == 2 ) 1581 { 1582 picOrderCntVal = 0; 1568 1583 } 1569 1584 else 1570 1585 { 1571 picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal(), 0, sps->getMaxPicOrderCntLsb() ); 1572 picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 1586 picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal(), 0, sps->getMaxPicOrderCntLsb() ); 1587 picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 1573 1588 } 1574 1589 } … … 1580 1595 if( slice->getPocMsbCycleValPresentFlag() ) 1581 1596 { 1582 picOrderCntMsb = slice->getPocMsbCycleVal() * sps->getMaxPicOrderCntLsb(); 1597 picOrderCntMsb = slice->getPocMsbCycleVal() * sps->getMaxPicOrderCntLsb(); 1583 1598 } 1584 1599 else if( !firstPicInLayerDecodedFlag || … … 1586 1601 { 1587 1602 picOrderCntMsb = 0; // (F 62) 1588 } 1603 } 1589 1604 else 1590 1605 { 1591 1606 Int prevPicOrderCntLsb = m_prevPicOrderCnt & ( sps->getMaxPicOrderCntLsb() - 1 ); 1592 Int prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb; 1593 picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() ); 1594 } 1595 picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 1596 } 1607 Int prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb; 1608 picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() ); 1609 } 1610 picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 1611 } 1597 1612 return picOrderCntVal; 1598 1613 } … … 1607 1622 if ( m_lastPresentPocResetIdc[ m_apcSlicePilot->getLayerId() ] != MIN_INT ) 1608 1623 { 1609 // - If the previous picture picA that has poc_reset_period_id present in the slice segment header is present in the same layer 1610 // of the bitstream as the current picture, the value of poc_reset_period_id is inferred to be equal to the value of the 1624 // - If the previous picture picA that has poc_reset_period_id present in the slice segment header is present in the same layer 1625 // of the bitstream as the current picture, the value of poc_reset_period_id is inferred to be equal to the value of the 1611 1626 // poc_reset_period_id of picA. 1612 1627 1613 m_apcSlicePilot->setPocResetPeriodId( m_lastPresentPocResetIdc[ m_apcSlicePilot->getLayerId() ] ); 1628 m_apcSlicePilot->setPocResetPeriodId( m_lastPresentPocResetIdc[ m_apcSlicePilot->getLayerId() ] ); 1614 1629 } 1615 1630 else 1616 1631 { 1617 1632 //- Otherwise, the value of poc_reset_period_id is inferred to be equal to 0. 1618 m_apcSlicePilot->setPocResetPeriodId( 0 ); 1633 m_apcSlicePilot->setPocResetPeriodId( 0 ); 1619 1634 } 1620 1635 } 1621 1636 else 1622 1637 { 1623 m_lastPresentPocResetIdc[ m_apcSlicePilot->getLayerId() ] = m_apcSlicePilot->getPocResetPeriodId(); 1638 m_lastPresentPocResetIdc[ m_apcSlicePilot->getLayerId() ] = m_apcSlicePilot->getPocResetPeriodId(); 1624 1639 } 1625 1640 } … … 1627 1642 1628 1643 Void TDecTop::decodePocAndRps( ) 1629 { 1644 { 1630 1645 assert( m_uiSliceIdx == 0 ); 1631 1646 Int nuhLayerId = m_pcPic->getLayerId(); … … 1634 1649 // 8.1.3 Decoding process for a coded picture with nuh_layer_id equal to 0 1635 1650 1636 // Variables and functions relating to picture order count are derived as 1637 // specified in clause 8.3.1. This needs to be invoked only for the first slice 1651 // Variables and functions relating to picture order count are derived as 1652 // specified in clause 8.3.1. This needs to be invoked only for the first slice 1638 1653 // segment of a picture. 1639 1654 x831DecProcForPicOrderCount( ); 1640 1655 1641 // The decoding process for RPS in clause 8.3.2 is invoked, wherein reference 1642 // pictures may be marked as "unused for reference" or "used for long-term 1643 // reference". This needs to be invoked only for the first slice segment of a 1656 // The decoding process for RPS in clause 8.3.2 is invoked, wherein reference 1657 // pictures may be marked as "unused for reference" or "used for long-term 1658 // reference". This needs to be invoked only for the first slice segment of a 1644 1659 // picture. 1645 1660 x832DecProcForRefPicSet ( false ); … … 1654 1669 // --> Clause 8.1.3 is invoked with replacments of 8.3.1, 8.3.2, and 8.3.3 by F.8.3.1, 8.3.2, and 8.3.3 1655 1670 1656 // Variables and functions relating to picture order count are derived as 1657 // specified in clause 8.3.1. This needs to be invoked only for the first slice 1671 // Variables and functions relating to picture order count are derived as 1672 // specified in clause 8.3.1. This needs to be invoked only for the first slice 1658 1673 // segment of a picture. 1659 1674 xF831DecProcForPicOrderCount( ); 1660 1675 1661 // The decoding process for RPS in clause 8.3.2 is invoked, wherein reference 1662 // pictures may be marked as "unused for reference" or "used for long-term 1663 // reference". This needs to be invoked only for the first slice segment of a 1676 // The decoding process for RPS in clause 8.3.2 is invoked, wherein reference 1677 // pictures may be marked as "unused for reference" or "used for long-term 1678 // reference". This needs to be invoked only for the first slice segment of a 1664 1679 // picture. 1665 1680 xF832DecProcForRefPicSet( ); … … 1670 1685 // nuh_layer_id greater than 0 1671 1686 1672 // Variables and functions relating to picture order count are derived in clause F.8.3.1. 1673 // This needs to be invoked only for the first slice segment of a picture. It is a requirement 1674 // of bitstream conformance that PicOrderCntVal of each picture in an access unit shall have the 1687 // Variables and functions relating to picture order count are derived in clause F.8.3.1. 1688 // This needs to be invoked only for the first slice segment of a picture. It is a requirement 1689 // of bitstream conformance that PicOrderCntVal of each picture in an access unit shall have the 1675 1690 // same value during and at the end of decoding of the access unit 1676 1691 xF831DecProcForPicOrderCount( ); 1677 1692 1678 // The decoding process for RPS in clause F.8.3.2 is invoked, wherein only reference pictures with 1679 // nuh_layer_id equal to that of CurrPic may be marked as "unused for reference" or "used for 1680 // long-term reference" and any picture with a different value of nuh_layer_id is not marked. 1693 // The decoding process for RPS in clause F.8.3.2 is invoked, wherein only reference pictures with 1694 // nuh_layer_id equal to that of CurrPic may be marked as "unused for reference" or "used for 1695 // long-term reference" and any picture with a different value of nuh_layer_id is not marked. 1681 1696 // This needs to be invoked only for the first slice segment of a picture. 1682 1697 xF832DecProcForRefPicSet( ); … … 1685 1700 else 1686 1701 { 1687 assert( false ); 1702 assert( false ); 1688 1703 } 1689 1704 } 1690 1705 1691 1706 Void TDecTop::genUnavailableRefPics( ) 1692 { 1707 { 1693 1708 assert( m_uiSliceIdx == 0 ); 1694 1709 Int nuhLayerId = m_pcPic->getLayerId(); … … 1699 1714 if ( m_pcPic->isBla() || ( m_pcPic->isCra() && m_pcPic->getNoRaslOutputFlag() ) ) 1700 1715 { 1701 // When the current picture is a BLA picture or is a CRA picture 1702 // with NoRaslOutputFlag equal to 1, the decoding process for generating 1703 // unavailable reference pictures specified in clause 8.3.3 is invoked, 1716 // When the current picture is a BLA picture or is a CRA picture 1717 // with NoRaslOutputFlag equal to 1, the decoding process for generating 1718 // unavailable reference pictures specified in clause 8.3.3 is invoked, 1704 1719 // which needs to be invoked only for the first slice segment of a picture. 1705 x8331GenDecProcForGenUnavilRefPics(); 1720 x8331GenDecProcForGenUnavilRefPics(); 1706 1721 } 1707 1722 } … … 1717 1732 if ( m_pcPic->isBla() || ( m_pcPic->isCra() && m_pcPic->getNoRaslOutputFlag() ) ) 1718 1733 { 1719 // When the current picture is a BLA picture or is a CRA picture 1720 // with NoRaslOutputFlag equal to 1, the decoding process for generating 1721 // unavailable reference pictures specified in clause 8.3.3 is invoked, 1734 // When the current picture is a BLA picture or is a CRA picture 1735 // with NoRaslOutputFlag equal to 1, the decoding process for generating 1736 // unavailable reference pictures specified in clause 8.3.3 is invoked, 1722 1737 // which needs to be invoked only for the first slice segment of a picture. 1723 xF833DecProcForGenUnavRefPics(); 1738 xF833DecProcForGenUnavRefPics(); 1724 1739 } 1725 1740 #if NH_MV_FIX_INIT_NUM_ACTIVE_REF_LAYER_PICS 1726 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 1741 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 1727 1742 decRps->m_numActiveRefLayerPics0 = 0; 1728 decRps->m_numActiveRefLayerPics1 = 0; 1743 decRps->m_numActiveRefLayerPics1 = 0; 1729 1744 #endif 1730 1745 } … … 1736 1751 if ( !m_firstPicInLayerDecodedFlag[ nuhLayerId ] ) 1737 1752 { 1738 // When FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 0, the decoding process for generating 1739 // unavailable reference pictures for pictures first in decoding order within a layer specified in 1753 // When FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 0, the decoding process for generating 1754 // unavailable reference pictures for pictures first in decoding order within a layer specified in 1740 1755 // clause F.8.1.7 is invoked, which needs to be invoked only for the first slice segment of a picture. 1741 1756 xF817DecProcForGenUnavRefPicForPicsFrstInDecOrderInLay(); … … 1744 1759 if ( m_firstPicInLayerDecodedFlag[ nuhLayerId ] && ( m_pcPic->isIrap() && m_pcPic->getNoRaslOutputFlag() ) ) 1745 1760 { 1746 // When FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 1 and the current picture is an IRAP 1747 // picture with NoRaslOutputFlag equal to 1, the decoding process for generating unavailable reference 1748 // pictures specified in clause F.8.3.3 is invoked, which needs to be invoked only for the first slice 1761 // When FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 1 and the current picture is an IRAP 1762 // picture with NoRaslOutputFlag equal to 1, the decoding process for generating unavailable reference 1763 // pictures specified in clause F.8.3.3 is invoked, which needs to be invoked only for the first slice 1749 1764 // segment of a picture. 1750 xF833DecProcForGenUnavRefPics(); 1765 xF833DecProcForGenUnavRefPics(); 1751 1766 } 1752 1767 … … 1760 1775 else 1761 1776 { 1762 assert( false ); 1763 } 1764 1765 xCheckUnavailableRefPics(); 1777 assert( false ); 1778 } 1779 1780 xCheckUnavailableRefPics(); 1766 1781 } 1767 1782 Void TDecTop::executeLoopFilters( ) 1768 1783 { 1769 assert( m_pcPic != NULL ); 1784 assert( m_pcPic != NULL ); 1770 1785 if ( !m_pcPic->getHasGeneratedRefPics() && !m_pcPic->getIsGenerated() ) 1771 1786 { … … 1779 1794 if( m_pcPic->isIrap() ) 1780 1795 { 1781 m_prevIrapPoc = m_pcPic->getPOC(); 1782 m_prevIrapDecodingOrder = m_pcPic->getDecodingOrder(); 1796 m_prevIrapPoc = m_pcPic->getPOC(); 1797 m_prevIrapDecodingOrder = m_pcPic->getDecodingOrder(); 1783 1798 } 1784 1799 if( m_pcPic->isStsa() ) … … 1791 1806 1792 1807 Void TDecTop::initFromActiveVps( const TComVPS* vps ) 1793 { 1794 setViewId ( vps->getViewId ( getLayerId() ) ); 1808 { 1809 setViewId ( vps->getViewId ( getLayerId() ) ); 1795 1810 #if NH_3D 1796 setViewIndex( vps->getViewIndex( getLayerId() ) ); 1797 setIsDepth ( vps->getDepthId ( getLayerId() ) == 1 ); 1811 setViewIndex( vps->getViewIndex( getLayerId() ) ); 1812 setIsDepth ( vps->getDepthId ( getLayerId() ) == 1 ); 1798 1813 #endif 1799 1814 1800 1815 if ( !vps->getVpsExtensionFlag() ) 1801 1816 { 1802 m_decodingProcess = CLAUSE_8; 1817 m_decodingProcess = CLAUSE_8; 1803 1818 m_isInOwnTargetDecLayerIdList = ( getLayerId() == 0 ); 1804 1819 } 1805 1820 else 1806 { 1821 { 1807 1822 if ( m_targetOlsIdx == -1 ) 1808 1823 { 1809 // Corresponds to specification by "External Means". (Should be set equal to 0, when no external means available. ) 1810 m_targetOlsIdx = vps->getVpsNumLayerSetsMinus1(); 1811 } 1812 1813 Int targetDecLayerSetIdx = vps->olsIdxToLsIdx( m_targetOlsIdx ); 1824 // Corresponds to specification by "External Means". (Should be set equal to 0, when no external means available. ) 1825 m_targetOlsIdx = vps->getVpsNumLayerSetsMinus1(); 1826 } 1827 1828 Int targetDecLayerSetIdx = vps->olsIdxToLsIdx( m_targetOlsIdx ); 1814 1829 1815 1830 if ( targetDecLayerSetIdx <= vps->getVpsNumLayerSetsMinus1() && vps->getVpsBaseLayerInternalFlag() ) 1816 1831 { 1817 m_smallestLayerId = 0; 1832 m_smallestLayerId = 0; 1818 1833 } 1819 1834 else if ( targetDecLayerSetIdx <= vps->getVpsNumLayerSetsMinus1() && !vps->getVpsBaseLayerInternalFlag() ) 1820 1835 { 1821 m_smallestLayerId = 0; 1836 m_smallestLayerId = 0; 1822 1837 } 1823 1838 else if ( targetDecLayerSetIdx > vps->getVpsNumLayerSetsMinus1() && vps->getNumLayersInIdList( targetDecLayerSetIdx) == 1 ) 1824 1839 { 1825 1826 // m_smallestLayerId = 0; 1827 // For now don't do change of layer id here. 1828 m_smallestLayerId = vps->getTargetDecLayerIdList( targetDecLayerSetIdx )[ 0 ]; 1840 1841 // m_smallestLayerId = 0; 1842 // For now don't do change of layer id here. 1843 m_smallestLayerId = vps->getTargetDecLayerIdList( targetDecLayerSetIdx )[ 0 ]; 1829 1844 } 1830 1845 else 1831 1846 { 1832 m_smallestLayerId = vps->getTargetDecLayerIdList( targetDecLayerSetIdx )[ 0 ]; 1847 m_smallestLayerId = vps->getTargetDecLayerIdList( targetDecLayerSetIdx )[ 0 ]; 1833 1848 } 1834 1849 … … 1836 1851 // Set profile 1837 1852 Int lsIdx = vps->olsIdxToLsIdx( m_targetOlsIdx ); 1838 Int lIdx = -1; 1853 Int lIdx = -1; 1839 1854 for (Int j = 0; j < vps->getNumLayersInIdList( lsIdx ) ; j++ ) 1840 1855 { 1841 1856 if ( vps->getLayerSetLayerIdList( lsIdx, j ) == getLayerId() ) 1842 { 1843 lIdx = j; 1844 break; 1845 } 1846 } 1847 m_isInOwnTargetDecLayerIdList = (lIdx != -1); 1857 { 1858 lIdx = j; 1859 break; 1860 } 1861 } 1862 m_isInOwnTargetDecLayerIdList = (lIdx != -1); 1848 1863 1849 1864 if ( m_isInOwnTargetDecLayerIdList ) 1850 1865 { 1851 1866 Int profileIdc = vps->getPTL( vps->getProfileTierLevelIdx( m_targetOlsIdx, lIdx ) )->getGeneralPTL()->getProfileIdc(); 1852 assert( profileIdc == 1 || profileIdc == 6 || profileIdc == 8 ); 1867 assert( profileIdc == 1 || profileIdc == 6 || profileIdc == 8 ); 1853 1868 1854 1869 if ( profileIdc == 6 ) … … 1881 1896 1882 1897 // Output of this process is PicOrderCntVal, the picture order count of the current picture. 1883 // Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and 1898 // Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and 1884 1899 // motion vector prediction, and for decoder conformance checking (see clause C.5). 1885 1900 // Each coded picture is associated with a picture order count variable, denoted as PicOrderCntVal. 1886 1901 1887 const TComSlice* curSlice = m_pcPic->getSlice(0); 1888 1889 Int prevPicOrderCntLsb = MIN_INT; 1890 Int prevPicOrderCntMsb = MIN_INT; 1891 if (!(m_pcPic->isIrap() && m_pcPic->getNoRaslOutputFlag() ) ) 1892 { 1893 // When the current picture is not an IRAP picture with NoRaslOutputFlag equal to 1, 1902 const TComSlice* curSlice = m_pcPic->getSlice(0); 1903 1904 Int prevPicOrderCntLsb = MIN_INT; 1905 Int prevPicOrderCntMsb = MIN_INT; 1906 if (!(m_pcPic->isIrap() && m_pcPic->getNoRaslOutputFlag() ) ) 1907 { 1908 // When the current picture is not an IRAP picture with NoRaslOutputFlag equal to 1, 1894 1909 // the variables prevPicOrderCntLsb and prevPicOrderCntMsb are derived as follows: 1895 1910 1896 // - Let prevTid0Pic be the previous picture in decoding order that has TemporalId equal to 0 and that is not a RASL picture, 1911 // - Let prevTid0Pic be the previous picture in decoding order that has TemporalId equal to 0 and that is not a RASL picture, 1897 1912 // a RADL picture or an SLNR picture. 1898 1913 1899 1914 // - The variable prevPicOrderCntLsb is set equal to slice_pic_order_cnt_lsb of prevTid0Pic. 1900 prevPicOrderCntLsb = m_prevTid0PicSlicePicOrderCntLsb; 1915 prevPicOrderCntLsb = m_prevTid0PicSlicePicOrderCntLsb; 1901 1916 1902 1917 // - The variable prevPicOrderCntMsb is set equal to PicOrderCntMsb of prevTid0Pic. 1903 prevPicOrderCntMsb = m_prevTid0PicPicOrderCntMsb; 1904 } 1905 1906 // The variable PicOrderCntMsb of the current picture is derived as follows: 1907 1918 prevPicOrderCntMsb = m_prevTid0PicPicOrderCntMsb; 1919 } 1920 1921 // The variable PicOrderCntMsb of the current picture is derived as follows: 1922 1908 1923 Int slicePicOrderCntLsb = curSlice->getSlicePicOrderCntLsb(); 1909 1924 1910 Int picOrderCntMsb; 1925 Int picOrderCntMsb; 1911 1926 1912 1927 if (m_pcPic->isIrap() && m_pcPic->getNoRaslOutputFlag() ) 1913 1928 { 1914 1929 //- If the current picture is an IRAP picture with NoRaslOutputFlag equal to 1, PicOrderCntMsb is set equal to 0. 1915 picOrderCntMsb = 0; 1930 picOrderCntMsb = 0; 1916 1931 } 1917 1932 else 1918 1933 { 1919 Int maxPicOrderCntLsb = curSlice->getSPS()->getMaxPicOrderCntLsb(); 1934 Int maxPicOrderCntLsb = curSlice->getSPS()->getMaxPicOrderCntLsb(); 1920 1935 1921 1936 // - Otherwise, PicOrderCntMsb is derived as follows: … … 1933 1948 else 1934 1949 { 1935 picOrderCntMsb = prevPicOrderCntMsb; 1936 } 1937 } 1938 1950 picOrderCntMsb = prevPicOrderCntMsb; 1951 } 1952 } 1953 1939 1954 //PicOrderCntVal is derived as follows: 1940 1955 Int picOrderCntVal = picOrderCntMsb + slicePicOrderCntLsb; // (8 2) 1941 1956 1942 // NOTE 1 - All IDR pictures will have PicOrderCntVal equal to 0 since slice_pic_order_cnt_lsb is inferred to be 0 for IDR 1957 // NOTE 1 - All IDR pictures will have PicOrderCntVal equal to 0 since slice_pic_order_cnt_lsb is inferred to be 0 for IDR 1943 1958 // pictures and prevPicOrderCntLsb and prevPicOrderCntMsb are both set equal to 0. 1944 1959 1945 m_pcPic->getSlice(0)->setPOC( picOrderCntVal ); 1960 m_pcPic->getSlice(0)->setPOC( picOrderCntVal ); 1946 1961 1947 1962 // Update prevTid0Pic … … 1949 1964 if( curSlice->getTemporalId() == 0 && !m_pcPic->isRasl() && !m_pcPic->isRadl() && !m_pcPic->isSlnr() ) 1950 1965 { 1951 m_prevTid0PicSlicePicOrderCntLsb = slicePicOrderCntLsb; 1952 m_prevTid0PicPicOrderCntMsb = picOrderCntMsb; 1966 m_prevTid0PicSlicePicOrderCntLsb = slicePicOrderCntLsb; 1967 m_prevTid0PicPicOrderCntMsb = picOrderCntMsb; 1953 1968 } 1954 1969 } … … 1957 1972 { 1958 1973 //Output of this process is PicOrderCntVal, the picture order count of the current picture. 1959 // Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and 1974 // Picture order counts are used to identify pictures, for deriving motion parameters in merge mode and 1960 1975 // motion vector prediction and for decoder conformance checking (see clause F.13.5). 1961 1976 1962 1977 // Each coded picture is associated with a picture order count variable, denoted as PicOrderCntVal. 1963 1978 1964 const TComSlice* slice = m_pcPic->getSlice(0); 1965 const Int nuhLayerId = m_pcPic->getLayerId(); 1966 const TComVPS* vps = slice->getVPS(); 1967 const TComSPS* sps = slice->getSPS(); 1979 const TComSlice* slice = m_pcPic->getSlice(0); 1980 const Int nuhLayerId = m_pcPic->getLayerId(); 1981 const TComVPS* vps = slice->getVPS(); 1982 const TComSPS* sps = slice->getSPS(); 1968 1983 if ( m_pcPic->getIsFstPicOfAllLayOfPocResetPer() ) 1969 1984 { 1970 // When the current picture is the first picture among all layers of a POC resetting period, 1985 // When the current picture is the first picture among all layers of a POC resetting period, 1971 1986 // the variable PocDecrementedInDPBFlag[ i ] is set equal to 0 for each value of i in the range of 0 to 62, inclusive. 1972 1987 for (Int i = 0; i <= 62; i++) 1973 1988 { 1974 m_pocDecrementedInDpbFlag[ i ] = 0; 1989 m_pocDecrementedInDpbFlag[ i ] = 0; 1975 1990 } 1976 1991 } 1977 1992 1978 1993 // The variable pocResettingFlag is derived as follows: 1979 Bool pocResettingFlag; 1994 Bool pocResettingFlag; 1980 1995 if (m_pcPic->getIsPocResettingPic() ) 1981 1996 { 1982 //- If the current picture is a POC resetting picture, the following applies: 1997 //- If the current picture is a POC resetting picture, the following applies: 1983 1998 if( vps->getVpsPocLsbAlignedFlag() ) 1984 1999 { 1985 2000 // - If vps_poc_lsb_aligned_flag is equal to 0, pocResettingFlag is set equal to 1. 1986 pocResettingFlag = true; 2001 pocResettingFlag = true; 1987 2002 } 1988 2003 else if ( m_pocDecrementedInDpbFlag[ nuhLayerId ] ) 1989 2004 { 1990 2005 // - Otherwise, if PocDecrementedInDPBFlag[ nuh_layer_id ] is equal to 1, pocResettingFlag is set equal to 0. 1991 pocResettingFlag = false; 2006 pocResettingFlag = false; 1992 2007 } 1993 2008 else 1994 2009 { 1995 2010 // - Otherwise, pocResettingFlag is set equal to 1. 1996 pocResettingFlag = true; 2011 pocResettingFlag = true; 1997 2012 } 1998 2013 } … … 2000 2015 { 2001 2016 // - Otherwise, pocResettingFlag is set equal to 0. 2002 pocResettingFlag = false; 2017 pocResettingFlag = false; 2003 2018 } 2004 2019 2005 2020 // The list affectedLayerList is derived as follows: 2006 std::vector<Int> affectedLayerList; 2021 std::vector<Int> affectedLayerList; 2007 2022 if (! vps->getVpsPocLsbAlignedFlag() ) 2008 2023 { 2009 2024 //- If vps_poc_lsb_aligned_flag is equal to 0, affectedLayerList consists of the nuh_layer_id of the current picture. 2010 affectedLayerList.push_back( nuhLayerId ); 2025 affectedLayerList.push_back( nuhLayerId ); 2011 2026 } 2012 2027 else 2013 2028 { 2014 // - Otherwise, affectedLayerList consists of the nuh_layer_id of the current picture and the nuh_layer_id values 2015 // equal to IdPredictedLayer[ currNuhLayerId ][ j ] for all values of j in the range of 0 to NumPredictedLayers[ currNuhLayerId ] - 1, 2029 // - Otherwise, affectedLayerList consists of the nuh_layer_id of the current picture and the nuh_layer_id values 2030 // equal to IdPredictedLayer[ currNuhLayerId ][ j ] for all values of j in the range of 0 to NumPredictedLayers[ currNuhLayerId ] - 1, 2016 2031 // inclusive, where currNuhLayerId is the nuh_layer_id value of the current picture. 2017 affectedLayerList.push_back( nuhLayerId ); 2018 Int currNuhLayerId = nuhLayerId; 2032 affectedLayerList.push_back( nuhLayerId ); 2033 Int currNuhLayerId = nuhLayerId; 2019 2034 for (Int j = 0; j <= vps->getNumPredictedLayers( currNuhLayerId )-1; j++ ) 2020 2035 { … … 2022 2037 } 2023 2038 } 2024 2025 Int picOrderCntMsb; 2026 Int picOrderCntVal; 2039 2040 Int picOrderCntMsb; 2041 Int picOrderCntVal; 2027 2042 2028 2043 // Depending on pocResettingFlag, the following applies: … … 2033 2048 { 2034 2049 //- The variables pocMsbDelta, pocLsbDelta and DeltaPocVal are derived as follows: 2035 Int pocMsbDelta; 2036 Int pocLsbDelta; 2037 Int deltaPocVal; 2038 2039 { 2040 Int pocLsbVal; 2041 Int prevPicOrderCntLsb; 2042 Int prevPicOrderCntMsb; 2050 Int pocMsbDelta; 2051 Int pocLsbDelta; 2052 Int deltaPocVal; 2053 2054 { 2055 Int pocLsbVal; 2056 Int prevPicOrderCntLsb; 2057 Int prevPicOrderCntMsb; 2043 2058 2044 2059 if( slice->getPocResetIdc() == 3 ) 2045 2060 { 2046 pocLsbVal = slice->getPocLsbVal(); 2047 } 2061 pocLsbVal = slice->getPocLsbVal(); 2062 } 2048 2063 else 2049 2064 { 2050 pocLsbVal = slice->getSlicePicOrderCntLsb(); 2065 pocLsbVal = slice->getSlicePicOrderCntLsb(); 2051 2066 } 2052 2067 … … 2054 2069 { 2055 2070 pocMsbDelta = slice->getPocMsbCycleVal() * sps->getMaxPicOrderCntLsb(); // (F 60) 2056 }2057 else2058 {2059 prevPicOrderCntLsb = m_prevPicOrderCnt & ( sps->getMaxPicOrderCntLsb() - 1 );2060 prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb;2061 2062 pocMsbDelta = xGetCurrMsb( pocLsbVal, prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() );2063 }2064 2065 if( slice->getPocResetIdc() == 2 || ( slice->getPocResetIdc() == 3 && slice->getFullPocResetFlag() ) )2066 {2067 pocLsbDelta = pocLsbVal;2068 2071 } 2069 2072 else 2070 2073 { 2071 pocLsbDelta = 0; 2074 prevPicOrderCntLsb = m_prevPicOrderCnt & ( sps->getMaxPicOrderCntLsb() - 1 ); 2075 prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb; 2076 2077 pocMsbDelta = xGetCurrMsb( pocLsbVal, prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() ); 2072 2078 } 2073 deltaPocVal = pocMsbDelta + pocLsbDelta; 2074 } 2075 2076 //- The PicOrderCntVal of each picture that has nuh_layer_id value nuhLayerId for which PocDecrementedInDPBFlag[ nuhLayerId ] is equal to 0 2079 2080 if( slice->getPocResetIdc() == 2 || ( slice->getPocResetIdc() == 3 && slice->getFullPocResetFlag() ) ) 2081 { 2082 pocLsbDelta = pocLsbVal; 2083 } 2084 else 2085 { 2086 pocLsbDelta = 0; 2087 } 2088 deltaPocVal = pocMsbDelta + pocLsbDelta; 2089 } 2090 2091 //- The PicOrderCntVal of each picture that has nuh_layer_id value nuhLayerId for which PocDecrementedInDPBFlag[ nuhLayerId ] is equal to 0 2077 2092 // and that is equal to any value in affectedLayerList is decremented by DeltaPocVal. 2078 2093 for (Int i = 0; i < (Int) affectedLayerList.size(); i++ ) … … 2080 2095 if ( !m_pocDecrementedInDpbFlag[ affectedLayerList[i] ] ) 2081 2096 { 2082 m_dpb->decrementPocsInSubDpb( affectedLayerList[i], deltaPocVal ); 2097 m_dpb->decrementPocsInSubDpb( affectedLayerList[i], deltaPocVal ); 2083 2098 } 2084 2099 } … … 2087 2102 for (Int i = 0; i < (Int) affectedLayerList.size(); i++ ) 2088 2103 { 2089 m_pocDecrementedInDpbFlag[ affectedLayerList[i] ] = true; 2090 } 2091 } 2104 m_pocDecrementedInDpbFlag[ affectedLayerList[i] ] = true; 2105 } 2106 } 2092 2107 2093 2108 //- The PicOrderCntVal of the current picture is derived as follows: 2094 2109 if( slice->getPocResetIdc() == 1 ) 2095 2110 { 2096 picOrderCntVal = slice->getSlicePicOrderCntLsb(); 2097 } 2098 else if (slice->getPocResetIdc() == 2 ) 2099 { 2100 picOrderCntVal = 0; 2111 picOrderCntVal = slice->getSlicePicOrderCntLsb(); 2112 } 2113 else if (slice->getPocResetIdc() == 2 ) 2114 { 2115 picOrderCntVal = 0; 2101 2116 } 2102 2117 else 2103 2118 { 2104 picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal(), 0, sps->getMaxPicOrderCntLsb() ); 2105 picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 2119 picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal(), 0, sps->getMaxPicOrderCntLsb() ); 2120 picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 2106 2121 } 2107 2122 } … … 2110 2125 //- Otherwise (pocResettingFlag is equal to 0), the following applies: 2111 2126 //- The PicOrderCntVal of the current picture is derived as follows: 2112 2127 2113 2128 if( slice->getPocMsbCycleValPresentFlag() ) 2114 2129 { 2115 picOrderCntMsb = slice->getPocMsbCycleVal() * sps->getMaxPicOrderCntLsb(); 2130 picOrderCntMsb = slice->getPocMsbCycleVal() * sps->getMaxPicOrderCntLsb(); 2116 2131 } 2117 2132 else if( !m_firstPicInLayerDecodedFlag[ nuhLayerId ] || … … 2119 2134 { 2120 2135 picOrderCntMsb = 0; // (F 62) 2121 } 2136 } 2122 2137 else 2123 2138 { 2124 2139 Int prevPicOrderCntLsb = m_prevPicOrderCnt & ( sps->getMaxPicOrderCntLsb() - 1 ); 2125 Int prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb; 2126 picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() ); 2127 } 2128 picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 2129 } 2130 2131 m_pcPic->getSlice(0)->setPOC( picOrderCntVal ); 2132 2140 Int prevPicOrderCntMsb = m_prevPicOrderCnt - prevPicOrderCntLsb; 2141 picOrderCntMsb = xGetCurrMsb( slice->getSlicePicOrderCntLsb(), prevPicOrderCntLsb, prevPicOrderCntMsb, sps->getMaxPicOrderCntLsb() ); 2142 } 2143 picOrderCntVal = picOrderCntMsb + slice->getSlicePicOrderCntLsb(); 2144 } 2145 2146 m_pcPic->getSlice(0)->setPOC( picOrderCntVal ); 2147 2133 2148 for (Int lId = 0; lId < (Int) affectedLayerList.size(); lId++ ) 2134 { 2149 { 2135 2150 // The value of PrevPicOrderCnt[ lId ] for each of the lId values included in affectedLayerList is derived as follows: 2136 2151 2137 2152 if (!m_pcPic->isRasl() && !m_pcPic->isRadl() && !m_pcPic->isSlnr() && slice->getTemporalId() == 0 && !slice->getDiscardableFlag() ) 2138 2153 { 2139 //- If the current picture is not a RASL picture, a RADL picture or a sub-layer non-reference picture, and the current picture 2154 //- If the current picture is not a RASL picture, a RADL picture or a sub-layer non-reference picture, and the current picture 2140 2155 // has TemporalId equal to 0 and discardable_flag equal to 0, PrevPicOrderCnt[ lId ] is set equal to PicOrderCntVal. 2141 m_prevPicOrderCnt = picOrderCntVal; 2156 m_prevPicOrderCnt = picOrderCntVal; 2142 2157 } 2143 2158 else if ( slice->getPocResetIdc() == 3 && ( 2144 ( !m_firstPicInLayerDecodedFlag[ nuhLayerId ]) || 2145 ( m_firstPicInLayerDecodedFlag[ nuhLayerId ] && m_pcPic->getIsPocResettingPic() ) 2159 ( !m_firstPicInLayerDecodedFlag[ nuhLayerId ]) || 2160 ( m_firstPicInLayerDecodedFlag[ nuhLayerId ] && m_pcPic->getIsPocResettingPic() ) 2146 2161 ) ) 2147 2162 { … … 2149 2164 // - FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 0. 2150 2165 // - FirstPicInLayerDecodedFlag[ nuh_layer_id ] is equal to 1 and the current picture is a POC resetting picture. 2151 m_prevPicOrderCnt = ( slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal() ); 2166 m_prevPicOrderCnt = ( slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal() ); 2152 2167 } 2153 2168 } … … 2156 2171 Int TDecTop::xGetCurrMsb( Int cl, Int pl, Int pm, Int ml ) 2157 2172 { 2158 Int currMsb; 2173 Int currMsb; 2159 2174 if ((pl - cl) >= (ml/ 2)) 2160 2175 { … … 2163 2178 else if ( (cl - pl) > (ml / 2)) 2164 2179 { 2165 currMsb = pm - ml; 2180 currMsb = pm - ml; 2166 2181 } 2167 2182 else 2168 2183 { 2169 currMsb = pm; 2170 } 2171 2172 return currMsb; 2173 } 2184 currMsb = pm; 2185 } 2186 2187 return currMsb; 2188 } 2174 2189 2175 2190 … … 2181 2196 /////////////////////////////////////////////////////////////////////////////////////// 2182 2197 2183 TComSlice* slice = m_pcPic->getSlice( 0 ); 2184 const TComSPS* sps = slice->getSPS(); 2185 // This process is invoked once per picture, after decoding of a slice header but prior to the decoding of any coding unit and prior 2186 // to the decoding process for reference picture list construction for the slice as specified in clause 8.3.3. 2187 // This process may result in one or more reference pictures in the DPB being marked as "unused for reference" or 2198 TComSlice* slice = m_pcPic->getSlice( 0 ); 2199 const TComSPS* sps = slice->getSPS(); 2200 // This process is invoked once per picture, after decoding of a slice header but prior to the decoding of any coding unit and prior 2201 // to the decoding process for reference picture list construction for the slice as specified in clause 8.3.3. 2202 // This process may result in one or more reference pictures in the DPB being marked as "unused for reference" or 2188 2203 // "used for long-term reference". 2189 2204 2190 2205 // The variable currPicLayerId is set equal to nuh_layer_id of the current picture. 2191 Int currPicLayerId = m_pcPic->getLayerId(); 2192 Int picOrderCntVal = m_pcPic->getPOC(); 2206 Int currPicLayerId = m_pcPic->getLayerId(); 2207 Int picOrderCntVal = m_pcPic->getPOC(); 2193 2208 2194 2209 if (m_pcPic->isIrap() && m_pcPic->getNoRaslOutputFlag() ) 2195 { 2196 // When the current picture is an IRAP picture with NoRaslOutputFlag equal to 1, 2197 // all reference pictures with nuh_layer_id equal to currPicLayerId currently in the 2210 { 2211 // When the current picture is an IRAP picture with NoRaslOutputFlag equal to 1, 2212 // all reference pictures with nuh_layer_id equal to currPicLayerId currently in the 2198 2213 // DPB (if any) are marked as "unused for reference". 2199 m_dpb->markSubDpbAsUnusedForReference( currPicLayerId ); 2200 } 2201 // Short-term reference pictures are identified by their PicOrderCntVal values. Long-term reference pictures are identified either by 2214 m_dpb->markSubDpbAsUnusedForReference( currPicLayerId ); 2215 } 2216 // Short-term reference pictures are identified by their PicOrderCntVal values. Long-term reference pictures are identified either by 2202 2217 // their PicOrderCntVal values or their slice_pic_order_cnt_lsb values. 2203 2218 2204 // Five lists of picture order count values are constructed to derive the RPS. These five lists are PocStCurrBefore, 2205 // PocStCurrAfter, PocStFoll, PocLtCurr and PocLtFoll, with NumPocStCurrBefore, NumPocStCurrAfter, NumPocStFoll, 2219 // Five lists of picture order count values are constructed to derive the RPS. These five lists are PocStCurrBefore, 2220 // PocStCurrAfter, PocStFoll, PocLtCurr and PocLtFoll, with NumPocStCurrBefore, NumPocStCurrAfter, NumPocStFoll, 2206 2221 // NumPocLtCurr and NumPocLtFoll number of elements, respectively. The five lists and the five variables are derived as follows: 2207 2208 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 2222 2223 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 2209 2224 2210 2225 std::vector<Int>& pocStCurrBefore = decRps->m_pocStCurrBefore; … … 2214 2229 std::vector<Int>& pocLtFoll = decRps->m_pocLtFoll; 2215 2230 2216 Int& numPocStCurrBefore = decRps->m_numPocStCurrBefore; 2231 Int& numPocStCurrBefore = decRps->m_numPocStCurrBefore; 2217 2232 Int& numPocStCurrAfter = decRps->m_numPocStCurrAfter; 2218 2233 Int& numPocStFoll = decRps->m_numPocStFoll; 2219 2234 Int& numPocLtCurr = decRps->m_numPocLtCurr; 2220 Int& numPocLtFoll = decRps->m_numPocLtFoll; 2221 2222 std::vector<Int> currDeltaPocMsbPresentFlag, follDeltaPocMsbPresentFlag; 2235 Int& numPocLtFoll = decRps->m_numPocLtFoll; 2236 2237 std::vector<Int> currDeltaPocMsbPresentFlag, follDeltaPocMsbPresentFlag; 2223 2238 2224 2239 if (m_pcPic->isIdr() ) 2225 2240 { 2226 // - If the current picture is an IDR picture, PocStCurrBefore, PocStCurrAfter, PocStFoll, 2227 // PocLtCurr and PocLtFoll are all set to be empty, and NumPocStCurrBefore, 2241 // - If the current picture is an IDR picture, PocStCurrBefore, PocStCurrAfter, PocStFoll, 2242 // PocLtCurr and PocLtFoll are all set to be empty, and NumPocStCurrBefore, 2228 2243 // NumPocStCurrAfter, NumPocStFoll, NumPocLtCurr and NumPocLtFoll are all set equal to 0. 2229 2244 … … 2233 2248 pocLtCurr .clear(); 2234 2249 pocLtFoll .clear(); 2235 numPocStCurrBefore = 0; 2236 numPocStCurrAfter = 0; 2237 numPocStFoll = 0; 2238 numPocLtCurr = 0; 2239 numPocLtFoll = 0; 2250 numPocStCurrBefore = 0; 2251 numPocStCurrAfter = 0; 2252 numPocStFoll = 0; 2253 numPocLtCurr = 0; 2254 numPocLtFoll = 0; 2240 2255 } 2241 2256 else … … 2244 2259 // - Otherwise, the following applies: 2245 2260 2246 Int j = 0; 2247 Int k = 0; 2261 Int j = 0; 2262 Int k = 0; 2248 2263 for( Int i = 0; i < stRps->getNumNegativePicsVar() ; i++ ) 2249 2264 { … … 2257 2272 } 2258 2273 } 2259 numPocStCurrBefore = j; 2260 2261 j = 0; 2274 numPocStCurrBefore = j; 2275 2276 j = 0; 2262 2277 for (Int i = 0; i < stRps->getNumPositivePicsVar(); i++ ) 2263 2278 { 2264 2279 if (stRps->getUsedByCurrPicS1Var( i ) ) 2265 2280 { 2266 pocStCurrAfter.push_back( picOrderCntVal + stRps->getDeltaPocS1Var( i ) ); j++; 2281 pocStCurrAfter.push_back( picOrderCntVal + stRps->getDeltaPocS1Var( i ) ); j++; 2267 2282 } 2268 2283 else … … 2275 2290 2276 2291 2277 j = 0; 2278 k = 0; 2292 j = 0; 2293 k = 0; 2279 2294 for( Int i = 0; i < slice->getNumLongTermSps( ) + slice->getNumLongTermPics(); i++ ) 2280 2295 { 2281 Int pocLt = slice->getPocLsbLtVar( i ); 2296 Int pocLt = slice->getPocLsbLtVar( i ); 2282 2297 if( slice->getDeltaPocMsbPresentFlag( i ) ) 2283 2298 { … … 2286 2301 } 2287 2302 2288 if( slice->getUsedByCurrPicLtVar(i)) 2303 if( slice->getUsedByCurrPicLtVar(i)) 2289 2304 { 2290 2305 pocLtCurr.push_back( pocLt ); 2291 currDeltaPocMsbPresentFlag.push_back( slice->getDeltaPocMsbPresentFlag( i ) ); j++; 2292 } 2306 currDeltaPocMsbPresentFlag.push_back( slice->getDeltaPocMsbPresentFlag( i ) ); j++; 2307 } 2293 2308 else 2294 2309 { 2295 2310 pocLtFoll.push_back( pocLt ); 2296 follDeltaPocMsbPresentFlag.push_back( slice->getDeltaPocMsbPresentFlag( i ) ); k++; 2311 follDeltaPocMsbPresentFlag.push_back( slice->getDeltaPocMsbPresentFlag( i ) ); k++; 2297 2312 } 2298 2313 } … … 2303 2318 assert(numPocStCurrAfter == pocStCurrAfter .size() ); 2304 2319 assert(numPocStCurrBefore == pocStCurrBefore .size() ); 2305 assert(numPocStFoll == pocStFoll .size() ); 2306 assert(numPocLtCurr == pocLtCurr .size() ); 2320 assert(numPocStFoll == pocStFoll .size() ); 2321 assert(numPocLtCurr == pocLtCurr .size() ); 2307 2322 assert(numPocLtFoll == pocLtFoll .size() ); 2308 2323 2309 2324 // where PicOrderCntVal is the picture order count of the current picture as specified in clause 8.3.1. 2310 2325 2311 // NOTE 2 - A value of CurrRpsIdx in the range of 0 to num_short_term_ref_pic_sets - 1, inclusive, 2312 // indicates that a candidate short-term RPS from the active SPS for the current layer is being used, 2313 // where CurrRpsIdx is the index of the candidate short-term RPS into the list of candidate short-term RPSs signalled 2314 // in the active SPS for the current layer. CurrRpsIdx equal to num_short_term_ref_pic_sets indicates that 2326 // NOTE 2 - A value of CurrRpsIdx in the range of 0 to num_short_term_ref_pic_sets - 1, inclusive, 2327 // indicates that a candidate short-term RPS from the active SPS for the current layer is being used, 2328 // where CurrRpsIdx is the index of the candidate short-term RPS into the list of candidate short-term RPSs signalled 2329 // in the active SPS for the current layer. CurrRpsIdx equal to num_short_term_ref_pic_sets indicates that 2315 2330 // the short-term RPS of the current picture is directly signalled in the slice header. 2316 2331 2317 2332 for (Int i = 0; i <= numPocLtCurr - 1; i++ ) 2318 2333 { 2319 // For each i in the range of 0 to NumPocLtCurr - 1, inclusive, when CurrDeltaPocMsbPresentFlag[ i ] is equal to 1, 2334 // For each i in the range of 0 to NumPocLtCurr - 1, inclusive, when CurrDeltaPocMsbPresentFlag[ i ] is equal to 1, 2320 2335 // it is a requirement of bitstream conformance that the following conditions apply: 2321 2336 if ( currDeltaPocMsbPresentFlag[i] ) 2322 2337 { 2323 // - There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive, 2338 // - There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive, 2324 2339 // for which PocLtCurr[ i ] is equal to PocStCurrBefore[ j ]. 2325 2340 for (Int j = 0; j <= numPocStCurrBefore - 1; j++ ) … … 2328 2343 } 2329 2344 2330 // - There shall be no j in the range of 0 to NumPocStCurrAfter - 1, inclusive, 2331 // for which PocLtCurr[ i ] is equal to PocStCurrAfter[ j ]. 2345 // - There shall be no j in the range of 0 to NumPocStCurrAfter - 1, inclusive, 2346 // for which PocLtCurr[ i ] is equal to PocStCurrAfter[ j ]. 2332 2347 for (Int j = 0; j <= numPocStCurrAfter - 1; j++ ) 2333 2348 { … … 2335 2350 } 2336 2351 2337 // - There shall be no j in the range of 0 to NumPocStFoll - 1, inclusive, 2352 // - There shall be no j in the range of 0 to NumPocStFoll - 1, inclusive, 2338 2353 // for which PocLtCurr[ i ] is equal to PocStFoll[ j ]. 2339 2354 for (Int j = 0; j <= numPocStFoll - 1; j++ ) … … 2342 2357 } 2343 2358 2344 // - There shall be no j in the range of 0 to NumPocLtCurr - 1, inclusive, 2359 // - There shall be no j in the range of 0 to NumPocLtCurr - 1, inclusive, 2345 2360 // where j is not equal to i, for which PocLtCurr[ i ] is equal to PocLtCurr[ j ]. 2346 2361 for (Int j = 0; j <= numPocLtCurr - 1; j++ ) 2347 2362 { 2348 2363 if ( i != j ) 2349 { 2364 { 2350 2365 assert(!( pocLtCurr[ i ] == pocLtCurr[ j ] ) ); 2351 2366 } … … 2356 2371 for (Int i = 0; i <= numPocLtFoll - 1; i++ ) 2357 2372 { 2358 // For each i in the range of 0 to NumPocLtFoll - 1, inclusive, when FollDeltaPocMsbPresentFlag[ i ] is equal to 1, 2373 // For each i in the range of 0 to NumPocLtFoll - 1, inclusive, when FollDeltaPocMsbPresentFlag[ i ] is equal to 1, 2359 2374 // it is a requirement of bitstream conformance that the following conditions apply: 2360 2375 if ( follDeltaPocMsbPresentFlag[i] ) 2361 2376 { 2362 // - There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive, 2377 // - There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive, 2363 2378 // for which PocLtFoll[ i ] is equal to PocStCurrBefore[ j ]. 2364 2379 for (Int j = 0; j <= numPocStCurrBefore - 1; j++ ) … … 2367 2382 } 2368 2383 2369 // - There shall be no j in the range of 0 to NumPocStCurrAfter - 1, inclusive, 2384 // - There shall be no j in the range of 0 to NumPocStCurrAfter - 1, inclusive, 2370 2385 // for which PocLtFoll[ i ] is equal to PocStCurrAfter[ j ]. 2371 2386 for (Int j = 0; j <= numPocStCurrAfter - 1; j++ ) … … 2374 2389 } 2375 2390 2376 // - There shall be no j in the range of 0 to NumPocStFoll - 1, inclusive, 2391 // - There shall be no j in the range of 0 to NumPocStFoll - 1, inclusive, 2377 2392 // for which PocLtFoll[ i ] is equal to PocStFoll[ j ]. 2378 2393 for (Int j = 0; j <= numPocStFoll - 1; j++ ) … … 2381 2396 } 2382 2397 2383 // - There shall be no j in the range of 0 to NumPocLtFoll - 1, inclusive, 2398 // - There shall be no j in the range of 0 to NumPocLtFoll - 1, inclusive, 2384 2399 // where j is not equal to i, for which PocLtFoll[ i ] is equal to PocLtFoll[ j ]. 2385 2400 for (Int j = 0; j <= numPocLtFoll - 1; j++ ) … … 2391 2406 } 2392 2407 2393 // - There shall be no j in the range of 0 to NumPocLtCurr - 1, inclusive, 2408 // - There shall be no j in the range of 0 to NumPocLtCurr - 1, inclusive, 2394 2409 // for which PocLtFoll[ i ] is equal to PocLtCurr[ j ]. 2395 2410 for (Int j = 0; j <= numPocLtCurr - 1; j++ ) … … 2400 2415 } 2401 2416 2402 Int maxPicOrderCntLsb = sps->getMaxPicOrderCntLsb(); 2417 Int maxPicOrderCntLsb = sps->getMaxPicOrderCntLsb(); 2403 2418 for (Int i = 0; i <= numPocLtCurr - 1; i++ ) 2404 2419 { 2405 // For each i in the range of 0 to NumPocLtCurr - 1, inclusive, when CurrDeltaPocMsbPresentFlag[ i ] is equal to 0, 2420 // For each i in the range of 0 to NumPocLtCurr - 1, inclusive, when CurrDeltaPocMsbPresentFlag[ i ] is equal to 0, 2406 2421 // it is a requirement of bitstream conformance that the following conditions apply: 2407 2422 if ( currDeltaPocMsbPresentFlag[ i ] == 0 ) 2408 2423 { 2409 // - There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive, 2424 // - There shall be no j in the range of 0 to NumPocStCurrBefore - 1, inclusive, 2410 2425 // for which PocLtCurr[ i ] is equal to ( PocStCurrBefore[ j ] & ( MaxPicOrderCntLsb - 1 ) ). 2411 2426 for (Int j = 0; j <= numPocStCurrBefore - 1; j++ ) … … 2442 2457 for (Int i = 0; i <= numPocLtFoll - 1; i++ ) 2443 2458 { 2444 // For each i in the range of 0 to NumPocLtFoll - 1, inclusive, when FollDeltaPocMsbPresentFlag[ i ] is equal to 0, 2459 // For each i in the range of 0 to NumPocLtFoll - 1, inclusive, when FollDeltaPocMsbPresentFlag[ i ] is equal to 0, 2445 2460 // it is a requirement of bitstream conformance that the following conditions apply: 2446 2461 if ( follDeltaPocMsbPresentFlag[ i ] == 0 ) … … 2474 2489 { 2475 2490 assert(!( pocLtFoll[ i ] == ( pocLtFoll[ j ] & ( maxPicOrderCntLsb - 1 ) ) ) ); 2476 } 2491 } 2477 2492 } 2478 2493 … … 2487 2502 2488 2503 if ( !annexFModifications ) 2489 { 2490 // The variable NumPicTotalCurr is derived as specified in clause 7.4.7.2. 2504 { 2505 // The variable NumPicTotalCurr is derived as specified in clause 7.4.7.2. 2491 2506 2492 2507 // It is a requirement of bitstream conformance that the following applies to the value of NumPicTotalCurr: … … 2494 2509 { 2495 2510 // - If the current picture is a BLA or CRA picture, the value of NumPicTotalCurr shall be equal to 0. 2496 assert( slice->getNumPicTotalCurr() == 0 ); 2511 assert( slice->getNumPicTotalCurr() == 0 ); 2497 2512 } 2498 2513 else 2499 2514 { 2500 // - Otherwise, 2515 // - Otherwise, 2501 2516 if ( slice->isInterP() || slice->isInterB() ) 2502 2517 { 2503 2518 // when the current picture contains a P or B slice, the value of NumPicTotalCurr shall not be equal to 0. 2504 assert( slice->getNumPicTotalCurr() != 0 ); 2505 } 2506 } 2507 } 2508 2509 // The RPS of the current picture consists of five RPS lists; RefPicSetStCurrBefore, RefPicSetStCurrAfter, RefPicSetStFoll, 2510 // RefPicSetLtCurr and RefPicSetLtFoll. RefPicSetStCurrBefore, RefPicSetStCurrAfter and RefPicSetStFoll are collectively 2519 assert( slice->getNumPicTotalCurr() != 0 ); 2520 } 2521 } 2522 } 2523 2524 // The RPS of the current picture consists of five RPS lists; RefPicSetStCurrBefore, RefPicSetStCurrAfter, RefPicSetStFoll, 2525 // RefPicSetLtCurr and RefPicSetLtFoll. RefPicSetStCurrBefore, RefPicSetStCurrAfter and RefPicSetStFoll are collectively 2511 2526 // referred to as the short-term RPS. RefPicSetLtCurr and RefPicSetLtFoll are collectively referred to as the long-term RPS. 2512 2527 … … 2516 2531 std::vector<TComPic*>& refPicSetLtCurr = decRps->m_refPicSetLtCurr ; 2517 2532 std::vector<TComPic*>& refPicSetLtFoll = decRps->m_refPicSetLtFoll ; 2518 2533 2519 2534 std::vector<TComPic*>** refPicSetsCurr = decRps->m_refPicSetsCurr ; 2520 2535 std::vector<TComPic*>** refPicSetsLt = decRps->m_refPicSetsLt ; 2521 2536 std::vector<TComPic*>** refPicSetsAll = decRps->m_refPicSetsAll ; 2522 // NOTE 3 - RefPicSetStCurrBefore, RefPicSetStCurrAfter and RefPicSetLtCurr contain all reference pictures that may be 2537 // NOTE 3 - RefPicSetStCurrBefore, RefPicSetStCurrAfter and RefPicSetLtCurr contain all reference pictures that may be 2523 2538 // used for inter prediction of the current picture and one or more pictures that follow the current picture in decoding order. 2524 // RefPicSetStFoll and RefPicSetLtFoll consist of all reference pictures that are not used for inter prediction of the current 2539 // RefPicSetStFoll and RefPicSetLtFoll consist of all reference pictures that are not used for inter prediction of the current 2525 2540 // picture but may be used in inter prediction for one or more pictures that follow the current picture in decoding order. 2526 2541 … … 2528 2543 // 1. The following applies: 2529 2544 2530 TComSubDpb* dpb = m_dpb->getSubDpb( getLayerId(), false ); 2545 TComSubDpb* dpb = m_dpb->getSubDpb( getLayerId(), false ); 2531 2546 assert( refPicSetLtCurr.empty() ); 2532 for( Int i = 0; i < numPocLtCurr; i++ ) 2533 { 2534 if( !currDeltaPocMsbPresentFlag[ i ] ) 2535 { 2536 refPicSetLtCurr.push_back( dpb->getPicFromLsb( pocLtCurr[ i ], maxPicOrderCntLsb ) ); 2547 for( Int i = 0; i < numPocLtCurr; i++ ) 2548 { 2549 if( !currDeltaPocMsbPresentFlag[ i ] ) 2550 { 2551 refPicSetLtCurr.push_back( dpb->getPicFromLsb( pocLtCurr[ i ], maxPicOrderCntLsb ) ); 2537 2552 } 2538 2553 else 2539 2554 { 2540 refPicSetLtCurr.push_back(dpb->getPic( pocLtCurr[ i ] )); 2541 } 2555 refPicSetLtCurr.push_back(dpb->getPic( pocLtCurr[ i ] )); 2556 } 2542 2557 } 2543 2558 … … 2551 2566 else 2552 2567 { 2553 refPicSetLtFoll.push_back(dpb->getPic( pocLtFoll[ i ] )); 2568 refPicSetLtFoll.push_back(dpb->getPic( pocLtFoll[ i ] )); 2554 2569 } 2555 2570 } 2556 2557 // 2. All reference pictures that are included in RefPicSetLtCurr or RefPicSetLtFoll and have nuh_layer_id equal 2571 2572 // 2. All reference pictures that are included in RefPicSetLtCurr or RefPicSetLtFoll and have nuh_layer_id equal 2558 2573 // to currPicLayerId are marked as "used for long-term reference". 2559 2574 for (Int i = 0; i < numPocLtCurr; i++) … … 2561 2576 if ( refPicSetLtCurr[i] != NULL ) 2562 2577 { 2563 refPicSetLtCurr[i]->markAsUsedForLongTermReference(); 2564 } 2578 refPicSetLtCurr[i]->markAsUsedForLongTermReference(); 2579 } 2565 2580 } 2566 2581 … … 2569 2584 if ( refPicSetLtFoll[i] != NULL ) 2570 2585 { 2571 refPicSetLtFoll[i]->markAsUsedForLongTermReference(); 2572 } 2586 refPicSetLtFoll[i]->markAsUsedForLongTermReference(); 2587 } 2573 2588 } 2574 2589 … … 2577 2592 for( Int i = 0; i < numPocStCurrBefore; i++ ) 2578 2593 { 2579 refPicSetStCurrBefore.push_back(dpb->getShortTermRefPic( pocStCurrBefore[ i ] )); 2594 refPicSetStCurrBefore.push_back(dpb->getShortTermRefPic( pocStCurrBefore[ i ] )); 2580 2595 } 2581 2596 … … 2583 2598 for( Int i = 0; i < numPocStCurrAfter; i++ ) 2584 2599 { 2585 refPicSetStCurrAfter.push_back(dpb->getShortTermRefPic( pocStCurrAfter[ i ] )); 2600 refPicSetStCurrAfter.push_back(dpb->getShortTermRefPic( pocStCurrAfter[ i ] )); 2586 2601 } 2587 2602 … … 2589 2604 for( Int i = 0; i < numPocStFoll; i++ ) 2590 2605 { 2591 refPicSetStFoll.push_back(dpb->getShortTermRefPic( pocStFoll[ i ] )); 2592 } 2593 2594 // 4. All reference pictures in the DPB that are not included in RefPicSetLtCurr, RefPicSetLtFoll, RefPicSetStCurrBefore, 2606 refPicSetStFoll.push_back(dpb->getShortTermRefPic( pocStFoll[ i ] )); 2607 } 2608 2609 // 4. All reference pictures in the DPB that are not included in RefPicSetLtCurr, RefPicSetLtFoll, RefPicSetStCurrBefore, 2595 2610 // RefPicSetStCurrAfter, or RefPicSetStFoll and have nuh_layer_id equal to currPicLayerId are marked as "unused for reference". 2596 TComSubDpb picsToMark = (*dpb); 2611 TComSubDpb picsToMark = (*dpb); 2597 2612 for (Int j = 0; j < 5; j++ ) 2598 2613 { 2599 picsToMark.removePics( *refPicSetsAll[j] ); 2600 } 2601 picsToMark.markAllAsUnusedForReference(); 2602 2603 // NOTE 4 - There may be one or more entries in the RPS lists that are equal to "no reference picture" because 2604 // the corresponding pictures are not present in the DPB. Entries in RefPicSetStFoll or RefPicSetLtFoll that are equal 2605 // to "no reference picture" should be ignored. An unintentional picture loss should be inferred for each entry in 2614 picsToMark.removePics( *refPicSetsAll[j] ); 2615 } 2616 picsToMark.markAllAsUnusedForReference(); 2617 2618 // NOTE 4 - There may be one or more entries in the RPS lists that are equal to "no reference picture" because 2619 // the corresponding pictures are not present in the DPB. Entries in RefPicSetStFoll or RefPicSetLtFoll that are equal 2620 // to "no reference picture" should be ignored. An unintentional picture loss should be inferred for each entry in 2606 2621 // RefPicSetStCurrBefore, RefPicSetStCurrAfter, or RefPicSetLtCurr that is equal to "no reference picture". 2607 2622 2608 2623 // NOTE 5 - A picture cannot be included in more than one of the five RPS lists. 2609 2624 2610 2625 2611 2626 // It is a requirement of bitstream conformance that the RPS is restricted as follows: 2612 2627 … … 2614 2629 #if NH_MV_FIX_NO_REF_PICS_CHECK 2615 2630 if ( !annexFModifications || m_firstPicInLayerDecodedFlag[ m_pcPic->getLayerId() ] ) 2616 { 2631 { 2617 2632 #endif 2618 2633 for (Int j = 0; j < 3; j++ ) 2619 2634 { 2620 // - There shall be no entry in RefPicSetStCurrBefore, RefPicSetStCurrAfter or RefPicSetLtCurr 2635 // - There shall be no entry in RefPicSetStCurrBefore, RefPicSetStCurrAfter or RefPicSetLtCurr 2621 2636 // for which one or more of the following are true: 2622 2637 2623 std::vector<TComPic*>* currSet = refPicSetsCurr[j]; 2638 std::vector<TComPic*>* currSet = refPicSetsCurr[j]; 2624 2639 for (Int i = 0; i < currSet->size(); i++) 2625 2640 { 2626 TComPic* pic = (*currSet)[i]; 2641 TComPic* pic = (*currSet)[i]; 2627 2642 2628 2643 // - The entry is equal to "no reference picture". 2629 assert( ! (pic == NULL ) ); 2644 assert( ! (pic == NULL ) ); 2630 2645 2631 2646 // - The entry is an SLNR picture and has TemporalId equal to that of the current picture. 2632 assert( !( pic->isSlnr() && pic->getTemporalId() == m_pcPic->getTemporalId() ) ); 2647 assert( !( pic->isSlnr() && pic->getTemporalId() == m_pcPic->getTemporalId() ) ); 2633 2648 2634 2649 // - The entry is a picture that has TemporalId greater than that of the current picture. 2635 assert( !( pic->getTemporalId() > m_pcPic->getTemporalId() ) ); 2636 } 2650 assert( !( pic->getTemporalId() > m_pcPic->getTemporalId() ) ); 2651 } 2637 2652 } 2638 2653 #if NH_MV_FIX_NO_REF_PICS_CHECK 2639 2654 } 2640 2655 #endif 2641 2642 // - There shall be no entry in RefPicSetLtCurr or RefPicSetLtFoll for which the 2643 // difference between the picture order count value of the current picture and the picture order count 2656 2657 // - There shall be no entry in RefPicSetLtCurr or RefPicSetLtFoll for which the 2658 // difference between the picture order count value of the current picture and the picture order count 2644 2659 // value of the entry is greater than or equal to 2^24. 2645 2660 for (Int j = 0; j < 2; j++ ) 2646 { 2647 std::vector<TComPic*>* ltSet = refPicSetsLt[j]; 2661 { 2662 std::vector<TComPic*>* ltSet = refPicSetsLt[j]; 2648 2663 for (Int i = 0; i < ltSet->size(); i++) 2649 2664 { 2650 TComPic* pic = (*ltSet)[i]; 2665 TComPic* pic = (*ltSet)[i]; 2651 2666 if( pic != NULL ) 2652 2667 { 2653 assert(!( abs( m_pcPic->getPOC() - pic->getPOC() ) >= (1 << 24) )); 2654 } 2655 } 2656 } 2657 2658 // - When the current picture is a temporal sub-layer access (TSA) picture, there shall be no picture 2668 assert(!( abs( m_pcPic->getPOC() - pic->getPOC() ) >= (1 << 24) )); 2669 } 2670 } 2671 } 2672 2673 // - When the current picture is a temporal sub-layer access (TSA) picture, there shall be no picture 2659 2674 // included in the RPS with TemporalId greater than or equal to the TemporalId of the current picture. 2660 2675 if (m_pcPic->isTsa() ) 2661 2676 { 2662 2677 for (Int j = 0; j < 5; j++ ) 2663 { 2664 std::vector<TComPic*>* aSet = refPicSetsAll[j]; 2678 { 2679 std::vector<TComPic*>* aSet = refPicSetsAll[j]; 2665 2680 for (Int i = 0; i < aSet->size(); i++) 2666 2681 { 2667 TComPic* pic = (*aSet)[i]; 2682 TComPic* pic = (*aSet)[i]; 2668 2683 if( pic != NULL ) 2669 2684 { 2670 assert( ! (pic->getTemporalId() >= m_pcPic->getTemporalId() ) ); 2685 assert( ! (pic->getTemporalId() >= m_pcPic->getTemporalId() ) ); 2671 2686 } 2672 2687 } … … 2674 2689 } 2675 2690 2676 // - When the current picture is a step-wise temporal sub-layer access (STSA) picture, 2691 // - When the current picture is a step-wise temporal sub-layer access (STSA) picture, 2677 2692 // there shall be no picture included in RefPicSetStCurrBefore, RefPicSetStCurrAfter or RefPicSetLtCurr that has 2678 2693 // TemporalId equal to that of the current picture. … … 2680 2695 { 2681 2696 for (Int j = 0; j < 3; j++ ) 2682 { 2683 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2697 { 2698 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2684 2699 for (Int i = 0; i < cSet->size(); i++) 2685 2700 { 2686 TComPic* pic = (*cSet)[i]; 2701 TComPic* pic = (*cSet)[i]; 2687 2702 if( pic != NULL ) 2688 2703 { 2689 assert( ! (pic->getTemporalId() == m_pcPic->getTemporalId() ) ); 2704 assert( ! (pic->getTemporalId() == m_pcPic->getTemporalId() ) ); 2690 2705 } 2691 2706 } … … 2700 2715 { 2701 2716 for (Int j = 0; j < 3; j++ ) 2702 { 2703 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2717 { 2718 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2704 2719 for (Int i = 0; i < cSet->size(); i++) 2705 2720 { 2706 TComPic* pic = (*cSet)[i]; 2721 TComPic* pic = (*cSet)[i]; 2707 2722 if( pic != NULL ) 2708 2723 { 2709 assert( ! (pic->getTemporalId() == m_pcPic->getTemporalId() && pic->getDecodingOrder() < m_prevStsaDecOrder ) ); 2724 assert( ! (pic->getTemporalId() == m_pcPic->getTemporalId() && pic->getDecodingOrder() < m_prevStsaDecOrder ) ); 2710 2725 } 2711 2726 } 2712 2727 } 2713 2728 } 2714 2729 2715 2730 // - When the current picture is a CRA picture, there shall be no picture included in the RPS that 2716 2731 // precedes, in output order or decoding order, any preceding IRAP picture in decoding order (when present). … … 2718 2733 { 2719 2734 for (Int j = 0; j < 5; j++ ) 2720 { 2721 std::vector<TComPic*>* aSet = refPicSetsAll[j]; 2735 { 2736 std::vector<TComPic*>* aSet = refPicSetsAll[j]; 2722 2737 for (Int i = 0; i < aSet->size(); i++) 2723 2738 { 2724 2739 // TBD check whether it sufficient to test only the last IRAP 2725 TComPic* pic = (*aSet)[i]; 2740 TComPic* pic = (*aSet)[i]; 2726 2741 if( pic != NULL ) 2727 { 2728 assert( ! (pic->getPOC() < m_prevIrapPoc ) ); 2729 assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) ); 2742 { 2743 assert( ! (pic->getPOC() < m_prevIrapPoc ) ); 2744 assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) ); 2730 2745 } 2731 2746 } 2732 2747 } 2733 2748 } 2734 2749 2735 2750 Bool isTrailingPicture = ( !m_pcPic->isIrap() ) && ( m_pcPic->getPOC() > m_prevIrapPoc ); 2736 2751 // - When the current picture is a trailing picture, there shall be no picture in RefPicSetStCurrBefore, … … 2740 2755 { 2741 2756 for (Int j = 0; j < 3; j++ ) 2742 { 2743 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2757 { 2758 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2744 2759 for (Int i = 0; i < cSet->size(); i++) 2745 2760 { 2746 TComPic* pic = (*cSet)[i]; 2761 TComPic* pic = (*cSet)[i]; 2747 2762 if( pic != NULL ) 2748 2763 { 2749 assert( ! (pic->getIsGeneratedCl833() ) ); 2764 assert( ! (pic->getIsGeneratedCl833() ) ); 2750 2765 } 2751 2766 } … … 2758 2773 { 2759 2774 for (Int j = 0; j < 5; j++ ) 2760 { 2761 std::vector<TComPic*>* aSet = refPicSetsAll[j]; 2775 { 2776 std::vector<TComPic*>* aSet = refPicSetsAll[j]; 2762 2777 for (Int i = 0; i < aSet->size(); i++) 2763 2778 { 2764 2779 // TBD check whether it sufficient to test only the last IRAP 2765 TComPic* pic = (*aSet)[i]; 2780 TComPic* pic = (*aSet)[i]; 2766 2781 if( pic != NULL ) 2767 { 2768 assert( ! (pic->getPOC() < m_prevIrapPoc ) ); 2769 assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) ); 2782 { 2783 assert( ! (pic->getPOC() < m_prevIrapPoc ) ); 2784 assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) ); 2770 2785 } 2771 2786 } … … 2778 2793 { 2779 2794 for (Int j = 0; j < 3; j++ ) 2780 { 2781 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2795 { 2796 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2782 2797 for (Int i = 0; i < cSet->size(); i++) 2783 { 2784 TComPic* pic = (*cSet)[i]; 2798 { 2799 TComPic* pic = (*cSet)[i]; 2785 2800 if( pic != NULL ) 2786 { 2801 { 2787 2802 // - A RASL picture 2788 assert( ! (pic->isRasl() ) ); 2789 // - A picture that was generated by the decoding process for generating unavailable reference pictures 2803 assert( ! (pic->isRasl() ) ); 2804 // - A picture that was generated by the decoding process for generating unavailable reference pictures 2790 2805 // as specified in clause 8.3.3 2791 assert( ! (pic->getIsGeneratedCl833() ) ); 2806 assert( ! (pic->getIsGeneratedCl833() ) ); 2792 2807 // - A picture that precedes the associated IRAP picture in decoding order 2793 assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) ); 2808 assert( ! (pic->getDecodingOrder() < m_prevIrapDecodingOrder ) ); 2794 2809 } 2795 2810 } 2796 2811 } 2797 2812 } 2798 2799 2813 2814 2800 2815 if ( sps->getTemporalIdNestingFlag() ) 2801 2816 { 2802 2817 // - When sps_temporal_id_nesting_flag is equal to 1, the following applies: 2803 2818 // - Let tIdA be the value of TemporalId of the current picture picA. 2804 TComPic* picA = m_pcPic; 2819 TComPic* picA = m_pcPic; 2805 2820 Int tIdA = picA->getTemporalId(); 2806 // - Any picture picB with TemporalId equal to tIdB that is less than or equal to tIdA shall not be included in 2807 // RefPicSetStCurrBefore, RefPicSetStCurrAfter or RefPicSetLtCurr of picA when there exists a picture picC that 2821 // - Any picture picB with TemporalId equal to tIdB that is less than or equal to tIdA shall not be included in 2822 // RefPicSetStCurrBefore, RefPicSetStCurrAfter or RefPicSetLtCurr of picA when there exists a picture picC that 2808 2823 // has TemporalId less than tIdB, follows picB in decoding order, and precedes picA in decoding order. 2809 2824 for (Int j = 0; j < 3; j++ ) 2810 { 2811 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2825 { 2826 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2812 2827 for (Int i = 0; i < cSet->size(); i++) 2813 2828 { 2814 TComPic* picB = (*cSet)[i]; 2829 TComPic* picB = (*cSet)[i]; 2815 2830 if( picB != NULL ) 2816 2831 { 2817 Int tIdB = picB->getTemporalId(); 2832 Int tIdB = picB->getTemporalId(); 2818 2833 2819 2834 if (tIdB <= tIdA) … … 2821 2836 for ( TComSubDpb::iterator itP = dpb->begin(); itP != dpb->end(); itP++ ) 2822 2837 { 2823 TComPic* picC = (*itP); 2824 assert(! ( picC->getTemporalId() < tIdB && picC->getDecodingOrder() > picB->getDecodingOrder() && picC->getDecodingOrder() < picA->getDecodingOrder() ) ); 2838 TComPic* picC = (*itP); 2839 assert(! ( picC->getTemporalId() < tIdB && picC->getDecodingOrder() > picB->getDecodingOrder() && picC->getDecodingOrder() < picA->getDecodingOrder() ) ); 2825 2840 } 2826 2841 } … … 2828 2843 } 2829 2844 } 2830 } 2845 } 2831 2846 } 2832 2847 … … 2839 2854 2840 2855 // The specifications in clause 8.3.2 apply with the following changes: 2841 // - The references to clauses 7.4.7.2, 8.3.1, 8.3.3 and 8.3.4 are replaced with references to 2856 // - The references to clauses 7.4.7.2, 8.3.1, 8.3.3 and 8.3.4 are replaced with references to 2842 2857 // clauses F.7.4.7.2, F.8.3.1, F.8.3.3 and F.8.3.4, respectively. 2843 2858 2844 x832DecProcForRefPicSet( true ); 2859 x832DecProcForRefPicSet( true ); 2845 2860 2846 2861 // - The following specifications are added: 2847 2862 if (m_pcPic->isIrap() && m_pcPic->getLayerId() == m_smallestLayerId ) 2848 2863 { 2849 // - When the current picture is an IRAP picture with nuh_layer_id equal to SmallestLayerId, 2850 // all reference pictures with any value of nuh_layer_id currently in the DPB (if any) are marked 2864 // - When the current picture is an IRAP picture with nuh_layer_id equal to SmallestLayerId, 2865 // all reference pictures with any value of nuh_layer_id currently in the DPB (if any) are marked 2851 2866 // as "unused for reference" when at least one of the following conditions is true: 2852 2867 … … 2860 2875 2861 2876 // - It is a requirement of bitstream conformance that the RPS is restricted as follows: 2862 // - When the current picture is a CRA picture, there shall be no picture in RefPicSetStCurrBefore, RefPicSetStCurrAfter 2877 // - When the current picture is a CRA picture, there shall be no picture in RefPicSetStCurrBefore, RefPicSetStCurrAfter 2863 2878 // or RefPicSetLtCurr. 2864 2879 … … 2867 2882 if ( m_pcPic->isCra() ) 2868 2883 { 2869 for (Int j = 0; j < 3; j++ ) 2870 { 2871 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2872 assert ( cSet->size() == 0 ); 2884 for (Int j = 0; j < 3; j++ ) 2885 { 2886 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 2887 assert ( cSet->size() == 0 ); 2873 2888 } 2874 2889 } … … 2876 2891 // - The constraints specified in clause 8.3.2 on the value of NumPicTotalCurr are replaced with the following: 2877 2892 // - It is a requirement of bitstream conformance that the following applies to the value of NumPicTotalCurr: 2878 Int numPicTotalCurr = m_pcPic->getSlice(0)->getNumPicTotalCurr(); 2879 Int currPicLayerId = m_pcPic->getLayerId(); 2880 const TComVPS* vps = m_pcPic->getSlice(0)->getVPS(); 2893 Int numPicTotalCurr = m_pcPic->getSlice(0)->getNumPicTotalCurr(); 2894 Int currPicLayerId = m_pcPic->getLayerId(); 2895 const TComVPS* vps = m_pcPic->getSlice(0)->getVPS(); 2881 2896 2882 2897 if ( ( m_pcPic->isBla() || m_pcPic->isCra() ) && ( (currPicLayerId == 0 ) || ( vps->getNumDirectRefLayers( currPicLayerId ) == 0 ) ) ) 2883 { 2884 assert( numPicTotalCurr == 0 ); 2885 // - If the current picture is a BLA or CRA picture and either currPicLayerId is equal to 0 or 2898 { 2899 assert( numPicTotalCurr == 0 ); 2900 // - If the current picture is a BLA or CRA picture and either currPicLayerId is equal to 0 or 2886 2901 // NumDirectRefLayers[ currPicLayerId ] is equal to 0, the value of NumPicTotalCurr shall be equal to 0. 2887 2902 } … … 2892 2907 { 2893 2908 // - Otherwise, when the current picture contains a P or B slice, the value of NumPicTotalCurr shall not be equal to 0. 2894 assert( numPicTotalCurr != 0 ); 2909 assert( numPicTotalCurr != 0 ); 2895 2910 } 2896 2911 } … … 2904 2919 //////////////////////////////////////////////////////////////////// 2905 2920 2906 // Outputs of this process are updated lists of inter-layer reference pictures RefPicSetInterLayer0 and RefPicSetInterLayer1 2921 // Outputs of this process are updated lists of inter-layer reference pictures RefPicSetInterLayer0 and RefPicSetInterLayer1 2907 2922 // and the variables NumActiveRefLayerPics0 and NumActiveRefLayerPics1. 2908 2923 2909 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 2910 TComSlice* slice = m_pcPic->getSlice( 0 ); 2911 const TComVPS* vps = slice->getVPS(); 2924 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 2925 TComSlice* slice = m_pcPic->getSlice( 0 ); 2926 const TComVPS* vps = slice->getVPS(); 2912 2927 2913 2928 Int& numActiveRefLayerPics0 = decRps->m_numActiveRefLayerPics0; … … 2915 2930 2916 2931 std::vector<TComPic*>& refPicSetInterLayer0 = decRps->m_refPicSetInterLayer0; 2917 std::vector<TComPic*>& refPicSetInterLayer1 = decRps->m_refPicSetInterLayer1; 2932 std::vector<TComPic*>& refPicSetInterLayer1 = decRps->m_refPicSetInterLayer1; 2918 2933 2919 2934 // The variable currLayerId is set equal to nuh_layer_id of the current picture. 2920 Int currLayerId = getLayerId(); 2921 2922 // The lists RefPicSetInterLayer0 and RefPicSetInterLayer1 are first emptied, NumActiveRefLayerPics0 and NumActiveRefLayerPics1 2935 Int currLayerId = getLayerId(); 2936 2937 // The lists RefPicSetInterLayer0 and RefPicSetInterLayer1 are first emptied, NumActiveRefLayerPics0 and NumActiveRefLayerPics1 2923 2938 // are set equal to 0 and the following applies: 2924 2939 2925 refPicSetInterLayer0.clear(); 2926 refPicSetInterLayer1.clear(); 2927 2928 numActiveRefLayerPics0 = 0; 2929 numActiveRefLayerPics1 = 0; 2930 2931 Int viewIdCurrLayerId = vps->getViewId( currLayerId ); 2940 refPicSetInterLayer0.clear(); 2941 refPicSetInterLayer1.clear(); 2942 2943 numActiveRefLayerPics0 = 0; 2944 numActiveRefLayerPics1 = 0; 2945 2946 Int viewIdCurrLayerId = vps->getViewId( currLayerId ); 2932 2947 Int viewId0 = vps->getViewId( 0 ); 2933 2948 2934 for( Int i = 0; i < slice->getNumActiveRefLayerPics(); i++ ) 2935 { 2936 Int viewIdRefPicLayerIdi = vps->getViewId( slice->getRefPicLayerId( i ) ); 2949 for( Int i = 0; i < slice->getNumActiveRefLayerPics(); i++ ) 2950 { 2951 Int viewIdRefPicLayerIdi = vps->getViewId( slice->getRefPicLayerId( i ) ); 2937 2952 2938 2953 Bool refPicSet0Flag = … … 2944 2959 { 2945 2960 // there is a picture picX in the DPB that is in the same access unit as the current picture and has 2946 // nuh_layer_id equal to RefPicLayerId[ i ] 2961 // nuh_layer_id equal to RefPicLayerId[ i ] 2947 2962 2948 2963 if ( refPicSet0Flag ) … … 2960 2975 assert( ! picX->getSlice(0)->getDiscardableFlag() ); 2961 2976 2962 // If the current picture is a RADL picture, there shall be no entry in RefPicSetInterLayer0 or RefPicSetInterLayer1 2977 // If the current picture is a RADL picture, there shall be no entry in RefPicSetInterLayer0 or RefPicSetInterLayer1 2963 2978 // that is a RASL picture. 2964 2979 if ( m_pcPic->isRadl() ) … … 2992 3007 /////////////////////////////////////////////////////////////////////////////////////// 2993 3008 2994 // This process is invoked once per coded picture when the current picture is a 3009 // This process is invoked once per coded picture when the current picture is a 2995 3010 // BLA picture or is a CRA picture with NoRaslOutputFlag equal to 1. 2996 3011 2997 3012 assert( m_pcPic->isBla() || (m_pcPic->isCra() && m_pcPic->getNoRaslOutputFlag() ) ); 2998 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 3013 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 2999 3014 3000 3015 std::vector<TComPic*>& refPicSetStFoll = decRps->m_refPicSetStFoll; 3001 std::vector<TComPic*>& refPicSetLtFoll = decRps->m_refPicSetLtFoll; 3016 std::vector<TComPic*>& refPicSetLtFoll = decRps->m_refPicSetLtFoll; 3002 3017 3003 3018 const std::vector<Int>& pocStFoll = decRps->m_pocStFoll; … … 3005 3020 3006 3021 const Int numPocStFoll = decRps->m_numPocStFoll; 3007 const Int numPocLtFoll = decRps->m_numPocLtFoll; 3022 const Int numPocLtFoll = decRps->m_numPocLtFoll; 3008 3023 3009 3024 // When this process is invoked, the following applies: … … 3012 3027 if ( refPicSetStFoll[ i ] == NULL ) 3013 3028 { 3014 //- For each RefPicSetStFoll[ i ], with i in the range of 0 to NumPocStFoll - 1, inclusive, that is equal 3029 //- For each RefPicSetStFoll[ i ], with i in the range of 0 to NumPocStFoll - 1, inclusive, that is equal 3015 3030 // to "no reference picture", a picture is generated as specified in clause 8.3.3.2, and the following applies: 3016 TComPic* genPic = x8332GenOfOneUnavailPic( true ); 3031 TComPic* genPic = x8332GenOfOneUnavailPic( true ); 3017 3032 3018 3033 // - The value of PicOrderCntVal for the generated picture is set equal to PocStFoll[ i ]. 3019 3034 genPic->getSlice(0)->setPOC( pocStFoll[ i ] ); 3020 3035 3021 //- The value of PicOutputFlag for the generated picture is set equal to 0. 3022 genPic->setPicOutputFlag( false ); 3036 //- The value of PicOutputFlag for the generated picture is set equal to 0. 3037 genPic->setPicOutputFlag( false ); 3023 3038 3024 3039 // - The generated picture is marked as "used for short-term reference". … … 3029 3044 3030 3045 // - The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id of the current picture. 3031 genPic->setLayerId( m_pcPic-> getLayerId() ); 3046 genPic->setLayerId( m_pcPic-> getLayerId() ); 3032 3047 3033 3048 // Insert to DPB 3034 m_dpb->addNewPic( genPic ); 3049 m_dpb->addNewPic( genPic ); 3035 3050 } 3036 3051 } … … 3040 3055 if ( refPicSetLtFoll[ i ] == NULL ) 3041 3056 { 3042 //- For each RefPicSetLtFoll[ i ], with i in the range of 0 to NumPocLtFoll - 1, inclusive, that is equal to 3057 //- For each RefPicSetLtFoll[ i ], with i in the range of 0 to NumPocLtFoll - 1, inclusive, that is equal to 3043 3058 // "no reference picture", a picture is generated as specified in clause 8.3.3.2, and the following applies: 3044 TComPic* genPic = x8332GenOfOneUnavailPic( true ); 3059 TComPic* genPic = x8332GenOfOneUnavailPic( true ); 3045 3060 3046 3061 //- The value of PicOrderCntVal for the generated picture is set equal to PocLtFoll[ i ]. … … 3048 3063 3049 3064 // - The value of slice_pic_order_cnt_lsb for the generated picture is inferred to be equal to ( PocLtFoll[ i ] & ( MaxPicOrderCntLsb - 1 ) ). 3050 genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtFoll[ i ] & ( m_pcPic->getSlice(0)->getSPS()->getMaxPicOrderCntLsb() - 1 ) ) ); 3051 3052 // - The value of PicOutputFlag for the generated picture is set equal to 0. 3053 genPic->setPicOutputFlag( false ); 3065 genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtFoll[ i ] & ( m_pcPic->getSlice(0)->getSPS()->getMaxPicOrderCntLsb() - 1 ) ) ); 3066 3067 // - The value of PicOutputFlag for the generated picture is set equal to 0. 3068 genPic->setPicOutputFlag( false ); 3054 3069 3055 3070 // - The generated picture is marked as "used for long-term reference". … … 3060 3075 3061 3076 // - The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id of the current picture. 3062 genPic->setLayerId( m_pcPic-> getLayerId() ); 3077 genPic->setLayerId( m_pcPic-> getLayerId() ); 3063 3078 3064 3079 // Insert to DPB 3065 m_dpb->addNewPic( genPic ); 3080 m_dpb->addNewPic( genPic ); 3066 3081 } 3067 3082 } … … 3075 3090 /////////////////////////////////////////////////////////////////////////////////////// 3076 3091 3077 TComPic* genPic = new TComPic; 3078 genPic->create( *m_pcPic->getSlice(0)->getSPS(), *m_pcPic->getSlice(0)->getPPS(), true ); 3079 genPic->setIsGenerated( true ); 3080 genPic->setIsGeneratedCl833( calledFromCl8331 ); 3092 TComPic* genPic = new TComPic; 3093 genPic->create( *m_pcPic->getSlice(0)->getSPS(), *m_pcPic->getSlice(0)->getPPS(), true ); 3094 genPic->setIsGenerated( true ); 3095 genPic->setIsGeneratedCl833( calledFromCl8331 ); 3081 3096 return genPic; 3082 3097 } … … 3086 3101 { 3087 3102 /////////////////////////////////////////////////////////////////////////////////////// 3088 // F.8.1.7 Decoding process for generating unavailable reference pictures for pictures 3103 // F.8.1.7 Decoding process for generating unavailable reference pictures for pictures 3089 3104 // first in decoding order within a layer 3090 3105 /////////////////////////////////////////////////////////////////////////////////////// 3091 3106 3092 // This process is invoked for a picture with nuh_layer_id equal to layerId, when FirstPicInLayerDecodedFlag[layerId ] is equal to 0. 3107 // This process is invoked for a picture with nuh_layer_id equal to layerId, when FirstPicInLayerDecodedFlag[layerId ] is equal to 0. 3093 3108 assert( !m_firstPicInLayerDecodedFlag[ getLayerId() ] ); 3094 3109 3095 3110 3096 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 3097 3098 std::vector<TComPic*>& refPicSetStCurrBefore = decRps->m_refPicSetStCurrBefore; 3111 TComDecodedRps* decRps = m_pcPic->getDecodedRps(); 3112 3113 std::vector<TComPic*>& refPicSetStCurrBefore = decRps->m_refPicSetStCurrBefore; 3099 3114 std::vector<TComPic*>& refPicSetStCurrAfter = decRps->m_refPicSetStCurrAfter; 3100 3115 std::vector<TComPic*>& refPicSetStFoll = decRps->m_refPicSetStFoll; 3101 std::vector<TComPic*>& refPicSetLtCurr = decRps->m_refPicSetLtCurr; 3102 std::vector<TComPic*>& refPicSetLtFoll = decRps->m_refPicSetLtFoll; 3116 std::vector<TComPic*>& refPicSetLtCurr = decRps->m_refPicSetLtCurr; 3117 std::vector<TComPic*>& refPicSetLtFoll = decRps->m_refPicSetLtFoll; 3103 3118 3104 3119 … … 3109 3124 const std::vector<Int>& pocLtFoll = decRps->m_pocLtFoll; 3110 3125 3111 const Int numPocStCurrBefore = decRps->m_numPocStCurrBefore; 3126 const Int numPocStCurrBefore = decRps->m_numPocStCurrBefore; 3112 3127 const Int numPocStCurrAfter = decRps->m_numPocStCurrAfter; 3113 3128 const Int numPocStFoll = decRps->m_numPocStFoll; 3114 3129 const Int numPocLtCurr = decRps->m_numPocLtCurr; 3115 const Int numPocLtFoll = decRps->m_numPocLtFoll; 3116 3117 Int nuhLayerId = m_pcPic-> getLayerId(); 3130 const Int numPocLtFoll = decRps->m_numPocLtFoll; 3131 3132 Int nuhLayerId = m_pcPic-> getLayerId(); 3118 3133 for ( Int i = 0 ; i <= numPocStCurrBefore - 1; i++ ) 3119 3134 { 3120 3135 if ( refPicSetStCurrBefore[ i ] == NULL ) 3121 3136 { 3122 //- For each RefPicSetStCurrBefore[ i ], with i in the range of 0 to NumPocStCurrBefore - 1, inclusive, that is 3137 //- For each RefPicSetStCurrBefore[ i ], with i in the range of 0 to NumPocStCurrBefore - 1, inclusive, that is 3123 3138 // equal to "no reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies: 3124 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3139 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3125 3140 3126 3141 //- The value of PicOrderCntVal for the generated picture is set equal to PocStCurrBefore[ i ]. … … 3128 3143 3129 3144 // - The value of PicOutputFlag for the generated picture is set equal to 0. 3130 genPic->setPicOutputFlag( false ); 3145 genPic->setPicOutputFlag( false ); 3131 3146 3132 3147 // - The generated picture is marked as "used for short-term reference". … … 3137 3152 3138 3153 // - The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id. 3139 genPic->setLayerId( nuhLayerId ); 3154 genPic->setLayerId( nuhLayerId ); 3140 3155 3141 3156 // Insert to DPB 3142 m_dpb->addNewPic( genPic ); 3157 m_dpb->addNewPic( genPic ); 3143 3158 } 3144 3159 } … … 3148 3163 if ( refPicSetStCurrAfter[ i ] == NULL ) 3149 3164 { 3150 // - For each RefPicSetStCurrAfter[ i ], with i in the range of 0 to NumPocStCurrAfter - 1, inclusive, that is equal 3165 // - For each RefPicSetStCurrAfter[ i ], with i in the range of 0 to NumPocStCurrAfter - 1, inclusive, that is equal 3151 3166 // to "no reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies: 3152 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3167 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3153 3168 3154 3169 // - The value of PicOrderCntVal for the generated picture is set equal to PocStCurrAfter[ i ]. … … 3156 3171 3157 3172 // - The value of PicOutputFlag for the generated picture is set equal to 0. 3158 genPic->setPicOutputFlag( false ); 3173 genPic->setPicOutputFlag( false ); 3159 3174 3160 3175 // - The generated picture is marked as "used for short-term reference". … … 3165 3180 3166 3181 // - The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id. 3167 genPic->setLayerId( nuhLayerId ); 3182 genPic->setLayerId( nuhLayerId ); 3168 3183 3169 3184 // Insert to DPB 3170 m_dpb->addNewPic( genPic ); 3185 m_dpb->addNewPic( genPic ); 3171 3186 3172 3187 } … … 3177 3192 if ( refPicSetStFoll[ i ] == NULL ) 3178 3193 { 3179 // - For each RefPicSetStFoll[ i ], with i in the range of 0 to NumPocStFoll - 1, inclusive, that is equal to "no 3194 // - For each RefPicSetStFoll[ i ], with i in the range of 0 to NumPocStFoll - 1, inclusive, that is equal to "no 3180 3195 // reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies: 3181 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3196 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3182 3197 3183 3198 // - The value of PicOrderCntVal for the generated picture is set equal to PocStFoll[ i ]. … … 3185 3200 3186 3201 // - The value of PicOutputFlag for the generated picture is set equal to 0. 3187 genPic->setPicOutputFlag( false ); 3202 genPic->setPicOutputFlag( false ); 3188 3203 3189 3204 // - The generated picture is marked as "used for short-term reference". … … 3194 3209 3195 3210 // - The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id. 3196 genPic->setLayerId( nuhLayerId ); 3211 genPic->setLayerId( nuhLayerId ); 3197 3212 3198 3213 // Insert to DPB 3199 m_dpb->addNewPic( genPic ); 3200 } 3201 } 3202 3203 Int maxPicOrderCntLsb = m_pcPic->getSlice(0)->getSPS()->getMaxPicOrderCntLsb(); 3214 m_dpb->addNewPic( genPic ); 3215 } 3216 } 3217 3218 Int maxPicOrderCntLsb = m_pcPic->getSlice(0)->getSPS()->getMaxPicOrderCntLsb(); 3204 3219 for ( Int i = 0 ; i <= numPocLtCurr - 1; i++ ) 3205 3220 { 3206 3221 if ( refPicSetLtCurr[ i ] == NULL ) 3207 3222 { 3208 // - For each RefPicSetLtCurr[ i ], with i in the range of 0 to NumPocLtCurr - 1, inclusive, that is equal to "no 3223 // - For each RefPicSetLtCurr[ i ], with i in the range of 0 to NumPocLtCurr - 1, inclusive, that is equal to "no 3209 3224 // reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies: 3210 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3225 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3211 3226 3212 3227 // - The value of PicOrderCntVal for the generated picture is set equal to PocLtCurr[ i ]. 3213 3228 genPic->getSlice(0)->setPOC( pocLtCurr[ i ] ); 3214 3229 3215 // - The value of slice_pic_order_cnt_lsb for the generated picture is inferred to be equal to ( PocLtCurr[ i ] & ( 3230 // - The value of slice_pic_order_cnt_lsb for the generated picture is inferred to be equal to ( PocLtCurr[ i ] & ( 3216 3231 // MaxPicOrderCntLsb - 1 ) ). 3217 genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtCurr[ i ] & ( maxPicOrderCntLsb - 1 ) ) ); 3232 genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtCurr[ i ] & ( maxPicOrderCntLsb - 1 ) ) ); 3218 3233 3219 3234 // - The value of PicOutputFlag for the generated picture is set equal to 0. 3220 genPic->setPicOutputFlag( false ); 3235 genPic->setPicOutputFlag( false ); 3221 3236 3222 3237 // - The generated picture is marked as "used for long-term reference". … … 3227 3242 3228 3243 // - The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id. 3229 genPic->setLayerId( nuhLayerId ); 3244 genPic->setLayerId( nuhLayerId ); 3230 3245 3231 3246 // Insert to DPB 3232 m_dpb->addNewPic( genPic ); 3247 m_dpb->addNewPic( genPic ); 3233 3248 } 3234 3249 } … … 3238 3253 if ( refPicSetLtFoll[ i ] == NULL ) 3239 3254 { 3240 // - For each RefPicSetLtFoll[ i ], with i in the range of 0 to NumPocLtFoll - 1, inclusive, that is equal to "no 3255 // - For each RefPicSetLtFoll[ i ], with i in the range of 0 to NumPocLtFoll - 1, inclusive, that is equal to "no 3241 3256 // reference picture", a picture is generated as specified in clause 8.3.3.2 and the following applies: 3242 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3257 TComPic* genPic = x8332GenOfOneUnavailPic( false ); 3243 3258 3244 3259 // - The value of PicOrderCntVal for the generated picture is set equal to PocLtFoll[ i ]. 3245 3260 genPic->getSlice(0)->setPOC( pocLtFoll[ i ] ); 3246 3261 3247 // - The value of slice_pic_order_cnt_lsb for the generated picture is inferred to be equal to ( PocLtCurr[ i ] & ( 3262 // - The value of slice_pic_order_cnt_lsb for the generated picture is inferred to be equal to ( PocLtCurr[ i ] & ( 3248 3263 // MaxPicOrderCntLsb - 1 ) ). 3249 genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtCurr[ i ] & ( maxPicOrderCntLsb - 1 ) ) ); 3264 genPic->getSlice(0)->setSlicePicOrderCntLsb( ( pocLtCurr[ i ] & ( maxPicOrderCntLsb - 1 ) ) ); 3250 3265 3251 3266 // - The value of PicOutputFlag for the generated picture is set equal to 0. 3252 genPic->setPicOutputFlag( false ); 3267 genPic->setPicOutputFlag( false ); 3253 3268 3254 3269 // - The generated picture is marked as "used for long-term reference". … … 3259 3274 3260 3275 // - The value of nuh_layer_id for the generated picture is set equal to nuh_layer_id. 3261 genPic->setLayerId( nuhLayerId ); 3276 genPic->setLayerId( nuhLayerId ); 3262 3277 3263 3278 // Insert to DPB 3264 m_dpb->addNewPic( genPic ); 3279 m_dpb->addNewPic( genPic ); 3265 3280 } 3266 3281 } … … 3280 3295 std::vector<TComPic*>** refPicSetsCurr = m_pcPic->getDecodedRps()->m_refPicSetsCurr; 3281 3296 3282 Bool hasGeneratedRefPic = false; 3283 for (Int j = 0; j < 3; j++ ) 3284 { 3285 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 3297 Bool hasGeneratedRefPic = false; 3298 for (Int j = 0; j < 3; j++ ) 3299 { 3300 std::vector<TComPic*>* cSet = refPicSetsCurr[j]; 3286 3301 for (Int i = 0 ; i < cSet->size(); i++ ) 3287 3302 { … … 3289 3304 if ((*cSet)[i]->getIsGenerated() ) 3290 3305 { 3291 hasGeneratedRefPic = true; 3292 } 3293 } 3294 } 3295 m_pcPic->setHasGeneratedRefPics( hasGeneratedRefPic ); 3306 hasGeneratedRefPic = true; 3307 } 3308 } 3309 } 3310 m_pcPic->setHasGeneratedRefPics( hasGeneratedRefPic ); 3296 3311 } 3297 3312
Note: See TracChangeset for help on using the changeset viewer.