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


Ignore:
Timestamp:
26 May 2013, 15:41:34 (11 years ago)
Author:
tech
Message:
  • Reintegrated branch 6.2-dev0 rev. 442.
  • Changed version number.
  • Added coding results.
File:
1 edited

Legend:

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

    r332 r443  
    5454  if (pcSlice->getSPS()->getUseSAO())
    5555  {
     56#if LGE_SAO_MIGRATION_D0091
     57    if (pcSlice->getSPS()->getUseSAO())
     58    {
     59        SAOParam *saoParam = pcSlice->getAPS()->getSaoParam();
     60        pcSlice->setSaoEnabledFlag     (saoParam->bSaoFlag[0]);
     61        {
     62            pcSlice->setSaoEnabledFlagChroma   (saoParam->bSaoFlag[1]);
     63        }
     64    }
     65#else
    5666    pcSlice->setSaoInterleavingFlag(pcSlice->getAPS()->getSaoInterleavingFlag());
    5767    pcSlice->setSaoEnabledFlag     (pcSlice->getAPS()->getSaoParam()->bSaoFlag[0]);
     
    6676      pcSlice->setSaoEnabledFlagCr   (0);
    6777    }
     78#endif
    6879  }
    6980
     
    456467
    457468
     469#if QC_ARP_D0177
     470Void TEncEntropy::encodeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD, UInt uiDepth)
     471{
     472  if( pcCU->getSlice()->getViewId() == 0 || pcCU->getSlice()->getIsDepth() == true || !pcCU->getSlice()->getARPStepNum() )
     473  {
     474    return;
     475  }
     476  assert( pcCU->isIntra( uiAbsPartIdx ) == false );
     477  if( bRD )
     478  {
     479    uiAbsPartIdx = 0;
     480  }
     481  bool bSignalflag[2] = {true, true};
     482  if (!(pcCU->getPartitionSize(uiAbsPartIdx)==SIZE_2Nx2N || pcCU->isSkipped(uiAbsPartIdx)))
     483  {
     484    assert(pcCU->getARPW (uiAbsPartIdx) == 0);
     485    bSignalflag[0] = false;
     486    bSignalflag[1] = false;
     487 }
     488  if (!(bSignalflag[0]|| bSignalflag[1]))
     489  {
     490    assert(pcCU->getARPW (uiAbsPartIdx) == 0);
     491    if (uiDepth != -1)
     492      pcCU->setARPWSubParts(0, uiAbsPartIdx, uiDepth);
     493  }
     494  else
     495     m_pcEntropyCoderIf->codeARPW( pcCU, uiAbsPartIdx );
     496 
     497}
     498#endif
    458499/** parse the fixed length code (smaller than one max value) in ALF
    459500 * \param run: coded value
     
    828869  m_pcEntropyCoderIf->codePredMode( pcCU, uiAbsPartIdx );
    829870 
     871#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    830872#if RWTH_SDC_DLT_B0036
    831873  // if B-Slice, code SDC flag later
     
    835877    encodeSDCFlag(pcCU, uiAbsPartIdx, bRD);
    836878  }
     879#endif
    837880#endif
    838881}
     
    876919    }
    877920  }
     921#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    878922#if RWTH_SDC_DLT_B0036
    879923  if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSDCFlag(uiAbsPartIdx)  )
     
    883927  }
    884928#endif
     929#endif
    885930 
    886931  m_pcEntropyCoderIf->codePartSize( pcCU, uiAbsPartIdx, uiDepth );
    887932 
     933#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    888934#if RWTH_SDC_DLT_B0036
    889935  // code SDC flag now!
     
    899945    }
    900946  }
     947#endif
    901948#endif
    902949}
     
    11791226
    11801227// Intra direction for Luma
    1181 Void TEncEntropy::encodeIntraDirModeLuma  ( TComDataCU* pcCU, UInt uiAbsPartIdx )
    1182 {
    1183   m_pcEntropyCoderIf->codeIntraDirLumaAng( pcCU, uiAbsPartIdx );
     1228Void TEncEntropy::encodeIntraDirModeLuma  ( TComDataCU* pcCU, UInt uiAbsPartIdx
     1229#if PKU_QC_DEPTH_INTRA_UNI_D0195
     1230                                           ,Bool bSdcRD
     1231#endif
     1232                                           )
     1233{
     1234  m_pcEntropyCoderIf->codeIntraDirLumaAng( pcCU, uiAbsPartIdx
     1235#if PKU_QC_DEPTH_INTRA_UNI_D0195
     1236    ,bSdcRD
     1237#endif
     1238    );
    11841239}
    11851240
     
    11951250}
    11961251
    1197 Void TEncEntropy::encodePredInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
     1252Void TEncEntropy::encodePredInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD
     1253#if PKU_QC_DEPTH_INTRA_UNI_D0195
     1254                                 ,Bool bSdcRD
     1255#endif
     1256                                 )
    11981257{
    11991258  if( bRD )
     
    12021261  }
    12031262
     1263#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    12041264#if RWTH_SDC_DLT_B0036
    12051265  if( pcCU->getSDCFlag(uiAbsPartIdx) )
     
    12081268    return;
    12091269  }
     1270#endif
    12101271#endif
    12111272
     
    12221283      encodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset*2 );
    12231284      encodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset*3 );
     1285#if PKU_QC_DEPTH_INTRA_UNI_D0195
     1286      if(!pcCU->getSDCFlag(uiAbsPartIdx))
     1287#endif
    12241288      encodeIntraDirModeChroma( pcCU, uiAbsPartIdx, bRD );
    12251289    }
    12261290    else                                                              // if it is not NxN size, encode 1 intra directions
    12271291    {
    1228       encodeIntraDirModeLuma  ( pcCU, uiAbsPartIdx );
     1292      encodeIntraDirModeLuma  ( pcCU, uiAbsPartIdx
     1293#if PKU_QC_DEPTH_INTRA_UNI_D0195
     1294        ,bSdcRD
     1295#endif
     1296        );
     1297#if PKU_QC_DEPTH_INTRA_UNI_D0195
     1298      if(!pcCU->getSDCFlag(uiAbsPartIdx))
     1299#endif
    12291300      encodeIntraDirModeChroma( pcCU, uiAbsPartIdx, bRD );
    12301301    }
     
    12331304  {
    12341305    encodePUWise( pcCU, uiAbsPartIdx, bRD );
     1306#if QC_ARP_D0177
     1307    encodeARPW( pcCU , uiAbsPartIdx , bRD );
     1308#endif
    12351309  }
    12361310}
     
    13511425  {
    13521426#if H3D_IVMP
     1427#if SEC_TWO_CANDIDATES_FOR_AMVP_D0122
     1428    const Int iNumCands = AMVP_MAX_NUM_CANDS;
     1429#else
    13531430    const Int iNumCands = AMVP_MAX_NUM_CANDS + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
     1431#endif
    13541432    m_pcEntropyCoderIf->codeMVPIdx( pcCU, uiAbsPartIdx, eRefList, iNumCands );
    13551433#else
     
    14171495    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
    14181496    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
    1419    
     1497#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    14201498    encodeSDCResidualData(pcCU, uiAbsPartIdx);
     1499#endif
    14211500    return;
    14221501  }
     
    14951574}
    14961575
     1576#if LGE_SAO_MIGRATION_D0091
     1577Void TEncEntropy::encodeSaoOffset(SaoLcuParam* saoLcuParam, UInt compIdx)
     1578{
     1579    UInt uiSymbol;
     1580    Int i;
     1581
     1582    uiSymbol = saoLcuParam->typeIdx + 1;
     1583    if (compIdx!=2)
     1584    {
     1585        m_pcEntropyCoderIf->codeSaoTypeIdx(uiSymbol);
     1586    }
     1587
     1588    if (uiSymbol)
     1589    {
     1590        if (saoLcuParam->typeIdx < 4 && compIdx != 2)
     1591        {
     1592            saoLcuParam->subTypeIdx = saoLcuParam->typeIdx;
     1593        }
     1594#if FULL_NBIT
     1595        Int offsetTh = 1 << ( min((Int)(g_uiBitDepth + (g_uiBitDepth-8)-5),5) );
     1596#else
     1597        Int offsetTh = 1 << ( min((Int)(g_uiBitDepth + g_uiBitIncrement-5),5) );
     1598#endif
     1599        if( saoLcuParam->typeIdx == SAO_BO )
     1600        {
     1601            for( i=0; i< saoLcuParam->length; i++)
     1602            {
     1603                UInt absOffset = ( (saoLcuParam->offset[i] < 0) ? -saoLcuParam->offset[i] : saoLcuParam->offset[i]);
     1604                m_pcEntropyCoderIf->codeSaoMaxUvlc(absOffset, offsetTh-1);
     1605            } 
     1606            for( i=0; i< saoLcuParam->length; i++)
     1607            {
     1608                if (saoLcuParam->offset[i] != 0)
     1609                {
     1610                    UInt sign = (saoLcuParam->offset[i] < 0) ? 1 : 0 ;
     1611                    m_pcEntropyCoderIf->codeSAOSign(sign);
     1612                }
     1613            }
     1614            uiSymbol = (UInt) (saoLcuParam->subTypeIdx);
     1615            m_pcEntropyCoderIf->codeSaoUflc(5, uiSymbol);
     1616        }
     1617        else if( saoLcuParam->typeIdx < 4 )
     1618        {
     1619            m_pcEntropyCoderIf->codeSaoMaxUvlc( saoLcuParam->offset[0], offsetTh-1);
     1620            m_pcEntropyCoderIf->codeSaoMaxUvlc( saoLcuParam->offset[1], offsetTh-1);
     1621            m_pcEntropyCoderIf->codeSaoMaxUvlc(-saoLcuParam->offset[2], offsetTh-1);
     1622            m_pcEntropyCoderIf->codeSaoMaxUvlc(-saoLcuParam->offset[3], offsetTh-1);
     1623
     1624            if (compIdx!=2)
     1625            {
     1626                uiSymbol = (UInt) (saoLcuParam->subTypeIdx);
     1627                m_pcEntropyCoderIf->codeSaoUflc(2, uiSymbol);
     1628            }
     1629        }
     1630    }
     1631}
     1632
     1633/** Encode SAO unit interleaving
     1634* \param  rx
     1635* \param  ry
     1636* \param  pSaoParam
     1637* \param  pcCU
     1638* \param  iCUAddrInSlice
     1639* \param  iCUAddrUpInSlice
     1640* \param  bLFCrossSliceBoundaryFlag
     1641 */
     1642Void TEncEntropy::encodeSaoUnitInterleaving(Int compIdx, Bool saoFlag, Int rx, Int ry, SaoLcuParam* saoLcuParam, Int cuAddrInSlice, Int cuAddrUpInSlice, Int allowMergeLeft, Int allowMergeUp)
     1643{
     1644    if (saoFlag)
     1645    {
     1646        if (rx>0 && cuAddrInSlice!=0 && allowMergeLeft)
     1647        {
     1648            m_pcEntropyCoderIf->codeSaoMerge(saoLcuParam->mergeLeftFlag);
     1649        }
     1650        else
     1651        {
     1652            saoLcuParam->mergeLeftFlag = 0;
     1653        }
     1654       
     1655        if (saoLcuParam->mergeLeftFlag == 0)
     1656        {
     1657            if ( (ry > 0) && (cuAddrUpInSlice>=0) && allowMergeUp )
     1658            {
     1659                m_pcEntropyCoderIf->codeSaoMerge(saoLcuParam->mergeUpFlag);
     1660            }
     1661            else
     1662            {
     1663                saoLcuParam->mergeUpFlag = 0;
     1664            }
     1665
     1666            if (!saoLcuParam->mergeUpFlag)
     1667            {
     1668                encodeSaoOffset(saoLcuParam, compIdx);
     1669            }
     1670        }
     1671    }
     1672}
     1673#else
    14971674/** Encode SAO Offset
    14981675 * \param  saoLcuParam SAO LCU paramters
     
    16821859  }
    16831860}
     1861#endif
    16841862
    16851863Int TEncEntropy::countNonZeroCoeffs( TCoeff* pcCoef, UInt uiSize )
     
    17151893
    17161894#if RWTH_SDC_DLT_B0036
     1895#if !PKU_QC_DEPTH_INTRA_UNI_D0195
    17171896Void TEncEntropy::encodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
    17181897{
     
    17341913  m_pcEntropyCoderIf->codeSDCFlag(pcCU, uiAbsPartIdx);
    17351914}
    1736 
     1915#endif
    17371916Void TEncEntropy::encodeSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
    17381917{
Note: See TracChangeset for help on using the changeset viewer.