Changeset 77 in 3DVCSoftware for trunk/source/Lib/TLibCommon
- Timestamp:
- 14 Jun 2012, 16:38:29 (13 years ago)
- Location:
- trunk/source/Lib/TLibCommon
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset for help on using the changeset viewer.