Changeset 406 in 3DVCSoftware for branches/HTM-6.2-dev3-LG-2/source/Lib/TLibEncoder
- Timestamp:
- 16 May 2013, 05:07:24 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-6.2-dev3-LG-2/source/Lib/TLibEncoder/TEncSbac.cpp
r397 r406 45 45 #define GetNumDepthValues() (pcCU->getSlice()->getSPS()->getNumDepthValues()) 46 46 #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 47 51 #endif 48 52 … … 2649 2653 UInt uiSign = segmentDCOffset < 0 ? 1 : 0; 2650 2654 UInt uiAbsIdx = abs(segmentDCOffset); 2655 #if !LGE_CONCATENATE 2651 2656 UInt uiBit = 0; 2657 #endif 2652 2658 2653 2659 UInt uiMaxResidualBits = GetBitsPerDepthValue(); … … 2674 2680 // encode residual magnitude 2675 2681 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 2676 2712 for (Int i=0; i<uiMaxResidualBits; i++) 2677 2713 { … … 2684 2720 #endif 2685 2721 } 2722 #endif 2686 2723 2687 2724 }
Note: See TracChangeset for help on using the changeset viewer.