Changeset 28 in 3DVCSoftware for branches/0.3-poznan-univ/source/Lib/TLibCommon
- Timestamp:
- 24 Feb 2012, 20:22:58 (13 years ago)
- Location:
- branches/0.3-poznan-univ/source/Lib/TLibCommon
- Files:
-
- 2 added
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.3-poznan-univ/source/Lib/TLibCommon/CommonDef.h
r21 r28 138 138 139 139 140 #if ( HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED )140 #if ( HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED || POZNAN_MP_USE_DEPTH_MAP_GENERATION) 141 141 #define DEPTH_MAP_GENERATION 1 142 142 #else 143 143 #define DEPTH_MAP_GENERATION 0 144 #endif 145 146 #if POZNAN_NONLINEAR_DEPTH 147 #define POZNAN_LUT_INCREASED_PRECISION 0 // 1 //to do 148 #else 149 #define POZNAN_LUT_INCREASED_PRECISION 0 144 150 #endif 145 151 … … 174 180 #define OUTPUT_RESIDUAL_PICTURES 0 // output residual pictures (for debugging) 175 181 176 #define HHI_MPI_MERGE_POS 0 // position of mvi in merge list (0..5) 177 182 #define HHI_MPI_MERGE_POS 0 // position of mvi in merge list (0..5) 183 184 // ==================================================================================================================== 185 // POZNAN DEFINE SECTION 186 // ==================================================================================================================== 187 #define POZNAN_OUTPUT_AVAILABLE_MAP 0 // output available map (for debugging) 188 #define POZNAN_OUTPUT_SYNTH 0 // output synthesised view (for debugging) 189 190 #if POZNAN_DBMP 191 #define POZNAN_DBMP_MERGE_POS 0 // position of DBMP candidate in merge list for coding (0..6) - overwrites PDM_MERGE_POS settings, is overwritten by HHI_MPI_MERGE_POS settings!!! 192 #endif 193 194 #if POZNAN_NONLINEAR_DEPTH 195 inline UChar quantizeDepthPower(Float fDepthPower) 196 { 197 Int r = (Int) ( (fDepthPower-1.0f)*128.0f + 0.5f); 198 if (r<=0) return 0; 199 if (r>255) r=255; 200 return r; 201 }; 202 203 inline Float dequantizeDepthPower(Int iDepthQuant) 204 { 205 return iDepthQuant/128.0f + 1.0f; 206 }; 207 #endif 178 208 179 209 // ==================================================================================================================== … … 186 216 #define Clip(x) ( Min(g_uiIBDI_MAX, Max( 0, (x)) ) ) ///< clip with bit-depth range 187 217 #define Clip3( MinVal, MaxVal, a) ( ((a)<(MinVal)) ? (MinVal) : (((a)>(MaxVal)) ? (MaxVal) :(a)) ) ///< general min/max clip 188 #define RemoveBitIncrement(x) ( (x + ( (1 << g_uiBitIncrement) >> 1 )) >> g_uiBitIncrement ) ///< Remove Bit increment 218 #define RemoveBitIncrement(x) ( ((x) + ( (1 << g_uiBitIncrement) >> 1 )) >> g_uiBitIncrement ) ///< Remove Bit increment 219 220 #if POZNAN_LUT_INCREASED_PRECISION 221 #define RemoveBitIncrementLUT(x) (x) ///< Remove Bit increment 222 #define SizeOfLUT (256 << g_uiBitIncrement) 223 #else 224 #define SizeOfLUT 256 225 #define RemoveBitIncrementLUT(x) ( ((x) + ( (1 << g_uiBitIncrement) >> 1 )) >> g_uiBitIncrement ) ///< Remove Bit increment 226 #endif 189 227 190 228 #define DATA_ALIGN 1 ///< use 32-bit aligned malloc/free … … 216 254 #define AMVP_MAX_NUM_CANDS 6 ///< max number of final candidates 217 255 // MERGE 256 #if POZNAN_DBMP 257 #define MRG_MAX_NUM_CANDS 7 258 #define POZNAN_DBMP_MRG_CAND MRG_MAX_NUM_CANDS-1 // position of DBMP candidate in merge list (0..6) 259 #else 218 260 #define MRG_MAX_NUM_CANDS 6 261 #endif 219 262 220 263 // Reference memory management -
branches/0.3-poznan-univ/source/Lib/TLibCommon/ContextTables.h
r5 r28 53 53 #define NUM_MERGE_FLAG_EXT_CTX 3 ///< number of context models for merge flag of merge extended 54 54 #define NUM_MERGE_IDX_EXT_CTX 4 ///< number of context models for merge index of merge extended 55 #if POZNAN_DBMP 56 #define NUM_MV_MERGE_IDX_EXT_CTX 6 ///< number of context models for merge index of merge extended 57 #else 55 58 #define NUM_MV_MERGE_IDX_EXT_CTX 5 ///< number of context models for merge index of merge extended 59 #endif 56 60 #define NUM_RES_PRED_FLAG_CTX 3 ///< number of context for residual prediction flag 57 61 -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComDataCU.cpp
r21 r28 187 187 m_acCUMvField[1].create( uiNumPartition ); 188 188 189 #if POZNAN_DBMP_CALC_PRED_DATA 190 m_acCUMvField2nd[0].create( uiNumPartition ); 191 m_acCUMvField2nd[1].create( uiNumPartition ); 192 #endif 193 189 194 #if HHI_DMM_WEDGE_INTRA 190 195 m_puiWedgeFullTabIdx = (UInt*)xMalloc(UInt, uiNumPartition); … … 210 215 m_acCUMvField[0].setNumPartition(uiNumPartition ); 211 216 m_acCUMvField[1].setNumPartition(uiNumPartition ); 217 218 #if POZNAN_DBMP_CALC_PRED_DATA 219 m_acCUMvField2nd[0].setNumPartition(uiNumPartition ); 220 m_acCUMvField2nd[1].setNumPartition(uiNumPartition ); 221 #endif 212 222 } 213 223 … … 296 306 if ( m_piContourPredTexDeltaDC2 ) { xFree(m_piContourPredTexDeltaDC2); m_piContourPredTexDeltaDC2 = NULL; } 297 307 #endif 308 309 #if POZNAN_DBMP_CALC_PRED_DATA 310 m_acCUMvField2nd[0].destroy(); 311 m_acCUMvField2nd[1].destroy(); 312 #endif 313 298 314 } 299 315 … … 388 404 m_acCUMvField[0].clearMvField(); 389 405 m_acCUMvField[1].clearMvField(); 406 407 #if POZNAN_DBMP_CALC_PRED_DATA 408 m_acCUMvField2nd[0].clearMvField(); 409 m_acCUMvField2nd[1].clearMvField(); 410 #endif 390 411 391 412 UInt uiTmp = m_puhWidth[0]*m_puhHeight[0]; … … 508 529 m_acCUMvField[1].clearMvField(); 509 530 531 #if POZNAN_DBMP_CALC_PRED_DATA 532 m_acCUMvField2nd[0].clearMvField(); 533 m_acCUMvField2nd[1].clearMvField(); 534 #endif 535 510 536 #if HHI_DMM_WEDGE_INTRA 511 537 memset( m_puiWedgeFullTabIdx, 0, iSizeInUInt ); … … 617 643 m_uiEntropySliceStartCU = pcCU->getEntropySliceStartCU(); 618 644 645 #if POZNAN_DBMP_CALC_PRED_DATA 646 m_acCUMvField2nd[0].clearMvField(); 647 m_acCUMvField2nd[1].clearMvField(); 648 #endif 649 619 650 #if HHI_DMM_WEDGE_INTRA 620 651 memset( m_puiWedgeFullTabIdx, 0, iSizeInUInt ); … … 719 750 m_acCUMvField[1].setMvdPtr(pcCU->getCUMvField(REF_PIC_LIST_1)->getMvd() + uiPart); 720 751 m_acCUMvField[1].setRefIdxPtr(pcCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx() + uiPart); 752 753 #if POZNAN_DBMP_CALC_PRED_DATA 754 m_acCUMvField2nd[0].setMvPtr(pcCU->getCUMvField2nd(REF_PIC_LIST_0)->getMv() + uiPart); 755 m_acCUMvField2nd[0].setMvdPtr(pcCU->getCUMvField2nd(REF_PIC_LIST_0)->getMvd() + uiPart); 756 m_acCUMvField2nd[0].setRefIdxPtr(pcCU->getCUMvField2nd(REF_PIC_LIST_0)->getRefIdx() + uiPart); 757 m_acCUMvField2nd[1].setMvPtr(pcCU->getCUMvField2nd(REF_PIC_LIST_1)->getMv() + uiPart); 758 m_acCUMvField2nd[1].setMvdPtr(pcCU->getCUMvField2nd(REF_PIC_LIST_1)->getMvd() + uiPart); 759 m_acCUMvField2nd[1].setRefIdxPtr(pcCU->getCUMvField2nd(REF_PIC_LIST_1)->getRefIdx() + uiPart); 760 #endif 761 721 762 m_uiSliceStartCU = pcCU->getSliceStartCU(); 722 763 m_uiEntropySliceStartCU = pcCU->getEntropySliceStartCU(); … … 787 828 m_acCUMvField[eRefPicList].setMvdPtr(pcCU->getCUMvField(eRefPicList)->getMvd() + uiAbsPartIdx); 788 829 m_acCUMvField[eRefPicList].setRefIdxPtr(pcCU->getCUMvField(eRefPicList)->getRefIdx() + uiAbsPartIdx); 830 831 #if POZNAN_DBMP_CALC_PRED_DATA 832 m_acCUMvField2nd[eRefPicList].setMvPtr(pcCU->getCUMvField2nd(eRefPicList)->getMv() + uiAbsPartIdx); 833 m_acCUMvField2nd[eRefPicList].setMvdPtr(pcCU->getCUMvField2nd(eRefPicList)->getMvd() + uiAbsPartIdx); 834 m_acCUMvField2nd[eRefPicList].setRefIdxPtr(pcCU->getCUMvField2nd(eRefPicList)->getRefIdx() + uiAbsPartIdx); 835 #endif 836 789 837 #if HHI_MPI 790 838 m_piTextureModeDepth = pcCU->getTextureModeDepth() + uiAbsPartIdx; … … 857 905 m_acCUMvField[1].copyFrom( pcCU->getCUMvField( REF_PIC_LIST_1 ), pcCU->getTotalNumPart(), uiOffset ); 858 906 907 #if POZNAN_DBMP_CALC_PRED_DATA 908 m_acCUMvField2nd[0].copyFrom( pcCU->getCUMvField2nd( REF_PIC_LIST_0 ), pcCU->getTotalNumPart(), uiOffset ); 909 m_acCUMvField2nd[1].copyFrom( pcCU->getCUMvField2nd( REF_PIC_LIST_1 ), pcCU->getTotalNumPart(), uiOffset ); 910 #endif 911 859 912 UInt uiTmp = g_uiMaxCUWidth*g_uiMaxCUHeight >> (uiDepth<<1); 860 913 UInt uiTmp2 = uiPartUnitIdx*uiTmp; … … 943 996 m_acCUMvField[0].copyTo( rpcCU->getCUMvField( REF_PIC_LIST_0 ), m_uiAbsIdxInLCU ); 944 997 m_acCUMvField[1].copyTo( rpcCU->getCUMvField( REF_PIC_LIST_1 ), m_uiAbsIdxInLCU ); 998 999 #if POZNAN_DBMP_CALC_PRED_DATA 1000 m_acCUMvField2nd[0].copyTo( rpcCU->getCUMvField2nd( REF_PIC_LIST_0 ), m_uiAbsIdxInLCU ); 1001 m_acCUMvField2nd[1].copyTo( rpcCU->getCUMvField2nd( REF_PIC_LIST_1 ), m_uiAbsIdxInLCU ); 1002 #endif 945 1003 946 1004 UInt uiTmp = (g_uiMaxCUWidth*g_uiMaxCUHeight)>>(uhDepth<<1); … … 1030 1088 m_acCUMvField[0].copyTo( rpcCU->getCUMvField( REF_PIC_LIST_0 ), m_uiAbsIdxInLCU, uiPartStart, uiQNumPart ); 1031 1089 m_acCUMvField[1].copyTo( rpcCU->getCUMvField( REF_PIC_LIST_1 ), m_uiAbsIdxInLCU, uiPartStart, uiQNumPart ); 1090 1091 #if POZNAN_DBMP_CALC_PRED_DATA 1092 m_acCUMvField2nd[0].copyTo( rpcCU->getCUMvField2nd( REF_PIC_LIST_0 ), m_uiAbsIdxInLCU, uiPartStart, uiQNumPart ); 1093 m_acCUMvField2nd[1].copyTo( rpcCU->getCUMvField2nd( REF_PIC_LIST_1 ), m_uiAbsIdxInLCU, uiPartStart, uiQNumPart ); 1094 #endif 1032 1095 1033 1096 UInt uiTmp = (g_uiMaxCUWidth*g_uiMaxCUHeight)>>((uhDepth+uiPartDepth)<<1); … … 2697 2760 #endif 2698 2761 2762 #if POZNAN_DBMP 2763 Bool bDBMPMerge = getSlice()->getMP()->isDBMPEnabled(); 2764 UInt uiDBMPAddr = POZNAN_DBMP_MRG_CAND; 2765 #endif 2766 2699 2767 bool abCandIsInter[ MRG_MAX_NUM_CANDS ]; 2700 2768 for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ++ui ) … … 2711 2779 pcCULeft = NULL; 2712 2780 } 2713 if( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx ) ) 2781 if( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx ) 2782 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 2783 && !pcCULeft->isCUSkiped( uiLeftPartIdx ) 2784 #endif 2785 ) 2714 2786 { 2715 2787 abCandIsInter[uiLeftAddr] = true; … … 2737 2809 pcCUAbove = NULL; 2738 2810 } 2739 if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx ) ) 2811 if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx ) 2812 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 2813 && !pcCUAbove->isCUSkiped( uiAbovePartIdx ) 2814 #endif 2815 ) 2740 2816 { 2741 2817 abCandIsInter[uiAboveAddr] = true; … … 3183 3259 #endif 3184 3260 3261 #if POZNAN_DBMP 3262 //===== add point-to-point merge with depth maps ===== 3263 if ( bDBMPMerge ) 3264 { 3265 //prediction of motion data for points with disocclusion: 3266 UInt uiRefArrayAddr = uiDBMPAddr; 3267 for(UInt ui=0; ui<MRG_MAX_NUM_CANDS; ui++) if ( ui!=uiDBMPAddr && abCandIsInter[ui] ) {uiRefArrayAddr = ui; break;} 3268 if(uiRefArrayAddr != uiDBMPAddr) 3269 { 3270 puhInterDirNeighbours[uiDBMPAddr] = puhInterDirNeighbours[uiRefArrayAddr]; 3271 pcMvFieldNeighbours[uiDBMPAddr << 1].setMvField(pcMvFieldNeighbours[uiRefArrayAddr << 1].getMv(),pcMvFieldNeighbours[uiRefArrayAddr << 1].getRefIdx()); 3272 pcMvFieldNeighbours[(uiDBMPAddr << 1)+1].setMvField(pcMvFieldNeighbours[(uiRefArrayAddr << 1)+1].getMv(),pcMvFieldNeighbours[(uiRefArrayAddr << 1)+1].getRefIdx()); 3273 } 3274 else 3275 { 3276 TComMv cMVzero; cMVzero.setZero(); 3277 if( getSlice()->isInterB() ) 3278 { 3279 puhInterDirNeighbours[uiDBMPAddr] = 3; 3280 pcMvFieldNeighbours[uiDBMPAddr << 1].setMvField(cMVzero,0); 3281 pcMvFieldNeighbours[(uiDBMPAddr << 1)+1].setMvField(cMVzero,0); 3282 } 3283 else 3284 { 3285 if(getSlice()->getNumRefIdx(REF_PIC_LIST_0)>0) 3286 { 3287 puhInterDirNeighbours[uiDBMPAddr] = 1; 3288 pcMvFieldNeighbours[uiDBMPAddr << 1].setMvField(cMVzero,0); 3289 } 3290 else if(getSlice()->getNumRefIdx(REF_PIC_LIST_1)>0) 3291 { 3292 puhInterDirNeighbours[uiDBMPAddr] = 2; 3293 pcMvFieldNeighbours[(uiDBMPAddr << 1)+1].setMvField(cMVzero,0); 3294 } 3295 else puhInterDirNeighbours[uiDBMPAddr] = 0; 3296 } 3297 } 3298 if(puhInterDirNeighbours[uiDBMPAddr]) 3299 { 3300 abCandIsInter[uiDBMPAddr] = true; 3301 puiNeighbourCandIdx[uiDBMPAddr] = uiDBMPAddr + 1; 3302 } 3303 } 3304 #endif 3305 3185 3306 3186 3307 //===== remove duplicates ===== 3187 3308 for( UInt uiOuter = 0; uiOuter < MRG_MAX_NUM_CANDS; uiOuter++ ) 3188 3309 { 3310 #if POZNAN_DBMP 3311 if(uiOuter==POZNAN_DBMP_MRG_CAND) continue; 3312 #endif 3189 3313 if( abCandIsInter[ uiOuter ] && ( puiNeighbourCandIdx[uiOuter] == uiOuter + 1 ) ) 3190 3314 { 3191 3315 for( UInt uiIter = uiOuter + 1; uiIter < MRG_MAX_NUM_CANDS; uiIter++ ) 3192 3316 { 3317 #if POZNAN_DBMP 3318 if(uiIter==POZNAN_DBMP_MRG_CAND) continue; 3319 #endif 3193 3320 if( abCandIsInter[ uiIter ] ) 3194 3321 { … … 3271 3398 if( uiIter == 0 ) 3272 3399 { 3273 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) ) 3400 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) 3401 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 3402 && !pcCorner->isCUSkiped( uiCornerPUIdx ) 3403 #endif 3404 ) 3274 3405 { 3275 3406 rbValidCand = true; … … 3306 3437 else 3307 3438 { 3308 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) ) 3439 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) 3440 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 3441 && !pcCorner->isCUSkiped( uiCornerPUIdx ) 3442 #endif 3443 ) 3309 3444 { 3310 3445 rbValidCand = true; … … 4464 4599 return false; 4465 4600 4601 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 4602 if (pColCU->isSkipped(uiPartIdxCenter)) 4603 return false; 4604 #endif 4605 4466 4606 if( m_pcSlice->getRefPic(eRefPicList, iRefIdx)->getViewIdx() != m_pcSlice->getViewIdx() ) 4467 4607 return false; … … 4821 4961 } 4822 4962 #endif 4963 4964 #if POZNAN_DBMP_CALC_PRED_DATA 4965 pcCU->getCUMvField2nd( REF_PIC_LIST_0 )->copyTo( &m_acCUMvField2nd[0], -Int(uiAbsPartIdxSrc) + uiAbsPartIdxDst, uiAbsPartIdxSrc, uiNumPartition ); 4966 pcCU->getCUMvField2nd( REF_PIC_LIST_1 )->copyTo( &m_acCUMvField2nd[1], -Int(uiAbsPartIdxSrc) + uiAbsPartIdxDst, uiAbsPartIdxSrc, uiNumPartition ); 4967 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 4968 for( UInt ui = 0; ui < uiNumPartition; ui++ ) 4969 { 4970 m_acCUMvField2nd[0].getMv( uiAbsPartIdxDst + ui ) += TComMv( 2, 2 ); 4971 m_acCUMvField2nd[0].getMv( uiAbsPartIdxDst + ui ) >>= 2; 4972 4973 m_acCUMvField2nd[1].getMv( uiAbsPartIdxDst + ui ) += TComMv( 2, 2 ); 4974 m_acCUMvField2nd[1].getMv( uiAbsPartIdxDst + ui ) >>= 2; 4975 4976 m_acCUMvField2nd[0].getMvd( uiAbsPartIdxDst + ui ) += TComMv( 2, 2 ); 4977 m_acCUMvField2nd[0].getMvd( uiAbsPartIdxDst + ui ) >>= 2; 4978 4979 m_acCUMvField2nd[1].getMvd( uiAbsPartIdxDst + ui ) += TComMv( 2, 2 ); 4980 m_acCUMvField2nd[1].getMvd( uiAbsPartIdxDst + ui ) >>= 2; 4981 } 4982 #endif 4983 #endif 4823 4984 } 4824 4985 #endif … … 4829 4990 riPosY = g_auiRasterToPelY[g_auiZscanToRaster[uiAbsPartIndex]] + getCUPelY(); 4830 4991 } 4992 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 4993 Int TComDataCU::CuQpIncrementFunction(Pel uiBlockMax) 4994 { 4995 if((uiBlockMax >> g_uiBitIncrement) >= 256 || (uiBlockMax >> g_uiBitIncrement) <0) 4996 { 4997 fprintf(stderr, "Bitincrement = %d, uiBlockMax = %d\n", g_uiBitIncrement, uiBlockMax); 4998 exit(333); 4999 } 5000 Float fVal = (Float)((255 - (uiBlockMax >> g_uiBitIncrement)) >> 4); 5001 fVal = (fVal * fVal); 5002 #if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC 5003 fVal = (Float)( fVal + getPic()->getTexDqpAccordingToDepthOffset() * 32); // add offset, if offset is negative than objects in front will have smaller QP than originaly - quality in front will be increased and in bacground will be decreased 5004 fVal = (Float)( fVal * getPic()->getTexDqpAccordingToDepthMul()); // 5005 #else 5006 fVal = (Float)( fVal + POZNAN_TEXTURE_TU_DELTA_QP_OFFSET * 32); // add offset, if offset is negative objects in front will have smaller QP than in original approach - quality in front will be increased and in bacground will be decreased 5007 fVal = (Float)( fVal * POZNAN_TEXTURE_TU_DELTA_QP_MUL); // 5008 #endif 5009 return (Int)fVal >> 5; 5010 } 5011 Int TComDataCU::getQpOffsetForTextCU(UInt uiPartIdx, Bool bIsIntra) 5012 { 5013 if(!getPic()->getSlice(0)->getSPS()->getUseTexDqpAccordingToDepth()) 5014 { 5015 return 0; 5016 } 5017 if(this->getPic()->getSlice(0)->getSPS()->isDepth()) 5018 { 5019 return 0; 5020 } 5021 #if POZNAN_TEXTURE_TU_DELTA_QP_NOT_IN_BASE_VIEW 5022 //if(!getPic()->getIsSideView()) 5023 if(this->getPic()->getViewIdx() == 0) 5024 { 5025 return 0; 5026 } 5027 #endif 5028 UInt iCuAddr = getAddr(); 5029 //TComPic * pcDepthPic = getPic()->getDepthPic(); 5030 TComPicYuv * pcDepthPicYUV = getPic()->getPicYuvSynthDepth(); 5031 if(pcDepthPicYUV /*pcDepthPic*/ == NULL) 5032 { 5033 char errortext[200]; 5034 sprintf(errortext, "depth map expected"); 5035 fprintf(stderr, "%s\n", errortext); 5036 exit(123); 5037 } 5038 //TComDataCU* rpcCUDepth = pcDepthPic->getCU(iCuAddr); 5039 Pel uiDepthLumaTransformBlockMax; 5040 if(bIsIntra) 5041 { 5042 // in intra block CU each TU block has QP chosen separatly so dQP is calculated for TU 5043 uiDepthLumaTransformBlockMax = getDepthLumaTransformBlockMax( pcDepthPicYUV /*rpcCUDepth*/, iCuAddr, uiPartIdx ); 5044 } 5045 else 5046 { 5047 // in inter block CU all TU block has the same QP so dQP is calculated for CU 5048 uiDepthLumaTransformBlockMax = getDepthLumaCodingBlockMax( pcDepthPicYUV /*rpcCUDepth*/, iCuAddr, uiPartIdx ); 5049 } 5050 #if POZNAN_NONLINEAR_DEPTH 5051 TComNonlinearDepthBackward cNonlinearDepthBwd(getSlice()->getSPS()->getDepthPower(), g_uiBitIncrement, g_uiBitIncrement); 5052 uiDepthLumaTransformBlockMax = (Pel)( cNonlinearDepthBwd(uiDepthLumaTransformBlockMax) + 0.5); 5053 #endif 5054 Int iDeltaQP = CuQpIncrementFunction(uiDepthLumaTransformBlockMax); 5055 #if POZNAN_TEXTURE_TU_DELTA_QP_TOP_BOTTOM_CU_ROW 5056 //Int iMaxCUHeight = this->getPic()->getPicSym()->getMaxCUHeight(); 5057 //Int iPicHeight = this->getPic()->getPicSym()->getPicHeight(); 5058 Int iMaxCUHeight = this->getPic()->getPicYuvRec()->getMaxCuHeight(); 5059 Int iPicHeight = this->getPic()->getPicYuvRec()->getHeight(); 5060 Int iLastPelYInFirstCURow = 0 + iMaxCUHeight; 5061 Int iFirstPelYInLastCURow = iPicHeight - iMaxCUHeight; 5062 Int iCUStartPelY = getCUPelY(); 5063 if((iCUStartPelY <= iLastPelYInFirstCURow) || (iCUStartPelY >= iFirstPelYInLastCURow)) 5064 { 5065 #if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC 5066 iDeltaQP += getPic()->getTexDqpAccordingToDepthTopBottomRow();// POZNAN_TEXTURE_TU_DELTA_QP_TOP_BOTTOM_CU_ROW; 5067 #else 5068 iDeltaQP += POZNAN_TEXTURE_TU_DELTA_QP_TOP_BOTTOM_ROW_VAL;// POZNAN_TEXTURE_TU_DELTA_QP_TOP_BOTTOM_CU_ROW; 5069 #endif 5070 } 5071 #endif 5072 return iDeltaQP; 5073 } 5074 5075 Int cmpProc(const Void *arg1, const Void *arg2) 5076 { 5077 return *((Pel*)arg2) - *((Pel*)arg1); 5078 } 5079 5080 // Function gets median value of depth block that has the same size and position as texture block that calls this function 5081 Pel TComDataCU::getDepthLumaCodingBlockMedian( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ) 5082 { 5083 static Pel pSortTable [64 * 64]; 5084 Int CUWidth, CUHeight; 5085 sortDepthLumaCodingBlock( pcDepthPicYUV /*rpcCUDepth*/, iCuAddr, uiPartIdx, pSortTable, CUWidth, CUHeight ); 5086 return pSortTable[(CUHeight * CUWidth) / 2]; 5087 } 5088 5089 // Function gets maximal value of depth block that has the same size and position as texture block that calls this function 5090 Pel TComDataCU::getDepthLumaCodingBlockMax( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ) 5091 { 5092 return maxDepthLumaCodingBlock( pcDepthPicYUV /*rpcCUDepth*/, iCuAddr, uiPartIdx); 5093 } 5094 Void TComDataCU::sortDepthLumaCodingBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx, Pel * pSortTable, Int& CUWidth, Int& CUHeight ) 5095 { 5096 Int x, y; 5097 UInt uiAbsZorderIdx = getZorderIdxInCU() + uiPartIdx; 5098 // CU size: 5099 CUHeight = getHeight(uiPartIdx); // Size is based on coded texture block size not on depth picture size 5100 CUWidth = getWidth(uiPartIdx); 5101 // uiAbsZorderIdx is z order idx of one particular base block (4x4 pix) in block that we process 5102 // What we need is z-order idx of first Base block (4x4 pix) in this block 5103 Int iNumBase4x4InBlock = (CUWidth >> 2) * (CUHeight >> 2); 5104 5105 UInt uiAbsZorderIdxBlockStart = (uiAbsZorderIdx / iNumBase4x4InBlock) * iNumBase4x4InBlock; 5106 // Address of block 5107 Pel* pPel = pcDepthPicYUV/*rpcCUDepth->getPic()->getPicYuvRec()*/->getLumaAddr ( iCuAddr, uiAbsZorderIdxBlockStart ); 5108 5109 Int p =0; 5110 Int iStride = getPic()->getPicYuvRec()->getStride(); 5111 for ( y = CUHeight - 1; y >= 0; y-- ) 5112 { 5113 for ( x = CUWidth - 1; x >= 0; x-- ) 5114 { 5115 pSortTable[p] = pPel[x]; ++p; 5116 } 5117 pPel += iStride; 5118 } 5119 // sort elements 5120 qsort(pSortTable, CUHeight * CUWidth, sizeof(Pel), cmpProc); 5121 } 5122 5123 Pel TComDataCU::maxDepthLumaCodingBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx) 5124 { 5125 Int x, y; 5126 UInt uiAbsZorderIdx = getZorderIdxInCU() + uiPartIdx; 5127 // CU size: 5128 Int CUHeight = getHeight(uiPartIdx); // Size is based on coded texture block size not on depth picture size 5129 Int CUWidth = getWidth(uiPartIdx); 5130 // uiAbsZorderIdx is z order idx of one particular base block (4x4 pix) in block that we process 5131 // What we need is z-order idx of first Base block (4x4 pix) in this block 5132 Int iNumBase4x4InBlock = (CUWidth >> 2) * (CUHeight >> 2); 5133 5134 UInt uiAbsZorderIdxBlockStart = (uiAbsZorderIdx / iNumBase4x4InBlock) * iNumBase4x4InBlock; 5135 // Address of block 5136 Pel* pPel = pcDepthPicYUV/*rpcCUDepth->getPic()->getPicYuvRec()*/->getLumaAddr ( iCuAddr, uiAbsZorderIdxBlockStart ); 5137 5138 Pel pValue = 0; 5139 Int iStride = getPic()->getPicYuvRec()->getStride(); 5140 for ( y = CUHeight - 1; y >= 0; y-- ) 5141 { 5142 for ( x = CUWidth - 1; x >= 0; x-- ) 5143 { 5144 if (pPel[x]>pValue) pValue = pPel[x]; 5145 } 5146 pPel += iStride; 5147 } 5148 return pValue; 5149 } 5150 5151 // Function gets median value of depth block that has the same size and position as texture block that calls this function 5152 Pel TComDataCU::getDepthLumaTransformBlockMedian( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ) 5153 { 5154 static Pel pSortTable [64 * 64]; 5155 Int TUWidth, TUHeight; 5156 sortDepthLumaTransformBlock( pcDepthPicYUV/*rpcCUDepth*/, iCuAddr, uiPartIdx, pSortTable, TUWidth, TUHeight ); 5157 return pSortTable[(TUHeight * TUWidth) / 2]; 5158 } 5159 5160 // Function gets maximal value of depth block that has the same size and position as texture block that calls this function 5161 Pel TComDataCU::getDepthLumaTransformBlockMax( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ) 5162 { 5163 return maxDepthLumaTransformBlock( pcDepthPicYUV/*rpcCUDepth*/, iCuAddr, uiPartIdx ); 5164 } 5165 Void TComDataCU::sortDepthLumaTransformBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx, Pel * pSortTable, Int& TUWidth, Int& TUHeight ) 5166 { 5167 Int x, y; 5168 UInt uiAbsZorderIdx = getZorderIdxInCU() + uiPartIdx; 5169 // CU size: 5170 TUHeight = getHeight(uiPartIdx); // Size is based on coded texture block size not on depth picture size 5171 TUWidth = getWidth(uiPartIdx); 5172 // correct CU size to trnsform size: 5173 if( getTransformIdx(uiPartIdx) ) 5174 { 5175 TUWidth = TUWidth >> 1; 5176 TUHeight = TUHeight >> 1; 5177 } 5178 // uiAbsZorderIdx is z order idx of one particular base block (4x4 pix) in block that we process 5179 // What we need is z-order idx of first Base block (4x4 pix) in this block 5180 Int iNumBase4x4InBlock = (TUWidth >> 2) * (TUHeight >> 2); 5181 5182 UInt uiAbsZorderIdxBlockStart = (uiAbsZorderIdx / iNumBase4x4InBlock) * iNumBase4x4InBlock; 5183 // Address of block 5184 Pel* pPel = pcDepthPicYUV/*rpcCUDepth->getPic()->getPicYuvRec()*/->getLumaAddr ( iCuAddr, uiAbsZorderIdxBlockStart ); 5185 5186 int p = 0; 5187 Int iStride = getPic()->getPicYuvRec()->getStride(); 5188 for ( y = TUHeight - 1; y >= 0; y-- ) 5189 { 5190 for ( x = TUWidth - 1; x >= 0; x-- ) 5191 { 5192 pSortTable[p] = pPel[x]; 5193 } 5194 pPel += iStride; 5195 } 5196 // sort elements 5197 qsort(pSortTable, TUHeight * TUWidth, sizeof(Pel), cmpProc); 5198 } 5199 Pel TComDataCU::maxDepthLumaTransformBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx) 5200 { 5201 Int x, y; 5202 UInt uiAbsZorderIdx = getZorderIdxInCU() + uiPartIdx; 5203 // CU size: 5204 Int TUHeight = getHeight(uiPartIdx); // Size is based on coded texture block size not on depth picture size 5205 Int TUWidth = getWidth(uiPartIdx); 5206 // correct CU size to trnsform size: 5207 if( getTransformIdx(uiPartIdx) ) 5208 { 5209 TUWidth = TUWidth >> 1; 5210 TUHeight = TUHeight >> 1; 5211 } 5212 // uiAbsZorderIdx is z order idx of one particular base block (4x4 pix) in block that we process 5213 // What we need is z-order idx of first Base block (4x4 pix) in this block 5214 Int iNumBase4x4InBlock = (TUWidth >> 2) * (TUHeight >> 2); 5215 5216 UInt uiAbsZorderIdxBlockStart = (uiAbsZorderIdx / iNumBase4x4InBlock) * iNumBase4x4InBlock; 5217 // Address of block 5218 Pel* pPel = pcDepthPicYUV/*rpcCUDepth->getPic()->getPicYuvRec()*/->getLumaAddr ( iCuAddr, uiAbsZorderIdxBlockStart ); 5219 5220 Pel pValue = 0; 5221 Int iStride = getPic()->getPicYuvRec()->getStride(); 5222 for ( y = TUHeight - 1; y >= 0; y-- ) 5223 { 5224 for ( x = TUWidth - 1; x >= 0; x-- ) 5225 { 5226 if (pPel[x]>pValue) pValue = pPel[x]; 5227 } 5228 pPel += iStride; 5229 } 5230 return pValue; 5231 } 5232 // Function gets median value of depth block that has the same size and position as texture block that calls this function 5233 Pel TComDataCU::getDepthLumaPredictionBlockMedian( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ) 5234 { 5235 static Pel pSortTable [64 * 64]; 5236 Int PUWidth, PUHeight; 5237 sortDepthLumaPredictionBlock( pcDepthPicYUV/*rpcCUDepth*/, iCuAddr, uiPartIdx, pSortTable, PUWidth, PUHeight ); 5238 return pSortTable[(PUHeight * PUWidth) / 2]; 5239 } 5240 5241 // Function gets maximal value of depth block that has the same size and position as texture block that calls this function 5242 Pel TComDataCU::getDepthLumaPredictionBlockMax( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ) 5243 { 5244 static Pel pSortTable [64 * 64]; 5245 Int PUWidth, PUHeight; 5246 sortDepthLumaPredictionBlock( pcDepthPicYUV/*rpcCUDepth*/, iCuAddr, uiPartIdx, pSortTable, PUWidth, PUHeight ); 5247 return pSortTable[0]; 5248 } 5249 Void TComDataCU::sortDepthLumaPredictionBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx, Pel * pSortTable, Int& PUWidth, Int& PUHeight ) 5250 { 5251 Int x, y; 5252 UInt uiAbsZorderIdx = getZorderIdxInCU() + uiPartIdx; 5253 // CU size: 5254 PUHeight = getHeight(uiPartIdx); // Size is based on coded texture block size not on depth picture size 5255 PUWidth = getWidth(uiPartIdx); 5256 // correct CU size to partition size: 5257 if( getPartitionSize(uiPartIdx) == SIZE_Nx2N || getPartitionSize(uiPartIdx) == SIZE_NxN ) 5258 { 5259 PUWidth = PUWidth >> 1; 5260 } 5261 if( getPartitionSize(uiPartIdx) == SIZE_2NxN || getPartitionSize(uiPartIdx) == SIZE_NxN ) 5262 { 5263 PUHeight = PUHeight >> 1; 5264 } 5265 5266 // uiAbsZorderIdx is z order idx of one particular base block (4x4 pix) in block that we process 5267 // What we need is z-order idx of first Base block (4x4 pix) in this block 5268 Int iNumBase4x4InBlock = (PUWidth >> 2) * (PUHeight >> 2); 5269 if(getPartitionSize(uiPartIdx) == SIZE_Nx2N) 5270 { 5271 iNumBase4x4InBlock = iNumBase4x4InBlock << 1; // KUBA if PU is Nx2N than to count start z-order idx we need to make such trick 5272 } 5273 UInt uiAbsZorderIdxBlockStart = (uiAbsZorderIdx / iNumBase4x4InBlock) * iNumBase4x4InBlock; 5274 // Address of block 5275 Pel* pPel = pcDepthPicYUV/*rpcCUDepth->getPic()->getPicYuvRec()*/->getLumaAddr ( iCuAddr, uiAbsZorderIdxBlockStart ); 5276 5277 UInt uiStride = getPic()->getPicYuvRec()->getStride(); 5278 for ( y = PUHeight - 1; y >= 0; y-- ) 5279 { 5280 for ( x = PUWidth - 1; x >= 0; x-- ) 5281 { 5282 pSortTable[y*PUWidth + x] = pPel[y*uiStride + x]; 5283 } 5284 } 5285 // sort elements 5286 qsort(pSortTable, PUHeight * PUWidth, sizeof(Pel), cmpProc); 5287 } 5288 #endif -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComDataCU.h
r5 r28 105 105 #endif//SNY_DQP 106 106 107 #if POZNAN_DBMP_CALC_PRED_DATA 108 TComCUMvField m_acCUMvField2nd[2]; ///< array of motion vectors selected for points with no MP prediction available 109 #endif 110 107 111 // ------------------------------------------------------------------------------------------------------------------- 108 112 // neighbour access variables … … 310 314 #endif 311 315 316 #if POZNAN_DBMP_CALC_PRED_DATA 317 TComCUMvField* getCUMvField2nd ( RefPicList e ) { return &m_acCUMvField2nd[e]; } 318 #endif 319 312 320 // ------------------------------------------------------------------------------------------------------------------- 313 321 // member functions for coding tool information … … 529 537 Bool isIntra ( UInt uiPartIdx ) { return m_pePredMode[ uiPartIdx ] == MODE_INTRA; } 530 538 Bool isSkipped ( UInt uiPartIdx ); ///< SKIP (no residual) 539 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 540 Bool isCUSkiped( UInt uiPartIdx ) { return m_pePredMode[ uiPartIdx ] == MODE_SYNTH; } 541 #endif 531 542 532 543 // ------------------------------------------------------------------------------------------------------------------- … … 585 596 #endif //QC_MDCS 586 597 598 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 599 Int CuQpIncrementFunction ( Pel uiBlockMax ); 600 Int getQpOffsetForTextCU ( UInt uiPartIdx, Bool bIsIntra ); 601 Pel getDepthLumaCodingBlockMedian ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ); 602 Pel getDepthLumaCodingBlockMax ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ); 603 Void sortDepthLumaCodingBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx, Pel * pSortTable, Int& TUWidth, Int& TUHeight); 604 Pel maxDepthLumaCodingBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ); 605 Pel getDepthLumaTransformBlockMedian ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ); 606 Pel getDepthLumaTransformBlockMax ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ); 607 Void sortDepthLumaTransformBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx , Pel * pSortTable, Int& TUWidth, Int& TUHeight); 608 Pel maxDepthLumaTransformBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ); 609 Pel getDepthLumaPredictionBlockMedian( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ); 610 Pel getDepthLumaPredictionBlockMax ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx ); 611 Void sortDepthLumaPredictionBlock ( TComPicYuv * pcDepthPicYUV/*TComDataCU* rpcCUDepth*/, UInt iCuAddr, UInt uiPartIdx , Pel * pSortTable, Int& PUWidth, Int& PUHeight); 612 #endif 587 613 }; 588 614 -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComDepthMapGenerator.cpp
r21 r28 985 985 xInterPredictCUDepthMap( pcSubCU, pcSubDM ); 986 986 break; 987 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 988 case MODE_SYNTH: 989 //What to do? Need Fix! 990 xIntraPredictCUDepthMap( pcSubCU, pcSubDM ); 991 break; 992 #endif 987 993 default: 988 994 AOT( true ); -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComLoopFilter.cpp
r5 r28 444 444 445 445 //-- Set BS for Intra MB : BS = 4 or 3 446 if ( pcCUP->isIntra(uiPartP) || pcCUQ->isIntra(uiPartQ) ) 446 if ( pcCUP->isIntra(uiPartP) || pcCUQ->isIntra(uiPartQ) 447 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 448 || pcCUP->isCUSkiped(uiPartP) || pcCUQ->isCUSkiped(uiPartQ) 449 #endif 450 ) 447 451 { 448 452 uiBs = bAtCUBoundary ? 4 : 3; // Intra MB && MB boundary … … 450 454 451 455 //-- Set BS for not Intra MB : BS = 2 or 1 or 0 452 if ( !pcCUP->isIntra(uiPartP) && !pcCUQ->isIntra(uiPartQ) ) 456 if ( !pcCUP->isIntra(uiPartP) && !pcCUQ->isIntra(uiPartQ) 457 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 458 && !pcCUP->isCUSkiped(uiPartP) && !pcCUQ->isCUSkiped(uiPartQ) 459 #endif 460 ) 453 461 { 454 462 if ( pcCUQ->getCbf( uiPartQ, TEXT_LUMA, pcCUQ->getTransformIdx(uiPartQ)) != 0 || pcCUP->getCbf( uiPartP, TEXT_LUMA, pcCUP->getTransformIdx(uiPartP) ) != 0) … … 528 536 } // enf of "if( not Intra )" 529 537 538 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU //if one of the block is CUSkipped dont use loop filter 539 if ( pcCUP->isCUSkiped(uiPartP) || pcCUQ->isCUSkiped(uiPartQ)) 540 { 541 uiBs = 0; 542 } 543 #endif 544 530 545 m_aapucBS[iDir][0][uiAbsPartIdx] = uiBs; 531 546 if ( bAtCUBoundary || bAtCUHalf ) -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComPic.cpp
r21 r28 50 50 m_apcPicYuv[0] = NULL; 51 51 m_apcPicYuv[1] = NULL; 52 #if POZNAN_AVAIL_MAP 53 m_apcPicYuvAvail = NULL; 54 #endif 55 #if POZNAN_SYNTH_VIEW 56 m_apcPicYuvSynth = NULL; 57 #endif 58 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 59 m_apcPicYuvSynthDepth= NULL; 60 #endif 52 61 #if DEPTH_MAP_GENERATION 53 62 m_pcPredDepthMap = NULL; … … 118 127 m_apcPicYuv[1] = NULL; 119 128 } 129 #if POZNAN_AVAIL_MAP 130 if (m_apcPicYuvAvail) 131 { 132 m_apcPicYuvAvail->destroy(); 133 delete m_apcPicYuvAvail; 134 m_apcPicYuvAvail = NULL; 135 } 136 #endif 137 138 #if POZNAN_SYNTH_VIEW 139 if (m_apcPicYuvSynth) 140 { 141 m_apcPicYuvSynth->destroy(); 142 delete m_apcPicYuvSynth; 143 m_apcPicYuvSynth = NULL; 144 } 145 #endif 146 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 147 if (m_apcPicYuvSynthDepth) 148 { 149 m_apcPicYuvSynthDepth->destroy(); 150 delete m_apcPicYuvSynthDepth; 151 m_apcPicYuvSynthDepth = NULL; 152 } 153 #endif 120 154 121 155 #if DEPTH_MAP_GENERATION … … 195 229 } 196 230 231 #if POZNAN_AVAIL_MAP 232 Void 233 TComPic::addAvailabilityBuffer() 234 { 235 AOT( m_apcPicYuvAvail ); 236 AOF( m_apcPicYuv[1] ); 237 Int iWidth = m_apcPicYuv[1]->getWidth (); 238 Int iHeight = m_apcPicYuv[1]->getHeight (); 239 UInt uiMaxCuWidth = m_apcPicYuv[1]->getMaxCuWidth (); 240 UInt uiMaxCuHeight = m_apcPicYuv[1]->getMaxCuHeight(); 241 UInt uiMaxCuDepth = m_apcPicYuv[1]->getMaxCuDepth (); 242 m_apcPicYuvAvail = new TComPicYuv; 243 m_apcPicYuvAvail ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth ); 244 } 245 #endif 246 247 #if POZNAN_SYNTH_VIEW 248 Void 249 TComPic::addSynthesisBuffer() 250 { 251 AOT( m_apcPicYuvSynth ); 252 AOF( m_apcPicYuv[1] ); 253 Int iWidth = m_apcPicYuv[1]->getWidth (); 254 Int iHeight = m_apcPicYuv[1]->getHeight (); 255 UInt uiMaxCuWidth = m_apcPicYuv[1]->getMaxCuWidth (); 256 UInt uiMaxCuHeight = m_apcPicYuv[1]->getMaxCuHeight(); 257 UInt uiMaxCuDepth = m_apcPicYuv[1]->getMaxCuDepth (); 258 m_apcPicYuvSynth = new TComPicYuv; 259 m_apcPicYuvSynth ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth ); 260 } 261 #endif 262 263 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 264 Void 265 TComPic::addSynthesisDepthBuffer() 266 { 267 AOT( m_apcPicYuvSynthDepth ); 268 AOF( m_apcPicYuv[1] ); 269 Int iWidth = m_apcPicYuv[1]->getWidth (); 270 Int iHeight = m_apcPicYuv[1]->getHeight (); 271 UInt uiMaxCuWidth = m_apcPicYuv[1]->getMaxCuWidth (); 272 UInt uiMaxCuHeight = m_apcPicYuv[1]->getMaxCuHeight(); 273 UInt uiMaxCuDepth = m_apcPicYuv[1]->getMaxCuDepth (); 274 m_apcPicYuvSynthDepth = new TComPicYuv; 275 m_apcPicYuvSynthDepth ->create( iWidth, iHeight, uiMaxCuWidth, uiMaxCuHeight, uiMaxCuDepth ); 276 } 277 #endif 278 197 279 #if PARALLEL_MERGED_DEBLK 198 280 Void … … 286 368 } 287 369 370 #if POZNAN_AVAIL_MAP 371 Void 372 TComPic::removeAvailabilityBuffer() 373 { 374 if( m_apcPicYuvAvail ) 375 { 376 m_apcPicYuvAvail->destroy(); 377 delete m_apcPicYuvAvail; 378 m_apcPicYuvAvail = NULL; 379 } 380 } 381 #endif 382 383 #if POZNAN_SYNTH_VIEW 384 Void 385 TComPic::removeSynthesisBuffer() 386 { 387 if( m_apcPicYuvSynth ) 388 { 389 m_apcPicYuvSynth->destroy(); 390 delete m_apcPicYuvSynth; 391 m_apcPicYuvSynth = NULL; 392 } 393 } 394 #endif 395 396 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 397 Void 398 TComPic::removeSynthesisDepthBuffer() 399 { 400 if( m_apcPicYuvSynthDepth ) 401 { 402 m_apcPicYuvSynthDepth->destroy(); 403 delete m_apcPicYuvSynthDepth; 404 m_apcPicYuvSynthDepth = NULL; 405 } 406 } 407 #endif 408 288 409 #if PARALLEL_MERGED_DEBLK 289 410 Void … … 351 472 #endif 352 473 474 #if POZNAN_AVAIL_MAP 475 Void TComPic::checkSynthesisAvailability( TComDataCU*& rpcCU, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied ) 476 { 477 rpbCUSynthesied[0] = true; 478 rpbCUSynthesied[1] = true; 479 rpbCUSynthesied[2] = true; 480 rpbCUSynthesied[3] = true; 481 482 if (!getPicYuvAvail()) 483 { 484 rpbCUSynthesied[0] = false; 485 rpbCUSynthesied[1] = false; 486 rpbCUSynthesied[2] = false; 487 rpbCUSynthesied[3] = false; 488 return; 489 } 490 491 Int x, y; 492 Bool bAvailable = true; 493 Pel* pAvail = getPicYuvAvail()->getLumaAddr ( iCuAddr, uiAbsZorderIdx ); 494 Int CUHeight = g_uiMaxCUHeight >> uiPartDepth; //rpcCU->getHeight(uiAbsZorderIdx); 495 Int CUWidth = g_uiMaxCUWidth >> uiPartDepth; //rpcCU->getWidth(uiAbsZorderIdx); 496 497 Int iStride = getPicYuvAvail()->getStride(); 498 for ( y = ((CUHeight - 1) >> 1); y >= 0; y-- ) 499 { 500 for ( x = ((CUWidth - 1) >> 1); x >= 0; x-- ) 501 { 502 rpbCUSynthesied[0] &= (pAvail[x] != 0); 503 } 504 for ( x = CUWidth - 1; x >= ((CUWidth) >> 1); x-- ) 505 { 506 rpbCUSynthesied[1] &= (pAvail[x] != 0); 507 } 508 pAvail += iStride; 509 } 510 //for ( y = CUHeight - 1; y >= ((CUHeight) >> 1); y-- ) 511 for ( y = ((CUHeight - 1) >> 1); y >= 0; y-- ) //Owieczka 512 { 513 for ( x = ((CUWidth - 1) >> 1); x >= 0; x-- ) 514 { 515 rpbCUSynthesied[2] &= (pAvail[x] != 0); 516 } 517 for ( x = CUWidth - 1; x >= ((CUWidth) >> 1); x-- ) 518 { 519 rpbCUSynthesied[3] &= (pAvail[x] != 0); 520 } 521 pAvail += iStride; 522 } 523 524 //rpbCUSynthesied[0] = !rpbCUSynthesied[0]; 525 //rpbCUSynthesied[1] = !rpbCUSynthesied[1]; 526 //rpbCUSynthesied[2] = !rpbCUSynthesied[2]; 527 //rpbCUSynthesied[3] = !rpbCUSynthesied[3]; 528 } 529 #endif -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComPic.h
r21 r28 61 61 62 62 TComPicYuv* m_apcPicYuv[2]; // Texture, 0:org / 1:rec 63 64 #if POZNAN_AVAIL_MAP 65 TComPicYuv* m_apcPicYuvAvail; // Availability Map - Does the given pixel can be synthesised in receiver 66 #endif 67 68 #if POZNAN_SYNTH_VIEW 69 TComPicYuv* m_apcPicYuvSynth; // Sythesied image 70 #endif 71 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 72 TComPicYuv* m_apcPicYuvSynthDepth; // Sythesied depth image 73 #endif 74 63 75 #if DEPTH_MAP_GENERATION 64 76 TComPicYuv* m_pcPredDepthMap; // estimated depth map … … 101 113 #if HHI_INTERVIEW_SKIP 102 114 TComPicYuv* m_pcUsedPelsMap; 115 #endif 116 #if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC 117 Double m_dTexDqpAccordingToDepthOffset; 118 Double m_dTexDqpAccordingToDepthMul; 119 Int m_iTexDqpAccordingToDepthTopBottomRow; 103 120 #endif 104 121 … … 129 146 TComPicYuv* getPicYuvOrg() { return m_apcPicYuv[0]; } 130 147 TComPicYuv* getPicYuvRec() { return m_apcPicYuv[1]; } 148 149 #if POZNAN_AVAIL_MAP 150 TComPicYuv* getPicYuvAvail() { return m_apcPicYuvAvail; } //Owieczka - returns available map from other pic image 151 #endif 152 153 #if POZNAN_SYNTH_VIEW 154 TComPicYuv* getPicYuvSynth() { return m_apcPicYuvSynth; } //Owieczka - returns synth form other pic in image 155 #endif 156 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 157 TComPicYuv* getPicYuvSynthDepth() { return m_apcPicYuvSynthDepth; }; // Sythesied depth image 158 #endif 131 159 132 160 #if DEPTH_MAP_GENERATION … … 203 231 204 232 Void addOriginalBuffer (); 233 #if POZNAN_AVAIL_MAP 234 Void addAvailabilityBuffer (); 235 #endif 236 #if POZNAN_SYNTH_VIEW 237 Void addSynthesisBuffer (); 238 #endif 239 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 240 Void addSynthesisDepthBuffer (); 241 #endif 205 242 #if PARALLEL_MERGED_DEBLK 206 243 Void addDeblockBuffer (); … … 221 258 222 259 Void removeOriginalBuffer (); 260 #if POZNAN_SYNTH_VIEW 261 Void removeSynthesisBuffer (); 262 #endif 263 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 264 Void removeSynthesisDepthBuffer (); 265 #endif 266 #if POZNAN_AVAIL_MAP 267 Void removeAvailabilityBuffer(); 268 #endif 223 269 #if PARALLEL_MERGED_DEBLK 224 270 Void removeDeblockBuffer (); … … 235 281 #if HHI_INTERVIEW_SKIP 236 282 Void removeUsedPelsMapBuffer (); 283 #endif 284 285 #if POZNAN_AVAIL_MAP 286 Void checkSynthesisAvailability( TComDataCU*& rpcBestCU, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied); 237 287 #endif 238 288 … … 254 304 const SEImessages* getSEIs() const { return m_SEIs; } 255 305 306 #if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC 307 Double getTexDqpAccordingToDepthOffset( ) { return m_dTexDqpAccordingToDepthOffset;} 308 Double getTexDqpAccordingToDepthMul( ) { return m_dTexDqpAccordingToDepthMul;} 309 Int getTexDqpAccordingToDepthTopBottomRow( ){ return m_iTexDqpAccordingToDepthTopBottomRow;} 310 Void setTexDqpAccordingToDepthOffset ( Double dTexDqpAccordingToDepthOffset ){ m_dTextureCuDeltaQpOffset = dTexDqpAccordingToDepthOffset; } 311 Void setTexDqpAccordingToDepthMul ( Double dTexDqpAccordingToDepthMul ){ m_dTexDqpAccordingToDepthMul = dTexDqpAccordingToDepthMul; } 312 Void setTexDqpAccordingToDepthTopBottomRow( Int iTexDqpAccordingToDepthTopBottomRow ){ m_iTexDqpAccordingToDepthTopBottomRow = iTexDqpAccordingToDepthTopBottomRow; } 313 #endif 256 314 };// END CLASS DEFINITION TComPic 257 315 -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComPicSym.h
r5 r28 43 43 44 44 // Include files 45 #if POZNAN_MP 46 #include "../TLibCommon/TComMP.h" 47 #endif 48 45 49 #include "CommonDef.h" 46 50 #include "TComSlice.h" -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComPicYuv.cpp
r17 r28 8 8 #include <assert.h> 9 9 #include <memory.h> 10 #include <math.h> 10 11 11 12 #ifdef __APPLE__ … … 455 456 } 456 457 } 458 #if POZNAN_NONLINEAR_DEPTH 459 Void TComPicYuv::nonlinearDepthForward(TComPicYuv *pcPicDst, Float p) 460 { 461 Int x,y; 462 TComNonlinearDepthForward cNonlinearDepthFwd(p, g_uiBitIncrement, g_uiBitIncrement); 463 464 // Luma 465 Pel* pPelSrc = getLumaAddr(); 466 Pel* pPelDst = pcPicDst->getLumaAddr(); 467 for(y=0; y<m_iPicHeight; y++) 468 { 469 for(x=0; x<m_iPicWidth; x++) 470 { 471 pPelDst[x] = (Pel)( cNonlinearDepthFwd(pPelSrc[x]) + 0.5); 472 } 473 pPelDst += pcPicDst->getStride(); 474 pPelSrc += getStride(); 475 } 476 // Chroma 477 copyToPicCb(pcPicDst); 478 copyToPicCr(pcPicDst); 479 } 480 Void TComPicYuv::nonlinearDepthBackward(TComPicYuv *pcPicDst, Float p) 481 { 482 Int x,y; 483 TComNonlinearDepthBackward cNonlinearDepthBwd(p, g_uiBitIncrement, g_uiBitIncrement); 484 485 // Luma 486 Pel* pPelSrc = getLumaAddr(); 487 Pel* pPelDst = pcPicDst->getLumaAddr(); 488 for(y=0; y<m_iPicHeight; y++) 489 { 490 for(x=0; x<m_iPicWidth; x++) 491 { 492 pPelDst[x] = (Pel)( cNonlinearDepthBwd(pPelSrc[x]) + 0.5); 493 } 494 pPelDst += pcPicDst->getStride(); 495 pPelSrc += getStride(); 496 } 497 // Chroma 498 copyToPicCb(pcPicDst); 499 copyToPicCr(pcPicDst); 500 } 501 #endif -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComPicYuv.h
r5 r28 44 44 #include "CommonDef.h" 45 45 46 #if POZNAN_NONLINEAR_DEPTH 47 48 #include <math.h> 49 50 class TComNonlinearDepthForward // OLGIERD - Z-NL-Power conversion 51 { 52 private: 53 Double m_fMul; 54 Float m_fPower; 55 56 public: 57 58 TComNonlinearDepthForward(Float fPower, Int iInputBitIncrement, Int iOutputBitIncrement) 59 { 60 m_fPower = fPower; 61 Double fPostMul = (1<<(8+iOutputBitIncrement))-1; // OLGIERD ToDo - should be or not? 62 Double fPreMul = 1.0/((1<<(8+iInputBitIncrement))-1); 63 m_fMul = fPostMul*pow(fPreMul,(Double)fPower); 64 }; 65 66 inline Double operator() (Double Value) 67 { 68 if (Value<0) return -pow( -Value,(Double)m_fPower)*m_fMul; 69 return pow(Value,(Double)m_fPower)*m_fMul; 70 }; 71 }; 72 73 class TComNonlinearDepthBackward // OLGIERD - Z-NL-Power conversion 74 { 75 private: 76 Double m_fMul; 77 Float m_fPower; 78 79 public: 80 81 TComNonlinearDepthBackward(Float fPower, Int iInputBitIncrement, Int iOutputBitIncrement) 82 { 83 m_fPower = fPower = 1.0/fPower; 84 Double fPostMul = (1<<(8+iOutputBitIncrement))-1; // OLGIERD ToDo - should be or not? 85 Double fPreMul = 1.0/((1<<(8+iInputBitIncrement))-1); 86 m_fMul = fPostMul*pow(fPreMul,(Double)fPower); 87 }; 88 89 inline Double operator() (Double Value) 90 { 91 if (Value<0) return -pow( -Value,(Double)m_fPower)*m_fMul; 92 return pow(Value,(Double)m_fPower)*m_fMul; 93 }; 94 }; 95 #endif 46 96 // ==================================================================================================================== 47 97 // Class definition … … 175 225 Void setChromaTo ( Pel pVal ); 176 226 227 #if POZNAN_NONLINEAR_DEPTH 228 Void nonlinearDepthForward(TComPicYuv *pcPicDst, Float p); 229 Void nonlinearDepthBackward(TComPicYuv *pcPicDst, Float p); 230 #endif 177 231 };// END CLASS DEFINITION TComPicYuv 178 232 -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComPrediction.cpp
r21 r28 1521 1521 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight ); 1522 1522 1523 #if POZNAN_DBMP 1524 if(pcCU->getMergeIndex(uiPartAddr)==POZNAN_DBMP_MRG_CAND) 1525 { 1526 #if DEPTH_MAP_GENERATION 1527 motionCompensation_DBMP( pcCU, pcYuvPred, eRefPicList, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY ); 1528 #else 1529 motionCompensation_DBMP( pcCU, pcYuvPred, eRefPicList, iPartIdx ); 1530 #endif 1531 return; 1532 } 1533 #endif 1534 1523 1535 #if DEPTH_MAP_GENERATION 1524 1536 if( bPrdDepthMap ) … … 1558 1570 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight ); 1559 1571 1572 #if POZNAN_DBMP 1573 if(pcCU->getMergeIndex(uiPartAddr)==POZNAN_DBMP_MRG_CAND) 1574 { 1575 #if DEPTH_MAP_GENERATION 1576 motionCompensation_DBMP( pcCU, pcYuvPred, eRefPicList, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY ); 1577 #else 1578 motionCompensation_DBMP( pcCU, pcYuvPred, eRefPicList, iPartIdx ); 1579 #endif 1580 continue; 1581 } 1582 #endif 1583 1560 1584 #if DEPTH_MAP_GENERATION 1561 1585 if( bPrdDepthMap ) … … 1591 1615 return; 1592 1616 } 1617 1618 #if POZNAN_DBMP 1619 #if DEPTH_MAP_GENERATION 1620 Void TComPrediction::motionCompensation_DBMP ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY ) 1621 #else 1622 Void TComPrediction::motionCompensation_DBMP ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList, Int iPartIdx ) 1623 #endif 1624 { 1625 if(!pcCU->getSlice()->getMP()->isDBMPEnabled()) return; 1626 1627 Int iPartIdxOrg = iPartIdx; 1628 Int iWidth; 1629 Int iHeight; 1630 UInt uiPartAddr; 1631 1632 Int x,y; 1633 Int px,py,iCUBaseX,iCUBaseY; 1634 Int ref_frame0, ref_frame1; 1635 Int ref_frame0_idx, ref_frame1_idx; 1636 TComMv mv0,mv1; 1637 1638 Int ref_frame0_idx_2nd, ref_frame1_idx_2nd; 1639 TComMv mv0_2nd,mv1_2nd; 1640 1641 Pel* piDstCb; 1642 Pel* piDstCr; 1643 Pel aiUTab[MAX_CU_SIZE]; 1644 Pel aiVTab[MAX_CU_SIZE]; 1645 Pel iULast; 1646 Pel iVLast; 1647 Pel iTemp; 1648 1649 TComMP* pcMP = pcCU->getSlice()->getMP(); 1650 UInt uiViewId = pcCU->getSlice()->getSPS()->getViewId(); 1651 Bool bIsDepth = pcCU->getSlice()->getSPS()->isDepth(); 1652 1653 #if POZNAN_DBMP_CALC_PRED_DATA 1654 UInt uiPointCnt; 1655 #endif 1656 1657 for ( iPartIdx = 0; iPartIdx < pcCU->getNumPartInter(); iPartIdx++ ) 1658 { 1659 if ( iPartIdxOrg >= 0 ) iPartIdx = iPartIdxOrg; 1660 1661 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight ); 1662 1663 //get motion data used for no-MP predicted points 1664 #if POZNAN_DBMP_CALC_PRED_DATA 1665 ref_frame0_idx_2nd = pcCU->getCUMvField2nd(REF_PIC_LIST_0)->getRefIdx(uiPartAddr); 1666 mv0_2nd = pcCU->getCUMvField2nd( REF_PIC_LIST_0 )->getMv( uiPartAddr ); 1667 1668 ref_frame1_idx_2nd = pcCU->getCUMvField2nd(REF_PIC_LIST_1)->getRefIdx(uiPartAddr); 1669 mv1_2nd = pcCU->getCUMvField2nd( REF_PIC_LIST_1 )->getMv( uiPartAddr ); 1670 #else 1671 ref_frame0_idx_2nd = pcCU->getCUMvField(REF_PIC_LIST_0)->getRefIdx(uiPartAddr); 1672 mv0_2nd = pcCU->getCUMvField( REF_PIC_LIST_0 )->getMv( uiPartAddr ); 1673 1674 ref_frame1_idx_2nd = pcCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx(uiPartAddr); 1675 mv1_2nd = pcCU->getCUMvField( REF_PIC_LIST_1 )->getMv( uiPartAddr ); 1676 #endif 1677 1678 iCUBaseX = pcCU->getCUPelX()+g_auiRasterToPelX[ g_auiZscanToRaster[uiPartAddr] ]; 1679 iCUBaseY = pcCU->getCUPelY()+g_auiRasterToPelY[ g_auiZscanToRaster[uiPartAddr] ]; 1680 1681 #if DEPTH_MAP_GENERATION 1682 if( bPrdDepthMap ) 1683 { 1684 iWidth >>= uiSubSampExpX; 1685 iHeight >>= uiSubSampExpY; 1686 } 1687 #endif 1688 1689 #if POZNAN_DBMP_CALC_PRED_DATA 1690 uiPointCnt = 0; 1691 #endif 1692 1693 for( py = 0; py < iHeight; py++) 1694 { 1695 for( px = 0; px < iWidth; px++) 1696 { 1697 #if DEPTH_MAP_GENERATION 1698 if( bPrdDepthMap ) 1699 { 1700 x = iCUBaseX+(px<<uiSubSampExpX); 1701 y = iCUBaseY+(py<<uiSubSampExpY); 1702 } 1703 else 1704 #endif 1705 { 1706 x = iCUBaseX+px; 1707 y = iCUBaseY+py; 1708 } 1709 1710 pcMP->getDBMPPredData(pcCU, x, y, ref_frame0, ref_frame0_idx, mv0, ref_frame0_idx_2nd, mv0_2nd, 1711 ref_frame1, ref_frame1_idx, mv1, ref_frame1_idx_2nd, mv1_2nd); 1712 1713 pcCU->getCUMvField(REF_PIC_LIST_0)->setRefIdx(ref_frame0_idx, uiPartAddr); 1714 pcCU->getCUMvField( REF_PIC_LIST_0 )->setMv( mv0, uiPartAddr ); 1715 1716 pcCU->getCUMvField(REF_PIC_LIST_1)->setRefIdx(ref_frame1_idx, uiPartAddr); 1717 pcCU->getCUMvField( REF_PIC_LIST_1 )->setMv( mv1, uiPartAddr ); 1718 1719 if ( eRefPicList != REF_PIC_LIST_X ) 1720 { 1721 #if DEPTH_MAP_GENERATION 1722 xPredInterUni_DBMP (pcCU, uiPartAddr, px, py, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY ); 1723 #else 1724 xPredInterUni_DBMP (pcCU, uiPartAddr, px, py, eRefPicList, pcYuvPred, iPartIdx ); 1725 #endif 1726 #ifdef WEIGHT_PRED 1727 if ( pcCU->getSlice()->getPPS()->getUseWP() ) 1728 { 1729 xWeightedPredictionUni_DBMP( pcCU, pcYuvPred, uiPartAddr, px, py, eRefPicList, pcYuvPred, iPartIdx ); 1730 } 1731 #endif 1732 } 1733 else 1734 { 1735 #if DEPTH_MAP_GENERATION 1736 xPredInterBi_DBMP (pcCU, uiPartAddr, px, py, uiSubSampExpX, uiSubSampExpY, pcYuvPred, iPartIdx, bPrdDepthMap ); 1737 #else 1738 xPredInterBi_DBMP (pcCU, uiPartAddr, px, py, pcYuvPred, iPartIdx ); 1739 #endif 1740 } 1741 1742 if(!pcCU->getSlice()->getSPS()->isDepth()) // Chroma check only for non depth 1743 { 1744 piDstCb = pcYuvPred->getCbAddr( uiPartAddr ) + (py>>1)*pcYuvPred->getCStride(); 1745 piDstCr = pcYuvPred->getCrAddr( uiPartAddr ) + (py>>1)*pcYuvPred->getCStride(); 1746 1747 //Chroma decimation 16x16 -> 8x8: 1748 if(py%2 && px%2) 1749 { 1750 iTemp = (aiUTab[px-1] + aiUTab[px] + iULast + piDstCb[px>>1] + 2)>>2; 1751 aiUTab[px-1] = iULast; 1752 iULast = piDstCb[px>>1]; 1753 piDstCb[px>>1] = iTemp; 1754 1755 iTemp = (aiVTab[px-1] + aiVTab[px] + iVLast + piDstCr[px>>1] + 2)>>2; 1756 aiVTab[px-1] = iVLast; 1757 iVLast = piDstCr[px>>1]; 1758 piDstCr[px>>1] = iTemp; 1759 } 1760 else 1761 { 1762 aiUTab[(px==0)? iWidth-1 : (px-1)] = iULast; 1763 iULast = piDstCb[px>>1]; 1764 1765 aiVTab[(px==0)? iWidth-1 : (px-1)] = iVLast; 1766 iVLast = piDstCr[px>>1]; 1767 } 1768 } 1769 1770 #if !POZNAN_DBMP_COMPRESS_ME_DATA 1771 //save motion data for every CU point 1772 #if DEPTH_MAP_GENERATION 1773 if( !bPrdDepthMap ) 1774 #endif 1775 { 1776 pcMP->setL0RefPOC(uiViewId,bIsDepth,x,y,ref_frame0); 1777 pcMP->setL0MvX(uiViewId,bIsDepth,x,y,mv0.getHor()); 1778 pcMP->setL0MvY(uiViewId,bIsDepth,x,y,mv0.getVer()); 1779 1780 pcMP->setL1RefPOC(uiViewId,bIsDepth,x,y,ref_frame1); 1781 pcMP->setL1MvX(uiViewId,bIsDepth,x,y,mv1.getHor()); 1782 pcMP->setL1MvY(uiViewId,bIsDepth,x,y,mv1.getVer()); 1783 } 1784 #endif 1785 1786 #if POZNAN_DBMP_CALC_PRED_DATA 1787 #if DEPTH_MAP_GENERATION 1788 if( !bPrdDepthMap ) 1789 #endif 1790 { 1791 pcMP->getTempL0RefIdx()[uiPointCnt] = ref_frame0_idx; 1792 pcMP->getTempL0MvX()[uiPointCnt] = mv0.getHor(); 1793 pcMP->getTempL0MvY()[uiPointCnt] = mv0.getVer(); 1794 1795 pcMP->getTempL1RefIdx()[uiPointCnt] = ref_frame1_idx; 1796 pcMP->getTempL1MvX()[uiPointCnt] = mv1.getHor(); 1797 pcMP->getTempL1MvY()[uiPointCnt] = mv1.getVer(); 1798 } 1799 uiPointCnt++; 1800 #endif 1801 1802 } 1803 } 1804 1805 //set motion data representing CU with DBMP 1806 #if DEPTH_MAP_GENERATION 1807 if( !bPrdDepthMap ) 1808 #endif 1809 { 1810 PartSize ePartSize = pcCU->getPartitionSize( uiPartAddr ); //PartSize ePartSize = pcCU->getPartitionSize( 0 ); 1811 #if POZNAN_DBMP_CALC_PRED_DATA 1812 pcMP->xCalcDBMPPredData(uiPointCnt, ref_frame0_idx, mv0, ref_frame1_idx, mv1); 1813 1814 pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( mv0, ref_frame0_idx, ePartSize, uiPartAddr, iPartIdx, 0 ); 1815 pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( mv1, ref_frame1_idx, ePartSize, uiPartAddr, iPartIdx, 0 ); 1816 #else 1817 pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( mv0_2nd, ref_frame0_idx_2nd, ePartSize, uiPartAddr, iPartIdx, 0 ); 1818 pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( mv1_2nd, ref_frame1_idx_2nd, ePartSize, uiPartAddr, iPartIdx, 0 ); 1819 #endif 1820 } 1821 1822 if ( iPartIdxOrg >= 0 ) break; 1823 } 1824 return; 1825 } 1826 #endif 1593 1827 1594 1828 #if HIGH_ACCURACY_BI … … 2135 2369 } 2136 2370 2371 2372 2373 #if POZNAN_DBMP 2374 2375 #if HIGH_ACCURACY_BI 2376 #if DEPTH_MAP_GENERATION 2377 Void TComPrediction::xPredInterUni_DBMP ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY, Bool bi ) 2378 #else 2379 Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi ) 2380 #endif 2381 #else 2382 #if DEPTH_MAP_GENERATION 2383 Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY ) 2384 #else 2385 Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx ) 2386 #endif 2387 #endif 2388 { 2389 Int iRefIdx = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); assert (iRefIdx >= 0); 2390 TComMv cMv = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr ); 2391 pcCU->clipMv(cMv); 2392 2393 #if DEPTH_MAP_GENERATION 2394 if( bPrdDepthMap ) 2395 { 2396 UInt uiRShift = 0; 2397 xPredInterPrdDepthMap_DBMP( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPredDepthMap(), uiPartAddr, &cMv, iPosX, iPosY, uiSubSampExpX, uiSubSampExpY, rpcYuvPred, uiRShift ); 2398 return; 2399 } 2400 #endif 2401 2402 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 2403 if( pcCU->getSlice()->getSPS()->isDepth() ) 2404 { 2405 #if HIGH_ACCURACY_BI 2406 UInt uiRShift = ( bi ? 14-g_uiBitDepth-g_uiBitIncrement : 0 ); 2407 #else 2408 UInt uiRShift = 0; 2409 #endif 2410 #if DEPTH_MAP_GENERATION 2411 xPredInterPrdDepthMap_DBMP( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iPosX, iPosY, 0, 0, rpcYuvPred, uiRShift ); 2412 #else 2413 xPredInterPrdDepthMap_DBMP( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iPosX, iPosY, rpcYuvPred, uiRShift ); 2414 #endif 2415 } 2416 else 2417 { 2418 #endif 2419 #if HIGH_ACCURACY_BI 2420 if(!bi) 2421 { 2422 xPredInterLumaBlk_DBMP ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iPosX, iPosY, rpcYuvPred ); 2423 } 2424 else 2425 { 2426 xPredInterLumaBlk_DBMP_ha ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iPosX, iPosY, rpcYuvPred ); 2427 } 2428 #else 2429 xPredInterLumaBlk_DBMP ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iPosX, iPosY, rpcYuvPred ); 2430 #endif 2431 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 2432 } 2433 #endif 2434 2435 #if HIGH_ACCURACY_BI 2436 if (!bi) 2437 { 2438 xPredInterChromaBlk_DBMP ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iPosX, iPosY, rpcYuvPred ); 2439 } 2440 else 2441 { 2442 xPredInterChromaBlk_DBMP_ha ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec() , uiPartAddr, &cMv, iPosX, iPosY, rpcYuvPred ); 2443 } 2444 #else 2445 xPredInterChromaBlk_DBMP ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iPosX, iPosY, rpcYuvPred ); 2446 #endif 2447 } 2448 2449 #if DEPTH_MAP_GENERATION 2450 Void TComPrediction::xPredInterBi_DBMP ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap ) 2451 #else 2452 Void TComPrediction::xPredInterBi_DBMP ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, TComYuv*& rpcYuvPred, Int iPartIdx ) 2453 #endif 2454 { 2455 TComYuv* pcMbYuv; 2456 Int iRefIdx[2] = {-1, -1}; 2457 2458 for ( Int iRefList = 0; iRefList < 2; iRefList++ ) 2459 { 2460 RefPicList eRefPicList = (iRefList ? REF_PIC_LIST_1 : REF_PIC_LIST_0); 2461 iRefIdx[iRefList] = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); 2462 2463 if ( iRefIdx[iRefList] < 0 ) 2464 { 2465 continue; 2466 } 2467 2468 assert( iRefIdx[iRefList] < pcCU->getSlice()->getNumRefIdx(eRefPicList) ); 2469 2470 pcMbYuv = &m_acYuvPred[iRefList]; 2471 #if HIGH_ACCURACY_BI 2472 if( pcCU->getCUMvField( REF_PIC_LIST_0 )->getRefIdx( uiPartAddr ) >= 0 && pcCU->getCUMvField( REF_PIC_LIST_1 )->getRefIdx( uiPartAddr ) >= 0 ) 2473 #if DEPTH_MAP_GENERATION 2474 xPredInterUni_DBMP ( pcCU, uiPartAddr, iPosX, iPosY, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, true ); 2475 #else 2476 xPredInterUni_DBMP ( pcCU, uiPartAddr, iPosX, iPosY, eRefPicList, pcMbYuv, iPartIdx, true ); 2477 #endif 2478 else 2479 #if DEPTH_MAP_GENERATION 2480 xPredInterUni_DBMP ( pcCU, uiPartAddr, iPosX, iPosY, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY ); 2481 #else 2482 xPredInterUni_DBMP ( pcCU, uiPartAddr, iPosX, iPosY, eRefPicList, pcMbYuv, iPartIdx ); 2483 #endif 2484 #else 2485 #if DEPTH_MAP_GENERATION 2486 xPredInterUni_DBMP ( pcCU, uiPartAddr, iPosX, iPosY, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY ); 2487 #else 2488 xPredInterUni_DBMP ( pcCU, uiPartAddr, iPosX, iPosY, eRefPicList, pcMbYuv, iPartIdx ); 2489 #endif 2490 #endif 2491 } 2492 2493 #ifdef WEIGHT_PRED 2494 if ( pcCU->getSlice()->getPPS()->getWPBiPredIdc() ) 2495 { 2496 xWeightedPredictionBi_DBMP( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iPosX, iPosY, rpcYuvPred ); 2497 } 2498 else 2499 #endif 2500 2501 #if DEPTH_MAP_GENERATION 2502 if ( bPrdDepthMap ) 2503 { 2504 xWeightedAveragePdm_DBMP( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iPosX, iPosY, rpcYuvPred, uiSubSampExpX, uiSubSampExpY ); 2505 } 2506 else 2507 { 2508 xWeightedAverage_DBMP( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iPosX, iPosY, rpcYuvPred ); 2509 } 2510 #else 2511 xWeightedAverage_DBMP( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iPosX, iPosY, rpcYuvPred ); 2512 #endif 2513 } 2514 2515 Void 2516 #if DEPTH_MAP_GENERATION 2517 TComPrediction::xPredInterPrdDepthMap_DBMP( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuv, UInt uiRShift ) 2518 #else 2519 TComPrediction::xPredInterPrdDepthMap_DBMP( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv, UInt uiRShift ) 2520 #endif 2521 { 2522 #if DEPTH_MAP_GENERATION 2523 Int iShiftX = 2 + uiSubSampExpX; 2524 Int iShiftY = 2 + uiSubSampExpY; 2525 Int iAddX = ( 1 << iShiftX ) >> 1; 2526 Int iAddY = ( 1 << iShiftY ) >> 1; 2527 Int iHor = ( pcMv->getHor() + iAddX ) >> iShiftX; 2528 Int iVer = ( pcMv->getVer() + iAddY ) >> iShiftY; 2529 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 2530 if( pcCU->getSlice()->getSPS()->isDepth() ) 2531 { 2532 iHor = pcMv->getHor(); 2533 iVer = pcMv->getVer(); 2534 } 2535 #endif 2536 Int iRefStride = pcPicYuvRef->getStride(); 2537 Int iDstStride = rpcYuv->getStride(); 2538 Int iRefOffset = iHor + iVer * iRefStride; 2539 #else 2540 Int iFPelMask = ~3; 2541 Int iRefStride = pcPicYuvRef->getStride(); 2542 Int iDstStride = rpcYuv->getStride(); 2543 Int iHor = ( pcMv->getHor() + 2 ) & iFPelMask; 2544 Int iVer = ( pcMv->getVer() + 2 ) & iFPelMask; 2545 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 2546 if( pcCU->getSlice()->getSPS()->isDepth() ) 2547 { 2548 iHor = pcMv->getHor() * 4; 2549 iVer = pcMv->getVer() * 4; 2550 } 2551 #endif 2552 Int ixFrac = iHor & 0x3; 2553 Int iyFrac = iVer & 0x3; 2554 Int iRefOffset = ( iHor >> 2 ) + ( iVer >> 2 ) * iRefStride; 2555 #endif 2556 2557 Pel* piRefY = pcPicYuvRef->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset; 2558 Pel* piDstY = rpcYuv->getLumaAddr( uiPartAddr ); 2559 2560 piDstY[ iPosY*iDstStride + iPosX ] = piRefY[ iPosY*iRefStride + iPosX ] << uiRShift; 2561 } 2562 2563 2564 #if HIGH_ACCURACY_BI 2565 2566 Void TComPrediction::xPredInterLumaBlk_DBMP_ha( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv ) 2567 { 2568 Int iRefStride = pcPicYuvRef->getStride(); 2569 Int iDstStride = rpcYuv->getStride(); 2570 2571 Int iRefOffset = ( pcMv->getHor() >> 2 ) + ( pcMv->getVer() >> 2 ) * iRefStride; 2572 Pel* piRefY = pcPicYuvRef->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset; 2573 2574 Int ixFrac = pcMv->getHor() & 0x3; 2575 Int iyFrac = pcMv->getVer() & 0x3; 2576 2577 Pel* piDstY = rpcYuv->getLumaAddr( uiPartAddr ); 2578 UInt shiftNum = 14-g_uiBitDepth-g_uiBitIncrement; 2579 2580 piDstY += iPosY*iDstStride+iPosX; 2581 piRefY += iPosY*iRefStride+iPosX; 2582 2583 // Integer point 2584 if ( ixFrac == 0 && iyFrac == 0 ) 2585 { 2586 *piDstY = (*piRefY)<<shiftNum; 2587 return; 2588 } 2589 2590 Int iWidth = 1; 2591 Int iHeight = 1; 2592 2593 // Half-pel horizontal 2594 if ( ixFrac == 2 && iyFrac == 0 ) 2595 { 2596 xCTI_FilterHalfHor_ha ( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2597 return; 2598 } 2599 2600 // Half-pel vertical 2601 if ( ixFrac == 0 && iyFrac == 2 ) 2602 { 2603 xCTI_FilterHalfVer_ha ( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2604 return; 2605 } 2606 2607 Int iExtStride = m_iYuvExtStride;//m_cYuvExt.getStride(); 2608 Int* piExtY = m_piYuvExt;//m_cYuvExt.getLumaAddr(); 2609 2610 // Half-pel center 2611 if ( ixFrac == 2 && iyFrac == 2 ) 2612 { 2613 xCTI_FilterHalfVer (piRefY - 3, iRefStride, 1, iWidth +7, iHeight, iExtStride, 1, piExtY ); 2614 xCTI_FilterHalfHor_ha (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2615 return; 2616 } 2617 2618 // Quater-pel horizontal 2619 if ( iyFrac == 0) 2620 { 2621 if ( ixFrac == 1) 2622 { 2623 xCTI_FilterQuarter0Hor_ha( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2624 return; 2625 } 2626 if ( ixFrac == 3) 2627 { 2628 xCTI_FilterQuarter1Hor_ha( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2629 return; 2630 } 2631 } 2632 if ( iyFrac == 2 ) 2633 { 2634 if ( ixFrac == 1) 2635 { 2636 xCTI_FilterHalfVer (piRefY -3, iRefStride, 1, iWidth +7, iHeight, iExtStride, 1, piExtY ); 2637 xCTI_FilterQuarter0Hor_ha (piExtY + 3, iExtStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2638 return; 2639 } 2640 if ( ixFrac == 3) 2641 { 2642 xCTI_FilterHalfVer (piRefY - 3, iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY ); 2643 xCTI_FilterQuarter1Hor_ha (piExtY + 3, iExtStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2644 return; 2645 } 2646 } 2647 2648 // Quater-pel vertical 2649 if( ixFrac == 0 ) 2650 { 2651 if( iyFrac == 1 ) 2652 { 2653 xCTI_FilterQuarter0Ver_ha( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2654 return; 2655 } 2656 if( iyFrac == 3 ) 2657 { 2658 xCTI_FilterQuarter1Ver_ha( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2659 return; 2660 } 2661 } 2662 2663 if( ixFrac == 2 ) 2664 { 2665 if( iyFrac == 1 ) 2666 { 2667 xCTI_FilterQuarter0Ver (piRefY - 3, iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY ); 2668 xCTI_FilterHalfHor_ha (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2669 2670 return; 2671 } 2672 if( iyFrac == 3 ) 2673 { 2674 xCTI_FilterQuarter1Ver (piRefY -3, iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY ); 2675 xCTI_FilterHalfHor_ha (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2676 return; 2677 } 2678 } 2679 2680 /// Quarter-pel center 2681 if ( iyFrac == 1) 2682 { 2683 if ( ixFrac == 1) 2684 { 2685 xCTI_FilterQuarter0Ver (piRefY - 3, iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY ); 2686 xCTI_FilterQuarter0Hor_ha (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2687 return; 2688 } 2689 if ( ixFrac == 3) 2690 { 2691 xCTI_FilterQuarter0Ver (piRefY - 3, iRefStride, 1, iWidth +7, iHeight, iExtStride, 1, piExtY ); 2692 xCTI_FilterQuarter1Hor_ha (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2693 2694 return; 2695 } 2696 } 2697 if ( iyFrac == 3 ) 2698 { 2699 if ( ixFrac == 1) 2700 { 2701 xCTI_FilterQuarter1Ver (piRefY - 3, iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY ); 2702 xCTI_FilterQuarter0Hor_ha (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2703 return; 2704 } 2705 if ( ixFrac == 3) 2706 { 2707 xCTI_FilterQuarter1Ver (piRefY - 3, iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY ); 2708 xCTI_FilterQuarter1Hor_ha (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2709 return; 2710 } 2711 } 2712 } 2713 2714 #endif 2715 2716 Void TComPrediction::xPredInterLumaBlk_DBMP( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv ) 2717 { 2718 Int iRefStride = pcPicYuvRef->getStride(); 2719 Int iDstStride = rpcYuv->getStride(); 2720 2721 Int iRefOffset = ( pcMv->getHor() >> 2 ) + ( pcMv->getVer() >> 2 ) * iRefStride; 2722 Pel* piRefY = pcPicYuvRef->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset; 2723 2724 Int ixFrac = pcMv->getHor() & 0x3; 2725 Int iyFrac = pcMv->getVer() & 0x3; 2726 2727 Pel* piDstY = rpcYuv->getLumaAddr( uiPartAddr ); 2728 2729 piDstY += iPosY*iDstStride+iPosX; 2730 piRefY += iPosY*iRefStride+iPosX; 2731 2732 // Integer point 2733 if ( ixFrac == 0 && iyFrac == 0 ) 2734 { 2735 ::memcpy(piDstY, piRefY, sizeof(Pel)); 2736 return; 2737 } 2738 2739 Int iWidth = 1; 2740 Int iHeight = 1; 2741 2742 // Half-pel horizontal 2743 if ( ixFrac == 2 && iyFrac == 0 ) 2744 { 2745 xCTI_FilterHalfHor ( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2746 return; 2747 } 2748 2749 // Half-pel vertical 2750 if ( ixFrac == 0 && iyFrac == 2 ) 2751 { 2752 xCTI_FilterHalfVer ( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2753 return; 2754 } 2755 2756 Int iExtStride = m_iYuvExtStride;//m_cYuvExt.getStride(); 2757 Int* piExtY = m_piYuvExt;//m_cYuvExt.getLumaAddr(); 2758 2759 // Half-pel center 2760 if ( ixFrac == 2 && iyFrac == 2 ) 2761 { 2762 2763 xCTI_FilterHalfVer (piRefY - 3, iRefStride, 1, iWidth +7, iHeight, iExtStride, 1, piExtY ); 2764 xCTI_FilterHalfHor (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2765 return; 2766 } 2767 2768 // Quater-pel horizontal 2769 if ( iyFrac == 0) 2770 { 2771 if ( ixFrac == 1) 2772 { 2773 xCTI_FilterQuarter0Hor( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2774 return; 2775 } 2776 if ( ixFrac == 3) 2777 { 2778 xCTI_FilterQuarter1Hor( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2779 return; 2780 } 2781 } 2782 if ( iyFrac == 2 ) 2783 { 2784 if ( ixFrac == 1) 2785 { 2786 xCTI_FilterHalfVer (piRefY -3, iRefStride, 1, iWidth +7, iHeight, iExtStride, 1, piExtY ); 2787 xCTI_FilterQuarter0Hor (piExtY + 3, iExtStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2788 return; 2789 } 2790 if ( ixFrac == 3) 2791 { 2792 xCTI_FilterHalfVer (piRefY - 3, iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY ); 2793 xCTI_FilterQuarter1Hor (piExtY + 3, iExtStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2794 return; 2795 } 2796 } 2797 2798 // Quater-pel vertical 2799 if( ixFrac == 0 ) 2800 { 2801 if( iyFrac == 1 ) 2802 { 2803 xCTI_FilterQuarter0Ver( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2804 return; 2805 } 2806 if( iyFrac == 3 ) 2807 { 2808 xCTI_FilterQuarter1Ver( piRefY, iRefStride, 1, iWidth, iHeight, iDstStride, 1, piDstY ); 2809 return; 2810 } 2811 } 2812 2813 if( ixFrac == 2 ) 2814 { 2815 if( iyFrac == 1 ) 2816 { 2817 xCTI_FilterQuarter0Ver (piRefY - 3, iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY ); 2818 xCTI_FilterHalfHor (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2819 return; 2820 } 2821 if( iyFrac == 3 ) 2822 { 2823 xCTI_FilterQuarter1Ver (piRefY -3, iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY ); 2824 xCTI_FilterHalfHor (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2825 return; 2826 } 2827 } 2828 2829 /// Quarter-pel center 2830 if ( iyFrac == 1) 2831 { 2832 if ( ixFrac == 1) 2833 { 2834 xCTI_FilterQuarter0Ver (piRefY - 3, iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY ); 2835 xCTI_FilterQuarter0Hor (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2836 return; 2837 } 2838 if ( ixFrac == 3) 2839 { 2840 xCTI_FilterQuarter0Ver (piRefY - 3, iRefStride, 1, iWidth +7, iHeight, iExtStride, 1, piExtY ); 2841 xCTI_FilterQuarter1Hor (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2842 return; 2843 } 2844 } 2845 if ( iyFrac == 3 ) 2846 { 2847 if ( ixFrac == 1) 2848 { 2849 xCTI_FilterQuarter1Ver (piRefY - 3, iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY ); 2850 xCTI_FilterQuarter0Hor (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2851 return; 2852 } 2853 if ( ixFrac == 3) 2854 { 2855 xCTI_FilterQuarter1Ver (piRefY - 3, iRefStride, 1, iWidth + 7, iHeight, iExtStride, 1, piExtY ); 2856 xCTI_FilterQuarter1Hor (piExtY + 3, iExtStride, 1, iWidth , iHeight, iDstStride, 1, piDstY ); 2857 return; 2858 } 2859 } 2860 } 2861 2862 #if HIGH_ACCURACY_BI 2863 Void TComPrediction::xPredInterChromaBlk_DBMP_ha( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv ) 2864 { 2865 Int iRefStride = pcPicYuvRef->getCStride(); 2866 Int iDstStride = rpcYuv->getCStride(); 2867 2868 Int iRefOffset = (pcMv->getHor() >> 3) + (pcMv->getVer() >> 3) * iRefStride; 2869 2870 Pel* piRefCb = pcPicYuvRef->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset; 2871 Pel* piRefCr = pcPicYuvRef->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset; 2872 2873 Pel* piDstCb = rpcYuv->getCbAddr( uiPartAddr ); 2874 Pel* piDstCr = rpcYuv->getCrAddr( uiPartAddr ); 2875 2876 Int ixFrac = pcMv->getHor() & 0x7; 2877 Int iyFrac = pcMv->getVer() & 0x7; 2878 UInt uiCWidth = 1; 2879 UInt uiCHeight = 1; 2880 2881 piDstCb += (iPosY>>1)*iDstStride+(iPosX>>1); 2882 piDstCr += (iPosY>>1)*iDstStride+(iPosX>>1); 2883 piRefCb += (iPosY>>1)*iRefStride+(iPosX>>1); 2884 piRefCr += (iPosY>>1)*iRefStride+(iPosX>>1); 2885 2886 xDCTIF_FilterC_ha(piRefCb, iRefStride,piDstCb,iDstStride,uiCWidth,uiCHeight, iyFrac, ixFrac); 2887 xDCTIF_FilterC_ha(piRefCr, iRefStride,piDstCr,iDstStride,uiCWidth,uiCHeight, iyFrac, ixFrac); 2888 return; 2889 } 2890 #endif 2891 2892 //-- 2893 Void TComPrediction::xPredInterChromaBlk_DBMP( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv ) 2894 { 2895 Int iRefStride = pcPicYuvRef->getCStride(); 2896 Int iDstStride = rpcYuv->getCStride(); 2897 2898 Int iRefOffset = (pcMv->getHor() >> 3) + (pcMv->getVer() >> 3) * iRefStride; 2899 2900 Pel* piRefCb = pcPicYuvRef->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset; 2901 Pel* piRefCr = pcPicYuvRef->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset; 2902 2903 Pel* piDstCb = rpcYuv->getCbAddr( uiPartAddr ); 2904 Pel* piDstCr = rpcYuv->getCrAddr( uiPartAddr ); 2905 2906 Int ixFrac = pcMv->getHor() & 0x7; 2907 Int iyFrac = pcMv->getVer() & 0x7; 2908 UInt uiCWidth = 1; 2909 UInt uiCHeight = 1; 2910 2911 piDstCb += (iPosY>>1)*iDstStride+(iPosX>>1); 2912 piDstCr += (iPosY>>1)*iDstStride+(iPosX>>1); 2913 piRefCb += (iPosY>>1)*iRefStride+(iPosX>>1); 2914 piRefCr += (iPosY>>1)*iRefStride+(iPosX>>1); 2915 2916 xDCTIF_FilterC(piRefCb, iRefStride,piDstCb,iDstStride,uiCWidth,uiCHeight, iyFrac, ixFrac); 2917 xDCTIF_FilterC(piRefCr, iRefStride,piDstCr,iDstStride,uiCWidth,uiCHeight, iyFrac, ixFrac); 2918 return; 2919 } 2920 2921 #endif 2922 2923 2137 2924 Void TComPrediction::xDCTIF_FilterC ( Pel* piRefC, Int iRefStride,Pel* piDstC,Int iDstStride, 2138 2925 Int iWidth, Int iHeight,Int iMVyFrac,Int iMVxFrac) … … 2260 3047 } 2261 3048 } 3049 3050 #if POZNAN_DBMP 3051 3052 #if DEPTH_MAP_GENERATION 3053 Void TComPrediction::xWeightedAveragePdm_DBMP( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iPosX, Int iPosY, TComYuv*& rpcYuvDst, UInt uiSubSampExpX, UInt uiSubSampExpY ) 3054 { 3055 if( iRefIdx0 >= 0 && iRefIdx1 >= 0 ) 3056 { 3057 rpcYuvDst->addAvgPdm_DBMP( pcYuvSrc0, pcYuvSrc1, uiPartIdx, iPosX, iPosY, uiSubSampExpX, uiSubSampExpY ); 3058 } 3059 else if ( iRefIdx0 >= 0 && iRefIdx1 < 0 ) 3060 { 3061 pcYuvSrc0->copyPartToPartYuvPdm_DBMP( rpcYuvDst, uiPartIdx, iPosX, iPosY, uiSubSampExpX, uiSubSampExpY ); 3062 } 3063 else if ( iRefIdx0 < 0 && iRefIdx1 >= 0 ) 3064 { 3065 pcYuvSrc1->copyPartToPartYuvPdm_DBMP( rpcYuvDst, uiPartIdx, iPosX, iPosY, uiSubSampExpX, uiSubSampExpY ); 3066 } 3067 else 3068 { 3069 assert (0); 3070 } 3071 } 3072 #endif 3073 3074 Void TComPrediction::xWeightedAverage_DBMP( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iPosX, Int iPosY, TComYuv*& rpcYuvDst ) 3075 { 3076 if( iRefIdx0 >= 0 && iRefIdx1 >= 0 ) 3077 { 3078 #ifdef ROUNDING_CONTROL_BIPRED 3079 rpcYuvDst->addAvg_DBMP( pcYuvSrc0, pcYuvSrc1, uiPartIdx, iPosX, iPosY, pcCU->getSlice()->isRounding()); 3080 #else 3081 rpcYuvDst->addAvg_DBMP( pcYuvSrc0, pcYuvSrc1, uiPartIdx, iPosX, iPosY ); 3082 #endif 3083 } 3084 else if ( iRefIdx0 >= 0 && iRefIdx1 < 0 ) 3085 { 3086 pcYuvSrc0->copyPartToPartYuv_DBMP( rpcYuvDst, uiPartIdx, iPosX, iPosY ); 3087 } 3088 else if ( iRefIdx0 < 0 && iRefIdx1 >= 0 ) 3089 { 3090 pcYuvSrc1->copyPartToPartYuv_DBMP( rpcYuvDst, uiPartIdx, iPosX, iPosY ); 3091 } 3092 else 3093 { 3094 assert (0); 3095 } 3096 } 3097 #endif 2262 3098 2263 3099 // AMVP -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComPrediction.h
r21 r28 52 52 #endif 53 53 54 #if POZNAN_MP 55 #include "../TLibCommon/TComMP.h" 56 #endif 57 54 58 // ==================================================================================================================== 55 59 // Class definition … … 124 128 #endif 125 129 130 #if POZNAN_DBMP 131 #if HIGH_ACCURACY_BI 132 #if DEPTH_MAP_GENERATION 133 Void xPredInterUni_DBMP ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0, Bool bi=false ); 134 #else 135 Void xPredInterUni_DBMP ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi=false ); 136 #endif 137 #else 138 #if DEPTH_MAP_GENERATION 139 Void xPredInterUni_DBMP ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0 ); 140 #else 141 Void xPredInterUni_DBMP ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx ); 142 #endif 143 #endif 144 #if DEPTH_MAP_GENERATION 145 Void xPredInterBi_DBMP ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap ); 146 Void xPredInterPrdDepthMap_DBMP( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuv, UInt uiRShift ); 147 #else 148 Void xPredInterBi_DBMP ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, TComYuv*& rpcYuvPred, Int iPartIdx ); 149 Void xPredInterPrdDepthMap_DBMP ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv, UInt uiRShift ); 150 #endif 151 152 Void xPredInterLumaBlk_DBMP ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv ); 153 Void xPredInterChromaBlk_DBMP ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv ); 154 155 #if DEPTH_MAP_GENERATION 156 Void xWeightedAveragePdm_DBMP ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iPosX, Int iPosY, TComYuv*& rpcYuvDst, UInt uiSubSampExpX, UInt uiSubSampExpY ); 157 #endif 158 Void xWeightedAverage_DBMP ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iPosX, Int iPosY, TComYuv*& rpcYuvDst ); 159 160 #if HIGH_ACCURACY_BI 161 Void xPredInterLumaBlk_DBMP_ha( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv ); 162 Void xPredInterChromaBlk_DBMP_ha( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv ); 163 #endif 164 #endif 165 126 166 #if HHI_DMM_WEDGE_INTRA 127 167 Void xPredIntraWedgeFull ( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder, Bool bDelta, UInt uiTabIdx, Int iDeltaDC1 = 0, Int iDeltaDC2 = 0 ); … … 160 200 #else 161 201 Void motionCompensation ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1 ); 202 #endif 203 204 #if POZNAN_DBMP 205 #if DEPTH_MAP_GENERATION 206 Void motionCompensation_DBMP ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1, Bool bPrdDepthMap = false, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0 ); 207 #else 208 Void motionCompensation_DBMP ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1 ); 209 #endif 210 162 211 #endif 163 212 -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComResidualGenerator.cpp
r21 r28 306 306 xSetRecResidualInterCU( pcSubCU, pcSubRes ); 307 307 break; 308 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 309 case MODE_SYNTH: 310 xSetRecResidualIntraCU( pcSubCU, pcSubRes ); //MayBe it should be seperate function 311 break; 312 #endif 308 313 default: 309 314 AOT( true ); … … 336 341 UInt uiLumaTrMode, uiChromaTrMode; 337 342 pcCU->convertTransIdx ( 0, pcCU->getTransformIdx( 0 ), uiLumaTrMode, uiChromaTrMode ); 343 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 344 m_pcTrQuant->setQPforQuant ( pcCU->getQP( 0 ) + pcCU->getQpOffsetForTextCU(0/*uiAbsPartIdx*/, false), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA ); 345 #else 338 346 m_pcTrQuant->setQPforQuant ( pcCU->getQP( 0 ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA ); 347 #endif 339 348 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_LUMA, pRes, 0, pcCUResidual->getStride(), uiWidth, uiHeight, uiLumaTrMode, 0, piCoeff ); 340 349 // chroma Cb … … 343 352 piCoeff = pcCU->getCoeffCb(); 344 353 pRes = pcCUResidual->getCbAddr(); 354 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 355 m_pcTrQuant->setQPforQuant ( pcCU->getQP( 0 ) + pcCU->getQpOffsetForTextCU(0/*uiAbsPartIdx*/, false), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA ); 356 #else 345 357 m_pcTrQuant->setQPforQuant ( pcCU->getQP( 0 ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_CHROMA ); 358 #endif 346 359 m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_CHROMA_U, pRes, 0, pcCUResidual->getCStride(), uiWidth, uiHeight, uiChromaTrMode, 0, piCoeff ); 347 360 // chroma Cr -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComSlice.cpp
r21 r28 89 89 initWpAcDcParam(); 90 90 #endif 91 92 #if POZNAN_MP 93 m_pcMP = NULL; 94 #endif 91 95 } 92 96 93 97 TComSlice::~TComSlice() 94 98 { 99 #if POZNAN_MP 100 m_pcMP = NULL; 101 #endif 95 102 } 96 103 … … 681 688 #endif 682 689 690 #if POZNAN_DBMP 691 m_uiDBMP = 0; 692 #endif 693 694 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 695 m_uiUseCUSkip = 0; 696 #endif 697 698 683 699 // AMVP parameter 684 700 ::memset( m_aeAMVPMode, 0, sizeof( m_aeAMVPMode ) ); … … 730 746 } 731 747 } 748 #if POZNAN_NONLINEAR_DEPTH 749 m_fDepthPower = 1.0; 750 #endif 751 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 752 m_bUseTexDqpAccordingToDepth = false; 753 #endif 732 754 } 733 755 … … 745 767 ::memset( m_aaiCodedScale, 0x00, sizeof( m_aaiCodedScale ) ); 746 768 ::memset( m_aaiCodedOffset, 0x00, sizeof( m_aaiCodedOffset ) ); 769 #if POZNAN_NONLINEAR_DEPTH 770 m_fDepthPower = 1.0; 771 #endif 747 772 } 748 773 -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComSlice.h
r21 r28 57 57 #endif 58 58 59 #if POZNAN_MP 60 //#include "../TLibCommon/TComMP.h" 61 class TComMP; 62 #endif 63 59 64 // ==================================================================================================================== 60 65 // Class definition … … 148 153 #endif 149 154 155 #if POZNAN_DBMP 156 UInt m_uiDBMP; 157 #endif 158 159 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 160 UInt m_uiUseCUSkip; 161 #endif 162 150 163 #if DEPTH_MAP_GENERATION 151 164 TComDepthMapGenerator* m_pcDepthMapGenerator; … … 153 166 #if HHI_INTER_VIEW_RESIDUAL_PRED 154 167 TComResidualGenerator* m_pcResidualGenerator; 168 #endif 169 170 #if POZNAN_NONLINEAR_DEPTH 171 Float m_fDepthPower; 172 #endif 173 174 #if POZNAN_MP 175 TComMP* m_pcMP; 176 #endif 177 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 178 Bool m_bUseTexDqpAccordingToDepth; 155 179 #endif 156 180 … … 208 232 209 233 // Tool list 234 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 235 Bool getUseALF () { return (getViewId()>0)?false:m_bUseALF;} //todo fix ALF 236 #else 210 237 Bool getUseALF () { return m_bUseALF; } 238 #endif 211 239 Bool getUseDQP () { return m_bUseDQP; } 212 240 … … 266 294 #if MTK_SAO 267 295 Void setUseSAO (Bool bVal) {m_bUseSAO = bVal;} 296 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU //todo fix SAO 297 Bool getUseSAO () { return (getViewId()>0)?false:m_bUseSAO;} 298 #else 268 299 Bool getUseSAO () {return m_bUseSAO;} 300 #endif 269 301 #endif 270 302 … … 282 314 #if HHI_INTER_VIEW_RESIDUAL_PRED 283 315 Void setMultiviewResPredMode ( UInt uiResPrdMode ) { m_uiMultiviewResPredMode = uiResPrdMode; } 316 #endif 317 318 #if POZNAN_DBMP 319 Void setDBMP ( UInt uiDBMP ) { m_uiDBMP = uiDBMP; } 320 #endif 321 322 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 323 Void setUseCUSkip ( UInt uiUseCUSkip ) { m_uiUseCUSkip = uiUseCUSkip; } 284 324 #endif 285 325 … … 297 337 #endif 298 338 339 #if POZNAN_DBMP 340 UInt getDBMP () { return m_uiDBMP; } 341 #endif 342 343 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 344 UInt getUseCUSkip () { return m_uiUseCUSkip; } 345 #endif 346 299 347 #if DEPTH_MAP_GENERATION 300 348 Void setDepthMapGenerator( TComDepthMapGenerator* pcDepthMapGenerator ) { m_pcDepthMapGenerator = pcDepthMapGenerator; } … … 304 352 Void setResidualGenerator( TComResidualGenerator* pcResidualGenerator ) { m_pcResidualGenerator = pcResidualGenerator; } 305 353 TComResidualGenerator* getResidualGenerator() { return m_pcResidualGenerator; } 354 #endif 355 #if POZNAN_NONLINEAR_DEPTH 356 inline Void setDepthPower(Float p) {m_fDepthPower = p;} 357 inline Float getDepthPower() {return m_fDepthPower;} 358 #else 359 inline Float getDepthPower() {return 1.0f;} 360 #endif 361 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 362 Void setUseTexDqpAccordingToDepth (Bool bVal) {m_bUseTexDqpAccordingToDepth = bVal;} 363 Bool getUseTexDqpAccordingToDepth () {return m_bUseTexDqpAccordingToDepth;} 306 364 #endif 307 365 }; … … 448 506 #endif 449 507 508 #if POZNAN_MP 509 TComMP* m_pcMP; 510 #endif 511 450 512 public: 451 513 TComSlice(); 514 #if POZNAN_MP 515 ~TComSlice(); 516 #else 452 517 virtual ~TComSlice(); 518 #endif 453 519 454 520 Void initSlice (); … … 614 680 #endif 615 681 682 #if POZNAN_MP 683 Void setMP(TComMP* pcMP) { m_pcMP = pcMP; } 684 TComMP* getMP() { return m_pcMP; } 685 #endif 686 616 687 protected: 617 688 #if 0 -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComWeightPrediction.cpp
r5 r28 393 393 } 394 394 395 #if POZNAN_DBMP 396 397 Void TComWeightPrediction::addWeightBi_DBMP( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iPosX, Int iPosY, wpScalingParam *wp0, wpScalingParam *wp1, TComYuv* rpcYuvDst, Bool bRound ) 398 { 399 Pel* pSrcY0 = pcYuvSrc0->getLumaAddr( iPartUnitIdx ); 400 Pel* pSrcU0 = pcYuvSrc0->getCbAddr ( iPartUnitIdx ); 401 Pel* pSrcV0 = pcYuvSrc0->getCrAddr ( iPartUnitIdx ); 402 403 Pel* pSrcY1 = pcYuvSrc1->getLumaAddr( iPartUnitIdx ); 404 Pel* pSrcU1 = pcYuvSrc1->getCbAddr ( iPartUnitIdx ); 405 Pel* pSrcV1 = pcYuvSrc1->getCrAddr ( iPartUnitIdx ); 406 407 Pel* pDstY = rpcYuvDst->getLumaAddr( iPartUnitIdx ); 408 Pel* pDstU = rpcYuvDst->getCbAddr ( iPartUnitIdx ); 409 Pel* pDstV = rpcYuvDst->getCrAddr ( iPartUnitIdx ); 410 411 // Luma : -------------------------------------------- 412 Int w0 = wp0[0].w; 413 Int o0 = wp0[0].o; 414 Int offset = wp0[0].offset; 415 Int shiftNum = 14 - (g_uiBitDepth + g_uiBitIncrement); 416 Int shift = wp0[0].shift + shiftNum; 417 Int round = (1<<(shift-1)) * bRound; 418 Int w1 = wp1[0].w; 419 Int o1 = wp1[0].o; 420 421 UInt iSrc0Stride = pcYuvSrc0->getStride(); 422 UInt iSrc1Stride = pcYuvSrc1->getStride(); 423 UInt iDstStride = rpcYuvDst->getStride(); 424 425 pDstY[iPosY*iDstStride+iPosX] = weightBidir(w0,pSrcY0[iPosY*iSrc0Stride+iPosX], w1,pSrcY1[iPosY*iSrc1Stride+iPosX], round, shift, offset); 426 427 // Chromas : -------------------------------------------- 428 iSrc0Stride = pcYuvSrc0->getCStride(); 429 iSrc1Stride = pcYuvSrc1->getCStride(); 430 iDstStride = rpcYuvDst->getCStride(); 431 432 iPosX = iPosX>>1; 433 iPosY = iPosY>>1; 434 435 // Chroma U : -------------------------------------------- 436 w0 = wp0[1].w; 437 o0 = wp0[1].o; 438 offset = wp0[1].offset; 439 shift = wp0[1].shift + shiftNum; 440 round = (1<<(shift-1)); 441 w1 = wp1[1].w; 442 o1 = wp1[1].o; 443 444 pDstU[iPosY*iDstStride+iPosX] = weightBidir(w0,pSrcU0[iPosY*iSrc0Stride+iPosX], w1,pSrcU1[iPosY*iSrc1Stride+iPosX], round, shift, offset); 445 446 // Chroma V : -------------------------------------------- 447 w0 = wp0[2].w; 448 o0 = wp0[2].o; 449 offset = wp0[2].offset; 450 shift = wp0[2].shift + shiftNum; 451 round = (1<<(shift-1)); 452 w1 = wp1[2].w; 453 o1 = wp1[2].o; 454 455 pDstV[iPosY*iDstStride+iPosX] = weightBidir(w0,pSrcV0[iPosY*iSrc0Stride+iPosX], w1,pSrcV1[iPosY*iSrc1Stride+iPosX], round, shift, offset); 456 } 457 458 Void TComWeightPrediction::addWeightUni_DBMP( TComYuv* pcYuvSrc0, UInt iPartUnitIdx, UInt iPosX, Int iPosY, wpScalingParam *wp0, TComYuv* rpcYuvDst ) 459 { 460 Pel* pSrcY0 = pcYuvSrc0->getLumaAddr( iPartUnitIdx ); 461 Pel* pSrcU0 = pcYuvSrc0->getCbAddr ( iPartUnitIdx ); 462 Pel* pSrcV0 = pcYuvSrc0->getCrAddr ( iPartUnitIdx ); 463 464 Pel* pDstY = rpcYuvDst->getLumaAddr( iPartUnitIdx ); 465 Pel* pDstU = rpcYuvDst->getCbAddr ( iPartUnitIdx ); 466 Pel* pDstV = rpcYuvDst->getCrAddr ( iPartUnitIdx ); 467 468 // Luma : -------------------------------------------- 469 Int w0 = wp0[0].w; 470 Int offset = wp0[0].offset; 471 Int shift = wp0[0].shift; 472 Int round = wp0[0].round; 473 474 UInt iSrc0Stride = pcYuvSrc0->getStride(); 475 UInt iDstStride = rpcYuvDst->getStride(); 476 477 pDstY[iPosY*iDstStride+iPosX] = weightUnidir(w0,pSrcY0[iPosY*iSrc0Stride+iPosX], round, shift, offset); 478 479 // Chromas : -------------------------------------------- 480 iSrc0Stride = pcYuvSrc0->getCStride(); 481 iDstStride = rpcYuvDst->getCStride(); 482 483 iPosX = iPosX>>1; 484 iPosY = iPosY>>1; 485 486 // Chroma U : -------------------------------------------- 487 w0 = wp0[1].w; 488 offset = wp0[1].offset; 489 shift = wp0[1].shift; 490 round = wp0[1].round; 491 492 pDstU[iPosY*iDstStride+iPosX] = weightUnidir(w0,pSrcU0[iPosY*iSrc0Stride+iPosX], round, shift, offset); 493 494 // Chroma V : -------------------------------------------- 495 w0 = wp0[2].w; 496 offset = wp0[2].offset; 497 shift = wp0[2].shift; 498 round = wp0[2].round; 499 500 pDstV[iPosY*iDstStride+iPosX] = weightUnidir(w0,pSrcV0[iPosY*iSrc0Stride+iPosX], round, shift, offset); 501 } 502 503 Void TComWeightPrediction::xWeightedPredictionUni_DBMP( TComDataCU* pcCU, TComYuv* pcYuvSrc, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx ) 504 { 505 wpScalingParam *pwp, *pwpTmp; 506 Int iRefIdx = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); assert (iRefIdx >= 0); 507 Int ibdi = (g_uiBitDepth+g_uiBitIncrement); 508 509 if ( eRefPicList == REF_PIC_LIST_0 ) 510 { 511 getWpScaling(pcCU, iRefIdx, -1, pwp, pwpTmp, ibdi); 512 } 513 else 514 { 515 getWpScaling(pcCU, -1, iRefIdx, pwpTmp, pwp, ibdi); 516 } 517 addWeightUni_DBMP( pcYuvSrc, uiPartAddr, iPosX, iPosY, pwp, rpcYuvPred ); 518 } 519 520 Void TComWeightPrediction::xWeightedPredictionBi_DBMP( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iPosX, Int iPosY, TComYuv* rpcYuvDst ) 521 { 522 wpScalingParam *pwp0, *pwp1; 523 TComPPS *pps = pcCU->getSlice()->getPPS(); 524 525 if ( !pps->getUseWP() ) { 526 printf("TComWeightPrediction::xWeightedPredictionBi():\tassert failed: useWP is false.\n"); 527 exit(0); 528 } 529 530 Int ibdi = (g_uiBitDepth+g_uiBitIncrement); 531 getWpScaling(pcCU, iRefIdx0, iRefIdx1, pwp0, pwp1, ibdi); 532 533 if( iRefIdx0 >= 0 && iRefIdx1 >= 0 ) 534 { 535 addWeightBi_DBMP(pcYuvSrc0, pcYuvSrc1, uiPartIdx, iPosX, iPosY, pwp0, pwp1, rpcYuvDst ); 536 } 537 else if ( iRefIdx0 >= 0 && iRefIdx1 < 0 ) 538 { 539 addWeightUni_DBMP( pcYuvSrc0, uiPartIdx, iPosX, iPosY, pwp0, rpcYuvDst ); 540 } 541 else if ( iRefIdx0 < 0 && iRefIdx1 >= 0 ) 542 { 543 addWeightUni_DBMP( pcYuvSrc1, uiPartIdx, iPosX, iPosY, pwp1, rpcYuvDst ); 544 } 545 else 546 assert (0); 547 548 } 549 #endif 550 395 551 #endif // WEIGHT_PRED 396 552 -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComWeightPrediction.h
r2 r28 37 37 Void xWeightedPredictionBi( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iWidth, Int iHeight, TComYuv* rpcYuvDst ); 38 38 39 #if POZNAN_DBMP 40 Void addWeightBi_DBMP( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iPosX, Int iPosY, wpScalingParam *wp0, wpScalingParam *wp1, TComYuv* rpcYuvDst, Bool bRound=true ); 41 Void addWeightUni_DBMP( TComYuv* pcYuvSrc0, UInt iPartUnitIdx, UInt iPosX, Int iPosY, wpScalingParam *wp0, TComYuv* rpcYuvDst ); 42 43 Void xWeightedPredictionUni_DBMP( TComDataCU* pcCU, TComYuv* pcYuvSrc, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx ); 44 Void xWeightedPredictionBi_DBMP( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iPosX, Int iPosY, TComYuv* rpcYuvDst ); 45 #endif 46 39 47 __inline Pel xClip ( Int x ); 40 48 __inline Pel weightBidir( Int w0, Pel P0, Int w1, Pel P1, Int round, Int shift, Int offset); -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComYuv.cpp
r21 r28 387 387 } 388 388 389 #if POZNAN_DBMP 390 391 Void TComYuv::copyPartToPartYuv_DBMP ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY ) 392 { 393 copyPartToPartLuma_DBMP (pcYuvDst, uiPartIdx, uiPosX, uiPosY ); 394 copyPartToPartChroma_DBMP (pcYuvDst, uiPartIdx, uiPosX>>1, uiPosY>>1 ); 395 } 396 397 Void TComYuv::copyPartToPartLuma_DBMP ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY ) 398 { 399 Pel* pSrc = getLumaAddr(uiPartIdx); 400 Pel* pDst = pcYuvDst->getLumaAddr(uiPartIdx); 401 if( pSrc == pDst ) 402 { 403 //th not a good idea 404 //th best would be to fix the caller 405 return ; 406 } 407 408 UInt iSrcStride = getStride(); 409 UInt iDstStride = pcYuvDst->getStride(); 410 411 ::memcpy( pDst+uiPosY*iDstStride+uiPosX, pSrc+uiPosY*iSrcStride+uiPosX, sizeof(Pel) ); 412 } 413 414 Void TComYuv::copyPartToPartChroma_DBMP( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY ) 415 { 416 Pel* pSrcU = getCbAddr(uiPartIdx); 417 Pel* pSrcV = getCrAddr(uiPartIdx); 418 Pel* pDstU = pcYuvDst->getCbAddr(uiPartIdx); 419 Pel* pDstV = pcYuvDst->getCrAddr(uiPartIdx); 420 421 if( getCbAddr() == NULL || getCrAddr() == NULL || pcYuvDst->getCbAddr() == NULL || pcYuvDst->getCrAddr() == NULL ) //KUBA CHROMA 422 { 423 return ; 424 } 425 if( pSrcU == pDstU && pSrcV == pDstV) 426 { 427 //th not a good idea 428 //th best would be to fix the caller 429 return ; 430 } 431 432 UInt iSrcStride = getCStride(); 433 UInt iDstStride = pcYuvDst->getCStride(); 434 435 ::memcpy( pDstU+uiPosY*iDstStride+uiPosX, pSrcU+uiPosY*iSrcStride+uiPosX, sizeof(Pel) ); 436 ::memcpy( pDstV+uiPosY*iDstStride+uiPosX, pSrcV+uiPosY*iSrcStride+uiPosX, sizeof(Pel) ); 437 } 438 439 #if DEPTH_MAP_GENERATION 440 Void TComYuv::copyPartToPartYuvPdm_DBMP ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY, UInt uiSubSampExpX, UInt uiSubSampExpY ) 441 { 442 copyPartToPartLumaPdm_DBMP (pcYuvDst, uiPartIdx, uiPosX, uiPosY, uiSubSampExpX, uiSubSampExpY ); 443 } 444 445 Void TComYuv::copyPartToPartLumaPdm_DBMP ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY, UInt uiSubSampExpX, UInt uiSubSampExpY ) 446 { 447 UInt uiBlkX = g_auiRasterToPelX[ g_auiZscanToRaster[ uiPartIdx ] ] >> uiSubSampExpX; 448 UInt uiBlkY = g_auiRasterToPelY[ g_auiZscanToRaster[ uiPartIdx ] ] >> uiSubSampExpY; 449 Pel* pSrc = getLumaAddr(uiPartIdx); 450 Pel* pDst = pcYuvDst->getLumaAddr() + uiBlkY * pcYuvDst->getStride() + uiBlkX; 451 452 if( pSrc == pDst ) 453 { 454 //th not a good idea 455 //th best would be to fix the caller 456 return ; 457 } 458 459 UInt iSrcStride = getStride(); 460 UInt iDstStride = pcYuvDst->getStride(); 461 462 ::memcpy( pDst+uiPosY*iDstStride+uiPosX, pSrc+uiPosY*iSrcStride+uiPosX, sizeof(Pel) ); 463 } 464 465 #endif 466 467 #endif 468 389 469 Void TComYuv::addClipPartLuma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ) 390 470 { … … 862 942 #endif 863 943 944 #if POZNAN_DBMP 945 946 #ifdef ROUNDING_CONTROL_BIPRED 947 948 Void TComYuv::addAvg_DBMP( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iPosX, UInt iPosY, Bool bRound ) 949 { 950 Pel* pSrcY0 = pcYuvSrc0->getLumaAddr( iPartUnitIdx ); 951 Pel* pSrcU0 = pcYuvSrc0->getCbAddr ( iPartUnitIdx ); 952 Pel* pSrcV0 = pcYuvSrc0->getCrAddr ( iPartUnitIdx ); 953 954 Pel* pSrcY1 = pcYuvSrc1->getLumaAddr( iPartUnitIdx ); 955 Pel* pSrcU1 = pcYuvSrc1->getCbAddr ( iPartUnitIdx ); 956 Pel* pSrcV1 = pcYuvSrc1->getCrAddr ( iPartUnitIdx ); 957 958 Pel* pDstY = getLumaAddr( iPartUnitIdx ); 959 Pel* pDstU = getCbAddr ( iPartUnitIdx ); 960 Pel* pDstV = getCrAddr ( iPartUnitIdx ); 961 962 UInt iSrc0Stride = pcYuvSrc0->getStride(); 963 UInt iSrc1Stride = pcYuvSrc1->getStride(); 964 UInt iDstStride = getStride(); 965 966 #if HIGH_ACCURACY_BI 967 Int shiftNum = 15 - (g_uiBitDepth + g_uiBitIncrement); 968 Int offset = (1<<(shiftNum - 1)); 969 970 //Luma 971 (pDstY+iPosY*iDstStride)[iPosX] = Clip(((pSrcY0+iPosY*iSrc0Stride)[iPosX] + (pSrcY1+iPosY*iSrc1Stride)[iPosX] + offset) >> shiftNum ); 972 973 iSrc0Stride = pcYuvSrc0->getCStride(); 974 iSrc1Stride = pcYuvSrc1->getCStride(); 975 iDstStride = getCStride(); 976 977 //Chroma 978 (pDstU+(iPosY>>1)*iDstStride)[(iPosX>>1)] = Clip(((pSrcU0+(iPosY>>1)*iSrc0Stride)[(iPosX>>1)] + (pSrcU1+(iPosY>>1)*iSrc1Stride)[(iPosX>>1)] + offset) >> shiftNum ); 979 (pDstV+(iPosY>>1)*iDstStride)[(iPosX>>1)] = Clip(((pSrcV0+(iPosY>>1)*iSrc0Stride)[(iPosX>>1)] + (pSrcV1+(iPosY>>1)*iSrc1Stride)[(iPosX>>1)] + offset) >> shiftNum ); 980 981 #else 982 983 //Luma 984 (pDstY+iPosY*iDstStride)[iPosX] = ((pSrcY0+iPosY*iSrc0Stride)[iPosX] + (pSrcY1+iPosY*iSrc1Stride)[iPosX] + bRound) >> 1; 985 986 iSrc0Stride = pcYuvSrc0->getCStride(); 987 iSrc1Stride = pcYuvSrc1->getCStride(); 988 iDstStride = getCStride(); 989 990 //Chroma 991 (pDstU+(iPosY>>1)*iDstStride)[(iPosX>>1)] = ((pSrcU0+(iPosY>>1)*iSrc0Stride)[(iPosX>>1)] + (pSrcU1+(iPosY>>1)*iSrc1Stride)[(iPosX>>1)] + bRound) >> 1; 992 (pDstV+(iPosY>>1)*iDstStride)[(iPosX>>1)] = ((pSrcV0+(iPosY>>1)*iSrc0Stride)[(iPosX>>1)] + (pSrcV1+(iPosY>>1)*iSrc1Stride)[(iPosX>>1)] + bRound) >> 1; 993 #endif 994 } 995 996 #endif 997 998 Void TComYuv::addAvg_DBMP( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iPosX, UInt iPosY ) 999 { 1000 Pel* pSrcY0 = pcYuvSrc0->getLumaAddr( iPartUnitIdx ); 1001 Pel* pSrcU0 = pcYuvSrc0->getCbAddr ( iPartUnitIdx ); 1002 Pel* pSrcV0 = pcYuvSrc0->getCrAddr ( iPartUnitIdx ); 1003 1004 Pel* pSrcY1 = pcYuvSrc1->getLumaAddr( iPartUnitIdx ); 1005 Pel* pSrcU1 = pcYuvSrc1->getCbAddr ( iPartUnitIdx ); 1006 Pel* pSrcV1 = pcYuvSrc1->getCrAddr ( iPartUnitIdx ); 1007 1008 Pel* pDstY = getLumaAddr( iPartUnitIdx ); 1009 Pel* pDstU = getCbAddr ( iPartUnitIdx ); 1010 Pel* pDstV = getCrAddr ( iPartUnitIdx ); 1011 1012 UInt iSrc0Stride = pcYuvSrc0->getStride(); 1013 UInt iSrc1Stride = pcYuvSrc1->getStride(); 1014 UInt iDstStride = getStride(); 1015 #if HIGH_ACCURACY_BI 1016 Int shiftNum = 15 - (g_uiBitDepth + g_uiBitIncrement); 1017 Int offset = (1<<(shiftNum - 1)); 1018 1019 //Luma 1020 (pDstY+iPosY*iDstStride)[iPosX] = Clip(((pSrcY0+iPosY*iSrc0Stride)[iPosX] + (pSrcY1+iPosY*iSrc1Stride)[iPosX] + offset) >> shiftNum ); 1021 1022 iSrc0Stride = pcYuvSrc0->getCStride(); 1023 iSrc1Stride = pcYuvSrc1->getCStride(); 1024 iDstStride = getCStride(); 1025 1026 //Chroma 1027 (pDstU+(iPosY>>1)*iDstStride)[(iPosX>>1)] = Clip(((pSrcU0+(iPosY>>1)*iSrc0Stride)[(iPosX>>1)] + (pSrcU1+(iPosY>>1)*iSrc1Stride)[(iPosX>>1)] + offset) >> shiftNum ); 1028 (pDstV+(iPosY>>1)*iDstStride)[(iPosX>>1)] = Clip(((pSrcV0+(iPosY>>1)*iSrc0Stride)[(iPosX>>1)] + (pSrcV1+(iPosY>>1)*iSrc1Stride)[(iPosX>>1)] + offset) >> shiftNum ); 1029 1030 #else 1031 //Luma 1032 (pDstY+iPosY*iDstStride)[iPosX] = ((pSrcY0+iPosY*iSrc0Stride)[iPosX] + (pSrcY1+iPosY*iSrc1Stride)[iPosX] + 1) >> 1; 1033 1034 iSrc0Stride = pcYuvSrc0->getCStride(); 1035 iSrc1Stride = pcYuvSrc1->getCStride(); 1036 iDstStride = getCStride(); 1037 1038 //Chroma 1039 (pDstU+(iPosY>>1)*iDstStride)[(iPosX>>1)] = ((pSrcU0+(iPosY>>1)*iSrc0Stride)[(iPosX>>1)] + (pSrcU1+(iPosY>>1)*iSrc1Stride)[(iPosX>>1)] + 1) >> 1; 1040 (pDstV+(iPosY>>1)*iDstStride)[(iPosX>>1)] = ((pSrcV0+(iPosY>>1)*iSrc0Stride)[(iPosX>>1)] + (pSrcV1+(iPosY>>1)*iSrc1Stride)[(iPosX>>1)] + 1) >> 1; 1041 #endif 1042 } 1043 1044 #if DEPTH_MAP_GENERATION 1045 Void TComYuv::addAvgPdm_DBMP( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iPosX, UInt iPosY, UInt uiSubSampExpX, UInt uiSubSampExpY ) 1046 { 1047 UInt uiBlkX = g_auiRasterToPelX[ g_auiZscanToRaster[ iPartUnitIdx ] ] >> uiSubSampExpX; 1048 UInt uiBlkY = g_auiRasterToPelY[ g_auiZscanToRaster[ iPartUnitIdx ] ] >> uiSubSampExpY; 1049 Pel* pSrcY0 = pcYuvSrc0->getLumaAddr( iPartUnitIdx ); 1050 Pel* pSrcY1 = pcYuvSrc1->getLumaAddr( iPartUnitIdx ); 1051 Pel* pDstY = getLumaAddr() + uiBlkY * getStride() + uiBlkX; 1052 1053 UInt iSrc0Stride = pcYuvSrc0->getStride(); 1054 UInt iSrc1Stride = pcYuvSrc1->getStride(); 1055 UInt iDstStride = getStride(); 1056 1057 pDstY[iPosY*iDstStride+iPosX] = (pSrcY0[iPosY*iSrc0Stride+iPosX] + pSrcY1[iPosY*iSrc1Stride+iPosX] + 1) >> 1; 1058 } 1059 #endif 1060 1061 #endif 864 1062 865 1063 Void TComYuv::removeHighFreq( TComYuv* pcYuvSrc, UInt uiWidht, UInt uiHeight ) -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComYuv.h
r21 r28 118 118 #endif 119 119 120 #if POZNAN_DBMP 121 Void copyPartToPartYuv_DBMP ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY ); 122 Void copyPartToPartLuma_DBMP ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY ); 123 Void copyPartToPartChroma_DBMP ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY ); 124 #if DEPTH_MAP_GENERATION 125 Void copyPartToPartYuvPdm_DBMP ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY, UInt uiSubSampExpX, UInt uiSubSampExpY ); 126 Void copyPartToPartLumaPdm_DBMP ( TComYuv* pcYuvDst, UInt uiPartIdx, UInt uiPosX, UInt uiPosY, UInt uiSubSampExpX, UInt uiSubSampExpY ); 127 #endif 128 #endif 129 120 130 // ------------------------------------------------------------------------------------------------------------------ 121 131 // Algebraic operation for YUV buffer … … 143 153 #endif 144 154 155 #if POZNAN_DBMP 156 #ifdef ROUNDING_CONTROL_BIPRED 157 Void addAvg_DBMP ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iPosX, UInt iPosY, Bool bRound ); 158 #endif 159 Void addAvg_DBMP ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iPosX, UInt iPosY ); 160 #if DEPTH_MAP_GENERATION 161 Void addAvgPdm_DBMP ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iPosX, UInt iPosY, UInt uiSubSampExpX, UInt uiSubSampExpY ); 162 #endif 163 #endif 164 145 165 // Remove High frequency 146 166 Void removeHighFreq ( TComYuv* pcYuvSrc, UInt uiWidht, UInt uiHeight ); -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TypeDef.h
r21 r28 65 65 //<<<<< HHI 3DV tools <<<<< 66 66 67 67 //<<<<< Poznan 3DV tools <<<<<< 68 #define POZNAN_CU_SKIP 1 //Poznan Cu Skip 69 #define POZNAN_CU_SYNTH 1 //Poznan Cu Synth 70 71 #define POZNAN_AVAIL_MAP 1 //Creates Availibity buffers in all needed classes 72 73 #define POZNAN_SYNTH_VIEW 1 //Creates view synthesis buffers in all needed classes 74 #define POZNAN_SYNTH_DEPTH 1 75 76 #define POZNAN_SYNTH 1 //Creates aligned synthesis classes in encoder and decoder 77 78 #define POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 1 //Poznan CU Skip 79 #define POZNAN_FILL_OCCLUDED_CU_WITH_SYNTHESIS 1 //Fill not sended CUs with synthesized data 80 81 #define POZNAN_VSO_FIX 0 82 83 #define POZNAN_CU_SKIP_PSNR 1 //Poznan Cu Skip Display psnr of the codded CUs only 84 85 #define POZNAN_NONLINEAR_DEPTH 1 /// Non-linear depth processing (Maciej Kurc) 86 #define POZNAN_NONLINEAR_DEPTH_SEND_AS_BYTE 1 /// Send DepthPower as byte instead of float 87 88 #if POZNAN_SYNTH 89 #define POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 1 /// Increase QP for texture CUs that are in the background (according to proper depth map). This QP change is not encoded in a bitstream 90 #endif 91 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 92 #define POZNAN_TEXTURE_TU_DELTA_QP_NOT_IN_BASE_VIEW 1 /// should not be disabled in current software version - no depth synthesis map is available for base view anyway 93 #define POZNAN_TEXTURE_TU_DELTA_QP_TOP_BOTTOM_CU_ROW 1 /// increase of QP param for top and bottom LCU row in frame 94 #define POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC 0 /// used for optimization of function calculating dQP from depth block max value. Standard values set if disabled. If enabled params are set in cfg file for encoder (no decoder is supported in that case). 95 #if !POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC 96 #define POZNAN_TEXTURE_TU_DELTA_QP_OFFSET (-2.6) 97 #define POZNAN_TEXTURE_TU_DELTA_QP_MUL (1) 98 #define POZNAN_TEXTURE_TU_DELTA_QP_TOP_BOTTOM_ROW_VAL (0) 99 #endif 100 #endif 101 102 #define POZNAN_MP 1 /// Depth-Based Multiview Prediction of CU parameters 103 #if POZNAN_MP 104 105 #define POZNAN_MP_USE_DEPTH_MAP_GENERATION 0 // determines if DEPTH_MAP_GENERATION is used for calculating corresponding pixel position in PUT multiview prediction (POZNAN_MP): 106 // POZNAN_MP_USE_DEPTH_MAP_GENERATION=1 - use DEPTH_MAP_GENERATION, 107 // POZNAN_MP_USE_DEPTH_MAP_GENERATION=0 - use reconstructed depth maps from neighboring views 108 109 #define POZNAN_MP_FILL 1 // Depth-Based Multiview Prediction of CU parameters with fill option for occluded areas 110 #if POZNAN_MP_FILL 111 #define POZNAN_MP_FILL_TYPE 0 // Variant of fill algorithm used for occluded areas (0 - smaller disparity, 1 - larger disparity) 112 #endif 113 114 // --------------------------------------- 115 116 #define POZNAN_DBMP 1 // Depth Based Motion Prediction prediction for MERGE 117 #if POZNAN_DBMP 118 #define POZNAN_DBMP_USE_FOR_TEXTURE 1 //use Depth Based Motion Prediction in texture pictures (0 - no, 1 -yes) 119 #define POZNAN_DBMP_USE_FOR_DEPTH 1 // use Depth Based Motion Prediction in depth pictures (0 - no, 1 -yes) 120 121 #define POZNAN_DBMP_CALC_PRED_DATA 1 // Depth Based Motion Prediction motion data used for prediction in other CUs is calculated based on all CU points (otherwise motion data for none-MP points is used for prediction) 122 #define POZNAN_DBMP_COMPRESS_ME_DATA 0 // Depth Based Motion Prediction derives representative motion data from reference CUs even if they are DBMP-based predicted (otherwise motion data is derived with per-point resolution for DBMP-based predicted reference CUs) 123 #define POZNAN_DBMP_USE_IN_NONANCHOR_PIC_ONLY 1 // determines if Depth Based Motion Prediction is used in non-anchor pictures only 124 #endif 125 126 #endif 127 128 129 //<<<<< Poznan 3DV tools <<<<<< 68 130 69 131 //////////////////////////// … … 345 407 typedef unsigned long ULong; 346 408 typedef double Double; 409 typedef float Float; 347 410 348 411 // ==================================================================================================================== … … 580 643 MODE_INTER, ///< inter-prediction mode 581 644 MODE_INTRA, ///< intra-prediction mode 645 #if POZNAN_SYNTH 646 MODE_SYNTH, ///< synth-mode 647 #endif 582 648 MODE_NONE = 15 583 649 };
Note: See TracChangeset for help on using the changeset viewer.