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


Ignore:
Timestamp:
18 Nov 2012, 22:11:37 (12 years ago)
Author:
tech
Message:

Reintegrated branch 4.1-dev0 Rev. 188.

File:
1 edited

Legend:

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

    r77 r189  
    169169}
    170170
     171#if LGE_ILLUCOMP_B0045
     172Void TEncEntropy::encodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
     173{
     174  if (pcCU->isIntra(uiAbsPartIdx) || (pcCU->getSlice()->getViewId() == 0) || pcCU->getSlice()->getSPS()->isDepth())
     175  {
     176    return;
     177  }
     178
     179  if(!pcCU->getSlice()->getApplyIC())
     180    return;
     181
     182  if( bRD )
     183  {
     184    uiAbsPartIdx = 0;
     185  }
     186
     187  if(pcCU->isICFlagRequired(uiAbsPartIdx))
     188    m_pcEntropyCoderIf->codeICFlag( pcCU, uiAbsPartIdx );
     189}
     190#endif
     191
    171192Void TEncEntropy::codeFiltCountBit(ALFParam* pAlfParam, Int64* ruiRate)
    172193{
     
    884905#endif
    885906
     907#if !RWTH_SDC_DLT_B0036
    886908  if ( pcCU->getSlice()->isIntra() )
    887909  {
    888910    return;
    889911  }
     912#endif
    890913
    891914  m_pcEntropyCoderIf->codePredMode( pcCU, uiAbsPartIdx );
     915 
     916#if RWTH_SDC_DLT_B0036
     917  // if B-Slice, code SDC flag later
     918  if( !pcCU->getSlice()->isInterB() && pcCU->getSlice()->getSPS()->isDepth() && pcCU->isIntra(uiAbsPartIdx) )
     919  {
     920    // encode SDC flag
     921    encodeSDCFlag(pcCU, uiAbsPartIdx, bRD);
     922  }
     923#endif
    892924}
    893925
     
    934966  }
    935967#endif 
     968#if RWTH_SDC_DLT_B0036
     969  if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSDCFlag(uiAbsPartIdx)  )
     970  {
     971    assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
     972    return;
     973  }
     974#endif
     975 
    936976  m_pcEntropyCoderIf->codePartSize( pcCU, uiAbsPartIdx, uiDepth );
     977 
     978#if RWTH_SDC_DLT_B0036
     979  // code SDC flag now!
     980  if( pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSlice()->getSPS()->isDepth() )
     981  {
     982    // encode SDC flag
     983    encodeSDCFlag(pcCU, uiAbsPartIdx, bRD);
     984   
     985    if( pcCU->getSDCFlag(uiAbsPartIdx) )
     986    {
     987      // part size is also known for SDC intra
     988      assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
     989    }
     990  }
     991#endif
    937992}
    938993
     
    9511006    return;
    9521007  }
     1008 
     1009#if RWTH_SDC_DLT_B0036
     1010  if( pcCU->getSDCFlag(uiAbsPartIdx) )
     1011  {
     1012    return;
     1013  }
     1014#endif
    9531015 
    9541016  if( bRD )
     
    12861348  }
    12871349 
     1350#if RWTH_SDC_DLT_B0036
     1351  if( pcCU->getSDCFlag(uiAbsPartIdx) )
     1352  {
     1353    encodeSDCPredMode(pcCU, uiAbsPartIdx, bRD);
     1354    return;
     1355  }
     1356#endif
     1357 
    12881358  PartSize eSize = pcCU->getPartitionSize( uiAbsPartIdx );
    12891359 
     
    16161686  pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx(uiAbsPartIdx), uiLumaTrMode, uiChromaTrMode );
    16171687 
     1688#if RWTH_SDC_DLT_B0036
     1689  if( pcCU->getSDCFlag( uiAbsPartIdx ) )
     1690  {
     1691    assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
     1692    assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
     1693    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
     1694    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
     1695    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
     1696   
     1697    encodeSDCResidualData(pcCU, uiAbsPartIdx);
     1698    return;
     1699  }
     1700#endif
     1701 
    16181702  if( pcCU->isIntra(uiAbsPartIdx) )
    16191703  {
     
    16561740  }
    16571741 
     1742#if FIX_MPI_B0065
     1743  if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER && pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getMergeIndex( uiAbsPartIdx ) == 0 && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N && pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1 )
     1744  {
     1745    TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() );
     1746    if( uiDepth == pcTextureCU->getDepth(uiAbsPartIdx))
     1747    {
     1748      PartSize partSize = pcTextureCU->getPartitionSize(uiAbsPartIdx);
     1749      pcCU->setPartSizeSubParts( partSize, uiAbsPartIdx, uiDepth );
     1750    }
     1751    else
     1752    {
     1753      pcCU->setPartSizeSubParts( SIZE_NxN, uiAbsPartIdx, uiDepth );
     1754    }
     1755  }
     1756#endif
     1757
    16581758#if UNIFIED_TRANSFORM_TREE
    16591759  UInt temp = 0;
     
    16641764  xEncodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, uiLumaTrMode, bCodeDQP );
    16651765#endif // UNIFIED_TRANSFORM_TREE
     1766
     1767#if FIX_MPI_B0065
     1768  if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER && pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getMergeIndex( uiAbsPartIdx ) == 0 && pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N &&  pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1 )
     1769  {
     1770    pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 
     1771  }
     1772#endif
    16661773}
    16671774
     
    19882095}
    19892096
     2097#if RWTH_SDC_DLT_B0036
     2098Void TEncEntropy::encodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
     2099{
     2100  assert( pcCU->getSlice()->getSPS()->isDepth() );
     2101 
     2102  if( bRD )
     2103    uiAbsPartIdx = 0;
     2104 
     2105  m_pcEntropyCoderIf->codeSDCPredMode(pcCU, uiAbsPartIdx);
     2106}
     2107
     2108Void TEncEntropy::encodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
     2109{
     2110  assert( pcCU->getSlice()->getSPS()->isDepth() );
     2111 
     2112  if( bRD )
     2113    uiAbsPartIdx = 0;
     2114 
     2115  m_pcEntropyCoderIf->codeSDCFlag(pcCU, uiAbsPartIdx);
     2116}
     2117
     2118Void TEncEntropy::encodeSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
     2119{
     2120  assert( pcCU->getSlice()->getSPS()->isDepth() );
     2121  assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
     2122  assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
     2123  assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
     2124  assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
     2125 
     2126  if( bRD )
     2127    uiAbsPartIdx = 0;
     2128 
     2129  // number of segments depends on prediction mode for INTRA
     2130  UInt uiNumSegments = 2;
     2131  UInt uiLumaPredMode = pcCU->getLumaIntraDir( uiAbsPartIdx );
     2132  if( uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX )
     2133    uiNumSegments = 1;
     2134 
     2135  // encode residual data for each segment
     2136  for( UInt uiSeg = 0; uiSeg < uiNumSegments; uiSeg++ )
     2137    m_pcEntropyCoderIf->codeSDCResidualData(pcCU, uiAbsPartIdx, uiSeg);
     2138}
     2139#endif
     2140
    19902141//! \}
Note: See TracChangeset for help on using the changeset viewer.