Changeset 415 in 3DVCSoftware for branches


Ignore:
Timestamp:
17 May 2013, 14:26:01 (12 years ago)
Author:
rwth
Message:
  • removed unnecessary macros
Location:
branches/HTM-6.2-dev3-RWTH-Fix/source/Lib
Files:
2 edited

Legend:

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

    r414 r415  
    3737
    3838#include "TDecSbac.h"
    39 
    40 #if RWTH_SDC_DLT_B0036
    41 #define GetNumDepthValues()     (pcCU->getSlice()->getSPS()->getNumDepthValues())
    42 #define GetBitsPerDepthValue()  (pcCU->getSlice()->getSPS()->getBitsPerDepthValue())
    43 #if LGE_CONCATENATE_D0141
    44 #define PrefixThreshold ( ((GetNumDepthValues() * 3) >> 2) )
    45 #define BitsPerSuffix ( (UInt)ceil( Log2(GetNumDepthValues() - PrefixThreshold) ) )
    46 #endif
    47 #endif
    4839
    4940//! \ingroup TLibDecoder
     
    26582649  Int  iIdx       = 0;
    26592650 
    2660   UInt uiMaxResidualBits  = GetBitsPerDepthValue();
     2651  UInt uiMaxResidualBits  = pcCU->getSlice()->getSPS()->getBitsPerDepthValue();
    26612652  assert( uiMaxResidualBits <= g_uiBitDepth );
    26622653 
     
    26802671    //prefix part
    26812672    UInt uiCount = 0;
    2682     for ( UInt ui = 0; ui < PrefixThreshold; ui++)
     2673    UInt uiNumDepthValues = pcCU->getSlice()->getSPS()->getNumDepthValues();
     2674    UInt uiPrefixThreshold = ((uiNumDepthValues * 3) >> 2);
     2675    for ( UInt ui = 0; ui < uiPrefixThreshold; ui++)
    26832676    {
    26842677        m_pcTDecBinIf->decodeBin( uiBit, m_cSDCResidualSCModel.get(0, 0, 0) );
     
    26892682    }
    26902683    //suffix part
    2691     if ( uiCount == PrefixThreshold )
    2692     {
    2693         for ( UInt ui = 0; ui < BitsPerSuffix; ui++ )
     2684    if ( uiCount == uiPrefixThreshold )
     2685    {
     2686        for ( UInt ui = 0; ui < ( (UInt)ceil( Log2(uiNumDepthValues - uiPrefixThreshold) ) ); ui++ )
    26942687        {
    26952688            m_pcTDecBinIf->decodeBinEP( uiBit );
  • 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.