Changeset 166 in 3DVCSoftware for branches/HTM-4.0.1-VSP-dev0/source
- Timestamp:
- 1 Nov 2012, 19:22:41 (12 years ago)
- Location:
- branches/HTM-4.0.1-VSP-dev0/source
- Files:
-
- 2 added
- 55 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-4.0.1-VSP-dev0/source/App/TAppDecoder/TAppDecTop.cpp
r105 r166 262 262 } 263 263 } 264 #if DEBUGIMGOUT 265 for(Int viewDepthIdx=0; viewDepthIdx<m_tVideoIOYuvReconDbgFile.size() ; viewDepthIdx++) 266 { 267 if( m_tVideoIOYuvReconDbgFile[viewDepthIdx] ) 268 { 269 m_tVideoIOYuvReconDbgFile[viewDepthIdx]->close(); 270 delete m_tVideoIOYuvReconDbgFile[viewDepthIdx]; 271 m_tVideoIOYuvReconDbgFile[viewDepthIdx] = NULL ; 272 } 273 } 274 #endif 264 275 265 276 for(Int viewDepthIdx=0; viewDepthIdx<m_tDecTop.size() ; viewDepthIdx++) … … 330 341 #endif 331 342 } 343 #if DEBUGIMGOUT 344 #if PIC_CROPPING 345 m_tVideoIOYuvReconDbgFile[viewDepthId]->write( pcPic->getPicYuvRecDbg(), sps->getPicCropLeftOffset(), sps->getPicCropRightOffset(), sps->getPicCropTopOffset(), sps->getPicCropBottomOffset() ); 346 #else 347 m_tVideoIOYuvReconDbgFile[viewDepthId]->write( pcPic->getPicYuvRecDbg(), pcPic->getSlice(0)->getSPS()->getPad() ); 348 #endif 349 #endif 332 350 333 351 // update POC of display order … … 388 406 #endif 389 407 } 408 #if DEBUGIMGOUT 409 #if PIC_CROPPING 410 m_tVideoIOYuvReconDbgFile[viewDepthId]->write( pcPic->getPicYuvRecDbg(), sps->getPicCropLeftOffset(), sps->getPicCropRightOffset(), sps->getPicCropTopOffset(), sps->getPicCropBottomOffset() ); 411 #else 412 m_tVideoIOYuvReconDbgFile[viewDepthId]->write( pcPic->getPicYuvRecDbg(), pcPic->getSlice(0)->getSPS()->getPad() ); 413 #endif 414 #endif 390 415 391 416 // update POC of display order … … 476 501 } 477 502 #endif 478 503 #if DEBUGIMGOUT 504 while( m_tVideoIOYuvReconDbgFile.size() < newNumberOfViewDepth) 505 { 506 m_tVideoIOYuvReconDbgFile.push_back(new TVideoIOYuv); 507 Char buffer[4]; 508 sprintf(buffer,"_%i", (Int)(m_tVideoIOYuvReconDbgFile.size()-1) / 2 ); 509 Char* nextFilename = NULL; 510 if( (m_tVideoIOYuvReconDbgFile.size() % 2) == 0 ) 511 { 512 Char* pchTempFilename = NULL; 513 xAppendToFileNameEnd( "DebugImg.yuv", "_depth", pchTempFilename); 514 xAppendToFileNameEnd( pchTempFilename, buffer, nextFilename); 515 free ( pchTempFilename ); 516 } 517 else 518 { 519 xAppendToFileNameEnd( "DebugImg.yuv", buffer, nextFilename); 520 } 521 if( isDepth || ( !isDepth && (m_tVideoIOYuvReconDbgFile.size() % 2) == 1 ) ) 522 { 523 m_tVideoIOYuvReconDbgFile.back()->open( nextFilename, true, m_outputBitDepth, g_uiBitDepth + g_uiBitIncrement ); 524 } 525 free ( nextFilename ); 526 } 527 #endif 479 528 while( m_pocLastDisplay.size() < newNumberOfViewDepth ) 480 529 { … … 533 582 return pcPic; 534 583 } 584 585 #if VSP_N 586 Void TAppDecTop::storeVSPInBuffer(TComPic* pcPicVSP, TComPic* pcPicAvail, Int iCodedViewIdx, Int iCoddedViewOrderIdx, Int iCurPoc, Bool bDepth) 587 { 588 //first view does not have VSP 589 #if VSP_TEXT_ONLY 590 if((iCodedViewIdx == 0)||(bDepth)) 591 #else 592 if((iCodedViewIdx == 0)) 593 #endif 594 return; 595 pcPicVSP->getSlice(0)->setPOC( iCurPoc ); 596 Int iNeighborViewId = 0; 597 Bool bRenderFromLeft; 598 //check if the neighboring view is situated to the left of the current view 599 bRenderFromLeft = ((iCoddedViewOrderIdx)>0); 600 //pointers to buffers 601 TComPicYuv* pcPicYuvVideo = getPicFromView(iNeighborViewId, iCurPoc, bDepth)->getPicYuvRec(); 602 TComPicYuv* pcPicYuvDepth = getPicFromView(iNeighborViewId, iCurPoc, true)->getPicYuvRec(); 603 TComPicYuv* pcPicYuvVSP = pcPicVSP->getPicYuvRec(); 604 TComPicYuv* pcPicYuvAvail = pcPicAvail->getPicYuvRec(); 605 //verifying buffers 606 AOF(pcPicYuvVideo); 607 AOF(pcPicYuvDepth); 608 AOF(pcPicYuvVSP); 609 AOF(pcPicYuvAvail); 610 611 TComPic* pcPic = getPicFromView( iCodedViewIdx, iCurPoc, bDepth ); 612 pcPic->setPicYuvSynth( pcPicYuvVSP ); 613 pcPic->setPicYuvAvail( pcPicYuvAvail ); 614 615 //setting look-up table 616 #if 0 617 m_cVSPRendererTop.setShiftLUTs( 618 m_cCamParsCollector.getBaseViewShiftLUTD()[iNeighborViewId][iCodedViewIdx], 619 m_cCamParsCollector.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx], 620 m_cCamParsCollector.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx], 621 m_cCamParsCollector.getBaseViewShiftLUTD()[iNeighborViewId][iCodedViewIdx], 622 m_cCamParsCollector.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx], 623 m_cCamParsCollector.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx], 624 -1 625 ); 626 #else 627 #if NTT_SUBPEL 628 m_cVSPRendererTop.setShiftLUTs( 629 m_cCamParsCollector.getBaseViewShiftLUTD()[iNeighborViewId][iCodedViewIdx], 630 m_cCamParsCollector.getBaseViewIPelLUT ()[iNeighborViewId][iCodedViewIdx], 631 NULL, 632 m_cCamParsCollector.getBaseViewShiftLUTD()[iNeighborViewId][iCodedViewIdx], 633 m_cCamParsCollector.getBaseViewIPelLUT ()[iNeighborViewId][iCodedViewIdx], 634 NULL, 635 -1 636 ); 637 m_cVSPRendererTop.setFposLUTs( 638 m_cCamParsCollector.getBaseViewFPosLUT()[iNeighborViewId][iCodedViewIdx], 639 m_cCamParsCollector.getBaseViewFPosLUT()[iNeighborViewId][iCodedViewIdx] 640 ); 641 #else 642 m_cVSPRendererTop.setShiftLUTs( 643 m_cCamParsCollector.getBaseViewShiftLUTD()[iNeighborViewId][iCodedViewIdx], 644 m_cCamParsCollector.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx], 645 NULL, 646 m_cCamParsCollector.getBaseViewShiftLUTD()[iNeighborViewId][iCodedViewIdx], 647 m_cCamParsCollector.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx], 648 NULL, 649 -1 650 ); 651 #endif 652 #endif 653 654 #if NTT_SUBPEL 655 m_cVSPRendererTop.setInterpolationMode( (bDepth ? 0 : 5) ); 656 #endif 657 658 //extrapolate from view iNeighborViewId to the current view, storing in the VSP buffer 659 //m_cVSPRendererTop.extrapolateView(pcPicYuvVideo,pcPicYuvDepth, pcPicYuvVSP, bRenderFromLeft); 660 m_cVSPRendererTop.extrapolateAvailabilityView(pcPicYuvVideo,pcPicYuvDepth, pcPicYuvVSP, pcPicYuvAvail, bRenderFromLeft); 661 662 // mark it should be extended 663 pcPicVSP->getPicYuvRec()->setBorderExtension(false); 664 pcPicVSP->getPicYuvRec()->extendPicBorder(); //will extend the border for prediction using pixels outside the frame 665 pcPicAvail->getPicYuvRec()->setBorderExtension(false); 666 pcPicAvail->getPicYuvRec()->extendPicBorder(); 667 #if VSP_N_DUMP 668 { 669 Char acFilenameBase[1024]; 670 ::sprintf(acFilenameBase,"VSP_dec_%sv%d_%dx%d_%04d.yuv",(bDepth?"D":"T"),iCodedViewIdx,pcPicYuvVSP->getWidth(), pcPicYuvVSP->getHeight(), iCurPoc); 671 pcPicYuvVSP->dump(acFilenameBase,0); 672 //pcPicYuvAvail->dump(acFilenameBase,iCurPoc!=0); 673 } 674 #endif 675 } 676 #endif 677 535 678 //! \} -
branches/HTM-4.0.1-VSP-dev0/source/App/TAppDecoder/TAppDecTop.h
r100 r166 49 49 #include "TLibDecoder/TDecTop.h" 50 50 #include "TAppDecCfg.h" 51 #if VSP_N 52 #include "../../Lib/TLibRenderer/TRenTop.h" 53 #endif 51 54 52 55 //! \ingroup TAppDecoder … … 65 68 66 69 std::vector<TVideoIOYuv*> m_tVideoIOYuvReconFile; ///< reconstruction YUV class 70 #if DEBUGIMGOUT 71 std::vector<TVideoIOYuv*> m_tVideoIOYuvReconDbgFile; ///< debug YUV class 72 #endif 67 73 68 74 // for output control … … 79 85 TComSPSAccess m_cSPSAccess; 80 86 TComAUPicAccess m_cAUPicAccess; 87 #endif 88 89 #if VSP_N 90 TRenTop m_cVSPRendererTop; 81 91 #endif 82 92 … … 107 117 #endif 108 118 119 #if VSP_N 120 Bool getUseDepth () { return m_useDepth; } 121 TRenTop* getVSPRendererTop(){ return &m_cVSPRendererTop; } 122 Void storeVSPInBuffer(TComPic* pcPicVSP, TComPic* pcPicAvail, Int iCodedViewIdx, Int iCoddedViewOrderIdx, Int iCurPoc, Bool bDepth); 123 #endif 124 109 125 protected: 110 126 // Void xCreateDecLib (); ///< create internal classes -
branches/HTM-4.0.1-VSP-dev0/source/App/TAppEncoder/TAppEncCfg.cpp
r133 r166 194 194 195 195 /* File, I/O and source parameters */ 196 ("InputFile_%d,i_%d", m_pchInputFileList, (char *) 0 , MAX_VIEW_NUM , "original Yuv input file name %d")197 ("DepthInputFile_%d,di_%d", m_pchDepthInputFileList, (char *) 0 , MAX_VIEW_NUM , "original Yuv depth input file name %d")198 ("ReconFile_%d,o_%d", m_pchReconFileList, (char *) 0 , MAX_VIEW_NUM , "reconstructed Yuv output file name %d")199 ("DepthReconFile_%d,do_%d", m_pchDepthReconFileList, (char *) 0 , MAX_VIEW_NUM , "reconstructed Yuv depth output file name %d")200 ("BitstreamFile,b", cfg_BitstreamFile, string(""),"bitstream output file name")201 ("CodeDepthMaps", m_bUsingDepthMaps, false,"Encode depth maps" )202 ("CodedCamParsPrecision", m_iCodedCamParPrecision,STD_CAM_PARAMETERS_PRECISION, "precision for coding of camera parameters (in units of 2^(-x) luma samples)" )203 ("LambdaModifier0,-LM0", m_adLambdaModifier[ 0 ], ( double )1.0,"Lambda modifier for temporal layer 0")204 ("LambdaModifier1,-LM1", m_adLambdaModifier[ 1 ], ( double )1.0,"Lambda modifier for temporal layer 1")205 ("LambdaModifier2,-LM2", m_adLambdaModifier[ 2 ], ( double )1.0,"Lambda modifier for temporal layer 2")206 ("LambdaModifier3,-LM3", m_adLambdaModifier[ 3 ], ( double )1.0,"Lambda modifier for temporal layer 3")207 ("SourceWidth,-wdt", m_iSourceWidth, 0,"Source picture width")208 ("SourceHeight,-hgt", m_iSourceHeight, 0,"Source picture height")196 ("InputFile_%d,i_%d", m_pchInputFileList, (char *) 0 , MAX_VIEW_NUM , "original Yuv input file name %d") 197 ("DepthInputFile_%d,di_%d", m_pchDepthInputFileList, (char *) 0 , MAX_VIEW_NUM , "original Yuv depth input file name %d") 198 ("ReconFile_%d,o_%d", m_pchReconFileList, (char *) 0 , MAX_VIEW_NUM , "reconstructed Yuv output file name %d") 199 ("DepthReconFile_%d,do_%d", m_pchDepthReconFileList, (char *) 0 , MAX_VIEW_NUM , "reconstructed Yuv depth output file name %d") 200 ("BitstreamFile,b", cfg_BitstreamFile, string(""), "bitstream output file name") 201 ("CodeDepthMaps", m_bUsingDepthMaps, false, "Encode depth maps" ) 202 ("CodedCamParsPrecision", m_iCodedCamParPrecision, STD_CAM_PARAMETERS_PRECISION, "precision for coding of camera parameters (in units of 2^(-x) luma samples)" ) 203 ("LambdaModifier0,-LM0", m_adLambdaModifier[ 0 ], ( double )1.0, "Lambda modifier for temporal layer 0") 204 ("LambdaModifier1,-LM1", m_adLambdaModifier[ 1 ], ( double )1.0, "Lambda modifier for temporal layer 1") 205 ("LambdaModifier2,-LM2", m_adLambdaModifier[ 2 ], ( double )1.0, "Lambda modifier for temporal layer 2") 206 ("LambdaModifier3,-LM3", m_adLambdaModifier[ 3 ], ( double )1.0, "Lambda modifier for temporal layer 3") 207 ("SourceWidth,-wdt", m_iSourceWidth, 0, "Source picture width") 208 ("SourceHeight,-hgt", m_iSourceHeight, 0, "Source picture height") 209 209 #if PIC_CROPPING 210 ("CroppingMode", m_croppingMode, 0,"Cropping mode (0: no cropping, 1:automatic padding, 2: padding, 3:cropping")211 ("CropLeft", m_cropLeft, 0,"Left cropping/padding for cropping mode 3")212 ("CropRight", m_cropRight, 0,"Right cropping/padding for cropping mode 3")213 ("CropTop", m_cropTop, 0,"Top cropping/padding for cropping mode 3")214 ("CropBottom", m_cropBottom, 0,"Bottom cropping/padding for cropping mode 3")215 ("HorizontalPadding,-pdx", m_aiPad[0], 0,"horizontal source padding for cropping mode 2")216 ("VerticalPadding,-pdy", m_aiPad[1], 0,"vertical source padding for cropping mode 2")210 ("CroppingMode", m_croppingMode, 0, "Cropping mode (0: no cropping, 1:automatic padding, 2: padding, 3:cropping") 211 ("CropLeft", m_cropLeft, 0, "Left cropping/padding for cropping mode 3") 212 ("CropRight", m_cropRight, 0, "Right cropping/padding for cropping mode 3") 213 ("CropTop", m_cropTop, 0, "Top cropping/padding for cropping mode 3") 214 ("CropBottom", m_cropBottom, 0, "Bottom cropping/padding for cropping mode 3") 215 ("HorizontalPadding,-pdx", m_aiPad[0], 0, "horizontal source padding for cropping mode 2") 216 ("VerticalPadding,-pdy", m_aiPad[1], 0, "vertical source padding for cropping mode 2") 217 217 #endif 218 218 ("InputBitDepth", m_uiInputBitDepth, 8u, "bit-depth of input file") … … 498 498 m_pchRowHeight = cfg_RowHeight.empty() ? NULL : strdup(cfg_RowHeight.c_str()); 499 499 m_scalingListFile = cfg_ScalingListFile.empty() ? NULL : strdup(cfg_ScalingListFile.c_str()); 500 500 501 501 if ( m_bUsingDepthMaps ) 502 502 { -
branches/HTM-4.0.1-VSP-dev0/source/App/TAppEncoder/TAppEncTop.cpp
r102 r166 697 697 #endif 698 698 699 #if VSP_N 700 #if NTT_SUBPEL 701 m_cVSPRendererTop.init(m_iSourceWidth, m_iSourceHeight, true, 0, LOG2_DISP_PREC_LUT, true, 0, 0, 0, 0, 0, 6, 5, 1, 0, 6 ); 702 #else 703 m_cVSPRendererTop.init(m_iSourceWidth, m_iSourceHeight, true, 0, LOG2_DISP_PREC_LUT, true, 0, 0, 0, 0, 0, 6, 4, 1, 0, 6 ); 704 #endif 705 #endif 699 706 } 700 707 … … 822 829 TComPicYuv* pcPicYuvRec = NULL; 823 830 TComPicYuv* pcDepthPicYuvRec = NULL; 824 831 825 832 // initialize internal class & member variables 826 833 xInitLibCfg(); … … 918 925 if ( iNextPoc < m_iFrameToBeEncoded ) 919 926 { 920 m_cCameraData.update( iNextPoc );927 m_cCameraData.update( iNextPoc ); 921 928 } 922 929 for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ ) … … 930 937 #endif 931 938 iNumEncoded = 0; 939 940 #if VSP_SLICE_HEADER 941 m_acTEncTopList [iViewIdx]->setUseVSP( (gopId%VSP_FRAME_INTERVAL==0) ); 942 m_acTEncDepthTopList[iViewIdx]->setUseVSP( (gopId%VSP_FRAME_INTERVAL==0) ); 943 #endif 944 945 #if VSP_N 946 #if VSP_SLICE_HEADER 947 if( m_acTEncTopList[iViewIdx]->getUseVSP() ) 948 #endif 949 if( m_bUsingDepthMaps ) 950 { 951 // Forward Warping 952 xStoreVSPInBuffer(m_acTEncTopList[iViewIdx]->getVSPBuf(), m_acTEncTopList[iViewIdx]->getVSPAvailBuf(), iViewIdx, false, gopId); 953 } 954 #endif 932 955 // call encoding function for one frame 933 956 m_acTEncTopList[iViewIdx]->encode( eos[iViewIdx], pcPicYuvOrg, *m_picYuvRec[iViewIdx], outputAccessUnits, iNumEncoded, gopId ); … … 937 960 { 938 961 Int iNumDepthEncoded = 0; 962 #if VSP_N 963 #if VSP_SLICE_HEADER 964 if( m_acTEncDepthTopList[iViewIdx]->getUseVSP() ) 965 #endif 966 xStoreVSPInBuffer(m_acTEncDepthTopList[iViewIdx]->getVSPBuf(), m_acTEncDepthTopList[iViewIdx]->getVSPAvailBuf(), iViewIdx, true, gopId); 967 #endif 939 968 // call encoding function for one depth frame 940 969 m_acTEncDepthTopList[iViewIdx]->encode( depthEos[iViewIdx], pcDepthPicYuvOrg, *m_picYuvDepthRec[iViewIdx], outputAccessUnits, iNumDepthEncoded, gopId ); … … 1377 1406 }; 1378 1407 1408 #if VSP_N 1409 Void TAppEncTop::xStoreVSPInBuffer(TComPic* pcPicVSP, TComPic* pcPicAvail, Int iCodedViewIdx, Bool bDepth, Int gopId) 1410 { 1411 //first view does not have VSP 1412 #if VSP_TEXT_ONLY 1413 if((iCodedViewIdx == 0)||(bDepth)) 1414 #else 1415 if((iCodedViewIdx == 0)) 1416 #endif 1417 return; 1418 1419 AOT( iCodedViewIdx <= 0); 1420 AOT( iCodedViewIdx >= m_iNumberOfViews ); 1421 1422 Int iCurPoc; 1423 //getting currrent POC and checking if the frame will be coded 1424 if(bDepth) 1425 { 1426 iCurPoc = m_acTEncDepthTopList[iCodedViewIdx]->getFrameId(gopId); 1427 if(iCurPoc>=m_acTEncDepthTopList[iCodedViewIdx]->getFrameToBeEncoded()) 1428 return; 1429 //if(!(m_acTEncDepthTopList[iCodedViewIdx]->currentPocWillBeCoded())) 1430 // return; 1431 } 1432 else 1433 { 1434 iCurPoc = m_acTEncTopList[iCodedViewIdx]->getFrameId(gopId); 1435 if(iCurPoc>=m_acTEncTopList[iCodedViewIdx]->getFrameToBeEncoded()) 1436 return; 1437 //if(!(m_acTEncTopList[iCodedViewIdx]->currentPocWillBeCoded())) 1438 // return; 1439 } 1440 pcPicVSP->getSlice(0)->setPOC( iCurPoc ); 1441 1442 Int iNeighborViewId = 0; 1443 Bool bRenderFromLeft; 1444 //check if the neighboring view is situated to the left of the current view 1445 bRenderFromLeft = ((m_cCameraData.getBaseSortedId2Id()[iCodedViewIdx]-m_cCameraData.getBaseSortedId2Id()[iNeighborViewId])>0); 1446 //pointers to buffers 1447 TComPicYuv* pcPicYuvVideo = xGetPicYuvFromView(iNeighborViewId, iCurPoc, bDepth, true ); 1448 TComPicYuv* pcPicYuvDepth = xGetPicYuvFromView(iNeighborViewId, iCurPoc, true, true ); 1449 TComPicYuv* pcPicYuvVSP = pcPicVSP->getPicYuvRec(); 1450 TComPicYuv* pcPicYuvAvail = pcPicAvail->getPicYuvRec(); 1451 //verifying buffers 1452 AOF(pcPicYuvVideo); 1453 AOF(pcPicYuvDepth); 1454 AOF(pcPicYuvVSP); 1455 AOF(pcPicYuvAvail); 1456 1457 TComPic* pcPic = getPicFromView( iCodedViewIdx, iCurPoc, bDepth ); 1458 pcPic->setPicYuvSynth( pcPicYuvVSP ); 1459 pcPic->setPicYuvAvail( pcPicYuvAvail ); 1460 1461 //setting look-up table 1462 #if 0 1463 m_cVSPRendererTop.setShiftLUTs( 1464 m_cCameraData.getBaseViewShiftLUTD()[iNeighborViewId][iCodedViewIdx], 1465 m_cCameraData.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx], 1466 m_cCameraData.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx], 1467 m_cCameraData.getBaseViewShiftLUTD()[iNeighborViewId][iCodedViewIdx], 1468 m_cCameraData.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx], 1469 m_cCameraData.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx], 1470 -1 1471 ); 1472 #else 1473 #if NTT_SUBPEL 1474 m_cVSPRendererTop.setShiftLUTs( 1475 m_cCameraData.getBaseViewShiftLUTD()[iNeighborViewId][iCodedViewIdx], 1476 m_cCameraData.getBaseViewIPelLUT ()[iNeighborViewId][iCodedViewIdx], 1477 NULL, 1478 m_cCameraData.getBaseViewShiftLUTD()[iNeighborViewId][iCodedViewIdx], 1479 m_cCameraData.getBaseViewIPelLUT ()[iNeighborViewId][iCodedViewIdx], 1480 NULL, 1481 -1 1482 ); 1483 m_cVSPRendererTop.setFposLUTs( 1484 m_cCameraData.getBaseViewFPosLUT()[iNeighborViewId][iCodedViewIdx], 1485 m_cCameraData.getBaseViewFPosLUT()[iNeighborViewId][iCodedViewIdx] 1486 ); 1487 #else 1488 m_cVSPRendererTop.setShiftLUTs( 1489 m_cCameraData.getBaseViewShiftLUTD()[iNeighborViewId][iCodedViewIdx], 1490 m_cCameraData.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx], 1491 NULL, 1492 m_cCameraData.getBaseViewShiftLUTD()[iNeighborViewId][iCodedViewIdx], 1493 m_cCameraData.getBaseViewShiftLUTI()[iNeighborViewId][iCodedViewIdx], 1494 NULL, 1495 -1 1496 ); 1497 #endif 1498 #endif 1499 1500 #if NTT_SUBPEL 1501 m_cVSPRendererTop.setInterpolationMode( (bDepth ? 0 : 5) ); 1502 #endif 1503 1504 //extrapolate from view iNeighborViewId to the current view, storing in the VSP buffer 1505 //m_cVSPRendererTop.extrapolateView(pcPicYuvVideo,pcPicYuvDepth, pcPicYuvVSP, bRenderFromLeft); 1506 m_cVSPRendererTop.extrapolateAvailabilityView(pcPicYuvVideo,pcPicYuvDepth, pcPicYuvVSP, pcPicYuvAvail, bRenderFromLeft); 1507 1508 1509 // mark it should be extended 1510 pcPicVSP->getPicYuvRec()->setBorderExtension(false); 1511 pcPicVSP->getPicYuvRec()->extendPicBorder();//will extend the border for prediction using pixels outside the frame (done at the slice level as well 1512 pcPicAvail->getPicYuvRec()->setBorderExtension(false); 1513 pcPicAvail->getPicYuvRec()->extendPicBorder(); 1514 1515 #if VSP_N_DUMP 1516 { 1517 Char acFilenameBase[1024]; 1518 ::sprintf(acFilenameBase,"VSP_enc_%sv%d_%dx%d.yuv",(bDepth?"D":"T"),iCodedViewIdx,m_iSourceWidth, m_iSourceHeight); 1519 pcPicYuvVSP->dump(acFilenameBase,iCurPoc!=0); 1520 //pcPicYuvAvail->dump(acFilenameBase,iCurPoc!=0); 1521 } 1522 #endif 1523 1524 } 1525 #endif 1526 1379 1527 //! \} -
branches/HTM-4.0.1-VSP-dev0/source/App/TAppEncoder/TAppEncTop.h
r102 r166 99 99 TRenTop m_cUsedPelsRenderer; ///< renderer for used pels map 100 100 #endif 101 102 #if VSP_N 103 TRenTop m_cVSPRendererTop; 104 #endif 105 101 106 protected: 102 107 // initialization … … 162 167 #endif 163 168 169 #if VSP_N 170 Void xStoreVSPInBuffer(TComPic* pcPicVSP, TComPic* pcPicAvail, Int iCodedViewIdx, Bool bDepth, Int gopId); 171 #endif 164 172 };// END CLASS DEFINITION TAppEncTop 165 173 -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TAppCommon/TAppComCamPara.cpp
r165 r166 89 89 } 90 90 91 #if NTT_SUBPEL 92 Void 93 TAppComCamPara::xCreateLUTs_Subpel( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Int****& raiLUT0, Int****& raiLUT1 ) 94 { 95 AOF( m_uiBitDepthForLUT == 8 ); 96 AOF( raiLUT0 == NULL && raiLUT1 == NULL ); 97 98 uiNumberSourceViews = Max( 1, uiNumberSourceViews ); 99 uiNumberTargetViews = Max( 1, uiNumberTargetViews ); 100 101 raiLUT0 = new Int ***[ uiNumberSourceViews ]; 102 raiLUT1 = new Int ***[ uiNumberSourceViews ]; 103 104 for( UInt uiSourceView = 0; uiSourceView < uiNumberSourceViews; uiSourceView++ ) 105 { 106 raiLUT0 [ uiSourceView ] = new Int **[ uiNumberTargetViews ]; 107 raiLUT1 [ uiSourceView ] = new Int **[ uiNumberTargetViews ]; 108 109 for( UInt uiTargetView = 0; uiTargetView < uiNumberTargetViews; uiTargetView++ ) 110 { 111 raiLUT0 [ uiSourceView ][ uiTargetView ] = new Int* [ 2 ]; 112 raiLUT0 [ uiSourceView ][ uiTargetView ][ 0 ] = new Int [ 257 ]; 113 raiLUT0 [ uiSourceView ][ uiTargetView ][ 1 ] = new Int [ 257 ]; 114 raiLUT1 [ uiSourceView ][ uiTargetView ] = new Int* [ 2 ]; 115 raiLUT1 [ uiSourceView ][ uiTargetView ][ 0 ] = new Int [ 257 ]; 116 raiLUT1 [ uiSourceView ][ uiTargetView ][ 1 ] = new Int [ 257 ]; 117 } 118 } 119 } 120 #endif 91 121 92 122 Void … … 928 958 } 929 959 960 #if NTT_SUBPEL 961 Void 962 TAppComCamPara::xSetShiftParametersAndLUT( UInt uiNumberSourceViews, UInt uiNumberTargetViews, UInt uiFrame, Int****& raiLUT_Disp, Int****& raiLUT_Fracpos ) 963 { 964 if( uiNumberSourceViews <= 1 || uiNumberTargetViews == 0 ) 965 { 966 return; 967 } 968 AOF( raiLUT_Disp != NULL && raiLUT_Fracpos != NULL ); 969 AOF( m_uiBitDepthForLUT == 8 ); 970 971 Int iLog2Div = m_uiBitDepthForLUT + m_uiCamParsCodedPrecision + 1 - m_iLog2Precision; AOF( iLog2Div > 0 ); 972 for( UInt uiSourceView = 0; uiSourceView < uiNumberSourceViews; uiSourceView++ ) 973 { 974 for( UInt uiTargetView = 0; uiTargetView < uiNumberTargetViews; uiTargetView++ ) 975 { 976 // integer-valued scale and offset 977 Int64 iScale, iOffset; 978 xGetShiftParameterInt ( uiSourceView, uiTargetView, uiFrame, false, true, iScale, iOffset ); 979 980 // offsets including rounding offsets 981 iOffset += ( 1 << iLog2Div ) >> 1; 982 983 for( UInt uiDepthValue = 0; uiDepthValue < 256; uiDepthValue++ ) 984 { 985 Int64 iTempScale = (Int64)uiDepthValue * iScale; 986 Int iShiftSubpel = (Int) (( iTempScale + iOffset ) >> iLog2Div); 987 Int iShiftPelLuma = iShiftSubpel >> m_iLog2Precision; // better to have rounding ? 988 Int iShiftPelChroma = iShiftPelLuma >> 1; 989 990 raiLUT_Disp [ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = iShiftPelLuma; 991 raiLUT_Disp [ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = iShiftPelChroma; 992 raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = iShiftSubpel - ( iShiftPelLuma << m_iLog2Precision ); 993 raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = iShiftSubpel - ( iShiftPelChroma << (m_iLog2Precision+1) ); 994 995 #if 0 // NTT bugfix 996 if ( raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] < 0 ) 997 raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = -4 - raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ]; 998 if ( raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] < 0 ) 999 raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = -4 - raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ]; 1000 #endif 1001 1002 #if _DEBUG 1003 AOF( (raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ]>> m_iLog2Precision ) == 0 ); 1004 AOF( (raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ]>>(m_iLog2Precision+1)) == 0 ); 1005 #endif 1006 } 1007 1008 raiLUT_Disp [ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT_Disp [ uiSourceView ][ uiTargetView ][ 0 ][ 255 ]; 1009 raiLUT_Disp [ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT_Disp [ uiSourceView ][ uiTargetView ][ 1 ][ 255 ]; 1010 raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ]; 1011 raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ]; 1012 } 1013 } 1014 } 1015 #endif 930 1016 931 1017 Void … … 936 1022 xSetShiftParametersAndLUT( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews, uiFrame, false, m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT, m_adBaseViewShiftParameter, m_aiBaseViewShiftParameter ); 937 1023 xSetShiftParametersAndLUT( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfSynthViews, uiFrame, true, m_adSynthViewShiftLUT, m_aiSynthViewShiftLUT, m_adSynthViewShiftParameter, m_aiSynthViewShiftParameter ); 1024 #if NTT_SUBPEL 1025 xSetShiftParametersAndLUT( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews, uiFrame, m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos ); 1026 #endif 938 1027 }; 939 1028 … … 1066 1155 m_aiSynthViewShiftLUT = 0; 1067 1156 1157 #if NTT_SUBPEL 1158 m_aiBaseViewShiftLUT_ipel = 0; 1159 m_aiBaseViewShiftLUT_fpos = 0; 1160 #endif 1161 1068 1162 m_bSetupFromCoded = false; 1069 1163 m_bCamParsCodedPrecSet = false; … … 1091 1185 xDeleteArray( m_aaiPdmScaleNomDelta, m_iNumberOfBaseViews ); 1092 1186 xDeleteArray( m_aaiPdmOffset, m_iNumberOfBaseViews ); 1187 1188 #if NTT_SUBPEL 1189 xDeleteArray( m_aiBaseViewShiftLUT_ipel, m_iNumberOfBaseViews, m_iNumberOfBaseViews, 2 ); 1190 xDeleteArray( m_aiBaseViewShiftLUT_fpos, m_iNumberOfBaseViews, m_iNumberOfBaseViews, 2 ); 1191 #endif 1093 1192 } 1094 1193 … … 1337 1436 xCreate2dArray( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews, m_aaiPdmOffset ); 1338 1437 1438 #if NTT_SUBPEL 1439 xCreateLUTs_Subpel( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews, m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos); 1440 #endif 1441 1339 1442 //===== init disparity to virtual depth conversion parameters ===== 1340 1443 xSetPdmConversionParams(); -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TAppCommon/TAppComCamPara.h
r165 r166 107 107 Int**** m_aiSynthViewShiftLUT; ///< Disparity LUT 108 108 109 #if NTT_SUBPEL 110 Int**** m_aiBaseViewShiftLUT_ipel; ///< Disparity LUT 111 Int**** m_aiBaseViewShiftLUT_fpos; ///< Disparity LUT 112 #endif 109 113 110 114 protected: … … 117 121 template<class T> Void xDeleteArray ( T*& rpt, UInt uiSize ); 118 122 123 #if NTT_SUBPEL 124 Void xCreateLUTs_Subpel ( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Int****& raiLUT0, Int****& raiLUT1 ); 125 #endif 126 119 127 // functions for reading, initialization, sorting, getting data, etc. 120 128 Void xReadCameraParameterFile ( Char* pchCfgFileName ); … … 143 151 Void xSetShiftParametersAndLUT ( UInt uiNumViewDim1, UInt uiNumViewDim2, UInt uiFrame, Bool bExternalReference, Double****& radLUT, Int****& raiLUT, Double***& radShiftParams, Int64***& raiShiftParams ); 144 152 Void xSetShiftParametersAndLUT ( UInt uiFrame ); 145 153 #if NTT_SUBPEL 154 Void xSetShiftParametersAndLUT ( UInt uiNumViewDim1, UInt uiNumViewDim2, UInt uiFrame, Int****& raiLUT_Disp, Int****& raiLUT_Fracpos ); 155 #endif 146 156 147 157 // getting conversion parameters for disparity to virtual depth conversion … … 211 221 Int**** getSynthViewShiftLUTI () { return m_aiSynthViewShiftLUT; } 212 222 Int**** getBaseViewShiftLUTI () { return m_aiBaseViewShiftLUT; } 223 224 #if NTT_SUBPEL 225 Int**** getBaseViewIPelLUT () { return m_aiBaseViewShiftLUT_ipel; } 226 Int**** getBaseViewFPosLUT () { return m_aiBaseViewShiftLUT_fpos; } 227 #endif 213 228 214 229 Bool getVaryingCameraParameters() { return m_bCamParsVaryOverTime; } -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/CommonDef.h
r134 r166 110 110 #define MAX_GOP 64 ///< max. value of hierarchical GOP size 111 111 112 #if VSP_N 113 #define MAX_NUM_REF 5 ///< max. value of multiple reference frames 114 #define MAX_NUM_REF_LC 10 ///< max. value of combined reference frames 115 #else 112 116 #define MAX_NUM_REF 4 ///< max. value of multiple reference frames 113 117 #define MAX_NUM_REF_LC 8 ///< max. value of combined reference frames 118 #endif 114 119 115 120 #define MAX_UINT 0xFFFFFFFFU ///< max. value of unsigned 32-bit integer -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComDataCU.cpp
r100 r166 49 49 Int * TComDataCU::m_pcGlbArlCoeffCb = NULL; 50 50 Int * TComDataCU::m_pcGlbArlCoeffCr = NULL; 51 #endif 52 53 #if FORCE_REF_VSP==1 54 #define CHECK_ADD_YET(pcCURef,uiIdx) 55 #define SET_AOUND_MVINFO(pcCURef,uiIdx) \ 56 {\ 57 if((pcCURef)->isVspMode((uiIdx))){\ 58 pcMvFieldNeighbours[iCount<<1].setRefIdx(getSlice()->getRefIdxVsp(REF_PIC_LIST_0));\ 59 if(getSlice()->isInterB()){\ 60 pcMvFieldNeighbours[(iCount<<1)+1].setRefIdx(getSlice()->getRefIdxVsp(REF_PIC_LIST_1));\ 61 }\ 62 }\ 63 } 64 65 #elif FORCE_REF_VSP==2 66 #define CHECK_ADD_YET(pcCURef,uiIdx) &&!((pcCURef)->isVspMode((uiIdx),TComMv(0,0))&&bVspMvZeroDone) 67 #define SET_AOUND_MVINFO(pcCURef,uiIdx) if((pcCURef)->isVspMode((uiIdx),TComMv(0,0))){bVspMvZeroDone=true;} 68 69 inline bool TComDataCU::xAddVspSkip(UChar ucVspMergePos, Bool bVspMvZeroDone, UInt uiDepth, Bool* abCandIsInter, Int& iCount, 70 UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, Int mrgCandIdx) 71 { 72 #if VSP_SLICE_HEADER 73 if( !getSlice()->getVspFlag() ) return true; 74 #endif 75 76 if( ucVspMergePos == VSP_MERGE_POS ) 77 { 78 #if VSP_TEXT_ONLY 79 if( !getSlice()->getSPS()->isDepth() ) 80 #endif 81 if( getSlice()->getSPS()->getViewId()!=0 && !bVspMvZeroDone ) 82 { 83 Bool bSubCUCanBeSynthesized[4]; 84 Bool * pbSubCUCanBeSynthesized = bSubCUCanBeSynthesized; 85 getPic()->checkSynthesisAvailability( getAddr(), getZorderIdxInCU(), uiDepth, pbSubCUCanBeSynthesized ); 86 if( bSubCUCanBeSynthesized[0] && bSubCUCanBeSynthesized[1] && bSubCUCanBeSynthesized[2] && bSubCUCanBeSynthesized[3] ) 87 { 88 abCandIsInter[iCount] = true; 89 // get Inter Dir 90 Int iInterDir = ((getSlice()->getNumRefIdx(REF_PIC_LIST_0) > 0 && getSlice()->getNumRefIdx(REF_PIC_LIST_1) > 0) ? 3 : 91 (getSlice()->getNumRefIdx(REF_PIC_LIST_0) > 0 ? 1 : 2)); 92 puhInterDirNeighbours[iCount] = iInterDir; //pcCUAboveLeft->getInterDir( uiAboveLeftPartIdx ); 93 // get Mv from Left 94 pcMvFieldNeighbours[iCount<<1].setMvField( TComMv(0, 0), getSlice()->getRefIdxVsp(REF_PIC_LIST_0) ); //pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 95 if ( getSlice()->isInterB() ) 96 { 97 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( TComMv(0, 0), getSlice()->getRefIdxVsp(REF_PIC_LIST_1) ); //pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 98 } 99 #if SIMP_MRG_PRUN 100 if ( mrgCandIdx == iCount ) 101 { 102 return false; 103 } 104 #endif 105 iCount ++; 106 } 107 } 108 } 109 return true; 110 } 51 111 #endif 52 112 … … 3450 3510 #endif 3451 3511 3512 #if FORCE_REF_VSP==2 3513 bool bVspMvZeroDone = false; 3514 #endif 3515 3452 3516 Int iCount = 0; 3453 3517 … … 3513 3577 #endif 3514 3578 3515 //left 3579 #if FORCE_REF_VSP==2 3580 //===== vsp 0 ===== 3581 if ( !xAddVspSkip(0, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, mrgCandIdx) ) 3582 return; 3583 #endif 3584 3585 //===== left ===== 3516 3586 UInt uiLeftPartIdx = 0; 3517 3587 TComDataCU* pcCULeft = 0; … … 3533 3603 if (!(uiPUIdx == 1 && (partSize == SIZE_Nx2N || partSize == SIZE_nLx2N || partSize == SIZE_nRx2N))) 3534 3604 { 3535 if ( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx ) ) 3605 if ( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx ) 3606 #if FORCE_REF_VSP 3607 CHECK_ADD_YET(pcCULeft, uiLeftPartIdx) 3608 #endif 3609 ) 3536 3610 { 3537 3611 abCandIsInter[iCount] = true; … … 3548 3622 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 3549 3623 #endif 3624 #if FORCE_REF_VSP 3625 SET_AOUND_MVINFO(pcCULeft, uiLeftPartIdx) 3626 #endif 3550 3627 #if SIMP_MRG_PRUN 3551 3628 if ( mrgCandIdx == iCount ) … … 3581 3658 #endif 3582 3659 3583 // above 3660 #if FORCE_REF_VSP==2 3661 //===== vsp 1 ===== 3662 if ( !xAddVspSkip(1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, mrgCandIdx) ) 3663 return; 3664 #endif 3665 3666 //===== above ===== 3584 3667 #if !SIMP_MRG_PRUN 3585 3668 partSize = getPartitionSize( uiAbsPartIdx ); … … 3605 3688 #if SIMP_MRG_PRUN 3606 3689 if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx ) 3690 #if FORCE_REF_VSP 3691 CHECK_ADD_YET(pcCUAbove, uiAbovePartIdx) 3692 #endif 3607 3693 && !(uiPUIdx == 1 && (cCurPS == SIZE_2NxN || cCurPS == SIZE_2NxnU || cCurPS == SIZE_2NxnD)) 3608 3694 && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAbove, uiAbovePartIdx ) ) ) … … 3624 3710 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 3625 3711 #endif 3712 #if FORCE_REF_VSP 3713 SET_AOUND_MVINFO(pcCUAbove, uiAbovePartIdx) 3714 #endif 3626 3715 #if SIMP_MRG_PRUN 3627 3716 if ( mrgCandIdx == iCount ) … … 3659 3748 #endif 3660 3749 3661 // above right 3750 #if FORCE_REF_VSP==2 3751 //===== vsp 2 ===== 3752 if ( !xAddVspSkip(2, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, mrgCandIdx) ) 3753 return; 3754 #endif 3755 3756 //===== above right ===== 3662 3757 UInt uiAboveRightPartIdx = 0; 3663 3758 TComDataCU* pcCUAboveRight = 0; … … 3677 3772 #endif 3678 3773 #if SIMP_MRG_PRUN 3679 if ( pcCUAboveRight && !pcCUAboveRight->isIntra( uiAboveRightPartIdx ) && ( !pcCUAbove || pcCUAbove->isIntra( uiAbovePartIdx ) || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveRight, uiAboveRightPartIdx ) ) ) 3774 if ( pcCUAboveRight && !pcCUAboveRight->isIntra( uiAboveRightPartIdx ) 3775 #if FORCE_REF_VSP 3776 CHECK_ADD_YET(pcCUAboveRight, uiAboveRightPartIdx) 3777 #endif 3778 && ( !pcCUAbove || pcCUAbove->isIntra( uiAbovePartIdx ) || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveRight, uiAboveRightPartIdx ) ) ) 3680 3779 #else 3681 3780 if ( pcCUAboveRight && !pcCUAboveRight->isIntra( uiAboveRightPartIdx ) ) … … 3695 3794 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 3696 3795 #endif 3796 #if FORCE_REF_VSP 3797 SET_AOUND_MVINFO(pcCUAboveRight, uiAboveRightPartIdx) 3798 #endif 3697 3799 #if SIMP_MRG_PRUN 3698 3800 if ( mrgCandIdx == iCount ) … … 3727 3829 #endif 3728 3830 3729 //left bottom 3831 #if FORCE_REF_VSP==2 3832 //===== vsp 3 ===== 3833 if ( !xAddVspSkip(3, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, mrgCandIdx) ) 3834 return; 3835 #endif 3836 3837 //===== left bottom ===== 3838 #if VSP_MERGE_POS < 4 3839 #if HHI_INTER_VIEW_MOTION_PRED 3840 if( iCount < 4 + extraMergeCand ) 3841 #else 3842 if( iCount < 4 ) 3843 #endif 3844 { 3845 #endif 3730 3846 UInt uiLeftBottomPartIdx = 0; 3731 3847 TComDataCU* pcCULeftBottom = 0; … … 3745 3861 #endif 3746 3862 #if SIMP_MRG_PRUN 3747 if ( pcCULeftBottom && !pcCULeftBottom->isIntra( uiLeftBottomPartIdx ) && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCULeftBottom, uiLeftBottomPartIdx ) ) ) 3863 if ( pcCULeftBottom && !pcCULeftBottom->isIntra( uiLeftBottomPartIdx ) 3864 #if FORCE_REF_VSP 3865 CHECK_ADD_YET(pcCULeftBottom, uiLeftBottomPartIdx) 3866 #endif 3867 && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCULeftBottom, uiLeftBottomPartIdx ) ) ) 3748 3868 #else 3749 3869 if ( pcCULeftBottom && !pcCULeftBottom->isIntra( uiLeftBottomPartIdx ) ) … … 3763 3883 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 3764 3884 #endif 3885 #if FORCE_REF_VSP 3886 SET_AOUND_MVINFO(pcCULeftBottom, uiLeftBottomPartIdx) 3887 #endif 3765 3888 #if SIMP_MRG_PRUN 3766 3889 if ( mrgCandIdx == iCount ) … … 3771 3894 iCount ++; 3772 3895 } 3896 #if VSP_MERGE_POS < 4 3897 } 3898 #endif 3773 3899 3774 3900 #if HHI_INTER_VIEW_MOTION_PRED … … 3795 3921 #endif 3796 3922 3797 // above left 3923 #if FORCE_REF_VSP==2 3924 //===== vsp 4 ===== 3925 if( iCount < 4 + extraMergeCand ) 3926 { 3927 if ( !xAddVspSkip(4, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, mrgCandIdx) ) 3928 return; 3929 } 3930 #endif 3931 3932 //===== above left ===== 3798 3933 #if HHI_INTER_VIEW_MOTION_PRED 3799 3934 if( iCount < 4 + extraMergeCand ) … … 3820 3955 #if SIMP_MRG_PRUN 3821 3956 if( pcCUAboveLeft && !pcCUAboveLeft->isIntra( uiAboveLeftPartIdx ) 3957 #if FORCE_REF_VSP 3958 CHECK_ADD_YET(pcCUAboveLeft, uiAboveLeftPartIdx) 3959 #endif 3822 3960 && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) ) 3823 3961 && ( !pcCUAbove || pcCUAbove->isIntra( uiAbovePartIdx ) || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) ) … … 3840 3978 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 3841 3979 #endif 3980 #if FORCE_REF_VSP 3981 SET_AOUND_MVINFO(pcCUAboveLeft, uiAboveLeftPartIdx) 3982 #endif 3842 3983 #if SIMP_MRG_PRUN 3843 3984 if ( mrgCandIdx == iCount ) … … 3849 3990 } 3850 3991 } 3992 3993 #if FORCE_REF_VSP==2 3994 //===== vsp 5 ===== 3995 #if HHI_INTER_VIEW_MOTION_PRED 3996 if( iCount < 4 + extraMergeCand ) 3997 #else 3998 if( iCount < 4 ) 3999 #endif 4000 { 4001 if ( !xAddVspSkip(5, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, mrgCandIdx) ) 4002 return; 4003 } 4004 #endif 3851 4005 3852 4006 if ( getSlice()->getPPS()->getEnableTMVPFlag() ) … … 4268 4422 if( uiIter == 0 ) 4269 4423 { 4270 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) ) 4424 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) 4425 #if FORCE_REF_VSP==1 4426 && !pcCorner->isVspMode( uiCornerPUIdx ) 4427 #endif 4428 ) 4271 4429 { 4272 4430 rbValidCand = true; … … 4303 4461 else 4304 4462 { 4305 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) ) 4463 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) 4464 #if FORCE_REF_VSP==1 4465 && !pcCorner->isVspMode( uiCornerPUIdx ) 4466 #endif 4467 ) 4306 4468 { 4307 4469 rbValidCand = true; … … 4452 4614 #endif 4453 4615 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 4616 #if VSP_N 4617 if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP) 4618 #endif 4454 4619 { 4455 4620 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) … … 4478 4643 4479 4644 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4645 #if VSP_N 4646 if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP) 4647 #endif 4480 4648 { 4481 4649 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) … … 4504 4672 #endif 4505 4673 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 4674 #if VSP_N 4675 if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP) 4676 #endif 4506 4677 { 4507 4678 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) … … 4529 4700 #endif 4530 4701 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4702 #if VSP_N 4703 if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP) 4704 #endif 4531 4705 { 4532 4706 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) … … 4557 4731 #endif 4558 4732 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4733 #if VSP_N 4734 if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP) 4735 #endif 4559 4736 { 4560 4737 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) … … 4768 4945 UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth(); 4769 4946 4770 Int aiDvMcpDvCand[2][7] = {{0,}, {0,}}; // dummy, 5 spatial + 1 temporal, DV-MCP ÁÖº¯ º í·°¿¡¼ »ç¿ëµÈ DV¸¦ ÀúÀå4947 Int aiDvMcpDvCand[2][7] = {{0,}, {0,}}; // dummy, 5 spatial + 1 temporal, DV-MCP ÁÖº¯ ºúÓ°¿¡¼ »ç¿EÈ DV¸¦ ÀúÀE 4771 4948 Bool abDvMcpFlag [2][7] = {{false,},{false,}}; 4772 4949 //Int aiRefPOC [2][7] = {{-1,},{-1}}; // debug … … 4788 4965 UInt uiLeftPartIdx = uiIdx; 4789 4966 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 4967 #if VSP_N 4968 if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP) 4969 #endif 4790 4970 { 4791 4971 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); … … 4826 5006 4827 5007 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 5008 #if VSP_N 5009 if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP) 5010 #endif 4828 5011 { 4829 5012 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); … … 4863 5046 #endif 4864 5047 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 5048 #if VSP_N 5049 if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP) 5050 #endif 4865 5051 { 4866 5052 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); … … 4900 5086 #endif 4901 5087 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 5088 #if VSP_N 5089 if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP) 5090 #endif 4902 5091 { 4903 5092 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); … … 4939 5128 #endif 4940 5129 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 5130 #if VSP_N 5131 if(pcTmpCU->getSlice()->getViewId() != NUM_VIEW_VSP) 5132 #endif 4941 5133 { 4942 5134 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); … … 5551 5743 } 5552 5744 5745 #if FORCE_REF_VSP==2 5746 Int TComDataCU::isVspMode ( UInt uiPartIdx ) 5747 { 5748 if( m_pePredMode[ uiPartIdx ] == MODE_SKIP ) return 0; 5749 if( m_pePredMode[ uiPartIdx ] == MODE_INTRA ) return 0; 5750 5751 Int aiRefIdx[2] = {NOT_VALID, NOT_VALID}, iRet = 0; 5752 for( Int iList = 0; iList < 2; iList++ ) 5753 { 5754 aiRefIdx[iList] = getCUMvField( RefPicList(iList) )->getRefIdx( uiPartIdx ); 5755 if( aiRefIdx[iList] >= 0 && getSlice()->getRefViewId( RefPicList(iList), aiRefIdx[iList] ) == NUM_VIEW_VSP ) 5756 { 5757 iRet |= (iList ? 0x02 : 0x01); // L0=1, L1=2, BI=3 5758 continue; 5759 } 5760 } 5761 5762 return iRet; 5763 } 5764 5765 Int TComDataCU::isVspMode ( UInt uiPartIdx, TComMv cCompMv ) 5766 { 5767 TComMv cMv; 5768 Int iRet = 0, iList = 0; 5769 5770 if( (iList = isVspMode( uiPartIdx )) ) 5771 { 5772 switch( iList ) 5773 { 5774 case 1: 5775 cMv = getCUMvField( RefPicList(0) )->getMv( uiPartIdx ); 5776 if( cMv == cCompMv ) 5777 { 5778 iRet = 1; // L0=1 5779 } 5780 break; 5781 case 2: 5782 cMv = getCUMvField( RefPicList(1) )->getMv( uiPartIdx ); 5783 if( cMv == cCompMv ) 5784 { 5785 iRet = 2; // L1=2 5786 } 5787 break; 5788 case 3: 5789 cMv = getCUMvField( RefPicList(0) )->getMv( uiPartIdx ); 5790 if( cMv == cCompMv ) 5791 { 5792 cMv = getCUMvField( RefPicList(1) )->getMv( uiPartIdx ); 5793 if( cMv == cCompMv ) 5794 { 5795 iRet = 3; // BI=3 5796 } 5797 } 5798 break; 5799 } 5800 } 5801 5802 return iRet; 5803 } 5804 #endif 5805 5553 5806 // ==================================================================================================================== 5554 5807 // Protected member functions … … 5612 5865 } 5613 5866 5867 #if AMVP_VSP_UNAVAILABLE 5868 if( pcTmpCU != NULL && pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) >= 0 && pcTmpCU->getSlice()->getRefViewId( eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ) == NUM_VIEW_VSP ) 5869 { 5870 return false; 5871 } 5872 #endif 5873 5614 5874 if ( pcTmpCU != NULL && m_pcSlice->isEqualRef(eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx), iRefIdx) ) 5615 5875 { … … 5713 5973 TComDataCU* pcTmpCU = NULL; 5714 5974 UInt uiIdx; 5975 #if VSP_N 5976 Bool bRefVsp = false; 5977 #endif 5715 5978 switch( eDir ) 5716 5979 { … … 5770 6033 return false; 5771 6034 } 6035 6036 #if AMVP_VSP_UNAVAILABLE 6037 if( pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) >= 0 && pcTmpCU->getSlice()->getRefViewId( eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ) == NUM_VIEW_VSP ) 6038 { 6039 return false; 6040 } 6041 #endif 5772 6042 5773 6043 RefPicList eRefPicList2nd = REF_PIC_LIST_0; … … 5815 6085 } 5816 6086 6087 #if VSP_N 6088 if( pcTmpCU->getSlice()->getRefViewId( eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ) == NUM_VIEW_VSP ) 6089 { 6090 bRefVsp = true; 6091 } 6092 Int iScale = bRefVsp ? 4096 : xGetDistScaleFactor( iCurrPOC, iCurrRefPOC, iNeibPOC, iNeibRefPOC ); 6093 #else 5817 6094 Int iScale = xGetDistScaleFactor( iCurrPOC, iCurrRefPOC, iNeibPOC, iNeibRefPOC ); 6095 #endif 5818 6096 if ( iScale == 4096 ) 5819 6097 { … … 5842 6120 } 5843 6121 6122 #if VSP_N 6123 if( pcTmpCU->getSlice()->getRefViewId( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ) == NUM_VIEW_VSP ) 6124 { 6125 bRefVsp = true; 6126 } 6127 Int iScale = bRefVsp ? 4096 : xGetDistScaleFactor( iCurrPOC, iCurrRefPOC, iNeibPOC, iNeibRefPOC ); 6128 #else 5844 6129 Int iScale = xGetDistScaleFactor( iCurrPOC, iCurrRefPOC, iNeibPOC, iNeibRefPOC ); 6130 #endif 5845 6131 if ( iScale == 4096 ) 5846 6132 { … … 5875 6161 Int iColViewIdx, iColRefViewIdx; 5876 6162 TComPic *pColPic = getSlice()->getRefPic( eRefPicList, refidx); 6163 #if VSP_MV_ZERO // shimizu 5877 6164 TComDataCU *pColCU = pColPic->getCU( uiCUAddr ); 5878 6165 iColViewIdx = pColCU->getSlice()->getViewId(); 5879 6166 #if VSP_N 6167 if( iColViewIdx == NUM_VIEW_VSP ) 6168 { 6169 return false; 6170 } 6171 #endif 6172 #else 6173 #if VSP_N 6174 if( pColPic->getSlice(0)->getViewId() == NUM_VIEW_VSP ) 6175 { 6176 return false; 6177 } 6178 #endif 6179 TComDataCU *pColCU = pColPic->getCU( uiCUAddr ); 6180 iColViewIdx = pColCU->getSlice()->getViewId(); 6181 #endif 5880 6182 5881 6183 if (pColCU->getPic()==0||pColCU->getPartitionSize(uiPartUnitIdx)==SIZE_NONE||pColCU->isIntra(uiAbsPartAddr)) … … 5904 6206 5905 6207 iColRefViewIdx = pColCU->getSlice()->getRefPic(eColRefPicList, iColRefIdx)->getViewId(); 6208 #if VSP_N 6209 if( iColRefViewIdx == NUM_VIEW_VSP ) 6210 { 6211 continue; 6212 } 6213 #endif 5906 6214 5907 6215 if ( iColViewIdx == iColRefViewIdx ) // temporal vector … … 6040 6348 iScale = 0; 6041 6349 iCurrRefViewOrderIdx = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewOrderIdx(); 6350 #if VSP_N 6351 // UInt uiColRefViewId = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewId(); 6352 UInt uiCurRefViewId = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewId(); 6353 if( uiCurRefViewId == NUM_VIEW_VSP ) 6354 iScale = 4096; 6355 else 6356 #endif 6042 6357 if((iColPOC != iColRefPOC)&&(iCurrPOC != iCurrRefPOC)) 6043 6358 iScale = xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iColPOC, iColRefPOC); … … 6052 6367 if ( iScale == 4096 ) 6053 6368 { 6369 #if VSP_MV_ZERO 6370 if( uiCurRefViewId == NUM_VIEW_VSP ) 6371 rcMv.setZero(); 6372 else 6373 #endif 6054 6374 rcMv = cColMv; 6055 6375 } … … 6151 6471 return false; 6152 6472 } 6473 6474 #if VSP_N //?? 6475 if (pColCU->isSkipped(uiPartIdxCenter)) 6476 return false; 6477 #endif 6153 6478 6154 6479 if( m_pcSlice->getRefPic( eRefPicList, iRefIdx )->getViewId() != m_pcSlice->getViewId() ) … … 7705 8030 7706 8031 //! \} 8032 -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComDataCU.h
r100 r166 265 265 Bool xAddMVPCand ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); 266 266 Bool xAddMVPCandOrder ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); 267 #if FORCE_REF_VSP==2 268 inline bool xAddVspSkip(UChar ucVspMergePos, Bool bVspMvZeroDone, UInt uiDepth, Bool* abCandIsInter, Int& iCount, 269 UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, Int mrgCandIdx); 270 #endif 267 271 268 272 Void deriveRightBottomIdx ( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxRB ); … … 656 660 Bool isIntra ( UInt uiPartIdx ) { return m_pePredMode[ uiPartIdx ] == MODE_INTRA; } 657 661 Bool isSkipped ( UInt uiPartIdx ); ///< SKIP (no residual) 662 #if FORCE_REF_VSP==1 663 Int isVspMode ( UInt uiPartIdx ) { return m_pePredMode[ uiPartIdx ] == MODE_SYNTH; } 664 #elif FORCE_REF_VSP==2 665 Int isVspMode ( UInt uiPartIdx ); 666 Int isVspMode ( UInt uiPartIdx, TComMv cCompMv ); 667 #endif 658 668 659 669 // ------------------------------------------------------------------------------------------------------------------- -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComDepthMapGenerator.cpp
r100 r166 562 562 m_cTmpPic.dump( acFilename, ( pcPic->getPOC() != 0 ) ); 563 563 } 564 565 #if VSP_N 566 Void 567 TComDepthMapGenerator::clearDepthMap( TComPic* pcPic, Int iVal/*=PDM_UNDEFINED_DEPTH*/ ) 568 { 569 xClearDepthMap( pcPic, iVal ); 570 } 571 #endif 564 572 #endif 565 573 … … 733 741 Int iNumRefPics = pcSlice->getNumRefIdx( eRefPicList ); 734 742 for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ ) 735 { 743 { 744 #if VSP_N 745 if( pcSlice->getRefViewId( eRefPicList, iPdmRefIdx ) != NUM_VIEW_VSP ) 746 #endif 736 747 if( pcSlice->getRefPOC( eRefPicList, iPdmRefIdx ) == pcSlice->getPOC()) 737 748 { … … 834 845 Int iRefPoc = pcRefPic->getPOC(); 835 846 Bool bInterview = ( uiRefViewId < m_uiCurrViewId ); 847 #if VSP_N 848 Bool bVsp = ( pcRefPic->getViewId() == NUM_VIEW_VSP ); 849 AOT( bInterview && bVsp && iRefPoc != pcSlice->getPOC() ); 850 AOT( !bInterview && !bVsp && iRefPoc == pcSlice->getPOC() ); 851 #else 836 852 AOT( bInterview && iRefPoc != pcSlice->getPOC() ); 837 853 AOT( !bInterview && iRefPoc == pcSlice->getPOC() ); 854 #endif 855 856 #if FORCE_REF_VSP 857 if( bVsp ) return false; 858 #endif 859 838 860 Bool bPdmIView = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_IVIEW ) == PDM_USE_FOR_IVIEW ); 839 861 Bool bPdmInter = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_INTER ) == PDM_USE_FOR_INTER ); … … 924 946 Int iRefPoc = pcRefPic->getPOC(); 925 947 Bool bInterview = ( uiRefViewId < m_uiCurrViewId ); 948 #if VSP_N 949 Bool bVsp = ( pcRefPic->getViewId() == NUM_VIEW_VSP ); 950 AOT( bInterview && bVsp && iRefPoc != pcSlice->getPOC() ); 951 AOT( !bInterview && !bVsp && iRefPoc == pcSlice->getPOC() ); 952 #else 926 953 AOT( bInterview && iRefPoc != pcSlice->getPOC() ); 927 954 AOT( !bInterview && iRefPoc == pcSlice->getPOC() ); 955 #endif 956 957 #if FORCE_REF_VSP 958 if( bVsp ) return false; 959 #endif 928 960 929 961 Bool bPdmIView = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_IVIEW ) == PDM_USE_FOR_IVIEW ); … … 1351 1383 xInterPredictCUDepthMap( pcSubCU, pcSubDM ); 1352 1384 break; 1385 #if FORCE_REF_VSP==1 1386 case MODE_SYNTH: 1387 xIntraPredictCUDepthMap( pcSubCU, pcSubDM ); //What to do? Need Fix! 1388 break; 1389 #endif 1353 1390 default: 1354 1391 AOT( true ); … … 1464 1501 aiCurrRefIdx[1] >= 0 && pcCU->getSlice()->getRefPic( REF_PIC_LIST_1, aiCurrRefIdx[1] )->getSPS()->getViewId() != m_uiCurrViewId }; 1465 1502 Bool bUsesInterViewPrd = ( abCurrIntView[0] || abCurrIntView[1] ); 1503 #if VSP_N 1504 if(( aiCurrRefIdx[0] >= 0 && pcCU->getSlice()->getRefPic( REF_PIC_LIST_0, aiCurrRefIdx[0] )->getViewId() == NUM_VIEW_VSP ) || 1505 ( aiCurrRefIdx[1] >= 0 && pcCU->getSlice()->getRefPic( REF_PIC_LIST_1, aiCurrRefIdx[1] )->getViewId() == NUM_VIEW_VSP )) { 1506 //if refpic is VSP, copy to Original cuurent PDM 1507 TComPicYuv* pcPdm = pcCU->getPic()->getPredDepthMap(); 1508 UInt uiZOrderIdx = pcCU->getZorderIdxInCU() + uiAbsPartIdx; 1509 assert( pcPdm ); 1510 pcCUDepthMap->copyFromPicYuv( pcPdm, pcCU->getAddr(), uiZOrderIdx ); 1511 } 1512 #endif 1466 1513 if( bUsesInterViewPrd ) 1467 1514 { -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComDepthMapGenerator.h
r100 r166 140 140 Void updateDepthMap ( TComPic* pcPic ); 141 141 Void dumpDepthMap ( TComPic* pcPic, char* pFilenameBase ); 142 #if VSP_N 143 Void clearDepthMap ( TComPic* pcPic, Int iVal = PDM_UNDEFINED_DEPTH); 144 #endif 142 145 #endif 143 146 -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComLoopFilter.cpp
r56 r166 439 439 440 440 //-- Set BS for Intra MB : BS = 4 or 3 441 if ( pcCUP->isIntra(uiPartP) || pcCUQ->isIntra(uiPartQ) ) 441 if ( pcCUP->isIntra(uiPartP) || pcCUQ->isIntra(uiPartQ) 442 #if FORCE_REF_VSP==1 443 || pcCUP->isVspMode(uiPartP) || pcCUQ->isVspMode(uiPartQ) 444 #endif 445 ) 442 446 { 443 447 uiBs = 2; … … 445 449 446 450 //-- Set BS for not Intra MB : BS = 2 or 1 or 0 447 if ( !pcCUP->isIntra(uiPartP) && !pcCUQ->isIntra(uiPartQ) ) 451 if ( !pcCUP->isIntra(uiPartP) && !pcCUQ->isIntra(uiPartQ) 452 #if FORCE_REF_VSP==1 453 && !pcCUP->isVspMode(uiPartP) && !pcCUQ->isVspMode(uiPartQ) 454 #endif 455 ) 448 456 { 449 457 #if NSQT_LFFIX … … 542 550 } // enf of "if( not Intra )" 543 551 552 #if FORCE_REF_VSP==1 553 if ( pcCUP->isVspMode(uiPartP) || pcCUQ->isVspMode(uiPartQ)) 554 { 555 uiBs = 0; 556 } 557 #endif 558 544 559 m_aapucBS[iDir][uiAbsPartIdx] = uiBs; 545 560 } -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPic.cpp
r100 r166 53 53 m_apcPicYuv[0] = NULL; 54 54 m_apcPicYuv[1] = NULL; 55 #if VSP_N 56 m_apcPicYuvAvail = NULL; 57 m_apcPicYuvSynth = NULL; 58 #endif 55 59 #if DEPTH_MAP_GENERATION 56 60 m_pcPredDepthMap = NULL; … … 64 68 #if HHI_INTER_VIEW_RESIDUAL_PRED 65 69 m_pcResidual = NULL; 70 #endif 71 #if DEBUGIMGOUT 72 m_acPicYuvDebug = NULL; 66 73 #endif 67 74 m_pcPicYuvPred = NULL; … … 95 102 } 96 103 m_apcPicYuv[1] = new TComPicYuv; m_apcPicYuv[1]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth ); 97 104 #if DEBUGIMGOUT 105 m_acPicYuvDebug = new TComPicYuv; m_acPicYuvDebug->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth ); 106 #endif 107 98 108 /* there are no SEI messages associated with this picture initially */ 99 109 m_SEIs = NULL; … … 162 172 delete m_pcResidual; 163 173 m_pcResidual = NULL; 174 } 175 #endif 176 #if DEBUGIMGOUT 177 if (m_acPicYuvDebug) 178 { 179 m_acPicYuvDebug->destroy(); 180 delete m_acPicYuvDebug; 181 m_acPicYuvDebug = NULL; 164 182 } 165 183 #endif … … 623 641 } 624 642 643 #if VSP_N 644 Void TComPic::checkSynthesisAvailability( /*TComDataCU*& rpcCU, */UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied ) 645 { 646 rpbCUSynthesied[0] = true; 647 rpbCUSynthesied[1] = true; 648 rpbCUSynthesied[2] = true; 649 rpbCUSynthesied[3] = true; 650 651 if (!getPicYuvAvail()) 652 { 653 rpbCUSynthesied[0] = false; 654 rpbCUSynthesied[1] = false; 655 rpbCUSynthesied[2] = false; 656 rpbCUSynthesied[3] = false; 657 return; 658 } 659 660 Int x, y; 661 Pel* pAvail = getPicYuvAvail()->getLumaAddr ( iCuAddr, uiAbsZorderIdx ); 662 Int CUHeight = g_uiMaxCUHeight >> uiPartDepth; //rpcCU->getHeight(uiAbsZorderIdx); 663 Int CUWidth = g_uiMaxCUWidth >> uiPartDepth; //rpcCU->getWidth(uiAbsZorderIdx); 664 665 Int iStride = getPicYuvAvail()->getStride(); 666 for ( y = ((CUHeight - 1) >> 1); y >= 0; y-- ) 667 { 668 for ( x = ((CUWidth - 1) >> 1); x >= 0; x-- ) 669 { 670 rpbCUSynthesied[0] &= (pAvail[x] != 0); 671 } 672 for ( x = CUWidth - 1; x >= ((CUWidth) >> 1); x-- ) 673 { 674 rpbCUSynthesied[1] &= (pAvail[x] != 0); 675 } 676 pAvail += iStride; 677 } 678 //for ( y = CUHeight - 1; y >= ((CUHeight) >> 1); y-- ) 679 for ( y = ((CUHeight - 1) >> 1); y >= 0; y-- ) //Owieczka 680 { 681 for ( x = ((CUWidth - 1) >> 1); x >= 0; x-- ) 682 { 683 rpbCUSynthesied[2] &= (pAvail[x] != 0); 684 } 685 for ( x = CUWidth - 1; x >= ((CUWidth) >> 1); x-- ) 686 { 687 rpbCUSynthesied[3] &= (pAvail[x] != 0); 688 } 689 pAvail += iStride; 690 } 691 692 //rpbCUSynthesied[0] = !rpbCUSynthesied[0]; 693 //rpbCUSynthesied[1] = !rpbCUSynthesied[1]; 694 //rpbCUSynthesied[2] = !rpbCUSynthesied[2]; 695 //rpbCUSynthesied[3] = !rpbCUSynthesied[3]; 696 } 697 #endif 625 698 626 699 //! \} -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPic.h
r100 r166 65 65 TComPicYuv* m_apcPicYuv[2]; // Texture, 0:org / 1:rec 66 66 67 #if VSP_N 68 TComPicYuv* m_apcPicYuvAvail; // Availability Map - Does the given pixel can be synthesised in receiver 69 TComPicYuv* m_apcPicYuvSynth; // Sythesied image 70 #endif 71 67 72 #if DEPTH_MAP_GENERATION 68 73 TComPicYuv* m_pcPredDepthMap; // estimated depth map … … 85 90 #if HHI_INTER_VIEW_RESIDUAL_PRED 86 91 TComPicYuv* m_pcResidual; // residual buffer (coded or inter-view predicted residual) 92 #endif 93 #if DEBUGIMGOUT 94 TComPicYuv* m_acPicYuvDebug; // debug image 87 95 #endif 88 96 … … 145 153 TComPicYuv* getPicYuvOrg() { return m_apcPicYuv[0]; } 146 154 TComPicYuv* getPicYuvRec() { return m_apcPicYuv[1]; } 155 #if VSP_N 156 Void setPicYuvAvail( TComPicYuv* pc ){ m_apcPicYuvAvail = pc; } 157 Void setPicYuvSynth( TComPicYuv* pc ){ m_apcPicYuvSynth = pc; } 158 TComPicYuv* getPicYuvAvail() { return m_apcPicYuvAvail; } 159 TComPicYuv* getPicYuvSynth() { return m_apcPicYuvSynth; } 160 Void checkSynthesisAvailability( /*TComDataCU*& rpcBestCU, */UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied); 161 #endif 147 162 #if HHI_INTERVIEW_SKIP 148 163 TComPicYuv* getUsedPelsMap() { return m_pcUsedPelsMap; } … … 168 183 #if HHI_INTER_VIEW_RESIDUAL_PRED 169 184 TComPicYuv* getResidual() { return m_pcResidual; } 185 #endif 186 187 #if DEBUGIMGOUT 188 TComPicYuv* getPicYuvRecDbg() { return m_acPicYuvDebug; } 170 189 #endif 171 190 -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPicSym.cpp
r56 r166 97 97 m_puiInverseCUOrderMap[i] = i; 98 98 } 99 100 #if VSP_N 101 m_apcTComTile = NULL; 102 #endif 99 103 } 100 104 -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPicYuv.h
r56 r166 184 184 Void setChromaTo ( Pel pVal ); 185 185 186 #if DEBUGIMGOUT 187 // Degub tools 188 public: 189 Void colsetToPicYuv ( const UChar ucColor[3], Int iOffset[2][2], TComPicYuv* pcPicYuvDst, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth = 0, UInt uiPartIdx = 0 ); 190 Void colsetToPicLuma ( const UChar ucLumaOffCol, Int iOffset[2][2], TComPicYuv* pcPicYuvDst, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth = 0, UInt uiPartIdx = 0 ); 191 Void colsetToPicChroma( const UChar ucUCol, const UChar ucVCol, Int iOffset[2][2], TComPicYuv* pcPicYuvDst, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth = 0, UInt uiPartIdx = 0 ); 192 Void drawLineToPicYuv ( bool bHor, bool bVer, UInt uiSize, TComPicYuv* pcPicYuvDst, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth = 0, UInt uiPartIdx = 0 ); 193 #endif 194 186 195 };// END CLASS DEFINITION TComPicYuv 187 196 -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPrediction.h
r100 r166 95 95 Void xPredInterPrdDepthMap ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, TComYuv*& rpcYuv, UInt uiRShift, UInt uiOffset ); 96 96 #endif 97 98 97 #if DEPTH_MAP_GENERATION 99 98 Void xWeightedAveragePdm ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst, UInt uiSubSampExpX, UInt uiSubSampExpY ); … … 103 102 Void xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi ); 104 103 Void xWeightedAverage ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst ); 105 104 106 105 Void xGetLLSPrediction ( TComPattern* pcPattern, Int* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0 ); 107 106 … … 142 141 Void motionCompensation ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1 ); 143 142 #endif 144 143 145 144 // motion vector prediction 146 145 Void getMvPredAMVP ( TComDataCU* pcCU, UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMvPred ); -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComResidualGenerator.cpp
r100 r166 390 390 xSetRecResidualInterCU( pcSubCU, pcSubRes ); 391 391 break; 392 #if FORCE_REF_VSP==1 393 case MODE_SYNTH: 394 xSetRecResidualIntraCU( pcSubCU, pcSubRes ); //MayBe it should be seperate function 395 break; 396 #endif 392 397 default: 393 398 AOT( true ); -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComSlice.cpp
r101 r166 114 114 { 115 115 m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = m_aiNumRefIdx[2] = 0; 116 117 #if FORCE_REF_VSP 118 m_iRefIdxVsp[0] = m_iRefIdxVsp[1] = NOT_VALID; 119 #endif 116 120 117 121 initEqualRef(); … … 139 143 resetWpScalingLC(m_weightPredTableLC); 140 144 initWpAcDcParam(); 145 146 #if VSP_SLICE_HEADER 147 m_bVspFlag = false; 148 #endif 141 149 } 142 150 … … 185 193 m_numEntryPointOffsets = 0; 186 194 #endif 195 #if VSP_SLICE_HEADER 196 m_bVspFlag = false; 197 #endif 198 187 199 } 188 200 … … 407 419 } 408 420 421 #if VSP_N 422 Void TComSlice::setRefPicListMvc( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcInterViewRefPics, TComPic* pcVspPic ) 423 #else 409 424 Void TComSlice::setRefPicListMvc( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcInterViewRefPics ) 425 #endif 410 426 { 411 427 if( m_eSliceType == I_SLICE ) … … 422 438 TComPic* RefPicSetLtCurr [16]; 423 439 TComPic* RefPicSetIvCurr [16]; 440 #if VSP_N 441 TComPic* RefPicSetVspCurr [16] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; //for Linux comp 442 #endif 424 443 425 444 UInt NumPocStCurr0 = 0; … … 427 446 UInt NumPocLtCurr = 0; 428 447 UInt NumPocIvCurr = 0; 448 #if VSP_N 449 UInt NumPocVspCurr = 0; 450 #endif 429 451 430 452 Int i; … … 474 496 NumPocIvCurr++; 475 497 } 498 #if VSP_N 499 if( pcVspPic ) 500 { 501 pcRefPic = pcVspPic; 502 pcRefPic->setIsLongTerm( 0 ); 503 pcRefPic->getPicYuvRec()->extendPicBorder(); 504 RefPicSetVspCurr[NumPocVspCurr] = pcRefPic; 505 NumPocVspCurr++; 506 } 507 #endif 476 508 477 509 // ref_pic_list_init … … 481 513 482 514 assert( (NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + NumPocIvCurr) == getNumPocTotalCurrMvc() ); 515 #if VSP_N 516 Int numRpsCurrTempList0 = max( (num_ref_idx_l0_active_minus1 + 1), (NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + NumPocIvCurr + NumPocVspCurr) ); 517 Int numRpsCurrTempList1 = max( (num_ref_idx_l1_active_minus1 + 1), (NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + NumPocIvCurr + NumPocVspCurr) ); 518 #else 483 519 Int numRpsCurrTempList0 = max( (num_ref_idx_l0_active_minus1 + 1), (NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + NumPocIvCurr) ); 484 520 Int numRpsCurrTempList1 = max( (num_ref_idx_l1_active_minus1 + 1), (NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + NumPocIvCurr) ); 521 #endif 485 522 486 523 assert( numRpsCurrTempList0 <= 16 ); … … 509 546 for( cIdx = 0; cIdx <= num_ref_idx_l0_active_minus1; cIdx ++ ) 510 547 { 548 #if VSP_N 549 if( pcVspPic && cIdx == num_ref_idx_l0_active_minus1 ) 550 { 551 m_apcRefPicList[0][cIdx] = RefPicSetVspCurr[0]; 552 #if FORCE_REF_VSP 553 m_iRefIdxVsp[0] = cIdx; 554 #endif 555 } 556 else 557 m_apcRefPicList[0][cIdx] = m_RefPicListModification.getRefPicListModificationFlagL0() ? refPicListTemp0[ m_RefPicListModification.getRefPicSetIdxL0(cIdx) ] : refPicListTemp0[cIdx]; 558 #else 511 559 m_apcRefPicList[0][cIdx] = m_RefPicListModification.getRefPicListModificationFlagL0() ? refPicListTemp0[ m_RefPicListModification.getRefPicSetIdxL0(cIdx) ] : refPicListTemp0[cIdx]; 560 #endif 512 561 } 513 562 if( m_eSliceType == P_SLICE ) … … 520 569 for( cIdx = 0; cIdx <= num_ref_idx_l1_active_minus1; cIdx ++ ) 521 570 { 571 #if VSP_N 572 if( pcVspPic && cIdx == num_ref_idx_l1_active_minus1 ) 573 { 574 m_apcRefPicList[1][cIdx] = RefPicSetVspCurr[0]; 575 #if FORCE_REF_VSP 576 m_iRefIdxVsp[1] = cIdx; 577 #endif 578 } 579 else 580 m_apcRefPicList[1][cIdx] = m_RefPicListModification.getRefPicListModificationFlagL1() ? refPicListTemp1[ m_RefPicListModification.getRefPicSetIdxL1(cIdx) ] : refPicListTemp1[cIdx]; 581 #else 522 582 m_apcRefPicList[1][cIdx] = m_RefPicListModification.getRefPicListModificationFlagL1() ? refPicListTemp1[ m_RefPicListModification.getRefPicSetIdxL1(cIdx) ] : refPicListTemp1[cIdx]; 583 #endif 523 584 } 524 585 } -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComSlice.h
r101 r166 45 45 #include "TComRom.h" 46 46 #include "TComList.h" 47 48 47 //! \ingroup TLibCommon 49 48 //! \{ … … 1269 1268 1270 1269 #if SONY_COLPIC_AVAILABILITY 1271 Int m_iViewOrderIdx; 1270 Int m_iViewOrderIdx; 1271 #endif 1272 1273 #if FORCE_REF_VSP 1274 Int m_iRefIdxVsp[2]; // L0/L1 1275 #endif 1276 1277 #if VSP_SLICE_HEADER 1278 Bool m_bVspFlag; 1272 1279 #endif 1273 1280 … … 1411 1418 Int getNumPocTotalCurr(); 1412 1419 Int getNumPocTotalCurrMvc(); 1420 #if VSP_N 1421 Void setRefPicListMvc ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcInterViewRefPics, TComPic* pcVspPic ); 1422 #else 1413 1423 Void setRefPicListMvc ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcInterViewRefPics ); 1424 #endif 1414 1425 Void setRefPOCnViewListsMvc(); 1415 1426 … … 1565 1576 Int* getInvCodedOffset () { return m_aaiCodedOffset[1]; } 1566 1577 1578 #if FORCE_REF_VSP 1579 Void setRefIdxVsp ( Int idx, Int refList ) { m_iRefIdxVsp[refList] = idx; } 1580 Int getRefIdxVsp ( Int refList ) { return m_iRefIdxVsp[refList]; } 1581 #endif 1582 1583 #if VSP_SLICE_HEADER 1584 Void setVspFlag ( Bool val ) { m_bVspFlag = val; } 1585 Bool getVspFlag () { return m_bVspFlag; } 1586 #endif 1587 1567 1588 protected: 1568 1589 TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, UInt uiPOC); -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComYuv.h
r100 r166 213 213 214 214 __inline Pel xClip (Pel x ) { return ( (x < 0) ? 0 : (x > (Pel)g_uiIBDI_MAX) ? (Pel)g_uiIBDI_MAX : x ); } 215 216 #if DEBUGIMGOUT 217 public: 218 Void colsetToPicYuv ( const UChar ucColor[3], Int iOffset[2][2], TComPicYuv* pcPicYuvDst, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth = 0, UInt uiPartIdx = 0 ); 219 Void colsetToPicLuma ( const UChar ucLumaOffCol, Int iOffset[2][2], TComPicYuv* pcPicYuvDst, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth = 0, UInt uiPartIdx = 0 ); 220 Void colsetToPicChroma( const UChar ucUCol, const UChar ucVCol, Int iOffset[2][2], TComPicYuv* pcPicYuvDst, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth = 0, UInt uiPartIdx = 0 ); 221 Void drawLineToPicYuv ( bool bHor, bool bVer, UInt uiSize, TComPicYuv* pcPicYuvDst, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth = 0, UInt uiPartIdx = 0 ); 222 #endif 223 215 224 };// END CLASS DEFINITION TComYuv 216 225 -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TypeDef.h
r133 r166 42 42 //! \{ 43 43 44 #define VSP_N 1 45 #if VSP_N 46 #define VSP_TEXT_ONLY 1 47 #define NUM_VIEW_VSP 99 48 #define VSP_N_DUMP 0 49 #define FORCE_REF_VSP 2 // 0=NotUseVSPSKIP 1:VSPSKIPforFlag 2:VSPSKIPforMergeIdx 50 #define VSP_MV_ZERO 0 // use zero vector for VSP 51 #if VSP_MV_ZERO 52 #define AMVP_VSP_UNAVAILABLE 1 53 #endif 54 #define VSP_MERGE_POS 5 // position of vsp in merge list (0..5) 55 #define NTT_SUBPEL 1 56 #endif 57 #define DEBUGIMGOUT 0 //Debug YUVImage Out 58 #define DEBUGLOGOUT 0 //Debug Log Out 59 60 #define VSP_SLICE_HEADER 1 61 #define VSP_FRAME_INTERVAL 2 62 44 63 #define FIXES 1 45 64 #define POZNAN_CABAC_INIT_FLAG_FIX 1 … … 115 134 #define HHI_FULL_PEL_DEPTH_MAP_MV_ACC 1 // full-pel mv accuracy for depth maps 116 135 117 #if HHI_INTER_VIEW_MOTION_PRED 136 #if HHI_INTER_VIEW_MOTION_PRED 118 137 #define SAIT_IMPROV_MOTION_PRED_M24829 1 // improved inter-view motion vector prediction 119 138 #else … … 727 746 MODE_INTER, ///< inter-prediction mode 728 747 MODE_INTRA, ///< intra-prediction mode 748 #if FORCE_REF_VSP==1 749 MODE_SYNTH, ///< synth-mode 750 #endif 729 751 MODE_NONE = 15 730 752 }; -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp
r100 r166 2348 2348 #endif 2349 2349 2350 #if VSP_SLICE_HEADER 2351 if( rpcSlice->getSPS()->getViewId()!=0 2352 #if VSP_TEXT_ONLY 2353 && !(rpcSlice->getSPS()->isDepth()) 2354 #endif 2355 ) 2356 { 2357 READ_FLAG( uiCode, "vsp_flag" ); 2358 rpcSlice->setVspFlag( uiCode ? true : false ); 2359 } 2360 #endif 2361 2350 2362 if (!bEntropySlice) 2351 2363 { … … 2601 2613 } 2602 2614 2615 #if FORCE_REF_VSP==1 2616 Void TDecCavlc::parseVspFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2617 { 2618 assert(0); 2619 } 2620 #endif 2621 2603 2622 #if HHI_INTER_VIEW_MOTION_PRED 2604 2623 Void TDecCavlc::parseMVPIdx( Int& riMVPIdx, Int iAMVPCands ) -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecCAVLC.h
r77 r166 142 142 143 143 Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 144 #if FORCE_REF_VSP==1 145 Void parseVspFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 146 #endif 144 147 Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); 145 148 Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth ); -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecCu.cpp
r100 r166 52 52 m_ppcYuvResPred = NULL; 53 53 #endif 54 #if FORCE_REF_VSP 55 m_ppcYuvAvail = NULL; 56 m_ppcYuvSynth = NULL; 57 #endif 54 58 m_ppcCU = NULL; 55 59 } … … 79 83 #if HHI_INTER_VIEW_RESIDUAL_PRED 80 84 m_ppcYuvResPred = new TComYuv* [m_uiMaxDepth-1]; 85 #endif 86 #if FORCE_REF_VSP 87 m_ppcYuvAvail = new TComYuv* [m_uiMaxDepth-1]; 88 m_ppcYuvSynth = new TComYuv* [m_uiMaxDepth-1]; 81 89 #endif 82 90 m_ppcCU = new TComDataCU*[m_uiMaxDepth-1]; … … 94 102 m_ppcYuvResPred[ui] = new TComYuv; m_ppcYuvResPred[ui]->create( uiWidth, uiHeight ); 95 103 #endif 104 #if FORCE_REF_VSP 105 m_ppcYuvAvail [ui] = new TComYuv; m_ppcYuvAvail [ui]->create( uiWidth, uiHeight ); 106 m_ppcYuvSynth [ui] = new TComYuv; m_ppcYuvSynth [ui]->create( uiWidth, uiHeight ); 107 #endif 96 108 m_ppcCU [ui] = new TComDataCU; m_ppcCU [ui]->create( uiNumPartitions, uiWidth, uiHeight, true, uiMaxWidth >> (m_uiMaxDepth - 1) ); 97 109 } … … 118 130 m_ppcYuvResPred[ui]->destroy(); delete m_ppcYuvResPred[ui]; m_ppcYuvResPred[ui] = NULL; 119 131 #endif 132 #if FORCE_REF_VSP 133 m_ppcYuvAvail [ui]->destroy(); delete m_ppcYuvAvail [ui]; m_ppcYuvAvail [ui] = NULL; 134 m_ppcYuvSynth [ui]->destroy(); delete m_ppcYuvSynth [ui]; m_ppcYuvSynth [ui] = NULL; 135 #endif 120 136 m_ppcCU [ui]->destroy(); delete m_ppcCU [ui]; m_ppcCU [ui] = NULL; 121 137 } … … 125 141 #if HHI_INTER_VIEW_RESIDUAL_PRED 126 142 delete [] m_ppcYuvResPred; m_ppcYuvResPred = NULL; 143 #endif 144 #if FORCE_REF_VSP 145 delete [] m_ppcYuvAvail; m_ppcYuvAvail = NULL; 146 delete [] m_ppcYuvSynth; m_ppcYuvSynth = NULL; 127 147 #endif 128 148 delete [] m_ppcCU ; m_ppcCU = NULL; … … 328 348 { 329 349 m_pcEntropyDecoder->decodeSkipFlag( pcCU, uiAbsPartIdx, uiDepth ); 350 351 #if FORCE_REF_VSP==1 352 if( pcCU->isSkipped(uiAbsPartIdx) && pcCU->getSlice()->getViewId() != 0 ) 353 #if VSP_TEXT_ONLY 354 if( !pcCU->getSlice()->getSPS()->isDepth() ) 355 #endif 356 { 357 m_pcEntropyDecoder->decodeVspFlag( pcCU, uiAbsPartIdx, uiDepth ); 358 } 359 #endif 330 360 } 331 361 332 362 if( pcCU->isSkipped(uiAbsPartIdx) ) 363 #if FORCE_REF_VSP==1 364 if( !pcCU->isVspMode(uiAbsPartIdx) ) 365 #endif 333 366 { 334 367 m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 ); … … 352 385 if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == uiDepth ) 353 386 { 387 #if DEBUGLOGOUT 388 PredMode eOrgPred = pcCU->getPredictionMode( uiAbsPartIdx ); 389 #endif 354 390 TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ); 355 391 pcCU->copyTextureMotionDataFrom( pcTextureCU, uiDepth, pcCU->getZorderIdxInCU() + uiAbsPartIdx, uiAbsPartIdx ); 392 #if DEBUGLOGOUT 393 if( eOrgPred == MODE_SKIP ) 394 pcCU->setPredModeSubParts( MODE_SKIP, uiAbsPartIdx, uiDepth ); 395 m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth ); 396 #endif 356 397 357 398 UInt uiCurrPartNumb = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); … … 396 437 #endif 397 438 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast ); 439 #if DEBUGLOGOUT 440 #if HHI_MPI 441 if( pcCU->getTextureModeDepth( uiAbsPartIdx ) != uiDepth ) 442 #endif 443 m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth ); 444 #endif 398 445 return; 399 446 } 447 448 #if FORCE_REF_VSP==1 449 if( pcCU->isVspMode( uiAbsPartIdx ) ) 450 { 451 TComMv cMvZero; 452 453 pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 454 pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth ); 455 456 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( TComMvField(), SIZE_2Nx2N, uiAbsPartIdx, uiDepth, 0 ); 457 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( TComMvField(), SIZE_2Nx2N, uiAbsPartIdx, uiDepth, 0 ); 458 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvd ( cMvZero, SIZE_2Nx2N, uiAbsPartIdx, uiDepth, 0 ); 459 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvd ( cMvZero, SIZE_2Nx2N, uiAbsPartIdx, uiDepth, 0 ); 460 461 //pcCU->getCUMvField(REF_PIC_LIST_0)->setAllRefIdx ( pcCU->getSlice()->getRefIdxVsp(REF_PIC_LIST_0), SIZE_2Nx2N, 0, pcCU->getDepth(0), 0 ); 462 //pcCU->getCUMvField(REF_PIC_LIST_1)->setAllRefIdx ( pcCU->getSlice()->getRefIdxVsp(REF_PIC_LIST_1), SIZE_2Nx2N, 0, pcCU->getDepth(0), 0 ); 463 464 pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_0, uiAbsPartIdx, 0, uiDepth ); 465 pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_0, uiAbsPartIdx, 0, uiDepth ); 466 pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_1, uiAbsPartIdx, 0, uiDepth ); 467 pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_1, uiAbsPartIdx, 0, uiDepth ); 468 469 pcCU->setCbfSubParts( 0, 0, 0, uiAbsPartIdx, uiDepth ); 470 pcCU->setTrIdxSubParts( 0 , uiAbsPartIdx, uiDepth ); 471 pcCU->setNSQTIdxSubParts( uiAbsPartIdx, uiDepth ); 472 473 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast ); 474 #if DEBUGLOGOUT 475 m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth ); 476 #endif 477 return; 478 } 479 #endif 400 480 401 481 #if HHI_MPI … … 428 508 { 429 509 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast ); 510 #if DEBUGLOGOUT 511 m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth ); 512 #endif 430 513 return; 431 514 } … … 527 610 setdQPFlag( bCodeDQP ); 528 611 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast ); 612 #if DEBUGLOGOUT 613 m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth ); 614 #endif 529 615 } 530 616 … … 553 639 { 554 640 TComPic* pcPic = pcCU->getPic(); 641 #if FORCE_REF_VSP 642 if(pcPic->getPicYuvSynth()) m_ppcYuvSynth[uiDepth]->copyFromPicYuv( pcPic->getPicYuvSynth(), pcCU->getAddr(), uiAbsPartIdx ); 643 if(pcPic->getPicYuvAvail()) m_ppcYuvAvail[uiDepth]->copyFromPicYuv( pcPic->getPicYuvAvail(), pcCU->getAddr(), uiAbsPartIdx ); 644 #endif 555 645 556 646 Bool bBoundary = false; … … 603 693 xReconIntraQT( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth ); 604 694 break; 695 #if FORCE_REF_VSP==1 696 case MODE_SYNTH: 697 m_ppcYuvReco[uiDepth]->copyFromPicYuv(pcPic->getPicYuvSynth(), pcCU->getAddr(), uiAbsPartIdx); 698 break; 699 #endif 605 700 default: 606 701 assert(0); … … 615 710 616 711 xCopyToPic( m_ppcCU[uiDepth], pcPic, uiAbsPartIdx, uiDepth ); 712 #if DEBUGIMGOUT 713 xColsetToPicMerge( m_ppcCU[uiDepth], pcPic->getPicYuvRecDbg(), uiAbsPartIdx, uiDepth ); 714 #endif 617 715 } 618 716 … … 626 724 // inter prediction 627 725 m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] ); 628 629 726 #if HHI_MPI 630 727 if( pcCU->getTextureModeDepth( 0 ) != -1 ) -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecCu.h
r56 r166 46 46 #include "TLibCommon/TComPrediction.h" 47 47 #include "TDecEntropy.h" 48 #if DEBUGIMGOUT || DEBUGLOGOUT 49 #include "TLibCommon/DebugLog.h" 50 #endif 48 51 49 52 //! \ingroup TLibDecoder … … 64 67 TComYuv** m_ppcYuvResPred; ///< residual prediction buffer 65 68 #endif 69 #if VSP_N 70 TComYuv** m_ppcYuvAvail; ///< array of available map buffer 71 TComYuv** m_ppcYuvSynth; ///< array of synth buffer 72 #endif 66 73 TComDataCU** m_ppcCU; ///< CU data array 67 74 … … 77 84 virtual ~TDecCu(); 78 85 86 #if DEBUGLOGOUT 87 DebugLog m_cDebug; 88 #endif 89 79 90 /// initialize access channels 80 91 Void init ( TDecEntropy* pcEntropyDecoder, TComTrQuant* pcTrQuant, TComPrediction* pcPrediction ); … … 121 132 Void xFillPCMBuffer (TComDataCU* pCU, UInt absPartIdx, UInt depth); 122 133 #endif 134 #if DEBUGIMGOUT 135 Void xColsetToPic ( TComDataCU* pcCU, TComPicYuv* pcPicYuv, UInt uiZorderIdx, UInt uiDepth ); 136 Void xColsetToPicMerge ( TComDataCU* pcCU, TComPicYuv* pcPicYuv, UInt uiZorderIdx, UInt uiDepth ); 137 #endif 123 138 }; 124 139 -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp
r100 r166 54 54 } 55 55 56 #if FORCE_REF_VSP==1 57 Void TDecEntropy::decodeVspFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 58 { 59 m_pcEntropyDecoderIf->parseVspFlag( pcCU, uiAbsPartIdx, uiDepth ); 60 } 61 #endif 62 56 63 /** decode merge flag 57 64 * \param pcSubCU … … 301 308 { 302 309 decodeRefFrmIdxPU( pcCU, uiSubPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); 310 #if VSP_MV_ZERO 311 Int iRefIdx = pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->getRefIdx(uiSubPartIdx); 312 if( pcCU->getSlice()->getViewId() && iRefIdx >= 0 && (pcCU->getSlice()->getRefViewId( RefPicList( uiRefListIdx ), iRefIdx ) == NUM_VIEW_VSP) ) 313 { 314 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( TComMv(0, 0), pcCU->getPartitionSize( uiSubPartIdx ), uiSubPartIdx, uiDepth, uiPartIdx ); 315 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMv ( TComMv(0, 0), pcCU->getPartitionSize( uiSubPartIdx ), uiSubPartIdx, uiDepth, uiPartIdx ); 316 pcCU->setMVPIdxSubParts( -1, RefPicList( uiRefListIdx ), uiSubPartIdx, uiPartIdx, pcCU->getDepth(uiSubPartIdx)); 317 pcCU->setMVPNumSubParts( -1, RefPicList( uiRefListIdx ), uiSubPartIdx, uiPartIdx, pcCU->getDepth(uiSubPartIdx)); 318 } 319 else 320 { 321 #endif 303 322 decodeMvdPU ( pcCU, uiSubPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); 304 323 decodeMVPIdxPU ( pcSubCU, uiSubPartIdx-uiAbsPartIdx, uiDepth, uiPartIdx, RefPicList( uiRefListIdx ) ); 324 #if VSP_MV_ZERO 325 } 326 #endif 305 327 } 306 328 } -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecEntropy.h
r77 r166 103 103 public: 104 104 virtual Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 105 #if FORCE_REF_VSP==1 106 virtual Void parseVspFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 107 #endif 105 108 virtual Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 106 109 virtual Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ) = 0; … … 196 199 Void decodeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 197 200 Void decodeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 201 #if FORCE_REF_VSP==1 202 Void decodeVspFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 203 #endif 198 204 Void decodeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); 199 205 Void decodeMergeIndex ( TComDataCU* pcSubCU, UInt uiPartIdx, UInt uiPartAddr, PartSize eCUMode, UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, UInt uiDepth ); -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecSbac.cpp
r100 r166 578 578 } 579 579 580 #if FORCE_REF_VSP==1 581 Void TDecSbac::parseVspFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 582 { 583 if( pcCU->getSlice()->isIntra() || pcCU->getSlice()->getViewId()==0 ) 584 { 585 return; 586 } 587 588 UInt uiSymbol = 0; 589 UInt uiCtxSkip = pcCU->getCtxSkipFlag( uiAbsPartIdx ); 590 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUSkipFlagSCModel.get( 0, 0, uiCtxSkip ) ); 591 DTRACE_CABAC_VL( g_nSymbolCounter++ ); 592 DTRACE_CABAC_T( "\tVspFlag" ); 593 DTRACE_CABAC_T( "\tuiCtxSkip: "); 594 DTRACE_CABAC_V( uiCtxSkip ); 595 DTRACE_CABAC_T( "\tuiSymbol: "); 596 DTRACE_CABAC_V( uiSymbol ); 597 DTRACE_CABAC_T( "\n"); 598 599 if( uiSymbol ) 600 { 601 pcCU->setPredModeSubParts( MODE_SYNTH, uiAbsPartIdx, uiDepth ); 602 } 603 } 604 #endif 605 580 606 /** parse merge flag 581 607 * \param pcCU … … 610 636 uiNumCand = pcCU->getSlice()->getMaxNumMergeCand(); 611 637 #if HHI_MPI 638 #if VSP_TEXT_ONLY 639 TComDataCU* pcTextCU = pcCU->getSlice()->getSPS()->getUseMVI() ? pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ) : NULL; 640 Int aiRefIdxVsp[2] = { pcTextCU ? pcTextCU->getCUMvField( RefPicList(0) )->getRefIdx( uiAbsPartIdx ) : -1, 641 pcTextCU ? pcTextCU->getCUMvField( RefPicList(1) )->getRefIdx( uiAbsPartIdx ) : -1 }; 642 const Bool bMVIAvailable = pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE 643 && !( aiRefIdxVsp[0] >= 0 && pcTextCU->getSlice()->getRefViewId( RefPicList(0), aiRefIdxVsp[0] ) == NUM_VIEW_VSP ) 644 && !( aiRefIdxVsp[1] >= 0 && pcTextCU->getSlice()->getRefViewId( RefPicList(1), aiRefIdxVsp[1] ) == NUM_VIEW_VSP ); 645 #else 612 646 const Bool bMVIAvailable = pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE; 647 #endif 613 648 const UInt uiMviMergePos = bMVIAvailable ? HHI_MPI_MERGE_POS : uiNumCand; 614 649 #endif -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecSbac.h
r100 r166 166 166 167 167 Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 168 #if FORCE_REF_VSP==1 169 Void parseVspFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 170 #endif 168 171 Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 169 172 Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecSlice.cpp
r77 r166 102 102 rpcPic->setPicYuvResi( 0 ); 103 103 104 #if DEBUGLOGOUT 105 char fname[128]; 106 sprintf(fname, "%sV%02d_%05d%s.csv", "DecLog", rpcPic->getSlice(0)->getViewId(), rpcPic->getPOC(), rpcPic->getSlice(0)->getIsDepth() ? "depth":"text"); 107 m_pcCuDecoder->m_cDebug.DebugLogFileOpen( fname ); 108 #endif 104 109 #if ENC_DEC_TRACE 105 110 g_bJustDoIt = g_bEncDecTraceEnable; … … 439 444 #endif 440 445 } 446 #if DEBUGLOGOUT 447 m_pcCuDecoder->m_cDebug.DebugLogFileClose(); 448 #endif 441 449 442 450 } -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecTop.cpp
r77 r166 56 56 m_aaiCodedScale [ uiId ] = new Int [ MAX_VIEW_NUM ]; 57 57 } 58 59 #if VSP_N 60 xCreateLUTs( (UInt)MAX_VIEW_NUM, (UInt)MAX_VIEW_NUM, m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT ); 61 m_iLog2Precision = LOG2_DISP_PREC_LUT; 62 m_uiBitDepthForLUT = 8; //fixed 63 #if NTT_SUBPEL 64 xCreateLUTs_Subpel( (UInt)MAX_VIEW_NUM, (UInt)MAX_VIEW_NUM, m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos); 65 #endif 66 #endif 58 67 } 59 68 … … 69 78 delete [] m_aiViewOrderIndex; 70 79 delete [] m_aiViewReceived; 80 81 #if VSP_N 82 xDeleteArray( m_adBaseViewShiftLUT, MAX_VIEW_NUM, MAX_VIEW_NUM, 2 ); 83 xDeleteArray( m_aiBaseViewShiftLUT, MAX_VIEW_NUM, MAX_VIEW_NUM, 2 ); 84 #if NTT_SUBPEL 85 xDeleteArray( m_aiBaseViewShiftLUT_ipel, MAX_VIEW_NUM, MAX_VIEW_NUM, 2 ); 86 xDeleteArray( m_aiBaseViewShiftLUT_fpos, MAX_VIEW_NUM, MAX_VIEW_NUM, 2 ); 87 #endif 88 #endif 71 89 } 72 90 … … 82 100 m_uiMaxViewId = 0; 83 101 } 102 103 #if VSP_N 104 Void 105 CamParsCollector::xCreateLUTs( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Double****& radLUT, Int****& raiLUT) 106 { 107 //AOF( m_uiBitDepthForLUT == 8 ); 108 //AOF(radLUT == NULL && raiLUT == NULL ); 109 110 uiNumberSourceViews = Max( 1, uiNumberSourceViews ); 111 uiNumberTargetViews = Max( 1, uiNumberTargetViews ); 112 113 radLUT = new Double***[ uiNumberSourceViews ]; 114 raiLUT = new Int ***[ uiNumberSourceViews ]; 115 116 for( UInt uiSourceView = 0; uiSourceView < uiNumberSourceViews; uiSourceView++ ) 117 { 118 radLUT [ uiSourceView ] = new Double**[ uiNumberTargetViews ]; 119 raiLUT [ uiSourceView ] = new Int **[ uiNumberTargetViews ]; 120 121 for( UInt uiTargetView = 0; uiTargetView < uiNumberTargetViews; uiTargetView++ ) 122 { 123 radLUT [ uiSourceView ][ uiTargetView ] = new Double*[ 2 ]; 124 radLUT [ uiSourceView ][ uiTargetView ][ 0 ] = new Double [ 257 ]; 125 radLUT [ uiSourceView ][ uiTargetView ][ 1 ] = new Double [ 257 ]; 126 127 raiLUT [ uiSourceView ][ uiTargetView ] = new Int* [ 2 ]; 128 raiLUT [ uiSourceView ][ uiTargetView ][ 0 ] = new Int [ 257 ]; 129 raiLUT [ uiSourceView ][ uiTargetView ][ 1 ] = new Int [ 257 ]; 130 } 131 } 132 } 133 134 Void 135 CamParsCollector::xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Double****& radLUT, Int****& raiLUT) 136 { 137 Int iLog2DivLuma = m_uiBitDepthForLUT + m_uiCamParsCodedPrecision + 1 - m_iLog2Precision; AOF( iLog2DivLuma > 0 ); 138 Int iLog2DivChroma = iLog2DivLuma + 1; 139 140 iOffset <<= m_uiBitDepthForLUT; 141 142 Double dScale = (Double) iScale / (( Double ) ( 1 << iLog2DivLuma )); 143 Double dOffset = (Double) iOffset / (( Double ) ( 1 << iLog2DivLuma )); 144 145 // offsets including rounding offsets 146 Int64 iOffsetLuma = iOffset + ( ( 1 << iLog2DivLuma ) >> 1 ); 147 Int64 iOffsetChroma = iOffset + ( ( 1 << iLog2DivChroma ) >> 1 ); 148 149 150 for( UInt uiDepthValue = 0; uiDepthValue < 256; uiDepthValue++ ) 151 { 152 153 // real-valued look-up tables 154 #if POZNAN_NONLINEAR_DEPTH 155 Double dShiftLuma; 156 if( m_bUseNonlinearDepth ) 157 dShiftLuma = ( m_cNonlinearDepthModel.BackwardD( (Double)uiDepthValue, dScale) + dOffset ) * Double( 1 << m_iLog2Precision ); 158 else 159 dShiftLuma = ( (Double)uiDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision ); 160 #else 161 Double dShiftLuma = ( (Double)uiDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision ); 162 #endif 163 Double dShiftChroma = dShiftLuma / 2; 164 radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = dShiftLuma; 165 radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = dShiftChroma; 166 167 // integer-valued look-up tables 168 #if POZNAN_NONLINEAR_DEPTH 169 Int64 iTempScale; 170 if( m_bUseNonlinearDepth ) 171 iTempScale = (Int64)m_cNonlinearDepthModel.BackwardI(uiDepthValue, iScale); 172 else 173 iTempScale = (Int64)uiDepthValue * iScale; 174 #else 175 Int64 iTempScale = (Int64)uiDepthValue * iScale; 176 #endif 177 Int64 iShiftLuma = ( iTempScale + iOffsetLuma ) >> iLog2DivLuma; 178 Int64 iShiftChroma = ( iTempScale + iOffsetChroma ) >> iLog2DivChroma; 179 raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = (Int)iShiftLuma; 180 raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = (Int)iShiftChroma; 181 182 // maximum deviation 183 //dMaxDispDev = Max( dMaxDispDev, fabs( Double( (Int) iTestScale ) - dShiftLuma * Double( 1 << iLog2DivLuma ) ) / Double( 1 << iLog2DivLuma ) ); 184 //dMaxRndDispDvL = Max( dMaxRndDispDvL, fabs( Double( (Int) iShiftLuma ) - dShiftLuma ) ); 185 //dMaxRndDispDvC = Max( dMaxRndDispDvC, fabs( Double( (Int) iShiftChroma ) - dShiftChroma ) ); 186 } 187 188 radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ]; 189 radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ]; 190 raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ]; 191 raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ]; 192 } 193 194 Bool 195 CamParsCollector::getNearestBaseView( Int iSynthViewIdx, Int &riNearestViewIdx, Int &riRelDistToLeft, Bool& rbRenderFromLeft) 196 { 197 /* 198 riNearestViewIdx = 0; 199 200 Bool bDecencdingVN = ( m_aiSortedBaseViews.size() >= 2 && m_aiSortedBaseViews[ 0 ] > m_aiSortedBaseViews[ 1 ] ); 201 Int iFactor = ( bDecencdingVN ? -1 : 1 ); 202 203 if( ( m_aiBaseId2SortedId[iSynthViewIdx] - m_aiBaseId2SortedId[riNearestViewIdx] ) * iFactor <= 0 ) 204 { 205 rbRenderFromLeft = true; 206 } 207 else 208 { 209 rbRenderFromLeft = false; 210 } 211 212 riRelDistToLeft = 128; //Not used for now; 213 //*/ 214 return true; 215 } 216 217 #if NTT_SUBPEL 218 Void 219 CamParsCollector::xCreateLUTs_Subpel( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Int****& raiLUT0, Int****& raiLUT1 ) 220 { 221 uiNumberSourceViews = Max( 1, uiNumberSourceViews ); 222 uiNumberTargetViews = Max( 1, uiNumberTargetViews ); 223 224 raiLUT0 = new Int ***[ uiNumberSourceViews ]; 225 raiLUT1 = new Int ***[ uiNumberSourceViews ]; 226 227 for( UInt uiSourceView = 0; uiSourceView < uiNumberSourceViews; uiSourceView++ ) 228 { 229 raiLUT0 [ uiSourceView ] = new Int **[ uiNumberTargetViews ]; 230 raiLUT1 [ uiSourceView ] = new Int **[ uiNumberTargetViews ]; 231 232 for( UInt uiTargetView = 0; uiTargetView < uiNumberTargetViews; uiTargetView++ ) 233 { 234 raiLUT0 [ uiSourceView ][ uiTargetView ] = new Int* [ 2 ]; 235 raiLUT0 [ uiSourceView ][ uiTargetView ][ 0 ] = new Int [ 257 ]; 236 raiLUT0 [ uiSourceView ][ uiTargetView ][ 1 ] = new Int [ 257 ]; 237 raiLUT1 [ uiSourceView ][ uiTargetView ] = new Int* [ 2 ]; 238 raiLUT1 [ uiSourceView ][ uiTargetView ][ 0 ] = new Int [ 257 ]; 239 raiLUT1 [ uiSourceView ][ uiTargetView ][ 1 ] = new Int [ 257 ]; 240 } 241 } 242 } 243 Void 244 CamParsCollector::xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Int****& raiLUT_ipel, Int****& raiLUT_fpos) 245 { 246 Int iLog2Div = m_uiBitDepthForLUT + m_uiCamParsCodedPrecision + 1 - m_iLog2Precision; AOF( iLog2Div > 0 ); 247 Int64 iOffset64 = ( Int64(iOffset) << m_uiBitDepthForLUT ) + ( ( 1 << iLog2Div ) >> 1 ); 248 249 for( UInt uiDepthValue = 0; uiDepthValue < 256; uiDepthValue++ ) 250 { 251 Int64 iTempScale = (Int64)uiDepthValue * iScale; 252 Int iShiftSubpel = (Int) (( iTempScale + iOffset64 ) >> iLog2Div); 253 Int iShiftPelLuma = iShiftSubpel >> m_iLog2Precision; // better to have rounding ? 254 Int iShiftPelChroma = iShiftPelLuma >> 1; 255 256 raiLUT_ipel[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = iShiftPelLuma; 257 raiLUT_ipel[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = iShiftPelChroma; 258 raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = iShiftSubpel - ( iShiftPelLuma << m_iLog2Precision ); 259 raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = iShiftSubpel - ( iShiftPelChroma << (m_iLog2Precision+1) ); 260 261 #if 0 // NTT bugfix 262 if ( raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] < 0 ) 263 raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = -4 - raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ]; 264 if ( raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] < 0 ) 265 raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = -8 - raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ]; 266 #endif 267 268 #if _DEBUG 269 AOF( (raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ]>> m_iLog2Precision ) == 0 ); 270 AOF( (raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ]>>(m_iLog2Precision+1)) == 0 ); 271 #endif 272 } 273 274 raiLUT_ipel[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT_ipel[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ]; 275 raiLUT_ipel[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT_ipel[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ]; 276 raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ]; 277 raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT_fpos[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ]; 278 } 279 #endif 280 281 #endif 84 282 85 283 Void … … 164 362 m_aaiCodedScale [ uiViewId ][ uiBaseId ] = pcSlice->getInvCodedScale () [ uiBaseId ]; 165 363 m_aaiCodedOffset[ uiViewId ][ uiBaseId ] = pcSlice->getInvCodedOffset() [ uiBaseId ]; 364 #if VSP_N 365 xInitLUTs( uiBaseId, uiViewId, m_aaiCodedScale[ uiBaseId ][ uiViewId ], m_aaiCodedOffset[ uiBaseId ][ uiViewId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT); 366 xInitLUTs( uiViewId, uiBaseId, m_aaiCodedScale[ uiViewId ][ uiBaseId ], m_aaiCodedOffset[ uiViewId ][ uiBaseId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT); 367 #if NTT_SUBPEL 368 xInitLUTs( uiBaseId, uiViewId, m_aaiCodedScale[ uiBaseId ][ uiViewId ], m_aaiCodedOffset[ uiBaseId ][ uiViewId ], m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos ); 369 xInitLUTs( uiViewId, uiBaseId, m_aaiCodedScale[ uiViewId ][ uiBaseId ], m_aaiCodedOffset[ uiViewId ][ uiBaseId ], m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos ); 370 #endif 371 #endif 166 372 } 167 373 else … … 171 377 m_aaiCodedScale [ uiViewId ][ uiBaseId ] = pcSlice->getSPS()->getInvCodedScale () [ uiBaseId ]; 172 378 m_aaiCodedOffset[ uiViewId ][ uiBaseId ] = pcSlice->getSPS()->getInvCodedOffset() [ uiBaseId ]; 379 #if VSP_N 380 xInitLUTs( uiBaseId, uiViewId, m_aaiCodedScale[ uiBaseId ][ uiViewId ], m_aaiCodedOffset[ uiBaseId ][ uiViewId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT ); 381 xInitLUTs( uiViewId, uiBaseId, m_aaiCodedScale[ uiViewId ][ uiBaseId ], m_aaiCodedOffset[ uiViewId ][ uiBaseId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT ); 382 #if NTT_SUBPEL 383 xInitLUTs( uiBaseId, uiViewId, m_aaiCodedScale[ uiBaseId ][ uiViewId ], m_aaiCodedOffset[ uiBaseId ][ uiViewId ], m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos ); 384 xInitLUTs( uiViewId, uiBaseId, m_aaiCodedScale[ uiViewId ][ uiBaseId ], m_aaiCodedOffset[ uiViewId ][ uiBaseId ], m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos ); 385 #endif 386 #endif 173 387 } 174 388 } … … 185 399 m_aaiCodedScale [ uiViewId ][ uiBaseId ] = pcSlice->getInvCodedScale () [ uiBaseId ]; 186 400 m_aaiCodedOffset[ uiViewId ][ uiBaseId ] = pcSlice->getInvCodedOffset() [ uiBaseId ]; 401 #if VSP_N 402 xInitLUTs( uiBaseId, uiViewId, m_aaiCodedScale[ uiBaseId ][ uiViewId ], m_aaiCodedOffset[ uiBaseId ][ uiViewId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT ); 403 xInitLUTs( uiViewId, uiBaseId, m_aaiCodedScale[ uiViewId ][ uiBaseId ], m_aaiCodedOffset[ uiViewId ][ uiBaseId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT ); 404 #if NTT_SUBPEL 405 xInitLUTs( uiBaseId, uiViewId, m_aaiCodedScale[ uiBaseId ][ uiViewId ], m_aaiCodedOffset[ uiBaseId ][ uiViewId ], m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos ); 406 xInitLUTs( uiViewId, uiBaseId, m_aaiCodedScale[ uiViewId ][ uiBaseId ], m_aaiCodedOffset[ uiViewId ][ uiBaseId ], m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos ); 407 #endif 408 #endif 187 409 } 188 410 } … … 255 477 #endif 256 478 #if ENC_DEC_TRACE 257 g_hTrace = fopen( "TraceDec.txt", "wb" );479 if(!g_hTrace) g_hTrace = fopen( "TraceDec.txt", "wb" ); 258 480 g_bJustDoIt = g_bEncDecTraceDisable; 259 481 g_nSymbolCounter = 0; … … 266 488 m_bFirstSliceInSequence = true; 267 489 m_pcCamParsCollector = 0; 490 491 #if VSP_N 492 m_pcPicVSP = NULL; 493 m_pcPicAvail = NULL; 494 #endif 268 495 } 269 496 … … 271 498 { 272 499 #if ENC_DEC_TRACE 273 fclose( g_hTrace ); 500 if(g_hTrace) fclose( g_hTrace ); 501 g_hTrace=NULL; 274 502 #endif 275 503 } … … 298 526 m_cResidualGenerator.destroy(); 299 527 #endif 528 529 #if VSP_N 530 if( m_pcPicVSP ) 531 { 532 m_pcPicVSP->destroy(); 533 delete m_pcPicVSP; 534 m_pcPicVSP = NULL; 535 } 536 if( m_pcPicAvail ) 537 { 538 m_pcPicAvail->destroy(); 539 delete m_pcPicAvail; 540 m_pcPicAvail = NULL; 541 } 542 #endif 543 300 544 } 301 545 … … 732 976 // Get a new picture buffer 733 977 xGetNewPicBuffer (m_apcSlicePilot, pcPic); 978 #if VSP_N 979 #if VSP_SLICE_HEADER 980 if( m_apcSlicePilot->getVspFlag() ) 981 #endif 982 { 983 if( m_pcPicVSP == NULL ) 984 { 985 m_pcPicVSP = new TComPic; 986 m_pcPicVSP->create( m_apcSlicePilot->getSPS()->getPicWidthInLumaSamples(), m_apcSlicePilot->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 987 m_pcPicVSP->setCurrSliceIdx(0); 988 m_pcPicVSP->getCurrSlice()->setViewId( NUM_VIEW_VSP ); 989 m_pcPicVSP->getCurrSlice()->setViewOrderIdx( m_apcSlicePilot->getSPS()->getViewOrderIdx() ); 990 m_pcPicVSP->getCurrSlice()->setSPS( m_apcSlicePilot->getSPS() ); 991 m_pcPicVSP->getCurrSlice()->setPPS( m_apcSlicePilot->getPPS() ); 992 m_pcPicVSP->getCurrSlice()->setPPSId( m_apcSlicePilot->getPPS()->getPPSId() ); 993 m_pcPicVSP->getPicSym()->setNumColumnsMinus1( m_apcSlicePilot->getSPS()->getNumColumnsMinus1() ); 994 m_pcPicVSP->getPicSym()->setNumRowsMinus1( m_apcSlicePilot->getSPS()->getNumRowsMinus1() ); 995 m_pcPicVSP->getPicSym()->xCreateTComTileArray(); 996 for (int i=0;i<m_pcPicVSP->getPicSym()->getNumberOfCUsInFrame();i++) 997 { 998 m_pcPicVSP->getPicSym()->getCU(i)->getCUMvField(RefPicList(0))->clearMvField(); 999 m_pcPicVSP->getPicSym()->getCU(i)->getCUMvField(RefPicList(1))->clearMvField(); 1000 } 1001 #if DEPTH_MAP_GENERATION 1002 UInt uiPdm = ( m_viewId ? m_apcSlicePilot->getSPS()->getPredDepthMapGeneration() : m_tAppDecTop->getSPSAccess()->getPdm() ); 1003 Bool bNeedPrdDepthMapBuffer = ( !m_isDepth && uiPdm > 0 ); 1004 if( bNeedPrdDepthMapBuffer ) 1005 { 1006 m_pcPicVSP->addPrdDepthMapBuffer( PDM_SUB_SAMP_EXP_X(uiPdm), PDM_SUB_SAMP_EXP_Y(uiPdm) ); 1007 } 1008 #endif 1009 } 1010 if( m_pcPicAvail == NULL ) 1011 { 1012 m_pcPicAvail = new TComPic; 1013 m_pcPicAvail->create( m_apcSlicePilot->getSPS()->getPicWidthInLumaSamples(), m_apcSlicePilot->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 1014 m_pcPicAvail->setCurrSliceIdx(0); 1015 m_pcPicAvail->getCurrSlice()->setViewId( 99 ); 1016 m_pcPicAvail->getCurrSlice()->setViewOrderIdx( m_apcSlicePilot->getSPS()->getViewOrderIdx() ); 1017 m_pcPicAvail->getCurrSlice()->setSPS( m_apcSlicePilot->getSPS() ); 1018 m_pcPicAvail->getCurrSlice()->setPPS( m_apcSlicePilot->getPPS() ); 1019 m_pcPicAvail->getCurrSlice()->setPPSId( m_apcSlicePilot->getPPS()->getPPSId() ); 1020 m_pcPicAvail->getPicSym()->setNumColumnsMinus1( m_apcSlicePilot->getSPS()->getNumColumnsMinus1() ); 1021 m_pcPicAvail->getPicSym()->setNumRowsMinus1( m_apcSlicePilot->getSPS()->getNumRowsMinus1() ); 1022 m_pcPicAvail->getPicSym()->xCreateTComTileArray(); 1023 for (int i=0;i<m_pcPicAvail->getPicSym()->getNumberOfCUsInFrame();i++) 1024 { 1025 m_pcPicAvail->getPicSym()->getCU(i)->getCUMvField(RefPicList(0))->clearMvField(); 1026 m_pcPicAvail->getPicSym()->getCU(i)->getCUMvField(RefPicList(1))->clearMvField(); 1027 } 1028 #if DEPTH_MAP_GENERATION 1029 UInt uiPdm = ( m_viewId ? m_apcSlicePilot->getSPS()->getPredDepthMapGeneration() : m_tAppDecTop->getSPSAccess()->getPdm() ); 1030 Bool bNeedPrdDepthMapBuffer = ( !m_isDepth && uiPdm > 0 ); 1031 if( bNeedPrdDepthMapBuffer ) 1032 { 1033 m_pcPicAvail->addPrdDepthMapBuffer( PDM_SUB_SAMP_EXP_X(uiPdm), PDM_SUB_SAMP_EXP_Y(uiPdm) ); 1034 } 1035 #endif 1036 } 1037 } 1038 #endif 734 1039 735 1040 #if SONY_COLPIC_AVAILABILITY … … 759 1064 m_cResidualGenerator.create( true, m_apcSlicePilot->getSPS()->getPicWidthInLumaSamples(), m_apcSlicePilot->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiBitDepth + g_uiBitIncrement ); 760 1065 #endif 1066 #if !QC_MULTI_DIS_CAN 1067 #if VSP_N 1068 #if VSP_SLICE_HEADER 1069 if( m_apcSlicePilot->getVspFlag() ) 1070 #endif 1071 { 1072 UInt uiPdm = ( m_viewId ? m_apcSlicePilot->getSPS()->getPredDepthMapGeneration() : m_tAppDecTop->getSPSAccess()->getPdm() ); 1073 Bool bNeedPrdDepthMapBuffer = ( !m_isDepth && uiPdm > 0 ); 1074 if( bNeedPrdDepthMapBuffer ) 1075 { 1076 if( m_pcPicVSP && m_pcPicVSP->getPredDepthMap() ) 1077 { 1078 m_cDepthMapGenerator.clearDepthMap( m_pcPicVSP ); 1079 } 1080 if( m_pcPicAvail && m_pcPicAvail->getPredDepthMap() ) 1081 { 1082 m_cDepthMapGenerator.clearDepthMap( m_pcPicAvail ); 1083 } 1084 } 1085 } 1086 #endif 1087 #endif 761 1088 } 762 1089 … … 973 1300 974 1301 std::vector<TComPic*> apcInterViewRefPics = m_tAppDecTop->getInterViewRefPics( m_viewId, pcSlice->getPOC(), m_isDepth, pcSlice->getSPS() ); 1302 #if VSP_N 1303 Bool bUseVsp = (m_viewId!=0); 1304 #if VSP_TEXT_ONLY 1305 if( m_isDepth ) bUseVsp = false; 1306 #endif 1307 #if VSP_SLICE_HEADER 1308 if( !pcSlice->getVspFlag() ) bUseVsp = false; 1309 #endif 1310 1311 #if VSP_SLICE_HEADER 1312 if( bUseVsp ) 1313 #endif 1314 m_pcPicVSP->getCurrSlice()->setPOC( pcPic->getPOC() ); 1315 1316 pcSlice->setRefPicListMvc( m_cListPic, apcInterViewRefPics, bUseVsp ? m_pcPicVSP : NULL ); 1317 1318 #else 975 1319 pcSlice->setRefPicListMvc( m_cListPic, apcInterViewRefPics ); 1320 #endif 976 1321 977 1322 // For generalized B … … 1068 1413 #endif 1069 1414 1415 #if VSP_N 1416 if( m_pcCamParsCollector ) 1417 { 1418 m_pcCamParsCollector->setSlice( pcSlice ); 1419 } 1420 #if VSP_SLICE_HEADER 1421 if( pcSlice->getVspFlag() ) 1422 #endif 1423 if( getTAppDecTop()->getUseDepth() ) 1424 { 1425 getTAppDecTop()->storeVSPInBuffer( m_pcPicVSP, m_pcPicAvail, pcSlice->getViewId(), pcSlice->getSPS()->getViewOrderIdx(), pcSlice->getPOC(), m_isDepth ); 1426 } 1427 #endif 1428 1070 1429 // Decode a picture 1071 1430 m_cGopDecoder.decompressGop(nalu.m_Bitstream, pcPic, false); … … 1108 1467 #if LCU_SYNTAX_ALF 1109 1468 m_cAdaptiveLoopFilter.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 1469 #endif 1470 1471 #if VSP_N 1472 if( !sps->isDepth() && sps->getViewId() == 0 && getTAppDecTop()->getVSPRendererTop() ) 1473 { 1474 #if NTT_SUBPEL 1475 getTAppDecTop()->getVSPRendererTop()->init( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), true, 0, LOG2_DISP_PREC_LUT, true, 0, 0, 0, 0, 0, 6, 5, 1, 0, 6 ); 1476 #else 1477 getTAppDecTop()->getVSPRendererTop()->init( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), true, 0, LOG2_DISP_PREC_LUT, true, 0, 0, 0, 0, 0, 6, 4, 1, 0, 6 ); 1478 #endif 1479 } 1110 1480 #endif 1111 1481 } -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibDecoder/TDecTop.h
r100 r166 77 77 Bool isInitialized() const { return m_bInitialized; } 78 78 79 #if VSP_N 80 Double**** getBaseViewShiftLUTD () { return m_adBaseViewShiftLUT; } 81 Int**** getBaseViewShiftLUTI () { return m_aiBaseViewShiftLUT; } 82 Int** getBaseViewOffsetI () { return m_aaiCodedOffset; } 83 Int** getBaseViewScaleI () { return m_aaiCodedScale; } 84 Bool getNearestBaseView ( Int iSynthViewIdx, Int &riNearestViewIdx, Int &riRelDistToLeft, Bool& rbRenderFromLeft); 85 #if NTT_SUBPEL 86 Int**** getBaseViewIPelLUT () { return m_aiBaseViewShiftLUT_ipel; } 87 Int**** getBaseViewFPosLUT () { return m_aiBaseViewShiftLUT_fpos; } 88 #endif 89 #endif 90 79 91 private: 80 92 Bool xIsComplete (); … … 94 106 Int m_iLastPOC; 95 107 UInt m_uiMaxViewId; 108 109 #if VSP_N 110 UInt m_uiBitDepthForLUT; 111 UInt m_iLog2Precision; 112 UInt m_uiInputBitDepth; 113 // look-up tables 114 Double**** m_adBaseViewShiftLUT; ///< Disparity LUT 115 Int**** m_aiBaseViewShiftLUT; ///< Disparity LUT 116 Void xCreateLUTs( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Double****& radLUT, Int****& raiLUT); 117 Void xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Double****& radLUT, Int****& raiLUT); 118 template<class T> Void xDeleteArray ( T*& rpt, UInt uiSize1, UInt uiSize2, UInt uiSize3 ); 119 template<class T> Void xDeleteArray ( T*& rpt, UInt uiSize1, UInt uiSize2 ); 120 template<class T> Void xDeleteArray ( T*& rpt, UInt uiSize ); 121 122 #if NTT_SUBPEL 123 Int**** m_aiBaseViewShiftLUT_ipel; ///< Disparity LUT 124 Int**** m_aiBaseViewShiftLUT_fpos; ///< Disparity LUT 125 Void xCreateLUTs_Subpel ( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Int****& raiLUT0, Int****& raiLUT1 ); 126 Void xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Int****& raiLUT_ipel, Int****& raiLUT_fpos); 127 #endif 128 #endif 96 129 }; 130 131 #if VSP_N 132 template <class T> 133 Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize1, UInt uiSize2, UInt uiSize3 ) 134 { 135 if( rpt ) 136 { 137 for( UInt uiK = 0; uiK < uiSize1; uiK++ ) 138 { 139 for( UInt uiL = 0; uiL < uiSize2; uiL++ ) 140 { 141 for( UInt uiM = 0; uiM < uiSize3; uiM++ ) 142 { 143 delete[] rpt[ uiK ][ uiL ][ uiM ]; 144 } 145 delete[] rpt[ uiK ][ uiL ]; 146 } 147 delete[] rpt[ uiK ]; 148 } 149 delete[] rpt; 150 } 151 rpt = NULL; 152 }; 153 154 155 template <class T> 156 Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize1, UInt uiSize2 ) 157 { 158 if( rpt ) 159 { 160 for( UInt uiK = 0; uiK < uiSize1; uiK++ ) 161 { 162 for( UInt uiL = 0; uiL < uiSize2; uiL++ ) 163 { 164 delete[] rpt[ uiK ][ uiL ]; 165 } 166 delete[] rpt[ uiK ]; 167 } 168 delete[] rpt; 169 } 170 rpt = NULL; 171 }; 172 173 174 template <class T> 175 Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize ) 176 { 177 if( rpt ) 178 { 179 for( UInt uiK = 0; uiK < uiSize; uiK++ ) 180 { 181 delete[] rpt[ uiK ]; 182 } 183 delete[] rpt; 184 } 185 rpt = NULL; 186 }; 187 #endif 97 188 98 189 /// decoder class … … 155 246 NalUnitType m_nalUnitTypeBaseView; 156 247 248 #if VSP_N 249 TComPic* m_pcPicVSP; //view synthesis prediction buffer for current POC to be coded 250 TComPic* m_pcPicAvail; 251 #endif 252 157 253 public: 158 254 TDecTop(); … … 195 291 TAppDecTop* getTAppDecTop() { return m_tAppDecTop; } 196 292 NalUnitType getNalUnitTypeBaseView() { return m_nalUnitTypeBaseView; } 293 294 #if VSP_N 295 TComPic* getVSPBuf() { return m_pcPicVSP; } 296 #endif 197 297 198 298 protected: -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp
r100 r166 1179 1179 WRITE_UVLC(MRG_MAX_NUM_CANDS - pcSlice->getMaxNumMergeCand(), "maxNumMergeCand"); 1180 1180 #endif 1181 1182 #if VSP_SLICE_HEADER 1183 if( pcSlice->getSPS()->getViewId()!=0 1184 #if VSP_TEXT_ONLY 1185 && !(pcSlice->getSPS()->isDepth()) 1186 #endif 1187 ) 1188 { 1189 WRITE_FLAG( pcSlice->getVspFlag()?1:0, "vsp_flag" ); 1190 // printf("[VSP: %d] ", pcSlice->getVspFlag()?1:0); 1191 } 1192 #endif 1193 1181 1194 } 1182 1195 … … 1426 1439 assert(0); 1427 1440 } 1441 1442 #if FORCE_REF_VSP==1 1443 Void TEncCavlc::codeVspFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 1444 { 1445 assert(0); 1446 } 1447 #endif 1428 1448 1429 1449 Void TEncCavlc::codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncCavlc.h
r77 r166 164 164 165 165 Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 166 #if FORCE_REF_VSP==1 167 Void codeVspFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 168 #endif 166 169 Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 167 170 Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ); -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncCu.cpp
r100 r166 453 453 // get Original YUV data from picture 454 454 m_ppcOrigYuv[uiDepth]->copyFromPicYuv( pcPic->getPicYuvOrg(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU() ); 455 #if FORCE_REF_VSP 456 //Bool bWholeCUCanBeSynthesized = false; 457 //Bool bOneSubCUCanNotBeSynthesied = false; 458 Bool bSubCUCanBeSynthesized[4]; 459 if( rpcBestCU->getSlice()->getViewId() ) 460 { 461 Bool * pbSubCUCanBeSynthesized = bSubCUCanBeSynthesized; 462 pcPic->checkSynthesisAvailability(/*rpcBestCU, */rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU(), uiDepth, pbSubCUCanBeSynthesized); //KUBA SYNTH 463 //Int iSubCUCanNotBeSynthesized = 0; // Dong: Compiling error, set but not used. DONG_CHECK 464 Int iSubCUCanBeSynthesizedCnt = 0; 465 for(Int i = 0; i < 4; i++) 466 { 467 if (!bSubCUCanBeSynthesized[i]) 468 { 469 //iSubCUCanNotBeSynthesized = i; 470 } 471 else 472 { 473 iSubCUCanBeSynthesizedCnt ++; 474 } 475 } 476 if(iSubCUCanBeSynthesizedCnt == 4) 477 { 478 //bWholeCUCanBeSynthesized = true; 479 } 480 //else if(iSubCUCanBeSynthesizedCnt == 3) 481 //{ 482 // bOneSubCUCanNotBeSynthesied = true; 483 //} 484 //bWholeCUCanBeSynthesized = true; 485 } 486 #endif 455 487 456 488 // variables for fast encoder decision … … 654 686 doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0; 655 687 } 688 689 #if FORCE_REF_VSP==1 690 #if VSP_TEXT_ONLY 691 if( !rpcBestCU->getSlice()->getSPS()->isDepth() ) 692 #endif 693 #if HHI_INTER_VIEW_RESIDUAL_PRED 694 rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag ); 695 #endif 696 #if HHI_INTERVIEW_SKIP 697 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bFullyRenderedSec, false, true ); // VSP 698 #else 699 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); 700 #endif 701 rpcTempCU->initEstData( uiDepth, iQP ); 702 #endif 656 703 } 657 704 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 1581 1628 { 1582 1629 m_pcEntropyCoder->encodeSkipFlag( pcCU, uiAbsPartIdx ); 1630 1631 #if FORCE_REF_VSP==1 1632 if( (pcCU->isSkipped( uiAbsPartIdx ) || pcCU->isVspMode( uiAbsPartIdx )) && pcCU->getSlice()->getViewId() != 0 ) 1633 #if VSP_TEXT_ONLY 1634 if( !pcCU->getSlice()->getSPS()->isDepth() ) 1635 #endif 1636 { 1637 m_pcEntropyCoder->encodeVspFlag( pcCU, uiAbsPartIdx ); 1638 } 1639 #endif 1583 1640 } 1584 1641 1585 1642 if( pcCU->isSkipped( uiAbsPartIdx ) ) 1643 #if FORCE_REF_VSP==1 1644 if( !pcCU->isVspMode( uiAbsPartIdx ) ) 1645 #endif 1586 1646 { 1587 1647 m_pcEntropyCoder->encodeMergeIndex( pcCU, uiAbsPartIdx, 0 ); 1588 1648 finishCU(pcCU,uiAbsPartIdx,uiDepth); 1649 #if DEBUGLOGOUT 1650 m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth ); 1651 #endif 1589 1652 xRestoreDepthWidthHeight( pcCU ); 1590 1653 return; … … 1635 1698 { 1636 1699 m_pcEntropyCoder->encodeSkipFlag( pcCU, uiAbsPartIdx ); 1700 1701 #if FORCE_REF_VSP==1 1702 if( (pcCU->isSkipped( uiAbsPartIdx ) || pcCU->isVspMode( uiAbsPartIdx )) && pcCU->getSlice()->getViewId() != 0 ) 1703 #if VSP_TEXT_ONLY 1704 if( !pcCU->getSlice()->getSPS()->isDepth() ) 1705 #endif 1706 { 1707 m_pcEntropyCoder->encodeVspFlag( pcCU, uiAbsPartIdx ); 1708 } 1709 #endif 1637 1710 } 1638 1711 1639 1712 if( pcCU->isSkipped( uiAbsPartIdx ) ) 1713 #if FORCE_REF_VSP==1 1714 if( !pcCU->isVspMode( uiAbsPartIdx ) ) 1715 #endif 1640 1716 { 1641 1717 m_pcEntropyCoder->encodeMergeIndex( pcCU, uiAbsPartIdx, 0 ); … … 1644 1720 #endif 1645 1721 finishCU(pcCU,uiAbsPartIdx,uiDepth); 1722 #if DEBUGLOGOUT 1723 m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth ); 1724 #endif 1646 1725 return; 1647 1726 } 1727 1728 #if FORCE_REF_VSP==1 1729 if( pcCU->isVspMode( uiAbsPartIdx ) ) 1730 { 1731 finishCU(pcCU,uiAbsPartIdx,uiDepth); 1732 #if DEBUGLOGOUT 1733 m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth ); 1734 #endif 1735 return; 1736 } 1737 #endif 1738 1648 1739 #if HHI_MPI 1649 1740 if( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 ) … … 1662 1753 // Encode slice finish 1663 1754 finishCU(pcCU,uiAbsPartIdx,uiDepth); 1755 #if DEBUGLOGOUT 1756 m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth ); 1757 #endif 1664 1758 return; 1665 1759 } … … 1685 1779 // --- write terminating bit --- 1686 1780 finishCU(pcCU,uiAbsPartIdx,uiDepth); 1781 #if DEBUGLOGOUT 1782 m_cDebug.DebugLogOut( pcCU, uiAbsPartIdx, uiDepth ); 1783 #endif 1687 1784 } 1688 1785 … … 1873 1970 #if AMP_MRG 1874 1971 #if HHI_INTERVIEW_SKIP 1875 Void TEncCu::xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bSkipRes, Bool bUseMRG) 1972 Void TEncCu::xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bSkipRes, Bool bUseMRG 1973 #if FORCE_REF_VSP==1 1974 , Bool bForceRefVsp 1975 #endif 1976 ) 1876 1977 #else 1877 1978 Void TEncCu::xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bUseMRG) … … 1910 2011 rpcTempCU->setResPredFlagSubParts ( bResPrdFlag, 0, 0, uhDepth ); 1911 2012 #endif 2013 #if FORCE_REF_VSP==1 2014 if( bForceRefVsp ) 2015 rpcTempCU->setPredModeSubParts ( MODE_SYNTH, 0, uhDepth ); 2016 else 2017 #endif 1912 2018 rpcTempCU->setPredModeSubParts ( MODE_INTER, 0, uhDepth ); 1913 2019 … … 1925 2031 #if HHI_INTERVIEW_SKIP 1926 2032 #if LG_RESTRICTEDRESPRED_M24766 1927 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcResPredTmp[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bSkipRes, bUseMRG ); 2033 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcResPredTmp[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bSkipRes, bUseMRG 2034 #if FORCE_REF_VSP==1 2035 , bForceRefVsp 2036 #endif 2037 ); 1928 2038 #else 1929 2039 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bSkipRes, bUseMRG ); … … 2494 2604 for( UInt ui = 0; ui < rpcTempCU->getTotalNumPart(); ui++ ) 2495 2605 { 2496 if( pcTextureCU->isIntra( rpcTempCU->getZorderIdxInCU() + ui ) ) 2606 if( pcTextureCU->isIntra( rpcTempCU->getZorderIdxInCU() + ui ) 2607 #if FORCE_REF_VSP==1 2608 || pcTextureCU->isVspMode( rpcTempCU->getZorderIdxInCU() + ui ) 2609 #endif 2610 ) 2497 2611 { 2498 2612 return; 2499 2613 } 2614 #if VSP_N 2615 #if !(!VSP_TEXT_ONLY && FORCE_REF_VSP==2) 2616 else // inter 2617 { 2618 Int aiRefIdx[2] = {NOT_VALID, NOT_VALID}; 2619 for( Int iList = 0; iList < 2; iList++ ) 2620 { 2621 aiRefIdx[iList] = pcTextureCU->getCUMvField( RefPicList(iList) )->getRefIdx( rpcTempCU->getZorderIdxInCU() + ui ); 2622 if( aiRefIdx[iList] >= 0 && pcTextureCU->getSlice()->getRefViewId( RefPicList(iList), aiRefIdx[iList] ) == NUM_VIEW_VSP ) 2623 { 2624 return; 2625 } 2626 } 2627 //if( aiRefIdx[0] == NOT_VALID && aiRefIdx[1] == NOT_VALID ) 2628 //{ 2629 // return; 2630 //} 2631 } 2632 #endif 2633 #endif 2500 2634 } 2501 2635 } … … 2694 2828 m_pcEntropyCoder->encodeSplitFlag( pcCU, 0, uhDepth, true ); 2695 2829 m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true ); 2830 #if FORCE_REF_VSP==1 2831 if( (pcCU->isSkipped( 0 ) || pcCU->isVspMode( 0 )) && pcCU->getSlice()->getViewId() != 0 ) 2832 #if VSP_TEXT_ONLY 2833 if( !pcCU->getSlice()->getSPS()->isDepth() ) 2834 #endif 2835 m_pcEntropyCoder->encodeVspFlag ( pcCU, 0, true ); 2836 #endif 2696 2837 2697 2838 if( pcCU->isSkipped( 0 ) ) 2839 #if FORCE_REF_VSP==1 2840 if( !pcCU->isVspMode( 0 ) ) 2841 #endif 2698 2842 { 2699 2843 m_pcEntropyCoder->encodeMergeIndex( pcCU, 0, 0, true ); -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncCu.h
r56 r166 46 46 #include "TLibCommon/TComBitCounter.h" 47 47 #include "TLibCommon/TComDataCU.h" 48 #if DEBUGLOGOUT 49 #include "TLibCommon/DebugLog.h" 50 #endif 48 51 49 52 #include "TEncEntropy.h" … … 113 116 114 117 public: 118 #if DEBUGLOGOUT 119 DebugLog m_cDebug; 120 #endif 121 115 122 /// copy parameters from encoder class 116 123 Void init ( TEncTop* pcEncTop ); … … 148 155 #if AMP_MRG 149 156 #if HHI_INTERVIEW_SKIP 150 Void xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bFullyRendered, Bool bUseMRG = false ) ; 157 Void xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bFullyRendered, Bool bUseMRG = false 158 #if FORCE_REF_VSP==1 159 , Bool bForceRefVsp = false 160 #endif 161 ) ; 151 162 #else 152 163 Void xCheckRDCostInter ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bUseMRG = false ); -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp
r77 r166 169 169 } 170 170 171 172 #if FORCE_REF_VSP==1 173 Void TEncEntropy::encodeVspFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 174 { 175 if ( pcCU->getSlice()->isIntra() || pcCU->getSlice()->getViewId() == 0 ) 176 { 177 return; 178 } 179 if( bRD ) 180 { 181 uiAbsPartIdx = 0; 182 } 183 m_pcEntropyCoderIf->codeVspFlag( pcCU, uiAbsPartIdx ); 184 } 185 #endif 186 171 187 Void TEncEntropy::codeFiltCountBit(ALFParam* pAlfParam, Int64* ruiRate) 172 188 { … … 1285 1301 uiAbsPartIdx = 0; 1286 1302 } 1303 1304 #if FORCE_REF_VSP==1 1305 if( pcCU->isVspMode( uiAbsPartIdx ) ) 1306 { 1307 return; 1308 } 1309 #endif 1287 1310 1288 1311 PartSize eSize = pcCU->getPartitionSize( uiAbsPartIdx ); … … 1345 1368 { 1346 1369 encodeRefFrmIdxPU ( pcCU, uiSubPartIdx, RefPicList( uiRefListIdx ) ); 1370 #if VSP_MV_ZERO 1371 Int iRefIdx = pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->getRefIdx(uiSubPartIdx); 1372 if( !(pcCU->getSlice()->getViewId() && iRefIdx >= 0 && pcCU->getSlice()->getRefViewId( RefPicList( uiRefListIdx ), iRefIdx ) == NUM_VIEW_VSP) ) 1373 { 1374 #endif 1347 1375 encodeMvdPU ( pcCU, uiSubPartIdx, RefPicList( uiRefListIdx ) ); 1348 1376 encodeMVPIdxPU ( pcCU, uiSubPartIdx, RefPicList( uiRefListIdx ) ); 1377 #if VSP_MV_ZERO 1378 } 1379 #endif 1349 1380 } 1350 1381 } … … 1632 1663 { 1633 1664 { 1665 #if FORCE_REF_VSP==1 1666 if( !pcCU->isVspMode( uiAbsPartIdx ) ) 1667 #endif 1634 1668 #if HHI_MPI 1635 1669 if( !(pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N && -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncEntropy.h
r100 r166 115 115 116 116 virtual Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 117 #if FORCE_REF_VSP==1 118 virtual Void codeVspFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 119 #endif 117 120 virtual Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 118 121 virtual Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; … … 251 254 Void encodeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false ); 252 255 Void encodeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 256 #if FORCE_REF_VSP==1 257 Void encodeVspFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 258 #endif 253 259 Void encodePUWise ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 254 260 Void encodeInterDirPU ( TComDataCU* pcSubCU, UInt uiAbsPartIdx ); -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncGOP.cpp
r102 r166 332 332 #endif 333 333 334 #if VSP_N 335 Int NumberOfVspRefs = ( ( pcPic->getViewId()==0 336 #if VSP_TEXT_ONLY 337 || m_pcEncTop->getIsDepth() 338 #endif 339 #if VSP_SLICE_HEADER 340 || !m_pcEncTop->getUseVSP() 341 #endif 342 ) ? 0 : 1 ); 343 pcSlice->setNumRefIdx( REF_PIC_LIST_0, min( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_numRefPicsActive + NumberOfVspRefs, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs() + NumberOfVspRefs) ) ); 344 pcSlice->setNumRefIdx( REF_PIC_LIST_1, min( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_numRefPicsActive + NumberOfVspRefs, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs() + NumberOfVspRefs) ) ); 345 #else 334 346 pcSlice->setNumRefIdx( REF_PIC_LIST_0, min( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_numRefPicsActive, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs()) ) ); 335 347 pcSlice->setNumRefIdx( REF_PIC_LIST_1, min( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_numRefPicsActive, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs()) ) ); 348 #endif 336 349 337 350 TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification(); … … 358 371 359 372 std::vector<TComPic*> apcInterViewRefPics = tAppEncTop->getInterViewRefPics( m_pcEncTop->getViewId(), pcSlice->getPOC(), m_pcEncTop->getIsDepth(), pcSlice->getSPS() ); 373 #if VSP_N 374 Bool bUseVsp = (pcPic->getViewId()!=0); 375 #if VSP_TEXT_ONLY 376 if( m_pcEncTop->getIsDepth() ) bUseVsp = false; 377 #endif 378 #if VSP_SLICE_HEADER 379 if( !m_pcEncTop->getUseVSP() ) bUseVsp = false; 380 #endif 381 pcSlice->setRefPicListMvc( rcListPic, apcInterViewRefPics, bUseVsp ? m_pcEncTop->getVSPBuf() : NULL ); 382 #else 360 383 pcSlice->setRefPicListMvc( rcListPic, apcInterViewRefPics ); 384 #endif 385 #if VSP_SLICE_HEADER 386 pcSlice->setVspFlag( bUseVsp ); 387 #endif 361 388 362 389 // Slice info. refinement … … 1130 1157 m_pcSbacCoder->load( &pcSbacCoders[0] ); 1131 1158 1159 #if DEBUGLOGOUT 1160 char fname[128]; 1161 sprintf(fname, "%sV%02d_%05d%s.csv", "Log", pcSlice->getViewId(), uiPOCCurr, pcSlice->getIsDepth() ? "depth":"text"); 1162 getSliceEncoder()->getCUEncoder()->m_cDebug.DebugLogFileOpen( fname ); 1163 #endif 1164 1132 1165 pcSlice->setTileOffstForMultES( uiOneBitstreamPerSliceLength ); 1133 1166 if (!bEntropySlice) … … 1140 1173 m_pcSliceEncoder->encodeSlice(pcPic, &nalu.m_Bitstream, pcSubstreamsOut); // nalu.m_Bitstream is only used for CAVLC tile position info. 1141 1174 } 1175 1176 #if DEBUGLOGOUT 1177 getSliceEncoder()->getCUEncoder()->m_cDebug.DebugLogFileClose(); 1178 #endif 1142 1179 1143 1180 { -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncGOP.h
r101 r166 146 146 Void freeAPS (TComAPS* pAPS, TComSPS* pSPS); 147 147 Void allocAPS (TComAPS* pAPS, TComSPS* pSPS); 148 148 149 protected: 149 150 Void encodeAPS (TComAPS* pcAPS, TComOutputBitstream& APSbs, TComSlice* pcSlice); //!< encode APS syntax elements -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncSbac.cpp
r101 r166 718 718 { 719 719 // get context function is here 720 #if FORCE_REF_VSP==1 721 UInt uiSymbol = (pcCU->isSkipped( uiAbsPartIdx ) || pcCU->isVspMode( uiAbsPartIdx )) ? 1 : 0; 722 #else 720 723 UInt uiSymbol = pcCU->isSkipped( uiAbsPartIdx ) ? 1 : 0; 724 #endif 721 725 UInt uiCtxSkip = pcCU->getCtxSkipFlag( uiAbsPartIdx ) ; 722 726 m_pcBinIf->encodeBin( uiSymbol, m_cCUSkipFlagSCModel.get( 0, 0, uiCtxSkip ) ); … … 730 734 } 731 735 736 #if FORCE_REF_VSP==1 737 Void TEncSbac::codeVspFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 738 { 739 // get context function is here 740 UInt uiSymbol = (UInt)pcCU->isVspMode( uiAbsPartIdx ); 741 UInt uiCtxSkip = pcCU->getCtxSkipFlag( uiAbsPartIdx ) ; 742 m_pcBinIf->encodeBin( uiSymbol, m_cCUSkipFlagSCModel.get( 0, 0, uiCtxSkip ) ); 743 DTRACE_CABAC_VL( g_nSymbolCounter++ ); 744 DTRACE_CABAC_T( "\tVspFlag" ); 745 DTRACE_CABAC_T( "\tuiCtxSkip: "); 746 DTRACE_CABAC_V( uiCtxSkip ); 747 DTRACE_CABAC_T( "\tuiSymbol: "); 748 DTRACE_CABAC_V( uiSymbol ); 749 DTRACE_CABAC_T( "\n"); 750 } 751 #endif 752 732 753 /** code merge flag 733 754 * \param pcCU … … 764 785 uiNumCand = pcCU->getSlice()->getMaxNumMergeCand(); 765 786 #if HHI_MPI 787 #if VSP_TEXT_ONLY 788 TComDataCU* pcTextCU = pcCU->getSlice()->getSPS()->getUseMVI() ? pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ) : NULL; 789 Int aiRefIdxVsp[2] = { pcTextCU ? pcTextCU->getCUMvField( RefPicList(0) )->getRefIdx( uiAbsPartIdx ) : -1, 790 pcTextCU ? pcTextCU->getCUMvField( RefPicList(1) )->getRefIdx( uiAbsPartIdx ) : -1 }; 791 const Bool bMVIAvailable = pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE 792 && !( aiRefIdxVsp[0] >= 0 && pcTextCU->getSlice()->getRefViewId( RefPicList(0), aiRefIdxVsp[0] ) == NUM_VIEW_VSP ) 793 && !( aiRefIdxVsp[1] >= 0 && pcTextCU->getSlice()->getRefViewId( RefPicList(1), aiRefIdxVsp[1] ) == NUM_VIEW_VSP ); 794 #else 766 795 const Bool bMVIAvailable = pcCU->getSlice()->getSPS()->getUseMVI() && pcCU->getSlice()->getSliceType() != I_SLICE; 796 #endif 767 797 if( bMVIAvailable ) 768 798 { -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncSbac.h
r100 r166 202 202 Void codeAlfCtrlFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 203 203 Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 204 #if FORCE_REF_VSP==1 205 Void codeVspFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 206 #endif 204 207 Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 205 208 Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ); -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncSearch.cpp
r133 r166 683 683 UInt TEncSearch::xPatternRefinement( TComPattern* pcPatternKey, 684 684 TComMv baseRefMv, 685 Int iFrac, TComMv& rcMvFrac ) 685 Int iFrac, TComMv& rcMvFrac 686 #if VSP_MV_ZERO 687 ,Bool bIsVsp 688 #endif 689 ) 686 690 { 687 691 UInt uiDist; … … 699 703 TComMv* pcMvRefine = (iFrac == 2 ? s_acMvRefineH : s_acMvRefineQ); 700 704 705 #if VSP_MV_ZERO 706 UInt iAround = ( bIsVsp )? 1:9; 707 for (UInt i = 0; i < iAround; i++) 708 #else 701 709 for (UInt i = 0; i < 9; i++) 710 #endif 702 711 { 703 712 TComMv cMvTest = pcMvRefine[i]; … … 871 880 { 872 881 m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true ); 882 #if FORCE_REF_VSP==1 883 if( pcCU->getSlice()->getViewId() != 0 ) 884 #if VSP_TEXT_ONLY 885 if( !pcCU->getSlice()->getSPS()->isDepth() ) 886 #endif 887 m_pcEntropyCoder->encodeVspFlag ( pcCU, 0, true ); 888 #endif 873 889 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 874 890 } … … 2751 2767 #if AMP_MRG 2752 2768 #if LG_RESTRICTEDRESPRED_M24766 2753 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv* rpcResiPredYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG ) 2754 #else 2755 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG ) 2769 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv* rpcResiPredYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG 2770 #if FORCE_REF_VSP==1 2771 , Bool bForceRefVsp 2772 #endif 2773 ) 2774 #else 2775 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG 2776 #if FORCE_REF_VSP==1 2777 , Bool bForceRefVsp 2778 #endif 2779 ) 2756 2780 #endif 2757 2781 #else … … 2813 2837 #endif 2814 2838 2839 #if FORCE_REF_VSP==1 2840 if( bForceRefVsp ) 2841 { 2842 assert( ePartSize == SIZE_2Nx2N ); 2843 2844 // Clear Motion Field 2845 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( TComMvField(), ePartSize, 0, pcCU->getDepth(0), 0 ); 2846 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( TComMvField(), ePartSize, 0, pcCU->getDepth(0), 0 ); 2847 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvd ( cMvZero, ePartSize, 0, pcCU->getDepth(0), 0 ); 2848 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvd ( cMvZero, ePartSize, 0, pcCU->getDepth(0), 0 ); 2849 2850 //pcCU->getCUMvField(REF_PIC_LIST_0)->setAllRefIdx ( pcCU->getSlice()->getRefIdxVsp(REF_PIC_LIST_0), ePartSize, 0, pcCU->getDepth(0), 0 ); 2851 //pcCU->getCUMvField(REF_PIC_LIST_1)->setAllRefIdx ( pcCU->getSlice()->getRefIdxVsp(REF_PIC_LIST_1), ePartSize, 0, pcCU->getDepth(0), 0 ); 2852 2853 pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_0, 0, 0, pcCU->getDepth(0)); 2854 pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_0, 0, 0, pcCU->getDepth(0)); 2855 pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_1, 0, 0, pcCU->getDepth(0)); 2856 pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_1, 0, 0, pcCU->getDepth(0)); 2857 2858 rpcPredYuv->copyFromPicYuv( pcCU->getPic()->getPicYuvSynth(), pcCU->getAddr(), pcCU->getZorderIdxInCU() ); 2859 setWpScalingDistParam( pcCU, -1, REF_PIC_LIST_X ); 2860 2861 return; 2862 } 2863 #endif 2864 2815 2865 #if ZERO_MVD_EST 2816 2866 Int aiZeroMvdMvpIdx[2] = {-1, -1}; … … 2833 2883 #if HHI_INTER_VIEW_MOTION_PRED 2834 2884 Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 ); 2885 #endif 2886 2887 #if VSP_MV_ZERO 2888 bool bIsVsp = false; 2889 //Bool bWholeCUCanBeSynthesized = false; 2890 //Bool bSubCUCanBeSynthesized[4]; 2891 //if( pcCU->getSlice()->getViewId() ) 2892 //{ 2893 // Bool * pbSubCUCanBeSynthesized = bSubCUCanBeSynthesized; 2894 // pcCU->getPic()->checkSynthesisAvailability(/*rpcBestCU, */pcCU->getAddr(), pcCU->getZorderIdxInCU(), pcCU->getDepth(0), pbSubCUCanBeSynthesized); //KUBA SYNTH 2895 // Int iSubCUCanBeSynthesizedCnt = 0; 2896 // for(Int i = 0; i < 4; i++) 2897 // { 2898 // if (bSubCUCanBeSynthesized[i]) 2899 // { 2900 // iSubCUCanBeSynthesizedCnt ++; 2901 // } 2902 // } 2903 // if(iSubCUCanBeSynthesizedCnt == 4) 2904 // { 2905 // bWholeCUCanBeSynthesized = true; 2906 // } 2907 //} 2835 2908 #endif 2836 2909 … … 2857 2930 for (Int iNumRef=0; iNumRef < MAX_NUM_REF; iNumRef++) uiCostTempL0[iNumRef] = MAX_UINT; 2858 2931 UInt uiBitsTempL0[MAX_NUM_REF]; 2932 2859 2933 #if LG_RESTRICTEDRESPRED_M24766 2860 2934 Int iPUResiPredShift[4] = {0, 0, 0, 0}; … … 2885 2959 for ( Int iRefIdxTemp = 0; iRefIdxTemp < pcCU->getSlice()->getNumRefIdx(eRefPicList); iRefIdxTemp++ ) 2886 2960 { 2961 #if VSP_MV_ZERO 2962 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp) == NUM_VIEW_VSP); 2963 //if( bIsVsp && !bWholeCUCanBeSynthesized ) 2964 //{ 2965 // continue; 2966 //} 2967 #endif 2887 2968 #if LG_RESTRICTEDRESPRED_M24766 2888 2969 if( pcCU->getResPredFlag( 0 )) … … 2908 2989 if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 ) uiBitsTemp--; 2909 2990 } 2991 #if VSP_MV_ZERO 2992 if( bIsVsp ) 2993 { 2994 aaiMvpIdx[iRefList][iRefIdxTemp] = -1; 2995 aaiMvpNum[iRefList][iRefIdxTemp] = -1; 2996 cMvPred[iRefList][iRefIdxTemp].setZero(); 2997 } 2998 else 2999 { 3000 #endif 2910 3001 #if H0111_MVD_L1_ZERO 2911 3002 #if ZERO_MVD_EST … … 2937 3028 #else 2938 3029 uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdx[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS]; 3030 #endif 3031 #if VSP_MV_ZERO 3032 } // if( bIsVsp ) 2939 3033 #endif 2940 3034 #if ZERO_MVD_EST … … 2973 3067 else 2974 3068 { 3069 #if VSP_MV_ZERO 3070 if( pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp) == NUM_VIEW_VSP ) 3071 { 3072 cMvTemp[1][iRefIdxTemp].setZero(); 3073 uiCostTemp = 0; 3074 } 3075 else 3076 { 3077 #endif 2975 3078 cMvTemp[1][iRefIdxTemp] = cMvTemp[0][pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)]; 2976 3079 uiCostTemp = uiCostTempL0[pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)]; 2977 3080 /*first subtract the bit-rate part of the cost of the other list*/ 2978 3081 uiCostTemp -= m_pcRdCost->getCost( uiBitsTempL0[pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)] ); 3082 #if VSP_MV_ZERO 3083 } 3084 #endif 2979 3085 } 2980 3086 /*correct the bit-rate part of the current ref*/ … … 2986 3092 else 2987 3093 { 3094 #if VSP_MV_ZERO 3095 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], bIsVsp, uiBitsTemp, uiCostTemp ); 3096 #else 2988 3097 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp ); 3098 #endif 2989 3099 } 2990 3100 } … … 2998 3108 else 2999 3109 { 3110 #if VSP_MV_ZERO 3111 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], bIsVsp, uiBitsTemp, uiCostTemp ); 3112 #else 3000 3113 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp ); 3114 #endif 3001 3115 } 3002 3116 } 3003 3117 #else 3004 3118 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp ); 3119 #endif 3120 #if VSP_MV_ZERO 3121 if( bIsVsp ) 3122 { 3123 cMvPred[iRefList][iRefIdxTemp].setZero(); 3124 } 3125 else 3126 { 3005 3127 #endif 3006 3128 xCopyAMVPInfo(pcCU->getCUMvField(eRefPicList)->getAMVPInfo(), &aacAMVPInfo[iRefList][iRefIdxTemp]); // must always be done ( also when AMVP_MODE = AM_NONE ) … … 3009 3131 xCheckBestMVP(pcCU, eRefPicList, cMvTemp[iRefList][iRefIdxTemp], cMvPred[iRefList][iRefIdxTemp], aaiMvpIdx[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp); 3010 3132 } 3133 #if VSP_MV_ZERO 3134 } 3135 #endif 3011 3136 3012 3137 if(pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && !pcCU->getSlice()->getNoBackPredFlag()) … … 3088 3213 if(pcCU->getSlice()->getMvdL1ZeroFlag()) 3089 3214 { 3215 #if VSP_MV_ZERO 3216 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_1, bestBiPRefIdxL1) == NUM_VIEW_VSP); 3217 3218 if( bIsVsp ) 3219 { 3220 cMvPredBi[1][bestBiPRefIdxL1].setZero(); 3221 } 3222 else 3223 { 3224 #endif 3090 3225 xCopyAMVPInfo(&aacAMVPInfo[1][bestBiPRefIdxL1], pcCU->getCUMvField(REF_PIC_LIST_1)->getAMVPInfo()); 3091 3226 pcCU->setMVPIdxSubParts( bestBiPMvpL1, REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3092 3227 aaiMvpIdxBi[1][bestBiPRefIdxL1] = bestBiPMvpL1; 3093 3228 cMvPredBi[1][bestBiPRefIdxL1] = pcCU->getCUMvField(REF_PIC_LIST_1)->getAMVPInfo()->m_acMvCand[bestBiPMvpL1]; 3229 #if VSP_MV_ZERO 3230 } 3231 #endif 3094 3232 3095 3233 cMvBi[1] = cMvPredBi[1][bestBiPRefIdxL1]; … … 3109 3247 } 3110 3248 3249 #if VSP_MV_ZERO 3250 if( !bIsVsp ) 3251 { 3252 #endif 3111 3253 #if HHI_INTER_VIEW_MOTION_PRED 3112 3254 uiMotBits[1] += m_auiMVPIdxCost[aaiMvpIdxBi[1][bestBiPRefIdxL1]][iNumAMVPCands]; 3113 3255 #else 3114 3256 uiMotBits[1] += m_auiMVPIdxCost[aaiMvpIdxBi[1][bestBiPRefIdxL1]][AMVP_MAX_NUM_CANDS]; 3257 #endif 3258 #if VSP_MV_ZERO 3259 } 3115 3260 #endif 3116 3261 … … 3168 3313 for ( Int iRefIdxTemp = iRefStart; iRefIdxTemp <= iRefEnd; iRefIdxTemp++ ) 3169 3314 { 3315 #if VSP_MV_ZERO 3316 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp) == NUM_VIEW_VSP); 3317 //if( bIsVsp && !bWholeCUCanBeSynthesized ) 3318 //{ 3319 // continue; 3320 //} 3321 #endif 3170 3322 uiBitsTemp = uiMbBits[2] + uiMotBits[1-iRefList]; 3171 3323 if ( pcCU->getSlice()->getNumRefIdx(eRefPicList) > 1 ) … … 3174 3326 if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 ) uiBitsTemp--; 3175 3327 } 3328 #if VSP_MV_ZERO 3329 if( !bIsVsp ) 3330 { 3331 #endif 3176 3332 #if HHI_INTER_VIEW_MOTION_PRED 3177 3333 uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdxBi[iRefList][iRefIdxTemp]][iNumAMVPCands]; 3178 3334 #else 3179 3335 uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdxBi[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS]; 3336 #endif 3337 #if VSP_MV_ZERO 3338 } 3180 3339 #endif 3181 3340 #if LG_RESTRICTEDRESPRED_M24766 … … 3211 3370 #endif 3212 3371 // call ME 3372 #if VSP_MV_ZERO 3373 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPredBi[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], bIsVsp, uiBitsTemp, uiCostTemp, true ); 3374 #else 3213 3375 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPredBi[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp, true ); 3376 #endif 3377 #if VSP_MV_ZERO 3378 if( !bIsVsp ) 3379 { 3380 #endif 3214 3381 if ( pcCU->getAMVPMode(uiPartAddr) == AM_EXPL ) 3215 3382 { … … 3217 3384 xCheckBestMVP(pcCU, eRefPicList, cMvTemp[iRefList][iRefIdxTemp], cMvPredBi[iRefList][iRefIdxTemp], aaiMvpIdxBi[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp); 3218 3385 } 3219 3386 #if VSP_MV_ZERO 3387 } 3388 #endif 3389 3220 3390 if ( uiCostTemp < uiCostBi ) 3221 3391 { … … 3249 3419 if ( uiCostBi <= uiCost[0] && uiCostBi <= uiCost[1] && pcCU->getAMVPMode(uiPartAddr) == AM_EXPL ) 3250 3420 { 3421 #if VSP_MV_ZERO 3422 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_0, iRefIdxBi[0]) == NUM_VIEW_VSP); 3423 3424 if( !bIsVsp ) 3425 { 3426 #endif 3251 3427 xCopyAMVPInfo(&aacAMVPInfo[0][iRefIdxBi[0]], pcCU->getCUMvField(REF_PIC_LIST_0)->getAMVPInfo()); 3252 3428 xCheckBestMVP(pcCU, REF_PIC_LIST_0, cMvBi[0], cMvPredBi[0][iRefIdxBi[0]], aaiMvpIdxBi[0][iRefIdxBi[0]], uiBits[2], uiCostBi); 3429 #if VSP_MV_ZERO 3430 } 3431 #endif 3253 3432 #if H0111_MVD_L1_ZERO 3254 3433 if(!pcCU->getSlice()->getMvdL1ZeroFlag()) 3255 3434 { 3256 3435 #endif 3436 #if VSP_MV_ZERO 3437 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_1, iRefIdxBi[1]) == NUM_VIEW_VSP); 3438 3439 if( !bIsVsp ) 3440 { 3441 #endif 3257 3442 xCopyAMVPInfo(&aacAMVPInfo[1][iRefIdxBi[1]], pcCU->getCUMvField(REF_PIC_LIST_1)->getAMVPInfo()); 3258 3443 xCheckBestMVP(pcCU, REF_PIC_LIST_1, cMvBi[1], cMvPredBi[1][iRefIdxBi[1]], aaiMvpIdxBi[1][iRefIdxBi[1]], uiBits[2], uiCostBi); 3444 #if VSP_MV_ZERO 3445 } 3446 #endif 3259 3447 #if H0111_MVD_L1_ZERO 3260 3448 } … … 3417 3605 pcCU->setInterDirSubParts( 3, uiPartAddr, iPartIdx, pcCU->getDepth(0) ); 3418 3606 3607 #if VSP_MV_ZERO 3608 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_0, iRefIdxBi[0]) == NUM_VIEW_VSP); 3609 if( !bIsVsp ) 3610 { 3611 #endif 3419 3612 pcCU->setMVPIdxSubParts( aaiMvpIdxBi[0][iRefIdxBi[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3420 3613 pcCU->setMVPNumSubParts( aaiMvpNum[0][iRefIdxBi[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3614 #if VSP_MV_ZERO 3615 } 3616 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_1, iRefIdxBi[1]) == NUM_VIEW_VSP); 3617 if( !bIsVsp ) 3618 { 3619 #endif 3421 3620 pcCU->setMVPIdxSubParts( aaiMvpIdxBi[1][iRefIdxBi[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3422 3621 pcCU->setMVPNumSubParts( aaiMvpNum[1][iRefIdxBi[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3622 #if VSP_MV_ZERO 3623 } 3624 #endif 3423 3625 3424 3626 uiMEBits = uiBits[2]; … … 3435 3637 pcCU->setInterDirSubParts( 1, uiPartAddr, iPartIdx, pcCU->getDepth(0) ); 3436 3638 3639 #if VSP_MV_ZERO 3640 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_0, iRefIdx[0]) == NUM_VIEW_VSP); 3641 if( !bIsVsp ) 3642 { 3643 #endif 3437 3644 pcCU->setMVPIdxSubParts( aaiMvpIdx[0][iRefIdx[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3438 3645 pcCU->setMVPNumSubParts( aaiMvpNum[0][iRefIdx[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3646 #if VSP_MV_ZERO 3647 } 3648 #endif 3439 3649 3440 3650 uiMEBits = uiBits[0]; … … 3451 3661 pcCU->setInterDirSubParts( 2, uiPartAddr, iPartIdx, pcCU->getDepth(0) ); 3452 3662 3663 #if VSP_MV_ZERO 3664 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_1, iRefIdx[1]) == NUM_VIEW_VSP); 3665 if( !bIsVsp ) 3666 { 3667 #endif 3453 3668 pcCU->setMVPIdxSubParts( aaiMvpIdx[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3454 3669 pcCU->setMVPNumSubParts( aaiMvpNum[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3670 #if VSP_MV_ZERO 3671 } 3672 #endif 3455 3673 3456 3674 uiMEBits = uiBits[1]; … … 3888 4106 } 3889 4107 4108 #if VSP_MV_ZERO 4109 Void TEncSearch::xMotionEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, RefPicList eRefPicList, TComMv* pcMvPred, Int iRefIdxPred, TComMv& rcMv, Bool bIsVsp, UInt& ruiBits, UInt& ruiCost, Bool bBi ) 4110 #else 3890 4111 Void TEncSearch::xMotionEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, RefPicList eRefPicList, TComMv* pcMvPred, Int iRefIdxPred, TComMv& rcMv, UInt& ruiBits, UInt& ruiCost, Bool bBi ) 4112 #endif 3891 4113 { 3892 4114 UInt uiPartAddr; … … 3901 4123 m_iSearchRange = m_aaiAdaptSR[eRefPicList][iRefIdxPred]; 3902 4124 4125 #if VSP_MV_ZERO 4126 Int iSrchRng = ( bIsVsp ? 0 : ( bBi ? m_bipredSearchRange : m_iSearchRange ) ); 4127 #else 3903 4128 Int iSrchRng = ( bBi ? m_bipredSearchRange : m_iSearchRange ); 4129 #endif 3904 4130 TComPattern* pcPatternKey = pcCU->getPattern (); 3905 4131 … … 3947 4173 m_pcRdCost->setCostScale ( 2 ); 3948 4174 4175 #if VSP_MV_ZERO 4176 if( !bIsVsp ) 4177 #endif 3949 4178 #if HHI_INTER_VIEW_MOTION_PRED 3950 4179 { // init inter-view regularization … … 3965 4194 } 3966 4195 #endif 4196 #if VSP_MV_ZERO 4197 else { // bIsVsp 4198 m_pcRdCost->setMultiviewReg( 0 ); 4199 } 4200 #endif 3967 4201 3968 4202 setWpScalingDistParam( pcCU, iRefIdxPred, eRefPicList ); 3969 4203 // Do integer search 4204 #if VSP_MV_ZERO 4205 if ( !m_iFastSearch || bBi || bIsVsp ) 4206 #else 3970 4207 if ( !m_iFastSearch || bBi ) 4208 #endif 3971 4209 { 3972 4210 xPatternSearch ( pcPatternKey, piRefY, iRefStride, &cMvSrchRngLT, &cMvSrchRngRB, rcMv, ruiCost ); … … 3979 4217 3980 4218 m_pcRdCost->getMotionCost( 1, 0 ); 4219 3981 4220 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 3982 4221 if( ! pcCU->getSlice()->getIsDepth() ) … … 3988 4227 xPatternSearchFracDIF( pcCU, pcPatternKey, piRefY, iRefStride, &rcMv, cMvHalf, cMvQter, ruiCost 3989 4228 ,bBi 4229 #if VSP_MV_ZERO 4230 ,bIsVsp 4231 #endif 3990 4232 ); 3991 4233 } … … 4006 4248 ruiCost += m_pcRdCost->getCost( uiMvBits ); 4007 4249 #endif 4008 4250 4251 #if VSP_MV_ZERO 4252 if( bIsVsp ) { 4253 uiMvBits = 0; // vector zero & not output 4254 assert( rcMv.getHor()==0 && rcMv.getVer()==0 ); 4255 } 4256 #endif 4257 4009 4258 ruiBits += uiMvBits; 4010 4259 ruiCost = (UInt)( floor( fWeight * ( (Double)ruiCost - (Double)m_pcRdCost->getCost( uiMvBits ) ) ) + (Double)m_pcRdCost->getCost( ruiBits ) ); … … 4304 4553 UInt& ruiCost 4305 4554 ,Bool biPred 4555 #if VSP_MV_ZERO 4556 ,Bool bIsVsp 4557 #endif 4306 4558 ) 4307 4559 { … … 4322 4574 rcMvHalf = *pcMvInt; rcMvHalf <<= 1; // for mv-cost 4323 4575 TComMv baseRefMv(0, 0); 4324 ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 2, rcMvHalf ); 4576 ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 2, rcMvHalf 4577 #if VSP_MV_ZERO 4578 ,bIsVsp 4579 #endif 4580 ); 4325 4581 4326 4582 m_pcRdCost->setCostScale( 0 ); … … 4332 4588 rcMvQter = *pcMvInt; rcMvQter <<= 1; // for mv-cost 4333 4589 rcMvQter += rcMvHalf; rcMvQter <<= 1; 4334 ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 1, rcMvQter ); 4590 ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 1, rcMvQter 4591 #if VSP_MV_ZERO 4592 ,bIsVsp 4593 #endif 4594 ); 4335 4595 } 4336 4596 … … 4367 4627 #endif 4368 4628 // No residual coding : SKIP mode 4369 if ( ePredMode == MODE_SKIP && bSkipRes ) 4629 if ( (ePredMode == MODE_SKIP && bSkipRes) 4630 #if FORCE_REF_VSP==1 4631 || ePredMode == MODE_SYNTH 4632 #endif 4633 ) 4370 4634 { 4371 4635 rpcYuvResi->clear(); … … 5737 6001 m_pcEntropyCoder->resetBits(); 5738 6002 m_pcEntropyCoder->encodeSkipFlag(pcCU, 0, true); 6003 #if FORCE_REF_VSP==1 6004 if( pcCU->getSlice()->getViewId() != 0 ) 6005 #if VSP_TEXT_ONLY 6006 if( !pcCU->getSlice()->getSPS()->isDepth() ) 6007 #endif 6008 m_pcEntropyCoder->encodeVspFlag ( pcCU, 0, true ); 6009 #endif 5739 6010 m_pcEntropyCoder->encodeMergeIndex(pcCU, 0, 0, true); 5740 6011 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 5743 6014 ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits(); 5744 6015 } 6016 #if FORCE_REF_VSP==1 6017 else if( pcCU->isVspMode( 0 ) ) 6018 { 6019 m_pcEntropyCoder->resetBits(); 6020 m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true ); 6021 m_pcEntropyCoder->encodeVspFlag ( pcCU, 0, true ); 6022 ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits(); 6023 } 6024 #endif 5745 6025 else 5746 6026 { -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncSearch.h
r100 r166 144 144 UInt xPatternRefinement( TComPattern* pcPatternKey, 145 145 TComMv baseRefMv, 146 Int iFrac, TComMv& rcMvFrac ); 146 Int iFrac, TComMv& rcMvFrac 147 #if VSP_MV_ZERO 148 ,Bool bIsVsp 149 #endif 150 ); 147 151 148 152 typedef struct … … 197 201 #if AMP_MRG 198 202 ,Bool bUseMRG = false 203 #endif 204 #if FORCE_REF_VSP==1 205 ,Bool bForceRefVsp = false 199 206 #endif 200 207 ); … … 486 493 Int iRefIdxPred, 487 494 TComMv& rcMv, 495 #if VSP_MV_ZERO 496 Bool bIsVsp, 497 #endif 488 498 UInt& ruiBits, 489 499 UInt& ruiCost, … … 531 541 UInt& ruiCost 532 542 ,Bool biPred 543 #if VSP_MV_ZERO 544 ,Bool bIsVsp 545 #endif 533 546 ); 534 547 -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncTop.cpp
r105 r166 79 79 m_pcBitCounters = NULL; 80 80 m_pcRdCosts = NULL; 81 82 #if VSP_N 83 m_pcPicVSP = NULL; 84 m_pcPicAvail = NULL; 85 #endif 86 87 #if VSP_SLICE_HEADER 88 m_bUseVSP = false; 89 #endif 90 81 91 } 82 92 … … 184 194 } 185 195 #endif 196 197 #if VSP_N 198 m_pcPicVSP = new TComPic; 199 m_pcPicVSP->create( getSourceWidth(), getSourceHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 200 //m_pcPicVSP->getCurrSlice()->setViewId( this->getViewId() ); 201 m_pcPicVSP->getCurrSlice()->setViewId( NUM_VIEW_VSP ); 202 m_pcPicVSP->getCurrSlice()->setViewOrderIdx( m_iViewOrderIdx ); 203 204 m_pcPicAvail = new TComPic; 205 m_pcPicAvail->create( getSourceWidth(), getSourceHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 206 m_pcPicAvail->getCurrSlice()->setViewId( 99 ); 207 m_pcPicAvail->getCurrSlice()->setViewOrderIdx( m_iViewOrderIdx ); 208 #endif 209 186 210 } 187 211 … … 325 349 } 326 350 351 #if VSP_N 352 if( m_pcPicVSP ) 353 { 354 m_pcPicVSP->destroy(); 355 delete m_pcPicVSP; 356 m_pcPicVSP = NULL; 357 } 358 if( m_pcPicAvail ) 359 { 360 m_pcPicAvail->destroy(); 361 delete m_pcPicAvail; 362 m_pcPicAvail = NULL; 363 } 364 #endif 365 327 366 return; 328 367 } … … 391 430 392 431 m_iMaxRefPicNum = 0; 432 433 #if VSP_N 434 m_pcPicVSP->setCurrSliceIdx( 0 ); 435 m_pcPicVSP->getCurrSlice()->setSPS( this->getSPS() ); 436 m_pcPicVSP->getCurrSlice()->setPPS( this->getPPS() ); 437 m_pcPicVSP->getCurrSlice()->setPPSId( this->getPPS()->getPPSId() ); 438 //initialize the motion vector field with zeros - How about the RefIdx ???? 439 //IS THIS REALLY NECESSARY ???? 440 for ( int i=0; i<m_pcPicVSP->getPicSym()->getNumberOfCUsInFrame(); i++ ) 441 { 442 m_pcPicVSP->getPicSym()->getCU(i)->getCUMvField(RefPicList(0))->clearMvField(); 443 m_pcPicVSP->getPicSym()->getCU(i)->getCUMvField(RefPicList(1))->clearMvField(); 444 } 445 #if DEPTH_MAP_GENERATION 446 #if !QC_MULTI_DIS_CAN 447 // add extra pic buffers 448 Bool bNeedPrdDepthMapBuf = ( m_uiPredDepthMapGeneration > 0 ); 449 if( bNeedPrdDepthMapBuf && !m_pcPicVSP->getPredDepthMap() ) 450 { 451 m_pcPicVSP->addPrdDepthMapBuffer( PDM_SUB_SAMP_EXP_X(m_uiPredDepthMapGeneration), PDM_SUB_SAMP_EXP_Y(m_uiPredDepthMapGeneration) ); 452 m_cDepthMapGenerator.clearDepthMap( m_pcPicVSP ); 453 } 454 #endif 455 #endif 456 m_pcPicAvail->setCurrSliceIdx( 0 ); 457 m_pcPicAvail->getCurrSlice()->setSPS( this->getSPS() ); 458 m_pcPicAvail->getCurrSlice()->setPPS( this->getPPS() ); 459 m_pcPicAvail->getCurrSlice()->setPPSId( this->getPPS()->getPPSId() ); 460 //initialize the motion vector field with zeros - How about the RefIdx ???? 461 //IS THIS REALLY NECESSARY ???? 462 for ( int i=0; i<m_pcPicAvail->getPicSym()->getNumberOfCUsInFrame(); i++ ) 463 { 464 m_pcPicAvail->getPicSym()->getCU(i)->getCUMvField(RefPicList(0))->clearMvField(); 465 m_pcPicAvail->getPicSym()->getCU(i)->getCUMvField(RefPicList(1))->clearMvField(); 466 } 467 #if DEPTH_MAP_GENERATION 468 #if !QC_MULTI_DIS_CAN 469 // add extra pic buffers 470 bNeedPrdDepthMapBuf = ( m_uiPredDepthMapGeneration > 0 ); 471 if( bNeedPrdDepthMapBuf && !m_pcPicVSP->getPredDepthMap() ) 472 { 473 m_pcPicAvail->addPrdDepthMapBuffer( PDM_SUB_SAMP_EXP_X(m_uiPredDepthMapGeneration), PDM_SUB_SAMP_EXP_Y(m_uiPredDepthMapGeneration) ); 474 m_cDepthMapGenerator.clearDepthMap( m_pcPicAvail ); 475 } 476 #endif 477 #endif 478 #endif 393 479 } 394 480 -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncTop.h
r56 r166 145 145 TEncAnalyze m_cAnalyzeB; 146 146 147 #if VSP_N 148 TComPic* m_pcPicVSP; ///< view synthesis prediction buffer for current POC to be coded 149 TComPic* m_pcPicAvail; 150 #endif 151 152 #if VSP_SLICE_HEADER 153 Bool m_bUseVSP; 154 #endif 155 147 156 protected: 148 157 Void xGetNewPicBuffer ( TComPic*& rpcPic ); ///< get picture buffer which will be processed … … 237 246 TComResidualGenerator* getResidualGenerator () { return &m_cResidualGenerator; } 238 247 #endif 248 #if VSP_N 249 TComPic* getVSPBuf () { return m_pcPicVSP; } 250 TComPic* getVSPAvailBuf () { return m_pcPicAvail; } 251 #endif 252 253 #if VSP_SLICE_HEADER 254 Void setUseVSP ( Bool val ) { m_bUseVSP = val; } 255 Bool getUseVSP () { return m_bUseVSP; } 256 #endif 239 257 240 258 // ------------------------------------------------------------------------------------------------------------------- -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenFilter.cpp
r56 r166 1154 1154 } 1155 1155 1156 #if NTT_SUBPEL 1157 // Convert luma sample 1158 Void TRenFilter::sampleConv( Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride, Pel* pcDepthPlaneData, Int iDepthStride, Int** ppiFposLUT ) 1159 { 1160 TRenInterpFilter cFilter; 1161 1162 xDistributeArrayOnDepthCondition ( pcInputPlaneData, iInputStride, 1 , 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 1, 1, pcDepthPlaneData, iDepthStride, 1, 1, ppiFposLUT); 1163 cFilter.xCTI_FilterQuarter0Hor ( pcInputPlaneData, iInputStride, 1, iInputWidth, iHeight, iOutputStride, 1, pcOutputPlaneData, pcDepthPlaneData, iDepthStride, 1, ppiFposLUT ); 1164 cFilter.xCTI_FilterHalfHor ( pcInputPlaneData, iInputStride, 1, iInputWidth, iHeight, iOutputStride, 1, pcOutputPlaneData, pcDepthPlaneData, iDepthStride, 1, ppiFposLUT ); 1165 cFilter.xCTI_FilterQuarter1Hor ( pcInputPlaneData, iInputStride, 1, iInputWidth, iHeight, iOutputStride, 1, pcOutputPlaneData, pcDepthPlaneData, iDepthStride, 1, ppiFposLUT ); 1166 } 1167 1168 Void TRenFilter::sampleCVerUp( Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride ) 1169 { 1170 xDistributeArray( pcInputPlaneData-3, iInputStride, 1, 1, iInputWidth+6, iHeight, pcOutputPlaneData -3, iOutputStride, 1, 2 ); 1171 xInterpVerChroma( pcInputPlaneData-3, iInputStride, 1, 1, iInputWidth+6, iHeight, pcOutputPlaneData+iOutputStride-3, iOutputStride, 1, 2, &TRenInterpFilter::xCTI_Filter_VPS04_C_HAL ); 1172 } 1173 1174 Void TRenFilter::sampleCConv( Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride, Pel* pcDepthPlaneData, Int iDepthStride, Int** ppiFposLUT ) 1175 { 1176 // assume quater resolution depth 1177 xDistributeArrayOnDepthCondition( pcInputPlaneData, iInputStride, 1, 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 1, 1, pcDepthPlaneData, iDepthStride, 2, 2, ppiFposLUT); 1178 xInterpHorChromaOnDepthCondition( pcInputPlaneData, iInputStride, 1, 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 1, 1, pcDepthPlaneData, iDepthStride, 2, 2, ppiFposLUT, 1, &TRenInterpFilter::xCTI_Filter_VP04_C_QUA0 ); 1179 xInterpHorChromaOnDepthCondition( pcInputPlaneData, iInputStride, 1, 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 1, 1, pcDepthPlaneData, iDepthStride, 2, 2, ppiFposLUT, 2, &TRenInterpFilter::xCTI_Filter_VPS04_C_HAL ); 1180 xInterpHorChromaOnDepthCondition( pcInputPlaneData, iInputStride, 1, 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 1, 1, pcDepthPlaneData, iDepthStride, 2, 2, ppiFposLUT, 3, &TRenInterpFilter::xCTI_Filter_VP04_C_QUA1 ); 1181 } 1182 1183 Void TRenFilter::sampleCConvHorUp( Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride, Pel* pcDepthPlaneData, Int iDepthStride, Int** ppiFposLUT ) 1184 { 1185 xDistributeArrayOnDepthCondition( pcInputPlaneData, iInputStride, 1, 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 2, 1, pcDepthPlaneData, iDepthStride, 2, 1, ppiFposLUT); 1186 xInterpHorChromaOnDepthCondition( pcInputPlaneData, iInputStride, 1, 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 2, 1, pcDepthPlaneData, iDepthStride, 2, 1, ppiFposLUT, 1, &TRenInterpFilter::xCTI_Filter_VP04_C_OCT0 ); 1187 xInterpHorChromaOnDepthCondition( pcInputPlaneData, iInputStride, 1, 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 2, 1, pcDepthPlaneData, iDepthStride, 2, 1, ppiFposLUT, 2, &TRenInterpFilter::xCTI_Filter_VP04_C_QUA0 ); 1188 xInterpHorChromaOnDepthCondition( pcInputPlaneData, iInputStride, 1, 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 2, 1, pcDepthPlaneData, iDepthStride, 2, 1, ppiFposLUT, 3, &TRenInterpFilter::xCTI_Filter_VP04_C_OCT1 ); 1189 1190 pcOutputPlaneData++; pcDepthPlaneData++; 1191 xInterpHorChromaOnDepthCondition( pcInputPlaneData, iInputStride, 1, 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 2, 1, pcDepthPlaneData, iDepthStride, 2, 1, ppiFposLUT, 0, &TRenInterpFilter::xCTI_Filter_VPS04_C_HAL ); 1192 xInterpHorChromaOnDepthCondition( pcInputPlaneData, iInputStride, 1, 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 2, 1, pcDepthPlaneData, iDepthStride, 2, 1, ppiFposLUT, 1, &TRenInterpFilter::xCTI_Filter_VP04_C_OCT2 ); 1193 xInterpHorChromaOnDepthCondition( pcInputPlaneData, iInputStride, 1, 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 2, 1, pcDepthPlaneData, iDepthStride, 2, 1, ppiFposLUT, 2, &TRenInterpFilter::xCTI_Filter_VP04_C_QUA1 ); 1194 xInterpHorChromaOnDepthCondition( pcInputPlaneData, iInputStride, 1, 1, iInputWidth, iHeight, pcOutputPlaneData, iOutputStride, 2, 1, pcDepthPlaneData, iDepthStride, 2, 1, ppiFposLUT, 3, &TRenInterpFilter::xCTI_Filter_VP04_C_OCT3 ); 1195 } 1196 #endif 1156 1197 1157 1198 // Down Sampling … … 1224 1265 } 1225 1266 } 1267 1268 #if NTT_SUBPEL 1269 Void TRenFilter::xDistributeArrayOnDepthCondition(Pel* pcSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* pcDst, Int iDstStride, Int iDstStepX, Int iDstStepY, Pel* pcDep, Int iDepStride, Int iDepStepX, Int iDepStepY, Int** ppiFposLUT) 1270 { 1271 iDstStride *= iDstStepY; 1272 iSrcStride *= iSrcStepY; 1273 iDepStride *= iDepStepY; 1274 1275 for (Int iYPos = 0; iYPos < iHeight; iYPos++ ) 1276 { 1277 Pel* pcCurDst = pcDst; 1278 Pel* pcCurSrc = pcSrc; 1279 Pel* pcCurDep = pcDep; 1280 1281 for (Int iXPos = 0; iXPos < iWidth; iXPos ++) 1282 { 1283 if( ppiFposLUT[0][ *pcCurDep ] == 0 ) 1284 { 1285 *pcCurDst = *pcCurSrc; 1286 } 1287 pcCurDst += iDstStepX; 1288 pcCurSrc += iSrcStepX; 1289 pcCurDep += iDepStepX; 1290 } 1291 pcDst += iDstStride; 1292 pcSrc += iSrcStride; 1293 pcDep += iDepStride; 1294 } 1295 } 1296 1297 Void TRenFilter::xInterpHorChromaOnDepthCondition( Pel* piSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iDstStepX, Int iDstStepY, Pel* piDep, Int iDepStride, Int iDepStepX, Int iDepStepY, Int** ppiFposLUT, Int iTargetFpos, FpChromaIntFilt fpFilter ) 1298 { 1299 Int iSum; 1300 Pel* piSrcTmpP; 1301 Pel* piSrcTmpN; 1302 Pel* piSrcTmp; 1303 1304 Int iDepX; 1305 1306 TRenInterpFilter cFilter; 1307 for ( Int y = 0; y < iHeight; y++ ) 1308 { 1309 piSrcTmpP = piSrc - iSrcStepX; 1310 piSrcTmpN = piSrc - iSrcStepX*2; 1311 iDepX = 0; 1312 for ( Int x = 0; x < iWidth; x++ ) 1313 { 1314 #if 0 // NTT bugfix 1315 if( abs(ppiFposLUT[0][ piDep[iDepX] ]) == iTargetFpos ) 1316 #else 1317 if( ppiFposLUT[0][ piDep[iDepX] ] == iTargetFpos || ppiFposLUT[0][ piDep[iDepX] ]+4 == iTargetFpos ) 1318 #endif 1319 { 1320 piSrcTmp = ppiFposLUT[0][ piDep[ iDepX ] ] >= 0 ? piSrcTmpP : piSrcTmpN; 1321 iSum = (cFilter.*fpFilter)( piSrcTmp, iSrcStepX ); 1322 piDst[x * iDstStepX ] = Clip ((iSum + 32) >> 6 ); 1323 } 1324 piSrcTmpP += iSrcStepX; 1325 piSrcTmpN += iSrcStepX; 1326 iDepX += iDepStepX; 1327 } 1328 piSrc += iSrcStride * iSrcStepY; 1329 piDst += iDstStride * iDstStepY; 1330 piDep += iDepStride * iDepStepY; 1331 } 1332 } 1333 #endif 1226 1334 1227 1335 -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenFilter.h
r56 r166 103 103 static Void sampleCUpHorUp (Int iLog2HorSampFac, Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride ); 104 104 105 #if NTT_SUBPEL 106 static Void sampleConv (Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride, Pel* pcDepthPlaneData, Int iDepthStride, Int** ppiFposLUT ); 107 static Void sampleCVerUp (Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride ); 108 static Void sampleCConv (Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride, Pel* pcDepthPlaneData, Int iDepthStride, Int** ppiFposLUT ); 109 static Void sampleCConvHorUp (Pel* pcInputPlaneData, Int iInputStride, Int iInputWidth, Int iHeight, Pel* pcOutputPlaneData, Int iOutputStride, Pel* pcDepthPlaneData, Int iDepthStride, Int** ppiFposLUT ); 110 #endif 111 105 112 //// Down sampling (13 tap) 106 113 … … 131 138 static Void xDistributeArray(Pel* pcSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* pcDst, Int iDstStride, Int iDstStepX, Int iDstStepY ); 132 139 140 #if NTT_SUBPEL 141 static Void xDistributeArrayOnDepthCondition(Pel* pcSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* pcDst, Int iDstStride, Int iDstStepX, Int iDstStepY, Pel* pcDep, Int iDepStride, Int iDepStepX, Int iDepStepY, Int** ppiFposLUT); 142 static Void xInterpHorChromaOnDepthCondition(Pel* piSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iDstStepX, Int iDstStepY, Pel* piDep, Int iDepStride, Int iDepStepX, Int iDepStepY, Int** ppiFposLUT, Int iTargetFpos, FpChromaIntFilt fpFilter ); 143 #endif 144 133 145 // Binominal Filtering 134 146 static Pel xFiltBinom3 (Pel* pcInputData, Int iStride ); -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenInterpFilter.h
r165 r166 72 72 __inline Void xCTI_FilterQuarter1Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst); 73 73 __inline Void xCTI_FilterQuarter1Hor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst); 74 74 75 #if NTT_SUBPEL 76 __inline Void xCTI_FilterHalfHor (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst, Pel* piDep, Int iDepStride, Int iDepStep, Int** ppiFposLUT); 77 __inline Void xCTI_FilterQuarter0Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst, Pel* piDep, Int iDepStride, Int iDepStep, Int** ppiFposLUT); 78 __inline Void xCTI_FilterQuarter1Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst, Pel* piDep, Int iDepStride, Int iDepStep, Int** ppiFposLUT); 79 #endif 80 75 81 __inline Void xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst, Int iDstStridePel, Pel*& rpiDstPel ); 76 82 __inline Void xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst ); … … 683 689 } 684 690 691 #if NTT_SUBPEL 692 __inline Void TRenInterpFilter::xCTI_FilterHalfHor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst, Pel* piDep, Int iDepStride, Int iDepStep, Int** ppiFposLUT) 693 { 694 Pel* piDst = rpiDst; 695 Int iSum; 696 Pel* piSrcTmp; 697 Int iSrcStep2 = iSrcStep*2; 698 Int iSrcStep3 = iSrcStep*3; 699 Int iSrcStep4 = iSrcStep*4; 700 Int iSrcStep5 = iSrcStep*5; 701 Int iSrcStep6 = iSrcStep*6; 702 Int iSrcStep7 = iSrcStep*7; 703 704 Int iTmp0, iTmp1, iTmp2, iTmp3, iTmpA; 705 706 Pel *piSrcTmpP, *piSrcTmpN; 707 Int iDepX; 708 709 for ( Int y = iHeight; y != 0; y-- ) 710 { 711 piSrcTmpP = &piSrc[ -3*iSrcStep ]; 712 piSrcTmpN = &piSrc[ -4*iSrcStep ]; 713 iDepX = 0; 714 for ( Int x = 0; x < iWidth; x++ ) 715 { 716 // { -1,4,-11,40,40,-11,4,-1 } 717 #if 0 // NTT bugfix 718 if( abs(ppiFposLUT[0][ piDep[ iDepX ] ]) == 2 ) 719 #else 720 if( ppiFposLUT[0][ piDep[ iDepX ] ] == 2 || ppiFposLUT[0][ piDep[ iDepX ] ] == -2 ) 721 #endif 722 { 723 piSrcTmp = ppiFposLUT[0][ piDep[ iDepX ] ] > 0 ? piSrcTmpP : piSrcTmpN; 724 725 iTmp0 = piSrcTmp[ 0]+piSrcTmp[iSrcStep7]; 726 iTmp1 = piSrcTmp[iSrcStep]+piSrcTmp[iSrcStep6]; 727 iTmp2 = piSrcTmp[iSrcStep2]+piSrcTmp[iSrcStep5]; 728 iTmp3 = piSrcTmp[iSrcStep3]+piSrcTmp[iSrcStep4]; 729 730 iTmpA = (iTmp3 << 2) - iTmp2; 731 732 iSum = ( iTmp1 << 2 ) 733 + ( iTmpA << 3 ) 734 + ( iTmpA << 1 ) 735 - iTmp0 - iTmp2; 736 737 piDst [x * iDstStep] = Clip( (iSum + 32) >> 6 ); 738 } 739 piSrcTmpP += iSrcStep; 740 piSrcTmpN += iSrcStep; 741 iDepX += iDepStep; 742 } 743 piSrc += iSrcStride; 744 piDst += iDstStride; 745 piDep += iDepStride; 746 } 747 return; 748 } 749 750 __inline Void TRenInterpFilter::xCTI_FilterQuarter0Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst, Pel* piDep, Int iDepStride, Int iDepStep, Int** ppiFposLUT) 751 { 752 Pel* piDst = rpiDst; 753 Int iSum; 754 Pel* piSrcTmp; 755 Int iSrcStep2 = iSrcStep*2; 756 Int iSrcStep3 = iSrcStep*3; 757 Int iSrcStep4 = iSrcStep*4; 758 Int iSrcStep5 = iSrcStep*5; 759 Int iSrcStep6 = iSrcStep*6; 760 Int iSrcStep7 = iSrcStep*7; 761 762 Int iTmp1, iTmp2; 763 764 Pel *piSrcTmpP, *piSrcTmpN; 765 Int iDepX; 766 767 for ( Int y = iHeight; y != 0; y-- ) 768 { 769 piSrcTmpP = &piSrc[ -3*iSrcStep ]; 770 piSrcTmpN = &piSrc[ -4*iSrcStep ]; 771 iDepX = 0; 772 for ( Int x = 0; x < iWidth; x++ ) 773 { 774 // {-1, 4, -10, 57, 19, -7, 3, -1 }, 775 #if 0 // NTT bugfix 776 if( abs(ppiFposLUT[0][ piDep[ iDepX ] ]) == 1 ) 777 #else 778 if( ppiFposLUT[0][ piDep[ iDepX ] ] == 1 || ppiFposLUT[0][ piDep[ iDepX ] ] == -3 ) 779 #endif 780 { 781 piSrcTmp = ppiFposLUT[0][ piDep[ iDepX ] ] > 0 ? piSrcTmpP : piSrcTmpN; 782 783 iTmp1 = piSrcTmp[iSrcStep3] + piSrcTmp[iSrcStep5]; 784 iTmp2 = piSrcTmp[iSrcStep6] + piSrcTmp[iSrcStep4]; 785 786 iSum = iTmp1 + iTmp2 - piSrcTmp[0] - piSrcTmp[iSrcStep7] 787 - ( ( piSrcTmp[iSrcStep2] - iTmp2 ) << 1 ) 788 + ( piSrcTmp[iSrcStep] << 2 ) 789 - ( ( piSrcTmp[iSrcStep2] + iTmp1 ) << 3 ) 790 + ( piSrcTmp[iSrcStep4] << 4 ); 791 792 piDst [x * iDstStep] = Clip(( (iSum + 32) >> 6 )+ piSrcTmp[iSrcStep3]); 793 } 794 piSrcTmpP += iSrcStep; 795 piSrcTmpN += iSrcStep; 796 iDepX += iDepStep; 797 } 798 piSrc += iSrcStride; 799 piDst += iDstStride; 800 piDep += iDepStride; 801 } 802 return; 803 } 804 805 __inline Void TRenInterpFilter::xCTI_FilterQuarter1Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst, Pel* piDep, Int iDepStride, Int iDepStep, Int** ppiFposLUT) 806 { 807 Pel* piDst = rpiDst; 808 Int iSum; 809 Pel* piSrcTmp; 810 Int iSrcStep2 = iSrcStep*2; 811 Int iSrcStep3 = iSrcStep*3; 812 Int iSrcStep4 = iSrcStep*4; 813 Int iSrcStep5 = iSrcStep*5; 814 Int iSrcStep6 = iSrcStep*6; 815 Int iSrcStep7 = iSrcStep*7; 816 817 Int iTmp1, iTmp2; 818 819 Pel *piSrcTmpP, *piSrcTmpN; 820 Int iDepX; 821 822 for ( Int y = iHeight; y != 0; y-- ) 823 { 824 piSrcTmpP = &piSrc[ -3*iSrcStep ]; 825 piSrcTmpN = &piSrc[ -4*iSrcStep ]; 826 iDepX = 0; 827 for ( Int x = 0; x < iWidth; x++ ) 828 { 829 // {-1, 3, -7, 19, 57, -10, 4, -1 }, 830 #if 0 // NTT bugfix 831 if( abs(ppiFposLUT[0][ piDep[ iDepX ] ]) == 3 ) 832 #else 833 if( ppiFposLUT[0][ piDep[ iDepX ] ] == 3 || ppiFposLUT[0][ piDep[ iDepX ] ] == -1 ) 834 #endif 835 { 836 piSrcTmp = ppiFposLUT[0][ piDep[ iDepX ] ] > 0 ? piSrcTmpP : piSrcTmpN; 837 838 iTmp1 = piSrcTmp[iSrcStep4] + piSrcTmp[iSrcStep2]; 839 iTmp2 = piSrcTmp[iSrcStep ] + piSrcTmp[iSrcStep3]; 840 841 iSum = iTmp1 + iTmp2 - piSrcTmp[0] - piSrcTmp[iSrcStep7] 842 - ( ( piSrcTmp[iSrcStep5] - iTmp2 ) << 1 ) 843 + ( piSrcTmp[iSrcStep6] << 2 ) 844 - ( ( piSrcTmp[iSrcStep5] + iTmp1 ) << 3 ) 845 + ( piSrcTmp[iSrcStep3] << 4 ); 846 847 piDst [x * iDstStep] = Clip( ((iSum + 32) >> 6) + piSrcTmp[iSrcStep4] ); 848 } 849 piSrcTmpP += iSrcStep; 850 piSrcTmpN += iSrcStep; 851 iDepX += iDepStep; 852 } 853 piSrc += iSrcStride; 854 piDst += iDstStride; 855 piDep += iDepStride; 856 } 857 return; 858 } 859 #endif 860 685 861 __inline Void TRenInterpFilter::xCTI_FilterQuarter0Hor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst) 686 862 { -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenModel.cpp
r101 r166 700 700 } 701 701 } 702 -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenSingleModel.cpp
r100 r166 1943 1943 } 1944 1944 #endif 1945 -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenTop.cpp
r100 r166 127 127 } 128 128 129 #if NTT_SUBPEL 130 Void TRenTop::xConvertInputVideoSubpel( PelImage* pcOrgInputImage, PelImage* pcConvInputImage, PelImage* pcInputDepth, Bool bMirror ) 131 { 132 PelImagePlane* pcOrgPlane; 133 PelImagePlane* pcConvPlane; 134 PelImagePlane* pcDepthPlane; 135 PelImagePlane* pcTmpPlane; 136 137 Int ** ppiFposLUT = bMirror ? m_ppiFposLUTRightMirror : m_ppiFposLUTLeft; 138 139 AOT( m_iLog2SamplingFactor ); 140 AOF( m_iInterpolationMode == eRenInt8Tap2 ); 141 142 pcDepthPlane = pcInputDepth->getPlane( 0 ); 143 pcTmpPlane = pcConvInputImage->getPlane( 0 ); 144 145 AOF( m_bUVUp ); // Currently only m_bUVUp=true is supported 146 for (UInt uiPlane = 1; uiPlane < 3; uiPlane++) 147 { 148 pcOrgPlane = pcOrgInputImage ->getPlane(uiPlane); 149 pcConvPlane = pcConvInputImage->getPlane(uiPlane); 150 151 if ( m_bUVUp ) 152 { 153 TRenFilter::sampleCVerUp (pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight() , pcTmpPlane ->getPlaneData(), pcTmpPlane ->getStride() ); 154 TRenFilter::sampleCConvHorUp(pcTmpPlane->getPlaneData(), pcTmpPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight()*2, pcConvPlane->getPlaneData(), pcConvPlane->getStride(), pcDepthPlane->getPlaneData(), pcDepthPlane->getStride(), ppiFposLUT ); 155 } 156 else 157 { 158 TRenFilter::sampleCConv (pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight()*2, pcConvPlane->getPlaneData(), pcConvPlane->getStride(), pcDepthPlane->getPlaneData(), pcDepthPlane->getStride(), ppiFposLUT ); 159 } 160 } 161 162 pcOrgPlane = pcOrgInputImage ->getPlane(0); 163 pcConvPlane = pcConvInputImage->getPlane(0); 164 TRenFilter::sampleConv(pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride(), pcDepthPlane->getPlaneData(), pcDepthPlane->getStride(), ppiFposLUT); 165 } 166 167 Void TRenTop::xConvertInputDepthSubpel( PelImage* pcOrgInputImage, PelImage* pcConvInputImage) 168 { 169 PelImagePlane* pcOrgPlane ; 170 PelImagePlane* pcConvPlane; 171 172 // Full Plane 173 pcOrgPlane = pcOrgInputImage ->getPlane(0); 174 pcConvPlane = pcConvInputImage->getPlane(0); 175 176 AOT( m_iLog2SamplingFactor ); 177 AOF( m_iInterpolationMode == eRenInt8Tap2 ); 178 179 TRenFilter::sampleHorUp(m_iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride()); 180 181 AOF( m_bUVUp ); 182 if ( !m_bUVUp ) //GT: depth down 183 { 184 // Quarter Plane 185 PelImagePlane* pcTempPlane = new PelImagePlane(pcOrgInputImage->getPlane(0)->getWidth(), ( pcOrgInputImage->getPlane(0)->getHeight() >> 1), REN_LUMA_MARGIN ); 186 187 TRenFilter::sampleVerDown2Tap13(pcOrgInputImage->getPlane(0), pcTempPlane, PICYUV_PAD); 188 pcConvPlane = pcConvInputImage->getPlane(1); 189 190 if ( m_iLog2SamplingFactor == 0 ) 191 { 192 TRenFilter::sampleHorDown2Tap13(pcTempPlane, pcConvPlane, 0 ); 193 } 194 else 195 { 196 TRenFilter::sampleHorUp ( m_iLog2SamplingFactor - 1, pcTempPlane->getPlaneData(), pcTempPlane->getStride(), pcTempPlane->getWidth(), pcTempPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride()); 197 } 198 delete pcTempPlane; 199 } 200 } 201 #endif 202 129 203 Void TRenTop::xConvertInputDepth( PelImage* pcOrgInputImage, PelImage* pcConvInputImage) 130 204 { … … 193 267 } 194 268 269 #if NTT_SUBPEL 270 Void TRenTop::xConvertInputDataSubpel( PelImage* pcOrgInputImage, PelImage* pcOrgInputDepth, PelImage* pcConvInputImage, PelImage* pcConvInputDepth, Bool bMirror ) 271 { 272 //ToDo: remove unnecessary copying 273 if ( bMirror ) 274 { 275 m_pcTempImage->getPlane(0)->assign( pcOrgInputDepth->getPlane(0) ); 276 TRenFilter::mirrorHor( m_pcTempImage->getPlane(0) ); 277 m_pcTempImage->getPlane(0)->extendMargin(); 278 xConvertInputDepthSubpel( m_pcTempImage, pcConvInputDepth ); 279 280 m_pcTempImage->assign( pcOrgInputImage ); 281 TRenFilter::mirrorHor( m_pcTempImage ); 282 m_pcTempImage->extendMargin(); 283 xConvertInputVideoSubpel( m_pcTempImage, pcConvInputImage, pcConvInputDepth, bMirror ); 284 } 285 else 286 { 287 m_pcTempImage->getPlane(0)->assign( pcOrgInputDepth->getPlane(0) ); 288 m_pcTempImage->getPlane(0)->extendMargin(); 289 xConvertInputDepthSubpel( m_pcTempImage, pcConvInputDepth ); 290 291 m_pcTempImage->assign( pcOrgInputImage ); 292 m_pcTempImage->extendMargin(); 293 xConvertInputVideoSubpel( m_pcTempImage, pcConvInputImage, pcConvInputDepth, bMirror ); 294 } 295 } 296 #endif 195 297 196 298 Void TRenTop::xConvertOutputData( PelImage* pcOrgOutputImage, PelImage* pcConvOutputImage, Bool bMirror ) … … 229 331 } 230 332 333 #if VSP_N 334 Void TRenTop::xConvertOutputDataPlane0( PelImage* pcOrgOutputImage, PelImage* pcConvOutputImage, Bool bMirror ) 335 { 336 Int iLog2SamplingFactor = m_iLog2SamplingFactor; 337 338 PelImagePlane* pcOrgPlane = pcOrgOutputImage ->getPlane(0); 339 PelImagePlane* pcConvPlane = pcConvOutputImage->getPlane(0); 340 341 pcOrgPlane->extendMargin(); 342 343 TRenFilter::sampleHorDown( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride()); 344 345 if ( bMirror ) 346 { 347 TRenFilter::mirrorHor( pcConvOutputImage ); 348 } 349 350 } 351 #endif 352 231 353 Void TRenTop::setShiftLUTs( Double** ppdShiftLUTLeft, Int** ppiShiftLUTLeft, Int** ppiBaseShiftLUTLeft, Double** ppdShiftLUTRight, Int** ppiShiftLUTRight, Int** ppiBaseShiftLUTRight, Int iRelDistToLeft ) 232 354 { … … 254 376 } 255 377 } 378 379 #if NTT_SUBPEL 380 Void TRenTop::setFposLUTs( Int** ppiFposLUTLeft, Int** ppiFposLUTRight ) 381 { 382 m_ppiFposLUTLeft = ppiFposLUTLeft; 383 m_ppiFposLUTRight = ppiFposLUTRight; 384 385 if ( m_ppiFposLUTRight != NULL ) 386 { 387 for( UInt uiPlane = 0; uiPlane < 2; uiPlane++) 388 { 389 for (UInt uiDepthValue = 0; uiDepthValue <= 256; uiDepthValue++) 390 { 391 m_ppiFposLUTRightMirror[uiPlane][uiDepthValue] = - m_ppiFposLUTRight[uiPlane][uiDepthValue]; 392 } 393 } 394 } 395 } 396 #endif 256 397 257 398 Void TRenTop::extrapolateView( TComPicYuv* pcPicYuvVideo, TComPicYuv* pcPicYuvDepth, TComPicYuv* pcPicYuvSynthOut, Bool bRenderFromLeft ) … … 278 419 xCutMargin ( &cOutputImage ); 279 420 }; 421 422 #if VSP_N 423 Void TRenTop::extrapolateAvailabilityView( TComPicYuv* pcPicYuvVideo, TComPicYuv* pcPicYuvDepth, TComPicYuv* pcPicYuvSynthOut, TComPicYuv* pcPicYuvAvailOut, Bool bRenderFromLeft ) 424 { 425 AOF( m_bExtrapolate ); 426 AOF( bRenderFromLeft ? m_ppiShiftLUTLeft || m_ppdShiftLUTLeft : m_ppiShiftLUTRight || m_ppdShiftLUTRight ); 427 AOF( m_auiInputResolution[0] == pcPicYuvVideo->getWidth ()); 428 AOF( m_auiInputResolution[1] == pcPicYuvVideo->getHeight()); 429 430 PelImage cInputImage ( pcPicYuvVideo ); 431 PelImage cInputDepth ( pcPicYuvDepth , true); 432 PelImage cOutputImage( pcPicYuvSynthOut ); 433 PelImage cFillImage ( pcPicYuvAvailOut ); 434 435 m_pcOutputImage->init(); 436 m_pcFilled ->assign(REN_IS_HOLE); 437 438 xPreProcessDepth ( &cInputDepth, &cInputDepth); 439 #if NTT_SUBPEL 440 if( m_iInterpolationMode == eRenInt8Tap2 ) 441 xConvertInputDataSubpel(&cInputImage, &cInputDepth, m_pcInputImage, m_pcInputDepth, !bRenderFromLeft ); 442 else 443 xConvertInputData( &cInputImage, &cInputDepth, m_pcInputImage, m_pcInputDepth, !bRenderFromLeft ); 444 #else 445 xConvertInputData( &cInputImage, &cInputDepth, m_pcInputImage, m_pcInputDepth, !bRenderFromLeft ); 446 #endif 447 xShiftPixels(m_pcInputImage, m_pcInputDepth, m_pcOutputImage, m_pcFilled, bRenderFromLeft); 448 xRemBoundaryNoise ( m_pcOutputImage, m_pcFilled, m_pcOutputImage, bRenderFromLeft); // Erode 449 xFillHoles ( m_pcOutputImage, m_pcFilled, m_pcOutputImage, bRenderFromLeft); 450 xConvertOutputData( m_pcOutputImage, &cOutputImage, !bRenderFromLeft ); 451 //if (!bRenderFromLeft) TRenFilter::mirrorHor( &cFillImage ); 452 xConvertOutputDataPlane0( m_pcFilled, &cFillImage, !bRenderFromLeft ); 453 xPostProcessImage (&cOutputImage, &cOutputImage); 454 xCutMargin ( &cOutputImage ); 455 }; 456 #endif 280 457 281 458 Void TRenTop::getUsedSamplesMap( TComPicYuv* pcPicYuvDepth, TComPicYuv* pcUsedSampleMap, Bool bRenderFromLeft ) … … 751 928 { 752 929 case eRenIntFullPel: 930 #if NTT_SUBPEL 931 case eRenInt8Tap2: 932 #endif 753 933 xShiftPlanePixelsFullPel( apcInPlane, pcDepthPlane, apcOutPlane, pcPlaneFilled, uiNumberOfPlanes); 754 934 break; … … 826 1006 } 827 1007 pcFilledData[iShiftedPos] = REN_IS_FILLED; 1008 1009 #if NTT_SUBPEL 1010 if(m_bInstantHoleFilling && (iDiff > 0) ) 1011 { 1012 Int iRefPos = (iPrevShiftedPos == -1) ? iShiftedPos : iPrevShiftedPos; 1013 1014 for (Int iCurPos = iPrevShiftedPos+1; iCurPos < iShiftedPos; iCurPos++) 1015 { 1016 for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++) 1017 { 1018 apcOutputData[uiCurPlane][iCurPos] = apcOutputData[uiCurPlane][iRefPos]; 1019 } 1020 pcFilledData[iCurPos] = REN_IS_FILLED; 1021 } 1022 } 1023 #endif 828 1024 } 829 1025 iPrevShiftedPos = iShiftedPos; 830 1026 } 831 1027 } 1028 #if NTT_SUBPEL 1029 if( (iPrevShiftedPos+1) != iWidth ) 1030 { 1031 for (Int iCurPos = iPrevShiftedPos+1; iCurPos < iWidth; iCurPos++) 1032 { 1033 for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++) 1034 { 1035 apcOutputData[uiCurPlane][iCurPos] = apcOutputData[uiCurPlane][iPrevShiftedPos]; 1036 } 1037 pcFilledData[iCurPos] = REN_IS_FILLED; 1038 } 1039 } 1040 #endif 832 1041 for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++) 833 1042 { … … 1450 1659 1451 1660 for( Int iXPos = iSourcePos + 1; iXPos < iWidth; iXPos++) 1452 1661 { 1453 1662 for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++) 1454 1663 { 1455 1664 apcOutputData[uiCurPlane][iXPos] = apcInputData[uiCurPlane][iSourcePos]; 1456 1665 } 1457 1666 } 1458 1667 1459 1668 // Fill Left Gap … … 1469 1678 { 1470 1679 apcOutputData[uiCurPlane][iXPos] = apcInputData[uiCurPlane][iSourcePos]; 1471 1472 1680 } 1681 } 1473 1682 1474 1683 // Go to next line … … 2032 2241 m_ppiShiftLUTRightMirror[0] = new Int[257]; 2033 2242 m_ppiShiftLUTRightMirror[1] = new Int[257]; 2243 2244 #if NTT_SUBPEL 2245 m_ppiFposLUTLeft = 0; 2246 m_ppiFposLUTRight = 0; 2247 m_ppiFposLUTRightMirror = new Int*[2]; 2248 m_ppiFposLUTRightMirror[0] = new Int[257]; 2249 m_ppiFposLUTRightMirror[1] = new Int[257]; 2250 #endif 2034 2251 2035 2252 m_aiShiftLUTCur = 0; … … 2116 2333 m_iHoleFillingMode = iHoleFillingMode; 2117 2334 2335 #if NTT_SUBPEL 2336 m_bInstantHoleFilling = (m_iInterpolationMode == eRenInt8Tap || m_iInterpolationMode == eRenInt8Tap2 ) && (m_iHoleFillingMode != 0 ); 2337 #else 2118 2338 m_bInstantHoleFilling = (m_iInterpolationMode == eRenInt8Tap ) && (m_iHoleFillingMode != 0 ); 2339 #endif 2119 2340 2120 2341 // PostProcessing … … 2154 2375 { 2155 2376 m_aaiSubPelShift[uiEntry] = new Int[ iNumEntries ]; 2156 2377 } 2157 2378 2158 2379 TRenFilter::setSubPelShiftLUT(m_iRelShiftLUTPrec, m_aaiSubPelShift, -1); … … 2184 2405 }; 2185 2406 2407 #if NTT_SUBPEL 2408 if ( m_ppiFposLUTRightMirror != NULL ) 2409 { 2410 delete[] m_ppiFposLUTRightMirror[0]; 2411 delete[] m_ppiFposLUTRightMirror[1]; 2412 delete[] m_ppiFposLUTRightMirror; 2413 }; 2414 #endif 2415 2186 2416 if (m_piInvZLUTLeft != NULL ) delete[] m_piInvZLUTLeft ; 2187 2417 if (m_piInvZLUTLeft != NULL ) delete[] m_piInvZLUTRight ; -
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenTop.h
r56 r166 50 50 // Interpolation Modes 51 51 52 #if NTT_SUBPEL 53 enum { eRenIntFullPel = 0, eRenIntLinInt = 1, eRenIntLinReal = 2, eRenIntFEM = 3, eRenInt8Tap = 4, eRenInt8Tap2 = 5 }; 54 #else 52 55 enum { eRenIntFullPel = 0, eRenIntLinInt = 1, eRenIntLinReal = 2, eRenIntFEM = 3, eRenInt8Tap = 4 }; 56 #endif 53 57 54 58 // HoleFilling … … 93 97 Int** ppiBaseShiftLUTRight, 94 98 Int iRelDistLeft ); 99 #if NTT_SUBPEL 100 Void setFposLUTs ( Int** ppiFposLUTLeft, Int** ppiFposLUTRight ); 101 Void setInterpolationMode ( Int iMode ) { m_iInterpolationMode = iMode; } 102 #endif 95 103 96 104 // View Synthesis … … 99 107 TComPicYuv* pcPicYuvSynthOut, 100 108 Bool bRenderFromLeft ); 109 110 #if VSP_N 111 Void extrapolateAvailabilityView ( TComPicYuv* pcPicYuvVideo, 112 TComPicYuv* pcPicYuvDepth, 113 TComPicYuv* pcPicYuvSynthOut, 114 TComPicYuv* pcPicYuvAvailOut, 115 Bool bRenderFromLeft ); 116 #endif 101 117 102 118 Void interpolateView ( TComPicYuv* pcPicYuvVideoLeft, … … 166 182 Void xConvertInputData ( PelImage* pcOrgInputImage, PelImage* pcOrgInputDepth, PelImage* pcConvInputImage, PelImage* pcConvInputDepth, Bool bMirror); 167 183 Void xConvertOutputData ( PelImage* pOrgOutputImage, PelImage* pConvOutputImage, Bool bMirror); 184 #if VSP_N 185 Void xConvertOutputDataPlane0 ( PelImage* pOrgOutputImage, PelImage* pConvOutputImage, Bool bMirror); 186 #endif 187 #if NTT_SUBPEL 188 Void xConvertInputDataSubpel ( PelImage* pcOrgInputImage, PelImage* pcOrgInputDepth, PelImage* pcConvInputImage, PelImage* pcConvInputDepth, Bool bMirror); 189 Void xConvertInputVideoSubpel ( PelImage* pcOrgInputImage, PelImage* pcConvInputImage, PelImage* pcInputDepth, Bool bMirror ); 190 Void xConvertInputDepthSubpel ( PelImage* pcOrgInputImage, PelImage* pcConvInputImage); 191 #endif 168 192 169 193 Void xGetDataPointers ( PelImage*& rpcInputImage, PelImage*& rpcOutputImage, PelImage*& rpcInputDepth, PelImage*& rpcOutputDepth, PelImage*& rpcFilled, Bool bRenderDepth ); … … 229 253 Int** m_ppiShiftLUTRightMirror; // For rendering the mirrored view 230 254 Int* m_aiShiftLUTCur; 255 #if NTT_SUBPEL 256 Int** m_ppiFposLUTLeft; 257 Int** m_ppiFposLUTRight; 258 Int** m_ppiFposLUTRightMirror; // For rendering the mirrored view 259 #endif 231 260 232 261 // Look up tables Z
Note: See TracChangeset for help on using the changeset viewer.