Changeset 231 in 3DVCSoftware for branches/HTM-5.1-dev3-MERL/source/Lib/TLibDecoder
- Timestamp:
- 26 Jan 2013, 19:36:53 (12 years ago)
- Location:
- branches/HTM-5.1-dev3-MERL/source/Lib/TLibDecoder
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-5.1-dev3-MERL/source/Lib/TLibDecoder/TDecCu.cpp
r189 r231 361 361 362 362 UInt uiCurrPartNumb = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); 363 363 364 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) 364 365 { 365 366 const UChar uhNewDepth = max<UInt>( uiDepth, pcTextureCU->getDepth( uiAbsPartIdx + ui ) ); 367 #if MERL_VSP_C0152 368 Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui); 369 pcCU->setVSPIndex( uiAbsPartIdx + ui, vspIdx); 370 #endif 366 371 pcCU->setPredictionMode( uiAbsPartIdx + ui, MODE_SKIP ); 367 372 pcCU->setPartitionSize( uiAbsPartIdx + ui, SIZE_2Nx2N ); … … 376 381 #if SIMP_MRG_PRUN 377 382 UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx); 383 #if MERL_VSP_C0152 384 Int iVSPIndexTrue[3] = {-1, -1, -1}; 385 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, uiMergeIndex ); 386 { 387 Int iVSPIdx = 0; 388 Int numVspIdx; 389 numVspIdx = 3; 390 for (Int i = 0; i < numVspIdx; i++) 391 { 392 if (iVSPIndexTrue[i] == uiMergeIndex) 393 { 394 iVSPIdx = i+1; 395 break; 396 } 397 } 398 pcCU->setVSPIndexSubParts( iVSPIdx, uiAbsPartIdx, 0, uiDepth ); //Initialize the VSP, may change later in get InterMergeCandidates() 399 } 400 #else 378 401 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 402 #endif 379 403 #else 380 404 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); … … 467 491 468 492 UInt uiCurrPartNumb = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); 493 469 494 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) 470 495 { 471 496 const UChar uhNewDepth = max<UInt>( uiDepth, pcTextureCU->getDepth( uiAbsPartIdx + ui ) ); 497 #if MERL_VSP_C0152 498 Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui); 499 pcCU->setVSPIndex( uiAbsPartIdx + ui, vspIdx); 500 #endif 472 501 pcCU->setPredictionMode( uiAbsPartIdx + ui, MODE_INTER ); 473 502 pcCU->setPartitionSize( uiAbsPartIdx + ui, SIZE_2Nx2N ); … … 658 687 659 688 // inter prediction 689 #if MERL_VSP_C0152 690 m_pcPrediction->motionCompensationBWVSP( pcCU, m_ppcYuvReco[uiDepth], uiAbsPartIdx ); 691 #else 660 692 m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] ); 661 693 #endif 662 694 #if HHI_MPI 663 695 if( pcCU->getTextureModeDepth( 0 ) != -1 ) … … 1047 1079 // reconstruct residual based on mask + DC residuals 1048 1080 Pel apDCResiValues[2]; 1049 Pel apDCRecoValues[2];1081 //Pel apDCRecoValues[2]; 1050 1082 for( UInt ui = 0; ui < uiNumSegments; ui++ ) 1051 1083 { … … 1054 1086 Pel pRecoValue = GetIdx2DepthValue( pPredIdx + pResiIdx ); 1055 1087 1056 apDCRecoValues[ui] = pRecoValue;1088 //apDCRecoValues[ui] = pRecoValue; 1057 1089 apDCResiValues[ui] = pRecoValue - apDCPredValues[ui]; 1058 1090 } -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibDecoder/TDecCu.h
r189 r231 65 65 #endif 66 66 TComDataCU** m_ppcCU; ///< CU data array 67 67 68 68 // access channel 69 69 TComTrQuant* m_pcTrQuant; … … 85 85 /// destroy internal buffers 86 86 Void destroy (); 87 87 88 88 /// decode CU information 89 89 Void decodeCU ( TComDataCU* pcCU, UInt& ruiIsLast ); -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibDecoder/TDecEntropy.cpp
r189 r231 337 337 #if SIMP_MRG_PRUN 338 338 UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 339 #if MERL_VSP_C0152 340 Int iVSPIndexTrue[3] = {-1, -1, -1}; 341 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, uiMergeIndex ); 342 343 if(pcCU->getTextureModeDepth( uiSubPartIdx ) == uiDepth)//MPI is used 344 { 345 TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ); 346 UInt uiCurrPartNumb = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); 347 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) 348 { 349 Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui); 350 pcCU->setVSPIndex( uiAbsPartIdx + ui, vspIdx); 351 } 352 } 353 else // MPI not used 354 { 355 Int iVSPIdx = 0; 356 Int numVspIdx; 357 numVspIdx = 3; 358 for (Int i = 0; i < numVspIdx; i++) 359 { 360 if (iVSPIndexTrue[i] == uiMergeIndex) 361 { 362 iVSPIdx = i+1; 363 break; 364 } 365 } 366 pcCU->setVSPIndexSubParts( iVSPIdx, uiSubPartIdx, uiPartIdx, uiDepth ); //Initialize the VSP, may change later in get InterMergeCandidates() 367 } 368 369 #else 339 370 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 371 #endif 340 372 #else 341 373 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibDecoder/TDecGop.cpp
r189 r231 511 511 m_vAlfCUCtrlSlices.clear(); 512 512 } 513 fflush(stdout); 513 514 } 514 515 -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibDecoder/TDecTop.cpp
r210 r231 59 59 m_aaiCodedScale [ uiId ] = new Int [ MAX_VIEW_NUM ]; 60 60 } 61 62 #if MERL_VSP_C0152 63 xCreateLUTs( (UInt)MAX_VIEW_NUM, (UInt)MAX_VIEW_NUM, m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT ); 64 m_iLog2Precision = LOG2_DISP_PREC_LUT; 65 m_uiBitDepthForLUT = 8; // fixed 66 #endif 61 67 } 62 68 … … 72 78 delete [] m_aiViewOrderIndex; 73 79 delete [] m_aiViewReceived; 80 81 #if MERL_VSP_C0152 82 xDeleteArray( m_adBaseViewShiftLUT, MAX_VIEW_NUM, MAX_VIEW_NUM, 2 ); 83 xDeleteArray( m_aiBaseViewShiftLUT, MAX_VIEW_NUM, MAX_VIEW_NUM, 2 ); 84 #endif 74 85 } 75 86 … … 85 96 m_uiMaxViewId = 0; 86 97 } 98 99 #if MERL_VSP_C0152 100 Void 101 CamParsCollector::xCreateLUTs( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Double****& radLUT, Int****& raiLUT) 102 { 103 //AOF( m_uiBitDepthForLUT == 8 ); 104 //AOF(radLUT == NULL && raiLUT == NULL ); 105 106 uiNumberSourceViews = Max( 1, uiNumberSourceViews ); 107 uiNumberTargetViews = Max( 1, uiNumberTargetViews ); 108 109 radLUT = new Double***[ uiNumberSourceViews ]; 110 raiLUT = new Int ***[ uiNumberSourceViews ]; 111 112 for( UInt uiSourceView = 0; uiSourceView < uiNumberSourceViews; uiSourceView++ ) 113 { 114 radLUT [ uiSourceView ] = new Double**[ uiNumberTargetViews ]; 115 raiLUT [ uiSourceView ] = new Int **[ uiNumberTargetViews ]; 116 117 for( UInt uiTargetView = 0; uiTargetView < uiNumberTargetViews; uiTargetView++ ) 118 { 119 radLUT [ uiSourceView ][ uiTargetView ] = new Double*[ 2 ]; 120 radLUT [ uiSourceView ][ uiTargetView ][ 0 ] = new Double [ 257 ]; 121 radLUT [ uiSourceView ][ uiTargetView ][ 1 ] = new Double [ 257 ]; 122 123 raiLUT [ uiSourceView ][ uiTargetView ] = new Int* [ 2 ]; 124 raiLUT [ uiSourceView ][ uiTargetView ][ 0 ] = new Int [ 257 ]; 125 raiLUT [ uiSourceView ][ uiTargetView ][ 1 ] = new Int [ 257 ]; 126 } 127 } 128 } 129 130 Void 131 CamParsCollector::xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Double****& radLUT, Int****& raiLUT) 132 { 133 Int iLog2DivLuma = m_uiBitDepthForLUT + m_uiCamParsCodedPrecision + 1 - m_iLog2Precision; AOF( iLog2DivLuma > 0 ); 134 Int iLog2DivChroma = iLog2DivLuma + 1; 135 136 iOffset <<= m_uiBitDepthForLUT; 137 138 Double dScale = (Double) iScale / (( Double ) ( 1 << iLog2DivLuma )); 139 Double dOffset = (Double) iOffset / (( Double ) ( 1 << iLog2DivLuma )); 140 141 // offsets including rounding offsets 142 Int64 iOffsetLuma = iOffset + ( ( 1 << iLog2DivLuma ) >> 1 ); 143 Int64 iOffsetChroma = iOffset + ( ( 1 << iLog2DivChroma ) >> 1 ); 144 145 146 for( UInt uiDepthValue = 0; uiDepthValue < 256; uiDepthValue++ ) 147 { 148 149 // real-valued look-up tables 150 Double dShiftLuma = ( (Double)uiDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision ); 151 Double dShiftChroma = dShiftLuma / 2; 152 radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = dShiftLuma; 153 radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = dShiftChroma; 154 155 // integer-valued look-up tables 156 Int64 iTempScale = (Int64)uiDepthValue * iScale; 157 Int64 iShiftLuma = ( iTempScale + iOffsetLuma ) >> iLog2DivLuma; 158 Int64 iShiftChroma = ( iTempScale + iOffsetChroma ) >> iLog2DivChroma; 159 raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = (Int)iShiftLuma; 160 raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = (Int)iShiftChroma; 161 162 // maximum deviation 163 //dMaxDispDev = Max( dMaxDispDev, fabs( Double( (Int) iTestScale ) - dShiftLuma * Double( 1 << iLog2DivLuma ) ) / Double( 1 << iLog2DivLuma ) ); 164 //dMaxRndDispDvL = Max( dMaxRndDispDvL, fabs( Double( (Int) iShiftLuma ) - dShiftLuma ) ); 165 //dMaxRndDispDvC = Max( dMaxRndDispDvC, fabs( Double( (Int) iShiftChroma ) - dShiftChroma ) ); 166 } 167 168 radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ]; 169 radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ]; 170 raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ]; 171 raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ]; 172 } 173 #endif // end MERL_VSP_C0152 87 174 88 175 Void … … 167 254 m_aaiCodedScale [ uiViewId ][ uiBaseId ] = pcSlice->getInvCodedScale () [ uiBaseId ]; 168 255 m_aaiCodedOffset[ uiViewId ][ uiBaseId ] = pcSlice->getInvCodedOffset() [ uiBaseId ]; 256 #if MERL_VSP_C0152 257 xInitLUTs( uiBaseId, uiViewId, m_aaiCodedScale[ uiBaseId ][ uiViewId ], m_aaiCodedOffset[ uiBaseId ][ uiViewId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT); 258 xInitLUTs( uiViewId, uiBaseId, m_aaiCodedScale[ uiViewId ][ uiBaseId ], m_aaiCodedOffset[ uiViewId ][ uiBaseId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT); 259 #endif 169 260 } 170 261 else … … 174 265 m_aaiCodedScale [ uiViewId ][ uiBaseId ] = pcSlice->getSPS()->getInvCodedScale () [ uiBaseId ]; 175 266 m_aaiCodedOffset[ uiViewId ][ uiBaseId ] = pcSlice->getSPS()->getInvCodedOffset() [ uiBaseId ]; 267 #if MERL_VSP_C0152 268 xInitLUTs( uiBaseId, uiViewId, m_aaiCodedScale[ uiBaseId ][ uiViewId ], m_aaiCodedOffset[ uiBaseId ][ uiViewId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT ); 269 xInitLUTs( uiViewId, uiBaseId, m_aaiCodedScale[ uiViewId ][ uiBaseId ], m_aaiCodedOffset[ uiViewId ][ uiBaseId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT ); 270 #endif 176 271 } 177 272 } … … 188 283 m_aaiCodedScale [ uiViewId ][ uiBaseId ] = pcSlice->getInvCodedScale () [ uiBaseId ]; 189 284 m_aaiCodedOffset[ uiViewId ][ uiBaseId ] = pcSlice->getInvCodedOffset() [ uiBaseId ]; 285 #if MERL_VSP_C0152 286 xInitLUTs( uiBaseId, uiViewId, m_aaiCodedScale[ uiBaseId ][ uiViewId ], m_aaiCodedOffset[ uiBaseId ][ uiViewId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT ); 287 xInitLUTs( uiViewId, uiBaseId, m_aaiCodedScale[ uiViewId ][ uiBaseId ], m_aaiCodedOffset[ uiViewId ][ uiBaseId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT ); 288 #endif 190 289 } 191 290 } … … 258 357 #endif 259 358 #if ENC_DEC_TRACE 260 g_hTrace = fopen( "TraceDec.txt", "wb" );359 if(!g_hTrace) g_hTrace = fopen( "TraceDec.txt", "wb" ); 261 360 g_bJustDoIt = g_bEncDecTraceDisable; 262 361 g_nSymbolCounter = 0; … … 277 376 { 278 377 #if ENC_DEC_TRACE 279 fclose( g_hTrace ); 378 if(g_hTrace) fclose( g_hTrace ); 379 g_hTrace=NULL; 280 380 #endif 281 381 } … … 304 404 m_cResidualGenerator.destroy(); 305 405 #endif 406 306 407 } 307 408 … … 1109 1210 initWedgeLists(); 1110 1211 } 1212 #endif 1213 1214 #if MERL_VSP_C0152 // set BW LUT 1215 if( m_pcCamParsCollector ) // Initialize the LUT elements 1216 { 1217 m_pcCamParsCollector->setSlice( pcSlice ); 1218 } 1219 if( pcSlice->getViewId() !=0 ) 1220 { 1221 TComPic* pcBaseTxtPic = m_tAppDecTop->getPicFromView( 0, pcSlice->getPOC(), false ); // get base view reconstructed texture 1222 TComPic* pcBaseDepthPic = m_tAppDecTop->getPicFromView( 0, pcSlice->getPOC(), true ); // get base view reconstructed depth 1223 pcSlice->setRefPicBaseTxt(pcBaseTxtPic); 1224 pcSlice->setRefPicBaseDepth(pcBaseDepthPic); 1225 } 1226 getTAppDecTop()->setBWVSPLUT( pcSlice, pcSlice->getViewId(), pcSlice->getPOC() ); // get the LUT for backward warping 1111 1227 #endif 1112 1228 -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibDecoder/TDecTop.h
r210 r231 77 77 Bool isInitialized() const { return m_bInitialized; } 78 78 79 #if MERL_VSP_C0152 80 Int**** getBaseViewShiftLUTI() { return m_aiBaseViewShiftLUT; } 81 #endif 79 82 private: 80 83 Bool xIsComplete (); … … 97 100 Int m_iLastPOC; 98 101 UInt m_uiMaxViewId; 102 103 #if MERL_VSP_C0152 104 UInt m_uiBitDepthForLUT; 105 UInt m_iLog2Precision; 106 UInt m_uiInputBitDepth; 107 // look-up tables 108 Double**** m_adBaseViewShiftLUT; ///< Disparity LUT 109 Int**** m_aiBaseViewShiftLUT; ///< Disparity LUT 110 Void xCreateLUTs( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Double****& radLUT, Int****& raiLUT); 111 Void xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Double****& radLUT, Int****& raiLUT); 112 template<class T> Void xDeleteArray ( T*& rpt, UInt uiSize1, UInt uiSize2, UInt uiSize3 ); 113 template<class T> Void xDeleteArray ( T*& rpt, UInt uiSize1, UInt uiSize2 ); 114 template<class T> Void xDeleteArray ( T*& rpt, UInt uiSize ); 115 #endif 116 99 117 }; 118 119 #if MERL_VSP_C0152 120 template <class T> 121 Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize1, UInt uiSize2, UInt uiSize3 ) 122 { 123 if( rpt ) 124 { 125 for( UInt uiK = 0; uiK < uiSize1; uiK++ ) 126 { 127 for( UInt uiL = 0; uiL < uiSize2; uiL++ ) 128 { 129 for( UInt uiM = 0; uiM < uiSize3; uiM++ ) 130 { 131 delete[] rpt[ uiK ][ uiL ][ uiM ]; 132 } 133 delete[] rpt[ uiK ][ uiL ]; 134 } 135 delete[] rpt[ uiK ]; 136 } 137 delete[] rpt; 138 } 139 rpt = NULL; 140 }; 141 142 143 template <class T> 144 Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize1, UInt uiSize2 ) 145 { 146 if( rpt ) 147 { 148 for( UInt uiK = 0; uiK < uiSize1; uiK++ ) 149 { 150 for( UInt uiL = 0; uiL < uiSize2; uiL++ ) 151 { 152 delete[] rpt[ uiK ][ uiL ]; 153 } 154 delete[] rpt[ uiK ]; 155 } 156 delete[] rpt; 157 } 158 rpt = NULL; 159 }; 160 161 162 template <class T> 163 Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize ) 164 { 165 if( rpt ) 166 { 167 for( UInt uiK = 0; uiK < uiSize; uiK++ ) 168 { 169 delete[] rpt[ uiK ]; 170 } 171 delete[] rpt; 172 } 173 rpt = NULL; 174 }; 175 176 #endif 100 177 101 178 /// decoder class … … 206 283 ParameterSetManagerDecoder* xGetParaSetDec () {return &m_parameterSetManagerDecoder;} 207 284 #endif 285 208 286 protected: 209 287 Void xGetNewPicBuffer (TComSlice* pcSlice, TComPic*& rpcPic);
Note: See TracChangeset for help on using the changeset viewer.