Changeset 11 in 3DVCSoftware for branches/0.2-poznan-univ/source
- Timestamp:
- 5 Feb 2012, 22:00:22 (13 years ago)
- Location:
- branches/0.2-poznan-univ/source
- Files:
-
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.2-poznan-univ/source/App/TAppCommon/TAppComCamPara.cpp
r5 r11 1339 1339 } 1340 1340 1341 1342 1341 Void 1343 1342 TAppComCamPara::check( Bool bCheckViewRange, Bool bCheckFrameRange ) … … 1457 1456 } 1458 1457 1458 #if POZNAN_SYNTH 1459 Bool 1460 TAppComCamPara::getNearestBaseView( Int iSynthViewIdx, Int &riNearestViewIdx, Int &riRelDistToLeft, Bool& rbRenderFromLeft) 1461 { 1462 riNearestViewIdx = 0; 1463 1464 Bool bDecencdingVN = ( m_aiSortedBaseViews.size() >= 2 && m_aiSortedBaseViews[ 0 ] > m_aiSortedBaseViews[ 1 ] ); 1465 Int iFactor = ( bDecencdingVN ? -1 : 1 ); 1466 1467 if( ( m_aiBaseId2SortedId[iSynthViewIdx] - m_aiBaseId2SortedId[riNearestViewIdx] ) * iFactor <= 0 ) 1468 { 1469 rbRenderFromLeft = true; 1470 } 1471 else 1472 { 1473 rbRenderFromLeft = false; 1474 } 1475 1476 riRelDistToLeft = 128; //Not used for now; 1477 1478 return true; 1479 } 1480 #endif 1481 1482 1483 1459 1484 Int TAppComCamPara::getRelDistLeft( Int iSynthViewIdx, Int iLeftViewIdx, Int iRightViewIdx ) 1460 1485 { -
branches/0.2-poznan-univ/source/App/TAppCommon/TAppComCamPara.h
r5 r11 182 182 Int synthRelNum2Idx ( Int iRelNum ); 183 183 Bool getLeftRightBaseView( Int iSynthViewIdx, Int &riLeftViewIdx, Int &riRightViewIdx, Int &riRelDistToLeft, Bool& rbIsBaseView ); 184 #if POZNAN_SYNTH 185 Bool getNearestBaseView( Int iSynthViewIdx, Int &riNearestViewIdx, Int &riRelDistToLeft, Bool& rbRenderFromLeft); 186 #endif 187 184 188 Int getRelDistLeft ( Int iSynthViewIdx, Int iLeftViewIdx, Int iRightViewIdx ); 185 189 UInt getCurFrameId () { return m_iCurrentFrameId; } -
branches/0.2-poznan-univ/source/App/TAppDecoder/TAppDecTop.cpp
r5 r11 163 163 if( eNalUnitType == NAL_UNIT_SPS ) 164 164 { 165 #if POZNAN_SYNTH 166 if(cComSPS.getViewId()==0 && !cComSPS.isDepth()) // it should be called at first view at the begining of the stream 167 initRenderer(cComSPS); 168 #endif 165 169 if( cComSPS.isDepth() && (m_bUsingDepth==false) ) // expected not using depth, but bitstream are using depth 166 170 { // know from sps … … 539 543 return pcRefPic; 540 544 } 545 546 #if POZNAN_SYNTH 547 Void TAppDecTop::initRenderer(TComSPS &cComSPS) 548 { 549 m_cAvailabilityRenderer.init(cComSPS.getWidth(), cComSPS.getHeight(),true,0,LOG2_DISP_PREC_LUT,true, 0,0,0,0,0,6,4,1,0,6 ); //GT: simplest configuration 550 } 551 //* 552 Void TAppDecTop::storeSynthPicsInBuffer(Int iCoddedViewIdx,Int iCoddedViewOrderIdx, Int iCurPoc, Bool bDepth) 553 { 554 Int iLeftViewIdx = -1; 555 Int iRightViewIdx = -1; 556 Int iNearestViewIdx = -1; 557 Bool bIsBaseView; 558 Bool bRenderFromLeft; 559 560 Int iRelDistToLeft = 128; 561 if(iCoddedViewIdx==0) //First on View Coded List 562 { 563 TComPic* pcPic = getPicFromView( iCoddedViewIdx, iCurPoc, false ); 564 return; 565 } 566 iNearestViewIdx = 0; 567 bRenderFromLeft = iCoddedViewOrderIdx>0?true:false; 568 //m_cCamParsCollector.getNearestBaseView(iCoddedViewIdx, iNearestViewIdx, iRelDistToLeft, bRenderFromLeft); 569 570 m_cAvailabilityRenderer.setShiftLUTs( 571 m_cCamParsCollector.getBaseViewShiftLUTD()[iNearestViewIdx][iCoddedViewIdx], 572 m_cCamParsCollector.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 573 m_cCamParsCollector.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 574 m_cCamParsCollector.getBaseViewShiftLUTD()[iNearestViewIdx][iCoddedViewIdx],//right 575 m_cCamParsCollector.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 576 m_cCamParsCollector.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 577 iRelDistToLeft 578 ); 579 580 TComPic* pcPic = getPicFromView( iCoddedViewIdx, iCurPoc, bDepth ); 581 582 TComPicYuv* pcPicYuvSynthView = pcPic->getPicYuvSynth(); 583 TComPicYuv* pcPicYuvAvailView = pcPic->getPicYuvAvail(); 584 if(!pcPicYuvSynthView) 585 { 586 pcPic->addSynthesisBuffer(); 587 pcPicYuvSynthView = pcPic->getPicYuvSynth(); 588 } 589 if(!pcPicYuvAvailView) 590 { 591 pcPic->addAvailabilityBuffer(); 592 pcPicYuvAvailView = pcPic->getPicYuvAvail(); 593 } 594 595 //m_cAvailabilityRenderer.extrapolateAvailabilityView( xGetPicFromView( iNearestViewIdx, iCurPoc, false )->getPicYuvRec(), xGetPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvERView, pcPicYuvAvailView, bRenderFromLeft ); 596 m_cAvailabilityRenderer.extrapolateAvailabilityView( getPicFromView( iNearestViewIdx, iCurPoc, false )->getPicYuvRec(), getPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvSynthView, pcPicYuvAvailView, bRenderFromLeft ); 597 598 pcPicYuvAvailView->setBorderExtension( false );//Needed?? 599 pcPicYuvAvailView->extendPicBorder();//Needed?? 600 601 #if POZNAN_OUTPUT_AVAILABLE_MAP 602 { 603 Char acFilenameBase[1024]; 604 ::sprintf( acFilenameBase, "Available_%s_%s_V%d.yuv", (bDepth ? "Depth":"Tex"),( true ? "Dec" : "Enc" ), iCoddedViewIdx); 605 pcPicYuvAvailView->dump(acFilenameBase, iCurPoc!=0); 606 } 607 #endif 608 #if POZNAN_OUTPUT_SYNTH 609 { 610 Char acFilenameBase[1024]; 611 ::sprintf( acFilenameBase, "Synth_%s_%s_V%d.yuv", (bDepth ? "Depth":"Tex"),( true ? "Dec" : "Enc" ), iCoddedViewIdx ); 612 pcPicYuvSynthView->dump(acFilenameBase, iCurPoc!=0); 613 } 614 #endif 615 616 } 617 #endif -
branches/0.2-poznan-univ/source/App/TAppDecoder/TAppDecTop.h
r5 r11 52 52 #include "../../Lib/TLibCommon/TComDepthMapGenerator.h" 53 53 #include "../../Lib/TLibDecoder/TDecTop.h" 54 #if POZNAN_SYNTH 55 #include "../../Lib/TLibRenderer/TRenTop.h" 56 #endif 54 57 #include "TAppDecCfg.h" 55 58 … … 87 90 #endif 88 91 92 #if POZNAN_SYNTH 93 TRenTop m_cAvailabilityRenderer; 94 #endif 95 96 89 97 public: 90 98 TAppDecTop(); … … 96 104 Void increaseNumberOfViews (Int iNewNumberOfViews); 97 105 Void startUsingDepth() ; 106 107 #if POZNAN_SYNTH 108 Void initRenderer(TComSPS &cComSPS); 109 Void storeSynthPicsInBuffer(Int iCoddedViewIdx,Int iCoddedViewOrderIdx,Int iCurPoc,Bool bDepth); 110 #endif 98 111 99 112 // GT FIX -
branches/0.2-poznan-univ/source/App/TAppEncoder/TAppEncTop.cpp
r5 r11 435 435 #endif 436 436 437 #if POZNAN_SYNTH 438 //m_cAvailabilityRenderer.init(m_iSourceWidth, m_iSourceHeight,true,0,0,true, 0,0,0,0,0,0,0,1,0,0 ); //GT: simplest configuration 439 m_cAvailabilityRenderer.init(m_iSourceWidth, m_iSourceHeight,true,0,LOG2_DISP_PREC_LUT,true, 0,0,0,0,0,6,4,1,0,6 ); //GT: simplest configuration 440 #endif 441 437 442 #if HHI_INTERVIEW_SKIP 438 443 m_cUsedPelsRenderer.init(m_iSourceWidth, m_iSourceHeight, true, 0, LOG2_DISP_PREC_LUT, true, 0, 0, 0, 0, 0, 6, 4, 1, 0, 6 ); … … 692 697 for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ ) // Start encoding 693 698 { 699 #if POZNAN_SYNTH 700 xStoreSynthPicsInBuffer(iViewIdx,false); 701 #endif 694 702 bool bThisViewContinueReadingPics = bContinueReadingPics[iViewIdx]; 695 703 m_acTEncTopList[iViewIdx]->encode( bEos[iViewIdx], m_cListPicYuvRecMap[iViewIdx], pcBitstream, bThisViewContinueReadingPics ); … … 708 716 if( m_bUsingDepthMaps ) 709 717 { 718 #if POZNAN_SYNTH 719 xStoreSynthPicsInBuffer(iViewIdx,true); 720 #endif 710 721 bool bThisViewContinueReadingDepthPics = bContinueReadingDepthPics[iViewIdx]; 711 722 m_acTEncDepthTopList[iViewIdx]->encode( bDepthEos[iViewIdx], m_cListPicYuvDepthRecMap[iViewIdx], pcBitstream, bThisViewContinueReadingDepthPics ); … … 1177 1188 #endif 1178 1189 1190 #if POZNAN_SYNTH 1191 Void TAppEncTop::xStoreSynthPicsInBuffer(Int iCoddedViewIdx,Bool bDepth) 1192 { 1193 Int iCurPoc; 1194 if(bDepth) 1195 { 1196 iCurPoc = m_acTEncDepthTopList[ iCoddedViewIdx ]->getNextFrameId(); 1197 if (!(m_acTEncDepthTopList[ iCoddedViewIdx ]->currentPocWillBeCoded())) return; 1198 } 1199 else 1200 { 1201 iCurPoc = m_acTEncTopList[ iCoddedViewIdx ]->getNextFrameId(); 1202 if (!(m_acTEncTopList[ iCoddedViewIdx ]->currentPocWillBeCoded())) return; 1203 } 1204 1205 Int iNumberOfReferenceViews = 0; 1206 UInt iSynthViewIdx; 1207 // Get Left and right view 1208 Int iLeftViewIdx = -1; 1209 Int iRightViewIdx = -1; 1210 Int iNearestViewIdx = -1; 1211 Bool bIsBaseView; 1212 Bool bRenderFromLeft; 1213 1214 Int iRelDistToLeft; 1215 if(iCoddedViewIdx==0) //First on View Coded List 1216 { 1217 //TComPic* pcPic = xGetPicFromView( iCoddedViewIdx, iCurPoc, false ); 1218 return; 1219 } 1220 m_cCameraData.getNearestBaseView(iCoddedViewIdx, iNearestViewIdx, iRelDistToLeft, bRenderFromLeft); 1221 1222 m_cAvailabilityRenderer.setShiftLUTs( 1223 m_cCameraData.getBaseViewShiftLUTD()[iNearestViewIdx][iCoddedViewIdx], 1224 m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 1225 m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 1226 m_cCameraData.getBaseViewShiftLUTD()[iNearestViewIdx][iCoddedViewIdx],//right 1227 m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 1228 m_cCameraData.getBaseViewShiftLUTI()[iNearestViewIdx][iCoddedViewIdx], 1229 iRelDistToLeft 1230 ); 1231 1232 1233 TComPicYuv* pcPicYuvERView = new TComPicYuv; 1234 pcPicYuvERView->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 1235 1236 TComPic* pcPic = xGetPicFromView( iCoddedViewIdx, iCurPoc, bDepth ); 1237 pcPic->addSynthesisBuffer(); 1238 pcPic->addAvailabilityBuffer(); 1239 TComPicYuv* pcPicYuvSynthView = pcPic->getPicYuvSynth(); 1240 TComPicYuv* pcPicYuvAvailView = pcPic->getPicYuvAvail(); 1241 1242 //m_cAvailabilityRenderer.extrapolateAvailabilityView( xGetPicFromView( iNearestViewIdx, iCurPoc, false )->getPicYuvRec(), xGetPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvERView, pcPicYuvAvailView, bRenderFromLeft ); 1243 m_cAvailabilityRenderer.extrapolateAvailabilityView( xGetPicFromView( iNearestViewIdx, iCurPoc, bDepth )->getPicYuvRec(), xGetPicFromView( iNearestViewIdx, iCurPoc, true )->getPicYuvRec(), pcPicYuvSynthView, pcPicYuvAvailView, bRenderFromLeft ); 1244 1245 pcPicYuvAvailView->setBorderExtension( false );//Needed?? 1246 pcPicYuvAvailView->extendPicBorder();//Needed?? 1247 1248 pcPicYuvSynthView->setBorderExtension( false );//Needed?? 1249 pcPicYuvSynthView->extendPicBorder();//Needed?? 1250 1251 //TComPic* pcPicDepth = xGetPicFromView( iCoddedViewIdx, iCurPoc, true ); 1252 //pcPicDepth->addAvailabilityBuffer(); 1253 //pcPicDepth->addSynthesisBuffer(); 1254 //pcPicYuvAvailView->copyToPic(pcPicDepth->getPicYuvAvail()); 1255 1256 #if POZNAN_OUTPUT_AVAILABLE_MAP 1257 { 1258 Char acFilenameBase[1024]; 1259 ::sprintf( acFilenameBase, "Available_%s_%s_V%d.yuv", (bDepth?"Depth":"Tex"),( false ? "Dec" : "Enc" ),iCoddedViewIdx ); 1260 pcPicYuvAvailView->dump(acFilenameBase, iCurPoc!=0); 1261 } 1262 #endif 1263 #if POZNAN_OUTPUT_SYNTH 1264 { 1265 Char acFilenameBase[1024]; 1266 ::sprintf( acFilenameBase, "Synth_%s_%s_V%d.yuv", (bDepth?"Depth":"Tex"),( false ? "Dec" : "Enc" ),iCoddedViewIdx ); 1267 pcPicYuvERView->dump(acFilenameBase, iCurPoc!=0); 1268 } 1269 #endif 1270 1271 //Usun pcPicYuvERView i inne bufforki 1272 } 1273 #endif 1274 1179 1275 #if HHI_INTERVIEW_SKIP 1180 1276 Void TAppEncTop::getUsedPelsMap( Int iViewIdx, Int iPoc, TComPicYuv* pcPicYuvUsedSplsMap ) -
branches/0.2-poznan-univ/source/App/TAppEncoder/TAppEncTop.h
r5 r11 92 92 #endif 93 93 94 #if POZNAN_SYNTH 95 TRenTop m_cAvailabilityRenderer; 96 #endif 97 94 98 protected: 95 99 // initialization … … 154 158 Void xStoreVSORefPicsInBuffer(); ///< read in External Ref pic from file and store in buffer 155 159 #endif 156 160 161 162 #if POZNAN_SYNTH 163 private: 164 Void xStoreSynthPicsInBuffer(Int iCoddedViewIdx, Bool bDepth); 165 #endif 166 157 167 };// END CLASS DEFINITION TAppEncTop 158 168 -
branches/0.2-poznan-univ/source/Lib/TLibCommon/CommonDef.h
r8 r11 58 58 59 59 #define HM_VERSION "3.0rc2" ///< Current software version 60 #define NV_VERSION "0. 2" ///< Current software version60 #define NV_VERSION "0.3" ///< Current software version 61 61 62 62 // ==================================================================================================================== … … 137 137 #define LOG2_DISP_PREC_LUT 2 ///< log2 of disparity precision used in integer disparity LUTs 138 138 139 140 139 #if ( HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED ) 141 140 #define DEPTH_MAP_GENERATION 1 … … 171 170 #define OUTPUT_RESIDUAL_PICTURES 0 // output residual pictures (for debugging) 172 171 173 #define HHI_MPI_MERGE_POS 0 // position of mvi in merge list (0..5) 174 172 #define HHI_MPI_MERGE_POS 0 // position of mvi in merge list (0..5) 173 174 // ==================================================================================================================== 175 // POZNAN DEFINE SECTION 176 // ==================================================================================================================== 177 #define POZNAN_OUTPUT_AVAILABLE_MAP 0 // output available map (for debugging) 178 #define POZNAN_OUTPUT_SYNTH 0 // output synthesised view (for debugging) 175 179 176 180 // ==================================================================================================================== -
branches/0.2-poznan-univ/source/Lib/TLibCommon/TComDataCU.cpp
r5 r11 2711 2711 pcCULeft = NULL; 2712 2712 } 2713 if( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx ) ) 2713 if( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx ) 2714 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 2715 && !pcCULeft->isCUSkiped( uiLeftPartIdx ) 2716 #endif 2717 ) 2714 2718 { 2715 2719 abCandIsInter[uiLeftAddr] = true; … … 2737 2741 pcCUAbove = NULL; 2738 2742 } 2739 if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx ) ) 2743 if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx ) 2744 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 2745 && !pcCUAbove->isCUSkiped( uiAbovePartIdx ) 2746 #endif 2747 ) 2740 2748 { 2741 2749 abCandIsInter[uiAboveAddr] = true; … … 3271 3279 if( uiIter == 0 ) 3272 3280 { 3273 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) ) 3281 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) 3282 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 3283 && !pcCorner->isCUSkiped( uiCornerPUIdx ) 3284 #endif 3285 ) 3274 3286 { 3275 3287 rbValidCand = true; … … 3306 3318 else 3307 3319 { 3308 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) ) 3320 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) 3321 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 3322 && !pcCorner->isCUSkiped( uiCornerPUIdx ) 3323 #endif 3324 ) 3309 3325 { 3310 3326 rbValidCand = true; … … 4425 4441 if (pColCU->isIntra(uiPartIdxCenter)) 4426 4442 return false; 4443 4444 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 4445 if (pColCU->isSkipped(uiPartIdxCenter)) 4446 return false; 4447 #endif 4427 4448 4428 4449 if( m_pcSlice->getRefPic(eRefPicList, iRefIdx)->getViewIdx() != m_pcSlice->getViewIdx() ) -
branches/0.2-poznan-univ/source/Lib/TLibCommon/TComDataCU.h
r5 r11 529 529 Bool isIntra ( UInt uiPartIdx ) { return m_pePredMode[ uiPartIdx ] == MODE_INTRA; } 530 530 Bool isSkipped ( UInt uiPartIdx ); ///< SKIP (no residual) 531 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 532 Bool isCUSkiped( UInt uiPartIdx ) { return m_pePredMode[ uiPartIdx ] == MODE_SYNTH; } 533 #endif 531 534 532 535 // ------------------------------------------------------------------------------------------------------------------- -
branches/0.2-poznan-univ/source/Lib/TLibCommon/TComDepthMapGenerator.cpp
r5 r11 971 971 xInterPredictCUDepthMap( pcSubCU, pcSubDM ); 972 972 break; 973 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 974 case MODE_SYNTH: 975 //What to do? Need Fix! 976 xIntraPredictCUDepthMap( pcSubCU, pcSubDM ); 977 break; 978 #endif 973 979 default: 974 980 AOT( true ); -
branches/0.2-poznan-univ/source/Lib/TLibCommon/TComLoopFilter.cpp
r5 r11 444 444 445 445 //-- Set BS for Intra MB : BS = 4 or 3 446 if ( pcCUP->isIntra(uiPartP) || pcCUQ->isIntra(uiPartQ) ) 446 if ( pcCUP->isIntra(uiPartP) || pcCUQ->isIntra(uiPartQ) 447 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 448 || pcCUP->isCUSkiped(uiPartP) || pcCUQ->isCUSkiped(uiPartQ) 449 #endif 450 ) 447 451 { 448 452 uiBs = bAtCUBoundary ? 4 : 3; // Intra MB && MB boundary 449 453 } 450 454 451 455 //-- Set BS for not Intra MB : BS = 2 or 1 or 0 452 if ( !pcCUP->isIntra(uiPartP) && !pcCUQ->isIntra(uiPartQ) ) 456 if ( !pcCUP->isIntra(uiPartP) && !pcCUQ->isIntra(uiPartQ) 457 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 458 && !pcCUP->isCUSkiped(uiPartP) && !pcCUQ->isCUSkiped(uiPartQ) 459 #endif 460 ) 453 461 { 454 462 if ( pcCUQ->getCbf( uiPartQ, TEXT_LUMA, pcCUQ->getTransformIdx(uiPartQ)) != 0 || pcCUP->getCbf( uiPartP, TEXT_LUMA, pcCUP->getTransformIdx(uiPartP) ) != 0) … … 527 535 } // enf of "if( one of BCBP == 0 )" 528 536 } // enf of "if( not Intra )" 529 537 538 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU //if one of the block is CUSkipped dont use loop filter 539 if ( pcCUP->isCUSkiped(uiPartP) || pcCUQ->isCUSkiped(uiPartQ)) 540 { 541 uiBs = 0; 542 } 543 #endif 544 530 545 m_aapucBS[iDir][0][uiAbsPartIdx] = uiBs; 531 546 if ( bAtCUBoundary || bAtCUHalf ) -
branches/0.2-poznan-univ/source/Lib/TLibCommon/TComPic.cpp
r5 r11 50 50 m_apcPicYuv[0] = NULL; 51 51 m_apcPicYuv[1] = NULL; 52 #if POZNAN_AVAIL_MAP 53 m_apcPicYuvAvail = NULL; 54 #endif 55 #if POZNAN_SYNTH_VIEW 56 m_apcPicYuvSynth = NULL; 57 #endif 52 58 #if DEPTH_MAP_GENERATION 53 59 m_pcPredDepthMap = NULL; … … 116 122 m_apcPicYuv[1] = NULL; 117 123 } 124 #if POZNAN_AVAIL_MAP 125 if (m_apcPicYuvAvail) 126 { 127 m_apcPicYuvAvail->destroy(); 128 delete m_apcPicYuvAvail; 129 m_apcPicYuvAvail = NULL; 130 } 131 #endif 132 133 #if POZNAN_SYNTH_VIEW 134 if (m_apcPicYuvSynth) 135 { 136 m_apcPicYuvSynth->destroy(); 137 delete m_apcPicYuvSynth; 138 m_apcPicYuvSynth = NULL; 139 } 140 #endif 118 141 119 142 #if DEPTH_MAP_GENERATION … … 193 216 } 194 217 218 #if POZNAN_AVAIL_MAP 219 Void 220 TComPic::addAvailabilityBuffer() 221 { 222 AOT( m_apcPicYuvAvail ); 223 AOF( m_apcPicYuv[1] ); 224 Int iWidth = m_apcPicYuv[1]->getWidth (); 225 Int iHeight = m_apcPicYuv[1]->getHeight (); 226 UInt uiMaxCuWidth = m_apcPicYuv[1]->getMaxCuWidth (); 227 UInt uiMaxCuHeight = m_apcPicYuv[1]->getMaxCuHeight(); 228 UInt uiMaxCuDepth = m_apcPicYuv[1]->getMaxCuDepth (); 229 m_apcPicYuvAvail = new TComPicYuv; 230 m_apcPicYuvAvail ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth ); 231 } 232 #endif 233 234 #if POZNAN_SYNTH_VIEW 235 Void 236 TComPic::addSynthesisBuffer() 237 { 238 AOT( m_apcPicYuvSynth ); 239 AOF( m_apcPicYuv[1] ); 240 Int iWidth = m_apcPicYuv[1]->getWidth (); 241 Int iHeight = m_apcPicYuv[1]->getHeight (); 242 UInt uiMaxCuWidth = m_apcPicYuv[1]->getMaxCuWidth (); 243 UInt uiMaxCuHeight = m_apcPicYuv[1]->getMaxCuHeight(); 244 UInt uiMaxCuDepth = m_apcPicYuv[1]->getMaxCuDepth (); 245 m_apcPicYuvSynth = new TComPicYuv; 246 m_apcPicYuvSynth ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth ); 247 } 248 #endif 249 195 250 #if PARALLEL_MERGED_DEBLK 196 251 Void … … 284 339 } 285 340 341 #if POZNAN_AVAIL_MAP 342 Void 343 TComPic::removeAvailabilityBuffer() 344 { 345 if( m_apcPicYuvAvail ) 346 { 347 m_apcPicYuvAvail->destroy(); 348 delete m_apcPicYuvAvail; 349 m_apcPicYuvAvail = NULL; 350 } 351 } 352 #endif 353 354 #if POZNAN_SYNTH_VIEW 355 Void 356 TComPic::removeSynthesisBuffer() 357 { 358 if( m_apcPicYuvSynth ) 359 { 360 m_apcPicYuvSynth->destroy(); 361 delete m_apcPicYuvSynth; 362 m_apcPicYuvSynth = NULL; 363 } 364 } 365 #endif 366 286 367 #if PARALLEL_MERGED_DEBLK 287 368 Void … … 349 430 #endif 350 431 432 #if POZNAN_AVAIL_MAP 433 Void TComPic::checkSynthesisAvailability( TComDataCU*& rpcCU, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied ) 434 { 435 rpbCUSynthesied[0] = true; 436 rpbCUSynthesied[1] = true; 437 rpbCUSynthesied[2] = true; 438 rpbCUSynthesied[3] = true; 439 440 if (!getPicYuvAvail()) 441 { 442 rpbCUSynthesied[0] = false; 443 rpbCUSynthesied[1] = false; 444 rpbCUSynthesied[2] = false; 445 rpbCUSynthesied[3] = false; 446 return; 447 } 448 449 Int x, y; 450 Bool bAvailable = true; 451 Pel* pAvail = getPicYuvAvail()->getLumaAddr ( iCuAddr, uiAbsZorderIdx ); 452 Int CUHeight = g_uiMaxCUHeight >> uiPartDepth; //rpcCU->getHeight(uiAbsZorderIdx); 453 Int CUWidth = g_uiMaxCUWidth >> uiPartDepth; //rpcCU->getWidth(uiAbsZorderIdx); 454 455 Int iStride = getPicYuvAvail()->getStride(); 456 for ( y = ((CUHeight - 1) >> 1); y >= 0; y-- ) 457 { 458 for ( x = ((CUWidth - 1) >> 1); x >= 0; x-- ) 459 { 460 rpbCUSynthesied[0] &= (pAvail[x] != 0); 461 } 462 for ( x = CUWidth - 1; x >= ((CUWidth) >> 1); x-- ) 463 { 464 rpbCUSynthesied[1] &= (pAvail[x] != 0); 465 } 466 pAvail += iStride; 467 } 468 //for ( y = CUHeight - 1; y >= ((CUHeight) >> 1); y-- ) 469 for ( y = ((CUHeight - 1) >> 1); y >= 0; y-- ) //Owieczka 470 { 471 for ( x = ((CUWidth - 1) >> 1); x >= 0; x-- ) 472 { 473 rpbCUSynthesied[2] &= (pAvail[x] != 0); 474 } 475 for ( x = CUWidth - 1; x >= ((CUWidth) >> 1); x-- ) 476 { 477 rpbCUSynthesied[3] &= (pAvail[x] != 0); 478 } 479 pAvail += iStride; 480 } 481 482 //rpbCUSynthesied[0] = !rpbCUSynthesied[0]; 483 //rpbCUSynthesied[1] = !rpbCUSynthesied[1]; 484 //rpbCUSynthesied[2] = !rpbCUSynthesied[2]; 485 //rpbCUSynthesied[3] = !rpbCUSynthesied[3]; 486 } 487 #endif -
branches/0.2-poznan-univ/source/Lib/TLibCommon/TComPic.h
r5 r11 61 61 62 62 TComPicYuv* m_apcPicYuv[2]; // Texture, 0:org / 1:rec 63 64 #if POZNAN_AVAIL_MAP 65 TComPicYuv* m_apcPicYuvAvail; // Availability Map - Does the given pixel can be synthesised in receiver 66 #endif 67 68 #if POZNAN_SYNTH_VIEW 69 TComPicYuv* m_apcPicYuvSynth; // Sythesied image 70 #endif 71 63 72 #if DEPTH_MAP_GENERATION 64 73 TComPicYuv* m_pcPredDepthMap; // estimated depth map … … 126 135 TComPicYuv* getPicYuvOrg() { return m_apcPicYuv[0]; } 127 136 TComPicYuv* getPicYuvRec() { return m_apcPicYuv[1]; } 137 138 #if POZNAN_AVAIL_MAP 139 TComPicYuv* getPicYuvAvail() { return m_apcPicYuvAvail; } //Owieczka - returns available map from other pic image 140 #endif 141 142 #if POZNAN_SYNTH_VIEW 143 TComPicYuv* getPicYuvSynth() { return m_apcPicYuvSynth; } //Owieczka - returns synth form other pic in image 144 #endif 128 145 129 146 #if DEPTH_MAP_GENERATION … … 196 213 197 214 Void addOriginalBuffer (); 215 #if POZNAN_AVAIL_MAP 216 Void addAvailabilityBuffer (); 217 #endif 218 #if POZNAN_SYNTH_VIEW 219 Void addSynthesisBuffer (); 220 #endif 198 221 #if PARALLEL_MERGED_DEBLK 199 222 Void addDeblockBuffer (); … … 214 237 215 238 Void removeOriginalBuffer (); 239 #if POZNAN_SYNTH_VIEW 240 Void removeSynthesisBuffer (); 241 #endif 242 #if POZNAN_AVAIL_MAP 243 Void removeAvailabilityBuffer(); 244 #endif 216 245 #if PARALLEL_MERGED_DEBLK 217 246 Void removeDeblockBuffer (); … … 228 257 #if HHI_INTERVIEW_SKIP 229 258 Void removeUsedPelsMapBuffer (); 259 #endif 260 261 #if POZNAN_AVAIL_MAP 262 Void checkSynthesisAvailability( TComDataCU*& rpcBestCU, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied); 230 263 #endif 231 264 -
branches/0.2-poznan-univ/source/Lib/TLibCommon/TComResidualGenerator.cpp
r5 r11 306 306 xSetRecResidualInterCU( pcSubCU, pcSubRes ); 307 307 break; 308 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 309 case MODE_SYNTH: 310 xSetRecResidualIntraCU( pcSubCU, pcSubRes ); //MayBe it should be seperate function 311 break; 312 #endif 308 313 default: 309 314 AOT( true ); -
branches/0.2-poznan-univ/source/Lib/TLibCommon/TComSlice.cpp
r5 r11 676 676 // AMVP parameter 677 677 ::memset( m_aeAMVPMode, 0, sizeof( m_aeAMVPMode ) ); 678 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 678 679 m_bUseDMM = false; 680 #endif 679 681 } 680 682 -
branches/0.2-poznan-univ/source/Lib/TLibCommon/TComSlice.h
r5 r11 452 452 453 453 Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } 454 TComSPS* getSPS () { return m_pcSPS; }454 TComSPS* getSPS () { return m_pcSPS; } 455 455 456 456 Void setPPS ( TComPPS* pcPPS ) { m_pcPPS = pcPPS; } -
branches/0.2-poznan-univ/source/Lib/TLibCommon/TypeDef.h
r5 r11 61 61 //<<<<< HHI 3DV tools <<<<< 62 62 63 //<<<<< Poznan 3DV tools <<<<<< 64 #define POZNAN_CU_SKIP 1 //Poznan Cu Skip 65 #define POZNAN_CU_SYNTH 1 //Poznan Cu Synth 66 67 #define POZNAN_AVAIL_MAP 1 //Creates Availibity buffers in all needed classes 68 69 #define POZNAN_SYNTH_VIEW 1 //Creates view synthesis buffers in all needed classes 70 #define POZNAN_SYNTH_DEPTH 1 71 72 #define POZNAN_SYNTH 1 //Creates aligned synthesis classes in encoder and decoder 73 74 #define POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 1 //Poznan CU Skip 75 #define POZNAN_FILL_OCCLUDED_CU_WITH_SYNTHESIS 1 //Fills not sended CUs with synthesized data 76 77 #define POZNAN_CU_SKIP_PSNR 1 //Poznan Cu Skip Display psnr of the codded CU only 78 //<<<<< Poznan 3DV tools <<<<<< 63 79 64 80 //////////////////////////// … … 575 591 MODE_INTER, ///< inter-prediction mode 576 592 MODE_INTRA, ///< intra-prediction mode 593 #if POZNAN_CU_SKIP 594 MODE_SYNTH, ///< synth-mode 595 #endif 577 596 MODE_NONE = 15 578 597 }; -
branches/0.2-poznan-univ/source/Lib/TLibDecoder/TDecCAVLC.cpp
r5 r11 285 285 for( UInt uiBaseId = 0; uiBaseId < uiViewId; uiBaseId++ ) 286 286 { 287 xReadSvlc( iCode ); m_aaiTempScale [ uiBaseId ][ uiViewId ] = iCode; 288 xReadSvlc( iCode ); m_aaiTempOffset[ uiBaseId ][ uiViewId ] = iCode; 287 xReadSvlc( iCode ); m_aaiTempScale [ uiBaseId ][ uiViewId ] = iCode; //printf("SPS Scale: %d\n",iCode); 288 xReadSvlc( iCode ); m_aaiTempOffset[ uiBaseId ][ uiViewId ] = iCode; //printf("SPS Offset: %d\n",iCode); 289 289 xReadSvlc( iCode ); m_aaiTempScale [ uiViewId ][ uiBaseId ] = iCode - m_aaiTempScale [ uiBaseId ][ uiViewId ]; 290 290 xReadSvlc( iCode ); m_aaiTempOffset[ uiViewId ][ uiBaseId ] = iCode - m_aaiTempOffset[ uiBaseId ][ uiViewId ]; … … 517 517 for( UInt uiBaseId = 0; uiBaseId < uiViewId; uiBaseId++ ) 518 518 { 519 xReadSvlc( iCode ); m_aaiTempScale [ uiBaseId ][ uiViewId ] = iCode; 520 xReadSvlc( iCode ); m_aaiTempOffset[ uiBaseId ][ uiViewId ] = iCode; 519 xReadSvlc( iCode ); m_aaiTempScale [ uiBaseId ][ uiViewId ] = iCode; printf("Scale: %d\n",iCode); 520 xReadSvlc( iCode ); m_aaiTempOffset[ uiBaseId ][ uiViewId ] = iCode; printf("Offset: %d\n",iCode); 521 521 xReadSvlc( iCode ); m_aaiTempScale [ uiViewId ][ uiBaseId ] = iCode - m_aaiTempScale [ uiBaseId ][ uiViewId ]; 522 522 xReadSvlc( iCode ); m_aaiTempOffset[ uiViewId ][ uiBaseId ] = iCode - m_aaiTempOffset[ uiBaseId ][ uiViewId ]; -
branches/0.2-poznan-univ/source/Lib/TLibDecoder/TDecCu.cpp
r5 r11 49 49 m_ppcYuvReco = NULL; 50 50 m_ppcYuvResPred = NULL; 51 #if POZNAN_AVAIL_MAP 52 m_ppcYuvAvail = NULL; 53 #endif 54 #if POZNAN_SYNTH_VIEW 55 m_ppcYuvSynth = NULL; 56 #endif 51 57 m_ppcCU = NULL; 52 58 } … … 75 81 m_ppcYuvReco = new TComYuv* [m_uiMaxDepth-1]; 76 82 m_ppcYuvResPred = new TComYuv* [m_uiMaxDepth-1]; 83 #if POZNAN_AVAIL_MAP 84 m_ppcYuvAvail = new TComYuv* [m_uiMaxDepth-1]; 85 #endif 86 #if POZNAN_SYNTH_VIEW 87 m_ppcYuvSynth = new TComYuv* [m_uiMaxDepth-1]; 88 #endif 77 89 m_ppcCU = new TComDataCU* [m_uiMaxDepth-1]; 78 90 … … 87 99 m_ppcYuvReco [ui] = new TComYuv; m_ppcYuvReco [ui]->create( uiWidth, uiHeight ); 88 100 m_ppcYuvResPred[ui] = new TComYuv; m_ppcYuvResPred[ui]->create( uiWidth, uiHeight ); 101 #if POZNAN_AVAIL_MAP 102 m_ppcYuvAvail [ui] = new TComYuv; m_ppcYuvAvail [ui]->create( uiWidth, uiHeight ); 103 #endif 104 #if POZNAN_SYNTH_VIEW 105 m_ppcYuvSynth [ui] = new TComYuv; m_ppcYuvSynth [ui]->create( uiWidth, uiHeight ); 106 #endif 107 89 108 m_ppcCU [ui] = new TComDataCU; m_ppcCU [ui]->create( uiNumPartitions, uiWidth, uiHeight, true ); 90 109 } … … 106 125 m_ppcYuvReco [ui]->destroy(); delete m_ppcYuvReco [ui]; m_ppcYuvReco [ui] = NULL; 107 126 m_ppcYuvResPred[ui]->destroy(); delete m_ppcYuvResPred[ui]; m_ppcYuvResPred[ui] = NULL; 127 #if POZNAN_AVAIL_MAP 128 m_ppcYuvAvail [ui]->destroy(); delete m_ppcYuvAvail [ui]; m_ppcYuvAvail [ui] = NULL; 129 #endif 130 #if POZNAN_SYNTH_VIEW 131 m_ppcYuvSynth [ui]->destroy(); delete m_ppcYuvSynth [ui]; m_ppcYuvSynth [ui] = NULL; 132 #endif 108 133 m_ppcCU [ui]->destroy(); delete m_ppcCU [ui]; m_ppcCU [ui] = NULL; 109 134 } … … 112 137 delete [] m_ppcYuvReco; m_ppcYuvReco = NULL; 113 138 delete [] m_ppcYuvResPred; m_ppcYuvResPred = NULL; 139 #if POZNAN_AVAIL_MAP 140 delete [] m_ppcYuvAvail; m_ppcYuvAvail = NULL; 141 #endif 142 #if POZNAN_SYNTH_VIEW 143 delete [] m_ppcYuvSynth; m_ppcYuvSynth = NULL; 144 #endif 145 114 146 delete [] m_ppcCU; m_ppcCU = NULL; 115 147 } … … 184 216 { 185 217 TComPic* pcPic = pcCU->getPic(); 218 219 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 220 Bool bWholeCUCanBeSynthesized = false; 221 Bool bOneSubCUCanNotBeSynthesied = false; 222 Bool bSubCUCanBeSynthesized[4]; 223 Bool * pbSubCUCanBeSynthesized = bSubCUCanBeSynthesized; 224 pcPic->checkSynthesisAvailability(pcCU, pcCU->getAddr(), uiAbsPartIdx, uiDepth, pbSubCUCanBeSynthesized); //KUBA SYNTH 225 Int iSubCUCanNotBeSynthesized = 0; 226 Int iSubCUCanBeSynthesizedCnt = 0; 227 for(Int i = 0; i < 4; i++) 228 { 229 if (!bSubCUCanBeSynthesized[i]) 230 { 231 iSubCUCanNotBeSynthesized = i; 232 } 233 else 234 { 235 iSubCUCanBeSynthesizedCnt ++; 236 } 237 } 238 if(iSubCUCanBeSynthesizedCnt == 4) 239 { 240 bWholeCUCanBeSynthesized = true; 241 } 242 else if(iSubCUCanBeSynthesizedCnt == 3) 243 { 244 bOneSubCUCanNotBeSynthesied = true; 245 } 246 247 if(bWholeCUCanBeSynthesized) 248 { 249 pcCU->setPredModeSubParts( MODE_SYNTH, uiAbsPartIdx, uiDepth ); 250 pcCU->setDepthSubParts( uiDepth, uiAbsPartIdx ); 251 pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 252 pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth ); 253 //pcCU->setSizeSubParts( pcCU->getSlice()->getSPS()->getMaxCUWidth()>>uiDepth, pcCU->getSlice()->getSPS()->getMaxCUHeight()>>uiDepth, uiAbsPartIdx, uiDepth ); 254 return; 255 } 256 #endif 257 186 258 UInt uiCurNumParts = pcPic->getNumPartInCU() >> (uiDepth<<1); 187 259 UInt uiQNumParts = uiCurNumParts>>2; … … 195 267 if( ( uiRPelX < pcCU->getSlice()->getSPS()->getWidth() ) && ( uiBPelY < pcCU->getSlice()->getSPS()->getHeight() ) ) 196 268 { 269 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 270 if(bOneSubCUCanNotBeSynthesied && (uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth )) // KUBA SYNTH check if CU has 3 synthesied subCU - no split flag is send in that case and CU split is assumed 271 { 272 pcCU->setDepthSubParts( uiDepth + 1, uiAbsPartIdx ); 273 } 274 else 275 #endif 197 276 #if HHI_MPI 198 277 if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 || uiDepth < pcCU->getTextureModeDepth( uiAbsPartIdx ) ) … … 367 446 { 368 447 TComPic* pcPic = pcCU->getPic(); 448 #if POZNAN_SYNTH_VIEW 449 if(pcPic->getPicYuvSynth()) m_ppcYuvSynth[uiDepth]->copyFromPicYuv( pcPic->getPicYuvSynth(), pcCU->getAddr(), uiAbsPartIdx ); 450 #endif 451 #if POZNAN_AVAIL_MAP 452 if(pcPic->getPicYuvAvail()) m_ppcYuvAvail[uiDepth]->copyFromPicYuv( pcPic->getPicYuvAvail(), pcCU->getAddr(), uiAbsPartIdx ); 453 #endif 369 454 370 455 Bool bBoundary = false; … … 411 496 xReconIntraQT( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth ); 412 497 break; 498 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 499 case MODE_SYNTH: 500 // break; 501 #if POZNAN_FILL_OCCLUDED_CU_WITH_SYNTHESIS 502 m_ppcYuvReco[uiDepth]->copyFromPicYuv(pcPic->getPicYuvSynth(), pcCU->getAddr(), uiAbsPartIdx); 503 #else 504 m_ppcYuvReco[uiDepth]->copyFromPicYuv(pcPic->getPicYuvAvail(), pcCU->getAddr(), uiAbsPartIdx); //Poprawiæ 505 #endif 506 //m_ppcYuvReco[uiDepth]->clear(); 507 break; 508 #endif 413 509 default: 414 510 assert(0); -
branches/0.2-poznan-univ/source/Lib/TLibDecoder/TDecCu.h
r5 r11 61 61 TComYuv** m_ppcYuvReco; ///< array of prediction & reconstruction buffer 62 62 TComYuv** m_ppcYuvResPred; ///< residual prediction buffer 63 #if POZNAN_AVAIL_MAP 64 TComYuv** m_ppcYuvAvail; ///< array of available map buffer 65 #endif 66 #if POZNAN_SYNTH_VIEW 67 TComYuv** m_ppcYuvSynth; ///< array of synth buffer 68 #endif 63 69 TComDataCU** m_ppcCU; ///< CU data array 64 70 -
branches/0.2-poznan-univ/source/Lib/TLibDecoder/TDecTop.cpp
r5 r11 53 53 m_aaiCodedScale [ uiId ] = new Int [ MAX_NUMBER_VIEWS ]; 54 54 } 55 #if POZNAN_SYNTH 56 xCreateLUTs ( (UInt)MAX_NUMBER_VIEWS, (UInt)MAX_NUMBER_VIEWS, m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT); 57 58 m_iLog2Precision = LOG2_DISP_PREC_LUT; 59 m_uiBitDepthForLUT = 8; //fixed 60 #endif 55 61 } 56 62 … … 66 72 delete [] m_aiViewOrderIndex; 67 73 delete [] m_aiViewReceived; 74 75 #if POZNAN_SYNTH 76 xDeleteArray( m_adBaseViewShiftLUT, MAX_NUMBER_VIEWS, MAX_NUMBER_VIEWS, 2 ); 77 xDeleteArray( m_aiBaseViewShiftLUT, MAX_NUMBER_VIEWS, MAX_NUMBER_VIEWS, 2 ); 78 #endif 68 79 } 69 80 … … 79 90 m_uiMaxViewId = 0; 80 91 } 92 93 #if POZNAN_SYNTH 94 /* 95 Void 96 CamParsCollector::initLUT(TComSPS &cComSPS) 97 { 98 //===== create arrays ===== 99 //xCreateLUTs ( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews, m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT, m_adBaseViewShiftParameter, m_aiBaseViewShiftParameter ); 100 101 102 //xCreate2dArray( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews, m_aaiCodedScale ); 103 //xCreate2dArray( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews, m_aaiCodedOffset ); 104 //xCreate2dArray( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews, m_aaiScaleAndOffsetSet ); 105 //xInit2dArray ( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews, m_aaiScaleAndOffsetSet, 0 ); 106 107 //xCreate2dArray( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews, m_aaiPdmScaleNomDelta ); 108 //xCreate2dArray( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews, m_aaiPdmOffset ); 109 110 //===== init disparity to virtual depth conversion parameters ===== 111 //xSetPdmConversionParams(); 112 113 //===== init arrays for first frame ===== 114 //xSetShiftParametersAndLUT( m_uiFirstFrameId ); 115 }//*/ 116 117 Void 118 CamParsCollector::xCreateLUTs( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Double****& radLUT, Int****& raiLUT) 119 { 120 //AOF( m_uiBitDepthForLUT == 8 ); 121 //AOF(radLUT == NULL && raiLUT == NULL ); 122 123 uiNumberSourceViews = Max( 1, uiNumberSourceViews ); 124 uiNumberTargetViews = Max( 1, uiNumberTargetViews ); 125 126 radLUT = new Double***[ uiNumberSourceViews ]; 127 raiLUT = new Int ***[ uiNumberSourceViews ]; 128 129 for( UInt uiSourceView = 0; uiSourceView < uiNumberSourceViews; uiSourceView++ ) 130 { 131 radLUT [ uiSourceView ] = new Double**[ uiNumberTargetViews ]; 132 raiLUT [ uiSourceView ] = new Int **[ uiNumberTargetViews ]; 133 134 for( UInt uiTargetView = 0; uiTargetView < uiNumberTargetViews; uiTargetView++ ) 135 { 136 radLUT [ uiSourceView ][ uiTargetView ] = new Double*[ 2 ]; 137 radLUT [ uiSourceView ][ uiTargetView ][ 0 ] = new Double [ 257 ]; 138 radLUT [ uiSourceView ][ uiTargetView ][ 1 ] = new Double [ 257 ]; 139 140 raiLUT [ uiSourceView ][ uiTargetView ] = new Int* [ 2 ]; 141 raiLUT [ uiSourceView ][ uiTargetView ][ 0 ] = new Int [ 257 ]; 142 raiLUT [ uiSourceView ][ uiTargetView ][ 1 ] = new Int [ 257 ]; 143 } 144 } 145 } 146 147 Void 148 CamParsCollector::xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Double****& radLUT, Int****& raiLUT) 149 { 150 Int iLog2DivLuma = m_uiBitDepthForLUT + m_uiCamParsCodedPrecision + 1 - m_iLog2Precision; AOF( iLog2DivLuma > 0 ); 151 Int iLog2DivChroma = iLog2DivLuma + 1; 152 153 iOffset <<= m_uiBitDepthForLUT; 154 155 Double dScale = (Double) iScale / (( Double ) ( 1 << iLog2DivLuma )); 156 Double dOffset = (Double) iOffset / (( Double ) ( 1 << iLog2DivLuma )); 157 158 // offsets including rounding offsets 159 Int64 iOffsetLuma = iOffset + ( ( 1 << iLog2DivLuma ) >> 1 ); 160 Int64 iOffsetChroma = iOffset + ( ( 1 << iLog2DivChroma ) >> 1 ); 161 162 for( UInt uiDepthValue = 0; uiDepthValue < 256; uiDepthValue++ ) 163 { 164 // real-valued look-up tables 165 Double dShiftLuma = ( (Double)uiDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision ); 166 Double dShiftChroma = dShiftLuma / 2; 167 radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = dShiftLuma; 168 radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = dShiftChroma; 169 170 // integer-valued look-up tables 171 Int64 iTempScale = (Int64)uiDepthValue * iScale; 172 Int64 iTestScale = ( iTempScale + iOffset ); // for checking accuracy of camera parameters 173 Int64 iShiftLuma = ( iTempScale + iOffsetLuma ) >> iLog2DivLuma; 174 Int64 iShiftChroma = ( iTempScale + iOffsetChroma ) >> iLog2DivChroma; 175 raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = (Int)iShiftLuma; 176 raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = (Int)iShiftChroma; 177 178 // maximum deviation 179 //dMaxDispDev = Max( dMaxDispDev, fabs( Double( (Int) iTestScale ) - dShiftLuma * Double( 1 << iLog2DivLuma ) ) / Double( 1 << iLog2DivLuma ) ); 180 //dMaxRndDispDvL = Max( dMaxRndDispDvL, fabs( Double( (Int) iShiftLuma ) - dShiftLuma ) ); 181 //dMaxRndDispDvC = Max( dMaxRndDispDvC, fabs( Double( (Int) iShiftChroma ) - dShiftChroma ) ); 182 } 183 184 radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ]; 185 radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ]; 186 raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ]; 187 raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ]; 188 } 189 190 Bool 191 CamParsCollector::getNearestBaseView( Int iSynthViewIdx, Int &riNearestViewIdx, Int &riRelDistToLeft, Bool& rbRenderFromLeft) 192 { 193 /* 194 riNearestViewIdx = 0; 195 196 Bool bDecencdingVN = ( m_aiSortedBaseViews.size() >= 2 && m_aiSortedBaseViews[ 0 ] > m_aiSortedBaseViews[ 1 ] ); 197 Int iFactor = ( bDecencdingVN ? -1 : 1 ); 198 199 if( ( m_aiBaseId2SortedId[iSynthViewIdx] - m_aiBaseId2SortedId[riNearestViewIdx] ) * iFactor <= 0 ) 200 { 201 rbRenderFromLeft = true; 202 } 203 else 204 { 205 rbRenderFromLeft = false; 206 } 207 208 riRelDistToLeft = 128; //Not used for now; 209 //*/ 210 return true; 211 } 212 213 #endif 81 214 82 215 Void … … 161 294 m_aaiCodedScale [ uiViewId ][ uiBaseId ] = pcSlice->getInvCodedScale () [ uiBaseId ]; 162 295 m_aaiCodedOffset[ uiViewId ][ uiBaseId ] = pcSlice->getInvCodedOffset() [ uiBaseId ]; 296 #if POZNAN_SYNTH 297 xInitLUTs(uiBaseId,uiViewId,m_aaiCodedScale [ uiBaseId ][ uiViewId ],m_aaiCodedOffset[ uiBaseId ][ uiViewId ],m_adBaseViewShiftLUT,m_aiBaseViewShiftLUT); 298 xInitLUTs(uiViewId,uiBaseId,m_aaiCodedScale [ uiViewId ][ uiBaseId ],m_aaiCodedOffset[ uiViewId ][ uiBaseId ],m_adBaseViewShiftLUT,m_aiBaseViewShiftLUT); 299 #endif 163 300 } 164 301 else … … 168 305 m_aaiCodedScale [ uiViewId ][ uiBaseId ] = pcSlice->getSPS()->getInvCodedScale () [ uiBaseId ]; 169 306 m_aaiCodedOffset[ uiViewId ][ uiBaseId ] = pcSlice->getSPS()->getInvCodedOffset() [ uiBaseId ]; 307 #if POZNAN_SYNTH 308 xInitLUTs(uiBaseId,uiViewId,m_aaiCodedScale [ uiBaseId ][ uiViewId ],m_aaiCodedOffset[ uiBaseId ][ uiViewId ],m_adBaseViewShiftLUT,m_aiBaseViewShiftLUT); 309 xInitLUTs(uiViewId,uiBaseId,m_aaiCodedScale [ uiViewId ][ uiBaseId ],m_aaiCodedOffset[ uiViewId ][ uiBaseId ],m_adBaseViewShiftLUT,m_aiBaseViewShiftLUT); 310 #endif 170 311 } 171 312 } … … 182 323 m_aaiCodedScale [ uiViewId ][ uiBaseId ] = pcSlice->getInvCodedScale () [ uiBaseId ]; 183 324 m_aaiCodedOffset[ uiViewId ][ uiBaseId ] = pcSlice->getInvCodedOffset() [ uiBaseId ]; 325 #if POZNAN_SYNTH 326 xInitLUTs(uiBaseId,uiViewId,m_aaiCodedScale [ uiBaseId ][ uiViewId ],m_aaiCodedOffset[ uiBaseId ][ uiViewId ],m_adBaseViewShiftLUT,m_aiBaseViewShiftLUT); 327 xInitLUTs(uiViewId,uiBaseId,m_aaiCodedScale [ uiViewId ][ uiBaseId ],m_aaiCodedOffset[ uiViewId ][ uiBaseId ],m_adBaseViewShiftLUT,m_aiBaseViewShiftLUT); 328 #endif 184 329 } 185 330 } … … 458 603 #if HHI_INTERVIEW_SKIP 459 604 pcPic->removeUsedPelsMapBuffer(); 605 #endif 606 #if POZNAN_AVAIL_MAP 607 pcPic->removeAvailabilityBuffer(); 608 #endif 609 #if POZNAN_SYNTH_VIEW 610 pcPic->removeSynthesisBuffer(); 460 611 #endif 461 612 } … … 724 875 #endif 725 876 877 #if POZNAN_SYNTH 878 if( m_pcCamParsCollector) 879 { 880 m_pcCamParsCollector->setSlice( pcSlice ); 881 } 882 //if(!getIsDepth()) 883 getDecTop()->storeSynthPicsInBuffer(pcSlice->getViewIdx(),pcSlice->getSPS()->getViewOrderIdx(),pcSlice->getPOC(),getIsDepth()); 884 #endif 885 726 886 // Decode a picture 727 887 m_cGopDecoder.decompressGop ( bEos, pcBitstream, pcPic, false ); -
branches/0.2-poznan-univ/source/Lib/TLibDecoder/TDecTop.h
r5 r11 71 71 Void uninit (); 72 72 Void setSlice ( TComSlice* pcSlice ); 73 #if POZNAN_SYNTH 74 Double**** getBaseViewShiftLUTD () { return m_adBaseViewShiftLUT; } 75 Int**** getBaseViewShiftLUTI () { return m_aiBaseViewShiftLUT; } 76 77 Int** getBaseViewOffsetI () { return m_aaiCodedOffset; } 78 Int** getBaseViewScaleI () { return m_aaiCodedScale; } 79 80 Bool getNearestBaseView ( Int iSynthViewIdx, Int &riNearestViewIdx, Int &riRelDistToLeft, Bool& rbRenderFromLeft); 81 #endif 73 82 74 83 private: … … 89 98 Int m_iLastPOC; 90 99 UInt m_uiMaxViewId; 91 }; 100 101 #if POZNAN_SYNTH 102 103 UInt m_uiBitDepthForLUT; 104 UInt m_iLog2Precision; 105 UInt m_uiInputBitDepth; 106 107 // look-up tables 108 Double**** m_adBaseViewShiftLUT; ///< Disparity LUT 109 Int**** m_aiBaseViewShiftLUT; ///< Disparity LUT 110 111 Void xCreateLUTs( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Double****& radLUT, Int****& raiLUT); 112 Void xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Double****& radLUT, Int****& raiLUT); 113 114 template<class T> Void xDeleteArray ( T*& rpt, UInt uiSize1, UInt uiSize2, UInt uiSize3 ); 115 template<class T> Void xDeleteArray ( T*& rpt, UInt uiSize1, UInt uiSize2 ); 116 template<class T> Void xDeleteArray ( T*& rpt, UInt uiSize ); 117 #endif 118 }; 119 120 #if POZNAN_SYNTH 121 template <class T> 122 Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize1, UInt uiSize2, UInt uiSize3 ) 123 { 124 if( rpt ) 125 { 126 for( UInt uiK = 0; uiK < uiSize1; uiK++ ) 127 { 128 for( UInt uiL = 0; uiL < uiSize2; uiL++ ) 129 { 130 for( UInt uiM = 0; uiM < uiSize3; uiM++ ) 131 { 132 delete[] rpt[ uiK ][ uiL ][ uiM ]; 133 } 134 delete[] rpt[ uiK ][ uiL ]; 135 } 136 delete[] rpt[ uiK ]; 137 } 138 delete[] rpt; 139 } 140 rpt = NULL; 141 }; 142 143 144 template <class T> 145 Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize1, UInt uiSize2 ) 146 { 147 if( rpt ) 148 { 149 for( UInt uiK = 0; uiK < uiSize1; uiK++ ) 150 { 151 for( UInt uiL = 0; uiL < uiSize2; uiL++ ) 152 { 153 delete[] rpt[ uiK ][ uiL ]; 154 } 155 delete[] rpt[ uiK ]; 156 } 157 delete[] rpt; 158 } 159 rpt = NULL; 160 }; 161 162 163 template <class T> 164 Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize ) 165 { 166 if( rpt ) 167 { 168 for( UInt uiK = 0; uiK < uiSize; uiK++ ) 169 { 170 delete[] rpt[ uiK ]; 171 } 172 delete[] rpt; 173 } 174 rpt = NULL; 175 }; 176 #endif 92 177 93 178 -
branches/0.2-poznan-univ/source/Lib/TLibEncoder/TEncCavlc.cpp
r5 r11 353 353 for( UInt uiId = 0; uiId < pcSPS->getViewId(); uiId++ ) 354 354 { 355 xWriteSvlc( pcSPS->getCodedScale ()[ uiId ] ); 356 xWriteSvlc( pcSPS->getCodedOffset ()[ uiId ] ); 355 //printf("From ViewID %d To ViewID: %d\n",pcSPS->getViewId(),uiId); 356 xWriteSvlc( pcSPS->getCodedScale ()[ uiId ] ); //printf("SPS Scale: %d\n",pcSPS->getCodedScale ()[ uiId ]); 357 xWriteSvlc( pcSPS->getCodedOffset ()[ uiId ] ); //printf("SPS Offset: %d\n", pcSPS->getCodedOffset ()[ uiId ]); 357 358 xWriteSvlc( pcSPS->getInvCodedScale ()[ uiId ] + pcSPS->getCodedScale ()[ uiId ] ); 358 359 xWriteSvlc( pcSPS->getInvCodedOffset()[ uiId ] + pcSPS->getCodedOffset()[ uiId ] ); … … 531 532 for( UInt uiId = 0; uiId < pcSlice->getSPS()->getViewId(); uiId++ ) 532 533 { 533 xWriteSvlc( pcSlice->getCodedScale ()[ uiId ] ); 534 xWriteSvlc( pcSlice->getCodedOffset ()[ uiId ] ); 534 printf("From ViewID %d To ViewID: %d\n",pcSlice->getSPS()->getViewId(),uiId); 535 xWriteSvlc( pcSlice->getCodedScale ()[ uiId ] ); printf("Slice Scale: %d\n",pcSlice->getCodedScale ()[ uiId ]); 536 xWriteSvlc( pcSlice->getCodedOffset ()[ uiId ] ); printf("Slice Offset: %d\n", pcSlice->getCodedOffset ()[ uiId ]); 535 537 xWriteSvlc( pcSlice->getInvCodedScale ()[ uiId ] + pcSlice->getCodedScale ()[ uiId ] ); 536 538 xWriteSvlc( pcSlice->getInvCodedOffset()[ uiId ] + pcSlice->getCodedOffset()[ uiId ] ); -
branches/0.2-poznan-univ/source/Lib/TLibEncoder/TEncCu.cpp
r5 r11 67 67 m_ppcOrigYuv = new TComYuv*[m_uhTotalDepth-1]; 68 68 m_ppcResPredTmp = new TComYuv*[m_uhTotalDepth-1]; 69 #if POZNAN_AVAIL_MAP 70 m_ppcAvailYuv = new TComYuv*[m_uhTotalDepth-1]; 71 #endif 72 #if POZNAN_SYNTH_VIEW 73 m_ppcSynthYuv = new TComYuv*[m_uhTotalDepth-1]; 74 #endif 75 69 76 70 77 #if HHI_MPI … … 93 100 m_ppcOrigYuv [i] = new TComYuv; m_ppcOrigYuv [i]->create(uiWidth, uiHeight); 94 101 102 #if POZNAN_AVAIL_MAP 103 m_ppcAvailYuv [i] = new TComYuv; m_ppcAvailYuv [i]->create(uiWidth, uiHeight); 104 #endif 105 #if POZNAN_SYNTH_VIEW 106 m_ppcSynthYuv [i] = new TComYuv; m_ppcSynthYuv [i]->create(uiWidth, uiHeight); 107 #endif 108 109 95 110 m_ppcResPredTmp [i] = new TComYuv; m_ppcResPredTmp [i]->create(uiWidth, uiHeight); 96 111 } … … 150 165 if(m_ppcOrigYuv[i]) 151 166 { 152 m_ppcOrigYuv[i]->destroy(); delete m_ppcOrigYuv[i]; m_ppcOrigYuv[i] = NULL; 153 } 167 m_ppcOrigYuv[i]->destroy(); delete m_ppcOrigYuv[i]; m_ppcOrigYuv[i] = NULL; 168 } 169 #if POZNAN_AVAIL_MAP 170 if(m_ppcAvailYuv[i]) 171 { 172 m_ppcAvailYuv[i]->destroy(); delete m_ppcAvailYuv[i]; m_ppcAvailYuv[i] = NULL; 173 } 174 #endif 175 #if POZNAN_SYNTH_VIEW 176 if(m_ppcSynthYuv[i]) 177 { 178 m_ppcSynthYuv[i]->destroy(); delete m_ppcSynthYuv[i]; m_ppcSynthYuv[i] = NULL; 179 } 180 #endif 154 181 if(m_ppcResPredTmp[i]) 155 182 { … … 203 230 m_ppcOrigYuv = NULL; 204 231 } 232 #if POZNAN_AVAIL_MAP 233 if(m_ppcAvailYuv) 234 { 235 delete [] m_ppcAvailYuv; 236 m_ppcAvailYuv = NULL; 237 } 238 #endif 239 #if POZNAN_SYNTH_VIEW 240 if(m_ppcSynthYuv) 241 { 242 delete [] m_ppcSynthYuv; 243 m_ppcSynthYuv = NULL; 244 } 245 #endif 205 246 if(m_ppcResPredTmp) 206 247 { … … 426 467 // get Original YUV data from picture 427 468 m_ppcOrigYuv[uiDepth]->copyFromPicYuv( pcPic->getPicYuvOrg(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU() ); 428 469 #if POZNAN_AVAIL_MAP 470 if (pcPic->getPicYuvAvail()) m_ppcAvailYuv[uiDepth]->copyFromPicYuv( pcPic->getPicYuvAvail(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU() ); 471 #endif 472 #if POZNAN_SYNTH_VIEW 473 if (pcPic->getPicYuvSynth()) m_ppcSynthYuv[uiDepth]->copyFromPicYuv( pcPic->getPicYuvSynth(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU() ); 474 #endif 475 476 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 477 Bool bWholeCUCanBeSynthesized = false; 478 Bool bOneSubCUCanNotBeSynthesied = false; 479 Bool bSubCUCanBeSynthesized[4]; 480 Bool * pbSubCUCanBeSynthesized = bSubCUCanBeSynthesized; 481 pcPic->checkSynthesisAvailability(rpcBestCU, rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU(), uiDepth, pbSubCUCanBeSynthesized); //KUBA SYNTH 482 Int iSubCUCanNotBeSynthesized = 0; 483 Int iSubCUCanBeSynthesizedCnt = 0; 484 for(Int i = 0; i < 4; i++) 485 { 486 if (!bSubCUCanBeSynthesized[i]) 487 { 488 iSubCUCanNotBeSynthesized = i; 489 } 490 else 491 { 492 iSubCUCanBeSynthesizedCnt ++; 493 } 494 } 495 if(iSubCUCanBeSynthesizedCnt == 4) 496 { 497 bWholeCUCanBeSynthesized = true; 498 } 499 else if(iSubCUCanBeSynthesizedCnt == 3) 500 { 501 bOneSubCUCanNotBeSynthesied = true; 502 } 503 #endif 429 504 // variables for fast encoder decision 430 505 TComDataCU* pcTempCU; … … 493 568 if( ( uiRPelX < rpcBestCU->getSlice()->getSPS()->getWidth() ) && ( uiBPelY < rpcBestCU->getSlice()->getSPS()->getHeight() ) ) 494 569 { 570 // do CU Skip 571 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 572 if(bWholeCUCanBeSynthesized) 573 { 574 rpcBestCU->getTotalCost() = 0; // Cost of synthesised CU is zero 575 rpcBestCU->getTotalBits() = 0; // Cost of synthesised CU is zero 576 rpcBestCU->getTotalDistortion() = 0; // Distortion of synthesised CU is zero 577 rpcBestCU->setPredModeSubParts( MODE_SYNTH, 0, uiDepth ); 578 rpcBestCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); 579 #if POZNAN_FILL_OCCLUDED_CU_WITH_SYNTHESIS 580 m_ppcRecoYuvBest[uiDepth]->copyFromPicYuv(pcPic->getPicYuvSynth(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU()); // First copy synthesis YUV part to CU encoder reconstruction YUV structure 581 #else 582 m_ppcRecoYuvBest[uiDepth]->copyFromPicYuv(pcPic->getPicYuvAvail(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU()); // First copy synthesis YUV part to CU encoder reconstruction YUV structure 583 #endif 584 UInt uiInitTrDepth = rpcBestCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1; 585 rpcBestCU->copyToPic(uiDepth, 0, uiInitTrDepth); 586 xCopyYuv2Pic( rpcBestCU->getPic(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU(), uiDepth ); // Next copy it to reconstruction YUV buffer in coded picture 587 assert( rpcBestCU->getPartitionSize ( 0 ) != SIZE_NONE ); //Not needed any more ?? 588 assert( rpcBestCU->getPredictionMode( 0 ) != MODE_NONE ); 589 assert( rpcBestCU->getTotalCost ( ) != MAX_DOUBLE ); 590 591 #if HHI_VSO//?? 592 if( m_pcRdCost->getUseRenModel() ) 593 { 594 UInt uiWidth = rpcBestCU->getWidth ( 0 ); 595 UInt uiHeight = rpcBestCU->getHeight( 0 ); 596 Pel* piSrc = m_ppcRecoYuvBest[uiDepth]->getLumaAddr( 0 ); 597 UInt uiSrcStride = m_ppcRecoYuvBest[uiDepth]->getStride(); 598 m_pcRdCost->setRenModelData( rpcBestCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 599 } 600 #endif 601 return; 602 } 603 else if (bOneSubCUCanNotBeSynthesied && (uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth )) // If only one from subCU can not be synthesised than force NxN split but donot signal it in the stream 604 { 605 //printf("CUSkip - OneCanNotBe %d %d %d\n",rpcBestCU->getCUPelX(),rpcBestCU->getCUPelY(),rpcBestCU->getWidth()); 606 // further split !!!!go to line 866!!! 607 #if HHI_VSO 608 // reset Model 609 if( m_pcRdCost->getUseRenModel() ) 610 { 611 UInt uiWidth = m_ppcBestCU[uiDepth]->getWidth ( 0 ); 612 UInt uiHeight = m_ppcBestCU[uiDepth]->getHeight( 0 ); 613 Pel* piSrc = m_ppcOrigYuv[uiDepth]->getLumaAddr( 0 ); 614 UInt uiSrcStride = m_ppcOrigYuv[uiDepth]->getStride(); 615 m_pcRdCost->setRenModelData( m_ppcBestCU[uiDepth], 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 616 } 617 #endif 618 619 UChar uhNextDepth = uiDepth + 1; 620 TComDataCU* pcSubBestPartCU = m_ppcBestCU[uhNextDepth]; 621 TComDataCU* pcSubTempPartCU = m_ppcTempCU[uhNextDepth]; 622 623 for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 4; uiPartUnitIdx++ ) //UInt uiPartUnitIdx = iSubCUNotSynthesied; 624 { 625 pcSubBestPartCU->initSubCU( rpcBestCU, uiPartUnitIdx, uhNextDepth ); // clear sub partition datas or init. 626 pcSubTempPartCU->initSubCU( rpcBestCU, uiPartUnitIdx, uhNextDepth ); // clear sub partition datas or init. 627 // pcSubBestPartCU->setLastCodedQP( rpcBestCU->getLastCodedQP() ); 628 // pcSubTempPartCU->setLastCodedQP( rpcBestCU->getLastCodedQP() ); 629 630 if( ( pcSubBestPartCU->getCUPelX() < pcSubBestPartCU->getSlice()->getSPS()->getWidth() ) && ( pcSubBestPartCU->getCUPelY() < pcSubBestPartCU->getSlice()->getSPS()->getHeight() ) ) 631 { 632 if( m_bUseSBACRD ) 633 { 634 if ( 0 == uiPartUnitIdx) //initialize RD with previous depth buffer 635 { 636 m_pppcRDSbacCoder[uhNextDepth][CI_CURR_BEST]->load(m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST]); 637 } 638 else 639 { 640 m_pppcRDSbacCoder[uhNextDepth][CI_CURR_BEST]->load(m_pppcRDSbacCoder[uhNextDepth][CI_NEXT_BEST]); 641 } 642 } 643 644 xCompressCU( pcSubBestPartCU, pcSubTempPartCU, uhNextDepth ); //Compress SubCU's 645 646 #if HHI_VSO 647 if( m_pcRdCost->getUseRenModel() ) 648 { 649 UInt uiWidth = pcSubBestPartCU->getWidth ( 0 ); 650 UInt uiHeight = pcSubBestPartCU->getHeight( 0 ); 651 Pel* piSrc = m_ppcRecoYuvBest[pcSubBestPartCU->getDepth(0)]->getLumaAddr( 0 ); 652 UInt uiSrcStride = m_ppcRecoYuvBest[pcSubBestPartCU->getDepth(0)]->getStride(); 653 m_pcRdCost->setRenModelData( pcSubBestPartCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 654 } 655 #endif 656 rpcTempCU->copyPartFrom( pcSubBestPartCU, uiPartUnitIdx, uhNextDepth ); // Keep best part data to current temporary data. 657 xCopyYuv2Tmp( pcSubBestPartCU->getTotalNumPart()*uiPartUnitIdx, uhNextDepth ); 658 } 659 } 660 661 if( !bBoundary ) 662 { 663 m_pcEntropyCoder->resetBits(); 664 m_pcEntropyCoder->encodeSplitFlag( rpcTempCU, 0, uiDepth, true ); 665 666 rpcTempCU->getTotalBits() += m_pcEntropyCoder->getNumberOfWrittenBits(); // split bits 667 } 668 669 #if HHI_INTERVIEW_SKIP_LAMBDA_SCALE 670 if( bFullyRenderedSec ) 671 { 672 m_pcRdCost->setLambdaScale( m_pcEncCfg->getInterViewSkipLambdaScale() ); 673 } 674 else 675 { 676 m_pcRdCost->setLambdaScale( 1 ); 677 } 678 #endif 679 #if HHI_VSO 680 if ( m_pcRdCost->getUseLambdaScaleVSO()) 681 { 682 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCostVSO( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 683 } 684 else 685 #endif 686 { 687 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 688 } 689 690 if( m_bUseSBACRD ) 691 { 692 m_pppcRDSbacCoder[uhNextDepth][CI_NEXT_BEST]->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]); 693 } 694 //Copy Tmp to Best 695 xCheckBestMode( rpcBestCU, rpcTempCU, uiDepth ); //Roznica z naszym koder // RD compare current larger prediction 696 697 #if HHI_VSO 698 if( m_pcRdCost->getUseRenModel() ) 699 { 700 UInt uiWidth = rpcBestCU->getWidth ( 0 ); 701 UInt uiHeight = rpcBestCU->getHeight( 0 ); 702 Pel* piSrc = m_ppcRecoYuvBest[uiDepth]->getLumaAddr( 0 ); 703 UInt uiSrcStride = m_ppcRecoYuvBest[uiDepth]->getStride(); 704 m_pcRdCost->setRenModelData( rpcBestCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 705 } 706 #endif 707 //Copy result to pic 708 rpcBestCU->copyToPic(uiDepth); // Copy Best data to Picture for next partition prediction. 709 710 if( bBoundary ) 711 return; 712 713 xCopyYuv2Pic( rpcBestCU->getPic(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU(), uiDepth ); // Copy Yuv data to picture Yuv 714 715 // Assert if Best prediction mode is NONE 716 // Selected mode's RD-cost must be not MAX_DOUBLE. 717 assert( rpcBestCU->getPartitionSize ( 0 ) != SIZE_NONE ); //Not needed any more? 718 assert( rpcBestCU->getPredictionMode( 0 ) != MODE_NONE ); 719 assert( rpcBestCU->getTotalCost ( ) != MAX_DOUBLE ); 720 return; 721 } 722 #endif 723 495 724 // do inter modes 496 725 if( rpcBestCU->getSlice()->getSliceType() != I_SLICE ) … … 836 1065 TComPic* pcPic = pcCU->getPic(); 837 1066 1067 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 1068 if( pcCU->isCUSkiped( uiAbsPartIdx ) && uiDepth == pcCU->getDepth( uiAbsPartIdx )) //If CU Skiped no information is coded into stream 1069 return; 1070 #endif 1071 838 1072 Bool bBoundary = false; 839 1073 UInt uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; … … 842 1076 UInt uiBPelY = uiTPelY + (g_uiMaxCUHeight>>uiDepth) - 1; 843 1077 1078 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 1079 Bool bDontSendSplitFlag = false; 1080 if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < (g_uiMaxCUDepth-g_uiAddCUDepth) ) ) || bBoundary ) //check if CU has 3 synthesied subCU - no split flag is send in that case 1081 { 1082 UInt uiQNumParts = ( pcPic->getNumPartInCU() >> (uiDepth<<1) )>>2; 1083 Int iCUSkipCounter = 0; 1084 UInt uiAbsPartIdxTmp = uiAbsPartIdx; 1085 for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 4; uiPartUnitIdx++, uiAbsPartIdxTmp+=uiQNumParts ) 1086 { 1087 if(pcCU->isCUSkiped(uiAbsPartIdxTmp) && (pcCU->getDepth( uiAbsPartIdxTmp ) == uiDepth + 1) ) 1088 { 1089 iCUSkipCounter++; 1090 } 1091 } 1092 if(iCUSkipCounter == 3) 1093 { 1094 bDontSendSplitFlag = true; 1095 } 1096 } 1097 #endif 1098 844 1099 if( ( uiRPelX < pcCU->getSlice()->getSPS()->getWidth() ) && ( uiBPelY < pcCU->getSlice()->getSPS()->getHeight() ) ) 845 1100 { 1101 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 1102 if(!bDontSendSplitFlag) 1103 #endif 846 1104 #if HHI_MPI 847 1105 if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 || uiDepth < pcCU->getTextureModeDepth( uiAbsPartIdx ) ) … … 1412 1670 for( UInt ui = 0; ui < rpcTempCU->getTotalNumPart(); ui++ ) 1413 1671 { 1414 if( pcTextureCU->isIntra( rpcTempCU->getZorderIdxInCU() + ui ) ) 1672 if( pcTextureCU->isIntra( rpcTempCU->getZorderIdxInCU() + ui ) 1673 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 1674 || pcTextureCU->isCUSkiped( rpcTempCU->getZorderIdxInCU() + ui ) 1675 #endif 1676 ) 1415 1677 { 1416 1678 return; -
branches/0.2-poznan-univ/source/Lib/TLibEncoder/TEncCu.h
r5 r11 78 78 TComYuv** m_ppcOrigYuv; ///< Original Yuv for each depth 79 79 TComYuv** m_ppcResPredTmp; ///< Temporary residual prediction for each depth 80 80 #if POZNAN_AVAIL_MAP 81 TComYuv** m_ppcAvailYuv; ///< Avaiability map for each depth 82 #endif 83 #if POZNAN_SYNTH_VIEW 84 TComYuv** m_ppcSynthYuv; ///< Synthetized Yuv for each depth 85 #endif 86 81 87 // Data : encoder control 82 88 Int m_iQp; ///< Last QP -
branches/0.2-poznan-univ/source/Lib/TLibEncoder/TEncGOP.cpp
r5 r11 799 799 Pel* pOrg = pcPic ->getPicYuvOrg()->getLumaAddr(); 800 800 Pel* pRec = pcPicD->getLumaAddr(); 801 #if POZNAN_CU_SKIP_PSNR 802 Pel* pAvail = NULL; 803 if(pcPic ->getPicYuvAvail()) 804 pAvail = pcPic ->getPicYuvAvail()->getLumaAddr(); 805 UInt64 iPixelsCnt = 0; 806 #endif 801 807 Int iStride = pcPicD->getStride(); 802 808 … … 813 819 Double fRefValueC = fRefValueY / 4.0; 814 820 815 for( y = 0; y < iHeight; y++ ) 816 { 817 for( x = 0; x < iWidth; x++ ) 818 { 819 Int iDiff = (Int)( pOrg[x] - pRec[x] ); 820 uiSSDY += iDiff * iDiff; 821 } 822 pOrg += iStride; 823 pRec += iStride; 821 #if POZNAN_CU_SKIP_PSNR 822 if(pAvail) 823 { 824 for( y = 0; y < iHeight; y++ ) 825 { 826 for( x = 0; x < iWidth; x++ ) 827 { 828 if(pAvail[x]==0) //If pixel was codded 829 { 830 Int iDiff = (Int)( pOrg[x] - pRec[x] ); 831 uiSSDY += iDiff * iDiff; 832 iPixelsCnt++; 833 } 834 } 835 pOrg += iStride; 836 pRec += iStride; 837 pAvail+=iStride; 838 } 839 840 fRefValueY = (double) maxval * maxval * iPixelsCnt; 841 } 842 else 843 #endif 844 { 845 for( y = 0; y < iHeight; y++ ) 846 { 847 for( x = 0; x < iWidth; x++ ) 848 { 849 Int iDiff = (Int)( pOrg[x] - pRec[x] ); 850 uiSSDY += iDiff * iDiff; 851 } 852 pOrg += iStride; 853 pRec += iStride; 854 } 824 855 } 825 856 … … 837 868 #endif 838 869 { 839 iHeight >>= 1; 840 iWidth >>= 1; 841 iStride >>= 1; 842 pOrg = pcPic ->getPicYuvOrg()->getCbAddr(); 843 pRec = pcPicD->getCbAddr(); 844 845 for( y = 0; y < iHeight; y++ ) 846 { 847 for( x = 0; x < iWidth; x++ ) 848 { 849 Int iDiff = (Int)( pOrg[x] - pRec[x] ); 850 uiSSDU += iDiff * iDiff; 851 } 852 pOrg += iStride; 853 pRec += iStride; 854 } 855 856 pOrg = pcPic ->getPicYuvOrg()->getCrAddr(); 857 pRec = pcPicD->getCrAddr(); 858 859 for( y = 0; y < iHeight; y++ ) 860 { 861 for( x = 0; x < iWidth; x++ ) 862 { 863 Int iDiff = (Int)( pOrg[x] - pRec[x] ); 864 uiSSDV += iDiff * iDiff; 865 } 866 pOrg += iStride; 867 pRec += iStride; 868 } 869 dYPSNR = ( uiSSDY ? 10.0 * log10( fRefValueY / (Double)uiSSDY ) : 99.99 ); 870 dUPSNR = ( uiSSDU ? 10.0 * log10( fRefValueC / (Double)uiSSDU ) : 99.99 ); 871 dVPSNR = ( uiSSDV ? 10.0 * log10( fRefValueC / (Double)uiSSDV ) : 99.99 ); 870 #if POZNAN_CU_SKIP_PSNR 871 if(pAvail) 872 { 873 iHeight >>= 1; 874 iWidth >>= 1; 875 iStride >>= 1; 876 877 pOrg = pcPic ->getPicYuvOrg()->getCbAddr(); 878 pRec = pcPicD->getCbAddr(); 879 pAvail = pcPic ->getPicYuvAvail()->getLumaAddr(); 880 iPixelsCnt = 0; 881 882 for( y = 0; y < iHeight; y++ ) 883 { 884 for( x = 0; x < iWidth; x++ ) 885 { 886 if(pAvail[x<<1]==0||pAvail[(x<<1)+1]==0|| 887 pAvail[(x+iStride)<<1]==0||pAvail[((x+iStride)<<1)+1]==0) //If pixel was codded 888 { 889 Int iDiff = (Int)( pOrg[x] - pRec[x] ); 890 uiSSDU += iDiff * iDiff; 891 iPixelsCnt++; 892 } 893 } 894 pOrg += iStride; 895 pRec += iStride; 896 pAvail+= (iStride<<2); 897 } 898 899 fRefValueC = (double) maxval * maxval * iPixelsCnt; 900 901 pOrg = pcPic ->getPicYuvOrg()->getCrAddr(); 902 pRec = pcPicD->getCrAddr(); 903 pAvail = pcPic ->getPicYuvAvail()->getLumaAddr(); 904 for( y = 0; y < iHeight; y++ ) 905 { 906 for( x = 0; x < iWidth; x++ ) 907 { 908 if(pAvail[x<<1]==0||pAvail[(x<<1)+1]==0|| 909 pAvail[(x+iStride)<<1]==0||pAvail[((x+iStride)<<1)+1]==0) //If pixel was codded 910 { 911 Int iDiff = (Int)( pOrg[x] - pRec[x] ); 912 uiSSDV += iDiff * iDiff; 913 } 914 } 915 pOrg += iStride; 916 pRec += iStride; 917 pAvail+= iStride<<2; 918 } 919 } 920 else 921 #endif 922 { 923 iHeight >>= 1; 924 iWidth >>= 1; 925 iStride >>= 1; 926 927 pOrg = pcPic ->getPicYuvOrg()->getCbAddr(); 928 pRec = pcPicD->getCbAddr(); 929 930 for( y = 0; y < iHeight; y++ ) 931 { 932 for( x = 0; x < iWidth; x++ ) 933 { 934 Int iDiff = (Int)( pOrg[x] - pRec[x] ); 935 uiSSDU += iDiff * iDiff; 936 } 937 pOrg += iStride; 938 pRec += iStride; 939 } 940 941 pOrg = pcPic ->getPicYuvOrg()->getCrAddr(); 942 pRec = pcPicD->getCrAddr(); 943 944 for( y = 0; y < iHeight; y++ ) 945 { 946 for( x = 0; x < iWidth; x++ ) 947 { 948 Int iDiff = (Int)( pOrg[x] - pRec[x] ); 949 uiSSDV += iDiff * iDiff; 950 } 951 pOrg += iStride; 952 pRec += iStride; 953 } 954 } 955 956 dYPSNR = ( uiSSDY ? 10.0 * log10( fRefValueY / (Double)uiSSDY ) : 99.99 ); 957 dUPSNR = ( uiSSDU ? 10.0 * log10( fRefValueC / (Double)uiSSDU ) : 99.99 ); 958 dVPSNR = ( uiSSDV ? 10.0 * log10( fRefValueC / (Double)uiSSDV ) : 99.99 ); 872 959 } 873 960 // fix: total bits should consider slice size bits (32bit) -
branches/0.2-poznan-univ/source/Lib/TLibEncoder/TEncTop.cpp
r5 r11 416 416 { 417 417 pcPic->removeOriginalBuffer (); 418 #if POZNAN_AVAIL_MAP 419 pcPic->removeAvailabilityBuffer(); 420 #endif 421 #if POZNAN_SYNTH_VIEW 422 pcPic->removeSynthesisBuffer(); 423 #endif 418 424 #if HHI_INTER_VIEW_MOTION_PRED 419 425 pcPic->removeOrgDepthMapBuffer(); -
branches/0.2-poznan-univ/source/Lib/TLibRenderer/TRenModel.cpp
r5 r11 523 523 Int iTargetStride = m_aiCurDepthStrides[ m_iCurrentView ]; 524 524 TRenFilter::copy( piNewData, iStride, iWidth, iHeight, m_apiCurDepthPel[ m_iCurrentView ] + iStartPosY * iTargetStride + iStartPosX, iTargetStride ); 525 526 { 527 printf("%d %d\n",iStartPosX,iStartPosY); 528 TComPicYuv mapPic; 529 mapPic.create( 1920, 1088, 64, 64, 3 ); 530 TRenFilter::copy( m_apiCurDepthPel[ m_iCurrentView ], iTargetStride, 1920,1088, mapPic.getLumaAddr(), mapPic.getStride()); 531 mapPic.dump("VSO_1920x1088.yuv",true); 532 } 525 533 } 526 534 else -
branches/0.2-poznan-univ/source/Lib/TLibRenderer/TRenTop.cpp
r5 r11 266 266 PelImage cInputDepth ( pcPicYuvDepth , true); 267 267 PelImage cOutputImage( pcPicYuvSynthOut ); 268 268 269 269 m_pcOutputImage->init(); 270 270 m_pcFilled ->assign(REN_IS_HOLE); 271 272 271 xPreProcessDepth ( &cInputDepth, &cInputDepth); 273 272 xConvertInputData( &cInputImage, &cInputDepth, m_pcInputImage, m_pcInputDepth, !bRenderFromLeft ); … … 279 278 xCutMargin ( &cOutputImage ); 280 279 }; 280 281 #if POZNAN_SYNTH 282 Void TRenTop::extrapolateAvailabilityView( TComPicYuv* pcPicYuvVideo, TComPicYuv* pcPicYuvDepth, TComPicYuv* pcPicYuvSynthOut, TComPicYuv* pcPicYuvAvailOut, Bool bRenderFromLeft ) 283 { 284 AOF( m_bExtrapolate ); 285 AOF( bRenderFromLeft ? m_ppiShiftLUTLeft || m_ppdShiftLUTLeft : m_ppiShiftLUTRight || m_ppdShiftLUTRight ); 286 AOF( m_auiInputResolution[0] == pcPicYuvVideo->getWidth ()); 287 AOF( m_auiInputResolution[1] == pcPicYuvVideo->getHeight()); 288 289 PelImage cInputImage ( pcPicYuvVideo ); 290 PelImage cInputDepth ( pcPicYuvDepth , true); 291 PelImage cOutputImage( pcPicYuvSynthOut ); 292 PelImage cFillImage( pcPicYuvAvailOut ); 293 294 m_pcOutputImage->init(); 295 m_pcFilled ->assign(REN_IS_HOLE); 296 297 xPreProcessDepth ( &cInputDepth, &cInputDepth); 298 xConvertInputData( &cInputImage, &cInputDepth, m_pcInputImage, m_pcInputDepth, !bRenderFromLeft ); 299 xShiftPixels(m_pcInputImage, m_pcInputDepth, m_pcOutputImage, &cFillImage, bRenderFromLeft); 300 xRemBoundaryNoise ( m_pcOutputImage, &cFillImage, m_pcOutputImage, bRenderFromLeft); // Erode 301 xFillHoles ( m_pcOutputImage, &cFillImage, m_pcOutputImage, bRenderFromLeft); 302 xConvertOutputData( m_pcOutputImage, &cOutputImage, !bRenderFromLeft ); 303 if (!bRenderFromLeft) TRenFilter::mirrorHor( &cFillImage ); 304 //xConvertOutputData( m_pcFilled, &cFillImage, !bRenderFromLeft ); 305 xPostProcessImage (&cOutputImage, &cOutputImage); 306 xCutMargin ( &cOutputImage ); 307 }; 308 #endif 281 309 282 310 Void TRenTop::getUsedSamplesMap( TComPicYuv* pcPicYuvDepth, TComPicYuv* pcUsedSampleMap, Bool bRenderFromLeft ) -
branches/0.2-poznan-univ/source/Lib/TLibRenderer/TRenTop.h
r5 r11 109 109 Int iBlendMode, 110 110 Int iSimEnhBaseView ); 111 112 #if POZNAN_SYNTH 113 Void extrapolateAvailabilityView 114 ( TComPicYuv* pcPicYuvVideo, 115 TComPicYuv* pcPicYuvDepth, 116 TComPicYuv* pcPicYuvSynthOut, 117 TComPicYuv* pcPicYuvAvailOut, 118 Bool bRenderFromLeft ); 119 #endif 111 120 // Tools 112 121 Void getUsedSamplesMap ( TComPicYuv* pcPicYuvDepth,
Note: See TracChangeset for help on using the changeset viewer.