Changeset 608 in 3DVCSoftware for trunk/source/Lib/TLibDecoder/TDecCu.cpp
- Timestamp:
- 1 Sep 2013, 22:47:26 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibDecoder/TDecCu.cpp
r443 r608 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 38 38 #include "TDecCu.h" 39 39 40 #if RWTH_SDC_DLT_B003641 #define GetDepthValue2Idx(val) (pcCU->getSlice()->getSPS()->depthValue2idx(val))42 #define GetIdx2DepthValue(val) (pcCU->getSlice()->getSPS()->idx2DepthValue(val))43 #endif44 45 40 //! \ingroup TLibDecoder 46 41 //! \{ … … 54 49 m_ppcYuvResi = NULL; 55 50 m_ppcYuvReco = NULL; 56 #if H3D_IVRP & !QC_ARP_D017757 m_ppcYuvResPred = NULL;58 #endif59 51 m_ppcCU = NULL; 60 52 } … … 82 74 m_ppcYuvResi = new TComYuv*[m_uiMaxDepth-1]; 83 75 m_ppcYuvReco = new TComYuv*[m_uiMaxDepth-1]; 84 #if H3D_IVRP & !QC_ARP_D017785 m_ppcYuvResPred = new TComYuv* [m_uiMaxDepth-1];86 #endif87 76 m_ppcCU = new TComDataCU*[m_uiMaxDepth-1]; 88 77 … … 96 85 m_ppcYuvResi[ui] = new TComYuv; m_ppcYuvResi[ui]->create( uiWidth, uiHeight ); 97 86 m_ppcYuvReco[ui] = new TComYuv; m_ppcYuvReco[ui]->create( uiWidth, uiHeight ); 98 #if H3D_IVRP & !QC_ARP_D017799 m_ppcYuvResPred[ui] = new TComYuv; m_ppcYuvResPred[ui]->create( uiWidth, uiHeight );100 #endif101 87 m_ppcCU [ui] = new TComDataCU; m_ppcCU [ui]->create( uiNumPartitions, uiWidth, uiHeight, true, uiMaxWidth >> (m_uiMaxDepth - 1) ); 102 88 } … … 111 97 // initialize conversion matrix from partition index to pel 112 98 initRasterToPelXY( uiMaxWidth, uiMaxHeight, m_uiMaxDepth ); 113 initMotionReferIdx ( uiMaxWidth, uiMaxHeight, m_uiMaxDepth );114 99 } 115 100 … … 120 105 m_ppcYuvResi[ui]->destroy(); delete m_ppcYuvResi[ui]; m_ppcYuvResi[ui] = NULL; 121 106 m_ppcYuvReco[ui]->destroy(); delete m_ppcYuvReco[ui]; m_ppcYuvReco[ui] = NULL; 122 #if H3D_IVRP & !QC_ARP_D0177123 m_ppcYuvResPred[ui]->destroy(); delete m_ppcYuvResPred[ui]; m_ppcYuvResPred[ui] = NULL;124 #endif125 107 m_ppcCU [ui]->destroy(); delete m_ppcCU [ui]; m_ppcCU [ui] = NULL; 126 108 } … … 128 110 delete [] m_ppcYuvResi; m_ppcYuvResi = NULL; 129 111 delete [] m_ppcYuvReco; m_ppcYuvReco = NULL; 130 #if H3D_IVRP & !QC_ARP_D0177131 delete [] m_ppcYuvResPred; m_ppcYuvResPred = NULL;132 #endif133 112 delete [] m_ppcCU ; m_ppcCU = NULL; 134 113 } … … 148 127 } 149 128 150 pcCU->setNumSucIPCM(0);151 152 129 // start from the top level CU 153 130 xDecodeCU( pcCU, 0, 0, ruiIsLast); … … 158 135 Void TDecCu::decompressCU( TComDataCU* pcCU ) 159 136 { 160 xDecompressCU( pcCU, pcCU,0, 0 );137 xDecompressCU( pcCU, 0, 0 ); 161 138 } 162 139 … … 171 148 * \returns Bool 172 149 */ 173 Bool TDecCu::xDecodeSliceEnd( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth) { 150 Bool TDecCu::xDecodeSliceEnd( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth) 151 { 174 152 UInt uiIsLast; 175 153 TComPic* pcPic = pcCU->getPic(); … … 178 156 UInt uiWidth = pcSlice->getSPS()->getPicWidthInLumaSamples(); 179 157 UInt uiHeight = pcSlice->getSPS()->getPicHeightInLumaSamples(); 180 UInt uiGranularityWidth = g_uiMaxCUWidth >>(pcSlice->getPPS()->getSliceGranularity());158 UInt uiGranularityWidth = g_uiMaxCUWidth; 181 159 UInt uiPosX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiAbsPartIdx] ]; 182 160 UInt uiPosY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; 183 161 184 #if HHI_MPI185 const UInt uiCUWidth = pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1 ? g_uiMaxCUWidth>>uiDepth : pcCU->getWidth (uiAbsPartIdx);186 const UInt uiCUHeight = pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1 ? g_uiMaxCUHeight>>uiDepth : pcCU->getHeight(uiAbsPartIdx);187 if(((uiPosX+uiCUWidth)%uiGranularityWidth==0||(uiPosX+uiCUWidth==uiWidth))188 &&((uiPosY+uiCUHeight)%uiGranularityWidth==0||(uiPosY+uiCUHeight==uiHeight)))189 #else190 162 if(((uiPosX+pcCU->getWidth(uiAbsPartIdx))%uiGranularityWidth==0||(uiPosX+pcCU->getWidth(uiAbsPartIdx)==uiWidth)) 191 163 &&((uiPosY+pcCU->getHeight(uiAbsPartIdx))%uiGranularityWidth==0||(uiPosY+pcCU->getHeight(uiAbsPartIdx)==uiHeight))) 192 #endif193 164 { 194 165 m_pcEntropyDecoder->decodeTerminatingBit( uiIsLast ); … … 201 172 if(uiIsLast) 202 173 { 203 if(pcSlice->isNext EntropySlice()&&!pcSlice->isNextSlice())204 { 205 pcSlice->set EntropySliceCurEndCUAddr(pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts);174 if(pcSlice->isNextSliceSegment()&&!pcSlice->isNextSlice()) 175 { 176 pcSlice->setSliceSegmentCurEndCUAddr(pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts); 206 177 } 207 178 else 208 179 { 209 180 pcSlice->setSliceCurEndCUAddr(pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts); 210 pcSlice->set EntropySliceCurEndCUAddr(pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts);181 pcSlice->setSliceSegmentCurEndCUAddr(pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts); 211 182 } 212 183 } … … 233 204 UInt uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiAbsPartIdx] ]; 234 205 UInt uiBPelY = uiTPelY + (g_uiMaxCUHeight>>uiDepth) - 1; 235 206 #if H_MV_ENC_DEC_TRAC 207 DTRACE_CU_S("=========== coding_quadtree ===========\n") 208 DTRACE_CU("x0", uiLPelX) 209 DTRACE_CU("x1", uiTPelY) 210 DTRACE_CU("log2CbSize", g_uiMaxCUWidth>>uiDepth) 211 DTRACE_CU("cqtDepth" , uiDepth) 212 #endif 236 213 TComSlice * pcSlice = pcCU->getPic()->getSlice(pcCU->getPic()->getCurrSliceIdx()); 237 Bool bStartInCU = pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts>pcSlice->get EntropySliceCurStartCUAddr()&&pcCU->getSCUAddr()+uiAbsPartIdx<pcSlice->getEntropySliceCurStartCUAddr();214 Bool bStartInCU = pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts>pcSlice->getSliceSegmentCurStartCUAddr()&&pcCU->getSCUAddr()+uiAbsPartIdx<pcSlice->getSliceSegmentCurStartCUAddr(); 238 215 if((!bStartInCU) && ( uiRPelX < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( uiBPelY < pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 239 216 { 240 if(pcCU->getNumSucIPCM() == 0) 241 { 242 #if HHI_MPI 243 if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 || uiDepth < pcCU->getTextureModeDepth( uiAbsPartIdx ) ) 244 #endif 245 m_pcEntropyDecoder->decodeSplitFlag( pcCU, uiAbsPartIdx, uiDepth ); 246 } 247 else 248 { 249 pcCU->setDepthSubParts( uiDepth, uiAbsPartIdx ); 250 } 217 m_pcEntropyDecoder->decodeSplitFlag( pcCU, uiAbsPartIdx, uiDepth ); 251 218 } 252 219 else … … 269 236 uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiIdx] ]; 270 237 271 Bool bSubInSlice = pcCU->getSCUAddr()+uiIdx+uiQNumParts>pcSlice->get EntropySliceCurStartCUAddr();238 Bool bSubInSlice = pcCU->getSCUAddr()+uiIdx+uiQNumParts>pcSlice->getSliceSegmentCurStartCUAddr(); 272 239 if ( bSubInSlice ) 273 240 { 274 if ( ( uiLPelX < pcCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples() ) )241 if ( !ruiIsLast && ( uiLPelX < pcCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples() ) ) 275 242 { 276 243 xDecodeCU( pcCU, uiIdx, uiDepth+1, ruiIsLast ); … … 281 248 } 282 249 } 283 if(ruiIsLast)284 {285 break;286 }287 250 288 251 uiIdx += uiQNumParts; … … 293 256 { 294 257 UInt uiQPSrcPartIdx; 295 if ( pcPic->getCU( pcCU->getAddr() )->get EntropySliceStartCU(uiAbsPartIdx) != pcSlice->getEntropySliceCurStartCUAddr() )258 if ( pcPic->getCU( pcCU->getAddr() )->getSliceSegmentStartCU(uiAbsPartIdx) != pcSlice->getSliceSegmentCurStartCUAddr() ) 296 259 { 297 uiQPSrcPartIdx = pcSlice->get EntropySliceCurStartCUAddr() % pcPic->getNumPartInCU();260 uiQPSrcPartIdx = pcSlice->getSliceSegmentCurStartCUAddr() % pcPic->getNumPartInCU(); 298 261 } 299 262 else … … 307 270 } 308 271 272 #if H_MV_ENC_DEC_TRAC 273 DTRACE_CU_S("=========== coding_unit ===========\n") 274 #endif 275 309 276 if( (g_uiMaxCUWidth>>uiDepth) >= pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP()) 310 277 { … … 312 279 pcCU->setQPSubParts( pcCU->getRefQP(uiAbsPartIdx), uiAbsPartIdx, uiDepth ); // set QP to default QP 313 280 } 314 #if QC_CU_NBDV_D0181 315 DisInfo DvInfo; 316 DvInfo.bDV = false; 317 if(!pcCU->getSlice()->isIntra()) 318 { 319 #if QC_ARP_D0177 320 if(( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() || pcCU->getSlice()->getSPS()->getUseAdvRP()) && pcCU->getSlice()->getViewId()) 281 #if H_3D_NBDV 282 DisInfo DvInfo; 283 DvInfo.bDV = false; 284 DvInfo.m_acNBDV.setZero(); 285 DvInfo.m_aVIdxCan = 0; 286 #if H_3D_NBDV_REF 287 DvInfo.m_acDoNBDV.setZero(); 288 #endif 289 290 291 if(!pcCU->getSlice()->isIntra()) 292 { 293 #if H_3D_ARP && H_3D_IV_MERGE 294 if( pcCU->getSlice()->getVPS()->getUseAdvRP( pcCU->getSlice()->getLayerId() ) || pcCU->getSlice()->getVPS()->getIvMvPredFlag( pcCU->getSlice()->getLayerId() )) 295 #else 296 #if H_3D_ARP 297 if( pcCU->getSlice()->getVPS()->getUseAdvRP(pcCU->getSlice()->getLayerId()) ) 321 298 #else 322 if(( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() || pcCU->getSlice()->getSPS()->getMultiviewResPredMode()) && pcCU->getSlice()->getViewId()) 323 #endif 324 { 325 m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0, true ); 326 m_ppcCU[uiDepth]->copyDVInfoFrom( pcCU, uiAbsPartIdx); 327 PartSize ePartTemp = m_ppcCU[uiDepth]->getPartitionSize(0); 328 UChar cWidTemp = m_ppcCU[uiDepth]->getWidth(0); 329 UChar cHeightTemp = m_ppcCU[uiDepth]->getHeight(0); 330 m_ppcCU[uiDepth]->setWidth ( 0, pcCU->getSlice()->getSPS()->getMaxCUWidth ()/(1<<uiDepth) ); 331 m_ppcCU[uiDepth]->setHeight ( 0, pcCU->getSlice()->getSPS()->getMaxCUHeight()/(1<<uiDepth) ); 332 m_ppcCU[uiDepth]->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); 333 #if MERL_VSP_C0152 334 DvInfo.bDV = m_ppcCU[uiDepth]->getDisMvpCandNBDV(0, 0, &DvInfo, false, true); 335 #else 336 DvInfo.bDV = m_ppcCU[uiDepth]->getDisMvpCandNBDV(0, 0, &DvInfo, false); 337 #endif 338 pcCU->setDvInfoSubParts(DvInfo, uiAbsPartIdx, uiDepth); 339 m_ppcCU[uiDepth]->setPartSizeSubParts( ePartTemp, 0, uiDepth ); 340 m_ppcCU[uiDepth]->setWidth ( 0, cWidTemp ); 341 m_ppcCU[uiDepth]->setHeight ( 0, cHeightTemp ); 342 } 343 if(DvInfo.bDV==false) 344 { 345 DvInfo.iN=1; 346 #if !SEC_DEFAULT_DV_D0112 347 DvInfo.m_acMvCand[0].setHor(0); 348 DvInfo.m_acMvCand[0].setVer(0); 349 DvInfo.m_aVIdxCan[0] = 0; 350 #endif 351 pcCU->setDvInfoSubParts(DvInfo, uiAbsPartIdx, uiDepth); 352 } 353 } 354 #endif 299 #if H_3D_IV_MERGE 300 if( pcCU->getSlice()->getVPS()->getIvMvPredFlag(pcCU->getSlice()->getLayerId()) ) 301 #else 302 if (0) 303 #endif 304 #endif 305 #endif 306 { 307 m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0, true ); 308 m_ppcCU[uiDepth]->copyDVInfoFrom( pcCU, uiAbsPartIdx); 309 PartSize ePartTemp = m_ppcCU[uiDepth]->getPartitionSize(0); 310 UChar cWidTemp = m_ppcCU[uiDepth]->getWidth(0); 311 UChar cHeightTemp = m_ppcCU[uiDepth]->getHeight(0); 312 m_ppcCU[uiDepth]->setWidth ( 0, pcCU->getSlice()->getSPS()->getMaxCUWidth ()/(1<<uiDepth) ); 313 m_ppcCU[uiDepth]->setHeight ( 0, pcCU->getSlice()->getSPS()->getMaxCUHeight()/(1<<uiDepth) ); 314 m_ppcCU[uiDepth]->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); 315 #if H_3D_NBDV_REF 316 if(pcCU->getSlice()->getVPS()->getDepthRefinementFlag( pcCU->getSlice()->getLayerIdInVps() )) //Notes from QC: please check the condition for DoNBDV. Remove this comment once it is done. 317 DvInfo.bDV = m_ppcCU[uiDepth]->getDisMvpCandNBDV(&DvInfo, true); 318 else 319 #endif 320 DvInfo.bDV = m_ppcCU[uiDepth]->getDisMvpCandNBDV(&DvInfo); 321 322 pcCU->setDvInfoSubParts(DvInfo, uiAbsPartIdx, uiDepth); 323 m_ppcCU[uiDepth]->setPartSizeSubParts( ePartTemp, 0, uiDepth ); 324 m_ppcCU[uiDepth]->setWidth ( 0, cWidTemp ); 325 m_ppcCU[uiDepth]->setHeight ( 0, cHeightTemp ); 326 } 327 } 328 #endif 329 if (pcCU->getSlice()->getPPS()->getTransquantBypassEnableFlag()) 330 { 331 m_pcEntropyDecoder->decodeCUTransquantBypassFlag( pcCU, uiAbsPartIdx, uiDepth ); 332 } 333 355 334 // decode CU mode and the partition size 356 if( !pcCU->getSlice()->isIntra() && pcCU->getNumSucIPCM() == 0 ) 357 #if HHI_MPI 358 if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 ) 359 #endif 335 if( !pcCU->getSlice()->isIntra()) 360 336 { 361 337 m_pcEntropyDecoder->decodeSkipFlag( pcCU, uiAbsPartIdx, uiDepth ); … … 364 340 if( pcCU->isSkipped(uiAbsPartIdx) ) 365 341 { 342 #if H_MV_ENC_DEC_TRAC 343 DTRACE_PU_S("=========== prediction_unit ===========\n") 344 DTRACE_PU("x0", uiLPelX) 345 DTRACE_PU("x1", uiTPelY) 346 #endif 366 347 m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 ); 367 348 m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 ); 368 #if H3D_IVMP 349 #if H_3D_IV_MERGE 350 m_ppcCU[uiDepth]->copyDVInfoFrom(pcCU, uiAbsPartIdx); 369 351 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists 370 352 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; 371 Int numValidMergeCand = 0;372 for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS_MEM; ++ui )373 353 #else 374 354 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists 375 355 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS]; 356 #endif 376 357 Int numValidMergeCand = 0; 377 for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ++ui ) 378 #endif 358 for( UInt ui = 0; ui < m_ppcCU[uiDepth]->getSlice()->getMaxNumMergeCand(); ++ui ) 379 359 { 380 360 uhInterDirNeighbours[ui] = 0; 381 361 } 382 m_pcEntropyDecoder->decodeMergeIndex( pcCU, 0, uiAbsPartIdx, SIZE_2Nx2N, uhInterDirNeighbours, cMvFieldNeighbours, uiDepth ); 383 #if HHI_MPI 384 if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == uiDepth ) 385 { 386 TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ); 387 pcCU->copyTextureMotionDataFrom( pcTextureCU, uiDepth, pcCU->getZorderIdxInCU() + uiAbsPartIdx, uiAbsPartIdx ); 388 389 UInt uiCurrPartNumb = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); 390 391 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) 392 { 393 const UChar uhNewDepth = max<UInt>( uiDepth, pcTextureCU->getDepth( uiAbsPartIdx + ui ) ); 394 #if MERL_VSP_C0152 395 Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui ); 396 pcCU->setVSPIndex( uiAbsPartIdx + ui, vspIdx ); 397 #endif 398 #if MERL_VSP_NBDV_RefVId_Fix_D0166 399 Int vspDir = pcTextureCU->getVSPDir( uiAbsPartIdx + ui ); 400 pcCU->setVSPDir( uiAbsPartIdx + ui, vspDir ); 401 #endif 402 pcCU->setPredictionMode( uiAbsPartIdx + ui, MODE_SKIP ); 403 pcCU->setPartitionSize( uiAbsPartIdx + ui, SIZE_2Nx2N ); 404 pcCU->setDepth( uiAbsPartIdx + ui, uhNewDepth ); 405 pcCU->setWidth( uiAbsPartIdx + ui, g_uiMaxCUWidth>>uhNewDepth ); 406 pcCU->setHeight( uiAbsPartIdx + ui, g_uiMaxCUHeight>>uhNewDepth ); 407 } 408 #if LGE_ILLUCOMP_DEPTH_C0046 409 m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 410 #endif 411 } 412 else 413 { 414 #endif 362 m_pcEntropyDecoder->decodeMergeIndex( pcCU, 0, uiAbsPartIdx, uiDepth ); 415 363 UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx); 416 #if MERL_VSP_C0152 417 #if LGE_VSP_INHERIT_D0092418 Int iVSPIndexTrue[MRG_MAX_NUM_CANDS_MEM];419 for (Int i=0; i<MRG_MAX_NUM_CANDS_MEM; i++)420 { 421 iVSPIndexTrue[i] = 0;422 }364 365 #if H_3D_VSP 366 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 367 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 368 #if MTK_VSP_FIX_ALIGN_WD_E0172 369 InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM]; 370 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand, uiMergeIndex ); 423 371 #else 424 Int iVSPIndexTrue[3] = {-1, -1, -1}; 425 #endif 426 #if MERL_VSP_NBDV_RefVId_Fix_D0166 427 Int iVSPDirTrue[3] = {-1, -1, -1};428 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, iVSPDirTrue, uiMergeIndex);372 #if MTK_VSP_FIX_E0172 373 Int vspDir[MRG_MAX_NUM_CANDS_MEM]; 374 memset(vspDir, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 375 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag,vspDir, numValidMergeCand, uiMergeIndex ); 376 pcCU->setVSPDirSubParts( vspDir[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); 429 377 #else 430 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, uiMergeIndex ); 431 #endif 432 #if MTK_D0156 433 if( !pcCU->getSlice()->getSPS()->getUseVSPCompensation() ) 434 { 435 pcCU->setVSPIndexSubParts( 0, uiAbsPartIdx, 0, uiDepth ); 436 } 437 else 438 #endif 439 { 440 Int iVSPIdx = 0; 441 #if LGE_VSP_INHERIT_D0092 442 if (iVSPIndexTrue[uiMergeIndex] == 1) 443 { 444 iVSPIdx = 1; 445 } 378 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, numValidMergeCand, uiMergeIndex ); 379 #endif 380 #endif// end of MTK_VSP_FIX_ALIGN_WD_E0172 381 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); 446 382 #else 447 Int numVspIdx; 448 numVspIdx = 3; 449 for (Int i = 0; i < numVspIdx; i++) 450 { 451 if (iVSPIndexTrue[i] == uiMergeIndex) 452 { 453 iVSPIdx = i+1; 454 break; 455 } 456 } 457 #endif 458 pcCU->setVSPIndexSubParts( iVSPIdx, uiAbsPartIdx, 0, uiDepth ); // Initialize 459 #if MERL_VSP_NBDV_RefVId_Fix_D0166 460 pcCU->setVSPDirSubParts( 0, uiAbsPartIdx, 0, uiDepth ); 461 #endif 462 #if QC_BVSP_CleanUP_D0191 && !LGE_VSP_INHERIT_D0092 463 if(iVSPIdx != 0) 464 { 465 Int iIVCIdx = pcCU->getSlice()->getRefPic(REF_PIC_LIST_0, 0)->getPOC()==pcCU->getSlice()->getPOC() ? 0: pcCU->getSlice()->getNewRefIdx(REF_PIC_LIST_0); 466 cMvFieldNeighbours[ 2*uiMergeIndex].setRefIdx(iIVCIdx); 467 } 468 #endif 469 } 470 #else 471 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 383 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 384 #endif 385 #if MTK_VSP_FIX_ALIGN_WD_E0172 386 if(vspFlag[uiMergeIndex]) 387 { 388 pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeIndex].m_acDvInfo, uiAbsPartIdx, 0, uiDepth); 389 } 472 390 #endif 473 391 pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); … … 484 402 } 485 403 } 486 #if LGE_ILLUCOMP_B0045404 #if H_3D_IC 487 405 m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 488 406 #endif 489 #if HHI_MPI 490 } 491 #endif 492 #if QC_ARP_D0177 493 if( pcCU->getSlice()->getSPS()->getUseAdvRP() ) 494 { 495 pcCU->setResPredAvailSubParts ( false, uiAbsPartIdx, 0, uiDepth ); 496 pcCU->setResPredFlagSubParts ( false, uiAbsPartIdx, 0, uiDepth ); 497 m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth, m_ppcCU[uiDepth], 0 ); 498 } 407 #if H_3D_ARP 408 m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth ); 499 409 #endif 500 410 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast ); … … 502 412 } 503 413 504 #if HHI_MPI 505 if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 ) 506 { 507 #endif 508 if( pcCU->getNumSucIPCM() == 0 ) 509 { 510 m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth ); 511 m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth ); 512 } 513 else 514 { 515 pcCU->setPredModeSubParts( MODE_INTRA, uiAbsPartIdx, uiDepth ); 516 pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 517 pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth ); 518 pcCU->setTrIdxSubParts( 0, uiAbsPartIdx, uiDepth ); 519 } 414 m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth ); 415 m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth ); 520 416 521 417 if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) … … 530 426 } 531 427 532 #if ! HHI_MPI533 428 UInt uiCurrWidth = pcCU->getWidth ( uiAbsPartIdx ); 534 429 UInt uiCurrHeight = pcCU->getHeight( uiAbsPartIdx ); 535 #endif536 430 537 431 // prediction mode ( Intra : direction mode, Inter : Mv, reference idx ) 538 432 m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]); 539 540 #if LGE_ILLUCOMP_B0045 541 #if LGE_ILLUCOMP_DEPTH_C0046 && HHI_MPI 542 if( pcCU->getTextureModeDepth( uiAbsPartIdx ) != uiDepth ) 543 { 544 #endif 433 #if H_3D_IC 545 434 m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 546 435 #endif 547 548 #if LGE_ILLUCOMP_DEPTH_C0046 && HHI_MPI 549 } 550 #endif 551 #if QC_ARP_D0177 552 if (pcCU->getSlice()->getSPS()->getUseAdvRP() && pcCU->isIntra( uiAbsPartIdx ) ) 553 { 554 pcCU->setResPredAvailSubParts ( 0, uiAbsPartIdx, 0, uiDepth ); 555 pcCU->setResPredFlagSubParts ( 0, uiAbsPartIdx, 0, uiDepth ); 556 } 557 #endif 558 #if HHI_MPI 559 if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == uiDepth ) 560 { 561 assert( pcCU->getZorderIdxInCU() == 0 ); 562 TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ); 563 pcCU->copyTextureMotionDataFrom( pcTextureCU, uiDepth, pcCU->getZorderIdxInCU() + uiAbsPartIdx, uiAbsPartIdx ); 564 565 UInt uiCurrPartNumb = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); 566 567 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) 568 { 569 const UChar uhNewDepth = max<UInt>( uiDepth, pcTextureCU->getDepth( uiAbsPartIdx + ui ) ); 570 #if MERL_VSP_C0152 571 Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui); 572 pcCU->setVSPIndex( uiAbsPartIdx + ui, vspIdx); 573 #endif 574 #if MERL_VSP_NBDV_RefVId_Fix_D0166 575 if (pcCU->getSlice()->getIsDepth()) { 576 pcCU->setVSPDir( uiAbsPartIdx + ui, 0); 577 } 578 else { 579 Int vspDir = pcTextureCU->getVSPDir( uiAbsPartIdx + ui); 580 pcCU->setVSPDir( uiAbsPartIdx + ui, vspDir); 581 } 582 #endif 583 pcCU->setPredictionMode( uiAbsPartIdx + ui, MODE_INTER ); 584 pcCU->setPartitionSize( uiAbsPartIdx + ui, SIZE_2Nx2N ); 585 pcCU->setDepth( uiAbsPartIdx + ui, uhNewDepth ); 586 pcCU->setWidth( uiAbsPartIdx + ui, g_uiMaxCUWidth>>uhNewDepth ); 587 pcCU->setHeight( uiAbsPartIdx + ui, g_uiMaxCUHeight>>uhNewDepth ); 588 } 589 #if LGE_ILLUCOMP_DEPTH_C0046 590 m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 591 #endif 592 if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth ) ) || bBoundary ) 593 { 594 UInt uiIdx = uiAbsPartIdx; 595 if( (g_uiMaxCUWidth>>uiDepth) == pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP()) 596 { 597 setdQPFlag(true); 598 pcCU->setQPSubParts( pcCU->getRefQP(uiAbsPartIdx), uiAbsPartIdx, uiDepth ); // set QP to default QP 599 } 600 601 for ( UInt uiPartUnitIdx = 0; uiPartUnitIdx < 4; uiPartUnitIdx++ ) 602 { 603 uiLPelX = pcCU->getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiIdx] ]; 604 uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiIdx] ]; 605 606 Bool bSubInSlice = pcCU->getSCUAddr()+uiIdx+uiQNumParts>pcSlice->getEntropySliceCurStartCUAddr(); 607 if ( bSubInSlice ) 608 { 609 if ( ( uiLPelX < pcCU->getSlice()->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples() ) ) 610 { 611 xDecodeCU( pcCU, uiIdx, uiDepth+1, ruiIsLast ); 612 } 613 else 614 { 615 pcCU->setOutsideCUPart( uiIdx, uiDepth+1 ); 616 } 617 } 618 if(ruiIsLast) 619 { 620 break; 621 } 622 uiIdx += uiQNumParts; 623 } 624 if( (g_uiMaxCUWidth>>uiDepth) == pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP()) 625 { 626 if ( getdQPFlag() ) 627 { 628 UInt uiQPSrcPartIdx; 629 if ( pcPic->getCU( pcCU->getAddr() )->getEntropySliceStartCU(uiAbsPartIdx) != pcSlice->getEntropySliceCurStartCUAddr() ) 630 { 631 uiQPSrcPartIdx = pcSlice->getEntropySliceCurStartCUAddr() % pcPic->getNumPartInCU(); 632 } 633 else 634 { 635 uiQPSrcPartIdx = uiAbsPartIdx; 636 } 637 pcCU->setQPSubParts( pcCU->getRefQP( uiQPSrcPartIdx ), uiAbsPartIdx, uiDepth ); // set QP to default QP 638 } 639 } 640 return; 641 } 642 } 643 } 644 645 UInt uiCurrWidth = pcCU->getWidth ( uiAbsPartIdx ); 646 UInt uiCurrHeight = pcCU->getHeight( uiAbsPartIdx ); 647 #endif 648 436 #if H_3D_ARP 437 m_pcEntropyDecoder->decodeARPW ( pcCU , uiAbsPartIdx , uiDepth ); 438 #endif 439 #if LGE_INTER_SDC_E0156 440 m_pcEntropyDecoder->decodeInterSDCFlag( pcCU, uiAbsPartIdx, uiDepth ); 441 #endif 649 442 // Coefficient decoding 650 443 Bool bCodeDQP = getdQPFlag(); … … 656 449 Void TDecCu::xFinishDecodeCU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt& ruiIsLast) 657 450 { 658 if( (g_uiMaxCUWidth>>uiDepth) >= pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP()) 659 { 660 if( getdQPFlag() ) 661 { 662 pcCU->setQPSubParts( pcCU->getRefQP(uiAbsPartIdx), uiAbsPartIdx, uiDepth ); // set QP to default QP 663 } 664 } 665 666 if( pcCU->getNumSucIPCM() > 0 ) 667 { 668 ruiIsLast = 0; 669 return; 451 if( pcCU->getSlice()->getPPS()->getUseDQP()) 452 { 453 pcCU->setQPSubParts( getdQPFlag()?pcCU->getRefQP(uiAbsPartIdx):pcCU->getCodedQP(), uiAbsPartIdx, uiDepth ); // set QP 670 454 } 671 455 … … 673 457 } 674 458 675 Void TDecCu::xDecompressCU( TComDataCU* pcCU, TComDataCU* pcCUCur,UInt uiAbsPartIdx, UInt uiDepth )459 Void TDecCu::xDecompressCU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 676 460 { 677 461 TComPic* pcPic = pcCU->getPic(); … … 685 469 UInt uiCurNumParts = pcPic->getNumPartInCU() >> (uiDepth<<1); 686 470 TComSlice * pcSlice = pcCU->getPic()->getSlice(pcCU->getPic()->getCurrSliceIdx()); 687 Bool bStartInCU = pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts>pcSlice->get EntropySliceCurStartCUAddr()&&pcCU->getSCUAddr()+uiAbsPartIdx<pcSlice->getEntropySliceCurStartCUAddr();471 Bool bStartInCU = pcCU->getSCUAddr()+uiAbsPartIdx+uiCurNumParts>pcSlice->getSliceSegmentCurStartCUAddr()&&pcCU->getSCUAddr()+uiAbsPartIdx<pcSlice->getSliceSegmentCurStartCUAddr(); 688 472 if(bStartInCU||( uiRPelX >= pcSlice->getSPS()->getPicWidthInLumaSamples() ) || ( uiBPelY >= pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 689 473 { … … 701 485 uiTPelY = pcCU->getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiIdx] ]; 702 486 703 Bool binSlice = (pcCU->getSCUAddr()+uiIdx+uiQNumParts>pcSlice->get EntropySliceCurStartCUAddr())&&(pcCU->getSCUAddr()+uiIdx<pcSlice->getEntropySliceCurEndCUAddr());487 Bool binSlice = (pcCU->getSCUAddr()+uiIdx+uiQNumParts>pcSlice->getSliceSegmentCurStartCUAddr())&&(pcCU->getSCUAddr()+uiIdx<pcSlice->getSliceSegmentCurEndCUAddr()); 704 488 if(binSlice&&( uiLPelX < pcSlice->getSPS()->getPicWidthInLumaSamples() ) && ( uiTPelY < pcSlice->getSPS()->getPicHeightInLumaSamples() ) ) 705 489 { 706 xDecompressCU(pcCU, m_ppcCU[uiNextDepth],uiIdx, uiNextDepth );490 xDecompressCU(pcCU, uiIdx, uiNextDepth ); 707 491 } 708 492 … … 719 503 switch( m_ppcCU[uiDepth]->getPredictionMode(0) ) 720 504 { 721 case MODE_SKIP:722 505 case MODE_INTER: 723 xReconInter( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth ); 506 #if LGE_INTER_SDC_E0156 507 if( m_ppcCU[uiDepth]->getInterSDCFlag( 0 ) ) 508 { 509 xReconInterSDC( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth ); 510 } 511 else 512 { 513 #endif 514 xReconInter( m_ppcCU[uiDepth], uiDepth ); 515 #if LGE_INTER_SDC_E0156 516 } 517 #endif 724 518 break; 725 519 case MODE_INTRA: 726 #if RWTH_SDC_DLT_B0036520 #if H_3D_DIM_SDC 727 521 if( m_ppcCU[uiDepth]->getSDCFlag(0) ) 728 522 xReconIntraSDC( m_ppcCU[uiDepth], 0, uiDepth ); 729 523 else 730 524 #endif 731 xReconIntraQT( m_ppcCU[uiDepth], ui AbsPartIdx, uiDepth );525 xReconIntraQT( m_ppcCU[uiDepth], uiDepth ); 732 526 break; 733 527 default: … … 735 529 break; 736 530 } 737 #if LOSSLESS_CODING738 531 if ( m_ppcCU[uiDepth]->isLosslessCoded(0) && (m_ppcCU[uiDepth]->getIPCMFlag(0) == false)) 739 532 { 740 xFillPCMBuffer(m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth); 741 } 742 #endif 533 xFillPCMBuffer(m_ppcCU[uiDepth], uiDepth); 534 } 743 535 744 536 xCopyToPic( m_ppcCU[uiDepth], pcPic, uiAbsPartIdx, uiDepth ); 745 537 } 746 538 747 Void TDecCu::xReconInter( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 748 { 749 #if HHI_MPI 750 #if FIX_MPI_B0065 751 if( pcCU->getTextureModeDepth( 0 ) != -1 ) 752 { 753 TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ); 754 if( uiDepth == pcTextureCU->getDepth(uiAbsPartIdx)) 755 { 756 PartSize partSize = pcTextureCU->getPartitionSize(uiAbsPartIdx); 757 pcCU->setPartSizeSubParts( partSize, 0, uiDepth ); 758 } 759 else 760 { 761 pcCU->setPartSizeSubParts( SIZE_NxN, 0, uiDepth ); 762 } 763 } 764 #else 765 if( pcCU->getTextureModeDepth( 0 ) != -1 ) 766 pcCU->setPartSizeSubParts( SIZE_NxN, 0, uiDepth ); 767 #endif 768 #endif 539 Void TDecCu::xReconInter( TComDataCU* pcCU, UInt uiDepth ) 540 { 769 541 770 542 // inter prediction 771 #if MERL_VSP_C0152772 m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth], uiAbsPartIdx );773 #else774 543 m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] ); 775 #endif 776 #if H3D_IVRP & !QC_ARP_D0177 777 if (pcCU->getMergeFlag(0) && pcCU->getMergeIndex(0)==0 && pcCU->getResPredAvail(0)) 778 { 779 m_pcPrediction->residualPrediction(pcCU, m_ppcYuvReco[uiDepth], m_ppcYuvResPred[uiDepth]); 780 } 781 #endif 782 783 #if HHI_MPI 784 if( pcCU->getTextureModeDepth( 0 ) != -1 ) 785 pcCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); 786 #endif 787 544 788 545 // inter recon 789 546 xDecodeInterTexture( pcCU, 0, uiDepth ); … … 796 553 else 797 554 { 798 #if H3D_IVRP799 if (pcCU->getMergeFlag(0) && pcCU->getMergeIndex(0)==0 && pcCU->getResPredAvail(0))800 {801 m_ppcYuvReco[uiDepth]->clip( pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) );802 }803 #endif804 555 m_ppcYuvReco[uiDepth]->copyPartToPartYuv( m_ppcYuvReco[uiDepth],0, pcCU->getWidth( 0 ),pcCU->getHeight( 0 )); 805 556 } 806 557 } 558 559 #if LGE_INTER_SDC_E0156 560 Void TDecCu::xReconInterSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 561 { 562 // inter prediction 563 m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] ); 564 565 UInt uiWidth = pcCU->getWidth ( 0 ); 566 UInt uiHeight = pcCU->getHeight( 0 ); 567 UChar* pMask = pcCU->getInterSDCMask(); 568 569 memset( pMask, 0, uiWidth*uiHeight ); 570 pcCU->xSetInterSDCCUMask( pcCU, pMask ); 571 572 Pel *pResi; 573 UInt uiPelX, uiPelY; 574 UInt uiResiStride = m_ppcYuvResi[uiDepth]->getStride(); 575 576 pResi = m_ppcYuvResi[uiDepth]->getLumaAddr( 0 ); 577 for( uiPelY = 0; uiPelY < uiHeight; uiPelY++ ) 578 { 579 for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ ) 580 { 581 UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ]; 582 583 pResi[ uiPelX ] = pcCU->getInterSDCSegmentDCOffset( uiSeg, 0 );; 584 } 585 pResi += uiResiStride; 586 } 587 588 m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ) ); 589 590 // clear UV 591 UInt uiStrideC = m_ppcYuvReco[uiDepth]->getCStride(); 592 Pel *pRecCb = m_ppcYuvReco[uiDepth]->getCbAddr(); 593 Pel *pRecCr = m_ppcYuvReco[uiDepth]->getCrAddr(); 594 595 for (Int y = 0; y < uiHeight/2; y++) 596 { 597 for (Int x = 0; x < uiWidth/2; x++) 598 { 599 pRecCb[x] = (Pel)( 1 << ( g_bitDepthC - 1 ) ); 600 pRecCr[x] = (Pel)( 1 << ( g_bitDepthC - 1 ) ); 601 } 602 603 pRecCb += uiStrideC; 604 pRecCr += uiStrideC; 605 } 606 } 607 #endif 807 608 808 609 Void … … 829 630 Pel* piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); 830 631 UInt uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); 831 632 Bool useTransformSkip = pcCU->getTransformSkip(uiAbsPartIdx, TEXT_LUMA); 832 633 //===== init availability pattern ===== 833 634 Bool bAboveAvail = false; … … 839 640 m_pcPrediction->getPredicBufHeight (), 840 641 bAboveAvail, bLeftAvail ); 841 #if LGE_EDGE_INTRA_A0070 842 if( uiLumaPredMode >= EDGE_INTRA_IDX ) 843 { 844 m_pcPrediction->predIntraLumaEdge( pcCU, pcCU->getPattern(), uiAbsPartIdx, uiWidth, uiHeight, piPred, uiStride 845 #if LGE_EDGE_INTRA_DELTA_DC 846 , uiLumaPredMode == EDGE_INTRA_DELTA_IDX 847 #endif 848 ); 849 } 642 643 //===== get prediction signal ===== 644 #if H_3D_DIM 645 if( isDimMode( uiLumaPredMode ) ) 646 { 647 m_pcPrediction->predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight ); 648 } 850 649 else 851 #endif 852 853 //===== get prediction signal ===== 854 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 855 if( uiLumaPredMode >= NUM_INTRA_MODE ) 856 { 857 m_pcPrediction->predIntraLumaDMM( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail, false ); 858 } 859 else 860 { 861 #endif 862 m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, pcCU, bAboveAvail, bLeftAvail ); 863 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 650 { 651 #endif 652 m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail ); 653 #if H_3D_DIM 864 654 } 865 655 #endif 866 656 867 657 //===== inverse transform ===== 868 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(),TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 );658 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 ); 869 659 870 660 Int scalingListType = (pcCU->isIntra(uiAbsPartIdx) ? 0 : 3) + g_eTTable[(Int)TEXT_LUMA]; 871 661 assert(scalingListType < 6); 872 #if LOSSLESS_CODING 873 m_pcTrQuant->invtransformNxN( pcCU, TEXT_LUMA, pcCU->getLumaIntraDir( uiAbsPartIdx ), piResi, uiStride, pcCoeff, uiWidth, uiHeight, scalingListType ); 874 #else 875 m_pcTrQuant->invtransformNxN( TEXT_LUMA, pcCU->getLumaIntraDir( uiAbsPartIdx ), piResi, uiStride, pcCoeff, uiWidth, uiHeight, scalingListType ); 876 #endif 662 m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA, pcCU->getLumaIntraDir( uiAbsPartIdx ), piResi, uiStride, pcCoeff, uiWidth, uiHeight, scalingListType, useTransformSkip ); 877 663 878 664 … … 886 672 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 887 673 { 888 pReco [ uiX ] = Clip ( pPred[ uiX ] + pResi[ uiX ] );674 pReco [ uiX ] = ClipY( pPred[ uiX ] + pResi[ uiX ] ); 889 675 pRecIPred[ uiX ] = pReco[ uiX ]; 890 676 } … … 937 723 Pel* piRecIPred = ( uiChromaId > 0 ? pcCU->getPic()->getPicYuvRec()->getCrAddr( pcCU->getAddr(), uiZOrder ) : pcCU->getPic()->getPicYuvRec()->getCbAddr( pcCU->getAddr(), uiZOrder ) ); 938 724 UInt uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getCStride(); 939 725 Bool useTransformSkipChroma = pcCU->getTransformSkip(uiAbsPartIdx,eText); 940 726 //===== init availability pattern ===== 941 727 Bool bAboveAvail = false; … … 943 729 pcCU->getPattern()->initPattern ( pcCU, uiTrDepth, uiAbsPartIdx ); 944 730 945 if( uiChromaPredMode == LM_CHROMA_IDX && uiChromaId == 0 ) 946 { 947 pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, uiTrDepth, 948 m_pcPrediction->getPredicBuf (), 949 m_pcPrediction->getPredicBufWidth (), 950 m_pcPrediction->getPredicBufHeight (), 951 bAboveAvail, bLeftAvail, 952 true ); 953 954 m_pcPrediction->getLumaRecPixels( pcCU->getPattern(), uiWidth, uiHeight ); 955 } 956 957 pcCU->getPattern()->initAdiPatternChroma( pcCU, uiAbsPartIdx, uiTrDepth, 731 pcCU->getPattern()->initAdiPatternChroma( pcCU, uiAbsPartIdx, uiTrDepth, 958 732 m_pcPrediction->getPredicBuf (), 959 733 m_pcPrediction->getPredicBufWidth (), … … 963 737 964 738 //===== get prediction signal ===== 965 if( uiChromaPredMode == LM_CHROMA_IDX ) 966 { 967 m_pcPrediction->predLMIntraChroma( pcCU->getPattern(), pPatChroma, piPred, uiStride, uiWidth, uiHeight, uiChromaId ); 739 { 740 if( uiChromaPredMode == DM_CHROMA_IDX ) 741 { 742 uiChromaPredMode = pcCU->getLumaIntraDir( 0 ); 743 #if H_3D_DIM 744 mapDepthModeToIntraDir( uiChromaPredMode ); 745 #endif 746 } 747 m_pcPrediction->predIntraChromaAng( pPatChroma, uiChromaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail ); 748 } 749 750 //===== inverse transform ===== 751 Int curChromaQpOffset; 752 if(eText == TEXT_CHROMA_U) 753 { 754 curChromaQpOffset = pcCU->getSlice()->getPPS()->getChromaCbQpOffset() + pcCU->getSlice()->getSliceQpDeltaCb(); 968 755 } 969 756 else 970 757 { 971 if( uiChromaPredMode == DM_CHROMA_IDX ) 972 { 973 uiChromaPredMode = pcCU->getLumaIntraDir( 0 ); 974 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 975 mapDMMtoIntraMode( uiChromaPredMode ); 976 #endif 977 } 978 m_pcPrediction->predIntraChromaAng( pcCU->getPattern(), pPatChroma, uiChromaPredMode, piPred, uiStride, uiWidth, uiHeight, pcCU, bAboveAvail, bLeftAvail ); 979 } 980 981 //===== inverse transform ===== 982 if(eText == TEXT_CHROMA_U) 983 { 984 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), eText, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), pcCU->getSlice()->getPPS()->getChromaQpOffset() ); 985 } 986 else 987 { 988 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), eText, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), pcCU->getSlice()->getPPS()->getChromaQpOffset2nd() ); 989 } 758 curChromaQpOffset = pcCU->getSlice()->getPPS()->getChromaCrQpOffset() + pcCU->getSlice()->getSliceQpDeltaCr(); 759 } 760 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), eText, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset ); 990 761 991 762 Int scalingListType = (pcCU->isIntra(uiAbsPartIdx) ? 0 : 3) + g_eTTable[(Int)eText]; 992 763 assert(scalingListType < 6); 993 #if LOSSLESS_CODING 994 m_pcTrQuant->invtransformNxN( pcCU, eText, REG_DCT, piResi, uiStride, pcCoeff, uiWidth, uiHeight, scalingListType ); 995 #else 996 m_pcTrQuant->invtransformNxN( eText, REG_DCT, piResi, uiStride, pcCoeff, uiWidth, uiHeight, scalingListType ); 997 #endif 764 m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), eText, REG_DCT, piResi, uiStride, pcCoeff, uiWidth, uiHeight, scalingListType, useTransformSkipChroma ); 998 765 999 766 //===== reconstruction ===== … … 1006 773 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 1007 774 { 1008 pReco [ uiX ] = Clip ( pPred[ uiX ] + pResi[ uiX ] );775 pReco [ uiX ] = ClipC( pPred[ uiX ] + pResi[ uiX ] ); 1009 776 pRecIPred[ uiX ] = pReco[ uiX ]; 1010 777 } … … 1016 783 } 1017 784 785 1018 786 Void 1019 TDecCu::xIntraRecQT( TComDataCU* pcCU, 1020 UInt uiTrDepth, 1021 UInt uiAbsPartIdx, 1022 TComYuv* pcRecoYuv, 1023 TComYuv* pcPredYuv, 1024 TComYuv* pcResiYuv ) 1025 { 1026 UInt uiFullDepth = pcCU->getDepth(0) + uiTrDepth; 1027 UInt uiTrMode = pcCU->getTransformIdx( uiAbsPartIdx ); 1028 if( uiTrMode == uiTrDepth ) 1029 { 1030 xIntraRecLumaBlk ( pcCU, uiTrDepth, uiAbsPartIdx, pcRecoYuv, pcPredYuv, pcResiYuv ); 1031 xIntraRecChromaBlk( pcCU, uiTrDepth, uiAbsPartIdx, pcRecoYuv, pcPredYuv, pcResiYuv, 0 ); 1032 xIntraRecChromaBlk( pcCU, uiTrDepth, uiAbsPartIdx, pcRecoYuv, pcPredYuv, pcResiYuv, 1 ); 1033 } 1034 else 1035 { 1036 UInt uiNumQPart = pcCU->getPic()->getNumPartInCU() >> ( ( uiFullDepth + 1 ) << 1 ); 1037 for( UInt uiPart = 0; uiPart < 4; uiPart++ ) 1038 { 1039 xIntraRecQT( pcCU, uiTrDepth + 1, uiAbsPartIdx + uiPart * uiNumQPart, pcRecoYuv, pcPredYuv, pcResiYuv ); 1040 } 1041 } 1042 } 1043 1044 Void 1045 TDecCu::xReconIntraQT( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 787 TDecCu::xReconIntraQT( TComDataCU* pcCU, UInt uiDepth ) 1046 788 { 1047 789 UInt uiInitTrDepth = ( pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1 ); … … 1051 793 if (pcCU->getIPCMFlag(0)) 1052 794 { 1053 xReconPCM( pcCU, ui AbsPartIdx, uiDepth );795 xReconPCM( pcCU, uiDepth ); 1054 796 return; 1055 797 } … … 1067 809 } 1068 810 1069 #if RWTH_SDC_DLT_B0036811 #if H_3D_DIM_SDC 1070 812 Void TDecCu::xReconIntraSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1071 813 { … … 1100 842 1101 843 //===== get prediction signal ===== 1102 #if H HI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX1103 if( uiLumaPredMode >= NUM_INTRA_MODE)1104 { 1105 m_pcPrediction->predIntraLumaD MM( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail, false);844 #if H_3D_DIM 845 if( isDimMode( uiLumaPredMode ) ) 846 { 847 m_pcPrediction->predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight ); 1106 848 } 1107 849 else 1108 850 { 1109 851 #endif 1110 m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, pcCU,bAboveAvail, bLeftAvail );1111 #if H HI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX852 m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail ); 853 #if H_3D_DIM 1112 854 } 1113 855 #endif 1114 856 1115 857 // number of segments depends on prediction mode 1116 UInt uiNumSegments = 1; 858 UInt uiNumSegments = 1; 1117 859 Bool* pbMask = NULL; 1118 860 UInt uiMaskStride = 0; 1119 861 1120 if( uiLumaPredMode == DMM_WEDGE_FULL_IDX || uiLumaPredMode == DMM_WEDGE_PREDDIR_IDX )1121 { 1122 Int uiTabIdx = (uiLumaPredMode == DMM_WEDGE_FULL_IDX)?pcCU->getWedgeFullTabIdx(uiAbsPartIdx):pcCU->getWedgePredDirTabIdx(uiAbsPartIdx);862 if( getDimType( uiLumaPredMode ) == DMM1_IDX ) 863 { 864 Int uiTabIdx = pcCU->getDmmWedgeTabIdx(DMM1_IDX, uiAbsPartIdx); 1123 865 1124 WedgeList* pacWedgeList = &g_ aacWedgeLists[(g_aucConvertToBit[uiWidth])];866 WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])]; 1125 867 TComWedgelet* pcWedgelet = &(pacWedgeList->at( uiTabIdx )); 1126 868 … … 1132 874 // get DC prediction for each segment 1133 875 Pel apDCPredValues[2]; 1134 xAnalyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride); 876 #if KWU_SDC_SIMPLE_DC_E0117 877 m_pcPrediction->analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode); 878 #else 879 m_pcPrediction->analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride); 880 #endif 1135 881 1136 882 // reconstruct residual based on mask + DC residuals 1137 883 Pel apDCResiValues[2]; 1138 #if !MERL_General_Fix 1139 Pel apDCRecoValues[2]; 1140 #endif 1141 for( UInt ui = 0; ui < uiNumSegments; ui++ ) 1142 { 1143 Pel pPredIdx = GetDepthValue2Idx( apDCPredValues[ui] ); 1144 Pel pResiIdx = pcCU->getSDCSegmentDCOffset(ui, uiAbsPartIdx); 1145 Pel pRecoValue = GetIdx2DepthValue( pPredIdx + pResiIdx ); 884 for( UInt uiSegment = 0; uiSegment < uiNumSegments; uiSegment++ ) 885 { 886 #if H_3D_DIM_DLT 887 Pel pPredIdx = pcCU->getSlice()->getVPS()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] ); 888 Pel pResiIdx = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx); 889 Pel pRecoValue = pcCU->getSlice()->getVPS()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pPredIdx + pResiIdx ); 1146 890 1147 #if !MERL_General_Fix 1148 apDCRecoValues[ui] = pRecoValue; 1149 #endif 1150 apDCResiValues[ui] = pRecoValue - apDCPredValues[ui]; 891 apDCResiValues[uiSegment] = pRecoValue - apDCPredValues[uiSegment]; 892 #else 893 apDCResiValues[uiSegment] = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx); 894 #endif 1151 895 } 1152 896 … … 1164 908 UChar ucSegment = pMask?(UChar)pMask[uiX]:0; 1165 909 assert( ucSegment < uiNumSegments ); 1166 #if MTK_SAMPLE_BASED_SDC_D0110910 1167 911 Pel pResiDC = apDCResiValues[ucSegment]; 1168 912 1169 pReco [ uiX ] = Clip( pPred[ uiX ] + pResiDC ); 1170 #else 1171 Pel pPredVal= apDCPredValues[ucSegment]; 1172 Pel pResiDC = apDCResiValues[ucSegment]; 1173 1174 pReco [ uiX ] = Clip( pPredVal + pResiDC ); 1175 #endif 913 pReco [ uiX ] = ClipY( pPred[ uiX ] + pResiDC ); 1176 914 pRecIPred[ uiX ] = pReco[ uiX ]; 1177 915 } … … 1192 930 for (Int x=0; x<uiWidth/2; x++) 1193 931 { 1194 pRecCb[x] = (Pel)(128<<g_uiBitIncrement);1195 pRecCr[x] = (Pel)(128<<g_uiBitIncrement);932 pRecCb[x] = 128; 933 pRecCr[x] = 128; 1196 934 } 1197 935 … … 1287 1025 1288 1026 Pel* pResi; 1289 UInt uiLumaTrMode, uiChromaTrMode; 1290 1291 pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx( uiAbsPartIdx ), uiLumaTrMode, uiChromaTrMode ); 1027 UInt trMode = pcCU->getTransformIdx( uiAbsPartIdx ); 1292 1028 1293 1029 // Y … … 1295 1031 pResi = m_ppcYuvResi[uiDepth]->getLumaAddr(); 1296 1032 1297 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(),TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 );1298 1299 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_LUMA, pResi, 0, m_ppcYuvResi[uiDepth]->getStride(), uiWidth, uiHeight, uiLumaTrMode, 0, piCoeff );1033 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 ); 1034 1035 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_LUMA, pResi, 0, m_ppcYuvResi[uiDepth]->getStride(), uiWidth, uiHeight, trMode, 0, piCoeff ); 1300 1036 1301 1037 // Cb and Cr 1302 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), pcCU->getSlice()->getPPS()->getChromaQpOffset() ); 1038 Int curChromaQpOffset = pcCU->getSlice()->getPPS()->getChromaCbQpOffset() + pcCU->getSlice()->getSliceQpDeltaCb(); 1039 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset ); 1303 1040 1304 1041 uiWidth >>= 1; 1305 1042 uiHeight >>= 1; 1306 1043 piCoeff = pcCU->getCoeffCb(); pResi = m_ppcYuvResi[uiDepth]->getCbAddr(); 1307 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_CHROMA_U, pResi, 0, m_ppcYuvResi[uiDepth]->getCStride(), uiWidth, uiHeight, uiChromaTrMode, 0, piCoeff ); 1308 1309 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), pcCU->getSlice()->getPPS()->getChromaQpOffset2nd() ); 1044 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_CHROMA_U, pResi, 0, m_ppcYuvResi[uiDepth]->getCStride(), uiWidth, uiHeight, trMode, 0, piCoeff ); 1045 1046 curChromaQpOffset = pcCU->getSlice()->getPPS()->getChromaCrQpOffset() + pcCU->getSlice()->getSliceQpDeltaCr(); 1047 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), curChromaQpOffset ); 1310 1048 1311 1049 piCoeff = pcCU->getCoeffCr(); pResi = m_ppcYuvResi[uiDepth]->getCrAddr(); 1312 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_CHROMA_V, pResi, 0, m_ppcYuvResi[uiDepth]->getCStride(), uiWidth, uiHeight, uiChromaTrMode, 0, piCoeff );1050 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_CHROMA_V, pResi, 0, m_ppcYuvResi[uiDepth]->getCStride(), uiWidth, uiHeight, trMode, 0, piCoeff ); 1313 1051 } 1314 1052 … … 1335 1073 uiPicStride = pcCU->getPic()->getPicYuvRec()->getStride(); 1336 1074 piPicReco = pcCU->getPic()->getPicYuvRec()->getLumaAddr(pcCU->getAddr(), pcCU->getZorderIdxInCU()+uiPartIdx); 1337 uiPcmLeftShiftBit = g_ uiBitDepth + g_uiBitIncrement- pcCU->getSlice()->getSPS()->getPCMBitDepthLuma();1075 uiPcmLeftShiftBit = g_bitDepthY - pcCU->getSlice()->getSPS()->getPCMBitDepthLuma(); 1338 1076 } 1339 1077 else … … 1349 1087 piPicReco = pcCU->getPic()->getPicYuvRec()->getCrAddr(pcCU->getAddr(), pcCU->getZorderIdxInCU()+uiPartIdx); 1350 1088 } 1351 uiPcmLeftShiftBit = g_ uiBitDepth + g_uiBitIncrement- pcCU->getSlice()->getSPS()->getPCMBitDepthChroma();1089 uiPcmLeftShiftBit = g_bitDepthC - pcCU->getSlice()->getSPS()->getPCMBitDepthChroma(); 1352 1090 } 1353 1091 … … 1367 1105 /** Function for reconstructing a PCM mode CU. 1368 1106 * \param pcCU pointer to current CU 1369 * \param uiAbsPartIdx CU index1370 1107 * \param uiDepth CU Depth 1371 1108 * \returns Void 1372 1109 */ 1373 Void TDecCu::xReconPCM( TComDataCU* pcCU, UInt ui AbsPartIdx, UInt uiDepth )1110 Void TDecCu::xReconPCM( TComDataCU* pcCU, UInt uiDepth ) 1374 1111 { 1375 1112 // Luma … … 1399 1136 } 1400 1137 1401 #if LOSSLESS_CODING1402 1138 /** Function for filling the PCM buffer of a CU using its reconstructed sample array 1403 1139 * \param pcCU pointer to current CU 1404 * \param uiAbsPartIdx CU index1405 1140 * \param uiDepth CU Depth 1406 1141 * \returns Void 1407 1142 */ 1408 Void TDecCu::xFillPCMBuffer(TComDataCU* pCU, UInt absPartIdx, UIntdepth)1143 Void TDecCu::xFillPCMBuffer(TComDataCU* pCU, UInt depth) 1409 1144 { 1410 1145 // Luma … … 1452 1187 1453 1188 } 1454 #endif1455 1456 #if RWTH_SDC_DLT_B00361457 Void TDecCu::xAnalyzeSegmentsSDC( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride )1458 {1459 Int iSumDepth[2];1460 memset(iSumDepth, 0, sizeof(Int)*2);1461 Int iSumPix[2];1462 memset(iSumPix, 0, sizeof(Int)*2);1463 #if HS_REFERENCE_SUBSAMPLE_C01541464 Int subSamplePix;1465 if ( uiSize == 64 || uiSize == 32 )1466 {1467 subSamplePix = 2;1468 }1469 else1470 {1471 subSamplePix = 1;1472 }1473 for (Int y=0; y<uiSize; y+=subSamplePix)1474 {1475 for (Int x=0; x<uiSize; x+=subSamplePix)1476 {1477 UChar ucSegment = pMask?(UChar)pMask[x]:0;1478 assert( ucSegment < uiNumSegments );1479 1480 iSumDepth[ucSegment] += pOrig[x];1481 iSumPix[ucSegment] += 1;1482 }1483 pOrig += uiStride*subSamplePix;1484 pMask += uiMaskStride*subSamplePix;1485 }1486 #else1487 for (Int y=0; y<uiSize; y++)1488 {1489 for (Int x=0; x<uiSize; x++)1490 {1491 UChar ucSegment = pMask?(UChar)pMask[x]:0;1492 assert( ucSegment < uiNumSegments );1493 1494 iSumDepth[ucSegment] += pOrig[x];1495 iSumPix[ucSegment] += 1;1496 }1497 1498 pOrig += uiStride;1499 pMask += uiMaskStride;1500 }1501 #endif1502 // compute mean for each segment1503 for( UChar ucSeg = 0; ucSeg < uiNumSegments; ucSeg++ )1504 {1505 if( iSumPix[ucSeg] > 0 )1506 rpSegMeans[ucSeg] = iSumDepth[ucSeg] / iSumPix[ucSeg];1507 else1508 rpSegMeans[ucSeg] = 0; // this happens for zero-segments1509 }1510 }1511 #endif1512 1189 1513 1190 //! \}
Note: See TracChangeset for help on using the changeset viewer.