- Timestamp:
- 2 May 2013, 02:57:45 (12 years ago)
- Location:
- branches/SHM-2.0-dev/source
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-2.0-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r133 r134 141 141 Void TAppEncCfg::destroy() 142 142 { 143 #if VPS_EXTN_DIRECT_REF_LAYERS 144 for(Int layer = 0; layer < MAX_LAYERS; layer++) 145 { 146 if( m_acLayerCfg[layer].m_numDirectRefLayers > 0 ) 147 { 148 delete [] m_acLayerCfg[layer].m_refLayerIds; 149 } 150 } 151 #endif 143 152 } 144 153 -
branches/SHM-2.0-dev/source/Lib/TLibCommon/TComDataCU.cpp
r125 r134 1835 1835 { 1836 1836 Int refIdxL0 = cMvFieldL0.getRefIdx(); 1837 if(getSlice()->getRefPic(REF_PIC_LIST_0, refIdxL0)->isILR( ))1837 if(getSlice()->getRefPic(REF_PIC_LIST_0, refIdxL0)->isILR(m_layerId)) 1838 1838 { 1839 1839 checkZeroMVILR &= (cMvFieldL0.getHor() == 0 && cMvFieldL0.getVer() == 0); … … 1843 1843 { 1844 1844 Int refIdxL1 = cMvFieldL1.getRefIdx(); 1845 if(getSlice()->getRefPic(REF_PIC_LIST_1, refIdxL1)->isILR( ))1845 if(getSlice()->getRefPic(REF_PIC_LIST_1, refIdxL1)->isILR(m_layerId)) 1846 1846 { 1847 1847 checkZeroMVILR &= (cMvFieldL1.getHor() == 0 && cMvFieldL1.getVer() == 0); … … 1859 1859 Bool checkZeroMVILR = true; 1860 1860 1861 if(getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR( ))1861 if(getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR(m_layerId)) 1862 1862 { 1863 1863 AMVPInfo* pcAMVPInfo = getCUMvField(eRefPicList)->getAMVPInfo(); -
branches/SHM-2.0-dev/source/Lib/TLibCommon/TComPic.h
r125 r134 124 124 #endif 125 125 #if REF_IDX_ME_ZEROMV || ENCODER_FAST_MODE || REF_IDX_MFM 126 Bool isILR( UInt refLayer = 0 ) {return (getIsLongTerm() && m_layerId == refLayer);}126 Bool isILR( UInt currLayerId ) { return ( getIsLongTerm() && m_layerId < currLayerId ); } 127 127 #endif 128 128 -
branches/SHM-2.0-dev/source/Lib/TLibCommon/TComPrediction.cpp
r133 r134 495 495 496 496 #if REF_IDX_ME_ZEROMV 497 assert( ( pcCU->getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR( ) && cMv.getHor() == 0 && cMv.getVer() == 0 ) || pcCU->getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR() == false );497 assert( ( pcCU->getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR(pcCU->getLayerId()) && cMv.getHor() == 0 && cMv.getVer() == 0 ) || pcCU->getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR(pcCU->getLayerId()) == false ); 498 498 #endif 499 499 -
branches/SHM-2.0-dev/source/Lib/TLibCommon/TComSlice.h
r133 r134 663 663 #if VPS_EXTN_DIRECT_REF_LAYERS 664 664 // Direct dependency of layers 665 Bool getDirectDependencyFlag(Int i, Int j) { return m_directDependencyFlag[i][j]; }666 Void setDirectDependencyFlag(Int i, Int j, Bool x) { m_directDependencyFlag[i][j] = x; }667 668 UInt getNumDirectRefLayers(Int i) { return m_numDirectRefLayers[i];}669 Void setNumDirectRefLayers(Int i, UInt x) { m_numDirectRefLayers[i] = x; }670 671 UInt getRefLayerId(Int i, Int j) { return m_refLayerId[i][j];}672 Void setRefLayerId(Int i, Int j, UInt x) { m_refLayerId[i][j] = x;}665 Bool getDirectDependencyFlag(Int currLayerId, Int refLayerId) { return m_directDependencyFlag[currLayerId][refLayerId]; } 666 Void setDirectDependencyFlag(Int currLayerId, Int refLayerId, Bool x) { m_directDependencyFlag[currLayerId][refLayerId] = x; } 667 668 UInt getNumDirectRefLayers(Int layerId) { return m_numDirectRefLayers[layerId]; } 669 Void setNumDirectRefLayers(Int layerId, UInt refLayerNum) { m_numDirectRefLayers[layerId] = refLayerNum; } 670 671 UInt getRefLayerId(Int layerId, Int refLayerIdx) { return m_refLayerId[layerId][refLayerIdx]; } 672 Void setRefLayerId(Int layerId, Int refLayerIdx, UInt refLayerId) { m_refLayerId[layerId][refLayerIdx] = refLayerId; } 673 673 #endif 674 674 }; -
branches/SHM-2.0-dev/source/Lib/TLibCommon/TypeDef.h
r133 r134 44 44 45 45 #if SVC_EXTENSION 46 #define MAX_LAYERS 2 ///< max number of layers the codec is supposed to handle 47 46 48 #define VPS_RENAME 1 ///< Rename variables max_layer_id and num_layer_sets_minus1 in VPS 47 49 #define VPS_EXTNS 1 ///< Include function structure for VPS extensions … … 51 53 #define VPS_EXTN_PROFILE_INFO 1 ///< Include profile information for layer sets in VPS extension 52 54 #define VPS_EXTN_DIRECT_REF_LAYERS 1 ///< Include indication of direct dependency of layers in VPS extension 53 # endif54 # define MAX_LAYERS 2 ///< max number of layers the codec is supposed to handle55 #define VPS_EXTN_DIRECT_REF_LAYERS_CONTINUE 1 56 #endif 55 57 56 58 #define SVC_COL_BLK 1 ///< get co-located block … … 159 161 #if VPS_RENAME 160 162 #define MAX_VPS_LAYER_SETS_PLUS1 1024 161 #define MAX_VPS_LAYER_ID_PLUS1 2163 #define MAX_VPS_LAYER_ID_PLUS1 MAX_LAYERS 162 164 #else 163 165 #define MAX_VPS_NUM_HRD_PARAMETERS 1 -
branches/SHM-2.0-dev/source/Lib/TLibDecoder/TDecGop.cpp
r125 r134 247 247 for (Int iRefIndex = 0; iRefIndex < pcSlice->getNumRefIdx(RefPicList(iRefList)); iRefIndex++) 248 248 { 249 #if VPS_EXTN_DIRECT_REF_LAYERS_CONTINUE 250 if( pcSlice->getRefPic(RefPicList(iRefList), iRefIndex)->isILR( m_layerId ) ) 251 { 252 printf( "%d(%d) ", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex), pcSlice->getRefPic(RefPicList(iRefList), iRefIndex)->getLayerId() ); 253 } 254 else 255 #endif 249 256 printf ("%d ", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex)); 250 257 } -
branches/SHM-2.0-dev/source/Lib/TLibDecoder/TDecTop.cpp
r133 r134 179 179 m_cIlpPic[0]->copyUpsampledPictureYuv(pcPic->getFullPelBaseRec(), m_cIlpPic[0]->getPicYuvRec()); 180 180 m_cIlpPic[0]->getSlice(0)->setPOC(pcPic->getPOC()); 181 m_cIlpPic[0]->setLayerId( 0); //set reference layerId181 m_cIlpPic[0]->setLayerId(pcPic->getSlice(0)->getBaseColPic()->getLayerId()); //set reference layerId 182 182 m_cIlpPic[0]->getPicYuvRec()->setBorderExtension(false); 183 183 m_cIlpPic[0]->getPicYuvRec()->extendPicBorder(); … … 243 243 if(m_layerId > 0) 244 244 { 245 #if VPS_EXTN_DIRECT_REF_LAYERS_CONTINUE 246 TDecTop *pcTDecTopBase = (TDecTop *)getRefLayerDec( m_layerId ); 247 #else 245 248 TDecTop *pcTDecTopBase = (TDecTop *)getLayerDec( m_layerId-1 ); 249 #endif 246 250 //TComPic* pcPic = *(pcTDecTopBase->getListPic()->begin()); 247 251 TComPicYuv* pcPicYuvRecBase = (*(pcTDecTopBase->getListPic()->begin()))->getPicYuvRec(); … … 795 799 796 800 #else 801 #if VPS_EXTN_DIRECT_REF_LAYERS_CONTINUE 802 TDecTop *pcTDecTop = (TDecTop *)getRefLayerDec( m_layerId ); 803 #else 797 804 TDecTop *pcTDecTop = (TDecTop *)getLayerDec( m_layerId-1 ); 805 #endif 798 806 TComList<TComPic*> *cListPic = pcTDecTop->getListPic(); 799 807 pcSlice->setBaseColPic ( *cListPic, m_layerId ); … … 1175 1183 } 1176 1184 1185 #if VPS_EXTN_DIRECT_REF_LAYERS_CONTINUE 1186 TDecTop* TDecTop::getRefLayerDec( UInt layerId ) 1187 { 1188 TComVPS* vps = m_parameterSetManagerDecoder[0].getActiveVPS(); 1189 if( vps->getNumDirectRefLayers( m_layerId ) <= 0 ) 1190 { 1191 return NULL; 1192 } 1193 1194 // currently only one reference layer is supported 1195 assert( vps->getNumDirectRefLayers( m_layerId ) == 1 ); 1196 1197 return (TDecTop *)getLayerDec( vps->getRefLayerId( m_layerId, 0 ) ); 1198 } 1199 #endif 1200 1177 1201 //! \} -
branches/SHM-2.0-dev/source/Lib/TLibDecoder/TDecTop.h
r125 r134 154 154 Void setNumLayer (UInt uiNum) { m_numLayer = uiNum; } 155 155 TComList<TComPic*>* getListPic() { return &m_cListPic; } 156 Void setLayerDec(TDecTop **p) { m_ppcTDecTop = p; } 157 TDecTop* getLayerDec(UInt layer) { return m_ppcTDecTop[layer]; } 156 Void setLayerDec(TDecTop **p) { m_ppcTDecTop = p; } 157 TDecTop* getLayerDec(UInt layer) { return m_ppcTDecTop[layer]; } 158 #if VPS_EXTN_DIRECT_REF_LAYERS_CONTINUE 159 TDecTop* getRefLayerDec(UInt layerId); 160 #endif 158 161 #if AVC_BASE 159 162 Void setBLReconFile( fstream* pFile ) { m_pBLReconFile = pFile; } -
branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r133 r134 534 534 if (m_layerId > 0) 535 535 { 536 #if VPS_EXTN_DIRECT_REF_LAYERS_CONTINUE 537 TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId]->getRefLayerEnc(m_layerId)->getListPic(); 538 #else 536 539 TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId-1]->getListPic(); 540 #endif 537 541 pcSlice->setBaseColPic (*cListPic, m_layerId ); 538 542 } … … 734 738 for(Int colIdx = 0; colIdx < pcSlice->getNumRefIdx( RefPicList(1 - ColFromL0Flag) ); colIdx++) 735 739 { 736 if( pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->isILR( ) )740 if( pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->isILR(m_layerId) ) 737 741 { 738 742 ColRefIdx = colIdx; … … 747 751 for(Int colIdx = 0; colIdx < pcSlice->getNumRefIdx( RefPicList(1 - ColFromL0Flag) ); colIdx++) 748 752 { 749 if( pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->isILR( ) )753 if( pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->isILR(m_layerId) ) 750 754 { 751 755 ColRefIdx = colIdx; … … 2550 2554 for (Int iRefIndex = 0; iRefIndex < pcSlice->getNumRefIdx(RefPicList(iRefList)); iRefIndex++) 2551 2555 { 2556 #if VPS_EXTN_DIRECT_REF_LAYERS_CONTINUE 2557 if( pcSlice->getRefPic(RefPicList(iRefList), iRefIndex)->isILR(m_layerId) ) 2558 { 2559 printf( "%d(%d) ", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex)-pcSlice->getLastIDR(), pcSlice->getRefPic(RefPicList(iRefList), iRefIndex)->getLayerId() ); 2560 } 2561 else 2562 #endif 2552 2563 printf ("%d ", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex)-pcSlice->getLastIDR()); 2553 2564 } -
branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncSearch.cpp
r133 r134 3296 3296 #if (ENCODER_FAST_MODE) 3297 3297 TComPic* pcPic = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxTemp ); 3298 if( !testILR && pcPic->isILR( ) && (ePartSize == SIZE_2Nx2N) )3298 if( !testILR && pcPic->isILR(pcCU->getLayerId()) && (ePartSize == SIZE_2Nx2N) ) 3299 3299 { 3300 3300 continue; … … 3622 3622 Bool testIter = true; 3623 3623 TComPic* pcPic = pcCU->getSlice()->getRefPic( RefPicList(1 - iRefList), iRefIdxBi[1 - iRefList] ); 3624 if(pcPic->isILR( ) && (ePartSize == SIZE_2Nx2N))3624 if(pcPic->isILR(pcCU->getLayerId()) && (ePartSize == SIZE_2Nx2N)) 3625 3625 { 3626 3626 testIter = false; //the fixed part is ILR, skip this iteration … … 3637 3637 Bool testRefIdx = true; 3638 3638 pcPic = pcCU->getSlice()->getRefPic( RefPicList(iRefList) , iRefIdxTemp ); 3639 if(pcPic->isILR( ) && (ePartSize == SIZE_2Nx2N))3639 if(pcPic->isILR(pcCU->getLayerId()) && (ePartSize == SIZE_2Nx2N)) 3640 3640 { 3641 3641 testRefIdx = false; //the refined part is ILR, skip this reference pic … … 4308 4308 // Do integer search 4309 4309 #if REF_IDX_ME_ZEROMV 4310 if( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->isILR( )) //ILR reference pic4310 if( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->isILR(pcCU->getLayerId())) //ILR reference pic 4311 4311 { 4312 4312 rcMv.setZero(); //use Mv(0, 0) for integer ME … … 4341 4341 { 4342 4342 #if REF_IDX_ME_ZEROMV 4343 if( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->isILR( )) //ILR reference pic4343 if( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->isILR(pcCU->getLayerId())) //ILR reference pic 4344 4344 { 4345 4345 xPatternSearchFracDIFMv0( pcCU, pcPatternKey, piRefY, iRefStride, &rcMv, cMvHalf, cMvQter, ruiCost, bBi ); … … 6315 6315 for( Int refIdx = 0; refIdx < pcCU->getSlice()->getNumRefIdx(eRefPicList); refIdx++ ) 6316 6316 { 6317 if( pcCU->getSlice()->getRefPic(eRefPicList, refIdx)->isILR( ) )6317 if( pcCU->getSlice()->getRefPic(eRefPicList, refIdx)->isILR(pcCU->getLayerId()) ) 6318 6318 { 6319 6319 iRefIdxTemp = refIdx; -
branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncTop.cpp
r133 r134 500 500 { 501 501 TEncPic* pcEPic = new TEncPic; 502 #if SVC_EXTENSION //Temporal solution, should be modified503 if(m_layerId > 0)504 {505 TEncTop *pcEncTopBase = (TEncTop *)getLayerEnc( m_layerId-1 );506 if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() )507 {508 pcEPic->setSpatialEnhLayerFlag( true );509 }510 }511 #endif512 502 513 503 #if SVC_UPSAMPLING … … 524 514 rpcPic = new TComPic; 525 515 526 #if SVC_EXTENSION //Temporal solution, should be modified527 if(m_layerId > 0)528 {529 TEncTop *pcEncTopBase = (TEncTop *)getLayerEnc( m_layerId-1 );530 if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() )531 {532 rpcPic->setSpatialEnhLayerFlag( true );533 }534 }535 #endif536 516 537 517 #if SVC_UPSAMPLING … … 543 523 #endif 544 524 } 525 526 #if SVC_EXTENSION //Temporal solution, should be modified 527 if(m_layerId > 0) 528 { 529 #if VPS_EXTN_DIRECT_REF_LAYERS_CONTINUE 530 TEncTop *pcEncTopBase = (TEncTop *)getRefLayerEnc( m_layerId ); 531 #else 532 TEncTop *pcEncTopBase = (TEncTop *)getLayerEnc( m_layerId-1 ); 533 #endif 534 if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() ) 535 { 536 rpcPic->setSpatialEnhLayerFlag( true ); 537 } 538 } 539 #endif 540 545 541 if (getUseSAO()) 546 542 { … … 1175 1171 } 1176 1172 1173 #if SVC_EXTENSION 1174 #if VPS_EXTN_DIRECT_REF_LAYERS_CONTINUE 1175 TEncTop* TEncTop::getRefLayerEnc( UInt layerId ) 1176 { 1177 if( m_ppcTEncTop[m_layerId]->getNumDirectRefLayers() <= 0 ) 1178 { 1179 return NULL; 1180 } 1181 1182 // currently only one reference layer is supported 1183 assert( m_ppcTEncTop[m_layerId]->getNumDirectRefLayers() == 1 ); 1184 1185 return (TEncTop *)getLayerEnc( getVPS()->getRefLayerId( m_layerId, 0 ) ); 1186 } 1187 #endif 1188 1177 1189 #if REF_IDX_FRAMEWORK 1178 1190 Void TEncTop::xInitILRP() … … 1211 1223 m_cIlpPic[0]->copyUpsampledPictureYuv(pcPic->getFullPelBaseRec(), m_cIlpPic[0]->getPicYuvRec()); 1212 1224 m_cIlpPic[0]->getSlice(0)->setPOC(pcPic->getPOC()); 1213 m_cIlpPic[0]->setLayerId( 0); //set reference layerId1225 m_cIlpPic[0]->setLayerId(pcPic->getSlice(0)->getBaseColPic()->getLayerId()); //set reference layerId 1214 1226 m_cIlpPic[0]->getPicYuvRec()->setBorderExtension(false); 1215 1227 m_cIlpPic[0]->getPicYuvRec()->extendPicBorder(); … … 1217 1229 } 1218 1230 #endif 1231 #endif 1219 1232 //! \} -
branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncTop.h
r133 r134 212 212 #if REF_IDX_FRAMEWORK 213 213 TComPic** getIlpList() { return m_cIlpPic; } 214 Void setILRPic(TComPic *pcPic);214 Void setILRPic(TComPic *pcPic); 215 215 #endif 216 216 #if REF_IDX_MFM 217 Void setMFMEnabledFlag (Bool flag) {m_bMFMEnabledFlag = flag;}218 Bool getMFMEnabledFlag() {return m_bMFMEnabledFlag;}217 Void setMFMEnabledFlag (Bool flag) {m_bMFMEnabledFlag = flag;} 218 Bool getMFMEnabledFlag() {return m_bMFMEnabledFlag;} 219 219 #endif 220 220 #if AVC_SYNTAX … … 222 222 fstream* getBLSyntaxFile() { return m_pBLSyntaxFile; } 223 223 #endif 224 Void encode( TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, 225 std::list<AccessUnit>& accessUnitsOut, Int iPicIdInGOP ); 226 Void encodePrep( TComPicYuv* pcPicYuvOrg ); 224 Void encode( TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsOut, Int iPicIdInGOP ); 225 Void encodePrep( TComPicYuv* pcPicYuvOrg ); 226 #if VPS_EXTN_DIRECT_REF_LAYERS_CONTINUE 227 TEncTop* getRefLayerEnc(UInt layerId); 228 #endif 227 229 #else 228 230 Void encode( Bool bEos, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut,
Note: See TracChangeset for help on using the changeset viewer.