Changeset 1039 in 3DVCSoftware for trunk/source/Lib/TLibEncoder


Ignore:
Timestamp:
4 Aug 2014, 11:36:05 (11 years ago)
Author:
tech
Message:

Merged 11.2-dev0@1038.

Location:
trunk/source/Lib/TLibEncoder
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibEncoder/TEncCavlc.cpp

    r976 r1039  
    887887{
    888888#if H_3D_QTLPC
     889#if !MTK_I0099_VPS_EX2
    889890//GT: This has to go to VPS
    890891if( depthFlag )
     
    893894  WRITE_FLAG( pcSPS->getUsePC()  ? 1 : 0, "use_pc_flag");
    894895}
     896#endif
    895897#endif
    896898}
     
    15581560Void TEncCavlc::codeVPSExtension2( TComVPS* pcVPS )
    15591561{
     1562#if SEC_VPS_CLEANUP_I0090
     1563  for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
     1564#else
    15601565  for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ )
    1561   {
     1566#endif
     1567  {
     1568#if !SEC_VPS_CLEANUP_I0090
    15621569    if (i!= 0)
    1563     {
     1570#endif
     1571    {
     1572#if MTK_I0099_VPS_EX2
     1573      WRITE_FLAG( pcVPS->getIvMvPredFlag         ( i ) ? 1 : 0 , "iv_mv_pred_flag[i]");
     1574#if SEC_HLS_CLEANUP_I0100
     1575      WRITE_FLAG( pcVPS->getIvMvScalingFlag( i ) ? 1 : 0 ,       "iv_mv_scaling_flag[i]" );
     1576#endif
     1577
     1578#endif
    15641579      if ( !( pcVPS->getDepthId( i ) == 1 ) )
    15651580      {
    15661581#if H_3D_IV_MERGE
     1582#if !MTK_I0099_VPS_EX2
    15671583        WRITE_FLAG( pcVPS->getIvMvPredFlag         ( i ) ? 1 : 0 , "iv_mv_pred_flag[i]");
     1584#endif
    15681585#if H_3D_SPIVMP
    15691586        WRITE_UVLC( pcVPS->getSubPULog2Size(i)-3, "log2_sub_PU_size_minus3[i]");
     
    15851602      else
    15861603      {
     1604#if !MTK_I0099_VPS_EX2
    15871605        if(i!=1)
    15881606        {
     
    15951613        }
    15961614#endif
     1615#endif
    15971616#if H_3D_IV_MERGE
    15981617        WRITE_FLAG( pcVPS->getMPIFlag( i ) ? 1 : 0 ,          "mpi_flag[i]" );
    15991618#endif
     1619#if MTK_I0099_VPS_EX2
     1620        WRITE_UVLC( pcVPS->getSubPUMPILog2Size(i)-3, "log2_mpi_sub_PU_size_minus3[i]");
     1621#endif
    16001622        WRITE_FLAG( pcVPS->getVpsDepthModesFlag( i ) ? 1 : 0 ,          "vps_depth_modes_flag[i]" );
    1601         //WRITE_FLAG( pcVPS->getLimQtPredFlag    ( i ) ? 1 : 0 ,          "lim_qt_pred_flag[i]"     );
     1623#if SEPARATE_FLAG_I0085
     1624        WRITE_FLAG( pcVPS->getIVPFlag( i ) ? 1 : 0 ,               "IVP_flag[i]" );
     1625#endif
     1626#if MTK_I0099_VPS_EX2
     1627        WRITE_FLAG( pcVPS->getLimQtPredFlag    ( i ) ? 1 : 0 ,          "lim_qt_pred_flag[i]"     );
     1628#endif
     1629
    16021630#if H_3D_INTER_SDC
    16031631        WRITE_FLAG( pcVPS->getInterSDCFlag( i ) ? 1 : 0, "depth_inter_SDC_flag" );
     
    16071635  }
    16081636  WRITE_UVLC( pcVPS->getCamParPrecision(), "cp_precision" );
     1637#if SEC_VPS_CLEANUP_I0090
     1638  for (UInt viewIndex=1; viewIndex<pcVPS->getNumViews(); viewIndex++)
     1639#else
    16091640  for (UInt viewIndex=0; viewIndex<pcVPS->getNumViews(); viewIndex++)
     1641#endif
    16101642  {
    16111643    WRITE_FLAG( pcVPS->getCamParPresent(viewIndex) ? 1 : 0, "cp_present_flag[i]" );
     
    16251657    }
    16261658  }
     1659#if !MTK_I0099_VPS_EX2
    16271660  WRITE_UVLC( pcVPS->getSubPUMPILog2Size( ) - 3, "log2_sub_PU_MPI_size_minus3");
     1661#endif
    16281662#if H_3D_TMVP
     1663#if !SEC_HLS_CLEANUP_I0100
    16291664  WRITE_FLAG( pcVPS->getIvMvScalingFlag( ) ? 1 : 0 ,          "iv_mv_scaling_flag" );
     1665#endif
    16301666#endif
    16311667}
     
    20132049    }
    20142050#if H_3D_IC
     2051#if SEC_HLS_CLEANUP_I0100
     2052    else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) && !pcSlice->getIsDepth() && vps->getNumDirectRefLayers( layerId ) > 0 )
     2053#else
    20152054    else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) && !pcSlice->getIsDepth())
     2055#endif
    20162056    {
    20172057      WRITE_FLAG( pcSlice->getApplyIC() ? 1 : 0, "slice_ic_enable_flag" );
     
    20222062    }
    20232063#endif
    2024 
     2064#if MTK_SINGLE_DEPTH_MODE_I0095
     2065    if(pcSlice->getIsDepth())
     2066    {
     2067      WRITE_FLAG( pcSlice->getApplySingleDepthMode() ? 1 : 0, "slice_enable_single_depth_mode" );
     2068    }
     2069#endif
    20252070#if H_3D_IV_MERGE
    20262071    assert(pcSlice->getMaxNumMergeCand()<=MRG_MAX_NUM_CANDS_MEM);
     
    24082453  assert(0);
    24092454}
    2410 
     2455#if MTK_SINGLE_DEPTH_MODE_I0095
     2456Void TEncCavlc::codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx )
     2457{
     2458  assert(0);
     2459}
     2460#endif
    24112461Void TEncCavlc::codeSplitFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    24122462{
  • trunk/source/Lib/TLibEncoder/TEncCavlc.h

    r884 r1039  
    123123  Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx );
    124124  Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     125#if MTK_SINGLE_DEPTH_MODE_I0095
     126  Void codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx );
     127#endif
    125128  Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    126129  Void codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx );
  • trunk/source/Lib/TLibEncoder/TEncCfg.h

    r976 r1039  
    414414#if H_3D_DIM
    415415  Bool      m_useDMM;
     416#if SEPARATE_FLAG_I0085
     417  Bool      m_useIVP;
     418#endif
    416419  Bool      m_useSDC;
    417420  Bool      m_useDLT;
    418421#endif
     422#if MTK_SINGLE_DEPTH_MODE_I0095
     423  Bool      m_useSingleDepthMode;
     424#endif
    419425#if H_3D_IV_MERGE
    420426  Bool      m_useMPI;
    421427#endif
     428#if !MTK_I0099_VPS_EX2 || MTK_I0099_FIX
    422429#if H_3D_QTLPC
    423430  Bool      m_bUseQTL;
     431#if !MTK_I0099_VPS_EX2
    424432  Bool      m_bUsePC;
     433#endif
     434#endif
    425435#endif
    426436#endif
     
    10031013  Bool      getUseDMM                       ()        { return m_useDMM; }
    10041014  Void      setUseDMM                       ( Bool b) { m_useDMM = b;    }
     1015#if SEPARATE_FLAG_I0085
     1016  Bool      getUseIVP                       ()        { return m_useIVP; }
     1017  Void      setUseIVP                       ( Bool b) { m_useIVP = b;    }
     1018#endif
    10051019  Bool      getUseSDC                       ()        { return m_useSDC; }
    10061020  Void      setUseSDC                       ( Bool b) { m_useSDC = b;    }
     
    10081022  Void      setUseDLT                       ( Bool b) { m_useDLT = b;    }
    10091023#endif
     1024#if MTK_SINGLE_DEPTH_MODE_I0095
     1025  Void       setUseSingleDepthMode          ( Bool bVal )    { m_useSingleDepthMode = bVal; }
     1026  Bool       getUseSingleDepthMode          ()               { return m_useSingleDepthMode; }
     1027#endif
     1028#if !MTK_I0099_VPS_EX2 || MTK_I0099_FIX
    10101029#if H_3D_QTLPC
    10111030  Void      setUseQTL                       ( Bool b ) { m_bUseQTL = b;    }
    10121031  Bool      getUseQTL                       ()         { return m_bUseQTL; }
     1032#if !MTK_I0099_VPS_EX2
    10131033  Void      setUsePC                        ( Bool b ) { m_bUsePC  = b;    }
    10141034  Bool      getUsePC                        ()         { return m_bUsePC;  }
     1035#endif
     1036#endif
    10151037#endif
    10161038#if H_3D_IV_MERGE
  • trunk/source/Lib/TLibEncoder/TEncCu.cpp

    r976 r1039  
    409409
    410410#if H_3D_QTLPC
     411#if MTK_I0099_VPS_EX2
     412  TComVPS *vps            = pcPic->getSlice(0)->getVPS();
     413  Bool  bLimQtPredFalg    = vps->getLimQtPredFlag(pcPic->getSlice(0)->getLayerId());
     414#else
    411415  TComSPS *sps            = pcPic->getSlice(0)->getSPS();
     416#endif
    412417  TComPic *pcTexture      = rpcBestCU->getSlice()->getTexturePic();
    413418
     
    531536      //logic for setting bTrySplit using the partition information that is stored of the texture colocated CU
    532537
     538#if MTK_I0099_VPS_EX2
     539#if MTK_I0099_FIX
     540      if(depthMapDetect && !bIntraSliceDetect && !rapPic && ( m_pcEncCfg->getUseQTL() || bLimQtPredFalg ))
     541#else
     542      if(depthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFalg)
     543#endif
     544#else
    533545      if(depthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTL())
     546#endif
    534547      {
    535548        TComDataCU* pcTextureCU = pcTexture->getCU( rpcBestCU->getAddr() ); //Corresponding texture LCU
     
    685698
    686699#if H_3D_QTLPC     
     700#if MTK_I0099_VPS_EX2
     701#if MTK_I0099_FIX
     702      if(depthMapDetect && !bIntraSliceDetect && !rapPic && ( m_pcEncCfg->getUseQTL() || bLimQtPredFalg ))
     703#else
     704      if(depthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFalg)
     705#endif
     706#else
    687707      if(depthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTL())
     708#endif
    688709      {
    689710        bTrySplitDQP = bTrySplit;
     
    709730    }
    710731#endif
    711 
     732#if MTK_SINGLE_DEPTH_MODE_I0095
     733    rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP  );
     734    if(rpcBestCU->getSlice()->getApplySingleDepthMode())
     735    {
     736      xCheckRDCostSingleDepth( rpcBestCU, rpcTempCU, SIZE_2Nx2N );
     737      rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP  );
     738    }
     739#endif
    712740    if(!earlyDetectionSkipMode)
    713741    {
     
    10211049          // speedup for inter frames
    10221050          if( rpcBestCU->getSlice()->getSliceType() == I_SLICE ||
    1023             rpcBestCU->getCbf( 0, TEXT_LUMA     ) != 0   ||
    1024             rpcBestCU->getCbf( 0, TEXT_CHROMA_U ) != 0   ||
     1051              rpcBestCU->getCbf( 0, TEXT_LUMA     ) != 0   ||
     1052              rpcBestCU->getCbf( 0, TEXT_CHROMA_U ) != 0   ||
    10251053              rpcBestCU->getCbf( 0, TEXT_CHROMA_V ) != 0     
    10261054#if H_3D_DIM_ENC
     1055#if HHI_DMM4_ENC_I0066
     1056              || rpcBestCU->getSlice()->getIsDepth()
     1057#else
    10271058            || ( rpcBestCU->getSlice()->getIsDepth() && rpcBestCU->getSlice()->isIRAP() )
     1059#endif
    10281060#endif
    10291061            ) // avoid very complex intra if it is unlikely
    10301062          {
     1063#if HHI_DMM4_ENC_I0066
     1064            Bool bOnlyIVP = false;
     1065            if( rpcBestCU->getSlice()->getIsDepth() && !(rpcBestCU->getSlice()->isIRAP()) &&
     1066                rpcBestCU->getSlice()->getSliceType() != I_SLICE &&
     1067                rpcBestCU->getCbf( 0, TEXT_LUMA     ) == 0 &&
     1068                rpcBestCU->getCbf( 0, TEXT_CHROMA_U ) == 0 &&
     1069                rpcBestCU->getCbf( 0, TEXT_CHROMA_V ) == 0
     1070              )
     1071            {
     1072              bOnlyIVP = true;
     1073            }
     1074            xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bOnlyIVP );
     1075#else
    10311076            xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_2Nx2N );
     1077#endif
    10321078
    10331079#if KWU_RC_MADPRED_E0227
     
    10481094                if( rpcTempCU->getWidth(0) > ( 1 << rpcTempCU->getSlice()->getSPS()->getQuadtreeTULog2MinSize() ) )
    10491095                {
     1096#if HHI_DMM4_ENC_I0066
     1097                  xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_NxN, bOnlyIVP );
     1098#else
    10501099                  xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_NxN   );
     1100#endif
    10511101                  rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
    10521102                }
     
    15361586    return;
    15371587  }
     1588#if MTK_SINGLE_DEPTH_MODE_I0095
     1589  m_pcEntropyCoder->encodeSingleDepthMode( pcCU, uiAbsPartIdx );
     1590  if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
     1591  {
     1592#endif
    15381593  m_pcEntropyCoder->encodePredMode( pcCU, uiAbsPartIdx );
    15391594 
     
    15681623  m_pcEntropyCoder->encodeCoeff( pcCU, uiAbsPartIdx, uiDepth, pcCU->getWidth (uiAbsPartIdx), pcCU->getHeight(uiAbsPartIdx), bCodeDQP );
    15691624  setdQPFlag( bCodeDQP );
    1570 
     1625#if MTK_SINGLE_DEPTH_MODE_I0095
     1626  }
     1627#endif
    15711628  // --- write terminating bit ---
    15721629  finishCU(pcCU,uiAbsPartIdx,uiDepth);
     
    18021859    Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    18031860    memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
     1861#if !FIX_TICKET_79
    18041862    InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
     1863#endif
    18051864#if H_3D_SPIVMP
    18061865    Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM];
     
    18151874    rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
    18161875    rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours
     1876#if !FIX_TICKET_79
    18171877      , inheritedVSPDisInfo
     1878#endif
    18181879#if H_3D_SPIVMP
    18191880      , pcMvFieldSP, puhInterDirSP
     
    18301891
    18311892#else
     1893#if FIX_TICKET_79
     1894    rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, numValidMergeCand );
     1895#else
    18321896    rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand );
    18331897#endif
     1898#endif
     1899
    18341900
    18351901#endif
     
    18721938#if H_3D_VSP
    18731939          rpcTempCU->setVSPFlagSubParts( vspFlag[uiMergeCand], 0, 0, uhDepth );
     1940#if !FIX_TICKET_79
    18741941          rpcTempCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, 0, 0, uhDepth );
     1942#endif
    18751943#endif
    18761944#if H_3D_DDD
     
    19712039
    19722040          rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth );
     2041#if MTK_SINGLE_DEPTH_MODE_I0095
     2042          rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth );
     2043#endif
    19732044#if H_3D_VSP // possible bug fix
    19742045          if( rpcTempCU->getSkipFlag(0) )
     
    19862057          if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() && !uiNoResidual )
    19872058          {
     2059#if FAST_SDC_OFFSET_DECISION_I0084
     2060            Double dOffsetCost[3] = {MAX_DOUBLE,MAX_DOUBLE,MAX_DOUBLE};
     2061            for( Int uiOffest = 1 ; uiOffest <= 5 ; uiOffest++ )
     2062#else
    19882063            for( Int uiOffest = -2 ; uiOffest <= 2 ; uiOffest++ )
     2064#endif
    19892065            {
     2066#if FAST_SDC_OFFSET_DECISION_I0084
     2067              if( uiOffest > 3)
     2068              {
     2069                if ( dOffsetCost[0] < (0.9*dOffsetCost[1]) && dOffsetCost[0] < (0.9*dOffsetCost[2]) )
     2070                {
     2071                  continue;
     2072                }
     2073                if ( dOffsetCost[1] < dOffsetCost[0] && dOffsetCost[0] < dOffsetCost[2] &&  uiOffest == 5)
     2074                {
     2075                  continue;
     2076                }
     2077                if ( dOffsetCost[0] < dOffsetCost[1] && dOffsetCost[2] < dOffsetCost[0] &&  uiOffest == 4)
     2078                {
     2079                  continue;
     2080                }
     2081              }
     2082#endif
    19902083              if( rpcTempCU != rpcTempCUPre )
    19912084              {
     
    19942087              }
    19952088              rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
     2089#if MTK_SINGLE_DEPTH_MODE_I0095
     2090              rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth );
     2091#endif
    19962092              rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth );
    19972093              rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth );
     
    20062102              }
    20072103#endif
     2104#if FAST_SDC_OFFSET_DECISION_I0084
     2105              Int iSdcOffset = 0;
     2106              if(uiOffest % 2 == 0)
     2107              {
     2108                iSdcOffset = uiOffest >> 1;
     2109              }
     2110              else
     2111              {
     2112                iSdcOffset = -1 * (uiOffest >> 1);
     2113              }
     2114              m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU,
     2115                m_ppcOrigYuv[uhDepth],
     2116                ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth],
     2117                m_ppcResiYuvTemp[uhDepth],
     2118                m_ppcRecoYuvTemp[uhDepth],
     2119                iSdcOffset,
     2120                uhDepth );
     2121              if (uiOffest <= 3 )
     2122              {
     2123                dOffsetCost [uiOffest -1] = rpcTempCU->getTotalCost();
     2124              }
     2125#else
    20082126              m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU,
    20092127                m_ppcOrigYuv[uhDepth],
     
    20132131                uiOffest,
    20142132                uhDepth );
     2133#endif
    20152134
    20162135              xCheckDQP( rpcTempCU );
     
    21302249 
    21312250  rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
    2132 
     2251#if MTK_SINGLE_DEPTH_MODE_I0095
     2252  rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth );
     2253#endif
    21332254  rpcTempCU->setPartSizeSubParts  ( ePartSize,  0, uhDepth );
    21342255  rpcTempCU->setPredModeSubParts  ( MODE_INTER, 0, uhDepth );
     
    22172338  if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() && ePartSize == SIZE_2Nx2N)
    22182339  {
     2340#if FAST_SDC_OFFSET_DECISION_I0084
     2341    Double dOffsetCost[3] = {MAX_DOUBLE,MAX_DOUBLE,MAX_DOUBLE};
     2342    for( Int uiOffest = 1 ; uiOffest <= 5 ; uiOffest++ )
     2343#else
    22192344    for( Int uiOffest = -2 ; uiOffest <= 2 ; uiOffest++ )
    2220     {
     2345#endif
     2346    {
     2347#if FAST_SDC_OFFSET_DECISION_I0084
     2348      if( uiOffest > 3)
     2349      {
     2350        if ( dOffsetCost[0] < (0.9*dOffsetCost[1]) && dOffsetCost[0] < (0.9*dOffsetCost[2]) )
     2351        {
     2352          continue;
     2353        }
     2354        if ( dOffsetCost[1] < dOffsetCost[0] && dOffsetCost[0] < dOffsetCost[2] &&  uiOffest == 5)
     2355        {
     2356          continue;
     2357        }
     2358        if ( dOffsetCost[0] < dOffsetCost[1] && dOffsetCost[2] < dOffsetCost[0] &&  uiOffest == 4)
     2359        {
     2360          continue;
     2361        }
     2362      }
     2363#endif
    22212364      if( rpcTempCU != rpcTempCUPre )
    22222365      {
     
    22262369      }
    22272370      rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
     2371#if MTK_SINGLE_DEPTH_MODE_I0095
     2372      rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth );
     2373#endif
    22282374      rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth );
    22292375      rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth );
     
    22392385#endif
    22402386
     2387#if FAST_SDC_OFFSET_DECISION_I0084
     2388      Int iSdcOffset = 0;
     2389      if(uiOffest % 2 == 0)
     2390      {
     2391        iSdcOffset = uiOffest >> 1;
     2392      }
     2393      else
     2394      {
     2395        iSdcOffset = -1 * (uiOffest >> 1);
     2396      }
     2397      m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU,
     2398        m_ppcOrigYuv[uhDepth],
     2399        ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth],
     2400        m_ppcResiYuvTemp[uhDepth],
     2401        m_ppcRecoYuvTemp[uhDepth],
     2402        iSdcOffset,
     2403        uhDepth );
     2404      if (uiOffest <= 3 )
     2405      {
     2406        dOffsetCost [uiOffest -1] = rpcTempCU->getTotalCost();
     2407      }
     2408#else
    22412409      m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU,
    22422410        m_ppcOrigYuv[uhDepth],
     
    22462414        uiOffest,
    22472415        uhDepth );
     2416#endif
    22482417
    22492418      xCheckDQP( rpcTempCU );
     
    23202489  }
    23212490}
    2322 
     2491#if MTK_SINGLE_DEPTH_MODE_I0095
     2492Void TEncCu::xCheckRDCostSingleDepth( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize )
     2493{
     2494  UInt uiDepth = rpcTempCU->getDepth( 0 );
     2495  if( !rpcBestCU->getSlice()->getIsDepth() || (eSize != SIZE_2Nx2N))
     2496  {
     2497    return;
     2498  }
     2499 
     2500#if H_3D_VSO // M5
     2501  if( m_pcRdCost->getUseRenModel() )
     2502  {
     2503    UInt  uiWidth     = m_ppcOrigYuv[uiDepth]->getWidth   ();
     2504    UInt  uiHeight    = m_ppcOrigYuv[uiDepth]->getHeight  ();
     2505    Pel*  piSrc       = m_ppcOrigYuv[uiDepth]->getLumaAddr();
     2506    UInt  uiSrcStride = m_ppcOrigYuv[uiDepth]->getStride  ();
     2507    m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
     2508  }
     2509#endif
     2510
     2511  rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
     2512  rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth );
     2513  rpcTempCU->setPredModeSubParts( MODE_INTRA, 0, uiDepth );
     2514  rpcTempCU->setCUTransquantBypassSubParts( rpcTempCU->getCUTransquantBypass(0), 0, uiDepth );
     2515
     2516  rpcTempCU->setTrIdxSubParts(0, 0, uiDepth);
     2517  rpcTempCU->setCbfSubParts(0, 1, 1, 0, uiDepth);
     2518  rpcTempCU->setSingleDepthFlagSubParts(true, 0, uiDepth);
     2519  rpcTempCU->setLumaIntraDirSubParts (DC_IDX, 0, uiDepth);
     2520#if H_3D_DIM_SDC
     2521  rpcTempCU->setSDCFlagSubParts( false, 0, uiDepth);
     2522#endif
     2523
     2524  UInt uiPreCalcDistC;
     2525  m_pcPredSearch  ->estIntraPredSingleDepth      ( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC, false );
     2526
     2527
     2528  m_ppcRecoYuvTemp[uiDepth]->copyToPicLuma(rpcTempCU->getPic()->getPicYuvRec(), rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU() );
     2529 
     2530 
     2531  m_pcEntropyCoder->resetBits();
     2532  if ( rpcTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag())
     2533  {
     2534    m_pcEntropyCoder->encodeCUTransquantBypassFlag( rpcTempCU, 0,          true );
     2535  }
     2536  m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0,          true );
     2537  m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0,          true );
     2538 
     2539
     2540  m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]);
     2541 
     2542  rpcTempCU->getTotalBits() = m_pcEntropyCoder->getNumberOfWrittenBits();
     2543  rpcTempCU->getTotalBins() = ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded();
     2544
     2545
     2546#if H_3D_VSO // M6
     2547  if( m_pcRdCost->getUseLambdaScaleVSO()) 
     2548    rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCostVSO( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 
     2549  else
     2550#endif
     2551  rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );
     2552 
     2553
     2554  xCheckDQP( rpcTempCU );
     2555  xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth);
     2556}
     2557#endif
    23232558Void TEncCu::xCheckRDCostInterDBBP( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bUseMRG )
    23242559{
     
    23412576  UInt uiHeight = rpcTempCU->getHeight(0);
    23422577  AOF( uiWidth == uiHeight );
     2578 
     2579#if SEC_DBBP_DISALLOW_8x8_I0078
     2580  if(uiWidth <= 8)
     2581  {
     2582    return;
     2583  }
     2584#endif
    23432585 
    23442586  rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N,  0, uhDepth );
     
    24382680 
    24392681  // reconstruct final prediction signal by combining both segments
     2682#if SHARP_DBBP_SIMPLE_FLTER_I0109
     2683  m_pcPredSearch->combineSegmentsWithMask(apPredYuv, m_ppcPredYuvTemp[uhDepth], pMask, uiWidth, uiHeight, 0, eVirtualPartSize);
     2684#else
    24402685  m_pcPredSearch->combineSegmentsWithMask(apPredYuv, m_ppcPredYuvTemp[uhDepth], pMask, uiWidth, uiHeight);
     2686#endif
    24412687 
    24422688  m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvBest[uhDepth], m_ppcRecoYuvTemp[uhDepth], false );
     
    24472693#endif
    24482694
     2695#if HHI_DMM4_ENC_I0066
     2696Void TEncCu::xCheckRDCostIntra( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize, Bool bOnlyIVP )
     2697#else
    24492698Void TEncCu::xCheckRDCostIntra( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize )
     2699#endif
    24502700{
    24512701  UInt uiDepth = rpcTempCU->getDepth( 0 );
     
    24632713
    24642714  rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
    2465 
     2715#if MTK_SINGLE_DEPTH_MODE_I0095
     2716  rpcTempCU->setSingleDepthFlagSubParts( false, 0, uiDepth );
     2717#endif
    24662718  rpcTempCU->setPartSizeSubParts( eSize, 0, uiDepth );
    24672719  rpcTempCU->setPredModeSubParts( MODE_INTRA, 0, uiDepth );
     
    24732725    m_pcPredSearch->preestChromaPredMode( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth] );
    24742726  }
     2727#if HHI_DMM4_ENC_I0066
     2728  m_pcPredSearch  ->estIntraPredQT      ( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC, bSeparateLumaChroma, bOnlyIVP );
     2729#else
    24752730  m_pcPredSearch  ->estIntraPredQT      ( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC, bSeparateLumaChroma );
    2476 
     2731#endif
    24772732  m_ppcRecoYuvTemp[uiDepth]->copyToPicLuma(rpcTempCU->getPic()->getPicYuvRec(), rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU() );
    24782733 
     
    24882743  }
    24892744  m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0,          true );
     2745#if MTK_SINGLE_DEPTH_MODE_I0095
     2746  m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0,          true );
     2747  if(!rpcTempCU->getSingleDepthFlag(0))
     2748  {
     2749#endif
    24902750  m_pcEntropyCoder->encodePredMode( rpcTempCU, 0,          true );
    24912751  m_pcEntropyCoder->encodePartSize( rpcTempCU, 0, uiDepth, true );
     
    25002760  m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, rpcTempCU->getWidth (0), rpcTempCU->getHeight(0), bCodeDQP );
    25012761  setdQPFlag( bCodeDQP );
    2502  
     2762#if MTK_SINGLE_DEPTH_MODE_I0095
     2763  }
     2764#endif       
    25032765  m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]);
    25042766 
     
    25282790
    25292791  rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
    2530 
     2792#if MTK_SINGLE_DEPTH_MODE_I0095
     2793  rpcTempCU->setSingleDepthFlagSubParts( false, 0, uiDepth );
     2794#endif
    25312795  rpcTempCU->setIPCMFlag(0, true);
    25322796  rpcTempCU->setIPCMFlagSubParts (true, 0, rpcTempCU->getDepth(0));
     
    25452809  }
    25462810  m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0,          true );
     2811#if MTK_SINGLE_DEPTH_MODE_I0095
     2812  m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0,          true );
     2813#endif
    25472814  m_pcEntropyCoder->encodePredMode ( rpcTempCU, 0,          true );
    25482815  m_pcEntropyCoder->encodePartSize ( rpcTempCU, 0, uiDepth, true );
  • trunk/source/Lib/TLibEncoder/TEncCu.h

    r872 r1039  
    159159  Void  xCheckRDCostInterDBBP( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bUseMRG = false );
    160160#endif
     161#if MTK_SINGLE_DEPTH_MODE_I0095
     162  Void  xCheckRDCostSingleDepth   ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize  );
     163#endif
     164#if HHI_DMM4_ENC_I0066
     165  Void  xCheckRDCostIntra   ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bOnlyIVP );
     166#else
    161167  Void  xCheckRDCostIntra   ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize  );
     168#endif
    162169  Void  xCheckDQP           ( TComDataCU*  pcCU );
    163170 
  • trunk/source/Lib/TLibEncoder/TEncEntropy.cpp

    r976 r1039  
    119119  m_pcEntropyCoderIf->codeSkipFlag( pcCU, uiAbsPartIdx );
    120120}
    121 
     121#if MTK_SINGLE_DEPTH_MODE_I0095
     122Void TEncEntropy::encodeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
     123{
     124  if ( !pcCU->getSlice()->getIsDepth() )
     125  {
     126    return;
     127  }
     128  if(!pcCU->getSlice()->getApplySingleDepthMode())
     129  {
     130     return;
     131  }
     132 
     133  if( bRD )
     134  {
     135    uiAbsPartIdx = 0;
     136  }
     137  m_pcEntropyCoderIf->codeSingleDepthMode( pcCU, uiAbsPartIdx );
     138}
     139#endif
    122140/** encode merge flag
    123141 * \param pcCU
     
    244262 
    245263#if H_3D_DBBP
     264#if! SEC_DBBP_EXPLICIT_SIG_I0077
    246265  PartSize eVirtualPartSize = pcCU->getPartitionSize(uiAbsPartIdx);
    247266  if( pcCU->getDBBPFlag(uiAbsPartIdx) )
     
    253272  }
    254273#endif
     274#endif
    255275 
    256276  m_pcEntropyCoderIf->codePartSize( pcCU, uiAbsPartIdx, uiDepth );
    257277 
    258278#if H_3D_DBBP
     279#if SEC_DBBP_EXPLICIT_SIG_I0077
     280#if SEC_DBBP_DISALLOW_8x8_I0078
     281  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) && pcCU->getWidth(uiAbsPartIdx) > 8 )
     282#else
     283  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) )
     284#endif
     285#else
     286#if SEC_DBBP_DISALLOW_8x8_I0078
     287  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && pcCU->getWidth(uiAbsPartIdx) > 8 )
     288#else
    259289  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) )
     290#endif
     291#endif
    260292  {
    261293    encodeDBBPFlag(pcCU, uiAbsPartIdx, bRD);
    262    
     294#if !SEC_DBBP_EXPLICIT_SIG_I0077
    263295    if( pcCU->getDBBPFlag(uiAbsPartIdx) )
    264296    {
     
    266298      pcCU->setPartSizeSubParts(eVirtualPartSize, uiAbsPartIdx, uiDepth);
    267299    }
     300#endif
    268301  }
    269302#endif
  • trunk/source/Lib/TLibEncoder/TEncEntropy.h

    r884 r1039  
    8686  virtual Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
    8787  virtual Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     88#if MTK_SINGLE_DEPTH_MODE_I0095
     89  virtual Void codeSingleDepthMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     90#endif
    8891  virtual Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
    8992  virtual Void codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     
    171174  Void encodeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
    172175  Void encodeSkipFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
     176#if MTK_SINGLE_DEPTH_MODE_I0095
     177  Void encodeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD=false );
     178#endif
    173179  Void encodePUWise       ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
    174180  Void encodeInterDirPU   ( TComDataCU* pcSubCU, UInt uiAbsPartIdx  );
  • trunk/source/Lib/TLibEncoder/TEncGOP.cpp

    r976 r1039  
    934934    pcSlice->setRefPicList ( rcListPic );
    935935#endif
    936  
     936#if MTK_SINGLE_DEPTH_MODE_I0095
     937    TEncTop* pcEncTop = (TEncTop*) m_pcCfg;
     938    bool enableSingleDepthMode=false;
     939    if(pcEncTop->getUseSingleDepthMode())
     940    {
     941      if(pcSlice->getIsDepth())
     942      {
     943        enableSingleDepthMode=true;
     944      }
     945    }
     946    pcSlice->setApplySingleDepthMode(enableSingleDepthMode);
     947#endif   
    937948#if H_3D_ARP
    938949    //GT: This seems to be broken when layerId in vps is not equal to layerId in nuh
  • trunk/source/Lib/TLibEncoder/TEncSbac.cpp

    r976 r1039  
    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
    6064, m_cCUMergeFlagExtSCModel    ( 1,             1,               NUM_MERGE_FLAG_EXT_CTX        , m_contextModels + m_numContextModels, m_numContextModels)
    6165, m_cCUMergeIdxExtSCModel     ( 1,             1,               NUM_MERGE_IDX_EXT_CTX         , m_contextModels + m_numContextModels, m_numContextModels)
     
    130134 
    131135  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
    132140  m_cCUMergeFlagExtSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT);
    133141  m_cCUMergeIdxExtSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT);
     
    206214      curCost  = m_cCUSplitFlagSCModel.calcCost       ( curSliceType, qp, (UChar*)INIT_SPLIT_FLAG );
    207215      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
    208220      curCost += m_cCUMergeFlagExtSCModel.calcCost    ( curSliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT);
    209221      curCost += m_cCUMergeIdxExtSCModel.calcCost     ( curSliceType, qp, (UChar*)INIT_MERGE_IDX_EXT);
     
    243255      curCost += m_CUTransquantBypassFlagSCModel.calcCost( curSliceType, qp, (UChar*)INIT_CU_TRANSQUANT_BYPASS_FLAG );
    244256#if H_3D_DIM
     257#if SEPARATE_FLAG_I0085
     258    if( m_pcSlice->getVpsDepthModesFlag() || m_pcSlice->getIVPFlag() )
     259#else
    245260    if( m_pcSlice->getVpsDepthModesFlag() )
     261#endif
    246262    {
    247263      curCost += m_cDepthIntraModeSCModel.calcCost    ( curSliceType, qp, (UChar*)INIT_DEPTH_INTRA_MODE );
     
    275291 
    276292  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 
    277297  m_cCUMergeFlagExtSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT);
    278298  m_cCUMergeIdxExtSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT);
     
    434454  m_pcBinIf->encodeBinsEP( bins, numBins );
    435455}
    436 
     456#if MTK_SINGLE_DEPTH_MODE_I0095
     457Void 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
    437487/** Coding of coeff_abs_level_minus3
    438488 * \param uiSymbol value of coeff_abs_level_minus3
     
    514564#endif
    515565
     566#if !FIX_TICKET_76
    516567#if H_3D_DIM_SDC
    517568Void TEncSbac::xCodeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment )
     
    600651#endif
    601652#endif
     653#endif
     654
    602655
    603656// SBAC RD
     
    664717  PartSize eSize         = pcCU->getPartitionSize( uiAbsPartIdx );
    665718#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
    666723  TComSPS *sps           = pcCU->getPic()->getSlice(0)->getSPS();
     724#endif
    667725  TComPic *pcTexture     = pcCU->getSlice()->getTexturePic();
    668726  Bool bDepthMapDetect   = (pcTexture != NULL);
     
    673731  Bool depthDependent = false;
    674732  UInt uiTexturePart = eSize;
     733#if MTK_I0099_VPS_EX2
     734  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && bLimQtPredFlag )
     735#else
    675736  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && sps->getUseQTL() && sps->getUsePC() )
     737#endif
    676738  {
    677739    TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
     
    10311093  Bool bCodeSplitFlag    = true;
    10321094
     1095#if MTK_I0099_VPS_EX2
     1096  TComVPS *vps           = pcCU->getPic()->getSlice(0)->getVPS();
     1097  Bool    bLimQtPredFlag = vps->getLimQtPredFlag(pcCU->getPic()->getSlice(0)->getLayerId());
     1098#else
    10331099  TComSPS *sps           = pcCU->getPic()->getSlice(0)->getSPS();
     1100#endif
    10341101  TComPic *pcTexture     = pcCU->getSlice()->getTexturePic();
    10351102  Bool bDepthMapDetect   = (pcTexture != NULL);
     
    10381105  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);
    10391106
     1107#if MTK_I0099_VPS_EX2
     1108  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && bLimQtPredFlag  )
     1109#else
    10401110  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && sps->getUseQTL() && sps->getUsePC())
     1111#endif
    10411112  {
    10421113    TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
     
    10881159    dir[j] = pcCU->getLumaIntraDir( absPartIdx+partOffset*j );
    10891160#if H_3D_DIM
     1161#if SEPARATE_FLAG_I0085
     1162    if( pcCU->getSlice()->getVpsDepthModesFlag() ||  pcCU->getSlice()->getIVPFlag() )
     1163#else
    10901164    if( pcCU->getSlice()->getVpsDepthModesFlag() )
     1165#endif
    10911166    {
    10921167      codeIntraDepth( pcCU, absPartIdx+partOffset*j );
     
    12341309    }
    12351310    //mode coding
     1311#if SEPARATE_FLAG_I0085
     1312    if( pcCU->getSlice()->getVpsDepthModesFlag() && pcCU->getSlice()->getIVPFlag())
     1313    {
     1314      m_pcBinIf->encodeBin( uiCodeIdx == 0 ? 0 : 1, m_cDepthIntraModeSCModel.get( 0, 0, 0 ) );
     1315    }
     1316#else
    12361317    m_pcBinIf->encodeBin( uiCodeIdx == 0 ? 0 : 1, m_cDepthIntraModeSCModel.get( 0, 0, 0 ) );
     1318#endif
    12371319  }
    12381320}
     
    22782360  }
    22792361
     2362#if HS_DMM_SIGNALLING_I0120
     2363  UInt uiNumSegments = isDimMode( pcCU->getLumaIntraDir( absPartIdx ) ) ? 2 : 1;
     2364  UInt dimDeltaDC = 1;
     2365#else
    22802366  UInt uiNumSegments = 0;
    22812367  UInt dimDeltaDC = 0;
    2282 
     2368#endif
     2369
     2370#if HS_DMM_SIGNALLING_I0120
     2371  if( pcCU->isIntra( absPartIdx ) && pcCU->getSDCFlag( absPartIdx ))
     2372  {
     2373#else
    22832374  if( pcCU->isIntra( absPartIdx ) )
    22842375  {
     
    22882379    if( pcCU->getSDCFlag( absPartIdx ) )
    22892380    {
     2381#endif
    22902382      if( uiNumSegments == 1 )
    22912383      {
     
    22962388        dimDeltaDC = ( pcCU->getSDCSegmentDCOffset( 0, absPartIdx ) || pcCU->getSDCSegmentDCOffset( 1, absPartIdx ) ) ? 1 : 0;
    22972389      }
     2390#if !HS_DMM_SIGNALLING_I0120
    22982391    }
    22992392    else
     
    23012394      dimDeltaDC = isDimDeltaDC( dir );
    23022395    }
     2396#endif
    23032397    m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get( 0, 0, 0 ) );
    23042398  }
     2399#if !HS_DMM_SIGNALLING_I0120
    23052400  else //all-zero inter SDC is not allowed
    23062401  {
     
    23082403    dimDeltaDC = 1;
    23092404  }
     2405#endif
    23102406
    23112407  if( dimDeltaDC )
     
    23432439Void TEncSbac::codeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
    23442440{
     2441#if SEC_DBBP_EXPLICIT_SIG_I0077
     2442  PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
     2443  AOF( ePartSize == SIZE_2NxN || ePartSize == SIZE_Nx2N );
     2444#endif
    23452445  AOF( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) );
    23462446  AOF( !pcCU->getSlice()->getIsDepth() );
  • trunk/source/Lib/TLibEncoder/TEncSbac.h

    r976 r1039  
    130130  Void  xCodeDmm1WedgeIdx    ( UInt uiTabIdx, Int iNumBit );
    131131#endif
     132#if !FIX_TICKET_76
    132133#if H_3D_DIM_SDC
    133134  Void  xCodeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment );
     135#endif
    134136#endif
    135137#endif
     
    153155  Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx );
    154156  Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     157#if MTK_SINGLE_DEPTH_MODE_I0095
     158  Void codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx );
     159#endif
    155160  Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    156161  Void codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     
    219224  ContextModel3DBuffer m_cCUSplitFlagSCModel;
    220225  ContextModel3DBuffer m_cCUSkipFlagSCModel;
     226#if MTK_SINGLE_DEPTH_MODE_I0095
     227  ContextModel3DBuffer m_cCUSingleDepthFlagSCModel;
     228  ContextModel3DBuffer m_cSingleDepthValueSCModel;
     229#endif
    221230  ContextModel3DBuffer m_cCUMergeFlagExtSCModel;
    222231  ContextModel3DBuffer m_cCUMergeIdxExtSCModel;
  • trunk/source/Lib/TLibEncoder/TEncSearch.cpp

    r976 r1039  
    915915        }
    916916        m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true );
     917#if MTK_SINGLE_DEPTH_MODE_I0095
     918        m_pcEntropyCoder->encodeSingleDepthMode(pcCU, 0, true );
     919        if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
     920#endif
    917921        m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
    918922      }
    919      
     923#if MTK_SINGLE_DEPTH_MODE_I0095
     924      else
     925      {
     926        m_pcEntropyCoder->encodeSingleDepthMode(pcCU, 0, true );
     927      }
     928#endif     
     929#if MTK_SINGLE_DEPTH_MODE_I0095
     930      if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
     931      {
     932#endif
    920933      m_pcEntropyCoder  ->encodePartSize( pcCU, 0, pcCU->getDepth(0), true );
    921934
     
    932945        }
    933946      }
    934     }
     947#if MTK_SINGLE_DEPTH_MODE_I0095
     948    }
     949#endif
     950    }
     951#if MTK_SINGLE_DEPTH_MODE_I0095
     952      if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
     953      {
     954#endif
    935955    // luma prediction mode
    936956    if( pcCU->getPartitionSize(0) == SIZE_2Nx2N )
     
    975995    }
    976996  }
    977 
     997#if MTK_SINGLE_DEPTH_MODE_I0095
     998    }
     999#endif
    9781000  }
    9791001  if( bChroma )
     
    18371859  dRDCost  += dSingleCost;
    18381860}
    1839 
     1861#if MTK_SINGLE_DEPTH_MODE_I0095
     1862Void TEncSearch::xIntraCodingSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Int iTestDepthIdx, Pel *DepthNeighbor )
     1863{
     1864  UInt    uiWidth           = pcCU     ->getWidth   ( 0 );
     1865  UInt    uiHeight          = pcCU     ->getHeight  ( 0 );
     1866  UInt    uiStride          = pcOrgYuv ->getStride  ();
     1867  Pel*    piOrg             = pcOrgYuv ->getLumaAddr( uiAbsPartIdx );
     1868  Pel*    piPred            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
     1869
     1870  AOF( uiWidth == uiHeight );
     1871  AOF( uiAbsPartIdx == 0 );
     1872  pcCU->setSingleDepthValueSubParts((Pel)iTestDepthIdx,uiAbsPartIdx, 0, pcCU->getDepth(0)); 
     1873  //===== reconstruction =====
     1874
     1875  for( UInt uiY = 0; uiY < uiHeight; uiY++ )
     1876  {
     1877    for( UInt uiX = 0; uiX < uiWidth; uiX++ )
     1878    {
     1879    piPred[ uiX ] = DepthNeighbor[iTestDepthIdx];
     1880    }
     1881    piPred     += uiStride;
     1882  }
     1883
     1884  // clear UV
     1885  UInt  uiStrideC     = pcPredYuv->getCStride();
     1886  Pel   *pRecCb       = pcPredYuv->getCbAddr();
     1887  Pel   *pRecCr       = pcPredYuv->getCrAddr();
     1888
     1889  for (Int y=0; y<uiHeight/2; y++)
     1890  {
     1891    for (Int x=0; x<uiWidth/2; x++)
     1892    {
     1893      pRecCb[x] = 1<<(g_bitDepthC-1);
     1894      pRecCr[x] = 1<<(g_bitDepthC-1);
     1895    }
     1896
     1897    pRecCb += uiStrideC;
     1898    pRecCr += uiStrideC;
     1899  }
     1900
     1901  piPred            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
     1902  //===== determine distortion =====
     1903#if H_3D_VSO
     1904  if ( m_pcRdCost->getUseVSO() )
     1905    ruiDist = m_pcRdCost->getDistPartVSO  ( pcCU, uiAbsPartIdx, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, false );
     1906  else
     1907#endif
     1908    ruiDist = m_pcRdCost->getDistPart(g_bitDepthY, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight );
     1909
     1910  //===== determine rate and r-d cost =====
     1911  m_pcEntropyCoder->resetBits();
     1912  m_pcEntropyCoder->encodeSingleDepthMode( pcCU, 0, true );
     1913  UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits();
     1914
     1915#if H_3D_VSO
     1916  if ( m_pcRdCost->getUseLambdaScaleVSO())
     1917    dRDCost = m_pcRdCost->calcRdCostVSO( uiBits, ruiDist );
     1918  else
     1919#endif
     1920    dRDCost = m_pcRdCost->calcRdCost( uiBits, ruiDist );
     1921}
     1922#endif
    18401923#if H_3D_DIM_SDC
    18411924Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi  )
     
    18871970      UInt dimType   = getDimType  ( uiLumaPredMode );
    18881971      UInt patternID = pcCU->getDmmWedgeTabIdx(dimType, uiAbsPartIdx);
     1972#if SHARP_DMM1_I0110
     1973      UInt uiBaseWidth = pcCU->isDMM1UpscaleMode(uiWidth) ? pcCU->getDMM1BasePatternWidth(uiWidth) : uiWidth;
     1974      if ( patternID >= g_dmmWedgeLists[g_aucConvertToBit[uiBaseWidth]].size() && dimType == DMM1_IDX )
     1975#else
    18891976      if ( patternID >= g_dmmWedgeLists[g_aucConvertToBit[uiWidth]].size() && dimType == DMM1_IDX )
    1890       {
     1977#endif
     1978      {
     1979#if SHARP_DMM1_I0110
     1980        if (g_aucConvertToBit[uiBaseWidth] == 2) // Encoder method. Avoid DMM1 pattern list index exceeds the maximum DMM1 pattern number when SDC split is used.
     1981#else
    18911982        if (g_aucConvertToBit[uiWidth] == 2) // Encoder method. Avoid DMM1 pattern list index exceeds the maximum DMM1 pattern number when SDC split is used.
     1983#endif
    18921984        {                                   
    18931985          patternID = 1349;  // Split 32x32 to 16x16. 1349: Maximum DMM1 pattern number when block size is 16x16
     
    19512043    Int uiTabIdx = pcCU->getDmmWedgeTabIdx(DMM1_IDX, uiAbsPartIdx);
    19522044
     2045#if SHARP_DMM1_I0110
     2046    WedgeList* pacWedgeList  = pcCU->isDMM1UpscaleMode( uiWidth ) ? &g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])] : &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];
     2047#else
    19532048    WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];
     2049#endif
    19542050    TComWedgelet* pcWedgelet = &(pacWedgeList->at( uiTabIdx ));
    19552051
    19562052    uiNumSegments = 2;
     2053#if SHARP_DMM1_I0110
     2054    pbMask       = pcCU->isDMM1UpscaleMode( uiWidth ) ? pcWedgelet->getScaledPattern( uiWidth ) : pcWedgelet->getPattern();
     2055    uiMaskStride = pcCU->isDMM1UpscaleMode( uiWidth ) ? uiWidth : pcWedgelet->getStride();
     2056#else
    19572057    pbMask = pcWedgelet->getPattern();
    19582058    uiMaskStride = pcWedgelet->getStride();
     2059#endif
    19592060  }
    19602061  if( getDimType( uiLumaPredMode ) == DMM4_IDX )
     
    27772878  pcCU->setChromIntraDirSubParts( uiBestMode, 0, pcCU->getDepth( 0 ) );
    27782879}
    2779 
     2880#if MTK_SINGLE_DEPTH_MODE_I0095
    27802881Void
    2781 TEncSearch::estIntraPredQT( TComDataCU* pcCU,
     2882TEncSearch::estIntraPredSingleDepth( TComDataCU* pcCU,
    27822883                           TComYuv*    pcOrgYuv,
    27832884                           TComYuv*    pcPredYuv,
     
    27862887                           UInt&       ruiDistC,
    27872888                           Bool        bLumaOnly )
     2889{
     2890  UInt    uiDepth        = pcCU->getDepth(0);
     2891  UInt    uiWidth        = pcCU->getWidth (0);
     2892  UInt    uiHeight       = pcCU->getHeight(0);
     2893
     2894
     2895  Pel* piOrg         = pcOrgYuv ->getLumaAddr( 0, uiWidth );
     2896  UInt uiStride      = pcPredYuv->getStride();
     2897
     2898  Int index=0;
     2899  Pel testDepth;
     2900  Pel DepthNeighbours[5];
     2901  //construction of depth candidates
     2902  for( Int i = 0; (i < 5)  && (index<MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE) ; i++ )
     2903  {
     2904    if(!pcCU->getNeighDepth (0, 0, &testDepth, i))
     2905    {
     2906      continue;
     2907    }
     2908    DepthNeighbours[index]=testDepth;
     2909    index++;
     2910    for(Int j=0;j<index-1;j++)
     2911    {
     2912      if( (DepthNeighbours[index-1]==DepthNeighbours[j]))
     2913      {
     2914        index--;
     2915        break;
     2916      }
     2917    }
     2918  }
     2919
     2920  if(index==0)
     2921  {
     2922    DepthNeighbours[index]=1<<(g_bitDepthY-1);
     2923    index++;
     2924  }
     2925
     2926  if(index==1)
     2927  {
     2928    DepthNeighbours[index]=ClipY(DepthNeighbours[0] + 1 );
     2929    index++;
     2930  }
     2931
     2932
     2933  Dist   uiDist = 0;
     2934  Double dCost   = 0.0;
     2935  Dist    uiBestDist = 0;
     2936  Double  dBestCost   = MAX_DOUBLE;
     2937  Pel     pBestSingleDepthValue = 0;
     2938
     2939  for( Int testdepthidx = 0; testdepthidx < index ; testdepthidx++ )
     2940  {
     2941      // set context models
     2942      m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] );
     2943
     2944      // determine residual for partition
     2945      uiDist = 0;
     2946      dCost   = 0.0;
     2947#if H_3D_VSO // M36
     2948      if( m_pcRdCost->getUseRenModel() )
     2949      {
     2950        m_pcRdCost->setRenModelData( pcCU, 0, piOrg, uiStride, uiWidth, uiHeight );
     2951      }
     2952#endif
     2953      xIntraCodingSingleDepth(pcCU, 0, pcOrgYuv, pcPredYuv, uiDist, dCost, testdepthidx, DepthNeighbours);
     2954      // check r-d cost
     2955      if( dCost < dBestCost )
     2956      {
     2957        uiBestDist = uiDist;
     2958        dBestCost   = dCost;
     2959        pBestSingleDepthValue = pcCU->getSingleDepthValue(0);
     2960        // copy reconstruction
     2961        pcPredYuv->copyPartToPartYuv(pcRecoYuv, 0, uiWidth, uiHeight);
     2962      }
     2963  } // depth index loop
     2964
     2965
     2966  pcCU->setSingleDepthValueSubParts((Pel)pBestSingleDepthValue,0, 0, uiDepth);
     2967  assert(pBestSingleDepthValue>=0);
     2968
     2969  //===== reset context models =====
     2970  m_pcRDGoOnSbacCoder->load(m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST]);
     2971 
     2972  //===== set distortion (rate and r-d costs are determined later) =====
     2973  pcCU->getTotalDistortion() = uiBestDist;
     2974}
     2975
     2976#endif
     2977Void
     2978TEncSearch::estIntraPredQT( TComDataCU* pcCU,
     2979                            TComYuv*    pcOrgYuv,
     2980                            TComYuv*    pcPredYuv,
     2981                            TComYuv*    pcResiYuv,
     2982                            TComYuv*    pcRecoYuv,
     2983                            UInt&       ruiDistC,
     2984                            Bool        bLumaOnly
     2985#if HHI_DMM4_ENC_I0066
     2986                          , Bool        bOnlyIVP
     2987#endif
     2988                          )
    27882989{
    27892990  UInt    uiDepth        = pcCU->getDepth(0);
     
    28313032    Int numModesForFullRD = g_aucIntraModeNumFast[ uiWidthBit ];
    28323033   
     3034#if HHI_DMM4_ENC_I0066
     3035    if( bOnlyIVP )
     3036    {
     3037      numModesForFullRD = 0;
     3038    }
     3039    else
     3040    {
     3041#endif
    28333042    Bool doFastSearch = (numModesForFullRD != numModesAvailable);
    28343043    if (doFastSearch)
     
    29223131      }
    29233132    }
    2924    
     3133#if HHI_DMM4_ENC_I0066
     3134    }
     3135#endif
     3136
    29253137#if H_3D_DIM
    29263138    //===== determine set of depth intra modes to be tested =====
    29273139    if( m_pcEncCfg->getIsDepth() && uiWidth >= DIM_MIN_SIZE && uiWidth <= DIM_MAX_SIZE && uiWidth == uiHeight )
    29283140    {
    2929 
     3141#if HHI_DMM4_ENC_I0066
     3142#if SEPARATE_FLAG_I0085
     3143      if( bOnlyIVP && m_pcEncCfg->getUseIVP() )
     3144#else
     3145      if( bOnlyIVP )
     3146#endif
     3147      {
     3148        TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
     3149        xPredContourFromTex( pcCU, uiPartOffset, uiWidth, uiHeight, dmm4Segmentation );
     3150
     3151        Pel deltaDC1 = 0; Pel deltaDC2 = 0;
     3152        xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, dmm4Segmentation->getPattern(), dmm4Segmentation->getStride(), uiWidth, uiHeight, deltaDC1, deltaDC2 );
     3153        pcCU->setDimDeltaDC( DMM4_IDX, 0, uiPartOffset, deltaDC1 );
     3154        pcCU->setDimDeltaDC( DMM4_IDX, 1, uiPartOffset, deltaDC2 );
     3155
     3156#if HS_DMM_SIGNALLING_I0120
     3157        uiRdModeList[ numModesForFullRD++ ] = (DMM4_IDX+DIM_OFFSET);
     3158#else
     3159        uiRdModeList[ numModesForFullRD++ ] = (2*DMM4_IDX  +DIM_OFFSET);
     3160        if( deltaDC1 != 0 || deltaDC2 != 0 )
     3161          uiRdModeList[ numModesForFullRD++ ] = (2*DMM4_IDX+1+DIM_OFFSET);
     3162#endif
     3163        dmm4Segmentation->destroy(); delete dmm4Segmentation;
     3164      }
     3165      else
     3166      {
     3167#endif
    29303168#if H_3D_FAST_DEPTH_INTRA
    29313169      Int  threshold    = max(((pcCU->getQP(0))>>3)-1,3);
     
    29353173
    29363174#if H_3D_DIM_DMM
     3175#if SEPARATE_FLAG_I0085
     3176      if( ( m_pcEncCfg->getUseDMM() || m_pcEncCfg->getUseIVP() )
     3177#else
    29373178      if( m_pcEncCfg->getUseDMM()
     3179#endif
    29383180#if H_3D_FAST_DEPTH_INTRA
    29393181         && (uiRdModeList[0] != PLANAR_IDX || varCU >= varThreshold)
     
    29413183        )
    29423184      {
     3185#if SEPARATE_FLAG_I0085
     3186        UInt uiStart, uiEnd;
     3187        if( m_pcEncCfg->getUseDMM() &&  m_pcEncCfg->getUseIVP() )
     3188        {
     3189          uiStart = 0;
     3190          uiEnd   = 2;
     3191        }
     3192        else if( m_pcEncCfg->getUseDMM() )
     3193        {
     3194          uiStart = 0;
     3195          uiEnd   = 1;
     3196        }
     3197        else if( m_pcEncCfg->getUseIVP() )
     3198        {
     3199          uiStart = 1;
     3200          uiEnd   = 2;
     3201        }
     3202        else
     3203        {
     3204          uiStart = 0;
     3205          uiEnd   = 0;
     3206        }
     3207        for( UInt dmmType = uiStart; dmmType < uiEnd; dmmType++ )
     3208#else
    29433209        for( UInt dmmType = 0; dmmType < DMM_NUM_TYPE; dmmType++ )
     3210#endif
    29443211        {
    29453212#if H_3D_FCO
     
    29593226              xSearchDmm1Wedge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight, uiTabIdx );
    29603227              pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dmmType,  uiPartOffset, uiDepth + uiInitTrDepth );
     3228#if SHARP_DMM1_I0110
     3229              biSegmentation = pcCU->isDMM1UpscaleMode( uiWidth ) ?
     3230                  &(g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])][uiTabIdx]) : &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]);
     3231#else
    29613232              biSegmentation = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]);
     3233#endif
    29623234            } break;
    29633235
     
    29743246          if( biSegmentation )
    29753247          {
     3248#if SHARP_DMM1_I0110
     3249            if( dmmType == DMM1_IDX && pcCU->isDMM1UpscaleMode( uiWidth ) ){
     3250                xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, biSegmentation->getScaledPattern(uiWidth), uiWidth, uiWidth, uiHeight, deltaDC1, deltaDC2 );
     3251            }
     3252            else
     3253            {
     3254                xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, biSegmentation->getPattern(), biSegmentation->getStride(), uiWidth, uiHeight, deltaDC1, deltaDC2 );
     3255            }
     3256#else
    29763257            xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, biSegmentation->getPattern(), biSegmentation->getStride(), uiWidth, uiHeight, deltaDC1, deltaDC2 );
     3258#endif
    29773259            pcCU->setDimDeltaDC( dmmType, 0, uiPartOffset, deltaDC1 );
    29783260            pcCU->setDimDeltaDC( dmmType, 1, uiPartOffset, deltaDC2 );
    29793261
     3262#if HS_DMM_SIGNALLING_I0120
     3263            uiRdModeList[ numModesForFullRD++ ] = (dmmType  +DIM_OFFSET);
     3264#else
    29803265            uiRdModeList[ numModesForFullRD++ ] = (2*dmmType  +DIM_OFFSET);
     3266#if HHI_DMM4_ENC_I0066
     3267            if( deltaDC1 != 0 || deltaDC2 != 0 )
     3268#endif
    29813269            uiRdModeList[ numModesForFullRD++ ] = (2*dmmType+1+DIM_OFFSET);
     3270#endif
    29823271
    29833272            if( DMM4_IDX == dmmType ) { biSegmentation->destroy(); delete biSegmentation; }
     
    29853274        }
    29863275      }
     3276#if HHI_DMM4_ENC_I0066
     3277      }
     3278#endif
    29873279#endif
    29883280    }
     
    29953287   
    29963288    UInt    uiBestPUMode  = 0;
     3289#if SCU_HS_FAST_INTRA_SDC_I0123
     3290    UInt    uiBestPUModeConv  = 0;
     3291    UInt    uiSecondBestPUModeConv  = 0;
     3292    UInt    uiThirdBestPUModeConv  = 0;
     3293#endif
     3294
    29973295#if H_3D_VSO
    29983296    Dist    uiBestPUDistY = 0;
     
    30023300    UInt    uiBestPUDistC = 0;
    30033301    Double  dBestPUCost   = MAX_DOUBLE;
     3302
     3303#if SCU_HS_FAST_INTRA_SDC_I0123
     3304    Double  dBestPUCostConv   = MAX_DOUBLE;
     3305    UInt varCU      = m_pcRdCost->calcVAR(piOrg, uiStride, uiWidth,uiHeight,pcCU->getDepth(0));
     3306    UInt rdSDC = m_pcEncCfg->getIsDepth() ? numModesForFullRD : 0;
     3307#endif
     3308
    30043309#if H_3D_DIM_SDC
    30053310    Bool    bBestUseSDC   = false;
    30063311    Pel     apBestDCOffsets[2] = {0,0};
    30073312#endif
     3313#if SCU_HS_FAST_INTRA_SDC_I0123
     3314    for( UInt uiMode = 0; uiMode < numModesForFullRD + rdSDC; uiMode++ )
     3315#else
    30083316    for( UInt uiMode = 0; uiMode < numModesForFullRD; uiMode++ )
     3317#endif
    30093318    {
    30103319      // set luma prediction mode
    3011       UInt uiOrgMode = uiRdModeList[uiMode];
     3320#if !SCU_HS_FAST_INTRA_SDC_I0123
     3321     UInt uiOrgMode = uiRdModeList[uiMode]; 
     3322#endif
    30123323     
     3324#if SCU_HS_FAST_INTRA_SDC_I0123
     3325      UInt uiOrgMode;
     3326      if (uiMode < numModesForFullRD)
     3327      {   
     3328         uiOrgMode = uiRdModeList[uiMode];
     3329      }
     3330      else
     3331      {
     3332           uiOrgMode = uiRdModeList[uiMode - numModesForFullRD];
     3333
     3334           if (uiBestPUModeConv <= 1 )
     3335           {
     3336           if (uiOrgMode > 1 && varCU < 1) continue;         
     3337           }
     3338           else
     3339           {
     3340              if (uiOrgMode != uiBestPUModeConv && uiOrgMode != uiSecondBestPUModeConv && uiOrgMode != uiThirdBestPUModeConv
     3341                  && uiOrgMode > 1 && uiOrgMode < NUM_INTRA_MODE && varCU < 4)
     3342              continue;
     3343           }
     3344       }
     3345#endif
     3346
    30133347      pcCU->setLumaIntraDirSubParts ( uiOrgMode, uiPartOffset, uiDepth + uiInitTrDepth );
    30143348     
    30153349#if H_3D_DIM_SDC
     3350#if SCU_HS_FAST_INTRA_SDC_I0123
     3351      Bool bTestSDC = ( m_pcEncCfg->getUseSDC() && pcCU->getSDCAvailable(uiPartOffset) && uiMode >= numModesForFullRD);
     3352#else
    30163353      Bool bTestSDC = ( m_pcEncCfg->getUseSDC() && pcCU->getSDCAvailable(uiPartOffset) );
     3354#endif
    30173355     
    30183356      for( UInt uiSDC=0; uiSDC<=(bTestSDC?1:0); uiSDC++ )
    30193357      {
     3358#if SCU_HS_FAST_INTRA_SDC_I0123
     3359        if (!uiSDC && uiMode >= numModesForFullRD) continue;
     3360#endif
    30203361        pcCU->setSDCFlagSubParts( (uiSDC != 0), uiPartOffset, uiDepth + uiInitTrDepth );
     3362#if FAST_SDC_OFFSET_DECISION_I0084
     3363        Double dOffsetCost[3] = {MAX_DOUBLE,MAX_DOUBLE,MAX_DOUBLE};
     3364        for( Int iOffset = 1; iOffset <= 5; iOffset++ )
     3365#else
    30213366        for( Int iSDCDeltaResi = -2; iSDCDeltaResi <= 2; iSDCDeltaResi++ )
    3022         {
     3367#endif
     3368        {
     3369#if FAST_SDC_OFFSET_DECISION_I0084
     3370          Int iSDCDeltaResi = 0;
     3371          if(iOffset % 2 == 0)
     3372          {
     3373            iSDCDeltaResi = iOffset >> 1;
     3374          }
     3375          else
     3376          {
     3377            iSDCDeltaResi = -1 * (iOffset >> 1);
     3378          }
     3379#endif
    30233380          if( ( uiSDC == 0 ) && iSDCDeltaResi != 0 )
    30243381          {
    30253382            continue;
    30263383          }
     3384#if FAST_SDC_OFFSET_DECISION_I0084
     3385          if( iOffset > 3)
     3386          {
     3387            if ( dOffsetCost[0] < (0.9*dOffsetCost[1]) && dOffsetCost[0] < (0.9*dOffsetCost[2]) )
     3388            {
     3389              continue;
     3390            }
     3391            if ( dOffsetCost[1] < dOffsetCost[0] && dOffsetCost[0] < dOffsetCost[2] &&  iOffset == 5)
     3392            {
     3393              continue;
     3394            }
     3395            if ( dOffsetCost[0] < dOffsetCost[1] && dOffsetCost[2] < dOffsetCost[0] &&  iOffset == 4)
     3396            {
     3397              continue;
     3398            }
     3399          }
     3400#endif
    30273401#endif
    30283402     
     
    30703444          // start encoding with SDC
    30713445          xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, ( testZeroResi != 0 ), iSDCDeltaResi );
     3446#if FAST_SDC_OFFSET_DECISION_I0084
     3447          if ( testZeroResi == 0 && iOffset <= 3 )
     3448          {
     3449            dOffsetCost [iOffset -1] = dPUCost;
     3450          }
     3451#endif
    30723452        }
    30733453        else
     
    30773457#if H_3D_DIM_ENC
    30783458          xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, true, dPUCost, (testZeroResi != 0) );
     3459#if SCU_HS_FAST_INTRA_SDC_I0123   
     3460      if( dPUCost < dBestPUCostConv )
     3461      {
     3462        uiThirdBestPUModeConv = uiSecondBestPUModeConv;
     3463        uiSecondBestPUModeConv = uiBestPUModeConv;
     3464        uiBestPUModeConv  = uiOrgMode;
     3465        dBestPUCostConv   = dPUCost;
     3466      }
     3467#endif
    30793468#else
    30803469          xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, true, dPUCost );
     
    36204009#if H_3D_VSP
    36214010                                 , Int* vspFlag
     4011#if !FIX_TICKET_79
    36224012                                 , InheritedVSPDisInfo*  inheritedVSPDisInfo
     4013#endif
    36234014#endif
    36244015#if H_3D_SPIVMP
     
    36804071      pcCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand);
    36814072      pcCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours
    3682 #if H_3D_VSP
     4073#if H_3D_VSP && !FIX_TICKET_79
    36834074                                        , inheritedVSPDisInfo
    36844075#endif
     
    37104101    pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand);
    37114102    pcCU->xGetInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours
    3712 #if H_3D_VSP
     4103#if H_3D_VSP && !FIX_TICKET_79
    37134104                                      , inheritedVSPDisInfo
    37144105#endif
     
    37334124#endif
    37344125  }
    3735 #if H_3D_VSP
     4126#if H_3D_VSP && !FIX_TICKET_75
    37364127  xRestrictBipredMergeCand( pcCU, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours,vspFlag, numValidMergeCand );
    37374128#else
     
    37654156#if H_3D_VSP
    37664157    pcCU->setVSPFlagSubParts( vspFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
     4158#if !FIX_TICKET_79
    37674159    pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
     4160#endif
    37684161#endif
    37694162
     
    38654258 * \returns Void
    38664259 */
    3867 #if H_3D_VSP
     4260#if H_3D_VSP && !FIX_TICKET_75
    38684261Void TEncSearch::xRestrictBipredMergeCand( TComDataCU* pcCU, UInt puIdx, TComMvField* mvFieldNeighbours, UChar* interDirNeighbours, Int* vspFlag, Int numValidMergeCand )
    38694262#else
     
    38754268    for( UInt mergeCand = 0; mergeCand < numValidMergeCand; ++mergeCand )
    38764269    {
    3877 #if H_3D_VSP
     4270#if H_3D_VSP && !FIX_TICKET_75
    38784271      if ( (interDirNeighbours[mergeCand] == 3) && (vspFlag[mergeCand] == false) )
    38794272#else
     
    45014894      Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    45024895      memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
     4896#if !FIX_TICKET_79
    45034897      InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
     4898#endif
    45044899      UInt uiAbsPartIdx = 0;
    45054900      Int iWidth = 0;
     
    45194914#if H_3D_VSP
    45204915                      , vspFlag
     4916#if !FIX_TICKET_79
    45214917                      , inheritedVSPDisInfo
     4918#endif
    45224919#endif
    45234920#if H_3D_SPIVMP
     
    45334930#if H_3D_VSP
    45344931        pcCU->setVSPFlagSubParts( vspFlag[uiMRGIndex], uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
     4932#if !FIX_TICKET_79
    45354933        pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMRGIndex].m_acDvInfo, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
     4934#endif
    45364935#endif
    45374936#if H_3D_DDD
     
    69817380    }
    69827381    m_pcEntropyCoder->encodeSkipFlag ( pcCU, 0, true );
     7382#if MTK_SINGLE_DEPTH_MODE_I0095
     7383    m_pcEntropyCoder->encodeSingleDepthMode ( pcCU, 0, true );
     7384#endif
    69837385    m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
    69847386    m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true );
     
    74357837
    74367838  Pel refDC1 = 0; Pel refDC2 = 0;
     7839#if SHARP_DMM1_I0110
     7840  WedgeList*     pacWedgeList     = pcCU->isDMM1UpscaleMode( uiWidth ) ? &g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])] : &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];
     7841  WedgeNodeList* pacWedgeNodeList = pcCU->isDMM1UpscaleMode( uiWidth ) ? &g_dmmWedgeNodeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])] : &g_dmmWedgeNodeLists[(g_aucConvertToBit[uiWidth])];
     7842#else
    74377843  WedgeList*     pacWedgeList     = &g_dmmWedgeLists    [(g_aucConvertToBit[uiWidth])];
    74387844  WedgeNodeList* pacWedgeNodeList = &g_dmmWedgeNodeLists[(g_aucConvertToBit[uiWidth])];
     7845#endif
    74397846
    74407847  // coarse wedge search
     
    74447851  {
    74457852    TComWedgelet* pcWedgelet = &(pacWedgeList->at(pacWedgeNodeList->at(uiNodeId).getPatternIdx()));
     7853#if SHARP_DMM1_I0110
     7854    Bool *pbPattern = pcCU->isDMM1UpscaleMode(uiWidth) ? pcWedgelet->getScaledPattern(uiWidth) : pcWedgelet->getPattern();
     7855    UInt uiStride   = pcCU->isDMM1UpscaleMode(uiWidth) ? uiWidth : pcWedgelet->getStride();
     7856    xCalcBiSegDCs  ( piRef,  uiRefStride,  pbPattern, uiStride, refDC1, refDC2 );
     7857    xAssignBiSegDCs( piPred, uiPredStride, pbPattern, uiStride, refDC1, refDC2 );
     7858#else
    74467859    xCalcBiSegDCs  ( piRef,  uiRefStride,  pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
    74477860    xAssignBiSegDCs( piPred, uiPredStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
     7861#endif
    74487862
    74497863    Dist uiActDist = RDO_DIST_MAX;
     
    74817895    {
    74827896      TComWedgelet* pcWedgelet = &(pacWedgeList->at(pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId )));
     7897#if SHARP_DMM1_I0110
     7898      Bool *pbPattern = pcCU->isDMM1UpscaleMode(uiWidth) ? pcWedgelet->getScaledPattern(uiWidth) : pcWedgelet->getPattern();
     7899      UInt uiStride   = pcCU->isDMM1UpscaleMode(uiWidth) ? uiWidth : pcWedgelet->getStride();
     7900      xCalcBiSegDCs  ( piRef,  uiRefStride,  pbPattern, uiStride, refDC1, refDC2 );
     7901      xAssignBiSegDCs( piPred, uiPredStride, pbPattern, uiStride, refDC1, refDC2 );
     7902#else
    74837903      xCalcBiSegDCs  ( piRef,  uiRefStride,  pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
    74847904      xAssignBiSegDCs( piPred, uiPredStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
    7485 
     7905#endif
    74867906      Dist uiActDist = RDO_DIST_MAX;
    74877907#if H_3D_VSO
  • trunk/source/Lib/TLibEncoder/TEncSearch.h

    r884 r1039  
    180180                                  TComYuv*    pcRecoYuv,
    181181                                  UInt&       ruiDistC,
    182                                   Bool        bLumaOnly );
     182                                  Bool        bLumaOnly
     183#if HHI_DMM4_ENC_I0066
     184                                , Bool        bOnlyIVP
     185#endif
     186                                );
    183187  Void  estIntraPredChromaQT    ( TComDataCU* pcCU,
    184188                                  TComYuv*    pcOrgYuv,
     
    187191                                  TComYuv*    pcRecoYuv,
    188192                                  UInt        uiPreCalcDistC );
    189  
     193#if MTK_SINGLE_DEPTH_MODE_I0095
     194  Void  estIntraPredSingleDepth  ( TComDataCU* pcCU,
     195                                  TComYuv*    pcOrgYuv,
     196                                  TComYuv*    pcPredYuv,
     197                                  TComYuv*    pcResiYuv,
     198                                  TComYuv*    pcRecoYuv,
     199                                  UInt&       ruiDistC,
     200                                  Bool        bLumaOnly );
     201#endif   
    190202 
    191203  /// encoder estimation - inter prediction (non-skip)
     
    342354                                    UInt         uiAbsPartIdx,
    343355                                    UInt         stateU0V1Both2 );
    344 
     356#if MTK_SINGLE_DEPTH_MODE_I0095
     357  Void xIntraCodingSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Int iTestDepthIdx, Pel * DepthNeighbor );
     358#endif
    345359#if H_3D_DIM
    346360  // -------------------------------------------------------------------------------------------------------------------
     
    415429#if H_3D_VSP
    416430                                  , Int* vspFlag
     431#if !FIX_TICKET_79
    417432                                  , InheritedVSPDisInfo*  inheritedVSPDisInfo
     433#endif
    418434#endif
    419435#if H_3D_SPIVMP
     
    427443                                    TComMvField*    mvFieldNeighbours,
    428444                                    UChar*          interDirNeighbours,
    429 #if H_3D_VSP
     445#if H_3D_VSP && !FIX_TICKET_75
    430446                                    Int* vspFlag,
    431447#endif
  • trunk/source/Lib/TLibEncoder/TEncTop.cpp

    r976 r1039  
    744744  m_cSPS.setUseAMP ( m_useAMP );
    745745
     746#if !MTK_I0099_VPS_EX2
    746747#if H_3D_QTLPC
    747748  m_cSPS.setUseQTL( m_bUseQTL );
    748749  m_cSPS.setUsePC ( m_bUsePC  );
     750#endif
    749751#endif
    750752
Note: See TracChangeset for help on using the changeset viewer.