Ignore:
Timestamp:
13 Oct 2014, 16:44:51 (12 years ago)
Author:
tech
Message:

Removed 3D-HEVC related integrations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-12.1-MV-draft-1/source/Lib/TLibEncoder/TEncSbac.cpp

    r1066 r1072  
    5858, m_cCUSplitFlagSCModel       ( 1,             1,               NUM_SPLIT_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels )
    5959, m_cCUSkipFlagSCModel        ( 1,             1,               NUM_SKIP_FLAG_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
    60 #if MTK_SINGLE_DEPTH_MODE_I0095
    61 , m_cCUSingleDepthFlagSCModel        ( 1,             1,               NUM_SINGLEDEPTH_FLAG_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
    62 , m_cSingleDepthValueSCModel         ( 1,             1,               NUM_SINGLE_DEPTH_VALUE_DATA_CTX      , m_contextModels + m_numContextModels, m_numContextModels)
    63 #endif
    6460, m_cCUMergeFlagExtSCModel    ( 1,             1,               NUM_MERGE_FLAG_EXT_CTX        , m_contextModels + m_numContextModels, m_numContextModels)
    6561, m_cCUMergeIdxExtSCModel     ( 1,             1,               NUM_MERGE_IDX_EXT_CTX         , m_contextModels + m_numContextModels, m_numContextModels)
    66 #if H_3D_ARP
    67 , m_cCUPUARPWSCModel          ( 1,             1,               NUM_ARPW_CTX                  , m_contextModels + m_numContextModels, m_numContextModels)
    68 #endif
    69 #if H_3D_IC
    70 , m_cCUICFlagSCModel          ( 1,             1,               NUM_IC_FLAG_CTX               , m_contextModels + m_numContextModels, m_numContextModels)
    71 #endif
    7262, m_cCUPartSizeSCModel        ( 1,             1,               NUM_PART_SIZE_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
    7363, m_cCUPredModeSCModel        ( 1,             1,               NUM_PRED_MODE_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
     
    9282, m_cTransformSkipSCModel     ( 1,             2,               NUM_TRANSFORMSKIP_FLAG_CTX    , m_contextModels + m_numContextModels, m_numContextModels)
    9383, m_CUTransquantBypassFlagSCModel( 1,          1,               NUM_CU_TRANSQUANT_BYPASS_FLAG_CTX, m_contextModels + m_numContextModels, m_numContextModels)
    94 #if H_3D_DIM
    95 , m_cDepthIntraModeSCModel    ( 1,             1,               NUM_DEPTH_INTRA_MODE_CTX      , m_contextModels + m_numContextModels, m_numContextModels)
    96 , m_cDdcFlagSCModel           ( 1,             1,               NUM_DDC_FLAG_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
    97 , m_cDdcDataSCModel           ( 1,             1,               NUM_DDC_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
    98 , m_cAngleFlagSCModel         ( 1,             1,               NUM_ANGLE_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels)
    99 #if H_3D_DIM_SDC
    100 , m_cSDCResidualFlagSCModel   ( 1,             1,               SDC_NUM_RESIDUAL_FLAG_CTX     , m_contextModels + m_numContextModels, m_numContextModels)
    101 , m_cSDCResidualSCModel       ( 1,             1,               SDC_NUM_RESIDUAL_CTX          , m_contextModels + m_numContextModels, m_numContextModels)
    102 #endif
    103 #endif
    104 #if H_3D_DIM_SDC
    105 , m_cSDCFlagSCModel                  ( 1,             1,  NUM_SDC_FLAG_CTX                 , m_contextModels + m_numContextModels, m_numContextModels)
    106 #endif
    107 #if H_3D_DBBP
    108 , m_cDBBPFlagSCModel             ( 1,             1,                 DBBP_NUM_FLAG_CTX           , m_contextModels + m_numContextModels, m_numContextModels)
    109 #endif
    11084{
    11185  assert( m_numContextModels <= MAX_NUM_CTX_MOD );
     
    134108 
    135109  m_cCUSkipFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG );
    136 #if MTK_SINGLE_DEPTH_MODE_I0095
    137   m_cCUSingleDepthFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SINGLEDEPTH_FLAG );
    138   m_cSingleDepthValueSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA );
    139 #endif
    140110  m_cCUMergeFlagExtSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT);
    141111  m_cCUMergeIdxExtSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT);
    142 #if H_3D_ARP
    143   m_cCUPUARPWSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_ARPW );
    144 #endif
    145 #if H_3D_IC
    146   m_cCUICFlagSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_IC_FLAG );
    147 #endif
    148112  m_cCUPartSizeSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_PART_SIZE );
    149113  m_cCUPredModeSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_PRED_MODE );
     
    169133  m_CUTransquantBypassFlagSCModel.initBuffer( eSliceType, iQp, (UChar*)INIT_CU_TRANSQUANT_BYPASS_FLAG );
    170134
    171 #if H_3D_DIM
    172   m_cDepthIntraModeSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_DEPTH_INTRA_MODE );
    173   m_cDdcFlagSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG );
    174   m_cDdcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
    175   m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
    176 #if H_3D_DIM_SDC
    177   m_cSDCResidualFlagSCModel.initBuffer   ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
    178   m_cSDCResidualSCModel.initBuffer       ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL );
    179 #endif
    180 #endif
    181 #if H_3D_DIM_SDC
    182   m_cSDCFlagSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG );
    183 #endif
    184 #if H_3D_DBBP
    185   m_cDBBPFlagSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_DBBP_FLAG );
    186 #endif
    187135  // new structure
    188136  m_uiLastQp = iQp;
     
    214162      curCost  = m_cCUSplitFlagSCModel.calcCost       ( curSliceType, qp, (UChar*)INIT_SPLIT_FLAG );
    215163      curCost += m_cCUSkipFlagSCModel.calcCost        ( curSliceType, qp, (UChar*)INIT_SKIP_FLAG );
    216 #if MTK_SINGLE_DEPTH_MODE_I0095
    217       curCost += m_cCUSingleDepthFlagSCModel.calcCost        ( curSliceType, qp, (UChar*)INIT_SINGLEDEPTH_FLAG );
    218       curCost += m_cSingleDepthValueSCModel.calcCost         ( curSliceType, qp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA );
    219 #endif
    220164      curCost += m_cCUMergeFlagExtSCModel.calcCost    ( curSliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT);
    221165      curCost += m_cCUMergeIdxExtSCModel.calcCost     ( curSliceType, qp, (UChar*)INIT_MERGE_IDX_EXT);
    222 #if H_3D_ARP
    223       curCost += m_cCUPUARPWSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_ARPW );
    224 #endif
    225 #if H_3D_IC
    226       curCost += m_cCUICFlagSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_IC_FLAG );
    227 #endif
    228 #if H_3D_DIM_SDC
    229       curCost += m_cSDCFlagSCModel.calcCost           ( curSliceType, qp, (UChar*)INIT_SDC_FLAG );
    230 #endif
    231 #if H_3D_DBBP
    232       curCost += m_cDBBPFlagSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_DBBP_FLAG );
    233 #endif
    234166      curCost += m_cCUPartSizeSCModel.calcCost        ( curSliceType, qp, (UChar*)INIT_PART_SIZE );
    235167      curCost += m_cCUPredModeSCModel.calcCost        ( curSliceType, qp, (UChar*)INIT_PRED_MODE );
     
    254186      curCost += m_cTransformSkipSCModel.calcCost     ( curSliceType, qp, (UChar*)INIT_TRANSFORMSKIP_FLAG );
    255187      curCost += m_CUTransquantBypassFlagSCModel.calcCost( curSliceType, qp, (UChar*)INIT_CU_TRANSQUANT_BYPASS_FLAG );
    256 #if H_3D_DIM
    257 #if SEPARATE_FLAG_I0085
    258     if( m_pcSlice->getVpsDepthModesFlag() || m_pcSlice->getIVPFlag() )
    259 #else
    260     if( m_pcSlice->getVpsDepthModesFlag() )
    261 #endif
    262     {
    263       curCost += m_cDepthIntraModeSCModel.calcCost    ( curSliceType, qp, (UChar*)INIT_DEPTH_INTRA_MODE );
    264       curCost += m_cDdcFlagSCModel.calcCost           ( curSliceType, qp, (UChar*)INIT_DDC_FLAG );
    265       curCost += m_cDdcDataSCModel.calcCost           ( curSliceType, qp, (UChar*)INIT_DDC_DATA );
    266       curCost += m_cAngleFlagSCModel.calcCost         ( curSliceType, qp, (UChar*)INIT_ANGLE_FLAG ); 
    267     }
    268 #endif
    269188      if (curCost < bestCost)
    270189      {
     
    291210 
    292211  m_cCUSkipFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG );
    293 #if MTK_SINGLE_DEPTH_MODE_I0095
    294   m_cCUSingleDepthFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SINGLEDEPTH_FLAG );
    295   m_cSingleDepthValueSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA );
    296 #endif 
    297212  m_cCUMergeFlagExtSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT);
    298213  m_cCUMergeIdxExtSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT);
    299 #if H_3D_ARP
    300   m_cCUPUARPWSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_ARPW );
    301 #endif
    302 #if H_3D_IC
    303   m_cCUICFlagSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_IC_FLAG );
    304 #endif
    305214  m_cCUPartSizeSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_PART_SIZE );
    306215  m_cCUPredModeSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_PRED_MODE );
     
    325234  m_cTransformSkipSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_TRANSFORMSKIP_FLAG );
    326235  m_CUTransquantBypassFlagSCModel.initBuffer( eSliceType, iQp, (UChar*)INIT_CU_TRANSQUANT_BYPASS_FLAG );
    327 #if H_3D_DIM
    328   m_cDepthIntraModeSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_DEPTH_INTRA_MODE );
    329   m_cDdcFlagSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG );
    330   m_cDdcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
    331   m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
    332 #if H_3D_DIM_SDC
    333   m_cSDCResidualFlagSCModel.initBuffer   ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG );
    334   m_cSDCResidualSCModel.initBuffer       ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL );
    335 #endif
    336 #endif
    337 #if H_3D_DIM_SDC
    338   m_cSDCFlagSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG );
    339 #endif
    340 #if H_3D_DBBP
    341   m_cDBBPFlagSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_DBBP_FLAG );
    342 #endif
    343236  m_pcBinIf->start();
    344237}
     
    350243}
    351244
    352 #if H_3D
    353 Void TEncSbac::codeSPS( TComSPS* pcSPS, Int viewIndex, Bool depthFlag )
    354 #else
    355245Void TEncSbac::codeSPS( TComSPS* pcSPS )
    356 #endif
    357246{
    358247  assert (0);
     
    454343  m_pcBinIf->encodeBinsEP( bins, numBins );
    455344}
    456 #if MTK_SINGLE_DEPTH_MODE_I0095
    457 Void TEncSbac::codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx )
    458 {
    459   UInt uiSymbol = pcCU->getSingleDepthFlag(uiAbsPartIdx ) ? 1 : 0;
    460   m_pcBinIf->encodeBin( uiSymbol, m_cCUSingleDepthFlagSCModel.get( 0, 0, 0 ) );
    461   if(uiSymbol)
    462   {
    463     UInt uiUnaryIdx = (UInt) pcCU->getSingleDepthValue(uiAbsPartIdx);
    464     UInt uiNumCand = MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE;
    465     if ( uiNumCand > 1 )
    466     {
    467       for( UInt ui = 0; ui < uiNumCand - 1; ++ui )
    468       {
    469         const UInt uiSymbol2 = ui == uiUnaryIdx ? 0 : 1;
    470         if ( ui==0 )
    471         {
    472           m_pcBinIf->encodeBin( uiSymbol2, m_cSingleDepthValueSCModel.get( 0, 0, 0 ) );
    473         }
    474         else
    475         {
    476           m_pcBinIf->encodeBinEP( uiSymbol2 );
    477         }
    478         if( uiSymbol2 == 0 )
    479         {
    480           break;
    481         }
    482       }
    483     }
    484   }
    485 }
    486 #endif
    487345/** Coding of coeff_abs_level_minus3
    488346 * \param uiSymbol value of coeff_abs_level_minus3
     
    513371}
    514372
    515 #if H_3D_DIM
    516 Void TEncSbac::xWriteExGolombLevel( UInt uiSymbol, ContextModel& rcSCModel  )
    517 {
    518   if( uiSymbol )
    519   {
    520     m_pcBinIf->encodeBin( 1, rcSCModel );
    521     UInt uiCount = 0;
    522     Bool bNoExGo = ( uiSymbol < 3 );
    523 
    524     while( --uiSymbol && ++uiCount < 3 )
    525     {
    526       m_pcBinIf->encodeBin( 1, rcSCModel );
    527     }
    528     if( bNoExGo )
    529     {
    530       m_pcBinIf->encodeBin( 0, rcSCModel );
    531     }
    532     else
    533     {
    534       xWriteEpExGolomb( uiSymbol, 0 );
    535     }
    536   }
    537   else
    538   {
    539     m_pcBinIf->encodeBin( 0, rcSCModel );
    540   }
    541 
    542   return;
    543 }
    544 
    545 Void TEncSbac::xCodeDimDeltaDC( Pel valDeltaDC, UInt uiNumSeg )
    546 {
    547   xWriteExGolombLevel( UInt( abs( valDeltaDC ) - ( uiNumSeg > 1 ? 0 : 1 ) ), m_cDdcDataSCModel.get(0, 0, 0) );
    548   if( valDeltaDC != 0 )
    549   {
    550     UInt uiSign = valDeltaDC > 0 ? 0 : 1;
    551     m_pcBinIf->encodeBinEP( uiSign );
    552   }
    553 }
    554 
    555 #if H_3D_DIM_DMM
    556 Void TEncSbac::xCodeDmm1WedgeIdx( UInt uiTabIdx, Int iNumBit )
    557 {
    558   for ( Int i = 0; i < iNumBit; i++ )
    559   {
    560     m_pcBinIf->encodeBinEP( ( uiTabIdx >> i ) & 1 );
    561   }
    562 }
    563 
    564 #endif
    565 
    566 #if !FIX_TICKET_76
    567 #if H_3D_DIM_SDC
    568 Void TEncSbac::xCodeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment )
    569 {
    570   assert( pcCU->getSlice()->getIsDepth() );
    571   assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
    572   assert( pcCU->getSDCFlag(uiAbsPartIdx) );
    573   assert( uiSegment < 2 );
    574  
    575   Pel segmentDCOffset = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx);
    576  
    577   UInt uiResidual = segmentDCOffset == 0 ? 0 : 1;
    578   UInt uiSign     = segmentDCOffset < 0 ? 1 : 0;
    579   UInt uiAbsIdx   = abs(segmentDCOffset);
    580 
    581 #if H_3D_DIM_DLT
    582   UInt uiMaxResidualBits = pcCU->getSlice()->getPPS()->getDLT()->getBitsPerDepthValue( pcCU->getSlice()->getLayerIdInVps() );
    583 #else
    584   UInt uiMaxResidualBits = g_bitDepthY;
    585 #endif
    586   assert( uiMaxResidualBits <= g_bitDepthY );
    587  
    588   // residual flag
    589   m_pcBinIf->encodeBin( uiResidual, m_cSDCResidualFlagSCModel.get( 0, 0, 0 ) );
    590 #if H_MV_ENC_DEC_TRAC
    591   DTRACE_CU("sdc_residual_flag[i]", uiResidual)
    592 #endif 
    593  
    594   if (uiResidual)
    595   {
    596     // encode sign bit of residual
    597     m_pcBinIf->encodeBinEP( uiSign );
    598 #if H_MV_ENC_DEC_TRAC
    599     DTRACE_CU("sdc_residual_sign_flag[i]", uiSign)
    600 #endif
    601 #if H_3D_DIM_DLT   
    602     UInt uiNumDepthValues = pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() );
    603 #else
    604     UInt uiNumDepthValues = ((1 << g_bitDepthY)-1);
    605 #endif
    606 
    607     assert(uiAbsIdx <= uiNumDepthValues);
    608    
    609     // encode residual magnitude
    610     uiAbsIdx -= 1;
    611 
    612 #if H_MV_ENC_DEC_TRAC
    613     DTRACE_CU("sdc_residual_abs_minus1[i]", uiAbsIdx)
    614 #endif
    615 
    616     // prefix part
    617     if ( uiAbsIdx == 0 )
    618     {
    619       m_pcBinIf->encodeBin( 0, m_cSDCResidualSCModel.get(0, 0, 0) );
    620     }
    621     else
    622     {
    623       UInt l = uiAbsIdx;
    624       UInt k = 0;
    625       UInt uiPrefixThreshold = ((uiNumDepthValues * 3) >> 2);
    626       while ( l > 0 && k < uiPrefixThreshold )
    627       {
    628         m_pcBinIf->encodeBin( 1, m_cSDCResidualSCModel.get(0, 0, 0) );
    629         l--;
    630         k++;
    631       }
    632       if ( uiAbsIdx < uiPrefixThreshold )
    633       {
    634         m_pcBinIf->encodeBin( 0, m_cSDCResidualSCModel.get(0, 0, 0) );
    635       }     
    636       else
    637       { // suffix part
    638         uiAbsIdx -= uiPrefixThreshold;
    639         UInt uiSuffixLength = numBitsForValue(uiNumDepthValues - uiPrefixThreshold);
    640         UInt uiBitInfo = 0;
    641         for ( Int i = 0; i < uiSuffixLength; i++)
    642         {
    643           uiBitInfo = ( uiAbsIdx & ( 1 << i ) ) >> i;
    644           m_pcBinIf->encodeBinEP( uiBitInfo);
    645         }
    646       }
    647     }
    648    
    649   }
    650 }
    651 #endif
    652 #endif
    653 #endif
    654373
    655374
     
    666385  this->m_cCUIntraPredSCModel      .copyFrom( &pSrc->m_cCUIntraPredSCModel       );
    667386}
    668 #if H_3D_DIM
    669 Void TEncSbac::loadIntraDepthMode( TEncSbac* pSrc)
    670 {
    671   m_pcBinIf->copyState( pSrc->m_pcBinIf );
    672 
    673   this->m_cDepthIntraModeSCModel .copyFrom( &pSrc->m_cDepthIntraModeSCModel );
    674   this->m_cDdcFlagSCModel        .copyFrom( &pSrc->m_cDdcFlagSCModel );
    675   this->m_cAngleFlagSCModel      .copyFrom( &pSrc->m_cAngleFlagSCModel );
    676 }
    677 #endif
    678387
    679388Void  TEncSbac::store( TEncSbac* pDest)
     
    716425{
    717426  PartSize eSize         = pcCU->getPartitionSize( uiAbsPartIdx );
    718 #if H_3D_QTLPC
    719 #if MTK_I0099_VPS_EX2
    720   TComVPS *vps           = pcCU->getPic()->getSlice(0)->getVPS();
    721   Bool    bLimQtPredFlag = vps->getLimQtPredFlag(pcCU->getPic()->getSlice(0)->getLayerId());
    722 #else
    723   TComSPS *sps           = pcCU->getPic()->getSlice(0)->getSPS();
    724 #endif
    725   TComPic *pcTexture     = pcCU->getSlice()->getTexturePic();
    726   Bool bDepthMapDetect   = (pcTexture != NULL);
    727   Bool bIntraSliceDetect = (pcCU->getSlice()->getSliceType() == I_SLICE);
    728  
    729   Bool rapPic     = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA);
    730 
    731   Bool depthDependent = false;
    732   UInt uiTexturePart = eSize;
    733 #if MTK_I0099_VPS_EX2
    734 #if LGE_FCO_I0116
    735   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && bLimQtPredFlag && pcTexture->getReconMark())
    736 #else
    737   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && bLimQtPredFlag )
    738 #endif
    739 #else
    740   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && sps->getUseQTL() && sps->getUsePC() )
    741 #endif
    742   {
    743     TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
    744     UInt uiCUIdx            = (pcCU->getZorderIdxInCU() == 0) ? uiAbsPartIdx : pcCU->getZorderIdxInCU();
    745     assert(pcTextureCU->getDepth(uiCUIdx) >= uiDepth);
    746     if(pcTextureCU->getDepth(uiCUIdx) == uiDepth )
    747     {
    748       depthDependent = true;
    749       uiTexturePart = pcTextureCU->getPartitionSize( uiCUIdx );
    750     }
    751     if (pcTextureCU->getDepth(uiCUIdx) == uiDepth && pcTextureCU->getPartitionSize( uiCUIdx ) == SIZE_2Nx2N)
    752     {
    753       assert( eSize == SIZE_2Nx2N );
    754       return;
    755     }
    756   }
    757 #endif
    758427  if ( pcCU->isIntra( uiAbsPartIdx ) )
    759428  {
     
    771440  DTRACE_CU("part_mode", eSize )
    772441#endif       
    773 #if H_3D_QTLPC
    774     if (depthDependent==false || uiTexturePart == SIZE_NxN|| uiTexturePart == SIZE_2Nx2N)
    775     {
    776 #endif
    777442  switch(eSize)
    778443  {
     
    841506    }
    842507  }
    843 #if H_3D_QTLPC
    844     }
    845     else if(uiTexturePart == SIZE_2NxN || uiTexturePart == SIZE_2NxnU || uiTexturePart == SIZE_2NxnD)
    846     {
    847       //assert(eSize!=SIZE_NxN);
    848       //assert(eSize!=SIZE_Nx2N);
    849       //assert(eSize==SIZE_2Nx2N || eSize==SIZE_2NxN || eSize==SIZE_2NxnU || eSize==SIZE_2NxnD);
    850       switch(eSize)
    851       {
    852       case SIZE_2Nx2N:
    853         {
    854           m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 0) );
    855           break;
    856         }
    857       case SIZE_2NxN:
    858         {
    859           m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) );
    860           if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) )
    861           {     
    862             m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 1) );
    863           }
    864           break;
    865         }
    866       case SIZE_2NxnU:
    867       case SIZE_2NxnD:
    868         {
    869           m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) );
    870           m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 1) );
    871           m_pcBinIf->encodeBinEP((eSize == SIZE_2NxnU? 0: 1));
    872           break;
    873         }
    874       default:
    875         {
    876           assert(0);
    877         }
    878       }
    879     }
    880     else if(uiTexturePart == SIZE_Nx2N|| uiTexturePart==SIZE_nLx2N || uiTexturePart==SIZE_nRx2N)
    881     {
    882       //assert(eSize!=SIZE_NxN);
    883       //assert(eSize!=SIZE_2NxN);
    884       //assert(eSize==SIZE_2Nx2N ||eSize==SIZE_Nx2N || eSize==SIZE_nLx2N || eSize==SIZE_nRx2N);
    885       switch(eSize)
    886       {
    887       case SIZE_2Nx2N:
    888         {
    889           m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 0) );
    890           break;
    891         }
    892       case SIZE_Nx2N:
    893         {
    894           m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) );
    895           if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) )
    896           {     
    897             m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 1) );
    898           }
    899           break;
    900         }
    901       case SIZE_nLx2N:
    902       case SIZE_nRx2N:
    903         {
    904           m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) );
    905           m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 1) );
    906           m_pcBinIf->encodeBinEP((eSize == SIZE_nLx2N? 0: 1));
    907           break;
    908         }
    909       default:
    910         {
    911           assert(0);
    912         }
    913       }
    914     }
    915     else
    916     {
    917       printf("uiTexturePart=%d",uiTexturePart);
    918       assert(0);
    919     }
    920 #endif
    921508}
    922509
     
    928515Void TEncSbac::codePredMode( TComDataCU* pcCU, UInt uiAbsPartIdx )
    929516{
    930 #if H_3D_DIM_SDC
    931   if ( pcCU->getSlice()->isIntra() )
    932   {
    933     assert( pcCU->isIntra(uiAbsPartIdx) );
    934     return;
    935   }
    936 #endif
    937517 
    938518  // get context function is here
     
    1041621}
    1042622
    1043 #if H_3D_ARP
    1044 Void TEncSbac::codeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx )
    1045 {
    1046   Int  iW = (Int)pcCU->getARPW( uiAbsPartIdx );
    1047   Int  iMaxW = pcCU->getSlice()->getARPStepNum() - 1;
    1048   assert( iMaxW > 0);
    1049 
    1050   Int nOffset = pcCU->getCTXARPWFlag(uiAbsPartIdx);
    1051   Int nBinNum = iW + ( iW != iMaxW );
    1052   m_pcBinIf->encodeBin( iW ? 1 : 0 , m_cCUPUARPWSCModel.get( 0, 0, 0 + nOffset ) );
    1053   if( nBinNum > 1 )
    1054   {
    1055      m_pcBinIf->encodeBin( ( iW == iMaxW ) ? 1 : 0, m_cCUPUARPWSCModel.get( 0, 0, 2 ) );
    1056   }
    1057 #if H_MV_ENC_DEC_TRAC
    1058   DTRACE_CU("iv_res_pred_weight_idx", iW);
    1059 #endif
    1060 }
    1061 #endif
    1062 
    1063 #if H_3D_IC
    1064 /** code Illumination Compensation flag
    1065  * \param pcCU
    1066  * \param uiAbsPartIdx
    1067  * \returns Void
    1068  */
    1069 Void TEncSbac::codeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
    1070 {
    1071   // get context function is here
    1072   UInt uiSymbol = pcCU->getICFlag( uiAbsPartIdx ) ? 1 : 0;
    1073   m_pcBinIf->encodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, 0 ) );
    1074 #if !H_MV_ENC_DEC_TRAC
    1075   DTRACE_CABAC_VL( g_nSymbolCounter++ );
    1076   DTRACE_CABAC_T( "\tICFlag" );
    1077   DTRACE_CABAC_T( "\tuiSymbol: ");
    1078   DTRACE_CABAC_V( uiSymbol );
    1079   DTRACE_CABAC_T( "\n");
    1080 #else
    1081   DTRACE_CU("ic_flag", uiSymbol );
    1082 #endif
    1083 }
    1084 #endif
     623
    1085624
    1086625
     
    1094633 
    1095634  assert( uiCtx < 3 );
    1096 #if H_3D_QTLPC
    1097   Bool bCodeSplitFlag    = true;
    1098 
    1099 #if MTK_I0099_VPS_EX2
    1100   TComVPS *vps           = pcCU->getPic()->getSlice(0)->getVPS();
    1101   Bool    bLimQtPredFlag = vps->getLimQtPredFlag(pcCU->getPic()->getSlice(0)->getLayerId());
    1102 #else
    1103   TComSPS *sps           = pcCU->getPic()->getSlice(0)->getSPS();
    1104 #endif
    1105   TComPic *pcTexture     = pcCU->getSlice()->getTexturePic();
    1106   Bool bDepthMapDetect   = (pcTexture != NULL);
    1107   Bool bIntraSliceDetect = (pcCU->getSlice()->getSliceType() == I_SLICE);
    1108 
    1109   Bool rapPic     = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA);
    1110 
    1111 #if MTK_I0099_VPS_EX2
    1112 #if LGE_FCO_I0116
    1113   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && bLimQtPredFlag && pcTexture->getReconMark() )
    1114 #else
    1115   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && bLimQtPredFlag  )
    1116 #endif
    1117 #else
    1118   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && sps->getUseQTL() && sps->getUsePC())
    1119 #endif
    1120   {
    1121     TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
    1122     UInt uiCUIdx            = (pcCU->getZorderIdxInCU() == 0) ? uiAbsPartIdx : pcCU->getZorderIdxInCU();
    1123     assert(pcTextureCU->getDepth(uiCUIdx) >= uiDepth);
    1124     bCodeSplitFlag          = (pcTextureCU->getDepth(uiCUIdx) > uiDepth);
    1125   }
    1126 
    1127   if(!bCodeSplitFlag)
    1128   {
    1129     assert(uiCurrSplitFlag == 0);
    1130     return;
    1131   }
    1132 #endif
    1133635  m_pcBinIf->encodeBin( uiCurrSplitFlag, m_cCUSplitFlagSCModel.get( 0, 0, uiCtx ) );
    1134636#if !H_MV_ENC_DEC_TRAC
     
    1166668  {
    1167669    dir[j] = pcCU->getLumaIntraDir( absPartIdx+partOffset*j );
    1168 #if H_3D_DIM
    1169 #if SEPARATE_FLAG_I0085
    1170     if( pcCU->getSlice()->getVpsDepthModesFlag() ||  pcCU->getSlice()->getIVPFlag() )
    1171 #else
    1172     if( pcCU->getSlice()->getVpsDepthModesFlag() )
    1173 #endif
    1174     {
    1175       codeIntraDepth( pcCU, absPartIdx+partOffset*j );
    1176     }
    1177     if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE )
    1178     {
    1179 #endif
    1180670      predNum[j] = pcCU->getIntraDirLumaPredictor(absPartIdx+partOffset*j, preds[j]); 
    1181671      for(UInt i = 0; i < predNum[j]; i++)
     
    1190680      DTRACE_CU("prev_intra_luma_pred_flag", (predIdx[j] != -1)? 1 : 0);
    1191681#endif
    1192 #if H_3D_DIM
    1193     }
    1194 #endif
    1195682
    1196683  } 
    1197684  for (j=0;j<partNum;j++)
    1198685  {
    1199 #if H_3D_DIM
    1200     if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE )
    1201     {
    1202 #endif
    1203686    if(predIdx[j] != -1)
    1204687    {
     
    1235718#endif
    1236719    }
    1237 #if H_3D_DIM
    1238     }
    1239 #endif
    1240720  }
    1241721  return;
     
    1277757}
    1278758
    1279 #if H_3D_DIM
    1280 Void TEncSbac::codeIntraDepth( TComDataCU* pcCU, UInt absPartIdx )
    1281 {
    1282   codeIntraDepthMode( pcCU, absPartIdx );
    1283 
    1284   UInt dir     = pcCU->getLumaIntraDir( absPartIdx );
    1285   UInt dimType = getDimType( dir );
    1286 
    1287   switch( dimType )
    1288   {
    1289 #if H_3D_DIM_DMM
    1290   case( DMM1_IDX ):
    1291     {
    1292       xCodeDmm1WedgeIdx( pcCU->getDmmWedgeTabIdx( dimType, absPartIdx ), g_dmm1TabIdxBits[pcCU->getIntraSizeIdx(absPartIdx)] );
    1293     } break;
    1294   case( DMM4_IDX ): break;
    1295 #endif
    1296   default: break;
    1297   }
    1298 }
    1299 
    1300 Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx )
    1301 {
    1302   UInt dir = pcCU->getLumaIntraDir( absPartIdx );
    1303 
    1304   if( ( pcCU->getSlice()->getSPS()->getMaxCUWidth() >> pcCU->getDepth( absPartIdx ) ) < 64 ) //DMM and HEVC intra modes are both allowed
    1305   {
    1306     m_pcBinIf->encodeBin( isDimMode( dir ) ? 0 : 1, m_cAngleFlagSCModel.get( 0, 0, 0 ) );
    1307   }
    1308   if( isDimMode( dir ) )
    1309   {
    1310     UInt uiCodeIdx = 0;
    1311 
    1312     switch( getDimType( dir ) )
    1313     {
    1314     case DMM1_IDX: uiCodeIdx = 0; break;
    1315     case DMM4_IDX: uiCodeIdx = 1; break;
    1316     default:                      break;
    1317     }
    1318     //mode coding
    1319 #if SEPARATE_FLAG_I0085
    1320     if( pcCU->getSlice()->getVpsDepthModesFlag() && pcCU->getSlice()->getIVPFlag())
    1321     {
    1322       m_pcBinIf->encodeBin( uiCodeIdx == 0 ? 0 : 1, m_cDepthIntraModeSCModel.get( 0, 0, 0 ) );
    1323     }
    1324 #else
    1325     m_pcBinIf->encodeBin( uiCodeIdx == 0 ? 0 : 1, m_cDepthIntraModeSCModel.get( 0, 0, 0 ) );
    1326 #endif
    1327   }
    1328 }
    1329 #endif
    1330759
    1331760
     
    23601789}
    23611790
    2362 #if H_3D_INTER_SDC
    2363 Void TEncSbac::codeDeltaDC( TComDataCU* pcCU, UInt absPartIdx )
    2364 {
    2365   if( !( pcCU->getSDCFlag( absPartIdx ) || ( pcCU->isIntra( absPartIdx ) && getDimType( pcCU->getLumaIntraDir( absPartIdx ) ) < DIM_NUM_TYPE ) ) )
    2366   {
    2367     assert( 0 );
    2368   }
    2369 
    2370 #if HS_DMM_SIGNALLING_I0120
    2371   UInt uiNumSegments = isDimMode( pcCU->getLumaIntraDir( absPartIdx ) ) ? 2 : 1;
    2372   UInt dimDeltaDC = 1;
    2373 #else
    2374   UInt uiNumSegments = 0;
    2375   UInt dimDeltaDC = 0;
    2376 #endif
    2377 
    2378 #if HS_DMM_SIGNALLING_I0120
    2379   if( pcCU->isIntra( absPartIdx ) && pcCU->getSDCFlag( absPartIdx ))
    2380   {
    2381 #else
    2382   if( pcCU->isIntra( absPartIdx ) )
    2383   {
    2384     UInt dir     = pcCU->getLumaIntraDir( absPartIdx );
    2385     uiNumSegments = isDimMode( dir ) ? 2 : 1;
    2386 
    2387     if( pcCU->getSDCFlag( absPartIdx ) )
    2388     {
    2389 #endif
    2390       if( uiNumSegments == 1 )
    2391       {
    2392         dimDeltaDC = pcCU->getSDCSegmentDCOffset( 0, absPartIdx ) ? 1 : 0;
    2393       }
    2394       else
    2395       {
    2396         dimDeltaDC = ( pcCU->getSDCSegmentDCOffset( 0, absPartIdx ) || pcCU->getSDCSegmentDCOffset( 1, absPartIdx ) ) ? 1 : 0;
    2397       }
    2398 #if !HS_DMM_SIGNALLING_I0120
    2399     }
    2400     else
    2401     {
    2402       dimDeltaDC = isDimDeltaDC( dir );
    2403     }
    2404 #endif
    2405     m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get( 0, 0, 0 ) );
    2406   }
    2407 #if !HS_DMM_SIGNALLING_I0120
    2408   else //all-zero inter SDC is not allowed
    2409   {
    2410     uiNumSegments = 1;
    2411     dimDeltaDC = 1;
    2412   }
    2413 #endif
    2414 
    2415   if( dimDeltaDC )
    2416   {
    2417     for( UInt segment = 0; segment < uiNumSegments; segment++ )
    2418     {
    2419       Pel deltaDC = 0;
    2420 
    2421       if( pcCU->isIntra( absPartIdx ) )
    2422       {
    2423         UInt dir     = pcCU->getLumaIntraDir( absPartIdx );
    2424         deltaDC = pcCU->getSDCFlag( absPartIdx ) ? pcCU->getSDCSegmentDCOffset( segment, absPartIdx ) : pcCU->getDimDeltaDC( getDimType( dir ), segment, absPartIdx );
    2425       }
    2426       else
    2427       {
    2428         deltaDC = pcCU->getSDCSegmentDCOffset( segment, absPartIdx );
    2429       }
    2430 
    2431       xCodeDimDeltaDC( deltaDC, uiNumSegments );
    2432     }
    2433   }
    2434 }
    2435 
    2436 Void TEncSbac::codeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
    2437 {
    2438   UInt uiSymbol = pcCU->getSDCFlag( uiAbsPartIdx ) ? 1 : 0;
    2439   UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx );
    2440 
    2441   m_pcBinIf->encodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) );
    2442 }
    2443 
    2444 #endif
    2445 
    2446 #if H_3D_DBBP
    2447 Void TEncSbac::codeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
    2448 {
    2449 #if SEC_DBBP_EXPLICIT_SIG_I0077
    2450   PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
    2451   AOF( ePartSize == SIZE_2NxN || ePartSize == SIZE_Nx2N );
    2452 #endif
    2453   AOF( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) );
    2454   AOF( !pcCU->getSlice()->getIsDepth() );
    2455  
    2456   UInt uiSymbol = pcCU->getDBBPFlag( uiAbsPartIdx ) ? 1 : 0;
    2457   m_pcBinIf->encodeBin( uiSymbol, m_cDBBPFlagSCModel.get( 0, 0, 0 ) );
    2458 }
    2459 #endif
     1791
    24601792
    24611793//! \}
Note: See TracChangeset for help on using the changeset viewer.