Changeset 622 in 3DVCSoftware for trunk/source/App/TAppEncoder
- Timestamp:
- 11 Sep 2013, 14:40:25 (11 years ago)
- Location:
- trunk/source/App/TAppEncoder
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/App/TAppEncoder/TAppEncCfg.cpp
r608 r622 224 224 in>>entry.m_interViewRefPosL[1][i]; 225 225 } 226 #if !H_MV5 226 227 if (entry.m_numActiveRefLayerPics > 0 ) 227 228 { 228 229 in>>entry.m_collocatedRefLayerIdx; 229 230 } 231 #endif 230 232 #endif 231 233 return in; … … 367 369 ("NumberOfLayers", m_numberOfLayers , 1, "Number of layers") 368 370 #if !H_3D 371 #if H_MV5 372 ("ScalabilityMask", m_scalabilityMask , 2 , "Scalability Mask") 373 #else 369 374 ("ScalabilityMask", m_scalabilityMask , 1 , "Scalability Mask") 375 #endif 370 376 #else 371 377 ("ScalabilityMask", m_scalabilityMask , 3 , "Scalability Mask, 1: Texture 3: Texture + Depth ") 372 378 #endif 373 379 ("DimensionIdLen", m_dimensionIdLen , cfg_dimensionLength , "Number of bits used to store dimensions Id") 380 #if H_MV5 381 ("ViewOrderIndex", m_viewOrderIndex , std::vector<Int>(1,0), "View Order Index per layer") 382 ("ViewId", m_viewId , std::vector<Int>(1,0), "View Id per View Order Index") 383 #else 374 384 ("ViewId", m_viewId , std::vector<Int>(1,0), "View Id") 385 #endif 375 386 #if H_3D 376 387 ("DepthFlag", m_depthFlag , std::vector<Int>(1,0), "Depth Flag") … … 587 598 ("TargetBitrate,-tbr", m_targetBitrate, 0, "Input target bitrate") 588 599 ("NumLCUInUnit,-nu", m_numLCUInUnit, 0, "Number of LCUs in an Unit") 600 #endif 601 602 #if H_MV5 603 #if H_MV 604 // VPS VUI 605 ("VpsVuiPresentFlag" , m_vpsVuiPresentFlag , false , "VpsVuiPresentFlag ") 606 ("BitRatePresentVpsFlag" , m_bitRatePresentVpsFlag , false , "BitRatePresentVpsFlag ") 607 ("PicRatePresentVpsFlag" , m_picRatePresentVpsFlag , false , "PicRatePresentVpsFlag ") 608 ("BitRatePresentFlag" , m_bitRatePresentFlag , std::vector< Bool >(1,0) ,MAX_VPS_OP_SETS_PLUS1, "BitRatePresentFlag per sub layer for the N-th layer set") 609 ("PicRatePresentFlag" , m_picRatePresentFlag , std::vector< Bool >(1,0) ,MAX_VPS_OP_SETS_PLUS1, "PicRatePresentFlag per sub layer for the N-th layer set") 610 ("AvgBitRate" , m_avgBitRate , std::vector< Int >(1,0) ,MAX_VPS_OP_SETS_PLUS1, "AvgBitRate per sub layer for the N-th layer set") 611 ("MaxBitRate" , m_maxBitRate , std::vector< Int >(1,0) ,MAX_VPS_OP_SETS_PLUS1, "MaxBitRate per sub layer for the N-th layer set") 612 ("ConstantPicRateIdc" , m_constantPicRateIdc , std::vector< Int >(1,0) ,MAX_VPS_OP_SETS_PLUS1, "ConstantPicRateIdc per sub layer for the N-th layer set") 613 ("AvgPicRate" , m_avgPicRate , std::vector< Int >(1,0) ,MAX_VPS_OP_SETS_PLUS1, "AvgPicRate per sub layer for the N-th layer set") 614 ("TileBoundariesAlignedFlag" , m_tileBoundariesAlignedFlag , std::vector< Bool >(1,0) ,MAX_NUM_LAYERS , "TileBoundariesAlignedFlag per direct reference for the N-th layer") 615 ("IlpRestrictedRefLayersFlag" , m_ilpRestrictedRefLayersFlag , false , "IlpRestrictedRefLayersFlag") 616 ("MinSpatialSegmentOffsetPlus1", m_minSpatialSegmentOffsetPlus1, std::vector< Int >(1,0) ,MAX_NUM_LAYERS , "MinSpatialSegmentOffsetPlus1 per direct reference for the N-th layer") 617 ("CtuBasedOffsetEnabledFlag" , m_ctuBasedOffsetEnabledFlag , std::vector< Bool >(1,0) ,MAX_NUM_LAYERS , "CtuBasedOffsetEnabledFlag per direct reference for the N-th layer") 618 ("MinHorizontalCtuOffsetPlus1" , m_minHorizontalCtuOffsetPlus1 , std::vector< Int >(1,0) ,MAX_NUM_LAYERS , "MinHorizontalCtuOffsetPlus1 per direct reference for the N-th layer") 619 #endif 589 620 #endif 590 621 … … 719 750 ("ViewSynthesisPred", m_viewSynthesisPredFlag, true , "view synthesis prediction " ) 720 751 #endif 721 #if H_3D _TMVP752 #if H_3D 722 753 ("IvMvScaling", m_ivMvScalingFlag , true , "inter view motion vector scaling" ) 723 754 #endif … … 731 762 if( k == 0 ) 732 763 { 764 #if H_MV5 765 m_GOPListMvc[0][0].m_sliceType = 'I'; 766 #endif 733 767 for( Int i = 1; i < MAX_GOP + 1; i++ ) 734 768 { … … 934 968 // allocate slice-based dQP values 935 969 #if H_MV 970 #if H_MV5 971 xResizeVector( m_viewOrderIndex ); 972 973 std::vector<Int> uniqueViewOrderIndices; 974 for( Int layer = 0; layer < m_numberOfLayers; layer++ ) 975 { 976 Bool isIn = false; 977 for ( Int i = 0 ; i < uniqueViewOrderIndices.size(); i++ ) 978 { 979 isIn = isIn || ( m_viewOrderIndex[ layer ] == uniqueViewOrderIndices[ i ] ); 980 } 981 if ( !isIn ) 982 { 983 uniqueViewOrderIndices.push_back( m_viewOrderIndex[ layer ] ); 984 } 985 } 986 m_iNumberOfViews = (Int) uniqueViewOrderIndices.size(); 987 988 #if H_3D 989 xResizeVector( m_depthFlag ); 990 #endif 991 #else 936 992 xResizeVector( m_viewId ); 937 993 #if H_3D … … 954 1010 #endif 955 1011 1012 #endif 956 1013 xResizeVector( m_fQP ); 957 1014 … … 1226 1283 xConfirmPara( (m_layerIdInNuh.size()!=1) && (m_layerIdInNuh.size() < m_numberOfLayers) , "LayerIdInNuh must be given for all layers. "); 1227 1284 1285 #if H_MV5 1286 #if H_3D 1287 xConfirmPara( m_scalabilityMask != 2 && m_scalabilityMask != 3, "Scalability Mask must be equal to 2 or 3. "); 1288 #else 1289 xConfirmPara( m_scalabilityMask != 2 , "Scalability Mask must be equal to 2. "); 1290 #endif 1291 1292 #if H_3D 1293 if ( m_scalabilityMask & ( 1 << DEPTH_ID ) ) 1294 { 1295 m_dimIds.push_back( m_depthFlag ); 1296 } 1297 #endif 1298 1299 m_dimIds.push_back( m_viewOrderIndex ); 1300 #else 1228 1301 #if H_3D 1229 1302 xConfirmPara( m_scalabilityMask != 1 && m_scalabilityMask != 3, "Scalability Mask must be equal to 1 or 3. "); … … 1239 1312 #endif 1240 1313 1314 #endif 1241 1315 xConfirmPara( m_dimensionIdLen.size() < m_dimIds.size(), "DimensionIdLen must be given for all dimensions. " ); Int dimBitOffset[MAX_NUM_SCALABILITY_TYPES+1]; 1242 1316 … … 1255 1329 { 1256 1330 xConfirmPara( m_dimIds[j].size() < m_numberOfLayers, "DimensionId must be given for all layers and all dimensions. "); 1331 #if H_MV5 1332 xConfirmPara( (m_dimIds[j][0] != 0) , "DimensionId of layer 0 must be 0. " ); 1333 #else 1257 1334 xConfirmPara( ( j != viewDimPosition ) && (m_dimIds[j][0] != 0), "DimensionId of layer 0 must be 0. " ); 1335 #endif 1258 1336 xConfirmPara( m_dimensionIdLen[j] < 1 || m_dimensionIdLen[j] > 8, "DimensionIdLen must be greater than 0 and less than 9 in all dimensions. " ); 1259 1337 … … 1297 1375 { 1298 1376 Bool inc = m_dimIds[ lastDiff ][ i ] > m_dimIds[ lastDiff ][ j ]; 1377 #if H_MV5 1378 Bool shallBeButIsNotIncreasing = ( !inc ) ; 1379 #else 1299 1380 Bool shallBeButIsNotIncreasing = ( !inc && ( lastDiff != viewDimPosition ) ) ; 1381 #endif 1300 1382 if ( shallBeButIsNotIncreasing ) 1301 1383 { 1302 1384 printf( "\nError: Positions of Layers %d and %d is not increasing in dimension %d \n", i, j, lastDiff); 1303 1385 } 1386 #if H_MV5 1387 xConfirmPara( shallBeButIsNotIncreasing, "DimensionIds shall be increasing within one dimension. " ); 1388 #else 1304 1389 xConfirmPara( shallBeButIsNotIncreasing && ( lastDiff != viewDimPosition ), "DimensionIds shall be increasing within one dimension. " ); 1390 #endif 1305 1391 } 1306 1392 } 1307 1393 } 1308 1394 1395 #if H_MV5 1396 /// ViewId 1397 xConfirmPara( m_viewId.size() != m_iNumberOfViews, "The number of ViewIds must be equal to the number of views." ); 1398 1309 1399 /// Layer sets 1400 xConfirmPara( m_vpsNumLayerSets < 0 || m_vpsNumLayerSets > 1024, "VpsNumLayerSets must be greater than 0 and less than 1025. ") ; 1401 #else 1310 1402 xConfirmPara( m_vpsNumLayerSets < 0 || m_vpsNumLayerSets > 1024, "VpsNumLayerSets must be greater than 0 and less than 1025") ; 1403 #endif 1311 1404 for( Int lsIdx = 0; lsIdx < m_vpsNumLayerSets; lsIdx++ ) 1312 1405 { … … 2068 2161 } 2069 2162 #endif 2163 #if H_MV5 2164 #if H_MV 2165 // VPS VUI 2166 for(Int i = 0; i < MAX_VPS_OP_SETS_PLUS1; i++ ) 2167 { 2168 for (Int j = 0; j < MAX_TLAYER; j++) 2169 { 2170 if ( j < m_avgBitRate [i].size() ) xConfirmPara( m_avgBitRate[i][j] < 0 || m_avgBitRate[i][j] > 65535, "avg_bit_rate must be more than or equal to 0 and less than 65536" ); 2171 if ( j < m_maxBitRate [i].size() ) xConfirmPara( m_maxBitRate[i][j] < 0 || m_maxBitRate[i][j] > 65535, "max_bit_rate must be more than or equal to 0 and less than 65536" ); 2172 if ( j < m_constantPicRateIdc[i].size() ) xConfirmPara( m_constantPicRateIdc[i][j] < 0 || m_constantPicRateIdc[i][j] > 3, "constant_pic_rate_idc must be more than or equal to 0 and less than 4" ); 2173 if ( j < m_avgPicRate [i].size() ) xConfirmPara( m_avgPicRate[i][j] < 0 || m_avgPicRate[i][j] > 65535, "avg_pic_rate must be more than or equal to 0 and less than 65536" ); 2174 } 2175 } 2176 // todo: replace value of 100 with requirement in spec 2177 for(Int i = 0; i < MAX_NUM_LAYERS; i++ ) 2178 { 2179 for (Int j = 0; j < MAX_NUM_LAYERS; j++) 2180 { 2181 if ( j < m_minSpatialSegmentOffsetPlus1[i].size() ) xConfirmPara( m_minSpatialSegmentOffsetPlus1[i][j] < 0 || m_minSpatialSegmentOffsetPlus1[i][j] > 100, "min_spatial_segment_offset_plus1 must be more than or equal to 0 and less than 101" ); 2182 if ( j < m_minHorizontalCtuOffsetPlus1[i] .size() ) xConfirmPara( m_minHorizontalCtuOffsetPlus1[i][j] < 0 || m_minHorizontalCtuOffsetPlus1[i][j] > 100, "min_horizontal_ctu_offset_plus1 must be more than or equal to 0 and less than 101" ); 2183 } 2184 } 2185 #endif 2186 #endif 2070 2187 2071 2188 xConfirmPara(!m_TransquantBypassEnableFlag && m_CUTransquantBypassFlagValue, "CUTransquantBypassFlagValue cannot be 1 when TransquantBypassEnableFlag is 0"); … … 2133 2250 #endif 2134 2251 #if H_MV 2252 #if H_MV5 2253 xPrintParaVector( "ViewIdVal" , m_viewId ); 2254 xPrintParaVector( "ViewOrderIndex", m_viewOrderIndex ); 2255 #else 2135 2256 xPrintParaVector( "ViewId", m_viewId ); 2257 #endif 2136 2258 #endif 2137 2259 #if H_3D … … 2283 2405 printf("ViewSynthesisPred:%d ", m_viewSynthesisPredFlag ); 2284 2406 #endif 2285 #if H_3D _TMVP2407 #if H_3D 2286 2408 printf("IvMvScaling:%d ", m_ivMvScalingFlag ? 1 : 0 ); 2287 2409 #endif -
trunk/source/App/TAppEncoder/TAppEncCfg.h
r608 r622 69 69 std::vector<char*> m_pchReconFileList; ///< output reconstruction file names 70 70 Int m_numberOfLayers; ///< number of Layers to Encode 71 #if H_MV5 72 Int m_iNumberOfViews; ///< number of Layers that are views 73 #else 71 74 #if H_3D 72 75 Int m_iNumberOfViews; ///< number of Layers that are views 76 #endif 73 77 #endif 74 78 #else … … 79 83 std::vector< std::vector<Int> > m_dimIds; ///< dimension ids ( pointers to m_viewId and m_depthFlag 80 84 std::vector<Int> m_viewId; ///< view id 85 #if H_MV5 86 std::vector<Int> m_viewOrderIndex; ///< view order index 87 #endif 81 88 #if H_3D 82 89 std::vector<Int> m_depthFlag; ///< depth flag … … 99 106 std::vector< std::vector<Int> > m_dependencyTypes; ///< Dependency types of direct reference layers 100 107 108 #if H_MV5 109 // VPS VUI 110 Bool m_vpsVuiPresentFlag; 111 Bool m_bitRatePresentVpsFlag; 112 Bool m_picRatePresentVpsFlag; 113 std::vector< std::vector<Bool > > m_bitRatePresentFlag; 114 std::vector< std::vector<Bool > > m_picRatePresentFlag; 115 std::vector< std::vector<Int > > m_avgBitRate; 116 std::vector< std::vector<Int > > m_maxBitRate; 117 std::vector< std::vector<Int > > m_constantPicRateIdc; 118 std::vector< std::vector<Int > > m_avgPicRate; 119 std::vector< std::vector<Bool > > m_tileBoundariesAlignedFlag; 120 Bool m_ilpRestrictedRefLayersFlag; 121 std::vector< std::vector<Int > > m_minSpatialSegmentOffsetPlus1; 122 std::vector< std::vector<Bool > > m_ctuBasedOffsetEnabledFlag; 123 std::vector< std::vector<Int > > m_minHorizontalCtuOffsetPlus1; 124 #endif 125 101 126 #if H_3D_IV_MERGE 102 127 Bool m_ivMvPredFlag; ///< Interview motion vector prediction … … 115 140 Bool m_viewSynthesisPredFlag; 116 141 #endif 117 #if H_3D _TMVP142 #if H_3D 118 143 Bool m_ivMvScalingFlag; 119 144 #endif -
trunk/source/App/TAppEncoder/TAppEncTop.cpp
r608 r622 88 88 vps.setTemporalNestingFlag(true); 89 89 } 90 #if H_MV5 91 vps.setMaxLayersMinus1( m_numberOfLayers - 1); 92 #else 90 93 vps.setMaxLayers( m_numberOfLayers ); 94 #endif 91 95 for(Int i = 0; i < MAX_TLAYER; i++) 92 96 { … … 120 124 xSetDependencies( vps ); 121 125 xSetProfileTierLevel ( vps ); 126 #if H_MV5 127 xSetRepFormat ( vps ); 128 #endif 122 129 xSetLayerSets ( vps ); 130 #if H_MV5 131 xSetVPSVUI ( vps ); 132 #endif 123 133 #if H_3D 134 #if !H_MV5 124 135 vps.initViewIndex(); 136 #endif 125 137 xSetVPSExtension2 ( vps ); 126 138 m_ivPicLists.setVPS ( &vps ); 127 139 #endif 128 140 141 142 #if H_MV5 143 for(Int layerIdInVps = 0; layerIdInVps < m_numberOfLayers; layerIdInVps++) 144 #else 129 145 for(Int layer = 0; layer < m_numberOfLayers; layer++) 146 #endif 130 147 { 131 148 m_frameRcvd .push_back(0); … … 134 151 m_acTVideoIOYuvReconFileList.push_back(new TVideoIOYuv); 135 152 m_picYuvRec .push_back(new TComList<TComPicYuv*>) ; 136 153 #if H_MV5 154 m_ivPicLists.push_back( m_acTEncTopList[ layerIdInVps ]->getListPic() ); 155 TEncTop& m_cTEncTop = *m_acTEncTopList[ layerIdInVps ]; // It is not a member, but this name helps avoiding code duplication !!! 156 157 Int layerId = vps.getLayerIdInNuh( layerIdInVps ); 158 m_cTEncTop.setLayerIdInVps ( layerIdInVps ); 159 m_cTEncTop.setLayerId ( layerId ); 160 m_cTEncTop.setViewId ( vps.getViewId ( layerId ) ); 161 m_cTEncTop.setViewIndex ( vps.getViewIndex ( layerId ) ); 162 #else 137 163 m_ivPicLists.push_back( m_acTEncTopList[ layer ]->getListPic() ); 138 164 TEncTop& m_cTEncTop = *m_acTEncTopList[ layer ]; // It is not a member, but this name helps avoiding code duplication !!! … … 141 167 m_cTEncTop.setLayerId ( vps.getLayerIdInNuh( layer ) ); 142 168 m_cTEncTop.setViewId ( vps.getViewId ( layer ) ); 169 170 #endif 143 171 #if H_3D 172 #if H_MV5 173 Bool isDepth = ( vps.getDepthId ( layerId ) != 0 ) ; 174 #else 144 175 Bool isDepth = ( vps.getDepthId ( layer ) != 0 ) ; 145 176 m_cTEncTop.setViewIndex ( vps.getViewIndex ( layer ) ); 177 #endif 146 178 m_cTEncTop.setIsDepth ( isDepth ); 147 179 //====== Camera Parameters ========= … … 169 201 m_cTEncTop.setDWeight ( isDepth ? m_iDWeight : 0 ); 170 202 #endif // H_3D_VSO 203 #if H_MV5 204 #if H_3D_ARP 205 //====== Advanced Inter-view Residual Prediction ========= 206 m_cTEncTop.setUseAdvRP ( ( isDepth || 0==layerIdInVps ) ? 0 : m_uiUseAdvResPred ); 207 m_cTEncTop.setARPStepNum ( ( isDepth || 0==layerIdInVps ) ? 1 : H_3D_ARP_WFNR ); 208 #endif 209 #if H_3D_IC 210 m_cTEncTop.setUseIC ( vps.getViewIndex( layerId ) == 0 ? false : m_abUseIC[isDepth ? 1 : 0] ); 211 #endif 212 #else 171 213 #if H_3D_ARP 172 214 //====== Advanced Inter-view Residual Prediction ========= … … 176 218 #if H_3D_IC 177 219 m_cTEncTop.setUseIC ( vps.getViewIndex( layer ) == 0 ? false : m_abUseIC[isDepth ? 1 : 0] ); 220 #endif 178 221 #endif 179 222 //========== Depth intra modes ========== … … 217 260 m_cTEncTop.setGOPSize ( m_iGOPSize ); 218 261 #if H_MV 262 #if H_MV5 263 m_cTEncTop.setGopList ( m_GOPListMvc[layerIdInVps] ); 264 m_cTEncTop.setExtraRPSs ( m_extraRPSsMvc[layerIdInVps] ); 265 for(Int i = 0; i < MAX_TLAYER; i++) 266 { 267 m_cTEncTop.setNumReorderPics ( m_numReorderPicsMvc[layerIdInVps][i], i ); 268 m_cTEncTop.setMaxDecPicBuffering ( m_maxDecPicBufferingMvc[layerIdInVps][i], i ); 269 } 270 #else 219 271 m_cTEncTop.setGopList ( m_GOPListMvc[layer] ); 220 272 m_cTEncTop.setExtraRPSs ( m_extraRPSsMvc[layer] ); … … 224 276 m_cTEncTop.setMaxDecPicBuffering ( m_maxDecPicBufferingMvc[layer][i], i ); 225 277 } 278 #endif 226 279 #else 227 280 m_cTEncTop.setGopList ( m_GOPList ); … … 238 291 } 239 292 #if H_MV 293 #if H_MV5 294 m_cTEncTop.setQP ( m_iQP[layerIdInVps] ); 295 #else 240 296 m_cTEncTop.setQP ( m_iQP[layer] ); 297 #endif 241 298 #else 242 299 m_cTEncTop.setQP ( m_iQP ); … … 246 303 247 304 #if H_MV 305 #if H_MV5 306 m_cTEncTop.setMaxTempLayer ( m_maxTempLayerMvc[layerIdInVps] ); 307 #else 248 308 m_cTEncTop.setMaxTempLayer ( m_maxTempLayerMvc[layer] ); 309 #endif 249 310 #else 250 311 m_cTEncTop.setMaxTempLayer ( m_maxTempLayer ); … … 256 317 //====== Loop/Deblock Filter ======== 257 318 #if H_MV 319 #if H_MV5 320 m_cTEncTop.setLoopFilterDisable ( m_bLoopFilterDisable[layerIdInVps]); 321 #else 258 322 m_cTEncTop.setLoopFilterDisable ( m_bLoopFilterDisable[layer]); 323 #endif 259 324 #else 260 325 m_cTEncTop.setLoopFilterDisable ( m_bLoopFilterDisable ); … … 286 351 287 352 #if H_MV 353 #if H_MV5 354 if ((m_iMaxDeltaQP == 0 ) && (m_iQP[layerIdInVps] == lowestQP) && (m_useLossless == true)) 355 #else 288 356 if ((m_iMaxDeltaQP == 0 ) && (m_iQP[layer] == lowestQP) && (m_useLossless == true)) 357 #endif 289 358 #else 290 359 if ((m_iMaxDeltaQP == 0 ) && (m_iQP == lowestQP) && (m_useLossless == true)) … … 303 372 m_cTEncTop.setUseLossless ( m_useLossless ); 304 373 #if H_MV 374 #if H_MV5 375 m_cTEncTop.setdQPs ( m_aidQP[layerIdInVps] ); 376 #else 305 377 m_cTEncTop.setdQPs ( m_aidQP[layer] ); 378 #endif 306 379 #else 307 380 m_cTEncTop.setdQPs ( m_aidQP ); … … 362 435 m_cTEncTop.setLFCrossSliceBoundaryFlag( m_bLFCrossSliceBoundaryFlag ); 363 436 #if H_MV 437 #if H_MV5 438 m_cTEncTop.setUseSAO ( m_bUseSAO[layerIdInVps] ); 439 #else 364 440 m_cTEncTop.setUseSAO ( m_bUseSAO[layer] ); 441 #endif 365 442 #else 366 443 m_cTEncTop.setUseSAO ( m_bUseSAO ); … … 1044 1121 Void TAppEncTop::xSetDimensionIdAndLength( TComVPS& vps ) 1045 1122 { 1123 #if H_MV5 1124 vps.setScalabilityMaskFlag( m_scalabilityMask ); 1125 #else 1046 1126 vps.setScalabilityMask( m_scalabilityMask ); 1127 #endif 1047 1128 for( Int dim = 0; dim < m_dimIds.size(); dim++ ) 1048 1129 { 1049 1130 vps.setDimensionIdLen( dim, m_dimensionIdLen[ dim ] ); 1131 #if H_MV5 1132 for( Int layer = 0; layer <= vps.getMaxLayersMinus1(); layer++ ) 1133 #else 1050 1134 for( Int layer = 0; layer < vps.getMaxLayers(); layer++ ) 1135 #endif 1136 1051 1137 { 1052 1138 vps.setDimensionId( layer, dim, m_dimIds[ dim ][ layer ] ); 1053 1139 } 1054 1140 } 1141 1142 #if H_MV5 1143 Int maxViewId = xGetMax( m_viewId ); 1144 1145 Int viewIdLenMinus1 = std::max( gCeilLog2( maxViewId + 1 ) - 1, 0 ) ; 1146 const Int maxViewIdLenMinus1 = ( 1 << 4 ) - 1; 1147 assert( viewIdLenMinus1 <= maxViewIdLenMinus1 ); 1148 vps.setViewIdLenMinus1( viewIdLenMinus1 ); 1149 for (Int i = 0; i < m_iNumberOfViews; i++) 1150 { 1151 vps.setViewIdVal( i, m_viewId[ i] ); 1152 } 1153 1154 assert( m_iNumberOfViews == vps.getNumViews() ); 1155 #endif 1055 1156 } 1056 1157 … … 1078 1179 } 1079 1180 1080 // Max temporal id for inter layer reference pictures 1181 // Max temporal id for inter layer reference pictures + presence flag 1182 #if H_MV5 1183 Bool maxTidRefPresentFlag = false; 1184 #endif 1081 1185 for ( Int refLayerIdInVps = 0; refLayerIdInVps < m_numberOfLayers; refLayerIdInVps++) 1082 1186 { … … 1099 1203 } 1100 1204 vps.setMaxTidIlRefPicPlus1( refLayerIdInVps, maxTid + 1 ); 1101 } 1102 1205 #if H_MV5 1206 maxTidRefPresentFlag = maxTidRefPresentFlag || ( maxTid != 6 ); 1207 #endif 1208 } 1209 1210 #if H_MV5 1211 vps.setMaxTidRefPresentFlag( maxTidRefPresentFlag ); 1212 #endif 1103 1213 // Max one active ref layer flag 1104 1214 Bool maxOneActiveRefLayerFlag = true; 1215 #if H_MV5 1216 for ( Int layerIdInVps = 1; layerIdInVps < m_numberOfLayers && maxOneActiveRefLayerFlag; layerIdInVps++) 1217 #else 1105 1218 for ( Int currLayerIdInVps = 1; currLayerIdInVps < m_numberOfLayers && maxOneActiveRefLayerFlag; currLayerIdInVps++) 1219 #endif 1106 1220 { 1107 1221 for( Int i = 0; i < ( getGOPSize() + 1) && maxOneActiveRefLayerFlag; i++ ) 1108 1222 { 1223 #if H_MV5 1224 GOPEntry ge = m_GOPListMvc[layerIdInVps][ ( i < getGOPSize() ? i : MAX_GOP ) ]; 1225 #else 1109 1226 GOPEntry ge = m_GOPListMvc[currLayerIdInVps][ ( i < getGOPSize() ? i : MAX_GOP ) ]; 1227 #endif 1110 1228 maxOneActiveRefLayerFlag = maxOneActiveRefLayerFlag && (ge.m_numActiveRefLayerPics <= 1); 1111 1229 } … … 1113 1231 1114 1232 vps.setMaxOneActiveRefLayerFlag( maxOneActiveRefLayerFlag ); 1233 1234 1235 #if H_MV5 1236 // All Ref layers active flag 1237 Bool allRefLayersActiveFlag = true; 1238 for ( Int layerIdInVps = 1; layerIdInVps < m_numberOfLayers && allRefLayersActiveFlag; layerIdInVps++) 1239 { 1240 for( Int i = 0; i < ( getGOPSize() + 1) && allRefLayersActiveFlag; i++ ) 1241 { 1242 GOPEntry ge = m_GOPListMvc[layerIdInVps][ ( i < getGOPSize() ? i : MAX_GOP ) ]; 1243 allRefLayersActiveFlag = allRefLayersActiveFlag && (ge.m_numActiveRefLayerPics == m_directRefLayers[ layerIdInVps ].size() ); 1244 } 1245 } 1246 1247 vps.setAllRefLayersActiveFlag( allRefLayersActiveFlag ); 1248 1249 // Currently cross layer irap aligned is always true. 1250 vps.setCrossLayerIrapAlignedFlag( true ); 1251 #endif 1115 1252 vps.setRefLayers(); 1116 1253 }; 1117 1254 1255 #if H_MV5 1256 GOPEntry* TAppEncTop::xGetGopEntry( Int layerIdInVps, Int poc ) 1257 { 1258 GOPEntry* geFound = NULL; 1259 for( Int i = 0; i < ( getGOPSize() + 1) && geFound == NULL ; i++ ) 1260 { 1261 GOPEntry* ge = &(m_GOPListMvc[layerIdInVps][ ( i < getGOPSize() ? i : MAX_GOP ) ]); 1262 if ( ge->m_POC == poc ) 1263 { 1264 geFound = ge; 1265 } 1266 } 1267 assert( geFound != NULL ); 1268 return geFound; 1269 } 1270 #endif 1271 1118 1272 Void TAppEncTop::xSetLayerIds( TComVPS& vps ) 1119 1273 { … … 1137 1291 Int maxVec = 0; 1138 1292 for ( Int i = 0; i < vec.size(); i++) 1293 { 1139 1294 maxVec = max( vec[i], maxVec ); 1295 } 1140 1296 return maxVec; 1141 1297 } … … 1152 1308 } 1153 1309 1310 #if H_MV5 1311 1312 Void TAppEncTop::xSetRepFormat( TComVPS& vps ) 1313 { 1314 vps.setRepFormatIdxPresentFlag( true ); 1315 vps.setVpsNumRepFormatsMinus1 ( 0 ); 1316 1317 TComRepFormat* repFormat = new TComRepFormat; 1318 1319 repFormat->setBitDepthVpsChromaMinus8 ( g_bitDepthC - 8 ); 1320 repFormat->setBitDepthVpsLumaMinus8 ( g_bitDepthY - 8 ); 1321 repFormat->setChromaFormatVpsIdc ( CHROMA_420 ); 1322 repFormat->setPicHeightVpsInLumaSamples ( m_iSourceHeight ); 1323 repFormat->setPicWidthVpsInLumaSamples ( m_iSourceWidth ); 1324 // ToDo not supported yet. 1325 //repFormat->setSeparateColourPlaneVpsFlag( ); 1326 1327 assert( vps.getRepFormat( 0 ) == NULL ); 1328 vps.setRepFormat( 0 , repFormat ); 1329 1330 for(Int i = 0; i <= vps.getMaxLayersMinus1(); i++ ) 1331 { 1332 vps.setVpsRepFormatIdx( i , 0 ); 1333 } 1334 } 1335 #endif 1154 1336 1155 1337 Void TAppEncTop::xSetLayerSets( TComVPS& vps ) … … 1204 1386 } 1205 1387 } 1388 #if H_MV5 1389 1390 Void TAppEncTop::xSetVPSVUI( TComVPS& vps ) 1391 { 1392 vps.setVpsVuiPresentFlag( m_vpsVuiPresentFlag ); 1393 1394 if ( m_vpsVuiPresentFlag ) 1395 { 1396 TComVPSVUI* pcVPSVUI = vps.getVPSVUI( ); 1397 1398 assert( pcVPSVUI ); 1399 1400 pcVPSVUI->setBitRatePresentVpsFlag( m_bitRatePresentVpsFlag ); 1401 pcVPSVUI->setPicRatePresentVpsFlag( m_picRatePresentVpsFlag ); 1402 1403 if( pcVPSVUI->getBitRatePresentVpsFlag( ) || pcVPSVUI->getPicRatePresentVpsFlag( ) ) 1404 { 1405 for( Int i = 0; i <= vps.getVpsNumberLayerSetsMinus1(); i++ ) 1406 { 1407 for( Int j = 0; j <= vps.getMaxTLayers(); j++ ) 1408 { 1409 if( pcVPSVUI->getBitRatePresentVpsFlag( ) && m_bitRatePresentFlag[i].size() > j ) 1410 { 1411 pcVPSVUI->setBitRatePresentFlag( i, j, m_bitRatePresentFlag[i][j] ); 1412 } 1413 if( pcVPSVUI->getPicRatePresentVpsFlag( ) && m_picRatePresentFlag[i].size() > j ) 1414 { 1415 pcVPSVUI->setPicRatePresentFlag( i, j, m_picRatePresentFlag[i][j] ); 1416 } 1417 if( pcVPSVUI->getBitRatePresentFlag( i, j ) && m_avgBitRate[i].size() > j ) 1418 { 1419 pcVPSVUI->setAvgBitRate( i, j, m_avgBitRate[i][j] ); 1420 } 1421 if( pcVPSVUI->getBitRatePresentFlag( i, j ) && m_maxBitRate[i].size() > j ) 1422 { 1423 pcVPSVUI->setMaxBitRate( i, j, m_maxBitRate[i][j] ); 1424 } 1425 if( pcVPSVUI->getPicRatePresentFlag( i, j ) && m_constantPicRateIdc[i].size() > j ) 1426 { 1427 pcVPSVUI->setConstantPicRateIdc( i, j, m_constantPicRateIdc[i][j] ); 1428 } 1429 if( pcVPSVUI->getPicRatePresentFlag( i, j ) && m_avgPicRate[i].size() > j ) 1430 { 1431 pcVPSVUI->setAvgPicRate( i, j, m_avgPicRate[i][j] ); 1432 } 1433 } 1434 } 1435 } 1436 1437 for( Int i = 1; i <= vps.getMaxLayersMinus1(); i++ ) 1438 { 1439 for( Int j = 0; j < vps.getNumDirectRefLayers( vps.getLayerIdInNuh( i ) ); j++ ) 1440 { 1441 if ( m_tileBoundariesAlignedFlag[i].size() > j ) 1442 { 1443 pcVPSVUI->setTileBoundariesAlignedFlag( i, j, m_tileBoundariesAlignedFlag[i][j]); 1444 } 1445 } 1446 } 1447 1448 pcVPSVUI->setIlpRestrictedRefLayersFlag( m_ilpRestrictedRefLayersFlag ); 1449 1450 if( pcVPSVUI->getIlpRestrictedRefLayersFlag( ) ) 1451 { 1452 for( Int i = 1; i <= vps.getMaxLayersMinus1(); i++ ) 1453 { 1454 for( Int j = 0; j < vps.getNumDirectRefLayers( vps.getLayerIdInNuh( i ) ); j++ ) 1455 { 1456 if ( m_minSpatialSegmentOffsetPlus1[i].size() > j ) 1457 { 1458 pcVPSVUI->setMinSpatialSegmentOffsetPlus1( i, j, m_minSpatialSegmentOffsetPlus1[i][j] ); 1459 } 1460 if( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ) > 0 ) 1461 { 1462 if ( m_ctuBasedOffsetEnabledFlag[i].size() > j ) 1463 { 1464 pcVPSVUI->setCtuBasedOffsetEnabledFlag( i, j, m_ctuBasedOffsetEnabledFlag[i][j] ); 1465 } 1466 if( pcVPSVUI->getCtuBasedOffsetEnabledFlag( i, j ) ) 1467 { 1468 if ( m_minHorizontalCtuOffsetPlus1[i].size() > j ) 1469 { 1470 pcVPSVUI->setMinHorizontalCtuOffsetPlus1( i, j, m_minHorizontalCtuOffsetPlus1[i][j] ); 1471 } 1472 } 1473 } 1474 } 1475 } 1476 } 1477 } 1478 } 1479 #endif 1206 1480 #endif 1207 1481 #if H_3D 1208 1482 Void TAppEncTop::xSetVPSExtension2( TComVPS& vps ) 1209 1483 { 1484 #if H_MV5 1485 1486 for ( Int layer = 0; layer <= vps.getMaxLayersMinus1(); layer++ ) 1487 #else 1210 1488 for ( Int layer = 0; layer < vps.getMaxLayers(); layer++ ) 1489 #endif 1211 1490 { 1212 1491 Bool isDepth = ( vps.getDepthId( layer ) == 1 ) ; … … 1242 1521 #endif 1243 1522 } 1244 #if H_3D _TMVP1523 #if H_3D 1245 1524 vps.setIvMvScalingFlag( m_ivMvScalingFlag ); 1246 1525 #endif -
trunk/source/App/TAppEncoder/TAppEncTop.h
r608 r622 121 121 Void xSetLayerSets ( TComVPS& vps ); 122 122 Void xSetProfileTierLevel ( TComVPS& vps ); 123 #if H_MV5 124 Void xSetRepFormat ( TComVPS& vps ); 125 Void xSetVPSVUI ( TComVPS& vps ); 126 GOPEntry* xGetGopEntry( Int layerIdInVps, Int poc ); 127 #endif 123 128 Int xGetMax( std::vector<Int>& vec); 124 129 #endif
Note: See TracChangeset for help on using the changeset viewer.