Changeset 1176 in 3DVCSoftware for branches


Ignore:
Timestamp:
7 Apr 2015, 15:48:27 (10 years ago)
Author:
tech
Message:

Fix for disabling colour components for depth.

Location:
branches/HTM-13.1-dev0
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-13.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1175 r1176  
    24862486      READ_FLAG(uiCode, "slice_sao_luma_flag");  rpcSlice->setSaoEnabledFlag((Bool)uiCode);
    24872487#if H_3D_DISABLE_CHROMA
    2488       if( !rpcSlice->getIsDepth() )
     2488      if( rpcSlice->getSPS()->getChromaFormatIdc() != 0 )
    24892489      {
    24902490      READ_FLAG(uiCode, "slice_sao_chroma_flag");  rpcSlice->setSaoEnabledFlagChroma((Bool)uiCode);
     
    32713271  wpScalingParam  *wp;
    32723272#if H_3D_DISABLE_CHROMA
    3273   Bool            bChroma     = !pcSlice->getIsDepth();
     3273  Bool            bChroma     = ( pcSlice->getSPS()->getChromaFormatIdc() != 0 );
    32743274#else
    32753275  Bool            bChroma     = true; // color always present in HEVC ?
  • branches/HTM-13.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp

    r1175 r1176  
    184184    if(!pcCU->getSDCFlag(uiAbsPartIdx) && !pcCU->getSlice()->getIsDepth() )
    185185#else
    186     if(!pcCU->getSlice()->getIsDepth() )
     186    if(!pcCU->getSDCFlag(uiAbsPartIdx) && pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 )
    187187#endif
    188188#else
     
    867867    {
    868868#if H_3D_DISABLE_CHROMA
    869       if (!pcCU->getSlice()->getIsDepth() )     
     869      if (pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 )     
    870870      {
    871871      if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) )
     
    10611061    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
    10621062#if H_3D_DISABLE_CHROMA
    1063     if (!pcCU->getSlice()->getIsDepth() )
     1063    if (pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 )
    10641064    {
    10651065      assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
  • branches/HTM-13.1-dev0/source/Lib/TLibDecoder/TDecSbac.cpp

    r1175 r1176  
    503503
    504504#if H_3D_DISABLE_CHROMA
    505     if( !pcCU->getSlice()->getIsDepth() )
     505    if( pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 )
    506506    {   
    507507#endif
  • branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp

    r1175 r1176  
    16591659  // Encode Coefficients
    16601660  Bool bCodeDQP = getdQPFlag();
     1661#if H_3D_DISABLE_CHROMA
     1662  m_pcEntropyCoder->encodeCoeff( pcCU, uiAbsPartIdx, uiDepth, pcCU->getWidth (uiAbsPartIdx), pcCU->getHeight(uiAbsPartIdx), bCodeDQP, false );
     1663#else
    16611664  m_pcEntropyCoder->encodeCoeff( pcCU, uiAbsPartIdx, uiDepth, pcCU->getWidth (uiAbsPartIdx), pcCU->getHeight(uiAbsPartIdx), bCodeDQP );
     1665#endif
    16621666  setdQPFlag( bCodeDQP );
    16631667#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     
    28582862  // Encode Coefficients
    28592863  Bool bCodeDQP = getdQPFlag();
     2864#if H_3D_DISABLE_CHROMA
     2865  m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, rpcTempCU->getWidth (0), rpcTempCU->getHeight(0), bCodeDQP, true );
     2866#else
    28602867  m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, rpcTempCU->getWidth (0), rpcTempCU->getHeight(0), bCodeDQP );
     2868#endif
     2869
     2870
    28612871  setdQPFlag( bCodeDQP );
    28622872#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
  • branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp

    r1175 r1176  
    304304}
    305305
     306#if H_3D_DISABLE_CHROMA
     307Void TEncEntropy::xEncodeTransform( TComDataCU* pcCU,UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP, Bool rd )
     308#else
    306309Void TEncEntropy::xEncodeTransform( TComDataCU* pcCU,UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP )
     310#endif
    307311{
    308312
     
    325329  UInt cbfU = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx );
    326330  UInt cbfV = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx );
    327 
     331#if H_3D_DISABLE_CHROMA
     332  if( !rd && pcCU->getSlice()->getSPS()->getChromaFormatIdc() == 0 )
     333  {
     334    cbfU = 0;
     335    cbfV = 0;
     336  }
     337#endif
    328338  if(uiTrIdx==0)
    329339  {
     
    342352      cbfU = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx );
    343353      cbfV = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx );
     354#if H_3D_DISABLE_CHROMA
     355      if( !rd && pcCU->getSlice()->getSPS()->getChromaFormatIdc() == 0 )
     356      {
     357        cbfU = 0;
     358        cbfV = 0;
     359      }
     360#endif
    344361    }
    345362  }
     
    383400  {
    384401#if H_3D_DISABLE_CHROMA
    385     if (!pcCU->getSlice()->getIsDepth() )
     402    if (pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 || rd)
    386403    {
    387404      if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) )
     
    394411      }
    395412    }
    396     else
    397     {
    398       if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) )
    399       {
    400         assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr ) == 0 );
    401       }
    402       if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr - 1 ) )
    403       {
    404         assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr ) == 0  );
    405       }
    406     }
    407413#else
    408414    if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) )
     
    418424  else if( uiLog2TrafoSize == 2 )
    419425  {
     426#if H_3D_DISABLE_CHROMA
     427    if ( rd && pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 )
     428    {
    420429    assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr ) == pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) );
    421430    assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr ) == pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr - 1 ) );
     431  }
     432#else
     433    assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr ) == pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) );
     434    assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr ) == pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr - 1 ) );
     435#endif
    422436  }
    423437 
     
    432446    const UInt partNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1);
    433447   
     448#if H_3D_DISABLE_CHROMA
     449    xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP, rd );
     450
     451    uiAbsPartIdx += partNum;  offsetLuma += size;  offsetChroma += (size>>2);
     452    xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP ,rd );
     453
     454    uiAbsPartIdx += partNum;  offsetLuma += size;  offsetChroma += (size>>2);
     455    xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP, rd );
     456
     457    uiAbsPartIdx += partNum;  offsetLuma += size;  offsetChroma += (size>>2);
     458    xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP, rd );
     459#else
    434460    xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP );
    435461
     
    442468    uiAbsPartIdx += partNum;  offsetLuma += size;  offsetChroma += (size>>2);
    443469    xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP );
     470#endif
    444471  }
    445472  else
     
    458485#endif
    459486   
     487#if H_3D_DISABLE_CHROMA
     488    Bool notcbfUV = !rd && pcCU->getSlice()->getSPS()->getChromaFormatIdc() == 0 ? 1 : ( !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) ) ;
     489    if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA &&
     490      uiDepth == pcCU->getDepth( uiAbsPartIdx ) && notcbfUV )
     491#else
    460492    if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) )
     493#endif
    461494    {
    462495      assert( pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, 0 ) );
     
    548581#if H_3D_DIM_SDC
    549582#if H_3D_DISABLE_CHROMA
    550     if(!pcCU->getSDCFlag(uiAbsPartIdx) && !pcCU->getSlice()->getIsDepth() )
     583    if(!pcCU->getSDCFlag(uiAbsPartIdx) && ( !pcCU->getSlice()->getIsDepth() || bRD ) )
    551584#else
    552585    if(!pcCU->getSDCFlag(uiAbsPartIdx))
     
    719752 * \param uiHeight
    720753 */
     754#if H_3D_DISABLE_CHROMA
     755Void TEncEntropy::encodeCoeff( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP, Bool rd )
     756#else
    721757Void TEncEntropy::encodeCoeff( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP )
     758#endif
    722759{
    723760  UInt uiMinCoeffSize = pcCU->getPic()->getMinCUWidth()*pcCU->getPic()->getMinCUHeight();
     
    794831  }
    795832 
     833#if H_3D_DISABLE_CHROMA
     834  xEncodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP, rd);
     835#else
    796836  xEncodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP);
     837#endif
    797838}
    798839
  • branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncEntropy.h

    r1175 r1176  
    226226
    227227private:
     228#if H_3D_DISABLE_CHROMA
     229  Void xEncodeTransform        ( TComDataCU* pcCU,UInt offsetLumaOffset, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP, Bool rd );
     230public:
     231  Void encodeCoeff             ( TComDataCU* pcCU,                 UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP, Bool rd );
     232#else
    228233  Void xEncodeTransform        ( TComDataCU* pcCU,UInt offsetLumaOffset, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP );
    229234public:
    230235  Void encodeCoeff             ( TComDataCU* pcCU,                 UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP );
     236#endif
    231237 
    232238  Void encodeCoeffNxN         ( TComDataCU* pcCU, TCoeff* pcCoeff, UInt uiAbsPartIdx, UInt uiTrWidth, UInt uiTrHeight, UInt uiDepth, TextType eType );
  • branches/HTM-13.1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp

    r1175 r1176  
    23292329
    23302330  Bool bDummy = false;
     2331#if H_3D_DISABLE_CHROMA
     2332  m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth( 0 ), uiWidth, uiHeight, bDummy, true );
     2333#else
    23312334  m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth( 0 ), uiWidth, uiHeight, bDummy );
     2335#endif
    23322336  UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits();
    23332337
     
    75417545#endif
    75427546    Bool bDummy = false;
     7547#if H_3D_DISABLE_CHROMA
     7548    m_pcEntropyCoder->encodeCoeff   ( pcCU, 0, pcCU->getDepth(0), pcCU->getWidth(0), pcCU->getHeight(0), bDummy, true );
     7549#else
    75437550    m_pcEntropyCoder->encodeCoeff   ( pcCU, 0, pcCU->getDepth(0), pcCU->getWidth(0), pcCU->getHeight(0), bDummy );
     7551#endif
    75447552   
    75457553    ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits();
Note: See TracChangeset for help on using the changeset viewer.