Ignore:
Timestamp:
16 May 2013, 05:07:24 (12 years ago)
Author:
lg
Message:

D0141 with Macro LGE_CONCATENATE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-6.2-dev3-LG-2/source/Lib/TLibEncoder/TEncSbac.cpp

    r397 r406  
    4545#define GetNumDepthValues()     (pcCU->getSlice()->getSPS()->getNumDepthValues())
    4646#define GetBitsPerDepthValue()  (pcCU->getSlice()->getSPS()->getBitsPerDepthValue())
     47#if LGE_CONCATENATE
     48#define PrefixThreshold ( ((GetNumDepthValues() * 3) >> 2) )
     49#define BitsPerSuffix ( (UInt)ceil( Log2(GetNumDepthValues() - PrefixThreshold) ) )
     50#endif
    4751#endif
    4852
     
    26492653  UInt uiSign     = segmentDCOffset < 0 ? 1 : 0;
    26502654  UInt uiAbsIdx   = abs(segmentDCOffset);
     2655#if !LGE_CONCATENATE
    26512656  UInt uiBit = 0;
     2657#endif
    26522658 
    26532659  UInt uiMaxResidualBits  = GetBitsPerDepthValue();
     
    26742680    // encode residual magnitude
    26752681    uiAbsIdx -= 1;
     2682#if LGE_CONCATENATE
     2683    //prefix part
     2684    if ( uiAbsIdx == 0 )
     2685        m_pcBinIf->encodeBin( 0, m_cSDCResidualSCModel.get(0, 0, 0) );
     2686    else
     2687    {
     2688        UInt l = uiAbsIdx;
     2689        UInt k = 0;
     2690        while ( l > 0 && k < PrefixThreshold )
     2691        {
     2692            m_pcBinIf->encodeBin( 1, m_cSDCResidualSCModel.get(0, 0, 0) );
     2693            l--;
     2694            k++;
     2695        }
     2696        if ( uiAbsIdx < PrefixThreshold )
     2697            m_pcBinIf->encodeBin( 0, m_cSDCResidualSCModel.get(0, 0, 0) );
     2698        //suffix part
     2699        else
     2700        {
     2701            uiAbsIdx -= PrefixThreshold;
     2702            UInt uiSuffixLength = BitsPerSuffix;
     2703            UInt uiBitInfo = 0;
     2704            for ( Int i = 0; i < uiSuffixLength; i++)
     2705            {
     2706                uiBitInfo = ( uiAbsIdx & ( 1 << i ) ) >> i;
     2707                m_pcBinIf->encodeBinEP( uiBitInfo);
     2708            }
     2709        }
     2710    }
     2711#else
    26762712    for (Int i=0; i<uiMaxResidualBits; i++)
    26772713    {
     
    26842720#endif
    26852721    }
     2722#endif
    26862723   
    26872724  }
Note: See TracChangeset for help on using the changeset viewer.