Changeset 294 in 3DVCSoftware for branches/HTM-5.1-dev0/source/Lib/TLibDecoder
- Timestamp:
- 19 Feb 2013, 20:33:52 (12 years ago)
- Location:
- branches/HTM-5.1-dev0/source/Lib/TLibDecoder
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-5.1-dev0/source/Lib/TLibDecoder/NALread.cpp
r210 r294 124 124 assert(forbidden_zero_bit == 0); 125 125 126 #if NAL_REF_FLAG127 126 nalu.m_nalRefFlag = (bs.read(1) != 0 ); 128 127 nalu.m_nalUnitType = (NalUnitType) bs.read(6); 129 #else130 nalu.m_nalRefIDC = (NalRefIdc) bs.read(2);131 nalu.m_nalUnitType = (NalUnitType) bs.read(5);132 #endif133 128 134 129 #if QC_MVHEVC_B0046 … … 137 132 nalu.m_temporalId = bs.read(3) - 1; 138 133 #else 139 #if H0388140 134 nalu.m_temporalId = bs.read(3); 141 135 // unsigned reserved_one_5bits = bs.read(5); … … 147 141 nalu.m_isDepth = bs.read(1); 148 142 #endif 149 #if H0566_TLA150 143 if ( nalu.m_temporalId ) 151 144 { … … 157 150 } 158 151 #endif 159 #else160 switch (nalu.m_nalUnitType)161 {162 case NAL_UNIT_CODED_SLICE:163 case NAL_UNIT_CODED_SLICE_IDR:164 #if H0566_TLA165 #if !QC_REM_IDV_B0046166 case NAL_UNIT_CODED_SLICE_IDV:167 #endif168 case NAL_UNIT_CODED_SLICE_CRA:169 case NAL_UNIT_CODED_SLICE_TLA:170 #else171 case NAL_UNIT_CODED_SLICE_CDR:172 #endif173 {174 nalu.m_temporalId = bs.read(3);175 #if VIDYO_VPS_INTEGRATION176 nalu.m_layerId = bs.read(5) - 1;177 #else178 nalu.m_OutputFlag = bs.read(1);179 // unsigned reserved_one_4bits = bs.read(4);180 // assert(reserved_one_4bits == 1);181 nalu.m_viewId = bs.read(3)-1;182 nalu.m_isDepth = bs.read(1);183 #endif184 185 #if H0566_TLA186 if (nalu.m_temporalId == 0)187 {188 #if QC_REM_IDV_B0046189 assert(nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR);190 #else191 assert(nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDV );192 #endif193 }194 else195 {196 assert(nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TLA);197 }198 #endif199 }200 break;201 default:202 nalu.m_temporalId = 0;203 nalu.m_OutputFlag = true;204 break;205 }206 #endif207 #endif208 152 } 209 153 //! \} -
branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecBinCoder.h
r56 r294 54 54 virtual Void start () = 0; 55 55 virtual Void finish () = 0; 56 #if OL_FLUSH57 56 virtual Void flush () = 0; 58 #endif59 57 60 58 virtual Void decodeBin ( UInt& ruiBin, ContextModel& rcCtxModel ) = 0; … … 64 62 65 63 virtual Void resetBac () = 0; 66 #if BURST_IPCM67 64 virtual Void decodeNumSubseqIPCM( Int& numSubseqIPCM ) = 0; 68 #endif69 65 virtual Void decodePCMAlignBits() = 0; 70 66 virtual Void xReadPCMCode ( UInt uiLength, UInt& ruiCode) = 0; -
branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecBinCoderCABAC.cpp
r56 r294 65 65 TDecBinCABAC::start() 66 66 { 67 #if !OL_FLUSH ||OL_FLUSH_ALIGN67 #if OL_FLUSH_ALIGN 68 68 assert( m_pcTComBitstream->getNumBitsUntilByteAligned() == 0 ); 69 69 #endif … … 72 72 m_bitsNeeded = -8; 73 73 m_uiValue = m_pcTComBitstream->readByte() << 8; 74 #if OL_FLUSH &&!OL_FLUSH_ALIGN74 #if !OL_FLUSH_ALIGN 75 75 m_uiLastByte = m_pcTComBitstream->readByte(); 76 76 m_uiValue |= m_uiLastByte; … … 85 85 } 86 86 87 #if OL_FLUSH88 87 Void 89 88 TDecBinCABAC::flush() … … 108 107 #endif // OL_FLUSH_ALIGN 109 108 } 110 #endif // OL_FLUSH111 109 112 110 /** … … 122 120 m_uiValue = pcTDecBinCABAC->m_uiValue; 123 121 m_bitsNeeded= pcTDecBinCABAC->m_bitsNeeded; 124 #if OL_FLUSH &&!OL_FLUSH_ALIGN122 #if !OL_FLUSH_ALIGN 125 123 m_uiLastByte= pcTDecBinCABAC->m_uiLastByte; 126 124 #endif … … 152 150 { 153 151 m_bitsNeeded = -8; 154 #if OL_FLUSH &&!OL_FLUSH_ALIGN152 #if !OL_FLUSH_ALIGN 155 153 m_uiLastByte = m_pcTComBitstream->readByte(); 156 154 m_uiValue += m_uiLastByte; … … 173 171 if ( m_bitsNeeded >= 0 ) 174 172 { 175 #if OL_FLUSH &&!OL_FLUSH_ALIGN173 #if !OL_FLUSH_ALIGN 176 174 m_uiLastByte = m_pcTComBitstream->readByte(); 177 175 m_uiValue += m_uiLastByte << m_bitsNeeded; … … 192 190 { 193 191 m_bitsNeeded = -8; 194 #if OL_FLUSH &&!OL_FLUSH_ALIGN192 #if !OL_FLUSH_ALIGN 195 193 m_uiLastByte = m_pcTComBitstream->readByte(); 196 194 m_uiValue += m_uiLastByte; … … 215 213 while ( numBins > 8 ) 216 214 { 217 #if OL_FLUSH &&!OL_FLUSH_ALIGN215 #if !OL_FLUSH_ALIGN 218 216 m_uiLastByte = m_pcTComBitstream->readByte(); 219 217 m_uiValue = ( m_uiValue << 8 ) + ( m_uiLastByte << ( 8 + m_bitsNeeded ) ); … … 241 239 if ( m_bitsNeeded >= 0 ) 242 240 { 243 #if OL_FLUSH &&!OL_FLUSH_ALIGN241 #if !OL_FLUSH_ALIGN 244 242 m_uiLastByte = m_pcTComBitstream->readByte(); 245 243 m_uiValue += m_uiLastByte << m_bitsNeeded; … … 285 283 { 286 284 m_bitsNeeded = -8; 287 #if OL_FLUSH &&!OL_FLUSH_ALIGN285 #if !OL_FLUSH_ALIGN 288 286 m_uiLastByte = m_pcTComBitstream->readByte(); 289 287 m_uiValue += m_uiLastByte; … … 306 304 } 307 305 308 #if BURST_IPCM309 306 /** Decode subsequent_pcm_num. 310 307 * \param numSubseqIPCM … … 323 320 { 324 321 m_bitsNeeded = -8; 325 #if OL_FLUSH &&!OL_FLUSH_ALIGN322 #if !OL_FLUSH_ALIGN 326 323 m_uiLastByte = m_pcTComBitstream->readByte(); 327 324 m_uiValue += m_uiLastByte; … … 342 339 numSubseqIPCM --; 343 340 } 344 #endif345 341 346 342 /** Decode PCM alignment zero bits. -
branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecBinCoderCABAC.h
r56 r294 56 56 Void start (); 57 57 Void finish (); 58 #if OL_FLUSH59 58 Void flush (); 60 #endif61 59 62 60 Void decodeBin ( UInt& ruiBin, ContextModel& rcCtxModel ); … … 66 64 67 65 Void resetBac (); 68 #if BURST_IPCM69 66 Void decodeNumSubseqIPCM( Int& numSubseqIPCM ) ; 70 #endif71 67 Void decodePCMAlignBits(); 72 68 Void xReadPCMCode ( UInt uiLength, UInt& ruiCode ); … … 82 78 UInt m_uiRange; 83 79 UInt m_uiValue; 84 #if OL_FLUSH &&!OL_FLUSH_ALIGN80 #if !OL_FLUSH_ALIGN 85 81 UInt m_uiLastByte; 86 82 #endif -
branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp
r292 r294 169 169 assert(m_pcBitstream->getNumBitsLeft() == 8); /* rsbp_trailing_bits */ 170 170 } 171 #if RPS_IN_SPS172 171 void TDecCavlc::parseShortTermRefPicSet( TComSPS* sps, TComReferencePictureSet* rps, Int idx ) 173 #else174 void TDecCavlc::parseShortTermRefPicSet( TComPPS* pcPPS, TComReferencePictureSet* rps, Int idx )175 #endif176 172 { 177 173 UInt code; … … 184 180 Int rIdx = idx - 1 - code; 185 181 assert (rIdx <= idx && rIdx >= 0); 186 #if RPS_IN_SPS187 182 TComReferencePictureSet* rpsRef = sps->getRPSList()->getReferencePictureSet(rIdx); 188 #else189 TComReferencePictureSet* rpsRef = pcPPS->getRPSList()->getReferencePictureSet(rIdx);190 #endif191 183 Int k = 0, k0 = 0, k1 = 0; 192 184 READ_CODE(1, bit, "delta_rps_sign"); // delta_RPS_sign … … 265 257 READ_FLAG(uiCode, "aps_scaling_list_data_present_flag"); aps->setScalingListEnabled( (uiCode==1)?true:false ); 266 258 READ_FLAG(uiCode, "aps_deblocking_filter_flag"); aps->setLoopFilterOffsetInAPS( (uiCode==1)?true:false ); 267 #if !SAO_UNIT_INTERLEAVING268 READ_FLAG(uiCode, "aps_sample_adaptive_offset_flag"); aps->setSaoEnabled( (uiCode==1)?true:false );269 #endif270 #if !LCU_SYNTAX_ALF271 READ_FLAG(uiCode, "aps_adaptive_loop_filter_flag"); aps->setAlfEnabled( (uiCode==1)?true:false );272 #endif273 259 if(aps->getScalingListEnabled()) 274 260 { 275 261 parseScalingList( aps->getScalingList() ); 276 262 } 277 #if DBL_CONTROL278 263 if(aps->getLoopFilterOffsetInAPS()) 279 264 { 280 265 xParseDblParam( aps ); 281 266 } 282 #endif283 #if SAO_UNIT_INTERLEAVING284 267 READ_FLAG(uiCode, "aps_sao_interleaving_flag"); aps->setSaoInterleavingFlag( (uiCode==1)?true:false ); 285 268 if(!aps->getSaoInterleavingFlag()) 286 269 { 287 270 READ_FLAG(uiCode, "aps_sample_adaptive_offset_flag"); aps->setSaoEnabled( (uiCode==1)?true:false ); 288 #endif289 271 if(aps->getSaoEnabled()) 290 272 { … … 292 274 xParseSaoParam( aps->getSaoParam() ); 293 275 } 294 #if SAO_UNIT_INTERLEAVING 295 } 296 #endif 297 #if LCU_SYNTAX_ALF 276 } 298 277 READ_FLAG(uiCode, "aps_adaptive_loop_filter_flag"); aps->setAlfEnabled( (uiCode==1)?true:false ); 299 #endif300 278 if(aps->getAlfEnabled()) 301 279 { 302 #if !LCU_SYNTAX_ALF303 aps->getAlfParam()->alf_flag = 1;304 #endif305 280 xParseAlfParam( aps->getAlfParam()); 306 281 } … … 316 291 } 317 292 318 #if DBL_CONTROL319 293 Void TDecCavlc::xParseDblParam ( TComAPS* aps ) 320 294 { … … 333 307 } 334 308 } 335 #endif336 309 /** parse SAO parameters 337 310 * \param pSaoParam … … 341 314 UInt uiSymbol; 342 315 343 #if SAO_UNIT_INTERLEAVING344 316 int i,j, compIdx; 345 317 int numCuInWidth; … … 393 365 } 394 366 } 395 #else 396 if (pSaoParam->bSaoFlag[0]) 397 { 398 xParseSaoSplitParam (pSaoParam, 0, 0); 399 xParseSaoOffsetParam(pSaoParam, 0, 0); 400 READ_FLAG (uiSymbol, "sao_flag_cb"); 401 pSaoParam->bSaoFlag[1] = uiSymbol? true:false; 402 if (pSaoParam->bSaoFlag[1]) 403 { 404 xParseSaoSplitParam (pSaoParam, 0, 1); 405 xParseSaoOffsetParam(pSaoParam, 0, 1); 406 } 407 408 READ_FLAG (uiSymbol, "sao_flag_cr"); 409 pSaoParam->bSaoFlag[2] = uiSymbol? true:false; 410 if (pSaoParam->bSaoFlag[2]) 411 { 412 xParseSaoSplitParam (pSaoParam, 0, 2); 413 xParseSaoOffsetParam(pSaoParam, 0, 2); 414 } 415 } 416 #endif 417 } 418 #if SAO_UNIT_INTERLEAVING 367 } 419 368 /** copy SAO parameter 420 369 * \param dst … … 584 533 } 585 534 586 #else 587 /** Decode quadtree split flag 588 * \param pSaoParam, iPartIdx 589 */ 590 Void TDecCavlc::xParseSaoSplitParam(SAOParam* pSaoParam, Int iPartIdx, Int iYCbCr) 591 { 592 UInt uiSymbol; 593 SAOQTPart* pSaoPart = NULL; 594 pSaoPart= &(pSaoParam->psSaoPart[iYCbCr][iPartIdx]); 595 596 if(pSaoPart->PartLevel < pSaoParam->iMaxSplitLevel) 597 { 598 READ_FLAG (uiSymbol, "sao_split_flag"); 599 pSaoPart->bSplit = uiSymbol? true:false; 600 if(pSaoPart->bSplit) 601 { 602 for (Int i=0;i<NUM_DOWN_PART;i++) 603 { 604 xParseSaoSplitParam(pSaoParam, pSaoPart->DownPartsIdx[i], iYCbCr); 605 } 606 } 607 } 608 else 609 { 610 pSaoPart->bSplit = false; 611 } 612 } 613 614 /** Decode SAO for one partition 615 * \param pSaoParam, iPartIdx 616 */ 617 Void TDecCavlc::xParseSaoOffsetParam(SAOParam* pSaoParam, Int iPartIdx, Int iYCbCr) 618 { 619 UInt uiSymbol; 620 Int iSymbol; 621 SAOQTPart* pSaoPart = NULL; 622 pSaoPart = &(pSaoParam->psSaoPart[iYCbCr][iPartIdx]); 623 624 static Int iTypeLength[MAX_NUM_SAO_TYPE] = { 625 SAO_EO_LEN, 626 SAO_EO_LEN, 627 SAO_EO_LEN, 628 SAO_EO_LEN, 629 SAO_BO_LEN, 630 SAO_BO_LEN 631 }; 632 if(!pSaoPart->bSplit) 633 { 634 READ_UVLC (uiSymbol, "sao_type_idx"); 635 if (uiSymbol) 636 { 637 pSaoPart->iBestType = uiSymbol-1; 638 pSaoPart->bEnableFlag = true; 639 } 640 else 641 { 642 pSaoPart->iBestType = -1; 643 pSaoPart->bEnableFlag = false; 644 } 645 646 if (pSaoPart->bEnableFlag) 647 { 648 pSaoPart->iLength = iTypeLength[pSaoPart->iBestType]; 649 for(Int i=0; i< pSaoPart->iLength; i++) 650 { 651 READ_SVLC (iSymbol, "sao_offset"); 652 pSaoPart->iOffset[i] = iSymbol; 653 } 654 } 655 return; 656 } 657 658 //split 659 if (pSaoPart->PartLevel < pSaoParam->iMaxSplitLevel) 660 { 661 for(Int i=0;i<NUM_DOWN_PART;i++) 662 { 663 xParseSaoOffsetParam(pSaoParam, pSaoPart->DownPartsIdx[i], iYCbCr); 664 } 665 } 666 } 667 #endif 668 669 #if LCU_SYNTAX_ALF 535 670 536 Void TDecCavlc::xParseAlfParam(AlfParamSet* pAlfParamSet, Bool bSentInAPS, Int firstLCUAddr, Bool acrossSlice, Int numLCUInWidth, Int numLCUInHeight) 671 537 { … … 931 797 } 932 798 933 #endif934 799 935 800 Void TDecCavlc::xParseAlfParam(ALFParam* pAlfParam) … … 937 802 UInt uiSymbol; 938 803 Int iSymbol; 939 #if ALF_SINGLE_FILTER_SHAPE940 804 Int sqrFiltLengthTab[NUM_ALF_FILTER_SHAPE] = {ALF_FILTER_LEN}; 941 #else 942 Int sqrFiltLengthTab[2] = { 9, 9}; 943 #endif 944 945 #if LCU_SYNTAX_ALF 805 946 806 switch(pAlfParam->componentID) 947 807 { … … 961 821 case ALF_Y: 962 822 { 963 #endif964 823 pAlfParam->filters_per_group = 0; 965 824 memset (pAlfParam->filterPattern, 0 , sizeof(Int)*NO_VAR_BINS); 966 #if !LCU_SYNTAX_ALF967 READ_FLAG (uiSymbol, "alf_region_adaptation_flag");968 pAlfParam->alf_pcr_region_flag = uiSymbol;969 #endif970 #if ALF_SINGLE_FILTER_SHAPE971 825 pAlfParam->filter_shape = 0; 972 #else973 READ_UVLC (uiSymbol, "alf_length_luma_minus_5_div2");974 pAlfParam->filter_shape = uiSymbol;975 #endif976 826 pAlfParam->num_coeff = sqrFiltLengthTab[pAlfParam->filter_shape]; 977 827 … … 989 839 { 990 840 pAlfParam->filters_per_group = 1; 991 #if LCU_SYNTAX_ALF992 #if ALF_16_BA_GROUPS993 841 Int numMergeFlags = 16; 994 #else995 Int numMergeFlags = 15;996 #endif997 #else998 #if ALF_16_BA_GROUPS999 Int numMergeFlags = 16;1000 #else1001 Int numMergeFlags = pAlfParam->alf_pcr_region_flag ? 16 : 15;1002 #endif1003 #endif1004 842 for (Int i=1; i<numMergeFlags; i++) 1005 843 { … … 1021 859 } 1022 860 1023 #if ALF_SINGLE_FILTER_SHAPE1024 861 Int minScanVal = MIN_SCAN_POS_CROSS; 1025 #else1026 Int minScanVal = (pAlfParam->filter_shape == ALF_STAR5x5) ? 0: MIN_SCAN_POS_CROSS;1027 #endif1028 862 1029 863 // Determine maxScanVal … … 1036 870 1037 871 // Golomb parameters 1038 #if LCU_SYNTAX_ALF1039 872 if( pAlfParam->filters_per_group > 1 ) 1040 873 { 1041 #endif1042 874 READ_UVLC (uiSymbol, "alf_min_kstart_minus1"); 1043 875 pAlfParam->minKStart = 1 + uiSymbol; … … 1051 883 kMin = pAlfParam->kMinTab[scanPos]; 1052 884 } 1053 #if LCU_SYNTAX_ALF 1054 } 1055 #endif 885 } 1056 886 1057 887 Int scanPos; … … 1061 891 { 1062 892 scanPos = pDepthInt[i] - 1; 1063 #if LCU_SYNTAX_ALF1064 893 Int k = (pAlfParam->filters_per_group == 1) ? kTableTabShapes[ALF_CROSS9x7_SQUARE3x3][i] : pAlfParam->kMinTab[scanPos]; 1065 894 pAlfParam->coeffmulti[idx][i] = xGolombDecode(k); 1066 #else 1067 pAlfParam->coeffmulti[idx][i] = xGolombDecode(pAlfParam->kMinTab[scanPos]); 1068 #endif 1069 } 1070 } 1071 #if LCU_SYNTAX_ALF 895 } 896 } 1072 897 } 1073 898 break; … … 1079 904 } 1080 905 } 1081 #else1082 // filter parameters for chroma1083 READ_UVLC (uiSymbol, "alf_chroma_idc");1084 pAlfParam->chroma_idc = uiSymbol;1085 1086 if(pAlfParam->chroma_idc)1087 {1088 1089 #if ALF_SINGLE_FILTER_SHAPE1090 pAlfParam->filter_shape_chroma = 0;1091 #else1092 READ_UVLC (uiSymbol, "alf_length_chroma_minus_5_div2");1093 1094 pAlfParam->filter_shape_chroma = uiSymbol;1095 #endif1096 pAlfParam->num_coeff_chroma = sqrFiltLengthTab[pAlfParam->filter_shape_chroma];1097 // filter coefficients for chroma1098 for(Int pos=0; pos<pAlfParam->num_coeff_chroma; pos++)1099 {1100 READ_SVLC (iSymbol, "alf_coeff_chroma");1101 pAlfParam->coeff_chroma[pos] = iSymbol;1102 }1103 }1104 #endif1105 906 } 1106 907 … … 1137 938 } 1138 939 1139 #if TILES_OR_ENTROPY_SYNC_IDC1140 940 Void TDecCavlc::parsePPS(TComPPS* pcPPS, ParameterSetManagerDecoder *parameterSet) 1141 #else1142 Void TDecCavlc::parsePPS(TComPPS* pcPPS)1143 #endif1144 941 { 1145 942 #if ENC_DEC_TRACE … … 1150 947 Int iCode; 1151 948 1152 #if !RPS_IN_SPS1153 TComRPSList* rpsList = pcPPS->getRPSList();1154 #endif1155 949 READ_UVLC( uiCode, "pic_parameter_set_id"); pcPPS->setPPSId (uiCode); 1156 950 READ_UVLC( uiCode, "seq_parameter_set_id"); pcPPS->setSPSId (uiCode); 1157 951 1158 #if MULTIBITS_DATA_HIDING1159 952 READ_FLAG ( uiCode, "sign_data_hiding_flag" ); pcPPS->setSignHideFlag( uiCode ); 1160 953 if( pcPPS->getSignHideFlag() ) … … 1162 955 READ_CODE( 4, uiCode, "sign_hiding_threshold"); pcPPS->setTSIG(uiCode); 1163 956 } 1164 #endif1165 957 1166 958 #if CABAC_INIT_FLAG 1167 959 READ_FLAG( uiCode, "cabac_init_present_flag" ); pcPPS->setCabacInitPresentFlag( uiCode ? true : false ); 1168 #endif1169 #if !RPS_IN_SPS1170 // RPS is put before entropy_coding_mode_flag1171 // since entropy_coding_mode_flag will probably be removed from the WD1172 TComReferencePictureSet* pcRPS;1173 1174 READ_UVLC( uiCode, "num_short_term_ref_pic_sets" );1175 rpsList->create(uiCode);1176 1177 for(Int i=0; i< rpsList->getNumberOfReferencePictureSets(); i++)1178 {1179 pcRPS = rpsList->getReferencePictureSet(i);1180 parseShortTermRefPicSet(pcPPS,pcRPS,i);1181 }1182 READ_FLAG( uiCode, "long_term_ref_pics_present_flag" ); pcPPS->setLongTermRefsPresent(uiCode);1183 960 #endif 1184 961 // entropy_coding_mode_flag … … 1187 964 if (pcPPS->getEntropyCodingMode()) 1188 965 { 1189 #if !WPP_SIMPLIFICATION 1190 READ_UVLC( uiCode, "entropy_coding_synchro" ); pcPPS->setEntropyCodingSynchro( uiCode ); 1191 READ_FLAG( uiCode, "cabac_istate_reset" ); pcPPS->setCabacIstateReset( uiCode ? true : false ); 1192 #endif 1193 #if !TILES_OR_ENTROPY_SYNC_IDC 1194 #if !WPP_SIMPLIFICATION 1195 if ( pcPPS->getEntropyCodingSynchro() ) 1196 #endif 1197 { 1198 READ_UVLC( uiCode, "num_substreams_minus1" ); pcPPS->setNumSubstreams(uiCode+1); 1199 } 1200 #endif 1201 } 1202 #if !H0566_TLA 1203 READ_UVLC( uiCode, "num_temporal_layer_switching_point_flags" ); pcPPS->setNumTLayerSwitchingFlags( uiCode ); 1204 for ( UInt i = 0; i < pcPPS->getNumTLayerSwitchingFlags(); i++ ) 1205 { 1206 READ_FLAG( uiCode, "temporal_layer_switching_point_flag" ); pcPPS->setTLayerSwitchingFlag( i, uiCode > 0 ? true : false ); 1207 } 1208 #endif 966 } 1209 967 1210 968 // num_ref_idx_l0_default_active_minus1 … … 1241 999 //printf("TDecCavlc::parsePPS():\tm_bUseWeightPred=%d\tm_uiBiPredIdc=%d\n", pcPPS->getUseWP(), pcPPS->getWPBiPredIdc()); 1242 1000 1243 #if H03881244 1001 READ_FLAG( uiCode, "output_flag_present_flag" ); 1245 1002 pcPPS->setOutputFlagPresentFlag( uiCode==1 ); 1246 #endif 1247 1248 #if TILES_OR_ENTROPY_SYNC_IDC 1003 1249 1004 if(parameterSet->getPrefetchedSPS(pcPPS->getSPSId())->getTilesOrEntropyCodingSyncIdc()==1) 1250 1005 { 1251 #endif1252 1006 READ_FLAG ( uiCode, "tile_info_present_flag" ); 1253 1007 pcPPS->setColumnRowInfoPresent(uiCode); … … 1290 1044 Int iNumColTilesMinus1 = (pcPPS->getColumnRowInfoPresent() == 1)?(pcPPS->getNumColumnsMinus1()):(pcPPS->getSPS()->getNumColumnsMinus1()); 1291 1045 Int iNumRowTilesMinus1 = (pcPPS->getColumnRowInfoPresent() == 1)?(pcPPS->getNumColumnsMinus1()):(pcPPS->getSPS()->getNumRowsMinus1()); 1292 #if !REMOVE_TILE_DEPENDENCE1293 pcPPS->setTileBoundaryIndependenceIdr( 1 ); //default1294 #endif1295 1046 pcPPS->setLFCrossTileBoundaryFlag(true); //default 1296 1047 1297 1048 if(iNumColTilesMinus1 !=0 || iNumRowTilesMinus1 !=0) 1298 1049 { 1299 #if !REMOVE_TILE_DEPENDENCE1300 READ_FLAG ( uiCode, "tile_boundary_independence_flag" );1301 pcPPS->setTileBoundaryIndependenceIdr( uiCode );1302 1303 if(pcPPS->getTileBoundaryIndependenceIdr() == 1)1304 {1305 #endif1306 1050 READ_FLAG ( uiCode, "loop_filter_across_tile_flag" ); 1307 1051 pcPPS->setLFCrossTileBoundaryFlag( (uiCode == 1)?true:false ); 1308 #if !REMOVE_TILE_DEPENDENCE 1309 } 1310 #endif 1311 } 1312 } 1313 #if TILES_OR_ENTROPY_SYNC_IDC 1052 } 1053 } 1314 1054 } 1315 1055 else if(parameterSet->getPrefetchedSPS(pcPPS->getSPSId())->getTilesOrEntropyCodingSyncIdc()==2) … … 1317 1057 READ_UVLC( uiCode, "num_substreams_minus1" ); pcPPS->setNumSubstreams(uiCode+1); 1318 1058 } 1319 #endif 1320 1321 #if DBL_CONTROL 1059 1322 1060 READ_FLAG( uiCode, "deblocking_filter_control_present_flag" ); 1323 1061 pcPPS->setDeblockingFilterControlPresent( uiCode ? true : false); 1324 #endif1325 #if PARALLEL_MERGE1326 1062 READ_UVLC( uiCode, "log2_parallel_merge_level_minus2"); 1327 1063 assert(uiCode == LOG2_PARALLEL_MERGE_LEVEL_MINUS2); 1328 1064 pcPPS->setLog2ParallelMergeLevelMinus2 (uiCode); 1329 #endif1330 1065 1331 1066 READ_FLAG( uiCode, "pps_extension_flag"); … … 1496 1231 READ_UVLC ( uiCode, "pic_width_in_luma_samples" ); pcSPS->setPicWidthInLumaSamples ( uiCode ); 1497 1232 READ_UVLC ( uiCode, "pic_height_in_luma_samples" ); pcSPS->setPicHeightInLumaSamples( uiCode ); 1498 #if PIC_CROPPING1499 1233 READ_FLAG( uiCode, "pic_cropping_flag"); pcSPS->setPicCroppingFlag ( uiCode ? true : false ); 1500 1234 if (uiCode != 0) … … 1505 1239 READ_UVLC( uiCode, "pic_crop_bottom_offset" ); pcSPS->setPicCropBottomOffset( uiCode ); 1506 1240 } 1507 #endif1508 1241 1509 1242 #if FULL_NBIT … … 1525 1258 #endif 1526 1259 1527 #if H0736_AVC_STYLE_QP_RANGE1528 1260 pcSPS->setQpBDOffsetY( (Int) (6*uiCode) ); 1529 #endif1530 1261 1531 1262 g_uiBASE_MAX = ((1<<(g_uiBitDepth))-1); … … 1537 1268 #endif 1538 1269 READ_UVLC( uiCode, "bit_depth_chroma_minus8" ); 1539 #if H0736_AVC_STYLE_QP_RANGE1540 1270 pcSPS->setQpBDOffsetC( (Int) (6*uiCode) ); 1541 #endif1542 1271 1543 1272 READ_FLAG( uiCode, "pcm_enabled_flag" ); pcSPS->setUsePCM( uiCode ? true : false ); … … 1554 1283 1555 1284 READ_UVLC( uiCode, "log2_max_pic_order_cnt_lsb_minus4" ); pcSPS->setBitsForPOC( 4 + uiCode ); 1556 #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER1557 1285 for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++) 1558 1286 { … … 1564 1292 pcSPS->setMaxLatencyIncrease( uiCode, i ); 1565 1293 } 1566 #else 1567 READ_UVLC( uiCode, "max_num_ref_pics" ); pcSPS->setMaxNumberOfReferencePictures(uiCode); 1568 READ_UVLC( uiCode, "num_reorder_frames" ); pcSPS->setNumReorderFrames(uiCode); 1569 READ_UVLC ( uiCode, "max_dec_frame_buffering"); 1570 pcSPS->setMaxDecFrameBuffering( uiCode ); 1571 READ_UVLC ( uiCode, "max_latency_increase"); 1572 pcSPS->setMaxLatencyIncrease( uiCode ); 1573 #endif 1574 1575 #if H0412_REF_PIC_LIST_RESTRICTION 1294 1576 1295 READ_FLAG( uiCode, "restricted_ref_pic_lists_flag" ); 1577 1296 pcSPS->setRestrictedRefPicListsFlag( uiCode ); … … 1585 1304 pcSPS->setListsModificationPresentFlag(true); 1586 1305 } 1587 #endif1588 1306 READ_UVLC( uiCode, "log2_min_coding_block_size_minus3" ); 1589 1307 UInt log2MinCUSize = uiCode + 3; … … 1628 1346 READ_FLAG( uiCode, "sample_adaptive_offset_enabled_flag" ); pcSPS->setUseSAO ( uiCode ? true : false ); 1629 1347 READ_FLAG( uiCode, "adaptive_loop_filter_enabled_flag" ); pcSPS->setUseALF ( uiCode ? true : false ); 1630 #if LCU_SYNTAX_ALF1631 1348 if(pcSPS->getUseALF()) 1632 1349 { 1633 1350 READ_FLAG( uiCode, "alf_coef_in_slice_flag" ); pcSPS->setUseALFCoefInSlice ( uiCode ? true : false ); 1634 1351 } 1635 #endif1636 1352 if( pcSPS->getUsePCM() ) 1637 1353 { … … 1642 1358 1643 1359 1644 #if RPS_IN_SPS1645 1360 TComRPSList* rpsList = pcSPS->getRPSList(); 1646 1361 TComReferencePictureSet* rps; … … 1655 1370 } 1656 1371 READ_FLAG( uiCode, "long_term_ref_pics_present_flag" ); pcSPS->setLongTermRefsPresent(uiCode); 1657 #endif1658 #if !PIC_CROPPING1659 //!!!KS: Syntax not in WD !!!1660 1661 xReadUvlc ( uiCode ); pcSPS->setPadX ( uiCode );1662 xReadUvlc ( uiCode ); pcSPS->setPadY ( uiCode );1663 #endif1664 1372 1665 1373 // AMVP mode for each depth (AM_NONE or AM_EXPL) … … 1670 1378 } 1671 1379 1672 #if TILES_WPP_ENTRY_POINT_SIGNALLING1673 1380 READ_CODE(2, uiCode, "tiles_or_entropy_coding_sync_idc"); pcSPS->setTilesOrEntropyCodingSyncIdc(uiCode); 1674 #endif 1675 1676 #if TILES_OR_ENTROPY_SYNC_IDC 1381 1677 1382 if(pcSPS->getTilesOrEntropyCodingSyncIdc() == 1) 1678 1383 { 1679 #endif1680 1384 READ_UVLC ( uiCode, "num_tile_columns_minus1" ); 1681 1385 pcSPS->setNumColumnsMinus1( uiCode ); … … 1704 1408 free(rowHeight); 1705 1409 } 1706 #if !REMOVE_TILE_DEPENDENCE1707 pcSPS->setTileBoundaryIndependenceIdr( 1 ); //default1708 #endif1709 1410 pcSPS->setLFCrossTileBoundaryFlag(true); //default 1710 1411 1711 1412 if( pcSPS->getNumColumnsMinus1() !=0 || pcSPS->getNumRowsMinus1() != 0) 1712 1413 { 1713 #if !REMOVE_TILE_DEPENDENCE1714 READ_FLAG ( uiCode, "tile_boundary_independence_flag" );1715 pcSPS->setTileBoundaryIndependenceIdr( uiCode );1716 if(pcSPS->getTileBoundaryIndependenceIdr() == 1)1717 {1718 #endif1719 1414 READ_FLAG ( uiCode, "loop_filter_across_tile_flag" ); 1720 1415 pcSPS->setLFCrossTileBoundaryFlag( (uiCode==1)?true:false); 1721 #if !REMOVE_TILE_DEPENDENCE 1722 } 1723 #endif 1724 } 1725 #if TILES_OR_ENTROPY_SYNC_IDC 1726 } 1727 #endif 1416 } 1417 } 1728 1418 READ_FLAG( uiCode, "sps_extension_flag"); 1729 1419 #if !QC_MVHEVC_B0046 … … 1894 1584 } 1895 1585 1896 #if LCU_SYNTAX_ALF1897 1586 #if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137 1898 1587 Void TDecCavlc::parseSliceHeader (TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet, bool isDepth) 1899 1588 #else 1900 1589 Void TDecCavlc::parseSliceHeader (TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet) 1901 #endif1902 #else1903 Void TDecCavlc::parseSliceHeader (TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl)1904 1590 #endif 1905 1591 { … … 1988 1674 rpcSlice->setSPS(sps); 1989 1675 rpcSlice->setPPS(pps); 1990 #if H03881991 1676 if( pps->getOutputFlagPresentFlag() ) 1992 1677 { … … 1998 1683 rpcSlice->setPicOutputFlag( true ); 1999 1684 } 2000 #endif2001 1685 #if QC_REM_IDV_B0046 2002 1686 #if !QC_MVHEVC_B0046 … … 2065 1749 { 2066 1750 rps = rpcSlice->getLocalRPS(); 2067 #if RPS_IN_SPS2068 1751 parseShortTermRefPicSet(sps,rps, sps->getRPSList()->getNumberOfReferencePictureSets()); 2069 #else2070 parseShortTermRefPicSet(pps,rps, pps->getRPSList()->getNumberOfReferencePictureSets());2071 #endif2072 1752 rpcSlice->setRPS(rps); 2073 1753 } 2074 1754 else // use reference to short-term reference picture set in PPS 2075 1755 { 2076 #if RPS_IN_SPS2077 1756 READ_UVLC( uiCode, "short_term_ref_pic_set_idx"); rpcSlice->setRPS(sps->getRPSList()->getReferencePictureSet(uiCode)); 2078 #else2079 READ_UVLC( uiCode, "short_term_ref_pic_set_idx"); rpcSlice->setRPS(pps->getRPSList()->getReferencePictureSet(uiCode));2080 #endif2081 1757 rps = rpcSlice->getRPS(); 2082 1758 } 2083 #if RPS_IN_SPS2084 1759 if(sps->getLongTermRefsPresent()) 2085 #else2086 if(pps->getLongTermRefsPresent())2087 #endif2088 1760 { 2089 1761 Int offset = rps->getNumberOfNegativePictures()+rps->getNumberOfPositivePictures(); 2090 1762 READ_UVLC( uiCode, "num_long_term_pics"); rps->setNumberOfLongtermPictures(uiCode); 2091 1763 Int prev = 0; 2092 #if LTRP_MULT2093 1764 Int prevMsb=0; 2094 1765 Int prevDeltaPocLt=0; 2095 #endif2096 1766 for(Int j=rps->getNumberOfLongtermPictures()+offset-1 ; j > offset-1; j--) 2097 1767 { … … 2099 1769 prev += uiCode; 2100 1770 2101 #if LTRP_MULT2102 1771 READ_FLAG(uiCode,"delta_poc_msb_present_flag"); 2103 1772 Int decDeltaPOCMsbPresent=uiCode; … … 2120 1789 else 2121 1790 { 2122 #endif2123 1791 rps->setPOC(j,rpcSlice->getPOC()-prev); 2124 1792 rps->setDeltaPOC(j,-(Int)prev); 2125 #if LTRP_MULT2126 1793 } 2127 1794 prevDeltaPocLt=prev; 2128 #endif2129 1795 READ_FLAG( uiCode, "used_by_curr_pic_lt_flag"); rps->setUsed(j,uiCode); 2130 1796 } … … 2145 1811 if (sps->getUseSAO()) 2146 1812 { 2147 #if SAO_UNIT_INTERLEAVING2148 1813 READ_FLAG(uiCode, "slice_sao_interleaving_flag"); rpcSlice->setSaoInterleavingFlag(uiCode); 2149 #endif2150 1814 READ_FLAG(uiCode, "slice_sample_adaptive_offset_flag"); rpcSlice->setSaoEnabledFlag((Bool)uiCode); 2151 #if SAO_UNIT_INTERLEAVING2152 1815 if (rpcSlice->getSaoEnabledFlag() && rpcSlice->getSaoInterleavingFlag()) 2153 1816 { … … 2160 1823 rpcSlice->setSaoEnabledFlagCr(0); 2161 1824 } 2162 #endif2163 1825 } 2164 1826 READ_UVLC ( uiCode, "aps_id" ); rpcSlice->setAPSId(uiCode); … … 2188 1850 if( !rpcSlice->isIntra() ) 2189 1851 { 2190 #if H0412_REF_PIC_LIST_RESTRICTION2191 1852 #if QC_MVHEVC_B0046 2192 1853 if( !rpcSlice->getViewId() || !rpcSlice->getSPS()->getListsModificationPresentFlag() ) … … 2199 1860 else 2200 1861 { 2201 #endif2202 1862 READ_FLAG( uiCode, "ref_pic_list_modification_flag_l0" ); refPicListModification->setRefPicListModificationFlagL0( uiCode ? 1 : 0 ); 2203 #if H0412_REF_PIC_LIST_RESTRICTION 2204 } 2205 #endif 1863 } 2206 1864 2207 1865 if(refPicListModification->getRefPicListModificationFlagL0()) … … 2209 1867 uiCode = 0; 2210 1868 Int i = 0; 2211 #if H0137_0138_LIST_MODIFICATION2212 1869 Int NumPocTotalCurr = rpcSlice->getNumPocTotalCurrMvc(); 2213 1870 if ( NumPocTotalCurr > 1 ) … … 2232 1889 } 2233 1890 } 2234 #else 2235 Int list_modification_idc = 0; 2236 while(list_modification_idc != 3) 2237 { 2238 READ_UVLC( uiCode, "list_modification_idc" ); refPicListModification->setListIdcL0(i, uiCode ); 2239 list_modification_idc = uiCode; 2240 if(uiCode != 3) 2241 { 2242 READ_UVLC( uiCode, "ref_pic_set_idx" ); refPicListModification->setRefPicSetIdxL0(i, uiCode ); 2243 } 2244 i++; 2245 } 2246 refPicListModification->setNumberOfRefPicListModificationsL0(i-1); 2247 #endif 2248 } 2249 #if !H0137_0138_LIST_MODIFICATION 2250 else 2251 { 2252 refPicListModification->setNumberOfRefPicListModificationsL0(0); 2253 } 2254 #endif 1891 } 2255 1892 } 2256 1893 else 2257 1894 { 2258 1895 refPicListModification->setRefPicListModificationFlagL0(0); 2259 #if !H0137_0138_LIST_MODIFICATION2260 refPicListModification->setNumberOfRefPicListModificationsL0(0);2261 #endif2262 1896 } 2263 1897 if(rpcSlice->isInterB()) 2264 1898 { 2265 #if H0412_REF_PIC_LIST_RESTRICTION2266 1899 #if QC_MVHEVC_B0046 2267 1900 if( !rpcSlice->getViewId() || !rpcSlice->getSPS()->getListsModificationPresentFlag() ) … … 2274 1907 else 2275 1908 { 2276 #endif2277 1909 READ_FLAG( uiCode, "ref_pic_list_modification_flag_l1" ); refPicListModification->setRefPicListModificationFlagL1( uiCode ? 1 : 0 ); 2278 #if H0412_REF_PIC_LIST_RESTRICTION 2279 } 2280 #endif 1910 } 2281 1911 if(refPicListModification->getRefPicListModificationFlagL1()) 2282 1912 { 2283 1913 uiCode = 0; 2284 1914 Int i = 0; 2285 #if H0137_0138_LIST_MODIFICATION2286 1915 Int NumPocTotalCurr = rpcSlice->getNumPocTotalCurrMvc(); 2287 1916 if ( NumPocTotalCurr > 1 ) … … 2306 1935 } 2307 1936 } 2308 #else 2309 Int list_modification_idc = 0; 2310 while(list_modification_idc != 3) 2311 { 2312 READ_UVLC( uiCode, "list_modification_idc" ); refPicListModification->setListIdcL1(i, uiCode ); 2313 list_modification_idc = uiCode; 2314 if(uiCode != 3) 2315 { 2316 READ_UVLC( uiCode, "ref_pic_set_idx" ); refPicListModification->setRefPicSetIdxL1(i, uiCode ); 2317 } 2318 i++; 2319 } 2320 refPicListModification->setNumberOfRefPicListModificationsL1(i-1); 2321 #endif 2322 } 2323 #if !H0137_0138_LIST_MODIFICATION 2324 else 2325 { 2326 refPicListModification->setNumberOfRefPicListModificationsL1(0); 2327 } 2328 #endif 1937 } 2329 1938 } 2330 1939 else 2331 1940 { 2332 1941 refPicListModification->setRefPicListModificationFlagL1(0); 2333 #if !H0137_0138_LIST_MODIFICATION2334 refPicListModification->setNumberOfRefPicListModificationsL1(0);2335 #endif2336 1942 } 2337 1943 } … … 2351 1957 READ_UVLC( uiCode, "num_ref_idx_lc_active_minus1" ); rpcSlice->setNumRefIdx( REF_PIC_LIST_C, uiCode + 1 ); 2352 1958 2353 #if H0412_REF_PIC_LIST_RESTRICTION2354 1959 #if QC_MVHEVC_B0046 2355 1960 if( rpcSlice->getViewId() && rpcSlice->getSPS()->getListsModificationPresentFlag() ) … … 2358 1963 #endif 2359 1964 { 2360 #endif2361 1965 READ_FLAG( uiCode, "ref_pic_list_modification_flag_lc" ); rpcSlice->setRefPicListModificationFlagLC( uiCode ? 1 : 0 ); 2362 1966 if(uiCode) … … 2366 1970 READ_FLAG( uiCode, "pic_from_list_0_flag" ); 2367 1971 rpcSlice->setListIdFromIdxOfLC(i, uiCode); 2368 #if H0137_0138_LIST_MODIFICATION2369 1972 if (((rpcSlice->getListIdFromIdxOfLC(i) == REF_PIC_LIST_0) && (rpcSlice->getNumRefIdx( REF_PIC_LIST_0 ) == 1)) || ((rpcSlice->getListIdFromIdxOfLC(i) == REF_PIC_LIST_1) && (rpcSlice->getNumRefIdx( REF_PIC_LIST_1 ) == 1)) ) 2370 1973 { … … 2375 1978 READ_UVLC( uiCode, "ref_idx_list_curr" ); 2376 1979 } 2377 #else2378 READ_UVLC( uiCode, "ref_idx_list_curr" );2379 #endif2380 1980 rpcSlice->setRefIdxFromIdxOfLC(i, uiCode); 2381 1981 rpcSlice->setRefIdxOfLC((RefPicList)rpcSlice->getListIdFromIdxOfLC(i), rpcSlice->getRefIdxFromIdxOfLC(i), i); 2382 1982 } 2383 1983 } 2384 #if H0412_REF_PIC_LIST_RESTRICTION2385 1984 } 2386 1985 else … … 2388 1987 rpcSlice->setRefPicListModificationFlagLC(false); 2389 1988 } 2390 #endif2391 1989 } 2392 1990 else … … 2401 1999 } 2402 2000 2403 #if H0111_MVD_L1_ZERO2404 2001 if (rpcSlice->isInterB()) 2405 2002 { 2406 2003 READ_FLAG( uiCode, "mvd_l1_zero_flag" ); rpcSlice->setMvdL1ZeroFlag( (uiCode ? true : false) ); 2407 2004 } 2408 #endif2409 2005 2410 2006 #if CABAC_INIT_FLAG … … 2432 2028 rpcSlice->setSliceQp (26 + pps->getPicInitQPMinus26() + iCode); 2433 2029 2434 #if H0736_AVC_STYLE_QP_RANGE2435 2030 assert( rpcSlice->getSliceQp() >= -sps->getQpBDOffsetY() ); 2436 2031 assert( rpcSlice->getSliceQp() <= 51 ); 2437 #endif 2438 2439 #if DBL_CONTROL 2032 2440 2033 if (rpcSlice->getPPS()->getDeblockingFilterControlPresent()) 2441 2034 { … … 2447 2040 rpcSlice->setInheritDblParamFromAPS(0); 2448 2041 } 2449 #else2450 READ_FLAG ( uiCode, "inherit_dbl_param_from_APS_flag" ); rpcSlice->setInheritDblParamFromAPS(uiCode ? 1 : 0);2451 #endif2452 2042 if(!rpcSlice->getInheritDblParamFromAPS()) 2453 2043 { … … 2459 2049 } 2460 2050 } 2461 #if DBL_CONTROL2462 2051 } 2463 #endif2464 2052 if ( rpcSlice->getSliceType() == B_SLICE ) 2465 2053 { … … 2531 2119 2532 2120 Int uiNumCUsInFrame = uiNumLCUsInWidth* uiNumLCUsInHeight; 2533 #if LCU_SYNTAX_ALF2534 2121 if(sps->getUseALFCoefInSlice()) 2535 2122 { … … 2544 2131 if(!sps->getUseALFCoefInSlice()) 2545 2132 { 2546 #endif2547 2133 xParseAlfCuControlParam(alfCUCtrl, uiNumCUsInFrame); 2548 #if LCU_SYNTAX_ALF 2549 } 2550 #endif 2134 } 2551 2135 2552 2136 } … … 2557 2141 if (!bEntropySlice) 2558 2142 { 2559 #if !REMOVE_TILE_DEPENDENCE2560 if (sps->getTileBoundaryIndependenceIdr())2561 {2562 #endif2563 2143 xReadCode(1, uiCode); // read flag indicating if tile markers transmitted 2564 2144 rpcSlice->setTileMarkerFlag( uiCode ); 2565 #if !REMOVE_TILE_DEPENDENCE 2566 } 2567 #endif 2568 } 2569 2570 #if TILES_WPP_ENTRY_POINT_SIGNALLING 2145 } 2146 2571 2147 Int tilesOrEntropyCodingSyncIdc = rpcSlice->getSPS()->getTilesOrEntropyCodingSyncIdc(); 2572 2148 UInt *entryPointOffset = NULL; … … 2629 2205 delete [] entryPointOffset; 2630 2206 } 2631 #else2632 #if WPP_SIMPLIFICATION2633 if (pps->getNumSubstreams() > 1)2634 #else2635 if (pps->getEntropyCodingSynchro())2636 #endif2637 {2638 UInt uiNumSubstreams = pps->getNumSubstreams();2639 rpcSlice->allocSubstreamSizes(uiNumSubstreams);2640 UInt *puiSubstreamSizes = rpcSlice->getSubstreamSizes();2641 2642 for (UInt ui = 0; ui+1 < uiNumSubstreams; ui++)2643 {2644 xReadCode(2, uiCode);2645 2646 switch ( uiCode )2647 {2648 case 0:2649 xReadCode(8, uiCode);2650 break;2651 case 1:2652 xReadCode(16, uiCode);2653 break;2654 case 2:2655 xReadCode(24, uiCode);2656 break;2657 case 3:2658 xReadCode(32, uiCode);2659 break;2660 default:2661 printf("Error in parseSliceHeader\n");2662 exit(-1);2663 break;2664 }2665 puiSubstreamSizes[ui] = uiCode;2666 }2667 }2668 #endif2669 2207 2670 2208 if (!bEntropySlice) 2671 2209 { 2672 2210 // Reading location information 2673 #if !REMOVE_TILE_DEPENDENCE2674 if (sps->getTileBoundaryIndependenceIdr())2675 {2676 #endif2677 #if !TILES_WPP_ENTRY_POINT_SIGNALLING2678 xReadCode(1, uiCode); // read flag indicating if location information signaled in slice header2679 Bool bTileLocationInformationInSliceHeaderFlag = (uiCode)? true : false;2680 2681 if (bTileLocationInformationInSliceHeaderFlag)2682 {2683 // location count2684 xReadCode(5, uiCode); // number of tiles for which location information signaled2685 rpcSlice->setTileLocationCount ( uiCode + 1 );2686 2687 xReadCode(5, uiCode); // number of bits used by diff2688 Int iBitsUsedByDiff = uiCode + 1;2689 2690 // read out tile start location2691 Int iLastSize = 0;2692 for (UInt uiIdx=0; uiIdx<rpcSlice->getTileLocationCount(); uiIdx++)2693 {2694 Int iAbsDiff, iCurSize, iCurDiff;2695 if (uiIdx==0)2696 {2697 xReadCode(iBitsUsedByDiff-1, uiCode); iAbsDiff = uiCode;2698 rpcSlice->setTileLocation( uiIdx, iAbsDiff );2699 iCurDiff = iAbsDiff;2700 iLastSize = iAbsDiff;2701 }2702 else2703 {2704 xReadCode(1, uiCode); // read sign2705 Int iSign = (uiCode) ? -1 : +1;2706 2707 xReadCode(iBitsUsedByDiff-1, uiCode); iAbsDiff = uiCode;2708 iCurDiff = (iSign) * iAbsDiff;2709 iCurSize = iLastSize + iCurDiff;2710 iLastSize = iCurSize;2711 rpcSlice->setTileLocation( uiIdx, rpcSlice->getTileLocation( uiIdx-1 ) + iCurSize ); // calculate byte location2712 }2713 }2714 }2715 #endif2716 2211 2717 2212 // read out trailing bits 2718 2213 m_pcBitstream->readOutTrailingBits(); 2719 #if !REMOVE_TILE_DEPENDENCE2720 }2721 #endif2722 2214 } 2723 2215 return; … … 2814 2306 Void TDecCavlc::parseIPCMInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2815 2307 { 2816 #if BURST_IPCM2817 2308 assert(0); 2818 #else2819 UInt uiSymbol;2820 2821 xReadFlag( uiSymbol );2822 2823 if ( uiSymbol )2824 {2825 Bool bIpcmFlag = true;2826 2827 xReadPCMAlignZero();2828 2829 pcCU->setPartSizeSubParts ( SIZE_2Nx2N, uiAbsPartIdx, uiDepth );2830 pcCU->setSizeSubParts ( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth );2831 pcCU->setIPCMFlagSubParts ( bIpcmFlag, uiAbsPartIdx, uiDepth );2832 2833 UInt uiMinCoeffSize = pcCU->getPic()->getMinCUWidth()*pcCU->getPic()->getMinCUHeight();2834 UInt uiLumaOffset = uiMinCoeffSize*uiAbsPartIdx;2835 UInt uiChromaOffset = uiLumaOffset>>2;2836 2837 Pel* piPCMSample;2838 UInt uiWidth;2839 UInt uiHeight;2840 UInt uiSampleBits;2841 UInt uiX, uiY;2842 2843 piPCMSample = pcCU->getPCMSampleY() + uiLumaOffset;2844 uiWidth = pcCU->getWidth(uiAbsPartIdx);2845 uiHeight = pcCU->getHeight(uiAbsPartIdx);2846 uiSampleBits = pcCU->getSlice()->getSPS()->getPCMBitDepthLuma();2847 2848 for(uiY = 0; uiY < uiHeight; uiY++)2849 {2850 for(uiX = 0; uiX < uiWidth; uiX++)2851 {2852 UInt uiSample;2853 xReadCode(uiSampleBits, uiSample);2854 2855 piPCMSample[uiX] = uiSample;2856 }2857 piPCMSample += uiWidth;2858 }2859 2860 piPCMSample = pcCU->getPCMSampleCb() + uiChromaOffset;2861 uiWidth = pcCU->getWidth(uiAbsPartIdx)/2;2862 uiHeight = pcCU->getHeight(uiAbsPartIdx)/2;2863 uiSampleBits = pcCU->getSlice()->getSPS()->getPCMBitDepthChroma();2864 2865 for(uiY = 0; uiY < uiHeight; uiY++)2866 {2867 for(uiX = 0; uiX < uiWidth; uiX++)2868 {2869 UInt uiSample;2870 xReadCode(uiSampleBits, uiSample);2871 piPCMSample[uiX] = uiSample;2872 }2873 piPCMSample += uiWidth;2874 }2875 2876 piPCMSample = pcCU->getPCMSampleCr() + uiChromaOffset;2877 uiWidth = pcCU->getWidth(uiAbsPartIdx)/2;2878 uiHeight = pcCU->getHeight(uiAbsPartIdx)/2;2879 uiSampleBits = pcCU->getSlice()->getSPS()->getPCMBitDepthChroma();2880 2881 for(uiY = 0; uiY < uiHeight; uiY++)2882 {2883 for(uiX = 0; uiX < uiWidth; uiX++)2884 {2885 UInt uiSample;2886 xReadCode(uiSampleBits, uiSample);2887 piPCMSample[uiX] = uiSample;2888 }2889 piPCMSample += uiWidth;2890 }2891 }2892 #endif2893 2309 } 2894 2310 … … 2920 2336 Void TDecCavlc::parseDeltaQP( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2921 2337 { 2922 #if H0736_AVC_STYLE_QP_RANGE2923 2338 Int qp; 2924 #else2925 UInt uiQp;2926 #endif2927 2339 Int iDQp; 2928 2340 2929 2341 xReadSvlc( iDQp ); 2930 2342 2931 #if H0736_AVC_STYLE_QP_RANGE2932 2343 Int qpBdOffsetY = pcCU->getSlice()->getSPS()->getQpBDOffsetY(); 2933 2344 qp = (((Int) pcCU->getRefQP( uiAbsPartIdx ) + iDQp + 52 + 2*qpBdOffsetY )%(52+ qpBdOffsetY)) - qpBdOffsetY; 2934 #else2935 uiQp = pcCU->getRefQP( uiAbsPartIdx ) + iDQp;2936 #endif2937 2345 2938 2346 UInt uiAbsQpCUPartIdx = (uiAbsPartIdx>>(8-(pcCU->getSlice()->getPPS()->getMaxCuDQPDepth()<<1)))<<(8-(pcCU->getSlice()->getPPS()->getMaxCuDQPDepth()<<1)) ; 2939 2347 UInt uiQpCUDepth = min(uiDepth,pcCU->getSlice()->getPPS()->getMaxCuDQPDepth()) ; 2940 2348 2941 #if H0736_AVC_STYLE_QP_RANGE2942 2349 pcCU->setQPSubParts( qp, uiAbsQpCUPartIdx, uiQpCUDepth ); 2943 #else2944 pcCU->setQPSubParts( uiQp, uiAbsQpCUPartIdx, uiQpCUDepth );2945 #endif2946 2350 } 2947 2351 … … 3407 2811 READ_UVLC( code, "scaling_list_pred_matrix_id_delta"); 3408 2812 scalingList->setRefMatrixId (sizeId,listId,(UInt)((Int)(listId)-(code+1))); 3409 #if SCALING_LIST3410 2813 if( sizeId > SCALING_LIST_8x8 ) 3411 2814 { 3412 2815 scalingList->setScalingListDC(sizeId,listId,scalingList->getScalingListDC(sizeId, scalingList->getRefMatrixId (sizeId,listId))); 3413 2816 } 3414 #endif3415 2817 scalingList->processRefMatrix( sizeId, listId, scalingList->getRefMatrixId (sizeId,listId)); 3416 2818 … … 3433 2835 Void TDecCavlc::xDecodeScalingList(TComScalingList *scalingList, UInt sizeId, UInt listId) 3434 2836 { 3435 #if SCALING_LIST3436 2837 Int i,coefNum = min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId]); 3437 2838 Int data; … … 3473 2874 } 3474 2875 } 3475 #else3476 Int i,coefNum = g_scalingListSize[sizeId];3477 Int data;3478 Int nextCoef = SCALING_LIST_START_VALUE;3479 UInt* scan = g_auiFrameScanXY [ sizeId + 1 ];3480 Int *dst = scalingList->getScalingListAddress(sizeId, listId);3481 3482 for(i = 0; i < coefNum; i++)3483 {3484 READ_SVLC( data, "scaling_list_delta_coef");3485 nextCoef = (nextCoef + data + 256 ) % 256;3486 dst[scan[i]] = nextCoef;3487 }3488 #endif3489 2876 } 3490 2877 -
branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.h
r292 r294 82 82 UInt xGetBit (); 83 83 84 #if RPS_IN_SPS85 84 void parseShortTermRefPicSet (TComSPS* pcSPS, TComReferencePictureSet* pcRPS, Int idx); 86 #else87 void parseShortTermRefPicSet (TComPPS* pcPPS, TComReferencePictureSet* pcRPS, Int idx);88 #endif89 85 private: 90 86 TComInputBitstream* m_pcBitstream; … … 123 119 Void parseSPS ( TComSPS* pcSPS ); 124 120 #endif 125 #if TILES_OR_ENTROPY_SYNC_IDC126 121 Void parsePPS ( TComPPS* pcPPS, ParameterSetManagerDecoder *parameterSet); 127 #else128 Void parsePPS ( TComPPS* pcPPS);129 #endif130 122 Void parseSEI(SEImessages&); 131 123 Void parseAPS ( TComAPS* pAPS ); 132 #if LCU_SYNTAX_ALF133 124 #if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137 134 125 Void parseSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet, bool isDepth); 135 126 #else 136 127 Void parseSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet); 137 #endif138 #else139 Void parseSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl );140 128 #endif 141 129 Void parseTerminatingBit ( UInt& ruiBit ); … … 175 163 Void readTileMarker ( UInt& uiTileIdx, UInt uiBitsUsed ); 176 164 Void updateContextTables ( SliceType eSliceType, Int iQp ) { return; } 177 #if OL_FLUSH178 165 Void decodeFlush() {}; 179 #endif180 166 181 167 Void xParsePredWeightTable ( TComSlice* pcSlice ); … … 190 176 #endif 191 177 protected: 192 #if DBL_CONTROL193 178 Void xParseDblParam ( TComAPS* aps ); 194 #endif195 179 Void xParseSaoParam ( SAOParam* pSaoParam ); 196 #if SAO_UNIT_INTERLEAVING197 180 Void xParseSaoOffset (SaoLcuParam* saoLcuParam); 198 181 Void xParseSaoUnit (Int rx, Int ry, Int compIdx, SAOParam* saoParam, Bool& repeatedRow ); 199 #else200 Void xParseSaoSplitParam ( SAOParam* pSaoParam, Int iPartIdx, Int iYCbCr );201 Void xParseSaoOffsetParam ( SAOParam* pSaoParam, Int iPartIdx, Int iYCbCr );202 #endif203 #if LCU_SYNTAX_ALF204 182 Void xParseAlfParam(AlfParamSet* pAlfParamSet, Bool bSentInAPS = true, Int firstLCUAddr = 0, Bool acrossSlice = true, Int numLCUInWidth= -1, Int numLCUInHeight= -1); 205 183 Void parseAlfParamSet(AlfParamSet* pAlfParamSet, Int firstLCUAddr, Bool alfAcrossSlice); 206 184 Void parseAlfFixedLengthRun(UInt& idx, UInt rx, UInt numLCUInWidth); 207 185 Void parseAlfStoredFilterIdx(UInt& idx, UInt numFilterSetsInBuffer); 208 #endif209 186 Void xParseAlfParam ( ALFParam* pAlfParam ); 210 187 Void xParseAlfCuControlParam(AlfCUCtrlInfo& cAlfParam, Int iNumCUsInPic); -
branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecCu.cpp
r292 r294 148 148 } 149 149 150 #if BURST_IPCM151 150 pcCU->setNumSucIPCM(0); 152 #endif153 151 154 152 // start from the top level CU … … 240 238 if((!bStartInCU) && ( uiRPelX < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( uiBPelY < pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 241 239 { 242 #if BURST_IPCM243 240 if(pcCU->getNumSucIPCM() == 0) 244 241 { … … 252 249 pcCU->setDepthSubParts( uiDepth, uiAbsPartIdx ); 253 250 } 254 #else255 #if HHI_MPI256 if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 || uiDepth < pcCU->getTextureModeDepth( uiAbsPartIdx ) )257 #endif258 m_pcEntropyDecoder->decodeSplitFlag( pcCU, uiAbsPartIdx, uiDepth );259 #endif260 251 } 261 252 else … … 323 314 324 315 // decode CU mode and the partition size 325 #if BURST_IPCM326 316 if( !pcCU->getSlice()->isIntra() && pcCU->getNumSucIPCM() == 0 ) 327 #else328 if( !pcCU->getSlice()->isIntra() )329 #endif330 317 #if HHI_MPI 331 318 if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 ) … … 382 369 { 383 370 #endif 384 #if SIMP_MRG_PRUN385 371 UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx); 386 372 #if MERL_VSP_C0152 … … 404 390 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 405 391 #endif 406 #else407 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );408 UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx);409 #endif410 392 pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); 411 393 … … 438 420 { 439 421 #endif 440 #if BURST_IPCM441 422 if( pcCU->getNumSucIPCM() == 0 ) 442 423 { … … 451 432 pcCU->setTrIdxSubParts( 0, uiAbsPartIdx, uiDepth ); 452 433 } 453 #else454 m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth );455 m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth );456 #endif457 434 458 435 if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) … … 592 569 } 593 570 594 #if BURST_IPCM595 571 if( pcCU->getNumSucIPCM() > 0 ) 596 572 { … … 598 574 return; 599 575 } 600 #endif601 576 602 577 ruiIsLast = xDecodeSliceEnd( pcCU, uiAbsPartIdx, uiDepth); … … 820 795 821 796 //===== inverse transform ===== 822 #if H0736_AVC_STYLE_QP_RANGE823 797 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 ); 824 #else825 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA, 0 );826 #endif827 798 828 799 Int scalingListType = (pcCU->isIntra(uiAbsPartIdx) ? 0 : 3) + g_eTTable[(Int)TEXT_LUMA]; … … 940 911 if(eText == TEXT_CHROMA_U) 941 912 { 942 #if H0736_AVC_STYLE_QP_RANGE943 913 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), eText, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), pcCU->getSlice()->getPPS()->getChromaQpOffset() ); 944 #else945 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), eText, pcCU->getSlice()->getPPS()->getChromaQpOffset() );946 #endif947 914 } 948 915 else 949 916 { 950 #if H0736_AVC_STYLE_QP_RANGE951 917 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), eText, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), pcCU->getSlice()->getPPS()->getChromaQpOffset2nd() ); 952 #else953 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), eText, pcCU->getSlice()->getPPS()->getChromaQpOffset2nd() );954 #endif955 918 } 956 919 … … 1252 1215 pResi = m_ppcYuvResi[uiDepth]->getLumaAddr(); 1253 1216 1254 #if H0736_AVC_STYLE_QP_RANGE1255 1217 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 ); 1256 #else1257 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA, 0 );1258 #endif1259 1218 1260 1219 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_LUMA, pResi, 0, m_ppcYuvResi[uiDepth]->getStride(), uiWidth, uiHeight, uiLumaTrMode, 0, piCoeff ); 1261 1220 1262 1221 // Cb and Cr 1263 #if H0736_AVC_STYLE_QP_RANGE1264 1222 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), pcCU->getSlice()->getPPS()->getChromaQpOffset() ); 1265 #else1266 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA, pcCU->getSlice()->getPPS()->getChromaQpOffset() );1267 #endif1268 1223 1269 1224 uiWidth >>= 1; … … 1272 1227 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_CHROMA_U, pResi, 0, m_ppcYuvResi[uiDepth]->getCStride(), uiWidth, uiHeight, uiChromaTrMode, 0, piCoeff ); 1273 1228 1274 #if H0736_AVC_STYLE_QP_RANGE1275 1229 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), pcCU->getSlice()->getPPS()->getChromaQpOffset2nd() ); 1276 #else1277 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA, pcCU->getSlice()->getPPS()->getChromaQpOffset2nd() );1278 #endif1279 1230 1280 1231 piCoeff = pcCU->getCoeffCr(); pResi = m_ppcYuvResi[uiDepth]->getCrAddr(); -
branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp
r292 r294 330 330 else 331 331 { 332 #if SIMP_MRG_PRUN333 332 uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 334 333 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 335 #else336 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );337 uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);338 #endif339 334 } 340 335 #else 341 #if SIMP_MRG_PRUN342 336 UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 343 337 #if MERL_VSP_C0152 … … 375 369 #else 376 370 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 377 #endif378 #else379 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );380 UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);381 371 #endif 382 372 #endif … … 547 537 } 548 538 549 #if UNIFIED_TRANSFORM_TREE550 539 Void TDecEntropy::xDecodeTransform( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt absTUPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, UInt uiInnerQuadIdx, UInt& uiYCbfFront3, UInt& uiUCbfFront3, UInt& uiVCbfFront3, Bool& bCodeDQP ) 551 #else552 Void TDecEntropy::xDecodeTransformSubdiv( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt absTUPartIdx, UInt uiDepth, UInt uiInnerQuadIdx, UInt& uiYCbfFront3, UInt& uiUCbfFront3, UInt& uiVCbfFront3 )553 #endif554 540 { 555 541 UInt uiSubdiv; 556 542 const UInt uiLog2TrafoSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()]+2 - uiDepth; 557 543 558 #if UNIFIED_TRANSFORM_TREE559 544 if(uiTrIdx==0) 560 545 { … … 570 555 } 571 556 } 572 #endif // UNIFIED_TRANSFORM_TREE573 557 if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTRA && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_NxN && uiDepth == pcCU->getDepth(uiAbsPartIdx) ) 574 558 { 575 559 uiSubdiv = 1; 576 560 } 577 #if G519_TU_AMP_NSQT_HARMONIZATION578 561 else if( (pcCU->getSlice()->getSPS()->getQuadtreeTUMaxDepthInter() == 1) && (pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER) && ( pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N ) && (uiDepth == pcCU->getDepth(uiAbsPartIdx)) ) 579 #else580 else if( (pcCU->getSlice()->getSPS()->getQuadtreeTUMaxDepthInter() == 1) && (pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER) && ( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) && (uiDepth == pcCU->getDepth(uiAbsPartIdx)) )581 #endif582 562 { 583 563 uiSubdiv = (uiLog2TrafoSize > pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx)); … … 656 636 if( uiSubdiv ) 657 637 { 658 #if UNIFIED_TRANSFORM_TREE659 638 UInt size; 660 639 width >>= 1; … … 662 641 size = width*height; 663 642 uiTrIdx++; 664 #endif665 643 ++uiDepth; 666 644 const UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); … … 678 656 for( Int i = 0; i < 4; i++ ) 679 657 { 680 #if UNIFIED_TRANSFORM_TREE681 658 UInt nsAddr = 0; 682 659 nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, i, uiTrDepth+1 ); 683 660 xDecodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, nsAddr, uiDepth, width, height, uiTrIdx, i, uiCurrentCbfY, uiCurrentCbfU, uiCurrentCbfV, bCodeDQP ); 684 #else685 UInt nsAddr = 0;686 nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, i, uiTrDepth+1 );687 xDecodeTransformSubdiv( pcCU, uiAbsPartIdx, nsAddr, uiDepth, i, uiCurrentCbfY, uiCurrentCbfU, uiCurrentCbfV );688 #endif689 661 uiYCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiLumaTrMode ); 690 662 uiUCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiChromaTrMode ); 691 663 uiVCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiChromaTrMode ); 692 664 uiAbsPartIdx += uiQPartNum; 693 #if UNIFIED_TRANSFORM_TREE694 665 offsetLuma += size; offsetChroma += (size>>2); 695 #endif696 666 } 697 667 … … 751 721 } 752 722 } 753 #if UNIFIED_TRANSFORM_TREE754 723 // transform_unit begin 755 724 UInt cbfY = pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA , uiTrIdx ); … … 817 786 } 818 787 // transform_unit end 819 #endif // UNIFIED_TRANSFORM_TREE 820 } 821 } 822 823 #if !UNIFIED_TRANSFORM_TREE 824 Void TDecEntropy::decodeTransformIdx( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 825 { 826 DTRACE_CABAC_VL( g_nSymbolCounter++ ) 827 DTRACE_CABAC_T( "\tdecodeTransformIdx()\tCUDepth=" ) 828 DTRACE_CABAC_V( uiDepth ) 829 DTRACE_CABAC_T( "\n" ) 830 UInt temp = 0; 831 UInt temp1 = 0; 832 UInt temp2 = 0; 833 xDecodeTransformSubdiv( pcCU, uiAbsPartIdx, uiAbsPartIdx, uiDepth, 0, temp, temp1, temp2 ); 834 } 835 #endif // UNIFIED_TRANSFORM_TREE 836 837 #if UNIFIED_TRANSFORM_TREE 788 } 789 } 790 791 838 792 Void TDecEntropy::decodeQP ( TComDataCU* pcCU, UInt uiAbsPartIdx ) 839 793 { … … 843 797 } 844 798 } 845 #else 846 Void TDecEntropy::decodeQP ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 847 { 848 if ( pcCU->getSlice()->getPPS()->getUseDQP() ) 849 { 850 m_pcEntropyDecoderIf->parseDeltaQP( pcCU, uiAbsPartIdx, uiDepth ); 851 } 852 } 853 #endif 854 855 #if !UNIFIED_TRANSFORM_TREE 856 Void TDecEntropy::xDecodeCoeff( TComDataCU* pcCU, UInt uiLumaOffset, UInt uiChromaOffset, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, UInt uiTrIdx, UInt uiCurrTrIdx, Bool& bCodeDQP ) 857 { 858 UInt uiLog2TrSize = g_aucConvertToBit[ pcCU->getSlice()->getSPS()->getMaxCUWidth() >> uiDepth ] + 2; 859 UInt uiCbfY = pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrIdx ); 860 UInt uiCbfU = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ); 861 UInt uiCbfV = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ); 862 if( uiLog2TrSize == 2 ) 863 { 864 UInt uiQPDiv = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 ); 865 if( ( uiAbsPartIdx % uiQPDiv ) == 0 ) 866 { 867 m_uiBakAbsPartIdx = uiAbsPartIdx; 868 m_uiBakChromaOffset = uiChromaOffset; 869 } 870 else if( ( uiAbsPartIdx % uiQPDiv ) == (uiQPDiv - 1) ) 871 { 872 uiCbfU = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ); 873 uiCbfV = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ); 874 } 875 } 876 877 if ( uiCbfY || uiCbfU || uiCbfV ) 878 { 879 // dQP: only for LCU 880 if ( pcCU->getSlice()->getPPS()->getUseDQP() ) 881 { 882 if ( bCodeDQP ) 883 { 884 decodeQP( pcCU, uiAbsPartIdx, uiDepth); 885 bCodeDQP = false; 886 } 887 } 888 UInt uiLumaTrMode, uiChromaTrMode; 889 pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx( uiAbsPartIdx ), uiLumaTrMode, uiChromaTrMode ); 890 const UInt uiStopTrMode = uiLumaTrMode; 891 892 if( uiTrIdx == uiStopTrMode ) 893 { 894 if( pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrIdx ) ) 895 { 896 Int trWidth = uiWidth; 897 Int trHeight = uiHeight; 898 pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight ); 899 m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffY()+uiLumaOffset), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_LUMA ); 900 } 901 902 uiWidth >>= 1; 903 uiHeight >>= 1; 904 905 if( uiLog2TrSize == 2 ) 906 { 907 UInt uiQPDiv = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 ); 908 if( ( uiAbsPartIdx % uiQPDiv ) == (uiQPDiv - 1) ) 909 { 910 uiWidth <<= 1; 911 uiHeight <<= 1; 912 Int trWidth = uiWidth; 913 Int trHeight = uiHeight; 914 pcCU->getNSQTSize( uiTrIdx-1, uiAbsPartIdx, trWidth, trHeight ); 915 if( pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ) ) 916 { 917 m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCb()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U ); 918 } 919 if( pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ) ) 920 { 921 m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCr()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V ); 922 } 923 } 924 } 925 else 926 { 927 Int trWidth = uiWidth; 928 Int trHeight = uiHeight; 929 pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight ); 930 if( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ) ) 931 { 932 m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCb()+uiChromaOffset), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U ); 933 } 934 if( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ) ) 935 { 936 m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffCr()+uiChromaOffset), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V ); 937 } 938 } 939 } 940 else 941 { 942 { 943 DTRACE_CABAC_VL( g_nSymbolCounter++ ); 944 DTRACE_CABAC_T( "\tgoing down\tdepth=" ); 945 DTRACE_CABAC_V( uiDepth ); 946 DTRACE_CABAC_T( "\ttridx=" ); 947 DTRACE_CABAC_V( uiTrIdx ); 948 DTRACE_CABAC_T( "\n" ); 949 } 950 if( uiCurrTrIdx <= uiTrIdx ) 951 { 952 assert(1); 953 } 954 UInt uiSize; 955 uiWidth >>= 1; 956 uiHeight >>= 1; 957 uiSize = uiWidth*uiHeight; 958 uiDepth++; 959 uiTrIdx++; 960 961 UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); 962 UInt uiIdx = uiAbsPartIdx; 963 964 xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP ); 965 uiLumaOffset += uiSize; uiChromaOffset += (uiSize>>2); uiIdx += uiQPartNum; 966 967 xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP ); 968 uiLumaOffset += uiSize; uiChromaOffset += (uiSize>>2); uiIdx += uiQPartNum; 969 970 xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP ); 971 uiLumaOffset += uiSize; uiChromaOffset += (uiSize>>2); uiIdx += uiQPartNum; 972 973 xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP ); 974 { 975 DTRACE_CABAC_VL( g_nSymbolCounter++ ); 976 DTRACE_CABAC_T( "\tgoing up\n" ); 977 } 978 } 979 } 980 } 981 #endif // !UNIFIED_TRANSFORM_TREE 799 982 800 983 801 /** decode coefficients … … 994 812 UInt uiLumaOffset = uiMinCoeffSize*uiAbsPartIdx; 995 813 UInt uiChromaOffset = uiLumaOffset>>2; 996 #if UNIFIED_TRANSFORM_TREE997 814 UInt temp = 0; 998 815 UInt temp1 = 0; 999 816 UInt temp2 = 0; 1000 #else1001 UInt uiLumaTrMode, uiChromaTrMode;1002 #endif1003 817 1004 818 #if RWTH_SDC_DLT_B0036 … … 1018 832 if( pcCU->isIntra(uiAbsPartIdx) ) 1019 833 { 1020 #if !UNIFIED_TRANSFORM_TREE1021 decodeTransformIdx( pcCU, uiAbsPartIdx, pcCU->getDepth(uiAbsPartIdx) );1022 1023 pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx(uiAbsPartIdx), uiLumaTrMode, uiChromaTrMode );1024 1025 #endif // !UNIFIED_TRANSFORM_TREE1026 834 } 1027 835 else … … 1045 853 } 1046 854 1047 #if !UNIFIED_TRANSFORM_TREE1048 decodeTransformIdx( pcCU, uiAbsPartIdx, pcCU->getDepth(uiAbsPartIdx) );1049 1050 pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx(uiAbsPartIdx), uiLumaTrMode, uiChromaTrMode );1051 #endif // !UNIFIED_TRANSFORM_TREE1052 855 } 1053 856 … … 1068 871 #endif 1069 872 1070 #if UNIFIED_TRANSFORM_TREE1071 873 xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, 0, temp, temp1, temp2, bCodeDQP ); 1072 #else // UNIFIED_TRANSFORM_TREE1073 xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, uiLumaTrMode, bCodeDQP );1074 #endif // UNIFIED_TRANSFORM_TREE1075 874 1076 875 #if FIX_MPI_B0065 -
branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecEntropy.h
r292 r294 67 67 virtual Void setBitstream ( TComInputBitstream* p ) = 0; 68 68 69 #if OL_FLUSH70 69 virtual Void decodeFlush() = 0; 71 #endif72 70 73 71 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 … … 79 77 virtual Void parseSPS ( TComSPS* pcSPS ) = 0; 80 78 #endif 81 #if TILES_OR_ENTROPY_SYNC_IDC82 79 virtual Void parsePPS ( TComPPS* pcPPS, ParameterSetManagerDecoder *parameterSet ) = 0; 83 #else84 virtual Void parsePPS ( TComPPS* pcPPS ) = 0;85 #endif86 80 virtual Void parseAPS ( TComAPS* pAPS ) = 0; 87 81 virtual void parseSEI(SEImessages&) = 0; 88 82 89 #if LCU_SYNTAX_ALF90 83 #if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137 91 84 virtual Void parseSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet, bool isDepth) = 0; 92 85 #else 93 86 virtual Void parseSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet) = 0; 94 #endif95 #else96 virtual Void parseSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl ) = 0;97 87 #endif 98 88 … … 163 153 UInt m_uiBakAbsPartIdx; 164 154 UInt m_uiBakChromaOffset; 165 #if UNIFIED_TRANSFORM_TREE166 155 UInt m_bakAbsPartIdxCU; 167 #endif168 156 169 157 public: … … 188 176 Void decodeSPS ( TComSPS* pcSPS ) { m_pcEntropyDecoderIf->parseSPS(pcSPS); } 189 177 #endif 190 #if TILES_OR_ENTROPY_SYNC_IDC191 178 Void decodePPS ( TComPPS* pcPPS, ParameterSetManagerDecoder *parameterSet ) { m_pcEntropyDecoderIf->parsePPS(pcPPS, parameterSet); } 192 #else193 Void decodePPS ( TComPPS* pcPPS ) { m_pcEntropyDecoderIf->parsePPS(pcPPS); }194 #endif195 179 Void decodeAPS ( TComAPS* pAPS ) { m_pcEntropyDecoderIf->parseAPS(pAPS);} 196 180 void decodeSEI(SEImessages& seis) { m_pcEntropyDecoderIf->parseSEI(seis); } 197 181 198 #if LCU_SYNTAX_ALF199 182 #if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137 200 183 Void decodeSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet, bool isDepth) { m_pcEntropyDecoderIf->parseSliceHeader(rpcSlice, parameterSetManager, alfCUCtrl, alfParamSet, isDepth); } 201 184 #else 202 185 Void decodeSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet) { m_pcEntropyDecoderIf->parseSliceHeader(rpcSlice, parameterSetManager, alfCUCtrl, alfParamSet); } 203 #endif204 #else205 Void decodeSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl ) { m_pcEntropyDecoderIf->parseSliceHeader(rpcSlice, parameterSetManager, alfCUCtrl); }206 186 #endif 207 187 … … 231 211 Void decodeIntraDirModeChroma( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 232 212 233 #if !UNIFIED_TRANSFORM_TREE234 Void decodeTransformIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );235 #endif236 #if UNIFIED_TRANSFORM_TREE237 213 Void decodeQP ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 238 #else239 Void decodeQP ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );240 #endif241 214 242 215 Void readTileMarker ( UInt& uiTileIdx, UInt uiBitsUsed ) { m_pcEntropyDecoderIf->readTileMarker( uiTileIdx, uiBitsUsed ); } … … 245 218 246 219 private: 247 #if UNIFIED_TRANSFORM_TREE248 220 Void xDecodeTransform ( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt absTUPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, UInt uiInnerQuadIdx, UInt& uiYCbfFront3, UInt& uiUCbfFront3, UInt& uiVCbfFront3, Bool& bCodeDQP ); 249 #else250 Void xDecodeTransformSubdiv ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt absTUPartIdx, UInt uiDepth, UInt uiInnerQuadIdx, UInt& uiYCbfFront3, UInt& uiUCbfFront3, UInt& uiVCbfFront3 );251 252 Void xDecodeCoeff ( TComDataCU* pcCU, UInt uiLumaOffset, UInt uiChromaOffset, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, UInt uiTrIdx, UInt uiCurrTrIdx, Bool& bCodeDQP );253 #endif //UNIFIED_TRANSFORM_TREE254 221 255 222 public: … … 261 228 Void setSliceGranularity (Int iSliceGranularity) {m_pcEntropyDecoderIf->setSliceGranularity(iSliceGranularity);} 262 229 263 #if SAO_UNIT_INTERLEAVING264 230 Void decodeSaoParam (SAOParam* saoParam); 265 231 void decodeSaoLcu(Int rx, Int ry, Int compIdx, SAOParam* saoParam, Bool &repeatedRow ); 266 232 Void decodeSaoOneLcu(SaoLcuParam* saoLcuParam); 267 #endif 268 269 #if OL_FLUSH 233 270 234 Void decodeFlush() { m_pcEntropyDecoderIf->decodeFlush(); } 271 #endif272 235 273 236 #if RWTH_SDC_DLT_B0036 -
branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecGop.cpp
r289 r294 79 79 Void TDecGop::destroy() 80 80 { 81 #if LCU_SYNTAX_ALF82 81 m_alfParamSetPilot.releaseALFParam(); 83 #endif84 82 } 85 83 … … 120 118 // Private member functions 121 119 // ==================================================================================================================== 122 #if LCU_SYNTAX_ALF123 120 Void TDecGop::patchAlfLCUParams(ALFParam*** alfLCUParam, AlfParamSet* alfParamSet, Int firstLCUAddr) 124 121 { … … 195 192 } 196 193 197 #endif198 194 // ==================================================================================================================== 199 195 // Public member functions … … 279 275 if(pcSlice->getAlfEnabledFlag()) 280 276 { 281 #if LCU_SYNTAX_ALF282 277 if(pcSlice->getSPS()->getUseALFCoefInSlice()) 283 278 { … … 289 284 if( !pcSlice->getSPS()->getUseALFCoefInSlice()) 290 285 { 291 #endif292 286 m_vAlfCUCtrlSlices.push_back(m_cAlfCUCtrlOneSlice); 293 #if LCU_SYNTAX_ALF294 287 } 295 #endif296 288 } 297 289 } … … 323 315 m_pcSliceDecoder->decompressSlice( pcBitstream, ppcSubstreams, rpcPic, m_pcSbacDecoder, m_pcSbacDecoders); 324 316 m_pcEntropyDecoder->setBitstream( ppcSubstreams[uiNumSubstreams-1] ); 325 #if WPP_SIMPLIFICATION326 317 if ( uiNumSubstreams > 1 ) 327 #else328 if ( pcSlice->getPPS()->getEntropyCodingSynchro() )329 #endif330 318 { 331 319 // deallocate all created substreams, including internal buffers. … … 356 344 Bool bLFCrossTileBoundary = (pcSlice->getPPS()->getTileBehaviorControlPresentFlag() == 1)? 357 345 (pcSlice->getPPS()->getLFCrossTileBoundaryFlag()):(pcSlice->getPPS()->getSPS()->getLFCrossTileBoundaryFlag()); 358 #if DBL_CONTROL359 346 if (pcSlice->getPPS()->getDeblockingFilterControlPresent()) 360 347 { 361 #endif362 348 if(pcSlice->getSPS()->getUseDF()) 363 349 { … … 372 358 } 373 359 } 374 #if DBL_CONTROL375 360 } 376 361 m_pcLoopFilter->setCfg(pcSlice->getPPS()->getDeblockingFilterControlPresent(), pcSlice->getLoopFilterDisable(), pcSlice->getLoopFilterBetaOffset(), pcSlice->getLoopFilterTcOffset(), bLFCrossTileBoundary); 377 #else378 m_pcLoopFilter->setCfg(pcSlice->getLoopFilterDisable(), pcSlice->getLoopFilterBetaOffset(), pcSlice->getLoopFilterTcOffset(), bLFCrossTileBoundary);379 #endif380 362 m_pcLoopFilter->loopFilterPic( rpcPic ); 381 363 … … 392 374 if(pcSlice->getSaoEnabledFlag()) 393 375 { 394 #if SAO_UNIT_INTERLEAVING395 376 if (pcSlice->getSaoInterleavingFlag()) 396 377 { … … 402 383 } 403 384 m_pcSAO->setSaoInterleavingFlag(pcSlice->getAPS()->getSaoInterleavingFlag()); 404 #endif405 385 m_pcSAO->createPicSaoInfo(rpcPic, m_uiILSliceCount); 406 386 m_pcSAO->SAOProcess(rpcPic, pcSlice->getAPS()->getSaoParam()); … … 413 393 if( pcSlice->getSPS()->getUseALF() ) 414 394 { 415 #if LCU_SYNTAX_ALF416 395 if( (pcSlice->getSPS()->getUseALFCoefInSlice())?(true):(pcSlice->getAlfEnabledFlag())) 417 #else 418 if(pcSlice->getAlfEnabledFlag()) 419 #endif 420 { 421 422 #if LCU_SYNTAX_ALF 396 { 397 423 398 if(!pcSlice->getSPS()->getUseALFCoefInSlice()) 424 399 { … … 427 402 m_pcAdaptiveLoopFilter->createPicAlfInfo(rpcPic, m_uiILSliceCount, pcSlice->getSliceQp()); 428 403 m_pcAdaptiveLoopFilter->ALFProcess(rpcPic, m_vAlfCUCtrlSlices, pcSlice->getSPS()->getUseALFCoefInSlice()); 429 #else430 m_pcAdaptiveLoopFilter->createPicAlfInfo(rpcPic, m_uiILSliceCount);431 m_pcAdaptiveLoopFilter->ALFProcess(rpcPic, pcSlice->getAPS()->getAlfParam(), m_vAlfCUCtrlSlices);432 #endif433 404 m_pcAdaptiveLoopFilter->PCMLFDisableProcess(rpcPic); 434 405 m_pcAdaptiveLoopFilter->destroyPicAlfInfo(); 435 406 } 436 #if LCU_SYNTAX_ALF437 407 m_pcAdaptiveLoopFilter->resetLCUAlfInfo(); //reset all LCU ALFParam->alf_flag = 0 438 #endif439 408 } 440 409 -
branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecGop.h
r56 r294 101 101 bool m_pictureDigestEnabled; ///< if true, handle picture_digest SEI messages 102 102 AlfCUCtrlInfo m_cAlfCUCtrlOneSlice; 103 #if LCU_SYNTAX_ALF104 103 AlfParamSet m_alfParamSetPilot; 105 #endif106 104 107 105 public: … … 131 129 void setPictureDigestEnabled(bool enabled) { m_pictureDigestEnabled = enabled; } 132 130 AlfCUCtrlInfo& getAlfCuCtrlParam() { return m_cAlfCUCtrlOneSlice; } 133 #if LCU_SYNTAX_ALF134 131 AlfParamSet& getAlfParamSet() {return m_alfParamSetPilot;} 135 #endif136 132 137 133 private: 138 #if LCU_SYNTAX_ALF139 134 Void patchAlfLCUParams(ALFParam*** alfLCUParam, AlfParamSet* alfParamSet, Int firstLCUAddr = 0); 140 #endif141 135 142 136 -
branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecSbac.cpp
r292 r294 87 87 , m_cALFUvlcSCModel ( 1, 1, NUM_ALF_UVLC_CTX , m_contextModels + m_numContextModels, m_numContextModels) 88 88 , m_cALFSvlcSCModel ( 1, 1, NUM_ALF_SVLC_CTX , m_contextModels + m_numContextModels, m_numContextModels) 89 #if AMP_CTX90 89 , m_cCUAMPSCModel ( 1, 1, NUM_CU_AMP_CTX , m_contextModels + m_numContextModels, m_numContextModels) 91 #else92 , m_cCUXPosiSCModel ( 1, 1, NUM_CU_X_POS_CTX , m_contextModels + m_numContextModels, m_numContextModels)93 , m_cCUYPosiSCModel ( 1, 1, NUM_CU_Y_POS_CTX , m_contextModels + m_numContextModels, m_numContextModels)94 #endif95 90 , m_cSaoFlagSCModel ( 1, 1, NUM_SAO_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 96 91 , m_cSaoUvlcSCModel ( 1, 1, NUM_SAO_UVLC_CTX , m_contextModels + m_numContextModels, m_numContextModels) 97 92 , m_cSaoSvlcSCModel ( 1, 1, NUM_SAO_SVLC_CTX , m_contextModels + m_numContextModels, m_numContextModels) 98 #if SAO_UNIT_INTERLEAVING99 93 , m_cSaoMergeLeftSCModel ( 1, 1, NUM_SAO_MERGE_LEFT_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 100 94 , m_cSaoMergeUpSCModel ( 1, 1, NUM_SAO_MERGE_UP_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 101 95 , m_cSaoTypeIdxSCModel ( 1, 1, NUM_SAO_TYPE_IDX_CTX , m_contextModels + m_numContextModels, m_numContextModels) 102 #endif103 96 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 104 97 , m_cDmmFlagSCModel ( 1, 1, NUM_DMM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 171 164 m_cCUAlfCtrlFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_ALF_CTRL_FLAG ); 172 165 m_cCUPartSizeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_PART_SIZE ); 173 #if AMP_CTX174 166 m_cCUAMPSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_CU_AMP_POS ); 175 #else176 m_cCUXPosiSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_CU_X_POS );177 m_cCUYPosiSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_CU_Y_POS );178 #endif179 167 m_cCUPredModeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_PRED_MODE ); 180 168 m_cCUIntraPredSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTRA_PRED_MODE ); … … 199 187 m_cSaoUvlcSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SAO_UVLC ); 200 188 m_cSaoSvlcSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SAO_SVLC ); 201 #if SAO_UNIT_INTERLEAVING202 189 m_cSaoMergeLeftSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SAO_MERGE_LEFT_FLAG ); 203 190 m_cSaoMergeUpSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SAO_MERGE_UP_FLAG ); 204 191 m_cSaoTypeIdxSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SAO_TYPE_IDX ); 205 #endif206 192 207 193 m_cCUTransSubdivFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_TRANS_SUBDIV_FLAG ); … … 265 251 m_cCUAlfCtrlFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ALF_CTRL_FLAG ); 266 252 m_cCUPartSizeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_PART_SIZE ); 267 #if AMP_CTX268 253 m_cCUAMPSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_CU_AMP_POS ); 269 #else270 m_cCUXPosiSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_CU_X_POS );271 m_cCUYPosiSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_CU_Y_POS );272 #endif273 254 m_cCUPredModeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_PRED_MODE ); 274 255 m_cCUIntraPredSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTRA_PRED_MODE ); … … 293 274 m_cSaoUvlcSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_UVLC ); 294 275 m_cSaoSvlcSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_SVLC ); 295 #if SAO_UNIT_INTERLEAVING296 276 m_cSaoMergeLeftSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_MERGE_LEFT_FLAG ); 297 277 m_cSaoMergeUpSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_MERGE_UP_FLAG ); 298 278 m_cSaoTypeIdxSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_TYPE_IDX ); 299 #endif300 279 m_cCUTransSubdivFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_TRANS_SUBDIV_FLAG ); 301 280 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX … … 449 428 } 450 429 451 #if EIGHT_BITS_RICE_CODE452 430 ruiGoRiceParam = g_aauiGoRiceUpdate[ ruiGoRiceParam ][ min<UInt>( ruiSymbol, 23 ) ]; 453 #else454 ruiGoRiceParam = g_aauiGoRiceUpdate[ ruiGoRiceParam ][ min<UInt>( ruiSymbol, 15 ) ];455 #endif456 431 457 432 return; … … 470 445 { 471 446 UInt uiSymbol; 472 #if BURST_IPCM473 447 Int numSubseqIPCM = 0; 474 448 Bool readPCMSampleFlag = false; … … 490 464 } 491 465 } 492 #else 493 m_pcTDecBinIf->decodeBinTrm(uiSymbol); 494 #endif 495 496 #if BURST_IPCM 466 497 467 if (readPCMSampleFlag == true) 498 #else499 if (uiSymbol)500 #endif501 468 { 502 469 Bool bIpcmFlag = true; 503 470 504 #if !BURST_IPCM505 m_pcTDecBinIf->decodePCMAlignBits();506 #endif507 471 508 472 pcCU->setPartSizeSubParts ( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); … … 568 532 } 569 533 570 #if BURST_IPCM571 534 pcCU->setNumSucIPCM( pcCU->getNumSucIPCM() - 1); 572 535 if(pcCU->getNumSucIPCM() == 0) … … 574 537 m_pcTDecBinIf->resetBac(); 575 538 } 576 #else577 m_pcTDecBinIf->resetBac();578 #endif579 539 } 580 540 } … … 664 624 { 665 625 UInt uiNumCand = MRG_MAX_NUM_CANDS; 666 #if !MRG_IDX_CTX_RED667 UInt auiCtx[4] = { 0, 1, 2, 3 };668 #endif669 626 UInt uiUnaryIdx = 0; 670 627 uiNumCand = pcCU->getSlice()->getMaxNumMergeCand(); … … 678 635 { 679 636 UInt uiSymbol = 0; 680 #if MRG_IDX_CTX_RED681 637 if ( uiUnaryIdx==0 ) 682 638 { … … 687 643 m_pcTDecBinIf->decodeBinEP( uiSymbol ); 688 644 } 689 #else690 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUMergeIdxExtSCModel.get( 0, 0, auiCtx[uiUnaryIdx] ) );691 #endif692 645 if( uiSymbol == 0 ) 693 646 { … … 879 832 if (eMode == SIZE_2NxN) 880 833 { 881 #if AMP_CTX882 834 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUAMPSCModel.get( 0, 0, 0 )); 883 #else884 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUYPosiSCModel.get( 0, 0, 0 ));885 #endif886 835 if (uiSymbol == 0) 887 836 { 888 #if AMP_CTX889 837 m_pcTDecBinIf->decodeBinEP(uiSymbol); 890 #else891 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUYPosiSCModel.get( 0, 0, 1 ));892 #endif893 838 eMode = (uiSymbol == 0? SIZE_2NxnU : SIZE_2NxnD); 894 839 } … … 896 841 else if (eMode == SIZE_Nx2N) 897 842 { 898 #if AMP_CTX899 843 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUAMPSCModel.get( 0, 0, 0 )); 900 #else901 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUXPosiSCModel.get( 0, 0, 0 ));902 #endif903 844 if (uiSymbol == 0) 904 845 { 905 #if AMP_CTX906 846 m_pcTDecBinIf->decodeBinEP(uiSymbol); 907 #else908 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUXPosiSCModel.get( 0, 0, 1 ));909 #endif910 847 eMode = (uiSymbol == 0? SIZE_nLx2N : SIZE_nRx2N); 911 848 } … … 989 926 { 990 927 #endif 991 #if !LOGI_INTRA_NAME_3MPM992 Int iIntraIdx = pcCU->getIntraSizeIdx(uiAbsPartIdx);993 #endif994 928 995 929 #if LGE_EDGE_INTRA_A0070 … … 1003 937 #endif 1004 938 1005 #if LOGI_INTRA_NAME_3MPM1006 939 Int uiPreds[3] = {-1, -1, -1}; 1007 #else1008 Int uiPreds[2] = {-1, -1};1009 #endif1010 940 Int uiPredNum = pcCU->getIntraDirLumaPredictor(uiAbsPartIdx, uiPreds); 1011 941 #if LGE_EDGE_INTRA_A0070 … … 1018 948 { 1019 949 m_pcTDecBinIf->decodeBinEP( uiSymbol ); 1020 #if LOGI_INTRA_NAME_3MPM1021 950 if (uiSymbol) 1022 951 { … … 1024 953 uiSymbol++; 1025 954 } 1026 #endif1027 955 intraPredMode = uiPreds[uiSymbol]; 1028 956 } … … 1031 959 intraPredMode = 0; 1032 960 1033 #if LOGI_INTRA_NAME_3MPM1034 961 1035 962 m_pcTDecBinIf->decodeBinsEP( uiSymbol, 5 ); … … 1060 987 std::swap(uiPreds[1], uiPreds[2]); 1061 988 } 1062 #else1063 m_pcTDecBinIf->decodeBinsEP( uiSymbol, g_aucIntraModeBitsAng[iIntraIdx] - 1 );1064 intraPredMode = uiSymbol;1065 1066 if ( intraPredMode == 31 )1067 {1068 m_pcTDecBinIf->decodeBinEP( uiSymbol );1069 intraPredMode += uiSymbol;1070 }1071 #endif1072 989 #if LGE_EDGE_INTRA_A0070 1073 990 if ( intraPredMode != EDGE_INTRA_IDX) … … 1158 1075 { 1159 1076 UInt uiIPredMode; 1160 #if CHROMA_MODE_CODING1161 1077 m_pcTDecBinIf->decodeBinsEP( uiIPredMode, 2 ); 1162 #else1163 xReadUnaryMaxSymbol( uiIPredMode, m_cCUChromaPredSCModel.get( 0, 0 ) + 1, 0, 3 );1164 #endif1165 1078 UInt uiAllowedChromaDir[ NUM_CHROMA_MODE ]; 1166 1079 pcCU->getAllowedChromaDir( uiAbsPartIdx, uiAllowedChromaDir ); … … 1230 1143 ContextModel *pCtx = m_cCUMvdSCModel.get( 0 ); 1231 1144 1232 #if H0111_MVD_L1_ZERO1233 1145 if(pcCU->getSlice()->getMvdL1ZeroFlag() && eRefList == REF_PIC_LIST_1 && pcCU->getInterDir(uiAbsPartIdx)==3) 1234 1146 { … … 1238 1150 else 1239 1151 { 1240 #endif1241 1152 1242 1153 m_pcTDecBinIf->decodeBin( uiHorAbs, *pCtx ); … … 1281 1192 } 1282 1193 1283 #if H0111_MVD_L1_ZERO 1284 } 1285 #endif 1194 } 1286 1195 1287 1196 const TComMv cMv( uiHorSign ? -Int( uiHorAbs ): uiHorAbs, uiVerSign ? -Int( uiVerAbs ) : uiVerAbs ); … … 1323 1232 Void TDecSbac::parseDeltaQP( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1324 1233 { 1325 #if H0736_AVC_STYLE_QP_RANGE1326 1234 Int qp; 1327 #endif1328 1235 UInt uiDQp; 1329 1236 Int iDQp; … … 1333 1240 if ( uiDQp == 0 ) 1334 1241 { 1335 #if H0736_AVC_STYLE_QP_RANGE1336 1242 qp = pcCU->getRefQP(uiAbsPartIdx); 1337 #else1338 uiDQp = pcCU->getRefQP(uiAbsPartIdx);1339 #endif1340 1243 } 1341 1244 else 1342 1245 { 1343 1246 UInt uiSign; 1344 #if H0736_AVC_STYLE_QP_RANGE1345 1247 Int qpBdOffsetY = pcCU->getSlice()->getSPS()->getQpBDOffsetY(); 1346 #else1347 UInt uiQpBdOffsetY = 6*(g_uiBitIncrement + g_uiBitDepth - 8);1348 #endif1349 1248 m_pcTDecBinIf->decodeBinEP(uiSign); 1350 1249 1351 #if H0736_AVC_STYLE_QP_RANGE1352 1250 UInt uiMaxAbsDQpMinus1 = 24 + (qpBdOffsetY/2) + (uiSign); 1353 #else1354 UInt uiMaxAbsDQpMinus1 = 24 + (uiQpBdOffsetY/2) + (uiSign);1355 #endif1356 1251 UInt uiAbsDQpMinus1; 1357 1252 xReadUnaryMaxSymbol (uiAbsDQpMinus1, &m_cCUDeltaQpSCModel.get( 0, 0, 1 ), 1, uiMaxAbsDQpMinus1); … … 1364 1259 } 1365 1260 1366 #if H0736_AVC_STYLE_QP_RANGE1367 1261 qp = (((Int) pcCU->getRefQP( uiAbsPartIdx ) + iDQp + 52 + 2*qpBdOffsetY )%(52+qpBdOffsetY)) - qpBdOffsetY; 1368 #else1369 #if LOSSLESS_CODING1370 uiDQp = (pcCU->getRefQP(uiAbsPartIdx) + iDQp + 52) % 52;1371 #else1372 uiDQp = pcCU->getRefQP(uiAbsPartIdx) + iDQp;1373 #endif1374 #endif1375 1262 } 1376 1263 1377 1264 UInt uiAbsQpCUPartIdx = (uiAbsPartIdx>>(8-(pcCU->getSlice()->getPPS()->getMaxCuDQPDepth()<<1)))<<(8-(pcCU->getSlice()->getPPS()->getMaxCuDQPDepth()<<1)) ; 1378 1265 UInt uiQpCUDepth = min(uiDepth,pcCU->getSlice()->getPPS()->getMaxCuDQPDepth()) ; 1379 #if H0736_AVC_STYLE_QP_RANGE1380 1266 pcCU->setQPSubParts( qp, uiAbsQpCUPartIdx, uiQpCUDepth ); 1381 #else1382 pcCU->setQPSubParts( uiDQp, uiAbsQpCUPartIdx, uiQpCUDepth );1383 #endif1384 1267 } 1385 1268 … … 1422 1305 1423 1306 // posX 1424 #if LAST_CTX_REDUCTION1425 1307 Int widthCtx = eTType ? 4 : width; 1426 1308 const UInt *puiCtxIdxX = g_uiLastCtx + ( g_aucConvertToBit[ widthCtx ] * ( g_aucConvertToBit[ widthCtx ] + 3 ) ); 1427 #else1428 const UInt *puiCtxIdxX = g_uiLastCtx + ( g_aucConvertToBit[ width ] * ( g_aucConvertToBit[ width ] + 3 ) );1429 #endif1430 1309 for( uiPosLastX = 0; uiPosLastX < g_uiGroupIdx[ width - 1 ]; uiPosLastX++ ) 1431 1310 { 1432 #if LAST_CTX_REDUCTION1433 1311 if ( eTType ) 1434 1312 { … … 1437 1315 else 1438 1316 { 1439 #endif1440 1317 m_pcTDecBinIf->decodeBin( uiLast, *( pCtxX + puiCtxIdxX[ uiPosLastX ] ) ); 1441 #if LAST_CTX_REDUCTION 1442 } 1443 #endif 1318 } 1444 1319 if( !uiLast ) 1445 1320 { … … 1449 1324 1450 1325 // posY 1451 #if LAST_CTX_REDUCTION1452 1326 Int heightCtx = eTType? 4 : height; 1453 1327 const UInt *puiCtxIdxY = g_uiLastCtx + ( g_aucConvertToBit[ heightCtx ] * ( g_aucConvertToBit[ heightCtx ] + 3 ) ); 1454 #else1455 const UInt *puiCtxIdxY = g_uiLastCtx + ( g_aucConvertToBit[ height ] * ( g_aucConvertToBit[ height ] + 3 ) );1456 #endif1457 1328 for( uiPosLastY = 0; uiPosLastY < g_uiGroupIdx[ height - 1 ]; uiPosLastY++ ) 1458 1329 { 1459 #if LAST_CTX_REDUCTION1460 1330 if (eTType) 1461 1331 { … … 1464 1334 else 1465 1335 { 1466 #endif1467 1336 m_pcTDecBinIf->decodeBin( uiLast, *( pCtxY + puiCtxIdxY[ uiPosLastY ] ) ); 1468 #if LAST_CTX_REDUCTION 1469 } 1470 #endif 1337 } 1471 1338 if( !uiLast ) 1472 1339 { … … 1588 1455 UInt uiGoRiceParam = 0; 1589 1456 1590 #if MULTIBITS_DATA_HIDING1591 1457 UInt const tsig = pcCU->getSlice()->getPPS()->getTSIG(); 1592 1458 #if LOSSLESS_CODING … … 1604 1470 #endif 1605 1471 UInt absSum = 0; 1606 #endif // MULTIBITS_DATA_HIDING1607 1472 1608 1473 UInt uiSigCoeffGroupFlag[ MLS_GRP_NUM ]; … … 1613 1478 { 1614 1479 scanCG = g_auiSigLastScan[ uiScanIdx ][ uiLog2BlockSize > 3 ? uiLog2BlockSize-2-1 : 0 ]; 1615 #if MULTILEVEL_SIGMAP_EXT1616 1480 if( uiLog2BlockSize == 3 ) 1617 1481 { … … 1622 1486 scanCG = g_sigLastScanCG32x32; 1623 1487 } 1624 #endif1625 1488 } 1626 1489 else … … 1635 1498 Int numNonZero = 0; 1636 1499 1637 #if MULTIBITS_DATA_HIDING1638 1500 Int lastNZPosInCG = -1, firstNZPosInCG = SCAN_SET_SIZE; 1639 #endif1640 1501 1641 1502 Int pos[SCAN_SET_SIZE]; 1642 1503 if( iScanPosSig == (Int) uiScanPosLast ) 1643 1504 { 1644 #if MULTIBITS_DATA_HIDING1645 1505 lastNZPosInCG = iScanPosSig; 1646 1506 firstNZPosInCG = iScanPosSig; 1647 #endif1648 1507 iScanPosSig--; 1649 1508 pos[ numNonZero ] = uiBlkPosLast; … … 1651 1510 } 1652 1511 1653 #if !MULTILEVEL_SIGMAP_EXT1654 if( blockType > 3 )1655 {1656 #endif1657 1512 // decode significant_coeffgroup_flag 1658 1513 Int iCGBlkPos = scanCG[ iSubSet ]; 1659 1514 Int iCGPosY = iCGBlkPos / uiNumBlkSide; 1660 1515 Int iCGPosX = iCGBlkPos - (iCGPosY * uiNumBlkSide); 1661 #if MULTILEVEL_SIGMAP_EXT1662 1516 if( uiWidth == 8 && uiHeight == 8 && (uiScanIdx == SCAN_HOR || uiScanIdx == SCAN_VER) ) 1663 1517 { … … 1665 1519 iCGPosX = (uiScanIdx == SCAN_VER ? iCGBlkPos : 0); 1666 1520 } 1667 #endif1668 #if !REMOVE_INFER_SIGGRP1669 Bool bInferredCGFlag = false;1670 #endif1671 #if REMOVE_INFER_SIGGRP1672 1521 if( iSubSet == iLastScanSet || iSubSet == 0) 1673 #else1674 if( iSubSet == iLastScanSet )1675 #endif1676 1522 { 1677 1523 uiSigCoeffGroupFlag[ iCGBlkPos ] = 1; … … 1679 1525 else 1680 1526 { 1681 #if !REMOVE_INFER_SIGGRP1682 #if MULTILEVEL_SIGMAP_EXT1683 if( !TComTrQuant::bothCGNeighboursOne( uiSigCoeffGroupFlag, iCGPosX, iCGPosY, uiScanIdx, uiWidth, uiHeight) && ( iSubSet ) )1684 #else1685 if( !TComTrQuant::bothCGNeighboursOne( uiSigCoeffGroupFlag, iCGPosX, iCGPosY, uiWidth, uiHeight) && ( iSubSet ) )1686 #endif1687 {1688 #endif1689 1527 UInt uiSigCoeffGroup; 1690 #if MULTILEVEL_SIGMAP_EXT1691 1528 UInt uiCtxSig = TComTrQuant::getSigCoeffGroupCtxInc( uiSigCoeffGroupFlag, iCGPosX, iCGPosY, uiScanIdx, uiWidth, uiHeight ); 1692 #else1693 UInt uiCtxSig = TComTrQuant::getSigCoeffGroupCtxInc( uiSigCoeffGroupFlag, iCGPosX, iCGPosY, uiWidth, uiHeight );1694 #endif1695 1529 m_pcTDecBinIf->decodeBin( uiSigCoeffGroup, baseCoeffGroupCtx[ uiCtxSig ] ); 1696 1530 uiSigCoeffGroupFlag[ iCGBlkPos ] = uiSigCoeffGroup; 1697 #if !REMOVE_INFER_SIGGRP1698 }1699 else1700 {1701 uiSigCoeffGroupFlag[ iCGBlkPos ] = 1;1702 bInferredCGFlag = true;1703 }1704 #endif1705 1531 } 1706 1532 … … 1716 1542 if( uiSigCoeffGroupFlag[ iCGBlkPos ] ) 1717 1543 { 1718 #if REMOVE_INFER_SIGGRP1719 1544 if( iScanPosSig > iSubPos || iSubSet == 0 || numNonZero ) 1720 #else1721 if( iScanPosSig > iSubPos || bInferredCGFlag || numNonZero )1722 #endif1723 1545 { 1724 1546 uiCtxSig = TComTrQuant::getSigCtxInc( pcCoef, uiPosX, uiPosY, blockType, uiWidth, uiHeight, eTType ); … … 1735 1557 pos[ numNonZero ] = uiBlkPos; 1736 1558 numNonZero ++; 1737 #if MULTIBITS_DATA_HIDING1738 1559 if( lastNZPosInCG == -1 ) 1739 1560 { … … 1741 1562 } 1742 1563 firstNZPosInCG = iScanPosSig; 1743 #endif1744 1564 } 1745 1565 } 1746 #if !MULTILEVEL_SIGMAP_EXT1747 }1748 else1749 {1750 for( ; iScanPosSig >= iSubPos; iScanPosSig-- )1751 {1752 UInt uiBlkPos = scan[ iScanPosSig ];1753 UInt uiPosY = uiBlkPos >> uiLog2BlockSize;1754 UInt uiPosX = uiBlkPos - ( uiPosY << uiLog2BlockSize );1755 UInt uiSig = 0;1756 UInt uiCtxSig = TComTrQuant::getSigCtxInc( pcCoef, uiPosX, uiPosY, blockType, uiWidth, uiHeight, eTType );1757 m_pcTDecBinIf->decodeBin( uiSig, baseCtx[ uiCtxSig ] );1758 pcCoef[ uiBlkPos ] = uiSig;1759 if( uiSig )1760 {1761 pos[ numNonZero ] = uiBlkPos;1762 numNonZero ++;1763 #if MULTIBITS_DATA_HIDING1764 if( lastNZPosInCG == -1 )1765 {1766 lastNZPosInCG = iScanPosSig;1767 }1768 firstNZPosInCG = iScanPosSig;1769 #endif1770 }1771 }1772 }1773 #endif1774 1566 1775 1567 1776 1568 if( numNonZero ) 1777 1569 { 1778 #if MULTIBITS_DATA_HIDING1779 1570 Bool signHidden = ( lastNZPosInCG - firstNZPosInCG >= (Int)tsig ); 1780 1571 absSum = 0; 1781 #endif // MULTIBITS_DATA_HIDING1782 1572 1783 1573 UInt c1 = 1; 1784 #if !RESTRICT_GR1GR2FLAG_NUMBER1785 UInt c2 = 0;1786 #endif1787 #if LEVEL_CTX_LUMA_RED1788 1574 UInt uiCtxSet = (iSubSet > 0 && eTType==TEXT_LUMA) ? 2 : 0; 1789 #else1790 UInt uiCtxSet = (iSubSet > 0 && eTType==TEXT_LUMA) ? 3 : 0;1791 #endif1792 1575 UInt uiBin; 1793 1576 … … 1795 1578 { 1796 1579 uiCtxSet++; 1797 #if !LEVEL_CTX_LUMA_RED1798 if(eTType==TEXT_LUMA && uiNumOne > 3)1799 {1800 uiCtxSet++;1801 }1802 #endif1803 1580 } 1804 1581 … … 1807 1584 Int absCoeff[SCAN_SET_SIZE]; 1808 1585 1809 #if RESTRICT_GR1GR2FLAG_NUMBER1810 1586 for ( Int i = 0; i < numNonZero; i++) absCoeff[i] = 1; 1811 1587 Int numC1Flag = min(numNonZero, C1FLAG_NUMBER); … … 1813 1589 1814 1590 for( Int idx = 0; idx < numC1Flag; idx++ ) 1815 #else1816 for( Int idx = 0; idx < numNonZero; idx++ )1817 #endif1818 1591 { 1819 1592 m_pcTDecBinIf->decodeBin( uiBin, baseCtxMod[c1] ); … … 1821 1594 { 1822 1595 c1 = 0; 1823 #if RESTRICT_GR1GR2FLAG_NUMBER1824 1596 if (firstC2FlagIdx == -1) 1825 1597 { 1826 1598 firstC2FlagIdx = idx; 1827 1599 } 1828 #endif1829 1600 } 1830 1601 else if( (c1 < 3) && (c1 > 0) ) … … 1837 1608 if (c1 == 0) 1838 1609 { 1839 #if RESTRICT_GR1GR2FLAG_NUMBER1840 1610 baseCtxMod = ( eTType==TEXT_LUMA ) ? m_cCUAbsSCModel.get( 0, 0 ) + uiCtxSet : m_cCUAbsSCModel.get( 0, 0 ) + NUM_ABS_FLAG_CTX_LUMA + uiCtxSet; 1841 1611 if ( firstC2FlagIdx != -1) … … 1844 1614 absCoeff[ firstC2FlagIdx ] = uiBin + 2; 1845 1615 } 1846 #else 1847 baseCtxMod = ( eTType==TEXT_LUMA ) ? m_cCUAbsSCModel.get( 0, 0 ) + 3 * uiCtxSet : m_cCUAbsSCModel.get( 0, 0 ) + NUM_ABS_FLAG_CTX_LUMA + 3 * uiCtxSet; 1616 } 1617 1618 UInt coeffSigns; 1619 if ( signHidden && beValid ) 1620 { 1621 m_pcTDecBinIf->decodeBinsEP( coeffSigns, numNonZero-1 ); 1622 coeffSigns <<= 32 - (numNonZero-1); 1623 } 1624 else 1625 { 1626 m_pcTDecBinIf->decodeBinsEP( coeffSigns, numNonZero ); 1627 coeffSigns <<= 32 - numNonZero; 1628 } 1629 1630 Int iFirstCoeff2 = 1; 1631 if (c1 == 0 || numNonZero > C1FLAG_NUMBER) 1632 { 1848 1633 for( Int idx = 0; idx < numNonZero; idx++ ) 1849 1634 { 1850 if( absCoeff[ idx ] == 2 )1851 {1852 m_pcTDecBinIf->decodeBin( uiBin, baseCtxMod[c2] );1853 absCoeff[ idx ] = uiBin + 2;1854 c2 += (c2 < 2);1855 uiNumOne++;1856 }1857 }1858 #endif1859 }1860 1861 #if MULTIBITS_DATA_HIDING1862 UInt coeffSigns;1863 if ( signHidden && beValid )1864 {1865 m_pcTDecBinIf->decodeBinsEP( coeffSigns, numNonZero-1 );1866 coeffSigns <<= 32 - (numNonZero-1);1867 }1868 else1869 {1870 m_pcTDecBinIf->decodeBinsEP( coeffSigns, numNonZero );1871 coeffSigns <<= 32 - numNonZero;1872 }1873 #else1874 UInt coeffSigns;1875 m_pcTDecBinIf->decodeBinsEP( coeffSigns, numNonZero );1876 coeffSigns <<= 32 - numNonZero;1877 #endif1878 1879 #if RESTRICT_GR1GR2FLAG_NUMBER1880 Int iFirstCoeff2 = 1;1881 if (c1 == 0 || numNonZero > C1FLAG_NUMBER)1882 #else1883 if (c1 == 0)1884 #endif1885 {1886 for( Int idx = 0; idx < numNonZero; idx++ )1887 {1888 #if RESTRICT_GR1GR2FLAG_NUMBER1889 1635 UInt baseLevel = (idx < C1FLAG_NUMBER)? (2 + iFirstCoeff2) : 1; 1890 1636 … … 1901 1647 uiNumOne++; 1902 1648 } 1903 #else1904 if( absCoeff[ idx ] == 3 )1905 {1906 UInt uiLevel;1907 xReadGoRiceExGolomb( uiLevel, uiGoRiceParam );1908 absCoeff[ idx ] = uiLevel + 3;1909 }1910 #endif1911 1649 } 1912 1650 } … … 1915 1653 { 1916 1654 Int blkPos = pos[ idx ]; 1917 #if MULTIBITS_DATA_HIDING1918 1655 // Signs applied later. 1919 1656 pcCoef[ blkPos ] = absCoeff[ idx ]; … … 1932 1669 coeffSigns <<= 1; 1933 1670 } 1934 #else1935 Int sign = static_cast<Int>( coeffSigns ) >> 31;1936 pcCoef[ blkPos ] = ( absCoeff[ idx ] ^ sign ) - sign;1937 coeffSigns <<= 1;1938 #endif1939 1671 } 1940 1672 } … … 1949 1681 1950 1682 1951 #if SAO_UNIT_INTERLEAVING1952 1683 Void TDecSbac::parseSaoUvlc (UInt& ruiVal) 1953 1684 { … … 2186 1917 } 2187 1918 } 2188 #endif2189 1919 2190 1920 /** … … 2217 1947 } 2218 1948 2219 #if OL_FLUSH2220 1949 Void TDecSbac::decodeFlush ( ) 2221 1950 { … … 2225 1954 2226 1955 } 2227 #endif2228 1956 2229 1957 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX || (LGE_EDGE_INTRA_A0070 && LGE_EDGE_INTRA_DELTA_DC) -
branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecSbac.h
r292 r294 74 74 Void xCopyFrom ( TDecSbac* pSrc ); 75 75 Void xCopyContextsFrom ( TDecSbac* pSrc ); 76 #if OL_FLUSH77 76 Void decodeFlush(); 78 #endif79 77 80 78 #if CABAC_INIT_FLAG … … 95 93 Void parseSPS ( TComSPS* pcSPS ) {} 96 94 #endif 97 #if TILES_OR_ENTROPY_SYNC_IDC98 95 Void parsePPS ( TComPPS* pcPPS, ParameterSetManagerDecoder *parameterSet ) {} 99 #else100 Void parsePPS ( TComPPS* pcPPS ) {}101 #endif102 96 Void parseAPS ( TComAPS* pAPS ) {} 103 97 void parseSEI(SEImessages&) {} 104 98 105 #if LCU_SYNTAX_ALF106 99 #if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137 107 100 Void parseSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet, bool isDepth) {} 108 101 #else 109 102 Void parseSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl, AlfParamSet& alfParamSet) {} 110 #endif111 #else112 Void parseSliceHeader ( TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, AlfCUCtrlInfo &alfCUCtrl ) {}113 103 #endif 114 104 … … 120 110 #endif 121 111 122 #if SAO_UNIT_INTERLEAVING123 112 Void parseSaoUvlc ( UInt& ruiVal ); 124 113 Void parseSaoSvlc ( Int& riVal ); … … 129 118 Void parseSaoOneLcuInterleaving(Int rx, Int ry, SAOParam* pSaoParam, TComDataCU* pcCU, Int iCUAddrInSlice, Int iCUAddrUpInSlice, Bool bLFCrossSliceBoundaryFlag); 130 119 Void parseSaoOffset (SaoLcuParam* psSaoLcuParam); 131 #endif132 120 133 121 #if RWTH_SDC_DLT_B0036 … … 256 244 ContextModel3DBuffer m_cALFUvlcSCModel; 257 245 ContextModel3DBuffer m_cALFSvlcSCModel; 258 #if AMP_CTX259 246 ContextModel3DBuffer m_cCUAMPSCModel; 260 #else261 ContextModel3DBuffer m_cCUXPosiSCModel;262 ContextModel3DBuffer m_cCUYPosiSCModel;263 #endif264 247 ContextModel3DBuffer m_cSaoFlagSCModel; 265 248 ContextModel3DBuffer m_cSaoUvlcSCModel; 266 249 ContextModel3DBuffer m_cSaoSvlcSCModel; 267 #if SAO_UNIT_INTERLEAVING268 250 ContextModel3DBuffer m_cSaoMergeLeftSCModel; 269 251 ContextModel3DBuffer m_cSaoMergeUpSCModel; 270 252 ContextModel3DBuffer m_cSaoTypeIdxSCModel; 271 #endif272 253 273 254 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX -
branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecSlice.cpp
r210 r294 148 148 UInt uiCol=0, uiLin=0, uiSubStrm=0; 149 149 150 #if !REMOVE_TILE_DEPENDENCE151 Int iBreakDep;152 #endif153 150 UInt uiTileCol; 154 151 UInt uiTileStartLCU; … … 163 160 pcCU = rpcPic->getCU( iCUAddr ); 164 161 pcCU->initCU( rpcPic, iCUAddr ); 165 #if !REMOVE_TILE_DEPENDENCE166 iBreakDep = rpcPic->getPicSym()->getTileBoundaryIndependenceIdr();167 #endif168 162 uiTileCol = rpcPic->getPicSym()->getTileIdxMap(iCUAddr) % (rpcPic->getPicSym()->getNumColumnsMinus1()+1); // what column of tiles are we in? 169 163 uiTileStartLCU = rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getFirstCUAddr(); … … 175 169 uiLin = iCUAddr / uiWidthInLCUs; 176 170 // inherit from TR if necessary, select substream to use. 177 #if WPP_SIMPLIFICATION178 171 if( iSymbolMode && pcSlice->getPPS()->getNumSubstreams() > 1 ) 179 #else 180 if( iSymbolMode && pcSlice->getPPS()->getEntropyCodingSynchro() ) 181 #endif 182 { 183 #if !REMOVE_TILE_DEPENDENCE 184 #if WPP_SIMPLIFICATION 185 if (iBreakDep && pcSlice->getPPS()->getNumSubstreams() > 1) 186 #else 187 if (iBreakDep && pcSlice->getPPS()->getEntropyCodingSynchro()) 188 #endif 189 #else 190 #if WPP_SIMPLIFICATION 172 { 191 173 if (pcSlice->getPPS()->getNumSubstreams() > 1) 192 #else193 if (pcSlice->getPPS()->getEntropyCodingSynchro())194 #endif195 #endif196 174 { 197 175 // independent tiles => substreams are "per tile". iNumSubstreams has already been multiplied. … … 207 185 m_pcEntropyDecoder->setBitstream( ppcSubstreams[uiSubStrm] ); 208 186 // Synchronize cabac probabilities with upper-right LCU if it's available and we're at the start of a line. 209 #if WPP_SIMPLIFICATION210 187 if (pcSlice->getPPS()->getNumSubstreams() > 1 && uiCol == uiTileLCUX) 211 #else212 if (pcSlice->getPPS()->getEntropyCodingSynchro() && uiCol == uiTileLCUX)213 #endif214 188 { 215 189 // We'll sync if the TR is available. … … 217 191 UInt uiWidthInCU = rpcPic->getFrameWidthInCU(); 218 192 TComDataCU *pcCUTR = NULL; 219 #if WPP_SIMPLIFICATION220 193 if ( pcCUUp && ((iCUAddr%uiWidthInCU+1) < uiWidthInCU) ) 221 194 { 222 195 pcCUTR = rpcPic->getCU( iCUAddr - uiWidthInCU + 1 ); 223 196 } 224 #else225 if ( pcCUUp && ((iCUAddr%uiWidthInCU+pcSlice->getPPS()->getEntropyCodingSynchro()) < uiWidthInCU) )226 {227 pcCUTR = rpcPic->getCU( iCUAddr - uiWidthInCU + pcSlice->getPPS()->getEntropyCodingSynchro() );228 }229 #endif230 197 UInt uiMaxParts = 1<<(pcSlice->getSPS()->getMaxCUDepth()<<1); 231 198 … … 233 200 ((pcCUTR==NULL) || (pcCUTR->getSlice()==NULL) || 234 201 ((pcCUTR->getSCUAddr()+uiMaxParts-1) < pcSlice->getSliceCurStartCUAddr()) || 235 #if !REMOVE_TILE_DEPENDENCE236 (rpcPic->getPicSym()->getTileBoundaryIndependenceIdr() && (rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr)))237 #else238 202 ((rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr))) 239 #endif240 203 ))|| 241 204 (true/*bEnforceEntropySliceRestriction*/ && 242 205 ((pcCUTR==NULL) || (pcCUTR->getSlice()==NULL) || 243 206 ((pcCUTR->getSCUAddr()+uiMaxParts-1) < pcSlice->getEntropySliceCurStartCUAddr()) || 244 #if !REMOVE_TILE_DEPENDENCE245 (rpcPic->getPicSym()->getTileBoundaryIndependenceIdr() && (rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr)))246 #else247 207 ((rpcPic->getPicSym()->getTileIdxMap( pcCUTR->getAddr() ) != rpcPic->getPicSym()->getTileIdxMap(iCUAddr))) 248 #endif249 208 )) 250 209 ) … … 260 219 pcSbacDecoder->load(&pcSbacDecoders[uiSubStrm]); //this load is used to simplify the code (avoid to change all the call to pcSbacDecoders) 261 220 } 262 #if WPP_SIMPLIFICATION263 221 else if ( iSymbolMode && pcSlice->getPPS()->getNumSubstreams() <= 1 ) 264 #else265 else if ( iSymbolMode && !pcSlice->getPPS()->getEntropyCodingSynchro() )266 #endif267 222 { 268 223 // Set variables to appropriate values to avoid later code change. … … 273 228 (iCUAddr!=0) && (iCUAddr!=rpcPic->getPicSym()->getPicSCUAddr(rpcPic->getSlice(rpcPic->getCurrSliceIdx())->getSliceCurStartCUAddr())/rpcPic->getNumPartInCU())) // !1st in frame && !1st in slice 274 229 { 275 #if WPP_SIMPLIFICATION276 230 if (pcSlice->getPPS()->getNumSubstreams() > 1) 277 #else278 if (pcSlice->getPPS()->getEntropyCodingSynchro())279 #endif280 231 { 281 232 // We're crossing into another tile, tiles are independent. … … 330 281 } 331 282 332 #if !REMOVE_TILE_DEPENDENCE333 if ( (rpcPic->getPicSym()->getTileBoundaryIndependenceIdr()==0) && (rpcPic->getPicSym()->getNumColumnsMinus1()!=0) )334 {335 // Synchronize cabac probabilities with LCU among Tiles336 if( (uiTileLCUX != 0) &&337 (iCUAddr == rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getFirstCUAddr()) )338 {339 TComDataCU *pcCULeft = pcCU->getCULeft();340 UInt uiMaxParts = 1<<(pcSlice->getSPS()->getMaxCUDepth()<<1);341 342 if ( (true/*bEnforceSliceRestriction*/ &&343 ((pcCULeft==NULL) || (pcCULeft->getSlice()==NULL) ||344 ((pcCULeft->getSCUAddr()+uiMaxParts-1) < pcSlice->getSliceCurStartCUAddr())345 )346 )||347 (true/*bEnforceEntropySliceRestriction*/ &&348 ((pcCULeft==NULL) || (pcCULeft->getSlice()==NULL) ||349 ((pcCULeft->getSCUAddr()+uiMaxParts-1) < pcSlice->getEntropySliceCurStartCUAddr())350 )351 )352 )353 {354 // Left not available.355 }356 else357 {358 // Left is available, we use it.359 pcSbacDecoders[uiSubStrm].loadContexts( &m_pcBufferLowLatSbacDecoders[uiTileCol-1] );360 pcSbacDecoder->loadContexts(&pcSbacDecoders[uiSubStrm]); //this load is used to simplify the code (avoid to change all the call to pcSbacDecoders)361 }362 }363 }364 #endif365 283 366 284 … … 368 286 g_bJustDoIt = g_bEncDecTraceEnable; 369 287 #endif 370 #if SAO_UNIT_INTERLEAVING371 288 if ( pcSlice->getSPS()->getUseSAO() && pcSlice->getSaoInterleavingFlag() && pcSlice->getSaoEnabledFlag() ) 372 289 { … … 384 301 pcSbacDecoder->parseSaoOneLcuInterleaving(rx, ry, pcSlice->getAPS()->getSaoParam(),pcCU, cuAddrInSlice, cuAddrUpInSlice, pcSlice->getSPS()->getLFCrossSliceBoundaryFlag() ); 385 302 } 386 #endif387 303 388 304 m_pcCuDecoder->decodeCU ( pcCU, uiIsLast ); … … 394 310 if( iSymbolMode ) 395 311 { 396 #if OL_FLUSH397 312 /*If at the end of a LCU line but not at the end of a substream, perform CABAC flush*/ 398 #if WPP_SIMPLIFICATION399 313 if (!uiIsLast && pcSlice->getPPS()->getNumSubstreams() > 1) 400 #else 401 if (!uiIsLast && pcSlice->getPPS()->getCabacIstateReset()) 402 #endif 403 { 404 #if !REMOVE_TILE_DEPENDENCE 405 if ((iBreakDep && (uiCol == uiTileLCUX+uiTileWidth-1) && (uiLin+iNumSubstreamsPerTile < uiTileLCUY+uiTileHeight)) 406 || (!iBreakDep && (uiCol == uiWidthInLCUs-1) && (uiLin+iNumSubstreams < pcCU->getPic()->getFrameHeightInCU()))) 407 #else 314 { 408 315 if ((uiCol == uiTileLCUX+uiTileWidth-1) && (uiLin+iNumSubstreamsPerTile < uiTileLCUY+uiTileHeight)) 409 #endif410 316 { 411 317 m_pcEntropyDecoder->decodeFlush(); 412 318 } 413 319 } 414 #endif415 320 pcSbacDecoders[uiSubStrm].load(pcSbacDecoder); 416 321 417 322 //Store probabilities of second LCU in line into buffer 418 #if WPP_SIMPLIFICATION419 323 if (pcSlice->getPPS()->getNumSubstreams() > 1 && (uiCol == uiTileLCUX+1)) 420 #else421 if (pcSlice->getPPS()->getEntropyCodingSynchro() && (uiCol == uiTileLCUX+pcSlice->getPPS()->getEntropyCodingSynchro()))422 #endif423 324 { 424 325 m_pcBufferSbacDecoders[uiTileCol].loadContexts( &pcSbacDecoders[uiSubStrm] ); … … 426 327 427 328 } 428 #if !REMOVE_TILE_DEPENDENCE429 if ( (rpcPic->getPicSym()->getTileBoundaryIndependenceIdr()==0) && (rpcPic->getPicSym()->getNumColumnsMinus1()!=0) )430 {431 pcSbacDecoders[uiSubStrm].load(pcSbacDecoder);432 //Store probabilties for next tile433 if( (uiLin == (rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getFirstCUAddr() / uiWidthInLCUs )) &&434 (uiCol == rpcPic->getPicSym()->getTComTile(rpcPic->getPicSym()->getTileIdxMap(iCUAddr))->getRightEdgePosInCU()) )435 {436 m_pcBufferLowLatSbacDecoders[uiTileCol].loadContexts( &pcSbacDecoders[uiSubStrm] );437 }438 }439 #endif440 329 } 441 330 -
branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecTop.cpp
r280 r294 525 525 xUpdateGopSize(pcSlice); 526 526 527 #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER528 527 m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer())+pcSlice->getSPS()->getNumReorderPics(pcSlice->getTLayer()) + 1; // +1 to have space for the picture currently being decoded 529 #else530 m_iMaxRefPicNum = pcSlice->getSPS()->getMaxNumberOfReferencePictures()+pcSlice->getSPS()->getNumReorderFrames() + 1; // +1 to have space for the picture currently being decoded531 #endif532 528 533 529 #if DEPTH_MAP_GENERATION … … 716 712 } 717 713 718 #if !LCU_SYNTAX_ALF719 // create ALF temporary buffer720 m_cAdaptiveLoopFilter.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );721 #endif722 714 m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 723 715 m_cLoopFilter. create( g_uiMaxCUDepth ); 724 716 } 725 717 726 #if SKIPFRAME_BUGFIX727 718 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay ) 728 #else729 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int iSkipFrame, Int iPOCLastDisplay )730 #endif731 719 { 732 720 TComPic*& pcPic = m_pcPic; … … 785 773 } 786 774 787 #if NAL_REF_FLAG788 775 m_apcSlicePilot->setReferenced(nalu.m_nalRefFlag); 789 #else790 m_apcSlicePilot->setReferenced(nalu.m_nalRefIDC != NAL_REF_IDC_PRIORITY_LOWEST);791 #endif792 776 m_apcSlicePilot->setTLayerInfo(nalu.m_temporalId); 793 777 794 778 // ALF CU parameters should be part of the slice header -> needs to be fixed 795 #if LCU_SYNTAX_ALF796 779 #if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137 797 780 m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder, m_cGopDecoder.getAlfCuCtrlParam(), m_cGopDecoder.getAlfParamSet(),m_apcSlicePilot->getVPS()->getDepthFlag(nalu.m_layerId)); … … 799 782 m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder, m_cGopDecoder.getAlfCuCtrlParam(), m_cGopDecoder.getAlfParamSet()); 800 783 #endif 801 #else802 m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder, m_cGopDecoder.getAlfCuCtrlParam() );803 #endif804 784 // byte align 805 785 { … … 816 796 if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence) 817 797 { 818 #if START_DECODING_AT_CRA819 798 if (m_prevPOC >= m_pocRandomAccess) 820 799 { … … 823 802 } 824 803 m_prevPOC = m_apcSlicePilot->getPOC(); 825 #else826 m_prevPOC = m_apcSlicePilot->getPOC();827 return true;828 #endif829 804 } 830 805 // actual decoding starts here … … 846 821 } 847 822 //detect lost reference picture and insert copy of earlier frame. 848 #if START_DECODING_AT_CRA849 823 while(m_apcSlicePilot->checkThatAllRefPicsAreAvailable(m_cListPic, m_apcSlicePilot->getRPS(), true, m_pocRandomAccess) > 0) 850 #else851 while(m_apcSlicePilot->checkThatAllRefPicsAreAvailable(m_cListPic, m_apcSlicePilot->getRPS(), true) > 0)852 #endif853 824 { 854 825 xCreateLostPicture(m_apcSlicePilot->checkThatAllRefPicsAreAvailable(m_cListPic, m_apcSlicePilot->getRPS(), false)-1); … … 897 868 UInt i, j, p; 898 869 899 #if !REMOVE_TILE_DEPENDENCE900 //set the TileBoundaryIndependenceIdr901 if(pcSlice->getPPS()->getTileBehaviorControlPresentFlag() == 1)902 {903 pcPic->getPicSym()->setTileBoundaryIndependenceIdr( pcSlice->getPPS()->getTileBoundaryIndependenceIdr() );904 }905 else906 {907 pcPic->getPicSym()->setTileBoundaryIndependenceIdr( pcSlice->getPPS()->getSPS()->getTileBoundaryIndependenceIdr() );908 }909 #endif910 870 911 871 if( pcSlice->getPPS()->getColumnRowInfoPresent() == 1 ) … … 1265 1225 { 1266 1226 TComSPS* sps = new TComSPS(); 1267 #if RPS_IN_SPS1268 1227 TComRPSList* rps = new TComRPSList(); 1269 1228 sps->setRPSList(rps); 1270 #endif1271 1229 #if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068 1272 1230 m_cEntropyDecoder.decodeSPS( sps, m_isDepth ); … … 1275 1233 #endif 1276 1234 m_parameterSetManagerDecoder.storePrefetchedSPS(sps); 1277 #if LCU_SYNTAX_ALF1278 1235 m_cAdaptiveLoopFilter.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 1279 #endif1280 1236 } 1281 1237 1282 1238 Void TDecTop::xDecodePPS() 1283 1239 { 1284 #if !RPS_IN_SPS1285 TComRPSList* rps = new TComRPSList();1286 #endif1287 1240 TComPPS* pps = new TComPPS(); 1288 #if !RPS_IN_SPS1289 pps->setRPSList(rps);1290 #endif1291 #if TILES_OR_ENTROPY_SYNC_IDC1292 1241 m_cEntropyDecoder.decodePPS( pps, &m_parameterSetManagerDecoder ); 1293 #else1294 m_cEntropyDecoder.decodePPS( pps );1295 #endif1296 1242 m_parameterSetManagerDecoder.storePrefetchedPPS( pps ); 1297 1243 … … 1346 1292 case NAL_UNIT_CODED_SLICE: 1347 1293 case NAL_UNIT_CODED_SLICE_IDR: 1348 #if H0566_TLA1349 1294 #if !QC_REM_IDV_B0046 1350 1295 case NAL_UNIT_CODED_SLICE_IDV: … … 1352 1297 case NAL_UNIT_CODED_SLICE_CRA: 1353 1298 case NAL_UNIT_CODED_SLICE_TLA: 1354 #else1355 case NAL_UNIT_CODED_SLICE_CDR:1356 #endif1357 1299 return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay); 1358 1300 break; … … 1375 1317 sps = pSPSV0; 1376 1318 m_parameterSetManagerDecoder.storePrefetchedSPS(sps); 1377 #if LCU_SYNTAX_ALF1378 1319 m_cAdaptiveLoopFilter.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 1379 #endif1380 1320 } 1381 1321 … … 1412 1352 else if (m_pocRandomAccess == MAX_INT) // start of random access point, m_pocRandomAccess has not been set yet. 1413 1353 { 1414 #if H0566_TLA1415 1354 if( m_apcSlicePilot->getNalUnitTypeBaseViewMvc() == NAL_UNIT_CODED_SLICE_CRA ) 1416 #else1417 if( m_apcSlicePilot->getNalUnitTypeBaseViewMvc() == NAL_UNIT_CODED_SLICE_CDR )1418 #endif1419 1355 { 1420 1356 m_pocRandomAccess = m_apcSlicePilot->getPOC(); // set the POC random access since we need to skip the reordered pictures in CRA. … … 1426 1362 else 1427 1363 { 1428 #if START_DECODING_AT_CRA1429 1364 static bool warningMessage = false; 1430 1365 if(!warningMessage) … … 1434 1369 } 1435 1370 return true; 1436 #else1437 printf("\nUnsafe random access point. Decoder may crash.");1438 m_pocRandomAccess = 0;1439 #endif1440 1371 } 1441 1372 } … … 1458 1389 m_cSAO.allocSaoParam(pAPS->getSaoParam()); 1459 1390 pAPS->createAlfParam(); 1460 #if !LCU_SYNTAX_ALF1461 m_cAdaptiveLoopFilter.allocALFParam(pAPS->getAlfParam());1462 #endif1463 1391 } 1464 1392 -
branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecTop.h
r280 r294 282 282 Void decodeAPS( TComAPS* cAPS) { m_cEntropyDecoder.decodeAPS(cAPS); }; 283 283 Void xActivateParameterSets(); 284 #if SKIPFRAME_BUGFIX285 284 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay); 286 #else287 Bool xDecodeSlice(InputNALUnit &nalu, Int iSkipFrame, Int iPOCLastDisplay);288 #endif289 285 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 290 286 Void xDecodeVPS();
Note: See TracChangeset for help on using the changeset viewer.