Changeset 1162 in SHVCSoftware
- Timestamp:
- 8 Jul 2015, 00:59:51 (9 years ago)
- Location:
- branches/SHM-dev/source
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r1150 r1162 111 111 #endif 112 112 , m_maxTidRefPresentFlag(1) 113 #if OUTPUT_LAYER_SETS_CONFIG114 113 , m_defaultTargetOutputLayerIdc (-1) 115 114 , m_numOutputLayerSets (-1) 116 #endif117 115 , m_inputColourSpaceConvert(IPCOLOURSPACE_UNCHANGED) 118 116 , m_snrInternalColourSpace(false) … … 952 950 } 953 951 #endif 954 #if OUTPUT_LAYER_SETS_CONFIG955 952 string* cfg_numOutputLayersInOutputLayerSet = new string; 956 953 string* cfg_listOfOutputLayers = new string[MAX_VPS_OUTPUT_LAYER_SETS_PLUS1]; 957 954 string* cfg_outputLayerSetIdx = new string; 958 #endif959 955 #if MULTIPLE_PTL_SUPPORT 960 956 string* cfg_listOfLayerPTLOfOlss = new string[MAX_VPS_OUTPUT_LAYER_SETS_PLUS1]; … … 1064 1060 ("NumLayers", m_numLayers, 1, "Number of layers to code") 1065 1061 #if Q0078_ADD_LAYER_SETS 1066 #if OUTPUT_LAYER_SETS_CONFIG1067 1062 ("NumLayerSets", m_numLayerSets, 1, "Number of layer sets") 1068 #else1069 ("NumLayerSets", m_numLayerSets, 0, "Number of layer sets")1070 #endif1071 1063 ("NumLayerInIdList%d", cfg_numLayerInIdList, 0, MAX_VPS_LAYER_IDX_PLUS1, "Number of layers in the set") 1072 1064 ("LayerSetLayerIdList%d", cfg_layerSetLayerIdListPtr, string(""), MAX_VPS_LAYER_IDX_PLUS1, "Layer IDs for the set") … … 1075 1067 ("HighestLayerIdx%d", cfg_highestLayerIdxPtr, string(""), MAX_VPS_LAYER_IDX_PLUS1, "Highest layer idx for an additional layer set") 1076 1068 #endif 1077 #if OUTPUT_LAYER_SETS_CONFIG1078 1069 ("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") 1079 1070 ("NumOutputLayerSets", m_numOutputLayerSets, 1, "Number of output layer sets excluding the 0-th output layer set") … … 1081 1072 ("ListOfOutputLayers%d", cfg_listOfOutputLayers, string(""), MAX_VPS_LAYER_IDX_PLUS1, "Layer IDs for the set, in terms of layer ID in the output layer set Range: [0..NumLayersInOutputLayerSet-1]") 1082 1073 ("OutputLayerSetIdx", cfg_outputLayerSetIdx, string(""), 1, "Corresponding layer set index, only for non-default output layer sets") 1083 #endif1084 1074 #if AUXILIARY_PICTURES 1085 1075 ("AuxId%d", cfg_auxId, 0, MAX_LAYERS, "Auxilary picture ID for layer %d (0: Not aux pic, 1: Alpha plane, 2: Depth picture, 3: Cb enh, 4: Cr enh") … … 2440 2430 2441 2431 #if Q0078_ADD_LAYER_SETS 2442 #if OUTPUT_LAYER_SETS_CONFIG2443 2432 for (Int layerSet = 1; layerSet < m_numLayerSets; layerSet++) 2444 2433 { 2445 2434 // Simplifying the code in the #else section, and allowing 0-th layer set t 2446 2435 assert( scanStringToArray( cfg_layerSetLayerIdList[layerSet], m_numLayerInIdList[layerSet], "NumLayerInIdList", m_layerSetLayerIdList[layerSet] ) ); 2447 #else2448 for (Int layerSet = 0; layerSet < m_numLayerSets; layerSet++)2449 {2450 if (m_numLayerInIdList[layerSet] > 0)2451 {2452 Char* layerSetLayerIdListDup = cfg_layerSetLayerIdList[layerSet].empty() ? NULL : strdup(cfg_layerSetLayerIdList[layerSet].c_str());2453 Int i = 0;2454 char *layerId = strtok(layerSetLayerIdListDup, " ,-");2455 while (layerId != NULL)2456 {2457 if (i >= m_numLayerInIdList[layerSet])2458 {2459 printf("NumLayerInIdList%d: The number of layers in the set is larger than the allowed number of layers.\n", layerSet);2460 exit(EXIT_FAILURE);2461 }2462 m_layerSetLayerIdList[layerSet][i] = atoi(layerId);2463 layerId = strtok(NULL, " ,-");2464 i++;2465 }2466 2467 if( layerSetLayerIdListDup )2468 {2469 free( layerSetLayerIdListDup );2470 layerSetLayerIdListDup = NULL;2471 }2472 }2473 #endif2474 2436 } 2475 2437 for (Int addLayerSet = 0; addLayerSet < m_numAddLayerSets; addLayerSet++) 2476 2438 { 2477 #if OUTPUT_LAYER_SETS_CONFIG2478 2439 // Simplifying the code in the #else section 2479 2440 assert( scanStringToArray( cfg_highestLayerIdx[addLayerSet], m_numHighestLayerIdx[addLayerSet], "HighestLayerIdx", m_highestLayerIdx[addLayerSet] ) ); 2480 #else 2481 if (m_numHighestLayerIdx[addLayerSet] > 0) 2482 { 2483 Char* highestLayrIdxListDup = cfg_highestLayerIdx[addLayerSet].empty() ? NULL : strdup(cfg_highestLayerIdx[addLayerSet].c_str()); 2484 Int i = 0; 2485 char *layerIdx = strtok(highestLayrIdxListDup, " ,-"); 2486 while (layerIdx != NULL) 2487 { 2488 if (i >= m_numLayerInIdList[addLayerSet]) 2489 { 2490 printf("NumLayerInIdList%d: The number of layer idx's in the highest layer idx list is larger than the allowed number of idx's.\n", addLayerSet); 2491 exit(EXIT_FAILURE); 2492 } 2493 m_highestLayerIdx[addLayerSet][i] = atoi(layerIdx); 2494 layerIdx = strtok(NULL, " ,-"); 2495 i++; 2496 } 2497 2498 if( highestLayrIdxListDup ) 2499 { 2500 free( highestLayrIdxListDup ); 2501 highestLayrIdxListDup = NULL; 2502 } 2503 } 2504 #endif 2505 } 2506 #endif 2507 #if OUTPUT_LAYER_SETS_CONFIG 2441 } 2442 #endif 2443 2508 2444 if( m_defaultTargetOutputLayerIdc != -1 ) 2509 2445 { … … 2593 2529 delete [] cfg_listOfOutputLayers; 2594 2530 delete cfg_outputLayerSetIdx; 2595 #endif2596 2531 #else //SVC_EXTENSION 2597 2532 switch (m_conformanceWindowMode) … … 4684 4619 4685 4620 #if SVC_EXTENSION 4686 #if OUTPUT_LAYER_SETS_CONFIG4687 4621 Void TAppEncCfg::cfgStringToArray(Int **arr, string const cfgString, Int const numEntries, const char* logString) 4688 #else4689 Void TAppEncCfg::cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString)4690 #endif4691 4622 { 4692 4623 Char *tempChar = cfgString.empty() ? NULL : strdup(cfgString.c_str()); … … 4697 4628 *arr = new Int[numEntries]; 4698 4629 4699 #if OUTPUT_LAYER_SETS_CONFIG4700 4630 if( tempChar == NULL ) 4701 4631 { … … 4706 4636 arrayEntry = strtok( tempChar, " ,"); 4707 4637 } 4708 #else 4709 arrayEntry = strtok( tempChar, " ,"); 4710 #endif 4638 4711 4639 while(arrayEntry != NULL) 4712 4640 { … … 4738 4666 } 4739 4667 4740 #if OUTPUT_LAYER_SETS_CONFIG4741 4668 Bool TAppEncCfg::scanStringToArray(string const cfgString, Int const numEntries, const char* logString, Int * const returnArray) 4742 4669 { … … 4755 4682 return false; 4756 4683 } 4684 4757 4685 Bool TAppEncCfg::scanStringToArray(string const cfgString, Int const numEntries, const char* logString, std::vector<Int> & returnVector) 4758 4686 { … … 4772 4700 return false; 4773 4701 } 4774 #endif 4775 4776 #if OUTPUT_LAYER_SETS_CONFIG 4702 4777 4703 Void TAppEncCfg::cfgStringToArrayNumEntries(Int **arr, string const cfgString, Int &numEntries, const char* logString) 4778 4704 { … … 4842 4768 return false; 4843 4769 } 4844 #endif4845 4770 #endif //SVC_EXTENSION 4846 4771 //! \} -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
r1150 r1162 81 81 Int m_highestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_IDX_PLUS1]; 82 82 #endif 83 #if OUTPUT_LAYER_SETS_CONFIG84 std::vector<Int> m_outputLayerSetIdx;85 83 Int m_defaultTargetOutputLayerIdc; 86 84 Int m_numOutputLayerSets; 85 std::vector<Int> m_outputLayerSetIdx; 87 86 std::vector<Int> m_numOutputLayersInOutputLayerSet; 88 87 std::vector< std::vector<Int> > m_listOfOutputLayers; 89 #endif90 88 Bool m_isField; ///< enable field coding 91 89 Bool m_isTopFieldFirst; … … 556 554 Int getWaveFrontSynchro(Int layerIdx) { return m_acLayerCfg[layerIdx].m_waveFrontSynchro; } 557 555 Void getDirFilename(string& filename, string& dir, const string path); 558 #if OUTPUT_LAYER_SETS_CONFIG 556 559 557 Bool scanStringToArray(string const cfgString, Int const numEntries, const char* logString, Int * const returnArray); 560 558 Bool scanStringToArray(string const cfgString, Int const numEntries, const char* logString, std::vector<Int> & returnVector); … … 563 561 Bool scanStringToArrayNumEntries(string const cfgString, Int &numEntries, const char* logString, std::vector<Int> & returnVector); 564 562 Void cfgStringToArrayNumEntries(Int **arr, string const cfgString, Int &numEntries, const char* logString); 565 #else 566 Void cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString); 567 #endif 563 568 564 #if REPN_FORMAT_IN_VPS 569 565 RepFormatCfg* getRepFormatCfg(Int i) { return &m_repFormatCfg[i]; } -
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r1161 r1162 1258 1258 1259 1259 #if Q0078_ADD_LAYER_SETS 1260 #if OUTPUT_LAYER_SETS_CONFIG1261 1260 if (m_numLayerSets > 1) 1262 1261 { 1263 1262 vps->setNumLayerSets(m_numLayerSets); 1264 #else 1265 if (m_numLayerSets > 0) 1266 { 1267 vps->setNumLayerSets(m_numLayerSets+1); 1268 #endif 1263 1269 1264 for (Int setId = 1; setId < vps->getNumLayerSets(); setId++) 1270 1265 { … … 1276 1271 for (Int setId = 1; setId < vps->getNumLayerSets(); setId++) 1277 1272 { 1278 #if OUTPUT_LAYER_SETS_CONFIG1279 1273 for( i = 0; i < m_numLayerInIdList[setId]; i++ ) 1280 1274 { 1281 1275 Int layerId = m_layerSetLayerIdList[setId][i]; 1282 1276 Int layerIdx = vps->getLayerIdxInVps(m_layerSetLayerIdList[setId][i]); 1283 #else1284 for( i = 0; i < m_numLayerInIdList[setId-1]; i++ )1285 {1286 Int layerId = m_layerSetLayerIdList[setId-1][i];1287 #endif1288 1277 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1289 1278 //4 … … 1544 1533 #endif 1545 1534 1546 #if OUTPUT_LAYER_SETS_CONFIG1547 1548 1535 vps->setDefaultTargetOutputLayerIdc( m_defaultTargetOutputLayerIdc ); // As per configuration file 1549 1536 … … 1569 1556 } 1570 1557 } 1571 #endif 1558 1572 1559 // Target output layer 1573 1560 #if !MULTIPLE_PTL_SUPPORT … … 1585 1572 1586 1573 // derive OutputLayerFlag[i][j] 1587 #if !OUTPUT_LAYER_SETS_CONFIG 1588 if( vps->getDefaultTargetOutputLayerIdc() == 1 ) 1589 #endif 1590 { 1591 // 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 1592 // AuxId[ nuhLayerIdA ] equal to 0 in each of the output layer sets with index in the range of 1 to vps_num_layer_sets_minus1, inclusive, is an output layer of its output layer set. 1593 1594 // Include the highest layer as output layer for each layer set 1595 for(Int lsIdx = 1; lsIdx <= vps->getVpsNumLayerSetsMinus1(); lsIdx++) 1596 { 1597 for( UInt layer = 0; layer < vps->getNumLayersInIdList(lsIdx); layer++ ) 1598 { 1574 // 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 1575 // AuxId[ nuhLayerIdA ] equal to 0 in each of the output layer sets with index in the range of 1 to vps_num_layer_sets_minus1, inclusive, is an output layer of its output layer set. 1576 1577 // Include the highest layer as output layer for each layer set 1578 for(Int lsIdx = 1; lsIdx <= vps->getVpsNumLayerSetsMinus1(); lsIdx++) 1579 { 1580 for( UInt layer = 0; layer < vps->getNumLayersInIdList(lsIdx); layer++ ) 1581 { 1599 1582 #if !Q0078_ADD_LAYER_SETS // the following condition is incorrect and is not needed anyway 1600 if( vps->getLayerIdIncludedFlag(lsIdx, layer) ) 1601 #endif 1583 if( vps->getLayerIdIncludedFlag(lsIdx, layer) ) 1584 #endif 1585 { 1586 switch(vps->getDefaultTargetOutputLayerIdc()) 1602 1587 { 1603 #if OUTPUT_LAYER_SETS_CONFIG 1604 switch(vps->getDefaultTargetOutputLayerIdc()) 1605 { 1606 case 0: vps->setOutputLayerFlag( lsIdx, layer, 1 ); 1607 break; 1608 case 1: vps->setOutputLayerFlag( lsIdx, layer, layer == vps->getNumLayersInIdList(lsIdx) - 1 ); 1609 break; 1610 case 2: 1611 case 3: vps->setOutputLayerFlag( lsIdx, layer, (layer != vps->getNumLayersInIdList(lsIdx) - 1) ? std::find( m_listOfOutputLayers[lsIdx].begin(), m_listOfOutputLayers[lsIdx].end(), m_layerSetLayerIdList[lsIdx][layer]) != m_listOfOutputLayers[lsIdx].end() 1612 : m_listOfOutputLayers[lsIdx][m_listOfOutputLayers[lsIdx].size()-1] == m_layerSetLayerIdList[lsIdx][layer] ); 1613 break; 1614 } 1615 #else 1616 vps->setOutputLayerFlag( lsIdx, layer, layer == vps->getNumLayersInIdList(lsIdx) - 1 ); 1617 #endif 1588 case 0: vps->setOutputLayerFlag( lsIdx, layer, 1 ); 1589 break; 1590 case 1: vps->setOutputLayerFlag( lsIdx, layer, layer == vps->getNumLayersInIdList(lsIdx) - 1 ); 1591 break; 1592 case 2: 1593 case 3: vps->setOutputLayerFlag( lsIdx, layer, (layer != vps->getNumLayersInIdList(lsIdx) - 1) ? std::find( m_listOfOutputLayers[lsIdx].begin(), m_listOfOutputLayers[lsIdx].end(), m_layerSetLayerIdList[lsIdx][layer]) != m_listOfOutputLayers[lsIdx].end() 1594 : m_listOfOutputLayers[lsIdx][m_listOfOutputLayers[lsIdx].size()-1] == m_layerSetLayerIdList[lsIdx][layer] ); 1595 break; 1618 1596 } 1619 1597 } 1620 1598 } 1621 #if OUTPUT_LAYER_SETS_CONFIG 1622 for( Int olsIdx = vps->getVpsNumLayerSetsMinus1() + 1; olsIdx < vps->getNumOutputLayerSets(); olsIdx++ ) 1623 { 1624 for( UInt layer = 0; layer < vps->getNumLayersInIdList(vps->getOutputLayerSetIdx(olsIdx)); layer++ ) 1625 { 1626 vps->setOutputLayerFlag( olsIdx, layer, (layer != vps->getNumLayersInIdList(vps->getOutputLayerSetIdx(olsIdx)) - 1) ? std::find( m_listOfOutputLayers[olsIdx].begin(), m_listOfOutputLayers[olsIdx].end(), vps->getLayerSetLayerIdList(vps->getOutputLayerSetIdx(olsIdx), layer)) != m_listOfOutputLayers[olsIdx].end() 1627 : m_listOfOutputLayers[olsIdx][m_listOfOutputLayers[olsIdx].size()-1] == vps->getLayerSetLayerIdList(vps->getOutputLayerSetIdx(olsIdx), layer) ); 1628 } 1629 } 1630 #endif 1631 } 1632 #if !OUTPUT_LAYER_SETS_CONFIG 1633 else 1634 { 1635 // cases when default_output_layer_idc is not equal to 1 1636 assert(!"default_output_layer_idc not equal to 1 is not yet supported"); 1637 } 1638 #endif 1599 } 1600 1601 for( Int olsIdx = vps->getVpsNumLayerSetsMinus1() + 1; olsIdx < vps->getNumOutputLayerSets(); olsIdx++ ) 1602 { 1603 for( UInt layer = 0; layer < vps->getNumLayersInIdList(vps->getOutputLayerSetIdx(olsIdx)); layer++ ) 1604 { 1605 vps->setOutputLayerFlag( olsIdx, layer, (layer != vps->getNumLayersInIdList(vps->getOutputLayerSetIdx(olsIdx)) - 1) ? std::find( m_listOfOutputLayers[olsIdx].begin(), m_listOfOutputLayers[olsIdx].end(), vps->getLayerSetLayerIdList(vps->getOutputLayerSetIdx(olsIdx), layer)) != m_listOfOutputLayers[olsIdx].end() 1606 : m_listOfOutputLayers[olsIdx][m_listOfOutputLayers[olsIdx].size()-1] == vps->getLayerSetLayerIdList(vps->getOutputLayerSetIdx(olsIdx), layer) ); 1607 } 1608 } 1639 1609 1640 1610 vps->deriveNecessaryLayerFlag(); -
branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
r1161 r1162 53 53 #define POC_RESET_RESTRICTIONS 1 ///< Restrictions on semantics of POC reset-related syntax elements, including one item from R0223 54 54 #define POC_RESET_VALUE_RESTRICTION 1 ///< R0223: Restriction on the value of full_poc_reset_flag 55 #define OUTPUT_LAYER_SETS_CONFIG 156 55 #define PTL_SIGNALLING 1 ///< Overall macro for all PTL-related signalling 57 56 #if PTL_SIGNALLING
Note: See TracChangeset for help on using the changeset viewer.