Changeset 1394 in 3DVCSoftware
- Timestamp:
- 4 Mar 2016, 09:42:34 (9 years ago)
- Location:
- branches/HTM-16.0-dev1/source
- Files:
-
- 43 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-16.0-dev1/source/App/TAppDecoder/TAppDecTop.cpp
r1386 r1394 1092 1092 m_newVpsActivatedbyCurAu = true; //TBD 1093 1093 m_newVpsActivatedbyCurPic = true; 1094 #if NH_3D_VSO 1094 #if NH_3D_VSO || NH_3D 1095 1095 m_dpb.setVPS( m_vps ); 1096 1096 #endif -
branches/HTM-16.0-dev1/source/App/TAppEncoder/TAppEncCfg.cpp
r1386 r1394 188 188 free ( m_pchVSOConfig ); 189 189 } 190 #endif 191 #if NH_3D_VSO || NH_3D 190 192 191 193 if ( m_pchCameraParameterFile != NULL ) … … 816 818 ("ViewId", m_viewId , IntAry1d(1,0), "View Id per View Order Index") 817 819 ("AuxId", m_auxId , IntAry1d(1,0), "AuxId per layer") 818 #if NH_3D_VSO 820 #if NH_3D_VSO || NH_3D 819 821 ("DepthFlag", m_depthFlag , IntAry1d(1,0), "Depth Flag") 820 822 #endif … … 1285 1287 ("Depth420OutputFlag", m_depth420OutputFlag, true , "Output depth layers in 4:2:0 ") 1286 1288 #endif 1287 #if NH_3D_VSO 1289 #if NH_3D_VSO || NH_3D 1288 1290 ("CameraParameterFile,cpf", m_pchCameraParameterFile, (TChar *) 0 , "Camera Parameter File Name") 1289 1291 ("CodedCamParsPrecision", m_iCodedCamParPrecision, STD_CAM_PARAMETERS_PRECISION, "precision for coding of camera parameters (in units of 2^(-x) luma samples)" ) 1290 1292 #endif 1293 #if NH_3D_VSO 1291 1294 /* View Synthesis Optimization */ 1292 1295 ("VSOConfig", m_pchVSOConfig , (TChar *) 0 ,"VSO configuration") … … 1807 1810 xResizeVector( m_auxId ); 1808 1811 1809 #if NH_3D_VSO 1812 #if NH_3D_VSO || NH_3D 1810 1813 xResizeVector( m_depthFlag ); 1811 1814 #endif … … 2070 2073 LOG2_DISP_PREC_LUT ); 2071 2074 } 2072 #if NH_3D2073 2075 else 2076 #endif 2077 #if NH_3D || NH_3D_VSO 2074 2078 { 2075 2079 m_cCameraData .init ( ((UInt) m_iNumberOfViews ), … … 2085 2089 } 2086 2090 m_cCameraData.check( false, true ); 2087 #endif2088 2091 #endif 2089 2092 … … 2270 2273 #endif 2271 2274 2272 #if NH_3D_VSO 2275 #if NH_3D_VSO || NH_3D 2273 2276 if ( m_scalabilityMask & ( 1 << DEPTH_ID ) ) 2274 2277 { … … 2629 2632 } 2630 2633 2631 #if NH_3D_VSO 2634 #if NH_3D_VSO || NH_3D 2632 2635 xConfirmPara( m_pchCameraParameterFile == 0 , "CameraParameterFile must be given"); 2633 2636 xConfirmPara( m_pchBaseViewCameraNumbers == 0 , "BaseViewCameraNumbers must be given" ); 2634 2637 xConfirmPara( m_iNumberOfViews != m_cCameraData.getBaseViewNumbers().size() , "Number of Views in BaseViewCameraNumbers must be equal to NumberOfViews" ); 2635 2638 xConfirmPara ( m_iCodedCamParPrecision < 0 || m_iCodedCamParPrecision > 5, "CodedCamParsPrecision must be in range of 0..5" ); 2639 #endif 2640 #if NH_3D_VSO 2636 2641 if( m_bUseVSO ) 2637 2642 { … … 3393 3398 xPrintParaVector( "AuxId", m_auxId ); 3394 3399 #endif 3395 #if NH_3D_VSO 3400 #if NH_3D_VSO || NH_3D 3396 3401 xPrintParaVector( "DepthLayerFlag", m_depthFlag ); 3397 3402 printf("Coded Camera Param. Precision : %d\n", m_iCodedCamParPrecision); … … 3595 3600 3596 3601 printf("Max Num Merge Candidates : %d\n", m_maxNumMergeCand); 3597 #if NH_3D_VSO 3602 #if NH_3D_VSO || NH_3D 3598 3603 printf("BaseViewCameraNumbers : %s\n", m_pchBaseViewCameraNumbers ); 3599 3604 printf("Coded Camera Param. Precision : %d\n", m_iCodedCamParPrecision); 3605 #endif 3606 #if NH_3D_VSO 3600 3607 printf("Force use of Lambda Scale : %d\n", m_bForceLambdaScaleVSO ); 3601 3608 -
branches/HTM-16.0-dev1/source/App/TAppEncoder/TAppEncCfg.h
r1386 r1394 80 80 IntAry1d m_viewOrderIndex; ///< view order index 81 81 IntAry1d m_auxId; ///< auxiliary id 82 #if NH_3D_VSO 82 #if NH_3D_VSO || NH_3D 83 83 IntAry1d m_depthFlag; ///< depth flag 84 84 #endif … … 532 532 #endif 533 533 // Camera parameters 534 #if NH_3D _VSO534 #if NH_3D || NH_3D_VSO 535 535 TChar* m_pchCameraParameterFile; ///< camera parameter file 536 536 TAppComCamPara m_cCameraData; 537 537 Int m_iCodedCamParPrecision; ///< precision for coding of camera parameters 538 #endif 539 #if NH_3D_VSO 538 540 TChar* m_pchVSOConfig; 539 541 Bool m_bUseVSO; ///< flag for using View Synthesis Optimization -
branches/HTM-16.0-dev1/source/App/TAppEncoder/TAppEncTop.cpp
r1386 r1394 148 148 xSetCamPara ( vps ); 149 149 #endif 150 #if NH_3D_VSO 150 #if NH_3D_VSO || NH_3D 151 151 m_ivPicLists.setVPS ( &vps ); 152 152 #endif … … 278 278 m_cTEncTop.setViewId ( vps.getViewId ( layerId ) ); 279 279 m_cTEncTop.setViewIndex ( vps.getViewIndex ( layerId ) ); 280 #if NH_3D_VSO 280 #if NH_3D_VSO || NH_3D 281 281 Bool isDepth = ( vps.getDepthId ( layerId ) != 0 ) ; 282 282 Bool isAuxDepth = ( vps.getAuxId ( layerId ) == 2 ) ; // TBD: define 2 as AUX_DEPTH … … 284 284 m_cTEncTop.setIsAuxDepth ( isAuxDepth ); 285 285 //====== Camera Parameters ========= 286 m_cTEncTop.setCameraParameters ( &m_cCameraData ); 286 m_cTEncTop.setCameraParameters ( &m_cCameraData ); 287 #endif 288 #if NH_3D_VSO 287 289 //====== VSO ========= 288 290 m_cTEncTop.setRenderModelParameters ( &m_cRenModStrParser ); … … 796 798 { 797 799 #if H_3D_VSO_EARLY_SKIP 798 m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, m_uiMaxCUHeight , LOG2_DISP_PREC_LUT, 0, m_bVSOEarlySkip );799 #else 800 m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, m_uiMaxCUHeight , LOG2_DISP_PREC_LUT, 0 );800 m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, m_uiMaxCUHeight , LOG2_DISP_PREC_LUT, 0, true, m_bVSOEarlySkip ); 801 #else 802 m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, m_uiMaxCUHeight , LOG2_DISP_PREC_LUT, 0 , true); 801 803 #endif 802 804 for ( Int layer = 0; layer < m_numberOfLayers ; layer++ ) … … 1036 1038 for ( Int gopId=0; gopId < gopSize; gopId++ ) 1037 1039 { 1038 #if NH_3D_VSO 1040 #if NH_3D_VSO || NH_3D 1039 1041 UInt iNextPoc = m_acTEncTopList[0] -> getFrameId( gopId ); 1040 1042 if ( iNextPoc < m_framesToBeEncoded ) -
branches/HTM-16.0-dev1/source/App/TAppRenderer/TAppRendererCfg.cpp
r1386 r1394 44 44 #include "../../Lib/TAppCommon/program_options_lite.h" 45 45 46 #if NH_3D_VSO 46 #if NH_3D_VSO || NH_3D 47 47 48 48 using namespace std; … … 207 207 else 208 208 { 209 if ( m_bUseSetupString ) 210 { 211 std::vector<Int> iaTempViews; 212 std::vector<Int>* piaTempViews; 213 m_cCameraData .convertNumberString( m_pchBaseViewCameraNumbers, iaTempViews, VIEW_NUM_PREC ); 214 m_cRenModStrParser.setString( (Int) iaTempViews.size(), m_pchViewConfig ); 215 piaTempViews = m_cRenModStrParser.getSynthViews(); 216 m_iNumberOfOutputViews = (Int) m_cRenModStrParser.getNumOfModels(); 217 m_iNumberOfInputViews = (Int) m_cRenModStrParser.getNumOfBaseViews(); 218 m_bContOutputFileNumbering = true; 219 220 m_cCameraData.init( MAX_INPUT_VIEW_NUM, uiInputBitDepth, uiCamParPrecision, (UInt)m_iFrameSkip, (UInt)m_iFramesToBeRendered, 221 m_pchCameraParameterFile, m_pchBaseViewCameraNumbers, NULL, piaTempViews, m_iLog2SamplingFactor+m_iShiftPrecision ); 222 } 223 else 224 { 225 m_cCameraData.init( MAX_INPUT_VIEW_NUM, uiInputBitDepth, uiCamParPrecision, (UInt)m_iFrameSkip, (UInt)m_iFramesToBeRendered, 226 m_pchCameraParameterFile, m_pchBaseViewCameraNumbers, m_pchSynthViewCameraNumbers, NULL, m_iLog2SamplingFactor+m_iShiftPrecision ); 227 m_iNumberOfOutputViews = (Int) m_cCameraData.getSynthViewNumbers().size(); 228 m_iNumberOfInputViews = (Int) m_cCameraData.getBaseViewNumbers() .size(); 229 } 209 #if NH_3D_VSO 210 if ( m_bUseSetupString ) 211 { 212 std::vector<Int> iaTempViews; 213 std::vector<Int>* piaTempViews; 214 m_cCameraData .convertNumberString( m_pchBaseViewCameraNumbers, iaTempViews, VIEW_NUM_PREC ); 215 m_cRenModStrParser.setString( (Int) iaTempViews.size(), m_pchViewConfig ); 216 piaTempViews = m_cRenModStrParser.getSynthViews(); 217 m_iNumberOfOutputViews = (Int) m_cRenModStrParser.getNumOfModels(); 218 m_iNumberOfInputViews = (Int) m_cRenModStrParser.getNumOfBaseViews(); 219 m_bContOutputFileNumbering = true; 220 221 m_cCameraData.init( MAX_INPUT_VIEW_NUM, uiInputBitDepth, uiCamParPrecision, (UInt)m_iFrameSkip, (UInt)m_iFramesToBeRendered, 222 m_pchCameraParameterFile, m_pchBaseViewCameraNumbers, NULL, piaTempViews, m_iLog2SamplingFactor+m_iShiftPrecision ); 223 } 224 else 225 { 226 m_cCameraData.init( MAX_INPUT_VIEW_NUM, uiInputBitDepth, uiCamParPrecision, (UInt)m_iFrameSkip, (UInt)m_iFramesToBeRendered, 227 m_pchCameraParameterFile, m_pchBaseViewCameraNumbers, m_pchSynthViewCameraNumbers, NULL, m_iLog2SamplingFactor+m_iShiftPrecision ); 228 m_iNumberOfOutputViews = (Int) m_cCameraData.getSynthViewNumbers().size(); 229 m_iNumberOfInputViews = (Int) m_cCameraData.getBaseViewNumbers() .size(); 230 } 231 #else 232 AOF( false ); // Compile with VSO enabled to use this option. 233 #endif 230 234 } 231 235 -
branches/HTM-16.0-dev1/source/App/TAppRenderer/TAppRendererCfg.h
r1386 r1394 47 47 #include <vector> 48 48 49 #if NH_3D_VSO 49 #if NH_3D_VSO || NH_3D 50 50 51 51 // ==================================================================================================================== … … 91 91 // derived 92 92 TAppComCamPara m_cCameraData; ///< class to store camera parameters 93 #if NH_3D_VSO 93 94 TRenModSetupStrParser m_cRenModStrParser; ///< class to manage View to be rendered 95 #endif 94 96 Bool m_bUseSetupString; ///< true if setup string is used 95 97 -
branches/HTM-16.0-dev1/source/App/TAppRenderer/TAppRendererTop.cpp
r1386 r1394 434 434 435 435 m_apcTVideoIOYuvSynthOutput[m_bSweep ? 0 : iSynthViewIdx]->write( pcPicYuvSynthOut, IPCOLOURSPACE_UNCHANGED, 0, 0, 0, 0, CHROMA_420 ); 436 436 } 437 437 iFrame++; 438 438 iNumOfRenderedFrames++; … … 544 544 AOT( m_iLog2SamplingFactor != 0 ); 545 545 #if H_3D_VSO_EARLY_SKIP 546 cCurModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, m_iSourceHeight, m_iShiftPrecision, m_iBlendHoleMargin, false, false ); 547 #else 546 548 cCurModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, m_iSourceHeight, m_iShiftPrecision, m_iBlendHoleMargin, false ); 547 #else548 cCurModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, m_iSourceHeight, m_iShiftPrecision, m_iBlendHoleMargin );549 549 #endif 550 550 … … 725 725 726 726 #if H_3D_VSO_EARLY_SKIP 727 cCurModel.create( m_iNumberOfInputViews, m_iNumberOfOutputViews, m_iSourceWidth, m_iSourceHeight, m_iShiftPrecision, m_iBlendHoleMargin, false );727 cCurModel.create( m_iNumberOfInputViews, m_iNumberOfOutputViews, m_iSourceWidth, m_iSourceHeight, m_iShiftPrecision, m_iBlendHoleMargin, false , false); 728 728 #else 729 cCurModel.create( m_iNumberOfInputViews, m_iNumberOfOutputViews, m_iSourceWidth, m_iSourceHeight, m_iShiftPrecision, m_iBlendHoleMargin );729 cCurModel.create( m_iNumberOfInputViews, m_iNumberOfOutputViews, m_iSourceWidth, m_iSourceHeight, m_iShiftPrecision, m_iBlendHoleMargin ,false); 730 730 #endif 731 731 cCurModel.setupPart( 0, m_iSourceHeight ); -
branches/HTM-16.0-dev1/source/Lib/TAppCommon/TAppComCamPara.cpp
r1386 r1394 49 49 #include <functional> 50 50 #include <string> 51 #if NH_3D_VSO 51 #if NH_3D_VSO || NH_3D 52 52 53 53 -
branches/HTM-16.0-dev1/source/Lib/TLibCommon/CommonDef.h
r1387 r1394 442 442 #endif 443 443 444 #if NH_3D_VSO 444 #if NH_3D_VSO || NH_3D 445 445 //PICYUV 446 446 #define PICYUV_PAD 16 … … 456 456 #define REN_UNUSED_PEL 0 457 457 #define REN_IS_HOLE 0 458 #if NH_3D_VSO459 458 #define ENC_INTERNAL_BIT_DEPTH REN_BIT_DEPTH // consider making this a variable 460 #endif 461 462 459 #endif // end of NH_3D_VSO 460 #if NH_3D 463 461 // CAMERA PARAMETERS 464 462 #define LOG2_DISP_PREC_LUT 2 ///< log2 of disparity precision used in integer disparity LUTs 465 463 #define STD_CAM_PARAMETERS_PRECISION 5 ///< quarter luma sample accuarcy for derived disparities (as default) 466 467 #endif // end of NH_3D 464 #endif 468 465 //! \} 469 466 -
branches/HTM-16.0-dev1/source/Lib/TLibCommon/TComDataCU.cpp
r1392 r1394 5101 5101 5102 5102 //// ******* Get disparity from left block ******* ///// 5103 pcTmpCU = getPULeft(uiIdx, uiPartIdxLB);5103 pcTmpCU = getPULeft(uiIdx, uiPartIdxLB); 5104 5104 bCheckMcpDv = true; 5105 5105 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, pDInfo, bCheckMcpDv, &cIDVInfo, DVFROM_LEFT -
branches/HTM-16.0-dev1/source/Lib/TLibCommon/TComDataCU.h
r1386 r1394 49 49 #include "TComRdCost.h" 50 50 #include "TComPattern.h" 51 #if NH_3D 52 #include "TComYuv.h" 53 #endif 51 54 52 55 //! \ingroup TLibCommon -
branches/HTM-16.0-dev1/source/Lib/TLibCommon/TComPic.cpp
r1386 r1394 60 60 , m_viewId (0) 61 61 , m_bPicOutputFlag (false) 62 #if NH_3D_VSO 62 #if NH_3D_VSO || NH_3D 63 63 , m_viewIndex (0) 64 64 , m_isDepth (false) … … 989 989 } 990 990 991 #if NH_3D_VSO 991 #if NH_3D_VSO || NH_3D 992 992 TComPicYuv* TComPicLists::getPicYuv( Int viewIndex, Bool depthFlag, Int auxId, Int poc, Bool recon ) 993 993 { -
branches/HTM-16.0-dev1/source/Lib/TLibCommon/TComPic.h
r1386 r1394 154 154 TComDecodedRps m_decodedRps; 155 155 #endif 156 #if NH_3D_VSO 156 #if NH_3D_VSO || NH_3D 157 157 Int m_viewIndex; 158 158 Bool m_isDepth; … … 311 311 Void print( Int outputLevel ); 312 312 313 #if NH_3D_VSO 313 #if NH_3D_VSO || NH_3D 314 314 Void setViewIndex ( Int viewIndex ) { m_viewIndex = viewIndex; } 315 315 Int getViewIndex () const { return m_viewIndex; } … … 404 404 TComList<TComSubDpb*> m_subDpbs; 405 405 Bool m_printPicOutput; 406 #if NH_3D_VSO 406 #if NH_3D_VSO || NH_3D 407 407 const TComVPS* m_vps; 408 408 #endif … … 448 448 Void print(); 449 449 450 #if NH_3D_VSO 450 #if NH_3D_VSO || NH_3D 451 451 Void setVPS ( const TComVPS* vps ) { m_vps = vps; }; 452 #endif 453 454 #if NH_3D || NH_3D_VSO 452 455 TComPic* getPic ( Int viewIndex, Bool depthFlag, Int auxId, Int poc ); 453 456 TComPicYuv* getPicYuv ( Int viewIndex, Bool depthFlag, Int auxId, Int poc, Bool recon ); -
branches/HTM-16.0-dev1/source/Lib/TLibCommon/TComRdCost.cpp
r1386 r1394 252 252 rcDistParam.DistFunc = TComRdCost::xGetMaskedSAD; 253 253 } 254 #if NH_3D_VSO 254 255 else if( eDFunc >= DF_VSD && eDFunc <= DF_VSD16N ) 255 256 { 256 257 rcDistParam.DistFunc = TComRdCost::xGetMaskedVSD; 257 258 } 259 #endif 258 260 else if( eDFunc >= DF_SAD12 && eDFunc <= DF_SADS48 ) 259 261 { … … 626 628 } 627 629 628 630 #if NH_3D_VSO 629 631 UInt TComRdCost::xGetMaskedVSD( DistParam* pcDtParam ) 630 632 { … … 660 662 return ( uiSum ); 661 663 } 664 #endif 662 665 #endif 663 666 // -------------------------------------------------------------------------------------------------------------------- -
branches/HTM-16.0-dev1/source/Lib/TLibCommon/TComRom.h
r1386 r1394 150 150 // ==================================================================================================================== 151 151 extern SChar g_aucConvertToBit [ MAX_CU_SIZE+1 ]; // from width to log2(width)-2 152 #if NH_MV153 // Change later154 #ifndef ENC_DEC_TRACE155 #define ENC_DEC_TRACE 0156 #endif157 #endif158 152 #if ENC_DEC_TRACE 159 153 extern FILE* g_hTrace; -
branches/HTM-16.0-dev1/source/Lib/TLibCommon/TComSlice.cpp
r1392 r1394 118 118 , m_viewId (0) 119 119 , m_viewIndex (0) 120 #if NH_3D_VSO 120 #if NH_3D_VSO || NH_3D 121 121 , m_isDepth (false) 122 122 #endif … … 2181 2181 } 2182 2182 2183 #if NH_3D_VSO 2183 #if NH_3D_VSO || NH_3D 2184 2184 Int TComVPS::getLayerIdInNuh( Int viewIndex, Bool depthFlag, Int auxId ) const 2185 2185 { -
branches/HTM-16.0-dev1/source/Lib/TLibCommon/TComSlice.h
r1386 r1394 1384 1384 /// VPS EXTENSION 2 SYNTAX ELEMENTS 1385 1385 Int getDepthId ( Int layerIdInNuh) const { return getScalabilityId( getLayerIdInVps(layerIdInNuh), DEPTH_ID ); } 1386 #if NH_3D_VSO 1386 #if NH_3D_VSO || NH_3D 1387 1387 Bool getVpsDepthFlag ( Int layerIdInNuh) const { return (getDepthId( layerIdInNuh ) > 0); } 1388 1388 Int getLayerIdInNuh ( Int viewIndex, Bool depthFlag, Int auxId ) const; … … 2701 2701 Int m_viewId; 2702 2702 Int m_viewIndex; 2703 #if NH_3D_VSO 2703 #if NH_3D_VSO || NH_3D 2704 2704 Bool m_isDepth; 2705 2705 #endif … … 3168 3168 #endif 3169 3169 #endif 3170 #if NH_3D_VSO 3170 #if NH_3D_VSO || NH_3D 3171 3171 Void setIsDepth ( Bool isDepth ) { m_isDepth = isDepth; } 3172 3172 Bool getIsDepth () const { return m_isDepth; } -
branches/HTM-16.0-dev1/source/Lib/TLibCommon/TComYuv.cpp
r1386 r1394 487 487 } 488 488 } 489 #endif 489 490 490 491 #if NH_3D_ARP … … 676 677 } 677 678 #endif 678 #endif679 679 680 680 //! \} -
branches/HTM-16.0-dev1/source/Lib/TLibCommon/TypeDef.h
r1392 r1394 65 65 #if NH_MV 66 66 // Recent bug fixes 67 #define RM_INIT_FIX 1 68 #define RM_FIX_SETUP 1 69 70 71 #define NH_3D_FIX_INTRA_SDC_VSO_OFF 1 67 72 #define NH_3D_FIX_TICKET_114 1 //Mismatch between text and software on DPB size syntax 68 73 #define NH_3D_FIX_LEAK 1 … … 349 354 #endif 350 355 // This can be enabled by the makefile 351 #if !NH_MV352 356 #ifndef ENC_DEC_TRACE 353 357 #define ENC_DEC_TRACE 0 358 #endif 359 360 #if NH_MV 361 #if ENC_DEC_TRACE 362 #define GT_DEBUG 1 363 #else 364 #define GT_DEBUG 0 354 365 #endif 355 366 #endif … … 510 521 #define RDO_DIST_MAX MAX_UINT 511 522 #endif 523 #else 524 #define RDO_DIST_MAX MAX_UINT 512 525 #endif 513 526 // ==================================================================================================================== … … 1000 1013 BLEND_GEN = 3 1001 1014 }; 1015 1016 enum SetMod 1017 { 1018 GET_FULL = 0, 1019 SET_FULL = 1, 1020 GET_SIMP = 2, 1021 SET_SIMP = 3 1022 }; 1023 1024 1002 1025 enum 1003 1026 { -
branches/HTM-16.0-dev1/source/Lib/TLibDecoder/TDecTop.cpp
r1386 r1394 1063 1063 m_pcPic->setLayerId( nalu.m_nuhLayerId ); 1064 1064 m_pcPic->setViewId ( getViewId() ); 1065 #if NH_3D 1065 #if NH_3D || NH_3D_VSO 1066 1066 m_pcPic->setViewIndex( getViewIndex() ); 1067 1067 m_pcPic->setIsDepth ( getIsDepth () ); -
branches/HTM-16.0-dev1/source/Lib/TLibDecoder/TDecTop.h
r1321 r1394 247 247 Int m_layerId; 248 248 Int m_viewId; 249 #if NH_3D 249 #if NH_3D || NH_3D_VSO 250 250 Int m_viewIndex; 251 251 Bool m_isDepth; -
branches/HTM-16.0-dev1/source/Lib/TLibEncoder/SyntaxElementWriter.cpp
r1386 r1394 128 128 129 129 #if NH_MV_ENC_DEC_TRAC 130 Void SyntaxElementWriter::xWriteStringTr( UChar* value, UInt length, const Char *pSymbolName)130 Void SyntaxElementWriter::xWriteStringTr( UChar* value, UInt length, const TChar *pSymbolName) 131 131 { 132 132 xWriteString(value, length); -
branches/HTM-16.0-dev1/source/Lib/TLibEncoder/SyntaxElementWriter.h
r1386 r1394 96 96 Void xWriteFlagTr ( UInt value, const TChar *pSymbolName); 97 97 #if NH_MV 98 Void xWriteStringTr ( UChar* value, UInt length, const Char *pSymbolName);98 Void xWriteStringTr ( UChar* value, UInt length, const TChar *pSymbolName); 99 99 #endif 100 100 #endif -
branches/HTM-16.0-dev1/source/Lib/TLibEncoder/TEncCavlc.cpp
r1392 r1394 69 69 fprintf( g_hTrace, "=========== Slice ===========\n"); 70 70 } 71 #endif 71 72 72 73 Void xTraceAccessUnitDelimiter () … … 75 76 } 76 77 77 #endif78 78 #endif 79 79 -
branches/HTM-16.0-dev1/source/Lib/TLibEncoder/TEncCfg.h
r1386 r1394 46 46 #include "TLibCommon/TComSlice.h" 47 47 #include <assert.h> 48 49 #if NH_3D 50 #include "TAppCommon/TAppComCamPara.h" 51 #endif 48 52 #if NH_3D_VSO 49 #include "TAppCommon/TAppComCamPara.h"50 53 #include "TLibRenderer/TRenModSetupStrParser.h" 51 54 #endif … … 458 461 #endif 459 462 460 #if NH_3D_VSO 463 #if NH_3D_VSO || NH_3D 461 464 Bool m_isDepth; 462 465 Bool m_isAuxDepth; … … 464 467 //====== Camera Parameters ====== 465 468 TAppComCamPara* m_cameraParameters; 469 #endif 466 470 471 #if NH_3D_VSO 467 472 //====== View Synthesis Optimization ====== 468 473 TRenModSetupStrParser* m_renderModelParameters; … … 504 509 , m_viewId(-1) 505 510 , m_viewIndex(-1) 506 #if NH_3D_VSO 511 #if NH_3D_VSO || NH_3D 507 512 , m_isDepth(false) 508 513 , m_isAuxDepth(false) 514 #endif 515 #if NH_3D_VSO 509 516 , m_bUseVSO(false) 510 517 #endif … … 555 562 Void setViewIndex ( Int viewIndex ) { m_viewIndex = viewIndex; } 556 563 Int getViewIndex () { return m_viewIndex; } 557 #if NH_3D_VSO 564 #if NH_3D_VSO || NH_3D 558 565 Void setIsDepth ( Bool isDepth ) { m_isDepth = isDepth; } 559 566 Bool getIsDepth () { return m_isDepth; } … … 1157 1164 UInt getSummaryVerboseness( ) const { return m_summaryVerboseness; } 1158 1165 1159 #if NH_3D_VSO 1166 #if NH_3D_VSO || NH_3D 1160 1167 // Only flags that are not in the SPS3dExtension should go here. 1161 1168 /// 3D Tools … … 1163 1170 //==== CAMERA PARAMETERS ========== 1164 1171 Void setCameraParameters ( TAppComCamPara* c) { m_cameraParameters = c; } 1165 //==== VSO ========== 1172 #endif 1173 #if NH_3D_VSO 1174 //==== VSO ========== 1166 1175 Void setRenderModelParameters ( TRenModSetupStrParser* c ) { m_renderModelParameters = c; } 1167 1176 Bool getUseVSO () { return m_bUseVSO; } -
branches/HTM-16.0-dev1/source/Lib/TLibEncoder/TEncCu.cpp
r1386 r1394 1199 1199 rpcBestCU->getTotalBins() += ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded(); 1200 1200 #if NH_3D_VSO // M8 1201 if ( m_pcRdCost->getUse VSO() )1201 if ( m_pcRdCost->getUseLambdaScaleVSO() ) 1202 1202 { 1203 1203 rpcBestCU->getTotalCost() = m_pcRdCost->calcRdCostVSO( rpcBestCU->getTotalBits(), rpcBestCU->getTotalDistortion() ); … … 1340 1340 } 1341 1341 #if NH_3D_VSO // M10 1342 if ( m_pcRdCost->getUse VSO() )1342 if ( m_pcRdCost->getUseLambdaScaleVSO() ) 1343 1343 { 1344 1344 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCostVSO( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); … … 2974 2974 rpcTempCU->getTotalBins() = ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded(); 2975 2975 #if NH_3D_VSO // M44 2976 if ( m_pcRdCost->getUse VSO() )2976 if ( m_pcRdCost->getUseLambdaScaleVSO() ) 2977 2977 { 2978 2978 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCostVSO( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); … … 3047 3047 pcCU->getTotalBins() += ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded(); 3048 3048 #if NH_3D_VSO // M45 3049 if ( m_pcRdCost->getUse VSO() )3049 if ( m_pcRdCost->getUseLambdaScaleVSO() ) 3050 3050 { 3051 3051 pcCU->getTotalCost() = m_pcRdCost->calcRdCostVSO( pcCU->getTotalBits(), pcCU->getTotalDistortion() ); -
branches/HTM-16.0-dev1/source/Lib/TLibEncoder/TEncSearch.cpp
r1386 r1394 1647 1647 UInt uiSingleBits = xGetIntraBitsQT( rTu, true, false, false ); 1648 1648 #if NH_3D_VSO // M NEW 1649 if ( m_pcRdCost->getUse RenModel() )1649 if ( m_pcRdCost->getUseLambdaScaleVSO() ) 1650 1650 { 1651 1651 singleCostTmp = m_pcRdCost->calcRdCostVSO( uiSingleBits, singleDistTmpLuma ); … … 1887 1887 1888 1888 #if NH_3D_DIS 1889 Void TEncSearch::xIntraCodingDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, UInt uiPredMode ) 1889 #if NH_3D_VSO 1890 Void TEncSearch::xIntraCodingDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, UInt uiPredMode ) 1891 #else 1892 Void TEncSearch::xIntraCodingDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Distortion& ruiDist, Double& dRDCost, UInt uiPredMode ) 1893 #endif 1890 1894 { 1891 1895 UInt uiWidth = pcCU ->getWidth ( 0 ); … … 1982 1986 #endif 1983 1987 #if NH_3D_SDC_INTRA 1984 Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi ) 1988 #if NH_3D_VSO 1989 Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi ) 1990 #else 1991 Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Distortion& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi ) 1992 #endif 1993 1994 1985 1995 { 1986 1996 UInt uiWidth = pcCU->getWidth ( 0 ); … … 2215 2225 #endif 2216 2226 { 2227 #if NH_3D_FIX_INTRA_SDC_VSO_OFF 2228 ruiDist = m_pcRdCost->getDistPart( bitDepthY, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, COMPONENT_Y ); 2229 #else 2217 2230 ruiDist = m_pcRdCost->getDistPart( bitDepthY, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, COMPONENT_Y, DF_SAD ); 2231 #endif 2218 2232 } 2219 2233 … … 2743 2757 Pel* piOrg = pcOrgYuv ->getAddr(COMPONENT_Y, 0, uiWidth ); 2744 2758 UInt uiStride = pcPredYuv->getStride(COMPONENT_Y); 2745 #endif 2759 2746 2760 Dist uiDist = 0; 2747 2761 Double dCost = 0.0; … … 2749 2763 Double dBestCost = MAX_DOUBLE; 2750 2764 UInt uiBestDISType = 0; 2765 #else 2766 Distortion uiDist = 0; 2767 Double dCost = 0.0; 2768 Distortion uiBestDist = 0; 2769 Double dBestCost = MAX_DOUBLE; 2770 UInt uiBestDISType = 0; 2771 #endif 2751 2772 2752 2773 for( UInt uiPredMode = 0; uiPredMode < 4 ; uiPredMode++ ) … … 6316 6337 } 6317 6338 6318 Dist ruiDist; 6339 #if NH_3D_VSO 6340 Dist ruiDist; 6341 #else 6342 Distortion ruiDist; 6343 #endif 6319 6344 Double rdCost; 6320 6345 #if NH_3D_VSO // M13 … … 6787 6812 6788 6813 #if NH_3D_VSO // M NEW01 6789 if ( m_pcRdCost->getUse RenModel() )6814 if ( m_pcRdCost->getUseLambdaScaleVSO() ) 6790 6815 { 6791 6816 currCompCost = m_pcRdCost->calcRdCostVSO(currCompBits, currCompDist); … … 6955 6980 6956 6981 #if NH_3D_VSO 6957 if ( m_pcRdCost->getUse RenModel() )6982 if ( m_pcRdCost->getUseLambdaScaleVSO() ) 6958 6983 { 6959 6984 dSingleCost = m_pcRdCost->calcRdCostVSO( uiSingleBits, uiSingleDist ); … … 7898 7923 7899 7924 // coarse wedge search 7900 Dist uiBestDist = RDO_DIST_MAX; 7925 #if NH_3D_VSO 7926 Dist uiBestDist = RDO_DIST_MAX; 7927 #else 7928 Distortion uiBestDist = RDO_DIST_MAX; 7929 #endif 7901 7930 UInt uiBestNodeId = 0; 7902 7931 for( UInt uiNodeId = 0; uiNodeId < pacWedgeNodeList->size(); uiNodeId++ ) … … 7908 7937 assignBiSegDCs( piPred, uiPredStride, pbPattern, uiStride, refDC1, refDC2 ); 7909 7938 7939 #if !NH_3D_VSO 7940 Distortion uiActDist = RDO_DIST_MAX; 7941 #else 7910 7942 Dist uiActDist = RDO_DIST_MAX; 7911 #if NH_3D_VSO 7943 7912 7944 if( m_pcRdCost->getUseVSO() ) 7913 7945 { … … 7935 7967 7936 7968 // refinement 7969 #if NH_3D_VSO 7937 7970 Dist uiBestDistRef = uiBestDist; 7971 #else 7972 Distortion uiBestDistRef = uiBestDist; 7973 #endif 7938 7974 UInt uiBestTabIdxRef = pacWedgeNodeList->at(uiBestNodeId).getPatternIdx(); 7939 7975 for( UInt uiRefId = 0; uiRefId < DMM_NUM_WEDGE_REFINES; uiRefId++ ) … … 7946 7982 xCalcBiSegDCs ( piRef, uiRefStride, pbPattern, uiStride, refDC1, refDC2, (1<<(bitDepthY-1)) ); 7947 7983 assignBiSegDCs( piPred, uiPredStride, pbPattern, uiStride, refDC1, refDC2 ); 7984 7985 #if !NH_3D_VSO 7986 Distortion uiActDist = RDO_DIST_MAX; 7987 #else 7948 7988 Dist uiActDist = RDO_DIST_MAX; 7949 #if NH_3D_VSO7950 7989 if( m_pcRdCost->getUseVSO() ) 7951 7990 { -
branches/HTM-16.0-dev1/source/Lib/TLibEncoder/TEncSearch.h
r1386 r1394 343 343 Void xLoadIntraResultQT ( const ComponentID compID, TComTU &rTu); 344 344 #if NH_3D_DIS 345 Void xIntraCodingDIS ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, UInt uiPredMode ); 345 #if NH_3D_VSO 346 Void xIntraCodingDIS ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, UInt uiPredMode ); 347 #else 348 Void xIntraCodingDIS ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Distortion& ruiDist, Double& dRDCost, UInt uiPredMode ); 349 #endif 346 350 #endif 347 351 … … 356 360 #endif 357 361 #if NH_3D_SDC_INTRA 358 Void xIntraCodingSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi ); 362 #if NH_3D_VSO 363 Void xIntraCodingSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist , Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi ); 364 #else 365 Void xIntraCodingSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Distortion& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi ); 366 #endif 359 367 Void xCalcConstantSDC ( Pel* ptrSrc, UInt srcStride, UInt uiSize, Pel& valDC ); 360 368 #endif -
branches/HTM-16.0-dev1/source/Lib/TLibEncoder/TEncSlice.cpp
r1386 r1394 461 461 462 462 #if NH_3D_VSO 463 m_pcRdCost->setUseLambdaScaleVSO ( (m_pcCfg->getUseVSO() || m_pcCfg->getForceLambdaScaleVSO()) && ( m_pcCfg->getIsDepth() 463 m_pcRdCost->setUseLambdaScaleVSO ( (m_pcCfg->getUseVSO() || m_pcCfg->getForceLambdaScaleVSO()) && ( m_pcCfg->getIsDepth() || m_pcCfg->getIsAuxDepth() ) ); 464 464 m_pcRdCost->setLambdaVSO ( dLambda * m_pcCfg->getLambdaScaleVSO() ); 465 465 -
branches/HTM-16.0-dev1/source/Lib/TLibEncoder/TEncTop.cpp
r1392 r1394 1666 1666 } 1667 1667 1668 rendererModel->setSingleModel( iModelNum, ppiShiftLUTLeft, ppiBaseShiftLUTLeft, ppiShiftLUTRight, ppiBaseShiftLUTRight, iDistToLeft, pcPicYuvOrgRef );1668 rendererModel->setSingleModel( iModelNum, ppiShiftLUTLeft, ppiBaseShiftLUTLeft, ppiShiftLUTRight, ppiBaseShiftLUTRight, iDistToLeft, pcPicYuvOrgRef, iEncViewSIdx ); 1669 1669 } 1670 1670 } -
branches/HTM-16.0-dev1/source/Lib/TLibRenderer/TRenFilter.cpp
r1386 r1394 36 36 #include "TRenFilter.h" 37 37 #include "TRenInterpFilter.h" 38 #if NH_3D_VSO 38 #if NH_3D_VSO || NH_3D 39 39 40 40 ///// COMMON ///// -
branches/HTM-16.0-dev1/source/Lib/TLibRenderer/TRenFilter.h
r1386 r1394 39 39 #include "TRenImage.h" 40 40 #include "TRenInterpFilter.h" 41 #if NH_3D_VSO 41 #if NH_3D_VSO || NH_3D 42 42 43 43 typedef Int (TRenInterpFilter<REN_BIT_DEPTH>::*FpChromaIntFilt) ( Pel*, Int ); -
branches/HTM-16.0-dev1/source/Lib/TLibRenderer/TRenImage.h
r1386 r1394 39 39 #include "../TLibCommon/TComPicYuv.h" 40 40 #include "TRenImagePlane.h" 41 #if NH_3D_VSO 41 #if NH_3D_VSO || NH_3D 42 42 43 43 -
branches/HTM-16.0-dev1/source/Lib/TLibRenderer/TRenImagePlane.cpp
r1386 r1394 36 36 #include "TRenFilter.h" 37 37 #include <string.h> 38 #if NH_3D_VSO 38 #if NH_3D_VSO || NH_3D 39 39 40 40 /////// TRenImagePlane /////// -
branches/HTM-16.0-dev1/source/Lib/TLibRenderer/TRenImagePlane.h
r1386 r1394 39 39 #include "../TLibCommon/TComPicYuv.h" 40 40 41 #if NH_3D_VSO 41 #if NH_3D_VSO || NH_3D 42 42 #define PelImagePlane TRenImagePlane<Pel> 43 43 #define DoubleImagePlane TRenImagePlane<Double> -
branches/HTM-16.0-dev1/source/Lib/TLibRenderer/TRenInterpFilter.cpp
r1386 r1394 39 39 40 40 #include "TRenInterpFilter.h" 41 #if NH_3D_VSO 41 #if NH_3D_VSO || NH_3D 42 42 43 43 // ==================================================================================================================== -
branches/HTM-16.0-dev1/source/Lib/TLibRenderer/TRenInterpFilter.h
r1386 r1394 44 44 #include "TLibCommon/CommonDef.h" 45 45 #include "assert.h" 46 #if NH_3D_VSO 46 #if NH_3D_VSO || NH_3D 47 47 48 48 // ==================================================================================================================== -
branches/HTM-16.0-dev1/source/Lib/TLibRenderer/TRenModel.cpp
r1313 r1394 216 216 Void 217 217 #if H_3D_VSO_EARLY_SKIP 218 TRenModel::create( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin, Bool b EarlySkip )218 TRenModel::create( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin, Bool bLimOutput, Bool bEarlySkip ) 219 219 #else 220 TRenModel::create( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin ) 221 #endif 222 { 220 TRenModel::create( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin, Bool bLimOutput ) 221 #endif 222 { 223 m_bLimOutput = bLimOutput; 224 223 225 m_iNumOfBaseViews = iNumOfBaseViews; 224 226 m_iNumOfRenModels = iNumOfModels; … … 416 418 417 419 #if H_3D_VSO_EARLY_SKIP 418 m_apcRenModels[iModelNum]->create( iMode ,m_iWidth, m_iHeight, m_iShiftPrec, m_aaaiSubPelShiftLut, m_iHoleMargin, bUseOrgRef, iBlendMode, m_bEarlySkip ); 420 #if RM_INIT_FIX 421 m_apcRenModels[iModelNum]->create( iMode ,m_iWidth, m_iHeight, m_iShiftPrec, m_aaaiSubPelShiftLut, m_iHoleMargin, bUseOrgRef, ( iMode != 2 ) ? BLEND_NONE : iBlendMode , m_bLimOutput, m_bEarlySkip ); 419 422 #else 420 m_apcRenModels[iModelNum]->create( iMode ,m_iWidth, m_iHeight, m_iShiftPrec, m_aaaiSubPelShiftLut, m_iHoleMargin, bUseOrgRef, iBlendMode ); 423 m_apcRenModels[iModelNum]->create( iMode ,m_iWidth, m_iHeight, m_iShiftPrec, m_aaaiSubPelShiftLut, m_iHoleMargin, bUseOrgRef, iBlendMode, m_bLimOutput, m_bEarlySkip ); 424 #endif 425 426 #else 427 428 #if RM_INIT_FIX 429 m_apcRenModels[iModelNum]->create( iMode ,m_iWidth, m_iHeight, m_iShiftPrec, m_aaaiSubPelShiftLut, m_iHoleMargin, bUseOrgRef, ( iMode != 2 ) ? BLEND_NONE : iBlendMode, m_bLimOutput ); 430 #else 431 m_apcRenModels[iModelNum]->create( iMode ,m_iWidth, m_iHeight, m_iShiftPrec, m_aaaiSubPelShiftLut, m_iHoleMargin, bUseOrgRef, iBlendMode, m_bLimOutput ); 432 #endif 421 433 #endif 422 434 … … 470 482 471 483 Void 472 TRenModel::setSingleModel( Int iModelNum, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, TComPicYuv* pcPicYuvRefView 484 TRenModel::setSingleModel( Int iModelNum, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, TComPicYuv* pcPicYuvRefView, Int iEncViewSIdx) 473 485 { 474 486 AOT( iModelNum < 0 || iModelNum > m_iNumOfRenModels ); … … 486 498 if ( m_aaeBaseViewPosInModel[iBaseViewIdx][iModelNum] != VIEWPOS_INVALID ) 487 499 { 488 bAnyRefFromOrg = true;489 500 m_apcRenModels[iModelNum]->setLRView( m_aaeBaseViewPosInModel[iBaseViewIdx][iModelNum], 490 501 ( bSetupFromOrgVideo ? m_aapiOrgVideoPel : m_aapiCurVideoPel ) [iBaseViewIdx], … … 495 506 } 496 507 497 m_apcRenModels[iModelNum]->setup ( pcPicYuvRefView, ppiShiftLutLeft, ppiBaseShiftLutLeft, ppiShiftLutRight, ppiBaseShiftLutRight, iDistToLeft, false ); 498 499 // Setup to Org 500 if ( bAnyRefFromOrg ) 501 { 502 // Restore old values 508 // Render 509 #if !RM_FIX_SETUP 510 m_apcRenModels[iModelNum]->setupLutAndRef( pcPicYuvRefView, ppiShiftLutLeft, ppiBaseShiftLutLeft, ppiShiftLutRight, ppiBaseShiftLutRight, iDistToLeft, bAnyRefFromOrg ); 511 512 // Setup with actual data 503 513 for (Int iBaseViewIdx = 0; iBaseViewIdx < m_iNumOfBaseViews; iBaseViewIdx++ ) 504 514 { … … 514 524 } 515 525 } 516 517 // setup keeping reference rendered from original data 518 m_apcRenModels[iModelNum]->setup ( pcPicYuvRefView, ppiShiftLutLeft, ppiBaseShiftLutLeft, ppiShiftLutRight, ppiBaseShiftLutRight, iDistToLeft, true ); 519 } 526 // Render initial state 527 AOT( m_bLimOutput && m_aaeBaseViewPosInModel[ iEncViewSIdx ][iModelNum] == VIEWPOS_INVALID ); 528 m_apcRenModels[iModelNum]->setupInitialState( m_bLimOutput ? m_aaeBaseViewPosInModel[ iEncViewSIdx ][iModelNum] : VIEWPOS_INVALID ); 529 530 #else 531 m_apcRenModels[iModelNum]->setupLut( ppiShiftLutLeft, ppiBaseShiftLutLeft, ppiShiftLutRight, ppiBaseShiftLutRight, iDistToLeft ); 532 533 // Copy yuv to reference if given. 534 AOT( pcPicYuvRefView != NULL && bAnyRefFromOrg ); 535 536 if (pcPicYuvRefView ) 537 { 538 m_apcRenModels[iModelNum]->setupRefView( pcPicYuvRefView ); 539 } 540 541 m_apcRenModels[iModelNum]->renderAll( ); 542 543 // pcPicYuvRefView != NULL && bAnyRefFromOrg --> invalid combination 544 // pcPicYuvRefView != NULL && !bAnyRefFromOrg --> distortion correct; reference view correct; current view correct 545 // pcPicYuvRefView == NULL && bAnyRefFromOrg --> distortion TBD ; reference view TBD ; current view TBD 546 // pcPicYuvRefView == NULL && !bAnyRefFromOrg --> distortion TBD ; reference view TBD ; current view correct 547 548 if ( pcPicYuvRefView == NULL ) 549 { 550 // Update reference view 551 m_apcRenModels[iModelNum]->setStructSynthViewAsRefView(); 552 553 // pcPicYuvRefView != NULL && bAnyRefFromOrg --> invalid combination 554 // pcPicYuvRefView != NULL && !bAnyRefFromOrg --> distortion correct; reference view correct; current view correct 555 // pcPicYuvRefView == NULL && bAnyRefFromOrg --> distortion TBD ; reference view correct; current view TBD 556 // pcPicYuvRefView == NULL && !bAnyRefFromOrg --> distortion TBD ; reference view correct; current view correct 557 558 if ( bAnyRefFromOrg ) 559 { 560 // Update current view and distortion 561 for (Int iBaseViewIdx = 0; iBaseViewIdx < m_iNumOfBaseViews; iBaseViewIdx++ ) 562 { 563 if ( m_aaeBaseViewPosInModel[iBaseViewIdx][iModelNum] != VIEWPOS_INVALID ) 564 { 565 m_apcRenModels[iModelNum]->setLRView( 566 m_aaeBaseViewPosInModel[iBaseViewIdx][iModelNum], 567 m_aapiCurVideoPel [iBaseViewIdx], 568 m_aaiCurVideoStrides [iBaseViewIdx], 569 m_apiCurDepthPel [iBaseViewIdx], 570 m_aiCurDepthStrides [iBaseViewIdx] 571 ); 572 } 573 } 574 m_apcRenModels[iModelNum]->renderAll( ); 575 } 576 else 577 { 578 // Update to distortion 579 m_apcRenModels[iModelNum]->resetStructError(); 580 } 581 } 582 583 if ( m_bLimOutput ) 584 { 585 AOT( m_aaeBaseViewPosInModel[ iEncViewSIdx ][iModelNum] == VIEWPOS_INVALID ); 586 Int curViewPosInModel = m_aaeBaseViewPosInModel[ iEncViewSIdx ][iModelNum]; 587 m_apcRenModels[iModelNum]->setLimOutStruct( (curViewPosInModel == VIEWPOS_RIGHT) ? VIEWPOS_LEFT : VIEWPOS_RIGHT ); 588 } 589 #endif 520 590 } 521 591 … … 549 619 TRenModel::setupPart ( UInt uiHorOff, Int iUsedHeight ) 550 620 { 551 AOT( iUsedHeight > m_iHeight );621 // AOT( iUsedHeight > m_iHeight ); 552 622 m_uiHorOff = uiHorOff; 553 623 m_iUsedHeight = iUsedHeight; … … 589 659 } 590 660 } 591 592 return ( iDist + (m_iNumOfCurRenModels >> 1) ) / m_iNumOfCurRenModels; 661 return m_iNumOfCurRenModels > 0 ? ( iDist + (m_iNumOfCurRenModels >> 1) ) / m_iNumOfCurRenModels : 0; 593 662 } 594 663 -
branches/HTM-16.0-dev1/source/Lib/TLibRenderer/TRenModel.h
r1313 r1394 53 53 // Creation 54 54 #if H_3D_VSO_EARLY_SKIP 55 Void create ( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin, Bool b EarlySkip );55 Void create ( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin, Bool bLimOutput, Bool bEarlySkip ); 56 56 #else 57 Void create ( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin );57 Void create ( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin, Bool bLimOutput ); 58 58 #endif 59 59 Void createSingleModel( Int iBaseViewNum, Int iContent, Int iModelNum, Int iLeftViewNum, Int iRightViewNum, Bool bUseOrgRef, Int iBlendMode ); … … 61 61 // Set new Frame 62 62 Void setBaseView ( Int iViewNum, TComPicYuv* pcPicYuvVideoData, TComPicYuv* pcPicYuvDepthData, TComPicYuv* pcPicYuvOrgVideoData, TComPicYuv* pcPicYuvOrgDepthData ); 63 Void setSingleModel ( Int iModelNum, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, TComPicYuv* pcPicYuvRefView );63 Void setSingleModel ( Int iModelNum, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, TComPicYuv* pcPicYuvRefView, Int curViewIdx = VIEWPOS_INVALID ); 64 64 65 65 // Set horizontal offset … … 96 96 Bool m_bEarlySkip; 97 97 #endif 98 Bool m_bLimOutput; 98 99 99 100 /// Size of Video and Depth -
branches/HTM-16.0-dev1/source/Lib/TLibRenderer/TRenSingleModel.cpp
r1313 r1394 56 56 57 57 m_pcOutputSamples = NULL; 58 m_pcOutputSamplesRow = NULL; 58 m_pcOutputSamplesRow = NULL; 59 59 m_iOutputSamplesStride = -1; 60 60 … … 106 106 if ( m_pcOutputSamples ) delete[] m_pcOutputSamples ; 107 107 108 if ( m_piInvZLUTLeft ) delete[] m_piInvZLUTLeft ;109 if ( m_piInvZLUTRight ) delete[] m_piInvZLUTRight;108 if ( m_piInvZLUTLeft ) delete[] m_piInvZLUTLeft ; 109 if ( m_piInvZLUTRight ) delete[] m_piInvZLUTRight; 110 110 111 111 if ( m_aapiRefVideoPel[0] ) delete[] ( m_aapiRefVideoPel[0] - ( m_aiRefVideoStrides[0] * m_iPad + m_iPad ) ); … … 116 116 template <BlenMod iBM, Bool bBitInc> Void 117 117 #if H_3D_VSO_EARLY_SKIP 118 TRenSingleModelC<iBM,bBitInc>::create( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bEarlySkip ) 119 #else 120 TRenSingleModelC<iBM,bBitInc>::create( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode ) 121 #endif 122 123 { 118 TRenSingleModelC<iBM,bBitInc>::create( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bLimOutput, Bool bEarlySkip ) 119 #else 120 TRenSingleModelC<iBM,bBitInc>::create( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bLimOutput ) 121 #endif 122 123 { 124 m_bLimOutput = bLimOutput; 124 125 #if H_3D_VSO_EARLY_SKIP 125 126 m_pbHorSkip = new Bool [MAX_CU_SIZE]; … … 127 128 #endif 128 129 129 AOF( iBlendMode == iBM ); 130 130 AOF( ( iBlendMode == iBM ) || ( iBM == BLEND_NONE ) ); 131 131 m_iMode = iMode; 132 132 … … 171 171 m_pcInputSamples[1] = new RenModelInPels[m_iInputSamplesStride*m_iHeight]; 172 172 173 m_pcOutputSamples = new RenModelOutPels[m_iOutputSamplesStride*m_iHeight]; 173 m_pcOutputSamples = new RenModelOutPels [m_iOutputSamplesStride*m_iHeight]; 174 m_pcLimOutputSamples = m_bLimOutput ? new RenModelLimOutPels[m_iOutputSamplesStride*m_iHeight] : NULL; 174 175 } 175 176 … … 244 245 } 245 246 246 template <BlenMod iBM, Bool bBitInc> Void 247 TRenSingleModelC<iBM,bBitInc>::setup( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bKeepReference ) 248 { 247 248 #if !RM_FIX_SETUP 249 template <BlenMod iBM, Bool bBitInc> Void 250 TRenSingleModelC<iBM,bBitInc>::setupInitialState( Int curViewPosInModel ) 251 { 252 xRenderAll( ); 253 254 if ( m_bLimOutput ) 255 { 256 AOT( curViewPosInModel == VIEWPOS_INVALID ) 257 xSetLimOutStruct( (curViewPosInModel == VIEWPOS_RIGHT) ? VIEWPOS_LEFT : VIEWPOS_RIGHT ); 258 } 259 } 260 #endif 261 262 #if RM_FIX_SETUP 263 template <BlenMod iBM, Bool bBitInc> Void 264 TRenSingleModelC<iBM,bBitInc>::setupRefView ( TComPicYuv* pcOrgVideo ) 265 { 266 m_pcPicYuvRef = pcOrgVideo; 267 // Use provided ref view reference 268 269 TRenFilter<REN_BIT_DEPTH>::copy( pcOrgVideo->getAddr( COMPONENT_Y ) + m_iHorOffset * pcOrgVideo->getStride( COMPONENT_Y ), pcOrgVideo->getStride( COMPONENT_Y ), m_iWidth, m_iUsedHeight, m_aapiRefVideoPel[0], m_aiRefVideoStrides[0]); 270 switch ( pcOrgVideo->getChromaFormat() ) 271 { 272 case CHROMA_420: 273 TRenFilter<REN_BIT_DEPTH>::sampleCUpHorUp(0, pcOrgVideo->getAddr( COMPONENT_Cb ) + (m_iHorOffset >> 1) * pcOrgVideo->getStride( COMPONENT_Cb ), pcOrgVideo->getStride( COMPONENT_Cb ), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiRefVideoPel[1], m_aiRefVideoStrides[1]); 274 TRenFilter<REN_BIT_DEPTH>::sampleCUpHorUp(0, pcOrgVideo->getAddr( COMPONENT_Cr ) + (m_iHorOffset >> 1) * pcOrgVideo->getStride( COMPONENT_Cr ), pcOrgVideo->getStride( COMPONENT_Cr ), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiRefVideoPel[2], m_aiRefVideoStrides[2]); 275 break; 276 case CHROMA_444: 277 TRenFilter<REN_BIT_DEPTH>::copy( pcOrgVideo->getAddr( COMPONENT_Cb ) + m_iHorOffset * pcOrgVideo->getStride( COMPONENT_Cb ), pcOrgVideo->getStride( COMPONENT_Cb ), m_iWidth, m_iUsedHeight, m_aapiRefVideoPel[1], m_aiRefVideoStrides[1]); 278 TRenFilter<REN_BIT_DEPTH>::copy( pcOrgVideo->getAddr( COMPONENT_Cr ) + m_iHorOffset * pcOrgVideo->getStride( COMPONENT_Cr ), pcOrgVideo->getStride( COMPONENT_Cr ), m_iWidth, m_iUsedHeight, m_aapiRefVideoPel[2], m_aiRefVideoStrides[2]); 279 break; 280 default: 281 break; 282 } 283 xSetStructRefView(); 284 } 285 286 287 template <BlenMod iBM, Bool bBitInc> Void 288 TRenSingleModelC<iBM,bBitInc>::setupLut( Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft ) 289 #else 290 template <BlenMod iBM, Bool bBitInc> Void 291 TRenSingleModelC<iBM,bBitInc>::setupLutAndRef( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bRenderRef ) 292 #endif 293 { 294 #if !RM_FIX_SETUP 249 295 AOT( !m_bUseOrgRef && pcOrgVideo ); 296 #endif 250 297 AOT( (ppiShiftLutLeft == NULL) && (m_iMode == 0 || m_iMode == 2) ); 251 298 AOT( (ppiShiftLutRight == NULL) && (m_iMode == 1 || m_iMode == 2) ); … … 254 301 m_appiShiftLut[1] = ppiShiftLutRight; 255 302 303 304 if ( m_iMode == 2 ) 305 { 306 TRenFilter<REN_BIT_DEPTH>::setupZLUT( true, 30, iDistToLeft, ppiBaseShiftLutLeft, ppiBaseShiftLutRight, m_iBlendZThres, m_iBlendDistWeight, m_piInvZLUTLeft, m_piInvZLUTRight ); 307 } 308 309 #if !RM_FIX_SETUP 256 310 // Copy Reference 257 311 m_pcPicYuvRef = pcOrgVideo; 258 312 259 if ( pcOrgVideo && !bKeepReference)260 { 261 assert( pcOrgVideo->getChromaFormat() != CHROMA_420 );313 if ( pcOrgVideo ) 314 { 315 assert( pcOrgVideo->getChromaFormat() == CHROMA_420 ); 262 316 263 317 TRenFilter<REN_BIT_DEPTH>::copy( pcOrgVideo->getAddr( COMPONENT_Y ) + m_iHorOffset * pcOrgVideo->getStride( COMPONENT_Y ), pcOrgVideo->getStride( COMPONENT_Y ), m_iWidth, m_iUsedHeight, m_aapiRefVideoPel[0], m_aiRefVideoStrides[0]); … … 266 320 xSetStructRefView(); 267 321 } 268 322 else 323 { 324 if ( bRenderRef ) 325 { 326 xRenderAll( ); 327 xSetStructSynthViewAsRefView(); 328 } 329 } 330 #endif 331 } 332 333 template <BlenMod iBM, Bool bBitInc> Void 334 #if RM_FIX_SETUP 335 TRenSingleModelC<iBM,bBitInc>::renderAll( ) 336 #else 337 TRenSingleModelC<iBM,bBitInc>::xRenderAll( ) 338 #endif 339 { 269 340 // Initial Rendering 341 #if RM_FIX_SETUP 342 resetStructError(); 343 #else 270 344 xResetStructError(); 345 #endif 271 346 xInitSampleStructs(); 272 347 switch ( m_iMode ) … … 274 349 case 0: 275 350 #if H_3D_VSO_EARLY_SKIP 276 xRender L<true>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0],false );277 #else 278 xRender L<true>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0] );351 xRender<true, SET_FULL>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0],false ); 352 #else 353 xRender<true, SET_FULL>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0] ); 279 354 #endif 280 355 break; 281 356 case 1: 282 357 #if H_3D_VSO_EARLY_SKIP 283 xRender R<true>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1],false);284 #else 285 xRender R<true>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1] );358 xRender<false, SET_FULL>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1],false); 359 #else 360 xRender<false, SET_FULL>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1] ); 286 361 #endif 287 362 break; 288 363 case 2: 289 TRenFilter<REN_BIT_DEPTH>::setupZLUT( true, 30, iDistToLeft, ppiBaseShiftLutLeft, ppiBaseShiftLutRight, m_iBlendZThres, m_iBlendDistWeight, m_piInvZLUTLeft, m_piInvZLUTRight ); 290 #if H_3D_VSO_EARLY_SKIP 291 xRenderL<true>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0],false); 292 xRenderR<true>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1],false); 364 #if H_3D_VSO_EARLY_SKIP 365 xRender<true , SET_FULL>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0],false); 366 xRender<false, SET_FULL>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1],false); 293 367 #else 294 xRender L<true>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0] );295 xRender R<true>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1] );368 xRender<true, SET_FULL>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0] ); 369 xRender<false, SET_FULL>( 0, 0, m_iWidth, m_iUsedHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1] ); 296 370 #endif 297 371 break; … … 299 373 AOT(true); 300 374 } 301 302 // Get Rendered View as Reference303 if ( !pcOrgVideo && !bKeepReference )304 {305 xResetStructError();306 xSetStructSynthViewAsRefView();307 }308 375 } 309 376 … … 317 384 switch ( iViewNum ) 318 385 { 386 387 case -1: 388 rpiSrcY = &RenModelOutPels::iYRef; 389 #if H_3D_VSO_COLOR_PLANES 390 rpiSrcU = &RenModelOutPels::iURef; 391 rpiSrcV = &RenModelOutPels::iVRef; 392 #endif 393 break; 319 394 case 0: 320 395 rpiSrcY = &RenModelOutPels::iYLeft; … … 349 424 } 350 425 426 template <BlenMod iBM, Bool bBitInc> Void 427 TRenSingleModelC<iBM,bBitInc>::xGetSampleStrFilledPtrs( Int iViewNum, Int RenModelOutPels::*& rpiSrcFilled ) 428 { 429 AOT(iViewNum != 0 && iViewNum != 1); 430 rpiSrcFilled = (iViewNum == 1) ? &RenModelOutPels::iFilledRight : &RenModelOutPels::iFilledLeft; 431 } 432 351 433 352 434 template <BlenMod iBM, Bool bBitInc> Void … … 383 465 384 466 template <BlenMod iBM, Bool bBitInc> Void 467 #if RM_FIX_SETUP 468 TRenSingleModelC<iBM,bBitInc>::resetStructError( ) 469 #else 385 470 TRenSingleModelC<iBM,bBitInc>::xResetStructError( ) 471 #endif 386 472 { 387 473 RenModelOutPels* pcCurOutSampleRow = m_pcOutputSamples; … … 398 484 399 485 template <BlenMod iBM, Bool bBitInc> Void 486 #if RM_FIX_SETUP 487 TRenSingleModelC<iBM,bBitInc>::setLimOutStruct(Int iSourceViewPos ) 488 #else 489 TRenSingleModelC<iBM,bBitInc>::xSetLimOutStruct(Int iSourceViewPos ) 490 #endif 491 { 492 RM_AOF( m_bLimOutput ); 493 RM_AOT( iSourceViewPos < 0 || iSourceViewPos > 1); 494 495 RenModelOutPels* pcCurOutSampleRow = m_pcOutputSamples; 496 RenModelLimOutPels* pcCurLimOutSampleRow = m_pcLimOutputSamples; 497 498 Int RenModelOutPels::* piFilled = NULL; 499 xGetSampleStrFilledPtrs( iSourceViewPos, piFilled ); 500 501 Pel RenModelOutPels::* piDepth = NULL; 502 xGetSampleStrDepthPtrs ( iSourceViewPos, piDepth ); 503 504 Pel RenModelOutPels::* piSrcY = NULL; 505 506 #if H_3D_VSO_COLOR_PLANES 507 Pel RenModelOutPels::* piSrcU = NULL; 508 Pel RenModelOutPels::* piSrcV = NULL; 509 xGetSampleStrTextPtrs ( iSourceViewPos, piSrcY, piSrcU, piSrcV ); 510 #else 511 xGetSampleStrTextPtrs ( iSourceViewPos, piSrcY ); 512 #endif 513 514 for ( Int iPosY = 0; iPosY < m_iUsedHeight; iPosY++ ) 515 { 516 for ( Int iPosX = 0; iPosX < m_iWidth; iPosX++ ) 517 { 518 pcCurLimOutSampleRow[iPosX].iYOther = pcCurOutSampleRow[iPosX].*piSrcY; 519 pcCurLimOutSampleRow[iPosX].iYRef = pcCurOutSampleRow[iPosX].iYRef; 520 521 #if H_3D_VSO_COLOR_PLANES 522 pcCurLimOutSampleRow[iPosX].iUOther = pcCurOutSampleRow[iPosX].*piSrcU; 523 pcCurLimOutSampleRow[iPosX].iURef = pcCurOutSampleRow[iPosX].iURef; 524 525 pcCurLimOutSampleRow[iPosX].iVOther = pcCurOutSampleRow[iPosX].*piSrcV; 526 pcCurLimOutSampleRow[iPosX].iVRef = pcCurOutSampleRow[iPosX].iVRef; 527 #endif 528 pcCurLimOutSampleRow[iPosX].iDOther = pcCurOutSampleRow[iPosX].*piDepth; 529 pcCurLimOutSampleRow[iPosX].iFilledOther = pcCurOutSampleRow[iPosX].*piFilled; 530 pcCurLimOutSampleRow[iPosX].iError = pcCurOutSampleRow[iPosX].iError; 531 532 } 533 pcCurOutSampleRow += m_iOutputSamplesStride; 534 pcCurLimOutSampleRow += m_iOutputSamplesStride; 535 } 536 } 537 538 template <BlenMod iBM, Bool bBitInc> Void 539 #if RM_FIX_SETUP 540 TRenSingleModelC<iBM,bBitInc>::setStructSynthViewAsRefView( ) 541 #else 400 542 TRenSingleModelC<iBM,bBitInc>::xSetStructSynthViewAsRefView( ) 543 #endif 401 544 { 402 545 AOT( m_iMode < 0 || m_iMode > 2); … … 447 590 pcOutSampleRow[iPosX].iDRight = 0; 448 591 pcOutSampleRow[iPosX].iDBlended = 0; 592 pcOutSampleRow[iPosX].iError = 0; 449 593 450 594 // Y Planes … … 463 607 pcOutSampleRow[iPosX].iVBlended = 1 << (REN_BIT_DEPTH - 1); 464 608 #endif 465 466 pcLeftInSampleRow [iPosX]. bOccluded = false;467 pcRightInSampleRow[iPosX]. bOccluded = false;609 //// Input Samples 610 pcLeftInSampleRow [iPosX].aiOccludedPos = MAX_INT; 611 pcRightInSampleRow[iPosX].aiOccludedPos = MIN_INT; 468 612 } 469 613 … … 491 635 case 0: 492 636 #if H_3D_VSO_EARLY_SKIP 493 bEarlySkip = m_bEarlySkip ? xDetectEarlySkip L(iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData, piOrgData, iOrgStride) : false;637 bEarlySkip = m_bEarlySkip ? xDetectEarlySkip<true>(iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData, piOrgData, iOrgStride) : false; 494 638 if( !bEarlySkip ) 495 639 { 496 iSSE = xRender L<false>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData,true );640 iSSE = xRender<true, GET_SIMP>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData,true ); 497 641 } 498 642 #else 499 iSSE = xRender L<false>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData );643 iSSE = xRender<true, GET_SIMP>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData ); 500 644 #endif 501 645 break; 502 646 case 1: 503 647 #if H_3D_VSO_EARLY_SKIP 504 bEarlySkip = m_bEarlySkip ? xDetectEarlySkip R(iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData, piOrgData, iOrgStride) : false;648 bEarlySkip = m_bEarlySkip ? xDetectEarlySkip<false>(iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData, piOrgData, iOrgStride) : false; 505 649 if( !bEarlySkip ) 506 650 { 507 iSSE = xRender R<false>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData,true );651 iSSE = xRender<false, GET_SIMP>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData,true ); 508 652 } 509 653 #else 510 iSSE = xRender R<false>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData );654 iSSE = xRender<false, GET_SIMP>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData ); 511 655 #endif 512 656 break; … … 525 669 #endif 526 670 { 527 #if defH_3D_VSO_EARLY_SKIP671 #if H_3D_VSO_EARLY_SKIP 528 672 Bool bEarlySkip; 529 673 #endif … … 532 676 case 0: 533 677 #if H_3D_VSO_EARLY_SKIP 534 bEarlySkip = m_bEarlySkip ? xDetectEarlySkip L(iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData, piOrgData,iOrgStride) : false;678 bEarlySkip = m_bEarlySkip ? xDetectEarlySkip<true>(iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData, piOrgData,iOrgStride) : false; 535 679 if( !bEarlySkip ) 536 680 { 537 xRender L<true>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData,true );681 xRender<true, SET_SIMP>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData,true ); 538 682 } 539 683 #else 540 xRender L<true>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData );684 xRender<true, SET_SIMP>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData ); 541 685 #endif 542 686 break; 543 687 case 1: 544 688 #if H_3D_VSO_EARLY_SKIP 545 bEarlySkip = m_bEarlySkip ? xDetectEarlySkip R(iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData, piOrgData,iOrgStride) : false;689 bEarlySkip = m_bEarlySkip ? xDetectEarlySkip<false>(iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData, piOrgData,iOrgStride) : false; 546 690 if( !bEarlySkip ) 547 691 { 548 xRender R<true>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData,true );692 xRender<false, SET_SIMP>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData,true ); 549 693 } 550 694 #else 551 xRender R<true>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData );695 xRender<false, SET_SIMP>( iStartPosX, iStartPosY, iWidth, iHeight, iStride, piNewData ); 552 696 #endif 553 697 break; … … 585 729 Pel RenModelOutPels::* piY; 586 730 xGetSampleStrTextPtrs(iViewPos, piY); 587 xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piY, pcPicYuv->get LumaAddr() + m_iHorOffset * pcPicYuv->getStride(), pcPicYuv->getStride(), m_iWidth, m_iUsedHeight );588 pcPicYuv->setChromaTo( 1 << ( g_bitDepthC- 1) );731 xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piY, pcPicYuv->getAddr(COMPONENT_Y) + m_iHorOffset * pcPicYuv->getStride(COMPONENT_Y), pcPicYuv->getStride(COMPONENT_Y), m_iWidth, m_iUsedHeight ); 732 pcPicYuv->setChromaTo( 1 << (REN_BIT_DEPTH - 1) ); 589 733 #endif 590 734 } … … 633 777 xCopy2PicYuv( apiData, aiStrides, pcPicYuv ); 634 778 #else 635 xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, &RenModelOutPels::iYRef, pcPicYuv->get LumaAddr() * pcPicYuv->getStride() + m_iHorOffset, pcPicYuv->getStride(), m_iWidth, m_iUsedHeight );636 pcPicYuv->setChromaTo( 1 << ( g_bitDepthC- 1 ) );779 xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, &RenModelOutPels::iYRef, pcPicYuv->getAddr(COMPONENT_Y), pcPicYuv->getStride(COMPONENT_Y), m_iWidth, m_iUsedHeight ); 780 pcPicYuv->setChromaTo( 1 << ( REN_BIT_DEPTH - 1 ) ); 637 781 #endif 638 782 } … … 653 797 654 798 655 template <BlenMod iBM, Bool bBitInc> __inline Void799 template <BlenMod iBM, Bool bBitInc> template<SetMod bSM> __inline Void 656 800 TRenSingleModelC<iBM,bBitInc>::xSetViewRow( Int iPosY ) 657 801 { 658 802 m_pcInputSamplesRow[0] = m_pcInputSamples[0] + m_iInputSamplesStride * iPosY; 659 803 m_pcInputSamplesRow[1] = m_pcInputSamples[1] + m_iInputSamplesStride * iPosY; 660 m_pcOutputSamplesRow = m_pcOutputSamples + m_iOutputSamplesStride * iPosY; 661 662 } 663 664 template <BlenMod iBM, Bool bBitInc> __inline Void 804 if (bSM == SET_FULL || bSM == GET_FULL ) 805 { 806 m_pcOutputSamplesRow = m_pcOutputSamples + m_iOutputSamplesStride * iPosY; 807 } 808 else 809 { 810 m_pcLimOutputSamplesRow = m_pcLimOutputSamples + m_iOutputSamplesStride * iPosY; 811 } 812 } 813 814 template <BlenMod iBM, Bool bBitInc> template<SetMod bSM> __inline Void 665 815 TRenSingleModelC<iBM,bBitInc>::xIncViewRow( ) 666 816 { 667 817 m_pcInputSamplesRow[0] += m_iInputSamplesStride ; 668 818 m_pcInputSamplesRow[1] += m_iInputSamplesStride ; 669 m_pcOutputSamplesRow += m_iOutputSamplesStride; 670 } 671 #if H_3D_VSO_EARLY_SKIP 672 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline RMDist 673 TRenSingleModelC<iBM,bBitInc>::xRenderL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, Bool bFast) 674 #else 675 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline RMDist 676 TRenSingleModelC<iBM,bBitInc>::xRenderL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData) 819 820 if (bSM == SET_FULL || bSM == GET_FULL ) 821 { 822 m_pcOutputSamplesRow += m_iOutputSamplesStride; 823 } 824 else 825 { 826 m_pcLimOutputSamplesRow += m_iOutputSamplesStride; 827 } 828 } 829 #if H_3D_VSO_EARLY_SKIP 830 template <BlenMod iBM, Bool bBitInc> template<SetMod bSM> __inline RMDist 831 TRenSingleModelC<iBM,bBitInc>::xGetSSE( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, Bool bFast) 832 #else 833 template <BlenMod iBM, Bool bBitInc> template<SetMod bSM> __inline RMDist 834 TRenSingleModelC<iBM,bBitInc>::xGetSSE( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData) 677 835 #endif 678 836 { … … 680 838 const Int iOtherViewPos = 1; 681 839 682 m_iCurViewPos = iCurViewPos ; 683 m_iOtherViewPos = iOtherViewPos; 840 m_piNewDepthData = piNewData; 841 m_iNewDataWidth = iWidth; 842 m_iStartChangePosX = iStartPosX; 843 844 if ((iWidth == 0) || (iHeight == 0)) 845 return 0; 846 847 xSetViewRow<bSM> ( iStartPosY); 848 849 // Init Start 850 RMDist iError = 0; 851 Int iStartChangePos = m_iStartChangePosX; 852 Int iEndChangePos = m_iStartChangePosX + iWidth - 1; 853 854 for (Int iPosY = iStartPosY; iPosY < iStartPosY + iHeight; iPosY++ ) 855 { 856 Int iPosXinNewData = iWidth - 1; 857 for ( Int iCurPosX = iEndChangePos; iCurPosX >= iStartChangePos; iCurPosX-- ) 858 { 859 Int iCurDepth = m_piNewDepthData[iPosXinNewData]; 860 Int iOldDepth = m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD; 861 Int iDiff = (iCurDepth - iOldDepth); 862 iError += iDiff * iDiff; 863 iPosXinNewData--; 864 } 865 xIncViewRow<bSM>(); 866 m_piNewDepthData += iStride; 867 } 868 return iError; 869 } 870 871 #if H_3D_VSO_EARLY_SKIP 872 template <BlenMod iBM, Bool bBitInc> template<Bool bL, SetMod bSM> __inline RMDist 873 TRenSingleModelC<iBM,bBitInc>::xRender( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, Bool bFast) 874 #else 875 template <BlenMod iBM, Bool bBitInc> template<Bool bL, SetMod bSM> __inline RMDist 876 TRenSingleModelC<iBM,bBitInc>::xRender( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData) 877 #endif 878 { 879 const Int iCurViewPos = bL ? 0 : 1; 684 880 685 881 m_piNewDepthData = piNewData; … … 688 884 689 885 if ((iWidth == 0) || (iHeight == 0)) 886 { 690 887 return 0; 888 } 691 889 692 890 // Get Data 693 891 m_ppiCurLUT = m_appiShiftLut [iCurViewPos]; 694 xSetViewRow 892 xSetViewRow<bSM>( iStartPosY); 695 893 696 894 // Init Start … … 698 896 Int iStartChangePos; 699 897 700 iStartChangePos = m_iStartChangePosX ;898 iStartChangePos = m_iStartChangePosX + ( bL ? 0 : (iWidth - 1)); 701 899 702 900 for (Int iPosY = iStartPosY; iPosY < iStartPosY + iHeight; iPosY++ ) … … 707 905 if ( m_pbHorSkip[iPosY-iStartPosY] ) 708 906 { 709 xIncViewRow ();907 xIncViewRow<bSM>(); 710 908 m_piNewDepthData += iStride; 711 909 continue; … … 716 914 717 915 Int iLastSPos; 718 Int iEndChangePos = m_iStartChangePosX + iWidth - 1; 719 Int iPosXinNewData = iWidth - 1; 720 Int iMinChangedSPos = m_iSampledWidth; 721 722 if ( iEndChangePos == ( m_iWidth -1 )) // Special processing for rightmost depth sample 916 Int iEndChangePos = m_iStartChangePosX + ( bL ? (iWidth - 1) : 0 ) ; 917 918 Int iEndChangePosInSubPel = iEndChangePos << m_iShiftPrec; 919 Int iPosXinNewData = bL ? iWidth - 1 : 0; 920 Int iMinChangedSPos = bL ? m_iSampledWidth : -1; 921 if ( iEndChangePos == xWidthMinus1<bL>() ) 723 922 { 724 923 m_iCurDepth = m_piNewDepthData[iPosXinNewData]; 725 Int iCurSPos = xShiftNewData(iEndChangePos, iPosXinNewData); 726 m_iLastOccludedSPos = iCurSPos + 1; 727 m_iLastOccludedSPosFP = xRangeLeftL( m_iLastOccludedSPos ); 728 xExtrapolateMarginL<bSet> ( iCurSPos, iEndChangePos, iError ); 729 730 iMinChangedSPos = std::min( iMinChangedSPos, (iEndChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( std::max(m_pcInputSamplesRow[iCurViewPos][iEndChangePos].iD, m_piNewDepthData[iPosXinNewData] )) ]); 731 iLastSPos = iCurSPos; 732 m_iLastDepth = m_iCurDepth; 733 734 if ( bSet ) 924 Int iCurSPos = xShiftDept(iEndChangePosInSubPel, m_iCurDepth ); 925 926 m_curRangeStart = xRangeLeft<bL>( iCurSPos ); 927 xExtrapolateMargin<bL, bSM> ( iCurSPos, iEndChangePos, iError ); 928 929 Int iOldDepth = m_pcInputSamplesRow[iCurViewPos][iEndChangePos].iD; 930 iMinChangedSPos = xMin<Int, bL>( ( iOldDepth <= m_iCurDepth ) ? iCurSPos : xShiftDept(iEndChangePosInSubPel, iOldDepth ), iMinChangedSPos); 931 iLastSPos = iCurSPos; 932 m_lastRangeStart = m_curRangeStart; 933 m_iLastDepth = m_iCurDepth; 934 m_iLastOccludedSPos = iLastSPos; 935 936 if ( bSM == SET_FULL || bSM == SET_SIMP ) 735 937 { 736 938 m_pcInputSamplesRow[iCurViewPos][iEndChangePos].iD = m_piNewDepthData[iPosXinNewData]; 737 939 } 738 940 739 iPosXinNewData--;740 iEndChangePos--;941 xDec<Int, bL>(iPosXinNewData); 942 xDec<Int, bL>(iEndChangePos); 741 943 } 742 944 else 743 945 { 744 iLastSPos = xShift(iEndChangePos+1);745 m_iLastDepth = m_pcInputSamplesRow [iCurViewPos][iEndChangePos+1].iD;746 xInitRenderPart L( iEndChangePos, iLastSPos );946 m_iLastDepth = m_pcInputSamplesRow [iCurViewPos][xPlus<Int,bL>(iEndChangePos,1)].iD; 947 iLastSPos = xShiftDept(xPlus<Int,bL>(iEndChangePosInSubPel, ( 1 << m_iShiftPrec ) ), m_iLastDepth ); 948 xInitRenderPart<bL>( iEndChangePos, iLastSPos ); 747 949 } 748 950 749 951 //// RENDER NEW DATA 750 952 Int iCurPosX; 751 for ( iCurPosX = iEndChangePos; iCurPosX >= iStartChangePos; iCurPosX-- ) 752 { 753 // Get minimal changed sample position 754 755 iMinChangedSPos = std::min( iMinChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( std::max(m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD, m_piNewDepthData[iPosXinNewData] )) ]); 756 Int iCurSPos = xShiftNewData(iCurPosX,iPosXinNewData); 757 m_iCurDepth = m_piNewDepthData[iPosXinNewData]; 758 xRenderRangeL<bSet>(iCurSPos, iLastSPos, iCurPosX, iError ); 953 for ( iCurPosX = iEndChangePos; xGeQ<Int,bL>(iCurPosX,iStartChangePos); xDec<Int,bL>(iCurPosX)) 954 { 955 Int iCurPosXInSubPel = iCurPosX << m_iShiftPrec; 956 m_iCurDepth = m_piNewDepthData[iPosXinNewData] ; 957 Int iCurSPos = xShiftDept(iCurPosXInSubPel,m_iCurDepth); 958 959 Int iOldDepth = m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD; 960 iMinChangedSPos = xMin<Int,bL>( ( iOldDepth <= m_iCurDepth ) ? iCurSPos : xShiftDept(iCurPosXInSubPel, iOldDepth ), iMinChangedSPos); 961 962 xRenderRange<bL,bSM>(iCurSPos, iLastSPos, iCurPosX, iError ); 759 963 iLastSPos = iCurSPos; 760 964 m_iLastDepth = m_iCurDepth; 761 965 762 if ( bS et)966 if ( bSM == SET_FULL || bSM == SET_SIMP ) 763 967 { 764 968 m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD = m_piNewDepthData[iPosXinNewData]; 765 969 } 766 767 iPosXinNewData--; 970 xDec<Int,bL>(iPosXinNewData); 768 971 } 769 972 770 973 //// RE-RENDER DATA LEFT TO NEW DATA 771 while ( iCurPosX >= 0 ) 772 {773 Int iCurSPos = xShift(iCurPosX);774 974 975 while ( xGeQ<Int,bL>(iCurPosX, xZero<bL>() ) ) 976 { 977 Int iCurPosXInSubPel = iCurPosX << m_iShiftPrec; 775 978 m_iCurDepth = m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD; 776 xRenderRangeL<bSet>( iCurSPos, iLastSPos, iCurPosX, iError );777 778 if ( iCurSPos < iMinChangedSPos)979 Int iCurSPos = xShiftDept(iCurPosXInSubPel,m_iCurDepth); 980 xRenderRange<bL,bSM>( iCurSPos, iLastSPos, iCurPosX, iError ); 981 if ( xLess<Int,bL>(iCurSPos,iMinChangedSPos) ) 779 982 { 780 983 break; 781 984 } 782 985 783 iCurPosX--;986 xDec<Int,bL>(iCurPosX); 784 987 iLastSPos = iCurSPos; 785 988 m_iLastDepth = m_iCurDepth; … … 787 990 788 991 789 xIncViewRow(); 992 993 994 xIncViewRow<bSM>(); 790 995 m_piNewDepthData += iStride; 791 996 } … … 793 998 } 794 999 795 #ifdef H_3D_VSO_EARLY_SKIP 796 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline RMDist 797 TRenSingleModelC<iBM,bBitInc>::xRenderR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData , Bool bFast) 798 #else 799 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline RMDist 800 TRenSingleModelC<iBM,bBitInc>::xRenderR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ) 801 #endif 802 { 803 804 const Int iCurViewPos = 1; 805 const Int iOtherViewPos = 0; 806 807 m_iCurViewPos = iCurViewPos; 808 m_iOtherViewPos = iOtherViewPos; 809 810 m_piNewDepthData = piNewData; 811 m_iNewDataWidth = iWidth; 812 m_iStartChangePosX = iStartPosX; 813 814 if ((iWidth == 0) || (iHeight == 0)) 815 return 0; 816 817 // Get Data 818 m_ppiCurLUT = m_appiShiftLut [iCurViewPos]; 819 xSetViewRow ( iStartPosY); 820 821 // Init Start 822 RMDist iError = 0; 823 Int iEndChangePos; 824 825 iEndChangePos = m_iStartChangePosX + iWidth - 1; 826 827 for (Int iPosY = iStartPosY; iPosY < iStartPosY + iHeight; iPosY++ ) 828 { 829 #if H_3D_VSO_EARLY_SKIP 830 if( m_bEarlySkip && bFast ) 831 { 832 if ( m_pbHorSkip[iPosY-iStartPosY] ) 833 { 834 xIncViewRow(); 835 m_piNewDepthData += iStride; 836 continue; 837 } 838 } 839 #endif 840 m_bInOcclusion = false; 841 842 Int iLastSPos; 843 Int iStartChangePos = m_iStartChangePosX; 844 Int iPosXinNewData = 0; 845 Int iMaxChangedSPos = -1; 846 847 if ( iStartChangePos == 0 ) // Special processing for leftmost depth sample 848 { 849 m_iCurDepth = m_piNewDepthData[iPosXinNewData]; 850 Int iCurSPos = xShiftNewData(iStartChangePos, iPosXinNewData); 851 m_iLastOccludedSPos = iCurSPos - 1; 852 m_iLastOccludedSPosFP = xRangeRightR( m_iLastOccludedSPos ); 853 xExtrapolateMarginR<bSet> ( iCurSPos, iStartChangePos, iError ); 854 855 iMaxChangedSPos = std::max( iMaxChangedSPos, (iStartChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( std::max(m_pcInputSamplesRow[iCurViewPos][iStartChangePos].iD, m_piNewDepthData[iPosXinNewData] )) ]); 856 iLastSPos = iCurSPos; 857 m_iLastDepth = m_iCurDepth; 858 if ( bSet ) 859 { 860 m_pcInputSamplesRow[iCurViewPos][iStartChangePos].iD = m_piNewDepthData[iPosXinNewData]; 861 } 862 863 864 iPosXinNewData++; 865 iStartChangePos++; 866 } 867 else 868 { 869 iLastSPos = xShift(iStartChangePos-1); 870 871 m_iLastDepth = m_pcInputSamplesRow[iCurViewPos][iStartChangePos-1].iD; 872 xInitRenderPartR( iStartChangePos, iLastSPos ); 873 } 874 875 //// RENDER NEW DATA 876 Int iCurPosX; 877 for ( iCurPosX = iStartChangePos; iCurPosX <= iEndChangePos; iCurPosX++ ) 878 { 879 // Get minimal changed sample position 880 881 iMaxChangedSPos = std::max( iMaxChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( std::max(m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD, m_piNewDepthData[iPosXinNewData] )) ]); 882 Int iCurSPos = xShiftNewData(iCurPosX,iPosXinNewData); 883 m_iCurDepth = m_piNewDepthData[iPosXinNewData]; 884 xRenderRangeR<bSet>(iCurSPos, iLastSPos, iCurPosX, iError ); 885 iLastSPos = iCurSPos; 886 m_iLastDepth = m_iCurDepth; 887 888 if ( bSet ) 889 { 890 m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD = m_piNewDepthData[iPosXinNewData]; 891 } 892 893 iPosXinNewData++; 894 } 895 896 //// RE-RENDER DATA LEFT TO NEW DATA 897 while ( iCurPosX < m_iWidth ) 898 { 899 Int iCurSPos = xShift(iCurPosX); 900 901 m_iCurDepth = m_pcInputSamplesRow[iCurViewPos][iCurPosX].iD; 902 xRenderRangeR<bSet>( iCurSPos, iLastSPos, iCurPosX, iError ); 903 904 if ( iCurSPos > iMaxChangedSPos ) 905 { 906 break; 907 } 908 iCurPosX++; 909 iLastSPos = iCurSPos; 910 m_iLastDepth = m_iCurDepth; 911 } 912 913 xIncViewRow(); 914 m_piNewDepthData += iStride; 915 } 916 return iError; 917 } 918 919 920 template <BlenMod iBM, Bool bBitInc> __inline Void 921 TRenSingleModelC<iBM,bBitInc>::xInitRenderPartL( Int iEndChangePos, Int iLastSPos ) 922 { 923 const Int iCurViewPos = 0; 924 // GET MINIMAL OCCLUDED SAMPLE POSITION 925 Int iCurPosX = iEndChangePos; 926 927 928 if ( ( iCurPosX + 1 < m_iWidth ) && (m_pcInputSamplesRow[iCurViewPos][ iCurPosX + 1].bOccluded ) ) 929 { 930 iCurPosX++; 931 932 while ( (iCurPosX + 1 < m_iWidth) && (m_pcInputSamplesRow[iCurViewPos][ iCurPosX + 1].bOccluded ) ) 933 934 iCurPosX++; 935 936 if ( iCurPosX + 1 < m_iWidth ) 937 { 938 iCurPosX++; 939 m_iLastOccludedSPos = xShift(iCurPosX); 940 } 941 else 942 { 943 m_iLastOccludedSPos = xShift(iCurPosX) + 1; 944 } 945 946 m_iLastOccludedSPosFP = xRoundL( m_iLastOccludedSPos ); 1000 template <BlenMod iBM, Bool bBitInc> template<Bool bL> __inline Void 1001 TRenSingleModelC<iBM,bBitInc>::xInitRenderPart( Int iEndChangePos, Int iLastSPos ) 1002 { 1003 const Int iCurViewPos = bL ? 0 : 1; 1004 m_iLastOccludedSPos = m_pcInputSamplesRow[iCurViewPos][ xPlus<Int,bL>(iEndChangePos,1) ].aiOccludedPos; 1005 m_bInOcclusion = xGeQ<Int,bL>( iLastSPos, m_iLastOccludedSPos ); 1006 1007 if( m_bInOcclusion ) 1008 { 1009 m_lastRangeStart = xRound<bL>( m_iLastOccludedSPos ); 947 1010 } 948 1011 else 949 1012 { 950 m_iLastOccludedSPos = iLastSPos+1; 951 m_iLastOccludedSPosFP = xRangeLeftL( m_iLastOccludedSPos ); 952 } 953 954 m_bInOcclusion = iLastSPos >= m_iLastOccludedSPos; 1013 m_iLastOccludedSPos = iLastSPos; 1014 m_lastRangeStart = xRangeLeft<bL>( iLastSPos ); 1015 } 955 1016 }; 956 1017 957 template <BlenMod iBM, Bool bBitInc> __inline Void 958 TRenSingleModelC<iBM,bBitInc>::xInitRenderPartR( Int iStartChangePos, Int iLastSPos ) 959 { 960 const Int iCurViewPos = 1; 961 // GET MINIMAL OCCLUDED SAMPLE POSITION 962 Int iCurPosX = iStartChangePos; 963 964 if ( ( iCurPosX - 1 > -1 ) && (m_pcInputSamplesRow[iCurViewPos][ iCurPosX - 1].bOccluded ) ) 965 { 966 iCurPosX--; 967 968 while ( (iCurPosX - 1 > -1 ) && (m_pcInputSamplesRow[iCurViewPos][ iCurPosX - 1].bOccluded ) ) 969 iCurPosX--; 970 971 if ( iCurPosX - 1 > -1 ) 972 { 973 iCurPosX--; 974 m_iLastOccludedSPos = xShift(iCurPosX); 975 } 976 else 977 { 978 m_iLastOccludedSPos = xShift(iCurPosX) - 1; 979 } 980 m_iLastOccludedSPosFP = xRoundR( m_iLastOccludedSPos ); 1018 template <BlenMod iBM, Bool bBitInc> template<Bool bL, SetMod bSM> __inline Void 1019 TRenSingleModelC<iBM,bBitInc>::xRenderShiftedRange(Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ) 1020 { 1021 RM_AOF( (xGeQ<Int,bL>(iLastSPos,iCurSPos)) ); 1022 Int iDeltaSPos = bL ? iLastSPos - iCurSPos : iCurSPos - iLastSPos; 1023 1024 m_curRangeStart = xRangeLeft<bL>( iCurSPos ); 1025 if ( iDeltaSPos > m_iGapTolerance ) 1026 { 1027 xFillHole<bL,bSM>( iCurSPos, iLastSPos, iCurPos, riError ); 981 1028 } 982 1029 else 983 1030 { 984 m_iLastOccludedSPos = iLastSPos-1; 985 m_iLastOccludedSPosFP = xRangeRightR( m_iLastOccludedSPos ); 986 } 987 988 m_bInOcclusion = iLastSPos <= m_iLastOccludedSPos; 989 }; 990 991 992 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 993 TRenSingleModelC<iBM,bBitInc>::xRenderShiftedRangeL(Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ) 994 { 995 assert( iCurSPos <= iLastSPos ); 996 //assert( iRightSPos < m_iWidth ); 997 998 Int iDeltaSPos = iLastSPos - iCurSPos; 999 if ( iDeltaSPos > m_iGapTolerance ) 1000 { 1001 xFillHoleL<bSet>( iCurSPos, iLastSPos, iCurPos, riError ); 1002 } 1003 else 1004 { 1005 if (iLastSPos < 0 ) 1031 if (!xGeQ<Int,bL>(iLastSPos, bL ? 0 : ( m_iSampledWidth - 1) )) 1032 { 1006 1033 return; 1034 } 1007 1035 1008 1036 RM_AOT( iDeltaSPos > m_iGapTolerance ); 1009 1037 1010 1038 m_iThisDepth = m_iCurDepth; 1011 for (Int iFillSPos = std::max(0, xRangeLeftL(iCurSPos) ); iFillSPos <= min(xRangeRightL( iLastSPos ) ,m_iLastOccludedSPosFP-1); iFillSPos++ ) 1012 { 1013 Int iDeltaCurSPos = (iFillSPos << m_iShiftPrec) - iCurSPos; 1039 1040 for (Int iFillSPos = xMax<Int,bL>(xZero<bL>(), m_curRangeStart ); xLess<Int,bL>(iFillSPos,m_lastRangeStart); xInc<Int,bL>(iFillSPos)) 1041 { 1042 Int iDeltaCurSPos = (iFillSPos << m_iShiftPrec) - (bL ? iCurSPos : iLastSPos); 1014 1043 1015 1044 RM_AOT( iDeltaCurSPos > iDeltaSPos ); … … 1017 1046 RM_AOT( m_aaiSubPelShiftL[iDeltaSPos][iDeltaCurSPos] == 0xdeaddead); 1018 1047 1019 xSetShiftedPel L<bSet>( iCurPos, m_aaiSubPelShiftL[iDeltaSPos][iDeltaCurSPos], iFillSPos, REN_IS_FILLED, riError );1048 xSetShiftedPel<bL, bSM>( iCurPos, m_aaiSubPelShiftL[iDeltaSPos][iDeltaCurSPos], iFillSPos, REN_IS_FILLED, riError ); 1020 1049 } 1021 1050 }; 1022 } 1023 1024 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1025 TRenSingleModelC<iBM,bBitInc>::xRenderShiftedRangeR(Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ) 1026 { 1027 assert( iCurSPos >= iLastSPos ); 1028 1029 Int iDeltaSPos = iCurSPos - iLastSPos; 1030 if ( iDeltaSPos > m_iGapTolerance ) 1031 { 1032 xFillHoleR<bSet>( iCurSPos, iLastSPos, iCurPos, riError ); 1051 m_lastRangeStart = m_curRangeStart; 1052 } 1053 1054 template <BlenMod iBM, Bool bBitInc> template<Bool bL, SetMod bSM> __inline Void 1055 TRenSingleModelC<iBM,bBitInc>::xRenderRange(Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ) 1056 { 1057 const Int iCurViewPos = bL ? 0 : 1; 1058 1059 if ( bSM == SET_FULL || bSM == SET_SIMP ) 1060 { 1061 m_pcInputSamplesRow[iCurViewPos][ iCurPos ].aiOccludedPos = m_iLastOccludedSPos; 1062 } 1063 1064 if ( xLess<Int,bL>(iCurSPos,m_iLastOccludedSPos )) 1065 { 1066 m_bInOcclusion = false; 1067 m_iLastOccludedSPos = iCurSPos; 1068 xRenderShiftedRange<bL,bSM>(iCurSPos, iLastSPos, iCurPos, riError ); 1033 1069 } 1034 1070 else 1035 1071 { 1036 if (iLastSPos > m_iSampledWidth - 1 ) 1037 return; 1038 1039 m_iThisDepth = m_iCurDepth; 1040 RM_AOT( iDeltaSPos > m_iGapTolerance ); 1041 for (Int iFillSPos = max(m_iLastOccludedSPosFP+1, xRangeLeftR(iLastSPos) ); iFillSPos <= min(xRangeRightR( iCurSPos ) ,m_iWidth -1); iFillSPos++ ) 1042 { 1043 Int iDeltaCurSPos = (iFillSPos << m_iShiftPrec) - iLastSPos; 1044 1045 RM_AOT( iDeltaCurSPos > iDeltaSPos ); 1046 RM_AOT( iDeltaCurSPos < 0 ); 1047 RM_AOT( m_aaiSubPelShiftR[iDeltaSPos][iDeltaCurSPos] == 0xdeaddead); 1048 1049 xSetShiftedPelR<bSet>( iCurPos, m_aaiSubPelShiftR[iDeltaSPos][iDeltaCurSPos], iFillSPos, REN_IS_FILLED, riError ); 1050 } 1051 }; 1052 } 1053 1054 1055 1056 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1057 TRenSingleModelC<iBM,bBitInc>::xRenderRangeL(Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ) 1058 { 1059 const Int iCurViewPos = 0; 1060 if ( !m_bInOcclusion ) 1061 { 1062 if ( iCurSPos >= iLastSPos ) 1063 { 1064 m_iLastOccludedSPos = iLastSPos; 1065 1066 Int iRightSPosFP = xRoundL( iLastSPos ); 1067 if ( ( iRightSPosFP == xRangeRightL(iLastSPos)) && (iRightSPosFP >= 0) ) 1072 if ( !m_bInOcclusion ) 1073 { 1074 RM_AOF( (xGeQ<Int,bL>(iLastSPos, m_iLastOccludedSPos)) ); 1075 Int iRightSPosFP = xRound<bL>( iLastSPos ); 1076 if ( ( iRightSPosFP == xPlus<Int,bL>(m_lastRangeStart, -1) ) && xGeQ<Int,bL>(iRightSPosFP, xZero<bL>()) ) 1068 1077 { 1069 1078 m_iThisDepth = m_iLastDepth; 1070 1071 xSetShiftedPelL<bSet>( iCurPos+1, 0, iRightSPosFP, REN_IS_FILLED, riError ); 1079 xSetShiftedPel<bL, bSM>( xPlus<Int,bL>(iCurPos,1), bL ? 0 : (1 << m_iShiftPrec), iRightSPosFP, REN_IS_FILLED, riError ); 1072 1080 } 1073 m_iLastOccludedSPosFP = iRightSPosFP; 1074 1075 m_bInOcclusion = true; 1076 1077 if ( bSet ) 1078 { 1079 m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded = true; 1080 } 1081 } 1082 else 1083 { 1084 if ( bSet ) 1085 { 1086 m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded = false; 1087 } 1088 1089 xRenderShiftedRangeL<bSet>(iCurSPos, iLastSPos, iCurPos, riError ); 1090 } 1091 } 1092 else 1093 { 1094 if ( iCurSPos < m_iLastOccludedSPos ) 1095 { 1096 m_bInOcclusion = false; 1097 if ( bSet ) 1098 { 1099 m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded = false; 1100 } 1101 1102 xRenderShiftedRangeL<bSet>(iCurSPos, iLastSPos, iCurPos, riError ); 1103 } 1104 else 1105 { 1106 if ( bSet ) 1107 { 1108 m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded = true; 1109 } 1110 } 1111 } 1112 } 1113 1114 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1115 TRenSingleModelC<iBM,bBitInc>::xRenderRangeR(Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ) 1116 { 1117 const Int iCurViewPos = 1; 1118 // Find out if current sample is occluded 1119 if ( !m_bInOcclusion ) 1120 { 1121 if ( iCurSPos <= iLastSPos ) 1122 { 1123 m_iLastOccludedSPos = iLastSPos; 1124 1125 Int iLeftSPosFP = xRoundR( iLastSPos ); 1126 if ( ( iLeftSPosFP == xRangeLeftR(iLastSPos)) && (iLeftSPosFP <= m_iWidth - 1) ) 1127 { 1128 m_iThisDepth = m_iLastDepth; 1129 xSetShiftedPelR<bSet>( iCurPos-1,1 << m_iShiftPrec , iLeftSPosFP, REN_IS_FILLED, riError ); 1130 } 1131 m_iLastOccludedSPosFP = iLeftSPosFP; 1132 1133 m_bInOcclusion = true; 1134 1135 if ( bSet ) 1136 { 1137 m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded = true; 1138 } 1139 } 1140 else 1141 { 1142 if ( bSet ) 1143 { 1144 m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded = false; 1145 } 1146 1147 xRenderShiftedRangeR<bSet>(iCurSPos, iLastSPos, iCurPos, riError ); 1148 } 1149 } 1150 else 1151 { 1152 if ( iCurSPos > m_iLastOccludedSPos ) 1153 { 1154 m_bInOcclusion = false; 1155 if ( bSet ) 1156 { 1157 m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded = false; 1158 } 1159 1160 xRenderShiftedRangeR<bSet>(iCurSPos, iLastSPos, iCurPos, riError ); 1161 } 1162 else 1163 { 1164 if ( bSet ) 1165 { 1166 m_pcInputSamplesRow[iCurViewPos][ iCurPos ].bOccluded = true; 1167 } 1168 } 1169 } 1170 } 1171 1172 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1173 TRenSingleModelC<iBM,bBitInc>::xFillHoleL( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ) 1081 m_lastRangeStart = iRightSPosFP; 1082 m_bInOcclusion = true; 1083 } 1084 } 1085 } 1086 1087 template <BlenMod iBM, Bool bBitInc> template<Bool bL, SetMod bSM> __inline Void 1088 TRenSingleModelC<iBM,bBitInc>::xFillHole( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ) 1174 1089 { 1175 1090 if (iLastSPos < 0) 1091 { 1176 1092 return; 1093 } 1177 1094 1178 1095 Int iStartFillSPos = iCurSPos; 1179 1096 Int iStartFillPos = iCurPos; 1180 Int iLastPos = iCurPos + 1; 1181 1182 Int iStartFillSPosFP = xRangeLeftL(iStartFillSPos); 1183 1184 if (iStartFillSPosFP == xRoundL(iStartFillSPos)) 1185 { 1186 if ((iStartFillSPosFP >= 0) && (iStartFillSPosFP < m_iLastOccludedSPosFP) ) 1097 Int iLastPos = xPlus<Int,bL>( iCurPos,1); 1098 1099 Int iStartFillSPosFP = m_curRangeStart; 1100 if (iStartFillSPosFP == xRound<bL>(iStartFillSPos)) 1101 { 1102 if ( xGeQ<Int,bL>(iStartFillSPosFP, xZero<bL>()) && xLess<Int,bL>(iStartFillSPosFP, m_lastRangeStart) ) 1187 1103 { 1188 1104 m_iThisDepth = m_iCurDepth; 1189 xSetShiftedPel L<bSet> ( iStartFillPos, 0, iStartFillSPosFP, REN_IS_FILLED, riError );1105 xSetShiftedPel<bL, bSM> ( iStartFillPos, bL ? 0 : ( 1 << m_iShiftPrec), iStartFillSPosFP, REN_IS_FILLED, riError ); 1190 1106 } 1191 1107 } 1192 1108 else 1193 1109 { 1194 iStartFillSPosFP--;1110 xDec<Int,bL>( iStartFillSPosFP ); 1195 1111 } 1196 1112 1197 1113 m_iThisDepth = m_iLastDepth; 1198 for (Int iFillSPos = std::max(iStartFillSPosFP+1,0); iFillSPos <= min(xRangeRightL( iLastSPos ), m_iLastOccludedSPosFP-1 ); iFillSPos++ ) 1199 { 1200 xSetShiftedPelL<bSet>( iLastPos, 0, iFillSPos, REN_IS_HOLE, riError ); 1201 } 1202 } 1203 1204 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1205 TRenSingleModelC<iBM,bBitInc>::xFillHoleR( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ) 1206 { 1207 if (iLastSPos < 0) 1208 return; 1209 1210 Int iStartFillSPos = iCurSPos; 1211 Int iEndFillPos = iCurPos; 1212 Int iLastPos = iCurPos - 1; 1213 1214 Int iStartFillSPosFP = xRangeRightR(iStartFillSPos); 1215 1216 if (iStartFillSPosFP == xRoundR(iStartFillSPos)) 1217 { 1218 if ((iStartFillSPosFP < m_iWidth) && (iStartFillSPosFP > m_iLastOccludedSPosFP) ) 1219 { 1220 m_iThisDepth = m_iCurDepth; 1221 xSetShiftedPelR<bSet>( iEndFillPos, 1 << m_iShiftPrec , iStartFillSPosFP, REN_IS_FILLED, riError ); 1222 } 1223 } 1224 else 1225 { 1226 iStartFillSPosFP++; 1227 } 1228 1229 m_iThisDepth = m_iLastDepth; 1230 for (Int iFillSPos = max(xRangeLeftR( iLastSPos ), m_iLastOccludedSPosFP+1); iFillSPos <= min(iStartFillSPosFP,m_iWidth)-1 ; iFillSPos++ ) 1231 { 1232 xSetShiftedPelR<bSet>( iLastPos, 1 << m_iShiftPrec, iFillSPos, REN_IS_HOLE, riError ); 1233 } 1234 } 1235 1236 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1237 TRenSingleModelC<iBM,bBitInc>::xExtrapolateMarginL(Int iCurSPos, Int iCurPos, RMDist& riError ) 1238 { 1239 // if (iLeftSPos < 0 ) 1240 // return; 1241 1242 Int iSPosFullPel = std::max(0,xRangeLeftL(iCurSPos)); 1114 for (Int iFillSPos = xMax<Int,bL>(xPlus<Int,bL>(iStartFillSPosFP,1),xZero<bL>()); xLess<Int,bL>(iFillSPos, m_lastRangeStart); xInc<Int,bL>(iFillSPos)) 1115 { 1116 xSetShiftedPel<bL, bSM>( iLastPos, bL ? 0 : (1 << m_iShiftPrec), iFillSPos, REN_IS_HOLE, riError ); 1117 } 1118 } 1119 1120 template <BlenMod iBM, Bool bBitInc> template<Bool bL, SetMod bSM> __inline Void 1121 TRenSingleModelC<iBM,bBitInc>::xExtrapolateMargin(Int iCurSPos, Int iCurPos, RMDist& riError ) 1122 { 1123 Int iSPosFullPel = xMax<Int,bL>(xZero<bL>(),m_curRangeStart); 1243 1124 1244 1125 m_iThisDepth = m_iCurDepth; 1245 if (iSPosFullPel < m_iWidth) 1246 { 1247 xSetShiftedPelL<bSet>( iCurPos, 0, iSPosFullPel, REN_IS_FILLED, riError ); 1248 } 1249 1250 for (Int iFillSPos = iSPosFullPel +1; iFillSPos < m_iWidth; iFillSPos++ ) 1251 { 1252 xSetShiftedPelL<bSet>( iCurPos, 0, iFillSPos, REN_IS_HOLE, riError ); 1253 } 1254 } 1255 1256 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1257 TRenSingleModelC<iBM,bBitInc>::xExtrapolateMarginR(Int iCurSPos, Int iCurPos, RMDist& riError ) 1258 { 1259 // if (iLeftSPos < 0 ) 1260 // return; 1261 1262 Int iSPosFullPel = std::min(m_iWidth-1,xRangeRightR(iCurSPos)); 1263 1264 m_iThisDepth = m_iCurDepth; 1265 if (iSPosFullPel > -1) 1266 { 1267 xSetShiftedPelR<bSet>( iCurPos, 1 << m_iShiftPrec, iSPosFullPel, REN_IS_FILLED, riError ); 1268 } 1269 1270 for (Int iFillSPos = iSPosFullPel -1; iFillSPos > -1; iFillSPos-- ) 1271 { 1272 xSetShiftedPelR<bSet>( iCurPos , 1 << m_iShiftPrec, iFillSPos, REN_IS_HOLE, riError ); 1273 } 1274 } 1275 1276 template <BlenMod iBM, Bool bBitInc> __inline Int 1126 if ( xGeQ<Int,bL>(xWidthMinus1<bL>(), iSPosFullPel) ) 1127 { 1128 xSetShiftedPel<bL, bSM>( iCurPos, bL ? 0 : (1 << m_iShiftPrec) , iSPosFullPel, REN_IS_FILLED, riError ); 1129 } 1130 for (Int iFillSPos = xPlus<Int,bL>(iSPosFullPel ,1); xGeQ<Int,bL>( xWidthMinus1<bL>(), iFillSPos ); xInc<Int,bL>(iFillSPos)) 1131 { 1132 xSetShiftedPel<bL, bSM>( iCurPos, bL ? 0 : ( 1 << m_iShiftPrec ), iFillSPos, REN_IS_HOLE, riError ); 1133 } 1134 } 1135 1136 template <BlenMod iBM, Bool bBitInc> template <Bool bL> __inline Int 1277 1137 TRenSingleModelC<iBM,bBitInc>::xShiftNewData( Int iPosX, Int iPosInNewData ) 1278 1138 { 1279 1139 RM_AOT( iPosInNewData < 0 ); 1280 1140 RM_AOF( iPosInNewData < m_iNewDataWidth ); 1281 1282 1141 return (iPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( m_piNewDepthData[iPosInNewData] )]; 1283 1142 } 1284 1143 1144 1285 1145 template <BlenMod iBM, Bool bBitInc> __inline Int 1146 TRenSingleModelC<iBM,bBitInc>::xShiftDept( Int iPosXinSubPel, Int iDepth ) 1147 { 1148 return (iPosXinSubPel) - m_ppiCurLUT[0][ RenModRemoveBitInc( iDepth )]; 1149 } 1150 1151 1152 template <BlenMod iBM, Bool bBitInc> template <Bool bL> __inline Int 1286 1153 TRenSingleModelC<iBM,bBitInc>::xShift( Int iPosX ) 1287 1154 { 1288 1155 RM_AOT( iPosX < 0); 1289 1156 RM_AOF( iPosX < m_iWidth); 1290 1291 return (iPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( m_pcInputSamplesRow[m_iCurViewPos][iPosX].iD )]; 1292 } 1293 1294 1295 template <BlenMod iBM, Bool bBitInc> __inline Int 1157 return (iPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RenModRemoveBitInc( m_pcInputSamplesRow[(bL ? 0 : 1)][iPosX].iD )]; 1158 } 1159 1160 1161 template <BlenMod iBM, Bool bBitInc> template <Bool bL> __inline Int 1296 1162 TRenSingleModelC<iBM,bBitInc>::xShift( Int iPos, Int iPosInNewData ) 1297 1163 { … … 1302 1168 else 1303 1169 { 1304 return xShift(iPos); 1305 } 1306 } 1307 1308 template <BlenMod iBM, Bool bBitInc> __inline Int 1309 TRenSingleModelC<iBM,bBitInc>::xRangeLeftL( Int iPos ) 1310 { 1311 return ( iPos + (1 << m_iShiftPrec) - 1) >> m_iShiftPrec; 1312 } 1313 1314 1315 template <BlenMod iBM, Bool bBitInc> __inline Int 1316 TRenSingleModelC<iBM,bBitInc>::xRangeLeftR( Int iPos ) 1317 { 1318 1319 return xRangeRightR( iPos ) + 1; 1320 } 1321 1322 1323 template <BlenMod iBM, Bool bBitInc> __inline Int 1324 TRenSingleModelC<iBM,bBitInc>::xRangeRightL( Int iPos ) 1325 { 1326 return xRangeLeftL(iPos) - 1; 1327 } 1328 1329 template <BlenMod iBM, Bool bBitInc> __inline Int 1330 TRenSingleModelC<iBM,bBitInc>::xRangeRightR( Int iPos ) 1331 { 1332 return iPos >> m_iShiftPrec; 1333 } 1334 1335 1336 template <BlenMod iBM, Bool bBitInc> __inline Int 1337 TRenSingleModelC<iBM,bBitInc>::xRoundL( Int iPos ) 1338 { 1339 return (iPos + (( 1 << m_iShiftPrec ) >> 1 )) >> m_iShiftPrec; 1340 } 1341 1342 template <BlenMod iBM, Bool bBitInc> __inline Int 1343 TRenSingleModelC<iBM,bBitInc>::xRoundR( Int iPos ) 1344 { 1345 return (m_iShiftPrec == 0) ? iPos : xRoundL(iPos - 1); 1170 return xShift<bL>(iPos); 1171 } 1172 } 1173 1174 template <BlenMod iBM, Bool bBitInc> template<Bool bL> __inline Int 1175 TRenSingleModelC<iBM,bBitInc>::xRangeLeft( Int iPos ) 1176 { 1177 if ( bL ) 1178 { 1179 return ( iPos + (1 << m_iShiftPrec) - 1) >> m_iShiftPrec; 1180 } 1181 else 1182 { 1183 return iPos >> m_iShiftPrec; 1184 } 1185 } 1186 1187 1188 1189 template <BlenMod iBM, Bool bBitInc> template<Bool bL> __inline Int 1190 TRenSingleModelC<iBM,bBitInc>::xRangeRight( Int iPos ) 1191 { 1192 if ( bL ) 1193 { 1194 return xRangeLeft<true>(iPos) - 1; 1195 } 1196 else 1197 { 1198 return xRangeLeft<false>( iPos ) + 1; 1199 } 1200 } 1201 1202 template <BlenMod iBM, Bool bBitInc> template<Bool bL> __inline Int 1203 TRenSingleModelC<iBM,bBitInc>::xRound( Int iPos ) 1204 { 1205 if( bL ) 1206 { 1207 return (iPos + (( 1 << m_iShiftPrec ) >> 1 )) >> m_iShiftPrec; 1208 } 1209 else 1210 { 1211 return (m_iShiftPrec == 0) ? iPos : xRound<true>(iPos - 1); 1212 } 1346 1213 } 1347 1214 … … 1387 1254 } 1388 1255 1389 template <BlenMod iBM, Bool bBitInc> template<Bool b Set> __inline Void1390 TRenSingleModelC<iBM,bBitInc>::xSetShiftedPel L(Int iSourcePos, Int iSubSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError )1256 template <BlenMod iBM, Bool bBitInc> template<Bool bL, SetMod bSM> __inline Void 1257 TRenSingleModelC<iBM,bBitInc>::xSetShiftedPel(Int iSourcePos, Int iSubSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ) 1391 1258 { 1392 1259 RM_AOT( iSourcePos < 0 ); … … 1395 1262 RM_AOT( iSubSourcePos > (1 << m_iShiftPrec) ); 1396 1263 RM_AOT( iTargetSPos < 0 ); 1397 RM_AOT( iTargetSPos >= m_iWidth ); 1398 1399 RenModelOutPels* pcOutSample = m_pcOutputSamplesRow + iTargetSPos; 1400 RenModelInPels * pcInSample = m_pcInputSamplesRow[VIEWPOS_LEFT] + iSourcePos ; 1401 1402 if ( iBM != BLEND_NONE ) 1403 { 1404 xSetShiftedPelBlendL<bSet> (pcInSample, iSubSourcePos, pcOutSample, iFilled, riError); 1405 } 1406 else 1407 { 1408 xSetShiftedPelNoBlendL<bSet>(pcInSample, iSubSourcePos, pcOutSample, iFilled, riError); 1409 } 1410 } 1411 1412 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1413 TRenSingleModelC<iBM,bBitInc>::xSetShiftedPelNoBlendL(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ) 1414 { 1415 if ( bSet ) 1416 { 1417 // Filled 1418 pcOutSample->iFilledLeft = iFilled; 1419 1420 // Yuv 1421 pcOutSample->iYLeft = pcInSample->aiY[iSubSourcePos]; 1422 #if H_3D_VSO_COLOR_PLANES 1423 pcOutSample->iULeft = pcInSample->aiU[iSubSourcePos]; 1424 pcOutSample->iVLeft = pcInSample->aiV[iSubSourcePos]; 1425 1426 pcOutSample->iError = xGetDist( pcOutSample->iYLeft - pcOutSample->iYRef, 1427 pcOutSample->iULeft - pcOutSample->iURef, 1428 pcOutSample->iVLeft - pcOutSample->iVRef 1429 ); 1430 #else 1431 pcOutSample->iError = xGetDist( pcOutSample->iYLeft - pcOutSample->iYRef ); 1264 RM_AOT( iTargetSPos >= m_iWidth ); 1265 1266 RenModelInPels * pcInSample = m_pcInputSamplesRow[ bL ? VIEWPOS_LEFT : VIEWPOS_RIGHT ] + iSourcePos ; 1267 1268 Pel iY; 1269 Pel iYCurNew = pcInSample->aiY[iSubSourcePos]; 1270 #if H_3D_VSO_COLOR_PLANES 1271 Pel iU; 1272 Pel iUCurNew = pcInSample->aiU[iSubSourcePos]; 1273 Pel iV; 1274 Pel iVCurNew = pcInSample->aiV[iSubSourcePos];; 1432 1275 #endif 1433 1276 1277 const Bool bFullMode = ( bSM == GET_FULL || bSM == SET_FULL ); 1278 1279 RenModelOutPels* pcOutSample = bFullMode ? ( m_pcOutputSamplesRow + iTargetSPos ) : NULL; 1280 RenModelLimOutPels* pcLimOutSample = bFullMode ? NULL : ( m_pcLimOutputSamplesRow + iTargetSPos ); 1281 1282 if ( iBM == BLEND_NONE ) 1283 { 1284 iY = iYCurNew; 1285 #if H_3D_VSO_COLOR_PLANES 1286 iU = iUCurNew; 1287 iV = iVCurNew; 1288 #endif 1434 1289 } 1435 1290 else 1436 1291 { 1437 #if H_3D_VSO_COLOR_PLANES 1438 riError += xGetDist( pcInSample->aiY[iSubSourcePos] - pcOutSample->iYRef, 1439 pcInSample->aiU[iSubSourcePos] - pcOutSample->iURef, 1440 pcInSample->aiV[iSubSourcePos] - pcOutSample->iVRef 1441 ); 1442 #else 1443 riError += xGetDist( pcInSample->aiY[iSubSourcePos] - pcOutSample->iYRef ); 1444 #endif 1445 1446 riError -= pcOutSample->iError; 1447 } 1448 } 1449 1450 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1451 TRenSingleModelC<iBM,bBitInc>::xSetShiftedPelBlendL(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ) 1452 { 1453 Pel piBlendedValueY; 1454 #if H_3D_VSO_COLOR_PLANES 1455 Pel piBlendedValueU; 1456 Pel piBlendedValueV; 1457 #endif 1458 1459 xGetBlendedValue ( 1460 pcInSample ->aiY[iSubSourcePos], 1461 pcOutSample->iYRight, 1462 #if H_3D_VSO_COLOR_PLANES 1463 pcInSample ->aiU[iSubSourcePos], 1464 pcOutSample->iURight, 1465 pcInSample ->aiV[iSubSourcePos], 1466 pcOutSample->iVRight, 1467 #endif 1468 m_piInvZLUTLeft [RenModRemoveBitInc(m_iThisDepth) ], 1469 m_piInvZLUTRight[RenModRemoveBitInc(pcOutSample->iDRight)], 1470 iFilled, 1471 pcOutSample->iFilledRight , 1472 piBlendedValueY 1473 #if H_3D_VSO_COLOR_PLANES 1474 , piBlendedValueU, 1475 piBlendedValueV 1476 #endif 1477 ); 1478 1479 if ( bSet ) 1292 Pel iYOther = bFullMode ? ( bL ? pcOutSample->iYRight : pcOutSample->iYLeft) : pcLimOutSample->iYOther; 1293 #if H_3D_VSO_COLOR_PLANES 1294 Pel iUOther = bFullMode ? ( bL ? pcOutSample->iURight : pcOutSample->iULeft ) : pcLimOutSample->iUOther; 1295 Pel iVOther = bFullMode ? ( bL ? pcOutSample->iVRight : pcOutSample->iVLeft ) : pcLimOutSample->iVOther; 1296 #endif 1297 Int iFilledOther = bFullMode ? ( bL ? pcOutSample->iFilledRight : pcOutSample->iFilledLeft ) : pcLimOutSample->iFilledOther; 1298 Pel iDOther = bFullMode ? ( bL ? pcOutSample->iDRight : pcOutSample->iDLeft ) : pcLimOutSample->iDOther; 1299 1300 xGetBlendedValue<bL, bSM>( 1301 iY, 1302 bL ? iYCurNew : iYOther, 1303 bL ? iYOther : iYCurNew, 1304 #if H_3D_VSO_COLOR_PLANES 1305 iU, 1306 bL ? iUCurNew : iUOther, 1307 bL ? iUOther : iUCurNew, 1308 iV, 1309 bL ? iVCurNew : iVOther, 1310 bL ? iVOther : iVCurNew, 1311 #endif 1312 bL ? iFilled : iFilledOther, 1313 bL ? iFilledOther : iFilled, 1314 m_piInvZLUTLeft [RenModRemoveBitInc( bL ? m_iThisDepth : iDOther)], 1315 m_piInvZLUTRight[RenModRemoveBitInc( bL ? iDOther : m_iThisDepth)] 1316 ); 1317 } 1318 1319 1320 Int iDist = xGetDist( 1321 iY - ( bFullMode ? pcOutSample->iYRef : pcLimOutSample->iYRef ) 1322 #if H_3D_VSO_COLOR_PLANES 1323 , iU - ( bFullMode ? pcOutSample->iURef : pcLimOutSample->iURef ) 1324 , iV - ( bFullMode ? pcOutSample->iVRef : pcLimOutSample->iVRef ) 1325 #endif 1326 ); 1327 1328 if ( bSM == GET_FULL || bSM == GET_SIMP ) 1480 1329 { 1481 // Set values 1482 pcOutSample->iDLeft = m_iThisDepth; 1483 pcOutSample->iYLeft = pcInSample ->aiY[iSubSourcePos]; 1484 pcOutSample->iYBlended = piBlendedValueY; 1485 #if H_3D_VSO_COLOR_PLANES 1486 pcOutSample->iULeft = pcInSample ->aiU[iSubSourcePos]; 1487 pcOutSample->iUBlended = piBlendedValueU; 1488 pcOutSample->iVLeft = pcInSample ->aiV[iSubSourcePos]; 1489 pcOutSample->iVBlended = piBlendedValueV; 1490 #endif 1491 pcOutSample->iFilledLeft = iFilled; 1492 1493 // Get Error 1494 Int iDiffY = pcOutSample->iYRef - piBlendedValueY; 1495 #if H_3D_VSO_COLOR_PLANES 1496 Int iDiffU = pcOutSample->iURef - piBlendedValueU; 1497 Int iDiffV = pcOutSample->iVRef - piBlendedValueV; 1498 pcOutSample->iError = xGetDist(iDiffY, iDiffU, iDiffV ); 1499 #else 1500 pcOutSample->iError = xGetDist(iDiffY ); 1501 #endif 1502 } 1503 else 1504 { 1505 Int iDiffY = pcOutSample->iYRef - piBlendedValueY; 1506 #if H_3D_VSO_COLOR_PLANES 1507 Int iDiffU = pcOutSample->iURef - piBlendedValueU; 1508 Int iDiffV = pcOutSample->iVRef - piBlendedValueV; 1509 riError += ( xGetDist( iDiffY, iDiffU, iDiffV ) - pcOutSample->iError ); 1510 1511 #else 1512 riError += ( xGetDist( iDiffY ) - pcOutSample->iError ); 1513 #endif 1514 1515 } 1516 } 1517 1518 1519 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1520 TRenSingleModelC<iBM,bBitInc>::xSetShiftedPelR(Int iSourcePos, Int iSubSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ) 1521 { 1522 RM_AOT( iSourcePos < 0 ); 1523 RM_AOT( iSourcePos >= m_iWidth ); 1524 RM_AOT( iSubSourcePos < 0 ); 1525 RM_AOT( iSubSourcePos >= (1 << m_iShiftPrec)+1 ); 1526 RM_AOT( iTargetSPos < 0 ); 1527 RM_AOT( iTargetSPos >= m_iWidth ); 1528 1529 RenModelOutPels* pcOutSample = m_pcOutputSamplesRow + iTargetSPos; 1530 RenModelInPels * pcInSample = m_pcInputSamplesRow[VIEWPOS_RIGHT] + iSourcePos ; 1531 1532 if ( iBM != BLEND_NONE ) 1533 { 1534 xSetShiftedPelBlendR<bSet> (pcInSample, iSubSourcePos, pcOutSample, iFilled, riError); 1535 } 1536 else 1537 { 1538 xSetShiftedPelNoBlendR<bSet> (pcInSample, iSubSourcePos, pcOutSample, iFilled, riError); 1539 } 1540 } 1541 1542 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1543 TRenSingleModelC<iBM,bBitInc>::xSetShiftedPelNoBlendR(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ) 1544 { 1545 if ( bSet ) 1546 { 1547 // Filled 1548 pcOutSample->iFilledRight = iFilled; 1549 1550 // Yuv 1551 pcOutSample->iYRight = pcInSample->aiY[iSubSourcePos]; 1552 #if H_3D_VSO_COLOR_PLANES 1553 pcOutSample->iURight = pcInSample->aiU[iSubSourcePos]; 1554 pcOutSample->iVRight = pcInSample->aiV[iSubSourcePos]; 1555 1556 pcOutSample->iError = xGetDist( 1557 pcOutSample->iYRight - pcOutSample->iYRef, 1558 pcOutSample->iURight - pcOutSample->iURef, 1559 pcOutSample->iVRight - pcOutSample->iVRef 1560 ); 1561 #else 1562 pcOutSample->iError = xGetDist( pcOutSample->iYRight - pcOutSample->iYRef ); 1563 #endif 1564 1565 } 1566 else 1567 { 1568 #if H_3D_VSO_COLOR_PLANES 1569 riError += xGetDist( pcInSample->aiY[iSubSourcePos] - pcOutSample->iYRef, 1570 pcInSample->aiU[iSubSourcePos] - pcOutSample->iURef, 1571 pcInSample->aiV[iSubSourcePos] - pcOutSample->iVRef 1572 ); 1573 #else 1574 riError += xGetDist( pcInSample->aiY[iSubSourcePos] - pcOutSample->iYRef ); 1575 #endif 1576 1577 riError -= pcOutSample->iError; 1578 } 1579 } 1580 1581 template <BlenMod iBM, Bool bBitInc> template<Bool bSet> __inline Void 1582 TRenSingleModelC<iBM,bBitInc>::xSetShiftedPelBlendR(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ) 1583 { 1584 Pel piBlendedValueY; 1585 #if H_3D_VSO_COLOR_PLANES 1586 Pel piBlendedValueU; 1587 Pel piBlendedValueV; 1588 #endif 1589 1590 xGetBlendedValue ( 1591 pcOutSample->iYLeft, 1592 pcInSample ->aiY[iSubSourcePos], 1593 #if H_3D_VSO_COLOR_PLANES 1594 pcOutSample->iULeft, 1595 pcInSample ->aiU[iSubSourcePos], 1596 pcOutSample->iVLeft, 1597 pcInSample ->aiV[iSubSourcePos], 1598 #endif 1599 m_piInvZLUTLeft [RenModRemoveBitInc(pcOutSample->iDLeft)], 1600 m_piInvZLUTRight [RenModRemoveBitInc(m_iThisDepth) ], 1601 pcOutSample->iFilledLeft, 1602 iFilled, 1603 piBlendedValueY 1604 #if H_3D_VSO_COLOR_PLANES 1605 , piBlendedValueU, 1606 piBlendedValueV 1607 #endif 1608 ); 1609 1610 if ( bSet ) 1611 { 1612 // Set values 1613 pcOutSample->iDRight = m_iThisDepth; 1614 pcOutSample->iYRight = pcInSample ->aiY[iSubSourcePos]; 1615 pcOutSample->iYBlended = piBlendedValueY; 1616 #if H_3D_VSO_COLOR_PLANES 1617 pcOutSample->iURight = pcInSample ->aiU[iSubSourcePos]; 1618 pcOutSample->iUBlended = piBlendedValueU; 1619 pcOutSample->iVRight = pcInSample ->aiV[iSubSourcePos]; 1620 pcOutSample->iVBlended = piBlendedValueV; 1621 #endif 1622 pcOutSample->iFilledRight = iFilled; 1623 1624 // Get Error 1625 Int iDiffY = pcOutSample->iYRef - piBlendedValueY; 1626 #if H_3D_VSO_COLOR_PLANES 1627 Int iDiffU = pcOutSample->iURef - piBlendedValueU; 1628 Int iDiffV = pcOutSample->iVRef - piBlendedValueV; 1629 pcOutSample->iError = xGetDist(iDiffY, iDiffU, iDiffV ); 1630 #else 1631 pcOutSample->iError = xGetDist(iDiffY ); 1632 #endif 1633 } 1634 else 1635 { 1636 Int iDiffY = pcOutSample->iYRef - piBlendedValueY; 1637 #if H_3D_VSO_COLOR_PLANES 1638 Int iDiffU = pcOutSample->iURef - piBlendedValueU; 1639 Int iDiffV = pcOutSample->iVRef - piBlendedValueV; 1640 riError += ( xGetDist( iDiffY, iDiffU, iDiffV ) - pcOutSample->iError ); 1641 #else 1642 riError += ( xGetDist( iDiffY ) - pcOutSample->iError ); 1643 #endif 1644 } 1330 riError += ( iDist - ( bFullMode ? pcOutSample->iError : pcLimOutSample->iError ) ); 1331 } 1332 else // bSM == SET_FULL 1333 { 1334 Int& riErrorStr = bFullMode ? pcOutSample->iError : pcLimOutSample->iError; 1335 riErrorStr = iDist; 1336 1337 if ( bFullMode ) 1338 { 1339 if ( iBM != BLEND_NONE ) 1340 { 1341 pcOutSample->iYBlended = iY; 1342 #if H_3D_VSO_COLOR_PLANES 1343 pcOutSample->iUBlended = iU; 1344 pcOutSample->iVBlended = iV; 1345 #endif 1346 } 1347 1348 if ( bL ) 1349 { 1350 pcOutSample->iDLeft = m_iThisDepth; 1351 pcOutSample->iFilledLeft = iFilled; 1352 pcOutSample->iYLeft = iYCurNew; 1353 #if H_3D_VSO_COLOR_PLANES 1354 pcOutSample->iULeft = iUCurNew; 1355 pcOutSample->iVLeft = iVCurNew; 1356 #endif 1357 } 1358 else 1359 { 1360 pcOutSample->iDRight = m_iThisDepth; 1361 pcOutSample->iFilledRight = iFilled; 1362 pcOutSample->iYRight = iYCurNew; 1363 #if H_3D_VSO_COLOR_PLANES 1364 pcOutSample->iURight = iUCurNew; 1365 pcOutSample->iVRight = iVCurNew; 1366 #endif 1367 } 1368 } 1369 } 1645 1370 } 1646 1371 … … 1687 1412 1688 1413 1689 #if H_3D_VSO_COLOR_PLANES 1690 template <BlenMod iBM, Bool bBitInc> __inline Void 1691 TRenSingleModelC<iBM,bBitInc>::xGetBlendedValue( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV ) 1692 #else 1693 template <BlenMod iBM, Bool bBitInc> __inline Void 1694 TRenSingleModelC<iBM,bBitInc>::xGetBlendedValue( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY ) 1695 #endif 1696 { 1697 1414 1415 template <BlenMod iBM, Bool bBitInc> template< Bool bL, SetMod bSM > __inline Void 1416 TRenSingleModelC<iBM,bBitInc>::xGetBlendedValue( Pel& riY, Pel iYL, Pel iYR, 1417 #if H_3D_VSO_COLOR_PLANES 1418 Pel& riU, Pel iUL, Pel iUR, Pel& riV, Pel iVL, Pel iVR, 1419 #endif 1420 Int iFilledL, Int iFilledR, Pel iDepthL, Pel iDepthR ) 1421 { 1698 1422 RM_AOT( iBM != BLEND_AVRG && iBM != BLEND_LEFT && iBM != BLEND_RIGHT ); 1699 1423 … … 1702 1426 if (iBM == BLEND_LEFT ) 1703 1427 { 1704 #if H_3D_VSO_COLOR_PLANES 1705 xGetBlendedValueBM1( iYL, iYR, iUL, iUR, iVL, iVR, iDepthL, iDepthR, iFilledL, iFilledR, riY, riU, riV ); 1706 #else 1707 xGetBlendedValueBM1( iYL, iYR, iDepthL, iDepthR, iFilledL, iFilledR, riY ); 1708 #endif 1428 xGetBlendedValueBM1<bL, bSM>( riY, iYL, iYR, 1429 #if H_3D_VSO_COLOR_PLANES 1430 riU, iUL, iUR, riV, iVL, iVR, 1431 #endif 1432 iFilledL, iFilledR, iDepthL, iDepthR ); 1709 1433 } 1710 1434 else 1711 1435 { 1712 #if H_3D_VSO_COLOR_PLANES 1713 xGetBlendedValueBM2( iYL, iYR, iUL, iUR, iVL, iVR, iDepthL, iDepthR, iFilledL, iFilledR, riY, riU, riV ); 1714 #else 1715 xGetBlendedValueBM2( iYL, iYR, iDepthL, iDepthR, iFilledL, iFilledR, riY ); 1716 #endif 1436 xGetBlendedValueBM2<bL, bSM>( riY, iYL, iYR, 1437 #if H_3D_VSO_COLOR_PLANES 1438 riU, iUL, iUR, riV, iVL, iVR, 1439 #endif 1440 iFilledL, iFilledR, iDepthL, iDepthR ); 1717 1441 } 1718 1442 return; … … 1725 1449 if ( abs ( iDepthDifference ) <= m_iBlendZThres ) 1726 1450 { 1727 if ((iFilledL == REN_IS_FILLED) && ( iFilledR != REN_IS_FILLED))1728 {1729 riY = xBlend( iYL, iYR, iFilledR >> 1 );1730 #if H_3D_VSO_COLOR_PLANES1731 riU = xBlend( iUL, iUR, iFilledR >> 1 );1732 riV = xBlend( iVL, iVR, iFilledR >> 1 );1733 #endif1734 1735 }1736 else if ((iFilledL != REN_IS_FILLED) && ( iFilledR == REN_IS_FILLED))1737 {1738 riY = xBlend( iYR, iYL, (iFilledL >> 1) );1739 #if H_3D_VSO_COLOR_PLANES1740 riU = xBlend( iUR, iUL, (iFilledL >> 1) );1741 riV = xBlend( iVR, iVL, (iFilledL >> 1) );1742 #endif1743 }1744 else1745 1451 { 1746 1452 riY = xBlend( iYL, iYR, m_iBlendDistWeight ); … … 1760 1466 } 1761 1467 else 1762 { 1468 { 1763 1469 riY = iYR; 1764 1470 #if H_3D_VSO_COLOR_PLANES … … 1808 1514 } 1809 1515 1810 template <BlenMod iBM, Bool bBitInc> __inline Void1811 #if H_3D_VSO_COLOR_PLANES 1812 TRenSingleModelC<iBM,bBitInc>::xGetBlendedValueBM1( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV ) 1813 #else 1814 TRenSingleModelC<iBM,bBitInc>::xGetBlendedValueBM1( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY ) 1815 #endif 1516 template <BlenMod iBM, Bool bBitInc> template< Bool bL, SetMod SM > __inline Void 1517 TRenSingleModelC<iBM,bBitInc>::xGetBlendedValueBM1( Pel& riY, Pel iYL, Pel iYR, 1518 #if H_3D_VSO_COLOR_PLANES 1519 Pel& riU, Pel iUL, Pel iUR, Pel& riV, Pel iVL, Pel iVR, 1520 #endif 1521 Int iFilledL, Int iFilledR, Pel iDepthL, Pel iDepthR ) 1816 1522 { 1817 1523 if ( iFilledL == REN_IS_FILLED || iFilledR == REN_IS_HOLE ) … … 1841 1547 } 1842 1548 1843 template <BlenMod iBM, Bool bBitInc> __inline Void1844 #if H_3D_VSO_COLOR_PLANES 1845 TRenSingleModelC<iBM,bBitInc>::xGetBlendedValueBM2( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV ) 1846 #else 1847 TRenSingleModelC<iBM,bBitInc>::xGetBlendedValueBM2( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY ) 1848 #endif 1549 template <BlenMod iBM, Bool bBitInc> template< Bool bL, SetMod SM > __inline Void 1550 TRenSingleModelC<iBM,bBitInc>::xGetBlendedValueBM2( Pel& riY, Pel iYL, Pel iYR, 1551 #if H_3D_VSO_COLOR_PLANES 1552 Pel& riU, Pel iUL, Pel iUR, Pel& riV, Pel iVL, Pel iVR, 1553 #endif 1554 Int iFilledL, Int iFilledR, Pel iDepthL, Pel iDepthR ) 1849 1555 { 1850 1556 if ( iFilledR == REN_IS_FILLED || iFilledL == REN_IS_HOLE ) … … 1899 1605 1900 1606 #if H_3D_VSO_EARLY_SKIP 1901 template <BlenMod iBM, Bool bBitInc> 1902 __inline Bool 1903 TRenSingleModelC<iBM,bBitInc>::xDetectEarlySkipL( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride) 1607 template <BlenMod iBM, Bool bBitInc> template <Bool bL > __inline Bool 1608 TRenSingleModelC<iBM,bBitInc>::xDetectEarlySkip( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride) 1904 1609 { 1905 1610 RM_AOF( m_bEarlySkip ); 1906 const Int iCurViewPos = 0;1611 const Int iCurViewPos = bL ? 0 : 1; 1907 1612 Int** ppiCurLUT = m_appiShiftLut [ iCurViewPos ]; 1908 1613 … … 1930 1635 return bNoDiff; 1931 1636 } 1932 1933 template <BlenMod iBM, Bool bBitInc>1934 __inline Bool1935 TRenSingleModelC<iBM,bBitInc>::xDetectEarlySkipR( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride)1936 {1937 RM_AOF( m_bEarlySkip );1938 Bool bNoDiff = true;1939 1940 const Int iCurViewPos = 1;1941 Int** ppiCurLUT = m_appiShiftLut [ iCurViewPos ];1942 1943 for ( Int iPosY = 0; iPosY < iHeight; iPosY++ )1944 {1945 m_pbHorSkip[iPosY] = true;1946 1947 for (Int iPosX = 0; iPosX < iWidth; iPosX++)1948 {1949 Int iDisparityRec = abs( ppiCurLUT[0][ RenModRemoveBitInc(piNewData[iPosX])] );1950 Int iDisparityOrg = abs( ppiCurLUT[0][ RenModRemoveBitInc(piOrgData[iPosX])] );1951 1952 if( iDisparityRec != iDisparityOrg )1953 {1954 m_pbHorSkip[iPosY] = false;1955 bNoDiff = false;1956 break;1957 }1958 }1959 1960 piNewData += iStride;1961 piOrgData += iOrgStride;1962 }1963 return bNoDiff;1964 }1965 1637 #endif 1966 1638 #endif // NH_3D -
branches/HTM-16.0-dev1/source/Lib/TLibRenderer/TRenSingleModel.h
r1313 r1394 70 70 virtual ~TRenSingleModel() { } 71 71 #if H_3D_VSO_EARLY_SKIP 72 virtual Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bEarlySkip ) = 0; 73 #else 74 virtual Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode ) = 0; 75 #endif 76 77 // Set Frame dependent data 78 virtual Void setLRView ( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride ) = 0; 79 virtual Void setupPart ( UInt uiHorOffset, Int iUsedHeight ) = 0; 80 virtual Void setup ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bKeepReference ) = 0; 72 virtual Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bLimOutput, Bool bEarlySkip ) = 0; 73 #else 74 virtual Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bLimOutput ) = 0; 75 #endif 76 77 // Setup 78 virtual Void setLRView ( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride ) = 0; 79 virtual Void setupPart ( UInt uiHorOffset, Int iUsedHeight ) = 0; 80 #if RM_FIX_SETUP 81 virtual Void setupLut ( Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft ) = 0; 82 virtual Void setupRefView ( TComPicYuv* pcOrgVideo ) = 0; 83 84 virtual Void renderAll () = 0; 85 virtual Void setStructSynthViewAsRefView () = 0; 86 virtual Void resetStructError () = 0; 87 virtual Void setLimOutStruct ( Int iSourceViewPos ) = 0; 88 #else 89 virtual Void setupLutAndRef ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bRenderRef ) = 0; 90 virtual Void setupInitialState ( Int curViewPosInModel ) = 0; 91 #endif 81 92 82 93 // Set Data … … 114 125 // depth 115 126 Pel iD ; // depth 116 117 // state 118 Bool bOccluded; // Occluded 127 Int aiOccludedPos; // Occluded 128 129 }; 130 131 struct RenModelLimOutPels 132 { 133 Pel iDOther; 134 Int iFilledOther; 135 // video 136 Pel iYOther; 137 Pel iYRef ; 138 #if H_3D_VSO_COLOR_PLANES 139 Pel iUOther; 140 Pel iURef ; 141 Pel iVOther; 142 Pel iVRef ; 143 #endif 144 Int iError ; 119 145 }; 120 146 … … 161 187 // Create Model 162 188 #if H_3D_VSO_EARLY_SKIP 163 Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bEarlySkip ); 164 #else 165 Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode ); 166 #endif 167 168 // Set Frame dependent data 169 Void setLRView ( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride ); 170 Void setupPart ( UInt uiHorOffset, Int uiUsedHeight ); 171 Void setup ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bKeepReference ); 189 Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bLimOutput, Bool bEarlySkip ); 190 #else 191 Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bLimOutput ); 192 #endif 193 194 // Setup 195 Void setLRView ( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride ); 196 Void setupPart ( UInt uiHorOffset, Int uiUsedHeight ); 197 #if RM_FIX_SETUP 198 Void setupLut ( Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft); 199 Void setupRefView ( TComPicYuv* pcOrgVideo ); 200 201 __inline Void renderAll( ); 202 Void setStructSynthViewAsRefView (); 203 Void resetStructError (); 204 Void setLimOutStruct ( Int iSourceViewPos ); 205 #else 206 Void setupLutAndRef ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bRenderRef ); 207 Void setupInitialState ( Int curViewPosInModel ); 208 #endif 209 172 210 173 211 #if H_3D_VSO_EARLY_SKIP 174 212 Void setDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride ); 175 #else 213 #else 176 214 Void setDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 177 #endif 215 #endif 178 216 Void setVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 179 180 // Get Distortion 181 #if H_3D_VSO_EARLY_SKIP 217 218 // Get Distortion 219 #if H_3D_VSO_EARLY_SKIP 182 220 RMDist getDistDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel * piOrgData , Int iOrgStride); 183 #else 221 #else 184 222 RMDist getDistDepth ( Int iViewPos, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 185 #endif 223 #endif 186 224 RMDist getDistVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 187 225 … … 191 229 192 230 private: 231 232 #if !RM_FIX_SETUP 233 __inline Void xRenderAll( ); 234 #endif 235 236 237 #if H_3D_VSO_EARLY_SKIP 238 template < Bool bL, SetMod iSM > RMDist xSetOrGet( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, Pel* piOrgData, Int iOrgStride ); 239 #else 240 template < Bool bL, SetMod iSM > RMDist xSetOrGet( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 241 #endif 242 193 243 // Set and inc Current Row 194 __inline Void xSetViewRow( Int iPosY );195 __inline Void xIncViewRow();244 template< SetMod bSM > __inline Void xSetViewRow( Int iPosY ); 245 template< SetMod bSM > __inline Void xIncViewRow(); 196 246 197 247 ///// Rendering ///// 198 // Left to Right 199 #if H_3D_VSO_EARLY_SKIP 200 __inline Bool xDetectEarlySkipL ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride ); 201 __inline Bool xDetectEarlySkipR ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, const Pel* piOrgData, Int iOrgStride ); 202 template<Bool bSet> __inline RMDist xRenderL ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, Bool bFast ); 203 template<Bool bSet> __inline RMDist xRenderR ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, Bool bFast ); 204 #else 205 template<Bool bSet> __inline RMDist xRenderR ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 206 template<Bool bSet> __inline RMDist xRenderL ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 207 #endif 208 __inline Void xInitRenderPartL ( Int iEndChangePos, Int iLastSPos ); 209 template<Bool bSet> __inline Void xRenderRangeL ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 210 template<Bool bSet> __inline Void xRenderShiftedRangeL( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 211 template<Bool bSet> __inline Void xFillHoleL ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 212 template<Bool bSet> __inline Void xExtrapolateMarginL ( Int iCurSPos, Int iCurPos, RMDist& riError ); 213 __inline Int xRangeLeftL ( Int iPos ); 214 __inline Int xRangeRightL ( Int iPos ); 215 __inline Int xRoundL ( Int iPos ); 216 217 // Right to Left 218 __inline Void xInitRenderPartR ( Int iStartChangePos, Int iLastSPos ); 219 template<Bool bSet> __inline Void xRenderShiftedRangeR( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 220 template<Bool bSet> __inline Void xRenderRangeR ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 221 template<Bool bSet> __inline Void xFillHoleR ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 222 template<Bool bSet> __inline Void xExtrapolateMarginR ( Int iCurSPos, Int iCurPos, RMDist& riError ); 223 __inline Int xRangeLeftR ( Int iPos ); 224 __inline Int xRangeRightR ( Int iPos ); 225 __inline Int xRoundR ( Int iPos ); 226 227 // Blending 228 template<Bool bSet> __inline Void xSetShiftedPelBlend ( Int iSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ); 229 230 #if H_3D_VSO_COLOR_PLANES 231 __inline Void xGetBlendedValue ( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV ); 232 __inline Void xGetBlendedValueBM1 ( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV ); 233 __inline Void xGetBlendedValueBM2 ( Pel iYL, Pel iYR, Pel iUL, Pel iUR, Pel iVL, Pel iVR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY, Pel& riU, Pel&riV ); 234 #else 235 __inline Void xGetBlendedValue ( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY ); 236 __inline Void xGetBlendedValueBM1 ( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY ); 237 __inline Void xGetBlendedValueBM2 ( Pel iYL, Pel iYR, Pel iDepthL, Pel iDepthR, Int iFilledL, Int iFilledR, Pel& riY ); 248 template< typename T, Bool bL > __inline T xPlus ( T arg1, T arg2 ) { return bL ? (arg1 + arg2) : (arg1 - arg2); }; 249 template< typename T, Bool bL > __inline T xMin ( T arg1, T arg2 ) { return bL ? std::min(arg1, arg2) : std::max(arg1, arg2) ;}; 250 template< typename T, Bool bL > __inline T xMax ( T arg1, T arg2 ) { return bL ? std::max(arg1, arg2) : std::min(arg1, arg2) ;}; 251 template< typename T, Bool bL > __inline Void xInc ( T& arg1 ) { bL ? arg1++ : arg1-- ;}; 252 template< typename T, Bool bL > __inline Void xDec ( T& arg1 ) { bL ? arg1-- : arg1++ ;}; 253 template< typename T, Bool bL > __inline Bool xLess ( T arg1, T arg2 ) { return bL ? arg1 < arg2 : arg1 > arg2; }; 254 template< typename T, Bool bL > __inline Bool xGeQ ( T arg1, T arg2 ) { return bL ? arg1 >= arg2 : arg1 <= arg2; }; 255 template< Bool bL > __inline Int xZero ( ) { return bL ? 0 : m_iWidth - 1; }; 256 template< Bool bL > __inline Int xWidthMinus1( ) { return bL ? m_iWidth - 1 : 0; }; 257 #if H_3D_VSO_EARLY_SKIP 258 template< Bool bL > __inline Bool xDetectEarlySkip ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData,const Pel* piOrgData, Int iOrgStride ); 259 template< Bool bL, SetMod bSM > __inline RMDist xRender ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, Bool bFast ); 260 template< SetMod bSM > __inline RMDist xGetSSE ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData, Bool bFast ); 261 #else 262 template< Bool bL, SetMod bSM > __inline RMDist xRender ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 263 template< SetMod bSM > __inline RMDist xGetSSE ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, const Pel* piNewData ); 264 #endif 265 template< Bool bL > __inline Void xInitRenderPart ( Int iEndChangePos, Int iLastSPos ); 266 template< Bool bL, SetMod bSM > __inline Void xRenderRange ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 267 template< Bool bL, SetMod bSM > __inline Void xRenderShiftedRange( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 268 template< Bool bL, SetMod bSM > __inline Void xFillHole ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError ); 269 template< Bool bL, SetMod bSM > __inline Void xExtrapolateMargin ( Int iCurSPos, Int iCurPos, RMDist& riError ); 270 template< Bool bL > __inline Int xRangeLeft ( Int iPos ); 271 template< Bool bL > __inline Int xRangeRight ( Int iPos ); 272 template< Bool bL > __inline Int xRound ( Int iPos ); 273 274 #if H_3D_VSO_COLOR_PLANES 275 template< Bool bL, SetMod bSM > __inline Void xGetBlendedValue ( Pel& riY, Pel iYL, Pel iYR, Pel& riU, Pel iUL, Pel iUR, Pel& riV, Pel iVL, Pel iVR, Int iFilledL, Int iFilledR, Pel iDepthL, Pel iDepthR ); 276 template< Bool bL, SetMod bSM > __inline Void xGetBlendedValueBM1 ( Pel& riY, Pel iYL, Pel iYR, Pel& riU, Pel iUL, Pel iUR, Pel& riV, Pel iVL, Pel iVR, Int iFilledL, Int iFilledR, Pel iDepthL, Pel iDepthR ); 277 template< Bool bL, SetMod bSM > __inline Void xGetBlendedValueBM2 ( Pel& riY, Pel iYL, Pel iYR, Pel& riU, Pel iUL, Pel iUR, Pel& riV, Pel iVL, Pel iVR, Int iFilledL, Int iFilledR, Pel iDepthL, Pel iDepthR ); 278 #else 279 template< Bool bL, SetMod bSM > __inline Void xGetBlendedValue ( Pel& riY, Pel iYL, Pel iYR, Int iFilledL, Int iFilledR, Pel iDepthL, Pel iDepthR ); 280 template< Bool bL, SetMod bSM > __inline Void xGetBlendedValueBM1 ( Pel& riY, Pel iYL, Pel iYR, Int iFilledL, Int iFilledR, Pel iDepthL, Pel iDepthR ); 281 template< Bool bL, SetMod bSM > __inline Void xGetBlendedValueBM2 ( Pel& riY, Pel iYL, Pel iYR, Int iFilledL, Int iFilledR, Pel iDepthL, Pel iDepthR ); 238 282 #endif 239 283 __inline Pel xBlend ( Pel pVal1, Pel pVal2, Int iWeightVal2 ); 240 284 241 285 // General 242 template<Bool bSet> __inline Void xSetShiftedPelL (Int iSourcePos, Int iSubSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ); 243 template<Bool bSet> __inline Void xSetShiftedPelBlendL (RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ); 244 template<Bool bSet> __inline Void xSetShiftedPelNoBlendL(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ); 245 246 template<Bool bSet> __inline Void xSetShiftedPelR (Int iSourcePos, Int iSubSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ); 247 template<Bool bSet> __inline Void xSetShiftedPelBlendR (RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ); 248 template<Bool bSet> __inline Void xSetShiftedPelNoBlendR(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError ); 249 250 __inline Int xShiftNewData ( Int iPos, Int iPosInNewData ); 251 __inline Int xShift ( Int iPos ); 252 __inline Int xShift ( Int iPos, Int iPosInNewData ); 286 template<Bool bL, SetMod bSM> __inline Void xSetShiftedPel (Int iSourcePos, Int iSubSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError ); 287 288 template <Bool bL> __inline Int xShiftNewData ( Int iPos, Int iPosInNewData ); 289 template <Bool bL> __inline Int xShift ( Int iPos ); 290 template <Bool bL> __inline Int xShift ( Int iPos, Int iPosInNewData ); 291 292 __inline Int xShiftDept ( Int iPosXinSubPel, Int iDepth ); 293 253 294 __inline Int xGetDist ( Int iDiffY, Int iDiffU, Int iDiffV ); 254 295 __inline Int xGetDist ( Int iDiffY ); … … 264 305 Void xGetSampleStrTextPtrs ( Int iViewNum, Pel RenModelOutPels::*& rpiSrcY ); 265 306 #endif 266 Void xGetSampleStrDepthPtrs( Int iViewNum, Pel RenModelOutPels::*& rpiSrcD ); 307 Void xGetSampleStrDepthPtrs ( Int iViewNum, Pel RenModelOutPels::*& rpiSrcD ); 308 Void xGetSampleStrFilledPtrs( Int iViewNum, Int RenModelOutPels::*& rpiSrcFilled ); 309 267 310 268 311 Void xSetStructRefView (); 312 #if !RM_FIX_SETUP 269 313 Void xResetStructError (); 314 Void xSetLimOutStruct (Int iSourceViewPos ); 315 #endif 316 270 317 Void xInitSampleStructs (); 318 #if !RM_FIX_SETUP 271 319 Void xSetStructSynthViewAsRefView (); 320 #endif 272 321 Void xCopy2PicYuv ( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget ); 273 322 … … 340 389 341 390 //// Output Samples 342 RenModelOutPels* m_pcOutputSamples; 391 RenModelOutPels* m_pcOutputSamples; 392 RenModelLimOutPels* m_pcLimOutputSamples; 393 343 394 Int m_iOutputSamplesStride; 344 395 … … 349 400 Bool m_bInOcclusion; // Currently rendering in occluded area 350 401 Int m_iLastOccludedSPos; // Position of last topmost shifted position 351 Int m_iLastOccludedSPosFP; // Position of last topmost shifted position in FullPels 352 353 Int m_ iCurViewPos; // Current View Position 0: Left, 1: Right354 Int m_iOtherViewPos; // Other View Position 0: Left, 1: Right 402 403 Int m_curRangeStart; 404 Int m_lastRangeStart; 405 355 406 const Pel* m_piNewDepthData; // Pointer to new depth data 356 407 Int m_iStartChangePosX; // Start Position of new data … … 377 428 //// Current Pointers //// 378 429 379 RenModelInPels* m_pcInputSamplesRow [2]; 380 RenModelOutPels* m_pcOutputSamplesRow; 430 RenModelInPels* m_pcInputSamplesRow [2]; 431 RenModelOutPels* m_pcOutputSamplesRow; 432 RenModelLimOutPels* m_pcLimOutputSamplesRow; 381 433 382 434 //// MISC //// 383 const Int m_iDistShift; // Shift in Distortion computation 435 const Int m_iDistShift; // Shift in Distortion computation 436 Bool m_bLimOutput; // Save distortion only 384 437 385 438 //// Early Skip … … 389 442 }; 390 443 391 #endif // NH_3D444 #endif // H_3D 392 445 #endif //__TRENSINGLEMODEL__ 393 446 -
branches/HTM-16.0-dev1/source/Lib/TLibRenderer/TRenTop.cpp
r1386 r1394 40 40 #include <math.h> 41 41 #include "../TLibCommon/CommonDef.h" 42 #if NH_3D_VSO 42 #if NH_3D_VSO || NH_3D 43 43 44 44 -
branches/HTM-16.0-dev1/source/Lib/TLibRenderer/TRenTop.h
r1386 r1394 39 39 #include "../TLibCommon/TComPicYuv.h" 40 40 41 #if NH_3D_VSO 41 #if NH_3D_VSO || NH_3D 42 42 #include <list> 43 43 #include <vector>
Note: See TracChangeset for help on using the changeset viewer.