Changeset 77 in 3DVCSoftware
- Timestamp:
- 14 Jun 2012, 16:38:29 (13 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 1 deleted
- 50 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/build/vc8/TLibCommon_vc8.vcproj
r56 r77 357 357 </File> 358 358 <File 359 RelativePath="..\..\source\Lib\TLibCommon\TComResidualGenerator.cpp" 360 > 361 </File> 362 <File 359 363 RelativePath="..\..\source\Lib\TLibCommon\TComRom.cpp" 360 364 > … … 499 503 </File> 500 504 <File 505 RelativePath="..\..\source\Lib\TLibCommon\TComResidualGenerator.h" 506 > 507 </File> 508 <File 501 509 RelativePath="..\..\source\Lib\TLibCommon\TComRom.h" 502 510 > … … 512 520 <File 513 521 RelativePath="..\..\source\Lib\TLibCommon\TComTrQuant.h" 522 > 523 </File> 524 <File 525 RelativePath="..\..\source\Lib\TLibCommon\TComWedgelet.h" 514 526 > 515 527 </File> -
trunk/source/App/TAppDecoder/TAppDecTop.cpp
r57 r77 82 82 Void TAppDecTop::decode() 83 83 { 84 #if VIDYO_VPS_INTEGRATION 85 increaseNumberOfViews( 0, 0, 0 ); 86 #else 84 87 increaseNumberOfViews( 1 ); 88 #endif 89 85 90 #if SONY_COLPIC_AVAILABILITY 86 91 m_tDecTop[0]->setViewOrderIdx(0); … … 140 145 { 141 146 read(nalu, nalUnit); 147 #if VIDYO_VPS_INTEGRATION 148 Int viewId = 0; 149 Int depth = 0; 150 151 if(nalu.m_nalUnitType != NAL_UNIT_VPS || nalu.m_layerId) 152 { 153 // code assumes that the first nal unit is VPS 154 // currently, this is a hack that requires non-first VPSs have non-zero layer_id 155 viewId = getVPSAccess()->getActiveVPS()->getViewId(nalu.m_layerId); 156 depth = getVPSAccess()->getActiveVPS()->getDepthFlag(nalu.m_layerId); 157 } 158 viewDepthId = nalu.m_layerId; // coding order T0D0T1D1T2D2 159 #else 142 160 Int viewId = nalu.m_viewId; 143 161 Int depth = nalu.m_isDepth ? 1 : 0; 144 162 viewDepthId = viewId * 2 + depth; // coding order T0D0T1D1T2D2 163 #endif 164 145 165 newPicture[viewDepthId] = false; 146 166 if( viewDepthId >= m_tDecTop.size() ) 147 167 { 168 #if VIDYO_VPS_INTEGRATION 169 increaseNumberOfViews( viewDepthId, viewId, depth ); 170 #else 148 171 increaseNumberOfViews( viewDepthId +1 ); 172 #endif 149 173 } 150 174 if(m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) … … 392 416 m_pocLastDisplay[viewDepthId] = -MAX_INT; 393 417 } 394 418 #if VIDYO_VPS_INTEGRATION 419 Void TAppDecTop::increaseNumberOfViews ( UInt layerId, UInt viewId, UInt isDepth ) 420 #else 395 421 Void TAppDecTop::increaseNumberOfViews ( Int newNumberOfViewDepth ) 396 { 422 #endif 423 { 424 #if VIDYO_VPS_INTEGRATION 425 Int newNumberOfViewDepth = layerId + 1; 426 #endif 397 427 if ( m_outputBitDepth == 0 ) 398 428 { 399 429 m_outputBitDepth = g_uiBitDepth + g_uiBitIncrement; 400 430 } 431 #if !VIDYO_VPS_INTEGRATION 401 432 Int viewId = (newNumberOfViewDepth-1)>>1; // coding order T0D0T1D1T2D2 402 433 Bool isDepth = ((newNumberOfViewDepth % 2) == 0); // coding order T0D0T1D1T2D2 434 #endif 403 435 if( isDepth ) 404 436 m_useDepth = true; -
trunk/source/App/TAppDecoder/TAppDecTop.h
r56 r77 74 74 CamParsCollector m_cCamParsCollector; 75 75 #if DEPTH_MAP_GENERATION 76 #if VIDYO_VPS_INTEGRATION 77 TComVPSAccess m_cVPSAccess; 78 #endif 76 79 TComSPSAccess m_cSPSAccess; 77 80 TComAUPicAccess m_cAUPicAccess; … … 85 88 Void destroy (); ///< destroy internal members 86 89 Void decode (); ///< main decoding function 90 #if VIDYO_VPS_INTEGRATION 91 Void increaseNumberOfViews (UInt layerId, UInt viewId, UInt isDepth); 92 #else 87 93 Void increaseNumberOfViews (Int newNumberOfViewDepth); 94 #endif 88 95 TDecTop* getTDecTop ( Int viewId, Bool isDepth ); 89 96 … … 92 99 93 100 #if DEPTH_MAP_GENERATION 101 #if VIDYO_VPS_INTEGRATION 102 TComVPSAccess* getVPSAccess () { return &m_cVPSAccess; } 103 #endif 94 104 TComSPSAccess* getSPSAccess () { return &m_cSPSAccess; } 95 105 TComAUPicAccess* getAUPicAccess() { return &m_cAUPicAccess; } -
trunk/source/App/TAppEncoder/TAppEncTop.cpp
r56 r77 67 67 Void TAppEncTop::xInitLibCfg() 68 68 { 69 #if VIDYO_VPS_INTEGRATION 70 UInt layerId = 0; 71 // TODO: fix the assumption here that the temporal structures are all equal across all layers??? 72 m_cVPS.setMaxTLayers( m_maxTempLayer[0] ); 73 m_cVPS.setMaxLayers( m_iNumberOfViews * (m_bUsingDepthMaps ? 2:1) ); 74 for(Int i = 0; i < MAX_TLAYER; i++) 75 { 76 m_cVPS.setNumReorderPics( m_numReorderPics[0][i], i ); 77 m_cVPS.setMaxDecPicBuffering( m_maxDecPicBuffering[0][i], i ); 78 } 79 #endif 80 69 81 for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++) 70 82 { … … 90 102 m_acTEncTopList[iViewIdx]->setIsDepth ( false ); 91 103 m_acTEncTopList[iViewIdx]->setViewOrderIdx ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] ); 104 #if VIDYO_VPS_INTEGRATION 105 layerId = iViewIdx * (m_bUsingDepthMaps ? 2:1); 106 m_acTEncTopList[iViewIdx]->setLayerId ( layerId ); 107 m_cVPS.setDepthFlag ( false, layerId ); 108 m_cVPS.setViewId ( iViewIdx, layerId ); 109 m_cVPS.setViewOrderIdx ( m_cCameraData.getViewOrderIndex()[ iViewIdx ], layerId ); 110 // TODO: set correct dependentFlag and dependentLayer 111 m_cVPS.setDependentFlag ( iViewIdx ? true:false, layerId ); 112 m_cVPS.setDependentLayer ( layerId - (m_bUsingDepthMaps ? 2:1), layerId ); 113 #endif 114 92 115 m_acTEncTopList[iViewIdx]->setCamParPrecision ( m_cCameraData.getCamParsCodedPrecision () ); 93 116 m_acTEncTopList[iViewIdx]->setCamParInSliceHeader ( m_cCameraData.getVaryingCameraParameters() ); … … 364 387 m_acTEncDepthTopList[iViewIdx]->setIsDepth ( true ); 365 388 m_acTEncDepthTopList[iViewIdx]->setViewOrderIdx ( m_cCameraData.getViewOrderIndex()[ iViewIdx ] ); 389 #if VIDYO_VPS_INTEGRATION 390 layerId = iViewIdx * 2 + 1; 391 m_acTEncDepthTopList[iViewIdx]->setLayerId ( layerId ); 392 m_cVPS.setDepthFlag ( true, layerId ); 393 m_cVPS.setViewId ( iViewIdx, layerId ); 394 m_cVPS.setViewOrderIdx ( m_cCameraData.getViewOrderIndex()[ iViewIdx ], layerId ); 395 m_cVPS.setDependentFlag ( true, layerId ); 396 m_cVPS.setDependentLayer ( layerId-1, layerId); 397 #endif 366 398 m_acTEncDepthTopList[iViewIdx]->setCamParPrecision ( 0 ); 367 399 m_acTEncDepthTopList[iViewIdx]->setCamParInSliceHeader ( false ); … … 1134 1166 case NAL_UNIT_SPS: 1135 1167 case NAL_UNIT_PPS: 1168 #if VIDYO_VPS_INTEGRATION 1169 case NAL_UNIT_VPS: 1170 #endif 1136 1171 m_essentialBytes += *it_stats; 1137 1172 break; -
trunk/source/App/TAppEncoder/TAppEncTop.h
r56 r77 80 80 81 81 #if DEPTH_MAP_GENERATION 82 #if VIDYO_VPS_INTEGRATION 83 TComVPSAccess m_cVPSAccess; 84 #endif 82 85 TComSPSAccess m_cSPSAccess; 83 86 TComAUPicAccess m_cAUPicAccess; 84 87 #endif 85 88 89 #if VIDYO_VPS_INTEGRATION 90 TComVPS m_cVPS; 91 #endif 92 86 93 #if HHI_VSO 87 94 TRenTop m_cRendererTop; … … 131 138 #endif 132 139 140 #if VIDYO_VPS_INTEGRATION 141 TComVPS* getVPS() { return &m_cVPS; } 142 TComVPSAccess* getVPSAccess () { return &m_cVPSAccess; } 143 #endif 144 133 145 #if DEPTH_MAP_GENERATION 134 146 TComSPSAccess* getSPSAccess () { return &m_cSPSAccess; } -
trunk/source/Lib/TLibCommon/CommonDef.h
r56 r77 58 58 59 59 #define HM_VERSION "6.1" 60 #define NV_VERSION "3. 0" ///< Current software version60 #define NV_VERSION "3.1rc1" ///< Current software version 61 61 62 62 // ==================================================================================================================== … … 138 138 #define PDM_NO_INTER_UPDATE 1 // no update for inter (but not inter-view) predicted blocks 139 139 #define PDM_MERGE_POS 0 // position of pdm in merge list (0..4) 140 #if SAIT_IMPROV_MOTION_PRED_M24829 141 #define PDM_AMVP_POS 0 // position of pdm in amvp list (0..3) 142 #else 140 143 #define PDM_AMVP_POS 2 // position of pdm in amvp list (0..3) 144 #endif 141 145 #define PDM_OUTPUT_PRED_DEPTH_MAP 0 // output prediction depth map (for debugging) 142 146 … … 168 172 #define LOG2_DISP_PREC_LUT 2 ///< log2 of disparity precision used in integer disparity LUTs 169 173 174 // ==================================================================================================================== 175 // VPS constants 176 // ==================================================================================================================== 177 #if VIDYO_VPS_INTEGRATION 178 #define MAX_LAYER_NUM MAX_VIEW_NUM 179 #define VPS_EXTENSION_TYPE_MULTI_VIEW 0 180 #endif 170 181 171 182 // ==================================================================================================================== … … 483 494 NAL_UNIT_RESERVED_23, 484 495 NAL_UNIT_UNSPECIFIED_24, 496 #if VIDYO_VPS_INTEGRATION 497 NAL_UNIT_VPS, 498 #else 485 499 NAL_UNIT_UNSPECIFIED_25, 500 #endif 486 501 NAL_UNIT_UNSPECIFIED_26, 487 502 NAL_UNIT_UNSPECIFIED_27, -
trunk/source/Lib/TLibCommon/NAL.h
r56 r77 51 51 NalRefIdc m_nalRefIDC; ///< nal_ref_idc 52 52 #endif 53 #if VIDYO_VPS_INTEGRATION 54 unsigned m_layerId; 55 unsigned m_temporalId; ///< temporal_id 56 #else 53 57 Int m_viewId; ///< view_id 54 58 Bool m_isDepth; ///< is_depth … … 56 60 #if !H0388 57 61 bool m_OutputFlag; ///< output_flag 62 #endif 58 63 #endif 59 64 … … 64 69 NalUnitType nalUnitType, 65 70 Bool nalRefFlag, 71 #if !VIDYO_VPS_INTEGRATION 66 72 Int viewId, 67 73 Bool isDepth, 68 Int temporalId = 0) 74 #else 75 unsigned layerId, 76 #endif 77 unsigned temporalId = 0) 69 78 :m_nalUnitType (nalUnitType) 70 79 ,m_nalRefFlag (nalRefFlag) 80 #if !VIDYO_VPS_INTEGRATION 71 81 ,m_viewId (viewId) 72 82 ,m_isDepth (isDepth) 83 #else 84 ,m_layerId (layerId) 85 #endif 73 86 ,m_temporalId (temporalId) 74 87 {} … … 83 96 m_nalUnitType = nalUnitType; 84 97 m_nalRefIDC = nalRefIDC; 98 #if !VIDYO_VPS_INTEGRATION 85 99 m_viewId = viewId; 86 100 m_isDepth = isDepth; 101 #else 102 m_layerId = layerId; 103 #endif 87 104 m_temporalId = temporalID; 88 105 } … … 92 109 NalUnitType nalUnitType, 93 110 NalRefIdc nalRefIDC, 111 #if !VIDYO_VPS_INTEGRATION 94 112 Int viewId, 95 113 Bool isDepth, 114 #else 115 unsigned layerId, 116 #endif 96 117 unsigned temporalID = 0, 97 118 bool outputFlag = true) … … 99 120 m_nalUnitType = nalUnitType; 100 121 m_nalRefIDC = nalRefIDC; 122 #if !VIDYO_VPS_INTEGRATION 101 123 m_viewId = viewId; 102 124 m_isDepth = isDepth; 125 #else 126 m_layerId = layerId; 127 #endif 103 128 m_temporalId = temporalID; 104 129 m_OutputFlag = outputFlag; -
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r56 r77 2883 2883 } 2884 2884 2885 #if LG_RESTRICTEDRESPRED_M24766 2886 Void TComDataCU::getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx, Bool bLCU) 2887 { 2888 UInt uiNumPartition = bLCU ? (getWidth(uiAbsPartIdx)*getHeight(uiAbsPartIdx) >> 4) : m_uiNumPartition; 2889 UInt uiTmpAbsPartIdx = bLCU ? uiAbsPartIdx : 0; 2890 2891 switch ( m_pePartSize[uiTmpAbsPartIdx] ) 2892 { 2893 case SIZE_2NxN: 2894 riWidth = getWidth(uiTmpAbsPartIdx); riHeight = getHeight(uiTmpAbsPartIdx) >> 1; ruiPartAddr = ( uiPartIdx == 0 )? 0 : uiNumPartition >> 1; 2895 break; 2896 case SIZE_Nx2N: 2897 riWidth = getWidth(uiTmpAbsPartIdx) >> 1; riHeight = getHeight(uiTmpAbsPartIdx); ruiPartAddr = ( uiPartIdx == 0 )? 0 : uiNumPartition >> 2; 2898 break; 2899 case SIZE_NxN: 2900 riWidth = getWidth(uiTmpAbsPartIdx) >> 1; riHeight = getHeight(uiTmpAbsPartIdx) >> 1; ruiPartAddr = ( uiNumPartition >> 2 ) * uiPartIdx; 2901 break; 2902 case SIZE_2NxnU: 2903 riWidth = getWidth(uiTmpAbsPartIdx); 2904 riHeight = ( uiPartIdx == 0 ) ? getHeight(uiTmpAbsPartIdx) >> 2 : ( getHeight(uiTmpAbsPartIdx) >> 2 ) + ( getHeight(uiTmpAbsPartIdx) >> 1 ); 2905 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : uiNumPartition >> 3; 2906 break; 2907 case SIZE_2NxnD: 2908 riWidth = getWidth(uiTmpAbsPartIdx); 2909 riHeight = ( uiPartIdx == 0 ) ? ( getHeight(uiTmpAbsPartIdx) >> 2 ) + ( getHeight(uiTmpAbsPartIdx) >> 1 ) : getHeight(uiTmpAbsPartIdx) >> 2; 2910 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : (uiNumPartition >> 1) + (uiNumPartition >> 3); 2911 break; 2912 case SIZE_nLx2N: 2913 riWidth = ( uiPartIdx == 0 ) ? getWidth(uiTmpAbsPartIdx) >> 2 : ( getWidth(uiTmpAbsPartIdx) >> 2 ) + ( getWidth(uiTmpAbsPartIdx) >> 1 ); 2914 riHeight = getHeight(uiTmpAbsPartIdx); 2915 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : uiNumPartition >> 4; 2916 break; 2917 case SIZE_nRx2N: 2918 riWidth = ( uiPartIdx == 0 ) ? ( getWidth(uiTmpAbsPartIdx) >> 2 ) + ( getWidth(uiTmpAbsPartIdx) >> 1 ) : getWidth(uiTmpAbsPartIdx) >> 2; 2919 riHeight = getHeight(uiTmpAbsPartIdx); 2920 ruiPartAddr = ( uiPartIdx == 0 ) ? 0 : (uiNumPartition >> 2) + (uiNumPartition >> 4); 2921 break; 2922 default: 2923 assert ( m_pePartSize[0] == SIZE_2Nx2N ); 2924 riWidth = getWidth(uiTmpAbsPartIdx); riHeight = getHeight(uiTmpAbsPartIdx); ruiPartAddr = 0; 2925 break; 2926 } 2927 } 2928 #else 2885 2929 Void TComDataCU::getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight ) 2886 2930 { … … 2922 2966 } 2923 2967 } 2924 2968 #endif 2969 2970 #if LG_RESTRICTEDRESPRED_M24766 2971 Int TComDataCU::getResiPredMode(UInt uiPartAddr) 2972 { 2973 Int iAddResiShift = -1; 2974 2975 for(UInt uiRefIdx = 0; uiRefIdx < 2; uiRefIdx++) 2976 { 2977 RefPicList eRefList = uiRefIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 2978 Int iBestRefIdx = getCUMvField(eRefList)->getRefIdx(uiPartAddr); 2979 if(iBestRefIdx >= 0 && getSlice()->getViewId() == getSlice()->getRefViewId(eRefList, iBestRefIdx)) 2980 iAddResiShift++; 2981 } 2982 2983 return iAddResiShift; 2984 } 2985 2986 Void TComDataCU::getPUResiPredShift(Int *iPUResiPredShift, UInt uiAbsPartIndex) 2987 { 2988 UInt uiPartSize = getPartitionSize(uiAbsPartIndex); 2989 UInt uiPartAddr; 2990 Int iWidth, iHeight; 2991 Int iAddResiShift; 2992 2993 if(uiPartSize == SIZE_2Nx2N) 2994 { 2995 iAddResiShift = getResiPredMode(uiAbsPartIndex); 2996 for(UInt i = 0; i < 4; i++) 2997 iPUResiPredShift[i] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiAbsPartIndex) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1); 2998 return; 2999 } 3000 3001 if(uiPartSize == SIZE_2NxN || uiPartSize == SIZE_2NxnU || uiPartSize == SIZE_2NxnD) 3002 { 3003 for(UInt i = 0; i < 2; i++) 3004 { 3005 getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIndex, true); 3006 uiPartAddr += uiAbsPartIndex; 3007 iAddResiShift = getResiPredMode(uiPartAddr); 3008 iPUResiPredShift[2*i] = iPUResiPredShift[2*i+1] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1); 3009 } 3010 return; 3011 } 3012 3013 if(uiPartSize == SIZE_Nx2N || uiPartSize == SIZE_nLx2N || uiPartSize == SIZE_nRx2N) 3014 { 3015 for(UInt i = 0; i < 2; i++) 3016 { 3017 getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIndex, true); 3018 uiPartAddr += uiAbsPartIndex; 3019 iAddResiShift = getResiPredMode(uiPartAddr); 3020 iPUResiPredShift[i] = iPUResiPredShift[2+i] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1); 3021 } 3022 return; 3023 } 3024 3025 if(uiPartSize == SIZE_NxN) 3026 { 3027 for(UInt i = 0; i < 4; i++) 3028 { 3029 getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIndex, true); 3030 uiPartAddr += uiAbsPartIndex; 3031 iAddResiShift = getResiPredMode(uiPartAddr); 3032 iPUResiPredShift[i] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1); 3033 } 3034 } 3035 3036 } 3037 #endif 2925 3038 2926 3039 Void TComDataCU::getMvField ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList, TComMvField& rcMvField ) … … 4723 4836 Int iNeibRefPOC; 4724 4837 4838 #if HHI_FIX 4839 if( pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) >= 0 ) 4840 { 4841 iNeibRefPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ); 4842 if( pcTmpCU->getSlice()->getRefViewId( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ) != m_pcSlice->getRefViewId( eRefPicList, iRefIdx ) ) 4843 return false; 4844 if( iNeibRefPOC == iCurrRefPOC ) // Same Reference Frame But Diff List// 4845 { 4846 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList2nd)->getMv(uiIdx); 4847 4848 clipMv(cMvPred); 4849 pInfo->m_acMvCand[ pInfo->iN++] = cMvPred; 4850 return true; 4851 } 4852 } 4853 #endif 4725 4854 //--------------- V1 (END) ------------------// 4726 4855 if( pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) >= 0) … … 4851 4980 iColRefViewOrderIdx = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewOrderIdx(); 4852 4981 #else 4982 #if HHI_FIX 4983 if( pColCU->getSlice()->getRefViewId( eColRefPicList, iColRefIdx ) != pColCU->getSlice()->getViewId() ) 4984 #else 4853 4985 if( pColCU->getSlice()->getRefViewId( eColRefPicList, iColRefIdx ) != m_pcSlice->getRefPic( eRefPicList, riRefIdx )->getViewId() ) 4986 #endif 4854 4987 { 4855 4988 return false; … … 4867 5000 else if((iColPOC == iColRefPOC)&&(iCurrPOC == iCurrRefPOC)) 4868 5001 iScale = xGetDistScaleFactor(iCurrViewOrderIdx, iCurrRefViewOrderIdx, iColViewOrderIdx, iColRefViewOrderIdx); 5002 #if HHI_FIX //GT: fix reported by Sony 5003 else 5004 return false; 5005 #endif 4869 5006 #else 4870 5007 iScale = xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iColPOC, iColRefPOC); … … 5839 5976 #if HHI_INTER_VIEW_RESIDUAL_PRED 5840 5977 Bool 5841 TComDataCU::getResidualSamples( UInt uiPartIdx, TComYuv* pcYuv ) 5978 TComDataCU::getResidualSamples( UInt uiPartIdx, 5979 #if QC_SIMPLIFIEDIVRP_M24938 5980 Bool bRecon , 5981 #endif 5982 TComYuv* pcYuv ) 5842 5983 { 5843 5984 TComResidualGenerator* pcResidualGenerator = m_pcSlice->getSPS()->getResidualGenerator(); 5844 5985 ROFRS( pcResidualGenerator, false ); 5845 return pcResidualGenerator->getResidualSamples( this, uiPartIdx, pcYuv ); 5986 return pcResidualGenerator->getResidualSamples( this, uiPartIdx, pcYuv 5987 #if QC_SIMPLIFIEDIVRP_M24938 5988 , bRecon 5989 #endif 5990 ); 5846 5991 } 5847 5992 #endif -
trunk/source/Lib/TLibCommon/TComDataCU.h
r56 r77 521 521 #endif 522 522 #if HHI_INTER_VIEW_RESIDUAL_PRED 523 Bool getResidualSamples( UInt uiPartIdx, TComYuv* pcYuv = 0 ); 523 Bool getResidualSamples( UInt uiPartIdx, 524 #if QC_SIMPLIFIEDIVRP_M24938 525 Bool bRecon , 526 #endif 527 TComYuv* pcYuv = 0 ); 524 528 #endif 525 529 // ------------------------------------------------------------------------------------------------------------------- 526 530 // member functions for accessing partition information 527 531 // ------------------------------------------------------------------------------------------------------------------- 528 532 #if LG_RESTRICTEDRESPRED_M24766 533 Void getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx = 0, Bool bLCU = false); 534 #else 529 535 Void getPartIndexAndSize ( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight ); 536 #endif 537 #if LG_RESTRICTEDRESPRED_M24766 538 Int getResiPredMode(UInt uiPartAddr); 539 Void getPUResiPredShift (Int *iPUPredResiShift, UInt uiAbsPartIndex); 540 #endif 530 541 UChar getNumPartInter (); 531 542 Bool isFirstAbsZorderIdxInDepth (UInt uiAbsPartIdx, UInt uiDepth); -
trunk/source/Lib/TLibCommon/TComDepthMapGenerator.cpp
r56 r77 122 122 } 123 123 124 #if VIDYO_VPS_INTEGRATION 125 Void 126 TComDepthMapGenerator::init( TComPrediction* pcPrediction, TComVPSAccess* pcVPSAccess, TComSPSAccess* pcSPSAccess, TComAUPicAccess* pcAUPicAccess ) 127 #else 124 128 Void 125 129 TComDepthMapGenerator::init( TComPrediction* pcPrediction, TComSPSAccess* pcSPSAccess, TComAUPicAccess* pcAUPicAccess ) 130 #endif 126 131 { 127 132 AOF( pcPrediction ); … … 130 135 uninit(); 131 136 m_pcPrediction = pcPrediction; 137 #if VIDYO_VPS_INTEGRATION 138 m_pcVPSAccess = pcVPSAccess; 139 #endif 132 140 m_pcSPSAccess = pcSPSAccess; 133 141 m_pcAUPicAccess = pcAUPicAccess; … … 157 165 158 166 // update SPS list and AU pic list and set depth map generator in SPS 167 #if VIDYO_VPS_INTEGRATION 168 m_pcVPSAccess ->addVPS( pcPic->getVPS() ); 169 #endif 159 170 m_pcSPSAccess ->addSPS( pcPic->getSPS() ); 160 171 m_pcAUPicAccess->addPic( pcPic ); … … 1467 1478 Int iCurrPosY; 1468 1479 pcPredDepthMap->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY ); 1480 #if SAIT_IMPROV_MOTION_PRED_M24829 // max disparity within PU 1481 Int DiWidth = iCurrPosX+(iWidth >> m_uiSubSampExpX); 1482 Int DiHeight = iCurrPosY+(iHeight >> m_uiSubSampExpY); 1483 Int maxDepth = MIN_INT; 1484 1485 for(Int y=iCurrPosY; y<DiHeight ;y++) 1486 { 1487 for(Int x=iCurrPosX; x<DiWidth; x++) 1488 { 1489 if(piPredDepthMap[ x + y * iCurrStride ] > maxDepth) 1490 { 1491 maxDepth = piPredDepthMap[ x + y * iCurrStride ]; 1492 } 1493 } 1494 } 1495 iCurrPosX += ( ( iWidth >> m_uiSubSampExpX ) - 1 ) >> 1; 1496 iCurrPosY += ( ( iHeight >> m_uiSubSampExpY ) - 1 ) >> 1; 1497 riPrdDepth = maxDepth; 1498 #else 1469 1499 iCurrPosX += ( ( iWidth >> m_uiSubSampExpX ) - 1 ) >> 1; 1470 1500 iCurrPosY += ( ( iHeight >> m_uiSubSampExpY ) - 1 ) >> 1; 1471 1501 riPrdDepth = piPredDepthMap[ iCurrPosX + iCurrPosY * iCurrStride ]; 1502 #endif 1472 1503 if( piPosX ) 1473 1504 { -
trunk/source/Lib/TLibCommon/TComDepthMapGenerator.h
r56 r77 50 50 51 51 #if DEPTH_MAP_GENERATION 52 52 #if VIDYO_VPS_INTEGRATION 53 class TComVPSAccess // would be better to have a real VPS buffer 54 { 55 public: 56 TComVPSAccess () { clear(); } 57 ~TComVPSAccess() {} 58 59 Void clear () { ::memset( m_aacVPS, 0x00, sizeof( m_aacVPS ) ); m_uiActiceVPSId = 0;} 60 Void addVPS ( TComVPS* pcVPS ) { m_aacVPS[ pcVPS->getVPSId() ] = pcVPS; } 61 TComVPS* getVPS ( UInt uiVPSId ) { return m_aacVPS[ uiVPSId ]; } 62 TComVPS* getActiveVPS ( ) { return m_aacVPS[ m_uiActiceVPSId ]; } 63 Void setActiveVPSId ( UInt activeVPSId ) { m_uiActiceVPSId = activeVPSId; } 64 private: 65 TComVPS* m_aacVPS[ MAX_NUM_VPS ]; 66 UInt m_uiActiceVPSId; 67 }; 68 #endif 53 69 54 70 class TComSPSAccess // would be better to have a real SPS buffer … … 113 129 Void destroy (); 114 130 131 #if VIDYO_VPS_INTEGRATION 132 Void init( TComPrediction* pcPrediction, TComVPSAccess* pcVPSAccess, TComSPSAccess* pcSPSAccess, TComAUPicAccess* pcAUPicAccess ); 133 #endif 115 134 Void init ( TComPrediction* pcPrediction, TComSPSAccess* pcSPSAccess, TComAUPicAccess* pcAUPicAccess ); 116 135 Void uninit (); … … 136 155 137 156 TComPrediction* getPrediction () { return m_pcPrediction; } 157 #if VIDYO_VPS_INTEGRATION 158 TComVPSAccess* getVPSAccess () { return m_pcVPSAccess; } 159 #endif 138 160 TComSPSAccess* getSPSAccess () { return m_pcSPSAccess; } 139 161 TComAUPicAccess* getAUPicAccess() { return m_pcAUPicAccess; } … … 198 220 Bool m_bDecoder; 199 221 TComPrediction* m_pcPrediction; 222 #if VIDYO_VPS_INTEGRATION 223 TComVPSAccess* m_pcVPSAccess; 224 #endif 200 225 TComSPSAccess* m_pcSPSAccess; 201 226 TComAUPicAccess* m_pcAUPicAccess; -
trunk/source/Lib/TLibCommon/TComPic.h
r56 r77 120 120 TComSlice* getSlice(Int i) { return m_apcPicSym->getSlice(i); } 121 121 TComSlice* getCurrSlice() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx); } 122 #if VIDYO_VPS_INTEGRATION 123 TComVPS* getVPS() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getVPS(); } 124 #endif 122 125 TComSPS* getSPS() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getSPS(); } 123 126 Int getPOC() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getPOC(); } -
trunk/source/Lib/TLibCommon/TComResidualGenerator.cpp
r56 r77 221 221 222 222 Bool 223 TComResidualGenerator::getResidualSamples( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv ) 223 TComResidualGenerator::getResidualSamples( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv 224 #if QC_SIMPLIFIEDIVRP_M24938 225 , Bool bRecon 226 #endif 227 ) 224 228 { 225 229 AOF( pcCU ); … … 231 235 iBlkHeight = pcCU->getHeight ( 0 ); 232 236 pcCU->getPic()->getPicYuvRec()->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iXPos, iYPos ); 233 return getResidualSamples( pcCU->getPic(), (UInt)iXPos, (UInt)iYPos, (UInt)iBlkWidth, (UInt)iBlkHeight, pcYuv ); 237 return getResidualSamples( pcCU->getPic(), (UInt)iXPos, (UInt)iYPos, (UInt)iBlkWidth, (UInt)iBlkHeight, pcYuv 238 #if QC_SIMPLIFIEDIVRP_M24938 239 , bRecon 240 #endif 241 ); 234 242 } 235 243 236 244 Bool 237 TComResidualGenerator::getResidualSamples( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv ) 245 TComResidualGenerator::getResidualSamples( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv 246 #if QC_SIMPLIFIEDIVRP_M24938 247 , Bool bRecon 248 #endif 249 ) 238 250 { 239 251 UInt uiBaseViewId = m_pcDepthMapGenerator->getBaseViewId( 0 ); … … 243 255 pcYuv = m_ppcYuvTmp[1]; 244 256 } 245 xSetPredResidualBlock( pcPic, uiBaseViewId, uiXPos, uiYPos, uiBlkWidth, uiBlkHeight, pcYuv ); 257 #if QC_SIMPLIFIEDIVRP_M24938 258 UInt uiXPosInRefView = uiXPos , uiYPosInRefView = uiYPos; 259 #endif 260 xSetPredResidualBlock( pcPic, uiBaseViewId, uiXPos, uiYPos, uiBlkWidth, uiBlkHeight, pcYuv 261 #if QC_SIMPLIFIEDIVRP_M24938 262 , &uiXPosInRefView , &uiYPosInRefView , bRecon 263 #endif 264 ); 265 266 #if QC_SIMPLIFIEDIVRP_M24938 267 return xIsNonZeroByCBF( uiBaseViewId , uiXPosInRefView , uiYPosInRefView , uiBlkWidth , uiBlkHeight ); 268 #else 246 269 return xIsNonZero( pcYuv, uiBlkWidth, uiBlkHeight ); 247 } 270 #endif 271 } 272 273 #if QC_SIMPLIFIEDIVRP_M24938 274 Bool TComResidualGenerator::xIsNonZeroByCBF( UInt uiBaseViewId , UInt uiXPos , UInt uiYPos, UInt uiBlkWidth , UInt uiBlkHeight ) 275 { 276 TComPic* pcBasePic = m_pcAUPicAccess->getPic( uiBaseViewId ); 277 const Int nMaxPicX = pcBasePic->getSPS()->getPicWidthInLumaSamples() - 1; 278 const Int nMaxPicY = pcBasePic->getSPS()->getPicHeightInLumaSamples() - 1; 279 for( UInt y = 0 ; y < uiBlkHeight ; y +=4 ) 280 { 281 for( UInt x = 0 ; x <= uiBlkWidth ; x += 4 ) 282 { // to cover both the mapped CU and the 1-pixel-right-shifted mapped CU 283 Int iCuAddr = 0, iAbsZorderIdx = 0; 284 pcBasePic->getPicYuvRec()->getCUAddrAndPartIdx( Min( uiXPos + x , nMaxPicX ) , Min( uiYPos + y , nMaxPicY ) , iCuAddr , iAbsZorderIdx ); 285 TComDataCU *pCUInRefView = pcBasePic->getCU( iCuAddr ); 286 if( pCUInRefView->isIntra( iAbsZorderIdx ) ) 287 // no inter-view residual pred from a intra CU 288 continue; 289 UInt uiTempTrDepth = pCUInRefView->getTransformIdx( iAbsZorderIdx ); 290 if( pCUInRefView->getCbf( iAbsZorderIdx , TEXT_LUMA , uiTempTrDepth ) 291 || pCUInRefView->getCbf( iAbsZorderIdx , TEXT_CHROMA_U , uiTempTrDepth ) 292 || pCUInRefView->getCbf( iAbsZorderIdx , TEXT_CHROMA_V , uiTempTrDepth ) ) 293 return( true ); 294 } 295 } 296 297 return( false ); 298 } 299 #endif 248 300 249 301 … … 335 387 Pel* pRes = pcCUResidual->getLumaAddr(); 336 388 UInt uiLumaTrMode, uiChromaTrMode; 389 #if LG_RESTRICTEDRESPRED_M24766 390 Int iPUPredResiShift[4]; 391 #endif 337 392 pcCU->convertTransIdx ( 0, pcCU->getTransformIdx( 0 ), uiLumaTrMode, uiChromaTrMode ); 338 393 #if H0736_AVC_STYLE_QP_RANGE … … 361 416 { 362 417 AOF( pcCU->getResPredAvail( 0 ) ); 363 Bool bOK = pcCU->getResidualSamples( 0, m_ppcYuvTmp[0] ); 418 Bool bOK = pcCU->getResidualSamples( 0, 419 #if QC_SIMPLIFIEDIVRP_M24938 420 true, 421 #endif 422 m_ppcYuvTmp[0] ); 364 423 AOF( bOK ); 424 #if LG_RESTRICTEDRESPRED_M24766 425 pcCU->getPUResiPredShift(iPUPredResiShift, 0); 426 pcCUResidual->add(iPUPredResiShift, pcCU->getPartitionSize(0), m_ppcYuvTmp[0], pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) ); 427 #else 365 428 pcCUResidual->add( m_ppcYuvTmp[0], pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) ); 429 #endif 366 430 } 367 431 … … 423 487 424 488 Void 425 TComResidualGenerator::xSetPredResidualBlock( TComPic* pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv ) 489 TComResidualGenerator::xSetPredResidualBlock( TComPic* pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv 490 #if QC_SIMPLIFIEDIVRP_M24938 491 , UInt * puiXPosInRefView , UInt * puiYPosInRefView , Bool bRecon 492 #endif 493 ) 426 494 { 427 495 //===== set and check some basic variables ===== … … 456 524 Pel* pSrcSamplesY= pcBaseRes->getLumaAddr ( 0 ) + uiYPos * iSrcStrideY; 457 525 Pel* pDesSamplesY= pcYuv ->getLumaAddr (); 526 527 #if QC_SIMPLIFIEDIVRP_M24938 528 if( puiXPosInRefView != NULL ) 529 *puiXPosInRefView = Max( 0, Min( iYMaxPosX, iYRefPosX0 ) ); 530 if( puiYPosInRefView != NULL ) 531 *puiYPosInRefView = uiYPos; 532 if( bRecon == false ) 533 return; 534 #endif 535 458 536 for( Int iY = 0; iY < iYHeight; iY++, pSrcSamplesY += iSrcStrideY, pDesSamplesY += iDesStrideY ) 459 537 { -
trunk/source/Lib/TLibCommon/TComResidualGenerator.h
r5 r77 69 69 Void setRecResidualPic ( TComPic* pcPic ); 70 70 71 Bool getResidualSamples ( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv ); 72 Bool getResidualSamples ( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv ); 71 Bool getResidualSamples ( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv 72 #if QC_SIMPLIFIEDIVRP_M24938 73 , Bool bRecon 74 #endif 75 ); 76 Bool getResidualSamples ( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv 77 #if QC_SIMPLIFIEDIVRP_M24938 78 , Bool bRecon 79 #endif 80 ); 73 81 74 82 private: … … 80 88 Void xClearResidual ( TComYuv* pcCUResidual, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight ); 81 89 82 Void xSetPredResidualBlock ( TComPic* pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv ); 90 Void xSetPredResidualBlock ( TComPic* pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv 91 #if QC_SIMPLIFIEDIVRP_M24938 92 , UInt * puiXPosInRefView , UInt * puiYPosInRefView , Bool bRecon 93 #endif 94 ); 83 95 Bool xIsNonZero ( TComYuv* pcYuv, UInt uiBlkWidth, UInt uiBlkHeight ); 96 #if QC_SIMPLIFIEDIVRP_M24938 97 Bool xIsNonZeroByCBF ( UInt uiBaseViewId , UInt uiXPos , UInt uiYPos, UInt uiBlkWidth , UInt uiBlkHeight ); 98 #endif 84 99 85 100 Void xDumpResidual ( TComPic* pcPic, char* pFilenameBase ); -
trunk/source/Lib/TLibCommon/TComRom.cpp
r56 r77 1188 1188 assert( uiWidth == uiHeight ); 1189 1189 1190 UChar uhStartX , uhStartY, uhEndX, uhEndY;1191 Int iStepStartX , iStepStartY, iStepEndX, iStepEndY;1190 UChar uhStartX = 0, uhStartY = 0, uhEndX = 0, uhEndY = 0; 1191 Int iStepStartX = 0, iStepStartY = 0, iStepEndX = 0, iStepEndY = 0; 1192 1192 1193 1193 UInt uiBlockSize = 0; -
trunk/source/Lib/TLibCommon/TComSlice.cpp
r61 r77 1305 1305 } 1306 1306 1307 // ------------------------------------------------------------------------------------------------ 1308 // Video parameter set (VPS) 1309 // ------------------------------------------------------------------------------------------------ 1310 #if VIDYO_VPS_INTEGRATION 1311 TComVPS::TComVPS() 1312 : m_VPSId ( 0) 1313 , m_uiMaxTLayers ( 1) 1314 , m_uiMaxLayers ( 1) 1315 , m_bTemporalIdNestingFlag (false) 1316 , m_uiExtensionType ( 0) 1317 { 1318 for( Int i = 0; i < MAX_LAYER_NUM; i++) 1319 { 1320 m_uiDependentLayer[i] = i? i-1: 0; 1321 m_bDependentFlag[i] = false; 1322 m_uiViewId[i] = 0; 1323 m_bDepthFlag[i] = 0; 1324 m_iViewOrderIdx[i] = 0; 1325 } 1326 1327 for( Int i = 0; i < MAX_TLAYER; i++) 1328 { 1329 m_numReorderPics[i] = 0; 1330 m_uiMaxDecPicBuffering[i] = 0; 1331 m_uiMaxLatencyIncrease[i] = 0; 1332 } 1333 } 1334 1335 TComVPS::~TComVPS() 1336 { 1337 1338 1339 } 1340 1341 #endif 1342 1307 1343 1308 1344 // ------------------------------------------------------------------------------------------------ … … 1311 1347 1312 1348 TComSPS::TComSPS() 1349 #if VIDYO_VPS_INTEGRATION 1350 : m_VPSId ( 0) 1351 , m_SPSId ( 0) 1352 #else 1313 1353 : m_SPSId ( 0) 1354 #endif 1314 1355 , m_ProfileIdc ( 0) 1315 1356 , m_LevelIdc ( 0) … … 2155 2196 , m_ppsMap(MAX_NUM_PPS) 2156 2197 , m_apsMap(MAX_NUM_APS) 2198 #if VIDYO_VPS_INTEGRATION 2199 , m_vpsMap(MAX_NUM_VPS) 2200 #endif 2157 2201 { 2158 2202 } -
trunk/source/Lib/TLibCommon/TComSlice.h
r56 r77 144 144 #endif 145 145 146 #if VIDYO_VPS_INTEGRATION 147 /// VPS class 148 149 class TComVPS 150 { 151 private: 152 Int m_VPSId; 153 UInt m_uiMaxTLayers; 154 UInt m_uiMaxLayers; 155 Bool m_bTemporalIdNestingFlag; 156 157 UInt m_uiExtensionType; 158 159 Bool m_bDependentFlag[MAX_LAYER_NUM]; 160 UInt m_uiViewId[MAX_LAYER_NUM]; 161 Bool m_bDepthFlag[MAX_LAYER_NUM]; 162 Int m_iViewOrderIdx[MAX_LAYER_NUM]; 163 UInt m_uiDependentLayer[MAX_LAYER_NUM]; 164 165 UInt m_numReorderPics[MAX_TLAYER]; 166 UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; 167 UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; 168 169 public: 170 TComVPS(); 171 virtual ~TComVPS(); 172 173 Int getVPSId () { return m_VPSId; } 174 Void setVPSId (Int i) { m_VPSId = i; } 175 176 UInt getMaxTLayers () { return m_uiMaxTLayers; } 177 Void setMaxTLayers (UInt t) { m_uiMaxTLayers = t; } 178 179 UInt getMaxLayers () { return m_uiMaxLayers; } 180 Void setMaxLayers (UInt l) { m_uiMaxLayers = l; } 181 182 Bool getTemporalNestingFlag () { return m_uiMaxLayers; } 183 Void setTemporalNestingFlag (UInt t) { m_bTemporalIdNestingFlag = t; } 184 185 Void setExtensionType(UInt v) { m_uiExtensionType = v; } 186 UInt getExtensionType() { return m_uiExtensionType; } 187 188 Void setDependentFlag(Bool d, UInt layer) { m_bDependentFlag[layer] = d; } 189 Bool getDependentFlag(UInt layer) { return m_bDependentFlag[layer]; } 190 191 Void setViewId(UInt v, UInt layer) { m_uiViewId[layer] = v; } 192 UInt getViewId(UInt layer) { return m_uiViewId[layer]; } 193 194 Void setDepthFlag(Bool d, UInt layer) { m_bDepthFlag[layer] = d; } 195 Bool getDepthFlag(UInt layer) { return m_bDepthFlag[layer]; } 196 197 Void setViewOrderIdx(Int v, UInt layer) { m_iViewOrderIdx[layer] = v; } 198 Int getViewOrderIdx(UInt layer) { return m_iViewOrderIdx[layer]; } 199 200 Void setDependentLayer(UInt v, UInt layer) { m_uiDependentLayer[layer] = v; } 201 UInt getDependentLayer(UInt layer) { return m_uiDependentLayer[layer]; } 202 203 Void setNumReorderPics(UInt v, UInt tLayer) { m_numReorderPics[tLayer] = v; } 204 UInt getNumReorderPics(UInt tLayer) { return m_numReorderPics[tLayer]; } 205 206 Void setMaxDecPicBuffering(UInt v, UInt tLayer) { m_uiMaxDecPicBuffering[tLayer] = v; } 207 UInt getMaxDecPicBuffering(UInt tLayer) { return m_uiMaxDecPicBuffering[tLayer]; } 208 209 Void setMaxLatencyIncrease(UInt v, UInt tLayer) { m_uiMaxLatencyIncrease[tLayer] = v; } 210 UInt getMaxLatencyIncrease(UInt tLayer) { return m_uiMaxLatencyIncrease[tLayer]; } 211 212 }; 213 214 #endif 215 146 216 /// SPS class 147 217 class TComSPS 148 218 { 149 219 private: 220 #if VIDYO_VPS_INTEGRATION 221 Int m_VPSId; 222 #endif 150 223 Int m_SPSId; 151 224 Int m_ProfileIdc; … … 305 378 TComSPS(); 306 379 virtual ~TComSPS(); 307 380 #if VIDYO_VPS_INTEGRATION 381 Int getVPSId () { return m_VPSId; } 382 Void setVPSId (Int i) { m_VPSId = i; } 383 #endif 308 384 Int getSPSId () { return m_SPSId; } 309 385 Void setSPSId (Int i) { m_SPSId = i; } … … 1109 1185 1110 1186 // access channel 1187 #if VIDYO_VPS_INTEGRATION 1188 TComVPS* m_pcVPS; 1189 #endif 1111 1190 TComSPS* m_pcSPS; 1112 1191 TComPPS* m_pcPPS; … … 1193 1272 Void initTiles(); 1194 1273 1195 1274 #if VIDYO_VPS_INTEGRATION 1275 Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } 1276 TComVPS* getVPS () { return m_pcVPS; } 1277 #endif 1196 1278 Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } 1197 1279 TComSPS* getSPS () { return m_pcSPS; } … … 1538 1620 ParameterSetManager(); 1539 1621 virtual ~ParameterSetManager(); 1540 1622 #if VIDYO_VPS_INTEGRATION 1623 //! store video parameter set and take ownership of it 1624 Void storeVPS(TComVPS *vps) { m_vpsMap.storePS( vps->getVPSId(), vps); }; 1625 //! get pointer to existing video parameter set 1626 TComVPS* getVPS(Int vpsId) { return m_vpsMap.getPS(vpsId); }; 1627 TComVPS* getFirstVPS() { return m_vpsMap.getFirstPS(); }; 1628 #endif 1541 1629 //! store sequence parameter set and take ownership of it 1542 1630 Void storeSPS(TComSPS *sps) { m_spsMap.storePS( sps->getSPSId(), sps); }; … … 1560 1648 ParameterSetMap<TComPPS> m_ppsMap; 1561 1649 ParameterSetMap<TComAPS> m_apsMap; 1650 #if VIDYO_VPS_INTEGRATION 1651 ParameterSetMap<TComVPS> m_vpsMap; 1652 #endif 1562 1653 }; 1563 1654 -
trunk/source/Lib/TLibCommon/TComYuv.cpp
r56 r77 392 392 } 393 393 394 394 #if LG_RESTRICTEDRESPRED_M24766 395 Void 396 TComYuv::add(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract ) 397 { 398 addLuma (iPUResiPredShift, uhPartitionSize, pcYuvAdd, iWidth, iHeight, bSubtract ); 399 addChroma (iPUResiPredShift, uhPartitionSize, pcYuvAdd, iWidth>>1, iHeight>>1, bSubtract ); 400 } 401 #else 395 402 Void 396 403 TComYuv::add( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract ) … … 399 406 addChroma ( pcYuvAdd, iWidth>>1, iHeight>>1, bSubtract ); 400 407 } 401 408 #endif 409 410 #if LG_RESTRICTEDRESPRED_M24766 411 void 412 TComYuv::getPUXYOffset(PartSize uhPartitionSize, Int iWidth, Int iHeight, Int &iXOffset, Int &iYOffset) 413 { 414 switch(uhPartitionSize) 415 { 416 case SIZE_2NxN: 417 iXOffset = iWidth; iYOffset = iHeight >> 1; break; 418 case SIZE_2NxnU: 419 iXOffset = iWidth; iYOffset = iHeight >> 2; break; 420 case SIZE_2NxnD: 421 iXOffset = iWidth; iYOffset = (iHeight >> 1) + (iHeight >> 2); break; 422 case SIZE_Nx2N: 423 iXOffset = iWidth >> 1; iYOffset = iHeight; break; 424 case SIZE_nLx2N: 425 iXOffset = iWidth >> 2; iYOffset = iHeight; break; 426 case SIZE_nRx2N: 427 iXOffset = (iWidth >> 1) + (iWidth >> 2); iYOffset = iHeight; break; 428 case SIZE_NxN: 429 iXOffset = iWidth >> 1; iYOffset = iHeight >> 1; break; 430 default: 431 assert(uhPartitionSize == SIZE_2Nx2N); 432 iXOffset = iWidth; iYOffset = iHeight; break; 433 } 434 } 435 #endif 436 437 #if LG_RESTRICTEDRESPRED_M24766 438 Void 439 TComYuv::addLuma(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract ) 440 #else 402 441 Void 403 442 TComYuv::addLuma( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract ) 443 #endif 404 444 { 405 445 Int iScale = ( bSubtract ? -1 : 1 ); … … 408 448 Pel* pAddSamples = pcYuvAdd->getLumaAddr(); 409 449 Pel* pDstSamples = getLumaAddr(); 450 451 #if LG_RESTRICTEDRESPRED_M24766 452 Int iXOffset, iYOffset; 453 454 getPUXYOffset(uhPartitionSize, iWidth, iHeight, iXOffset, iYOffset); 455 456 for( Int iY = 0; iY < iYOffset; iY++, pDstSamples += iDstStride, pAddSamples += iAddStride ) 457 { 458 if(iPUResiPredShift[0] >= 0) 459 { 460 for( Int iX = 0; iX < iXOffset; iX++ ) 461 { 462 pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[0]); 463 } 464 } 465 466 if(iPUResiPredShift[1] >= 0) 467 { 468 for( Int iX = iXOffset; iX < iWidth; iX++ ) 469 { 470 pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[1]); 471 } 472 } 473 } 474 475 for( Int iY = iYOffset; iY < iHeight; iY++, pDstSamples += iDstStride, pAddSamples += iAddStride ) 476 { 477 if(iPUResiPredShift[2] >= 0) 478 { 479 for( Int iX = 0; iX < iXOffset; iX++ ) 480 { 481 pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[2]); 482 } 483 } 484 485 if(iPUResiPredShift[3] >= 0) 486 { 487 for( Int iX = iXOffset; iX < iWidth; iX++ ) 488 { 489 pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[3]); 490 } 491 } 492 } 493 #else 410 494 for( Int iY = 0; iY < iHeight; iY++, pDstSamples += iDstStride, pAddSamples += iAddStride ) 411 495 { … … 415 499 } 416 500 } 417 } 418 501 #endif 502 } 503 504 #if LG_RESTRICTEDRESPRED_M24766 505 Void 506 TComYuv::addChroma(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract ) 507 #else 419 508 Void 420 509 TComYuv::addChroma( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract ) 510 #endif 421 511 { 422 512 Int iScale = ( bSubtract ? -1 : 1 ); … … 427 517 Pel* pDstSamplesCb = getCbAddr(); 428 518 Pel* pDstSamplesCr = getCrAddr(); 519 520 #if LG_RESTRICTEDRESPRED_M24766 521 Int iXOffset, iYOffset; 522 523 getPUXYOffset(uhPartitionSize, iWidth, iHeight, iXOffset, iYOffset); 524 525 for( Int iY = 0; iY < iYOffset; iY++, pDstSamplesCb += iDstStride, pAddSamplesCb += iAddStride, 526 pDstSamplesCr += iDstStride, pAddSamplesCr += iAddStride ) 527 { 528 if(iPUResiPredShift[0] >= 0) 529 { 530 for( Int iX = 0; iX < iXOffset; iX++ ) 531 { 532 pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[0]); 533 pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[0]); 534 } 535 } 536 537 if(iPUResiPredShift[1] >= 0) 538 { 539 for( Int iX = iXOffset; iX < iWidth; iX++ ) 540 { 541 pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[1]); 542 pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[1]); 543 } 544 } 545 } 546 547 for( Int iY = iYOffset; iY < iHeight; iY++, pDstSamplesCb += iDstStride, pAddSamplesCb += iAddStride, 548 pDstSamplesCr += iDstStride, pAddSamplesCr += iAddStride ) 549 { 550 if(iPUResiPredShift[2] >= 0) 551 { 552 for( Int iX = 0; iX < iXOffset; iX++ ) 553 { 554 pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[2]); 555 pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[2]); 556 } 557 } 558 559 if(iPUResiPredShift[3] >= 0) 560 { 561 for( Int iX = iXOffset; iX < iWidth; iX++ ) 562 { 563 pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[3]); 564 pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[3]); 565 } 566 } 567 } 568 #else 429 569 for( Int iY = 0; iY < iHeight; iY++, pDstSamplesCb += iDstStride, pAddSamplesCb += iAddStride, 430 570 pDstSamplesCr += iDstStride, pAddSamplesCr += iAddStride ) … … 436 576 } 437 577 } 578 #endif 438 579 } 439 580 … … 535 676 } 536 677 678 #if LG_RESTRICTEDRESPRED_M24766 679 Void TComYuv::subtract(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ) 680 { 681 subtractLuma (iPUResiPredShift, uhPartitionSize, pcYuvSrc0, pcYuvSrc1, uiTrUnitIdx, uiPartSize ); 682 subtractChroma(iPUResiPredShift, uhPartitionSize, pcYuvSrc0, pcYuvSrc1, uiTrUnitIdx, uiPartSize>>1 ); 683 } 684 #else 537 685 Void TComYuv::subtract( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ) 538 686 { … … 540 688 subtractChroma( pcYuvSrc0, pcYuvSrc1, uiTrUnitIdx, uiPartSize>>1 ); 541 689 } 542 690 #endif 691 692 #if LG_RESTRICTEDRESPRED_M24766 693 Void TComYuv::subtractLuma(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ) 694 #else 543 695 Void TComYuv::subtractLuma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ) 696 #endif 544 697 { 545 698 Int x, y; … … 552 705 Int iSrc1Stride = pcYuvSrc1->getStride(); 553 706 Int iDstStride = getStride(); 707 708 #if LG_RESTRICTEDRESPRED_M24766 709 Int iXOffset, iYOffset; 710 711 getPUXYOffset(uhPartitionSize, uiPartSize, uiPartSize, iXOffset, iYOffset); 712 713 for ( y = uiPartSize-1; y >= iYOffset; y-- ) 714 { 715 if(iPUResiPredShift[3] >= 0) 716 { 717 for ( x = uiPartSize-1; x >= iXOffset; x-- ) 718 { 719 pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[3]); 720 } 721 } 722 723 if(iPUResiPredShift[2] >= 0) 724 { 725 for ( x = iXOffset-1; x >= 0; x-- ) 726 { 727 pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[2]); 728 } 729 } 730 pSrc0 += iSrc0Stride; 731 pSrc1 += iSrc1Stride; 732 pDst += iDstStride; 733 } 734 735 for ( y = iYOffset-1; y >= 0; y-- ) 736 { 737 if(iPUResiPredShift[1] >= 0) 738 { 739 for ( x = uiPartSize-1; x >= iXOffset; x-- ) 740 { 741 pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[3]); 742 } 743 } 744 745 if(iPUResiPredShift[0] >= 0) 746 { 747 for ( x = iXOffset-1; x >= 0; x-- ) 748 { 749 pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[2]); 750 } 751 } 752 pSrc0 += iSrc0Stride; 753 pSrc1 += iSrc1Stride; 754 pDst += iDstStride; 755 } 756 757 #else 554 758 for ( y = uiPartSize-1; y >= 0; y-- ) 555 759 { … … 562 766 pDst += iDstStride; 563 767 } 564 } 565 768 #endif 769 } 770 771 #if LG_RESTRICTEDRESPRED_M24766 772 Void TComYuv::subtractChroma(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ) 773 #else 566 774 Void TComYuv::subtractChroma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ) 775 #endif 567 776 { 568 777 Int x, y; … … 578 787 Int iSrc1Stride = pcYuvSrc1->getCStride(); 579 788 Int iDstStride = getCStride(); 789 #if LG_RESTRICTEDRESPRED_M24766 790 Int iXOffset, iYOffset; 791 792 getPUXYOffset(uhPartitionSize, uiPartSize, uiPartSize, iXOffset, iYOffset); 793 794 for ( y = uiPartSize-1; y >= iYOffset; y-- ) 795 { 796 if(iPUResiPredShift[3] >= 0) 797 { 798 for ( x = uiPartSize-1; x >= iXOffset; x-- ) 799 { 800 pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[3]); 801 pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[3]); 802 } 803 } 804 805 if(iPUResiPredShift[2] >= 0) 806 { 807 for ( x = iXOffset-1; x >= 0; x-- ) 808 { 809 pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[2]); 810 pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[2]); 811 } 812 } 813 pSrcU0 += iSrc0Stride; 814 pSrcU1 += iSrc1Stride; 815 pSrcV0 += iSrc0Stride; 816 pSrcV1 += iSrc1Stride; 817 pDstU += iDstStride; 818 pDstV += iDstStride; 819 } 820 821 for ( y = iYOffset-1; y >= 0; y-- ) 822 { 823 if(iPUResiPredShift[1] >= 0) 824 { 825 for ( x = uiPartSize-1; x >= iXOffset; x-- ) 826 { 827 pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[1]); 828 pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[1]); 829 } 830 } 831 832 if(iPUResiPredShift[0] >= 0) 833 { 834 for ( x = iXOffset-1; x >= 0; x-- ) 835 { 836 pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[0]); 837 pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[0]); 838 } 839 } 840 pSrcU0 += iSrc0Stride; 841 pSrcU1 += iSrc1Stride; 842 pSrcV0 += iSrc0Stride; 843 pSrcV1 += iSrc1Stride; 844 pDstU += iDstStride; 845 pDstV += iDstStride; 846 } 847 #else 580 848 for ( y = uiPartSize-1; y >= 0; y-- ) 581 849 { … … 592 860 pDstV += iDstStride; 593 861 } 862 #endif 594 863 } 595 864 -
trunk/source/Lib/TLibCommon/TComYuv.h
r56 r77 146 146 Void addClipPartLuma ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ); //GT 147 147 148 148 #if LG_RESTRICTEDRESPRED_M24766 149 149 // pcYuvSrc0 - pcYuvSrc1 -> m_apiBuf 150 Void subtract (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ); 151 Void subtractLuma (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ); 152 Void subtractChroma (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ); 153 #else 150 154 Void subtract ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ); 151 155 Void subtractLuma ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ); 152 156 Void subtractChroma ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ); 157 #endif 153 158 154 159 // (pcYuvSrc0 + pcYuvSrc1)/2 for YUV partition … … 161 166 // Remove High frequency 162 167 Void removeHighFreq ( TComYuv* pcYuvSrc, UInt uiPartIdx, UInt uiWidht, UInt uiHeight ); 163 168 #if LG_RESTRICTEDRESPRED_M24766 169 void getPUXYOffset (PartSize uhPartitionSize, Int iWidth, Int iHeight, Int &iXOffset, Int &iYOffset); 170 Void add (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract = false ); 171 Void addLuma (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract ); 172 Void addChroma (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract ); 173 #else 164 174 Void add ( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract = false ); 165 175 Void addLuma ( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract ); 166 176 Void addChroma ( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract ); 177 #endif 167 178 168 179 Void clip ( Int iWidth, Int iHeight ); -
trunk/source/Lib/TLibCommon/TypeDef.h
r56 r77 46 46 #define HHI_INTER_VIEW_MOTION_PRED 1 // inter-view motion parameter prediction 47 47 #define HHI_INTER_VIEW_RESIDUAL_PRED 1 // inter-view residual prediction 48 #define HHI_FIX 1 // inter-view prediction and other fixes 48 49 49 50 #define HHI_VSO 1 50 51 #define HHI_VSO_LS_TABLE 1 51 52 #define HHI_VSO_DIST_INT 1 53 #define HHI_VSO_SYNTH_DIST_OUT 0 54 #define HHI_VSO_COLOR_PLANES 1 52 55 53 56 #define HHI_INTERVIEW_SKIP 1 … … 67 70 #define HHI_FULL_PEL_DEPTH_MAP_MV_ACC 1 // full-pel mv accuracy for depth maps 68 71 69 70 72 #if HHI_INTER_VIEW_MOTION_PRED 73 #define SAIT_IMPROV_MOTION_PRED_M24829 1 // improved inter-view motion vector prediction 74 #else 75 #define SAIT_IMPROV_MOTION_PRED_M24829 0 76 #endif 77 78 #if HHI_INTER_VIEW_RESIDUAL_PRED 79 #define LG_RESTRICTEDRESPRED_M24766 1 // restricted inter-view residual prediction 80 #define QC_SIMPLIFIEDIVRP_M24938 1 81 #else 82 #define LG_RESTRICTEDRESPRED_M24766 0 83 #define QC_SIMPLIFIEDIVRP_M24938 0 84 #endif 71 85 72 86 … … 344 358 #define COMPLETE_SLICES_IN_TILE 1 // Among the constraints between slices and tiles, all slices within a tile shall be complete (JCTVC-H0348/JCTVC-H0463) for SliceMode 1&2 345 359 #define WPP_SIMPLIFICATION 1 // JCTVC-H0349/JCTVC-0517 360 361 // ==================================================================================================================== 362 // VPS INTEGRATION 363 // ==================================================================================================================== 364 #define VIDYO_VPS_INTEGRATION 1 365 #if VIDYO_VPS_INTEGRATION 366 #define MAX_NUM_VPS 10 367 #endif 368 346 369 // ==================================================================================================================== 347 370 // Basic type redefinition … … 751 774 }; 752 775 753 754 776 //! \} 755 777 -
trunk/source/Lib/TLibDecoder/NALread.cpp
r56 r77 136 136 // unsigned reserved_one_5bits = bs.read(5); 137 137 // assert(reserved_one_5bits == 1); 138 #if VIDYO_VPS_INTEGRATION 139 nalu.m_layerId = bs.read(5) - 1; 140 #else 138 141 nalu.m_viewId = bs.read(4)-1; 139 142 nalu.m_isDepth = bs.read(1); 140 143 #endif 141 144 #if H0566_TLA 142 145 if ( nalu.m_temporalId ) … … 159 162 { 160 163 nalu.m_temporalId = bs.read(3); 164 #if VIDYO_VPS_INTEGRATION 165 nalu.m_layerId = bs.read(5) - 1; 166 #else 161 167 nalu.m_OutputFlag = bs.read(1); 162 168 // unsigned reserved_one_4bits = bs.read(4); … … 164 170 nalu.m_viewId = bs.read(3)-1; 165 171 nalu.m_isDepth = bs.read(1); 172 #endif 166 173 167 174 #if H0566_TLA -
trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
r56 r77 1339 1339 } 1340 1340 1341 #if VIDYO_VPS_INTEGRATION 1342 Void TDecCavlc::parseVPS(TComVPS* pcVPS) 1343 { 1344 UInt uiCode; 1345 Int iCode; 1346 1347 READ_CODE( 3, uiCode, "max_temporal_layers_minus1" ); pcVPS->setMaxTLayers( uiCode + 1 ); 1348 READ_CODE( 5, uiCode, "max_layers_minus1" ); pcVPS->setMaxLayers( uiCode + 1 ); 1349 READ_FLAG( uiCode, "temporal_id_nesting_flag" ); pcVPS->setTemporalNestingFlag( uiCode ? true:false ); 1350 READ_UVLC( uiCode, "video_parameter_set_id" ); pcVPS->setVPSId( uiCode ); 1351 for(UInt i = 0; i <= pcVPS->getMaxTLayers()-1; i++) 1352 { 1353 READ_UVLC( uiCode, "max_dec_pic_buffering[i]" ); pcVPS->setMaxDecPicBuffering( uiCode, i ); 1354 READ_UVLC( uiCode, "num_reorder_pics[i]" ); pcVPS->setNumReorderPics( uiCode, i ); 1355 READ_UVLC( uiCode, "max_latency_increase[i]" ); pcVPS->setMaxLatencyIncrease( uiCode, i ); 1356 } 1357 1358 READ_CODE( 1, uiCode, "bit_equal_to_one" ); assert( uiCode ); 1359 1360 if( pcVPS->getMaxLayers() - 1 > 0 ) 1361 { 1362 READ_UVLC( uiCode, "extension_type" ); pcVPS->setExtensionType( uiCode ); 1363 1364 pcVPS->setViewOrderIdx( 0, 0 ); 1365 pcVPS->setViewId( 0, 0 ); 1366 pcVPS->setDepthFlag( 0, 0 ); 1367 for(UInt i = 1; i <= pcVPS->getMaxLayers()-1; i++) 1368 { 1369 READ_FLAG( uiCode, "dependent_flag[i]" ); pcVPS->setDependentFlag( uiCode ? true:false, i); 1370 if( pcVPS->getDependentFlag(i) ) 1371 { 1372 READ_UVLC( uiCode, "delta_reference_layer_id_minus1[i]" ); pcVPS->setDependentLayer( i - uiCode + 1, i ); 1373 if( pcVPS->getExtensionType() == VPS_EXTENSION_TYPE_MULTI_VIEW ) 1374 { 1375 READ_UVLC( uiCode, "view_id[i]" ); pcVPS->setViewId( uiCode, i ); 1376 READ_FLAG( uiCode, "depth_flag[i]" ); pcVPS->setDepthFlag( uiCode ? true:false, i ); 1377 READ_SVLC( iCode, "view_order_idx[i]" ); pcVPS->setViewOrderIdx( iCode, i ); 1378 } 1379 1380 } 1381 } 1382 } 1383 1384 READ_FLAG( uiCode, "vps_extension_flag" ); assert(!uiCode); 1385 //future extensions go here.. 1386 1387 return; 1388 } 1389 1390 #endif 1391 1341 1392 #if HHI_MPI 1342 1393 Void TDecCavlc::parseSPS(TComSPS* pcSPS, Bool bIsDepth) … … 1356 1407 READ_CODE( 8, uiCode, "level_idc" ); pcSPS->setLevelIdc( uiCode ); 1357 1408 READ_UVLC( uiCode, "seq_parameter_set_id" ); pcSPS->setSPSId( uiCode ); 1409 #if VIDYO_VPS_INTEGRATION 1410 READ_UVLC( uiCode, "video_parameter_set_id" ); pcSPS->setVPSId( uiCode ); 1411 #endif 1358 1412 READ_UVLC( uiCode, "chroma_format_idc" ); pcSPS->setChromaFormatIdc( uiCode ); 1359 1413 READ_CODE( 3, uiCode, "max_temporal_layers_minus1" ); pcSPS->setMaxTLayers( uiCode+1 ); … … 1837 1891 rpcSlice->setPOC( iPOCmsb+iPOClsb ); 1838 1892 1893 #if HHI_FIX 1894 if( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDV && rpcSlice->getPOC() == 0 ) 1895 #else 1839 1896 if( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDV ) 1897 #endif 1840 1898 { 1841 1899 TComReferencePictureSet* rps = rpcSlice->getLocalRPS(); -
trunk/source/Lib/TLibDecoder/TDecCAVLC.h
r56 r77 113 113 Void parseQtRootCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt& uiQtRootCbf ); 114 114 115 #if VIDYO_VPS_INTEGRATION 116 Void parseVPS ( TComVPS* pcVPS ); 117 #endif 115 118 #if HHI_MPI 116 119 Void parseSPS ( TComSPS* pcSPS, Bool bIsDepth ); -
trunk/source/Lib/TLibDecoder/TDecCu.cpp
r56 r77 636 636 { 637 637 AOF( pcCU->getResPredAvail( 0 ) ); 638 Bool bOK = pcCU->getResidualSamples( 0, m_ppcYuvResPred[uiDepth] ); 638 Bool bOK = pcCU->getResidualSamples( 0, 639 #if QC_SIMPLIFIEDIVRP_M24938 640 true, 641 #endif 642 m_ppcYuvResPred[uiDepth] ); 639 643 AOF( bOK ); 644 #if LG_RESTRICTEDRESPRED_M24766 645 Int iPUResiPredShift[4]; 646 pcCU->getPUResiPredShift(iPUResiPredShift, 0); 647 m_ppcYuvReco[uiDepth]->add(iPUResiPredShift, pcCU->getPartitionSize(0), m_ppcYuvResPred[uiDepth], pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) ); 648 #else 640 649 m_ppcYuvReco[uiDepth]->add( m_ppcYuvResPred[uiDepth], pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) ); 650 #endif 641 651 } 642 652 #endif -
trunk/source/Lib/TLibDecoder/TDecEntropy.cpp
r56 r77 98 98 if( bResPredAllowed ) 99 99 { 100 bResPredAvailable = pcSubCU->getResidualSamples( uiPUIdx ); 100 bResPredAvailable = pcSubCU->getResidualSamples( uiPUIdx 101 #if QC_SIMPLIFIEDIVRP_M24938 102 , false 103 #endif 104 ); 101 105 } 102 106 … … 104 108 if( bResPredAvailable ) 105 109 { 110 #if LG_RESTRICTEDRESPRED_M24766 111 Int iPUResiPredShift[4]; 112 pcCU->getPUResiPredShift(iPUResiPredShift, uiAbsPartIdx); 113 if(iPUResiPredShift[0] >= 0 || iPUResiPredShift[1] >= 0 || iPUResiPredShift[2] >= 0 || iPUResiPredShift[3] >= 0 ) 114 #endif 106 115 m_pcEntropyDecoderIf->parseResPredFlag( pcCU, bResPredFlag, uiAbsPartIdx, uiDepth ); 107 116 } -
trunk/source/Lib/TLibDecoder/TDecEntropy.h
r56 r77 71 71 #endif 72 72 73 #if VIDYO_VPS_INTEGRATION 74 virtual Void parseVPS ( TComVPS* pcVPS ) = 0; 75 #endif 73 76 #if HHI_MPI 74 77 virtual Void parseSPS ( TComSPS* pcSPS, Bool bIsDepth ) = 0; … … 163 166 Void resetEntropy ( TComSlice* p) { m_pcEntropyDecoderIf->resetEntropy(p); } 164 167 168 #if VIDYO_VPS_INTEGRATION 169 Void decodeVPS ( TComVPS* pcVPS ) { m_pcEntropyDecoderIf->parseVPS(pcVPS); } 170 #endif 171 165 172 #if HHI_MPI 166 173 Void decodeSPS ( TComSPS* pcSPS, Bool bIsDepth ) { m_pcEntropyDecoderIf->parseSPS(pcSPS, bIsDepth); } -
trunk/source/Lib/TLibDecoder/TDecSbac.h
r56 r77 87 87 Void setBitstream ( TComInputBitstream* p ) { m_pcBitstream = p; m_pcTDecBinIf->init( p ); } 88 88 89 #if VIDYO_VPS_INTEGRATION 90 Void parseVPS ( TComVPS* pcVPS ) {} 91 #endif 89 92 #if HHI_MPI 90 93 Void parseSPS ( TComSPS* pcSPS, Bool bIsDepth ) {} -
trunk/source/Lib/TLibDecoder/TDecSlice.cpp
r56 r77 446 446 , m_ppsBuffer(16) 447 447 , m_apsBuffer(64) 448 #if VIDYO_VPS_INTEGRATION 449 , m_vpsBuffer(16) 450 #endif 448 451 { 449 452 … … 454 457 455 458 } 459 460 #if VIDYO_VPS_INTEGRATION 461 TComVPS* ParameterSetManagerDecoder::getPrefetchedVPS (Int vpsId) 462 { 463 if (m_vpsBuffer.getPS(vpsId) != NULL ) 464 { 465 return m_vpsBuffer.getPS(vpsId); 466 } 467 else 468 { 469 return getVPS(vpsId); 470 } 471 } 472 #endif 456 473 457 474 TComSPS* ParameterSetManagerDecoder::getPrefetchedSPS (Int spsId) … … 496 513 m_ppsMap.mergePSList(m_ppsBuffer); 497 514 m_spsMap.mergePSList(m_spsBuffer); 515 #if VIDYO_VPS_INTEGRATION 516 m_vpsMap.mergePSList(m_vpsBuffer); 517 #endif 498 518 } 499 519 -
trunk/source/Lib/TLibDecoder/TDecSlice.h
r56 r77 96 96 Void storePrefetchedAPS(TComAPS *aps) { m_apsBuffer.storePS( aps->getAPSID(), aps); }; 97 97 TComAPS* getPrefetchedAPS (Int apsId); 98 98 #if VIDYO_VPS_INTEGRATION 99 Void storePrefetchedVPS(TComVPS *vps) { m_vpsBuffer.storePS( vps->getVPSId(), vps); }; 100 TComVPS* getPrefetchedVPS (Int vpsId); 101 #endif 99 102 Void applyPrefetchedPS(); 100 103 … … 103 106 ParameterSetMap<TComPPS> m_ppsBuffer; 104 107 ParameterSetMap<TComAPS> m_apsBuffer; 108 #if VIDYO_VPS_INTEGRATION 109 ParameterSetMap<TComVPS> m_vpsBuffer; 110 #endif 105 111 }; 106 112 -
trunk/source/Lib/TLibDecoder/TDecTop.cpp
r57 r77 319 319 m_tAppDecTop = pcTAppDecTop; 320 320 #if DEPTH_MAP_GENERATION 321 #if VIDYO_VPS_INTEGRATION 322 m_cDepthMapGenerator.init( &m_cPrediction, m_tAppDecTop->getVPSAccess(), m_tAppDecTop->getSPSAccess(), m_tAppDecTop->getAUPicAccess() ); 323 #else 321 324 m_cDepthMapGenerator.init( &m_cPrediction, m_tAppDecTop->getSPSAccess(), m_tAppDecTop->getAUPicAccess() ); 325 #endif 322 326 #endif 323 327 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 571 575 TComSPS *sps = m_parameterSetManagerDecoder.getSPS(pps->getSPSId()); 572 576 assert (sps != 0); 573 577 #if VIDYO_VPS_INTEGRATION 578 TComVPS *vps = m_parameterSetManagerDecoder.getVPS(sps->getVPSId()); 579 assert (vps != 0); 580 if( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ) 581 // VPS can only be activated on IDR or CRA... 582 getTAppDecTop()->getVPSAccess()->setActiveVPSId( sps->getVPSId() ); 583 #endif 574 584 m_apcSlicePilot->setPPS(pps); 575 585 m_apcSlicePilot->setSPS(sps); 586 #if VIDYO_VPS_INTEGRATION 587 m_apcSlicePilot->setVPS(vps); 588 #endif 576 589 pps->setSPS(sps); 577 590 … … 613 626 m_apcSlicePilot->setPPS(m_parameterSetManagerDecoder.getPrefetchedPPS(0)); 614 627 m_apcSlicePilot->setSPS(m_parameterSetManagerDecoder.getPrefetchedSPS(0)); 628 #if VIDYO_VPS_INTEGRATION 629 m_apcSlicePilot->setVPS(m_parameterSetManagerDecoder.getPrefetchedVPS(0)); 630 #endif 615 631 m_apcSlicePilot->initTiles(); 616 632 … … 629 645 if( m_bFirstSliceInPicture ) 630 646 { 647 #if VIDYO_VPS_INTEGRATION 648 if( m_apcSlicePilot->getVPS()->getViewId(nalu.m_layerId) == 0 ) { m_nalUnitTypeBaseView = nalu.m_nalUnitType; } 649 else { m_nalUnitTypeBaseView = m_tAppDecTop->getTDecTop( 0, m_apcSlicePilot->getVPS()->getDepthFlag(nalu.m_layerId) )->getNalUnitTypeBaseView(); } 650 #else 631 651 if( nalu.m_viewId == 0 ) { m_nalUnitTypeBaseView = nalu.m_nalUnitType; } 632 652 else { m_nalUnitTypeBaseView = m_tAppDecTop->getTDecTop( 0, nalu.m_isDepth )->getNalUnitTypeBaseView(); } 653 #endif 654 633 655 m_apcSlicePilot->setNalUnitTypeBaseViewMvc( m_nalUnitTypeBaseView ); 634 656 } … … 929 951 930 952 // Set reference list 953 #if VIDYO_VPS_INTEGRATION 954 pcSlice->setViewId( pcSlice->getVPS()->getViewId(nalu.m_layerId) ); 955 pcSlice->setIsDepth( pcSlice->getVPS()->getDepthFlag(nalu.m_layerId) ); 956 #else 931 957 pcSlice->setViewId(m_viewId); 932 958 pcSlice->setIsDepth(m_isDepth); 959 #endif 933 960 934 961 #if SONY_COLPIC_AVAILABILITY 962 #if VIDYO_VPS_INTEGRATION 963 pcSlice->setViewOrderIdx( pcSlice->getVPS()->getViewOrderIdx(nalu.m_layerId) ); 964 #else 935 965 pcSlice->setViewOrderIdx( pcPic->getViewOrderIdx() ); 966 #endif 936 967 #endif 937 968 … … 1051 1082 } 1052 1083 1084 #if VIDYO_VPS_INTEGRATION 1085 Void TDecTop::xDecodeVPS() 1086 { 1087 TComVPS* vps = new TComVPS(); 1088 1089 m_cEntropyDecoder.decodeVPS( vps ); 1090 m_parameterSetManagerDecoder.storePrefetchedVPS(vps); 1091 getTAppDecTop()->getVPSAccess()->addVPS( vps ); 1092 } 1093 #endif 1053 1094 1054 1095 Void TDecTop::xDecodeSPS() … … 1114 1155 switch (nalu.m_nalUnitType) 1115 1156 { 1157 #if VIDYO_VPS_INTEGRATION 1158 case NAL_UNIT_VPS: 1159 xDecodeVPS(); 1160 return false; 1161 #endif 1116 1162 case NAL_UNIT_SPS: 1117 1163 xDecodeSPS(); -
trunk/source/Lib/TLibDecoder/TDecTop.h
r57 r77 208 208 Bool xDecodeSlice(InputNALUnit &nalu, Int iSkipFrame, Int iPOCLastDisplay); 209 209 #endif 210 #if VIDYO_VPS_INTEGRATION 211 Void xDecodeVPS(); 212 #endif 210 213 Void xDecodeSPS(); 211 214 Void xDecodePPS(); -
trunk/source/Lib/TLibEncoder/NALwrite.cpp
r56 r77 64 64 #endif 65 65 66 #if VIDYO_VPS_INTEGRATION 67 bsNALUHeader.write(nalu.m_temporalId, 3); // temporal_id 68 bsNALUHeader.write(nalu.m_layerId + 1, 5); // layer_id_plus1 69 #else 66 70 #if H0388 67 71 bsNALUHeader.write(nalu.m_temporalId, 3); // temporal_id … … 90 94 } 91 95 #endif 96 #endif 97 92 98 out.write(bsNALUHeader.getByteStream(), bsNALUHeader.getByteStreamLength()); 93 99 … … 201 207 naluDest.m_nalRefIDC = naluSrc.m_nalRefIDC; 202 208 #endif 209 #if !VIDYO_VPS_INTEGRATION 203 210 naluDest.m_viewId = naluSrc.m_viewId; 204 211 naluDest.m_isDepth = naluSrc.m_isDepth; 212 #endif 205 213 naluDest.m_temporalId = naluSrc.m_temporalId; 214 #if VIDYO_VPS_INTEGRATION 215 naluDest.m_layerId = naluSrc.m_layerId; 216 #else 217 206 218 #if !H0388 207 219 naluDest.m_OutputFlag = naluSrc.m_OutputFlag; 208 220 #endif 221 #endif 209 222 naluDest.m_Bitstream = naluSrc.m_Bitstream; 210 223 } -
trunk/source/Lib/TLibEncoder/NALwrite.h
r56 r77 62 62 NalRefIdc nalRefIDC, 63 63 #endif 64 #if VIDYO_VPS_INTEGRATION 65 unsigned layerId, 66 #else 64 67 Int viewId, 65 68 Bool isDepth, 69 #endif 66 70 unsigned temporalID = 0) 67 71 #if NAL_REF_FLAG 72 #if VIDYO_VPS_INTEGRATION 73 : NALUnit(nalUnitType, nalRefFlag, layerId, temporalID) 74 #else 68 75 : NALUnit(nalUnitType, nalRefFlag, viewId, isDepth, temporalID) 76 #endif 77 #else 78 #if VIDYO_VPS_INTEGRATION 79 : NALUnit(nalUnitType, nalRefIDC, layerId, temporalID) 69 80 #else 70 81 : NALUnit(nalUnitType, nalRefIDC, viewId, isDepth, temporalID) 82 #endif 71 83 #endif 72 84 , m_Bitstream() -
trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
r56 r77 375 375 } 376 376 377 #if VIDYO_VPS_INTEGRATION 378 Void TEncCavlc::codeVPS( TComVPS* pcVPS ) 379 { 380 WRITE_CODE( pcVPS->getMaxTLayers() - 1, 3, "max_temporal_layers_minus1" ); 381 WRITE_CODE( pcVPS->getMaxLayers() - 1, 5, "max_layers_minus1" ); 382 WRITE_FLAG( pcVPS->getTemporalNestingFlag() - 1, "temporal_id_nesting_flag" ); 383 WRITE_UVLC( pcVPS->getVPSId(), "video_parameter_set_id" ); 384 for(UInt i=0; i <= pcVPS->getMaxTLayers()-1; i++) 385 { 386 WRITE_UVLC( pcVPS->getMaxDecPicBuffering(i), "max_dec_pic_buffering[i]" ); 387 WRITE_UVLC( pcVPS->getNumReorderPics(i), "num_reorder_pics[i]" ); 388 WRITE_UVLC( pcVPS->getMaxLatencyIncrease(i), "max_latency_increase[i]" ); 389 } 390 391 WRITE_CODE( 1, 1, "bit_equal_to_one" ); 392 393 if( pcVPS->getMaxLayers() - 1 > 0 ) 394 { 395 WRITE_UVLC( pcVPS->getExtensionType(), "extension_type" ); 396 397 for(UInt i=1; i <= pcVPS->getMaxLayers()-1; i++) 398 { 399 WRITE_FLAG( pcVPS->getDependentFlag(i), "dependent_flag[i]" ); 400 if( pcVPS->getDependentFlag(i) ) 401 { 402 WRITE_UVLC( i - pcVPS->getDependentLayer(i) - 1, "delta_reference_layer_id_minus1[i]" ); 403 if( pcVPS->getExtensionType() == VPS_EXTENSION_TYPE_MULTI_VIEW ) 404 { 405 WRITE_UVLC( pcVPS->getViewId(i), "view_id[i]" ); 406 WRITE_FLAG( pcVPS->getDepthFlag(i), "depth_flag[i]" ); 407 WRITE_SVLC( pcVPS->getViewOrderIdx(i), "view_order_idx[i]" ); 408 } 409 410 } 411 } 412 } 413 414 WRITE_FLAG( 0, "vps_extension_flag" ); 415 416 //future extensions here.. 417 418 return; 419 } 420 #endif 421 377 422 #if HHI_MPI 378 423 Void TEncCavlc::codeSPS( TComSPS* pcSPS, Bool bIsDepth ) … … 388 433 WRITE_CODE( pcSPS->getLevelIdc (), 8, "level_idc" ); 389 434 WRITE_UVLC( pcSPS->getSPSId (), "seq_parameter_set_id" ); 435 #if VIDYO_VPS_INTEGRATION 436 WRITE_UVLC( pcSPS->getVPSId (), "video_parameter_set_id" ); 437 #endif 390 438 WRITE_UVLC( pcSPS->getChromaFormatIdc (), "chroma_format_idc" ); 391 439 WRITE_CODE( pcSPS->getMaxTLayers() - 1, 3, "max_temporal_layers_minus1" ); … … 727 775 { 728 776 WRITE_CODE( (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC()))%(1<<pcSlice->getSPS()->getBitsForPOC()), pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb"); 729 730 if( pcSlice->get NalUnitType() != NAL_UNIT_CODED_SLICE_IDV )777 #if HHI_FIX 778 if( pcSlice->getPOC() == 0 && pcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_IDV ) 731 779 { 732 780 TComReferencePictureSet* rps = pcSlice->getRPS(); … … 799 847 } 800 848 } 849 if( pcSlice->getPOC() != 0 ) 850 #else 851 if( pcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_IDV ) 852 #endif 853 { 854 TComReferencePictureSet* rps = pcSlice->getRPS(); 855 if(pcSlice->getRPSidx() < 0) 856 { 857 WRITE_FLAG( 0, "short_term_ref_pic_set_sps_flag"); 858 #if RPS_IN_SPS 859 codeShortTermRefPicSet(pcSlice->getSPS(), rps); 860 #else 861 codeShortTermRefPicSet(pcSlice->getPPS(), rps); 862 #endif 863 } 864 else 865 { 866 WRITE_FLAG( 1, "short_term_ref_pic_set_sps_flag"); 867 WRITE_UVLC( pcSlice->getRPSidx(), "short_term_ref_pic_set_idx" ); 868 } 869 #if RPS_IN_SPS 870 if(pcSlice->getSPS()->getLongTermRefsPresent()) 871 #else 872 if(pcSlice->getPPS()->getLongTermRefsPresent()) 873 #endif 874 { 875 WRITE_UVLC( rps->getNumberOfLongtermPictures(), "num_long_term_pics"); 876 Int maxPocLsb = 1<<pcSlice->getSPS()->getBitsForPOC(); 877 Int prev = 0; 878 #if LTRP_MULT 879 Int prevDeltaPocLt=0; 880 Int currDeltaPocLt=0; 881 #endif 882 for(Int i=rps->getNumberOfPictures()-1 ; i > rps->getNumberOfPictures()-rps->getNumberOfLongtermPictures()-1; i--) 883 { 884 WRITE_UVLC((maxPocLsb-rps->getDeltaPOC(i)+prev)%maxPocLsb, "delta_poc_lsb_lt"); 885 886 #if LTRP_MULT 887 currDeltaPocLt=((maxPocLsb-rps->getDeltaPOC(i)+prev)%maxPocLsb)+prevDeltaPocLt; 888 889 Int deltaMsbCycle=0; 890 if( (i==(rps->getNumberOfPictures()-1)) ) 891 { 892 deltaMsbCycle=((-rps->getDeltaPOC(i))/maxPocLsb)-1; 893 } 894 else if( prevDeltaPocLt!=currDeltaPocLt ) 895 { 896 deltaMsbCycle=((-rps->getDeltaPOC(i))/maxPocLsb)-1; 897 if( ((prevDeltaPocLt==maxPocLsb-1) && (currDeltaPocLt==maxPocLsb+1)) || ((prevDeltaPocLt==maxPocLsb-2) && (currDeltaPocLt==maxPocLsb))) 898 { 899 deltaMsbCycle=deltaMsbCycle-1; 900 } 901 } 902 else 903 { 904 deltaMsbCycle=((rps->getDeltaPOC(i+1)-rps->getDeltaPOC(i))/maxPocLsb)-1; 905 } 906 907 if(deltaMsbCycle>=0) 908 { 909 WRITE_FLAG( 1, "delta_poc_msb_present_flag"); 910 WRITE_UVLC(deltaMsbCycle, "delta_poc_msb_cycle_lt_minus1"); 911 } 912 else 913 { 914 WRITE_FLAG( 0, "delta_poc_msb_present_flag"); 915 } 916 prevDeltaPocLt=currDeltaPocLt; 917 #endif 918 prev = rps->getDeltaPOC(i); 919 WRITE_FLAG( rps->getUsed(i), "used_by_curr_pic_lt_flag"); 920 } 921 } 922 } 801 923 } 802 924 -
trunk/source/Lib/TLibEncoder/TEncCavlc.h
r56 r77 114 114 UInt getCoeffCost () { return m_uiCoeffCost; } 115 115 116 #if VIDYO_VPS_INTEGRATION 117 Void codeVPS ( TComVPS* pcVPS ); 118 #endif 119 116 120 #if HHI_MPI 117 121 Void codeSPS ( TComSPS* pcSPS, Bool bIsDepth ); -
trunk/source/Lib/TLibEncoder/TEncCfg.h
r56 r77 290 290 #endif 291 291 292 #if VIDYO_VPS_INTEGRATION 293 UInt m_layerId; 294 #endif 295 292 296 Int m_viewId; 293 297 Bool m_isDepth; … … 765 769 Int getTSIG() { return m_signHidingThreshold; } 766 770 #endif 771 #if VIDYO_VPS_INTEGRATION 772 Void setLayerId ( UInt layerId ) { m_layerId = layerId; } 773 UInt getLayerId () { return m_layerId; } 774 #endif 767 775 768 776 Void setViewId ( Int viewId ) { m_viewId = viewId; } -
trunk/source/Lib/TLibEncoder/TEncCu.cpp
r61 r77 604 604 if( bResPredAllowed ) 605 605 { 606 bResPredAvailable = rpcBestCU->getResidualSamples( 0, m_ppcResPredTmp[uiDepth] ); 606 bResPredAvailable = rpcBestCU->getResidualSamples( 0, 607 #if QC_SIMPLIFIEDIVRP_M24938 608 true , 609 #endif 610 m_ppcResPredTmp[uiDepth] ); 607 611 } 608 612 … … 698 702 if( bResPredAllowed ) 699 703 { 700 bResPredAvailable = rpcBestCU->getResidualSamples( 0, m_ppcResPredTmp[uiDepth] ); 704 bResPredAvailable = rpcBestCU->getResidualSamples( 0, 705 #if QC_SIMPLIFIEDIVRP_M24938 706 true, 707 #endif 708 m_ppcResPredTmp[uiDepth] ); 701 709 } 702 710 … … 1903 1911 1904 1912 #if HHI_INTER_VIEW_RESIDUAL_PRED 1913 #if !LG_RESTRICTEDRESPRED_M24766 1905 1914 if( rpcTempCU->getResPredFlag( 0 ) ) 1906 1915 { // subtract residual prediction from original in motion search … … 1908 1917 } 1909 1918 #endif 1919 #endif 1910 1920 1911 1921 #if AMP_MRG 1912 1922 rpcTempCU->setMergeAMP (true); 1913 1923 #if HHI_INTERVIEW_SKIP 1924 #if LG_RESTRICTEDRESPRED_M24766 1925 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcResPredTmp[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bSkipRes, bUseMRG ); 1926 #else 1914 1927 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bSkipRes, bUseMRG ); 1928 #endif 1915 1929 #else 1916 1930 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], false, bUseMRG ); … … 1925 1939 1926 1940 #if HHI_INTER_VIEW_RESIDUAL_PRED 1941 #if !LG_RESTRICTEDRESPRED_M24766 1927 1942 if( rpcTempCU->getResPredFlag( 0 ) ) 1928 1943 { // add residual prediction to original again 1929 1944 m_ppcOrigYuv[uhDepth]->add( m_ppcResPredTmp [uhDepth], rpcTempCU->getWidth( 0 ), rpcTempCU->getHeight( 0 ) ); 1930 1945 } 1946 #endif 1931 1947 #endif 1932 1948 -
trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
r56 r77 121 121 } 122 122 123 #if VIDYO_VPS_INTEGRATION 124 Void TEncEntropy::encodeVPS( TComVPS* pcVPS ) 125 { 126 m_pcEntropyCoderIf->codeVPS( pcVPS ); 127 return; 128 } 129 #endif 130 131 #if VIDYO_VPS_INTEGRATION 132 Void codeVPS ( TComVPS* pcVPS ); 133 #endif 134 123 135 #if HHI_MPI 124 136 Void TEncEntropy::encodeSPS( TComSPS* pcSPS, Bool bIsDepth ) … … 471 483 ROTVS( pcCU->isIntra ( uiAbsPartIdx ) ); 472 484 ROFVS( pcCU->getResPredAvail ( uiAbsPartIdx ) ); 473 485 #if LG_RESTRICTEDRESPRED_M24766 486 Int iPUResiPredShift[4]; 487 pcCU->getPUResiPredShift(iPUResiPredShift, uiAbsPartIdx); 488 if(iPUResiPredShift[0] >= 0 || iPUResiPredShift[1] >= 0 || iPUResiPredShift[2] >= 0 || iPUResiPredShift[3] >= 0 ) 489 #endif 474 490 // encode flag 475 491 m_pcEntropyCoderIf->codeResPredFlag( pcCU, uiAbsPartIdx ); -
trunk/source/Lib/TLibEncoder/TEncEntropy.h
r56 r77 76 76 virtual UInt getCoeffCost () = 0; 77 77 78 #if VIDYO_VPS_INTEGRATION 79 virtual Void codeVPS ( TComVPS* pcVPS ) = 0; 80 #endif 81 78 82 #if HHI_MPI 79 83 virtual Void codeSPS ( TComSPS* pcSPS, Bool bIsDepth ) = 0; … … 229 233 230 234 public: 235 #if VIDYO_VPS_INTEGRATION 236 Void encodeVPS ( TComVPS* pcVPS); 237 #endif 231 238 // SPS 232 239 #if HHI_MPI -
trunk/source/Lib/TLibEncoder/TEncGOP.cpp
r56 r77 246 246 247 247 std::vector<TComAPS>& vAPS = m_pcEncTop->getAPS(); 248 #if VIDYO_VPS_INTEGRATION 249 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, uiPOCCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getEncTop()->getVPS(), m_pcEncTop->getSPS(), m_pcEncTop->getPPS() ); 250 #else 248 251 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, uiPOCCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getSPS(), m_pcEncTop->getPPS() ); 252 #endif 249 253 pcSlice->setLastIDR(m_iLastIDR); 250 254 pcSlice->setSliceIdx(0); … … 809 813 if ( m_bSeqFirst ) 810 814 { 815 #if VIDYO_VPS_INTEGRATION 816 { 817 OutputNALUnit nalu(NAL_UNIT_VPS, true, m_pcEncTop->getLayerId()); 818 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 819 m_pcEntropyCoder->encodeVPS(m_pcEncTop->getEncTop()->getVPS()); 820 writeRBSPTrailingBits(nalu.m_Bitstream); 821 accessUnit.push_back(new NALUnitEBSP(nalu)); 822 } 823 #endif 811 824 #if NAL_REF_FLAG 825 #if VIDYO_VPS_INTEGRATION 826 OutputNALUnit nalu(NAL_UNIT_SPS, true, m_pcEncTop->getLayerId()); 827 #else 812 828 OutputNALUnit nalu(NAL_UNIT_SPS, true, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth()); 829 #endif 813 830 #else 814 831 OutputNALUnit nalu(NAL_UNIT_SPS, NAL_REF_IDC_PRIORITY_HIGHEST, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth()); … … 827 844 828 845 #if NAL_REF_FLAG 846 #if VIDYO_VPS_INTEGRATION 847 nalu = NALUnit(NAL_UNIT_PPS, true, m_pcEncTop->getLayerId()); 848 #else 829 849 nalu = NALUnit(NAL_UNIT_PPS, true, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth()); 850 #endif 830 851 #else 831 852 nalu = NALUnit(NAL_UNIT_PPS, NAL_REF_IDC_PRIORITY_HIGHEST, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth()); … … 954 975 #if H0388 955 976 #if NAL_REF_FLAG 956 OutputNALUnit nalu( pcSlice->getNalUnitType(), pcSlice->isReferenced(), m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth(), pcSlice->getTLayer() ); 957 #else 958 OutputNALUnit nalu( pcSlice->getNalUnitType(), pcSlice->isReferenced() ? NAL_REF_IDC_PRIORITY_HIGHEST: NAL_REF_IDC_PRIORITY_LOWEST, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth(), pcSlice->getTLayer() ); 959 #endif 960 #else 961 OutputNALUnit nalu( pcSlice->getNalUnitType(), pcSlice->isReferenced() ? NAL_REF_IDC_PRIORITY_HIGHEST: NAL_REF_IDC_PRIORITY_LOWEST, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth(), pcSlice->getTLayer(), true); 962 #endif 977 OutputNALUnit nalu( pcSlice->getNalUnitType(), pcSlice->isReferenced(), 978 #if !VIDYO_VPS_INTEGRATION 979 m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth(), pcSlice->getTLayer() ); 980 #else 981 m_pcEncTop->getLayerId(), pcSlice->getTLayer() ); 982 #endif 983 #else 984 OutputNALUnit nalu( pcSlice->getNalUnitType(), pcSlice->isReferenced() ? NAL_REF_IDC_PRIORITY_HIGHEST: NAL_REF_IDC_PRIORITY_LOWEST, 985 #if !VIDYO_VPS_INTEGRATION 986 m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth(), pcSlice->getTLayer() ); 987 #else 988 m_pcEncTop->getLayerId(), pcSlice->getTLayer() ); 989 #endif 990 #endif 991 #else 992 OutputNALUnit nalu( pcSlice->getNalUnitType(), pcSlice->isReferenced() ? NAL_REF_IDC_PRIORITY_HIGHEST: NAL_REF_IDC_PRIORITY_LOWEST, 993 #if !VIDYO_VPS_INTEGRATION 994 m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth(), pcSlice->getTLayer(), true ); 995 #else 996 m_pcEncTop->getLayerId(), pcSlice->getTLayer(), true ); 997 #endif 998 999 #endif 1000 963 1001 Bool bEntropySlice = (!pcSlice->isNextSlice()); 964 1002 if (!bEntropySlice) … … 1414 1452 { 1415 1453 #if NAL_REF_FLAG 1454 #if VIDYO_VPS_INTEGRATION 1455 OutputNALUnit nalu(NAL_UNIT_APS, true, m_pcEncTop->getLayerId()); 1456 #else 1416 1457 OutputNALUnit nalu(NAL_UNIT_APS, true, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth()); 1458 #endif 1417 1459 #else 1418 1460 OutputNALUnit nalu(NAL_UNIT_APS, NAL_REF_IDC_PRIORITY_HIGHEST, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth()); … … 1476 1518 1477 1519 #if NAL_REF_FLAG 1520 #if VIDYO_VPS_INTEGRATION 1521 OutputNALUnit nalu(NAL_UNIT_SEI, false, m_pcEncTop->getLayerId()); 1522 #else 1478 1523 OutputNALUnit nalu(NAL_UNIT_SEI, false, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth()); 1524 #endif 1479 1525 #else 1480 1526 OutputNALUnit nalu(NAL_UNIT_SEI, NAL_REF_IDC_PRIORITY_LOWEST, m_pcEncTop->getViewId(), m_pcEncTop->getIsDepth()); … … 1962 2008 1963 2009 #if HHI_VSO 2010 #if HHI_VSO_SYNTH_DIST_OUT 1964 2011 if ( m_pcRdCost->getUseRenModel() ) 1965 2012 { … … 1975 2022 } 1976 2023 else 2024 #endif 1977 2025 #endif 1978 2026 { -
trunk/source/Lib/TLibEncoder/TEncSbac.cpp
r58 r77 342 342 } 343 343 344 #if VIDYO_VPS_INTEGRATION 345 Void TEncSbac::codeVPS( TComVPS* pcVPS ) 346 { 347 assert (0); 348 return; 349 } 350 #endif 351 344 352 #if HHI_MPI 345 353 Void TEncSbac::codeSPS( TComSPS* pcSPS, Bool bIsDepth ) -
trunk/source/Lib/TLibEncoder/TEncSbac.h
r56 r77 98 98 //--SBAC RD 99 99 100 #if VIDYO_VPS_INTEGRATION 101 Void codeVPS ( TComVPS* pcVPS ); 102 #endif 103 100 104 #if HHI_MPI 101 105 Void codeSPS ( TComSPS* pcSPS, Bool bIsDepth ); -
trunk/source/Lib/TLibEncoder/TEncSearch.cpp
r56 r77 2505 2505 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost, TComMvField* cMvFieldNeighbours, UChar* uhInterDirNeighbours, Int& numValidMergeCand ) 2506 2506 #else 2507 #if LG_RESTRICTEDRESPRED_M24766 2508 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* rpcResiPredYuv, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost ) 2509 #else 2507 2510 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost ) 2511 #endif 2508 2512 #endif 2509 2513 { … … 2553 2557 const int maxNumMergeCand = MRG_MAX_NUM_CANDS_SIGNALED + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 ); 2554 2558 #endif 2555 2559 #if LG_RESTRICTEDRESPRED_M24766 2560 Int iPUResiPredShift[4]; 2561 Int iLastAddResiShift = -1000; 2562 #endif 2556 2563 ruiCost = MAX_UINT; 2557 2564 for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand ) … … 2565 2572 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx ); 2566 2573 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx ); 2567 2574 #if LG_RESTRICTEDRESPRED_M24766 2575 Int iAddResiShift; 2576 UInt uiPartAddr; 2577 Int iRoiWidth, iRoiHeight; 2578 2579 pcCU->getPartIndexAndSize( iPUIdx, uiPartAddr, iRoiWidth, iRoiHeight ); 2580 iAddResiShift = pcCU->getResiPredMode(uiPartAddr); 2581 iAddResiShift = (pcCU->getSlice()->getPPS()->getUseWP() || pcCU->getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1 - iAddResiShift : -1); 2582 2583 if( pcCU->getResPredFlag( 0 )) 2584 { // subtract residual prediction from original in motion search 2585 if(iLastAddResiShift != iAddResiShift) 2586 { 2587 //add subtracted residual last time 2588 if(iLastAddResiShift >= 0) 2589 { 2590 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iLastAddResiShift; 2591 pcYuvOrg->add(iPUResiPredShift, ePartSize, rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 )); 2592 } 2593 //subtract residual 2594 if(iAddResiShift >= 0) 2595 { 2596 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iAddResiShift; 2597 pcYuvOrg->add(iPUResiPredShift, ePartSize, rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ), true ); 2598 } 2599 iLastAddResiShift = iAddResiShift; 2600 } 2601 } 2602 #endif 2568 2603 xGetInterPredictionError( pcCU, pcYuvOrg, iPUIdx, uiCostCand, m_pcEncCfg->getUseHADME() ); 2569 2604 uiBitsCand = uiMergeCand + 1; … … 2587 2622 } 2588 2623 } 2624 #if LG_RESTRICTEDRESPRED_M24766 2625 if( pcCU->getResPredFlag( 0 ) && iLastAddResiShift >= 0) 2626 { 2627 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iLastAddResiShift; 2628 pcYuvOrg->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 )); 2629 } 2630 #endif 2589 2631 } 2590 2632 … … 2599 2641 */ 2600 2642 #if AMP_MRG 2643 #if LG_RESTRICTEDRESPRED_M24766 2644 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv* rpcResiPredYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG ) 2645 #else 2601 2646 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG ) 2647 #endif 2602 2648 #else 2603 2649 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes ) … … 2702 2748 for (Int iNumRef=0; iNumRef < MAX_NUM_REF; iNumRef++) uiCostTempL0[iNumRef] = MAX_UINT; 2703 2749 UInt uiBitsTempL0[MAX_NUM_REF]; 2704 2750 #if LG_RESTRICTEDRESPRED_M24766 2751 Int iPUResiPredShift[4] = {0, 0, 0, 0}; 2752 #endif 2705 2753 xGetBlkBits( ePartSize, pcCU->getSlice()->isInterP(), iPartIdx, uiLastMode, uiMbBits); 2706 2754 … … 2718 2766 { 2719 2767 #endif 2720 2768 #if LG_RESTRICTEDRESPRED_M24766 2769 Bool bLastResiFlag = false; 2770 #endif 2721 2771 // Uni-directional prediction 2722 2772 for ( Int iRefList = 0; iRefList < iNumPredDir; iRefList++ ) … … 2726 2776 for ( Int iRefIdxTemp = 0; iRefIdxTemp < pcCU->getSlice()->getNumRefIdx(eRefPicList); iRefIdxTemp++ ) 2727 2777 { 2778 #if LG_RESTRICTEDRESPRED_M24766 2779 if( pcCU->getResPredFlag( 0 )) 2780 { 2781 if(pcCU->getSlice()->getViewId() == pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp)) 2782 { // subtract residual prediction from original in motion search 2783 if(!bLastResiFlag) 2784 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ), true ); 2785 bLastResiFlag = true; 2786 } 2787 else 2788 { 2789 if(bLastResiFlag) 2790 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 )); 2791 bLastResiFlag = false; 2792 } 2793 } 2794 #endif 2728 2795 uiBitsTemp = uiMbBits[iRefList]; 2729 2796 if ( pcCU->getSlice()->getNumRefIdx(eRefPicList) > 1 ) … … 2889 2956 } 2890 2957 } 2958 #if LG_RESTRICTEDRESPRED_M24766 2959 if( pcCU->getResPredFlag( 0 ) && bLastResiFlag) 2960 { // subtract residual prediction from original in motion search 2961 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 )); 2962 } 2963 #endif 2891 2964 // Bi-directional prediction 2892 2965 if ( pcCU->getSlice()->isInterB() ) 2893 2966 { 2894 2967 #if LG_RESTRICTEDRESPRED_M24766 2968 Int iLastAddResiShift = -1000; 2969 #endif 2895 2970 cMvBi[0] = cMv[0]; cMvBi[1] = cMv[1]; 2896 2971 iRefIdxBi[0] = iRefIdx[0]; iRefIdxBi[1] = iRefIdx[1]; … … 2994 3069 #else 2995 3070 uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdxBi[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS]; 3071 #endif 3072 #if LG_RESTRICTEDRESPRED_M24766 3073 Int iAddResiShift = -1, iPredFrom = 0; 3074 Int iBestRefIdx = pcCU->getCUMvField(eRefPicList == REF_PIC_LIST_0 ? REF_PIC_LIST_1 : REF_PIC_LIST_0)->getRefIdx(uiPartAddr); 3075 3076 iPredFrom = iBestRefIdx >= 0 ? 3 : 1; 3077 if(iBestRefIdx >= 0 && pcCU->getSlice()->getViewId() == pcCU->getSlice()->getRefViewId(eRefPicList == REF_PIC_LIST_0 ? REF_PIC_LIST_1 : REF_PIC_LIST_0, iBestRefIdx)) 3078 iAddResiShift++; 3079 if(pcCU->getSlice()->getViewId() == pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp)) 3080 iAddResiShift++; 3081 iAddResiShift = (pcCU->getSlice()->getPPS()->getUseWP() || iPredFrom != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1); 3082 3083 if( pcCU->getResPredFlag( 0 ) ) 3084 { 3085 if(iLastAddResiShift != iAddResiShift) 3086 { 3087 //add substracted residual last time 3088 if(iLastAddResiShift >= 0 ) 3089 { 3090 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iLastAddResiShift; 3091 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 )); 3092 } 3093 //substract residual 3094 if(iAddResiShift >= 0) 3095 { 3096 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iAddResiShift; 3097 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ), true ); 3098 } 3099 iLastAddResiShift = iAddResiShift; 3100 } 3101 } 2996 3102 #endif 2997 3103 // call ME … … 3049 3155 } 3050 3156 } // for loop-iter 3157 #if LG_RESTRICTEDRESPRED_M24766 3158 if( pcCU->getResPredFlag( 0 ) && iLastAddResiShift >= 0) 3159 { 3160 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iLastAddResiShift; 3161 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 )); 3162 } 3163 #endif 3051 3164 } // if (B_SLICE) 3052 3165 #if ZERO_MVD_EST … … 3255 3368 if (bTestNormalMC) 3256 3369 { 3370 #if LG_RESTRICTEDRESPRED_M24766 3371 Int iAddResiShift = pcCU->getResiPredMode(uiPartAddr); 3372 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = \ 3373 (pcCU->getSlice()->getPPS()->getUseWP() || pcCU->getInterDir(uiPartAddr) != 3)? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1); 3374 if(pcCU->getResPredFlag(0) && iAddResiShift >= 0) 3375 { 3376 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ), true); 3377 } 3378 #endif 3257 3379 xGetInterPredictionError( pcCU, pcOrgYuv, iPartIdx, uiMEError, m_pcEncCfg->getUseHADME() ); 3258 3380 uiMECost = uiMEError + m_pcRdCost->getCost( uiMEBits ); 3381 #if LG_RESTRICTEDRESPRED_M24766 3382 if(pcCU->getResPredFlag(0) && iAddResiShift >= 0) 3383 { 3384 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 )); 3385 } 3386 #endif 3259 3387 } 3260 3388 #else … … 3274 3402 xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand); 3275 3403 #else 3404 #if LG_RESTRICTEDRESPRED_M24766 3405 xMergeEstimation( pcCU, pcOrgYuv, rpcResiPredYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost ); 3406 #else 3276 3407 xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost ); 3408 #endif 3277 3409 #endif 3278 3410 if ( uiMRGCost < uiMECost ) … … 4116 4248 UInt uiWidth = pcCU->getWidth ( 0 ); 4117 4249 UInt uiHeight = pcCU->getHeight( 0 ); 4118 4250 #if LG_RESTRICTEDRESPRED_M24766 4251 Int iPUResiPredShift[4]; 4252 #endif 4119 4253 // No residual coding : SKIP mode 4120 4254 if ( ePredMode == MODE_SKIP && bSkipRes ) … … 4128 4262 if( pcCU->getResPredFlag( 0 ) ) 4129 4263 { 4264 #if LG_RESTRICTEDRESPRED_M24766 4265 pcCU->getPUResiPredShift(iPUResiPredShift, 0); 4266 rpcYuvRec->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcYuvResPrd, uiWidth, uiHeight ); 4267 #else 4130 4268 rpcYuvRec->add( rpcYuvResPrd, uiWidth, uiHeight ); 4269 #endif 4131 4270 rpcYuvRec->clip( uiWidth, uiHeight ); 4132 4271 } … … 4237 4376 else 4238 4377 { 4378 #if LG_RESTRICTEDRESPRED_M24766 4379 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = 0; 4380 rpcYuvResi->subtract(iPUResiPredShift, pcCU->getPartitionSize(0), pcYuvOrg, pcYuvPred, 0, uiWidth ); 4381 #else 4239 4382 rpcYuvResi->subtract( pcYuvOrg, pcYuvPred, 0, uiWidth ); 4383 #endif 4240 4384 #if HHI_INTER_VIEW_RESIDUAL_PRED 4241 4385 // subtract residual prediction 4242 4386 if( pcCU->getResPredFlag( 0 ) ) 4243 4387 { 4388 #if LG_RESTRICTEDRESPRED_M24766 4389 pcCU->getPUResiPredShift(iPUResiPredShift, 0); 4390 rpcYuvResi->subtract(iPUResiPredShift, pcCU->getPartitionSize(0), rpcYuvResi, rpcYuvResPrd, 0, uiWidth ); 4391 #else 4244 4392 rpcYuvResi->subtract( rpcYuvResi, rpcYuvResPrd, 0, uiWidth ); 4393 #endif 4245 4394 } 4246 4395 #endif … … 4456 4605 { 4457 4606 pcYuvPred->copyToPartYuv( rpcYuvRec, 0 ); 4607 #if LG_RESTRICTEDRESPRED_M24766 4608 pcCU->getPUResiPredShift(iPUResiPredShift, 0); 4609 rpcYuvRec->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcYuvResPrd, uiWidth, uiHeight ); 4610 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = 0; 4611 rpcYuvRec->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcYuvResiBest, uiWidth, uiHeight ); 4612 #else 4458 4613 rpcYuvRec->add( rpcYuvResPrd, uiWidth, uiHeight ); 4459 4614 rpcYuvRec->add( rpcYuvResiBest, uiWidth, uiHeight ); 4615 #endif 4460 4616 rpcYuvRec->clip( uiWidth, uiHeight ); 4461 4617 } -
trunk/source/Lib/TLibEncoder/TEncSearch.h
r56 r77 188 188 Void predInterSearch ( TComDataCU* pcCU, 189 189 TComYuv* pcOrgYuv, 190 #if LG_RESTRICTEDRESPRED_M24766 191 TComYuv* rpcResiPredYuv, 192 #endif 190 193 TComYuv*& rpcPredYuv, 191 194 TComYuv*& rpcResiYuv, … … 440 443 Void xMergeEstimation ( TComDataCU* pcCU, 441 444 TComYuv* pcYuvOrg, 445 #if LG_RESTRICTEDRESPRED_M24766 446 TComYuv* rpcResiPredYuv, 447 #endif 442 448 Int iPartIdx, 443 449 UInt& uiInterDir, -
trunk/source/Lib/TLibEncoder/TEncSlice.cpp
r56 r77 161 161 \param pPPS PPS associated with the slice 162 162 */ 163 #if VIDYO_VPS_INTEGRATION 164 Void TEncSlice::initEncSlice( TComPic* pcPic, Int iPOCLast, UInt uiPOCCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComVPS * pVPS, TComSPS* pSPS, TComPPS *pPPS ) 165 #else 163 166 Void TEncSlice::initEncSlice( TComPic* pcPic, Int iPOCLast, UInt uiPOCCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS ) 167 #endif 164 168 { 165 169 Double dQP; … … 167 171 168 172 rpcSlice = pcPic->getSlice(0); 173 #if VIDYO_VPS_INTEGRATION 174 rpcSlice->setVPS( pVPS ); 175 #endif 169 176 rpcSlice->setSPS( pSPS ); 170 177 rpcSlice->setPPS( pPPS ); -
trunk/source/Lib/TLibEncoder/TEncSlice.h
r56 r77 110 110 111 111 /// preparation of slice encoding (reference marking, QP and lambda) 112 #if VIDYO_VPS_INTEGRATION 113 Void initEncSlice ( TComPic* pcPic, Int iPOCLast, UInt uiPOCCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComVPS* pVPS, TComSPS* pSPS, TComPPS *pPPS ); 114 #else 112 115 Void initEncSlice ( TComPic* pcPic, Int iPOCLast, UInt uiPOCCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS ); 113 116 #endif 114 117 // compress and encode slice 115 118 Void precompressSlice ( TComPic*& rpcPic ); ///< precompress slice for multi-loop opt. -
trunk/source/Lib/TLibEncoder/TEncTop.cpp
r56 r77 348 348 349 349 #if DEPTH_MAP_GENERATION 350 #if VIDYO_VPS_INTEGRATION 351 m_cDepthMapGenerator.init( (TComPrediction*)this->getPredSearch(), m_pcTAppEncTop->getVPSAccess(), m_pcTAppEncTop->getSPSAccess(), m_pcTAppEncTop->getAUPicAccess() ); 352 #else 350 353 m_cDepthMapGenerator.init( (TComPrediction*)this->getPredSearch(), m_pcTAppEncTop->getSPSAccess(), m_pcTAppEncTop->getAUPicAccess() ); 354 #endif 351 355 #endif 352 356 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 977 981 Void TEncTop::selectReferencePictureSet(TComSlice* slice, Int POCCurr, Int GOPid,TComList<TComPic*>& listPic ) 978 982 { 983 #if HHI_FIX 984 if( slice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDV && POCCurr == 0 ) 985 #else 979 986 if( slice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDV ) 987 #endif 980 988 { 981 989 TComReferencePictureSet* rps = slice->getLocalRPS(); -
trunk/source/Lib/TLibExtractor/TExtrTop.cpp
r56 r77 55 55 Bool TExtrTop::extract( InputNALUnit& nalu, std::set<UInt>& rsuiExtractLayerIds ) 56 56 { 57 #if VIDYO_VPS_INTEGRATION 58 //extraction now has to be done using layer_id 59 UInt uiLayerId = nalu.m_layerId; 60 #else 57 61 UInt uiLayerId = xGetLayerId( nalu.m_viewId, nalu.m_isDepth ); 58 62 #endif 59 63 // Initialize entropy decoder 60 64 m_cEntropyDecoder.setEntropyDecoder( &m_cCavlcDecoder ); 61 65 m_cEntropyDecoder.setBitstream ( nalu.m_Bitstream ); 62 66 67 #if VIDYO_VPS_INTEGRATION 68 if ( nalu.m_nalUnitType == NAL_UNIT_VPS ) 69 { 70 // a hack for now assuming there's only one VPS in the bitstream 71 m_cEntropyDecoder.decodeVPS( &m_cVPS ); 72 73 } 74 #endif 75 63 76 if ( nalu.m_nalUnitType == NAL_UNIT_SPS ) 64 77 { … … 69 82 #endif 70 83 #if HHI_MPI 84 #if VIDYO_VPS_INTEGRATION 85 m_cEntropyDecoder.decodeSPS( &cSPS, m_cVPS.getDepthFlag(uiLayerId) ); 86 #else 71 87 m_cEntropyDecoder.decodeSPS( &cSPS, nalu.m_isDepth ); 88 #endif 72 89 #else 73 90 m_cEntropyDecoder.decodeSPS( &cSPS ); -
trunk/source/Lib/TLibExtractor/TExtrTop.h
r56 r77 54 54 { 55 55 private: 56 #if VIDYO_VPS_INTEGRATION 57 TComVPS m_cVPS; 58 #endif 56 59 std::list<TComSPS> m_acSPSBuffer; 57 60 -
trunk/source/Lib/TLibRenderer/TRenSingleModel.cpp
r56 r77 214 214 AOT( (ppiShiftLutLeft == NULL) && (m_iMode == 0 || m_iMode == 2) ); 215 215 AOT( (ppiShiftLutRight == NULL) && (m_iMode == 1 || m_iMode == 2) ); 216 #if HHI_FIX 217 #else 216 218 AOT( pcOrgVideo != NULL && bKeepReference ); 219 #endif 217 220 218 221 m_appiShiftLut[0] = ppiShiftLutLeft; … … 222 225 m_pcPicYuvRef = pcOrgVideo; 223 226 227 #if HHI_FIX 228 if ( pcOrgVideo && !bKeepReference ) 229 #else 224 230 if ( pcOrgVideo ) 231 #endif 225 232 { 226 233 TRenFilter::copy( pcOrgVideo->getLumaAddr(), pcOrgVideo->getStride() , m_iWidth, m_iHeight, m_aapiRefVideoPel[0], m_aiRefVideoStrides[0]);
Note: See TracChangeset for help on using the changeset viewer.