Changeset 815 in SHVCSoftware for trunk/source/App/TAppEncoder
- Timestamp:
- 30 Jun 2014, 06:13:06 (11 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk ¶
- Property svn:mergeinfo changed
/branches/SHM-6-dev merged: 715-751,753-814
- Property svn:mergeinfo changed
-
trunk/source ¶
- Property svn:mergeinfo changed
/branches/SHM-6-dev/source merged: 715-726,728-744,746-751,753-802,804-814
- Property svn:mergeinfo changed
-
TabularUnified trunk/source/App/TAppEncoder/TAppEncCfg.cpp ¶
r713 r815 69 69 , m_avcBaseLayerFlag(0) 70 70 #endif 71 #if N0120_MAX_TID_REF_CFG72 71 , m_maxTidRefPresentFlag(1) 73 #endif74 72 , m_pColumnWidth() 75 73 , m_pRowHeight() … … 420 418 Int* cfg_OutputBitDepthC [MAX_LAYERS]; 421 419 #endif 422 #if N0120_MAX_TID_REF_CFG423 420 Int* cfg_maxTidIlRefPicsPlus1[MAX_LAYERS]; 424 #endif425 421 for(UInt layer = 0; layer < MAX_LAYERS; layer++) 426 422 { … … 491 487 cfg_OutputBitDepthC [layer] = &m_acLayerCfg[layer].m_outputBitDepthC; 492 488 #endif 493 #if N0120_MAX_TID_REF_CFG 494 cfg_maxTidIlRefPicsPlus1[layer] = &m_acLayerCfg[layer].m_maxTidIlRefPicsPlus1; 495 #endif 489 cfg_maxTidIlRefPicsPlus1[layer] = &m_acLayerCfg[layer].m_maxTidIlRefPicsPlus1; 496 490 #if AUXILIARY_PICTURES 497 491 cfg_auxId[layer] = &m_acLayerCfg[layer].m_auxId; 498 492 #endif 499 493 } 494 #if Q0078_ADD_LAYER_SETS 495 Int* cfg_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1]; 496 string cfg_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1]; 497 string* cfg_layerSetLayerIdListPtr[MAX_VPS_LAYER_SETS_PLUS1]; 498 Int* cfg_numHighestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1]; 499 string cfg_highestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1]; 500 string* cfg_highestLayerIdxPtr[MAX_VPS_LAYER_SETS_PLUS1]; 501 for (UInt i = 0; i < MAX_VPS_LAYER_SETS_PLUS1; i++) 502 { 503 cfg_numLayerInIdList[i] = &m_numLayerInIdList[i]; 504 cfg_layerSetLayerIdListPtr[i] = &cfg_layerSetLayerIdList[i]; 505 cfg_highestLayerIdxPtr[i] = &cfg_highestLayerIdx[i]; 506 cfg_numHighestLayerIdx[i] = &m_numHighestLayerIdx[i]; 507 } 508 #endif 500 509 #if AVC_BASE 501 510 string cfg_BLInputFile; … … 519 528 string cfg_codedPivotValue; 520 529 string cfg_targetPivotValue; 530 #if P0050_KNEE_FUNCTION_SEI 531 string cfg_kneeSEIInputKneePointValue; 532 string cfg_kneeSEIOutputKneePointValue; 533 #endif 521 534 po::Options opts; 522 535 opts.addOptions() … … 548 561 #endif 549 562 ("NumLayers", m_numLayers, 1, "Number of layers to code") 563 #if Q0078_ADD_LAYER_SETS 564 ("NumLayerSets", m_numLayerSets, 0, "Number of layer sets") 565 ("NumLayerInIdList%d", cfg_numLayerInIdList, 0, MAX_VPS_LAYER_ID_PLUS1, "Number of layers in the set") 566 ("LayerSetLayerIdList%d", cfg_layerSetLayerIdListPtr, string(""), MAX_VPS_LAYER_ID_PLUS1, "Layer IDs for the set") 567 ("NumAddLayerSets", m_numAddLayerSets, 0, "Number of additional layer sets") 568 ("NumHighestLayerIdx%d", cfg_numHighestLayerIdx, 0, MAX_VPS_LAYER_ID_PLUS1, "Number of highest layer idx") 569 ("HighestLayerIdx%d", cfg_highestLayerIdxPtr, string(""), MAX_VPS_LAYER_ID_PLUS1, "Highest layer idx for an additional layer set") 570 #endif 550 571 #if AUXILIARY_PICTURES 551 572 ("InputChromaFormat%d", cfg_tmpInputChromaFormat, 420, MAX_LAYERS, "InputChromaFormatIDC for layer %d") … … 554 575 #endif 555 576 ("ConformanceMode%d", cfg_conformanceMode,0, MAX_LAYERS, "Window conformance mode (0: no cropping, 1:automatic padding, 2: padding, 3:cropping") 556 #if SCALABILITY_MASK_E0104557 577 ("ScalabilityMask1", m_scalabilityMask[1], 0, "scalability_mask[1] (multiview)") 558 578 ("ScalabilityMask2", m_scalabilityMask[2], 1, "scalability_mask[2] (scalable)" ) 559 579 #if AUXILIARY_PICTURES 560 580 ("ScalabilityMask3", m_scalabilityMask[3], 0, "scalability_mask[3] (auxiliary pictures)" ) 561 #endif562 #else563 ("ScalabilityMask0", m_scalabilityMask[0], 0, "scalability_mask[0] (multiview)")564 ("ScalabilityMask1", m_scalabilityMask[1], 1, "scalability_mask[1] (scalable)" )565 581 #endif 566 582 ("BitstreamFile,b", cfg_BitstreamFile, string(""), "Bitstream output file name") … … 598 614 ("OutputBitDepthC%d", cfg_OutputBitDepthC, 0, MAX_LAYERS, "As per OutputBitDepth but for chroma component. (default:InternalBitDepthC)") 599 615 #endif 600 #if N0120_MAX_TID_REF_CFG601 616 ("MaxTidRefPresentFlag", m_maxTidRefPresentFlag, true, "max_tid_ref_present_flag (0: not present, 1: present(default)) " ) 602 617 ("MaxTidIlRefPicsPlus1%d", cfg_maxTidIlRefPicsPlus1, 1, MAX_LAYERS, "allowed maximum temporal_id for inter-layer prediction") 603 #endif604 618 #if O0223_PICTURE_TYPES_ALIGN_FLAG 605 619 ("CrossLayerPictureTypeAlignFlag", m_crossLayerPictureTypeAlignFlag, true, "align picture type across layers" ) 606 620 #endif 607 #if N0147_IRAP_ALIGN_FLAG608 621 ("CrossLayerIrapAlignFlag", m_crossLayerIrapAlignFlag, true, "align IRAP across layers" ) 609 #endif610 622 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 611 623 ("CrossLayerAlignedIdrOnlyFlag", m_crossLayerAlignedIdrOnlyFlag, true, "only idr for IRAP across layers" ) … … 953 965 ("SEISOPDescription", m_SOPDescriptionSEIEnabled, 0, "Control generation of SOP description SEI messages") 954 966 ("SEIScalableNesting", m_scalableNestingSEIEnabled, 0, "Control generation of scalable nesting SEI messages") 967 #if P0050_KNEE_FUNCTION_SEI 968 ("SEIKneeFunctionInfo", m_kneeSEIEnabled, false, "Control generation of Knee function SEI messages") 969 ("SEIKneeFunctionId", m_kneeSEIId, 0, "Specifies Id of Knee function SEI message for a given session") 970 ("SEIKneeFunctionCancelFlag", m_kneeSEICancelFlag, false, "Indicates that Knee function SEI message cancels the persistance or follows") 971 ("SEIKneeFunctionPersistenceFlag", m_kneeSEIPersistenceFlag, true, "Specifies the persistence of the Knee function SEI message") 972 ("SEIKneeFunctionMappingFlag", m_kneeSEIMappingFlag, false, "Specifies the mapping mode of the Knee function SEI message") 973 ("SEIKneeFunctionInputDrange", m_kneeSEIInputDrange, 1000, "Specifies the peak luminance level for the input picture of Knee function SEI messages") 974 ("SEIKneeFunctionInputDispLuminance", m_kneeSEIInputDispLuminance, 100, "Specifies the expected display brightness for the input picture of Knee function SEI messages") 975 ("SEIKneeFunctionOutputDrange", m_kneeSEIOutputDrange, 4000, "Specifies the peak luminance level for the output picture of Knee function SEI messages") 976 ("SEIKneeFunctionOutputDispLuminance", m_kneeSEIOutputDispLuminance, 800, "Specifies the expected display brightness for the output picture of Knee function SEI messages") 977 ("SEIKneeFunctionNumKneePointsMinus1", m_kneeSEINumKneePointsMinus1, 2, "Specifies the number of knee points - 1") 978 ("SEIKneeFunctionInputKneePointValue", cfg_kneeSEIInputKneePointValue, string("600 800 900"), "Array of input knee point") 979 ("SEIKneeFunctionOutputKneePointValue", cfg_kneeSEIOutputKneePointValue, string("100 250 450"), "Array of output knee point") 980 #endif 981 #if Q0189_TMVP_CONSTRAINTS 982 ("SEITemporalMotionVectorPredictionConstraints", m_TMVPConstraintsSEIEnabled, 0, "Control generation of TMVP constrants SEI message") 983 #endif 955 984 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 956 985 ("AdaptiveResolutionChange", m_adaptiveResolutionChange, 0, "Adaptive resolution change frame number. Should coincide with EL RAP picture. (0: disable)") … … 976 1005 ("CGSLUTBit", m_nCGSLUTBit , 12, "bit depth of CGS LUT") 977 1006 #endif 1007 #if Q0108_TSA_STSA 1008 ("InheritCodingStruct%d",m_inheritCodingStruct, 0, MAX_LAYERS, "Predicts the GOP structure of one layer for another layer") 1009 #endif 978 1010 ; 979 1011 … … 983 1015 opts.addOptions()(cOSS.str(), m_GOPList[i-1], GOPEntry()); 984 1016 } 1017 1018 #if Q0108_TSA_STSA 1019 for (Int i=1; i<MAX_LAYERS; i++) 1020 { 1021 for(Int j=1; j<MAX_GOP+1; j++) 1022 { 1023 std::ostringstream cOSS; 1024 cOSS<<"Layer"<<i<<"Frame"<<j; 1025 opts.addOptions()(cOSS.str(), m_EhGOPList[i][j-1], GOPEntry()); 1026 } 1027 } 1028 #endif 1029 985 1030 po::setDefaults(opts); 986 1031 const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv); 1032 1033 #if Q0108_TSA_STSA 1034 for (Int i=1; i<MAX_LAYERS; i++) 1035 { 1036 if(m_inheritCodingStruct[i] == 0) 1037 { 1038 for(Int j=1; j<MAX_GOP+1; j++) 1039 { 1040 m_EhGOPList[i][j-1] = m_GOPList[j-1]; 1041 } 1042 } 1043 else if( m_inheritCodingStruct[i] > 0) 1044 { 1045 for(Int j=1; j<MAX_GOP+1; j++) 1046 { 1047 m_EhGOPList[i][j-1] = m_EhGOPList[m_inheritCodingStruct[i]][j-1]; 1048 } 1049 } 1050 } 1051 #endif 987 1052 988 1053 if(m_isField) … … 1309 1374 { 1310 1375 m_acLayerCfg[layer].m_predLayerIds = NULL; 1376 } 1377 } 1378 #endif 1379 #if Q0078_ADD_LAYER_SETS 1380 for (Int layerSet = 0; layerSet < m_numLayerSets; layerSet++) 1381 { 1382 if (m_numLayerInIdList[layerSet] > 0) 1383 { 1384 Char* layerSetLayerIdListDup = cfg_layerSetLayerIdList[layerSet].empty() ? NULL : strdup(cfg_layerSetLayerIdList[layerSet].c_str()); 1385 Int i = 0; 1386 char *layerId = strtok(layerSetLayerIdListDup, " ,-"); 1387 while (layerId != NULL) 1388 { 1389 if (i >= m_numLayerInIdList[layerSet]) 1390 { 1391 printf("NumLayerInIdList%d: The number of layers in the set is larger than the allowed number of layers.\n", layerSet); 1392 exit(EXIT_FAILURE); 1393 } 1394 m_layerSetLayerIdList[layerSet][i] = atoi(layerId); 1395 layerId = strtok(NULL, " ,-"); 1396 i++; 1397 } 1398 } 1399 } 1400 for (Int addLayerSet = 0; addLayerSet < m_numAddLayerSets; addLayerSet++) 1401 { 1402 if (m_numHighestLayerIdx[addLayerSet] > 0) 1403 { 1404 Char* highestLayrIdxListDup = cfg_highestLayerIdx[addLayerSet].empty() ? NULL : strdup(cfg_highestLayerIdx[addLayerSet].c_str()); 1405 Int i = 0; 1406 char *layerIdx = strtok(highestLayrIdxListDup, " ,-"); 1407 while (layerIdx != NULL) 1408 { 1409 if (i >= m_numLayerInIdList[addLayerSet]) 1410 { 1411 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); 1412 exit(EXIT_FAILURE); 1413 } 1414 m_highestLayerIdx[addLayerSet][i] = atoi(layerIdx); 1415 layerIdx = strtok(NULL, " ,-"); 1416 i++; 1417 } 1311 1418 } 1312 1419 } … … 1495 1602 } 1496 1603 } 1604 #if P0050_KNEE_FUNCTION_SEI 1605 if( m_kneeSEIEnabled && !m_kneeSEICancelFlag ) 1606 { 1607 Char* pcInputKneePointValue = cfg_kneeSEIInputKneePointValue.empty() ? NULL : strdup(cfg_kneeSEIInputKneePointValue.c_str()); 1608 Char* pcOutputKneePointValue = cfg_kneeSEIOutputKneePointValue.empty() ? NULL : strdup(cfg_kneeSEIOutputKneePointValue.c_str()); 1609 assert ( m_kneeSEINumKneePointsMinus1 >= 0 && m_kneeSEINumKneePointsMinus1 < 999 ); 1610 m_kneeSEIInputKneePoint = new Int[m_kneeSEINumKneePointsMinus1+1]; 1611 m_kneeSEIOutputKneePoint = new Int[m_kneeSEINumKneePointsMinus1+1]; 1612 char *InputVal = strtok(pcInputKneePointValue, " .,"); 1613 Int i=0; 1614 while( InputVal && i<(m_kneeSEINumKneePointsMinus1+1) ) 1615 { 1616 m_kneeSEIInputKneePoint[i] = (UInt) atoi( InputVal ); 1617 InputVal = strtok(NULL, " .,"); 1618 i++; 1619 } 1620 char *OutputVal = strtok(pcOutputKneePointValue, " .,"); 1621 i=0; 1622 while( OutputVal && i<(m_kneeSEINumKneePointsMinus1+1) ) 1623 { 1624 m_kneeSEIOutputKneePoint[i] = (UInt) atoi( OutputVal ); 1625 OutputVal = strtok(NULL, " .,"); 1626 i++; 1627 } 1628 } 1629 #endif 1497 1630 1498 1631 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI … … 1742 1875 * This permits the ability to omit a GOP structure specification */ 1743 1876 #if SVC_EXTENSION 1877 #if Q0108_TSA_STSA 1878 if( m_acLayerCfg[0].m_iIntraPeriod == 1 && m_GOPList[0].m_POC == -1 ) 1879 { 1880 m_GOPList[0] = GOPEntry(); 1881 m_GOPList[0].m_QPFactor = 1; 1882 m_GOPList[0].m_betaOffsetDiv2 = 0; 1883 m_GOPList[0].m_tcOffsetDiv2 = 0; 1884 m_GOPList[0].m_POC = 1; 1885 m_GOPList[0].m_numRefPicsActive = 4; 1886 } 1887 1744 1888 for(UInt layer = 0; layer < MAX_LAYERS; layer++) 1745 1889 { 1890 if (m_acLayerCfg[layer].m_iIntraPeriod == 1 && m_EhGOPList[layer][0].m_POC == -1) { 1891 m_EhGOPList[layer][0] = GOPEntry(); 1892 m_EhGOPList[layer][0].m_QPFactor = 1; 1893 m_EhGOPList[layer][0].m_betaOffsetDiv2 = 0; 1894 m_EhGOPList[layer][0].m_tcOffsetDiv2 = 0; 1895 m_EhGOPList[layer][0].m_POC = 1; 1896 m_EhGOPList[layer][0].m_numRefPicsActive = 4; 1897 } 1898 } 1899 #else 1900 for(UInt layer = 0; layer < MAX_LAYERS; layer++) 1901 { 1746 1902 Int m_iIntraPeriod = m_acLayerCfg[layer].m_iIntraPeriod; 1747 #endif 1903 if (m_iIntraPeriod == 1 && m_GOPList[0].m_POC == -1) { 1904 m_GOPList[0] = GOPEntry(); 1905 m_GOPList[0].m_QPFactor = 1; 1906 m_GOPList[0].m_betaOffsetDiv2 = 0; 1907 m_GOPList[0].m_tcOffsetDiv2 = 0; 1908 m_GOPList[0].m_POC = 1; 1909 m_GOPList[0].m_numRefPicsActive = 4; 1910 } 1911 } 1912 #endif 1913 #else 1748 1914 if (m_iIntraPeriod == 1 && m_GOPList[0].m_POC == -1) { 1749 1915 m_GOPList[0] = GOPEntry(); … … 1754 1920 m_GOPList[0].m_numRefPicsActive = 4; 1755 1921 } 1756 #if SVC_EXTENSION 1757 } 1758 #endif 1759 1922 #endif 1760 1923 1761 1924 Bool verifiedGOP=false; … … 1790 1953 xConfirmPara( m_numLayers > MAX_LAYERS , "Number of layers in config file is greater than MAX_LAYERS" ); 1791 1954 m_numLayers = m_numLayers > MAX_LAYERS ? MAX_LAYERS : m_numLayers; 1792 1793 1955 1794 1956 // it can be updated after AVC BL support will be added to the WD … … 1827 1989 #endif 1828 1990 1829 m_extraRPSs=0; 1991 #if !Q0108_TSA_STSA 1992 m_extraRPSs = 0; 1993 #else 1994 memset( m_extraRPSs, 0, sizeof( m_extraRPSs ) ); 1995 #endif 1830 1996 //start looping through frames in coding order until we can verify that the GOP structure is correct. 1831 1997 while(!verifiedGOP&&!errorGOP) … … 1893 2059 { 1894 2060 //create a new GOPEntry for this frame containing all the reference pictures that were available (POC > 0) 2061 #if !Q0108_TSA_STSA 1895 2062 m_GOPList[m_iGOPSize+m_extraRPSs]=m_GOPList[curGOP]; 2063 #else 2064 m_GOPList[m_iGOPSize+m_extraRPSs[0]]=m_GOPList[curGOP]; 2065 #endif 1896 2066 Int newRefs=0; 1897 2067 for(Int i = 0; i< m_GOPList[curGOP].m_numRefPics; i++) … … 1900 2070 if(absPOC>=0) 1901 2071 { 2072 #if !Q0108_TSA_STSA 1902 2073 m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[newRefs]=m_GOPList[curGOP].m_referencePics[i]; 1903 2074 m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[newRefs]=m_GOPList[curGOP].m_usedByCurrPic[i]; 2075 #else 2076 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[newRefs]=m_GOPList[curGOP].m_referencePics[i]; 2077 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_usedByCurrPic[newRefs]=m_GOPList[curGOP].m_usedByCurrPic[i]; 2078 #endif 1904 2079 newRefs++; 1905 2080 } … … 1924 2099 for(Int i=0; i<newRefs; i++) 1925 2100 { 2101 #if !Q0108_TSA_STSA 1926 2102 if(m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[i]==offPOC-curPOC) 2103 #else 2104 if(m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[i]==offPOC-curPOC) 2105 #endif 1927 2106 { 1928 2107 newRef=false; … … 1939 2118 for(Int j=0; j<newRefs; j++) 1940 2119 { 2120 #if !Q0108_TSA_STSA 1941 2121 if(m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]<offPOC-curPOC||m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]>0) 2122 #else 2123 if(m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j]<offPOC-curPOC||m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j]>0) 2124 #endif 1942 2125 { 1943 2126 insertPoint = j; … … 1949 2132 for(Int j=insertPoint; j<newRefs+1; j++) 1950 2133 { 2134 #if !Q0108_TSA_STSA 1951 2135 Int newPrev = m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]; 1952 2136 Int newUsed = m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[j]; 1953 2137 m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]=prev; 1954 2138 m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[j]=prevUsed; 2139 #else 2140 Int newPrev = m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j]; 2141 Int newUsed = m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_usedByCurrPic[j]; 2142 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j]=prev; 2143 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_usedByCurrPic[j]=prevUsed; 2144 #endif 2145 1955 2146 prevUsed=newUsed; 1956 2147 prev=newPrev; … … 1964 2155 } 1965 2156 } 2157 #if !Q0108_TSA_STSA 1966 2158 m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefPics=newRefs; 1967 2159 m_GOPList[m_iGOPSize+m_extraRPSs].m_POC = curPOC; 2160 #else 2161 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_numRefPics=newRefs; 2162 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_POC = curPOC; 2163 #endif 2164 #if !Q0108_TSA_STSA 1968 2165 if (m_extraRPSs == 0) 1969 { 2166 #else 2167 if (m_extraRPSs[0] == 0) 2168 #endif 2169 { 2170 #if !Q0108_TSA_STSA 1970 2171 m_GOPList[m_iGOPSize+m_extraRPSs].m_interRPSPrediction = 0; 1971 2172 m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefIdc = 0; 2173 #else 2174 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_interRPSPrediction = 0; 2175 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_numRefIdc = 0; 2176 #endif 1972 2177 } 1973 2178 else 1974 2179 { 2180 #if !Q0108_TSA_STSA 1975 2181 Int rIdx = m_iGOPSize + m_extraRPSs - 1; 2182 #else 2183 Int rIdx = m_iGOPSize + m_extraRPSs[0] - 1; 2184 #endif 1976 2185 Int refPOC = m_GOPList[rIdx].m_POC; 1977 2186 Int refPics = m_GOPList[rIdx].m_numRefPics; … … 1982 2191 Int absPOCref = refPOC+deltaPOC; 1983 2192 Int refIdc = 0; 2193 #if !Q0108_TSA_STSA 1984 2194 for (Int j = 0; j < m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefPics; j++) 1985 2195 { … … 2006 2216 m_extraRPSs++; 2007 2217 } 2218 #else 2219 for (Int j = 0; j < m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_numRefPics; j++) 2220 { 2221 if ( (absPOCref - curPOC) == m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j]) 2222 { 2223 if (m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_usedByCurrPic[j]) 2224 { 2225 refIdc = 1; 2226 } 2227 else 2228 { 2229 refIdc = 2; 2230 } 2231 } 2232 } 2233 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_refIdc[newIdc]=refIdc; 2234 newIdc++; 2235 } 2236 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_interRPSPrediction = 1; 2237 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_numRefIdc = newIdc; 2238 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_deltaRPS = refPOC - m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_POC; 2239 } 2240 curGOP=m_iGOPSize+m_extraRPSs[0]; 2241 m_extraRPSs[0]++; 2242 } 2243 #endif 2244 2008 2245 numRefs=0; 2009 2246 for(Int i = 0; i< m_GOPList[curGOP].m_numRefPics; i++) … … 2022 2259 } 2023 2260 xConfirmPara(errorGOP,"Invalid GOP structure given"); 2261 2262 #if SVC_EXTENSION && Q0108_TSA_STSA 2263 for ( Int layerId = 1; layerId < m_numLayers; layerId++ ) 2264 { 2265 verifiedGOP=false; 2266 errorGOP=false; 2267 checkGOP=1; 2268 numRefs = m_isField ? 2 : 1; 2269 refList[0]=0; 2270 2271 if(m_isField) 2272 { 2273 refList[1] = 1; 2274 } 2275 2276 memset( isOK, 0, sizeof( isOK ) ); 2277 numOK=0; 2278 2279 for(Int i=0; i<m_iGOPSize; i++) 2280 { 2281 if(m_EhGOPList[layerId][i].m_POC==m_iGOPSize) 2282 { 2283 xConfirmPara( m_EhGOPList[layerId][i].m_temporalId!=0 , "The last frame in each GOP must have temporal ID = 0 " ); 2284 } 2285 } 2286 2287 xConfirmPara( m_numLayers > MAX_LAYERS , "Number of layers in config file is greater than MAX_LAYERS" ); 2288 m_numLayers = m_numLayers > MAX_LAYERS ? MAX_LAYERS : m_numLayers; 2289 2290 // verify layer configuration parameters 2291 for(UInt layer=0; layer<m_numLayers; layer++) 2292 { 2293 Int m_iIntraPeriod = m_acLayerCfg[layer].m_iIntraPeriod; 2294 if ( (m_iIntraPeriod != 1) && !m_loopFilterOffsetInPPS && m_DeblockingFilterControlPresent && (!m_bLoopFilterDisable) ) 2295 { 2296 for(Int i=0; i<m_iGOPSize; i++) 2297 { 2298 xConfirmPara( (m_EhGOPList[layerId][i].m_betaOffsetDiv2 + m_loopFilterBetaOffsetDiv2) < -6 || (m_EhGOPList[layerId][i].m_betaOffsetDiv2 + m_loopFilterBetaOffsetDiv2) > 6, "Loop Filter Beta Offset div. 2 for one of the GOP entries exceeds supported range (-6 to 6)" ); 2299 xConfirmPara( (m_EhGOPList[layerId][i].m_tcOffsetDiv2 + m_loopFilterTcOffsetDiv2) < -6 || (m_EhGOPList[layerId][i].m_tcOffsetDiv2 + m_loopFilterTcOffsetDiv2) > 6, "Loop Filter Tc Offset div. 2 for one of the GOP entries exceeds supported range (-6 to 6)" ); 2300 } 2301 } 2302 } 2303 2304 //start looping through frames in coding order until we can verify that the GOP structure is correct. 2305 while(!verifiedGOP&&!errorGOP) 2306 { 2307 Int curGOP = (checkGOP-1)%m_iGOPSize; 2308 Int curPOC = ((checkGOP-1)/m_iGOPSize)*m_iGOPSize + m_EhGOPList[layerId][curGOP].m_POC; 2309 if(m_EhGOPList[layerId][curGOP].m_POC<0) 2310 { 2311 printf("\nError: found fewer Reference Picture Sets than GOPSize\n"); 2312 errorGOP=true; 2313 } 2314 else 2315 { 2316 //check that all reference pictures are available, or have a POC < 0 meaning they might be available in the next GOP. 2317 Bool beforeI = false; 2318 for(Int i = 0; i< m_EhGOPList[layerId][curGOP].m_numRefPics; i++) 2319 { 2320 Int absPOC = curPOC+m_EhGOPList[layerId][curGOP].m_referencePics[i]; 2321 if(absPOC < 0) 2322 { 2323 beforeI=true; 2324 } 2325 else 2326 { 2327 Bool found=false; 2328 for(Int j=0; j<numRefs; j++) 2329 { 2330 if(refList[j]==absPOC) 2331 { 2332 found=true; 2333 for(Int k=0; k<m_iGOPSize; k++) 2334 { 2335 if(absPOC%m_iGOPSize == m_EhGOPList[layerId][k].m_POC%m_iGOPSize) 2336 { 2337 if(m_EhGOPList[layerId][k].m_temporalId==m_EhGOPList[layerId][curGOP].m_temporalId) 2338 { 2339 m_EhGOPList[layerId][k].m_refPic = true; 2340 } 2341 m_EhGOPList[layerId][curGOP].m_usedByCurrPic[i]=m_EhGOPList[layerId][k].m_temporalId<=m_EhGOPList[layerId][curGOP].m_temporalId; 2342 } 2343 } 2344 } 2345 } 2346 if(!found) 2347 { 2348 printf("\nError: ref pic %d is not available for GOP frame %d\n",m_EhGOPList[layerId][curGOP].m_referencePics[i],curGOP+1); 2349 errorGOP=true; 2350 } 2351 } 2352 } 2353 if(!beforeI&&!errorGOP) 2354 { 2355 //all ref frames were present 2356 if(!isOK[curGOP]) 2357 { 2358 numOK++; 2359 isOK[curGOP]=true; 2360 if(numOK==m_iGOPSize) 2361 { 2362 verifiedGOP=true; 2363 } 2364 } 2365 } 2366 else 2367 { 2368 //create a new GOPEntry for this frame containing all the reference pictures that were available (POC > 0) 2369 2370 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]]=m_EhGOPList[layerId][curGOP]; 2371 Int newRefs=0; 2372 for(Int i = 0; i< m_EhGOPList[layerId][curGOP].m_numRefPics; i++) 2373 { 2374 Int absPOC = curPOC+m_EhGOPList[layerId][curGOP].m_referencePics[i]; 2375 if(absPOC>=0) 2376 { 2377 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[newRefs]=m_EhGOPList[layerId][curGOP].m_referencePics[i]; 2378 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_usedByCurrPic[newRefs]=m_EhGOPList[layerId][curGOP].m_usedByCurrPic[i]; 2379 newRefs++; 2380 } 2381 } 2382 Int numPrefRefs = m_EhGOPList[layerId][curGOP].m_numRefPicsActive; 2383 2384 for(Int offset = -1; offset>-checkGOP; offset--) 2385 { 2386 //step backwards in coding order and include any extra available pictures we might find useful to replace the ones with POC < 0. 2387 Int offGOP = (checkGOP-1+offset)%m_iGOPSize; 2388 Int offPOC = ((checkGOP-1+offset)/m_iGOPSize)*m_iGOPSize + m_EhGOPList[layerId][offGOP].m_POC; 2389 if(offPOC>=0&&m_EhGOPList[layerId][offGOP].m_temporalId<=m_EhGOPList[layerId][curGOP].m_temporalId) 2390 { 2391 Bool newRef=false; 2392 for(Int i=0; i<numRefs; i++) 2393 { 2394 if(refList[i]==offPOC) 2395 { 2396 newRef=true; 2397 } 2398 } 2399 for(Int i=0; i<newRefs; i++) 2400 { 2401 if(m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[i]==offPOC-curPOC) 2402 { 2403 newRef=false; 2404 } 2405 } 2406 if(newRef) 2407 { 2408 Int insertPoint=newRefs; 2409 //this picture can be added, find appropriate place in list and insert it. 2410 if(m_EhGOPList[layerId][offGOP].m_temporalId==m_EhGOPList[layerId][curGOP].m_temporalId) 2411 { 2412 m_EhGOPList[layerId][offGOP].m_refPic = true; 2413 } 2414 for(Int j=0; j<newRefs; j++) 2415 { 2416 if(m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j]<offPOC-curPOC||m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j]>0) 2417 { 2418 insertPoint = j; 2419 break; 2420 } 2421 } 2422 Int prev = offPOC-curPOC; 2423 Int prevUsed = m_EhGOPList[layerId][offGOP].m_temporalId<=m_EhGOPList[layerId][curGOP].m_temporalId; 2424 for(Int j=insertPoint; j<newRefs+1; j++) 2425 { 2426 Int newPrev = m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j]; 2427 Int newUsed = m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_usedByCurrPic[j]; 2428 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j]=prev; 2429 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_usedByCurrPic[j]=prevUsed; 2430 prevUsed=newUsed; 2431 prev=newPrev; 2432 } 2433 newRefs++; 2434 } 2435 } 2436 if(newRefs>=numPrefRefs) 2437 { 2438 break; 2439 } 2440 } 2441 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_numRefPics=newRefs; 2442 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_POC = curPOC; 2443 if (m_extraRPSs[layerId] == 0) 2444 { 2445 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_interRPSPrediction = 0; 2446 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_numRefIdc = 0; 2447 } 2448 else 2449 { 2450 Int rIdx = m_iGOPSize + m_extraRPSs[layerId] - 1; 2451 Int refPOC = m_EhGOPList[layerId][rIdx].m_POC; 2452 Int refPics = m_EhGOPList[layerId][rIdx].m_numRefPics; 2453 Int newIdc=0; 2454 for(Int i = 0; i<= refPics; i++) 2455 { 2456 Int deltaPOC = ((i != refPics)? m_EhGOPList[layerId][rIdx].m_referencePics[i] : 0); // check if the reference abs POC is >= 0 2457 Int absPOCref = refPOC+deltaPOC; 2458 Int refIdc = 0; 2459 for (Int j = 0; j < m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_numRefPics; j++) 2460 { 2461 if ( (absPOCref - curPOC) == m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j]) 2462 { 2463 if (m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_usedByCurrPic[j]) 2464 { 2465 refIdc = 1; 2466 } 2467 else 2468 { 2469 refIdc = 2; 2470 } 2471 } 2472 } 2473 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_refIdc[newIdc]=refIdc; 2474 newIdc++; 2475 } 2476 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_interRPSPrediction = 1; 2477 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_numRefIdc = newIdc; 2478 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_deltaRPS = refPOC - m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_POC; 2479 } 2480 curGOP=m_iGOPSize+m_extraRPSs[layerId]; 2481 m_extraRPSs[layerId]++; 2482 } 2483 numRefs=0; 2484 for(Int i = 0; i< m_EhGOPList[layerId][curGOP].m_numRefPics; i++) 2485 { 2486 Int absPOC = curPOC+m_EhGOPList[layerId][curGOP].m_referencePics[i]; 2487 if(absPOC >= 0) 2488 { 2489 refList[numRefs]=absPOC; 2490 numRefs++; 2491 } 2492 } 2493 refList[numRefs]=curPOC; 2494 numRefs++; 2495 } 2496 checkGOP++; 2497 } 2498 xConfirmPara(errorGOP,"Invalid GOP structure given"); 2499 } 2500 #endif 2501 2024 2502 m_maxTempLayer = 1; 2025 2503 for(Int i=0; i<m_iGOPSize; i++) … … 2031 2509 xConfirmPara(m_GOPList[i].m_sliceType!='B'&&m_GOPList[i].m_sliceType!='P'&&m_GOPList[i].m_sliceType!='I', "Slice type must be equal to B or P or I"); 2032 2510 } 2511 2512 #if Q0108_TSA_STSA 2513 for ( Int layerId = 1; layerId < m_numLayers; layerId++) 2514 { 2515 m_EhMaxTempLayer[layerId] = 1; 2516 for(Int i=0; i<m_iGOPSize; i++) 2517 { 2518 if(m_EhGOPList[layerId][i].m_temporalId >= m_EhMaxTempLayer[layerId] ) 2519 { 2520 m_EhMaxTempLayer[layerId] = m_EhGOPList[layerId][i].m_temporalId; 2521 } 2522 xConfirmPara(m_GOPList[i].m_sliceType!='B'&&m_GOPList[i].m_sliceType!='P'&&m_GOPList[i].m_sliceType!='I', "Slice type must be equal to B or P or I"); 2523 } 2524 } 2525 #endif 2526 2033 2527 for(Int i=0; i<MAX_TLAYER; i++) 2034 2528 { … … 2195 2689 xConfirmPara( m_extendedWhiteLevelLumaCodeValue < m_nominalWhiteLevelLumaCodeValue, "SEIToneMapExtendedWhiteLevelLumaCodeValue shall be greater than or equal to SEIToneMapNominalWhiteLevelLumaCodeValue"); 2196 2690 } 2691 #if P0050_KNEE_FUNCTION_SEI 2692 if (m_kneeSEIEnabled && !m_kneeSEICancelFlag) 2693 { 2694 xConfirmPara( m_kneeSEINumKneePointsMinus1 < 0 || m_kneeSEINumKneePointsMinus1 > 998, "SEIKneeFunctionNumKneePointsMinus1 must be in the range of 0 to 998"); 2695 for ( UInt i=0; i<=m_kneeSEINumKneePointsMinus1; i++ ){ 2696 xConfirmPara( m_kneeSEIInputKneePoint[i] < 1 || m_kneeSEIInputKneePoint[i] > 999, "SEIKneeFunctionInputKneePointValue must be in the range of 1 to 999"); 2697 xConfirmPara( m_kneeSEIOutputKneePoint[i] < 0 || m_kneeSEIOutputKneePoint[i] > 1000, "SEIKneeFunctionInputKneePointValue must be in the range of 0 to 1000"); 2698 if ( i > 0 ) 2699 { 2700 xConfirmPara( m_kneeSEIInputKneePoint[i-1] >= m_kneeSEIInputKneePoint[i], "The i-th SEIKneeFunctionInputKneePointValue must be greather than the (i-1)-th value"); 2701 } 2702 } 2703 } 2704 #endif 2197 2705 2198 2706 #if RC_SHVC_HARMONIZATION … … 2234 2742 xConfirmPara(m_framePackingSEIType < 3 || m_framePackingSEIType > 5 , "SEIFramePackingType must be in rage 3 to 5"); 2235 2743 } 2744 2745 #if SVC_EXTENSION 2236 2746 #if VPS_EXTN_DIRECT_REF_LAYERS 2237 2747 xConfirmPara( (m_acLayerCfg[0].m_numSamplePredRefLayers != 0) && (m_acLayerCfg[0].m_numSamplePredRefLayers != -1), "Layer 0 cannot have any reference layers" ); … … 2304 2814 } 2305 2815 #endif 2306 #if N0120_MAX_TID_REF_CFG2307 2816 for (UInt layer=0; layer < MAX_LAYERS-1; layer++) 2308 2817 { 2309 2818 xConfirmPara(m_acLayerCfg[layer].m_maxTidIlRefPicsPlus1 < 0 || m_acLayerCfg[layer].m_maxTidIlRefPicsPlus1 > 7, "MaxTidIlRefPicsPlus1 must be in range 0 to 7"); 2310 2819 } 2311 #endif2312 2820 #if AUXILIARY_PICTURES 2313 2821 for (UInt layer=0; layer < MAX_LAYERS-1; layer++) … … 2320 2828 xConfirmPara( m_nCGSFlag < 0 || m_nCGSFlag > 1 , "0<=CGS<=1" ); 2321 2829 #endif 2830 #endif //SVC_EXTENSION 2322 2831 #undef xConfirmPara 2323 2832 if (check_failed) … … 2397 2906 #if SVC_EXTENSION 2398 2907 printf("Total number of layers : %d\n", m_numLayers ); 2399 #if SCALABILITY_MASK_E0104 2400 printf("Multiview : %d\n", m_scalabilityMask[1] ); 2401 printf("Scalable : %d\n", m_scalabilityMask[2] ); 2908 printf("Multiview : %d\n", m_scalabilityMask[VIEW_ORDER_INDEX] ); 2909 printf("Scalable : %d\n", m_scalabilityMask[SCALABILITY_ID] ); 2402 2910 #if AVC_BASE 2403 2911 printf("Base layer : %s\n", m_avcBaseLayerFlag ? "AVC" : "HEVC"); 2404 2912 #endif 2405 2913 #if AUXILIARY_PICTURES 2406 printf("Auxiliary pictures : %d\n", m_scalabilityMask[3] ); 2407 #endif 2408 #else 2409 printf("Multiview : %d\n", m_scalabilityMask[0] ); 2410 printf("Scalable : %d\n", m_scalabilityMask[1] ); 2914 printf("Auxiliary pictures : %d\n", m_scalabilityMask[AUX_ID] ); 2411 2915 #endif 2412 2916 #if M0040_ADAPTIVE_RESOLUTION_CHANGE … … 2419 2923 printf("Align picture type : %d\n", m_crossLayerPictureTypeAlignFlag ); 2420 2924 #endif 2421 #if N0147_IRAP_ALIGN_FLAG2422 2925 printf("Cross layer IRAP alignment : %d\n", m_crossLayerIrapAlignFlag ); 2423 #endif2424 2926 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 2425 2927 printf("IDR only for IRAP : %d\n", m_crossLayerAlignedIdrOnlyFlag ); -
TabularUnified trunk/source/App/TAppEncoder/TAppEncCfg.h ¶
r713 r815 73 73 Char* m_BLSyntaxFile; ///< input syntax file 74 74 #endif 75 #if N0120_MAX_TID_REF_CFG76 75 Bool m_maxTidRefPresentFlag; 77 #endif 76 #if Q0078_ADD_LAYER_SETS 77 Int m_numLayerSets; 78 Int m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1]; 79 Int m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 80 Int m_numAddLayerSets; 81 Int m_numHighestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1]; 82 Int m_highestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 83 #endif 78 84 #else 79 85 Char* m_pchInputFile; ///< source file name … … 119 125 Int m_iDecodingRefreshType; ///< random access type 120 126 Int m_iGOPSize; ///< GOP size of hierarchical structure 127 128 #if !Q0108_TSA_STSA 121 129 Int m_extraRPSs; ///< extra RPSs added to handle CRA 130 #else 131 Int m_extraRPSs[MAX_LAYERS]; ///< extra RPSs added to handle CRA 132 #endif 133 122 134 GOPEntry m_GOPList[MAX_GOP]; ///< the coding structure entries from the config file 135 #if Q0108_TSA_STSA 136 GOPEntry m_EhGOPList[MAX_LAYERS][MAX_GOP]; ///< the enhancement layer coding structure entries from the config file 137 Int m_inheritCodingStruct[MAX_LAYERS]; 138 #endif 139 123 140 Int m_numReorderPics[MAX_TLAYER]; ///< total number of reorder pictures 124 141 Int m_maxDecPicBuffering[MAX_TLAYER]; ///< total number of pictures in the decoded picture buffer … … 148 165 149 166 Int m_maxTempLayer; ///< Max temporal layer 167 #if Q0108_TSA_STSA 168 Int m_EhMaxTempLayer[MAX_LAYERS]; ///< Max temporal layer 169 #endif 150 170 151 171 #if !LAYER_CTB … … 285 305 Int m_SOPDescriptionSEIEnabled; 286 306 Int m_scalableNestingSEIEnabled; 307 #if Q0189_TMVP_CONSTRAINTS 308 Int m_TMVPConstraintsSEIEnabled; 309 #endif 287 310 // weighted prediction 288 311 Bool m_useWeightedPred; ///< Use of weighted prediction in P slices … … 363 386 Void xPrintParameter (); ///< print configuration values 364 387 Void xPrintUsage (); ///< print usage 388 #if SVC_EXTENSION 365 389 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 366 390 Int m_adaptiveResolutionChange; ///< Indicate adaptive resolution change frame … … 386 410 Bool m_crossLayerPictureTypeAlignFlag; 387 411 #endif 388 #if N0147_IRAP_ALIGN_FLAG389 412 Bool m_crossLayerIrapAlignFlag; 413 #if P0050_KNEE_FUNCTION_SEI 414 Bool m_kneeSEIEnabled; 415 Int m_kneeSEIId; 416 Bool m_kneeSEICancelFlag; 417 Bool m_kneeSEIPersistenceFlag; 418 Bool m_kneeSEIMappingFlag; 419 Int m_kneeSEIInputDrange; 420 Int m_kneeSEIInputDispLuminance; 421 Int m_kneeSEIOutputDrange; 422 Int m_kneeSEIOutputDispLuminance; 423 Int m_kneeSEINumKneePointsMinus1; 424 Int* m_kneeSEIInputKneePoint; 425 Int* m_kneeSEIOutputKneePoint; 390 426 #endif 391 427 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG … … 404 440 Int m_nCGSLUTBit; 405 441 #endif 442 #endif //SVC_EXTENSION 406 443 public: 407 444 TAppEncCfg(); -
TabularUnified trunk/source/App/TAppEncoder/TAppEncLayerCfg.h ¶
r713 r815 83 83 #endif 84 84 85 #if N0120_MAX_TID_REF_CFG86 85 Int m_maxTidIlRefPicsPlus1; 87 #endif88 86 Int m_iWaveFrontSubstreams; //< If iWaveFrontSynchro, this is the number of substreams per frame (dependent tiles) or per tile (independent tiles). 89 87 … … 181 179 Void setSourceHeight(Int x) { m_iSourceHeight = x; } 182 180 #endif 183 #if N0120_MAX_TID_REF_CFG184 181 Int getMaxTidIlRefPicsPlus1() { return m_maxTidIlRefPicsPlus1; } 185 #endif186 182 #if LAYER_CTB 187 183 UInt getMaxCUWidth() {return m_uiMaxCUWidth; } -
TabularUnified trunk/source/App/TAppEncoder/TAppEncTop.cpp ¶
r713 r815 82 82 vps->setTemporalNestingFlag(true); 83 83 } 84 #if !VPS_RENAME85 vps.setMaxLayers ( 1 );86 #endif87 84 for(Int i = 0; i < MAX_TLAYER; i++) 88 85 { … … 190 187 delete [] mapIdxToLayer; 191 188 #endif 189 190 assert( m_numLayers <= MAX_LAYERS ); 192 191 193 192 for(UInt layer=0; layer<m_numLayers; layer++) … … 241 240 m_acTEncTop[layer].setDecodingRefreshType ( m_iDecodingRefreshType ); 242 241 m_acTEncTop[layer].setGOPSize ( m_iGOPSize ); 242 #if Q0108_TSA_STSA 243 m_acTEncTop[layer].setGopList ( layer ? m_EhGOPList[layer] : m_GOPList ); 244 #else 243 245 m_acTEncTop[layer].setGopList ( m_GOPList ); 244 246 #endif 247 248 #if !Q0108_TSA_STSA 245 249 m_acTEncTop[layer].setExtraRPSs ( m_extraRPSs ); 250 #else 251 m_acTEncTop[layer].setExtraRPSs ( m_extraRPSs[layer] ); 252 #endif 246 253 for(Int i = 0; i < MAX_TLAYER; i++) 247 254 { … … 256 263 257 264 m_acTEncTop[layer].setPad ( m_acLayerCfg[layer].getPad() ); 258 265 #if !Q0108_TSA_STSA 259 266 m_acTEncTop[layer].setMaxTempLayer ( m_maxTempLayer ); 267 #else 268 if (layer== 0) 269 { 270 m_acTEncTop[layer].setMaxTempLayer ( m_maxTempLayer ); 271 } 272 else 273 { 274 m_acTEncTop[layer].setMaxTempLayer ( m_EhMaxTempLayer[layer] ); 275 } 276 #endif 260 277 m_acTEncTop[layer].setUseAMP( m_enableAMP ); 261 #if N0120_MAX_TID_REF_CFG 262 if (layer<m_numLayers-1)278 279 if( layer < m_numLayers - 1 ) 263 280 { 264 281 m_acTEncTop[layer].setMaxTidIlRefPicsPlus1 ( m_acLayerCfg[layer].getMaxTidIlRefPicsPlus1()); 265 282 } 266 #endif 283 267 284 #if VPS_EXTN_DIRECT_REF_LAYERS 268 285 if(layer) … … 306 323 } 307 324 Int numDirectRefLayers = 0; 325 326 assert( layer < MAX_LAYERS ); 327 308 328 for (Int i = 0; i < layer; i++) 309 329 { … … 480 500 m_acTEncTop[layer].setTMISEINominalWhiteLevelLumaCodeValue ( m_nominalWhiteLevelLumaCodeValue ); 481 501 m_acTEncTop[layer].setTMISEIExtendedWhiteLevelLumaCodeValue ( m_extendedWhiteLevelLumaCodeValue ); 502 #if P0050_KNEE_FUNCTION_SEI 503 m_acTEncTop[layer].setKneeSEIEnabled ( m_kneeSEIEnabled ); 504 m_acTEncTop[layer].setKneeSEIId ( m_kneeSEIId ); 505 m_acTEncTop[layer].setKneeSEICancelFlag ( m_kneeSEICancelFlag ); 506 m_acTEncTop[layer].setKneeSEIPersistenceFlag ( m_kneeSEIPersistenceFlag ); 507 m_acTEncTop[layer].setKneeSEIMappingFlag ( m_kneeSEIMappingFlag ); 508 m_acTEncTop[layer].setKneeSEIInputDrange ( m_kneeSEIInputDrange ); 509 m_acTEncTop[layer].setKneeSEIInputDispLuminance ( m_kneeSEIInputDispLuminance ); 510 m_acTEncTop[layer].setKneeSEIOutputDrange ( m_kneeSEIOutputDrange ); 511 m_acTEncTop[layer].setKneeSEIOutputDispLuminance ( m_kneeSEIOutputDispLuminance ); 512 m_acTEncTop[layer].setKneeSEINumKneePointsMinus1 ( m_kneeSEINumKneePointsMinus1 ); 513 m_acTEncTop[layer].setKneeSEIInputKneePoint ( m_kneeSEIInputKneePoint ); 514 m_acTEncTop[layer].setKneeSEIOutputKneePoint ( m_kneeSEIOutputKneePoint ); 515 #endif 482 516 #if Q0074_SEI_COLOR_MAPPING 483 517 m_acTEncTop[layer].setColorMappingInfoSEIFile ( m_acLayerCfg[layer].m_cSeiColorMappingFile.empty() ? NULL : const_cast<Char *>(m_acLayerCfg[layer].m_cSeiColorMappingFile.c_str()) ); … … 497 531 m_acTEncTop[layer].setSOPDescriptionSEIEnabled( m_SOPDescriptionSEIEnabled ); 498 532 m_acTEncTop[layer].setScalableNestingSEIEnabled( m_scalableNestingSEIEnabled ); 533 #if Q0189_TMVP_CONSTRAINTS 534 m_acTEncTop[layer].setTMVPConstraintsSEIEnabled( m_TMVPConstraintsSEIEnabled); 535 #endif 499 536 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 500 537 m_acTEncTop[layer].setInterLayerConstrainedTileSetsSEIEnabled( m_interLayerConstrainedTileSetsSEIEnabled ); … … 614 651 m_acTEncTop[layer].setCGSLUTBit( m_nCGSLUTBit ); 615 652 #endif 653 #if Q0078_ADD_LAYER_SETS 654 m_acTEncTop[layer].setNumAddLayerSets( m_numAddLayerSets ); 655 #endif 616 656 } 617 657 } … … 799 839 m_cTEncTop.setTMISEINominalWhiteLevelLumaCodeValue ( m_nominalWhiteLevelLumaCodeValue ); 800 840 m_cTEncTop.setTMISEIExtendedWhiteLevelLumaCodeValue ( m_extendedWhiteLevelLumaCodeValue ); 841 #if P0050_KNEE_FUNCTION_SEI 842 m_cTEncTop.setKneeSEIEnabled ( m_kneeSEIEnabled ); 843 m_cTEncTop.setKneeSEIId ( m_kneeSEIId ); 844 m_cTEncTop.setKneeSEICancelFlag ( m_kneeSEICancelFlag ); 845 m_cTEncTop.setKneeSEIPersistenceFlag ( m_kneeSEIPersistenceFlag ); 846 m_cTEncTop.setKneeSEIMappingFlag ( m_kneeSEIMappingFlag ); 847 m_cTEncTop.setKneeSEIInputDrange ( m_kneeSEIInputDrange ); 848 m_cTEncTop.setKneeSEIInputDispLuminance ( m_kneeSEIInputDispLuminance ); 849 m_cTEncTop.setKneeSEIOutputDrange ( m_kneeSEIOutputDrange ); 850 m_cTEncTop.setKneeSEIOutputDispLuminance ( m_kneeSEIOutputDispLuminance ); 851 m_cTEncTop.setKneeSEINumKneePointsMinus1 ( m_kneeSEINumKneePointsMinus1 ); 852 m_cTEncTop.setKneeSEIInputKneePoint ( m_kneeSEIInputKneePoint ); 853 m_cTEncTop.setKneeSEIOutputKneePoint ( m_kneeSEIOutputKneePoint ); 854 #endif 801 855 #if Q0074_SEI_COLOR_MAPPING 802 856 m_cTEncTop.setColorMappingInfoSEIFile ( m_pchSEIColorMappingFile ); … … 994 1048 #endif 995 1049 } 996 #if VPS_RENAME997 1050 m_acTEncTop[0].getVPS()->setMaxLayers( m_numLayers ); 998 #endif999 1051 #if VPS_EXTN_OP_LAYER_SETS 1000 1052 TComVPS* vps = m_acTEncTop[0].getVPS(); … … 1003 1055 vps->setVpsExtensionFlag( m_numLayers > 1 ? true : false ); 1004 1056 1005 vps->setNumLayerSets(m_numLayers); 1006 for(Int setId = 1; setId < vps->getNumLayerSets(); setId++) 1007 { 1008 for(Int layerId = 0; layerId <= vps->getMaxLayerId(); layerId++) 1009 { 1057 #if Q0078_ADD_LAYER_SETS 1058 if (m_numLayerSets > 0) 1059 { 1060 vps->setNumLayerSets(m_numLayerSets+1); 1061 for (Int setId = 1; setId < vps->getNumLayerSets(); setId++) 1062 { 1063 for (Int layerId = 0; layerId <= vps->getMaxLayerId(); layerId++) 1064 { 1065 vps->setLayerIdIncludedFlag(false, setId, layerId); 1066 } 1067 } 1068 for (Int setId = 1; setId < vps->getNumLayerSets(); setId++) 1069 { 1070 for (Int i = 0; i < m_numLayerInIdList[setId-1]; i++) 1071 { 1072 Int layerId = m_layerSetLayerIdList[setId-1][i]; 1073 1010 1074 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1011 //4 1012 g_bitDepthY = m_acLayerCfg[layerId].m_internalBitDepthY; 1013 g_bitDepthC = m_acLayerCfg[layerId].m_internalBitDepthC; 1014 1015 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthY : m_acLayerCfg[layerId].m_internalBitDepthY; 1016 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthC : m_acLayerCfg[layerId].m_internalBitDepthC; 1017 #endif 1018 if( layerId <= setId ) 1019 { 1075 //4 1076 g_bitDepthY = m_acLayerCfg[layerId].m_internalBitDepthY; 1077 g_bitDepthC = m_acLayerCfg[layerId].m_internalBitDepthC; 1078 1079 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthY : m_acLayerCfg[layerId].m_internalBitDepthY; 1080 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthC : m_acLayerCfg[layerId].m_internalBitDepthC; 1081 #endif 1082 1020 1083 vps->setLayerIdIncludedFlag(true, setId, layerId); 1021 1084 } 1022 else 1023 { 1024 vps->setLayerIdIncludedFlag(false, setId, layerId); 1025 } 1026 } 1027 } 1085 } 1086 } 1087 else 1088 { 1089 // Default layer sets 1090 #endif 1091 vps->setNumLayerSets(m_numLayers); 1092 for (Int setId = 1; setId < vps->getNumLayerSets(); setId++) 1093 { 1094 for (Int layerId = 0; layerId <= vps->getMaxLayerId(); layerId++) 1095 { 1096 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1097 //4 1098 g_bitDepthY = m_acLayerCfg[layerId].m_internalBitDepthY; 1099 g_bitDepthC = m_acLayerCfg[layerId].m_internalBitDepthC; 1100 1101 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthY : m_acLayerCfg[layerId].m_internalBitDepthY; 1102 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthC : m_acLayerCfg[layerId].m_internalBitDepthC; 1103 #endif 1104 if (layerId <= setId) 1105 { 1106 vps->setLayerIdIncludedFlag(true, setId, layerId); 1107 } 1108 else 1109 { 1110 vps->setLayerIdIncludedFlag(false, setId, layerId); 1111 } 1112 } 1113 } 1114 #if Q0078_ADD_LAYER_SETS 1115 } 1116 #endif 1117 #if Q0078_ADD_LAYER_SETS 1118 vps->setVpsNumLayerSetsMinus1(vps->getNumLayerSets() - 1); 1119 vps->setNumAddLayerSets(m_numAddLayerSets); 1120 vps->setNumLayerSets(vps->getNumLayerSets() + vps->getNumAddLayerSets()); 1121 if (m_numAddLayerSets > 0) 1122 { 1123 for (Int setId = 0; setId < m_numAddLayerSets; setId++) 1124 { 1125 for (Int j = 0; j < m_numHighestLayerIdx[setId]; j++) 1126 { 1127 vps->setHighestLayerIdxPlus1(setId, j + 1, m_highestLayerIdx[setId][j] + 1); 1128 } 1129 } 1130 } 1131 #endif 1028 1132 #if VPS_EXTN_MASK_AND_DIM_INFO 1029 1133 UInt i = 0, dimIdLen = 0; … … 1097 1201 #if VPS_TSLAYERS 1098 1202 vps->setMaxTSLayersPresentFlag(true); 1203 1099 1204 for( i = 0; i < vps->getMaxLayers(); i++ ) 1100 1205 { … … 1102 1207 } 1103 1208 #endif 1104 #if N0120_MAX_TID_REF_PRESENT_FLAG1105 #if N0120_MAX_TID_REF_CFG1106 1209 vps->setMaxTidRefPresentFlag(m_maxTidRefPresentFlag); 1107 #else1108 vps->setMaxTidRefPresentFlag(true);1109 #endif1110 1210 if (vps->getMaxTidRefPresentFlag()) 1111 1211 { 1112 1212 for( i = 0; i < vps->getMaxLayers() - 1; i++ ) 1113 1213 { 1114 #if N0120_MAX_TID_REF_CFG1115 1214 #if O0225_MAX_TID_FOR_REF_LAYERS 1116 1215 for( Int j = i+1; j < vps->getMaxLayers(); j++) … … 1121 1220 vps->setMaxTidIlRefPicsPlus1(i, m_acTEncTop[i].getMaxTidIlRefPicsPlus1()); 1122 1221 #endif 1123 #else 1222 } 1223 } 1224 else 1225 { 1226 for( i = 0; i < vps->getMaxLayers() - 1; i++ ) 1227 { 1124 1228 #if O0225_MAX_TID_FOR_REF_LAYERS 1125 1229 for( Int j = i+1; j < vps->getMaxLayers(); j++) 1126 1230 { 1127 vps->setMaxTidIlRefPicsPlus1(i, j, vps->getMaxTLayers()+1);1128 }1129 #else1130 vps->setMaxTidIlRefPicsPlus1(i, vps->getMaxTLayers()+1);1131 #endif1132 #endif1133 }1134 }1135 else1136 {1137 for( i = 0; i < vps->getMaxLayers() - 1; i++ )1138 {1139 #if O0225_MAX_TID_FOR_REF_LAYERS1140 for( Int j = i+1; j < vps->getMaxLayers(); j++)1141 {1142 1231 vps->setMaxTidIlRefPicsPlus1(i, j, 7); 1143 1232 } … … 1147 1236 } 1148 1237 } 1149 #endif1150 #if ILP_SSH_SIG1151 #if ILP_SSH_SIG_FIX1152 1238 vps->setIlpSshSignalingEnabledFlag(false); 1153 #else1154 vps->setIlpSshSignalingEnabledFlag(true);1155 #endif1156 #endif1157 1239 #if VPS_EXTN_PROFILE_INFO 1158 1240 vps->getPTLForExtnPtr()->resize(vps->getNumLayerSets()); … … 1162 1244 // Note - may need to be changed for other layer structures. 1163 1245 *(vps->getPTLForExtn(setId)) = *(m_acTEncTop[setId].getSPS()->getPTL()); 1164 }1165 #endif1166 // Target output layer1167 vps->setNumOutputLayerSets(vps->getNumLayerSets());1168 vps->setNumProfileTierLevel(vps->getNumLayerSets());1169 #if P0295_DEFAULT_OUT_LAYER_IDC1170 vps->setDefaultTargetOutputLayerIdc(1);1171 #else1172 #if O0109_DEFAULT_ONE_OUT_LAYER_IDC1173 vps->setDefaultOneTargetOutputLayerIdc(1);1174 #else1175 vps->setDefaultOneTargetOutputLayerFlag(true);1176 #endif1177 #endif1178 for(i = 1; i < vps->getNumLayerSets(); i++)1179 {1180 vps->setProfileLevelTierIdx(i, i);1181 vps->setOutputLayerSetIdx(i, i);1182 }1183 #endif1184 #if VPS_DPB_SIZE_TABLE1185 // The Layer ID List variables can be derived here.1186 #if DERIVE_LAYER_ID_LIST_VARIABLES1187 vps->deriveLayerIdListVariables();1188 #endif1189 #if RESOLUTION_BASED_DPB1190 vps->assignSubDpbIndices();1191 #else1192 vps->deriveNumberOfSubDpbs();1193 #endif1194 1195 // derive OutputLayerFlag[i][j]1196 if( vps->getDefaultTargetOutputLayerIdc() == 1 )1197 {1198 // default_target_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 and1199 // 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.1200 1201 // Include the highest layer as output layer for each layer set1202 for(Int lsIdx = 1; lsIdx < vps->getNumLayerSets(); lsIdx++)1203 {1204 for( UInt layer = 0; layer < vps->getNumLayersInIdList(lsIdx); layer++ )1205 {1206 if( vps->getLayerIdIncludedFlag(lsIdx, layer) )1207 {1208 vps->setOutputLayerFlag( lsIdx, layer, layer == vps->getNumLayersInIdList(lsIdx) - 1 );1209 }1210 }1211 }1212 }1213 else1214 {1215 // cases when default_target_output_layer_idc is not equal to 11216 assert(!"default_target_output_layer_idc not equal to 1 is not yet supported");1217 }1218 1219 // Initialize dpb_size_table() for all ouput layer sets in the VPS extension1220 for(i = 1; i < vps->getNumOutputLayerSets(); i++)1221 {1222 #if CHANGE_NUMSUBDPB_IDX1223 Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx( i );1224 #endif1225 Int layerSetId = vps->getOutputLayerSetIdx(i);1226 1227 for(Int j = 0; j < vps->getMaxTLayers(); j++)1228 {1229 1230 Int maxNumReorderPics = -1;1231 #if CHANGE_NUMSUBDPB_IDX1232 #if RESOLUTION_BASED_DPB1233 for(Int k = 0; k < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet); k++)1234 #else1235 for(Int k = 0; k < vps->getNumSubDpbs(layerSetIdxForOutputLayerSet); k++)1236 #endif1237 #else1238 for(Int k = 0; k < vps->getNumSubDpbs(i); k++)1239 #endif1240 {1241 Int layerId = vps->getLayerSetLayerIdList(layerSetId, k); // k-th layer in the output layer set1242 #if RESOLUTION_BASED_DPB1243 vps->setMaxVpsLayerDecPicBuffMinus1( i, k, j, m_acTEncTop[layerId].getMaxDecPicBuffering(j) - 1 );1244 // Add sub-DPB sizes of layers belonging to a sub-DPB. If a different sub-DPB size is calculated1245 // at the encoder, modify below1246 Int oldValue = vps->getMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j );1247 oldValue += vps->getMaxVpsLayerDecPicBuffMinus1( i, k, j ) + 1;1248 vps->setMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j, oldValue );1249 #else1250 vps->setMaxVpsDecPicBufferingMinus1( i, k, j, m_acTEncTop[layerId].getMaxDecPicBuffering(j) - 1 );1251 #endif1252 maxNumReorderPics = std::max( maxNumReorderPics, m_acTEncTop[layerId].getNumReorderPics(j));1253 }1254 #if RESOLUTION_BASED_DPB1255 for(Int k = 0; k < vps->getNumSubDpbs(i); k++)1256 {1257 // Decrement m_maxVpsDecPicBufferingMinus11258 Int oldValue = vps->getMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j );1259 vps->setMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j, oldValue - 1 );1260 }1261 #endif1262 vps->setMaxVpsNumReorderPics(i, j, maxNumReorderPics);1263 vps->determineSubDpbInfoFlags();1264 }1265 1246 } 1266 1247 #endif … … 1271 1252 Bool isDefaultDirectDependencyTypeSet = false; 1272 1253 #endif 1273 for (UInt layerCtr = 1;layerCtr <= vps->getMaxLayers() - 1; layerCtr++)1274 { 1275 vps->setNumDirectRefLayers( layerCtr, m_acTEncTop[layerCtr].getNumDirectRefLayers());1276 maxDirectRefLayers = max<UInt>( maxDirectRefLayers, vps->getNumDirectRefLayers( layerCtr ));1277 1278 for (i = 0; i < vps->getNumDirectRefLayers(layerCtr); i++)1279 { 1280 vps->setRefLayerId( layerCtr, i, m_acTEncTop[layerCtr].getRefLayerId(i));1254 for (UInt layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++) 1255 { 1256 vps->setNumDirectRefLayers(layerCtr, m_acTEncTop[layerCtr].getNumDirectRefLayers()); 1257 maxDirectRefLayers = max<UInt>(maxDirectRefLayers, vps->getNumDirectRefLayers(layerCtr)); 1258 1259 for (i = 0; i < vps->getNumDirectRefLayers(layerCtr); i++) 1260 { 1261 vps->setRefLayerId(layerCtr, i, m_acTEncTop[layerCtr].getRefLayerId(i)); 1281 1262 } 1282 1263 // Set direct dependency flag 1283 1264 // Initialize flag to 0 1284 for (Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++)1285 { 1286 vps->setDirectDependencyFlag( layerCtr, refLayerCtr, false);1287 } 1288 for (i = 0; i < vps->getNumDirectRefLayers(layerCtr); i++)1289 { 1290 vps->setDirectDependencyFlag( 1265 for (Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++) 1266 { 1267 vps->setDirectDependencyFlag(layerCtr, refLayerCtr, false); 1268 } 1269 for (i = 0; i < vps->getNumDirectRefLayers(layerCtr); i++) 1270 { 1271 vps->setDirectDependencyFlag(layerCtr, vps->getLayerIdInVps(m_acTEncTop[layerCtr].getRefLayerId(i)), true); 1291 1272 } 1292 1273 // prediction indications 1293 1274 vps->setDirectDepTypeLen(2); // sample and motion types are encoded 1294 for (Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++)1295 { 1296 if (vps->getDirectDependencyFlag( 1275 for (Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++) 1276 { 1277 if (vps->getDirectDependencyFlag(layerCtr, refLayerCtr)) 1297 1278 { 1298 1279 assert(m_acTEncTop[layerCtr].getSamplePredEnabledFlag(refLayerCtr) || m_acTEncTop[layerCtr].getMotionPredEnabledFlag(refLayerCtr)); 1299 vps->setDirectDependencyType( 1300 1280 vps->setDirectDependencyType(layerCtr, refLayerCtr, ((m_acTEncTop[layerCtr].getSamplePredEnabledFlag(refLayerCtr) ? 1 : 0) | 1281 (m_acTEncTop[layerCtr].getMotionPredEnabledFlag(refLayerCtr) ? 2 : 0)) - 1); 1301 1282 #if O0096_DEFAULT_DEPENDENCY_TYPE 1302 1283 if (!isDefaultDirectDependencyTypeSet) … … 1314 1295 else 1315 1296 { 1316 vps->setDirectDependencyType( layerCtr, refLayerCtr, 0);1297 vps->setDirectDependencyType(layerCtr, refLayerCtr, 0); 1317 1298 } 1318 1299 } … … 1320 1301 1321 1302 #if O0092_0094_DEPENDENCY_CONSTRAINT 1322 for(UInt layerCtr = 1;layerCtr <= vps->getMaxLayers() - 1; layerCtr++) 1323 { 1324 vps->setNumRefLayers(vps->getLayerIdInNuh(layerCtr)); // identify the number of direct and indirect reference layers of current layer and set recursiveRefLayersFlags 1325 } 1326 if(vps->getMaxLayers() > MAX_REF_LAYERS) 1327 { 1328 for(UInt layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++) 1329 { 1330 assert( vps->getNumRefLayers(vps->getLayerIdInNuh(layerCtr)) <= MAX_REF_LAYERS); 1331 } 1332 } 1333 #endif 1303 vps->setNumRefLayers(); 1304 1305 if (vps->getMaxLayers() > MAX_REF_LAYERS) 1306 { 1307 for (UInt layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++) 1308 { 1309 assert(vps->getNumRefLayers(vps->getLayerIdInNuh(layerCtr)) <= MAX_REF_LAYERS); 1310 } 1311 } 1312 #endif 1313 #if Q0078_ADD_LAYER_SETS 1314 vps->setPredictedLayerIds(); 1315 vps->setTreePartitionLayerIdList(); 1316 vps->setLayerIdIncludedFlagsForAddLayerSets(); 1317 #endif 1318 #endif 1319 // Target output layer 1320 vps->setNumOutputLayerSets(vps->getNumLayerSets()); 1321 vps->setNumProfileTierLevel(vps->getNumLayerSets()); 1322 #if P0295_DEFAULT_OUT_LAYER_IDC 1323 vps->setDefaultTargetOutputLayerIdc(1); 1324 #else 1325 #if O0109_DEFAULT_ONE_OUT_LAYER_IDC 1326 vps->setDefaultOneTargetOutputLayerIdc(1); 1327 #else 1328 vps->setDefaultOneTargetOutputLayerFlag(true); 1329 #endif 1330 #endif 1331 for(i = 1; i < vps->getNumLayerSets(); i++) 1332 { 1333 vps->setProfileLevelTierIdx(i, i); 1334 vps->setOutputLayerSetIdx(i, i); 1335 } 1336 #endif 1337 #if VPS_DPB_SIZE_TABLE 1338 // The Layer ID List variables can be derived here. 1339 #if DERIVE_LAYER_ID_LIST_VARIABLES 1340 vps->deriveLayerIdListVariables(); 1341 #endif 1342 #if RESOLUTION_BASED_DPB 1343 vps->assignSubDpbIndices(); 1344 #else 1345 vps->deriveNumberOfSubDpbs(); 1346 #endif 1347 1348 // derive OutputLayerFlag[i][j] 1349 if( vps->getDefaultTargetOutputLayerIdc() == 1 ) 1350 { 1351 // 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 1352 // 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. 1353 1354 // Include the highest layer as output layer for each layer set 1355 for(Int lsIdx = 1; lsIdx < vps->getNumLayerSets(); lsIdx++) 1356 { 1357 for( UInt layer = 0; layer < vps->getNumLayersInIdList(lsIdx); layer++ ) 1358 { 1359 #if !Q0078_ADD_LAYER_SETS // the following condition is incorrect and is not needed anyway 1360 if( vps->getLayerIdIncludedFlag(lsIdx, layer) ) 1361 #endif 1362 { 1363 vps->setOutputLayerFlag( lsIdx, layer, layer == vps->getNumLayersInIdList(lsIdx) - 1 ); 1364 } 1365 } 1366 } 1367 } 1368 else 1369 { 1370 // cases when default_output_layer_idc is not equal to 1 1371 assert(!"default_output_layer_idc not equal to 1 is not yet supported"); 1372 } 1373 1374 // Initialize dpb_size_table() for all ouput layer sets in the VPS extension 1375 for(i = 1; i < vps->getNumOutputLayerSets(); i++) 1376 { 1377 #if CHANGE_NUMSUBDPB_IDX 1378 Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx( i ); 1379 #endif 1380 Int layerSetId = vps->getOutputLayerSetIdx(i); 1381 1382 for(Int j = 0; j < vps->getMaxTLayers(); j++) 1383 { 1384 1385 Int maxNumReorderPics = -1; 1386 #if CHANGE_NUMSUBDPB_IDX 1387 #if RESOLUTION_BASED_DPB 1388 for(Int k = 0; k < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet); k++) 1389 #else 1390 for(Int k = 0; k < vps->getNumSubDpbs(layerSetIdxForOutputLayerSet); k++) 1391 #endif 1392 #else 1393 for(Int k = 0; k < vps->getNumSubDpbs(i); k++) 1394 #endif 1395 { 1396 Int layerId = vps->getLayerSetLayerIdList(layerSetId, k); // k-th layer in the output layer set 1397 #if RESOLUTION_BASED_DPB 1398 vps->setMaxVpsLayerDecPicBuffMinus1( i, k, j, m_acTEncTop[layerId].getMaxDecPicBuffering(j) - 1 ); 1399 // Add sub-DPB sizes of layers belonging to a sub-DPB. If a different sub-DPB size is calculated 1400 // at the encoder, modify below 1401 Int oldValue = vps->getMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j ); 1402 oldValue += vps->getMaxVpsLayerDecPicBuffMinus1( i, k, j ) + 1; 1403 vps->setMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j, oldValue ); 1404 #else 1405 vps->setMaxVpsDecPicBufferingMinus1( i, k, j, m_acTEncTop[layerId].getMaxDecPicBuffering(j) - 1 ); 1406 #endif 1407 maxNumReorderPics = std::max( maxNumReorderPics, m_acTEncTop[layerId].getNumReorderPics(j)); 1408 } 1409 #if RESOLUTION_BASED_DPB 1410 for(Int k = 0; k < vps->getNumSubDpbs(i); k++) 1411 { 1412 // Decrement m_maxVpsDecPicBufferingMinus1 1413 Int oldValue = vps->getMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j ); 1414 vps->setMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j, oldValue - 1 ); 1415 } 1416 #endif 1417 vps->setMaxVpsNumReorderPics(i, j, maxNumReorderPics); 1418 vps->determineSubDpbInfoFlags(); 1419 } 1420 } 1334 1421 #endif 1335 1422 vps->setMaxOneActiveRefLayerFlag(maxDirectRefLayers > 1 ? false : true); … … 1339 1426 if( vps->getNumDirectRefLayers( vps->getLayerIdInNuh(i) ) == 0 ) 1340 1427 { 1428 #if Q0078_ADD_LAYER_SETS 1429 vps->setPocLsbNotPresentFlag(i, true); // make independedent layers base-layer compliant 1430 #else 1341 1431 vps->setPocLsbNotPresentFlag(i, false); 1432 #endif 1342 1433 } 1343 1434 } … … 1349 1440 vps->setCrossLayerAlignedIdrOnlyFlag( m_crossLayerAlignedIdrOnlyFlag ); 1350 1441 #endif 1351 #if N0147_IRAP_ALIGN_FLAG1352 1442 vps->setCrossLayerIrapAlignFlag( m_crossLayerIrapAlignFlag ); 1353 1443 for(UInt layerCtr = 1;layerCtr <= vps->getMaxLayers() - 1; layerCtr++) … … 1365 1455 } 1366 1456 } 1367 #endif1368 1457 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 1369 1458 vps->setSingleLayerForNonIrapFlag(m_adaptiveResolutionChange > 0 ? true : false); … … 1418 1507 { 1419 1508 vps->setVpsVuiBspHrdPresentFlag(true); 1509 #if Q0078_ADD_LAYER_SETS 1510 vps->setVpsNumBspHrdParametersMinus1(vps->getVpsNumLayerSetsMinus1() - 1); 1511 #else 1420 1512 vps->setVpsNumBspHrdParametersMinus1(vps->getNumLayerSets() - 2); 1513 #endif 1421 1514 vps->createBspHrdParamBuffer(vps->getVpsNumBspHrdParametersMinus1() + 1); 1422 1515 for ( i = 0; i <= vps->getVpsNumBspHrdParametersMinus1(); i++ ) … … 1451 1544 vps->setBspHrdParameters( i, pcCfgLayer->getFrameRate(), numDU, pcCfgLayer->getTargetBitrate(), ( pcCfgLayer->getIntraPeriod() > 0 ) ); 1452 1545 } 1546 #if Q0078_ADD_LAYER_SETS 1547 for (UInt h = 1; h <= vps->getVpsNumLayerSetsMinus1(); h++) 1548 #else 1453 1549 for(UInt h = 1; h <= (vps->getNumLayerSets()-1); h++) 1550 #endif 1454 1551 { 1455 1552 vps->setNumBitstreamPartitions(h, 1); … … 1532 1629 if( m_isField ) 1533 1630 { 1534 #if SVC_ UPSAMPLING1631 #if SVC_EXTENSION 1535 1632 #if LAYER_CTB 1536 1633 #if AUXILIARY_PICTURES … … 1552 1649 else 1553 1650 { 1554 #if SVC_ UPSAMPLING1651 #if SVC_EXTENSION 1555 1652 #if LAYER_CTB 1556 1653 #if AUXILIARY_PICTURES … … 1991 2088 rpcPicYuvRec = new TComPicYuv; 1992 2089 1993 #if SVC_UPSAMPLING1994 2090 #if LAYER_CTB 1995 2091 #if AUXILIARY_PICTURES … … 2005 2101 #endif 2006 2102 #endif 2007 #else2008 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth );2009 #endif2010 2103 2011 2104 } … … 2032 2125 Void TAppEncTop::xWriteRecon(UInt layer, Int iNumEncoded) 2033 2126 { 2127 #if REPN_FORMAT_IN_VPS 2128 ChromaFormat chromaFormatIdc = m_acLayerCfg[layer].getChromaFormatIDC(); 2129 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ); 2130 Int yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 2131 #endif 2132 2034 2133 if (m_isField) 2035 2134 { … … 2054 2153 #endif 2055 2154 { 2155 #if REPN_FORMAT_IN_VPS 2156 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRecTop, pcPicYuvRecBottom, m_acLayerCfg[layer].getConfLeft() * xScal, m_acLayerCfg[layer].getConfRight() * xScal, 2157 m_acLayerCfg[layer].getConfTop() * yScal, m_acLayerCfg[layer].getConfBottom() * yScal, m_isTopFieldFirst ); 2158 #else 2056 2159 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRecTop, pcPicYuvRecBottom, m_acLayerCfg[layer].getConfLeft(), m_acLayerCfg[layer].getConfRight(), m_acLayerCfg[layer].getConfTop(), m_acLayerCfg[layer].getConfBottom(), m_isTopFieldFirst ); 2160 #endif 2057 2161 } 2058 2162 } … … 2078 2182 #endif 2079 2183 { 2184 #if REPN_FORMAT_IN_VPS 2185 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfLeft() * xScal, m_acLayerCfg[layer].getConfRight() * xScal, 2186 m_acLayerCfg[layer].getConfTop() * yScal, m_acLayerCfg[layer].getConfBottom() * yScal ); 2187 #else 2080 2188 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfLeft(), m_acLayerCfg[layer].getConfRight(), 2081 2189 m_acLayerCfg[layer].getConfTop(), m_acLayerCfg[layer].getConfBottom() ); 2190 #endif 2082 2191 } 2083 2192 }
Note: See TracChangeset for help on using the changeset viewer.