Changeset 406 in 3DVCSoftware for branches/HTM-6.2-dev3-LG-2


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

D0141 with Macro LGE_CONCATENATE

Location:
branches/HTM-6.2-dev3-LG-2/source/Lib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-6.2-dev3-LG-2/source/Lib/TLibCommon/ContextTables.h

    r397 r406  
    138138#define SDC_NUM_SIGN_FLAG_CTX            1
    139139#endif
     140#if LGE_CONCATENATE
     141#define SDC_NUM_RESIDUAL_CTX             1
     142#else
    140143#if RWTH_SDC_CTX_SIMPL_D0032
    141144#define SDC_NUM_RESIDUAL_CTX             8
    142145#else
    143146#define SDC_NUM_RESIDUAL_CTX             10
     147#endif
    144148#endif
    145149
     
    576580  }
    577581};
    578 
     582   
     583#if LGE_CONCATENATE
    579584static const UChar INIT_SDC_RESIDUAL[3][SDC_NUM_RESIDUAL_CTX] =
    580585{
     586    {
     587         155
     588    },
     589    {
     590         155
     591    },
     592    {
     593        155
     594    }
     595};
     596#else
     597static const UChar INIT_SDC_RESIDUAL[3][SDC_NUM_RESIDUAL_CTX] =
     598{
    581599  {
    582600    CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU
     
    589607  }
    590608};
     609#endif
    591610
    592611static const UChar INIT_SDC_PRED_MODE[3][3*SDC_NUM_PRED_MODE_CTX] =
  • branches/HTM-6.2-dev3-LG-2/source/Lib/TLibCommon/TypeDef.h

    r397 r406  
    7474#define INTEL_SDC64_D0193                 1   // JCT3V-D0193: SDC binary clean up (use a 1 bit binary code to signal sdc_pred_mode when CU size is 64x64)
    7575#define RWTH_SDC_CTX_SIMPL_D0032          1   // JCT3V-D0032: CABAC Context Reduction for Simplified Depth Coding
     76#define LGE_CONCATENATE                 1 // JCT3V-D0141: concatenate binarization for residual index coding
    7677#endif
    7778#define FIX_SDC_ENC_RD_WVSO_D0163         1   // JCT3V-D0163: fix for SDC encoder rd-cost (VSO -> WVSO)
  • branches/HTM-6.2-dev3-LG-2/source/Lib/TLibDecoder/TDecSbac.cpp

    r397 r406  
    4141#define GetNumDepthValues()     (pcCU->getSlice()->getSPS()->getNumDepthValues())
    4242#define GetBitsPerDepthValue()  (pcCU->getSlice()->getSPS()->getBitsPerDepthValue())
     43#if LGE_CONCATENATE
     44#define PrefixThreshold ( ((GetNumDepthValues() * 3) >> 2) )
     45#define BitsPerSuffix ( (UInt)ceil( Log2(GetNumDepthValues() - PrefixThreshold) ) )
     46#endif
    4347#endif
    4448
     
    26732677   
    26742678    // decode residual magnitude
     2679#if LGE_CONCATENATE
     2680    //prefix part
     2681    UInt uiCount = 0;
     2682    for ( UInt ui = 0; ui < PrefixThreshold; ui++)
     2683    {
     2684        m_pcTDecBinIf->decodeBin( uiBit, m_cSDCResidualSCModel.get(0, 0, 0) );
     2685        if ( uiBit == 0 )
     2686            break;
     2687        else
     2688            uiCount++;
     2689    }
     2690    //suffix part
     2691    if ( uiCount == PrefixThreshold )
     2692    {
     2693        for ( UInt ui = 0; ui < BitsPerSuffix; ui++ )
     2694        {
     2695            m_pcTDecBinIf->decodeBinEP( uiBit );
     2696            uiAbsIdx |= uiBit << ui;
     2697        }
     2698        uiAbsIdx += uiCount;
     2699    }
     2700    else
     2701        uiAbsIdx = uiCount;
     2702#else
    26752703    for (Int i=0; i<uiMaxResidualBits; i++)
    26762704    {
     
    26822710      uiAbsIdx |= uiBit << i;
    26832711    }
     2712#endif
    26842713   
    26852714    uiAbsIdx += 1;
  • 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.