Changeset 1073 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
- Timestamp:
- 6 Mar 2015, 03:10:49 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
r1069 r1073 256 256 { 257 257 #if USE_DPB_SIZE_TABLE 258 if( getCommonDecoderParams()->getTargetOutputLayerSetIdx() == 0 )258 if( m_commonDecoderParams->getTargetOutputLayerSetIdx() == 0 ) 259 259 { 260 260 assert( this->getLayerId() == 0 ); … … 273 273 274 274 #if USE_DPB_SIZE_TABLE 275 if( getCommonDecoderParams()->getTargetOutputLayerSetIdx() == 0 )275 if( m_commonDecoderParams->getTargetOutputLayerSetIdx() == 0 ) 276 276 { 277 277 assert( this->getLayerId() == 0 ); … … 285 285 m_iMaxRefPicNum = pcSlice->getVPS()->getMaxVpsLayerDecPicBuffMinus1( getCommonDecoderParams()->getTargetOutputLayerSetIdx(), layerIdx, pcSlice->getTLayer() ) + 1; // m_uiMaxDecPicBuffering has the space for the picture currently being decoded 286 286 #else 287 m_iMaxRefPicNum = pcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1( getCommonDecoderParams()->getTargetOutputLayerSetIdx(), pcSlice->getLayerId(), pcSlice->getTLayer() ) + 1; // m_uiMaxDecPicBuffering has the space for the picture currently being decoded287 m_iMaxRefPicNum = pcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1( m_commonDecoderParams->getTargetOutputLayerSetIdx(), pcSlice->getVPS()->getLayerIdcInOls( pcSlice->getVPS()->getOutputLayerSetIdx( m_commonDecoderParams->getTargetOutputLayerSetIdx()), pcSlice->getLayerId() ), pcSlice->getTLayer() ) + 1; // m_uiMaxDecPicBuffering has the space for the picture currently being decoded 288 288 #endif 289 289 } … … 300 300 rpcPic = new TComPic(); 301 301 302 #if SVC_EXTENSION //Temporal solution, should be modified302 #if SVC_EXTENSION 303 303 if(m_layerId > 0) 304 304 { 305 for(UInt i = 0; i < pcSlice->getVPS()->getNumDirectRefLayers( m_layerId ); i++ ) 306 { 307 #if MOVE_SCALED_OFFSET_TO_PPS 308 #if O0098_SCALED_REF_LAYER_ID 309 const Window scalEL = pcSlice->getPPS()->getScaledRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, i)); 310 #else 311 const Window scalEL = pcSlice->getPPS()->getScaledRefLayerWindow(i); 312 #endif 313 #else 314 #if O0098_SCALED_REF_LAYER_ID 315 const Window scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, i)); 316 #else 317 const Window scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(i); 318 #endif 319 #endif 320 #if REF_REGION_OFFSET 321 const Window refEL = pcSlice->getPPS()->getRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, i)); 322 #if RESAMPLING_FIX 323 Bool equalOffsets = scalEL.hasEqualOffset(refEL); 324 #if R0209_GENERIC_PHASE 325 Bool zeroPhase = pcSlice->getPPS()->hasZeroResamplingPhase(pcSlice->getVPS()->getRefLayerId(m_layerId, i)); 326 #endif 327 #else 328 Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 329 && refEL.getWindowLeftOffset() == 0 && refEL.getWindowRightOffset() == 0 && refEL.getWindowTopOffset() == 0 && refEL.getWindowBottomOffset() == 0 ); 330 #endif 331 #else 332 Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 ); 333 #endif 334 335 #if VPS_EXTN_DIRECT_REF_LAYERS 336 TDecTop *pcTDecTopBase = (TDecTop *)getRefLayerDec( i ); 337 #else 338 TDecTop *pcTDecTopBase = (TDecTop *)getLayerDec( m_layerId-1 ); 339 #endif 340 //TComPic* pcPic = *(pcTDecTopBase->getListPic()->begin()); 341 TComPicYuv* pcPicYuvRecBase = (*(pcTDecTopBase->getListPic()->begin()))->getPicYuvRec(); 342 #if REPN_FORMAT_IN_VPS 343 #if O0194_DIFFERENT_BITDEPTH_EL_BL 344 UInt refLayerId = pcSlice->getVPS()->getRefLayerId(m_layerId, i); 345 Bool sameBitDepths = ( g_bitDepthLayer[CHANNEL_TYPE_LUMA][m_layerId] == g_bitDepthLayer[CHANNEL_TYPE_LUMA][refLayerId] ) && ( g_bitDepthLayer[CHANNEL_TYPE_CHROMA][m_layerId] == g_bitDepthLayer[CHANNEL_TYPE_CHROMA][refLayerId] ); 346 347 #if REF_IDX_MFM 348 if( pcPicYuvRecBase->getWidth(COMPONENT_Y) == pcSlice->getPicWidthInLumaSamples() && pcPicYuvRecBase->getHeight(COMPONENT_Y) == pcSlice->getPicHeightInLumaSamples() && equalOffsets && zeroPhase ) 349 { 350 rpcPic->setEqualPictureSizeAndOffsetFlag( i, true ); 351 } 352 353 if( !rpcPic->equalPictureSizeAndOffsetFlag(i) || !sameBitDepths 354 #else 355 if( pcPicYuvRecBase->getWidth() != pcSlice->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getPicHeightInLumaSamples() || !sameBitDepths 356 #if REF_REGION_OFFSET && RESAMPLING_FIX 357 || !equalOffsets 358 #if R0209_GENERIC_PHASE 359 || !zeroPhase 360 #endif 361 #else 362 || !zeroOffsets 363 #endif 364 #endif 365 #if Q0048_CGS_3D_ASYMLUT 366 || pcSlice->getPPS()->getCGSFlag() > 0 367 #endif 368 #if LAYER_CTB 369 || pcTDecTopBase->getActiveSPS()->getMaxCUWidth() != m_ppcTDecTop[m_layerId]->getActiveSPS()->getMaxCUWidth() || pcTDecTopBase->getActiveSPS()->getMaxCUHeight() != m_ppcTDecTop[m_layerId]->getActiveSPS()->getMaxCUHeight() || pcTDecTopBase->getActiveSPS()->getMaxCUDepth() != m_ppcTDecTop[m_layerId]->getActiveSPS()->getMaxCUDepth() 370 #endif 371 ) 372 #else 373 if(pcPicYuvRecBase->getWidth() != pcSlice->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getPicHeightInLumaSamples() 374 #if REF_REGION_OFFSET && RESAMPLING_FIX 375 || !equalOffsets 376 #if R0209_GENERIC_PHASE 377 || !zeroPhase 378 #endif 379 #else 380 || !zeroOffsets 381 #endif 382 ) 383 #endif 384 #else 385 if(pcPicYuvRecBase->getWidth() != pcSlice->getSPS()->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getSPS()->getPicHeightInLumaSamples() 386 #if REF_REGION_OFFSET && RESAMPLING_FIX 387 || !equalOffsets 388 #if R0209_GENERIC_PHASE 389 || !zeroPhase 390 #endif 391 #else 392 || !zeroOffsets 393 #endif 394 ) 395 #endif 396 { 397 rpcPic->setSpatialEnhLayerFlag( i, true ); 398 399 //only for scalable extension 400 assert( pcSlice->getVPS()->getScalabilityMask( SCALABILITY_ID ) == true ); 401 } 402 } 305 xSetSpatialEnhLayerFlag( pcSlice, rpcPic ); 403 306 } 404 307 … … 455 358 456 359 #if SVC_EXTENSION 360 if( m_layerId > 0 ) 361 { 362 xSetSpatialEnhLayerFlag( pcSlice, rpcPic ); 363 } 364 457 365 #if REPN_FORMAT_IN_VPS 458 366 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, … … 757 665 assert( i < MAX_TLAYER ); 758 666 #if LAYER_DECPICBUFF_PARAM && RESOLUTION_BASED_DPB 759 sps->setMaxDecPicBuffering( activeVPS->getMaxVpsLayerDecPicBuffMinus1( getCommonDecoderParams()->getTargetOutputLayerSetIdx(), sps->getLayerId(), i) + 1, i);760 #else 761 sps->setMaxDecPicBuffering( activeVPS->getMaxVpsDecPicBufferingMinus1( getCommonDecoderParams()->getTargetOutputLayerSetIdx(), sps->getLayerId(), i) + 1, i);667 sps->setMaxDecPicBuffering( activeVPS->getMaxVpsLayerDecPicBuffMinus1( m_commonDecoderParams->getTargetOutputLayerSetIdx(), sps->getLayerId(), i) + 1, i); 668 #else 669 sps->setMaxDecPicBuffering( activeVPS->getMaxVpsDecPicBufferingMinus1( m_commonDecoderParams->getTargetOutputLayerSetIdx(), activeVPS->getLayerIdcInOls( activeVPS->getOutputLayerSetIdx( m_commonDecoderParams->getTargetOutputLayerSetIdx() ), sps->getLayerId() ), i) + 1, i); 762 670 #endif 763 671 } … … 3299 3207 #endif 3300 3208 3209 Void TDecTop::xSetSpatialEnhLayerFlag(TComSlice* slice, TComPic* pic) 3210 { 3211 for(UInt i = 0; i < slice->getVPS()->getNumDirectRefLayers( m_layerId ); i++ ) 3212 { 3213 const Window scalEL = slice->getPPS()->getScaledRefLayerWindowForLayer(slice->getVPS()->getRefLayerId(m_layerId, i)); 3214 const Window refEL = slice->getPPS()->getRefLayerWindowForLayer(slice->getVPS()->getRefLayerId(m_layerId, i)); 3215 Bool equalOffsets = scalEL.hasEqualOffset(refEL); 3216 Bool zeroPhase = slice->getPPS()->hasZeroResamplingPhase(slice->getVPS()->getRefLayerId(m_layerId, i)); 3217 3218 TDecTop *pcTDecTopBase = (TDecTop *)getRefLayerDec( i ); 3219 //TComPic* pcPic = *(pcTDecTopBase->getListPic()->begin()); 3220 TComPicYuv* pcPicYuvRecBase = (*(pcTDecTopBase->getListPic()->begin()))->getPicYuvRec(); 3221 3222 UInt refLayerId = slice->getVPS()->getRefLayerId(m_layerId, i); 3223 Bool sameBitDepths = ( g_bitDepthLayer[CHANNEL_TYPE_LUMA][m_layerId] == g_bitDepthLayer[CHANNEL_TYPE_LUMA][refLayerId] ) && ( g_bitDepthLayer[CHANNEL_TYPE_CHROMA][m_layerId] == g_bitDepthLayer[CHANNEL_TYPE_CHROMA][refLayerId] ); 3224 3225 if( pcPicYuvRecBase->getWidth(COMPONENT_Y) == slice->getPicWidthInLumaSamples() && pcPicYuvRecBase->getHeight(COMPONENT_Y) == slice->getPicHeightInLumaSamples() && equalOffsets && zeroPhase ) 3226 { 3227 pic->setEqualPictureSizeAndOffsetFlag( i, true ); 3228 } 3229 3230 if( !pic->equalPictureSizeAndOffsetFlag(i) || !sameBitDepths 3231 #if Q0048_CGS_3D_ASYMLUT 3232 || slice->getPPS()->getCGSFlag() > 0 3233 #endif 3234 #if LAYER_CTB 3235 || pcTDecTopBase->getActiveSPS()->getMaxCUWidth() != m_ppcTDecTop[m_layerId]->getActiveSPS()->getMaxCUWidth() || pcTDecTopBase->getActiveSPS()->getMaxCUHeight() != m_ppcTDecTop[m_layerId]->getActiveSPS()->getMaxCUHeight() || pcTDecTopBase->getActiveSPS()->getMaxCUDepth() != m_ppcTDecTop[m_layerId]->getActiveSPS()->getMaxCUDepth() 3236 #endif 3237 ) 3238 { 3239 pic->setSpatialEnhLayerFlag( i, true ); 3240 3241 //only for scalable extension 3242 assert( slice->getVPS()->getScalabilityMask( SCALABILITY_ID ) == true ); 3243 } 3244 } 3245 } 3246 3301 3247 #endif //SVC_EXTENSION 3302 3248
Note: See TracChangeset for help on using the changeset viewer.