Changeset 1039 in 3DVCSoftware


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

Merged 11.2-dev0@1038.

Location:
trunk
Files:
44 edited

Legend:

Unmodified
Added
Removed
  • trunk/cfg/3D-HEVC/NonCTC/allintra/baseCfg_2view+depth_AllIntra.cfg

    r872 r1039  
    173173VSO                       : 1                                      # use of view synthesis optimization for depth coding
    174174DMM                                : 1
     175IVP                                : 1                 # use of intra-view prediction mode
    175176SDC                                : 1
    176177DLT                                : 1
     
    179180InterSDC                           : 1                             # use of inter sdc
    180181MPI                                : 1
    181 
     182SingleDepthMode                    : 1                 # use of single depth mode
    182183#========== view synthesis optimization (VSO) ==========
    183184
  • trunk/cfg/3D-HEVC/NonCTC/allintra/baseCfg_3view+depth_AllIntra.cfg

    r872 r1039  
    188188VSO                       : 1                                      # use of view synthesis optimization for depth coding
    189189DMM                                : 1
     190IVP                                : 1                 # use of intra-view prediction mode
    190191SDC                                : 1
    191192DLT                                : 1
     
    194195InterSDC                           : 1                             # use of inter sdc
    195196MPI                                : 1
    196 
     197SingleDepthMode                    : 1                 # use of single depth mode
    197198#========== view synthesis optimization (VSO) ==========
    198199VSOConfig                 : [cx0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) B(oo2) I(s0.25 s0.5 s0.75 s1.25 s1.5 s1.75)][cx2 B(cc1) I(s1.25 s1.5 s1.75)] # VSO configuration string
  • trunk/cfg/3D-HEVC/baseCfg_2view+depth.cfg

    r950 r1039  
    209209VSO                                : 1                 # use of view synthesis optimization for depth coding
    210210DMM                                : 1
     211IVP                                : 1                 # use of intra-view prediction mode
    211212SDC                                : 1
    212213DLT                                : 1
     
    215216InterSDC                           : 1                             # use of inter sdc
    216217MPI                                : 1
    217 
     218SingleDepthMode                    : 1                 # use of single depth mode
    218219#========== view synthesis optimization (VSO) ==========
    219220
  • trunk/cfg/3D-HEVC/baseCfg_3view+depth.cfg

    r950 r1039  
    240240VSO                                : 1                 # use of view synthesis optimization for depth coding
    241241DMM                                : 1
     242IVP                                : 1                 # use of intra-view prediction mode
    242243SDC                                : 1
    243244DLT                                : 1
     
    246247InterSDC                           : 1                             # use of inter sdc
    247248MPI                                : 1
    248 
     249SingleDepthMode                    : 1                 # use of single depth mode
    249250#========== view synthesis optimization (VSO) ==========
    250251VSOConfig                 : [cx0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) B(oo2) I(s0.25 s0.5 s0.75 s1.25 s1.5 s1.75)][cx2 B(cc1) I(s1.25 s1.5 s1.75)] # VSO configuration string
  • trunk/cfg/3D-HEVC/fullCfg.cfg

    r950 r1039  
    262262VSO                       : 1                          # use of view synthesis optimization for depth coding
    263263DMM                                : 1
     264IVP                                : 1                 # use of intra-view prediction mode
    264265SDC                                : 1
    265266DLT                                : 1
  • trunk/source/App/TAppEncoder/TAppEncCfg.cpp

    r976 r1039  
    378378#if H_3D_DIM
    379379  ("DMM",                   m_useDMM,           true,  "Depth intra model modes")
     380#if SEPARATE_FLAG_I0085
     381  ("IVP",                   m_useIVP,           true,  "intra-view prediction")
     382#endif
    380383  ("SDC",                   m_useSDC,           true,  "Simplified depth coding")
    381384  ("DLT",                   m_useDLT,           true,  "Depth lookup table")
     385#endif
     386#if MTK_SINGLE_DEPTH_MODE_I0095
     387  ("SingleDepthMode",    m_useSingleDepthMode, true, "Single depth mode")                         
    382388#endif
    383389#endif
     
    761767
    762768#endif //HHI_VSO
     769#if MTK_I0099_VPS_EX2
     770  ("LimQtPredFlag",                   m_bLimQtPredFlag          , true          , "Use Predictive Coding with QTL" )
     771#endif
     772#if !MTK_I0099_VPS_EX2 || MTK_I0099_FIX
    763773#if H_3D_QTLPC
    764774  ("QTL",                             m_bUseQTL                 , true          , "Use depth Quadtree Limitation" )
     775#if !MTK_I0099_VPS_EX2
    765776  ("PC",                              m_bUsePC                  , true          , "Use Predictive Coding with QTL" )
     777#endif
     778#endif
    766779#endif
    767780#if H_3D_IV_MERGE
     
    14021415    for ( Int i = 0; i < m_layerIdsInSets[lsIdx].size(); i++ )
    14031416    {
     1417#if FIX_TICKET_61
     1418      xConfirmPara( m_layerIdsInSets[lsIdx][i] < 0 || m_layerIdsInSets[lsIdx][i] >= MAX_NUM_LAYER_IDS, "LayerIdsInSet must be greater than 0 and less than MAX_NUM_LAYER_IDS" );
     1419#else
    14041420      xConfirmPara( m_layerIdsInSets[lsIdx][i] < 0 || m_layerIdsInSets[lsIdx].size() >= MAX_NUM_LAYER_IDS, "LayerIdsInSet must be greater than and less than MAX_NUM_LAYER_IDS" );
     1421#endif
    14051422    }
    14061423  }
     
    24912508  printf("WVSO:%d ", m_bUseWVSO ); 
    24922509#endif
     2510#if MTK_I0099_VPS_EX2
     2511  printf("LimQtPredFlag:%d ", m_bLimQtPredFlag ? 1 : 0);
     2512#endif
     2513#if !MTK_I0099_VPS_EX2 || MTK_I0099_FIX
    24932514#if H_3D_QTLPC
    24942515  printf("QTL:%d ", m_bUseQTL);
     2516#if !MTK_I0099_VPS_EX2
    24952517  printf("PC:%d " , m_bUsePC );
     2518#endif
     2519#endif
    24962520#endif
    24972521#if H_3D_IV_MERGE
     
    25202544#if H_3D_DIM
    25212545  printf("DMM:%d ", m_useDMM );
     2546#if SEPARATE_FLAG_I0085
     2547  printf("IVP:%d ", m_useIVP );
     2548#endif
    25222549  printf("SDC:%d ", m_useSDC );
    25232550  printf("DLT:%d ", m_useDLT );
     2551#endif
     2552#if MTK_SINGLE_DEPTH_MODE_I0095
     2553  printf("SingleDepthMode:%d ",    m_useSingleDepthMode);
    25242554#endif
    25252555#if H_3D_INTER_SDC
  • trunk/source/App/TAppEncoder/TAppEncCfg.h

    r976 r1039  
    131131  Int                    m_iSubPUMPILog2Size;                   
    132132#endif
     133#endif
     134#if MTK_I0099_VPS_EX2
     135  Bool                   m_bLimQtPredFlag;
    133136#endif
    134137#if H_3D_ARP                                                  /// < flag and number of weighting factors in ARP
     
    470473#if H_3D_DIM
    471474  Bool      m_useDMM;                                        ///< flag for using DMM
     475#if SEPARATE_FLAG_I0085
     476  Bool      m_useIVP;
     477#endif
    472478  Bool      m_useSDC;                                        ///< flag for using SDC
    473479  Bool      m_useDLT;                                        ///< flag for using DLT
    474480#endif
     481#if MTK_SINGLE_DEPTH_MODE_I0095
     482  Bool     m_useSingleDepthMode;                          ///< flag for using single depth mode
     483#endif
     484#if !MTK_I0099_VPS_EX2 || MTK_I0099_FIX
    475485#if H_3D_QTLPC
    476486  Bool      m_bUseQTL;                                        ///< flag for using depth QuadTree Limitation
     487#if !MTK_I0099_VPS_EX2
    477488  Bool      m_bUsePC;                                         ///< flag for using Predictive Coding with QTL
     489#endif
     490#endif
    478491#endif
    479492#if H_3D_INTER_SDC
  • trunk/source/App/TAppEncoder/TAppEncTop.cpp

    r976 r1039  
    199199#if H_3D_DIM
    200200    m_cTEncTop.setUseDMM                       ( isDepth ? m_useDMM               : false );
     201#if SEPARATE_FLAG_I0085
     202    m_cTEncTop.setUseIVP                       ( isDepth ? m_useIVP               : false );
     203#endif
    201204    m_cTEncTop.setUseSDC                       ( isDepth ? m_useSDC               : false );
    202205    m_cTEncTop.setUseDLT                       ( isDepth ? m_useDLT               : false );
    203206#endif
     207#if MTK_SINGLE_DEPTH_MODE_I0095
     208    m_cTEncTop.setUseSingleDepthMode           ( isDepth ? m_useSingleDepthMode   : false );
     209#endif
     210#if !MTK_I0099_VPS_EX2 || MTK_I0099_FIX
    204211#if H_3D_QTLPC
    205212    m_cTEncTop.setUseQTL                       ( isDepth ? m_bUseQTL               : false );
     213#if !MTK_I0099_VPS_EX2   
    206214    m_cTEncTop.setUsePC                        ( isDepth ? m_bUsePC                : false );
     215#endif
     216#endif
    207217#endif
    208218    //====== Depth Inter SDC =========
     
    18151825    {
    18161826      vps.setSubPULog2Size         ( layer, (layer != 1) ? 6: 0 );
     1827#if MTK_I0099_VPS_EX2
     1828      vps.setSubPUMPILog2Size      ( layer, (!isLayerZero) ? m_iSubPUMPILog2Size: 0 );
     1829#endif
    18171830    }
    18181831    else
     
    18241837#if H_3D_DIM
    18251838    vps.setVpsDepthModesFlag( layer, isDepth && !isLayerZero && (m_useDMM || m_useSDC || m_useDLT ) );
     1839#if SEPARATE_FLAG_I0085
     1840    vps.setIVPFlag          ( layer, isDepth && !isLayerZero && m_useIVP );
     1841#endif
    18261842#endif
    18271843
     
    18301846    {
    18311847      vps.setIvMvPredFlag    (layer, false);
     1848#if SEC_HLS_CLEANUP_I0100
     1849      vps.setIvMvScalingFlag (layer, false);
     1850#endif
    18321851    }
    18331852    else
     
    18411860        vps.setIvMvPredFlag         ( layer, !isLayerZero && m_ivMvPredFlag[0] );
    18421861      }
    1843     }
     1862#if SEC_HLS_CLEANUP_I0100
     1863      vps.setIvMvScalingFlag (layer, m_ivMvScalingFlag);
     1864#endif
     1865    }
     1866#endif
     1867#if MTK_I0099_VPS_EX2
     1868    vps.setLimQtPredFlag         ( layer, isDepth && m_bLimQtPredFlag );
    18441869#endif
    18451870#if H_3D_NBDV_REF
     
    18591884#endif
    18601885  } 
     1886#if !MTK_I0099_VPS_EX2
    18611887#if H_3D_SPIVMP
    18621888  vps.setSubPUMPILog2Size( m_iSubPUMPILog2Size );
    18631889#endif
     1890#endif
    18641891#if H_3D
     1892#if !SEC_HLS_CLEANUP_I0100
    18651893  vps.setIvMvScalingFlag( m_ivMvScalingFlag );   
     1894#endif
    18661895#endif
    18671896}
  • trunk/source/Lib/TAppCommon/program_options_lite.h

    r872 r1039  
    378378        std::string cDescBuffer;
    379379
     380#if !FIX_TICKET_62
    380381        cNameBuffer       .resize( name.size() + 10 );
    381382        cDescBuffer.resize( desc.size() + 10 );
     383#endif
    382384
    383385        storage.resize(uiMaxNum);
    384386        for ( unsigned int uiK = 0; uiK < uiMaxNum; uiK++ )
    385387        {
     388
     389#if FIX_TICKET_62
     390          cNameBuffer       .resize( name.size() + 10 );
     391          cDescBuffer.resize( desc.size() + 10 );
     392#endif
     393
    386394          Bool duplicate = (uiK != 0);
    387395          // isn't there are sprintf function for string??
  • trunk/source/Lib/TLibCommon/ContextTables.h

    r976 r1039  
    5151#define NUM_SPLIT_FLAG_CTX            3       ///< number of context models for split flag
    5252#define NUM_SKIP_FLAG_CTX             3       ///< number of context models for skip flag
    53 
     53#if MTK_SINGLE_DEPTH_MODE_I0095
     54#define NUM_SINGLEDEPTH_FLAG_CTX                     1
     55#define NUM_SINGLE_DEPTH_VALUE_DATA_CTX              1       
     56#endif
    5457#define NUM_MERGE_FLAG_EXT_CTX        1       ///< number of context models for merge flag of merge extended
    5558#define NUM_MERGE_IDX_EXT_CTX         1       ///< number of context models for merge index of merge extended
     
    150153  { CNU,  CNU,  CNU, },
    151154};
    152 
     155#if MTK_SINGLE_DEPTH_MODE_I0095
     156static const UChar
     157INIT_SINGLEDEPTH_FLAG[3][NUM_SINGLEDEPTH_FLAG_CTX] = 
     158{
     159  { 185 },
     160  { 185 },
     161  { 185 },
     162};
     163static const UChar
     164INIT_SINGLE_DEPTH_VALUE_DATA[3][NUM_SINGLE_DEPTH_VALUE_DATA_CTX] =
     165{
     166  { 137 },
     167  { 137 },
     168  { 137 },
     169};
     170#endif
    153171static const UChar
    154172INIT_MERGE_FLAG_EXT[3][NUM_MERGE_FLAG_EXT_CTX] =
     
    432450static const UChar INIT_DBBP_FLAG[3][DBBP_NUM_FLAG_CTX] =
    433451{
     452#if SEC_DBBP_EXPLICIT_SIG_I0077
     453  { CNU },
     454  { CNU },
     455  { CNU },
     456#else
    434457  { 161 },
    435458  { 161 },
    436459  { 161 },
    437 };
    438 #endif
    439 
    440 #endif
     460#endif
     461};
     462#endif
     463
     464#endif
  • trunk/source/Lib/TLibCommon/TComDataCU.cpp

    r976 r1039  
    6060 
    6161  m_skipFlag           = NULL;
    62 
     62#if MTK_SINGLE_DEPTH_MODE_I0095
     63  m_singleDepthFlag     = NULL;
     64  m_apSingleDepthValue  = NULL;
     65#endif 
    6366  m_pePartSize         = NULL;
    6467  m_pePredMode         = NULL;
     
    182185
    183186    m_skipFlag           = new Bool[ uiNumPartition ];
    184 
     187#if MTK_SINGLE_DEPTH_MODE_I0095
     188    m_singleDepthFlag     = new Bool[ uiNumPartition ];
     189    m_apSingleDepthValue  = (Pel*)xMalloc(Pel, uiNumPartition);
     190#endif
    185191    m_pePartSize         = new Char[ uiNumPartition ];
    186192    memset( m_pePartSize, SIZE_NONE,uiNumPartition * sizeof( *m_pePartSize ) );
     
    329335
    330336    if ( m_skipFlag           ) { delete[] m_skipFlag;          m_skipFlag          = NULL; }
    331 
     337#if MTK_SINGLE_DEPTH_MODE_I0095
     338    if ( m_singleDepthFlag    ) { delete[] m_singleDepthFlag;   m_singleDepthFlag     = NULL; }
     339    if ( m_apSingleDepthValue ) { xFree(m_apSingleDepthValue);  m_apSingleDepthValue  = NULL; }
     340#endif
    332341    if ( m_pePartSize         ) { delete[] m_pePartSize;        m_pePartSize        = NULL; }
    333342    if ( m_pePredMode         ) { delete[] m_pePredMode;        m_pePredMode        = NULL; }
     
    494503    TComDataCU * pcFrom = pcPic->getCU(getAddr());
    495504    m_skipFlag[ui]   = pcFrom->getSkipFlag(ui);
     505#if MTK_SINGLE_DEPTH_MODE_I0095
     506    m_singleDepthFlag[ui]    = pcFrom->getSingleDepthFlag(ui);
     507    m_apSingleDepthValue[ui] = pcFrom->getSingleDepthValue(ui);
     508#endif
    496509    m_pePartSize[ui] = pcFrom->getPartitionSize(ui);
    497510    m_pePredMode[ui] = pcFrom->getPredictionMode(ui);
     
    550563  {
    551564    memset( m_skipFlag          + firstElement, false,                    numElements * sizeof( *m_skipFlag ) );
    552 
     565#if MTK_SINGLE_DEPTH_MODE_I0095
     566    memset( m_singleDepthFlag     + firstElement, false,                  numElements * sizeof( *m_singleDepthFlag ) );
     567    memset( m_apSingleDepthValue  + firstElement,     0,                  numElements * sizeof( *m_apSingleDepthValue ) );
     568#endif
    553569    memset( m_pePartSize        + firstElement, SIZE_NONE,                numElements * sizeof( *m_pePartSize ) );
    554570    memset( m_pePredMode        + firstElement, MODE_NONE,                numElements * sizeof( *m_pePredMode ) );
     
    738754      m_puhTransformSkip[2][ui] = 0;
    739755      m_skipFlag[ui]   = false;
     756#if MTK_SINGLE_DEPTH_MODE_I0095
     757      m_singleDepthFlag[ui]     = false;
     758      m_apSingleDepthValue[ui]  = 0;
     759#endif
    740760      m_pePartSize[ui] = SIZE_NONE;
    741761      m_pePredMode[ui] = MODE_NONE;
     
    913933  {
    914934    m_skipFlag[ui]   = false;
     935#if MTK_SINGLE_DEPTH_MODE_I0095
     936    m_singleDepthFlag[ui]   = false;
     937    m_apSingleDepthValue[ui]= 0;
     938#endif
    915939    m_pePartSize[ui] = SIZE_NONE;
    916940    m_pePredMode[ui] = MODE_NONE;
     
    934958      m_puhTransformSkip[2][ui] = pcCU->getTransformSkip(uiPartOffset+ui,TEXT_CHROMA_V);
    935959      m_skipFlag[ui]   = pcCU->getSkipFlag(uiPartOffset+ui);
     960#if MTK_SINGLE_DEPTH_MODE_I0095
     961      m_singleDepthFlag[ui]    = pcCU->getSingleDepthFlag(uiPartOffset+ui);
     962      m_apSingleDepthValue[ui] = pcCU->getSingleDepthValue(uiPartOffset+ui);
     963#endif
    936964      m_pePartSize[ui] = pcCU->getPartitionSize(uiPartOffset+ui);
    937965      m_pePredMode[ui] = pcCU->getPredictionMode(uiPartOffset+ui);
     
    10831111 
    10841112  m_skipFlag=pcCU->getSkipFlag()          + uiPart;
    1085 
     1113#if MTK_SINGLE_DEPTH_MODE_I0095
     1114  m_singleDepthFlag     = pcCU->getSingleDepthFlag()   + uiPart;
     1115  m_apSingleDepthValue  = pcCU->getSingleDepthValue()  + uiPart;
     1116#endif 
    10861117  m_phQP=pcCU->getQP()                    + uiPart;
    10871118  m_pePartSize = pcCU->getPartitionSize() + uiPart;
     
    12211252 
    12221253  m_skipFlag           = pcCU->getSkipFlag ()             + uiAbsPartIdx;
    1223 
     1254#if MTK_SINGLE_DEPTH_MODE_I0095
     1255  m_singleDepthFlag     = pcCU->getSingleDepthFlag ()             + uiAbsPartIdx;
     1256  m_apSingleDepthValue  = pcCU->getSingleDepthValue ()            + uiAbsPartIdx;
     1257#endif 
    12241258  m_pePartSize         = pcCU->getPartitionSize ()        + uiAbsPartIdx;
    12251259#if H_3D_NBDV
     
    12971331  Int sizeInChar  = sizeof( Char ) * uiNumPartition;
    12981332  memcpy( m_skipFlag   + uiOffset, pcCU->getSkipFlag(),       sizeof( *m_skipFlag )   * uiNumPartition );
     1333#if MTK_SINGLE_DEPTH_MODE_I0095
     1334  memcpy( m_singleDepthFlag     + uiOffset, pcCU->getSingleDepthFlag(),       sizeof( *m_singleDepthFlag )   * uiNumPartition );
     1335  memcpy( m_apSingleDepthValue  + uiOffset, pcCU->getSingleDepthValue(),      sizeof( *m_apSingleDepthValue ) * uiNumPartition);
     1336#endif
    12991337  memcpy( m_phQP       + uiOffset, pcCU->getQP(),             sizeInChar                        );
    13001338  memcpy( m_pePartSize + uiOffset, pcCU->getPartitionSize(),  sizeof( *m_pePartSize ) * uiNumPartition );
     
    14171455
    14181456  memcpy( rpcCU->getSkipFlag() + m_uiAbsIdxInLCU, m_skipFlag, sizeof( *m_skipFlag ) * m_uiNumPartition );
    1419 
     1457#if MTK_SINGLE_DEPTH_MODE_I0095
     1458  memcpy( rpcCU->getSingleDepthFlag()  + m_uiAbsIdxInLCU, m_singleDepthFlag,    sizeof( *m_singleDepthFlag ) * m_uiNumPartition );
     1459  memcpy( rpcCU->getSingleDepthValue() + m_uiAbsIdxInLCU, m_apSingleDepthValue, sizeof( *m_apSingleDepthValue ) * m_uiNumPartition);
     1460#endif
    14201461  memcpy( rpcCU->getQP() + m_uiAbsIdxInLCU, m_phQP, sizeInChar  );
    14211462#if H_3D_NBDV
     
    15331574  Int sizeInChar  = sizeof( Char ) * uiQNumPart;
    15341575  memcpy( rpcCU->getSkipFlag()       + uiPartOffset, m_skipFlag,   sizeof( *m_skipFlag )   * uiQNumPart );
    1535 
     1576#if MTK_SINGLE_DEPTH_MODE_I0095
     1577  memcpy( rpcCU->getSingleDepthFlag()  + uiPartOffset, m_singleDepthFlag,    sizeof( *m_singleDepthFlag )   * uiQNumPart );
     1578  memcpy( rpcCU->getSingleDepthValue() + uiPartOffset, m_apSingleDepthValue, sizeof( *m_apSingleDepthValue ) * uiQNumPart);
     1579#endif
    15361580  memcpy( rpcCU->getQP() + uiPartOffset, m_phQP, sizeInChar );
    15371581  memcpy( rpcCU->getPartitionSize()  + uiPartOffset, m_pePartSize, sizeof( *m_pePartSize ) * uiQNumPart );
     
    24532497  memset( m_skipFlag + absPartIdx, skip, m_pcPic->getNumPartInCU() >> ( 2 * depth ) );
    24542498}
    2455 
     2499#if MTK_SINGLE_DEPTH_MODE_I0095
     2500Void TComDataCU::setSingleDepthFlagSubParts( Bool singleDepth, UInt absPartIdx, UInt depth )
     2501{
     2502  assert( sizeof( *m_singleDepthFlag) == 1 );
     2503  memset( m_singleDepthFlag + absPartIdx, singleDepth, m_pcPic->getNumPartInCU() >> ( 2 * depth ) );
     2504}
     2505
     2506Void TComDataCU::setSingleDepthValueSubParts(Pel singleDepthValue, UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth )
     2507{
     2508  setSubPartT<Pel>( singleDepthValue, m_apSingleDepthValue, uiAbsPartIdx, uiDepth, uiPUIdx );
     2509}
     2510#endif
    24562511Void TComDataCU::setPredModeSubParts( PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth )
    24572512{
     
    26222677  }
    26232678
     2679#if HS_DMM_SIGNALLING_I0120
     2680  if( isDimMode( getLumaIntraDir( uiAbsPartIdx ) ) )
     2681#else
    26242682  if( isDimMode( getLumaIntraDir( uiAbsPartIdx ) ) && !isDimDeltaDC( getLumaIntraDir( uiAbsPartIdx ) ) )
     2683#endif
    26252684  {
    26262685    return true;
     
    26352694  // check prediction mode
    26362695  UInt uiLumaPredMode = getLumaIntraDir( uiAbsPartIdx ); 
     2696#if HS_DMM_SIGNALLING_I0120
     2697  if( uiLumaPredMode == PLANAR_IDX || ( getDimType( uiLumaPredMode ) == DMM1_IDX  ) )
     2698#else
    26372699  if( uiLumaPredMode == PLANAR_IDX || ( getDimType( uiLumaPredMode ) == DMM1_IDX && !isDimDeltaDC( uiLumaPredMode ) ) )
     2700#endif
    26382701    return true;
    26392702 
     
    33103373  for(Int iLoop = 0; iLoop < 2; iLoop ++ )
    33113374  {
     3375#if !SEC_SIMP_SHIFTED_DV_I0086
    33123376    // IvDcShift (Derived from spatial Iv neighboring blocks)
    33133377    if( iLoop == 1 )
     
    33433407      }
    33443408    }
     3409#endif
    33453410
    33463411    /// iLoop = 0 --> IvMCShift
     
    33903455}
    33913456
     3457#if !SEC_SIMP_SHIFTED_DV_I0086
    33923458inline Bool TComDataCU::xGetPosFirstAvailDmvCand(Int iCount, Int& posFirstAvailDmvCand )
    33933459{
     
    34063472  return false; 
    34073473}
     3474#endif
    34083475                                     
    34093476#endif
     
    38543921Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours
    38553922#endif
    3856 #if H_3D_VSP
     3923#if H_3D_VSP && !FIX_TICKET_79
    38573924      , InheritedVSPDisInfo*  inheritedVSPDisInfo
    38583925#endif
     
    38843951  //////////////////////////////////
    38853952  DisInfo cDisInfo = getDvInfo(uiAbsPartIdx);
     3953#if !FIX_TICKET_79
    38863954  for(Int i = 0; i < MRG_MAX_NUM_CANDS_MEM; i++)
    38873955  {
    38883956    inheritedVSPDisInfo[i].m_acDvInfo = cDisInfo;   // To prevent run-time error, this code must be executed always for merging process.
    38893957  }
     3958#endif
    38903959  m_cDefaultDisInfo = cDisInfo;
    38913960
     
    41784247                TComMv cMv = cDefaultMvField.getMv() + cMvRounding;
    41794248                cMv >>= 2;
     4249#if !FIX_TICKET_68
    41804250                clipMv( cMv );
     4251#endif
    41814252                cMvFieldSaved[eCurrRefPicList].setMvField(cMv, iRefPicList) ;
    41824253                break;
     
    52505321#endif
    52515322
    5252 
     5323#if !FIX_TICKET_76
    52535324#if H_3D_VSP
    52545325inline Void TComDataCU::xInheritVSPDisInfo(TComDataCU* pcCURef, UInt uiAbsPartIdx, Int iCount, InheritedVSPDisInfo*  inheritedVSPDisInfo)
     
    52575328  inheritedVSPDisInfo[iCount].m_acDvInfo.m_aVIdxCan = pcCURef->getDvInfo(uiAbsPartIdx).m_aVIdxCan;
    52585329}
     5330#endif
    52595331#endif
    52605332/** Check whether the current PU and a spatial neighboring PU are in a same ME region.
     
    59005972    Int iColRefViewId  = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewIndex();
    59015973    iScale = xGetDistScaleFactor( iCurrViewId, iCurrRefViewId, iColViewId, iColRefViewId );
     5974#if SEC_HLS_CLEANUP_I0100
     5975    if ( iScale != 4096 && m_pcSlice->getVPS()->getIvMvScalingFlag(getSlice()->getLayerIdInVps()) )
     5976#else
    59025977    if ( iScale != 4096 && m_pcSlice->getVPS()->getIvMvScalingFlag() )
     5978#endif
    59035979    {
    59045980      rcMv = cColMv.scaleMv( iScale );
     
    60836159
    60846160  TComMv cMv;
     6161#if MTK_I0093
     6162  Int iDisp     = getSlice()->getDepthToDisparityB( 0 )[ 1 << ( getSlice()->getSPS()->getBitDepthY() - 1 ) ];
     6163#else
    60856164  Int iDisp     = getSlice()->getDepthToDisparityB( 0 )[ 128 ];
     6165#endif
    60866166  cMv.setHor(iDisp);
    60876167  cMv.setVer(0);
     
    60916171  return true;
    60926172}
     6173#endif
     6174
     6175#if MTK_SINGLE_DEPTH_MODE_I0095
     6176Bool TComDataCU::getNeighDepth (UInt uiPartIdx, UInt uiPartAddr, Pel* pNeighDepth, Int index)
     6177{
     6178
     6179  Bool bDepAvail = false;
     6180  Pel *pDepth  = this->getPic()->getPicYuvRec()->getLumaAddr();
     6181  Int iDepStride =  this->getPic()->getPicYuvRec()->getStride();
     6182
     6183  Int xP, yP, nPSW, nPSH;
     6184  this->getPartPosition(uiPartIdx, xP, yP, nPSW, nPSH);
     6185  UInt PicHeight=this->getPic()->getPicYuvRec()->getHeight();
     6186  UInt PicWidth=this->getPic()->getPicYuvRec()->getWidth();
     6187  switch(index)
     6188  {
     6189  case 0: // Mid Left
     6190    if( ( xP != 0 ) && ( ( yP + ( nPSH >> 1 ) ) < PicHeight ) )
     6191    {
     6192      *pNeighDepth = pDepth[ (yP+(nPSH>>1)) * iDepStride + (xP-1) ];
     6193      bDepAvail = true;
     6194    }
     6195    break;
     6196  case 1: // Mid Above
     6197    if( ( yP != 0 ) && ( ( xP + ( nPSW >> 1 ) ) < PicWidth ) )
     6198    {
     6199      *pNeighDepth = pDepth[ (yP-1) * iDepStride + (xP + (nPSW>>1)) ];
     6200      bDepAvail = true;
     6201    }
     6202    break;
     6203  case 2: // Above
     6204    if(yP != 0)
     6205    {
     6206      *pNeighDepth = pDepth[ (yP-1) * iDepStride + (xP) ];
     6207      bDepAvail = true;
     6208    }
     6209    break;
     6210  case 3: // Left
     6211    if(xP != 0)
     6212    {
     6213      *pNeighDepth = pDepth[ (yP) * iDepStride + (xP-1) ];
     6214      bDepAvail = true;
     6215    }
     6216    break;
     6217  case 4: // Above_Left
     6218    if(xP != 0 && yP != 0)
     6219    {
     6220      *pNeighDepth = pDepth[ (yP-1) * iDepStride + (xP-1) ];
     6221      bDepAvail = true;
     6222    }
     6223    break;
     6224  default:
     6225      break;
     6226  }
     6227  return bDepAvail;
     6228}
     6229
    60936230#endif
    60946231#if H_3D_NBDV
     
    66506787  if( getSlice()->getIsDepth() )
    66516788  {
     6789#if MTK_I0099_VPS_EX2
     6790    iSubPUSize = 1<<getSlice()->getVPS()->getSubPUMPILog2Size(getSlice()->getLayerId());
     6791#else
    66526792    iSubPUSize = 1 << getSlice()->getVPS()->getSubPUMPILog2Size();
     6793#endif
    66536794  }
    66546795
  • trunk/source/Lib/TLibCommon/TComDataCU.h

    r976 r1039  
    110110  // -------------------------------------------------------------------------------------------------------------------
    111111  Bool*         m_skipFlag;           ///< array of skip flags
     112#if MTK_SINGLE_DEPTH_MODE_I0095
     113  Bool*         m_singleDepthFlag;           ///< array of single depth flags
     114  Pel*          m_apSingleDepthValue;
     115#endif
    112116  Char*         m_pePartSize;         ///< array of partition sizes
    113117  Char*         m_pePredMode;         ///< array of prediction modes
     
    246250#if H_3D_IV_MERGE
    247251  Bool          xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Int*   ivCandDir, TComMv* ivCandMv, Int* ivCandRefIdx );
     252#if! SEC_SIMP_SHIFTED_DV_I0086
    248253  Bool          xGetPosFirstAvailDmvCand( Int iCount, Int& iFirDispCand );
     254#endif
    249255#endif
    250256
     
    347353  Void         setSkipFlag           ( UInt idx, Bool skip)     { m_skipFlag[idx] = skip;   }
    348354  Void         setSkipFlagSubParts   ( Bool skip, UInt absPartIdx, UInt depth );
    349 
     355#if MTK_SINGLE_DEPTH_MODE_I0095
     356  Bool*        getSingleDepthFlag            ()                        { return m_singleDepthFlag;          }
     357  Bool         getSingleDepthFlag            (UInt idx)                { return m_singleDepthFlag[idx];     }
     358  Void         setSingleDepthFlag           ( UInt idx, Bool singleDepth)     { m_singleDepthFlag[idx] = singleDepth;   }
     359  Void         setSingleDepthFlagSubParts   ( Bool singleDepth, UInt absPartIdx, UInt depth );
     360
     361  Pel*         getSingleDepthValue( ) { return m_apSingleDepthValue; }
     362  Pel          getSingleDepthValue            (UInt idx)                { return m_apSingleDepthValue[idx];     }
     363  Void         setSingleDepthValue           ( UInt idx, Pel pDepthValue)     { m_apSingleDepthValue[idx] = pDepthValue;   }
     364  Void         setSingleDepthValueSubParts   (Pel singleDepthValue, UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth );
     365#endif 
    350366  Char*         getPredictionMode     ()                        { return m_pePredMode;        }
    351367  PredMode      getPredictionMode     ( UInt uiIdx )            { return static_cast<PredMode>( m_pePredMode[uiIdx] ); }
     
    489505  Bool          getDispMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDis, Int* iPdm );
    490506#endif
    491 
     507#if MTK_SINGLE_DEPTH_MODE_I0095
     508   Bool          getNeighDepth (UInt uiPartIdx, UInt uiPartAddr, Pel* pNeighDepth, Int index);
     509#endif
    492510#if H_3D_NBDV_REF
    493511  Pel           getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT );
     
    652670  Void          getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours
    653671#endif
    654 #if H_3D_VSP
     672#if H_3D_VSP && !FIX_TICKET_79
    655673                                            , InheritedVSPDisInfo*  inheritedVSPDisInfo
    656674#endif
     
    662680
    663681#if H_3D_VSP
     682#if !FIX_TICKET_76
    664683  inline Void   xInheritVSPDisInfo(TComDataCU* pcCURef, UInt uiAbsPartIdx, Int iCount,  InheritedVSPDisInfo*  inheritedVSPDisInfo);
     684#endif
    665685
    666686#if H_3D_SPIVMP
     
    750770
    751771#endif
     772
     773#if SHARP_DMM1_I0110
     774  Bool         isDMM1UpscaleMode       ( UInt uiWidth ){ Bool bDMM1UpsampleModeFlag = true; UInt uiBaseWidth = 16; if( uiBaseWidth >= uiWidth ){ bDMM1UpsampleModeFlag = false; } return bDMM1UpsampleModeFlag; };
     775  UInt         getDMM1BasePatternWidth ( UInt uiWidth ){ UInt uiBaseWidth = 16; if( uiBaseWidth >= uiWidth ){ uiBaseWidth =  uiWidth; } return uiBaseWidth; }
     776#endif
     777
    752778};
    753779
  • trunk/source/Lib/TLibCommon/TComMotionInfo.h

    r976 r1039  
    7979} IDVInfo;
    8080#endif
    81 #if H_3D_VSP
     81#if H_3D_VSP && !FIX_TICKET_79
    8282typedef struct _InheritedVSPDisCand
    8383{
  • trunk/source/Lib/TLibCommon/TComPrediction.cpp

    r976 r1039  
    423423
    424424  UInt dimType    = getDimType  ( uiIntraMode );
    425   Bool dimDeltaDC = isDimDeltaDC( uiIntraMode );   
     425#if !HS_DMM_SIGNALLING_I0120
     426  Bool dimDeltaDC = isDimDeltaDC( uiIntraMode );
     427#endif
    426428  Bool isDmmMode  = (dimType <  DMM_NUM_TYPE);
    427429
     
    438440    case( DMM1_IDX ):
    439441      {
     442#if SHARP_DMM1_I0110
     443        dmmSegmentation = pcCU->isDMM1UpscaleMode((UInt)iWidth) ?
     444            &(g_dmmWedgeLists[ g_aucConvertToBit[pcCU->getDMM1BasePatternWidth((UInt)iWidth)] ][ pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ) ]) :
     445            &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ) ]);
     446#else
    440447        dmmSegmentation = &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ) ]);
     448#endif
    441449      } break;
    442450    case( DMM4_IDX ):
     
    456464    }
    457465    assert( dmmSegmentation );
     466#if SHARP_DMM1_I0110
     467    if( dimType == DMM1_IDX && pcCU->isDMM1UpscaleMode((UInt)iWidth) )
     468    {
     469        biSegPattern = dmmSegmentation->getScaledPattern((UInt)iWidth);
     470        patternStride = iWidth;
     471    }
     472    else
     473    {
     474        biSegPattern  = dmmSegmentation->getPattern();
     475        patternStride = dmmSegmentation->getStride ();
     476    }
     477#else
    458478    biSegPattern  = dmmSegmentation->getPattern();
    459479    patternStride = dmmSegmentation->getStride ();
     480#endif
    460481  }
    461482#endif
     
    474495  Pel segDC1 = 0;
    475496  Pel segDC2 = 0;
     497#if HS_DMM_SIGNALLING_I0120
     498  if( !pcCU->getSDCFlag( uiAbsPartIdx ) )
     499#else
    476500  if( dimDeltaDC )
     501#endif
    477502  {
    478503    Pel deltaDC1 = pcCU->getDimDeltaDC( dimType, 0, uiAbsPartIdx );
     
    543568    pcCU->getSPAbsPartIdx(uiPartAddr, iSPWidth, iSPHeight, i, iNumSPInOneLine, uiSPAddr[i]);
    544569  }
     570#if SHARP_ARP_CHROMA_I0104
     571  if( pcCU->getARPW( uiPartAddr ) != 0 )
     572  {
     573    return;
     574  }
     575#endif
    545576  // horizontal sub-PU merge
    546577  for (Int i=0; i<iNumSP; i++)
     
    714745  Int uiMinDepth = MAX_INT;
    715746  Int uiMaxDepth = 0;
     747#if SEC_DBBP_DMM4_THRESHOLD_I0076
     748  iSumDepth  = pDepthPels[ 0 ];
     749  iSumDepth += pDepthPels[ uiWidth - 1 ];
     750  iSumDepth += pDepthPels[ uiDepthStride * (uiHeight - 1) ];
     751  iSumDepth += pDepthPels[ uiDepthStride * (uiHeight - 1) + uiWidth - 1 ];
     752
     753  uiMinDepth = pDepthPels[ 0 ];
     754  uiMinDepth = std::min( uiMinDepth, (Int)pDepthPels[ uiWidth - 1 ]);
     755  uiMinDepth = std::min( uiMinDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) ]);
     756  uiMinDepth = std::min( uiMinDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) + uiWidth - 1 ]);
     757
     758  uiMaxDepth = pDepthPels[ 0 ];
     759  uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiWidth - 1 ]);
     760  uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) ]);
     761  uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) + uiWidth - 1 ]);
     762#else
    716763  for (Int y=0; y<uiHeight; y++)
    717764  {
     
    734781    pDepthPels += uiDepthStride;
    735782  }
     783#endif
    736784 
    737785  // don't generate mask for blocks with small depth range (encoder decision)
     
    742790 
    743791  AOF(uiWidth==uiHeight);
     792#if SEC_DBBP_DMM4_THRESHOLD_I0076
     793  Int iMean = iSumDepth >> 2;
     794#else
    744795  Int iSizeInBits = g_aucConvertToBit[uiWidth]+2;
    745796  Int iMean = iSumDepth >> iSizeInBits*2;       // iMean /= (uiWidth*uiHeight);
     797#endif
    746798 
    747799  // start again for segmentation
     
    790842}
    791843
     844#if SHARP_DBBP_SIMPLE_FLTER_I0109
     845Void TComPrediction::combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr, UInt partSize )
     846#else
    792847Void TComPrediction::combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr )
     848#endif
    793849{
    794850  Pel*  piSrc[2]    = {pInYuv[0]->getLumaAddr(uiPartAddr), pInYuv[1]->getLumaAddr(uiPartAddr)};
     
    798854 
    799855  UInt  uiMaskStride= MAX_CU_SIZE;
     856#if !SHARP_DBBP_SIMPLE_FLTER_I0109
    800857  Pel  filSrc = 0;
     858#endif
    801859  Pel* tmpTar = 0;
    802860  tmpTar = (Pel *)xMalloc(Pel, uiWidth*uiHeight);
     
    822880  }
    823881 
     882#if SHARP_DBBP_SIMPLE_FLTER_I0109
     883  if (partSize == SIZE_Nx2N)
     884  {
     885    for (Int y=0; y<uiHeight; y++)
     886    {
     887      for (Int x=0; x<uiWidth; x++)
     888      {
     889        Bool l = (x==0)?pMaskStart[y*uiMaskStride+x]:pMaskStart[y*uiMaskStride+x-1];
     890        Bool r = (x==uiWidth-1)?pMaskStart[y*uiMaskStride+x]:pMaskStart[y*uiMaskStride+x+1];
     891       
     892        Pel left, right;
     893        left   = (x==0)          ? tmpTar[y*uiWidth+x] : tmpTar[y*uiWidth+x-1];
     894        right  = (x==uiWidth-1)  ? tmpTar[y*uiWidth+x] : tmpTar[y*uiWidth+x+1];
     895       
     896        piDst[x] = (l!=r) ? ClipY( Pel(( left + (tmpTar[y*uiWidth+x] << 1) + right ) >> 2 )) : tmpTar[y*uiWidth+x];
     897      }
     898      piDst     += uiDstStride;
     899    }
     900  }
     901  else // SIZE_2NxN
     902  {
     903    for (Int y=0; y<uiHeight; y++)
     904    {
     905      for (Int x=0; x<uiWidth; x++)
     906      {
     907        Bool t = (y==0)?pMaskStart[y*uiMaskStride+x]:pMaskStart[(y-1)*uiMaskStride+x];
     908        Bool b = (y==uiHeight-1)?pMaskStart[y*uiMaskStride+x]:pMaskStart[(y+1)*uiMaskStride+x];
     909       
     910        Pel top, bottom;
     911        top    = (y==0)          ? tmpTar[y*uiWidth+x] : tmpTar[(y-1)*uiWidth+x];
     912        bottom = (y==uiHeight-1) ? tmpTar[y*uiWidth+x] : tmpTar[(y+1)*uiWidth+x];
     913       
     914        piDst[x] = (t!=b) ? ClipY( Pel(( top + (tmpTar[y*uiWidth+x] << 1) + bottom ) >> 2 )) : tmpTar[y*uiWidth+x];
     915      }
     916      piDst     += uiDstStride;
     917    }
     918  }
     919#else
    824920  for (Int y=0; y<uiHeight; y++)
    825921  {
     
    855951    piDst     += uiDstStride;
    856952  }
     953#endif
     954
    857955  if ( tmpTar    ) { xFree(tmpTar);             tmpTar        = NULL; }
    858956 
     
    891989  }
    892990
     991#if SHARP_DBBP_SIMPLE_FLTER_I0109
     992  if (partSize == SIZE_Nx2N)
     993  {
     994    for (Int y=0; y<uiHeightC; y++)
     995    {
     996      for (Int x=0; x<uiWidthC; x++)
     997      {
     998        Bool l = (x==0)?pMaskStart[y*2*uiMaskStride+x*2]:pMaskStart[y*2*uiMaskStride+(x-1)*2];
     999        Bool r = (x==uiWidthC-1)?pMaskStart[y*2*uiMaskStride+x*2]:pMaskStart[y*2*uiMaskStride+(x+1)*2];
     1000
     1001        Pel leftU, rightU;
     1002        leftU   = (x==0)           ? tmpTarU[y*uiWidthC+x] : tmpTarU[y*uiWidthC+x-1];
     1003        rightU  = (x==uiWidthC-1)  ? tmpTarU[y*uiWidthC+x] : tmpTarU[y*uiWidthC+x+1];
     1004        Pel leftV, rightV;
     1005        leftV   = (x==0)           ? tmpTarV[y*uiWidthC+x] : tmpTarV[y*uiWidthC+x-1];
     1006        rightV  = (x==uiWidthC-1)  ? tmpTarV[y*uiWidthC+x] : tmpTarV[y*uiWidthC+x+1];
     1007
     1008        if (l!=r)
     1009        {
     1010          filSrcU = ClipC( Pel(( leftU + (tmpTarU[y*uiWidthC+x] << 1) + rightU ) >> 2 ));
     1011          filSrcV = ClipC( Pel(( leftV + (tmpTarV[y*uiWidthC+x] << 1) + rightV ) >> 2 ));
     1012        }
     1013        else
     1014        {
     1015          filSrcU = tmpTarU[y*uiWidthC+x];
     1016          filSrcV = tmpTarV[y*uiWidthC+x];
     1017        }
     1018        piDstU[x] = filSrcU;
     1019        piDstV[x] = filSrcV;
     1020      }
     1021      piDstU      += uiDstStrideC;
     1022      piDstV      += uiDstStrideC;
     1023    }
     1024  }
     1025  else
     1026  {
     1027    for (Int y=0; y<uiHeightC; y++)
     1028    {
     1029      for (Int x=0; x<uiWidthC; x++)
     1030      {
     1031        Bool t = (y==0)?pMaskStart[y*2*uiMaskStride+x*2]:pMaskStart[(y-1)*2*uiMaskStride+x*2];
     1032        Bool b = (y==uiHeightC-1)?pMaskStart[y*2*uiMaskStride+x*2]:pMaskStart[(y+1)*2*uiMaskStride+x*2];
     1033
     1034        Pel topU, bottomU;
     1035        topU    = (y==0)           ? tmpTarU[y*uiWidthC+x] : tmpTarU[(y-1)*uiWidthC+x];
     1036        bottomU = (y==uiHeightC-1) ? tmpTarU[y*uiWidthC+x] : tmpTarU[(y+1)*uiWidthC+x];
     1037        Pel topV, bottomV;
     1038        topV    = (y==0)           ? tmpTarV[y*uiWidthC+x] : tmpTarV[(y-1)*uiWidthC+x];
     1039        bottomV = (y==uiHeightC-1) ? tmpTarV[y*uiWidthC+x] : tmpTarV[(y+1)*uiWidthC+x];
     1040
     1041        if (t!=b)
     1042        {
     1043          filSrcU = ClipC( Pel(( topU + (tmpTarU[y*uiWidthC+x] << 1) + bottomU ) >> 2 ));
     1044          filSrcV = ClipC( Pel(( topV + (tmpTarV[y*uiWidthC+x] << 1) + bottomV ) >> 2 ));
     1045        }
     1046        else
     1047        {
     1048          filSrcU = tmpTarU[y*uiWidthC+x];
     1049          filSrcV = tmpTarV[y*uiWidthC+x];
     1050        }
     1051        piDstU[x] = filSrcU;
     1052        piDstV[x] = filSrcV;
     1053      }
     1054      piDstU      += uiDstStrideC;
     1055      piDstV      += uiDstStrideC;
     1056    }
     1057  }
     1058#else
    8931059  for (Int y=0; y<uiHeightC; y++)
    8941060  {
     
    9361102    piDstV      += uiDstStrideC;
    9371103  }
     1104#endif
    9381105  if ( tmpTarU    ) { xFree(tmpTarU);             tmpTarU        = NULL; }
    9391106  if ( tmpTarV    ) { xFree(tmpTarV);             tmpTarV        = NULL; }
     
    13081475  pcCU->clipMv(cMv);
    13091476  TComPicYuv* pcPicYuvRef = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec();
     1477#if QC_I0129_ARP_FIX
     1478  xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 ), true );
     1479  xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 ), true );
     1480#else
    13101481  xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi, true );
    13111482  xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi, true );
    1312 
     1483#endif
    13131484  if( dW > 0 )
    13141485  {
     
    13181489    TComMv cMVwithDisparity = cMv + cDistparity.m_acNBDV;
    13191490    pcCU->clipMv(cMVwithDisparity);
     1491#if SHARP_ARP_CHROMA_I0104
     1492    if (iWidth <= 8)
     1493    {
     1494      pYuvB0->clear(); pYuvB1->clear();
     1495    }
     1496#endif
    13201497
    13211498    assert ( cDistparity.bDV );
     
    13261503   
    13271504    pcPicYuvRef = pcPicYuvBaseCol->getPicYuvRec();
     1505#if QC_I0129_ARP_FIX
     1506    xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, true, true );
     1507#if SHARP_ARP_CHROMA_I0104
     1508    if (iWidth > 8)
     1509#endif
     1510    xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, true, true );
     1511#else
    13281512    xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, bi, true );
    13291513    xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, bi, true );
     1514#endif
    13301515#else
    13311516    pcPicYuvRef = pcPicYuvBaseCol->getPicYuvRec();
     
    13351520   
    13361521    pcPicYuvRef = pcPicYuvBaseRef->getPicYuvRec();
     1522#if QC_I0129_ARP_FIX
     1523    xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, true, true );
     1524#if SHARP_ARP_CHROMA_I0104
     1525    if (iWidth > 8)
     1526#endif
     1527    xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, true, true );
     1528#else
    13371529    xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, bi, true );
    13381530    xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, bi, true );
    1339 
     1531#endif
    13401532    pYuvB0->subtractARP( pYuvB0 , pYuvB1 , uiPartAddr , iWidth , iHeight );
    13411533
     
    13471539  }
    13481540}
     1541
     1542#if QC_I0051_ARP_SIMP
     1543Bool TComPrediction::xCheckBiInterviewARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eBaseRefPicList, TComPic*& pcPicYuvCurrTRef, TComMv& cBaseTMV, Int& iCurrTRefPoc )
     1544{
     1545  Int         iRefIdx       = pcCU->getCUMvField( eBaseRefPicList )->getRefIdx( uiPartAddr );
     1546  TComMv      cDMv          = pcCU->getCUMvField( eBaseRefPicList )->getMv( uiPartAddr );
     1547  TComPic* pcPicYuvBaseCol  = pcCU->getSlice()->getRefPic( eBaseRefPicList, iRefIdx ); 
     1548  TComPicYuv* pcYuvBaseCol  = pcPicYuvBaseCol->getPicYuvRec();
     1549  Int uiLCUAddr,uiAbsPartAddr;
     1550  Int irefPUX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[uiPartAddr]] + iWidth/2  + ((cDMv.getHor() + 2)>>2);
     1551  Int irefPUY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[uiPartAddr]] + iHeight/2 + ((cDMv.getVer() + 2)>>2);
     1552
     1553  irefPUX = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()-> getPicWidthInLumaSamples()-1, irefPUX);
     1554  irefPUY = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples()-1, irefPUY); 
     1555  pcYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr);
     1556  TComDataCU *pColCU = pcPicYuvBaseCol->getCU( uiLCUAddr );
     1557
     1558  TComPic* pcPicYuvBaseTRef = NULL;
     1559  pcPicYuvCurrTRef = NULL;
     1560
     1561  //If there is available motion in base reference list, use it
     1562  if(!pColCU->isIntra(uiAbsPartAddr))
     1563  {
     1564    for(Int iList = 0; iList < (pColCU->getSlice()->isInterB() ? 2: 1); iList ++)
     1565    {
     1566      RefPicList eRefPicListCurr = RefPicList(iList);
     1567      Int iRef = pColCU->getCUMvField(eRefPicListCurr)->getRefIdx(uiAbsPartAddr);
     1568      if( iRef != -1)
     1569      {
     1570        pcPicYuvBaseTRef = pColCU->getSlice()->getRefPic(eRefPicListCurr, iRef); 
     1571        Int  iCurrPOC    = pColCU->getSlice()->getPOC();
     1572        Int  iCurrRefPOC = pcPicYuvBaseTRef->getPOC();
     1573        Int  iCurrRef    = pcCU->getSlice()->getFirstTRefIdx(eRefPicListCurr);
     1574#if MTK_I0072_IVARP_SCALING_FIX
     1575        if( iCurrRef >= 0 && iCurrPOC != iCurrRefPOC)
     1576#else
     1577        if( iCurrRef >= 0)
     1578#endif
     1579        {
     1580          pcPicYuvCurrTRef =  pcCU->getSlice()->getRefPic(eRefPicListCurr,iCurrRef); 
     1581          Int iTargetPOC = pcPicYuvCurrTRef->getPOC();
     1582          pcPicYuvBaseTRef =  pcCU->getSlice()->getBaseViewRefPic(iTargetPOC,  pcPicYuvBaseCol->getViewIndex() ); 
     1583          if(pcPicYuvBaseTRef)
     1584          {
     1585            cBaseTMV = pColCU->getCUMvField(eRefPicListCurr)->getMv(uiAbsPartAddr);
     1586            Int iScale = pcCU-> xGetDistScaleFactor(iCurrPOC, iTargetPOC, iCurrPOC, iCurrRefPOC);
     1587            if ( iScale != 4096 )
     1588            {
     1589              cBaseTMV = cBaseTMV.scaleMv( iScale );
     1590            }
     1591            iCurrTRefPoc = iTargetPOC;
     1592            return true;
     1593          }
     1594        }
     1595      }
     1596    }
     1597  }
     1598
     1599  //If there is no available motion in base reference list, use ( 0, 0 )
     1600  if( pcCU->getSlice()->getFirstTRefIdx( eBaseRefPicList ) >= 0 )
     1601  {
     1602    cBaseTMV.set( 0, 0 );
     1603    pcPicYuvCurrTRef = pcCU->getSlice()->getRefPic( eBaseRefPicList,  pcCU->getSlice()->getFirstTRefIdx( eBaseRefPicList ) );
     1604    iCurrTRefPoc = pcPicYuvCurrTRef->getPOC();
     1605    return true;
     1606  }
     1607
     1608  return false;
     1609}
     1610#endif
     1611
    13491612Void TComPrediction::xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled )
    13501613{
     
    13801643  pcYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr);
    13811644  TComDataCU *pColCU = pcPicYuvBaseCol->getCU( uiLCUAddr );
    1382 
     1645#if QC_I0051_ARP_SIMP
     1646  if( pcCU->getSlice()->isInterB() && !pcCU->getSlice()->getIsDepth() )
     1647  {
     1648    RefPicList eOtherRefList = ( eRefPicList == REF_PIC_LIST_0 ) ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
     1649    Int iOtherRefIdx = pcCU->getCUMvField( eOtherRefList )->getRefIdx( uiPartAddr );
     1650    //The other prediction direction is temporal ARP
     1651    if( iOtherRefIdx >= 0 && pcCU->getSlice()->getViewIndex() == pcCU->getSlice()->getRefPic( eOtherRefList, iOtherRefIdx )->getViewIndex() )
     1652    {
     1653      bTMVAvai = true;
     1654      pcPicYuvBaseTRef = pcCU->getSlice()->getRefPic( eOtherRefList, iOtherRefIdx );
     1655      Int  iCurrPOC    = pcCU->getSlice()->getPOC();
     1656      Int  iCurrRefPOC = pcPicYuvBaseTRef->getPOC();
     1657      Int  iCurrRef    = pcCU->getSlice()->getFirstTRefIdx( eOtherRefList );
     1658     
     1659      if( iCurrRef >= 0 )
     1660      {
     1661        pcPicYuvCurrTRef =  pcCU->getSlice()->getRefPic( eOtherRefList,iCurrRef ); 
     1662        Int iTargetPOC = pcPicYuvCurrTRef->getPOC();
     1663        pcPicYuvBaseTRef =  pcCU->getSlice()->getBaseViewRefPic( iTargetPOC,  pcPicYuvBaseCol->getViewIndex() );
     1664        if( pcPicYuvBaseTRef )
     1665        {
     1666          cBaseTMV = pcCU->getCUMvField( eOtherRefList )->getMv( uiPartAddr );
     1667          Int iScale = pcCU-> xGetDistScaleFactor( iCurrPOC, iTargetPOC, iCurrPOC, iCurrRefPOC );
     1668          if ( iScale != 4096 )
     1669          {
     1670            cBaseTMV = cBaseTMV.scaleMv( iScale );
     1671          }
     1672        }
     1673        else
     1674        {
     1675          dW = 0;
     1676        }
     1677      }
     1678      else
     1679      {
     1680        dW = 0;
     1681      }
     1682    }
     1683
     1684    //Both prediction directions are inter-view ARP
     1685    if ( iOtherRefIdx >= 0 && !bTMVAvai )
     1686    {
     1687      RefPicList eBaseList = REF_PIC_LIST_0;
     1688      Int iCurrTRefPoc;
     1689      bTMVAvai = ( eBaseList != eRefPicList ) && ( pcCU->getSlice()->getViewIndex() != pcCU->getSlice()->getRefPic( eOtherRefList, iOtherRefIdx )->getViewIndex() );
     1690
     1691      if ( bTMVAvai )
     1692      {
     1693        if( xCheckBiInterviewARP( pcCU, uiPartAddr, iWidth, iHeight, eBaseList, pcPicYuvCurrTRef, cBaseTMV, iCurrTRefPoc ) )
     1694        {
     1695          pcPicYuvBaseTRef = pcCU->getSlice()->getBaseViewRefPic( iCurrTRefPoc,  pcPicYuvBaseCol->getViewIndex() );
     1696          if ( pcPicYuvBaseTRef == NULL )
     1697          {
     1698            dW = 0;
     1699          }
     1700        }
     1701        else
     1702        {
     1703          dW = 0;
     1704        }
     1705      }
     1706    }
     1707  }
     1708
     1709  if( !pColCU->isIntra( uiAbsPartAddr ) && !bTMVAvai )
     1710#else
    13831711  if(!pColCU->isIntra(uiAbsPartAddr))
     1712#endif
    13841713  {
    13851714    TComMvField puMVField;
     
    13941723        Int  iCurrRefPOC = pcPicYuvBaseTRef->getPOC();
    13951724        Int  iCurrRef    = pcCU->getSlice()->getFirstTRefIdx(eRefPicListCurr);
     1725#if MTK_I0072_IVARP_SCALING_FIX
     1726        if (iCurrRef >= 0 && iCurrRefPOC != iCurrPOC)
     1727#else
    13961728        if( iCurrRef >= 0)
     1729#endif
    13971730        {
    13981731          pcPicYuvCurrTRef =  pcCU->getSlice()->getRefPic(eRefPicListCurr,iCurrRef); 
     
    14211754    pcPicYuvCurrTRef =  pcCU->getSlice()->getRefPic  (eRefPicList,  pcCU->getSlice()->getFirstTRefIdx(eRefPicList));     
    14221755  }
    1423 
     1756#if QC_I0129_ARP_FIX
     1757  xPredInterLumaBlk  ( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ),        bTMVAvai);
     1758  xPredInterChromaBlk( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ),        bTMVAvai);
     1759#else
    14241760  xPredInterLumaBlk  ( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi,        bTMVAvai);
    14251761  xPredInterChromaBlk( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi,        bTMVAvai);
    1426 
     1762#endif
    14271763  if( dW > 0 && bTMVAvai )
    14281764  {
     
    14351771    pcCU->clipMv(cBaseTMV);
    14361772    pcCU->clipMv(cTempMv);
    1437 
     1773#if SHARP_ARP_CHROMA_I0104
     1774    if (iWidth <= 8)
     1775    {
     1776      pYuvCurrTRef->clear(); pYuvBaseTRef->clear();
     1777    }
     1778#endif
     1779#if QC_I0129_ARP_FIX
     1780    xPredInterLumaBlk  ( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, true,   true);
     1781#if SHARP_ARP_CHROMA_I0104
     1782    if (iWidth > 8)
     1783#endif
     1784    xPredInterChromaBlk( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, true,   true);
     1785    xPredInterLumaBlk  ( pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv,  iWidth, iHeight, pYuvBaseTRef, true,   true);
     1786#if SHARP_ARP_CHROMA_I0104
     1787    if (iWidth > 8)
     1788#endif
     1789    xPredInterChromaBlk( pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv,  iWidth, iHeight, pYuvBaseTRef, true,   true);
     1790#else
    14381791    xPredInterLumaBlk  ( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, bi,   true);
    14391792    xPredInterChromaBlk( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, bi,   true);
     
    14411794    xPredInterChromaBlk( pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv,  iWidth, iHeight, pYuvBaseTRef, bi,   true);
    14421795
     1796#endif
    14431797    pYuvCurrTRef->subtractARP( pYuvCurrTRef , pYuvBaseTRef , uiPartAddr , iWidth , iHeight ); 
    14441798    if(dW == 2)
     
    19742328  Int iRecStride = ( eType == TEXT_LUMA ) ? pRecPic->getStride() : pRecPic->getCStride();
    19752329  Int iRefStride = ( eType == TEXT_LUMA ) ? pRefPic->getStride() : pRefPic->getCStride();
     2330#if SEC_IC_NEIGHBOR_CLIP_I0080
     2331  Int iRefOffset, iHor, iVer;
     2332#else
    19762333  Int iCUPelX, iCUPelY, iRefX, iRefY, iRefOffset, iHor, iVer;
    19772334
    19782335  iCUPelX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]];
    19792336  iCUPelY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]];
     2337#endif
    19802338  iHor = pcCU->getSlice()->getIsDepth() ? pMv->getHor() : ( ( pMv->getHor() + 2 ) >> 2 );
    19812339  iVer = pcCU->getSlice()->getIsDepth() ? pMv->getVer() : ( ( pMv->getVer() + 2 ) >> 2 );
     2340#if !SEC_IC_NEIGHBOR_CLIP_I0080
    19822341  iRefX   = iCUPelX + iHor;
    19832342  iRefY   = iCUPelY + iVer;
     2343#endif
    19842344  if( eType != TEXT_LUMA )
    19852345  {
     
    19972357  Int precShift = std::max(0, (( eType == TEXT_LUMA ) ? g_bitDepthY : g_bitDepthC) - 12);
    19982358
     2359#if SEC_IC_NEIGHBOR_CLIP_I0080
     2360  if( pcCU->getPUAbove( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) )
     2361#else
    19992362  if( pcCU->getPUAbove( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) && iCUPelY > 0 && iRefY > 0 )
     2363#endif
    20002364  {
    20012365    iRefOffset = iHor + iVer * iRefStride - iRefStride;
     
    20272391  }
    20282392
    2029 
     2393#if SEC_IC_NEIGHBOR_CLIP_I0080
     2394  if( pcCU->getPULeft( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) )
     2395#else
    20302396  if( pcCU->getPULeft( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) && iCUPelX > 0 && iRefX > 0 )
     2397#endif
    20312398  {
    20322399    iRefOffset = iHor + iVer * iRefStride - 1;
     
    20612428    iCountShift += iCountShift > 0 ? 1 : ( g_aucConvertToBit[ uiWidth ] + 1 );
    20622429  }
     2430
     2431#if FIX_TICKET_71
     2432  if( iCountShift == 0 )
     2433  {
     2434    a = ( 1 << IC_CONST_SHIFT );
     2435    b = 0;
     2436    return;
     2437  }
     2438#endif
    20632439
    20642440  xy += xx >> IC_REG_COST_SHIFT;
     
    21772553  // find contour for texture luma block
    21782554  UInt iDC = 0;
     2555#if SEC_DBBP_DMM4_THRESHOLD_I0076
     2556  iDC  = piRefBlkY[ 0 ];
     2557  iDC += piRefBlkY[ uiWidth - 1 ];
     2558  iDC += piRefBlkY[ uiWidth * (uiHeight - 1) ];
     2559  iDC += piRefBlkY[ uiWidth * (uiHeight - 1) + uiWidth - 1 ];
     2560  iDC = iDC >> 2;
     2561#else
    21792562  for( UInt k = 0; k < (uiWidth*uiHeight); k++ )
    21802563  {
     
    21842567  Int cuMaxLog2Size = g_aucConvertToBit[g_uiMaxCUWidth]+2;   //
    21852568  iDC = iDC >> (cuMaxLog2Size - pcCU->getDepth(0))*2;        //  iDC /= (uiWidth*uiHeight);
     2569#endif
    21862570
    21872571  piRefBlkY = cTempYuv.getLumaAddr();
  • trunk/source/Lib/TLibCommon/TComPrediction.h

    r884 r1039  
    9090#if H_3D_ARP
    9191  Void xPredInterUniARP         ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi=false, TComMvField * pNewMvFiled = NULL );
     92#if QC_I0051_ARP_SIMP
     93  Bool xCheckBiInterviewARP     ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eBaseRefPicList, TComPic*& pcPicYuvCurrTRef, TComMv& cBaseTMV, Int& iCurrTRefPoc );
     94#endif
    9295  Void xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled = NULL );
    9396#endif
     
    176179  PartSize      getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize);
    177180  Bool          getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask );
     181#if SHARP_DBBP_SIMPLE_FLTER_I0109
     182  Void          combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr, UInt partSize );
     183#else
    178184  Void          combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr = 0 );
     185#endif
    179186#endif
    180187
  • trunk/source/Lib/TLibCommon/TComRom.cpp

    r976 r1039  
    336336  HALF_PEL,    //   8x8
    337337  FULL_PEL,    //  16x16
     338#if SHARP_DMM1_I0110
     339  FULL_PEL,    //  32x32
     340  FULL_PEL,    //  64x64
     341  FULL_PEL     // 128x128
     342#else
    338343  DOUBLE_PEL,  //  32x32
    339344  DOUBLE_PEL,  //  64x64
    340345  DOUBLE_PEL   // 128x128
     346#endif
    341347};
    342348
     
    348354{ //2x2   4x4   8x8 16x16 32x32 64x64
    349355     0,    4,    7,    8,    8,    0 };
     356
     357#if SHARP_DMM1_I0110
     358Bool g_wedgePattern[32*32];
     359#endif
    350360
    351361extern std::vector< std::vector<TComWedgelet> >   g_dmmWedgeLists;
     
    646656  if( !g_dmmWedgeLists.empty() ) return;
    647657
     658#if SHARP_DMM1_I0110
     659  for( UInt ui = g_aucConvertToBit[DIM_MIN_SIZE]; ui < (g_aucConvertToBit[DIM_MAX_SIZE]); ui++ )
     660#else
    648661  for( UInt ui = g_aucConvertToBit[DIM_MIN_SIZE]; ui < (g_aucConvertToBit[DIM_MAX_SIZE]+1); ui++ )
     662#endif
    649663  {
    650664    UInt uiWedgeBlockSize = ((UInt)DIM_MIN_SIZE)<<ui;
     
    730744  switch( eWedgeRes )
    731745  {
     746#if !SHARP_DMM1_I0110
    732747  case( DOUBLE_PEL ): { uiBlockSize = (uiWidth>>1); break; }
     748#endif
    733749  case(   FULL_PEL ): { uiBlockSize =  uiWidth;     break; }
    734750  case(   HALF_PEL ): { uiBlockSize = (uiWidth<<1); break; }
  • trunk/source/Lib/TLibCommon/TComRom.h

    r976 r1039  
    166166extern const UChar                                           g_dmm3IntraTabIdxBits[6];
    167167
     168#if SHARP_DMM1_I0110
     169extern Bool                                                  g_wedgePattern[32*32];
     170#endif
     171
    168172extern       std::vector< std::vector<TComWedgelet> >        g_dmmWedgeLists;
    169173extern       std::vector< std::vector<TComWedgeRef> >        g_dmmWedgeRefLists;
  • trunk/source/Lib/TLibCommon/TComSlice.cpp

    r976 r1039  
    139139, m_depthToDisparityF             ( NULL )
    140140#endif
     141#if MTK_SINGLE_DEPTH_MODE_I0095
     142, m_bApplySingleDepthMode         (false)
     143#endif
    141144#endif
    142145{
     
    644647 
    645648  TComPic**             refPicSetStCurr    [2] = { RefPicSetStCurr0, RefPicSetStCurr1 };
     649#if FIX_WARNING
     650  Int numPocStCurr[2] = { (Int)NumPocStCurr0, (Int)NumPocStCurr1 };
     651#else
    646652  Int numPocStCurr[2] = { NumPocStCurr0, NumPocStCurr1 };
     653#endif
    647654
    648655  for (Int li = 0; li < ((m_eSliceType==B_SLICE) ? 2 : 1); li++)
     
    10911098    m_interLayerPredLayerIdc[ layer ] = pSrc->m_interLayerPredLayerIdc[ layer ];
    10921099  }
     1100#endif
     1101#if MTK_SINGLE_DEPTH_MODE_I0095
     1102  m_bApplySingleDepthMode = pSrc->m_bApplySingleDepthMode;
    10931103#endif
    10941104#if H_3D_IC
     
    19421952    m_viewIndex         [i] = -1;
    19431953    m_vpsDepthModesFlag [i] = false;
     1954#if SEC_HLS_CLEANUP_I0100
     1955    m_ivMvScalingFlag[i] = true;
     1956#else
    19441957    m_ivMvScalingFlag = true;
     1958#endif
     1959#if SEPARATE_FLAG_I0085
     1960    m_bIVPFlag [i]      = false;
     1961#endif
    19451962#endif
    19461963
     
    19741991#endif
    19751992#endif
     1993#if MTK_I0099_VPS_EX2
     1994    m_bLimQtPredFlag       [ i ] = false;
     1995#endif
    19761996#if H_3D_VSP
    19771997    m_viewSynthesisPredFlag[ i ] = false;
     
    19822002#if H_3D_INTER_SDC
    19832003    m_bInterSDCFlag        [ i ] = false;
     2004#endif
     2005#if SEPARATE_FLAG_I0085
     2006    m_bIVPFlag             [ i ] = false;
    19842007#endif
    19852008#if H_3D_DBBP
     
    25022525, m_pcmLog2MaxSize            (  5)
    25032526, m_uiPCMLog2MinSize          (  7)
     2527#if !MTK_I0099_VPS_EX2
    25042528#if H_3D_QTLPC
    25052529, m_bUseQTL                   (false)
    25062530, m_bUsePC                    (false)
     2531#endif
    25072532#endif
    25082533, m_bitDepthY                 (  8)
     
    27742799    // allocate some memory and initialize with default mapping
    27752800    m_iNumDepthmapValues[i] = ((1 << m_uiDepthViewBitDepth)-1)+1;
     2801#if !FIX_TICKET_77
    27762802    m_iBitsPerDepthValue[i] = numBitsForValue(m_iNumDepthmapValues[i]);
    2777 
     2803#endif
    27782804    m_iDepthValue2Idx[i]    = (Int*) xMalloc(Int, m_iNumDepthmapValues[i]);
    27792805    m_iIdx2DepthValue[i]    = (Int*) xMalloc(Int, m_iNumDepthmapValues[i]);
     
    28642890  // update DLT variables
    28652891  m_iNumDepthmapValues[layerIdInVps] = iNumDepthValues;
     2892#if !FIX_TICKET_77
    28662893  m_iBitsPerDepthValue[layerIdInVps] = numBitsForValue(m_iNumDepthmapValues[layerIdInVps]);
     2894#endif
    28672895}
    28682896
  • trunk/source/Lib/TLibCommon/TComSlice.h

    r976 r1039  
    798798#if H_3D_IV_MERGE
    799799  Bool        m_ivMvPredFlag             [ MAX_NUM_LAYERS ];
     800#if SEC_HLS_CLEANUP_I0100
     801  Bool        m_ivMvScalingFlag          [ MAX_NUM_LAYERS ];
     802#endif
    800803#if H_3D_SPIVMP
    801804  Int         m_iSubPULog2Size           [MAX_NUM_LAYERS   ];
     805#if MTK_I0099_VPS_EX2
     806  Int         m_iSubPUMPILog2Size        [MAX_NUM_LAYERS   ];
     807#else
    802808  Int         m_iSubPUMPILog2Size;
    803809#endif
     810#endif
     811#endif
     812#if MTK_I0099_VPS_EX2
     813  Bool        m_bLimQtPredFlag           [ MAX_NUM_LAYERS ];
    804814#endif
    805815#if H_3D_VSP
     
    810820#endif
    811821  Bool        m_vpsDepthModesFlag        [MAX_NUM_LAYERS   ];
     822#if SEPARATE_FLAG_I0085
     823  Bool        m_bIVPFlag                 [MAX_NUM_LAYERS   ];
     824#endif
    812825
    813826#if H_3D
     
    817830  Int         ***m_aaaiCodedScale ;
    818831  Int         ***m_aaaiCodedOffset;
     832
     833#if !SEC_HLS_CLEANUP_I0100
    819834  Bool        m_ivMvScalingFlag;
     835#endif
     836
    820837#endif
    821838#if H_3D_INTER_SDC
     
    11301147  Int     getSubPULog2Size(Int layerIdInVps)           { return m_iSubPULog2Size[layerIdInVps]; }
    11311148  Void    setSubPULog2Size(Int layerIdInVps, Int u)    { m_iSubPULog2Size[layerIdInVps] = u;}
     1149#if MTK_I0099_VPS_EX2
     1150  Int     getSubPUMPILog2Size(Int layerIdInVps)           { return m_iSubPUMPILog2Size[layerIdInVps]; }
     1151  Void    setSubPUMPILog2Size(Int layerIdInVps, Int u)    { m_iSubPUMPILog2Size[layerIdInVps] = u;}
     1152#else
    11321153  Int     getSubPUMPILog2Size( )           { return m_iSubPUMPILog2Size; }
    11331154  Void    setSubPUMPILog2Size( Int u )     { m_iSubPUMPILog2Size = u;    }
    11341155#endif
     1156#endif
     1157#endif
     1158#if MTK_I0099_VPS_EX2
     1159  Void    setLimQtPredFlag    ( Int layerIdInVps, Bool val )  { m_bLimQtPredFlag[ layerIdInVps ] = val; }
     1160  Bool    getLimQtPredFlag    ( Int layerIdInVps ) { return m_bLimQtPredFlag[layerIdInVps];}
    11351161#endif
    11361162#if H_3D_VSP
     
    11441170  Void    setVpsDepthModesFlag( Int layerIdInVps, Bool val )               { m_vpsDepthModesFlag[ layerIdInVps ] = val; }
    11451171  Bool    getVpsDepthModesFlag( Int layerIdInVps )                         { return m_vpsDepthModesFlag[ layerIdInVps ]; }
    1146 
     1172#if SEPARATE_FLAG_I0085
     1173  Void    setIVPFlag( Int layerIdInVps, Bool val )                    { m_bIVPFlag[ layerIdInVps ] = val; }
     1174  Bool    getIVPFlag( Int layerIdInVps )                              { return m_bIVPFlag[ layerIdInVps ]; }
     1175#endif
     1176
     1177#if SEC_HLS_CLEANUP_I0100
     1178  Bool    getIvMvScalingFlag   ( Int layerIdInVps )                        { return m_ivMvScalingFlag[ layerIdInVps ]; }
     1179  Void    setIvMvScalingFlag   (Int layerIdInVps, Bool b )                 { m_ivMvScalingFlag[ layerIdInVps ] = b;    } 
     1180#else
    11471181  Bool    getIvMvScalingFlag   (  )                       { return m_ivMvScalingFlag; }
    11481182  Void    setIvMvScalingFlag   ( Bool b )                 { m_ivMvScalingFlag = b;    } 
     1183#endif
     1184
    11491185#if H_3D_INTER_SDC
    11501186  Bool    getInterSDCFlag      ( Int layerIdInVps )           { return m_bInterSDCFlag[layerIdInVps]; }
     
    11711207  Bool        m_bInterViewDltPredEnableFlag[ MAX_NUM_LAYERS ];
    11721208
     1209#if !FIX_TICKET_77
    11731210  Int         m_iBitsPerDepthValue       [ MAX_NUM_LAYERS ];
     1211#endif
    11741212  Int         m_iNumDepthmapValues       [ MAX_NUM_LAYERS ];
    11751213  Int*        m_iDepthValue2Idx          [ MAX_NUM_LAYERS ];
     
    11981236  UInt    getDepthViewBitDepth()                          { return m_uiDepthViewBitDepth; }
    11991237
     1238#if !FIX_TICKET_77
    12001239  Int     getBitsPerDepthValue( Int layerIdInVps )        { return getUseDLTFlag(layerIdInVps)?m_iBitsPerDepthValue[layerIdInVps]:g_bitDepthY; }
     1240#endif
    12011241  Int     getNumDepthValues( Int layerIdInVps )           { return getUseDLTFlag(layerIdInVps)?m_iNumDepthmapValues[layerIdInVps]:((1 << g_bitDepthY)-1); }
    12021242  Int     depthValue2idx( Int layerIdInVps, Pel value )   { return getUseDLTFlag(layerIdInVps)?m_iDepthValue2Idx[layerIdInVps][value]:value; }
     1243#if RWTH_DLT_CLIP_I0057
     1244  Pel     idx2DepthValue( Int layerIdInVps, UInt uiIdx )  { return getUseDLTFlag(layerIdInVps)?m_iIdx2DepthValue[layerIdInVps][ClipY(uiIdx)]:uiIdx; }
     1245#else
    12031246  Pel     idx2DepthValue( Int layerIdInVps, UInt uiIdx )  { return getUseDLTFlag(layerIdInVps)?m_iIdx2DepthValue[layerIdInVps][uiIdx]:uiIdx; }
     1247#endif
    12041248  Void    setDepthLUTs( Int layerIdInVps, Int* idx2DepthValue = NULL, Int iNumDepthValues = 0 );
    12051249#if H_3D_DELTA_DLT
     
    14661510  Bool        m_useAMP;
    14671511
     1512#if !MTK_I0099_VPS_EX2
    14681513#if H_3D_QTLPC
    14691514  Bool        m_bUseQTL;
    14701515  Bool        m_bUsePC;
     1516#endif
    14711517#endif
    14721518  // Parameter
     
    17321778
    17331779#endif
     1780#if !MTK_I0099_VPS_EX2
    17341781#if H_3D_QTLPC
    17351782  Void setUseQTL( Bool b ) { m_bUseQTL = b;    }
     
    17371784  Void setUsePC ( Bool b ) { m_bUsePC  = b;    }
    17381785  Bool getUsePC ()         { return m_bUsePC;  }
     1786#endif
    17391787#endif
    17401788#if H_MV
     
    22052253  UInt         m_aiDDDShift    [MAX_NUM_LAYERS];
    22062254#endif
    2207 
     2255#if MTK_SINGLE_DEPTH_MODE_I0095
     2256  Bool      m_bApplySingleDepthMode;
     2257#endif
    22082258public:
    22092259  TComSlice();
     
    22752325#if H_3D
    22762326  TComPic*  getTexturePic       ()                              { return  m_ivPicsCurrPoc[0][ m_viewIndex ]; }
     2327#endif
     2328#if MTK_SINGLE_DEPTH_MODE_I0095
     2329  Void      setApplySingleDepthMode( Bool b )                                { m_bApplySingleDepthMode = b; }
     2330  Bool      getApplySingleDepthMode()                                        { return m_bApplySingleDepthMode; }
    22772331#endif
    22782332#if H_3D_IC
     
    25092563  Int* getDepthToDisparityF( Int refViewIdx ) { return m_depthToDisparityF[ refViewIdx ]; };
    25102564  Bool getVpsDepthModesFlag  ()  { return getVPS()->getVpsDepthModesFlag( getVPS()->getLayerIdInVps( m_layerId ) ); }
    2511 
     2565#if SEPARATE_FLAG_I0085
     2566  Bool getIVPFlag       ()  { return getVPS()->getIVPFlag( getVPS()->getLayerIdInVps( m_layerId ) ); }
     2567#endif
    25122568#endif
    25132569#if H_MV
  • trunk/source/Lib/TLibCommon/TComWedgelet.cpp

    r655 r1039  
    6868                                                            m_uiHeight ( rcWedge.m_uiHeight  ),
    6969                                                            m_pbPattern( (Bool*)xMalloc( Bool, (m_uiWidth * m_uiHeight) ) )
     70#if SHARP_DMM1_I0110
     71                                                            ,m_pbScaledPattern( g_wedgePattern )
     72#endif
    7073{
    7174  ::memcpy( m_pbPattern, rcWedge.m_pbPattern, sizeof(Bool) * (m_uiWidth * m_uiHeight));
     
    8588
    8689  m_pbPattern = (Bool*)xMalloc( Bool, (m_uiWidth * m_uiHeight) );
     90#if SHARP_DMM1_I0110
     91  m_pbScaledPattern = g_wedgePattern;
     92#endif
    8793}
    8894
     
    181187  switch( m_eWedgeRes )
    182188  {
     189#if !SHARP_DMM1_I0110
    183190  case( DOUBLE_PEL ): { uiTempBlockSize =  m_uiWidth;     uhXs = (m_uhXs<<1); uhYs = (m_uhYs<<1); uhXe = (m_uhXe<<1); uhYe = (m_uhYe<<1); } break;
     191#endif
    184192  case(   FULL_PEL ): { uiTempBlockSize =  m_uiWidth;     uhXs =  m_uhXs;     uhYs =  m_uhYs;     uhXe =  m_uhXe;     uhYe =  m_uhYe;     } break;
    185193  case(   HALF_PEL ): { uiTempBlockSize = (m_uiWidth<<1); uhXs =  m_uhXs;     uhYs =  m_uhYs;     uhXe =  m_uhXe;     uhYe =  m_uhYe;     } break;
    186194  }
    187195
     196#if !SHARP_DMM1_I0110
    188197  if( m_eWedgeRes == DOUBLE_PEL) // adjust line-end for DOUBLE_PEL resolution
    189198  {
     
    194203    if( m_uhOri == 5 ) { uhXs = uiTempBlockSize-1; }
    195204  }
     205#endif
    196206
    197207  Bool* pbTempPattern = new Bool[ (uiTempBlockSize * uiTempBlockSize) ];
     
    223233  switch( m_eWedgeRes )
    224234  {
     235#if !SHARP_DMM1_I0110
    225236  case( DOUBLE_PEL ): { for( UInt k = 0; k < (m_uiWidth * m_uiHeight); k++ ) { m_pbPattern[k] = pbTempPattern[k]; }; } break;
     237#endif
    226238  case(   FULL_PEL ): { for( UInt k = 0; k < (m_uiWidth * m_uiHeight); k++ ) { m_pbPattern[k] = pbTempPattern[k]; }; } break;
    227239  case(   HALF_PEL ): // sub-sampling by factor 2
     
    315327}
    316328
     329#if SHARP_DMM1_I0110
     330Bool* TComWedgelet::getScaledPattern(UInt uiDstSize)
     331{
     332    Bool *pbSrcPat = this->getPattern();
     333    UInt uiSrcSize = this->getStride();
     334
     335    Int scale = (g_aucConvertToBit[uiDstSize] - g_aucConvertToBit[uiSrcSize]);
     336    assert(scale>=0);
     337    for (Int y=0; y<uiDstSize; y++)
     338    {
     339       for (Int x=0; x<uiDstSize; x++)
     340       {
     341           Int srcX = x>>scale;
     342           Int srcY = y>>scale;
     343           m_pbScaledPattern[y*uiDstSize + x] = pbSrcPat[ srcY*uiSrcSize + srcX ];
     344       }
     345   }
     346   return m_pbScaledPattern;
     347}
     348#endif
     349
    317350TComWedgeNode::TComWedgeNode()
    318351{
  • trunk/source/Lib/TLibCommon/TComWedgelet.h

    r773 r1039  
    5858#define DIM_NO_IDX     MAX_UINT
    5959
     60#if HS_DMM_SIGNALLING_I0120
     61__inline UInt getDimType  ( Int intraMode )
     62{
     63    Int dimType = intraMode-DIM_OFFSET;
     64    return (dimType >= 0 && dimType < DIM_NUM_TYPE) ? (UInt)dimType : DIM_NO_IDX;
     65}
     66#else
    6067__inline UInt getDimType  ( Int intraMode ) { Int dimType = (intraMode-DIM_OFFSET)/2; return (dimType >= 0 && dimType < DIM_NUM_TYPE) ? (UInt)dimType : DIM_NO_IDX; }
     68#endif
    6169__inline Bool isDimMode   ( Int intraMode ) { return (getDimType( intraMode ) < DIM_NUM_TYPE); }
     70#if !HS_DMM_SIGNALLING_I0120
    6271__inline Bool isDimDeltaDC( Int intraMode ) { return (isDimMode( intraMode ) && ((intraMode-DIM_OFFSET)%2) == 1); }
     72#endif
    6373#endif
    6474
     
    6979enum WedgeResolution
    7080{
     81#if !SHARP_DMM1_I0110
    7182  DOUBLE_PEL,
     83#endif
    7284  FULL_PEL,
    7385  HALF_PEL
     
    94106
    95107  Bool* m_pbPattern;
     108#if SHARP_DMM1_I0110
     109  Bool* m_pbScaledPattern;
     110#endif
    96111
    97112  Void  xGenerateWedgePattern();
     
    119134  Bool            getIsCoarse() { return m_bIsCoarse; }
    120135  UInt            getAng     () { return m_uiAng; }
     136#if SHARP_DMM1_I0110
     137  Bool*           getScaledPattern(UInt uiWidth);
     138#endif
    121139
    122140  Void  setWedgelet( UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe, UChar uhOri, WedgeResolution eWedgeRes, Bool bIsCoarse = false );
  • trunk/source/Lib/TLibCommon/TComYuv.cpp

    r872 r1039  
    689689  UInt iSrc1Stride = pcYuvSrc1->getStride();
    690690  UInt iDstStride  = getStride();
     691#if QC_I0129_ARP_FIX
     692  Int iIFshift = IF_INTERNAL_PREC - g_bitDepthY;
     693  Int iOffSet  = ( 1 << ( iIFshift - 1 ) ) + IF_INTERNAL_OFFS;
     694#endif
    691695  for ( y = uiHeight-1; y >= 0; y-- )
    692696  {
     
    696700      if( bClip )
    697701      {
     702#if QC_I0129_ARP_FIX
     703        pDst[x] = ClipY( ( pDst[x] + iOffSet ) >> iIFshift );
     704#else
    698705        pDst[x] = ClipY( pDst[x] );
     706#endif
    699707      }
    700708    }
     
    719727  UInt  iSrc1Stride = pcYuvSrc1->getCStride();
    720728  UInt  iDstStride  = getCStride();
     729#if QC_I0129_ARP_FIX
     730  Int iIFshift = IF_INTERNAL_PREC - g_bitDepthC;
     731  Int iOffSet  = ( 1 << ( iIFshift - 1 ) ) + IF_INTERNAL_OFFS;
     732#endif
    721733  for ( y = uiHeight-1; y >= 0; y-- )
    722734  {
     
    727739      if( bClip )
    728740      {
     741#if QC_I0129_ARP_FIX
     742        pDstU[x] = ClipC( ( pDstU[x] + iOffSet ) >> iIFshift );
     743        pDstV[x] = ClipC( ( pDstV[x] + iOffSet ) >> iIFshift );
     744#else
    729745        pDstU[x] = ClipC( pDstU[x] );
    730746        pDstV[x] = ClipC( pDstV[x] );
     747#endif
    731748      }
    732749    }
     
    744761{
    745762  subtractARPLuma  ( pcYuvSrc0, pcYuvSrc1,  uiAbsPartIdx, uiWidth    , uiHeight    );
     763#if SHARP_ARP_CHROMA_I0104
     764  if (uiWidth > 8)
     765#endif
    746766  subtractARPChroma( pcYuvSrc0, pcYuvSrc1,  uiAbsPartIdx, uiWidth>>1 , uiHeight>>1 );
    747767}
     
    803823{
    804824  multiplyARPLuma( uiAbsPartIdx , uiWidth , uiHeight , dW );
     825#if SHARP_ARP_CHROMA_I0104
     826  if (uiWidth > 8)
     827#endif
    805828  multiplyARPChroma( uiAbsPartIdx , uiWidth >> 1 , uiHeight >> 1 , dW );
    806829}
  • trunk/source/Lib/TLibCommon/TypeDef.h

    r976 r1039  
    6868#define BUG_FIX_TK65        1
    6969
     70#define MTK_I0093           1
    7071/////////////////////////////////////////////////////////////////////////////////////////
    7172///////////////////////////////////   MAJOR DEFINES   /////////////////////////////////// 
     
    123124                                              // MTK_LOW_LATENCY_IC_ENCODING_H0086  Low-latency IC encoding in JCT3V-H0086
    124125
     126#define SEC_IC_NEIGHBOR_CLIP_I0080        1   // Clipping of neighboring sample position, JCT3V-I0080
     127
    125128
    126129#if H_3D_NBDV
     
    172175                                              // MTK_DIS_SPBIP8X4_H0205        Disable bi-prediction for 8x4 and 4x8 sub PU and remove the SPIVMP 2Nx2N restriction
    173176                                              // SEC_ADAPT_DISABLE_IVMP        Disalbing IVMP merge candidates when IC is enabled, JCT3V-H0070
     177
     178#define SEC_SIMP_SHIFTED_DV_I0086         1   // Simplification of Shifted DV candidate, JCT3V-I0086
    174179
    175180#define H_3D_TMVP                         1   // QC_TMVP_C0047
     
    215220                                              // MTK_DLT_CODING_FIX_H0091
    216221
     222#define MTK_SINGLE_DEPTH_MODE_I0095       1   // Single depth mode proposed in JCT3V-I0095
     223#if MTK_SINGLE_DEPTH_MODE_I0095
     224#define MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE            2 // size of the sample candidate list
     225#endif
    217226
    218227#define H_3D_INTER_SDC                    1   // INTER SDC, Inter simplified depth coding
     
    233242                                              // H_3D_FIX_DBBP_IVMP        Fix . Enable IVMP is always disabled, when DBBP is enabled. The original intention is to disable Sub-PU IVMP when DBBP is enabled, not to disable IVMP itself.
    234243
     244#define SEC_DBBP_EXPLICIT_SIG_I0077       1   // Remove the partition derivation and signal dbbp_flag only when the partion mode is 2NxN/Nx2N, JCT3V-I0077
     245#define SEC_DBBP_DISALLOW_8x8_I0078       1   // Disallow DBBP in 8x8 CU, JCT3V-I0078
     246#define SHARP_DBBP_SIMPLE_FLTER_I0109     1   // Simple condition and one dimensional dilter for DBBP
     247#define SEC_DBBP_DMM4_THRESHOLD_I0076     1   // Simplification of threshold derivation for DBBP and DMM4, JCT3V-I0076
     248
    235249
    236250#define H_3D_DDD                          1   // Disparity derived depth coding
     
    238252#define H_3D_FCO                          0   // Flexible coding order for 3D
    239253
    240 
     254#define SCU_HS_FAST_INTRA_SDC_I0123       1
    241255
    242256// OTHERS
     
    250264#endif
    251265
     266#define MTK_I0099_VPS_EX2                 1  ///< JCT3V-I0099, sub-PU size signaling and lim_qt_pred_flag in VPS extension 2
     267#define MTK_I0099_FIX                     1  ///< Fix the problem of removing encoder only QTL
     268
    252269// Rate Control
    253270#define KWU_FIX_URQ                       1
     
    255272#define KWU_RC_MADPRED_E0227              0  ///< JCT3V-E0227, inter-view MAD prediction
    256273
     274#define SEC_VPS_CLEANUP_I0090             1
     275#define SEC_HLS_CLEANUP_I0100             1
     276
    257277#endif // H_3D
    258278
     
    262282///////////////////////////////////   DERIVED DEFINES /////////////////////////////////// 
    263283/////////////////////////////////////////////////////////////////////////////////////////
     284
     285// Fixes
     286#define FIX_TICKET_79                     1    // Unused VSP code
     287#define FIX_TICKET_75                     1    // Bi-pred restriction bug in VSP
     288#define FIX_TICKET_68                     1    // MV clipping bug in the sub-PU MPI default MV generation
     289#define FIX_TICKET_71                     1    // IC parameters is meaningless in HTM when no training samples are available
     290#define FIX_TICKET_77                     1    // Unused variable m_iBitsPerDepthValue
     291#define FIX_TICKET_76                     1    // unused functions
     292#define FIX_TICKET_62                     1    // buffer overflow for print
     293#define FIX_TICKET_61                     1    // layerIdsInSets size check
    264294
    265295///// ***** VIEW SYNTHESIS OPTIMIZAION *********
     
    283313#if H_3D_ARP
    284314#define H_3D_ARP_WFNR                     3
     315#define QC_I0129_ARP_FIX                  1
     316#define QC_I0051_ARP_SIMP                 1
     317#define SHARP_ARP_CHROMA_I0104            1
     318#define MTK_I0072_IVARP_SCALING_FIX       1
    285319#endif
    286320
     
    290324#define H_3D_DIM_SDC                      1   // Simplified Depth Coding method
    291325#define H_3D_DIM_DLT                      1   // Depth Lookup Table
     326#define HS_DMM_SIGNALLING_I0120  1   
     327#define SHARP_DMM1_I0110                  1   // LUT size reduction for DMM1 proposed in JCT3V-I0110
     328#define FIX_WARNING                       1   // fix narrowing conversion of NumPocStCurr0,NumPocStCurr1 at TComSlice.cpp
     329#define FAST_SDC_OFFSET_DECISION_I0084    1
     330#define SEPARATE_FLAG_I0085               1
    292331
    293332#if H_3D_DIM_DLT
    294333#define H_3D_DELTA_DLT                    1
     334#define RWTH_DLT_CLIP_I0057               1
    295335#endif
    296336#define H_3D_DIM_ENC                      1   // Depth Intra encoder optimizations, includes:
    297337                                              // HHI_DEPTH_INTRA_SEARCH_RAU_C0160
    298338                                              // LG_ZEROINTRADEPTHRESI_A0087
     339#define HHI_DMM4_ENC_I0066                1
    299340#endif
    300341///// ***** VIEW SYNTHESIS PREDICTION *********
     
    381422
    382423// OTHERS
    383 //#define H_MV_HLS_8_HSB_Q0041_03  0 // #3  (HS     /Q0041/hybrid scalability) The proposed text was endorsed, with non-editorial open issues considered as follows
    384 :// #define H_MV_HLS_7_OTHER_P0187_1          0 // (OTHER/P0187/NoOutputOfPriorPicsFlag) #1 Inference of NoOutputOfPriorPicsFlag and proposes to take into account colour format and bit depth for the inference in addition to spatial resolution
     424//#define H_MV_HLS_8_HSB_Q0041_03  0 // #3  (HS     /Q0041/hybrid scalability) The proposed text was endorsed, with non-editorial open issues considered as follows ?// #define H_MV_HLS_7_OTHER_P0187_1          0 // (OTHER/P0187/NoOutputOfPriorPicsFlag) #1 Inference of NoOutputOfPriorPicsFlag and proposes to take into account colour format and bit depth for the inference in addition to spatial resolution
    385425//#define H_MV_HLS_8_MIS_Q0078_24  0 // #24 (MISC   /Q0078/scan and pic type) , Items 3 b,c and 4, clarifying which pictures in an output layer sets are applied the values of general_progressive_source_flag, general_interlaced_source_flag, general_non_packed_constraint_flag and general_frame_only_constraint_flag.
    386426//#define H_MV_HLS_7_HRD_P0138_6   0 //     (HRD/P0138/HRD parameters for bitstreams excluding) #6 Decision: Adopt (as revised in updated contribution, with the specification of a flag in the BP SEI (HRD/P0192/sub-DPB) #12 Establish sub-DPBs based on the representation format indicated at the VPS level. It was suggested that the expressed shared capacity limit would need to be less than or equal to the sum of the individual capacity limits. Decision: Adopt as modified. Further study is encouraged on profile/level constraint selections.
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r976 r1039  
    10511051Void TDecCavlc::parseSPSExtension2( TComSPS* pcSPS, Int viewIndex, Bool depthFlag )
    10521052{
     1053#if !MTK_I0099_VPS_EX2
    10531054  UInt uiCode;
    10541055#if H_3D_QTLPC
     
    10611062    pcSPS->setUsePC( uiCode );
    10621063  }
     1064#endif
    10631065#endif
    10641066}
     
    17561758{
    17571759  UInt uiCode;
     1760#if SEC_VPS_CLEANUP_I0090
     1761  for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
     1762#else
    17581763  for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ )
     1764#endif
    17591765  {
    17601766#if H_3D_ARP
     
    17651771    pcVPS->setSubPULog2Size(i, 0);
    17661772#endif
     1773#if !SEC_VPS_CLEANUP_I0090
    17671774    if ( i != 0 )
    1768     {
     1775#endif
     1776    {
     1777#if MTK_I0099_VPS_EX2
     1778      READ_FLAG( uiCode, "iv_mv_pred_flag[i]");          pcVPS->setIvMvPredFlag         ( i, uiCode == 1 ? true : false );
     1779#if SEC_HLS_CLEANUP_I0100
     1780      READ_FLAG( uiCode, "iv_mv_scaling_flag[i]");       pcVPS->setIvMvScalingFlag         ( i, uiCode == 1 ? true : false );
     1781#endif
     1782#endif
    17691783      if( !( pcVPS->getDepthId( i ) == 1 ) )
    17701784      {
    17711785#if H_3D_IV_MERGE
     1786#if !MTK_I0099_VPS_EX2
    17721787        READ_FLAG( uiCode, "iv_mv_pred_flag[i]");          pcVPS->setIvMvPredFlag         ( i, uiCode == 1 ? true : false );
     1788#endif
    17731789        if( !pcVPS->getNumDirectRefLayers(i) )
    17741790        {
     
    18021818      else
    18031819      {
     1820#if !MTK_I0099_VPS_EX2
    18041821#if H_3D_IV_MERGE
    18051822        if(i!=1)
     
    18181835        }
    18191836#endif
     1837#endif
    18201838#if H_3D_IV_MERGE
    18211839        READ_FLAG( uiCode, "mpi_flag[i]" );             pcVPS->setMPIFlag( i, uiCode == 1 ? true : false );
    18221840#endif
     1841#if MTK_I0099_VPS_EX2
     1842        READ_UVLC (uiCode, "log2_mpi_sub_PU_size_minus3[i]");     pcVPS->setSubPUMPILog2Size(i, uiCode+3);
     1843#endif
    18231844        READ_FLAG( uiCode, "vps_depth_modes_flag[i]" );             pcVPS->setVpsDepthModesFlag( i, uiCode == 1 ? true : false );
    1824         //          READ_FLAG( uiCode, "lim_qt_pred_flag[i]");                  pcVPS->setLimQtPreFlag     ( i, uiCode == 1 ? true : false );
     1845#if SEPARATE_FLAG_I0085
     1846        READ_FLAG( uiCode, "ivp_flag[i]" );                   pcVPS->setIVPFlag( i, uiCode == 1 ? true : false );
     1847#endif
     1848#if MTK_I0099_VPS_EX2
     1849        READ_FLAG( uiCode, "lim_qt_pred_flag[i]");                  pcVPS->setLimQtPredFlag     ( i, uiCode == 1 ? true : false );
     1850#endif
    18251851#if H_3D_INTER_SDC
    18261852            READ_FLAG( uiCode, "depth_inter_SDC_flag" );              pcVPS->setInterSDCFlag( i, uiCode ? true : false );
     
    18351861
    18361862  READ_UVLC( uiCamParPrecision, "cp_precision" );
     1863#if SEC_VPS_CLEANUP_I0090
     1864  for (UInt viewIndex=1; viewIndex<pcVPS->getNumViews(); viewIndex++)
     1865#else
    18371866  for (UInt viewIndex=0; viewIndex<pcVPS->getNumViews(); viewIndex++)
     1867#endif
    18381868  {
    18391869    pcVPS->setCamParPresent         ( viewIndex, false );
     
    18571887    }
    18581888  }
     1889#if !MTK_I0099_VPS_EX2
    18591890  READ_UVLC (uiCode, "log2_sub_PU_MPI_size_minus3");              pcVPS->setSubPUMPILog2Size( uiCode + 3 );
     1891#endif
     1892#if !SEC_HLS_CLEANUP_I0100
    18601893  READ_FLAG( uiCode, "iv_mv_scaling_flag");                       pcVPS->setIvMvScalingFlag( uiCode == 1 ? true : false );
     1894#endif
    18611895}
    18621896#endif
     
    24592493    }
    24602494#if H_3D_IC
     2495#if SEC_HLS_CLEANUP_I0100
     2496    else if( rpcSlice->getViewIndex() && ( rpcSlice->getSliceType() == P_SLICE || rpcSlice->getSliceType() == B_SLICE ) && !rpcSlice->getIsDepth() && vps->getNumDirectRefLayers( layerId ) > 0 )
     2497#else
    24612498    else if( rpcSlice->getViewIndex() && ( rpcSlice->getSliceType() == P_SLICE || rpcSlice->getSliceType() == B_SLICE ) && !rpcSlice->getIsDepth())
     2499#endif
    24622500    {
    24632501      UInt uiCodeTmp = 0;
     
    24712509        rpcSlice->setIcSkipParseFlag( uiCodeTmp );
    24722510      }
     2511    }
     2512#endif
     2513#if MTK_SINGLE_DEPTH_MODE_I0095
     2514    if(rpcSlice->getIsDepth())
     2515    {
     2516      UInt uiCodeTmp = 0;
     2517      READ_FLAG( uiCodeTmp, "slice_enable_single_depth_mode" );
     2518      rpcSlice->setApplySingleDepthMode(uiCodeTmp);
    24732519    }
    24742520#endif
     
    28432889  assert(0);
    28442890}
    2845 
     2891#if MTK_SINGLE_DEPTH_MODE_I0095
     2892Void TDecCavlc::parseSingleDepthMode( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ )
     2893{
     2894  assert(0);
     2895}
     2896#endif
    28462897Void TDecCavlc::parseCUTransquantBypassFlag( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ )
    28472898{
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.h

    r976 r1039  
    119119 
    120120  Void  parseSkipFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     121#if MTK_SINGLE_DEPTH_MODE_I0095
     122  Void  parseSingleDepthMode        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     123#endif 
    121124  Void  parseCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    122125  Void parseMergeFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx );
  • trunk/source/Lib/TLibDecoder/TDecCu.cpp

    r976 r1039  
    420420    Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    421421    memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
     422#if !FIX_TICKET_79
    422423    InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
     424#endif
    423425#if H_3D_SPIVMP
    424426    Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM];
     
    432434    m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
    433435    m_ppcCU[uiDepth]->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours
     436#if !FIX_TICKET_79
    434437      , inheritedVSPDisInfo
     438#endif
    435439#if H_3D_SPIVMP
    436440      , pcMvFieldSP, puhInterDirSP
     
    453457#endif
    454458#endif
    455 #if H_3D_VSP
     459#if H_3D_VSP && !FIX_TICKET_79
    456460    if(vspFlag[uiMergeIndex])
    457461    {
     
    542546    return;
    543547  }
    544 
     548#if MTK_SINGLE_DEPTH_MODE_I0095
     549  m_pcEntropyDecoder->decodeSingleDepthMode( pcCU, uiAbsPartIdx, uiDepth );
     550  if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
     551  {
     552#endif
    545553  m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth );
    546554  m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth );
     
    572580  m_pcEntropyDecoder->decodeCoeff( pcCU, uiAbsPartIdx, uiDepth, uiCurrWidth, uiCurrHeight, bCodeDQP );
    573581  setdQPFlag( bCodeDQP );
     582#if MTK_SINGLE_DEPTH_MODE_I0095
     583  }
     584#endif
    574585  xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast );
    575586#if H_3D_IV_MERGE
     
    671682      break;
    672683    case MODE_INTRA:
     684#if MTK_SINGLE_DEPTH_MODE_I0095
     685      if( m_ppcCU[uiDepth]->getSingleDepthFlag(0) )
     686        xReconIntraSingleDepth( m_ppcCU[uiDepth], 0, uiDepth );
     687#if H_3D_DIM_SDC
     688      else if( m_ppcCU[uiDepth]->getSDCFlag(0) )
     689        xReconIntraSDC( m_ppcCU[uiDepth], 0, uiDepth );
     690#endif
     691      else
     692#else
    673693#if H_3D_DIM_SDC
    674694      if( m_ppcCU[uiDepth]->getSDCFlag(0) )
    675695        xReconIntraSDC( m_ppcCU[uiDepth], 0, uiDepth );
    676696      else
     697#endif
    677698#endif
    678699      xReconIntraQT( m_ppcCU[uiDepth], uiDepth );
     
    709730  }
    710731}
    711 
     732#if MTK_SINGLE_DEPTH_MODE_I0095
     733Void TDecCu::xReconIntraSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     734{
     735  UInt uiWidth        = pcCU->getWidth  ( 0 );
     736  UInt uiHeight       = pcCU->getHeight ( 0 );
     737
     738  TComYuv* pcRecoYuv  = m_ppcYuvReco[uiDepth];
     739
     740  UInt    uiStride    = pcRecoYuv->getStride  ();
     741  Pel*    piReco      = pcRecoYuv->getLumaAddr( uiAbsPartIdx );
     742
     743
     744  AOF( uiWidth == uiHeight );
     745  AOF( uiAbsPartIdx == 0 );
     746
     747  //construction of depth candidates
     748  Pel testDepth;
     749  Pel DepthNeighbours[5];
     750  Int index =0;
     751  for( Int i = 0; (i < 5) && (index<MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE) ; i++ )
     752  {
     753    if(!pcCU->getNeighDepth (0, uiAbsPartIdx, &testDepth, i))
     754    {
     755      continue;
     756    }
     757    DepthNeighbours[index]=testDepth;
     758    index++;
     759    for(Int j=0;j<index-1;j++)
     760    {
     761     if( (DepthNeighbours[index-1]==DepthNeighbours[j]) )
     762     {
     763       index--;
     764       break;
     765     }
     766    }
     767  }
     768
     769  if(index==0)
     770  {
     771    DepthNeighbours[index]=1<<(g_bitDepthY-1);
     772    index++;
     773  }
     774
     775  if(index==1)
     776  {
     777    DepthNeighbours[index]=ClipY(DepthNeighbours[0] + 1 );
     778    index++;
     779  }
     780
     781  for( UInt uiY = 0; uiY < uiHeight; uiY++ )
     782  {
     783    for( UInt uiX = 0; uiX < uiWidth; uiX++ )
     784    {
     785      piReco[ uiX ] =DepthNeighbours[(Int)pcCU->getSingleDepthValue(uiAbsPartIdx)];
     786    }
     787    piReco     += uiStride;
     788  }
     789
     790  // clear UV
     791  UInt  uiStrideC     = pcRecoYuv->getCStride();
     792  Pel   *pRecCb       = pcRecoYuv->getCbAddr();
     793  Pel   *pRecCr       = pcRecoYuv->getCrAddr();
     794
     795  for (Int y=0; y<uiHeight/2; y++)
     796  {
     797    for (Int x=0; x<uiWidth/2; x++)
     798    {
     799      pRecCb[x] = 1<<(g_bitDepthC-1);
     800      pRecCr[x] = 1<<(g_bitDepthC-1);
     801    }
     802
     803    pRecCb += uiStrideC;
     804    pRecCr += uiStrideC;
     805  }
     806}
     807#endif
    712808#if H_3D_INTER_SDC
    713809Void TDecCu::xReconInterSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     
    832928 
    833929  // reconstruct final prediction signal by combining both segments
     930#if SHARP_DBBP_SIMPLE_FLTER_I0109
     931  m_pcPrediction->combineSegmentsWithMask(apSegPredYuv, m_ppcYuvReco[uiDepth], pMask, pcCU->getWidth(0), pcCU->getHeight(0), 0, ePartSize);
     932#else
    834933  m_pcPrediction->combineSegmentsWithMask(apSegPredYuv, m_ppcYuvReco[uiDepth], pMask, pcCU->getWidth(0), pcCU->getHeight(0));
     934#endif
    835935 
    836936  // inter recon
     
    12061306  {
    12071307    Int uiTabIdx = pcCU->getDmmWedgeTabIdx(DMM1_IDX, uiAbsPartIdx);
    1208    
     1308
     1309#if SHARP_DMM1_I0110
     1310    WedgeList* pacWedgeList  = pcCU->isDMM1UpscaleMode(uiWidth) ? &g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])] :  &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];
     1311#else
    12091312    WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];
     1313#endif
    12101314    TComWedgelet* pcWedgelet = &(pacWedgeList->at( uiTabIdx ));
    1211    
     1315
    12121316    uiNumSegments = 2;
     1317
     1318#if SHARP_DMM1_I0110
     1319    pbMask       = pcCU->isDMM1UpscaleMode( uiWidth ) ? pcWedgelet->getScaledPattern(uiWidth) : pcWedgelet->getPattern();
     1320    uiMaskStride = pcCU->isDMM1UpscaleMode( uiWidth ) ? uiWidth : pcWedgelet->getStride();
     1321#else
    12131322    pbMask = pcWedgelet->getPattern();
    12141323    uiMaskStride = pcWedgelet->getStride();
     1324#endif
    12151325  }
    12161326  if( getDimType( uiLumaPredMode ) == DMM4_IDX )
  • trunk/source/Lib/TLibDecoder/TDecCu.h

    r872 r1039  
    123123  Void setdQPFlag               ( Bool b )                { m_bDecodeDQP = b;           }
    124124  Void xFillPCMBuffer           (TComDataCU* pCU, UInt depth);
     125#if MTK_SINGLE_DEPTH_MODE_I0095
     126  Void xReconIntraSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     127#endif
    125128#if H_3D_DIM_SDC
    126129  Void xReconIntraSDC           ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
  • trunk/source/Lib/TLibDecoder/TDecEntropy.cpp

    r976 r1039  
    5252  m_pcEntropyDecoderIf->parseSkipFlag( pcCU, uiAbsPartIdx, uiDepth );
    5353}
    54 
     54#if MTK_SINGLE_DEPTH_MODE_I0095
     55Void TDecEntropy::decodeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     56{
     57  if ( !pcCU->getSlice()->getIsDepth() )
     58  {
     59    return;
     60  }
     61  if(!pcCU->getSlice()->getApplySingleDepthMode())
     62  {
     63     return;
     64  }
     65  m_pcEntropyDecoderIf->parseSingleDepthMode( pcCU, uiAbsPartIdx, uiDepth );
     66}
     67#endif
    5568Void TDecEntropy::decodeCUTransquantBypassFlag(TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    5669{
     
    140153#if H_3D_DBBP
    141154
     155#if SEC_DBBP_EXPLICIT_SIG_I0077
     156#if SEC_DBBP_DISALLOW_8x8_I0078
     157  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) && pcCU->getWidth(uiAbsPartIdx) > 8 )
     158#else
     159  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) )
     160#endif
     161#else
     162#if SEC_DBBP_DISALLOW_8x8_I0078
     163  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && pcCU->getWidth(uiAbsPartIdx) > 8 )
     164#else
    142165  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) )
     166#endif
     167#endif
    143168  {
    144169    decodeDBBPFlag(pcCU, uiAbsPartIdx, uiDepth);
    145    
     170#if !SEC_DBBP_EXPLICIT_SIG_I0077   
    146171    if( pcCU->getDBBPFlag(uiAbsPartIdx) )
    147172    {
     
    167192      pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx+uiPUOffset, 1, uiDepth);
    168193    }
     194#endif
    169195  }
    170196#endif
     
    285311          Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    286312          memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
     313#if !FIX_TICKET_79
    287314          InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
     315#endif
    288316#if H_3D_SPIVMP
    289317          memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
     
    292320          pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand);
    293321          pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours
     322#if !FIX_TICKET_79
    294323            , inheritedVSPDisInfo
     324#endif
    295325#if H_3D_SPIVMP
    296326            , pcMvFieldSP, puhInterDirSP
     
    304334          pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
    305335
     336#if !FIX_TICKET_79
    306337          if(vspFlag[uiMergeIndex])
    307338          {
    308339            pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeIndex].m_acDvInfo, uiSubPartIdx, uiPartIdx, uiDepth);
    309340          }
     341#endif
    310342#else
    311343#if H_3D
     
    328360        Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
    329361        memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
     362#if !FIX_TICKET_79
    330363        InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
     364#endif
    331365#if H_3D_SPIVMP
    332366        memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
     
    335369        pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
    336370        pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours
     371#if !FIX_TICKET_79
    337372          , inheritedVSPDisInfo
     373#endif
    338374#if H_3D_SPIVMP
    339375          , pcMvFieldSP, puhInterDirSP
     
    346382          ,numValidMergeCand );
    347383        pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
     384#if !FIX_TICKET_79
    348385        if(vspFlag[uiMergeIndex])
    349386        {
    350387          pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeIndex].m_acDvInfo, uiSubPartIdx, uiPartIdx, uiDepth);
    351388        }
     389#endif
    352390#else
    353391#if H_3D
     
    447485#endif
    448486    }
    449 #if H_3D_VSP
     487#if H_3D_VSP && !FIX_TICKET_75
    450488    if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) && (pcCU->getVSPFlag(uiSubPartIdx) == 0))
    451489#else
  • trunk/source/Lib/TLibDecoder/TDecEntropy.h

    r976 r1039  
    8989public:
    9090  virtual Void parseSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     91#if MTK_SINGLE_DEPTH_MODE_I0095
     92  virtual Void parseSingleDepthMode       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     93#endif
    9194  virtual Void parseCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    9295  virtual Void parseSplitFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     
    176179  Void decodeSplitFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    177180  Void decodeSkipFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     181#if MTK_SINGLE_DEPTH_MODE_I0095
     182  Void decodeSingleDepthMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) ;
     183#endif
    178184  Void decodeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    179185  Void decodeMergeFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx );
  • trunk/source/Lib/TLibDecoder/TDecSbac.cpp

    r976 r1039  
    5252, m_cCUSplitFlagSCModel       ( 1,             1,               NUM_SPLIT_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels )
    5353, m_cCUSkipFlagSCModel        ( 1,             1,               NUM_SKIP_FLAG_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
     54#if MTK_SINGLE_DEPTH_MODE_I0095
     55, m_cCUSingleDepthFlagSCModel        ( 1,             1,               NUM_SINGLEDEPTH_FLAG_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
     56, m_cSingleDepthValueSCModel         ( 1,             1,               NUM_SINGLE_DEPTH_VALUE_DATA_CTX      , m_contextModels + m_numContextModels, m_numContextModels)
     57#endif
    5458, m_cCUMergeFlagExtSCModel    ( 1,             1,               NUM_MERGE_FLAG_EXT_CTX        , m_contextModels + m_numContextModels, m_numContextModels)
    5559, m_cCUMergeIdxExtSCModel     ( 1,             1,               NUM_MERGE_IDX_EXT_CTX         , m_contextModels + m_numContextModels, m_numContextModels)
     
    132136  m_cCUSplitFlagSCModel.initBuffer       ( sliceType, qp, (UChar*)INIT_SPLIT_FLAG );
    133137  m_cCUSkipFlagSCModel.initBuffer        ( sliceType, qp, (UChar*)INIT_SKIP_FLAG );
     138#if MTK_SINGLE_DEPTH_MODE_I0095
     139  m_cCUSingleDepthFlagSCModel.initBuffer        ( sliceType, qp, (UChar*)INIT_SINGLEDEPTH_FLAG );
     140  m_cSingleDepthValueSCModel.initBuffer         ( sliceType, qp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA );
     141#endif
    134142  m_cCUMergeFlagExtSCModel.initBuffer    ( sliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT );
    135143  m_cCUMergeIdxExtSCModel.initBuffer     ( sliceType, qp, (UChar*)INIT_MERGE_IDX_EXT );
     
    199207  m_cCUSplitFlagSCModel.initBuffer       ( eSliceType, iQp, (UChar*)INIT_SPLIT_FLAG );
    200208  m_cCUSkipFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG );
     209#if MTK_SINGLE_DEPTH_MODE_I0095
     210  m_cCUSingleDepthFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SINGLEDEPTH_FLAG );
     211  m_cSingleDepthValueSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA );
     212#endif
    201213  m_cCUMergeFlagExtSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT );
    202214  m_cCUMergeIdxExtSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT );
     
    420432#endif
    421433
     434#if !FIX_TICKET_76
    422435#if H_3D_DIM_SDC
    423436Void TDecSbac::xParseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiSegment )
     
    499512#endif
    500513#endif
    501 
     514#endif
    502515/** Parse I_PCM information.
    503516 * \param pcCU
     
    636649#endif
    637650}
    638 
     651#if MTK_SINGLE_DEPTH_MODE_I0095
     652Void TDecSbac::parseSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     653{
     654  pcCU->setSingleDepthFlagSubParts( false,        uiAbsPartIdx, uiDepth );
     655  UInt uiSymbol = 0;
     656  m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUSingleDepthFlagSCModel.get( 0, 0, 0 ) );
     657  if( uiSymbol )
     658  {
     659    pcCU->setSingleDepthFlagSubParts( true,        uiAbsPartIdx, uiDepth );
     660    pcCU->setSkipFlagSubParts( false,        uiAbsPartIdx, uiDepth );
     661    pcCU->setSDCFlagSubParts( false,        uiAbsPartIdx, uiDepth );
     662    pcCU->setPredModeSubParts( MODE_INTRA,  uiAbsPartIdx, uiDepth );
     663    pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
     664    pcCU->setLumaIntraDirSubParts (DC_IDX, uiAbsPartIdx, uiDepth );
     665    pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth );
     666    pcCU->setMergeFlagSubParts( false , uiAbsPartIdx, 0, uiDepth );
     667    pcCU->setTrIdxSubParts(0, uiAbsPartIdx, uiDepth);
     668    pcCU->setCbfSubParts(0, 1, 1, uiAbsPartIdx, uiDepth);
     669
     670    UInt absValDeltaDC = 0;
     671
     672    UInt uiUnaryIdx = 0;
     673    UInt uiNumCand = MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE;
     674    if ( uiNumCand > 1 )
     675    {
     676      for( ; uiUnaryIdx < uiNumCand - 1; ++uiUnaryIdx )
     677      {
     678        UInt uiSymbol2 = 0;
     679        if ( uiUnaryIdx==0 )
     680        {
     681          m_pcTDecBinIf->decodeBin( uiSymbol2, m_cSingleDepthValueSCModel.get( 0, 0, 0 ) );
     682        }
     683        else
     684        {
     685          m_pcTDecBinIf->decodeBinEP( uiSymbol2);
     686        }
     687        if( uiSymbol2 == 0 )
     688        {
     689          break;
     690        }
     691      }
     692    }
     693    absValDeltaDC = uiUnaryIdx;
     694    pcCU->setSingleDepthValueSubParts((Pel)absValDeltaDC,uiAbsPartIdx, 0, uiDepth);
     695  }
     696}
     697
     698#endif
    639699/** parse merge flag
    640700 * \param pcCU
     
    721781  Bool bParseSplitFlag    = true;
    722782
     783#if MTK_I0099_VPS_EX2
     784  TComVPS *vps           = pcCU->getPic()->getSlice(0)->getVPS();
     785  Bool    bLimQtPredFlag = vps->getLimQtPredFlag(pcCU->getPic()->getSlice(0)->getLayerId());
     786#else
    723787  TComSPS *sps            = pcCU->getPic()->getSlice(0)->getSPS();
     788#endif
    724789  TComPic *pcTexture      = pcCU->getSlice()->getTexturePic();
    725790  Bool bDepthMapDetect    = (pcTexture != NULL);
     
    728793  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);
    729794
     795#if MTK_I0099_VPS_EX2
     796  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFlag)
     797#else
    730798  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTL() && sps->getUsePC())
     799#endif
    731800  {
    732801    TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
     
    770839#if H_3D_QTLPC
    771840  Bool bParsePartSize    = true;
     841#if MTK_I0099_VPS_EX2
     842  TComVPS *vps           = pcCU->getPic()->getSlice(0)->getVPS();
     843  Bool    bLimQtPredFlag = vps->getLimQtPredFlag(pcCU->getPic()->getSlice(0)->getLayerId());
     844#else
    772845  TComSPS *sps           = pcCU->getPic()->getSlice(0)->getSPS();
     846#endif
    773847  TComPic *pcTexture     = pcCU->getSlice()->getTexturePic();
    774848  Bool bDepthMapDetect   = (pcTexture != NULL);
     
    779853  Bool depthDependent = false;
    780854  UInt uiTexturePart = uiMode;
     855#if MTK_I0099_VPS_EX2
     856  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFlag )
     857#else
    781858  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTL() && sps->getUsePC())
     859#endif
    782860  {
    783861    TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
     
    9901068  {
    9911069#if H_3D_DIM
     1070#if SEPARATE_FLAG_I0085
     1071    if( pcCU->getSlice()->getVpsDepthModesFlag() || pcCU->getSlice()->getIVPFlag() )
     1072#else
    9921073    if( pcCU->getSlice()->getVpsDepthModesFlag() )
     1074#endif
    9931075    {
    9941076      parseIntraDepth( pcCU, absPartIdx+partOffset*j, depth );
     
    11321214  if( uiIsDimMode )
    11331215  {
     1216#if SEPARATE_FLAG_I0085
     1217    if( pcCU->getSlice()->getVpsDepthModesFlag() && pcCU->getSlice()->getIVPFlag() )
     1218    {
     1219      m_pcTDecBinIf->decodeBin( uiSymbol, m_cDepthIntraModeSCModel.get( 0, 0, 0 ) );
     1220      if( !uiSymbol )
     1221      {
     1222#if HS_DMM_SIGNALLING_I0120
     1223        pcCU->setLumaIntraDirSubParts( DIM_OFFSET, absPartIdx, depth );
     1224#else
     1225        pcCU->setLumaIntraDirSubParts( ( 2 * DMM1_IDX + DIM_OFFSET ), absPartIdx, depth );
     1226#endif
     1227      }
     1228      else
     1229      {
     1230#if HS_DMM_SIGNALLING_I0120
     1231        pcCU->setLumaIntraDirSubParts( ( 1+ DIM_OFFSET ), absPartIdx, depth );
     1232#else
     1233        pcCU->setLumaIntraDirSubParts( ( 2 * DMM4_IDX + DIM_OFFSET ), absPartIdx, depth );
     1234#endif
     1235      }
     1236    }
     1237    else if ( pcCU->getSlice()->getVpsDepthModesFlag() )
     1238    {
     1239#if HS_DMM_SIGNALLING_I0120
     1240      pcCU->setLumaIntraDirSubParts( DIM_OFFSET, absPartIdx, depth );
     1241#else
     1242      pcCU->setLumaIntraDirSubParts( ( 2 * DMM1_IDX + DIM_OFFSET ), absPartIdx, depth );
     1243#endif
     1244    }
     1245    else if( pcCU->getSlice()->getIVPFlag() )
     1246    {
     1247#if HS_DMM_SIGNALLING_I0120
     1248      pcCU->setLumaIntraDirSubParts( ( 1+ DIM_OFFSET ), absPartIdx, depth );
     1249#else
     1250      pcCU->setLumaIntraDirSubParts( ( 2 * DMM4_IDX + DIM_OFFSET ), absPartIdx, depth );
     1251#endif
     1252    }
     1253#else
    11341254    m_pcTDecBinIf->decodeBin( uiSymbol, m_cDepthIntraModeSCModel.get( 0, 0, 0 ) );
    11351255    if( !uiSymbol )
    11361256    {
     1257#if HS_DMM_SIGNALLING_I0120
     1258      pcCU->setLumaIntraDirSubParts( DIM_OFFSET, absPartIdx, depth );
     1259#else
    11371260      pcCU->setLumaIntraDirSubParts( ( 2 * DMM1_IDX + DIM_OFFSET ), absPartIdx, depth );
     1261#endif
    11381262    }
    11391263    else
    11401264    {
     1265#if HS_DMM_SIGNALLING_I0120
     1266      pcCU->setLumaIntraDirSubParts( ( 1+ DIM_OFFSET ), absPartIdx, depth );
     1267#else
    11411268      pcCU->setLumaIntraDirSubParts( ( 2 * DMM4_IDX + DIM_OFFSET ), absPartIdx, depth );
    1142     }
     1269#endif
     1270    }
     1271#endif
    11431272  }
    11441273}
     
    20532182  }
    20542183
     2184#if HS_DMM_SIGNALLING_I0120
     2185  UInt symbol = 1;
     2186  UInt uiNumSegments = isDimMode( pcCU->getLumaIntraDir( absPartIdx ) ) ? 2 : 1;
     2187#else
    20552188  UInt symbol = 0;
    20562189  UInt uiNumSegments = 0;
    2057 
     2190#endif
     2191
     2192#if HS_DMM_SIGNALLING_I0120
     2193  if( pcCU->isIntra( absPartIdx ) && pcCU->getSDCFlag( absPartIdx ))
     2194  {
     2195#else
    20582196  if( pcCU->isIntra( absPartIdx ) )
    20592197  {
    20602198    UInt dir     = pcCU->getLumaIntraDir( absPartIdx );
    20612199    uiNumSegments = isDimMode( dir ) ? 2 : 1;
     2200#endif
    20622201    m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get( 0, 0, 0 ) );
     2202#if !HS_DMM_SIGNALLING_I0120
    20632203    if( pcCU->getSDCFlag( absPartIdx ) )
    20642204    {
     2205#endif
    20652206      assert( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N );
    20662207      pcCU->setTrIdxSubParts( 0, absPartIdx, depth );
    20672208      pcCU->setCbfSubParts( 1, 1, 1, absPartIdx, depth );
    20682209    }
     2210#if !HS_DMM_SIGNALLING_I0120
    20692211    else
    20702212    {
     
    20772219    symbol = 1;
    20782220  }
     2221#endif
    20792222
    20802223
     
    21382281  m_pcTDecBinIf->decodeBin( uiSymbol, m_cDBBPFlagSCModel.get( 0, 0, 0 ) );
    21392282 
     2283#if SEC_DBBP_EXPLICIT_SIG_I0077
     2284  PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
     2285  AOF( ePartSize == SIZE_2NxN || ePartSize == SIZE_Nx2N );
     2286  UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxCUDepth() - uiDepth ) << 1 ) ) >> 4;
     2287  pcCU->setDBBPFlagSubParts(uiSymbol, uiAbsPartIdx, 0, uiDepth);
     2288  pcCU->setDBBPFlagSubParts(uiSymbol, uiAbsPartIdx+uiPUOffset, 1, uiDepth);
     2289#else
    21402290  if( uiSymbol )
    21412291  {
     
    21442294    pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx + 2*uiCurrPartNumQ, 1, uiDepth);
    21452295  }
     2296#endif
    21462297}
    21472298#endif
  • trunk/source/Lib/TLibDecoder/TDecSbac.h

    r976 r1039  
    129129 
    130130  Void parseSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     131#if MTK_SINGLE_DEPTH_MODE_I0095 
     132  Void parseSingleDepthMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     133#endif 
    131134  Void parseCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    132135  Void parseSplitFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     
    179182  ContextModel3DBuffer m_cCUSplitFlagSCModel;
    180183  ContextModel3DBuffer m_cCUSkipFlagSCModel;
     184#if MTK_SINGLE_DEPTH_MODE_I0095
     185  ContextModel3DBuffer m_cCUSingleDepthFlagSCModel;
     186  ContextModel3DBuffer m_cSingleDepthValueSCModel;
     187#endif
    181188  ContextModel3DBuffer m_cCUMergeFlagExtSCModel;
    182189  ContextModel3DBuffer m_cCUMergeIdxExtSCModel;
  • 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.