Changeset 507 in SHVCSoftware for branches/SHM-4.1-dev/source/Lib
- Timestamp:
- 25 Nov 2013, 17:32:16 (11 years ago)
- Location:
- branches/SHM-4.1-dev/source/Lib
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-4.1-dev/source/Lib/TLibCommon/TComDataCU.cpp
r494 r507 4028 4028 #endif 4029 4029 4030 #if O0098_SCALED_REF_LAYER_ID 4031 Int leftStartL = getSlice()->getSPS()->getScaledRefLayerWindowForLayer(getSlice()->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowLeftOffset(); 4032 Int topStartL = getSlice()->getSPS()->getScaledRefLayerWindowForLayer(getSlice()->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowTopOffset(); 4033 #else 4030 4034 Int leftStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowLeftOffset(); 4031 4035 Int topStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowTopOffset(); 4036 #endif 4032 4037 Int iBX = ((uiPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16; 4033 4038 Int iBY = ((uiPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16; -
branches/SHM-4.1-dev/source/Lib/TLibCommon/TComSlice.cpp
r504 r507 522 522 memset( refResamplingLayer, 0, sizeof( refResamplingLayer ) ); 523 523 #endif 524 #if !RESAMPLING_CONSTRAINT_BUG_FIX 524 525 const Window &scalEL = getSPS()->getScaledRefLayerWindow(m_interLayerPredLayerIdc[i]); 525 526 Int scalingOffset = ((scalEL.getWindowLeftOffset() == 0 ) && … … 528 529 (scalEL.getWindowBottomOffset() == 0 ) 529 530 ); 531 #endif 530 532 531 533 for( i=0; i < m_activeNumILRRefIdx; i++ ) 532 534 { 533 535 UInt refLayerIdc = m_interLayerPredLayerIdc[i]; 536 #if RESAMPLING_CONSTRAINT_BUG_FIX 537 #if O0098_SCALED_REF_LAYER_ID 538 const Window &scalEL = getSPS()->getScaledRefLayerWindowForLayer(m_pcVPS->getRefLayerId( m_layerId, m_interLayerPredLayerIdc[i] )); 539 #else 540 const Window &scalEL = getSPS()->getScaledRefLayerWindow(m_interLayerPredLayerIdc[i]); 541 #endif 542 Int scalingOffset = ((scalEL.getWindowLeftOffset() == 0 ) && 543 (scalEL.getWindowRightOffset() == 0 ) && 544 (scalEL.getWindowTopOffset() == 0 ) && 545 (scalEL.getWindowBottomOffset() == 0 ) 546 ); 547 #endif 534 548 if(!( g_posScalingFactor[refLayerIdc][0] == 65536 && g_posScalingFactor[refLayerIdc][1] == 65536 ) || (!scalingOffset)) // ratio 1x 535 549 { … … 2470 2484 const Int TComSPS::m_winUnitY[]={1,2,1,1}; 2471 2485 2486 #if O0098_SCALED_REF_LAYER_ID 2487 Window& TComSPS::getScaledRefLayerWindowForLayer(Int layerId) 2488 { 2489 static Window win; 2490 2491 for (Int i = 0; i < m_numScaledRefLayerOffsets; i++) 2492 { 2493 if (layerId == m_scaledRefLayerId[i]) 2494 { 2495 return m_scaledRefLayerWindow[i]; 2496 } 2497 } 2498 2499 win.resetWindow(); // scaled reference layer offsets are inferred to be zero when not present 2500 return win; 2501 } 2502 #endif 2503 2472 2504 TComPPS::TComPPS() 2473 2505 : m_PPSId (0) -
branches/SHM-4.1-dev/source/Lib/TLibCommon/TComSlice.h
r504 r507 1227 1227 #endif 1228 1228 UInt m_numScaledRefLayerOffsets; 1229 #if O0098_SCALED_REF_LAYER_ID 1230 UInt m_scaledRefLayerId[MAX_LAYERS]; 1231 #endif 1229 1232 Window m_scaledRefLayerWindow[MAX_LAYERS]; 1230 1233 #if REPN_FORMAT_IN_VPS … … 1412 1415 UInt getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; } 1413 1416 Void setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; } 1417 #if O0098_SCALED_REF_LAYER_ID 1418 UInt getScaledRefLayerId(Int x) { return m_scaledRefLayerId[x]; } 1419 Void setScaledRefLayerId(Int x, UInt id) { m_scaledRefLayerId[x] = id; } 1420 Window& getScaledRefLayerWindowForLayer( Int layerId ); 1421 #endif 1414 1422 Window& getScaledRefLayerWindow( Int x ) { return m_scaledRefLayerWindow[x]; } 1415 1423 #if REPN_FORMAT_IN_VPS -
branches/SHM-4.1-dev/source/Lib/TLibCommon/TypeDef.h
r504 r507 175 175 #define O0096_REP_FORMAT_INDEX 1 ///< JCTVC-O0096: identify SPS rep_format() with an index into the lists of formats in VPS extension. 176 176 #define O0096_DEFAULT_DEPENDENCY_TYPE 1 ///< JCTVC-O0096: specify default dependency type for all direct reference layers 177 178 #define RESAMPLING_CONSTRAINT_BUG_FIX 1 179 #define O0098_SCALED_REF_LAYER_ID 1 ///< JCTVC-O0098: signal scaled reference id 177 180 178 181 #else -
branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r505 r507 861 861 { 862 862 Window& scaledWindow = pcSPS->getScaledRefLayerWindow(i); 863 #if O0098_SCALED_REF_LAYER_ID 864 READ_CODE( 6, uiCode, "scaled_ref_layer_left_id" ); pcSPS->setScaledRefLayerId( i, uiCode ); 865 #endif 863 866 READ_SVLC( iCode, "scaled_ref_layer_left_offset" ); scaledWindow.setWindowLeftOffset (iCode << 1); 864 867 READ_SVLC( iCode, "scaled_ref_layer_top_offset" ); scaledWindow.setWindowTopOffset (iCode << 1); -
branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecTop.cpp
r494 r507 278 278 for(UInt i = 0; i < pcSlice->getVPS()->getNumDirectRefLayers( m_layerId ); i++ ) 279 279 { 280 #if O0098_SCALED_REF_LAYER_ID 281 const Window scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, i)); 282 #else 280 283 const Window scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(i); 284 #endif 281 285 Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 ); 282 286 … … 1194 1198 #endif 1195 1199 1200 #if O0098_SCALED_REF_LAYER_ID 1201 const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc)); 1202 #else 1196 1203 const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc); 1204 #endif 1197 1205 1198 1206 Int widthBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(); … … 1211 1219 if( pcPic->isSpatialEnhLayer(refLayerIdc) ) 1212 1220 { 1221 #if O0098_SCALED_REF_LAYER_ID 1222 Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc)); 1223 #else 1224 Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc); 1225 #endif 1213 1226 #if O0215_PHASE_ALIGNMENT 1214 1227 #if O0194_JOINT_US_BITSHIFT 1215 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() );1216 #else 1217 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() );1228 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() ); 1229 #else 1230 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() ); 1218 1231 #endif 1219 1232 #else 1220 1233 #if O0194_JOINT_US_BITSHIFT 1221 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc));1222 #else 1223 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc));1234 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1235 #else 1236 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1224 1237 #endif 1225 1238 #endif -
branches/SHM-4.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r506 r507 684 684 { 685 685 Window scaledWindow = pcSPS->getScaledRefLayerWindow(i); 686 #if O0098_SCALED_REF_LAYER_ID 687 WRITE_CODE( pcSPS->getScaledRefLayerId(i), 6, "scaled_ref_layer_id" ); 688 #endif 686 689 WRITE_SVLC( scaledWindow.getWindowLeftOffset() >> 1, "scaled_ref_layer_left_offset" ); 687 690 WRITE_SVLC( scaledWindow.getWindowTopOffset() >> 1, "scaled_ref_layer_top_offset" ); -
branches/SHM-4.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r506 r507 783 783 } 784 784 785 #if O0098_SCALED_REF_LAYER_ID 786 const Window &scalEL = m_pcEncTop->getScaledRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc)); 787 #else 785 788 const Window &scalEL = m_pcEncTop->getScaledRefLayerWindow(refLayerIdc); 789 #endif 786 790 787 791 Int widthBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(); … … 800 804 if( pcPic->isSpatialEnhLayer(refLayerIdc)) 801 805 { 806 #if O0098_SCALED_REF_LAYER_ID 807 Window scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc)); 808 #else 809 Window scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc); 810 #endif 802 811 #if O0215_PHASE_ALIGNMENT 803 812 #if O0194_JOINT_US_BITSHIFT 804 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() );805 #else 806 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() );813 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() ); 814 #else 815 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() ); 807 816 #endif 808 817 #else 809 818 #if O0194_JOINT_US_BITSHIFT 810 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc));811 #else 812 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc));819 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 820 #else 821 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 813 822 #endif 814 823 #endif -
branches/SHM-4.1-dev/source/Lib/TLibEncoder/TEncTop.cpp
r506 r507 791 791 for(UInt i = 0; i < m_cVPS.getNumDirectRefLayers( m_layerId ); i++ ) 792 792 { 793 #if O0098_SCALED_REF_LAYER_ID 794 const Window scalEL = getSPS()->getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i)); 795 #else 793 796 const Window scalEL = getSPS()->getScaledRefLayerWindow(i); 797 #endif 794 798 Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 ); 795 799 … … 842 846 for(UInt i = 0; i < m_cVPS.getNumDirectRefLayers( m_layerId ); i++ ) 843 847 { 848 #if O0098_SCALED_REF_LAYER_ID 849 const Window scalEL = getSPS()->getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i)); 850 #else 844 851 const Window scalEL = getSPS()->getScaledRefLayerWindow(i); 852 #endif 845 853 Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 ); 846 854 … … 912 920 for(Int i = 0; i < m_cSPS.getNumScaledRefLayerOffsets(); i++) 913 921 { 922 #if O0098_SCALED_REF_LAYER_ID 923 m_cSPS.setScaledRefLayerId(i, m_scaledRefLayerId[i]); 924 #endif 914 925 m_cSPS.getScaledRefLayerWindow(i) = m_scaledRefLayerWindow[i]; 915 926 } … … 1683 1694 } 1684 1695 #endif 1696 1697 #if O0098_SCALED_REF_LAYER_ID 1698 Window& TEncTop::getScaledRefLayerWindowForLayer(Int layerId) 1699 { 1700 static Window win; 1701 1702 for (Int i = 0; i < m_numScaledRefLayerOffsets; i++) 1703 { 1704 if (layerId == m_scaledRefLayerId[i]) 1705 { 1706 return m_scaledRefLayerWindow[i]; 1707 } 1708 } 1709 1710 win.resetWindow(); // scaled reference layer offsets are inferred to be zero when not present 1711 return win; 1712 } 1713 #endif 1714 1685 1715 #endif //SVC_EXTENSION 1686 1716 //! \} -
branches/SHM-4.1-dev/source/Lib/TLibEncoder/TEncTop.h
r494 r507 141 141 #endif 142 142 UInt m_numScaledRefLayerOffsets; 143 #if O0098_SCALED_REF_LAYER_ID 144 UInt m_scaledRefLayerId[MAX_LAYERS]; 145 #endif 143 146 Window m_scaledRefLayerWindow[MAX_LAYERS]; 144 147 #if POC_RESET_FLAG … … 209 212 Void setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; } 210 213 UInt getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; } 214 #if O0098_SCALED_REF_LAYER_ID 215 Void setScaledRefLayerId(Int x, UInt id) { m_scaledRefLayerId[x] = id; } 216 UInt getScaledRefLayerId(Int x) { return m_scaledRefLayerId[x]; } 217 Window& getScaledRefLayerWindowForLayer(Int layerId); 218 #endif 211 219 Window& getScaledRefLayerWindow(Int x) { return m_scaledRefLayerWindow[x]; } 212 220 #endif //SVC_EXTENSION
Note: See TracChangeset for help on using the changeset viewer.