Changeset 1378 in SHVCSoftware
- Timestamp:
- 23 Jul 2015, 20:39:49 (9 years ago)
- Location:
- branches/SHM-dev/source/App
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp
r1338 r1378 67 67 { 68 68 memset( m_apcTDecTop, NULL, sizeof(m_apcTDecTop) ); 69 memset( m_apcTVideoIOYuvReconFile, NULL, sizeof(m_apcTVideoIOYuvReconFile) ); 69 70 70 71 for(UInt layer=0; layer < MAX_LAYERS; layer++) 71 72 { 72 73 m_aiPOCLastDisplay[layer] = -MAX_INT; 73 m_apcTDecTop[layer] = &m_acTDecTop[layer];74 74 } 75 75 } … … 106 106 free ( m_pchReconFile[i] ); 107 107 m_pchReconFile[i] = NULL; 108 } 109 110 if( m_apcTDecTop[i] ) 111 { 112 delete m_apcTDecTop[i]; 113 m_apcTDecTop[i] = NULL; 114 } 115 116 if( m_apcTVideoIOYuvReconFile[i] ) 117 { 118 delete m_apcTVideoIOYuvReconFile[i]; 119 m_apcTVideoIOYuvReconFile[i] = NULL; 108 120 } 109 121 } … … 195 207 streamYUV.open( m_pchBLReconFile, fstream::in | fstream::binary ); 196 208 } 197 TComList<TComPic*> *cListPic = m_a cTDecTop[0].getListPic();198 m_a cTDecTop[0].setBLReconFile( &streamYUV );209 TComList<TComPic*> *cListPic = m_apcTDecTop[0]->getListPic(); 210 m_apcTDecTop[0]->setBLReconFile( &streamYUV ); 199 211 pcBLPic.setLayerId( 0 ); 200 212 cListPic->pushBack( &pcBLPic ); … … 245 257 else 246 258 { 247 bNewPicture = m_a cTDecTop[nalu.m_nuhLayerId].decode(nalu, m_iSkipFrame, m_aiPOCLastDisplay[nalu.m_nuhLayerId], curLayerId, bNewPOC);259 bNewPicture = m_apcTDecTop[nalu.m_nuhLayerId]->decode(nalu, m_iSkipFrame, m_aiPOCLastDisplay[nalu.m_nuhLayerId], curLayerId, bNewPOC); 248 260 249 261 #if SVC_POC 250 if( (bNewPicture && m_a cTDecTop[nalu.m_nuhLayerId].getParseIdc() == 3) || (m_acTDecTop[nalu.m_nuhLayerId].getParseIdc() == 0) )262 if( (bNewPicture && m_apcTDecTop[nalu.m_nuhLayerId]->getParseIdc() == 3) || (m_apcTDecTop[nalu.m_nuhLayerId]->getParseIdc() == 0) ) 251 263 #else 252 264 if (bNewPicture) … … 268 280 } 269 281 #if SVC_POC 270 else if(m_a cTDecTop[nalu.m_nuhLayerId].getParseIdc() == 1)282 else if(m_apcTDecTop[nalu.m_nuhLayerId]->getParseIdc() == 1) 271 283 { 272 284 bitstreamFile.clear(); … … 284 296 285 297 #if SVC_POC 286 if( ( (bNewPicture && m_a cTDecTop[nalu.m_nuhLayerId].getParseIdc() == 3) || m_acTDecTop[nalu.m_nuhLayerId].getParseIdc() == 0 || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS ) &&287 !m_a cTDecTop[nalu.m_nuhLayerId].getFirstSliceInSequence() )298 if( ( (bNewPicture && m_apcTDecTop[nalu.m_nuhLayerId]->getParseIdc() == 3) || m_apcTDecTop[nalu.m_nuhLayerId]->getParseIdc() == 0 || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS ) && 299 !m_apcTDecTop[nalu.m_nuhLayerId]->getFirstSliceInSequence() ) 288 300 #else 289 301 if ( (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS) && 290 !m_a cTDecTop[nalu.m_nuhLayerId].getFirstSliceInSequence() )302 !m_apcTDecTop[nalu.m_nuhLayerId]->getFirstSliceInSequence() ) 291 303 #endif 292 304 { 293 305 if (!loopFiltered[curLayerId] || bitstreamFile) 294 306 { 295 m_a cTDecTop[curLayerId].executeLoopFilters(poc, pcListPic);307 m_apcTDecTop[curLayerId]->executeLoopFilters(poc, pcListPic); 296 308 } 297 309 loopFiltered[curLayerId] = (nalu.m_nalUnitType == NAL_UNIT_EOS); … … 299 311 if (nalu.m_nalUnitType == NAL_UNIT_EOS) 300 312 { 301 m_a cTDecTop[nalu.m_nuhLayerId].setFirstSliceInSequence(true);313 m_apcTDecTop[nalu.m_nuhLayerId]->setFirstSliceInSequence(true); 302 314 } 303 315 } 304 316 else if ( (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS ) && 305 m_a cTDecTop[nalu.m_nuhLayerId].getFirstSliceInSequence () )306 { 307 m_a cTDecTop[nalu.m_nuhLayerId].setFirstSliceInPicture (true);317 m_apcTDecTop[nalu.m_nuhLayerId]->getFirstSliceInSequence () ) 318 { 319 m_apcTDecTop[nalu.m_nuhLayerId]->setFirstSliceInPicture (true); 308 320 } 309 321 310 322 #if SVC_POC 311 if( bNewPicture && m_a cTDecTop[nalu.m_nuhLayerId].getParseIdc() == 0 )323 if( bNewPicture && m_apcTDecTop[nalu.m_nuhLayerId]->getParseIdc() == 0 ) 312 324 { 313 325 outputAllPictures( nalu.m_nuhLayerId, true ); … … 327 339 } 328 340 } 329 m_a cTVideoIOYuvReconFile[curLayerId].open( m_pchReconFile[curLayerId], true, m_outputBitDepth, m_outputBitDepth, bitDepths.recon ); // write mode341 m_apcTVideoIOYuvReconFile[curLayerId]->open( m_pchReconFile[curLayerId], true, m_outputBitDepth, m_outputBitDepth, bitDepths.recon ); // write mode 330 342 331 343 openedReconFile[curLayerId] = true; … … 334 346 Bool outputPicturesFlag = true; 335 347 336 if( m_a cTDecTop[nalu.m_nuhLayerId].getNoOutputPriorPicsFlag() )348 if( m_apcTDecTop[nalu.m_nuhLayerId]->getNoOutputPriorPicsFlag() ) 337 349 { 338 350 outputPicturesFlag = false; … … 345 357 346 358 #if SVC_POC 347 if( bNewPicture && m_a cTDecTop[nalu.m_nuhLayerId].getParseIdc() != 0 )359 if( bNewPicture && m_apcTDecTop[nalu.m_nuhLayerId]->getParseIdc() != 0 ) 348 360 // New picture, slice header parsed but picture not decoded 349 361 #else … … 397 409 for(UInt layer = 0; layer <= m_tgtLayerId; layer++) 398 410 { 399 xFlushOutput( m_a cTDecTop[layer].getListPic(), layer );411 xFlushOutput( m_apcTDecTop[layer]->getListPic(), layer ); 400 412 } 401 413 #endif 402 414 // delete buffers 403 415 #if AVC_BASE 404 UInt layerIdxmin = m_a cTDecTop[0].getBLReconFile()->is_open() ? 1 : 0;416 UInt layerIdxmin = m_apcTDecTop[0]->getBLReconFile()->is_open() ? 1 : 0; 405 417 406 418 if( streamYUV.is_open() ) … … 418 430 #endif 419 431 { 420 m_a cTDecTop[layer].deletePicBuffer();432 m_apcTDecTop[layer]->deletePicBuffer(); 421 433 } 422 434 … … 607 619 #endif 608 620 { 621 m_apcTDecTop[layer] = new TDecTop; 622 m_apcTVideoIOYuvReconFile[layer] = new TVideoIOYuv; 623 609 624 // set layer ID 610 m_a cTDecTop[layer].setLayerId ( layer );625 m_apcTDecTop[layer]->setLayerId ( layer ); 611 626 612 627 // create decoder class 613 m_a cTDecTop[layer].create();614 615 m_a cTDecTop[layer].setLayerDec(m_apcTDecTop);628 m_apcTDecTop[layer]->create(); 629 630 m_apcTDecTop[layer]->setLayerDec(m_apcTDecTop); 616 631 } 617 632 #else … … 635 650 if ( m_pchReconFile[layer] ) 636 651 { 637 m_a cTVideoIOYuvReconFile[layer].close();652 m_apcTVideoIOYuvReconFile[layer]->close(); 638 653 } 639 654 640 655 // destroy decoder class 641 m_a cTDecTop[layer].destroy();656 m_apcTDecTop[layer]->destroy(); 642 657 } 643 658 #else … … 662 677 #endif 663 678 { 664 m_a cTDecTop[layer].init();665 m_a cTDecTop[layer].setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled);679 m_apcTDecTop[layer]->init(); 680 m_apcTDecTop[layer]->setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled); 666 681 #if CONFORMANCE_BITSTREAM_MODE 667 m_a cTDecTop[layer].setNumLayer( MAX_LAYERS );668 #else 669 m_a cTDecTop[layer].setNumLayer( m_tgtLayerId + 1 );670 #endif 671 m_a cTDecTop[layer].setCommonDecoderParams( &m_commonDecoderParams );682 m_apcTDecTop[layer]->setNumLayer( MAX_LAYERS ); 683 #else 684 m_apcTDecTop[layer]->setNumLayer( m_tgtLayerId + 1 ); 685 #endif 686 m_apcTDecTop[layer]->setCommonDecoderParams( &m_commonDecoderParams ); 672 687 } 673 688 #if CONFORMANCE_BITSTREAM_MODE 674 689 for(UInt layer = 0; layer < MAX_VPS_LAYER_IDX_PLUS1; layer++) 675 690 { 676 m_a cTDecTop[layer].setConfModeFlag( m_confModeFlag );691 m_apcTDecTop[layer]->setConfModeFlag( m_confModeFlag ); 677 692 } 678 693 #endif … … 799 814 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 800 815 801 m_a cTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(),816 m_apcTVideoIOYuvReconFile[layerId]->write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 802 817 m_outputColourSpaceConvert, 803 818 conf.getWindowLeftOffset() * xScal + defDisp.getWindowLeftOffset(), … … 894 909 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 895 910 896 m_a cTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), m_outputColourSpaceConvert,911 m_apcTVideoIOYuvReconFile[layerId]->write( pcPic->getPicYuvRec(), m_outputColourSpaceConvert, 897 912 conf.getWindowLeftOffset() * xScal + defDisp.getWindowLeftOffset(), 898 913 conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(), … … 1018 1033 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 1019 1034 1020 m_a cTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), m_outputColourSpaceConvert,1035 m_apcTVideoIOYuvReconFile[layerId]->write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), m_outputColourSpaceConvert, 1021 1036 conf.getWindowLeftOffset() *xScal + defDisp.getWindowLeftOffset(), 1022 1037 conf.getWindowRightOffset() *xScal + defDisp.getWindowRightOffset(), … … 1096 1111 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 1097 1112 1098 m_a cTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(),1113 m_apcTVideoIOYuvReconFile[layerId]->write( pcPic->getPicYuvRec(), 1099 1114 m_outputColourSpaceConvert, 1100 1115 conf.getWindowLeftOffset() *xScal + defDisp.getWindowLeftOffset(), … … 1232 1247 1233 1248 TComPicYuv* pPicCYuvRec = pic->getPicYuvRec(); 1234 m_a cTVideoIOYuvReconFile[layerId].write( pPicCYuvRec, m_outputColourSpaceConvert,1249 m_apcTVideoIOYuvReconFile[layerId]->write( pPicCYuvRec, m_outputColourSpaceConvert, 1235 1250 conf.getWindowLeftOffset() * xScal + defDisp.getWindowLeftOffset(), 1236 1251 conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(), … … 1362 1377 Void TAppDecTop::markAllPicturesAsErased(Int layerIdx) 1363 1378 { 1364 TComList<TComPic*>::iterator iterPic = m_a cTDecTop[layerIdx].getListPic()->begin();1365 Int iSize = Int( m_a cTDecTop[layerIdx].getListPic()->size() );1379 TComList<TComPic*>::iterator iterPic = m_apcTDecTop[layerIdx]->getListPic()->begin(); 1380 Int iSize = Int( m_apcTDecTop[layerIdx]->getListPic()->size() ); 1366 1381 1367 1382 for (Int i = 0; i < iSize; i++ ) … … 1374 1389 1375 1390 // pcPic is statically created for the external (AVC) base layer, no need to delete it 1376 if( !m_a cTDecTop[layerIdx].getParameterSetManager()->getActiveVPS()->getNonHEVCBaseLayerFlag() || layerIdx )1391 if( !m_apcTDecTop[layerIdx]->getParameterSetManager()->getActiveVPS()->getNonHEVCBaseLayerFlag() || layerIdx ) 1377 1392 { 1378 1393 delete pcPic; … … 1382 1397 } 1383 1398 1384 m_a cTDecTop[layerIdx].getListPic()->clear();1399 m_apcTDecTop[layerIdx]->getListPic()->clear(); 1385 1400 } 1386 1401 … … 1467 1482 Int picPosition = (Int)std::distance( listOfPocsInEachLayer[layerId].begin(), it ); 1468 1483 Int j; 1469 for(j = 0, iterPic = m_a cTDecTop[layerId].getListPic()->begin(); j < listOfPocsPositionInEachLayer[layerId][picPosition]; j++) // Picture to be output1484 for(j = 0, iterPic = m_apcTDecTop[layerId]->getListPic()->begin(); j < listOfPocsPositionInEachLayer[layerId][picPosition]; j++) // Picture to be output 1470 1485 { 1471 1486 iterPic++; … … 1513 1528 Int layerId = dpbStatus.m_targetDecLayerIdList[dpbLayerCtr]; 1514 1529 // Output all picutres "decoded" in that layer that have POC less than the current picture 1515 std::vector<TComPic> *layerBuffer = (m_acTDecTop->getLayerDec(layerId))->getConfListPic();1530 std::vector<TComPic> *layerBuffer = m_apcTDecTop[layerId]->getConfListPic(); 1516 1531 // Write all pictures to the file. 1517 1532 if( this->getDecodedYuvLayerRefresh(layerId) ) … … 1520 1535 strcpy(tempFileName, this->getDecodedYuvLayerFileName( layerId ).c_str()); 1521 1536 1522 const TComVPS *vps = m_a cTDecTop->getLayerDec(layerId)->getParameterSetManager()->getActiveVPS();1523 const TComSPS *sps = m_a cTDecTop->getLayerDec(layerId)->getParameterSetManager()->getActiveSPS();1537 const TComVPS *vps = m_apcTDecTop[layerId]->getParameterSetManager()->getActiveVPS(); 1538 const TComSPS *sps = m_apcTDecTop[layerId]->getParameterSetManager()->getActiveSPS(); 1524 1539 const BitDepths &bitDpeths = vps->getBitDepths(sps, layerId); 1525 1540 Int bitDepth[] = {bitDpeths.recon[CHANNEL_TYPE_LUMA], bitDpeths.recon[CHANNEL_TYPE_CHROMA]}; … … 1576 1591 TComList<TComPic*>::iterator iterPic; 1577 1592 Int j; 1578 for(j = 0, iterPic = m_a cTDecTop[0].getListPic()->begin(); j < listOfPocsPositionInEachLayer[0][0]; j++) // Picture to be output1593 for(j = 0, iterPic = m_apcTDecTop[0]->getListPic()->begin(); j < listOfPocsPositionInEachLayer[0][0]; j++) // Picture to be output 1579 1594 { 1580 1595 iterPic++; … … 1600 1615 for( Int i = 0; i < MAX_VPS_LAYER_IDX_PLUS1; i++ ) 1601 1616 { 1602 if( m_a cTDecTop[i].getListPic()->empty() )1617 if( m_apcTDecTop[i]->getListPic()->empty() ) 1603 1618 { 1604 1619 assert( listOfPocsInEachLayer[i].size() == 0 ); … … 1616 1631 1617 1632 // Picture to be output 1618 for( j = 0, iterPic = m_a cTDecTop[i].getListPic()->begin(); j < listOfPocsPositionInEachLayer[i][picPosition]; j++ )1633 for( j = 0, iterPic = m_apcTDecTop[i]->getListPic()->begin(); j < listOfPocsPositionInEachLayer[i][picPosition]; j++ ) 1619 1634 { 1620 1635 iterPic++; … … 1651 1666 for( Int layerIdx = 0; layerIdx < MAX_VPS_LAYER_IDX_PLUS1; layerIdx++ ) 1652 1667 { 1653 TComList <TComPic*> *pcListPic = m_a cTDecTop[layerIdx].getListPic();1668 TComList <TComPic*> *pcListPic = m_apcTDecTop[layerIdx]->getListPic(); 1654 1669 TComList<TComPic*>::iterator iterPic = pcListPic->begin(); 1655 1670 while ( iterPic != pcListPic->end() ) … … 1703 1718 for( Int i = 0; i < MAX_VPS_LAYER_IDX_PLUS1; i++ ) 1704 1719 { 1705 if( m_a cTDecTop[i].getListPic()->empty() )1720 if( m_apcTDecTop[i]->getListPic()->empty() ) 1706 1721 { 1707 1722 continue; … … 1710 1725 // To check # AUs that have at least one picture not output, 1711 1726 // For each layer, populate listOfPOcs if not already present 1712 TComList<TComPic*>::iterator iterPic = m_a cTDecTop[i].getListPic()->begin();1727 TComList<TComPic*>::iterator iterPic = m_apcTDecTop[i]->getListPic()->begin(); 1713 1728 Int picPositionInList = 0; 1714 while (iterPic != m_a cTDecTop[i].getListPic()->end())1729 while (iterPic != m_apcTDecTop[i]->getListPic()->end()) 1715 1730 { 1716 1731 TComPic* pic = *(iterPic); -
branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.h
r1292 r1378 64 64 // class interface 65 65 #if SVC_EXTENSION 66 TDecTop m_acTDecTop [MAX_LAYERS]; ///< decoder class [WARNING] suppose to use MAX_NUM_LAYER_IDS but decoder crashes, pending for further investigation 67 TDecTop* m_apcTDecTop [MAX_NUM_LAYER_IDS]; ///< decoder point class 68 TVideoIOYuv m_acTVideoIOYuvReconFile [MAX_NUM_LAYER_IDS]; ///< reconstruction YUV class 66 TDecTop* m_apcTDecTop[MAX_NUM_LAYER_IDS]; ///< decoder point class 67 TVideoIOYuv* m_apcTVideoIOYuvReconFile[MAX_NUM_LAYER_IDS]; ///< reconstruction YUV class 69 68 #else 70 69 TDecTop m_cTDecTop; ///< decoder class -
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r1377 r1378 1666 1666 { 1667 1667 UInt layer; 1668 const TComVPS *vps = m_apcTEncTop[0]->getVPS();1669 1668 const Int rateMultiplier = isField ? 2 : 1; 1670 1669
Note: See TracChangeset for help on using the changeset viewer.