Changeset 815 in SHVCSoftware for trunk/source/App/TAppEncoder/TAppEncCfg.cpp
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
-
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 );
Note: See TracChangeset for help on using the changeset viewer.