Changeset 48 in 3DVCSoftware for branches/0.3-poznan-univ/source/App
- Timestamp:
- 30 Mar 2012, 18:57:41 (13 years ago)
- Location:
- branches/0.3-poznan-univ/source/App
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.3-poznan-univ/source/App/TAppDecoder/TAppDecTop.cpp
r41 r48 739 739 Void TAppDecTop::storeSynthPicsInBuffer(Int iCoddedViewIdx,Int iCoddedViewOrderIdx, Int iCurPoc, Bool bDepth) 740 740 { 741 Int iLeftViewIdx = -1;742 Int iRightViewIdx = -1;743 741 Int iNearestViewIdx = -1; 744 742 Bool bRenderFromLeft; … … 830 828 Void TAppDecTop::storeDepthSynthPicsInBuffer(Int iCoddedViewIdx,Int iCoddedViewOrderIdx, Int iCurPoc) 831 829 { 832 Int iLeftViewIdx = -1;833 Int iRightViewIdx = -1;834 830 Int iNearestViewIdx = -1; 835 831 Bool bRenderFromLeft; -
branches/0.3-poznan-univ/source/App/TAppEncoder/TAppEncCfg.cpp
r41 r48 523 523 size = m_iSourceWidth*m_iSourceHeight; 524 524 depth_buf = (unsigned char *)malloc(size); 525 fread(depth_buf, 1, size, base_depth_file);525 size_t read = fread(depth_buf, 1, size, base_depth_file); 526 526 fclose(base_depth_file); 527 memset(histogram, 0, sizeof(histogram)); 528 for (i=0; i<size;++i) histogram[depth_buf[i]]++; 529 weighted_avg = 0; 530 for (i=0; i<256; ++i) weighted_avg += i*histogram[i]; 531 weighted_avg /= size; 532 533 if (weighted_avg<m_iNonlinearDepthThreshold) 527 if(read) 534 528 { 535 m_bUseNonlinearDepth = 0; 536 printf ("\nWeighted average of depth histogram:%f < %d, turning NonlinearDepthRepresentation OFF\n", weighted_avg, m_iNonlinearDepthThreshold); 529 memset(histogram, 0, sizeof(histogram)); 530 for (i=0; i<size;++i) histogram[depth_buf[i]]++; 531 weighted_avg = 0; 532 for (i=0; i<256; ++i) weighted_avg += i*histogram[i]; 533 weighted_avg /= size; 534 535 if (weighted_avg<m_iNonlinearDepthThreshold) 536 { 537 m_bUseNonlinearDepth = 0; 538 printf ("\nWeighted average of depth histogram:%f < %d, turning NonlinearDepthRepresentation OFF\n", weighted_avg, m_iNonlinearDepthThreshold); 539 } 537 540 } 538 541 } … … 542 545 if(m_bUseNonlinearDepth) 543 546 { 547 if((Int)m_aiNonlinearDepthModel.size()== 0) 548 { 549 m_aiNonlinearDepthModel.push_back(10); 550 m_aiNonlinearDepthModel.push_back(19); 551 m_aiNonlinearDepthModel.push_back(24); 552 m_aiNonlinearDepthModel.push_back(27); 553 m_aiNonlinearDepthModel.push_back(26); 554 m_aiNonlinearDepthModel.push_back(22); 555 m_aiNonlinearDepthModel.push_back(13); 556 } 557 //10,19,24,27,26,22,13 544 558 m_cNonlinearDepthModel.m_iNum = (Int)m_aiNonlinearDepthModel.size(); 559 545 560 m_cNonlinearDepthModel.m_aiPoints[0]=0; 561 546 562 for (int i=0; i<m_cNonlinearDepthModel.m_iNum; ++i) 547 563 m_cNonlinearDepthModel.m_aiPoints[i+1] = m_aiNonlinearDepthModel[i]; -
branches/0.3-poznan-univ/source/App/TAppEncoder/TAppEncTop.cpp
r41 r48 150 150 #endif 151 151 152 #if BITSTREAM_EXTRACTION 153 m_acTEncTopList[iViewIdx]->setLayerId ( ( (UInt)iViewIdx ) << 1 ); 154 #endif 152 155 m_acTEncTopList[iViewIdx]->setViewId ( (UInt)iViewIdx ); 153 156 m_acTEncTopList[iViewIdx]->setViewOrderIdx ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] ); … … 359 362 #endif 360 363 364 #if BITSTREAM_EXTRACTION 365 m_acTEncDepthTopList[iViewIdx]->setLayerId ( ( ( (UInt)iViewIdx ) << 1 ) + 1 ); 366 #endif 361 367 m_acTEncDepthTopList[iViewIdx]->setViewId ( (UInt)iViewIdx ); 362 368 m_acTEncDepthTopList[iViewIdx]->setViewOrderIdx ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] ); 363 369 m_acTEncDepthTopList[iViewIdx]->setIsDepth ( true ); 370 #if FLEX_CODING_ORDER 371 m_acTEncDepthTopList[iViewIdx]->setCamParPrecision ( m_cCameraData.getCamParsCodedPrecision () ); 372 m_acTEncDepthTopList[iViewIdx]->setCamParInSliceHeader ( m_cCameraData.getVaryingCameraParameters() ); 373 m_acTEncDepthTopList[iViewIdx]->setCodedScale ( m_cCameraData.getCodedScale () ); 374 m_acTEncDepthTopList[iViewIdx]->setCodedOffset ( m_cCameraData.getCodedOffset () ); 375 #else 364 376 m_acTEncDepthTopList[iViewIdx]->setCamParPrecision ( 0 ); 365 377 m_acTEncDepthTopList[iViewIdx]->setCamParInSliceHeader ( false ); 366 378 m_acTEncDepthTopList[iViewIdx]->setCodedScale ( 0 ); 367 379 m_acTEncDepthTopList[iViewIdx]->setCodedOffset ( 0 ); 380 #endif 368 381 #if DEPTH_MAP_GENERATION 369 382 m_acTEncDepthTopList[iViewIdx]->setPredDepthMapGeneration ( 0 ); … … 794 807 iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0'); 795 808 bThisViewContinueReadingPics = bContinueReadingPics[iViewIdx]; 809 #if POZNAN_SYNTH 810 if( m_uiUseCUSkip ) 811 { 812 xStoreSynthPicsInBuffer(iViewIdx,false); 813 } 814 #endif 796 815 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 797 816 // If no depth picture reconstruction for current view and current POC is available sythesize one 798 Int iCurrPoc= m_acTEncTopList[ 0 ]->getNextFrameId();817 //Int iCurrPoc2 = m_acTEncTopList[ 0 ]->getNextFrameId(); 799 818 Bool bCurrPicDepthRec = getPicFromView( iViewIdx, iCurrPoc, true ) != NULL && getPicFromView( iViewIdx, iCurrPoc, true )->getReconMark(); 800 819 if(m_bUseTexDqpAccordingToDepth && !bCurrPicDepthRec) … … 825 844 iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0'); 826 845 bThisViewContinueReadingDepthPics = bContinueReadingDepthPics[iViewIdx]; 846 #if POZNAN_SYNTH 847 if( m_uiUseCUSkip ) 848 { 849 xStoreSynthPicsInBuffer(iViewIdx,true); 850 } 851 #endif 827 852 m_acTEncDepthTopList[iViewIdx]->encode( bDepthEos[iViewIdx], m_cListPicYuvDepthRecMap[iViewIdx], pcBitstream, bThisViewContinueReadingDepthPics ); 828 853 bContinueReadingDepthPics[iViewIdx]=bThisViewContinueReadingDepthPics; … … 858 883 #if FLEX_CODING_ORDER 859 884 // If no depth picture reconstruction for current view and current POC is available sythesize one 860 Int iCurrPoc = m_acTEncTopList[ 0 ]->getNextFrameId();885 //Int iCurrPoc = m_acTEncTopList[ 0 ]->getNextFrameId(); 861 886 Bool bCurrPicDepthRec = getPicFromView( iViewIdx, iCurrPoc, true ) != NULL && getPicFromView( iViewIdx, iCurrPoc, true )->getReconMark(); 862 887 if(m_bUseTexDqpAccordingToDepth && !bCurrPicDepthRec) … … 1390 1415 } 1391 1416 1392 Int iNumberOfReferenceViews = 0;1393 1417 Int iNearestViewIdx = -1; 1394 1418 Bool bRenderFromLeft; … … 1477 1501 Void TAppEncTop::xStoreDepthSynthPicsInBuffer(Int iCoddedViewIdx) 1478 1502 { 1479 Int iLeftViewIdx = -1;1480 Int iRightViewIdx = -1;1481 1503 Int iNearestViewIdx = -1; 1482 1504 Bool bRenderFromLeft; -
branches/0.3-poznan-univ/source/App/TAppRenderer/TAppRendererTop.cpp
r45 r48 308 308 else 309 309 { 310 Int iDistLeft = abs( m_cCameraData.getBaseId2SortedId()[0] - m_cCameraData.getBaseId2SortedId() [iLeftBaseViewIdx ] );311 Int iDistRight = abs( m_cCameraData.getBaseId2SortedId()[0] - m_cCameraData.getBaseId2SortedId() [iRightBaseViewIdx] );310 //Int iDistLeft = abs( m_cCameraData.getBaseId2SortedId()[0] - m_cCameraData.getBaseId2SortedId() [iLeftBaseViewIdx ] ); 311 //Int iDistRight = abs( m_cCameraData.getBaseId2SortedId()[0] - m_cCameraData.getBaseId2SortedId() [iRightBaseViewIdx] ); 312 312 313 313 Int iFillViewIdx = (0!=iLeftBaseViewIdx)? iLeftBaseViewIdx: iRightBaseViewIdx;
Note: See TracChangeset for help on using the changeset viewer.