Changeset 433 in 3DVCSoftware for branches/HTM-6.2-dev0/source
- Timestamp:
- 22 May 2013, 21:05:43 (12 years ago)
- Location:
- branches/HTM-6.2-dev0/source/Lib
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-6.2-dev0/source/Lib/TLibCommon/ContextTables.h
r427 r433 133 133 134 134 #if RWTH_SDC_DLT_B0036 135 #if PKU_QC_DEPTH_INTRA_UNI_D0195 136 #define DEPTH_MODE_NUM_FLAG_CTX 8 137 #define DMM_DELTA_NUM_FLAG_CTX 1 138 #else 135 139 #define SDC_NUM_FLAG_CTX 3 140 #endif 136 141 #define SDC_NUM_RESIDUAL_FLAG_CTX 1 142 #if !RWTH_SDC_CTX_SIMPL_D0032 137 143 #define SDC_NUM_SIGN_FLAG_CTX 1 144 #endif 145 #if LGE_CONCATENATE_D0141 146 #define SDC_NUM_RESIDUAL_CTX 1 147 #else 148 #if RWTH_SDC_CTX_SIMPL_D0032 149 #define SDC_NUM_RESIDUAL_CTX 8 150 #else 138 151 #define SDC_NUM_RESIDUAL_CTX 10 152 #endif 153 #endif 139 154 140 155 #define SDC_NUM_PRED_MODE_CTX 5 … … 555 570 556 571 #if RWTH_SDC_DLT_B0036 572 #if PKU_QC_DEPTH_INTRA_UNI_D0195 573 static const UChar INIT_DEPTHMODE_FLAG[3][DEPTH_MODE_NUM_FLAG_CTX]= 574 { 575 {0, 0, 64, 0, CNU, 0, CNU, 0}, 576 {0, 64, 0, CNU, 0, CNU, 0, 0}, 577 {64, 0, CNU, 0, CNU, 0, 0, 0} 578 }; 579 static const UChar INIT_DMMDELTA_FLAG[3][DMM_DELTA_NUM_FLAG_CTX]= 580 { 581 {0}, 582 {0}, 583 {64} 584 }; 585 #else 557 586 static const Short INIT_SDC_FLAG[3][SDC_NUM_FLAG_CTX][2] = 558 587 { … … 567 596 } 568 597 }; 569 598 #endif 599 600 #if RWTH_SDC_CTX_SIMPL_D0032 601 static const UChar INIT_SDC_RESIDUAL_FLAG[3][SDC_NUM_RESIDUAL_FLAG_CTX] = 602 { 603 { 604 CNU 605 606 }, 607 { 608 CNU 609 }, 610 { 611 CNU 612 } 613 }; 614 615 #if LGE_CONCATENATE_D0141 616 static const UChar INIT_SDC_RESIDUAL[3][SDC_NUM_RESIDUAL_CTX] = 617 { 618 { 619 155 620 }, 621 { 622 155 623 }, 624 { 625 155 626 } 627 }; 628 #else 629 static const UChar INIT_SDC_RESIDUAL[3][SDC_NUM_RESIDUAL_CTX] = 630 { 631 { 632 CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU 633 }, 634 { 635 CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU 636 }, 637 { 638 CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU 639 } 640 }; 641 #endif 642 643 static const UChar INIT_SDC_PRED_MODE[3][3*SDC_NUM_PRED_MODE_CTX] = 644 { 645 { 646 CNU, CNU 647 ,CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU 648 }, 649 { 650 CNU, CNU 651 ,CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU 652 }, 653 { 654 CNU, CNU 655 ,CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU, CNU 656 } 657 }; 658 #else 570 659 static const Short INIT_SDC_RESIDUAL_FLAG[3][3*SDC_NUM_RESIDUAL_FLAG_CTX][2] = 571 660 { … … 645 734 }; 646 735 #endif 736 #endif 647 737 648 738 //! \} -
branches/HTM-6.2-dev0/source/Lib/TLibCommon/TComDataCU.cpp
r427 r433 3196 3196 } 3197 3197 3198 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 3198 3199 UInt TComDataCU::getCtxSDCFlag( UInt uiAbsPartIdx ) 3199 3200 { … … 3212 3213 return uiCtx; 3213 3214 } 3215 #endif 3214 3216 3215 3217 Bool TComDataCU::getSDCAvailable( UInt uiAbsPartIdx ) -
branches/HTM-6.2-dev0/source/Lib/TLibCommon/TComDataCU.h
r427 r433 886 886 Void setSDCFlagSubParts ( Bool bSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 887 887 888 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 888 889 UInt getCtxSDCFlag ( UInt uiAbsPartIdx ); 890 #endif 889 891 890 892 Bool getSDCAvailable ( UInt uiAbsPartIdx ); -
branches/HTM-6.2-dev0/source/Lib/TLibCommon/TComPrediction.cpp
r427 r433 50 50 #endif 51 51 52 #if HHI_DELTADC_DLT_D0035 53 #define GetDepthValue2Idx(val) (pcCU->getSlice()->getSPS()->depthValue2idx(val)) 54 #define GetIdx2DepthValue(val) (pcCU->getSlice()->getSPS()->idx2DepthValue(val)) 55 #endif 56 52 57 #if MERL_General_Fix 53 58 #if MERL_VSP_C0152 … … 555 560 // Do prediction 556 561 { 562 #if QC_DC_PREDICTOR_D0183 563 Int iMean0, iMean1; 564 getPredDCs( pbRegion, iWidth, pSrc+srcStride+1, srcStride, iMean0, iMean1 ); 565 #else 557 566 //UInt uiSum0 = 0, uiSum1 = 0; 558 567 Int iSum0 = 0, iSum1 = 0; … … 593 602 iMean0 = iSum0 / iCount0; // TODO : integer op. 594 603 iMean1 = iSum1 / iCount1; 604 #endif 595 605 #if LGE_EDGE_INTRA_DELTA_DC 596 606 if( bDelta ) … … 3163 3173 } 3164 3174 3175 #if QC_DC_PREDICTOR_D0183 3176 Void TComPrediction::getPredDCs( Bool* pbPattern, Int iStride, Int* piMask, Int iMaskStride, Int& riPredDC1, Int& riPredDC2 ) 3177 { 3178 Int iDC1, iDC2; 3179 const Int iTR = ( iStride - 1 ) - iMaskStride; 3180 const Int iTM = ( ( iStride - 1 ) >> 1 ) - iMaskStride; 3181 const Int iLB = ( iStride - 1 ) * iMaskStride - 1; 3182 const Int iLM = ( ( iStride - 1 ) >> 1 ) * iMaskStride - 1; 3183 const UInt uiBitDepth = g_uiBitDepth + g_uiBitIncrement; 3184 3185 Bool bL = ( pbPattern[0] != pbPattern[(iStride-1)*iStride] ); 3186 Bool bT = ( pbPattern[0] != pbPattern[(iStride-1)] ); 3187 3188 if( bL == bT ) 3189 { 3190 iDC1 = bL ? ( piMask[iTR] + piMask[iLB] )>>1 : 1<<( uiBitDepth - 1 ); 3191 iDC2 = ( piMask[ -1] + piMask[-iMaskStride] )>>1; 3192 } 3193 else 3194 { 3195 iDC1 = bL ? piMask[iLB] : piMask[iTR]; 3196 iDC2 = bL ? piMask[iTM] : piMask[iLM]; 3197 } 3198 3199 riPredDC1 = pbPattern[0] ? iDC1 : iDC2; 3200 riPredDC2 = pbPattern[0] ? iDC2 : iDC1; 3201 } 3202 #else 3165 3203 Void TComPrediction::getWedgePredDCs( TComWedgelet* pcWedgelet, Int* piMask, Int iMaskStride, Int& riPredDC1, Int& riPredDC2, Bool bAbove, Bool bLeft ) 3166 3204 { … … 3240 3278 } 3241 3279 } 3280 #endif 3242 3281 3243 3282 Void TComPrediction::calcWedgeDCs( TComWedgelet* pcWedgelet, Pel* piOrig, UInt uiStride, Int& riDC1, Int& riDC2 ) … … 3607 3646 Int iMaskStride = ( iWidth<<1 ) + 1; 3608 3647 piMask += iMaskStride+1; 3648 #if QC_DC_PREDICTOR_D0183 3649 getPredDCs( pcWedgelet->getPattern(), pcWedgelet->getStride(), piMask, iMaskStride, iPredDC1, iPredDC2 ); 3650 #else 3609 3651 getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft ); 3652 #endif 3610 3653 3611 3654 // assign wedge pred DCs to prediction 3612 if( bDelta ) { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip ( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); } 3613 else { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, iPredDC1, iPredDC2 ); } 3655 if( bDelta ) 3656 { 3657 #if HHI_DELTADC_DLT_D0035 3658 assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, GetIdx2DepthValue( GetDepthValue2Idx(iPredDC1) + iDeltaDC1 ), GetIdx2DepthValue( GetDepthValue2Idx(iPredDC2) + iDeltaDC2 ) ); 3659 #else 3660 assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); 3661 #endif 3662 } 3663 else 3664 { 3665 assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, iPredDC1, iPredDC2 ); 3666 } 3614 3667 } 3615 3668 … … 3626 3679 Int iMaskStride = ( iWidth<<1 ) + 1; 3627 3680 piMask += iMaskStride+1; 3681 #if QC_DC_PREDICTOR_D0183 3682 getPredDCs( pcContourWedge->getPattern(), pcContourWedge->getStride(), piMask, iMaskStride, iPredDC1, iPredDC2 ); 3683 #else 3628 3684 getWedgePredDCs( pcContourWedge, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft ); 3685 #endif 3629 3686 3630 3687 // assign wedge pred DCs to prediction 3631 if( bDelta ) { assignWedgeDCs2Pred( pcContourWedge, piPred, uiStride, Clip ( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); } 3632 else { assignWedgeDCs2Pred( pcContourWedge, piPred, uiStride, iPredDC1, iPredDC2 ); } 3688 if( bDelta ) 3689 { 3690 #if HHI_DELTADC_DLT_D0035 3691 assignWedgeDCs2Pred( pcContourWedge, piPred, uiStride, GetIdx2DepthValue( GetDepthValue2Idx(iPredDC1) + iDeltaDC1 ), GetIdx2DepthValue( GetDepthValue2Idx(iPredDC2) + iDeltaDC2 ) ); 3692 #else 3693 assignWedgeDCs2Pred( pcContourWedge, piPred, uiStride, Clip( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); 3694 #endif 3695 } 3696 else 3697 { 3698 assignWedgeDCs2Pred( pcContourWedge, piPred, uiStride, iPredDC1, iPredDC2 ); 3699 } 3633 3700 3634 3701 pcContourWedge->destroy(); … … 3801 3868 Int iMaskStride = ( iWidth<<1 ) + 1; 3802 3869 piMask += iMaskStride+1; 3870 #if QC_DC_PREDICTOR_D0183 3871 getPredDCs( pcWedgelet->getPattern(), pcWedgelet->getStride(), piMask, iMaskStride, iPredDC1, iPredDC2 ); 3872 #else 3803 3873 getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft ); 3874 #endif 3804 3875 3805 3876 // assign wedge pred DCs to prediction 3806 if( bDelta ) { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); } 3807 else { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, iPredDC1, iPredDC2 ); } 3877 if( bDelta ) 3878 { 3879 #if HHI_DELTADC_DLT_D0035 3880 assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, GetIdx2DepthValue( GetDepthValue2Idx(iPredDC1) + iDeltaDC1 ), GetIdx2DepthValue( GetDepthValue2Idx(iPredDC2) + iDeltaDC2 ) ); 3881 #else 3882 assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); 3883 #endif 3884 } 3885 else 3886 { 3887 assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, iPredDC1, iPredDC2 ); 3888 } 3808 3889 } 3809 3890 … … 3836 3917 Int iMaskStride = ( iWidth<<1 ) + 1; 3837 3918 piMask += iMaskStride+1; 3919 #if QC_DC_PREDICTOR_D0183 3920 getPredDCs( pcWedgelet->getPattern(), pcWedgelet->getStride(), piMask, iMaskStride, iPredDC1, iPredDC2 ); 3921 #else 3838 3922 getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft ); 3923 #endif 3839 3924 3840 3925 // assign wedge pred DCs to prediction 3841 if( bDelta ) { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); } 3842 else { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, iPredDC1, iPredDC2 ); } 3926 if( bDelta ) 3927 { 3928 #if HHI_DELTADC_DLT_D0035 3929 assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, GetIdx2DepthValue( GetDepthValue2Idx(iPredDC1) + iDeltaDC1 ), GetIdx2DepthValue( GetDepthValue2Idx(iPredDC2) + iDeltaDC2 ) ); 3930 #else 3931 assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); 3932 #endif 3933 } 3934 else 3935 { 3936 assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, iPredDC1, iPredDC2 ); 3937 } 3843 3938 } 3844 3939 -
branches/HTM-6.2-dev0/source/Lib/TLibCommon/TComPrediction.h
r422 r433 249 249 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 250 250 Void predIntraLumaDMM ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder ); 251 252 251 Void getWedgePredDCs ( TComWedgelet* pcWedgelet, Int* piMask, Int iMaskStride, Int& riPredDC1, Int& riPredDC2, Bool bAbove, Bool bLeft ); 252 #endif 253 253 Void calcWedgeDCs ( TComWedgelet* pcWedgelet, Pel* piOrig, UInt uiStride, Int& riDC1, Int& riDC2 ); 254 254 Void assignWedgeDCs2Pred ( TComWedgelet* pcWedgelet, Pel* piPred, UInt uiStride, Int iDC1, Int iDC2 ); -
branches/HTM-6.2-dev0/source/Lib/TLibCommon/TComWedgelet.cpp
r296 r433 783 783 Int deltax = x1 - x0; 784 784 Int deltay = abs(y1 - y0); 785 #if FIX_WEDGE_NOFLOAT_D0036 786 Int error = 0; 787 Int deltaerr = (deltay<<1); 788 #else 785 789 double error = 0.0; 786 790 double deltaerr = (double)deltay / (double)deltax; 791 #endif 787 792 788 793 Int ystep; … … 797 802 798 803 error += deltaerr; 804 #if FIX_WEDGE_NOFLOAT_D0036 805 if( error >= deltax ) 806 #else 799 807 if( error >= 0.5) 808 #endif 800 809 { 801 810 y += ystep; 811 #if FIX_WEDGE_NOFLOAT_D0036 812 error = error - (deltax<<1); 813 #else 802 814 error = error - 1.0; 815 #endif 803 816 } 804 817 } -
branches/HTM-6.2-dev0/source/Lib/TLibCommon/TypeDef.h
r428 r433 59 59 // HHI_DMM_DELTADC_Q1_C0034 JCT3V-C0034: no quantization and fast encoder search for DMM delta DC values 60 60 // FIX_DMM_CTX_INIT_C0034 JCT3V-C0034 fix for wrong init type of DMM contexts (UChar instead of Short) 61 #define FIX_WEDGE_NOFLOAT_D0036 1 // JCT3V-D0036: Fix for aligning SW and spec (Wedgelet segmentation line generation without float) 61 62 62 63 #define LGE_EDGE_INTRA_A0070 1 // JCT3V-A0070 63 64 #define LGE_DMM3_SIMP_C0044 1 65 66 #define QC_DC_PREDICTOR_D0183 1 // JCT3V-D0183: Simplified DC predictor for depth intra modes 64 67 65 68 ///// ***** SDC ********* … … 67 70 // SAIT_SDC_C0096 JCT3V-C0096: Improved Simple Depth Coding(removal of DMM2 among four SDC modes(DC, Planar, DMM1 and DMM2)) 68 71 // FIX_SDC_ENC_C0143, JCT3V-C0143 fix for unnecessary encoder checks in case of SDC 69 72 #if RWTH_SDC_DLT_B0036 73 #define HHI_DELTADC_DLT_D0035 1 // JCT3V-D0035: DLT for DMM deltaDC coding 74 #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) 75 #define RWTH_SDC_CTX_SIMPL_D0032 1 // JCT3V-D0032: CABAC Context Reduction for Simplified Depth Coding 76 #define LGE_CONCATENATE_D0141 1 // JCT3V-D0141: concatenate binarization for residual index coding 77 #endif 78 #define FIX_SDC_ENC_RD_WVSO_D0163 1 // JCT3V-D0163: fix for SDC encoder rd-cost (VSO -> WVSO) 79 80 #define PKU_QC_DEPTH_INTRA_UNI_D0195 1 // JCT3V-D0195: unified syntax table for depth intra coding tools 81 #define MTK_SAMPLE_BASED_SDC_D0110 1 // JCT3V-D0110: sample based SDC 70 82 ///// ***** TMVP/AMVP ********* 71 83 #define TMVP_DEPTH_SWITCH 1 // JCT3V-B0092 additional encoder option only -
branches/HTM-6.2-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp
r427 r433 2479 2479 #endif 2480 2480 #if RWTH_SDC_DLT_B0036 2481 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 2481 2482 Void TDecCavlc::parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2482 2483 { … … 2487 2488 assert(0); 2488 2489 } 2490 #endif 2489 2491 Void TDecCavlc::parseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ) 2490 2492 { -
branches/HTM-6.2-dev0/source/Lib/TLibDecoder/TDecCAVLC.h
r427 r433 174 174 Void parseDFSvlc ( Int& riVal, const Char *pSymbolName ); 175 175 #if RWTH_SDC_DLT_B0036 176 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 176 177 Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 177 178 Void parseSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 179 #endif 178 180 Void parseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ); 179 181 #endif -
branches/HTM-6.2-dev0/source/Lib/TLibDecoder/TDecCu.cpp
r427 r433 1164 1164 UChar ucSegment = pMask?(UChar)pMask[uiX]:0; 1165 1165 assert( ucSegment < uiNumSegments ); 1166 #if MTK_SAMPLE_BASED_SDC_D0110 1167 Pel pResiDC = apDCResiValues[ucSegment]; 1166 1168 1169 pReco [ uiX ] = Clip( pPred[ uiX ] + pResiDC ); 1170 #else 1167 1171 Pel pPredVal= apDCPredValues[ucSegment]; 1168 1172 Pel pResiDC = apDCResiValues[ucSegment]; 1169 1173 1170 1174 pReco [ uiX ] = Clip( pPredVal + pResiDC ); 1175 #endif 1171 1176 pRecIPred[ uiX ] = pReco[ uiX ]; 1172 1177 } -
branches/HTM-6.2-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp
r427 r433 130 130 m_pcEntropyDecoderIf->parsePredMode( pcCU, uiAbsPartIdx, uiDepth ); 131 131 132 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 132 133 #if RWTH_SDC_DLT_B0036 133 134 // if B-Slice, code SDC flag later … … 138 139 } 139 140 #endif 141 #endif 140 142 } 141 143 142 144 Void TDecEntropy::decodePartSize( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 143 145 { 146 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 144 147 #if RWTH_SDC_DLT_B0036 145 148 if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSDCFlag(uiAbsPartIdx) ) … … 150 153 } 151 154 #endif 155 #endif 152 156 153 157 m_pcEntropyDecoderIf->parsePartSize( pcCU, uiAbsPartIdx, uiDepth ); 154 158 159 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 155 160 #if RWTH_SDC_DLT_B0036 156 161 if( pcCU->getSlice()->isInterB() && pcCU->getSlice()->getSPS()->isDepth() && pcCU->isIntra(uiAbsPartIdx) ) … … 167 172 } 168 173 #endif 174 #endif 169 175 } 170 176 171 177 Void TDecEntropy::decodePredInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU ) 172 178 { 179 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 173 180 #if RWTH_SDC_DLT_B0036 174 181 if( pcCU->getSDCFlag(uiAbsPartIdx) ) … … 177 184 return; 178 185 } 186 #endif 179 187 #endif 180 188 … … 191 199 decodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset*2, uiDepth+1 ); 192 200 decodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset*3, uiDepth+1 ); 201 #if PKU_QC_DEPTH_INTRA_UNI_D0195 202 if(!pcCU->getSDCFlag(uiAbsPartIdx)) 203 #endif 193 204 decodeIntraDirModeChroma( pcCU, uiAbsPartIdx, uiDepth ); 194 205 } … … 196 207 { 197 208 decodeIntraDirModeLuma ( pcCU, uiAbsPartIdx, uiDepth ); 209 #if PKU_QC_DEPTH_INTRA_UNI_D0195 210 if(!pcCU->getSDCFlag(uiAbsPartIdx)) 211 #endif 198 212 decodeIntraDirModeChroma( pcCU, uiAbsPartIdx, uiDepth ); 199 213 } … … 852 866 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 853 867 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 854 855 868 decodeSDCResidualData(pcCU, uiAbsPartIdx, uiDepth); 869 #endif 856 870 return; 857 871 } … … 910 924 911 925 #if RWTH_SDC_DLT_B0036 926 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 912 927 Void TDecEntropy::decodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 913 928 { … … 924 939 m_pcEntropyDecoderIf->parseSDCFlag(pcCU, uiAbsPartIdx, uiDepth ); 925 940 } 926 927 941 Void TDecEntropy::decodeSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 928 942 { -
branches/HTM-6.2-dev0/source/Lib/TLibDecoder/TDecEntropy.h
r427 r433 140 140 141 141 #if RWTH_SDC_DLT_B0036 142 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 142 143 virtual Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 143 144 virtual Void parseSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 145 #endif 144 146 virtual Void parseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ) = 0; 145 147 #endif … … 240 242 241 243 #if RWTH_SDC_DLT_B0036 244 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 242 245 Void decodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 243 246 Void decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 247 #endif 244 248 Void decodeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 245 249 #endif -
branches/HTM-6.2-dev0/source/Lib/TLibDecoder/TDecSbac.cpp
r427 r433 37 37 38 38 #include "TDecSbac.h" 39 40 #if RWTH_SDC_DLT_B003641 #define GetNumDepthValues() (pcCU->getSlice()->getSPS()->getNumDepthValues())42 #define GetBitsPerDepthValue() (pcCU->getSlice()->getSPS()->getBitsPerDepthValue())43 #endif44 39 45 40 //! \ingroup TLibDecoder … … 103 98 #endif 104 99 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 100 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 105 101 , m_cDmmFlagSCModel ( 1, 1, NUM_DMM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 106 102 , m_cDmmModeSCModel ( 1, 1, NUM_DMM_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 103 #endif 107 104 , m_cDmmDataSCModel ( 1, 1, NUM_DMM_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 108 105 #endif … … 114 111 #endif 115 112 #if RWTH_SDC_DLT_B0036 113 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 116 114 , m_cSDCFlagSCModel ( 1, 1, SDC_NUM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 115 #else 116 , m_cDepthModeModel ( 1, 1, DEPTH_MODE_NUM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 117 , m_cDmmDeltaFlagModel ( 1, 1, DMM_DELTA_NUM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 118 #endif 119 #if RWTH_SDC_CTX_SIMPL_D0032 120 , m_cSDCResidualFlagSCModel ( 1, 1, SDC_NUM_RESIDUAL_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 121 , m_cSDCResidualSCModel ( 1, 1, SDC_NUM_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) 122 , m_cSDCPredModeSCModel ( 1, 3, SDC_NUM_PRED_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 123 #else 117 124 , m_cSDCResidualFlagSCModel ( 1, 2, SDC_NUM_RESIDUAL_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 118 125 , m_cSDCResidualSignFlagSCModel ( 1, 2, SDC_NUM_SIGN_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 119 126 , m_cSDCResidualSCModel ( 1, 2, SDC_NUM_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) 120 127 , m_cSDCPredModeSCModel ( 1, 3, SDC_NUM_PRED_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 128 #endif 121 129 #endif 122 130 { … … 216 224 m_uiLastDQpNonZero = 0; 217 225 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 226 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 218 227 m_cDmmFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DMM_FLAG ); 219 228 m_cDmmModeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DMM_MODE ); 229 #endif 220 230 m_cDmmDataSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DMM_DATA ); 221 231 #endif 222 232 #if RWTH_SDC_DLT_B0036 233 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 223 234 m_cSDCFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_FLAG ); 235 #else 236 m_cDepthModeModel.initBuffer ( sliceType, qp, (UChar*)INIT_DEPTHMODE_FLAG ); 237 m_cDmmDeltaFlagModel.initBuffer ( sliceType, qp, (UChar*)INIT_DMMDELTA_FLAG ); 238 #endif 224 239 m_cSDCResidualFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL_FLAG ); 225 240 m_cSDCResidualSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL ); 241 #if !RWTH_SDC_CTX_SIMPL_D0032 226 242 m_cSDCResidualSignFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_SIGN_FLAG ); 243 #endif 227 244 m_cSDCPredModeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_PRED_MODE ); 228 245 #endif … … 303 320 m_cCUTransSubdivFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_TRANS_SUBDIV_FLAG ); 304 321 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 322 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 305 323 m_cDmmFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM_FLAG ); 306 324 m_cDmmModeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM_MODE ); 325 #endif 307 326 m_cDmmDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM_DATA ); 308 327 #endif 309 328 #if RWTH_SDC_DLT_B0036 329 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 310 330 m_cSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG ); 331 #else 332 m_cDepthModeModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DEPTHMODE_FLAG ); 333 m_cDmmDeltaFlagModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMMDELTA_FLAG ); 334 #endif 311 335 m_cSDCResidualFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG ); 312 336 m_cSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL ); 337 #if !RWTH_SDC_CTX_SIMPL_D0032 313 338 m_cSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_SIGN_FLAG ); 339 #endif 314 340 m_cSDCPredModeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_PRED_MODE ); 315 341 #endif … … 894 920 } 895 921 922 UInt uiSymbol; 923 if (bDmmFlag) 924 { 925 if (bDmmFlag) 926 { 927 m_pcTDecBinIf->decodeBin( uiSymbol , m_cDmmDeltaFlagModel.get(0, 0, 0) ); 928 uiDir += uiSymbol; 929 } 930 if (uiSymbol) 931 { 932 UInt uiDC; 933 Int iDC = 0,iDC1 = 0,iDC2 = 0; 934 for ( Int i = 0; i <2; i++ ) 935 { 936 xReadExGolombLevel( uiDC, m_cDmmDataSCModel.get(0, 0, 1) ); 937 iDC = uiDC; 938 if ( uiDC ) 939 { 940 UInt uiSign; 941 m_pcTDecBinIf->decodeBinEP( uiSign ); 942 if ( uiSign ) 943 { 944 iDC = -iDC; 945 } 946 } 947 if ( i == 0 ) { iDC1 = iDC; } 948 else { iDC2 = iDC; } 949 } 950 951 if( uiDir == DMM_WEDGE_FULL_D_IDX ) 952 { 953 pcCU->setWedgeFullDeltaDC1SubParts( iDC1, uiAbsPartIdx, uiDepth ); 954 pcCU->setWedgeFullDeltaDC2SubParts( iDC2, uiAbsPartIdx, uiDepth ); 955 } 956 else if( uiDir == DMM_WEDGE_PREDDIR_D_IDX ) 957 { 958 pcCU->setWedgePredDirDeltaDC1SubParts( iDC1, uiAbsPartIdx, uiDepth ); 959 pcCU->setWedgePredDirDeltaDC2SubParts( iDC2, uiAbsPartIdx, uiDepth ); 960 } 961 else if( uiDir == DMM_WEDGE_PREDTEX_D_IDX) 962 { 963 pcCU->setWedgePredTexDeltaDC1SubParts( iDC1, uiAbsPartIdx, uiDepth ); 964 pcCU->setWedgePredTexDeltaDC2SubParts( iDC2, uiAbsPartIdx, uiDepth ); 965 } 966 else if (uiDir== DMM_CONTOUR_PREDTEX_D_IDX ) 967 { 968 pcCU->setContourPredTexDeltaDC1SubParts( iDC1, uiAbsPartIdx, uiDepth ); 969 pcCU->setContourPredTexDeltaDC2SubParts( iDC2, uiAbsPartIdx, uiDepth ); 970 } 971 } 972 } 973 else if (uiDir >= EDGE_INTRA_IDX) 974 { 975 m_pcTDecBinIf->decodeBin( uiSymbol, m_cEdgeIntraDeltaDCSCModel.get(0, 0, 0) ); 976 if( uiSymbol ) 977 { 978 uiDir = EDGE_INTRA_DELTA_IDX; 979 Int iDeltaDC = 0,iDeltaDC0 = 0,iDeltaDC1 = 0; 980 for (Int i = 0; i<2; i++) 981 { 982 xReadExGolombLevel( (UInt &) iDeltaDC, m_cEdgeIntraDeltaDCSCModel.get(0, 0, 1) ); 983 if( iDeltaDC != 0 ) 984 { 985 UInt uiSign; 986 m_pcTDecBinIf->decodeBinEP( uiSign ); 987 if ( uiSign ) 988 { 989 iDeltaDC = -iDeltaDC; 990 } 991 } 992 if ( i == 0 ) { iDeltaDC0 = iDeltaDC; } 993 else { iDeltaDC1 = iDeltaDC; } 994 } 995 996 pcCU->setEdgeDeltaDC0( uiAbsPartIdx, iDeltaDC0 ); 997 pcCU->setEdgeDeltaDC1( uiAbsPartIdx, iDeltaDC1 ); 998 } 999 } 1000 else if(bSdcFlag)//SDC mode 1001 { 1002 assert(pcCU->getPartitionSize(uiAbsPartIdx)!=SIZE_NxN); 1003 pcCU->setTrIdxSubParts(0, uiAbsPartIdx, uiDepth); 1004 pcCU->setCbfSubParts(1, 1, 1, uiAbsPartIdx, uiDepth); 1005 1006 UInt uiNumSegments = ( uiDir == DC_IDX || uiDir == PLANAR_IDX )? 1 : 2; 1007 for (int uiSeg=0; uiSeg<uiNumSegments; uiSeg++) 1008 { 1009 parseSDCResidualData(pcCU, uiAbsPartIdx, uiDepth, uiSeg); 1010 } 1011 } 1012 1013 pcCU->setLumaIntraDirSubParts( (UChar)uiDir, uiAbsPartIdx, uiDepth ); 1014 } 1015 #endif 896 1016 Void TDecSbac::parseIntraDirLumaAng ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 897 1017 { 898 1018 UInt uiSymbol; 899 1019 Int intraPredMode; 900 1020 #if PKU_QC_DEPTH_INTRA_UNI_D0195 1021 if (pcCU->getSlice()->getSPS()->isDepth()) 1022 { 1023 parseDepthModelingTable(pcCU, uiAbsPartIdx, uiDepth); 1024 } 1025 if (pcCU->getLumaIntraDir(uiAbsPartIdx)<NUM_INTRA_MODE && !pcCU->getSDCFlag(uiAbsPartIdx)) 1026 { 1027 #else 901 1028 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 902 1029 UInt uiFlag = 0; … … 952 1079 } 953 1080 #endif 954 955 1081 Int uiPreds[3] = {-1, -1, -1}; 956 1082 Int uiPredNum = pcCU->getIntraDirLumaPredictor(uiAbsPartIdx, uiPreds); 1083 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 957 1084 #if LGE_EDGE_INTRA_A0070 958 1085 UInt uiCheckBit = 0; 959 1086 #endif 1087 #endif 960 1088 961 1089 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUIntraPredSCModel.get( 0, 0, 0) ); … … 977 1105 978 1106 m_pcTDecBinIf->decodeBinsEP( uiSymbol, 5 ); 1107 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 979 1108 #if LGE_EDGE_INTRA_A0070 980 1109 if (bCodeEdgeIntra) … … 987 1116 } 988 1117 } 1118 #endif 989 1119 #endif 990 1120 intraPredMode = uiSymbol; … … 1003 1133 std::swap(uiPreds[1], uiPreds[2]); 1004 1134 } 1135 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 1005 1136 #if LGE_EDGE_INTRA_A0070 1006 1137 if ( intraPredMode != EDGE_INTRA_IDX) 1007 1138 { 1008 1139 #endif 1140 #endif 1009 1141 for ( Int i = 0; i < uiPredNum; i++ ) 1010 1142 { 1011 1143 intraPredMode += ( intraPredMode >= uiPreds[i] ); 1012 1144 } 1145 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 1013 1146 #if LGE_EDGE_INTRA_A0070 1014 1147 } 1015 1148 #endif 1016 } 1017 1149 #endif 1150 } 1151 1152 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 1018 1153 #if LGE_EDGE_INTRA_A0070 1019 1154 if( intraPredMode == EDGE_INTRA_IDX ) … … 1059 1194 } 1060 1195 #endif 1061 1062 1196 pcCU->setLumaIntraDirSubParts( (UChar)intraPredMode, uiAbsPartIdx, uiDepth ); 1197 #else 1198 pcCU->setLumaIntraDirSubParts( (UChar)intraPredMode, uiAbsPartIdx, uiDepth ); 1199 } 1200 #endif 1063 1201 } 1064 1202 … … 2629 2767 2630 2768 #if RWTH_SDC_DLT_B0036 2769 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 2631 2770 Void TDecSbac::parseSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2632 2771 { … … 2661 2800 { 2662 2801 UInt uiIsMostProb = 0; 2802 #if INTEL_SDC64_D0193 2803 if( !(pcCU->getWidth(uiAbsPartIdx) == 64 && i == 1)) 2804 #endif 2663 2805 m_pcTDecBinIf->decodeBin( uiIsMostProb, m_cSDCPredModeSCModel.get( 0, i, uiCtx ) ); 2664 2806 … … 2679 2821 pcCU->setLumaIntraDirSubParts((UChar)intraPredMode, uiAbsPartIdx, uiDepth); 2680 2822 } 2823 #endif 2681 2824 2682 2825 Void TDecSbac::parseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiSegment ) … … 2692 2835 Int iIdx = 0; 2693 2836 2694 UInt uiMaxResidualBits = GetBitsPerDepthValue();2837 UInt uiMaxResidualBits = pcCU->getSlice()->getSPS()->getBitsPerDepthValue(); 2695 2838 assert( uiMaxResidualBits <= g_uiBitDepth ); 2696 2839 2840 #if RWTH_SDC_CTX_SIMPL_D0032 2841 m_pcTDecBinIf->decodeBin(uiResidual, m_cSDCResidualFlagSCModel.get( 0, 0, 0 ) ); 2842 #else 2697 2843 m_pcTDecBinIf->decodeBin(uiResidual, m_cSDCResidualFlagSCModel.get( 0, uiSegment, 0 ) ); 2844 #endif 2698 2845 2699 2846 if (uiResidual) 2700 2847 { 2701 2848 // decode residual sign bit 2849 #if RWTH_SDC_CTX_SIMPL_D0032 2850 m_pcTDecBinIf->decodeBinEP(uiSign); 2851 #else 2702 2852 m_pcTDecBinIf->decodeBin(uiSign, m_cSDCResidualSignFlagSCModel.get( 0, uiSegment, 0 ) ); 2853 #endif 2703 2854 2704 2855 // decode residual magnitude 2856 #if LGE_CONCATENATE_D0141 2857 //prefix part 2858 UInt uiCount = 0; 2859 UInt uiNumDepthValues = pcCU->getSlice()->getSPS()->getNumDepthValues(); 2860 UInt uiPrefixThreshold = ((uiNumDepthValues * 3) >> 2); 2861 for ( UInt ui = 0; ui < uiPrefixThreshold; ui++) 2862 { 2863 m_pcTDecBinIf->decodeBin( uiBit, m_cSDCResidualSCModel.get(0, 0, 0) ); 2864 if ( uiBit == 0 ) 2865 break; 2866 else 2867 uiCount++; 2868 } 2869 //suffix part 2870 if ( uiCount == uiPrefixThreshold ) 2871 { 2872 for ( UInt ui = 0; ui < ( (UInt)ceil( Log2(uiNumDepthValues - uiPrefixThreshold) ) ); ui++ ) 2873 { 2874 m_pcTDecBinIf->decodeBinEP( uiBit ); 2875 uiAbsIdx |= uiBit << ui; 2876 } 2877 uiAbsIdx += uiCount; 2878 } 2879 else 2880 uiAbsIdx = uiCount; 2881 #else 2705 2882 for (Int i=0; i<uiMaxResidualBits; i++) 2706 2883 { 2884 #if RWTH_SDC_CTX_SIMPL_D0032 2885 m_pcTDecBinIf->decodeBin(uiBit, m_cSDCResidualSCModel.get( 0, 0, i ) ); 2886 #else 2707 2887 m_pcTDecBinIf->decodeBin(uiBit, m_cSDCResidualSCModel.get( 0, uiSegment, i ) ); 2888 #endif 2708 2889 uiAbsIdx |= uiBit << i; 2709 2890 } 2891 #endif 2710 2892 2711 2893 uiAbsIdx += 1; -
branches/HTM-6.2-dev0/source/Lib/TLibDecoder/TDecSbac.h
r427 r433 129 129 130 130 #if RWTH_SDC_DLT_B0036 131 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 131 132 Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 132 133 Void parseSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 134 #endif 133 135 Void parseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ); 134 136 #endif … … 190 192 Void parsePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 191 193 Void parsePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 192 193 194 Void parseIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 194 195 … … 273 274 274 275 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 276 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 275 277 ContextModel3DBuffer m_cDmmFlagSCModel; 276 278 ContextModel3DBuffer m_cDmmModeSCModel; 279 #endif 277 280 ContextModel3DBuffer m_cDmmDataSCModel; 278 281 #endif … … 285 288 286 289 #if RWTH_SDC_DLT_B0036 290 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 287 291 ContextModel3DBuffer m_cSDCFlagSCModel; 292 #else 293 ContextModel3DBuffer m_cDepthModeModel; 294 ContextModel3DBuffer m_cDmmDeltaFlagModel; 295 #endif 288 296 289 297 ContextModel3DBuffer m_cSDCResidualFlagSCModel; 298 #if !RWTH_SDC_CTX_SIMPL_D0032 290 299 ContextModel3DBuffer m_cSDCResidualSignFlagSCModel; 300 #endif 291 301 ContextModel3DBuffer m_cSDCResidualSCModel; 292 302 -
branches/HTM-6.2-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp
r427 r433 1436 1436 } 1437 1437 1438 Void TEncCavlc::codeIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx ) 1438 Void TEncCavlc::codeIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx 1439 #if PKU_QC_DEPTH_INTRA_UNI_D0195 1440 , Bool bSdcRD 1441 #endif 1442 ) 1439 1443 { 1440 1444 assert(0); … … 1915 1919 1916 1920 #if RWTH_SDC_DLT_B0036 1921 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 1917 1922 Void TEncCavlc::codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) 1918 1923 { 1919 1924 assert(0); 1920 1925 } 1921 1926 #endif 1922 1927 Void TEncCavlc::codeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) 1923 1928 { 1924 1929 assert(0); 1925 1930 } 1926 1931 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 1927 1932 Void TEncCavlc::codeSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx ) 1928 1933 { … … 1930 1935 } 1931 1936 #endif 1937 #endif 1932 1938 //! \} -
branches/HTM-6.2-dev0/source/Lib/TLibEncoder/TEncCavlc.h
r427 r433 194 194 Void codeQtRootCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 195 195 196 Void codeIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx ); 196 Void codeIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx 197 #if PKU_QC_DEPTH_INTRA_UNI_D0195 198 , Bool bSdcRD = false 199 #endif 200 ); 197 201 198 202 Void codeIntraDirChroma( TComDataCU* pcCU, UInt uiAbsPartIdx ); … … 220 224 221 225 #if RWTH_SDC_DLT_B0036 226 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 222 227 Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 228 #endif 223 229 Void codeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ); 230 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 224 231 Void codeSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 225 232 #endif 233 #endif 226 234 227 235 }; -
branches/HTM-6.2-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp
r427 r433 877 877 } 878 878 #endif 879 #endif 879 880 } 880 881 … … 917 918 } 918 919 } 920 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 919 921 #if RWTH_SDC_DLT_B0036 920 922 if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSDCFlag(uiAbsPartIdx) ) … … 924 926 } 925 927 #endif 928 #endif 926 929 927 930 m_pcEntropyCoderIf->codePartSize( pcCU, uiAbsPartIdx, uiDepth ); 928 931 932 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 929 933 #if RWTH_SDC_DLT_B0036 930 934 // code SDC flag now! … … 940 944 } 941 945 } 946 #endif 942 947 #endif 943 948 } … … 1220 1225 1221 1226 // Intra direction for Luma 1222 Void TEncEntropy::encodeIntraDirModeLuma ( TComDataCU* pcCU, UInt uiAbsPartIdx ) 1223 { 1224 m_pcEntropyCoderIf->codeIntraDirLumaAng( pcCU, uiAbsPartIdx ); 1227 Void TEncEntropy::encodeIntraDirModeLuma ( TComDataCU* pcCU, UInt uiAbsPartIdx 1228 #if PKU_QC_DEPTH_INTRA_UNI_D0195 1229 ,Bool bSdcRD 1230 #endif 1231 ) 1232 { 1233 m_pcEntropyCoderIf->codeIntraDirLumaAng( pcCU, uiAbsPartIdx 1234 #if PKU_QC_DEPTH_INTRA_UNI_D0195 1235 ,bSdcRD 1236 #endif 1237 ); 1225 1238 } 1226 1239 … … 1236 1249 } 1237 1250 1238 Void TEncEntropy::encodePredInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 1251 Void TEncEntropy::encodePredInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD 1252 #if PKU_QC_DEPTH_INTRA_UNI_D0195 1253 ,Bool bSdcRD 1254 #endif 1255 ) 1239 1256 { 1240 1257 if( bRD ) … … 1243 1260 } 1244 1261 1262 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 1245 1263 #if RWTH_SDC_DLT_B0036 1246 1264 if( pcCU->getSDCFlag(uiAbsPartIdx) ) … … 1249 1267 return; 1250 1268 } 1269 #endif 1251 1270 #endif 1252 1271 … … 1263 1282 encodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset*2 ); 1264 1283 encodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset*3 ); 1284 #if PKU_QC_DEPTH_INTRA_UNI_D0195 1285 if(!pcCU->getSDCFlag(uiAbsPartIdx)) 1286 #endif 1265 1287 encodeIntraDirModeChroma( pcCU, uiAbsPartIdx, bRD ); 1266 1288 } 1267 1289 else // if it is not NxN size, encode 1 intra directions 1268 1290 { 1269 encodeIntraDirModeLuma ( pcCU, uiAbsPartIdx );1291 encodeIntraDirModeLuma ( pcCU, uiAbsPartIdx 1270 1292 encodeIntraDirModeChroma( pcCU, uiAbsPartIdx, bRD ); 1271 1293 } … … 1465 1487 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 1466 1488 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 1467 1468 1489 encodeSDCResidualData(pcCU, uiAbsPartIdx); 1490 #endif 1469 1491 return; 1470 1492 } … … 1862 1884 1863 1885 #if RWTH_SDC_DLT_B0036 1886 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 1864 1887 Void TEncEntropy::encodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 1865 1888 { … … 1881 1904 m_pcEntropyCoderIf->codeSDCFlag(pcCU, uiAbsPartIdx); 1882 1905 } 1883 1884 1906 Void TEncEntropy::encodeSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 1885 1907 { -
branches/HTM-6.2-dev0/source/Lib/TLibEncoder/TEncEntropy.h
r427 r433 126 126 127 127 #if RWTH_SDC_DLT_B0036 128 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 128 129 virtual Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 130 #endif 129 131 virtual Void codeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) = 0; 132 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 130 133 virtual Void codeSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 134 #endif 131 135 #endif 132 136 … … 136 140 virtual Void codeQtCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth ) = 0; 137 141 virtual Void codeQtRootCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 138 virtual Void codeIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 142 virtual Void codeIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx 143 #if PKU_QC_DEPTH_INTRA_UNI_D0195 144 , Bool bSdcRD = false 145 #endif 146 ) = 0; 139 147 140 148 virtual Void codeIntraDirChroma( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; … … 279 287 Void encodePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false ); 280 288 Void encodeIPCMInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 281 Void encodePredInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 282 Void encodeIntraDirModeLuma ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 289 Void encodePredInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false 290 #if PKU_QC_DEPTH_INTRA_UNI_D0195 291 ,Bool bSdcRD = false 292 #endif 293 ); 294 Void encodeIntraDirModeLuma ( TComDataCU* pcCU, UInt uiAbsPartIdx 295 #if PKU_QC_DEPTH_INTRA_UNI_D0195 296 ,Bool bSdcRD = false 297 #endif 298 ); 283 299 284 300 Void encodeIntraDirModeChroma( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); … … 298 314 299 315 #if RWTH_SDC_DLT_B0036 316 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 300 317 Void encodeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 318 #endif 301 319 Void encodeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 320 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 302 321 Void encodeSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 322 #endif 303 323 #endif 304 324 -
branches/HTM-6.2-dev0/source/Lib/TLibEncoder/TEncSbac.cpp
r427 r433 41 41 #include <map> 42 42 #include <algorithm> 43 44 #if RWTH_SDC_DLT_B003645 #define GetNumDepthValues() (pcCU->getSlice()->getSPS()->getNumDepthValues())46 #define GetBitsPerDepthValue() (pcCU->getSlice()->getSPS()->getBitsPerDepthValue())47 #endif48 43 49 44 //! \ingroup TLibEncoder … … 111 106 #endif 112 107 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 108 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 113 109 , m_cDmmFlagSCModel ( 1, 1, NUM_DMM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 114 110 , m_cDmmModeSCModel ( 1, 1, NUM_DMM_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 111 #endif 115 112 , m_cDmmDataSCModel ( 1, 1, NUM_DMM_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 116 113 #endif … … 122 119 #endif 123 120 #if RWTH_SDC_DLT_B0036 121 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 124 122 , m_cSDCFlagSCModel ( 1, 1, SDC_NUM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 123 #else 124 , m_cDepthModeModel ( 1, 1, DEPTH_MODE_NUM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 125 , m_cDmmDeltaFlagModel ( 1, 1, DMM_DELTA_NUM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 126 #endif 127 #if RWTH_SDC_CTX_SIMPL_D0032 128 , m_cSDCResidualFlagSCModel ( 1, 1, SDC_NUM_RESIDUAL_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 129 , m_cSDCResidualSCModel ( 1, 1, SDC_NUM_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) 130 , m_cSDCPredModeSCModel ( 1, 3, SDC_NUM_PRED_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 131 #else 125 132 , m_cSDCResidualFlagSCModel ( 1, 2, SDC_NUM_RESIDUAL_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 126 133 , m_cSDCResidualSignFlagSCModel ( 1, 2, SDC_NUM_SIGN_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 127 134 , m_cSDCResidualSCModel ( 1, 2, SDC_NUM_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) 128 135 , m_cSDCPredModeSCModel ( 1, 3, SDC_NUM_PRED_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 136 #endif 129 137 #endif 130 138 { … … 203 211 #endif 204 212 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 213 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 205 214 m_cDmmFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM_FLAG ); 206 215 m_cDmmModeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM_MODE ); 216 #endif 207 217 m_cDmmDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM_DATA ); 208 218 #endif … … 214 224 #endif 215 225 #if RWTH_SDC_DLT_B0036 226 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 216 227 m_cSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG ); 228 #else 229 m_cDepthModeModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DEPTHMODE_FLAG ); 230 m_cDmmDeltaFlagModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMMDELTA_FLAG ); 231 #endif 217 232 m_cSDCResidualFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG ); 218 233 m_cSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL ); 234 #if !RWTH_SDC_CTX_SIMPL_D0032 219 235 m_cSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_SIGN_FLAG ); 236 #endif 220 237 m_cSDCPredModeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_PRED_MODE ); 221 238 #endif … … 369 386 #endif 370 387 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 388 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 371 389 m_cDmmFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM_FLAG ); 372 390 m_cDmmModeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM_MODE ); 391 #endif 373 392 m_cDmmDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM_DATA ); 374 393 #endif 375 394 #if RWTH_SDC_DLT_B0036 395 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 376 396 m_cSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG ); 397 #else 398 m_cDepthModeModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DEPTHMODE_FLAG ); 399 m_cDmmDeltaFlagModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMMDELTA_FLAG ); 400 #endif 377 401 m_cSDCResidualFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG ); 378 402 m_cSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL ); 403 #if !RWTH_SDC_CTX_SIMPL_D0032 379 404 m_cSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_SIGN_FLAG ); 405 #endif 380 406 m_cSDCPredModeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_PRED_MODE ); 381 407 #endif … … 571 597 } 572 598 573 599 #if PKU_QC_DEPTH_INTRA_UNI_D0195 600 Void TEncSbac::loadDepthMode( TEncSbac* pSrc) 601 { 602 m_pcBinIf->copyState( pSrc->m_pcBinIf ); 603 604 this->m_cDepthModeModel .copyFrom( &pSrc->m_cDepthModeModel ); 605 this->m_cDmmDeltaFlagModel .copyFrom( &pSrc->m_cDmmDeltaFlagModel ); 606 } 607 #endif 574 608 Void TEncSbac::store( TEncSbac* pDest) 575 609 { … … 1012 1046 } 1013 1047 #endif 1014 1015 Void TEncSbac::codeIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx ) 1048 #if PKU_QC_DEPTH_INTRA_UNI_D0195 1049 Void TEncSbac::codeDepthIntraMode( TComDataCU* pcCU, UInt uiAbsPartIdx ) 1050 { 1051 UInt uiCodeWordTable[3][9] = {{0, 0, 0, 2, 0,6, 0, 0, 7},{0, 2, 3, 4, 5, 6, 14, 31, 30},{0, 2, 0, 0, 0, 0, 3, 0, 0}}; 1052 UInt uiCodeWordLenTable[3][9] = {{0, 1, 0, 2, 0,3, 0, 0, 3},{2, 3, 3, 3, 3, 3, 4, 5, 5},{1, 2, 0, 0, 0, 0, 2, 0, 0}}; 1053 UInt uiDir = pcCU->getLumaIntraDir(uiAbsPartIdx); 1054 Bool bSdcFlag = pcCU->getSDCFlag(uiAbsPartIdx); 1055 UInt uiPuIdx = ( pcCU->getWidth(uiAbsPartIdx) == 64 )? 2 : ( ( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_NxN && pcCU->getWidth(uiAbsPartIdx) == 8 ) ? 0 : 1 ); 1056 UInt uiCodeIdx = 0; 1057 if ( bSdcFlag ) 1058 { 1059 switch(uiDir) 1060 { 1061 case PLANAR_IDX: uiCodeIdx = 0; break; 1062 case DC_IDX: uiCodeIdx = 6; break; 1063 default: uiCodeIdx = 2; 1064 } 1065 } 1066 else if ( uiDir>=EDGE_INTRA_IDX ) 1067 { 1068 uiCodeIdx = 8; 1069 } 1070 else if ( uiDir<NUM_INTRA_MODE ) 1071 { 1072 uiCodeIdx = 1; 1073 } 1074 else 1075 { 1076 if (uiDir== DMM_WEDGE_FULL_IDX || uiDir==DMM_WEDGE_FULL_D_IDX ) {uiCodeIdx = 3;} 1077 if (uiDir== DMM_CONTOUR_PREDTEX_IDX|| uiDir==DMM_CONTOUR_PREDTEX_D_IDX) {uiCodeIdx = 4;} 1078 if (uiDir== DMM_WEDGE_PREDTEX_IDX || uiDir==DMM_WEDGE_PREDTEX_D_IDX ) {uiCodeIdx = 5;} 1079 if (uiDir== DMM_WEDGE_PREDDIR_IDX || uiDir==DMM_WEDGE_PREDDIR_D_IDX ) {uiCodeIdx = 7;} 1080 } 1081 //mode coding 1082 for (UInt i=0; i<uiCodeWordLenTable[uiPuIdx][uiCodeIdx]; i++) 1083 { 1084 UInt uiBit = uiCodeWordTable[uiPuIdx][uiCodeIdx] & ( 1<<(uiCodeWordLenTable[uiPuIdx][uiCodeIdx]-i-1) ); 1085 UInt uiCtxDepthMode = uiPuIdx*3 + ( i >= 2? 2 : i ); 1086 m_pcBinIf->encodeBin( uiBit!=0 , m_cDepthModeModel.get(0, 0, uiCtxDepthMode) ); 1087 } 1088 } 1089 Void TEncSbac::codeDepthModelingTable( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bSdcRD) 1090 { 1091 UInt uiDir = pcCU->getLumaIntraDir( uiAbsPartIdx ); 1092 Bool bSdcFlag = pcCU->getSDCFlag(uiAbsPartIdx); 1093 Bool bDmmFlag = (uiDir >= NUM_INTRA_MODE && uiDir < EDGE_INTRA_IDX &&(!bSdcFlag))? 1:0; 1094 1095 codeDepthIntraMode(pcCU,uiAbsPartIdx); 1096 1097 if (uiDir >= NUM_INTRA_MODE && uiDir < EDGE_INTRA_IDX )//DMM modes or SDC DMM1 1098 { 1099 assert(pcCU->getWidth(uiAbsPartIdx)<64); 1100 assert(pcCU->getWidth(uiAbsPartIdx)<64); 1101 if( uiDir == DMM_WEDGE_FULL_IDX || uiDir == DMM_WEDGE_FULL_D_IDX) { xCodeWedgeFullInfo ( pcCU, uiAbsPartIdx ); } 1102 else if( uiDir == DMM_WEDGE_PREDTEX_IDX || uiDir == DMM_WEDGE_PREDTEX_D_IDX ) { xCodeWedgePredTexInfo ( pcCU, uiAbsPartIdx ); } 1103 else if( uiDir == DMM_WEDGE_PREDDIR_IDX || uiDir == DMM_WEDGE_PREDDIR_D_IDX) { xCodeWedgePredDirInfo ( pcCU, uiAbsPartIdx ); } 1104 } 1105 else if(uiDir >= EDGE_INTRA_IDX)//CCM mode 1106 { 1107 assert(pcCU->getWidth(uiAbsPartIdx)<64); 1108 xCodeEdgeIntraInfo( pcCU, uiAbsPartIdx ); 1109 } 1110 1111 if (bDmmFlag) 1112 { 1113 m_pcBinIf->encodeBin( (uiDir&1) , m_cDmmDeltaFlagModel.get(0, 0, 0) ); 1114 if (uiDir&1) 1115 { 1116 Int iDeltaDC1 = 0,iDeltaDC2 = 0; 1117 if ( uiDir == DMM_WEDGE_FULL_D_IDX ) 1118 { 1119 iDeltaDC1 = pcCU->getWedgeFullDeltaDC1( uiAbsPartIdx ); 1120 iDeltaDC2 = pcCU->getWedgeFullDeltaDC2( uiAbsPartIdx ); 1121 } 1122 else if ( uiDir == DMM_WEDGE_PREDTEX_D_IDX ) 1123 { 1124 iDeltaDC1 = pcCU->getWedgePredTexDeltaDC1( uiAbsPartIdx ); 1125 iDeltaDC2 = pcCU->getWedgePredTexDeltaDC2( uiAbsPartIdx ); 1126 } 1127 else if ( uiDir == DMM_WEDGE_PREDDIR_D_IDX ) 1128 { 1129 iDeltaDC1 = pcCU->getWedgePredDirDeltaDC1( uiAbsPartIdx ); 1130 iDeltaDC2 = pcCU->getWedgePredDirDeltaDC2( uiAbsPartIdx ); 1131 } 1132 else if ( uiDir == DMM_CONTOUR_PREDTEX_D_IDX ) 1133 { 1134 iDeltaDC1 = pcCU->getContourPredTexDeltaDC1( uiAbsPartIdx ); 1135 iDeltaDC2 = pcCU->getContourPredTexDeltaDC2( uiAbsPartIdx ); 1136 1137 } 1138 1139 for ( Int i = 0; i < 2; i++ ) 1140 { 1141 Int iDeltaDC = (i==0)? iDeltaDC1 : iDeltaDC2; 1142 xWriteExGolombLevel( UInt( abs( iDeltaDC ) ), m_cDmmDataSCModel.get(0, 0, 1) ); 1143 if ( iDeltaDC != 0 ) 1144 { 1145 UInt uiSign = iDeltaDC > 0 ? 0 : 1; 1146 m_pcBinIf->encodeBinEP( uiSign ); 1147 } 1148 } 1149 } 1150 } 1151 else if (uiDir>=EDGE_INTRA_IDX) 1152 { 1153 m_pcBinIf->encodeBin( (uiDir == EDGE_INTRA_DELTA_IDX), m_cEdgeIntraDeltaDCSCModel.get(0, 0, 0) ); 1154 if( uiDir == EDGE_INTRA_DELTA_IDX ) 1155 { 1156 Int iDeltaDC0 = pcCU->getEdgeDeltaDC0( uiAbsPartIdx ); 1157 Int iDeltaDC1 = pcCU->getEdgeDeltaDC1( uiAbsPartIdx ); 1158 1159 for ( Int i = 0; i < 2; i++ ) 1160 { 1161 Int iDeltaDC = (i==0)? iDeltaDC0 : iDeltaDC1; 1162 xWriteExGolombLevel( UInt( abs( iDeltaDC ) ), m_cEdgeIntraDeltaDCSCModel.get(0, 0, 1) ); 1163 if ( iDeltaDC != 0 ) 1164 { 1165 UInt uiSign = iDeltaDC > 0 ? 0 : 1; 1166 m_pcBinIf->encodeBinEP( uiSign ); 1167 } 1168 } 1169 } 1170 } 1171 if (pcCU->getSDCFlag(uiAbsPartIdx))//SDC mode 1172 { 1173 assert(pcCU->getPartitionSize(uiAbsPartIdx)==SIZE_2Nx2N); 1174 UInt uiNumSegments = ( uiDir == DC_IDX || uiDir == PLANAR_IDX )? 1 : 2; 1175 if(!bSdcRD) 1176 { 1177 for (int uiSeg=0; uiSeg<uiNumSegments; uiSeg++) 1178 { 1179 codeSDCResidualData(pcCU, uiAbsPartIdx, uiSeg); 1180 } 1181 } 1182 } 1183 } 1184 #endif 1185 Void TEncSbac::codeIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx 1186 #if PKU_QC_DEPTH_INTRA_UNI_D0195 1187 , Bool bSdcRD 1188 #endif 1189 ) 1016 1190 { 1017 1191 UInt uiDir = pcCU->getLumaIntraDir( uiAbsPartIdx ); 1018 1192 1193 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 1019 1194 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 1020 1195 if( pcCU->getSlice()->getSPS()->getUseDMM() && pcCU->getWidth( uiAbsPartIdx ) <= DMM_WEDGEMODEL_MAX_SIZE ) … … 1116 1291 } 1117 1292 #endif 1118 1293 #else 1294 if (pcCU->getSlice()->getSPS()->isDepth()) 1295 { 1296 codeDepthModelingTable(pcCU, uiAbsPartIdx, bSdcRD); 1297 } 1298 if (pcCU->getLumaIntraDir(uiAbsPartIdx)<NUM_INTRA_MODE && !pcCU->getSDCFlag(uiAbsPartIdx)) 1299 { 1300 #endif 1119 1301 Int uiPreds[3] = {-1, -1, -1}; 1120 1302 Int uiPredNum = pcCU->getIntraDirLumaPredictor(uiAbsPartIdx, uiPreds); … … 1162 1344 1163 1345 m_pcBinIf->encodeBinsEP( uiDir, 5 ); 1346 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 1164 1347 #if LGE_EDGE_INTRA_A0070 1165 1348 if (bCodeEdgeIntra) 1166 1349 if (uiDir == 31) m_pcBinIf->encodeBinsEP(0,1); 1167 1350 #endif 1351 #endif 1168 1352 } 1353 #if PKU_QC_DEPTH_INTRA_UNI_D0195 1354 } 1355 #else 1169 1356 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 1170 1357 } 1171 1358 #endif 1359 #endif 1360 1172 1361 return; 1173 1362 } … … 2516 2705 2517 2706 #if RWTH_SDC_DLT_B0036 2707 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 2518 2708 Void TEncSbac::codeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2519 2709 { … … 2530 2720 { 2531 2721 UInt uiBit = (uiPredMode == g_auiSDCPredModes[uiMPModeIdx]) ? 1 : 0; 2722 #if INTEL_SDC64_D0193 2723 if( !(pcCU->getWidth(uiAbsPartIdx) == 64 && i == 1)) 2724 #endif 2532 2725 m_pcBinIf->encodeBin( uiBit, m_cSDCPredModeSCModel.get( 0, i, uiCtx ) ); 2533 2726 … … 2556 2749 2557 2750 } 2751 #endif 2558 2752 2559 2753 Void TEncSbac::codeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) … … 2569 2763 UInt uiSign = segmentDCOffset < 0 ? 1 : 0; 2570 2764 UInt uiAbsIdx = abs(segmentDCOffset); 2765 #if !LGE_CONCATENATE_D0141 2571 2766 UInt uiBit = 0; 2572 2573 UInt uiMaxResidualBits = GetBitsPerDepthValue(); 2767 #endif 2768 2769 UInt uiMaxResidualBits = pcCU->getSlice()->getSPS()->getBitsPerDepthValue(); 2574 2770 assert( uiMaxResidualBits <= g_uiBitDepth ); 2575 2771 2576 2772 // residual flag 2773 #if RWTH_SDC_CTX_SIMPL_D0032 2774 m_pcBinIf->encodeBin( uiResidual, m_cSDCResidualFlagSCModel.get( 0, 0, 0 ) ); 2775 #else 2577 2776 m_pcBinIf->encodeBin( uiResidual, m_cSDCResidualFlagSCModel.get( 0, uiSegment, 0 ) ); //TODO depthmap: more sophisticated context selection 2777 #endif 2578 2778 2579 2779 if (uiResidual) 2580 2780 { 2581 2781 // encode sign bit of residual 2782 #if RWTH_SDC_CTX_SIMPL_D0032 2783 m_pcBinIf->encodeBinEP( uiSign ); 2784 #else 2582 2785 m_pcBinIf->encodeBin( uiSign, m_cSDCResidualSignFlagSCModel.get( 0, uiSegment, 0 ) ); //TODO depthmap: more sophisticated context selection 2786 #endif 2583 2787 2584 assert(uiAbsIdx < GetNumDepthValues()); 2788 UInt uiNumDepthValues = pcCU->getSlice()->getSPS()->getNumDepthValues(); 2789 assert(uiAbsIdx < uiNumDepthValues); 2585 2790 2586 2791 // encode residual magnitude 2587 2792 uiAbsIdx -= 1; 2793 #if LGE_CONCATENATE_D0141 2794 //prefix part 2795 if ( uiAbsIdx == 0 ) 2796 m_pcBinIf->encodeBin( 0, m_cSDCResidualSCModel.get(0, 0, 0) ); 2797 else 2798 { 2799 UInt l = uiAbsIdx; 2800 UInt k = 0; 2801 UInt uiPrefixThreshold = ((uiNumDepthValues * 3) >> 2); 2802 while ( l > 0 && k < uiPrefixThreshold ) 2803 { 2804 m_pcBinIf->encodeBin( 1, m_cSDCResidualSCModel.get(0, 0, 0) ); 2805 l--; 2806 k++; 2807 } 2808 if ( uiAbsIdx < uiPrefixThreshold ) 2809 m_pcBinIf->encodeBin( 0, m_cSDCResidualSCModel.get(0, 0, 0) ); 2810 //suffix part 2811 else 2812 { 2813 uiAbsIdx -= uiPrefixThreshold; 2814 UInt uiSuffixLength = ( (UInt)ceil( Log2(uiNumDepthValues - uiPrefixThreshold) ) ); 2815 UInt uiBitInfo = 0; 2816 for ( Int i = 0; i < uiSuffixLength; i++) 2817 { 2818 uiBitInfo = ( uiAbsIdx & ( 1 << i ) ) >> i; 2819 m_pcBinIf->encodeBinEP( uiBitInfo); 2820 } 2821 } 2822 } 2823 #else 2588 2824 for (Int i=0; i<uiMaxResidualBits; i++) 2589 2825 { 2590 2826 uiBit = (uiAbsIdx & (1<<i))>>i; 2591 2827 2828 #if RWTH_SDC_CTX_SIMPL_D0032 2829 m_pcBinIf->encodeBin( uiBit, m_cSDCResidualSCModel.get( 0, 0, i ) ); 2830 #else 2592 2831 m_pcBinIf->encodeBin( uiBit, m_cSDCResidualSCModel.get( 0, uiSegment, i ) ); //TODO depthmap: more sophisticated context selection 2593 } 2832 #endif 2833 } 2834 #endif 2594 2835 2595 2836 } -
branches/HTM-6.2-dev0/source/Lib/TLibEncoder/TEncSbac.h
r427 r433 92 92 Void load ( TEncSbac* pScr ); 93 93 Void loadIntraDirModeLuma ( TEncSbac* pScr ); 94 #if PKU_QC_DEPTH_INTRA_UNI_D0195 95 Void loadDepthMode ( TEncSbac* pSrc ); 96 #endif 94 97 Void store ( TEncSbac* pDest ); 95 98 Void loadContexts ( TEncSbac* pScr ); … … 145 148 146 149 #if RWTH_SDC_DLT_B0036 150 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 147 151 Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 152 #endif 148 153 Void codeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ); 154 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 149 155 Void codeSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 156 #endif 150 157 #endif 151 158 … … 233 240 Void codeQtCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth ); 234 241 Void codeQtRootCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 235 236 Void codeIntraDirLumaAng ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 242 #if PKU_QC_DEPTH_INTRA_UNI_D0195 243 Void codeDepthIntraMode ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 244 Void codeDepthModelingTable ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bSdcRD = false ); 245 #endif 246 Void codeIntraDirLumaAng ( TComDataCU* pcCU, UInt uiAbsPartIdx 247 #if PKU_QC_DEPTH_INTRA_UNI_D0195 248 , Bool bSdcRD = false 249 #endif 250 ); 237 251 238 252 Void codeIntraDirChroma ( TComDataCU* pcCU, UInt uiAbsPartIdx ); … … 319 333 320 334 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 335 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 321 336 ContextModel3DBuffer m_cDmmFlagSCModel; 322 337 ContextModel3DBuffer m_cDmmModeSCModel; 338 #endif 323 339 ContextModel3DBuffer m_cDmmDataSCModel; 324 340 #endif … … 331 347 332 348 #if RWTH_SDC_DLT_B0036 349 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 333 350 ContextModel3DBuffer m_cSDCFlagSCModel; 351 #else 352 ContextModel3DBuffer m_cDepthModeModel; 353 ContextModel3DBuffer m_cDmmDeltaFlagModel; 354 #endif 334 355 335 356 ContextModel3DBuffer m_cSDCResidualFlagSCModel; 357 #if !RWTH_SDC_CTX_SIMPL_D0032 336 358 ContextModel3DBuffer m_cSDCResidualSignFlagSCModel; 359 #endif 337 360 ContextModel3DBuffer m_cSDCResidualSCModel; 338 361 -
branches/HTM-6.2-dev0/source/Lib/TLibEncoder/TEncSearch.cpp
r427 r433 912 912 if( uiAbsPartIdx == 0 ) 913 913 { 914 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, 0 ); 914 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, 0 915 #if PKU_QC_DEPTH_INTRA_UNI_D0195 916 ,true 917 #endif 918 ); 915 919 } 916 920 } … … 1705 1709 UChar ucSegment = pMask?(UChar)pMask[uiX]:0; 1706 1710 assert( ucSegment < uiNumSegments ); 1711 #if MTK_SAMPLE_BASED_SDC_D0110 1712 Pel pResiDC = apDCResiValues[ucSegment]; 1707 1713 1714 pReco [ uiX ] = Clip( pPred[ uiX ] + pResiDC ); 1715 #else 1708 1716 Pel pPredVal= apDCPredValues[ucSegment]; 1709 1717 Pel pResiDC = apDCResiValues[ucSegment]; 1710 1718 1711 1719 pReco [ uiX ] = Clip( pPredVal + pResiDC ); 1720 #endif 1712 1721 pRecIPred[ uiX ] = pReco[ uiX ]; 1713 1722 } … … 1739 1748 if ( m_pcRdCost->getUseVSO() ) 1740 1749 { 1750 #if FIX_SDC_ENC_RD_WVSO_D0163 && LGE_WVSO_A0119 1751 if ( m_pcRdCost->getUseWVSO() ) 1752 { 1753 Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight(); 1754 Int iVSOWeight = m_pcRdCost->getVSOWeight() * m_pcRdCost->getVSOWeight(); 1755 Dist iD = (Dist) m_pcRdCost->getDistPart( piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight ); 1756 Dist iVSO = m_pcRdCost->getDistVS ( pcCU, uiAbsPartIdx, piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight, false, 0 ); 1757 ruiDist += (iDWeight * iD + iVSOWeight * iVSO) / ( iDWeight + iVSOWeight); 1758 } 1759 else 1760 #endif 1741 1761 ruiDist = m_pcRdCost->getDistVS ( pcCU, uiAbsPartIdx, piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight, false, 0 ); 1742 1762 } … … 1755 1775 1756 1776 // encode pred direction + residual data 1757 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true ); 1758 1777 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true 1778 #if PKU_QC_DEPTH_INTRA_UNI_D0195 1779 ,true 1780 #endif 1781 ); 1759 1782 UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits(); 1760 1783 … … 5997 6020 // Reload only contexts required for coding intra mode information 5998 6021 m_pcRDGoOnSbacCoder->loadIntraDirModeLuma( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] ); 6022 #if PKU_QC_DEPTH_INTRA_UNI_D0195 6023 m_pcRDGoOnSbacCoder->loadDepthMode( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] ); 6024 #endif 5999 6025 } 6000 6026 … … 6002 6028 6003 6029 m_pcEntropyCoder->resetBits(); 6004 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiPartOffset); 6030 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiPartOffset 6031 #if PKU_QC_DEPTH_INTRA_UNI_D0195 6032 ,true 6033 #endif 6034 ); 6005 6035 6006 6036 return m_pcEntropyCoder->getNumberOfWrittenBits(); … … 6412 6442 Int iMaskStride = ( uiWidth<<1 ) + 1; 6413 6443 piMask += iMaskStride+1; 6444 #if QC_DC_PREDICTOR_D0183 6445 getPredDCs( pcWedgelet->getPattern(), pcWedgelet->getStride(), piMask, iMaskStride, iPredDC1, iPredDC2 ); 6446 #else 6414 6447 getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAboveAvail, bLeftAvail ); 6448 #endif 6415 6449 6416 6450 riDeltaDC1 = iDC1 - iPredDC1; … … 6589 6623 #endif 6590 6624 6625 #if HHI_DELTADC_DLT_D0035 6626 riDeltaDC1 = (Int)GetDepthValue2Idx( Clip(iPredDC1 + riDeltaDC1) ) - (Int)GetDepthValue2Idx( iPredDC1 ); 6627 riDeltaDC2 = (Int)GetDepthValue2Idx( Clip(iPredDC2 + riDeltaDC2) ) - (Int)GetDepthValue2Idx( iPredDC2 ); 6628 #endif 6591 6629 } 6592 6630 #endif … … 7973 8011 7974 8012 // PredDC Calculation 8013 #if QC_DC_PREDICTOR_D0183 8014 getPredDCs( pbRegion, uiWidth, piMask+iMaskStride+1, iMaskStride, iPredDC0, iPredDC1 ); 8015 #else 7975 8016 { 7976 8017 UInt uiSum0 = 0; … … 8012 8053 iPredDC1 = uiSum1 / uiCount1; 8013 8054 } 8055 #endif 8014 8056 8015 8057 iDeltaDC0 = iDC0 - iPredDC0;
Note: See TracChangeset for help on using the changeset viewer.