Changeset 953 in SHVCSoftware for branches/SHM-dev/source/App
- Timestamp:
- 5 Jan 2015, 11:34:55 (10 years ago)
- Location:
- branches/SHM-dev/source/App/TAppDecoder
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.cpp ¶
r952 r953 151 151 m_tgtLayerId = nLayerNum - 1; 152 152 assert( m_tgtLayerId >= 0 ); 153 assert( m_tgtLayerId < MAX_LAYERS ); 153 #if !FIX_CONF_MODE 154 assert( m_tgtLayerId < MAX_LAYERS ); // If this is wrong, it should be caught by asserts in other locations. 155 #endif 154 156 #if O0137_MAX_LAYERID 155 157 assert( m_tgtLayerId < MAX_NUM_LAYER_IDS ); … … 176 178 177 179 // Decoded layer YUV files 180 #if FIX_CONF_MODE 181 for(Int layer= 0; layer <= MAX_VPS_LAYER_ID_PLUS1-1; layer++ ) 182 #else 178 183 for(UInt layer=0; layer<= m_tgtLayerId; layer++) 184 #endif 179 185 { 180 186 sprintf(fileNameSuffix, "%s-L%d.yuv", m_confPrefix.c_str(), layer); // olsIdx is the target output layer set index. … … 187 193 this->getCommonDecoderParams()->setTargetLayerId ( m_tgtLayerId ); 188 194 #endif 195 #if FIX_CONF_MODE 196 for(Int layer = 0; layer <= MAX_VPS_LAYER_ID_PLUS1-1; layer++ ) 197 { 198 #else 189 199 for(UInt layer=0; layer<= m_tgtLayerId; layer++) 190 200 { 191 201 assert( layer < MAX_LAYERS ); 202 #endif 192 203 m_pchReconFile[layer] = cfg_ReconFile[layer].empty() ? NULL : strdup(cfg_ReconFile[layer].c_str()); 193 204 } -
TabularUnified branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp ¶
r952 r953 82 82 } 83 83 #if SVC_EXTENSION 84 #if FIX_CONF_MODE 85 for(Int i = 0; i <= MAX_VPS_LAYER_ID_PLUS1-1; i++ ) 86 #else 84 87 for( Int i = 0; i <= m_tgtLayerId; i++ ) 88 #endif 85 89 { 86 90 if( m_pchReconFile[i] ) … … 142 146 memset( loopFiltered, false, sizeof( loopFiltered ) ); 143 147 148 #if FIX_CONF_MODE 149 for(UInt layer = 0; layer <= MAX_VPS_LAYER_ID_PLUS1-1; layer++) 150 #else 144 151 for(UInt layer=0; layer<=m_tgtLayerId; layer++) 152 #endif 145 153 { 146 154 openedReconFile[layer] = false; … … 353 361 pcBLPic.destroy(); 354 362 363 #if FIX_CONF_MODE 364 for(UInt layer = layerIdmin; layer <= MAX_VPS_LAYER_ID_PLUS1-1; layer++) 365 #else 355 366 for(UInt layer = layerIdmin; layer <= m_tgtLayerId; layer++) 367 #endif 356 368 #else 357 369 for(UInt layer = 0; layer <= m_tgtLayerId; layer++) … … 522 534 // initialize global variables 523 535 initROM(); 524 536 #if FIX_CONF_MODE 537 for(UInt layer = 0; layer <= MAX_VPS_LAYER_ID_PLUS1-1; layer++) 538 #else 525 539 for(UInt layer = 0; layer <= m_tgtLayerId; layer++) 540 #endif 526 541 { 527 542 // set layer ID … … 544 559 // destroy ROM 545 560 destroyROM(); 546 561 #if FIX_CONF_MODE 562 for(UInt layer = 0; layer <= MAX_VPS_LAYER_ID_PLUS1-1; layer++) 563 #else 547 564 for(UInt layer = 0; layer <= m_tgtLayerId; layer++) 565 #endif 548 566 { 549 567 if ( m_pchReconFile[layer] ) … … 570 588 // initialize decoder class 571 589 #if SVC_EXTENSION 590 #if FIX_CONF_MODE 591 for(UInt layer = 0; layer <= MAX_VPS_LAYER_ID_PLUS1-1; layer++) 592 #else 572 593 for(UInt layer = 0; layer <= m_tgtLayerId; layer++) 594 #endif 573 595 { 574 596 m_acTDecTop[layer].init(); … … 577 599 m_acTDecTop[layer].setColourRemappingInfoSEIEnabled(m_colourRemapSEIEnabled); 578 600 #endif 601 #if FIX_CONF_MODE 602 m_acTDecTop[layer].setNumLayer( MAX_LAYERS ); 603 #else 579 604 m_acTDecTop[layer].setNumLayer( m_tgtLayerId + 1 ); 605 #endif 580 606 #if OUTPUT_LAYER_SET_INDEX 581 607 m_acTDecTop[layer].setCommonDecoderParams( this->getCommonDecoderParams() ); … … 583 609 } 584 610 #if CONFORMANCE_BITSTREAM_MODE 611 #if FIX_CONF_MODE 612 for(UInt layer = 0; layer < MAX_VPS_LAYER_ID_PLUS1; layer++) 613 #else 585 614 for(UInt layer = 0; layer < MAX_LAYERS; layer++) 586 { 587 m_acTDecTop[layer].setConfModeFlag( m_confModeFlag ); 615 #endif 616 { 617 m_acTDecTop[layer].setConfModeFlag ( this->getConfModeFlag() ); 588 618 } 589 619 #endif … … 1386 1416 fprintf(fptr, "%8d%9d MD5:%s\n", pic->getLayerId(), pic->getSlice(0)->getPOC(), digestToString(recon_digest, 16)); 1387 1417 fclose(fptr); 1388 1389 // Output all picutres "decoded" in that layer that have POC less than the current picture 1390 std::vector<TComPic> *layerBuffer = (m_acTDecTop->getLayerDec(pic->getLayerId()))->getConfListPic(); 1391 // Write all pictures to the file. 1392 if( this->getDecodedYuvLayerRefresh(layerIdx) ) 1393 { 1394 if (!m_outputBitDepthY) { m_outputBitDepthY = g_bitDepthY; } 1395 if (!m_outputBitDepthC) { m_outputBitDepthC = g_bitDepthC; } 1396 1397 char tempFileName[256]; 1398 strcpy(tempFileName, this->getDecodedYuvLayerFileName( layerIdx ).c_str()); 1399 m_confReconFile[layerIdx].open(tempFileName, true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode 1400 this->setDecodedYuvLayerRefresh( layerIdx, false ); 1401 } 1402 const Window &conf = pic->getConformanceWindow(); 1403 const Window &defDisp = m_respectDefDispWindow ? pic->getDefDisplayWindow() : Window(); 1404 Int xScal = 1, yScal = 1; 1405 #if REPN_FORMAT_IN_VPS 1406 UInt chromaFormatIdc = pic->getSlice(0)->getChromaFormatIdc(); 1407 xScal = TComSPS::getWinUnitX( chromaFormatIdc ); 1408 yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 1409 #endif 1410 std::vector<TComPic>::iterator itPic; 1411 for(itPic = layerBuffer->begin(); itPic != layerBuffer->end(); itPic++) 1412 { 1413 TComPic checkPic = *itPic; 1414 if( checkPic.getPOC() <= pic->getPOC() ) 1415 { 1416 TComPicYuv* pPicCYuvRec = checkPic.getPicYuvRec(); 1417 m_confReconFile[layerIdx].write( pPicCYuvRec, 1418 conf.getWindowLeftOffset() * xScal + defDisp.getWindowLeftOffset(), 1419 conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(), 1420 conf.getWindowTopOffset() * yScal + defDisp.getWindowTopOffset(), 1421 conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset() ); 1422 layerBuffer->erase(itPic); 1423 itPic = layerBuffer->begin(); // Ensure doesn't go to infinite loop 1424 if(layerBuffer->size() == 0) 1425 { 1426 break; 1427 } 1428 } 1429 } 1430 } 1431 // Now to remove the pictures that have been output 1432 #endif 1418 } 1419 #endif 1420 1433 1421 1434 1422 listOfPocsInEachLayer[layerIdx].erase( it ); … … 1448 1436 dpbStatus.m_numAUsNotDisplayed--; 1449 1437 1438 #if CONFORMANCE_BITSTREAM_MODE 1439 if( this->getConfModeFlag() ) 1440 { 1441 for( Int dpbLayerCtr = 0; dpbLayerCtr < dpbStatus.m_numLayers; dpbLayerCtr++) 1442 { 1443 Int layerIdx = dpbStatus.m_targetDecLayerIdList[dpbLayerCtr]; 1444 // Output all picutres "decoded" in that layer that have POC less than the current picture 1445 std::vector<TComPic> *layerBuffer = (m_acTDecTop->getLayerDec(layerIdx))->getConfListPic(); 1446 // Write all pictures to the file. 1447 if( this->getDecodedYuvLayerRefresh(layerIdx) ) 1448 { 1449 if (!m_outputBitDepthY) { m_outputBitDepthY = g_bitDepthY; } 1450 if (!m_outputBitDepthC) { m_outputBitDepthC = g_bitDepthC; } 1451 1452 char tempFileName[256]; 1453 strcpy(tempFileName, this->getDecodedYuvLayerFileName( layerIdx ).c_str()); 1454 m_confReconFile[layerIdx].open(tempFileName, true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode 1455 this->setDecodedYuvLayerRefresh( layerIdx, false ); 1456 } 1457 1458 std::vector<TComPic>::iterator itPic; 1459 for(itPic = layerBuffer->begin(); itPic != layerBuffer->end(); itPic++) 1460 { 1461 TComPic checkPic = *itPic; 1462 const Window &conf = checkPic.getConformanceWindow(); 1463 const Window &defDisp = m_respectDefDispWindow ? checkPic.getDefDisplayWindow() : Window(); 1464 Int xScal = 1, yScal = 1; 1465 #if REPN_FORMAT_IN_VPS 1466 UInt chromaFormatIdc = checkPic.getSlice(0)->getChromaFormatIdc(); 1467 xScal = TComSPS::getWinUnitX( chromaFormatIdc ); 1468 yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 1469 #endif 1470 if( checkPic.getPOC() <= pocValue ) 1471 { 1472 TComPicYuv* pPicCYuvRec = checkPic.getPicYuvRec(); 1473 m_confReconFile[layerIdx].write( pPicCYuvRec, 1474 conf.getWindowLeftOffset() * xScal + defDisp.getWindowLeftOffset(), 1475 conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(), 1476 conf.getWindowTopOffset() * yScal + defDisp.getWindowTopOffset(), 1477 conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset() ); 1478 layerBuffer->erase(itPic); 1479 itPic = layerBuffer->begin(); // Ensure doesn't go to infinite loop 1480 if(layerBuffer->size() == 0) 1481 { 1482 break; 1483 } 1484 } 1485 } 1486 } 1487 } 1488 #endif 1450 1489 // Remove the picture from the listOfPocs 1451 1490 listOfPocs.erase( listOfPocs.begin() ); 1452 1491 } 1492 1453 1493 1454 1494 TComVPS *TAppDecTop::findDpbParametersFromVps(std::vector<Int> const &listOfPocs, std::vector<Int> const *listOfPocsInEachLayer, std::vector<Int> const *listOfPocsPositionInEachLayer, DpbStatus &maxDpbLimit) -
TabularUnified branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.h ¶
r952 r953 169 169 #if FIX_ALIGN_BUMPING 170 170 ::memset( m_targetDecLayerIdList, 0, sizeof(m_targetDecLayerIdList) ); 171 for(Int i = 0; i < MAX_ LAYERS; i++)171 for(Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1; i++) 172 172 { 173 173 m_layerIdToSubDpbIdMap[i] = -1;
Note: See TracChangeset for help on using the changeset viewer.