Changeset 1179 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncEntropy.cpp


Ignore:
Timestamp:
7 Apr 2015, 17:05:30 (9 years ago)
Author:
tech
Message:

Merged branch 13.1-dev0@1178.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibEncoder/TEncEntropy.cpp

    r1133 r1179  
    44 * granted under this license. 
    55 *
    6 * Copyright (c) 2010-2014, ITU/ISO/IEC
     6* Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    111111  m_pcEntropyCoderIf->codeSkipFlag( pcCU, uiAbsPartIdx );
    112112}
     113
     114#if SEC_DEPTH_INTRA_SKIP_MODE_K0033
     115Void TEncEntropy::encodeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
     116{
     117  if ( !pcCU->getSlice()->getIsDepth() )
     118  {
     119    return;
     120  }
     121  if( bRD )
     122  {
     123    uiAbsPartIdx = 0;
     124  }
     125  m_pcEntropyCoderIf->codeDIS( pcCU, uiAbsPartIdx );
     126}
     127#else
    113128#if H_3D_SINGLE_DEPTH
    114129Void TEncEntropy::encodeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
     
    125140}
    126141#endif
     142#endif
     143
    127144/** encode merge flag
    128145 * \param pcCU
     
    254271  m_pcEntropyCoderIf->codePartSize( pcCU, uiAbsPartIdx, uiDepth );
    255272 
     273#if !HHI_MOVE_SYN_K0052
    256274#if H_3D_DBBP
    257275  if( pcCU->getSlice()->getDepthBasedBlkPartFlag() && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) && pcCU->getWidth(uiAbsPartIdx) > 8 && pcCU->getSlice()->getDefaultRefViewIdxAvailableFlag() )
     
    259277    encodeDBBPFlag(pcCU, uiAbsPartIdx, bRD);
    260278  }
     279#endif
    261280#endif
    262281}
     
    285304}
    286305
     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
    287309Void TEncEntropy::xEncodeTransform( TComDataCU* pcCU,UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP )
    288 {
     310#endif
     311{
     312
     313#if H_MV_ENC_DEC_TRAC
     314#if ENC_DEC_TRACE
     315  UInt uiLPelX   = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ];
     316  UInt uiTPelY   = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ];
     317
     318  DTRACE_TU_S("=========== transform_tree ===========\n")
     319  DTRACE_TU("x0", uiLPelX)
     320  DTRACE_TU("x1", uiTPelY)
     321  DTRACE_TU("log2TrafoSize", g_uiMaxCUWidth>>uiDepth)
     322  DTRACE_TU("trafoDepth"  , uiDepth)
     323#endif
     324#endif
     325
    289326  const UInt uiSubdiv = pcCU->getTransformIdx( uiAbsPartIdx ) + pcCU->getDepth( uiAbsPartIdx ) > uiDepth;
    290327  const UInt uiLog2TrafoSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()]+2 - uiDepth;
     
    292329  UInt cbfU = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx );
    293330  UInt cbfV = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx );
    294 
     331#if H_3D_DISABLE_CHROMA
     332  if( !rd && pcCU->getSlice()->getSPS()->getChromaFormatIdc() == 0 )
     333  {
     334    cbfU = 0;
     335    cbfV = 0;
     336  }
     337#endif
    295338  if(uiTrIdx==0)
    296339  {
     
    309352      cbfU = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx );
    310353      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
    311361    }
    312362  }
     
    349399  if( bFirstCbfOfCU || uiLog2TrafoSize > 2 )
    350400  {
     401#if H_3D_DISABLE_CHROMA
     402    if (pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 || rd)
     403    {
     404      if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) )
     405      {
     406        m_pcEntropyCoderIf->codeQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr );
     407      }
     408      if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr - 1 ) )
     409      {
     410        m_pcEntropyCoderIf->codeQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr );
     411      }
     412    }
     413#else
    351414    if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) )
    352415    {
     
    357420      m_pcEntropyCoderIf->codeQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepthCurr );
    358421    }
     422#endif
    359423  }
    360424  else if( uiLog2TrafoSize == 2 )
    361425  {
     426#if H_3D_DISABLE_CHROMA
     427    if ( rd && pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0 )
     428    {
    362429    assert( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr ) == pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepthCurr - 1 ) );
    363430    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
    364436  }
    365437 
     
    374446    const UInt partNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1);
    375447   
     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
    376460    xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP );
    377461
     
    384468    uiAbsPartIdx += partNum;  offsetLuma += size;  offsetChroma += (size>>2);
    385469    xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP );
     470#endif
    386471  }
    387472  else
     
    400485#endif
    401486   
     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
    402492    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
    403494    {
    404495      assert( pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, 0 ) );
     
    489580    encodeIntraDirModeLuma  ( pcCU, uiAbsPartIdx,true );
    490581#if H_3D_DIM_SDC
     582#if H_3D_DISABLE_CHROMA
     583    if(!pcCU->getSDCFlag(uiAbsPartIdx) && ( pcCU->getSlice()->getSPS()->getChromaFormatIdc() != 0  || bRD ) )
     584#else
    491585    if(!pcCU->getSDCFlag(uiAbsPartIdx))
     586#endif
    492587#endif
    493588    encodeIntraDirModeChroma( pcCU, uiAbsPartIdx, bRD );
     
    657752 * \param uiHeight
    658753 */
     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
    659757Void TEncEntropy::encodeCoeff( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP )
     758#endif
    660759{
    661760  UInt uiMinCoeffSize = pcCU->getPic()->getMinCUWidth()*pcCU->getPic()->getMinCUHeight();
     
    668767    assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
    669768    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
     769#if H_3D_DISABLE_CHROMA
     770    if (!pcCU->getSlice()->getIsDepth() )
     771    {
     772      assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
     773      assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
     774    }
     775#else
    670776    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
    671777    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
    672   }
     778#endif
     779  }
     780
    673781
    674782  if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx ) )
     
    723831  }
    724832 
     833#if H_3D_DISABLE_CHROMA
     834  xEncodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP, rd);
     835#else
    725836  xEncodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP);
     837#endif
    726838}
    727839
     
    792904Void TEncEntropy::encodeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
    793905{
    794   if( bRD )
    795   {
    796     uiAbsPartIdx = 0;
    797   }
    798   m_pcEntropyCoderIf->codeDBBPFlag( pcCU, uiAbsPartIdx );
     906#if HHI_MOVE_SYN_K0052
     907  if( pcCU->getSlice()->getDepthBasedBlkPartFlag() &&
     908    ( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN ||
     909      pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) &&
     910      pcCU->getWidth(uiAbsPartIdx) > 8 &&
     911      pcCU->getSlice()->getDefaultRefViewIdxAvailableFlag() )
     912  {
     913#endif
     914    if( bRD )
     915    {
     916      uiAbsPartIdx = 0;
     917    }
     918    m_pcEntropyCoderIf->codeDBBPFlag( pcCU, uiAbsPartIdx );
     919#if HHI_MOVE_SYN_K0052
     920  }
     921#endif
    799922}
    800923#endif
Note: See TracChangeset for help on using the changeset viewer.