Changeset 962 in SHVCSoftware for branches/SHM-upgrade
- Timestamp:
- 6 Jan 2015, 04:36:57 (10 years ago)
- Location:
- branches/SHM-upgrade/source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/SHM-upgrade/source/App/TAppDecoder/TAppDecCfg.cpp ¶
r961 r962 167 167 m_tgtLayerId = nLayerNum - 1; 168 168 assert( m_tgtLayerId >= 0 ); 169 assert( m_tgtLayerId < MAX_LAYERS ); 169 #if !FIX_CONF_MODE 170 assert( m_tgtLayerId < MAX_LAYERS ); // If this is wrong, it should be caught by asserts in other locations. 171 #endif 170 172 #if O0137_MAX_LAYERID 171 173 assert( m_tgtLayerId < MAX_NUM_LAYER_IDS ); … … 192 194 193 195 // Decoded layer YUV files 196 #if FIX_CONF_MODE 197 for(Int layer= 0; layer < MAX_VPS_LAYER_ID_PLUS1; layer++ ) 198 #else 194 199 for(UInt layer=0; layer<= m_tgtLayerId; layer++) 200 #endif 195 201 { 196 202 sprintf(fileNameSuffix, "%s-L%d.yuv", m_confPrefix.c_str(), layer); // olsIdx is the target output layer set index. … … 203 209 this->getCommonDecoderParams()->setTargetLayerId ( m_tgtLayerId ); 204 210 #endif 211 #if FIX_CONF_MODE 212 for(Int layer = 0; layer < MAX_VPS_LAYER_ID_PLUS1; layer++ ) 213 { 214 #else 205 215 for(UInt layer=0; layer<= m_tgtLayerId; layer++) 206 216 { 207 217 assert( layer < MAX_LAYERS ); 218 #endif 208 219 m_pchReconFile[layer] = cfg_ReconFile[layer].empty() ? NULL : strdup(cfg_ReconFile[layer].c_str()); 209 220 } -
TabularUnified branches/SHM-upgrade/source/App/TAppDecoder/TAppDecTop.cpp ¶
r961 r962 88 88 } 89 89 #if SVC_EXTENSION 90 #if FIX_CONF_MODE 91 for(Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1; i++ ) 92 #else 90 93 for( Int i = 0; i <= m_tgtLayerId; i++ ) 94 #endif 91 95 { 92 96 if( m_pchReconFile[i] ) … … 158 162 memset( loopFiltered, false, sizeof( loopFiltered ) ); 159 163 164 #if FIX_CONF_MODE 165 for(UInt layer = 0; layer < MAX_VPS_LAYER_ID_PLUS1; layer++) 166 #else 160 167 for(UInt layer=0; layer<=m_tgtLayerId; layer++) 168 #endif 161 169 { 162 170 openedReconFile[layer] = false; … … 397 405 pcBLPic.destroy(); 398 406 407 #if FIX_CONF_MODE 408 for(UInt layer = layerIdmin; layer < MAX_VPS_LAYER_ID_PLUS1; layer++) 409 #else 399 410 for(UInt layer = layerIdmin; layer <= m_tgtLayerId; layer++) 411 #endif 400 412 #else 401 413 for(UInt layer = 0; layer <= m_tgtLayerId; layer++) … … 582 594 initROM(); 583 595 596 #if FIX_CONF_MODE 597 for(UInt layer = 0; layer < MAX_VPS_LAYER_ID_PLUS1; layer++) 598 #else 584 599 for(UInt layer = 0; layer <= m_tgtLayerId; layer++) 600 #endif 585 601 { 586 602 // set layer ID … … 604 620 destroyROM(); 605 621 622 #if FIX_CONF_MODE 623 for(UInt layer = 0; layer < MAX_VPS_LAYER_ID_PLUS1; layer++) 624 #else 606 625 for(UInt layer = 0; layer <= m_tgtLayerId; layer++) 626 #endif 607 627 { 608 628 if ( m_pchReconFile[layer] ) … … 629 649 // initialize decoder class 630 650 #if SVC_EXTENSION 651 #if FIX_CONF_MODE 652 for(UInt layer = 0; layer < MAX_VPS_LAYER_ID_PLUS1; layer++) 653 #else 631 654 for(UInt layer = 0; layer <= m_tgtLayerId; layer++) 655 #endif 632 656 { 633 657 m_acTDecTop[layer].init(); … … 636 660 m_acTDecTop[layer].setColourRemappingInfoSEIEnabled(m_colourRemapSEIEnabled); 637 661 #endif 662 #if FIX_CONF_MODE 663 m_acTDecTop[layer].setNumLayer( MAX_LAYERS ); 664 #else 638 665 m_acTDecTop[layer].setNumLayer( m_tgtLayerId + 1 ); 666 #endif 639 667 #if OUTPUT_LAYER_SET_INDEX 640 668 m_acTDecTop[layer].setCommonDecoderParams( &m_commonDecoderParams ); … … 642 670 } 643 671 #if CONFORMANCE_BITSTREAM_MODE 672 #if FIX_CONF_MODE 673 for(UInt layer = 0; layer < MAX_VPS_LAYER_ID_PLUS1; layer++) 674 #else 644 675 for(UInt layer = 0; layer < MAX_LAYERS; layer++) 676 #endif 645 677 { 646 678 m_acTDecTop[layer].setConfModeFlag( m_confModeFlag ); … … 1483 1515 fprintf(fptr, "%8d%9d MD5:%s\n", pic->getLayerId(), pic->getSlice(0)->getPOC(), digestToString(recon_digest, numChar).c_str()); 1484 1516 fclose(fptr); 1485 1486 // Output all picutres "decoded" in that layer that have POC less than the current picture 1487 std::vector<TComPic> *layerBuffer = (m_acTDecTop->getLayerDec(pic->getLayerId()))->getConfListPic(); 1488 // Write all pictures to the file. 1489 if( this->getDecodedYuvLayerRefresh(layerIdx) ) 1490 { 1491 if (!m_outputBitDepth[CHANNEL_TYPE_LUMA]) { m_outputBitDepth[CHANNEL_TYPE_LUMA] = g_bitDepth[CHANNEL_TYPE_LUMA]; } 1492 if (!m_outputBitDepth[CHANNEL_TYPE_CHROMA]) { m_outputBitDepth[CHANNEL_TYPE_CHROMA] = g_bitDepth[CHANNEL_TYPE_CHROMA]; } 1493 1494 char tempFileName[256]; 1495 strcpy(tempFileName, this->getDecodedYuvLayerFileName( layerIdx ).c_str()); 1496 m_confReconFile[layerIdx].open(tempFileName, true, m_outputBitDepth, m_outputBitDepth, g_bitDepth ); // write mode 1497 this->setDecodedYuvLayerRefresh( layerIdx, false ); 1498 } 1499 const Window &conf = pic->getConformanceWindow(); 1500 const Window &defDisp = m_respectDefDispWindow ? pic->getDefDisplayWindow() : Window(); 1501 Int xScal = 1, yScal = 1; 1502 #if REPN_FORMAT_IN_VPS 1503 UInt chromaFormatIdc = pic->getSlice(0)->getChromaFormatIdc(); 1504 xScal = TComSPS::getWinUnitX( chromaFormatIdc ); 1505 yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 1506 #endif 1507 std::vector<TComPic>::iterator itPic; 1508 for(itPic = layerBuffer->begin(); itPic != layerBuffer->end(); itPic++) 1509 { 1510 TComPic checkPic = *itPic; 1511 if( checkPic.getPOC() <= pic->getPOC() ) 1512 { 1513 TComPicYuv* pPicCYuvRec = checkPic.getPicYuvRec(); 1514 m_confReconFile[layerIdx].write( pPicCYuvRec, m_outputColourSpaceConvert, 1515 conf.getWindowLeftOffset() * xScal + defDisp.getWindowLeftOffset(), 1516 conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(), 1517 conf.getWindowTopOffset() * yScal + defDisp.getWindowTopOffset(), 1518 conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset() ); 1519 layerBuffer->erase(itPic); 1520 itPic = layerBuffer->begin(); // Ensure doesn't go to infinite loop 1521 if(layerBuffer->size() == 0) 1522 { 1523 break; 1524 } 1525 } 1526 } 1527 } 1528 // Now to remove the pictures that have been output 1517 } 1529 1518 #endif 1530 1519 … … 1543 1532 } 1544 1533 #endif 1545 dpbStatus.m_numAUsNotDisplayed--; 1534 dpbStatus.m_numAUsNotDisplayed--; 1535 1536 #if CONFORMANCE_BITSTREAM_MODE 1537 if( m_confModeFlag ) 1538 { 1539 for( Int dpbLayerCtr = 0; dpbLayerCtr < dpbStatus.m_numLayers; dpbLayerCtr++) 1540 { 1541 Int layerIdx = dpbStatus.m_targetDecLayerIdList[dpbLayerCtr]; 1542 // Output all picutres "decoded" in that layer that have POC less than the current picture 1543 std::vector<TComPic> *layerBuffer = (m_acTDecTop->getLayerDec(layerIdx))->getConfListPic(); 1544 // Write all pictures to the file. 1545 if( this->getDecodedYuvLayerRefresh(layerIdx) ) 1546 { 1547 if (!m_outputBitDepth[CHANNEL_TYPE_LUMA]) { m_outputBitDepth[CHANNEL_TYPE_LUMA] = g_bitDepth[CHANNEL_TYPE_LUMA]; } 1548 if (!m_outputBitDepth[CHANNEL_TYPE_CHROMA]) { m_outputBitDepth[CHANNEL_TYPE_CHROMA] = g_bitDepth[CHANNEL_TYPE_CHROMA]; } 1549 1550 char tempFileName[256]; 1551 strcpy(tempFileName, this->getDecodedYuvLayerFileName( layerIdx ).c_str()); 1552 m_confReconFile[layerIdx].open(tempFileName, true, m_outputBitDepth, m_outputBitDepth, g_bitDepth ); // write mode 1553 this->setDecodedYuvLayerRefresh( layerIdx, false ); 1554 } 1555 1556 std::vector<TComPic>::iterator itPic; 1557 for(itPic = layerBuffer->begin(); itPic != layerBuffer->end(); itPic++) 1558 { 1559 TComPic checkPic = *itPic; 1560 const Window &conf = checkPic.getConformanceWindow(); 1561 const Window &defDisp = m_respectDefDispWindow ? checkPic.getDefDisplayWindow() : Window(); 1562 Int xScal = 1, yScal = 1; 1563 #if REPN_FORMAT_IN_VPS 1564 UInt chromaFormatIdc = checkPic.getSlice(0)->getChromaFormatIdc(); 1565 xScal = TComSPS::getWinUnitX( chromaFormatIdc ); 1566 yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 1567 #endif 1568 if( checkPic.getPOC() <= pocValue ) 1569 { 1570 TComPicYuv* pPicCYuvRec = checkPic.getPicYuvRec(); 1571 m_confReconFile[layerIdx].write( pPicCYuvRec, m_outputColourSpaceConvert, 1572 conf.getWindowLeftOffset() * xScal + defDisp.getWindowLeftOffset(), 1573 conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(), 1574 conf.getWindowTopOffset() * yScal + defDisp.getWindowTopOffset(), 1575 conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset() ); 1576 layerBuffer->erase(itPic); 1577 itPic = layerBuffer->begin(); // Ensure doesn't go to infinite loop 1578 if(layerBuffer->size() == 0) 1579 { 1580 break; 1581 } 1582 } 1583 } 1584 } 1585 } 1586 #endif 1546 1587 1547 1588 // Remove the picture from the listOfPocs -
TabularUnified branches/SHM-upgrade/source/App/TAppDecoder/TAppDecTop.h ¶
r961 r962 171 171 #if FIX_ALIGN_BUMPING 172 172 ::memset( m_targetDecLayerIdList, 0, sizeof(m_targetDecLayerIdList) ); 173 for(Int i = 0; i < MAX_ LAYERS; i++)173 for(Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1; i++) 174 174 { 175 175 m_layerIdToSubDpbIdMap[i] = -1; -
TabularUnified branches/SHM-upgrade/source/Lib/TLibCommon/TypeDef.h ¶
r961 r962 48 48 #define CONFORMANCE_BITSTREAM_MODE 1 ///< In order to generate the metadata related to conformance bitstreams 49 49 #define FIX_CONF_MODE 1 50 #define FIX_NON_OUTPUT_LAYER 1 50 51 #define SIGNALLING_BITRATE_PICRATE_FIX 1 ///< Fix for signalling of bitrate and picture rate info in VPS VUI to be more aligned to JCTVC-R1008 51 52 #define INFERENCE_POC_MSB_VAL_PRESENT 1 ///< JCTVC-Q0146 -- poc_msb_val_present_flag shall be equal to 0 when slice_header_extension_length is (inferred to be ) equal to 0 -
TabularUnified branches/SHM-upgrade/source/Lib/TLibDecoder/TDecTop.cpp ¶
r961 r962 132 132 m_confModeFlag = false; 133 133 #endif 134 #if FIX_NON_OUTPUT_LAYER 135 m_isOutputLayerFlag = false; 136 #endif 134 137 } 135 138 … … 473 476 474 477 m_cGopDecoder.filterPicture(pcPic); 478 479 #if FIX_NON_OUTPUT_LAYER 480 if( this->getLayerDec(pcPic->getLayerId())->m_isOutputLayerFlag == false ) 481 { 482 pcPic->setOutputMark( false ); 483 } 484 #endif 475 485 476 486 TComSlice::sortPicList( m_cListPic ); // sorting for application output … … 2903 2913 CommonDecoderParams* params = this->getCommonDecoderParams(); 2904 2914 2915 #if !FIX_CONF_MODE 2905 2916 assert( params->getTargetLayerId() < vps->getMaxLayers() ); 2917 #endif 2906 2918 2907 2919 if( params->getValueCheckedFlag() ) … … 3006 3018 Int targetLsIdx = vps->getOutputLayerSetIdx( targetOlsIdx ); 3007 3019 params->setTargetLayerId( vps->getLayerSetLayerIdList( targetLsIdx, vps->getNumLayersInIdList(targetLsIdx)-1 ) ); 3020 #endif 3021 #if FIX_NON_OUTPUT_LAYER 3022 // Check if the current layer is an output layer 3023 for(Int i = 0; i < vps->getNumLayersInIdList( targetLsIdx ); i++) 3024 { 3025 if( vps->getOutputLayerFlag( targetOlsIdx, i ) ) 3026 { 3027 this->getLayerDec( vps->getLayerSetLayerIdList( targetLsIdx, i ) )->m_isOutputLayerFlag = true; 3028 } 3029 } 3008 3030 #endif 3009 3031 } -
TabularUnified branches/SHM-upgrade/source/Lib/TLibDecoder/TDecTop.h ¶
r928 r962 174 174 std::vector<TComPic> m_confListPic; // Dynamic buffer for storing pictures for conformance purposes 175 175 #endif 176 #if FIX_NON_OUTPUT_LAYER 177 Bool m_isOutputLayerFlag; 178 #endif 176 179 public: 177 180 #if POC_RESET_RESTRICTIONS
Note: See TracChangeset for help on using the changeset viewer.