Changeset 855 in SHVCSoftware for branches/SHM-dev/source
- Timestamp:
- 9 Aug 2014, 00:58:27 (10 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibEncoder
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibEncoder/TEnc3DAsymLUT.cpp
r849 r855 15 15 m_pEncCuboid = NULL; 16 16 m_pBestEncCuboid = NULL; 17 #if R0151_CGS_3D_ASYMLUT_IMPROVE 17 18 m_nAccuFrameBit = 0; 18 19 m_nAccuFrameCGSBit = 0; 19 20 m_nPrevFrameCGSPartNumLog2 = 0; 21 #else 22 memset( m_nPrevFrameBit , 0 , sizeof( m_nPrevFrameBit ) ); 23 memset( m_nPrevFrameCGSBit , 0 , sizeof( m_nPrevFrameCGSBit ) ); 24 memset( m_nPrevFrameCGSPartNumLog2 , 0 , sizeof( m_nPrevFrameCGSPartNumLog2 ) ); 25 memset( m_nPrevFrameOverWritePPS , 0 , sizeof( m_nPrevFrameOverWritePPS ) ); 26 #endif 20 27 m_dTotalFrameBit = 0; 21 28 m_nTotalCGSBit = 0; … … 587 594 Void TEnc3DAsymLUT::xxDerivePartNumLog2( TComSlice * pSlice , TEncCfg * pcCfg , Int & rOctantDepth , Int & rYPartNumLog2 , Bool bSignalPPS , Bool bElRapSliceTypeB ) 588 595 { 596 #if !R0151_CGS_3D_ASYMLUT_IMPROVE 597 Int nSliceType = pSlice->getSliceType(); 598 // update slice type as what will be done later 599 if( pSlice->getActiveNumILRRefIdx() == 0 && pSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA ) 600 { 601 nSliceType = I_SLICE; 602 } 603 else if( !bElRapSliceTypeB ) 604 { 605 if( (pSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && 606 (pSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && 607 pSlice->getSliceType() == B_SLICE ) 608 { 609 nSliceType = P_SLICE; 610 } 611 } 612 613 const Int nSliceTempLevel = pSlice->getDepth(); 614 #endif 589 615 Int nPartNumLog2 = 4; 590 616 if( pSlice->getBaseColPic( pSlice->getInterLayerPredLayerIdc( 0 ) )->getSlice( 0 )->isIntra() ) … … 592 618 nPartNumLog2 = xGetMaxPartNumLog2(); 593 619 } 620 #if R0151_CGS_3D_ASYMLUT_IMPROVE 594 621 if( m_nAccuFrameBit && pSlice->getPPS()->getCGSFlag() ) 595 622 { 596 623 Double dBitCost = 1.0 * m_nAccuFrameCGSBit / m_nAccuFrameBit; 597 624 nPartNumLog2 = m_nPrevFrameCGSPartNumLog2; 625 #else 626 if( m_nPrevFrameBit[nSliceType][nSliceTempLevel] && pSlice->getPPS()->getCGSFlag() ) 627 { 628 Double dBitCost = 1.0 * m_nPrevFrameCGSBit[nSliceType][nSliceTempLevel] / m_nPrevFrameBit[nSliceType][nSliceTempLevel]; 629 nPartNumLog2 = m_nPrevFrameCGSPartNumLog2[nSliceType][nSliceTempLevel]; 630 #endif 598 631 Double dBitCostT = 0.03; 599 632 if( dBitCost < dBitCostT / 6.0 ) … … 606 639 } 607 640 } 641 #if !R0151_CGS_3D_ASYMLUT_IMPROVE 642 else 643 { 644 nPartNumLog2 -= nSliceTempLevel; 645 } 646 #endif 608 647 nPartNumLog2 = Clip3( 0 , xGetMaxPartNumLog2() , nPartNumLog2 ); 609 648 xxMapPartNum2DepthYPart( nPartNumLog2 , rOctantDepth , rYPartNumLog2 ); … … 630 669 Void TEnc3DAsymLUT::updatePicCGSBits( TComSlice * pcSlice , Int nPPSBit ) 631 670 { 671 #if !R0151_CGS_3D_ASYMLUT_IMPROVE 672 const Int nSliceType = pcSlice->getSliceType(); 673 const Int nSliceTempLevel = pcSlice->getDepth(); 674 #endif 632 675 for( Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ ) 633 676 { 634 677 UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i); 678 #if R0151_CGS_3D_ASYMLUT_IMPROVE 635 679 m_nAccuFrameBit += pcSlice->getPic()->getFrameBit() + pcSlice->getBaseColPic(refLayerIdc)->getFrameBit(); 680 #else 681 m_nPrevFrameBit[nSliceType][nSliceTempLevel] = pcSlice->getPic()->getFrameBit() + pcSlice->getBaseColPic(refLayerIdc)->getFrameBit(); 682 #endif 636 683 m_dTotalFrameBit += pcSlice->getPic()->getFrameBit() + pcSlice->getBaseColPic(refLayerIdc)->getFrameBit(); 637 684 } 685 #if R0151_CGS_3D_ASYMLUT_IMPROVE 638 686 m_nAccuFrameCGSBit += nPPSBit; 639 687 m_nTotalCGSBit += nPPSBit; 640 688 m_nPrevFrameCGSPartNumLog2 = getCurOctantDepth() * 3 + getCurYPartNumLog2(); 641 } 642 643 #endif 689 #else 690 m_nPrevFrameOverWritePPS[nSliceType][nSliceTempLevel] = pcSlice->getCGSOverWritePPS(); 691 m_nPrevFrameCGSBit[nSliceType][nSliceTempLevel] = nPPSBit; 692 m_nTotalCGSBit += nPPSBit; 693 m_nPrevFrameCGSPartNumLog2[nSliceType][nSliceTempLevel] = getCurOctantDepth() * 3 + getCurYPartNumLog2(); 694 #endif 695 } 696 697 #endif -
branches/SHM-dev/source/Lib/TLibEncoder/TEnc3DAsymLUT.h
r825 r855 78 78 SCuboid *** m_pEncCuboid; 79 79 SCuboid *** m_pBestEncCuboid; 80 #if R0151_CGS_3D_ASYMLUT_IMPROVE 80 81 Int m_nAccuFrameBit; // base + enhancement layer 81 82 Int m_nAccuFrameCGSBit; 82 83 Int m_nPrevFrameCGSPartNumLog2; 84 #else 85 Int m_nPrevFrameBit[3][MAX_TLAYER]; // base + enhancement layer 86 Int m_nPrevFrameCGSBit[3][MAX_TLAYER]; 87 Int m_nPrevFrameCGSPartNumLog2[3][MAX_TLAYER]; 88 Int m_nPrevFrameOverWritePPS[3][MAX_TLAYER]; 89 #endif 83 90 Double m_dTotalFrameBit; 84 91 Int m_nTotalCGSBit;
Note: See TracChangeset for help on using the changeset viewer.