Changeset 389 in SHVCSoftware for branches/SHM-3.1-dev/source/App
- Timestamp:
- 10 Sep 2013, 17:27:55 (11 years ago)
- Location:
- branches/SHM-3.1-dev/source/App
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-3.1-dev/source/App/TAppDecoder/TAppDecTop.cpp
r374 r389 551 551 const Window &conf = pcPic->getConformanceWindow(); 552 552 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 553 #if REPN_FORMAT_IN_VPS 554 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); 555 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 556 m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), 557 conf.getWindowLeftOffset() * xScal + defDisp.getWindowLeftOffset(), 558 conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(), 559 conf.getWindowTopOffset() * yScal + defDisp.getWindowTopOffset(), 560 conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset() ); 561 562 #else 553 563 m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), 554 564 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), … … 556 566 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 557 567 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 568 #endif 558 569 } 559 570 … … 630 641 const Window &conf = pcPic->getConformanceWindow(); 631 642 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 643 #if REPN_FORMAT_IN_VPS 644 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); 645 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 646 m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), 647 conf.getWindowLeftOffset() *xScal + defDisp.getWindowLeftOffset(), 648 conf.getWindowRightOffset() *xScal + defDisp.getWindowRightOffset(), 649 conf.getWindowTopOffset() *yScal + defDisp.getWindowTopOffset(), 650 conf.getWindowBottomOffset()*yScal + defDisp.getWindowBottomOffset() ); 651 652 #else 632 653 m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), 633 654 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), … … 635 656 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 636 657 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 658 #endif 637 659 } 638 660 -
branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r377 r389 351 351 Double* cfg_fQP [MAX_LAYERS]; 352 352 353 #if REPN_FORMAT_IN_VPS 354 Int* cfg_repFormatIdx [MAX_LAYERS]; 355 #endif 353 356 Int* cfg_SourceWidth [MAX_LAYERS]; 354 357 Int* cfg_SourceHeight [MAX_LAYERS]; … … 399 402 cfg_ReconFile[layer] = &m_acLayerCfg[layer].m_cReconFile; 400 403 cfg_fQP[layer] = &m_acLayerCfg[layer].m_fQP; 404 #if REPN_FORMAT_IN_VPS 405 cfg_repFormatIdx[layer] = &m_acLayerCfg[layer].m_repFormatIdx; 406 #endif 401 407 cfg_SourceWidth[layer] = &m_acLayerCfg[layer].m_iSourceWidth; 402 408 cfg_SourceHeight[layer] = &m_acLayerCfg[layer].m_iSourceHeight; … … 469 475 ("FrameRate%d,-fr%d", cfg_FrameRate, 0, MAX_LAYERS, "Frame rate for layer %d") 470 476 ("LambdaModifier%d,-LM%d", m_adLambdaModifier, ( double )1.0, MAX_TLAYER, "Lambda modifier for temporal layer %d") 477 #if REPN_FORMAT_IN_VPS 478 ("RepFormatIdx%d", cfg_repFormatIdx, -1, MAX_LAYERS, "Index to the representation format structure used from the VPS") 479 #endif 471 480 #if VPS_EXTN_DIRECT_REF_LAYERS 472 481 #if M0457_PREDICTION_INDICATIONS … … 1127 1136 #endif 1128 1137 m_scalingListFile = cfg_ScalingListFile.empty() ? NULL : strdup(cfg_ScalingListFile.c_str()); 1129 1138 1139 #if REPN_FORMAT_IN_VPS_123 1140 for(Int layer = 0; layer < MAX_LAYERS; layer++) 1141 { 1142 m_acLayerCfg[layer].setSourceHeight( m_repFormatCfg[ m_acLayerCfg[layer].getRepFormatIdx() ].m_picHeightInLumaSamples); 1143 m_acLayerCfg[layer].setSourceWidth ( m_repFormatCfg[ m_acLayerCfg[layer].getRepFormatIdx() ].m_picWidthInLumaSamples ); 1144 } 1145 #endif 1130 1146 /* rules for input, output and internal bitdepths as per help text */ 1131 1147 if (!m_internalBitDepthY) { m_internalBitDepthY = m_inputBitDepthY; } -
branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncCfg.h
r377 r389 354 354 Int m_adaptiveResolutionChange; ///< Indicate adaptive resolution change frame 355 355 #endif 356 #if REPN_FORMAT_IN_VPS 357 RepFormatCfg m_repFormatCfg[16]; ///< Rep_format structures 358 #endif 356 359 public: 357 360 TAppEncCfg(); … … 381 384 Void cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString); 382 385 #endif 386 #if REPN_FORMAT_IN_VPS 387 RepFormatCfg* getRepFormatCfg(Int i) { return &m_repFormatCfg[i]; } 388 #endif 383 389 #endif 384 390 };// END CLASS DEFINITION TAppEncCfg -
branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp
r313 r389 32 32 m_conformanceMode( 0 ), 33 33 m_aidQP(NULL) 34 #if REPN_FORMAT_IN_VPS 35 , m_repFormatIdx (-1) 36 #endif 34 37 { 35 38 m_confLeft = m_confRight = m_confTop = m_confBottom = 0; -
branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncLayerCfg.h
r345 r389 84 84 GOPEntry m_GOPListLayer[MAX_GOP]; ///< for layer 85 85 #endif 86 #if REPN_FORMAT_IN_VPS 87 Int m_repFormatIdx; 88 #endif 86 89 public: 87 90 TAppEncLayerCfg(); … … 147 150 GOPEntry getGOPEntry(Int i ) {return m_GOPListLayer[i]; } 148 151 #endif 152 #if REPN_FORMAT_IN_VPS 153 Int getRepFormatIdx() { return m_repFormatIdx; } 154 Void setSourceWidth(Int x) {m_iSourceWidth = x; } 155 Void setSourceHeight(Int x) {m_iSourceHeight = x; } 156 #endif 149 157 }; // END CLASS DEFINITION TAppEncLayerCfg 150 158 -
branches/SHM-3.1-dev/source/App/TAppEncoder/TAppEncTop.cpp
r377 r389 90 90 vps->setMaxDecPicBuffering ( m_maxDecPicBuffering[i], i ); 91 91 } 92 92 #if REPN_FORMAT_IN_VPS 93 vps->setRepFormatIdxPresentFlag( true ); // Could be disabled to optimize in some cases. 94 Int maxRepFormatIdx = -1; 95 for(UInt layer=0; layer < m_numLayers; layer++) 96 { 97 assert( m_acLayerCfg[layer].getRepFormatIdx() != -1, "RepFormatIdx not assigned for a layer" ); 98 vps->setVpsRepFormatIdx( layer, m_acLayerCfg[layer].getRepFormatIdx() ); 99 maxRepFormatIdx = std::max( m_acLayerCfg[layer].getRepFormatIdx(), maxRepFormatIdx ); 100 } 101 assert( vps->getVpsRepFormatIdx( 0 ) == 0 ); // Base layer should point to the first one. 102 Int* mapIdxToLayer = new Int[maxRepFormatIdx + 1]; 103 // Check that all the indices from 0 to maxRepFormatIdx are used in the VPS 104 for(Int i = 0; i <= maxRepFormatIdx; i++) 105 { 106 mapIdxToLayer[i] = -1; 107 UInt layer; 108 for(layer=0; layer < m_numLayers; layer++) 109 { 110 if( vps->getVpsRepFormatIdx(layer) == i ) 111 { 112 mapIdxToLayer[i] = layer; 113 break; 114 } 115 } 116 assert( layer != m_numLayers ); // One of the VPS Rep format indices not set 117 } 118 vps->setVpsNumRepFormats( maxRepFormatIdx + 1 ); 119 for(UInt idx=0; idx < vps->getVpsNumRepFormats(); idx++) 120 { 121 RepFormat *repFormat = vps->getVpsRepFormat( idx ); 122 repFormat->setPicWidthVpsInLumaSamples ( m_acLayerCfg[mapIdxToLayer[idx]].getSourceWidth() ); 123 repFormat->setPicHeightVpsInLumaSamples ( m_acLayerCfg[mapIdxToLayer[idx]].getSourceHeight() ); 124 repFormat->setChromaFormatVpsIdc ( 1 ); // Need modification to change for each layer - corresponds to 420 125 repFormat->setSeparateColourPlaneVpsFlag( 0 ); // Need modification to change for each layer 126 repFormat->setBitDepthVpsLuma ( getInternalBitDepthY() ); // Need modification to change for each layer 127 repFormat->setBitDepthVpsChroma ( getInternalBitDepthC() ); // Need modification to change for each layer 128 } 129 delete [] mapIdxToLayer; 130 #endif 93 131 for(UInt layer=0; layer<m_numLayers; layer++) 94 132 {
Note: See TracChangeset for help on using the changeset viewer.