Changeset 42 in 3DVCSoftware for trunk/source/App/TAppEncoder
- Timestamp:
- 26 Mar 2012, 18:05:40 (13 years ago)
- Location:
- trunk/source/App/TAppEncoder
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/App/TAppEncoder/TAppEncCfg.cpp
r21 r42 110 110 free (m_pchBitstreamFile) ; 111 111 112 #if FLEX_CODING_ORDER 113 if (m_pchMVCJointCodingOrder != NULL) 114 { 115 free(m_pchMVCJointCodingOrder) ; 116 } 117 #endif 112 118 for(Int i = 0; i< m_pchDepthReconFileList.size(); i++ ) 113 119 { … … 153 159 string cfg_ReconFile; 154 160 string cfg_dQPFile; 161 162 #if FLEX_CODING_ORDER 163 string cfg_JointCodingOrdering; 164 #endif 165 155 166 po::Options opts; 156 167 opts.addOptions() … … 191 202 ("NumberOfViews", m_iNumberOfViews, 0, "Number of views") 192 203 204 #if FLEX_CODING_ORDER 205 ("FCO", m_b3DVFlexOrder, false, "flexible coding order flag" ) 206 ("CodingOrder", cfg_JointCodingOrdering, string(""), "The coding order for joint texture-depth coding") 207 #endif 193 208 194 209 /* Unit definition parameters */ … … 380 395 381 396 397 #if FLEX_CODING_ORDER 398 m_pchMVCJointCodingOrder = cfg_JointCodingOrdering.empty()?NULL:strdup(cfg_JointCodingOrdering.c_str()); 399 // If flexible order is enabled and if depth comes before the texture for a view, disable VSO 400 401 #if HHI_VSO && DISABLE_FCO_FOR_VSO 402 Bool depthComesFirst = false; 403 if ( m_b3DVFlexOrder ) 404 { 405 for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++) 406 { 407 for ( Int ii=1; ii<12; ii+=2 ) 408 { 409 Int iViewIdxCfg = (Int)(m_pchMVCJointCodingOrder[ii]-'0'); 410 if ( iViewIdxCfg == iViewIdx ) 411 { 412 if ( m_pchMVCJointCodingOrder[ii-1]=='D' ) // depth comes first for this view 413 { 414 depthComesFirst = true; 415 break; 416 } 417 else 418 { 419 assert(m_pchMVCJointCodingOrder[ii-1]=='T'); 420 } 421 } 422 } 423 } 424 } 425 if (depthComesFirst) 426 { 427 m_bUseVSO = false; 428 } 429 #endif 430 #endif 431 382 432 // GT FIX 383 433 if ( m_bUsingDepthMaps ) -
trunk/source/App/TAppEncoder/TAppEncCfg.h
r5 r42 81 81 Bool m_bUsingDepthMaps ; 82 82 83 #if FLEX_CODING_ORDER 84 char* m_pchMVCJointCodingOrder; ///< texture-depth coding order 85 Bool m_b3DVFlexOrder; ///< flexible coding order flag 86 #endif 87 83 88 84 89 // coding structure -
trunk/source/App/TAppEncoder/TAppEncTop.cpp
r21 r42 145 145 #endif 146 146 147 #if BITSTREAM_EXTRACTION 148 m_acTEncTopList[iViewIdx]->setLayerId ( ( (UInt)iViewIdx ) << 1 ); 149 #endif 147 150 m_acTEncTopList[iViewIdx]->setViewId ( (UInt)iViewIdx ); 148 151 m_acTEncTopList[iViewIdx]->setViewOrderIdx ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] ); … … 235 238 for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++) 236 239 { 240 #if FLEX_CODING_ORDER 241 // Detect whether depth comes before than texture for this view 242 Bool isDepthFirst = false; 243 if ( m_b3DVFlexOrder ) 244 { 245 for ( Int ii=1; ii<12; ii+=2 ) 246 { 247 Int iViewIdxCfg = (Int)(m_pchMVCJointCodingOrder[ii]-'0'); 248 if ( iViewIdxCfg == iViewIdx ) 249 { 250 if ( m_pchMVCJointCodingOrder[ii-1]=='D' ) // depth comes first for this view 251 { 252 isDepthFirst = true; 253 } 254 else 255 { 256 assert(m_pchMVCJointCodingOrder[ii-1]=='T'); 257 } 258 break; 259 } 260 } 261 } 262 #endif 237 263 m_iDepthFrameRcvdVector.push_back(0) ; 238 264 m_acTEncDepthTopList.push_back(new TEncTop); … … 314 340 #endif 315 341 342 #if BITSTREAM_EXTRACTION 343 m_acTEncDepthTopList[iViewIdx]->setLayerId ( ( ( (UInt)iViewIdx ) << 1 ) + 1 ); 344 #endif 316 345 m_acTEncDepthTopList[iViewIdx]->setViewId ( (UInt)iViewIdx ); 317 346 m_acTEncDepthTopList[iViewIdx]->setViewOrderIdx ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] ); … … 354 383 m_acTEncDepthTopList[iViewIdx]->setUseDMM( m_bUseDMM ); 355 384 #endif 385 #if FLEX_CODING_ORDER && HHI_DMM_PRED_TEX 386 m_acTEncDepthTopList[iViewIdx]->setUseDMM34( (m_b3DVFlexOrder && isDepthFirst) ? false : m_bUseDMM ); 387 #endif 356 388 #if CONSTRAINED_INTRA_PRED 357 389 m_acTEncDepthTopList[iViewIdx]->setUseConstrainedIntraPred ( m_bUseConstrainedIntraPred ); … … 380 412 #endif 381 413 #if HHI_MPI 414 #if FLEX_CODING_ORDER 415 m_acTEncDepthTopList[iViewIdx]->setUseMVI( (m_b3DVFlexOrder && isDepthFirst) ? false : m_bUseMVI ); 416 #else 382 417 m_acTEncDepthTopList[iViewIdx]->setUseMVI( m_bUseMVI ); 383 418 #endif 384 419 #endif 420 385 421 m_acTEncDepthTopList[iViewIdx]->setPictureDigestEnabled(m_pictureDigestEnabled); 386 422 … … 591 627 std::vector<Bool> bDepthEos ; 592 628 std::vector<Bool> bContinueReadingDepthPics ; 593 594 629 for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ ) 595 630 { … … 689 724 #endif 690 725 726 #if FLEX_CODING_ORDER 727 if (m_b3DVFlexOrder) 728 { 729 Int i=0; 730 Int iViewIdx = 0; 731 bool bThisViewContinueReadingPics = false; 732 bool bThisViewContinueReadingDepthPics = false; 733 Int iNumberofDepthViews = m_bUsingDepthMaps?m_iNumberOfViews:0; 734 for(Int j=0; j < (m_iNumberOfViews+ iNumberofDepthViews); j++ ) // Start encoding 735 { 736 if (m_pchMVCJointCodingOrder[i]=='T') 737 { 738 i++; 739 assert(isdigit(m_pchMVCJointCodingOrder[i])); 740 iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0'); 741 bThisViewContinueReadingPics = bContinueReadingPics[iViewIdx]; 742 m_acTEncTopList[iViewIdx]->encode( bEos[iViewIdx], m_cListPicYuvRecMap[iViewIdx], pcBitstream, bThisViewContinueReadingPics ); 743 bContinueReadingPics[iViewIdx]=bThisViewContinueReadingPics; 744 bAllContinueReadingPics = bAllContinueReadingPics||bContinueReadingPics[iViewIdx]; 745 746 if(pcBitstream->getNumberOfWrittenBits()!=0) 747 { 748 m_cTVideoIOBitsFile.writeBits( pcBitstream ); 749 } 750 pcBitstream->resetBits(); //GT: also done later in .... 751 pcBitstream->rewindStreamPacket( ); 752 // write bistream to file if necessary 753 xWriteOutput( iViewIdx ); //GT: Write Reconfiles (when gop is complete?) 754 i++; 755 } 756 else if ( m_pchMVCJointCodingOrder[i] == 'D') 757 { 758 i++; 759 if( m_bUsingDepthMaps ) 760 { 761 assert(isdigit(m_pchMVCJointCodingOrder[i])); 762 iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0'); 763 bThisViewContinueReadingDepthPics = bContinueReadingDepthPics[iViewIdx]; 764 m_acTEncDepthTopList[iViewIdx]->encode( bDepthEos[iViewIdx], m_cListPicYuvDepthRecMap[iViewIdx], pcBitstream, bThisViewContinueReadingDepthPics ); 765 bContinueReadingDepthPics[iViewIdx]=bThisViewContinueReadingDepthPics; 766 767 bAllContinueReadingDepthPics = bAllContinueReadingDepthPics||bContinueReadingDepthPics[iViewIdx]; 768 if(pcBitstream->getNumberOfWrittenBits()!=0) 769 { 770 m_cTVideoIOBitsFile.writeBits( pcBitstream ); 771 } 772 pcBitstream->resetBits(); 773 pcBitstream->rewindStreamPacket( ); 774 // write bistream to file if necessary 775 xWriteOutput( iViewIdx, true ); 776 i++; 777 } 778 } 779 } 780 } 781 else 782 { 783 #endif 691 784 //GT: Encode 692 785 for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ ) // Start encoding … … 723 816 } 724 817 } 725 818 #if FLEX_CODING_ORDER 819 } 820 #endif 726 821 // delete extra picture buffers 727 822 if( bCurrPocCoded )
Note: See TracChangeset for help on using the changeset viewer.