Changeset 296 in 3DVCSoftware for trunk/source/Lib/TLibDecoder/TDecCu.cpp
- Timestamp:
- 20 Feb 2013, 22:07:43 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibDecoder/TDecCu.cpp
r189 r296 54 54 m_ppcYuvResi = NULL; 55 55 m_ppcYuvReco = NULL; 56 #if H HI_INTER_VIEW_RESIDUAL_PRED56 #if H3D_IVRP 57 57 m_ppcYuvResPred = NULL; 58 58 #endif … … 82 82 m_ppcYuvResi = new TComYuv*[m_uiMaxDepth-1]; 83 83 m_ppcYuvReco = new TComYuv*[m_uiMaxDepth-1]; 84 #if H HI_INTER_VIEW_RESIDUAL_PRED84 #if H3D_IVRP 85 85 m_ppcYuvResPred = new TComYuv* [m_uiMaxDepth-1]; 86 86 #endif … … 96 96 m_ppcYuvResi[ui] = new TComYuv; m_ppcYuvResi[ui]->create( uiWidth, uiHeight ); 97 97 m_ppcYuvReco[ui] = new TComYuv; m_ppcYuvReco[ui]->create( uiWidth, uiHeight ); 98 #if H HI_INTER_VIEW_RESIDUAL_PRED98 #if H3D_IVRP 99 99 m_ppcYuvResPred[ui] = new TComYuv; m_ppcYuvResPred[ui]->create( uiWidth, uiHeight ); 100 100 #endif … … 120 120 m_ppcYuvResi[ui]->destroy(); delete m_ppcYuvResi[ui]; m_ppcYuvResi[ui] = NULL; 121 121 m_ppcYuvReco[ui]->destroy(); delete m_ppcYuvReco[ui]; m_ppcYuvReco[ui] = NULL; 122 #if H HI_INTER_VIEW_RESIDUAL_PRED122 #if H3D_IVRP 123 123 m_ppcYuvResPred[ui]->destroy(); delete m_ppcYuvResPred[ui]; m_ppcYuvResPred[ui] = NULL; 124 124 #endif … … 128 128 delete [] m_ppcYuvResi; m_ppcYuvResi = NULL; 129 129 delete [] m_ppcYuvReco; m_ppcYuvReco = NULL; 130 #if H HI_INTER_VIEW_RESIDUAL_PRED130 #if H3D_IVRP 131 131 delete [] m_ppcYuvResPred; m_ppcYuvResPred = NULL; 132 132 #endif … … 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 ) … … 339 326 m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 ); 340 327 m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 ); 341 #if H HI_INTER_VIEW_MOTION_PRED328 #if H3D_IVMP 342 329 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists 343 330 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; … … 361 348 362 349 UInt uiCurrPartNumb = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); 350 363 351 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) 364 352 { 365 353 const UChar uhNewDepth = max<UInt>( uiDepth, pcTextureCU->getDepth( uiAbsPartIdx + ui ) ); 354 #if MERL_VSP_C0152 355 Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui); 356 pcCU->setVSPIndex( uiAbsPartIdx + ui, vspIdx); 357 #endif 366 358 pcCU->setPredictionMode( uiAbsPartIdx + ui, MODE_SKIP ); 367 359 pcCU->setPartitionSize( uiAbsPartIdx + ui, SIZE_2Nx2N ); … … 370 362 pcCU->setHeight( uiAbsPartIdx + ui, g_uiMaxCUHeight>>uhNewDepth ); 371 363 } 364 #if LGE_ILLUCOMP_DEPTH_C0046 365 m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 366 #endif 372 367 } 373 368 else 374 369 { 375 370 #endif 376 #if SIMP_MRG_PRUN377 371 UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx); 372 #if MERL_VSP_C0152 373 Int iVSPIndexTrue[3] = {-1, -1, -1}; 374 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, uiMergeIndex ); 375 { 376 Int iVSPIdx = 0; 377 Int numVspIdx; 378 numVspIdx = 3; 379 for (Int i = 0; i < numVspIdx; i++) 380 { 381 if (iVSPIndexTrue[i] == uiMergeIndex) 382 { 383 iVSPIdx = i+1; 384 break; 385 } 386 } 387 pcCU->setVSPIndexSubParts( iVSPIdx, uiAbsPartIdx, 0, uiDepth ); //Initialize the VSP, may change later in get InterMergeCandidates() 388 } 389 #else 378 390 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 379 #else380 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );381 UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx);382 391 #endif 383 392 pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); … … 400 409 } 401 410 #endif 402 #if H HI_INTER_VIEW_RESIDUAL_PRED411 #if H3D_IVRP && !MTK_MDIVRP_C0138 403 412 m_pcEntropyDecoder->decodeResPredFlag( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth], 0 ); 404 413 #endif … … 411 420 { 412 421 #endif 413 #if BURST_IPCM414 422 if( pcCU->getNumSucIPCM() == 0 ) 415 423 { … … 424 432 pcCU->setTrIdxSubParts( 0, uiAbsPartIdx, uiDepth ); 425 433 } 426 #else427 m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth );428 m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth );429 #endif430 434 431 435 if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) … … 449 453 450 454 #if LGE_ILLUCOMP_B0045 455 #if LGE_ILLUCOMP_DEPTH_C0046 && HHI_MPI 456 if( pcCU->getTextureModeDepth( uiAbsPartIdx ) != uiDepth ) 457 { 458 #endif 451 459 m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 452 460 #endif 453 461 454 #if H HI_INTER_VIEW_RESIDUAL_PRED462 #if H3D_IVRP && !MTK_MDIVRP_C0138 455 463 if( !pcCU->isIntra( uiAbsPartIdx ) ) 456 464 { 457 465 m_pcEntropyDecoder->decodeResPredFlag ( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth], 0 ); 466 } 467 #endif 468 #if LGE_ILLUCOMP_DEPTH_C0046 && HHI_MPI 458 469 } 459 470 #endif … … 467 478 468 479 UInt uiCurrPartNumb = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); 480 469 481 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) 470 482 { 471 483 const UChar uhNewDepth = max<UInt>( uiDepth, pcTextureCU->getDepth( uiAbsPartIdx + ui ) ); 484 #if MERL_VSP_C0152 485 Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui); 486 pcCU->setVSPIndex( uiAbsPartIdx + ui, vspIdx); 487 #endif 472 488 pcCU->setPredictionMode( uiAbsPartIdx + ui, MODE_INTER ); 473 489 pcCU->setPartitionSize( uiAbsPartIdx + ui, SIZE_2Nx2N ); … … 476 492 pcCU->setHeight( uiAbsPartIdx + ui, g_uiMaxCUHeight>>uhNewDepth ); 477 493 } 478 494 #if LGE_ILLUCOMP_DEPTH_C0046 495 m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 496 #endif 479 497 if( ( ( uiDepth < pcCU->getDepth( uiAbsPartIdx ) ) && ( uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth ) ) || bBoundary ) 480 498 { … … 551 569 } 552 570 553 #if BURST_IPCM554 571 if( pcCU->getNumSucIPCM() > 0 ) 555 572 { … … 557 574 return; 558 575 } 559 #endif560 576 561 577 ruiIsLast = xDecodeSliceEnd( pcCU, uiAbsPartIdx, uiDepth); … … 658 674 659 675 // inter prediction 676 #if MERL_VSP_C0152 677 m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth], uiAbsPartIdx ); 678 #else 660 679 m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] ); 661 680 #endif 681 #if MTK_MDIVRP_C0138 682 if (pcCU->getMergeFlag(0) && pcCU->getMergeIndex(0)==0 && pcCU->getResPredAvail(0)) 683 { 684 m_pcPrediction->residualPrediction(pcCU, m_ppcYuvReco[uiDepth], m_ppcYuvResPred[uiDepth]); 685 } 686 #endif 687 662 688 #if HHI_MPI 663 689 if( pcCU->getTextureModeDepth( 0 ) != -1 ) … … 665 691 #endif 666 692 667 #if H HI_INTER_VIEW_RESIDUAL_PRED693 #if H3D_IVRP && !MTK_MDIVRP_C0138 668 694 if( pcCU->getResPredFlag( 0 ) ) 669 695 { … … 695 721 else 696 722 { 697 #if HHI_INTER_VIEW_RESIDUAL_PRED 723 #if H3D_IVRP 724 #if MTK_MDIVRP_C0138 725 if (pcCU->getMergeFlag(0) && pcCU->getMergeIndex(0)==0 && pcCU->getResPredAvail(0)) 726 #else 698 727 if( pcCU->getResPredFlag( 0 ) ) 728 #endif 699 729 { 700 730 m_ppcYuvReco[uiDepth]->clip( pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) ); … … 765 795 766 796 //===== inverse transform ===== 767 #if H0736_AVC_STYLE_QP_RANGE768 797 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 ); 769 #else770 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA, 0 );771 #endif772 798 773 799 Int scalingListType = (pcCU->isIntra(uiAbsPartIdx) ? 0 : 3) + g_eTTable[(Int)TEXT_LUMA]; … … 885 911 if(eText == TEXT_CHROMA_U) 886 912 { 887 #if H0736_AVC_STYLE_QP_RANGE888 913 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), eText, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), pcCU->getSlice()->getPPS()->getChromaQpOffset() ); 889 #else890 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), eText, pcCU->getSlice()->getPPS()->getChromaQpOffset() );891 #endif892 914 } 893 915 else 894 916 { 895 #if H0736_AVC_STYLE_QP_RANGE896 917 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), eText, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), pcCU->getSlice()->getPPS()->getChromaQpOffset2nd() ); 897 #else898 m_pcTrQuant->setQPforQuant ( pcCU->getQP(0), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), eText, pcCU->getSlice()->getPPS()->getChromaQpOffset2nd() );899 #endif900 918 } 901 919 … … 1197 1215 pResi = m_ppcYuvResi[uiDepth]->getLumaAddr(); 1198 1216 1199 #if H0736_AVC_STYLE_QP_RANGE1200 1217 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 ); 1201 #else1202 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA, 0 );1203 #endif1204 1218 1205 1219 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_LUMA, pResi, 0, m_ppcYuvResi[uiDepth]->getStride(), uiWidth, uiHeight, uiLumaTrMode, 0, piCoeff ); 1206 1220 1207 1221 // Cb and Cr 1208 #if H0736_AVC_STYLE_QP_RANGE1209 1222 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), pcCU->getSlice()->getPPS()->getChromaQpOffset() ); 1210 #else1211 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA, pcCU->getSlice()->getPPS()->getChromaQpOffset() );1212 #endif1213 1223 1214 1224 uiWidth >>= 1; … … 1217 1227 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_CHROMA_U, pResi, 0, m_ppcYuvResi[uiDepth]->getCStride(), uiWidth, uiHeight, uiChromaTrMode, 0, piCoeff ); 1218 1228 1219 #if H0736_AVC_STYLE_QP_RANGE1220 1229 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA, pcCU->getSlice()->getSPS()->getQpBDOffsetC(), pcCU->getSlice()->getPPS()->getChromaQpOffset2nd() ); 1221 #else1222 m_pcTrQuant->setQPforQuant( pcCU->getQP( uiAbsPartIdx ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA, pcCU->getSlice()->getPPS()->getChromaQpOffset2nd() );1223 #endif1224 1230 1225 1231 piCoeff = pcCU->getCoeffCr(); pResi = m_ppcYuvResi[uiDepth]->getCrAddr(); … … 1375 1381 Int iSumPix[2]; 1376 1382 memset(iSumPix, 0, sizeof(Int)*2); 1377 1383 #if HS_REFERENCE_SUBSAMPLE_C0154 1384 Int subSamplePix; 1385 if ( uiSize == 64 || uiSize == 32 ) 1386 { 1387 subSamplePix = 2; 1388 } 1389 else 1390 { 1391 subSamplePix = 1; 1392 } 1393 for (Int y=0; y<uiSize; y+=subSamplePix) 1394 { 1395 for (Int x=0; x<uiSize; x+=subSamplePix) 1396 { 1397 UChar ucSegment = pMask?(UChar)pMask[x]:0; 1398 assert( ucSegment < uiNumSegments ); 1399 1400 iSumDepth[ucSegment] += pOrig[x]; 1401 iSumPix[ucSegment] += 1; 1402 } 1403 pOrig += uiStride*subSamplePix; 1404 pMask += uiMaskStride*subSamplePix; 1405 } 1406 #else 1378 1407 for (Int y=0; y<uiSize; y++) 1379 1408 { … … 1390 1419 pMask += uiMaskStride; 1391 1420 } 1392 1421 #endif 1393 1422 // compute mean for each segment 1394 1423 for( UChar ucSeg = 0; ucSeg < uiNumSegments; ucSeg++ )
Note: See TracChangeset for help on using the changeset viewer.