Changeset 855 in SHVCSoftware for branches/SHM-dev/source


Ignore:
Timestamp:
9 Aug 2014, 00:58:27 (10 years ago)
Author:
qualcomm
Message:

Added missing macros R0151_CGS_3D_ASYMLUT_IMPROVE for encoder only parts in JCTVC-R0151

Location:
branches/SHM-dev/source/Lib/TLibEncoder
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibEncoder/TEnc3DAsymLUT.cpp

    r849 r855  
    1515  m_pEncCuboid = NULL;
    1616  m_pBestEncCuboid = NULL;
     17#if R0151_CGS_3D_ASYMLUT_IMPROVE
    1718  m_nAccuFrameBit = 0;
    1819  m_nAccuFrameCGSBit = 0;
    1920  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
    2027  m_dTotalFrameBit = 0;
    2128  m_nTotalCGSBit = 0;
     
    587594Void TEnc3DAsymLUT::xxDerivePartNumLog2( TComSlice * pSlice , TEncCfg * pcCfg , Int & rOctantDepth , Int & rYPartNumLog2 , Bool bSignalPPS , Bool bElRapSliceTypeB )
    588595{
     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
    589615  Int nPartNumLog2 = 4;
    590616  if( pSlice->getBaseColPic( pSlice->getInterLayerPredLayerIdc( 0 ) )->getSlice( 0 )->isIntra() )
     
    592618    nPartNumLog2 = xGetMaxPartNumLog2();
    593619  }
     620#if R0151_CGS_3D_ASYMLUT_IMPROVE
    594621  if( m_nAccuFrameBit && pSlice->getPPS()->getCGSFlag() )
    595622  {
    596623    Double dBitCost = 1.0 * m_nAccuFrameCGSBit / m_nAccuFrameBit;
    597624    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
    598631    Double dBitCostT = 0.03;
    599632    if( dBitCost < dBitCostT / 6.0 )
     
    606639    }
    607640  }
     641#if !R0151_CGS_3D_ASYMLUT_IMPROVE
     642  else
     643  {
     644    nPartNumLog2 -= nSliceTempLevel;
     645  }
     646#endif
    608647  nPartNumLog2 = Clip3( 0 , xGetMaxPartNumLog2()  , nPartNumLog2 );
    609648  xxMapPartNum2DepthYPart( nPartNumLog2 , rOctantDepth , rYPartNumLog2 );
     
    630669Void TEnc3DAsymLUT::updatePicCGSBits( TComSlice * pcSlice , Int nPPSBit )
    631670{
     671#if !R0151_CGS_3D_ASYMLUT_IMPROVE
     672  const Int nSliceType = pcSlice->getSliceType();
     673  const Int nSliceTempLevel = pcSlice->getDepth();
     674#endif
    632675  for( Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ )
    633676  {
    634677    UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i);
     678#if R0151_CGS_3D_ASYMLUT_IMPROVE
    635679    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
    636683    m_dTotalFrameBit += pcSlice->getPic()->getFrameBit() + pcSlice->getBaseColPic(refLayerIdc)->getFrameBit();
    637684  }
     685#if R0151_CGS_3D_ASYMLUT_IMPROVE
    638686  m_nAccuFrameCGSBit += nPPSBit;
    639687  m_nTotalCGSBit += nPPSBit;
    640688  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  
    7878  SCuboid *** m_pEncCuboid;
    7979  SCuboid *** m_pBestEncCuboid;
     80#if R0151_CGS_3D_ASYMLUT_IMPROVE
    8081  Int   m_nAccuFrameBit;                  // base + enhancement layer
    8182  Int   m_nAccuFrameCGSBit;
    8283  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
    8390  Double m_dTotalFrameBit;
    8491  Int   m_nTotalCGSBit;
Note: See TracChangeset for help on using the changeset viewer.