Ignore:
Timestamp:
16 May 2013, 09:23:44 (12 years ago)
Author:
lg
Message:

D0135->D0092->D0091

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-6.2-dev1-LG/source/Lib/TLibEncoder/TEncEntropy.cpp

    r348 r408  
    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
     
    14991510}
    15001511
     1512#if LGE_SAO_MIGRATION_D0091
     1513Void TEncEntropy::encodeSaoOffset(SaoLcuParam* saoLcuParam, UInt compIdx)
     1514{
     1515    UInt uiSymbol;
     1516    Int i;
     1517
     1518    uiSymbol = saoLcuParam->typeIdx + 1;
     1519    if (compIdx!=2)
     1520    {
     1521        m_pcEntropyCoderIf->codeSaoTypeIdx(uiSymbol);
     1522    }
     1523
     1524    if (uiSymbol)
     1525    {
     1526        if (saoLcuParam->typeIdx < 4 && compIdx != 2)
     1527        {
     1528            saoLcuParam->subTypeIdx = saoLcuParam->typeIdx;
     1529        }
     1530#if FULL_NBIT
     1531        Int offsetTh = 1 << ( min((Int)(g_uiBitDepth + (g_uiBitDepth-8)-5),5) );
     1532#else
     1533        Int offsetTh = 1 << ( min((Int)(g_uiBitDepth + g_uiBitIncrement-5),5) );
     1534#endif
     1535        if( saoLcuParam->typeIdx == SAO_BO )
     1536        {
     1537            for( i=0; i< saoLcuParam->length; i++)
     1538            {
     1539                UInt absOffset = ( (saoLcuParam->offset[i] < 0) ? -saoLcuParam->offset[i] : saoLcuParam->offset[i]);
     1540                m_pcEntropyCoderIf->codeSaoMaxUvlc(absOffset, offsetTh-1);
     1541            } 
     1542            for( i=0; i< saoLcuParam->length; i++)
     1543            {
     1544                if (saoLcuParam->offset[i] != 0)
     1545                {
     1546                    UInt sign = (saoLcuParam->offset[i] < 0) ? 1 : 0 ;
     1547                    m_pcEntropyCoderIf->codeSAOSign(sign);
     1548                }
     1549            }
     1550            uiSymbol = (UInt) (saoLcuParam->subTypeIdx);
     1551            m_pcEntropyCoderIf->codeSaoUflc(5, uiSymbol);
     1552        }
     1553        else if( saoLcuParam->typeIdx < 4 )
     1554        {
     1555            m_pcEntropyCoderIf->codeSaoMaxUvlc( saoLcuParam->offset[0], offsetTh-1);
     1556            m_pcEntropyCoderIf->codeSaoMaxUvlc( saoLcuParam->offset[1], offsetTh-1);
     1557            m_pcEntropyCoderIf->codeSaoMaxUvlc(-saoLcuParam->offset[2], offsetTh-1);
     1558            m_pcEntropyCoderIf->codeSaoMaxUvlc(-saoLcuParam->offset[3], offsetTh-1);
     1559
     1560            if (compIdx!=2)
     1561            {
     1562                uiSymbol = (UInt) (saoLcuParam->subTypeIdx);
     1563                m_pcEntropyCoderIf->codeSaoUflc(2, uiSymbol);
     1564            }
     1565        }
     1566    }
     1567}
     1568
     1569/** Encode SAO unit interleaving
     1570* \param  rx
     1571* \param  ry
     1572* \param  pSaoParam
     1573* \param  pcCU
     1574* \param  iCUAddrInSlice
     1575* \param  iCUAddrUpInSlice
     1576* \param  bLFCrossSliceBoundaryFlag
     1577 */
     1578Void TEncEntropy::encodeSaoUnitInterleaving(Int compIdx, Bool saoFlag, Int rx, Int ry, SaoLcuParam* saoLcuParam, Int cuAddrInSlice, Int cuAddrUpInSlice, Int allowMergeLeft, Int allowMergeUp)
     1579{
     1580    if (saoFlag)
     1581    {
     1582        if (rx>0 && cuAddrInSlice!=0 && allowMergeLeft)
     1583        {
     1584            m_pcEntropyCoderIf->codeSaoMerge(saoLcuParam->mergeLeftFlag);
     1585        }
     1586        else
     1587        {
     1588            saoLcuParam->mergeLeftFlag = 0;
     1589        }
     1590       
     1591        if (saoLcuParam->mergeLeftFlag == 0)
     1592        {
     1593            if ( (ry > 0) && (cuAddrUpInSlice>=0) && allowMergeUp )
     1594            {
     1595                m_pcEntropyCoderIf->codeSaoMerge(saoLcuParam->mergeUpFlag);
     1596            }
     1597            else
     1598            {
     1599                saoLcuParam->mergeUpFlag = 0;
     1600            }
     1601
     1602            if (!saoLcuParam->mergeUpFlag)
     1603            {
     1604                encodeSaoOffset(saoLcuParam, compIdx);
     1605            }
     1606        }
     1607    }
     1608}
     1609#else
    15011610/** Encode SAO Offset
    15021611 * \param  saoLcuParam SAO LCU paramters
     
    16861795  }
    16871796}
     1797#endif
    16881798
    16891799Int TEncEntropy::countNonZeroCoeffs( TCoeff* pcCoef, UInt uiSize )
Note: See TracChangeset for help on using the changeset viewer.