Changeset 861 in SHVCSoftware
- Timestamp:
- 12 Aug 2014, 00:51:17 (10 years ago)
- Location:
- branches/SHM-dev
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/cfg/layers.cfg
r815 r861 43 43 44 44 45 NumLayerSets : 146 NumLayerInIdList 0 : 247 LayerSetLayerIdList 0: 0 145 NumLayerSets : 2 # Include default layer set, value of 0 not allowed 46 NumLayerInIdList1 : 2 # 0-th layer set is default, need not specify LayerSetLayerIdList0 or NumLayerInIdList0 47 LayerSetLayerIdList1 : 0 1 48 48 49 49 NumAddLayerSets : 0 50 NumOutputLayerSets : 2 # Include defualt OLS, value of 0 not allowed 51 DefaultTargetOutputLayerIdc : 1 52 NumLayersInOutputLayerSet : 1 # The number of layers in the 0-th OLS should not be specified, 53 # ListOfOutputLayers0 need not be specified 54 ListOfOutputLayers1 : 1 -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r860 r861 72 72 , m_scalingListFile() 73 73 , m_elRapSliceBEnabled(0) 74 #if OUTPUT_LAYER_SETS_CONFIG 75 , m_defaultTargetOutputLayerIdc (-1) 76 , m_numOutputLayerSets (-1) 77 #endif 74 78 { 75 79 for(UInt layer=0; layer<MAX_LAYERS; layer++) … … 580 584 } 581 585 #endif 586 #if OUTPUT_LAYER_SETS_CONFIG 587 string* cfg_numLayersInOutputLayerSet = new string; 588 string* cfg_listOfOutputLayers = new string[MAX_VPS_OUTPUT_LAYER_SETS_PLUS1]; 589 string* cfg_outputLayerSetIdx = new string; 590 #endif 582 591 #if AVC_BASE 583 592 string cfg_BLInputFile; … … 636 645 ("NumLayers", m_numLayers, 1, "Number of layers to code") 637 646 #if Q0078_ADD_LAYER_SETS 647 #if OUTPUT_LAYER_SETS_CONFIG 648 ("NumLayerSets", m_numLayerSets, 1, "Number of layer sets") 649 #else 638 650 ("NumLayerSets", m_numLayerSets, 0, "Number of layer sets") 651 #endif 639 652 ("NumLayerInIdList%d", cfg_numLayerInIdList, 0, MAX_VPS_LAYER_ID_PLUS1, "Number of layers in the set") 640 653 ("LayerSetLayerIdList%d", cfg_layerSetLayerIdListPtr, string(""), MAX_VPS_LAYER_ID_PLUS1, "Layer IDs for the set") … … 642 655 ("NumHighestLayerIdx%d", cfg_numHighestLayerIdx, 0, MAX_VPS_LAYER_ID_PLUS1, "Number of highest layer idx") 643 656 ("HighestLayerIdx%d", cfg_highestLayerIdxPtr, string(""), MAX_VPS_LAYER_ID_PLUS1, "Highest layer idx for an additional layer set") 657 #endif 658 #if OUTPUT_LAYER_SETS_CONFIG 659 ("DefaultTargetOutputLayerIdc", m_defaultTargetOutputLayerIdc, 1, "Default target output layers. 0: All layers are output layer, 1: Only highest layer is output layer, 2 or 3: No default output layers") 660 ("NumOutputLayerSets", m_numOutputLayerSets, 1, "Number of output layer sets excluding the 0-th output layer set") 661 ("NumLayersInOutputLayerSet", cfg_numLayersInOutputLayerSet, string(""), 1 , "List containing number of output layers in the output layer sets") 662 ("ListOfOutputLayers%d", cfg_listOfOutputLayers, string(""), MAX_VPS_LAYER_ID_PLUS1, "Layer IDs for the set, in terms of layer ID in the output layer set Range: [0..NumLayersInOutputLayerSet-1]") 663 ("OutputLayerSetIdx", cfg_outputLayerSetIdx, string(""), 1, "Corresponding layer set index, only for non-default output layer sets") 644 664 #endif 645 665 #if AUXILIARY_PICTURES … … 1701 1721 #endif 1702 1722 #if Q0078_ADD_LAYER_SETS 1723 #if OUTPUT_LAYER_SETS_CONFIG 1724 for (Int layerSet = 1; layerSet < m_numLayerSets; layerSet++) 1725 { 1726 // Simplifying the code in the #else section, and allowing 0-th layer set t 1727 assert( scanStringToArray( cfg_layerSetLayerIdList[layerSet], m_numLayerInIdList[layerSet], "NumLayerInIdList", m_layerSetLayerIdList[layerSet] ) ); 1728 #else 1703 1729 for (Int layerSet = 0; layerSet < m_numLayerSets; layerSet++) 1704 1730 { … … 1726 1752 } 1727 1753 } 1754 #endif 1728 1755 } 1729 1756 for (Int addLayerSet = 0; addLayerSet < m_numAddLayerSets; addLayerSet++) 1730 1757 { 1758 #if OUTPUT_LAYER_SETS_CONFIG 1759 // Simplifying the code in the #else section 1760 assert( scanStringToArray( cfg_layerSetLayerIdList[addLayerSet], m_numLayerInIdList[addLayerSet], "NumLayerInIdList", m_highestLayerIdx[addLayerSet] ) ); 1761 #else 1731 1762 if (m_numHighestLayerIdx[addLayerSet] > 0) 1732 1763 { … … 1752 1783 } 1753 1784 } 1754 } 1785 #endif 1786 } 1787 #endif 1788 #if OUTPUT_LAYER_SETS_CONFIG 1789 if( m_defaultTargetOutputLayerIdc != -1 ) 1790 { 1791 assert( m_defaultTargetOutputLayerIdc >= 0 && m_defaultTargetOutputLayerIdc <= 3 ); 1792 } 1793 assert( m_numOutputLayerSets != 0 ); 1794 assert( m_numOutputLayerSets >= m_numLayerSets + m_numAddLayerSets ); // Number of output layer sets must be at least as many as layer sets. 1795 1796 Int *tempArray = NULL; 1797 1798 // If output layer Set Idx is specified, only specify it for the non-default output layer sets 1799 Int numNonDefaultOls = m_numOutputLayerSets - (m_numLayerSets + m_numAddLayerSets); 1800 if( numNonDefaultOls ) 1801 { 1802 assert( scanStringToArray( *cfg_outputLayerSetIdx, numNonDefaultOls, "OutputLayerSetIdx", m_outputLayerSetIdx ) ); 1803 for(Int i = 0; i < numNonDefaultOls; i++) 1804 { 1805 assert( m_outputLayerSetIdx[i] >= 0 && m_outputLayerSetIdx[i] < (m_numLayerSets + m_numAddLayerSets) ); 1806 } 1807 } 1808 1809 // Number of output layers in output layer sets 1810 Bool readStringFlag = scanStringToArray( *cfg_numLayersInOutputLayerSet, m_numOutputLayerSets - 1, "NumLayersInOutputLayerSets", m_numLayersInOutputLayerSet ); 1811 m_numLayersInOutputLayerSet.insert(m_numLayersInOutputLayerSet.begin(), 1); 1812 // Layers in the output layer set 1813 m_listOfOutputLayers.resize(m_numOutputLayerSets); 1814 Int startOlsCtr = 1; 1815 if( m_defaultTargetOutputLayerIdc == 0 || m_defaultTargetOutputLayerIdc == 1 ) 1816 { 1817 // Default output layer sets defined 1818 startOlsCtr = m_numLayerSets + m_numAddLayerSets; 1819 } 1820 for( Int olsCtr = 1; olsCtr < m_numOutputLayerSets; olsCtr++ ) 1821 { 1822 if( olsCtr < startOlsCtr ) 1823 { 1824 if(scanStringToArray( cfg_listOfOutputLayers[olsCtr], m_numLayersInOutputLayerSet[olsCtr], "ListOfOutputLayers", m_listOfOutputLayers[olsCtr] ) ) 1825 { 1826 std::cout << "Default OLS defined. Ignoring ListOfOutputLayers" << olsCtr << endl; 1827 } 1828 } 1829 else 1830 { 1831 assert( scanStringToArray( cfg_listOfOutputLayers[olsCtr], m_numLayersInOutputLayerSet[olsCtr], "ListOfOutputLayers", m_listOfOutputLayers[olsCtr] ) ); 1832 } 1833 } 1834 delete cfg_numLayersInOutputLayerSet; 1835 delete [] cfg_listOfOutputLayers; 1836 delete cfg_outputLayerSetIdx; 1755 1837 #endif 1756 1838 #endif //SVC_EXTENSION … … 3670 3752 3671 3753 #if SVC_EXTENSION 3754 #if OUTPUT_LAYER_SETS_CONFIG 3755 Void TAppEncCfg::cfgStringToArray(Int **arr, string const cfgString, Int const numEntries, const char* logString) 3756 #else 3672 3757 Void TAppEncCfg::cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString) 3758 #endif 3673 3759 { 3674 3760 Char *tempChar = cfgString.empty() ? NULL : strdup(cfgString.c_str()); … … 3679 3765 *arr = new Int[numEntries]; 3680 3766 3767 #if OUTPUT_LAYER_SETS_CONFIG 3768 if( tempChar == NULL ) 3769 { 3770 arrayEntry = NULL; 3771 } 3772 else 3773 { 3774 arrayEntry = strtok( tempChar, " ,"); 3775 } 3776 #else 3681 3777 arrayEntry = strtok( tempChar, " ,"); 3778 #endif 3682 3779 while(arrayEntry != NULL) 3683 3780 { … … 3709 3806 } 3710 3807 3808 #if OUTPUT_LAYER_SETS_CONFIG 3809 Bool TAppEncCfg::scanStringToArray(string const cfgString, Int const numEntries, const char* logString, Int * const returnArray) 3810 { 3811 Int *tempArray = NULL; 3812 // For all layer sets 3813 cfgStringToArray( &tempArray, cfgString, numEntries, logString ); 3814 if(tempArray) 3815 { 3816 for(Int i = 0; i < numEntries; i++) 3817 { 3818 returnArray[i] = tempArray[i]; 3819 } 3820 delete [] tempArray; tempArray = NULL; 3821 return true; 3822 } 3823 return false; 3824 } 3825 Bool TAppEncCfg::scanStringToArray(string const cfgString, Int const numEntries, const char* logString, std::vector<Int> & returnVector) 3826 { 3827 Int *tempArray = NULL; 3828 // For all layer sets 3829 cfgStringToArray( &tempArray, cfgString, numEntries, logString ); 3830 if(tempArray) 3831 { 3832 returnVector.empty(); 3833 for(Int i = 0; i < numEntries; i++) 3834 { 3835 returnVector.push_back(tempArray[i]); 3836 } 3837 delete [] tempArray; tempArray = NULL; 3838 return true; 3839 } 3840 return false; 3841 } 3842 #endif 3711 3843 #endif //SVC_EXTENSION 3712 3844 //! \} -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
r856 r861 79 79 Int m_numHighestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1]; 80 80 Int m_highestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 81 #endif 82 #if OUTPUT_LAYER_SETS_CONFIG 83 std::vector<Int> m_outputLayerSetIdx; 84 Int m_defaultTargetOutputLayerIdc; 85 Int m_numOutputLayerSets; 86 std::vector<Int> m_numLayersInOutputLayerSet; 87 std::vector< std::vector<Int> > m_listOfOutputLayers; 81 88 #endif 82 89 #else … … 488 495 Int getWaveFrontSynchro() { return m_iWaveFrontSynchro; } 489 496 Void getDirFilename(string& filename, string& dir, const string path); 497 #if OUTPUT_LAYER_SETS_CONFIG 498 Bool scanStringToArray(string const cfgString, Int const numEntries, const char* logString, Int * const returnArray); 499 Bool scanStringToArray(string const cfgString, Int const numEntries, const char* logString, std::vector<Int> & returnVector); 500 Void cfgStringToArray(Int **arr, string const cfgString, Int const numEntries, const char* logString); 501 #else 490 502 Void cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString); 503 #endif 491 504 #if REPN_FORMAT_IN_VPS 492 505 RepFormatCfg* getRepFormatCfg(Int i) { return &m_repFormatCfg[i]; } -
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r856 r861 1142 1142 1143 1143 #if Q0078_ADD_LAYER_SETS 1144 #if OUTPUT_LAYER_SETS_CONFIG 1145 if (m_numLayerSets > 1) 1146 { 1147 vps->setNumLayerSets(m_numLayerSets); 1148 #else 1144 1149 if (m_numLayerSets > 0) 1145 1150 { 1146 1151 vps->setNumLayerSets(m_numLayerSets+1); 1152 #endif 1147 1153 for (Int setId = 1; setId < vps->getNumLayerSets(); setId++) 1148 1154 { … … 1154 1160 for (Int setId = 1; setId < vps->getNumLayerSets(); setId++) 1155 1161 { 1162 #if OUTPUT_LAYER_SETS_CONFIG 1163 for (Int i = 0; i < m_numLayerInIdList[setId]; i++) 1164 { 1165 Int layerId = m_layerSetLayerIdList[setId][i]; 1166 #else 1156 1167 for (Int i = 0; i < m_numLayerInIdList[setId-1]; i++) 1157 1168 { 1158 1169 Int layerId = m_layerSetLayerIdList[setId-1][i]; 1159 1170 #endif 1160 1171 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1161 1172 //4 … … 1403 1414 #endif 1404 1415 #endif 1416 #if OUTPUT_LAYER_SETS_CONFIG 1417 1418 vps->setDefaultTargetOutputLayerIdc( m_defaultTargetOutputLayerIdc ); // As per configuration file 1419 1420 if( m_numOutputLayerSets == -1 ) // # of output layer sets not specified in the configuration file 1421 { 1422 vps->setNumOutputLayerSets(vps->getNumLayerSets()); 1423 1424 for(i = 1; i < vps->getNumLayerSets(); i++) 1425 { 1426 vps->setOutputLayerSetIdx(i, i); 1427 } 1428 } 1429 else 1430 { 1431 vps->setNumOutputLayerSets( m_numOutputLayerSets ); 1432 for( Int olsCtr = 0; olsCtr < vps->getNumLayerSets(); olsCtr ++ ) // Default output layer sets 1433 { 1434 vps->setOutputLayerSetIdx(i, i); 1435 } 1436 for( Int olsCtr = vps->getNumLayerSets(); olsCtr < vps->getNumOutputLayerSets(); olsCtr ++ ) // Non-default output layer sets 1437 { 1438 vps->setOutputLayerSetIdx(i, m_outputLayerSetIdx[olsCtr - vps->getNumLayerSets()]); 1439 } 1440 } 1441 #endif 1405 1442 // Target output layer 1406 1443 vps->setNumOutputLayerSets(vps->getNumLayerSets()); 1407 1444 vps->setNumProfileTierLevel(vps->getNumLayerSets()); 1445 #if !OUTPUT_LAYER_SETS_CONFIG // Taken care by configuration file parameter 1408 1446 #if P0295_DEFAULT_OUT_LAYER_IDC 1409 1447 vps->setDefaultTargetOutputLayerIdc(1); … … 1415 1453 #endif 1416 1454 #endif 1455 #endif 1417 1456 for(i = 1; i < vps->getNumLayerSets(); i++) 1418 1457 { 1419 1458 vps->setProfileLevelTierIdx(i, i); 1459 #if !OUTPUT_LAYER_SETS_CONFIG 1420 1460 vps->setOutputLayerSetIdx(i, i); 1461 #endif 1421 1462 } 1422 1463 #endif … … 1433 1474 1434 1475 // derive OutputLayerFlag[i][j] 1476 #if !OUTPUT_LAYER_SETS_CONFIG 1435 1477 if( vps->getDefaultTargetOutputLayerIdc() == 1 ) 1478 #endif 1436 1479 { 1437 1480 // default_output_layer_idc equal to 1 specifies that only the layer with the highest value of nuh_layer_id such that nuh_layer_id equal to nuhLayerIdA and … … 1446 1489 if( vps->getLayerIdIncludedFlag(lsIdx, layer) ) 1447 1490 #endif 1448 { 1491 { 1492 #if OUTPUT_LAYER_SETS_CONFIG 1493 switch(vps->getDefaultTargetOutputLayerIdc()) 1494 { 1495 case 0: vps->setOutputLayerFlag( lsIdx, layer, 1 ); 1496 break; 1497 case 1: vps->setOutputLayerFlag( lsIdx, layer, layer == vps->getNumLayersInIdList(lsIdx) - 1 ); 1498 break; 1499 case 2: 1500 case 3: vps->setOutputLayerFlag( lsIdx, layer, std::find( m_listOfOutputLayers[lsIdx].begin(), m_listOfOutputLayers[lsIdx].end(), layer) != m_listOfOutputLayers[lsIdx].end() ); 1501 break; 1502 } 1503 #else 1449 1504 vps->setOutputLayerFlag( lsIdx, layer, layer == vps->getNumLayersInIdList(lsIdx) - 1 ); 1505 #endif 1450 1506 } 1451 1507 } 1452 1508 } 1453 } 1509 #if OUTPUT_LAYER_SETS_CONFIG 1510 for( Int olsIdx = vps->getNumLayerSets(); olsIdx < vps->getNumOutputLayerSets(); olsIdx++ ) 1511 { 1512 for( UInt layer = 0; layer < vps->getNumLayersInIdList(vps->getOutputLayerSetIdx(olsIdx)); layer++ ) 1513 { 1514 vps->setOutputLayerFlag( olsIdx, layer, std::find( m_listOfOutputLayers[olsIdx].begin(), m_listOfOutputLayers[olsIdx].end(), layer) != m_listOfOutputLayers[olsIdx].end()); 1515 } 1516 } 1517 #endif 1518 } 1519 #if !OUTPUT_LAYER_SETS_CONFIG 1454 1520 else 1455 1521 { … … 1457 1523 assert(!"default_output_layer_idc not equal to 1 is not yet supported"); 1458 1524 } 1525 #endif 1459 1526 1460 1527 // Initialize dpb_size_table() for all ouput layer sets in the VPS extension -
branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
r856 r861 51 51 #define POC_RESET_RESTRICTIONS 1 ///< Restrictions on semantics of POC reset-related syntax elements, including one item from R0223 52 52 #define POC_RESET_VALUE_RESTRICTION 1 ///< R0223: Restriction on the value of full_poc_reset_flag 53 #define OUTPUT_LAYER_SETS_CONFIG 1 53 54 #define O0137_MAX_LAYERID 1 ///< JCTVC-O0137, JCTVC-O0200, JCTVC-O0223: restrict nuh_layer_id and vps_max_layers_minus1 54 55 … … 323 324 #define MAX_VPS_OP_LAYER_SETS_PLUS1 (MAX_LAYERS+1) 324 325 #define MAX_VPS_LAYER_SETS_PLUS1 1024 326 #define MAX_VPS_OUTPUT_LAYER_SETS_PLUS1 1024 325 327 #define MAX_VPS_LAYER_ID_PLUS1 MAX_LAYERS 326 328 #else
Note: See TracChangeset for help on using the changeset viewer.