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

Fix for disabling colour components for depth.

File:
1 edited

Legend:

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