Changeset 953 in SHVCSoftware
- Timestamp:
- 5 Jan 2015, 11:34:55 (10 years ago)
- Location:
- branches/SHM-dev/source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
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 } -
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) -
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; -
branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
r952 r953 46 46 #define CONFORMANCE_BITSTREAM_MODE 1 ///< In order to generate the metadata related to conformance bitstreams 47 47 #define FIX_CONF_MODE 1 48 #define FIX_NON_OUTPUT_LAYER 1 48 49 #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 49 50 #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 -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
r952 r953 127 127 m_confModeFlag = false; 128 128 #endif 129 #if FIX_NON_OUTPUT_LAYER 130 m_isOutputLayerFlag = false; 131 #endif 129 132 } 130 133 … … 569 572 // Execute Deblock + Cleanup 570 573 m_cGopDecoder.filterPicture(pcPic); 574 575 #if FIX_NON_OUTPUT_LAYER 576 if( this->getLayerDec(pcPic->getLayerId())->m_isOutputLayerFlag == false ) 577 { 578 pcPic->setOutputMark( false ); 579 } 580 #endif 571 581 572 582 TComSlice::sortPicList( m_cListPic ); // sorting for application output … … 2913 2923 CommonDecoderParams* params = this->getCommonDecoderParams(); 2914 2924 2925 #if !FIX_CONF_MODE 2915 2926 assert( params->getTargetLayerId() < vps->getMaxLayers() ); 2927 #endif 2916 2928 2917 2929 if( params->getValueCheckedFlag() ) … … 3016 3028 Int targetLsIdx = vps->getOutputLayerSetIdx( targetOlsIdx ); 3017 3029 params->setTargetLayerId( vps->getLayerSetLayerIdList( targetLsIdx, vps->getNumLayersInIdList(targetLsIdx)-1 ) ); 3030 #endif 3031 #if FIX_NON_OUTPUT_LAYER 3032 // Check if the current layer is an output layer 3033 for(Int i = 0; i < vps->getNumLayersInIdList( targetLsIdx ); i++) 3034 { 3035 if( vps->getOutputLayerFlag( targetOlsIdx, i ) ) 3036 { 3037 this->getLayerDec( vps->getLayerSetLayerIdList( targetLsIdx, i ) )->m_isOutputLayerFlag = true; 3038 } 3039 } 3018 3040 #endif 3019 3041 } -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h
r924 r953 171 171 std::vector<TComPic> m_confListPic; // Dynamic buffer for storing pictures for conformance purposes 172 172 #endif 173 #if FIX_NON_OUTPUT_LAYER 174 Bool m_isOutputLayerFlag; 175 #endif 173 176 public: 174 177 #if POC_RESET_RESTRICTIONS
Note: See TracChangeset for help on using the changeset viewer.