Ignore:
Timestamp:
17 May 2013, 14:26:01 (12 years ago)
Author:
rwth
Message:
  • removed unnecessary macros
File:
1 edited

Legend:

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

    r414 r415  
    4141#include <map>
    4242#include <algorithm>
    43 
    44 #if RWTH_SDC_DLT_B0036
    45 #define GetNumDepthValues()     (pcCU->getSlice()->getSPS()->getNumDepthValues())
    46 #define GetBitsPerDepthValue()  (pcCU->getSlice()->getSPS()->getBitsPerDepthValue())
    47 #if LGE_CONCATENATE_D0141
    48 #define PrefixThreshold ( ((GetNumDepthValues() * 3) >> 2) )
    49 #define BitsPerSuffix ( (UInt)ceil( Log2(GetNumDepthValues() - PrefixThreshold) ) )
    50 #endif
    51 #endif
    5243
    5344//! \ingroup TLibEncoder
     
    26572648#endif
    26582649 
    2659   UInt uiMaxResidualBits  = GetBitsPerDepthValue();
     2650  UInt uiMaxResidualBits  = pcCU->getSlice()->getSPS()->getBitsPerDepthValue();
    26602651  assert( uiMaxResidualBits <= g_uiBitDepth );
    26612652 
     
    26752666    m_pcBinIf->encodeBin( uiSign, m_cSDCResidualSignFlagSCModel.get( 0, uiSegment, 0 ) ); //TODO depthmap: more sophisticated context selection
    26762667#endif
    2677        
    2678     assert(uiAbsIdx < GetNumDepthValues());
     2668   
     2669    UInt uiNumDepthValues = pcCU->getSlice()->getSPS()->getNumDepthValues();
     2670    assert(uiAbsIdx < uiNumDepthValues);
    26792671   
    26802672    // encode residual magnitude
     
    26882680        UInt l = uiAbsIdx;
    26892681        UInt k = 0;
    2690         while ( l > 0 && k < PrefixThreshold )
     2682        UInt uiPrefixThreshold = ((uiNumDepthValues * 3) >> 2);
     2683        while ( l > 0 && k < uiPrefixThreshold )
    26912684        {
    26922685            m_pcBinIf->encodeBin( 1, m_cSDCResidualSCModel.get(0, 0, 0) );
     
    26942687            k++;
    26952688        }
    2696         if ( uiAbsIdx < PrefixThreshold )
     2689        if ( uiAbsIdx < uiPrefixThreshold )
    26972690            m_pcBinIf->encodeBin( 0, m_cSDCResidualSCModel.get(0, 0, 0) );
    26982691        //suffix part
    26992692        else
    27002693        {
    2701             uiAbsIdx -= PrefixThreshold;
    2702             UInt uiSuffixLength = BitsPerSuffix;
     2694            uiAbsIdx -= uiPrefixThreshold;
     2695            UInt uiSuffixLength = ( (UInt)ceil( Log2(uiNumDepthValues - uiPrefixThreshold) ) );
    27032696            UInt uiBitInfo = 0;
    27042697            for ( Int i = 0; i < uiSuffixLength; i++)
Note: See TracChangeset for help on using the changeset viewer.