Ignore:
Timestamp:
11 Jul 2014, 03:49:39 (11 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/source/Lib/TLibCommon
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • 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.
Note: See TracChangeset for help on using the changeset viewer.