Changeset 861 in SHVCSoftware for branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
- Timestamp:
- 12 Aug 2014, 00:51:17 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified 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 //! \}
Note: See TracChangeset for help on using the changeset viewer.