Changeset 11 in 3DVCSoftware for branches/0.2-poznan-univ/source/App
- Timestamp:
- 5 Feb 2012, 22:00:22 (13 years ago)
- Location:
- branches/0.2-poznan-univ/source/App
- Files:
-
- 6 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
Note: See TracChangeset for help on using the changeset viewer.