Changeset 983 in 3DVCSoftware


Ignore:
Timestamp:
11 Jul 2014, 03:49:39 (10 years ago)
Author:
mediatek-htm
Message:

Integration of Single Depth Mode proposed in JCT3V-I0095.
The MACRO is "MTK_SINGLE_DEPTH_MODE_I0095".

By Yi-Wen Chen (yiwen.chen@…)

Location:
branches/HTM-11.2-dev3-MediaTek
Files:
3 added
33 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-11.2-dev3-MediaTek/cfg/3D-HEVC/NonCTC/allintra/baseCfg_2view+depth_AllIntra.cfg

    r872 r983  
    179179InterSDC                           : 1                             # use of inter sdc
    180180MPI                                : 1
    181 
     181SingleDepthMode                    : 1                 # use of single depth mode
    182182#========== view synthesis optimization (VSO) ==========
    183183
  • branches/HTM-11.2-dev3-MediaTek/cfg/3D-HEVC/NonCTC/allintra/baseCfg_3view+depth_AllIntra.cfg

    r872 r983  
    194194InterSDC                           : 1                             # use of inter sdc
    195195MPI                                : 1
    196 
     196SingleDepthMode                    : 1                 # use of single depth mode
    197197#========== view synthesis optimization (VSO) ==========
    198198VSOConfig                 : [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
  • branches/HTM-11.2-dev3-MediaTek/cfg/3D-HEVC/baseCfg_2view+depth.cfg

    r950 r983  
    215215InterSDC                           : 1                             # use of inter sdc
    216216MPI                                : 1
    217 
     217SingleDepthMode                    : 1                 # use of single depth mode
    218218#========== view synthesis optimization (VSO) ==========
    219219
  • branches/HTM-11.2-dev3-MediaTek/cfg/3D-HEVC/baseCfg_3view+depth.cfg

    r950 r983  
    246246InterSDC                           : 1                             # use of inter sdc
    247247MPI                                : 1
    248 
     248SingleDepthMode                    : 1                 # use of single depth mode
    249249#========== view synthesis optimization (VSO) ==========
    250250VSOConfig                 : [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
  • branches/HTM-11.2-dev3-MediaTek/source/App/TAppEncoder/TAppEncCfg.cpp

    r976 r983  
    380380  ("SDC",                   m_useSDC,           true,  "Simplified depth coding")
    381381  ("DLT",                   m_useDLT,           true,  "Depth lookup table")
     382#endif
     383#if MTK_SINGLE_DEPTH_MODE_I0095
     384  ("SingleDepthMode",    m_useSingleDepthMode, true, "Single depth mode")                         
    382385#endif
    383386#endif
     
    25232526  printf("DLT:%d ", m_useDLT );
    25242527#endif
     2528#if MTK_SINGLE_DEPTH_MODE_I0095
     2529  printf("SingleDepthMode:%d ",    m_useSingleDepthMode);
     2530#endif
    25252531#if H_3D_INTER_SDC
    25262532  printf( "interSDC:%d ", m_bDepthInterSDCFlag ? 1 : 0 );
  • branches/HTM-11.2-dev3-MediaTek/source/App/TAppEncoder/TAppEncCfg.h

    r976 r983  
    473473  Bool      m_useDLT;                                        ///< flag for using DLT
    474474#endif
     475#if MTK_SINGLE_DEPTH_MODE_I0095
     476  Bool     m_useSingleDepthMode;                          ///< flag for using single depth mode
     477#endif
    475478#if H_3D_QTLPC
    476479  Bool      m_bUseQTL;                                        ///< flag for using depth QuadTree Limitation
  • branches/HTM-11.2-dev3-MediaTek/source/App/TAppEncoder/TAppEncTop.cpp

    r976 r983  
    201201    m_cTEncTop.setUseSDC                       ( isDepth ? m_useSDC               : false );
    202202    m_cTEncTop.setUseDLT                       ( isDepth ? m_useDLT               : false );
     203#endif
     204#if MTK_SINGLE_DEPTH_MODE_I0095
     205    m_cTEncTop.setUseSingleDepthMode           ( isDepth ? m_useSingleDepthMode   : false );
    203206#endif
    204207#if H_3D_QTLPC
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/ContextTables.h

    r976 r983  
    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] =
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TComDataCU.cpp

    r976 r983  
    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{
     
    60926147}
    60936148#endif
     6149
     6150#if MTK_SINGLE_DEPTH_MODE_I0095
     6151Bool TComDataCU::getNeighDepth (UInt uiPartIdx, UInt uiPartAddr, Pel* pNeighDepth, Int index)
     6152{
     6153
     6154  Bool bDepAvail = false;
     6155  Pel *pDepth  = this->getPic()->getPicYuvRec()->getLumaAddr();
     6156  Int iDepStride =  this->getPic()->getPicYuvRec()->getStride();
     6157
     6158  Int xP, yP, nPSW, nPSH;
     6159  this->getPartPosition(uiPartIdx, xP, yP, nPSW, nPSH);
     6160  UInt PicHeight=this->getPic()->getPicYuvRec()->getHeight();
     6161  UInt PicWidth=this->getPic()->getPicYuvRec()->getWidth();
     6162  switch(index)
     6163  {
     6164  case 0: // Mid Left
     6165    if( ( xP != 0 ) && ( ( yP + ( nPSH >> 1 ) ) < PicHeight ) )
     6166    {
     6167      *pNeighDepth = pDepth[ (yP+(nPSH>>1)) * iDepStride + (xP-1) ];
     6168      bDepAvail = true;
     6169    }
     6170    break;
     6171  case 1: // Mid Above
     6172    if( ( yP != 0 ) && ( ( xP + ( nPSW >> 1 ) ) < PicWidth ) )
     6173    {
     6174      *pNeighDepth = pDepth[ (yP-1) * iDepStride + (xP + (nPSW>>1)) ];
     6175      bDepAvail = true;
     6176    }
     6177    break;
     6178  case 2: // Above
     6179    if(yP != 0)
     6180    {
     6181      *pNeighDepth = pDepth[ (yP-1) * iDepStride + (xP) ];
     6182      bDepAvail = true;
     6183    }
     6184    break;
     6185  case 3: // Left
     6186    if(xP != 0)
     6187    {
     6188      *pNeighDepth = pDepth[ (yP) * iDepStride + (xP-1) ];
     6189      bDepAvail = true;
     6190    }
     6191    break;
     6192  case 4: // Above_Left
     6193    if(xP != 0 && yP != 0)
     6194    {
     6195      *pNeighDepth = pDepth[ (yP-1) * iDepStride + (xP-1) ];
     6196      bDepAvail = true;
     6197    }
     6198    break;
     6199  default:
     6200      break;
     6201  }
     6202  return bDepAvail;
     6203}
     6204
     6205#endif
    60946206#if H_3D_NBDV
    60956207//Notes from QC:
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TComDataCU.h

    r976 r983  
    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
     
    347351  Void         setSkipFlag           ( UInt idx, Bool skip)     { m_skipFlag[idx] = skip;   }
    348352  Void         setSkipFlagSubParts   ( Bool skip, UInt absPartIdx, UInt depth );
    349 
     353#if MTK_SINGLE_DEPTH_MODE_I0095
     354  Bool*        getSingleDepthFlag            ()                        { return m_singleDepthFlag;          }
     355  Bool         getSingleDepthFlag            (UInt idx)                { return m_singleDepthFlag[idx];     }
     356  Void         setSingleDepthFlag           ( UInt idx, Bool singleDepth)     { m_singleDepthFlag[idx] = singleDepth;   }
     357  Void         setSingleDepthFlagSubParts   ( Bool singleDepth, UInt absPartIdx, UInt depth );
     358
     359  Pel*         getSingleDepthValue( ) { return m_apSingleDepthValue; }
     360  Pel          getSingleDepthValue            (UInt idx)                { return m_apSingleDepthValue[idx];     }
     361  Void         setSingleDepthValue           ( UInt idx, Pel pDepthValue)     { m_apSingleDepthValue[idx] = pDepthValue;   }
     362  Void         setSingleDepthValueSubParts   (Pel singleDepthValue, UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth );
     363#endif 
    350364  Char*         getPredictionMode     ()                        { return m_pePredMode;        }
    351365  PredMode      getPredictionMode     ( UInt uiIdx )            { return static_cast<PredMode>( m_pePredMode[uiIdx] ); }
     
    489503  Bool          getDispMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDis, Int* iPdm );
    490504#endif
    491 
     505#if MTK_SINGLE_DEPTH_MODE_I0095
     506   Bool          getNeighDepth (UInt uiPartIdx, UInt uiPartAddr, Pel* pNeighDepth, Int index);
     507#endif
    492508#if H_3D_NBDV_REF
    493509  Pel           getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT );
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TComSlice.cpp

    r976 r983  
    139139, m_depthToDisparityF             ( NULL )
    140140#endif
     141#if MTK_SINGLE_DEPTH_MODE_I0095
     142, m_bApplySingleDepthMode         (false)
     143#endif
    141144#endif
    142145{
     
    10911094    m_interLayerPredLayerIdc[ layer ] = pSrc->m_interLayerPredLayerIdc[ layer ];
    10921095  }
     1096#endif
     1097#if MTK_SINGLE_DEPTH_MODE_I0095
     1098  m_bApplySingleDepthMode = pSrc->m_bApplySingleDepthMode;
    10931099#endif
    10941100#if H_3D_IC
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TComSlice.h

    r976 r983  
    22052205  UInt         m_aiDDDShift    [MAX_NUM_LAYERS];
    22062206#endif
    2207 
     2207#if MTK_SINGLE_DEPTH_MODE_I0095
     2208  Bool      m_bApplySingleDepthMode;
     2209#endif
    22082210public:
    22092211  TComSlice();
     
    22752277#if H_3D
    22762278  TComPic*  getTexturePic       ()                              { return  m_ivPicsCurrPoc[0][ m_viewIndex ]; }
     2279#endif
     2280#if MTK_SINGLE_DEPTH_MODE_I0095
     2281  Void      setApplySingleDepthMode( Bool b )                                { m_bApplySingleDepthMode = b; }
     2282  Bool      getApplySingleDepthMode()                                        { return m_bApplySingleDepthMode; }
    22772283#endif
    22782284#if H_3D_IC
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TypeDef.h

    r976 r983  
    215215                                              // MTK_DLT_CODING_FIX_H0091
    216216
     217#define MTK_SINGLE_DEPTH_MODE_I0095       1   // Single depth mode proposed in JCT3V-I0095
     218#if MTK_SINGLE_DEPTH_MODE_I0095
     219#define MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE            2 // size of the sample candidate list
     220#endif
    217221
    218222#define H_3D_INTER_SDC                    1   // INTER SDC, Inter simplified depth coding
     
    381385
    382386// 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
     387//#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
    385388//#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.
    386389//#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.
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r976 r983  
    24732473    }
    24742474#endif
     2475#if MTK_SINGLE_DEPTH_MODE_I0095
     2476    if(rpcSlice->getIsDepth())
     2477    {
     2478      UInt uiCodeTmp = 0;
     2479      READ_FLAG( uiCodeTmp, "slice_enable_single_depth_mode" );
     2480      rpcSlice->setApplySingleDepthMode(uiCodeTmp);
     2481    }
     2482#endif
    24752483    if (!rpcSlice->isIntra())
    24762484    {
     
    28432851  assert(0);
    28442852}
    2845 
     2853#if MTK_SINGLE_DEPTH_MODE_I0095
     2854Void TDecCavlc::parseSingleDepthMode( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ )
     2855{
     2856  assert(0);
     2857}
     2858#endif
    28462859Void TDecCavlc::parseCUTransquantBypassFlag( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ )
    28472860{
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder/TDecCAVLC.h

    r976 r983  
    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 );
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder/TDecCu.cpp

    r976 r983  
    542542    return;
    543543  }
    544 
     544#if MTK_SINGLE_DEPTH_MODE_I0095
     545  m_pcEntropyDecoder->decodeSingleDepthMode( pcCU, uiAbsPartIdx, uiDepth );
     546  if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
     547  {
     548#endif
    545549  m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth );
    546550  m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth );
     
    572576  m_pcEntropyDecoder->decodeCoeff( pcCU, uiAbsPartIdx, uiDepth, uiCurrWidth, uiCurrHeight, bCodeDQP );
    573577  setdQPFlag( bCodeDQP );
     578#if MTK_SINGLE_DEPTH_MODE_I0095
     579  }
     580#endif
    574581  xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast );
    575582#if H_3D_IV_MERGE
     
    671678      break;
    672679    case MODE_INTRA:
     680#if MTK_SINGLE_DEPTH_MODE_I0095
     681      if( m_ppcCU[uiDepth]->getSingleDepthFlag(0) )
     682        xReconIntraSingleDepth( m_ppcCU[uiDepth], 0, uiDepth );
     683#if H_3D_DIM_SDC
     684      else if( m_ppcCU[uiDepth]->getSDCFlag(0) )
     685        xReconIntraSDC( m_ppcCU[uiDepth], 0, uiDepth );
     686#endif
     687      else
     688#else
    673689#if H_3D_DIM_SDC
    674690      if( m_ppcCU[uiDepth]->getSDCFlag(0) )
    675691        xReconIntraSDC( m_ppcCU[uiDepth], 0, uiDepth );
    676692      else
     693#endif
    677694#endif
    678695      xReconIntraQT( m_ppcCU[uiDepth], uiDepth );
     
    709726  }
    710727}
    711 
     728#if MTK_SINGLE_DEPTH_MODE_I0095
     729Void TDecCu::xReconIntraSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     730{
     731  UInt uiWidth        = pcCU->getWidth  ( 0 );
     732  UInt uiHeight       = pcCU->getHeight ( 0 );
     733
     734  TComYuv* pcRecoYuv  = m_ppcYuvReco[uiDepth];
     735
     736  UInt    uiStride    = pcRecoYuv->getStride  ();
     737  Pel*    piReco      = pcRecoYuv->getLumaAddr( uiAbsPartIdx );
     738
     739
     740  AOF( uiWidth == uiHeight );
     741  AOF( uiAbsPartIdx == 0 );
     742
     743  //construction of depth candidates
     744  Pel testDepth;
     745  Pel DepthNeighbours[5];
     746  Int index =0;
     747  for( Int i = 0; (i < 5) && (index<MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE) ; i++ )
     748  {
     749    if(!pcCU->getNeighDepth (0, uiAbsPartIdx, &testDepth, i))
     750    {
     751      continue;
     752    }
     753    DepthNeighbours[index]=testDepth;
     754    index++;
     755    for(Int j=0;j<index-1;j++)
     756    {
     757     if( (DepthNeighbours[index-1]==DepthNeighbours[j]) )
     758     {
     759       index--;
     760       break;
     761     }
     762    }
     763  }
     764
     765  if(index==0)
     766  {
     767    DepthNeighbours[index]=1<<(g_bitDepthY-1);
     768    index++;
     769  }
     770
     771  if(index==1)
     772  {
     773    DepthNeighbours[index]=ClipY(DepthNeighbours[0] + 1 );
     774    index++;
     775  }
     776
     777  for( UInt uiY = 0; uiY < uiHeight; uiY++ )
     778  {
     779    for( UInt uiX = 0; uiX < uiWidth; uiX++ )
     780    {
     781      piReco[ uiX ] =DepthNeighbours[(Int)pcCU->getSingleDepthValue(uiAbsPartIdx)];
     782    }
     783    piReco     += uiStride;
     784  }
     785
     786  // clear UV
     787  UInt  uiStrideC     = pcRecoYuv->getCStride();
     788  Pel   *pRecCb       = pcRecoYuv->getCbAddr();
     789  Pel   *pRecCr       = pcRecoYuv->getCrAddr();
     790
     791  for (Int y=0; y<uiHeight/2; y++)
     792  {
     793    for (Int x=0; x<uiWidth/2; x++)
     794    {
     795      pRecCb[x] = 1<<(g_bitDepthC-1);
     796      pRecCr[x] = 1<<(g_bitDepthC-1);
     797    }
     798
     799    pRecCb += uiStrideC;
     800    pRecCr += uiStrideC;
     801  }
     802}
     803#endif
    712804#if H_3D_INTER_SDC
    713805Void TDecCu::xReconInterSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder/TDecCu.h

    r872 r983  
    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 );
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder/TDecEntropy.cpp

    r976 r983  
    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{
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder/TDecEntropy.h

    r976 r983  
    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 );
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder/TDecSbac.cpp

    r976 r983  
    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 );
     
    636648#endif
    637649}
    638 
     650#if MTK_SINGLE_DEPTH_MODE_I0095
     651Void TDecSbac::parseSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     652{
     653  pcCU->setSingleDepthFlagSubParts( false,        uiAbsPartIdx, uiDepth );
     654  UInt uiSymbol = 0;
     655  m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUSingleDepthFlagSCModel.get( 0, 0, 0 ) );
     656  if( uiSymbol )
     657  {
     658    pcCU->setSingleDepthFlagSubParts( true,        uiAbsPartIdx, uiDepth );
     659    pcCU->setSkipFlagSubParts( false,        uiAbsPartIdx, uiDepth );
     660    pcCU->setSDCFlagSubParts( false,        uiAbsPartIdx, uiDepth );
     661    pcCU->setPredModeSubParts( MODE_INTRA,  uiAbsPartIdx, uiDepth );
     662    pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
     663    pcCU->setLumaIntraDirSubParts (DC_IDX, uiAbsPartIdx, uiDepth );
     664    pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth );
     665    pcCU->setMergeFlagSubParts( false , uiAbsPartIdx, 0, uiDepth );
     666    pcCU->setTrIdxSubParts(0, uiAbsPartIdx, uiDepth);
     667    pcCU->setCbfSubParts(0, 1, 1, uiAbsPartIdx, uiDepth);
     668
     669    UInt absValDeltaDC = 0;
     670
     671    UInt uiUnaryIdx = 0;
     672    UInt uiNumCand = MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE;
     673    if ( uiNumCand > 1 )
     674    {
     675      for( ; uiUnaryIdx < uiNumCand - 1; ++uiUnaryIdx )
     676      {
     677        UInt uiSymbol2 = 0;
     678        if ( uiUnaryIdx==0 )
     679        {
     680          m_pcTDecBinIf->decodeBin( uiSymbol2, m_cSingleDepthValueSCModel.get( 0, 0, 0 ) );
     681        }
     682        else
     683        {
     684          m_pcTDecBinIf->decodeBinEP( uiSymbol2);
     685        }
     686        if( uiSymbol2 == 0 )
     687        {
     688          break;
     689        }
     690      }
     691    }
     692    absValDeltaDC = uiUnaryIdx;
     693    pcCU->setSingleDepthValueSubParts((Pel)absValDeltaDC,uiAbsPartIdx, 0, uiDepth);
     694  }
     695}
     696
     697#endif
    639698/** parse merge flag
    640699 * \param pcCU
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder/TDecSbac.h

    r976 r983  
    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;
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncCavlc.cpp

    r976 r983  
    20222022    }
    20232023#endif
    2024 
     2024#if MTK_SINGLE_DEPTH_MODE_I0095
     2025    if(pcSlice->getIsDepth())
     2026    {
     2027      WRITE_FLAG( pcSlice->getApplySingleDepthMode() ? 1 : 0, "slice_enable_single_depth_mode" );
     2028    }
     2029#endif
    20252030#if H_3D_IV_MERGE
    20262031    assert(pcSlice->getMaxNumMergeCand()<=MRG_MAX_NUM_CANDS_MEM);
     
    24082413  assert(0);
    24092414}
    2410 
     2415#if MTK_SINGLE_DEPTH_MODE_I0095
     2416Void TEncCavlc::codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx )
     2417{
     2418  assert(0);
     2419}
     2420#endif
    24112421Void TEncCavlc::codeSplitFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    24122422{
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncCavlc.h

    r884 r983  
    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 );
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncCfg.h

    r976 r983  
    416416  Bool      m_useSDC;
    417417  Bool      m_useDLT;
     418#endif
     419#if MTK_SINGLE_DEPTH_MODE_I0095
     420  Bool      m_useSingleDepthMode;
    418421#endif
    419422#if H_3D_IV_MERGE
     
    10081011  Void      setUseDLT                       ( Bool b) { m_useDLT = b;    }
    10091012#endif
     1013#if MTK_SINGLE_DEPTH_MODE_I0095
     1014  Void       setUseSingleDepthMode          ( Bool bVal )    { m_useSingleDepthMode = bVal; }
     1015  Bool       getUseSingleDepthMode          ()               { return m_useSingleDepthMode; }
     1016#endif
    10101017#if H_3D_QTLPC
    10111018  Void      setUseQTL                       ( Bool b ) { m_bUseQTL = b;    }
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncCu.cpp

    r976 r983  
    709709    }
    710710#endif
    711 
     711#if MTK_SINGLE_DEPTH_MODE_I0095
     712    rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP  );
     713    if(rpcBestCU->getSlice()->getApplySingleDepthMode())
     714    {
     715      xCheckRDCostSingleDepth( rpcBestCU, rpcTempCU, SIZE_2Nx2N );
     716      rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP  );
     717    }
     718#endif
    712719    if(!earlyDetectionSkipMode)
    713720    {
     
    15361543    return;
    15371544  }
     1545#if MTK_SINGLE_DEPTH_MODE_I0095
     1546  m_pcEntropyCoder->encodeSingleDepthMode( pcCU, uiAbsPartIdx );
     1547  if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
     1548  {
     1549#endif
    15381550  m_pcEntropyCoder->encodePredMode( pcCU, uiAbsPartIdx );
    15391551 
     
    15681580  m_pcEntropyCoder->encodeCoeff( pcCU, uiAbsPartIdx, uiDepth, pcCU->getWidth (uiAbsPartIdx), pcCU->getHeight(uiAbsPartIdx), bCodeDQP );
    15691581  setdQPFlag( bCodeDQP );
    1570 
     1582#if MTK_SINGLE_DEPTH_MODE_I0095
     1583  }
     1584#endif
    15711585  // --- write terminating bit ---
    15721586  finishCU(pcCU,uiAbsPartIdx,uiDepth);
     
    19711985
    19721986          rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth );
     1987#if MTK_SINGLE_DEPTH_MODE_I0095
     1988          rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth );
     1989#endif
    19731990#if H_3D_VSP // possible bug fix
    19741991          if( rpcTempCU->getSkipFlag(0) )
     
    19942011              }
    19952012              rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
     2013#if MTK_SINGLE_DEPTH_MODE_I0095
     2014              rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth );
     2015#endif
    19962016              rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth );
    19972017              rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth );
     
    21302150 
    21312151  rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
    2132 
     2152#if MTK_SINGLE_DEPTH_MODE_I0095
     2153  rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth );
     2154#endif
    21332155  rpcTempCU->setPartSizeSubParts  ( ePartSize,  0, uhDepth );
    21342156  rpcTempCU->setPredModeSubParts  ( MODE_INTER, 0, uhDepth );
     
    22262248      }
    22272249      rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
     2250#if MTK_SINGLE_DEPTH_MODE_I0095
     2251      rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth );
     2252#endif
    22282253      rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth );
    22292254      rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth );
     
    23202345  }
    23212346}
    2322 
     2347#if MTK_SINGLE_DEPTH_MODE_I0095
     2348Void TEncCu::xCheckRDCostSingleDepth( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize )
     2349{
     2350  UInt uiDepth = rpcTempCU->getDepth( 0 );
     2351  if( !rpcBestCU->getSlice()->getIsDepth() || (eSize != SIZE_2Nx2N))
     2352  {
     2353    return;
     2354  }
     2355 
     2356#if H_3D_VSO // M5
     2357  if( m_pcRdCost->getUseRenModel() )
     2358  {
     2359    UInt  uiWidth     = m_ppcOrigYuv[uiDepth]->getWidth   ();
     2360    UInt  uiHeight    = m_ppcOrigYuv[uiDepth]->getHeight  ();
     2361    Pel*  piSrc       = m_ppcOrigYuv[uiDepth]->getLumaAddr();
     2362    UInt  uiSrcStride = m_ppcOrigYuv[uiDepth]->getStride  ();
     2363    m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
     2364  }
     2365#endif
     2366
     2367  rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
     2368  rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth );
     2369  rpcTempCU->setPredModeSubParts( MODE_INTRA, 0, uiDepth );
     2370  rpcTempCU->setCUTransquantBypassSubParts( rpcTempCU->getCUTransquantBypass(0), 0, uiDepth );
     2371
     2372  rpcTempCU->setTrIdxSubParts(0, 0, uiDepth);
     2373  rpcTempCU->setCbfSubParts(0, 1, 1, 0, uiDepth);
     2374  rpcTempCU->setSingleDepthFlagSubParts(true, 0, uiDepth);
     2375  rpcTempCU->setLumaIntraDirSubParts (DC_IDX, 0, uiDepth);
     2376#if H_3D_DIM_SDC
     2377  rpcTempCU->setSDCFlagSubParts( false, 0, uiDepth);
     2378#endif
     2379
     2380  UInt uiPreCalcDistC;
     2381  m_pcPredSearch  ->estIntraPredSingleDepth      ( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC, false );
     2382
     2383
     2384  m_ppcRecoYuvTemp[uiDepth]->copyToPicLuma(rpcTempCU->getPic()->getPicYuvRec(), rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU() );
     2385 
     2386 
     2387  m_pcEntropyCoder->resetBits();
     2388  if ( rpcTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag())
     2389  {
     2390    m_pcEntropyCoder->encodeCUTransquantBypassFlag( rpcTempCU, 0,          true );
     2391  }
     2392  m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0,          true );
     2393  m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0,          true );
     2394 
     2395
     2396  m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]);
     2397 
     2398  rpcTempCU->getTotalBits() = m_pcEntropyCoder->getNumberOfWrittenBits();
     2399  rpcTempCU->getTotalBins() = ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded();
     2400
     2401
     2402#if H_3D_VSO // M6
     2403  if( m_pcRdCost->getUseLambdaScaleVSO()) 
     2404    rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCostVSO( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 
     2405  else
     2406#endif
     2407  rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );
     2408 
     2409
     2410  xCheckDQP( rpcTempCU );
     2411  xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth);
     2412}
     2413#endif
    23232414Void TEncCu::xCheckRDCostInterDBBP( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bUseMRG )
    23242415{
     
    24632554
    24642555  rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
    2465 
     2556#if MTK_SINGLE_DEPTH_MODE_I0095
     2557  rpcTempCU->setSingleDepthFlagSubParts( false, 0, uiDepth );
     2558#endif
    24662559  rpcTempCU->setPartSizeSubParts( eSize, 0, uiDepth );
    24672560  rpcTempCU->setPredModeSubParts( MODE_INTRA, 0, uiDepth );
     
    24882581  }
    24892582  m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0,          true );
     2583#if MTK_SINGLE_DEPTH_MODE_I0095
     2584  m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0,          true );
     2585  if(!rpcTempCU->getSingleDepthFlag(0))
     2586  {
     2587#endif
    24902588  m_pcEntropyCoder->encodePredMode( rpcTempCU, 0,          true );
    24912589  m_pcEntropyCoder->encodePartSize( rpcTempCU, 0, uiDepth, true );
     
    25002598  m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, rpcTempCU->getWidth (0), rpcTempCU->getHeight(0), bCodeDQP );
    25012599  setdQPFlag( bCodeDQP );
    2502  
     2600#if MTK_SINGLE_DEPTH_MODE_I0095
     2601  }
     2602#endif       
    25032603  m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]);
    25042604 
     
    25282628
    25292629  rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
    2530 
     2630#if MTK_SINGLE_DEPTH_MODE_I0095
     2631  rpcTempCU->setSingleDepthFlagSubParts( false, 0, uiDepth );
     2632#endif
    25312633  rpcTempCU->setIPCMFlag(0, true);
    25322634  rpcTempCU->setIPCMFlagSubParts (true, 0, rpcTempCU->getDepth(0));
     
    25452647  }
    25462648  m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0,          true );
     2649#if MTK_SINGLE_DEPTH_MODE_I0095
     2650  m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0,          true );
     2651#endif
    25472652  m_pcEntropyCoder->encodePredMode ( rpcTempCU, 0,          true );
    25482653  m_pcEntropyCoder->encodePartSize ( rpcTempCU, 0, uiDepth, true );
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncCu.h

    r872 r983  
    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
    161164  Void  xCheckRDCostIntra   ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize  );
    162165  Void  xCheckDQP           ( TComDataCU*  pcCU );
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncEntropy.cpp

    r976 r983  
    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
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncEntropy.h

    r884 r983  
    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  );
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncGOP.cpp

    r976 r983  
    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
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncSbac.cpp

    r976 r983  
    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);
     
    275287 
    276288  m_cCUSkipFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG );
     289#if MTK_SINGLE_DEPTH_MODE_I0095
     290  m_cCUSingleDepthFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SINGLEDEPTH_FLAG );
     291  m_cSingleDepthValueSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA );
     292#endif 
    277293  m_cCUMergeFlagExtSCModel.initBuffer    ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT);
    278294  m_cCUMergeIdxExtSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT);
     
    434450  m_pcBinIf->encodeBinsEP( bins, numBins );
    435451}
    436 
     452#if MTK_SINGLE_DEPTH_MODE_I0095
     453Void TEncSbac::codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx )
     454{
     455  UInt uiSymbol = pcCU->getSingleDepthFlag(uiAbsPartIdx ) ? 1 : 0;
     456  m_pcBinIf->encodeBin( uiSymbol, m_cCUSingleDepthFlagSCModel.get( 0, 0, 0 ) );
     457  if(uiSymbol)
     458  {
     459    UInt uiUnaryIdx = (UInt) pcCU->getSingleDepthValue(uiAbsPartIdx);
     460    UInt uiNumCand = MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE;
     461    if ( uiNumCand > 1 )
     462    {
     463      for( UInt ui = 0; ui < uiNumCand - 1; ++ui )
     464      {
     465        const UInt uiSymbol2 = ui == uiUnaryIdx ? 0 : 1;
     466        if ( ui==0 )
     467        {
     468          m_pcBinIf->encodeBin( uiSymbol2, m_cSingleDepthValueSCModel.get( 0, 0, 0 ) );
     469        }
     470        else
     471        {
     472          m_pcBinIf->encodeBinEP( uiSymbol2 );
     473        }
     474        if( uiSymbol2 == 0 )
     475        {
     476          break;
     477        }
     478      }
     479    }
     480  }
     481}
     482#endif
    437483/** Coding of coeff_abs_level_minus3
    438484 * \param uiSymbol value of coeff_abs_level_minus3
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncSbac.h

    r976 r983  
    153153  Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx );
    154154  Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     155#if MTK_SINGLE_DEPTH_MODE_I0095
     156  Void codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx );
     157#endif
    155158  Void codeMergeFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    156159  Void codeMergeIndex    ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     
    219222  ContextModel3DBuffer m_cCUSplitFlagSCModel;
    220223  ContextModel3DBuffer m_cCUSkipFlagSCModel;
     224#if MTK_SINGLE_DEPTH_MODE_I0095
     225  ContextModel3DBuffer m_cCUSingleDepthFlagSCModel;
     226  ContextModel3DBuffer m_cSingleDepthValueSCModel;
     227#endif
    221228  ContextModel3DBuffer m_cCUMergeFlagExtSCModel;
    222229  ContextModel3DBuffer m_cCUMergeIdxExtSCModel;
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncSearch.cpp

    r976 r983  
    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  )
     
    27772860  pcCU->setChromIntraDirSubParts( uiBestMode, 0, pcCU->getDepth( 0 ) );
    27782861}
    2779 
     2862#if MTK_SINGLE_DEPTH_MODE_I0095
     2863Void
     2864TEncSearch::estIntraPredSingleDepth( TComDataCU* pcCU,
     2865                           TComYuv*    pcOrgYuv,
     2866                           TComYuv*    pcPredYuv,
     2867                           TComYuv*    pcResiYuv,
     2868                           TComYuv*    pcRecoYuv,
     2869                           UInt&       ruiDistC,
     2870                           Bool        bLumaOnly )
     2871{
     2872  UInt    uiDepth        = pcCU->getDepth(0);
     2873  UInt    uiWidth        = pcCU->getWidth (0);
     2874  UInt    uiHeight       = pcCU->getHeight(0);
     2875
     2876
     2877  Pel* piOrg         = pcOrgYuv ->getLumaAddr( 0, uiWidth );
     2878  UInt uiStride      = pcPredYuv->getStride();
     2879
     2880  Int index=0;
     2881  Pel testDepth;
     2882  Pel DepthNeighbours[5];
     2883  //construction of depth candidates
     2884  for( Int i = 0; (i < 5)  && (index<MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE) ; i++ )
     2885  {
     2886    if(!pcCU->getNeighDepth (0, 0, &testDepth, i))
     2887    {
     2888      continue;
     2889    }
     2890    DepthNeighbours[index]=testDepth;
     2891    index++;
     2892    for(Int j=0;j<index-1;j++)
     2893    {
     2894      if( (DepthNeighbours[index-1]==DepthNeighbours[j]))
     2895      {
     2896        index--;
     2897        break;
     2898      }
     2899    }
     2900  }
     2901
     2902  if(index==0)
     2903  {
     2904    DepthNeighbours[index]=1<<(g_bitDepthY-1);
     2905    index++;
     2906  }
     2907
     2908  if(index==1)
     2909  {
     2910    DepthNeighbours[index]=ClipY(DepthNeighbours[0] + 1 );
     2911    index++;
     2912  }
     2913
     2914
     2915  Dist   uiDist = 0;
     2916  Double dCost   = 0.0;
     2917  Dist    uiBestDist = 0;
     2918  Double  dBestCost   = MAX_DOUBLE;
     2919  Pel     pBestSingleDepthValue = 0;
     2920
     2921  for( Int testdepthidx = 0; testdepthidx < index ; testdepthidx++ )
     2922  {
     2923      // set context models
     2924      m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] );
     2925
     2926      // determine residual for partition
     2927      uiDist = 0;
     2928      dCost   = 0.0;
     2929#if H_3D_VSO // M36
     2930      if( m_pcRdCost->getUseRenModel() )
     2931      {
     2932        m_pcRdCost->setRenModelData( pcCU, 0, piOrg, uiStride, uiWidth, uiHeight );
     2933      }
     2934#endif
     2935      xIntraCodingSingleDepth(pcCU, 0, pcOrgYuv, pcPredYuv, uiDist, dCost, testdepthidx, DepthNeighbours);
     2936      // check r-d cost
     2937      if( dCost < dBestCost )
     2938      {
     2939        uiBestDist = uiDist;
     2940        dBestCost   = dCost;
     2941        pBestSingleDepthValue = pcCU->getSingleDepthValue(0);
     2942        // copy reconstruction
     2943        pcPredYuv->copyPartToPartYuv(pcRecoYuv, 0, uiWidth, uiHeight);
     2944      }
     2945  } // depth index loop
     2946
     2947
     2948  pcCU->setSingleDepthValueSubParts((Pel)pBestSingleDepthValue,0, 0, uiDepth);
     2949  assert(pBestSingleDepthValue>=0);
     2950
     2951  //===== reset context models =====
     2952  m_pcRDGoOnSbacCoder->load(m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST]);
     2953 
     2954  //===== set distortion (rate and r-d costs are determined later) =====
     2955  pcCU->getTotalDistortion() = uiBestDist;
     2956}
     2957
     2958#endif
    27802959Void
    27812960TEncSearch::estIntraPredQT( TComDataCU* pcCU,
     
    69817160    }
    69827161    m_pcEntropyCoder->encodeSkipFlag ( pcCU, 0, true );
     7162#if MTK_SINGLE_DEPTH_MODE_I0095
     7163    m_pcEntropyCoder->encodeSingleDepthMode ( pcCU, 0, true );
     7164#endif
    69837165    m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
    69847166    m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true );
  • branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncSearch.h

    r884 r983  
    187187                                  TComYuv*    pcRecoYuv,
    188188                                  UInt        uiPreCalcDistC );
    189  
     189#if MTK_SINGLE_DEPTH_MODE_I0095
     190  Void  estIntraPredSingleDepth  ( TComDataCU* pcCU,
     191                                  TComYuv*    pcOrgYuv,
     192                                  TComYuv*    pcPredYuv,
     193                                  TComYuv*    pcResiYuv,
     194                                  TComYuv*    pcRecoYuv,
     195                                  UInt&       ruiDistC,
     196                                  Bool        bLumaOnly );
     197#endif   
    190198 
    191199  /// encoder estimation - inter prediction (non-skip)
     
    342350                                    UInt         uiAbsPartIdx,
    343351                                    UInt         stateU0V1Both2 );
    344 
     352#if MTK_SINGLE_DEPTH_MODE_I0095
     353  Void xIntraCodingSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Int iTestDepthIdx, Pel * DepthNeighbor );
     354#endif
    345355#if H_3D_DIM
    346356  // -------------------------------------------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.