Changeset 865 in SHVCSoftware
- Timestamp:
- 13 Aug 2014, 01:39:59 (10 years ago)
- Location:
- branches/SHM-dev/source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r864 r865 1455 1455 for( Int olsCtr = 0; olsCtr < vps->getNumLayerSets(); olsCtr ++ ) // Default output layer sets 1456 1456 { 1457 vps->setOutputLayerSetIdx( i, i);1457 vps->setOutputLayerSetIdx(olsCtr, olsCtr); 1458 1458 } 1459 1459 for( Int olsCtr = vps->getNumLayerSets(); olsCtr < vps->getNumOutputLayerSets(); olsCtr ++ ) // Non-default output layer sets 1460 1460 { 1461 vps->setOutputLayerSetIdx( i, m_outputLayerSetIdx[olsCtr - vps->getNumLayerSets()]);1461 vps->setOutputLayerSetIdx(olsCtr, m_outputLayerSetIdx[olsCtr - vps->getNumLayerSets()]); 1462 1462 } 1463 1463 } … … 1551 1551 } 1552 1552 #endif 1553 1553 #if NECESSARY_LAYER_FLAG 1554 vps->deriveNecessaryLayerFlag(); 1555 vps->checkNecessaryLayerFlagCondition(); 1556 #endif 1554 1557 // Initialize dpb_size_table() for all ouput layer sets in the VPS extension 1555 1558 for(i = 1; i < vps->getNumOutputLayerSets(); i++) -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
r850 r865 36 36 */ 37 37 38 #include <numeric> 38 39 #include "CommonDef.h" 39 40 #include "TComSlice.h" … … 2439 2440 ::memset(m_directDependencyType, 0, sizeof(m_directDependencyType)); 2440 2441 #endif 2442 #if !NECESSARY_LAYER_FLAG 2441 2443 #if DERIVE_LAYER_ID_LIST_VARIABLES 2442 2444 ::memset(m_layerSetLayerIdList, 0, sizeof(m_layerSetLayerIdList)); 2443 2445 ::memset(m_numLayerInIdList, 0, sizeof(m_numLayerInIdList )); 2446 #endif 2444 2447 #endif 2445 2448 ::memset(m_profileLevelTierIdx, 0, sizeof(m_profileLevelTierIdx)); … … 2562 2565 { 2563 2566 // For layer 0 2567 #if NECESSARY_LAYER_FLAG 2568 m_numLayerInIdList.push_back(1); 2569 m_layerSetLayerIdList.resize(m_numLayerSets); 2570 m_layerSetLayerIdList[0].push_back(0); 2571 #else 2564 2572 m_numLayerInIdList[0] = 1; 2565 2573 m_layerSetLayerIdList[0][0] = 0; 2574 #endif 2566 2575 2567 2576 // For other layers … … 2574 2583 if( m_layerIdIncludedFlag[i][m] ) 2575 2584 { 2585 #if NECESSARY_LAYER_FLAG 2586 m_layerSetLayerIdList[i].push_back(m); 2587 #else 2576 2588 m_layerSetLayerIdList[i][n++] = m; 2577 } 2578 } 2589 #endif 2590 } 2591 } 2592 #if NECESSARY_LAYER_FLAG 2593 m_numLayerInIdList.push_back(m_layerSetLayerIdList[i].size()); 2594 #else 2579 2595 m_numLayerInIdList[i] = n; 2596 #endif 2580 2597 } 2581 2598 } … … 2993 3010 hrd->setCbrFlag( i, j, 1, ( j == 0 ) ); 2994 3011 } 3012 } 3013 } 3014 #endif 3015 #if NECESSARY_LAYER_FLAG 3016 Void TComVPS::deriveNecessaryLayerFlag() 3017 { 3018 m_necessaryLayerFlag.empty(); 3019 m_numNecessaryLayers.empty(); 3020 // Assumed that output layer sets and variables RecursiveRefLayer are already derived 3021 for( Int olsIdx = 0; olsIdx < getNumOutputLayerSets(); olsIdx++) 3022 { 3023 deriveNecessaryLayerFlag(olsIdx); 3024 } 3025 } 3026 Void TComVPS::deriveNecessaryLayerFlag(Int const olsIdx) 3027 { 3028 Int lsIdx = this->getOutputLayerSetIdx( olsIdx ); 3029 Int numLayersInLs = this->getNumLayersInIdList( lsIdx ); 3030 assert( m_necessaryLayerFlag.size() == olsIdx ); // Function should be called in the correct order. 3031 m_necessaryLayerFlag.push_back( std::vector<Bool>( numLayersInLs, false ) ); // Initialize to false 3032 for( Int lsLayerIdx = 0; lsLayerIdx < numLayersInLs; lsLayerIdx++ ) 3033 { 3034 if( this->m_outputLayerFlag[olsIdx][lsLayerIdx] ) 3035 { 3036 m_necessaryLayerFlag[olsIdx][lsLayerIdx] = true; 3037 Int currNuhLayerId = this->m_layerSetLayerIdList[lsIdx][lsLayerIdx]; 3038 for( Int rLsLayerIdx = 0; rLsLayerIdx < lsLayerIdx; rLsLayerIdx++ ) 3039 { 3040 Int refNuhLayerId = this->m_layerSetLayerIdList[lsIdx][rLsLayerIdx]; 3041 if( this->m_recursiveRefLayerFlag[currNuhLayerId][refNuhLayerId] ) 3042 { 3043 m_necessaryLayerFlag[olsIdx][rLsLayerIdx] = true; 3044 } 3045 } 3046 } 3047 } 3048 m_numNecessaryLayers.push_back(std::accumulate(m_necessaryLayerFlag[olsIdx].begin(), m_necessaryLayerFlag[olsIdx].end(), 0)); 3049 } 3050 Void TComVPS::checkNecessaryLayerFlagCondition() 3051 { 3052 /* It is a requirement of bitstream conformance that for each layer index layerIdx in the range of 3053 ( vps_base_layer_internal_flag ? 0 : 1 ) to MaxLayersMinus1, inclusive, there shall be at least one OLS with index olsIdx such that 3054 NecessaryLayerFlag[ olsIdx ][ lsLayerIdx ] is equal to 1 for the value of lsLayerIdx 3055 for which LayerSetLayerIdList[ OlsIdxToLsIdx[ olsIdx ] ][ lsLayerIdx ] is equal to layer_id_in_nuh[ layerIdx ]. */ 3056 for(Int layerIdx = this->getBaseLayerInternalFlag() ? 0 : 1; layerIdx < this->getMaxLayers(); layerIdx++) 3057 { 3058 Bool layerFoundNecessaryLayerFlag = false; 3059 for(Int olsIdx = 0; olsIdx < this->getNumOutputLayerSets(); olsIdx++) 3060 { 3061 Int lsIdx = this->getOutputLayerSetIdx( olsIdx ); 3062 Int currNuhLayerId = this->getLayerIdInNuh( layerIdx ); 3063 std::vector<Int>::iterator iter = std::find( m_layerSetLayerIdList[lsIdx].begin(), m_layerSetLayerIdList[lsIdx].end(), currNuhLayerId ); 3064 if( iter != m_layerSetLayerIdList[lsIdx].end() ) // Layer present in layer set 3065 { 3066 size_t positionLayer = iter - m_layerSetLayerIdList[lsIdx].begin(); 3067 if( *(m_necessaryLayerFlag[olsIdx].begin() + positionLayer) == true ) 3068 { 3069 layerFoundNecessaryLayerFlag = true; 3070 break; 3071 } 3072 } 3073 } 3074 assert( layerFoundNecessaryLayerFlag ); 2995 3075 } 2996 3076 } -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
r851 r865 489 489 #if DERIVE_LAYER_ID_LIST_VARIABLES 490 490 #if Q0078_ADD_LAYER_SETS 491 #if NECESSARY_LAYER_FLAG 492 std::vector< std::vector<Int> > m_layerSetLayerIdList; 493 std::vector<Int> m_numLayerInIdList;; 494 #else 491 495 Int m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS][MAX_VPS_LAYER_ID_PLUS1]; 492 496 Int m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS]; 497 #endif 493 498 #else 494 499 Int m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; … … 747 752 #if RESOLUTION_BASED_DPB 748 753 Int m_subDpbAssigned [MAX_VPS_LAYER_SETS_PLUS1][MAX_LAYERS]; 754 #endif 755 #if NECESSARY_LAYER_FLAG 756 std::vector< std::vector<Bool> > m_necessaryLayerFlag; 757 std::vector<Int> m_numNecessaryLayers; 749 758 #endif 750 759 #endif //SVC_EXTENSION … … 1216 1225 Void setBspHrdParameters( UInt hrdIdx, UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ); 1217 1226 #endif 1227 #if NECESSARY_LAYER_FLAG 1228 Void deriveNecessaryLayerFlag(); 1229 Void deriveNecessaryLayerFlag(Int const olsIdx); 1230 Void checkNecessaryLayerFlagCondition(); 1231 #endif 1218 1232 #endif //SVC_EXTENSION 1219 1233 }; -
branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
r864 r865 56 56 #if PTL_SIGNALLING 57 57 #define LIST_OF_PTL 1 ///< JCTVC-R0272: Signalling the PTL for the 0-th OLS 58 #define NECESSARY_LAYER_FLAG 1 ////< Derivation of NecessaryLayerFlag 58 59 #endif 59 60 #define O0137_MAX_LAYERID 1 ///< JCTVC-O0137, JCTVC-O0200, JCTVC-O0223: restrict nuh_layer_id and vps_max_layers_minus1 -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r864 r865 1467 1467 #endif 1468 1468 vps->setNumOutputLayerSets( numOutputLayerSets ); 1469 1469 #if NECESSARY_LAYER_FLAG 1470 // Default output layer set 1471 vps->setOutputLayerSetIdx(0, 0); 1472 vps->setOutputLayerFlag(0, 0, true); 1473 vps->deriveNecessaryLayerFlag(0); 1474 #endif 1470 1475 for(i = 1; i < numOutputLayerSets; i++) 1471 1476 { … … 1519 1524 } 1520 1525 } 1526 #if NECESSARY_LAYER_FLAG 1527 vps->deriveNecessaryLayerFlag(i); 1528 #endif 1521 1529 Int numBits = 1; 1522 1530 while ((1 << numBits) < (vps->getNumProfileTierLevel())) … … 1547 1555 #endif 1548 1556 } 1557 #if NECESSARY_LAYER_FLAG 1558 vps->checkNecessaryLayerFlagCondition(); 1559 #endif 1549 1560 #else 1550 1561 if( numOutputLayerSets > 1 ) -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r864 r865 831 831 } 832 832 } 833 #if !NECESSARY_FLAG // Already called once in TAppEncTop.cpp 833 834 #if DERIVE_LAYER_ID_LIST_VARIABLES 834 835 pcVPS->deriveLayerIdListVariables(); 836 #endif 835 837 #endif 836 838 TimingInfo *timingInfo = pcVPS->getTimingInfo();
Note: See TracChangeset for help on using the changeset viewer.