Changeset 1574 in SHVCSoftware
- Timestamp:
- 20 Jun 2016, 19:14:44 (8 years ago)
- Location:
- branches/SHM-dev/source/Lib
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp
r1573 r1574 2959 2959 // use coldir. 2960 2960 const TComPic * const pColPic = getSlice()->getRefPic( RefPicList(getSlice()->isInterB() ? 1-getSlice()->getColFromL0Flag() : 0), getSlice()->getColRefIdx()); 2961 #if REDUCED_ENCODER_MEMORY 2962 if (!pColPic->getPicSym()->hasDPBPerCtuData()) 2963 { 2964 return false; 2965 } 2966 const TComPicSym::DPBPerCtuData * const pColDpbCtu = &(pColPic->getPicSym()->getDPBPerCtuData(ctuRsAddr)); 2967 const TComSlice * const pColSlice = pColDpbCtu->getSlice(); 2968 if(pColDpbCtu->getPartitionSize(partUnitIdx)==NUMBER_OF_PART_SIZES) 2969 #else 2961 2970 const TComDataCU * const pColCtu = pColPic->getCtu( ctuRsAddr ); 2962 2971 if(pColCtu->getPic()==0 || pColCtu->getPartitionSize(partUnitIdx)==NUMBER_OF_PART_SIZES) 2972 #endif 2963 2973 { 2964 2974 return false; 2965 2975 } 2966 2976 2977 #if REDUCED_ENCODER_MEMORY 2978 if (!pColDpbCtu->isInter(absPartAddr)) 2979 #else 2967 2980 if (!pColCtu->isInter(absPartAddr)) 2981 #endif 2968 2982 { 2969 2983 return false; … … 2971 2985 2972 2986 RefPicList eColRefPicList = getSlice()->getCheckLDC() ? eRefPicList : RefPicList(getSlice()->getColFromL0Flag()); 2987 #if REDUCED_ENCODER_MEMORY 2988 Int iColRefIdx = pColDpbCtu->getCUMvField(RefPicList(eColRefPicList))->getRefIdx(absPartAddr); 2989 #else 2973 2990 Int iColRefIdx = pColCtu->getCUMvField(RefPicList(eColRefPicList))->getRefIdx(absPartAddr); 2991 #endif 2974 2992 2975 2993 if (iColRefIdx < 0 ) 2976 2994 { 2977 2995 eColRefPicList = RefPicList(1 - eColRefPicList); 2996 #if REDUCED_ENCODER_MEMORY 2997 iColRefIdx = pColDpbCtu->getCUMvField(RefPicList(eColRefPicList))->getRefIdx(absPartAddr); 2998 #else 2978 2999 iColRefIdx = pColCtu->getCUMvField(RefPicList(eColRefPicList))->getRefIdx(absPartAddr); 3000 #endif 2979 3001 2980 3002 if (iColRefIdx < 0 ) … … 2985 3007 2986 3008 const Bool bIsCurrRefLongTerm = m_pcSlice->getRefPic(eRefPicList, refIdx)->getIsLongTerm(); 3009 #if REDUCED_ENCODER_MEMORY 3010 const Bool bIsColRefLongTerm = pColSlice->getIsUsedAsLongTerm(eColRefPicList, iColRefIdx); 3011 #else 2987 3012 const Bool bIsColRefLongTerm = pColCtu->getSlice()->getIsUsedAsLongTerm(eColRefPicList, iColRefIdx); 3013 #endif 2988 3014 2989 3015 if ( bIsCurrRefLongTerm != bIsColRefLongTerm ) … … 2993 3019 2994 3020 // Scale the vector. 3021 #if REDUCED_ENCODER_MEMORY 3022 const TComMv &cColMv = pColDpbCtu->getCUMvField(eColRefPicList)->getMv(absPartAddr); 3023 #else 2995 3024 const TComMv &cColMv = pColCtu->getCUMvField(eColRefPicList)->getMv(absPartAddr); 3025 #endif 2996 3026 if ( bIsCurrRefLongTerm /*|| bIsColRefLongTerm*/ ) 2997 3027 { … … 3001 3031 { 3002 3032 const Int currPOC = m_pcSlice->getPOC(); 3033 #if REDUCED_ENCODER_MEMORY 3034 const Int colPOC = pColSlice->getPOC(); 3035 const Int colRefPOC = pColSlice->getRefPOC(eColRefPicList, iColRefIdx); 3036 #else 3003 3037 const Int colPOC = pColCtu->getSlice()->getPOC(); 3004 3038 const Int colRefPOC = pColCtu->getSlice()->getRefPOC(eColRefPicList, iColRefIdx); 3039 #endif 3005 3040 const Int currRefPOC = m_pcSlice->getRefPic(eRefPicList, refIdx)->getPOC(); 3006 3041 const Int scale = xGetDistScaleFactor(currPOC, currRefPOC, colPOC, colRefPOC); … … 3053 3088 Void TComDataCU::compressMV() 3054 3089 { 3090 #if REDUCED_ENCODER_MEMORY 3091 const Int scaleFactor = std::max<Int>(1,4 * AMVP_DECIMATION_FACTOR / m_unitSize); 3092 TComPicSym &picSym=*(getPic()->getPicSym()); 3093 TComPicSym::DPBPerCtuData &dpbForCtu=picSym.getDPBPerCtuData(getCtuRsAddr()); 3094 3095 for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++) 3096 { 3097 dpbForCtu.m_CUMvField[i].compress(dpbForCtu.m_pePredMode, m_pePredMode, scaleFactor,m_acCUMvField[i]); 3098 memcpy(dpbForCtu.m_pePartSize, m_pePartSize, sizeof(*m_pePartSize)*m_uiNumPartition); 3099 dpbForCtu.m_pSlice = getSlice(); 3100 } 3101 #else 3055 3102 Int scaleFactor = 4 * AMVP_DECIMATION_FACTOR / m_unitSize; 3056 3103 if (scaleFactor > 0) … … 3061 3108 } 3062 3109 } 3110 #endif 3063 3111 } 3064 3112 -
branches/SHM-dev/source/Lib/TLibCommon/TComMotionInfo.cpp
r1549 r1574 328 328 * \param scale Factor by which to subsample motion information 329 329 */ 330 #if REDUCED_ENCODER_MEMORY 331 Void TComCUMvField::compress(SChar *pePredMode, const SChar* pePredModeSource, const Int scale, const TComCUMvField &source) 332 { 333 const Int numSubpartsWithIdenticalMotion = scale * scale; 334 assert( numSubpartsWithIdenticalMotion > 0 && numSubpartsWithIdenticalMotion <= m_uiNumPartition); 335 assert(source.m_uiNumPartition == m_uiNumPartition); 336 337 for ( Int partIdx = 0; partIdx < m_uiNumPartition; partIdx += numSubpartsWithIdenticalMotion ) 338 { 339 TComMv cMv(0,0); 340 Int iRefIdx = 0; 341 342 cMv = source.m_pcMv[ partIdx ]; 343 PredMode predMode = static_cast<PredMode>( pePredModeSource[ partIdx ] ); 344 iRefIdx = source.m_piRefIdx[ partIdx ]; 345 for ( Int i = 0; i < numSubpartsWithIdenticalMotion; i++ ) 346 { 347 m_pcMv[ partIdx + i ] = cMv; 348 pePredMode[ partIdx + i ] = predMode; 349 m_piRefIdx[ partIdx + i ] = iRefIdx; 350 } 351 } 352 } 353 #else 330 354 Void TComCUMvField::compress(SChar* pePredMode, Int scale) 331 355 { … … 349 373 } 350 374 } 375 #endif 351 376 //! \} -
branches/SHM-dev/source/Lib/TLibCommon/TComMotionInfo.h
r1550 r1574 153 153 } 154 154 155 #if REDUCED_ENCODER_MEMORY 156 Void compress(SChar *pePredMode, const SChar* pePredModeSource, const Int scale, const TComCUMvField &source); 157 #else 155 158 Void compress(SChar* pePredMode, Int scale); 159 #endif 156 160 157 161 #if SVC_EXTENSION -
branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp
r1550 r1574 78 78 } 79 79 #if SVC_EXTENSION 80 #if REDUCED_ENCODER_MEMORY 81 Void TComPic::create( const TComSPS &sps, const TComPPS &pps, const Bool bCreateEncoderSourcePicYuv, const Bool bCreateForImmediateReconstruction, const UInt layerId ) 82 #else 80 83 Void TComPic::create( const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual, const UInt layerId ) 84 #endif 81 85 { 82 86 destroy(); … … 92 96 m_layerId = layerId; 93 97 98 #if REDUCED_ENCODER_MEMORY 99 m_picSym.create( sps, pps, uiMaxDepth, bCreateForImmediateReconstruction, layerId ); 100 if (bCreateEncoderSourcePicYuv) 101 #else 94 102 m_picSym.create( sps, pps, uiMaxDepth, layerId ); 95 103 96 104 if (!bIsVirtual) 97 { 98 m_apcPicYuv[PIC_YUV_ORG] = new TComPicYuv; m_apcPicYuv[PIC_YUV_ORG]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true, &conformanceWindow ); 105 #endif 106 { 107 m_apcPicYuv[PIC_YUV_ORG ] = new TComPicYuv; m_apcPicYuv[PIC_YUV_ORG ]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true, &conformanceWindow ); 99 108 m_apcPicYuv[PIC_YUV_TRUE_ORG] = new TComPicYuv; m_apcPicYuv[PIC_YUV_TRUE_ORG]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true, &conformanceWindow ); 100 109 } 110 #if REDUCED_ENCODER_MEMORY 111 if (bCreateForImmediateReconstruction) 112 { 113 #endif 101 114 m_apcPicYuv[PIC_YUV_REC] = new TComPicYuv; m_apcPicYuv[PIC_YUV_REC]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true, &conformanceWindow ); 115 #if REDUCED_ENCODER_MEMORY 116 } 117 #endif 102 118 103 119 for( Int i = 0; i < MAX_LAYERS; i++ ) … … 117 133 } 118 134 #else 135 #if REDUCED_ENCODER_MEMORY 136 Void TComPic::create( const TComSPS &sps, const TComPPS &pps, const Bool bCreateEncoderSourcePicYuv, const Bool bCreateForImmediateReconstruction ) 137 #else 119 138 Void TComPic::create( const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual) 139 #endif 120 140 { 121 141 destroy(); … … 128 148 const UInt uiMaxDepth = sps.getMaxTotalCUDepth(); 129 149 150 #if REDUCED_ENCODER_MEMORY 151 m_picSym.create( sps, pps, uiMaxDepth, bCreateForImmediateReconstruction ); 152 if (bCreateEncoderSourcePicYuv) 153 #else 130 154 m_picSym.create( sps, pps, uiMaxDepth ); 131 155 if (!bIsVirtual) 156 #endif 132 157 { 133 158 m_apcPicYuv[PIC_YUV_ORG ] = new TComPicYuv; m_apcPicYuv[PIC_YUV_ORG ]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true ); 134 159 m_apcPicYuv[PIC_YUV_TRUE_ORG] = new TComPicYuv; m_apcPicYuv[PIC_YUV_TRUE_ORG]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true ); 135 160 } 136 m_apcPicYuv[PIC_YUV_REC] = new TComPicYuv; m_apcPicYuv[PIC_YUV_REC]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true ); 161 #if REDUCED_ENCODER_MEMORY 162 if (bCreateForImmediateReconstruction) 163 { 164 #endif 165 m_apcPicYuv[PIC_YUV_REC] = new TComPicYuv; m_apcPicYuv[PIC_YUV_REC]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true ); 166 #if REDUCED_ENCODER_MEMORY 167 } 168 #endif 137 169 138 170 // there are no SEI messages associated with this picture initially … … 142 174 } 143 175 m_bUsedByCurr = false; 176 } 177 #endif 178 179 #if REDUCED_ENCODER_MEMORY 180 Void TComPic::prepareForEncoderSourcePicYuv() 181 { 182 const TComSPS &sps=m_picSym.getSPS(); 183 184 const ChromaFormat chromaFormatIDC = sps.getChromaFormatIdc(); 185 const Int iWidth = sps.getPicWidthInLumaSamples(); 186 const Int iHeight = sps.getPicHeightInLumaSamples(); 187 const UInt uiMaxCuWidth = sps.getMaxCUWidth(); 188 const UInt uiMaxCuHeight = sps.getMaxCUHeight(); 189 const UInt uiMaxDepth = sps.getMaxTotalCUDepth(); 190 191 if (m_apcPicYuv[PIC_YUV_ORG ]==NULL) 192 { 193 m_apcPicYuv[PIC_YUV_ORG ] = new TComPicYuv; m_apcPicYuv[PIC_YUV_ORG ]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true ); 194 } 195 if (m_apcPicYuv[PIC_YUV_TRUE_ORG ]==NULL) 196 { 197 m_apcPicYuv[PIC_YUV_TRUE_ORG] = new TComPicYuv; m_apcPicYuv[PIC_YUV_TRUE_ORG]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true ); 198 } 199 } 200 201 Void TComPic::prepareForReconstruction() 202 { 203 if (m_apcPicYuv[PIC_YUV_REC] == NULL) 204 { 205 const TComSPS &sps=m_picSym.getSPS(); 206 const ChromaFormat chromaFormatIDC = sps.getChromaFormatIdc(); 207 const Int iWidth = sps.getPicWidthInLumaSamples(); 208 const Int iHeight = sps.getPicHeightInLumaSamples(); 209 const UInt uiMaxCuWidth = sps.getMaxCUWidth(); 210 const UInt uiMaxCuHeight = sps.getMaxCUHeight(); 211 const UInt uiMaxDepth = sps.getMaxTotalCUDepth(); 212 213 m_apcPicYuv[PIC_YUV_REC] = new TComPicYuv; m_apcPicYuv[PIC_YUV_REC]->create( iWidth, iHeight, chromaFormatIDC, uiMaxCuWidth, uiMaxCuHeight, uiMaxDepth, true ); 214 } 215 216 // mark it should be extended 217 m_apcPicYuv[PIC_YUV_REC]->setBorderExtension(false); 218 219 m_picSym.prepareForReconstruction(); 220 } 221 222 Void TComPic::releaseReconstructionIntermediateData() 223 { 224 m_picSym.releaseReconstructionIntermediateData(); 225 } 226 227 Void TComPic::releaseEncoderSourceImageData() 228 { 229 if (m_apcPicYuv[PIC_YUV_ORG ]) 230 { 231 m_apcPicYuv[PIC_YUV_ORG]->destroy(); 232 delete m_apcPicYuv[PIC_YUV_ORG]; 233 m_apcPicYuv[PIC_YUV_ORG] = NULL; 234 } 235 if (m_apcPicYuv[PIC_YUV_TRUE_ORG ]) 236 { 237 m_apcPicYuv[PIC_YUV_TRUE_ORG]->destroy(); 238 delete m_apcPicYuv[PIC_YUV_TRUE_ORG]; 239 m_apcPicYuv[PIC_YUV_TRUE_ORG] = NULL; 240 } 241 } 242 243 Void TComPic::releaseAllReconstructionData() 244 { 245 if (m_apcPicYuv[PIC_YUV_REC ]) 246 { 247 m_apcPicYuv[PIC_YUV_REC]->destroy(); 248 delete m_apcPicYuv[PIC_YUV_REC]; 249 m_apcPicYuv[PIC_YUV_REC] = NULL; 250 } 251 m_picSym.releaseAllReconstructionData(); 144 252 } 145 253 #endif -
branches/SHM-dev/source/Lib/TLibCommon/TComPic.h
r1550 r1574 101 101 virtual ~TComPic(); 102 102 103 #if REDUCED_ENCODER_MEMORY 104 #if SVC_EXTENSION 105 Void create( const TComSPS &sps, const TComPPS &pps, const Bool bCreateEncoderSourcePicYuv, const Bool bCreateForImmediateReconstruction, const UInt layerId ); 106 #else 107 Void create( const TComSPS &sps, const TComPPS &pps, const Bool bCreateEncoderSourcePicYuv, const Bool bCreateForImmediateReconstruction ); 108 #endif 109 Void prepareForEncoderSourcePicYuv(); 110 Void prepareForReconstruction(); 111 Void releaseReconstructionIntermediateData(); 112 Void releaseAllReconstructionData(); 113 Void releaseEncoderSourceImageData(); 114 #else 103 115 #if SVC_EXTENSION 104 116 Void create( const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual /*= false*/, const UInt layerId ); 105 117 #else 106 118 Void create( const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual /*= false*/ ); 119 #endif 107 120 #endif 108 121 -
branches/SHM-dev/source/Lib/TLibCommon/TComPicSym.cpp
r1550 r1574 64 64 ,m_puiTileIdxMap(NULL) 65 65 ,m_ctuRsToTsAddrMap(NULL) 66 #if REDUCED_ENCODER_MEMORY 67 ,m_dpbPerCtuData(NULL) 68 #endif 66 69 ,m_saoBlkParams(NULL) 67 70 #if ADAPTIVE_QP_SELECTION … … 83 86 } 84 87 88 85 89 #if SVC_EXTENSION 90 #if REDUCED_ENCODER_MEMORY 91 Void TComPicSym::create ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, const Bool bAllocateCtuArray, const UInt layerId ) 92 #else 86 93 Void TComPicSym::create ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, const UInt layerId ) 87 { 94 #endif 95 { 96 #else 97 #if REDUCED_ENCODER_MEMORY 98 Void TComPicSym::create ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, const Bool bAllocateCtuArray ) 88 99 #else 89 100 Void TComPicSym::create ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth ) 101 #endif 90 102 { 91 103 #endif … … 95 107 m_pps = pps; 96 108 109 #if !REDUCED_ENCODER_MEMORY 97 110 const ChromaFormat chromaFormatIDC = sps.getChromaFormatIdc(); 111 #endif 98 112 const Int iPicWidth = sps.getPicWidthInLumaSamples(); 99 113 const Int iPicHeight = sps.getPicHeightInLumaSamples(); … … 114 128 115 129 m_numCtusInFrame = m_frameWidthInCtus * m_frameHeightInCtus; 130 #if REDUCED_ENCODER_MEMORY 131 m_pictureCtuArray = NULL; 132 #else 116 133 m_pictureCtuArray = new TComDataCU*[m_numCtusInFrame]; 134 #endif 117 135 118 136 clearSliceBuffer(); … … 126 144 if (m_pParentARLBuffer == NULL) 127 145 { 128 m_pParentARLBuffer = new TCoeff[uiMaxCuWidth*uiMaxCuHeight*MAX_NUM_COMPONENT]; 129 } 130 #endif 131 146 m_pParentARLBuffer = new TCoeff[uiMaxCuWidth*uiMaxCuHeight*MAX_NUM_COMPONENT]; 147 } 148 #endif 149 150 #if REDUCED_ENCODER_MEMORY 151 if (bAllocateCtuArray) 152 { 153 prepareForReconstruction(); 154 } 155 #else 132 156 for (UInt i=0; i<m_numCtusInFrame ; i++ ) 133 157 { … … 139 163 ); 140 164 } 165 #endif 141 166 142 167 m_ctuTsToRsAddrMap = new UInt[m_numCtusInFrame+1]; … … 164 189 } 165 190 166 Void TComPicSym::destroy() 167 { 168 clearSliceBuffer(); 169 191 #if REDUCED_ENCODER_MEMORY 192 Void TComPicSym::prepareForReconstruction() 193 { 194 const ChromaFormat chromaFormatIDC = m_sps.getChromaFormatIdc(); 195 const UInt uiMaxCuWidth = m_sps.getMaxCUWidth(); 196 const UInt uiMaxCuHeight = m_sps.getMaxCUHeight(); 197 if (m_pictureCtuArray == NULL) 198 { 199 m_pictureCtuArray = new TComDataCU*[m_numCtusInFrame]; 200 201 for (UInt i=0; i<m_numCtusInFrame ; i++ ) 202 { 203 m_pictureCtuArray[i] = new TComDataCU; 204 m_pictureCtuArray[i]->create( chromaFormatIDC, m_numPartitionsInCtu, uiMaxCuWidth, uiMaxCuHeight, false, uiMaxCuWidth >> m_uhTotalDepth 205 #if ADAPTIVE_QP_SELECTION 206 , m_pParentARLBuffer 207 #endif 208 ); 209 } 210 } 211 if (m_dpbPerCtuData == NULL) 212 { 213 m_dpbPerCtuData = new DPBPerCtuData[m_numCtusInFrame]; 214 for(UInt i=0; i<m_numCtusInFrame; i++) 215 { 216 for(Int j=0; j<NUM_REF_PIC_LIST_01; j++) 217 { 218 m_dpbPerCtuData[i].m_CUMvField[j].create( m_numPartitionsInCtu ); 219 } 220 m_dpbPerCtuData[i].m_pePredMode = new SChar[m_numPartitionsInCtu]; 221 memset(m_dpbPerCtuData[i].m_pePredMode, m_numPartitionsInCtu, NUMBER_OF_PREDICTION_MODES); 222 m_dpbPerCtuData[i].m_pePartSize = new SChar[m_numPartitionsInCtu]; 223 memset(m_dpbPerCtuData[i].m_pePartSize, m_numPartitionsInCtu, NUMBER_OF_PART_SIZES); 224 m_dpbPerCtuData[i].m_pSlice=NULL; 225 } 226 } 227 } 228 229 Void TComPicSym::releaseReconstructionIntermediateData() 230 { 170 231 if (m_pictureCtuArray) 171 232 { … … 182 243 m_pictureCtuArray = NULL; 183 244 } 245 } 246 247 Void TComPicSym::releaseAllReconstructionData() 248 { 249 releaseReconstructionIntermediateData(); 250 251 if (m_dpbPerCtuData != NULL) 252 { 253 for(UInt i=0; i<m_numCtusInFrame; i++) 254 { 255 for(Int j=0; j<NUM_REF_PIC_LIST_01; j++) 256 { 257 m_dpbPerCtuData[i].m_CUMvField[j].destroy(); 258 } 259 delete [] m_dpbPerCtuData[i].m_pePredMode; 260 delete [] m_dpbPerCtuData[i].m_pePartSize; 261 } 262 delete [] m_dpbPerCtuData; 263 m_dpbPerCtuData=NULL; 264 } 265 } 266 #endif 267 268 Void TComPicSym::destroy() 269 { 270 clearSliceBuffer(); 271 272 #if REDUCED_ENCODER_MEMORY 273 releaseAllReconstructionData(); 274 #else 275 if (m_pictureCtuArray) 276 { 277 for (Int i = 0; i < m_numCtusInFrame; i++) 278 { 279 if (m_pictureCtuArray[i]) 280 { 281 m_pictureCtuArray[i]->destroy(); 282 delete m_pictureCtuArray[i]; 283 m_pictureCtuArray[i] = NULL; 284 } 285 } 286 delete [] m_pictureCtuArray; 287 m_pictureCtuArray = NULL; 288 } 289 #endif 184 290 185 291 delete [] m_ctuTsToRsAddrMap; -
branches/SHM-dev/source/Lib/TLibCommon/TComPicSym.h
r1550 r1574 106 106 UInt* m_ctuRsToTsAddrMap; ///< for a given RS (Raster-Scan) address, returns the TS (Tile-Scan; coding order) address. cf CtbAddrRsToTs in specification. 107 107 108 #if REDUCED_ENCODER_MEMORY 109 public: 110 struct DPBPerCtuData 111 { 112 Bool isInter(const UInt absPartAddr) const { return m_pePredMode[absPartAddr] == MODE_INTER; } 113 PartSize getPartitionSize( const UInt absPartAddr ) const { return static_cast<PartSize>( m_pePartSize[absPartAddr] ); } 114 const TComCUMvField* getCUMvField ( RefPicList e ) const { return &m_CUMvField[e]; } 115 const TComSlice* getSlice() const { return m_pSlice; } 116 117 SChar * m_pePredMode; 118 SChar * m_pePartSize; 119 TComCUMvField m_CUMvField[NUM_REF_PIC_LIST_01]; 120 TComSlice * m_pSlice; 121 }; 122 123 private: 124 DPBPerCtuData *m_dpbPerCtuData; 125 #endif 108 126 SAOBlkParam *m_saoBlkParams; 109 127 #if ADAPTIVE_QP_SELECTION … … 130 148 public: 131 149 #if SVC_EXTENSION 132 Void create ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, const UInt layerId ); 150 #if REDUCED_ENCODER_MEMORY 151 Void create ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, const Bool bAllocateCtuArray , const UInt layerId ); 152 #else 153 Void create ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, const UInt layerId ); 154 #endif 133 155 #if CGS_3D_ASYMLUT 134 156 TComPPS* getPPSToUpdate() { return &m_pps; } 135 157 #endif 136 158 #else 137 Void create ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth ); 159 #if REDUCED_ENCODER_MEMORY 160 Void create ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, const Bool bAllocateCtuArray ); 161 #else 162 Void create ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth ); 163 #endif 164 #endif 165 #if REDUCED_ENCODER_MEMORY 166 Void prepareForReconstruction(); 167 Void releaseReconstructionIntermediateData(); 168 Void releaseAllReconstructionData(); 138 169 #endif 139 170 Void destroy (); … … 153 184 const TComSPS& getSPS() const { return m_sps; } 154 185 const TComPPS& getPPS() const { return m_pps; } 186 #if REDUCED_ENCODER_MEMORY 187 Bool hasDPBPerCtuData() const { return (m_dpbPerCtuData!=0); }; 188 DPBPerCtuData& getDPBPerCtuData(UInt ctuRsAddr) { return m_dpbPerCtuData[ctuRsAddr]; } 189 const DPBPerCtuData& getDPBPerCtuData(UInt ctuRsAddr) const { return m_dpbPerCtuData[ctuRsAddr]; } 190 #endif 155 191 156 192 TComSlice * swapSliceObject(TComSlice* p, UInt i) { p->setSPS(&m_sps); p->setPPS(&m_pps); TComSlice *pTmp=m_apSlices[i];m_apSlices[i] = p; pTmp->setSPS(0); pTmp->setPPS(0); return pTmp; } -
branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
r1555 r1574 173 173 #define W0062_RECALCULATE_QP_TO_ALIGN_WITH_LAMBDA 0 ///< This recalculates QP to align with the derived lambda (same relation as for all intra coding is used). Currently disabled by default. 174 174 #define OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP 1 ///< Adds command line option to reset SAO parameters after each IRAP. 175 #define REDUCED_ENCODER_MEMORY 1 ///< When 1, the encoder will allocate TComPic memory when required and release it when no longer required. 175 176 176 177 // ==================================================================================================================== -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
r1549 r1574 275 275 } 276 276 277 #if REDUCED_ENCODER_MEMORY 278 rpcPic->create ( sps, pps, false, true, m_layerId); 279 #else 277 280 rpcPic->create( sps, pps, true, m_layerId); 281 #endif 278 282 #else //SVC_EXTENSION 283 #if REDUCED_ENCODER_MEMORY 284 rpcPic->create ( sps, pps, false, true); 285 #else 279 286 rpcPic->create ( sps, pps, true); 287 #endif 280 288 #endif //SVC_EXTENSION 281 289 … … 323 331 xSetRequireResamplingFlag( vps, sps, pps, rpcPic ); 324 332 } 325 333 #if REDUCED_ENCODER_MEMORY 334 rpcPic->create ( sps, pps, false, true, m_layerId); 335 #else 326 336 rpcPic->create( sps, pps, true, m_layerId); 337 #endif 327 338 #else //SVC_EXTENSION 339 #if REDUCED_ENCODER_MEMORY 340 rpcPic->create ( sps, pps, false, true); 341 #else 328 342 rpcPic->create ( sps, pps, true); 343 #endif 329 344 #endif //SVC_EXTENSION 330 345 } … … 522 537 pBLPic->getPicSym()->inferSpsForNonHEVCBL(vps, sps->getMaxCUWidth(), sps->getMaxCUHeight()); 523 538 539 #if REDUCED_ENCODER_MEMORY 540 pBLPic->create( pBLPic->getPicSym()->getSPS(), *pps, true, true, refLayerId); 541 #else 524 542 pBLPic->create( pBLPic->getPicSym()->getSPS(), *pps, true, refLayerId); 543 #endif 525 544 526 545 // it is needed where the VPS is accessed through the slice … … 2278 2297 m_cIlpPic[j] = new TComPic; 2279 2298 2299 #if REDUCED_ENCODER_MEMORY 2300 m_cIlpPic[j]->create(*sps, *pps, true, false, m_layerId); 2301 #else 2280 2302 m_cIlpPic[j]->create(*sps, *pps, true, m_layerId); 2303 #endif 2281 2304 2282 2305 for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCtusInFrame(); i++) -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1572 r1574 1460 1460 xGetBuffer( rcListPic, rcListPicYuvRecOut, iNumPicRcvd, iTimeOffset, pcPic, pcPicYuvRecOut, pocCurr, isField ); 1461 1461 1462 #if REDUCED_ENCODER_MEMORY 1463 pcPic->prepareForReconstruction(); 1464 1465 #endif 1462 1466 // Slice data initialization 1463 1467 pcPic->clearSliceBuffer(); … … 2853 2857 iGOPid=effFieldIRAPMap.restoreGOPid(iGOPid); 2854 2858 } 2859 #if REDUCED_ENCODER_MEMORY 2860 2861 pcPic->releaseReconstructionIntermediateData(); 2862 if (!isField) // don't release the source data for field-coding because the fields are dealt with in pairs. // TODO: release source data for interlace simulations. 2863 { 2864 pcPic->releaseEncoderSourceImageData(); 2865 } 2866 2867 #endif 2855 2868 } // iGOPid-loop 2856 2869 -
branches/SHM-dev/source/Lib/TLibEncoder/TEncPic.cpp
r1549 r1574 125 125 #if SVC_EXTENSION 126 126 // * \param vps reference to used VPS 127 #if REDUCED_ENCODER_MEMORY 128 Void TEncPic::create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxAdaptiveQPDepth, const UInt layerId ) 129 { 130 TComPic::create( sps, pps, true, false, layerId ); 131 #else 127 132 Void TEncPic::create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxAdaptiveQPDepth, Bool bIsVirtual, const UInt layerId ) 128 133 { 129 134 TComPic::create( sps, pps, bIsVirtual, layerId ); 135 #endif 136 #else 137 #if REDUCED_ENCODER_MEMORY 138 Void TEncPic::create( const TComSPS &sps, const TComPPS &pps, UInt uiMaxAdaptiveQPDepth ) 139 { 140 TComPic::create( sps, pps, true, false ); 130 141 #else 131 142 Void TEncPic::create( const TComSPS &sps, const TComPPS &pps, UInt uiMaxAdaptiveQPDepth, Bool bIsVirtual ) 132 143 { 133 144 TComPic::create( sps, pps, bIsVirtual ); 145 #endif 134 146 #endif 135 147 const Int iWidth = sps.getPicWidthInLumaSamples(); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncPic.h
r1549 r1574 106 106 107 107 #if SVC_EXTENSION 108 #if REDUCED_ENCODER_MEMORY 109 Void create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxAdaptiveQPDepth, const UInt layerId ); 110 #else 108 111 Void create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxAdaptiveQPDepth, Bool bIsVirtual /* = false*/, const UInt layerId ); 112 #endif 109 113 #else //SVC_EXTENSION 114 #if REDUCED_ENCODER_MEMORY 115 Void create( const TComSPS &sps, const TComPPS &pps, UInt uiMaxAdaptiveQPDepth ); 116 #else 110 117 Void create( const TComSPS &sps, const TComPPS &pps, UInt uiMaxAdaptiveQPDepth, Bool bIsVirtual /* = false*/ ); 118 #endif 111 119 #endif //SVC_EXTENSION 112 120 -
branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp
r1570 r1574 532 532 533 533 pcField->getSlice(0)->setPOC( m_iPOCLast ); // superfluous? 534 #if !REDUCED_ENCODER_MEMORY 534 535 pcField->getPicYuvRec()->setBorderExtension(false);// where is this normally? 536 #endif 535 537 536 538 pcField->setTopField(isTopField); // interlaced requirement … … 630 632 631 633 pcField->getSlice(0)->setPOC( m_iPOCLast ); // superfluous? 634 #if !REDUCED_ENCODER_MEMORY 632 635 pcField->getPicYuvRec()->setBorderExtension(false);// where is this normally? 636 #endif 633 637 634 638 pcField->setTopField(isTopField); // interlaced requirement … … 704 708 } 705 709 } 710 #if REDUCED_ENCODER_MEMORY 711 rpcPic->releaseAllReconstructionData(); 712 rpcPic->prepareForEncoderSourcePicYuv(); 713 #endif 706 714 } 707 715 else … … 748 756 } 749 757 } 750 751 pcEPic->create( m_cVPS, m_cSPS, m_cPPS, m_cPPS.getMaxCuDQPDepth()+1, false, m_layerId); 758 #if REDUCED_ENCODER_MEMORY 759 #else 760 pcEPic->create( m_cVPS, m_cSPS, m_cPPS, m_cPPS.getMaxCuDQPDepth()+1, m_layerId); 761 #endif 752 762 #else //SVC_EXTENSION 763 #if REDUCED_ENCODER_MEMORY 764 pcEPic->create( m_cSPS, m_cPPS, m_cPPS.getMaxCuDQPDepth()+1); 765 #else 753 766 pcEPic->create( m_cSPS, m_cPPS, m_cPPS.getMaxCuDQPDepth()+1, false); 767 #endif 754 768 #endif //SVC_EXTENSION 755 769 rpcPic = pcEPic; … … 794 808 } 795 809 810 #if REDUCED_ENCODER_MEMORY 811 rpcPic->create( m_cSPS, m_cPPS, true, false, m_layerId ); 812 #else 796 813 rpcPic->create( m_cSPS, m_cPPS, false, m_layerId ); 814 #endif 797 815 #else //SVC_EXTENSION 816 #if REDUCED_ENCODER_MEMORY 817 rpcPic->create( m_cSPS, m_cPPS, true, false ); 818 #else 798 819 rpcPic->create( m_cSPS, m_cPPS, false ); 820 #endif 799 821 #endif //SVC_EXTENSION 800 822 } … … 808 830 809 831 rpcPic->getSlice(0)->setPOC( m_iPOCLast ); 832 #if !REDUCED_ENCODER_MEMORY 810 833 // mark it should be extended 811 834 rpcPic->getPicYuvRec()->setBorderExtension(false); 835 #endif 812 836 } 813 837 … … 1732 1756 { 1733 1757 m_cIlpPic[j] = new TComPic; 1758 #if REDUCED_ENCODER_MEMORY 1759 m_cIlpPic[j]->create(m_cSPS, m_cPPS, true, false, m_layerId); 1760 #else 1734 1761 m_cIlpPic[j]->create(m_cSPS, m_cPPS, true, m_layerId); 1762 #endif 1735 1763 for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCtusInFrame(); i++) 1736 1764 {
Note: See TracChangeset for help on using the changeset viewer.