Changeset 41 in 3DVCSoftware
- Timestamp:
- 26 Mar 2012, 09:03:21 (13 years ago)
- Location:
- branches/0.3-poznan-univ
- Files:
-
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.3-poznan-univ/CommonTestConditionsCfgs/baseCfg_2view+depth.cfg
r30 r41 115 115 VSO : 1 # use of view synthesis optimization for depth coding 116 116 MVI : 1 # motion parameter inheritance 117 DepthPower : -1 # nonlinear depth representation 117 NonlinearDepth : 1 # nonlinear depth representation 118 NonlinearDepthModel : 12 21 26 27 23 15 # nonlinear depth representation model 118 119 119 120 #========== view synthesis optimization (VSO) ========== 120 121 VSOConfig : [cx0 B(cc1) I(s0.5)][cx1 B(oo0) I(s0.5)] 121 122 # VSO configuration string 122 123 #========== flexible coding order (FlexCO) ========== 124 3DVFlexOrder : 0 125 3DVCodingOrder : T0D0D1D2T1T2 -
branches/0.3-poznan-univ/CommonTestConditionsCfgs/baseCfg_3view+depth.cfg
r30 r41 119 119 VSO : 1 # use of view synthesis optimization for depth coding 120 120 MVI : 1 # motion parameter inheritance 121 DepthPower : -1 # nonlinear depth representation 121 NonlinearDepth : 1 # nonlinear depth representation 122 NonlinearDepthModel : 12 21 26 27 23 15 # nonlinear depth representation model 122 123 123 124 #========== view synthesis optimization (VSO) ========== 124 125 VSOConfig : [cx0 B(cc1) I(s0.5)][cx1 B(oo0) B(oo2) I(s0.5 s1.5)][cx2 B(cc1) I(s1.5)] 125 126 # VSO configuration string 127 #========== flexible coding order (FlexCO) ========== 128 3DVFlexOrder : 0 129 3DVCodingOrder : T0D0D1D2T1T2 126 130 127 131 128 -
branches/0.3-poznan-univ/source/App/TAppCommon/TAppComCamPara.cpp
r29 r41 877 877 radShiftParams[ uiSourceView][ uiTargetView ][ 1 ] = dOffset; 878 878 879 for( UInt uiDepthValue = 0; uiDepthValue < SizeOfLUT; uiDepthValue++ ) 880 { 881 // real-valued look-up tables 879 882 #if POZNAN_NONLINEAR_DEPTH 880 TComNonlinearDepthBackward cNonlinearDepthBwd(m_fDepthPower, (POZNAN_LUT_INCREASED_PRECISION) ? g_uiBitIncrement : 0, (POZNAN_LUT_INCREASED_PRECISION) ? g_uiBitIncrement : 0); 883 Double dShiftLuma; 884 if(m_bUseNonlinearDepth) 885 dShiftLuma = ( m_cNonlinearDepthModel.BackwardD((Double)uiDepthValue, dScale) + dOffset ) * Double( 1 << m_iLog2Precision ); 886 else 887 dShiftLuma = ( (Double)uiDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision ); 888 #else 889 Double dShiftLuma = ( (Double)uiDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision ); 881 890 #endif 882 883 for( UInt uiDepthValue = 0; uiDepthValue < SizeOfLUT; uiDepthValue++ )884 {885 Double dDepthValue = (Double)uiDepthValue;886 Int64 iDepthValue = (Int64)uiDepthValue;887 #if POZNAN_NONLINEAR_DEPTH888 dDepthValue = cNonlinearDepthBwd(dDepthValue);889 iDepthValue = (Int64)(dDepthValue+0.5);890 #endif891 #if POZNAN_LUT_INCREASED_PRECISION892 dDepthValue /= (1<<g_uiBitIncrement);893 #endif894 // real-valued look-up tables895 896 Double dShiftLuma = ( dDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision );897 891 Double dShiftChroma = dShiftLuma / 2; 898 892 radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = dShiftLuma; … … 900 894 901 895 // integer-valued look-up tables 902 Int64 iTempScale = iDepthValue * iScale; 903 #if POZNAN_LUT_INCREASED_PRECISION 904 iTempScale >>= g_uiBitIncrement; 896 #if POZNAN_NONLINEAR_DEPTH 897 Int64 iTempScale; 898 if(m_bUseNonlinearDepth) 899 iTempScale = (Int64)m_cNonlinearDepthModel.BackwardI(uiDepthValue, iScale); 900 else 901 iTempScale = (Int64)uiDepthValue * iScale; 902 903 #else 904 Int64 iTempScale = (Int64)uiDepthValue * iScale; 905 905 #endif 906 906 Int64 iTestScale = ( iTempScale + iOffset ); // for checking accuracy of camera parameters … … 1254 1254 Int iLog2Precision 1255 1255 #if POZNAN_NONLINEAR_DEPTH 1256 , Float fDepthPower1256 ,TComNonlinearDepthModel* pcNonlinearDepthModel 1257 1257 #endif 1258 1258 ) … … 1266 1266 1267 1267 #if POZNAN_NONLINEAR_DEPTH 1268 m_fDepthPower = fDepthPower; 1268 m_bUseNonlinearDepth = (pcNonlinearDepthModel != NULL) ? true : false; 1269 if(pcNonlinearDepthModel != NULL) 1270 m_cNonlinearDepthModel = *pcNonlinearDepthModel; 1269 1271 #endif 1270 1272 -
branches/0.3-poznan-univ/source/App/TAppCommon/TAppComCamPara.h
r28 r41 105 105 106 106 #if POZNAN_NONLINEAR_DEPTH 107 Float m_fDepthPower; 107 TComNonlinearDepthModel m_cNonlinearDepthModel; 108 Bool m_bUseNonlinearDepth; 108 109 #endif 109 110 … … 166 167 Int iLog2Precision 167 168 #if POZNAN_NONLINEAR_DEPTH 168 , Float fDepthPower169 ,TComNonlinearDepthModel* pcNonlinearDepthModel 169 170 #endif 170 171 ); … … 178 179 Int iLog2Precision 179 180 #if POZNAN_NONLINEAR_DEPTH 180 , Float fDepthPower181 ,TComNonlinearDepthModel* pcNonlinearDepthModel 181 182 #endif 182 183 ); -
branches/0.3-poznan-univ/source/App/TAppDecoder/TAppDecTop.cpp
r30 r41 138 138 NalUnitType eNalUnitType; 139 139 140 #if FLEX_CODING_ORDER 141 Int iDepthViewIdx = 0; 142 Bool bCountDepthViewIdx = false; // a flag which avoid repeating assign a value to iDepthViewIdx 143 Bool bNewPictureType =true; 144 Bool bFirstDepth = false; 145 #endif 140 146 141 147 while ( !bEos ) … … 148 154 if( bIsDepth ) 149 155 { 156 #if FLEX_CODING_ORDER 157 if (!bFirstSliceDecoded) m_acTDecDepthTopList[iDepthViewIdx]->decode( bEos, pcBitstream, uiPOC, pcListPic, eNalUnitType, cComSPS, m_iSkipFrame, m_aiDepthPOCLastDisplayList[iDepthViewIdx] ,bNewPictureType); 158 m_acTDecDepthTopList[iDepthViewIdx]->executeDeblockAndAlf( bEos, pcBitstream, uiPOC, pcListPic, m_iSkipFrame, m_aiDepthPOCLastDisplayList[iDepthViewIdx]); 159 #else 150 160 if (!bFirstSliceDecoded) m_acTDecDepthTopList[iViewIdx]->decode( bEos, pcBitstream, uiPOC, pcListPic, eNalUnitType, cComSPS, m_iSkipFrame, m_aiDepthPOCLastDisplayList[iViewIdx] ); 151 161 m_acTDecDepthTopList[iViewIdx]->executeDeblockAndAlf( bEos, pcBitstream, uiPOC, pcListPic, m_iSkipFrame, m_aiDepthPOCLastDisplayList[iViewIdx]); 162 #endif 152 163 } 153 164 else 154 165 { 166 #if FLEX_CODING_ORDER 167 if (!bFirstSliceDecoded) m_acTDecTopList[iViewIdx]->decode( bEos, pcBitstream, uiPOC, pcListPic, eNalUnitType, cComSPS, m_iSkipFrame, m_aiPOCLastDisplayList[iViewIdx], bNewPictureType); 168 #else 155 169 if (!bFirstSliceDecoded) m_acTDecTopList[iViewIdx]->decode( bEos, pcBitstream, uiPOC, pcListPic, eNalUnitType, cComSPS, m_iSkipFrame, m_aiPOCLastDisplayList[iViewIdx] ); 170 #endif 156 171 m_acTDecTopList[iViewIdx]->executeDeblockAndAlf( bEos, pcBitstream, uiPOC, pcListPic, m_iSkipFrame, m_aiPOCLastDisplayList[iViewIdx]); 157 172 } … … 168 183 Bool bNewPicture; 169 184 if( bIsDepth ) 185 #if FLEX_CODING_ORDER 186 bNewPicture = m_acTDecDepthTopList[iDepthViewIdx]->decode( bEos, pcBitstream, uiPOC, pcListPic, eNalUnitType, cComSPS, m_iSkipFrame, m_aiDepthPOCLastDisplayList[iDepthViewIdx], bNewPictureType); 187 #else 170 188 bNewPicture = m_acTDecDepthTopList[iViewIdx]->decode( bEos, pcBitstream, uiPOC, pcListPic, eNalUnitType, cComSPS, m_iSkipFrame, m_aiDepthPOCLastDisplayList[iViewIdx] ); 189 #endif 171 190 else 191 #if FLEX_CODING_ORDER 192 bNewPicture = m_acTDecTopList[iViewIdx]->decode( bEos, pcBitstream, uiPOC, pcListPic, eNalUnitType, cComSPS, m_iSkipFrame, m_aiPOCLastDisplayList[iViewIdx], bNewPictureType ); 193 #else 172 194 bNewPicture = m_acTDecTopList[iViewIdx]->decode( bEos, pcBitstream, uiPOC, pcListPic, eNalUnitType, cComSPS, m_iSkipFrame, m_aiPOCLastDisplayList[iViewIdx] ); 195 #endif 173 196 bFirstSliceDecoded = true; 197 198 #if FLEX_CODING_ORDER 199 if (eNalUnitType == NAL_UNIT_SPS) 200 { 201 #if POZNAN_SYNTH 202 if(cComSPS.getViewId()==0 && !cComSPS.isDepth()) // it should be called at first view at the begining of the stream 203 initRenderer(cComSPS); 204 #endif 205 if( cComSPS.isDepth() && (m_bUsingDepth==false) ) // expected not using depth, but bitstream are using depth 206 { // know from sps 207 assert( cComSPS.getViewId() == 0 && iDepthViewIdx == 0 && !bIsDepth ); 208 startUsingDepth() ; 209 } 210 if (cComSPS.isDepth()) 211 { 212 if (cComSPS.getViewId() >= m_acTVideoIOYuvDepthReconFileList.size()) 213 { 214 assert( cComSPS.getViewId() == m_acTVideoIOYuvReconFileList.size() ); 215 increaseNumberOfViews(cComSPS.getViewId()+1); 216 } 217 218 m_acTDecDepthTopList[cComSPS.getViewId()]->setSPS(cComSPS); 219 } 220 else 221 { 222 if (cComSPS.getViewId() >= m_acTVideoIOYuvReconFileList.size()) 223 { 224 assert( cComSPS.getViewId() == m_acTVideoIOYuvReconFileList.size() ); 225 increaseNumberOfViews(cComSPS.getViewId()+1); 226 } 227 m_acTDecTopList[cComSPS.getViewId()]->setSPS(cComSPS); 228 } 229 bEos = m_cTVideoIOBitstreamFile.readBits( pcBitstream ); 230 assert( !bEos); 231 if( cComSPS.isDepth() ) 232 m_acTDecDepthTopList[cComSPS.getViewId()]->decode( bEos, pcBitstream, uiPOC, pcListPic, eNalUnitType, cComSPS, m_iSkipFrame, m_aiDepthPOCLastDisplayList[cComSPS.getViewId()], bNewPictureType); // decode PPS 233 else 234 m_acTDecTopList[cComSPS.getViewId()]->decode( bEos, pcBitstream, uiPOC, pcListPic, eNalUnitType, cComSPS, m_iSkipFrame, m_aiPOCLastDisplayList[cComSPS.getViewId()], bNewPictureType); // decode PPS 235 assert( eNalUnitType == NAL_UNIT_PPS ); 236 } 237 #else 174 238 175 239 if( eNalUnitType == NAL_UNIT_SPS ) … … 204 268 assert( eNalUnitType == NAL_UNIT_PPS ); 205 269 } 270 #endif 206 271 assert( eNalUnitType != NAL_UNIT_SEI ); // not yet supported for MVC 207 272 if (bNewPicture) 208 273 { 209 274 if( bIsDepth ) 275 #if FLEX_CODING_ORDER 276 m_acTDecDepthTopList[iDepthViewIdx]->executeDeblockAndAlf( bEos, pcBitstream, uiPOC, pcListPic, m_iSkipFrame, m_aiDepthPOCLastDisplayList[iDepthViewIdx]); 277 #else 210 278 m_acTDecDepthTopList[iViewIdx]->executeDeblockAndAlf( bEos, pcBitstream, uiPOC, pcListPic, m_iSkipFrame, m_aiDepthPOCLastDisplayList[iViewIdx]); 279 #endif 211 280 else 212 281 m_acTDecTopList[iViewIdx]->executeDeblockAndAlf( bEos, pcBitstream, uiPOC, pcListPic, m_iSkipFrame, m_aiPOCLastDisplayList[iViewIdx]); … … 214 283 m_cTVideoIOBitstreamFile.setFileLocation( lLocation ); 215 284 bFirstSliceDecoded = false; 216 217 if( m_bUsingDepth && !bIsDepth ) 218 { 219 bIsDepth = true; 285 #if FLEX_CODING_ORDER 286 if (m_bUsingDepth) 287 { 288 bIsDepth = bNewPictureType; 289 290 } 291 if (bCountDepthViewIdx == false ) 292 { 293 bCountDepthViewIdx = true; 294 if (bIsDepth == true) 295 { 296 bFirstDepth = true; 297 bCountDepthViewIdx = true; 298 } 299 if (!bFirstDepth && !bIsDepth) 300 { 301 iViewIdx++; 302 bCountDepthViewIdx = false; 303 } 304 220 305 } 221 306 else 222 307 { 223 bIsDepth = false; 224 if( iViewIdx<m_acTDecTopList.size()-1) 225 { 226 iViewIdx++ ; 308 if (bIsDepth) 309 { 310 iDepthViewIdx++; 227 311 } 228 312 else 229 313 { 314 iViewIdx ++; 315 } 316 317 if (iViewIdx >= m_acTDecTopList.size() || iDepthViewIdx >= m_acTDecDepthTopList.size()) 318 { 319 bFirstDepth = false; 230 320 iViewIdx = 0; 231 321 iDepthViewIdx = 0; 322 bCountDepthViewIdx = false; 232 323 // end of access unit: delete extra pic buffers 233 324 Int iNumViews = (Int)m_acTVideoIOYuvReconFileList.size(); … … 260 351 } 261 352 } 353 354 #else 355 356 if( m_bUsingDepth && !bIsDepth ) 357 { 358 bIsDepth = true; 359 } 360 else 361 { 362 bIsDepth = false; 363 if( iViewIdx<m_acTDecTopList.size()-1) 364 { 365 iViewIdx++ ; 366 } 367 else 368 { 369 iViewIdx = 0; 370 371 // end of access unit: delete extra pic buffers 372 Int iNumViews = (Int)m_acTVideoIOYuvReconFileList.size(); 373 for( Int iVId = 0; iVId < iNumViews; iVId++ ) 374 { 375 if( iVId < (Int)m_acTDecTopList.size() && m_acTDecTopList[iVId] ) 376 { 377 m_acTDecTopList[iVId]->deleteExtraPicBuffers( (Int)uiPOC ); 378 } 379 if( iVId < (Int)m_acTDecDepthTopList.size() && m_acTDecDepthTopList[iVId] ) 380 { 381 m_acTDecDepthTopList[iVId]->deleteExtraPicBuffers( (Int)uiPOC ); 382 } 383 } 384 385 #if AMVP_BUFFERCOMPRESS 386 // compress motion for entire access unit 387 for( Int iVId = 0; iVId < iNumViews; iVId++ ) 388 { 389 if( iVId < (Int)m_acTDecTopList.size() && m_acTDecTopList[iVId] ) 390 { 391 m_acTDecTopList[iVId]->compressMotion( (Int)uiPOC ); 392 } 393 if( iVId < (Int)m_acTDecDepthTopList.size() && m_acTDecDepthTopList[iVId] ) 394 { 395 m_acTDecDepthTopList[iVId]->compressMotion( (Int)uiPOC ); 396 } 397 } 398 #endif 399 } 400 } 401 #endif 262 402 } 263 403 #else … … 434 574 #if POZNAN_NONLINEAR_DEPTH 435 575 TComSPS* pcSPS = pcPic->getSlice(0)->getSPS(); 436 TComPicYuv cPicPower; 437 438 //pcPic->getPicYuvRec() 439 cPicPower.create(pcSPS->getWidth(), pcSPS->getHeight(), pcSPS->getMaxCUWidth(), pcSPS->getMaxCUHeight(), pcSPS->getMaxCUDepth() ); 440 441 pcPic->getPicYuvRec()->nonlinearDepthBackward(&cPicPower, pcSPS->getDepthPower()); 442 443 m_acTVideoIOYuvDepthReconFileList[iViewIdx]->write(&cPicPower, pcSPS->getPad()); 444 cPicPower.destroy(); 445 #else 576 if( pcSPS->getUseNonlinearDepth() ) 577 { 578 TComPicYuv cPicNonlinearDepth; 579 580 //pcPic->getPicYuvRec() 581 cPicNonlinearDepth.create(pcSPS->getWidth(), pcSPS->getHeight(), pcSPS->getMaxCUWidth(), pcSPS->getMaxCUHeight(), pcSPS->getMaxCUDepth() ); 582 583 pcPic->getPicYuvRec()->nonlinearDepthBackward(&cPicNonlinearDepth, pcSPS->getNonlinearDepthModel()); 584 585 m_acTVideoIOYuvDepthReconFileList[iViewIdx]->write(&cPicNonlinearDepth, pcSPS->getPad()); 586 cPicNonlinearDepth.destroy(); 587 } 588 else 589 #endif 446 590 m_acTVideoIOYuvDepthReconFileList[iViewIdx]->write( pcPic->getPicYuvRec(), pcPic->getSlice(0)->getSPS()->getPad() ); 447 #endif448 591 } 449 592 … … 536 679 m_acTDecDepthTopList.back()->create() ; 537 680 m_acTDecDepthTopList.back()->init( this, false ); 681 #if FLEX_CODING_ORDER 682 Int iNumofgen = (Int)m_acTDecDepthTopList.size(); 683 m_acTDecDepthTopList.back()->setViewIdx(iNumofgen-1); //Oweczka ?? 684 #else 538 685 m_acTDecDepthTopList.back()->setViewIdx((Int)m_acTDecTopList.size()-1); 686 #endif 539 687 m_acTDecDepthTopList.back()->setPictureDigestEnabled(m_pictureDigestEnabled); 540 688 m_acTDecDepthTopList.back()->setToDepth( true ); … … 560 708 TComPic* TAppDecTop::getPicFromView( Int iViewIdx, Int iPoc, bool bIsDepth ) 561 709 { 710 #if FLEX_CODING_ORDER //Owieczka ?? flaga Jakuba 711 if( bIsDepth && ((Int)(m_acTDecDepthTopList.size() - 1) < iViewIdx)) 712 { 713 return NULL; 714 } 715 if(!bIsDepth && ((Int)( m_acTDecTopList.size() - 1) < iViewIdx)) 716 { 717 return NULL; 718 } 719 #endif 562 720 TComList<TComPic*>* apcListPic = (bIsDepth ? m_acTDecDepthTopList[iViewIdx] : m_acTDecTopList[iViewIdx])->getListPic(); 563 721 TComPic* pcRefPic = NULL; -
branches/0.3-poznan-univ/source/App/TAppEncoder/TAppEncCfg.cpp
r28 r41 110 110 free (m_pchBitstreamFile) ; 111 111 112 #if FLEX_CODING_ORDER 113 if (m_pchMVCJointCodingOrder != NULL) 114 { 115 free(m_pchMVCJointCodingOrder) ; 116 } 117 #endif 118 112 119 for(Int i = 0; i< m_pchDepthReconFileList.size(); i++ ) 113 120 { … … 153 160 string cfg_ReconFile; 154 161 string cfg_dQPFile; 162 163 #if FLEX_CODING_ORDER 164 string cfg_JointCodingOrdering; 165 #endif 166 155 167 po::Options opts; 156 168 opts.addOptions() … … 191 203 ("NumberOfViews", m_iNumberOfViews, 0, "Number of views") 192 204 205 #if FLEX_CODING_ORDER 206 ("3DVFlexOrder", m_b3DVFlexOrder, false, "flexible coding order flag" ) 207 ("3DVCodingOrder", cfg_JointCodingOrdering, string(""), "The coding order for joint texture-depth coding") 208 #endif 193 209 194 210 /* Unit definition parameters */ … … 367 383 #endif 368 384 #if POZNAN_NONLINEAR_DEPTH 369 ("DepthPower,-dpow", m_fDepthPower, (Double)1.0, "Depth power value (for non-linear processing)") 385 ("NonlinearDepth", m_bUseNonlinearDepth, true, "usage of non-linear depth representation") 386 ("NonlinearDepthModel", m_aiNonlinearDepthModel, std::vector<Int>(0,0), "Nodes for definition of non-linear depth representation") 387 #if POZNAN_NONLINEAR_DEPTH_THRESHOLD 388 ("NonlinearDepthThreshold", m_iNonlinearDepthThreshold, 100, "Threshold for usage of Nonlinear depth representation") 389 #endif 370 390 #endif 371 391 … … 398 418 m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str()); 399 419 m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str()); 420 421 #if FLEX_CODING_ORDER && HHI_VSO 422 m_pchMVCJointCodingOrder = cfg_JointCodingOrdering.empty()?NULL:strdup(cfg_JointCodingOrdering.c_str()); 423 // If flexible order is enabled and if depth comes before the texture for a view, disable VSO 424 Bool depthComesFirst = false; 425 if ( m_b3DVFlexOrder ) 426 { 427 for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++) 428 { 429 for ( Int ii=1; ii<12; ii+=2 ) 430 { 431 Int iViewIdxCfg = (Int)(m_pchMVCJointCodingOrder[ii]-'0'); 432 if ( iViewIdxCfg == iViewIdx ) 433 { 434 if ( m_pchMVCJointCodingOrder[ii-1]=='D' ) // depth comes first for this view 435 { 436 depthComesFirst = true; 437 break; 438 } 439 else 440 { 441 assert(m_pchMVCJointCodingOrder[ii-1]=='T'); 442 } 443 } 444 } 445 } 446 } 447 if (depthComesFirst) 448 { 449 m_bUseVSO = false; 450 } 451 #endif 400 452 401 453 … … 458 510 459 511 #if POZNAN_NONLINEAR_DEPTH 460 if (m_fDepthPower<=0) 461 { 462 Float fDepthQP = m_adQP[ m_adQP.size() < 2 ? 0 : 1]; 463 m_fDepthPower = (fDepthQP-30) *0.25/20.0 + 1.25; 464 if (m_fDepthPower<=1.0) m_fDepthPower = 1.0; 465 // QP = 30 = 1.25 466 // QP = 50 = 1.5 467 if (m_fDepthPower>=1.66) m_fDepthPower = 1.66; 468 }; 469 470 #if POZNAN_NONLINEAR_DEPTH_SEND_AS_BYTE 471 m_fDepthPower = dequantizeDepthPower(quantizeDepthPower((Float)m_fDepthPower)); 472 #endif 473 512 #if POZNAN_NONLINEAR_DEPTH_THRESHOLD 513 if(m_bUseNonlinearDepth && m_iNonlinearDepthThreshold>0) 514 { 515 FILE *base_depth_file; 516 unsigned char *depth_buf; 517 int histogram[256]; 518 int i, size; 519 float weighted_avg; 520 base_depth_file = fopen(m_pchDepthInputFileList[0], "rb"); 521 if (base_depth_file) 522 { 523 size = m_iSourceWidth*m_iSourceHeight; 524 depth_buf = (unsigned char *)malloc(size); 525 fread(depth_buf, 1, size, base_depth_file); 526 fclose(base_depth_file); 527 memset(histogram, 0, sizeof(histogram)); 528 for (i=0; i<size;++i) histogram[depth_buf[i]]++; 529 weighted_avg = 0; 530 for (i=0; i<256; ++i) weighted_avg += i*histogram[i]; 531 weighted_avg /= size; 532 533 if (weighted_avg<m_iNonlinearDepthThreshold) 534 { 535 m_bUseNonlinearDepth = 0; 536 printf ("\nWeighted average of depth histogram:%f < %d, turning NonlinearDepthRepresentation OFF\n", weighted_avg, m_iNonlinearDepthThreshold); 537 } 538 } 539 } 540 #endif 541 542 if(m_bUseNonlinearDepth) 543 { 544 m_cNonlinearDepthModel.m_iNum = (Int)m_aiNonlinearDepthModel.size(); 545 m_cNonlinearDepthModel.m_aiPoints[0]=0; 546 for (int i=0; i<m_cNonlinearDepthModel.m_iNum; ++i) 547 m_cNonlinearDepthModel.m_aiPoints[i+1] = m_aiNonlinearDepthModel[i]; 548 549 m_cNonlinearDepthModel.m_aiPoints[m_cNonlinearDepthModel.m_iNum+1]=0; 550 m_cNonlinearDepthModel.Init(); 551 } 474 552 #endif 475 553 … … 555 633 LOG2_DISP_PREC_LUT 556 634 #if POZNAN_NONLINEAR_DEPTH 557 , m_fDepthPower635 ,(m_bUseNonlinearDepth ? &m_cNonlinearDepthModel : NULL) 558 636 #endif 559 637 ); … … 572 650 LOG2_DISP_PREC_LUT 573 651 #if POZNAN_NONLINEAR_DEPTH 574 , m_fDepthPower652 ,(m_bUseNonlinearDepth ? &m_cNonlinearDepthModel : NULL) 575 653 #endif 576 654 ); … … 589 667 LOG2_DISP_PREC_LUT 590 668 #if POZNAN_NONLINEAR_DEPTH 591 , m_fDepthPower669 ,(m_bUseNonlinearDepth ? &m_cNonlinearDepthModel : NULL) 592 670 #endif 593 671 ); … … 605 683 LOG2_DISP_PREC_LUT 606 684 #if POZNAN_NONLINEAR_DEPTH 607 , m_fDepthPower685 ,(m_bUseNonlinearDepth ? &m_cNonlinearDepthModel : NULL) 608 686 #endif 609 687 ); … … 1064 1142 #endif 1065 1143 #if POZNAN_NONLINEAR_DEPTH 1066 printf(" DepthPower:%f ", m_fDepthPower);1144 printf("NLDR:%d ", m_bUseNonlinearDepth ? 1 : 0); 1067 1145 #endif 1068 1146 printf("\n"); -
branches/0.3-poznan-univ/source/App/TAppEncoder/TAppEncCfg.h
r28 r41 81 81 Bool m_bUsingDepthMaps ; 82 82 83 #if FLEX_CODING_ORDER 84 char* m_pchMVCJointCodingOrder; ///< texture-depth coding order 85 Bool m_b3DVFlexOrder; ///< flexible coding order flag 86 #endif 87 83 88 84 89 // coding structure … … 290 295 291 296 #if POZNAN_NONLINEAR_DEPTH 292 Double m_fDepthPower; ///< Depth power value 297 std::vector<Int> m_aiNonlinearDepthModel; 298 TComNonlinearDepthModel m_cNonlinearDepthModel; 299 Int m_iNonlinearDepthThreshold; 300 Bool m_bUseNonlinearDepth; 293 301 #endif 294 302 -
branches/0.3-poznan-univ/source/App/TAppEncoder/TAppEncTop.cpp
r30 r41 142 142 143 143 #if POZNAN_NONLINEAR_DEPTH 144 m_acTEncTopList[iViewIdx]->setDepthPower ( (Float)m_fDepthPower ); 144 m_acTEncTopList[iViewIdx]->setNonlinearDepthModel ( m_cNonlinearDepthModel ); 145 m_acTEncTopList[iViewIdx]->setUseNonlinearDepth ( m_bUseNonlinearDepth ); 145 146 #endif 146 147 … … 256 257 for(Int iViewIdx=0; iViewIdx<m_iNumberOfViews; iViewIdx++) 257 258 { 259 #if FLEX_CODING_ORDER 260 // Detect whether depth comes before than texture for this view 261 Bool isDepthFirst = false; 262 if ( m_b3DVFlexOrder ) 263 { 264 for ( Int ii=1; ii<12; ii+=2 ) 265 { 266 Int iViewIdxCfg = (Int)(m_pchMVCJointCodingOrder[ii]-'0'); 267 if ( iViewIdxCfg == iViewIdx ) 268 { 269 if ( m_pchMVCJointCodingOrder[ii-1]=='D' ) // depth comes first for this view 270 { 271 isDepthFirst = true; 272 } 273 else 274 { 275 assert(m_pchMVCJointCodingOrder[ii-1]=='T'); 276 } 277 break; 278 } 279 } 280 } 281 #endif 258 282 m_iDepthFrameRcvdVector.push_back(0) ; 259 283 m_acTEncDepthTopList.push_back(new TEncTop); … … 375 399 m_acTEncDepthTopList[iViewIdx]->setUseDMM( m_bUseDMM ); 376 400 #endif 401 #if FLEX_CODING_ORDER && HHI_DMM_PRED_TEX 402 m_acTEncDepthTopList[iViewIdx]->setUseDMM34( (m_b3DVFlexOrder && isDepthFirst) ? false : m_bUseDMM ); 403 #endif 377 404 #if CONSTRAINED_INTRA_PRED 378 405 m_acTEncDepthTopList[iViewIdx]->setUseConstrainedIntraPred ( m_bUseConstrainedIntraPred ); … … 401 428 #endif 402 429 #if HHI_MPI 430 #if FLEX_CODING_ORDER 431 m_acTEncDepthTopList[iViewIdx]->setUseMVI( (m_b3DVFlexOrder && isDepthFirst) ? false : m_bUseMVI ); 432 #else 403 433 m_acTEncDepthTopList[iViewIdx]->setUseMVI( m_bUseMVI ); 434 #endif 404 435 #endif 405 436 #if POZNAN_DBMP … … 407 438 #endif 408 439 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 409 m_acTEncDepthTopList[iViewIdx]->setUseCUSkip 440 m_acTEncDepthTopList[iViewIdx]->setUseCUSkip ( m_uiUseCUSkip ); 410 441 #endif 411 442 #if POZNAN_NONLINEAR_DEPTH 412 m_acTEncDepthTopList[iViewIdx]->setDepthPower ( (Float)m_fDepthPower ); 443 m_acTEncDepthTopList[iViewIdx]->setNonlinearDepthModel ( m_cNonlinearDepthModel ); 444 m_acTEncDepthTopList[iViewIdx]->setUseNonlinearDepth ( m_bUseNonlinearDepth ); 413 445 #endif 414 446 … … 690 722 m_acTVideoIOYuvDepthInputFileList[iViewIdx]->read( pcPdmDepthOrg, m_aiPad, m_bUsingDepthMaps ); 691 723 #if POZNAN_NONLINEAR_DEPTH 692 pcPdmDepthOrg->nonlinearDepthForward(pcPdmDepthOrg, m_fDepthPower); 724 if( m_bUseNonlinearDepth ) 725 pcPdmDepthOrg->nonlinearDepthForward(pcPdmDepthOrg, m_cNonlinearDepthModel); 693 726 #endif 694 727 } … … 714 747 m_acTVideoIOYuvDepthInputFileList[iViewIdx]->read( pcDepthPicYuvOrg, m_aiPad ) ; 715 748 #if POZNAN_NONLINEAR_DEPTH 716 pcDepthPicYuvOrg->nonlinearDepthForward(pcDepthPicYuvOrg, m_fDepthPower); 749 if( m_bUseNonlinearDepth ) 750 pcDepthPicYuvOrg->nonlinearDepthForward(pcDepthPicYuvOrg, m_cNonlinearDepthModel); 717 751 #endif 718 752 bDepthEos[iViewIdx] = ( m_acTVideoIOYuvDepthInputFileList[iViewIdx]->isEof() == 1 ? true : false ); … … 744 778 #endif 745 779 780 #if FLEX_CODING_ORDER 781 if (m_b3DVFlexOrder) 782 { 783 Int i=0; 784 Int iViewIdx = 0; 785 bool bThisViewContinueReadingPics = false; 786 bool bThisViewContinueReadingDepthPics = false; 787 Int iNumberofDepthViews = m_bUsingDepthMaps?m_iNumberOfViews:0; 788 for(Int j=0; j < (m_iNumberOfViews+ iNumberofDepthViews); j++ ) // Start encoding 789 { 790 if (m_pchMVCJointCodingOrder[i]=='T') 791 { 792 i++; 793 assert(isdigit(m_pchMVCJointCodingOrder[i])); 794 iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0'); 795 bThisViewContinueReadingPics = bContinueReadingPics[iViewIdx]; 796 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 797 // If no depth picture reconstruction for current view and current POC is available sythesize one 798 Int iCurrPoc = m_acTEncTopList[ 0 ]->getNextFrameId(); 799 Bool bCurrPicDepthRec = getPicFromView( iViewIdx, iCurrPoc, true ) != NULL && getPicFromView( iViewIdx, iCurrPoc, true )->getReconMark(); 800 if(m_bUseTexDqpAccordingToDepth && !bCurrPicDepthRec) 801 { 802 xStoreDepthSynthPicsInBuffer(iViewIdx); 803 } 804 #endif 805 m_acTEncTopList[iViewIdx]->encode( bEos[iViewIdx], m_cListPicYuvRecMap[iViewIdx], pcBitstream, bThisViewContinueReadingPics ); 806 bContinueReadingPics[iViewIdx]=bThisViewContinueReadingPics; 807 bAllContinueReadingPics = bAllContinueReadingPics||bContinueReadingPics[iViewIdx]; 808 809 if(pcBitstream->getNumberOfWrittenBits()!=0) 810 { 811 m_cTVideoIOBitsFile.writeBits( pcBitstream ); 812 } 813 pcBitstream->resetBits(); //GT: also done later in .... 814 pcBitstream->rewindStreamPacket( ); 815 // write bistream to file if necessary 816 xWriteOutput( iViewIdx ); //GT: Write Reconfiles (when gop is complete?) 817 i++; 818 } 819 else if ( m_pchMVCJointCodingOrder[i] == 'D') 820 { 821 i++; 822 if( m_bUsingDepthMaps ) 823 { 824 assert(isdigit(m_pchMVCJointCodingOrder[i])); 825 iViewIdx = (Int)(m_pchMVCJointCodingOrder[i]-'0'); 826 bThisViewContinueReadingDepthPics = bContinueReadingDepthPics[iViewIdx]; 827 m_acTEncDepthTopList[iViewIdx]->encode( bDepthEos[iViewIdx], m_cListPicYuvDepthRecMap[iViewIdx], pcBitstream, bThisViewContinueReadingDepthPics ); 828 bContinueReadingDepthPics[iViewIdx]=bThisViewContinueReadingDepthPics; 829 830 bAllContinueReadingDepthPics = bAllContinueReadingDepthPics||bContinueReadingDepthPics[iViewIdx]; 831 if(pcBitstream->getNumberOfWrittenBits()!=0) 832 { 833 m_cTVideoIOBitsFile.writeBits( pcBitstream ); 834 } 835 pcBitstream->resetBits(); 836 pcBitstream->rewindStreamPacket( ); 837 // write bistream to file if necessary 838 xWriteOutput( iViewIdx, true ); 839 i++; 840 } 841 } 842 } 843 } 844 else 845 { 846 #endif 746 847 //GT: Encode 747 848 for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ ) // Start encoding … … 755 856 //* 756 857 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 858 #if FLEX_CODING_ORDER 859 // If no depth picture reconstruction for current view and current POC is available sythesize one 860 Int iCurrPoc = m_acTEncTopList[ 0 ]->getNextFrameId(); 861 Bool bCurrPicDepthRec = getPicFromView( iViewIdx, iCurrPoc, true ) != NULL && getPicFromView( iViewIdx, iCurrPoc, true )->getReconMark(); 862 if(m_bUseTexDqpAccordingToDepth && !bCurrPicDepthRec) 863 #else 757 864 if(m_bUseTexDqpAccordingToDepth) 865 #endif 758 866 { 759 867 xStoreDepthSynthPicsInBuffer(iViewIdx); … … 798 906 } 799 907 } 800 908 #if FLEX_CODING_ORDER 909 } 910 #endif 801 911 // delete extra picture buffers 802 912 if( bCurrPocCoded ) … … 1004 1114 riNextPocToDump++; 1005 1115 #if POZNAN_NONLINEAR_DEPTH 1006 if(isDepth )1116 if(isDepth && m_bUseNonlinearDepth) 1007 1117 { 1008 1118 TComPicYuv *pcPicOrg = i->second; … … 1011 1121 pcPicPow->create( pcPicOrg->getWidth(), pcPicOrg->getHeight(), pcPicOrg->getMaxCuWidth(), pcPicOrg->getMaxCuHeight(), pcPicOrg->getMaxCuDepth() ); 1012 1122 //cPicPower.create(pcSPS->getWidth(), pcSPS->getHeight(), pcSPS->getMaxCUWidth(), pcSPS->getMaxCUHeight(), pcSPS->getMaxCUDepth() ); 1013 pcPicOrg->nonlinearDepthBackward(pcPicPow, m_ fDepthPower);1123 pcPicOrg->nonlinearDepthBackward(pcPicPow, m_cNonlinearDepthModel); 1014 1124 rpcTVideoIOYuvReconFile->write( pcPicPow, m_aiPad ); 1015 1125 // to do destroy pcPicow -
branches/0.3-poznan-univ/source/Lib/TLibCommon/CommonDef.h
r28 r41 144 144 #endif 145 145 146 #if POZNAN_NONLINEAR_DEPTH147 #define POZNAN_LUT_INCREASED_PRECISION 0 // 1 //to do148 #else149 #define POZNAN_LUT_INCREASED_PRECISION 0150 #endif151 152 146 //>>>>> generation and usage of virtual prediction depth maps >>>>> 153 147 #define PDM_ONE_DEPTH_PER_PU 1 // use only a single depth for a prediction unit (in update) … … 192 186 #endif 193 187 194 #if POZNAN_NONLINEAR_DEPTH195 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 #endif208 209 188 // ==================================================================================================================== 210 189 // Macro functions … … 218 197 #define RemoveBitIncrement(x) ( ((x) + ( (1 << g_uiBitIncrement) >> 1 )) >> g_uiBitIncrement ) ///< Remove Bit increment 219 198 220 #if POZNAN_LUT_INCREASED_PRECISION221 #define RemoveBitIncrementLUT(x) (x) ///< Remove Bit increment222 #define SizeOfLUT (256 << g_uiBitIncrement)223 #else224 199 #define SizeOfLUT 256 225 #define RemoveBitIncrementLUT(x) ( ((x) + ( (1 << g_uiBitIncrement) >> 1 )) >> g_uiBitIncrement ) ///< Remove Bit increment226 #endif227 200 228 201 #define DATA_ALIGN 1 ///< use 32-bit aligned malloc/free … … 665 638 666 639 640 #if POZNAN_NONLINEAR_DEPTH 641 struct TComNonlinearDepthModel // // OS: cannot be stdarray, due to memcpy done on SlicePilot 642 { 643 Int m_aiPoints[257]; 644 Int m_iNum; 645 646 Int m_aiX[257]; 647 Int m_aiY[257]; 648 649 Void Clear() { m_iNum=0; m_aiPoints[0]=0; m_aiPoints[1]=0; }; 650 Void Init() 651 { 652 for (Int k=m_iNum+1; k>=0; --k) 653 { 654 int q = 255*k/(m_iNum+1); 655 m_aiX[k] = q + m_aiPoints[k]; 656 m_aiY[k] = q - m_aiPoints[k]; 657 } 658 }; 659 660 Double xInterpolateD(Int *aiX,Int *aiY, Double x, Double dScale) 661 { 662 Int x1 = 0; 663 Int x2 = m_iNum+1; 664 665 for (;;) 666 { 667 if (x1+1>=x2) 668 return ((x-aiX[x1])*(aiY[x2]-aiY[x1])/(aiX[x2]-aiX[x1]) + aiY[x1])*dScale; 669 Int xm = (x1+x2)>>1; 670 if (x >= aiX[xm]) x1 = xm; 671 else x2 = xm; 672 } 673 } 674 675 inline Double ForwardD(Double x, Double dScale) { return xInterpolateD(m_aiX, m_aiY, x, dScale); } 676 inline Double BackwardD(Double x, Double dScale) { return xInterpolateD(m_aiY, m_aiX, x, dScale); } 677 678 Int64 xInterpolateI(Int *aiX,Int *aiY, Int x, Int64 iScale) 679 { 680 Int x1 = 0; 681 Int x2 = m_iNum+1; 682 683 for (;;) 684 { 685 if (x1+1>=x2) 686 { 687 Int aiXx2x1 = (aiX[x2]-aiX[x1]); 688 Int64 res = (x-aiX[x1])*(aiY[x2]-aiY[x1])*iScale; 689 if (res>0) return (res + (aiXx2x1>>1) )/aiXx2x1 + aiY[x1]*iScale; 690 else return (res - (aiXx2x1>>1) )/aiXx2x1 + aiY[x1]*iScale; 691 } 692 Int xm = (x1+x2)>>1; 693 if (x >= aiX[xm]) x1 = xm; 694 else x2 = xm; 695 } 696 } 697 698 inline Int64 ForwardI (Int x, Int64 iScale) { return xInterpolateI(m_aiX, m_aiY, x, iScale); } 699 inline Int64 BackwardI(Int x, Int64 iScale) { return xInterpolateI(m_aiY, m_aiX, x, iScale); } 700 701 }; 702 #endif 703 667 704 #endif // end of #ifndef __COMMONDEF__ 668 705 -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComDataCU.cpp
r30 r41 5004 5004 exit(333); 5005 5005 } 5006 Float fVal = (Float)((255 - (uiBlockMax >> g_uiBitIncrement)) >> 4);5006 Double fVal = (Double)((255 - (uiBlockMax >> g_uiBitIncrement)) >> 4); //Owieczka ?? ToDo Convert Double to Int 5007 5007 fVal = (fVal * fVal); 5008 5008 #if POZNAN_TEXTURE_TU_DELTA_QP_PARAM_IN_CFG_FOR_ENC 5009 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 decreased5010 fVal = ( Float)( fVal * getPic()->getTexDqpAccordingToDepthMul()); //5009 fVal = (Double)( 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 5010 fVal = (Double)( fVal * getPic()->getTexDqpAccordingToDepthMul()); // 5011 5011 #else 5012 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 decreased5013 fVal = ( Float)( fVal * POZNAN_TEXTURE_TU_DELTA_QP_MUL); //5012 fVal = (Double)( 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 5013 fVal = (Double)( fVal * POZNAN_TEXTURE_TU_DELTA_QP_MUL); // 5014 5014 #endif 5015 5015 return (Int)fVal >> 5; … … 5034 5034 UInt iCuAddr = getAddr(); 5035 5035 //TComPic * pcDepthPic = getPic()->getDepthPic(); 5036 #if FLEX_CODING_ORDER 5037 TComPicYuv * pcDepthPicYUV = NULL; 5038 // if depth map reconstruction picture is available use it Use synthesis picture otherwise. 5039 if(getPic()->getSlice(0)->getDepthPic() != NULL && getPic()->getSlice(0)->getDepthPic()->getReconMark()) 5040 { 5041 pcDepthPicYUV = getPic()->getSlice(0)->getDepthPic()->getPicYuvRec(); 5042 } 5043 else 5044 { 5045 pcDepthPicYUV = getPic()->getPicYuvSynthDepth(); 5046 } 5047 #else 5036 5048 TComPicYuv * pcDepthPicYUV = getPic()->getPicYuvSynthDepth(); 5049 #endif 5037 5050 if(pcDepthPicYUV /*pcDepthPic*/ == NULL) 5038 5051 { … … 5055 5068 } 5056 5069 #if POZNAN_NONLINEAR_DEPTH 5057 TComNonlinearDepthBackward cNonlinearDepthBwd(getSlice()->getSPS()->getDepthPower(), g_uiBitIncrement, g_uiBitIncrement);5058 uiDepthLumaTransformBlockMax = (Pel)( cNonlinearDepthBwd(uiDepthLumaTransformBlockMax) + 0.5);5070 if( getSlice()->getSPS()->getUseNonlinearDepth() ) 5071 uiDepthLumaTransformBlockMax = (Pel)( getSlice()->getSPS()->getNonlinearDepthModel().BackwardI(RemoveBitIncrement(uiDepthLumaTransformBlockMax), 1<<g_uiBitIncrement ) ) ; 5059 5072 #endif 5060 5073 Int iDeltaQP = CuQpIncrementFunction(uiDepthLumaTransformBlockMax); -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComMP.cpp
r28 r41 44 44 //m_pcCameraData = NULL; 45 45 m_aiBaseViewShiftLUT = NULL; 46 #if POZNAN_MP_USE_CURRENT_VIEW_DEPTH_MAP_IF_AVAILABLE 47 m_ppiTempMvPtCorrX = NULL; 48 m_ppiTempMvPtCorrY = NULL; 49 m_ppiTempMvPtCorrZ = NULL; 50 #endif 46 51 #endif 47 52 … … 96 101 #endif 97 102 98 /*99 m_ppiMvPtCorrX = new Short*[m_uiHeight];100 m_ppiMvPtCorrY = new Short*[m_uiHeight];101 m_ppiMvPtCorrZ = new Short*[m_uiHeight];102 m_ppiMvPtCorrRefViewIdx = new Short*[m_uiHeight];103 m_pppcRefCU = new TComDataCU**[m_uiHeight];104 m_ppuicRefPartAddr = new UShort*[m_uiHeight];105 for(Int i=0;i<m_uiHeight;i++)106 {107 m_ppiMvPtCorrX[i] = new Short[m_uiWidth];108 m_ppiMvPtCorrY[i] = new Short[m_uiWidth];109 m_ppiMvPtCorrZ[i] = new Short[m_uiWidth];110 m_ppiMvPtCorrRefViewIdx[i] = new Short[m_uiWidth];111 m_pppcRefCU[i] = new TComDataCU*[m_uiWidth];112 m_ppuicRefPartAddr[i] = new UShort[m_uiWidth];113 }114 //*/115 ///*116 103 Short* piPtr; 117 104 UShort* puiPtr; … … 141 128 puiPtr = (UShort*)malloc(sizeof(UShort)*m_uiHeight*m_uiWidth); 142 129 for(UInt i=0,addr=0;i<m_uiHeight;i++,addr+=m_uiWidth) m_ppuicRefPartAddr[i] = &(puiPtr[addr]); 143 //*/ 130 131 #if !POZNAN_MP_USE_DEPTH_MAP_GENERATION && POZNAN_MP_USE_CURRENT_VIEW_DEPTH_MAP_IF_AVAILABLE 132 m_ppiTempMvPtCorrX = (Short**)malloc(sizeof(Short*)*m_uiHeight); 133 piPtr = (Short*)malloc(sizeof(Short)*m_uiHeight*m_uiWidth); 134 for(UInt i=0,addr=0;i<m_uiHeight;i++,addr+=m_uiWidth) m_ppiTempMvPtCorrX[i] = &(piPtr[addr]); 135 136 m_ppiTempMvPtCorrY = (Short**)malloc(sizeof(Short*)*m_uiHeight); 137 piPtr = (Short*)malloc(sizeof(Short)*m_uiHeight*m_uiWidth); 138 for(UInt i=0,addr=0;i<m_uiHeight;i++,addr+=m_uiWidth) m_ppiTempMvPtCorrY[i] = &(piPtr[addr]); 139 140 m_ppiTempMvPtCorrZ = (Short**)malloc(sizeof(Short*)*m_uiHeight); 141 piPtr = (Short*)malloc(sizeof(Short)*m_uiHeight*m_uiWidth); 142 for(UInt i=0,addr=0;i<m_uiHeight;i++,addr+=m_uiWidth) m_ppiTempMvPtCorrZ[i] = &(piPtr[addr]); 143 #endif 144 144 145 #if POZNAN_DBMP & !POZNAN_DBMP_COMPRESS_ME_DATA 145 146 m_ppiL0RefPOC.clear(); … … 303 304 } 304 305 306 #if !POZNAN_MP_USE_DEPTH_MAP_GENERATION && POZNAN_MP_USE_CURRENT_VIEW_DEPTH_MAP_IF_AVAILABLE 307 if(m_ppiTempMvPtCorrX!=NULL) 308 { 309 //for(Int i=0;i<m_uiHeight;i++) delete [] m_ppiTempMvPtCorrX[i]; 310 //delete [] m_ppiTempMvPtCorrX; 311 free(m_ppiTempMvPtCorrX[0]); 312 free(m_ppiTempMvPtCorrX); 313 m_ppiTempMvPtCorrX = NULL; 314 } 315 316 if(m_ppiTempMvPtCorrY!=NULL) 317 { 318 //for(Int i=0;i<m_uiHeight;i++) delete [] m_ppiTempMvPtCorrY[i]; 319 //delete [] m_ppiTempMvPtCorrY; 320 free(m_ppiTempMvPtCorrY[0]); 321 free(m_ppiTempMvPtCorrY); 322 m_ppiTempMvPtCorrY = NULL; 323 } 324 325 if(m_ppiTempMvPtCorrZ!=NULL) 326 { 327 //for(Int i=0;i<m_uiHeight;i++) delete [] m_ppiTempMvPtCorrZ[i]; 328 //delete [] m_ppiTempMvPtCorrZ; 329 free(m_ppiTempMvPtCorrZ[0]); 330 free(m_ppiTempMvPtCorrZ); 331 m_ppiTempMvPtCorrZ = NULL; 332 } 333 334 #endif 335 305 336 #if POZNAN_DBMP & !POZNAN_DBMP_COMPRESS_ME_DATA 306 337 PUT_MP_ARRAY_TYPE** ppiTemp; … … 439 470 } 440 471 472 #if !POZNAN_MP_USE_DEPTH_MAP_GENERATION && POZNAN_MP_USE_CURRENT_VIEW_DEPTH_MAP_IF_AVAILABLE 473 Void TComMP::clearTemp() 474 { 475 if(!isInit()) return; 476 477 for(Int i=0;i<m_uiHeight;i++) 478 for(Int j=0;j<m_uiWidth;j++) 479 { 480 m_ppiTempMvPtCorrX[i][j] = TComMP::OCCLUSION; 481 m_ppiTempMvPtCorrY[i][j] = TComMP::OCCLUSION; 482 //m_ppiTempMvPtCorrZ[i][j] = 0x7FFF; //Depth 483 m_ppiTempMvPtCorrZ[i][j] = TComMP::OCCLUSION; //Disparity 484 } 485 } 486 #endif 487 441 488 Bool TComMP::isInit() 442 489 { … … 498 545 //Bool bIsLeft; 499 546 Int iDepth; 547 #if POZNAN_MP_USE_CURRENT_VIEW_DEPTH_MAP_IF_AVAILABLE 548 Int iSrcX, iSrcY; 549 #endif 500 550 #endif 501 551 … … 547 597 } 548 598 #else 599 600 #if POZNAN_MP_USE_CURRENT_VIEW_DEPTH_MAP_IF_AVAILABLE 601 //pcDepthPic = GetPicFromList(m_pcDepthRefPicsList, uiPOC, uiViewId); 602 if(pcPic->getSlice(0)->getDepthPic()!=NULL && pcPic->getSlice(0)->getDepthPic()->getReconMark()) 603 pcDepthPic = pcPic->getSlice(0)->getDepthPic(); 604 else 605 pcDepthPic = NULL; 606 607 if(pcDepthPic!=NULL) 608 { 609 pDepth = pcDepthPic->getPicYuvRec()->getLumaAddr(); 610 iStride = pcDepthPic->getPicYuvRec()->getStride(); 611 612 for( UInt uiIdx = 0; uiIdx < uiViewId; uiIdx++ ) 613 //for( UInt uiIdx = uiViewId-1; uiIdx >= uiViewId; uiIdx-- ) 614 { 615 uiRefViewId = uiIdx; 616 617 pcRefPic = GetPicFromList(m_pcRefPicsList, uiPOC, uiRefViewId); 618 assert(pcRefPic!=NULL);//test 619 if(pcRefPic==NULL) return false; //No ref pic with current POC and RefView found in ref list!!! 620 621 if(!pcRefPic->getSlice(0)->isIntra()) bIsRefNoISliceAvailable = true; 622 else bIsAnchorPicture = true; 623 624 //ppiShiftLUTLeft = m_pcCameraData->getBaseViewShiftLUTI()[uiViewId][uiRefViewId]; 625 ppiShiftLUTLeft = m_aiBaseViewShiftLUT[uiViewId][uiRefViewId]; 626 627 clearTemp(); 628 629 for(iCurY=0; iCurY<(Int)m_uiHeight; iCurY++) 630 for(iCurX=0; iCurX<(Int)m_uiWidth; iCurX++) 631 { 632 //Check if point already has its reference: 633 if(m_ppiMvPtCorrX[iCurY][iCurX]!=TComMP::OCCLUSION && m_ppiMvPtCorrY[iCurY][iCurX]!=TComMP::OCCLUSION) continue; 634 635 iDepth = pDepth[ iCurX + iCurY * iStride ]; 636 iDepth = RemoveBitIncrement(iDepth); 637 assert( iDepth >= 0 && iDepth <= 256 ); 638 639 //if(bIsLeft) iDisparity = ppiShiftLUTLeft[0][iDepth]; 640 //else iDisparity = -ppiShiftLUTLeft[0][iDepth]; 641 iDisparity = ppiShiftLUTLeft[0][iDepth]; //!!! 642 643 iRefX = iCurX - ( ( iDisparity + 2 ) >> 2 ); 644 iRefY = iCurY; 645 646 if(iRefX>=0 && iRefX<m_uiWidth && iRefY>=0 && iRefY<m_uiHeight) 647 { 648 iSrcX = m_ppiTempMvPtCorrX[iRefY][iRefX]; 649 iSrcY = m_ppiTempMvPtCorrY[iRefY][iRefX]; 650 651 if(iSrcX==TComMP::OCCLUSION || iSrcY==TComMP::OCCLUSION) 652 { 653 m_ppiMvPtCorrRefViewIdx[iCurY][iCurX] = (Short)uiRefViewId; 654 m_ppiMvPtCorrX[iCurY][iCurX] = (Short)iRefX; 655 m_ppiMvPtCorrY[iCurY][iCurX] = (Short)iRefY; 656 657 m_ppiMvPtCorrZ[iCurY][iCurX] = (Short)iDepth; 658 //m_ppiMvPtCorrZ[iCurY][iCurX] = (Short)iDisparity; 659 660 pcRefCU = pcRefPic->getCU((UInt)(iRefY/pcRefPic->getSlice(0)->getSPS()->getMaxCUHeight()*pcRefPic->getFrameWidthInCU() + iRefX/pcRefPic->getSlice(0)->getSPS()->getMaxCUWidth())); 661 662 m_pppcRefCU[iCurY][iCurX] = pcRefCU; 663 m_ppuicRefPartAddr[iCurY][iCurX] = (UShort)g_auiRasterToZscan[(iRefY-pcRefCU->getCUPelY())/pcRefPic->getMinCUHeight()*pcRefPic->getNumPartInWidth()+(iRefX-pcRefCU->getCUPelX())/pcRefPic->getMinCUWidth()]; 664 665 m_ppiTempMvPtCorrX[iRefY][iRefX] = iCurX; 666 m_ppiTempMvPtCorrY[iRefY][iRefX] = iCurY; 667 m_ppiTempMvPtCorrZ[iRefY][iRefX] = (Short)iDepth; 668 //m_ppiTempMvPtCorrZ[iRefY][iRefX] = (Short)iDisparity; 669 } 670 else if((Short)iDepth>m_ppiTempMvPtCorrZ[iRefY][iRefX]) //Point assigned earlier to this location is occluded 671 //else if((Short)iDisparity>m_ppiTempMvPtCorrZ[iRefY][iRefX]) //Point assigned earlier to this location is occluded 672 { 673 m_ppiMvPtCorrRefViewIdx[iCurY][iCurX] = (Short)uiRefViewId; 674 m_ppiMvPtCorrX[iCurY][iCurX] = (Short)iRefX; 675 m_ppiMvPtCorrY[iCurY][iCurX] = (Short)iRefY; 676 677 m_ppiMvPtCorrZ[iCurY][iCurX] = (Short)iDepth; 678 //m_ppiMvPtCorrZ[iCurY][iCurX] = (Short)iDisparity; 679 680 pcRefCU = pcRefPic->getCU((UInt)(iRefY/pcRefPic->getSlice(0)->getSPS()->getMaxCUHeight()*pcRefPic->getFrameWidthInCU() + iRefX/pcRefPic->getSlice(0)->getSPS()->getMaxCUWidth())); 681 682 m_pppcRefCU[iCurY][iCurX] = pcRefCU; 683 m_ppuicRefPartAddr[iCurY][iCurX] = (UShort)g_auiRasterToZscan[(iRefY-pcRefCU->getCUPelY())/pcRefPic->getMinCUHeight()*pcRefPic->getNumPartInWidth()+(iRefX-pcRefCU->getCUPelX())/pcRefPic->getMinCUWidth()]; 684 685 m_ppiTempMvPtCorrX[iRefY][iRefX] = iCurX; 686 m_ppiTempMvPtCorrY[iRefY][iRefX] = iCurY; 687 m_ppiTempMvPtCorrZ[iRefY][iRefX] = (Short)iDepth; 688 //m_ppiTempMvPtCorrZ[iRefY][iRefX] = (Short)iDisparity; 689 690 //Mark point assigned earlier to this location as occluded: 691 m_ppiMvPtCorrRefViewIdx[iSrcY][iSrcX] = TComMP::OCCLUSION; 692 m_ppiMvPtCorrX[iSrcY][iSrcX] = TComMP::OCCLUSION; 693 m_ppiMvPtCorrY[iSrcY][iSrcX] = TComMP::OCCLUSION; 694 695 //m_ppiMvPtCorrZ[iSrcY][iSrcX] = 0x7FFF; 696 m_ppiMvPtCorrZ[iSrcY][iSrcX] = TComMP::OCCLUSION; 697 698 m_pppcRefCU[iSrcY][iSrcX] = NULL; 699 m_ppuicRefPartAddr[iSrcY][iSrcX] = 0; 700 } 701 } 702 } 703 } 704 } 705 else 706 #endif 707 { 549 708 iSynthViewIdx = uiViewId; 550 709 … … 605 764 } 606 765 } 766 } 607 767 #endif 608 768 -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComMP.h
r28 r41 69 69 Short** m_ppiMvPtCorrZ; 70 70 Short** m_ppiMvPtCorrRefViewIdx; 71 72 #if !POZNAN_MP_USE_DEPTH_MAP_GENERATION && POZNAN_MP_USE_CURRENT_VIEW_DEPTH_MAP_IF_AVAILABLE 73 Short** m_ppiTempMvPtCorrX; 74 Short** m_ppiTempMvPtCorrY; 75 Short** m_ppiTempMvPtCorrZ; 76 #endif 71 77 72 78 TComDataCU*** m_pppcRefCU; //XY array of pointers to reference CU for each point of picture … … 117 123 //Void init(UInt uiHeight, UInt uiWidth, TAppComCamPara* pcCameraData); 118 124 Void init(UInt uiHeight, UInt uiWidth, Int**** aiBaseViewShiftLUT); 125 #if POZNAN_MP_USE_CURRENT_VIEW_DEPTH_MAP_IF_AVAILABLE 126 Void clearTemp(); 127 #endif 119 128 #endif 120 129 Void uninit(); -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComPicYuv.cpp
r28 r41 457 457 } 458 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); 459 Void TComPicYuv::nonlinearDepthForward(TComPicYuv *pcPicDst, TComNonlinearDepthModel &rcNonlinearDepthModel) 460 { 461 Int x,y,i; 462 Int LUT[256]; 463 464 for (i=0; i<256; ++i) 465 LUT[i] = (Int)rcNonlinearDepthModel.ForwardI(i, 1<<g_uiBitIncrement); 463 466 464 467 // Luma … … 469 472 for(x=0; x<m_iPicWidth; x++) 470 473 { 471 pPelDst[x] = (Pel)( cNonlinearDepthFwd(pPelSrc[x]) + 0.5);474 pPelDst[x] = LUT[RemoveBitIncrement(pPelSrc[x])]; 472 475 } 473 476 pPelDst += pcPicDst->getStride(); … … 478 481 copyToPicCr(pcPicDst); 479 482 } 480 Void TComPicYuv::nonlinearDepthBackward(TComPicYuv *pcPicDst, Float p) 481 { 482 Int x,y; 483 TComNonlinearDepthBackward cNonlinearDepthBwd(p, g_uiBitIncrement, g_uiBitIncrement); 483 484 Void TComPicYuv::nonlinearDepthBackward(TComPicYuv *pcPicDst, TComNonlinearDepthModel &rcNonlinearDepthModel) 485 { 486 Int x,y,i; 487 Int LUT[256]; 488 489 for (i=255; i>=0; --i) 490 LUT[i] = (Int)rcNonlinearDepthModel.BackwardI(i, 1<<g_uiBitIncrement ); // +0.5; 484 491 485 492 // Luma … … 490 497 for(x=0; x<m_iPicWidth; x++) 491 498 { 492 pPelDst[x] = (Pel)( cNonlinearDepthBwd(pPelSrc[x]) + 0.5);499 pPelDst[x] = LUT[RemoveBitIncrement(pPelSrc[x])]; 493 500 } 494 501 pPelDst += pcPicDst->getStride(); -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComPicYuv.h
r28 r41 44 44 #include "CommonDef.h" 45 45 46 #if POZNAN_NONLINEAR_DEPTH47 48 #include <math.h>49 50 class TComNonlinearDepthForward // OLGIERD - Z-NL-Power conversion51 {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 conversion74 {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 #endif96 46 // ==================================================================================================================== 97 47 // Class definition … … 226 176 227 177 #if POZNAN_NONLINEAR_DEPTH 228 Void nonlinearDepthForward(TComPicYuv *pcPicDst, Float p);229 Void nonlinearDepthBackward(TComPicYuv *pcPicDst, Float p);178 Void nonlinearDepthForward(TComPicYuv *pcPicDst, TComNonlinearDepthModel &rcNonlinearDepthModel); 179 Void nonlinearDepthBackward(TComPicYuv *pcPicDst, TComNonlinearDepthModel &rcNonlinearDepthModel); 230 180 #endif 231 181 };// END CLASS DEFINITION TComPicYuv -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComPrediction.cpp
r28 r41 1639 1639 TComMv mv0_2nd,mv1_2nd; 1640 1640 1641 #if DEPTH_MAP_GENERATION 1642 Int ref_frame0_idx_1st, ref_frame1_idx_1st; 1643 TComMv mv0_1st,mv1_1st; 1644 #endif 1645 1641 1646 Pel* piDstCb; 1642 1647 Pel* piDstCr; … … 1684 1689 iWidth >>= uiSubSampExpX; 1685 1690 iHeight >>= uiSubSampExpY; 1691 1692 //save orginal motion field of CU (it will be overwritten during the motion compensation) 1693 ref_frame0_idx_1st = pcCU->getCUMvField(REF_PIC_LIST_0)->getRefIdx(uiPartAddr); 1694 mv0_1st = pcCU->getCUMvField( REF_PIC_LIST_0 )->getMv( uiPartAddr ); 1695 1696 ref_frame1_idx_1st = pcCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx(uiPartAddr); 1697 mv1_1st = pcCU->getCUMvField( REF_PIC_LIST_1 )->getMv( uiPartAddr ); 1686 1698 } 1687 1699 #endif … … 1804 1816 1805 1817 //set motion data representing CU with DBMP 1818 PartSize ePartSize = pcCU->getPartitionSize( uiPartAddr ); //PartSize ePartSize = pcCU->getPartitionSize( 0 ); 1806 1819 #if DEPTH_MAP_GENERATION 1807 1820 if( !bPrdDepthMap ) 1808 1821 #endif 1809 1822 { 1810 PartSize ePartSize = pcCU->getPartitionSize( uiPartAddr ); //PartSize ePartSize = pcCU->getPartitionSize( 0 );1811 1823 #if POZNAN_DBMP_CALC_PRED_DATA 1812 1824 pcMP->xCalcDBMPPredData(uiPointCnt, ref_frame0_idx, mv0, ref_frame1_idx, mv1); … … 1819 1831 #endif 1820 1832 } 1833 1834 #if DEPTH_MAP_GENERATION 1835 if( bPrdDepthMap ) 1836 { 1837 pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( mv0_1st, ref_frame0_idx_1st, ePartSize, uiPartAddr, iPartIdx, 0 ); 1838 pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( mv1_1st, ref_frame1_idx_1st, ePartSize, uiPartAddr, iPartIdx, 0 ); 1839 } 1840 #endif 1821 1841 1822 1842 if ( iPartIdxOrg >= 0 ) break; -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComSlice.cpp
r28 r41 85 85 ::memset( m_aaiCodedOffset, 0x00, sizeof( m_aaiCodedOffset ) ); 86 86 m_pcTexturePic = NULL; 87 m_pcDepthPic = NULL; 87 88 #ifdef WEIGHT_PRED 88 89 resetWpScaling(m_weightPredTable); … … 113 114 ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx )); 114 115 m_pcTexturePic = NULL; 116 m_pcDepthPic = NULL; 115 117 116 118 initEqualRef(); … … 703 705 m_bUseDMM = false; 704 706 #endif 707 #if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER 708 m_bUseDMM34 = false; 709 #endif 705 710 } 706 711 … … 747 752 } 748 753 #if POZNAN_NONLINEAR_DEPTH 749 m_ fDepthPower = 1.0;754 m_cNonlinearDepthModel.Clear(); 750 755 #endif 751 756 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH … … 768 773 ::memset( m_aaiCodedOffset, 0x00, sizeof( m_aaiCodedOffset ) ); 769 774 #if POZNAN_NONLINEAR_DEPTH 770 m_ fDepthPower = 1.0;775 m_cNonlinearDepthModel.Clear(); 771 776 #endif 772 777 } -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TComSlice.h
r28 r41 139 139 Bool m_bUseDMM; 140 140 #endif 141 #if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER 142 Bool m_bUseDMM34; 143 #endif 141 144 142 145 #if DEPTH_MAP_GENERATION … … 169 172 170 173 #if POZNAN_NONLINEAR_DEPTH 171 Float m_fDepthPower; 174 TComNonlinearDepthModel m_cNonlinearDepthModel; 175 Bool m_bUseNonlinearDepth; 172 176 #endif 173 177 … … 258 262 Void setUseDMM( Bool b ) { m_bUseDMM = b; } 259 263 #endif 260 264 #if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER 265 Bool getUseDMM34() { return m_bUseDMM34; } 266 Void setUseDMM34( Bool b ) { m_bUseDMM34 = b; } 267 #endif 261 268 262 269 #if DCM_COMB_LIST … … 295 302 Void setUseSAO (Bool bVal) {m_bUseSAO = bVal;} 296 303 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU //todo fix SAO 297 Bool getUseSAO () { return (getViewId()>0)?false:m_bUseSAO;}304 Bool getUseSAO () { return (getUseCUSkip() && getViewId()>0)?false:m_bUseSAO;} 298 305 #else 299 306 Bool getUseSAO () {return m_bUseSAO;} … … 354 361 #endif 355 362 #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;}363 inline Void setNonlinearDepthModel( TComNonlinearDepthModel &rp ){ m_cNonlinearDepthModel = rp; } 364 inline TComNonlinearDepthModel& getNonlinearDepthModel() { return m_cNonlinearDepthModel; } 365 Bool getUseNonlinearDepth() { return m_bUseNonlinearDepth; } 366 Void setUseNonlinearDepth( Bool bVal ) { m_bUseNonlinearDepth = bVal; } 360 367 #endif 361 368 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH … … 459 466 Int m_iDepth; 460 467 TComPic* m_pcTexturePic; 468 TComPic* m_pcDepthPic; 461 469 462 470 // referenced slice? … … 664 672 665 673 Void setTexturePic( TComPic *pcTexturePic ) { m_pcTexturePic = pcTexturePic; } 674 Void setDepthPic ( TComPic *pcDepthPic ) { m_pcDepthPic = pcDepthPic; } 666 675 TComPic *getTexturePic() const { return m_pcTexturePic; } 676 TComPic *getDepthPic() const { return m_pcDepthPic; } 667 677 668 678 #ifdef WEIGHT_PRED -
branches/0.3-poznan-univ/source/Lib/TLibCommon/TypeDef.h
r28 r41 40 40 41 41 42 43 #define SONY_COLPIC_AVAILABILITY 1 42 #define FLEX_CODING_ORDER 1 43 44 #define SONY_COLPIC_AVAILABILITY 1 44 45 45 46 //>>>>> HHI 3DV tools >>>>> … … 83 84 #define POZNAN_CU_SKIP_PSNR 1 //Poznan Cu Skip Display psnr of the codded CUs only 84 85 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 float86 #define POZNAN_NONLINEAR_DEPTH 1 /// Non-linear depth processing 87 #define POZNAN_NONLINEAR_DEPTH_THRESHOLD 1 /// Non-linear depth thrasholding 87 88 88 89 #if POZNAN_SYNTH … … 106 107 // POZNAN_MP_USE_DEPTH_MAP_GENERATION=1 - use DEPTH_MAP_GENERATION, 107 108 // POZNAN_MP_USE_DEPTH_MAP_GENERATION=0 - use reconstructed depth maps from neighboring views 109 110 #if !POZNAN_MP_USE_DEPTH_MAP_GENERATION 111 #define POZNAN_MP_USE_CURRENT_VIEW_DEPTH_MAP_IF_AVAILABLE 1 // Depth-Based Multiview Prediction of CU parameters will use depth picture of current view if this picture is available, otherwise reference view depth is utilized 112 #endif 108 113 109 114 #define POZNAN_MP_FILL 1 // Depth-Based Multiview Prediction of CU parameters with fill option for occluded areas … … 407 412 typedef unsigned long ULong; 408 413 typedef double Double; 409 typedef float Float;410 414 411 415 // ==================================================================================================================== -
branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecCAVLC.cpp
r28 r41 238 238 #endif 239 239 #if POZNAN_DBMP 240 xReadFlag( uiCode ); 241 pcSPS->setDBMP ( uiCode ); 240 xReadFlag( uiCode ); pcSPS->setDBMP ( uiCode ); 242 241 #endif 243 242 #if POZNAN_ENCODE_ONLY_DISOCCLUDED_CU 244 xReadFlag( uiCode ); 245 pcSPS->setUseCUSkip ( uiCode ); 243 xReadFlag( uiCode ); pcSPS->setUseCUSkip ( uiCode ); 246 244 #endif 247 245 xReadFlag( uiCode ); // SPS base view flag … … 279 277 #endif 280 278 #if POZNAN_NONLINEAR_DEPTH 281 #if POZNAN_NONLINEAR_DEPTH_SEND_AS_BYTE 282 uiCode = 0; 283 xReadCode(8, uiCode); 284 pcSPS->setDepthPower(dequantizeDepthPower(uiCode)); 285 #else 286 uiCode = 0; 287 xReadCode(sizeof(float)*8, uiCode); // We do not send seign 288 //uiCode &= ~0x80000000; 289 pcSPS->setDepthPower(*((float*)&uiCode)); 290 #endif 291 printf("\nfDepthPower = %f", pcSPS->getDepthPower()); 279 xReadFlag( uiCode ); 280 pcSPS->setUseNonlinearDepth( uiCode ? true : false ); 281 pcSPS->getNonlinearDepthModel().Clear(); 282 if( uiCode ) 283 { 284 uiCode = 0; //Owieczka Necessary?? 285 xReadUvlc( uiCode ); 286 int num = pcSPS->getNonlinearDepthModel().m_iNum = uiCode; 287 for (int i=1; i<=num; ++i) 288 { 289 uiCode = 0; 290 xReadUvlc( uiCode ); 291 pcSPS->getNonlinearDepthModel().m_aiPoints[i] = uiCode; 292 } 293 pcSPS->getNonlinearDepthModel().m_aiPoints[0] = 0; 294 pcSPS->getNonlinearDepthModel().m_aiPoints[num+1] = 0; 295 pcSPS->getNonlinearDepthModel().Init(); 296 } 292 297 #endif 293 298 } -
branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecTop.cpp
r28 r41 90 90 m_uiMaxViewId = 0; 91 91 #if POZNAN_NONLINEAR_DEPTH 92 m_fDepthPower = 1.0; 92 m_cNonlinearDepthModel.Clear(); 93 m_bUseNonlinearDepth = false; 93 94 #endif 94 95 } … … 140 141 Int64 iOffsetChroma = iOffset + ( ( 1 << iLog2DivChroma ) >> 1 ); 141 142 143 144 for( UInt uiDepthValue = 0; uiDepthValue < 256; uiDepthValue++ ) 145 { 146 147 // real-valued look-up tables 142 148 #if POZNAN_NONLINEAR_DEPTH 143 TComNonlinearDepthBackward cNonlinearDepthBwd(m_fDepthPower, (POZNAN_LUT_INCREASED_PRECISION) ? g_uiBitIncrement : 0, (POZNAN_LUT_INCREASED_PRECISION) ? g_uiBitIncrement : 0); 144 #endif 145 146 for( UInt uiDepthValue = 0; uiDepthValue < 256; uiDepthValue++ ) 147 { 148 Double dDepthValue = (Double)uiDepthValue; 149 Int64 iDepthValue = (Int64)uiDepthValue; 150 #if POZNAN_NONLINEAR_DEPTH 151 dDepthValue = cNonlinearDepthBwd(dDepthValue); 152 iDepthValue = (Int64)(dDepthValue+0.5); 153 #endif 154 #if POZNAN_LUT_INCREASED_PRECISION 155 dDepthValue /= (1<<g_uiBitIncrement); 156 #endif 157 158 // real-valued look-up tables 159 Double dShiftLuma = ( dDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision ); 149 Double dShiftLuma; 150 if( m_bUseNonlinearDepth ) 151 dShiftLuma = ( m_cNonlinearDepthModel.BackwardD( (Double)uiDepthValue, dScale) + dOffset ) * Double( 1 << m_iLog2Precision ); 152 else 153 dShiftLuma = ( (Double)uiDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision ); 154 #else 155 Double dShiftLuma = ( (Double)uiDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision ); 156 #endif 160 157 Double dShiftChroma = dShiftLuma / 2; 161 158 radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = dShiftLuma; … … 163 160 164 161 // integer-valued look-up tables 165 Int64 iTempScale = iDepthValue * iScale; 166 #if POZNAN_LUT_INCREASED_PRECISION 167 iTempScale >>= g_uiBitIncrement; 162 #if POZNAN_NONLINEAR_DEPTH 163 Int64 iTempScale; 164 if( m_bUseNonlinearDepth ) 165 iTempScale = (Int64)m_cNonlinearDepthModel.BackwardI(uiDepthValue, iScale); 166 else 167 iTempScale = (Int64)uiDepthValue * iScale; 168 #else 169 Int64 iTempScale = (Int64)uiDepthValue * iScale; 168 170 #endif 169 171 Int64 iTestScale = ( iTempScale + iOffset ); // for checking accuracy of camera parameters … … 233 235 { 234 236 #if POZNAN_NONLINEAR_DEPTH 235 m_fDepthPower = pcSlice->getSPS()->getDepthPower(); 237 m_bUseNonlinearDepth = pcSlice->getSPS()->getUseNonlinearDepth(); 238 m_cNonlinearDepthModel = pcSlice->getSPS()->getNonlinearDepthModel(); 236 239 #endif 237 240 return; … … 240 243 { 241 244 #if POZNAN_NONLINEAR_DEPTH 242 pcSlice->getSPS()->setDepthPower(m_fDepthPower); // OLGIERD: ToDo - QP-Tex should not use getDepthPower() from texture SPS. 245 pcSlice->getSPS()->setUseNonlinearDepth(m_bUseNonlinearDepth); 246 pcSlice->getSPS()->setNonlinearDepthModel(m_cNonlinearDepthModel); // OLGIERD: ToDo - QP-Tex should not use getDepthPower() from texture SPS. 243 247 #endif 244 248 } … … 684 688 685 689 #if DCM_SKIP_DECODING_FRAMES 690 #if FLEX_CODING_ORDER 691 Bool TDecTop::decode (Bool bEos, TComBitstream* pcBitstream, UInt& ruiPOC, TComList<TComPic*>*& rpcListPic, NalUnitType& reNalUnitType, TComSPS& cComSPS, Int& iSkipFrame, Int& iPOCLastDisplay, Bool& bNewPictureType) 692 #else 686 693 Bool TDecTop::decode (Bool bEos, TComBitstream* pcBitstream, UInt& ruiPOC, TComList<TComPic*>*& rpcListPic, NalUnitType& reNalUnitType, TComSPS& cComSPS, Int& iSkipFrame, Int& iPOCLastDisplay) 694 #endif 687 695 #else 688 696 Void TDecTop::decode (Bool bEos, TComBitstream* pcBitstream, UInt& ruiPOC, TComList<TComPic*>*& rpcListPic, NalUnitType& reNalUnitType, TComSPS& cComSPS ) … … 712 720 TComSPS cTempSPS; 713 721 m_cEntropyDecoder.decodeSPS( &cTempSPS ); 722 #if FLEX_CODING_ORDER 723 m_cNewSPS = cTempSPS; 724 #endif 714 725 715 726 if( (m_iViewIdx == cTempSPS.getViewId()) && ( m_bIsDepth == cTempSPS.isDepth() ) ) … … 724 735 if(!cTempSPS.isDepth() && cTempSPS.getViewId()) 725 736 { 726 Float fDepthPower = getDecTop()->getPicFromView( 0, pcPic->getPOC(), true )->getSPS()->getDepthPower();727 cTempSPS.set DepthPower(fDepthPower);737 cTempSPS.setUseNonlinearDepth(getDecTop()->getPicFromView( 0, pcPic->getPOC(), true )->getSPS()->getUseNonlinearDepth()); 738 cTempSPS.setNonlinearDepthModel(getDecTop()->getPicFromView( 0, pcPic->getPOC(), true )->getSPS()->getNonlinearDepthModel()); 728 739 } 729 740 #endif … … 802 813 { 803 814 m_uiPrevPOC = m_apcSlicePilot->getPOC(); 815 #if FLEX_CODING_ORDER 816 bNewPictureType = m_cNewSPS.isDepth(); 817 #endif 804 818 return true; 805 819 } … … 887 901 // Set reference list 888 902 std::vector<TComPic*> apcSpatRefPics = getDecTop()->getSpatialRefPics( pcPic->getViewIdx(), pcSlice->getPOC(), m_cSPS.isDepth() ); 889 TComPic * const pcTexturePic = m_cSPS.isDepth() ? getDecTop()->getPicFromView( pcPic->getViewIdx(), pcSlice->getPOC(), false ) : NULL; 903 TComPic * const pcTexturePic = ( m_cSPS.isDepth()) ? getDecTop()->getPicFromView( pcPic->getViewIdx(), pcSlice->getPOC(), false ) : NULL; 904 TComPic * const pcDepthPic = (!m_cSPS.isDepth()) ? getDecTop()->getPicFromView( pcPic->getViewIdx(), pcSlice->getPOC(), true ) : NULL; 905 #if FLEX_CODING_ORDER 906 if (pcTexturePic != NULL) 907 { 908 assert( ! m_cSPS.isDepth() || pcTexturePic != NULL ); 909 pcSlice->setTexturePic( pcTexturePic ); 910 } 911 if (pcDepthPic != NULL) 912 { 913 assert( m_cSPS.isDepth() || pcDepthPic != NULL ); 914 pcSlice->setDepthPic( pcDepthPic ); 915 } 916 #else 890 917 assert( ! m_cSPS.isDepth() || pcTexturePic != NULL ); 891 918 pcSlice->setTexturePic( pcTexturePic ); 919 pcSlice->setDepthPic( pcDepthPic ); 892 920 pcSlice->setViewIdx( pcPic->getViewIdx() ); 921 #endif 893 922 #if SONY_COLPIC_AVAILABILITY 894 923 pcSlice->setViewOrderIdx( pcPic->getViewOrderIdx() ); … … 949 978 //* 950 979 #if POZNAN_TEXTURE_TU_DELTA_QP_ACCORDING_TO_DEPTH 980 #if FLEX_CODING_ORDER 981 Bool bHaveReconDepth = (pcSlice->getDepthPic() != NULL) && (pcSlice->getDepthPic()->getReconMark()); 982 if(!getIsDepth() && pcSlice->getSPS()->getUseTexDqpAccordingToDepth() && !bHaveReconDepth ) 983 #else 951 984 if(!getIsDepth() && pcSlice->getSPS()->getUseTexDqpAccordingToDepth()) 985 #endif 952 986 { 953 987 getDecTop()->storeDepthSynthPicsInBuffer(pcSlice->getViewIdx(),pcSlice->getSPS()->getViewOrderIdx(),pcSlice->getPOC()); -
branches/0.3-poznan-univ/source/Lib/TLibDecoder/TDecTop.h
r28 r41 121 121 #endif 122 122 #if POZNAN_NONLINEAR_DEPTH 123 Float m_fDepthPower; 123 TComNonlinearDepthModel m_cNonlinearDepthModel; 124 Bool m_bUseNonlinearDepth; 124 125 #endif 125 126 … … 205 206 TComList<TComPic*> m_cListPic; // Dynamic buffer 206 207 TComSPS m_cSPS; 208 #if FLEX_CODING_ORDER 209 TComSPS m_cNewSPS; 210 #endif 207 211 TComPPS m_cPPS; 208 212 TComSlice* m_apcSlicePilot; … … 265 269 Void init( TAppDecTop* pcTAppDecTop, Bool bFirstInstance = true ); 266 270 #if DCM_SKIP_DECODING_FRAMES 271 #if FLEX_CODING_ORDER 272 Bool decode (Bool bEos, TComBitstream* pcBitstream, UInt& ruiPOC, TComList<TComPic*>*& rpcListPic, NalUnitType& reNalUnitType, TComSPS& cComSPS, Int& iSkipFrame, Int& iPOCLastDisplay, Bool& bNewPictureType); 273 #else 267 274 Bool decode (Bool bEos, TComBitstream* pcBitstream, UInt& ruiPOC, TComList<TComPic*>*& rpcListPic, NalUnitType& reNalUnitType, TComSPS& cComSPS, Int& iSkipFrame, Int& iPOCLastDisplay); 275 #endif 268 276 #else 269 277 Void decode ( Bool bEos, TComBitstream* pcBitstream, UInt& ruiPOC, TComList<TComPic*>*& rpcListPic, NalUnitType& reNalUnitType, TComSPS& cComSPS ); -
branches/0.3-poznan-univ/source/Lib/TLibEncoder/TEncCavlc.cpp
r28 r41 348 348 #endif 349 349 #if POZNAN_NONLINEAR_DEPTH 350 // Depth power coefficient 351 #if POZNAN_NONLINEAR_DEPTH_SEND_AS_BYTE 352 UInt uiCode = quantizeDepthPower(pcSPS->getDepthPower()); 353 xWriteCode(uiCode, 8); 354 #else 355 float fCode = pcSPS->getDepthPower(); 356 UInt uiCode = *((UInt*)&fCode); 357 //uiCode &= ~0x80000000; 358 xWriteCode(uiCode, sizeof(float)*8); // we do not send sign?; 359 #endif 350 if( pcSPS->getUseNonlinearDepth() ) 351 { 352 xWriteFlag( 1 ); //Nonlinear Depth Representation 353 // Nonlinear Depth Model coefficient 354 xWriteUvlc(pcSPS->getNonlinearDepthModel().m_iNum); 355 for (int i=1; i<=pcSPS->getNonlinearDepthModel().m_iNum; ++i) 356 xWriteUvlc(pcSPS->getNonlinearDepthModel().m_aiPoints[i]); 357 } 358 else 359 { 360 xWriteFlag( 0 ); // Don't use Nonlinear Depth Representation 361 } 360 362 #endif 361 363 } -
branches/0.3-poznan-univ/source/Lib/TLibEncoder/TEncCfg.h
r28 r41 159 159 Bool m_bUseDMM; 160 160 #endif 161 #if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER 162 Bool m_bUseDMM34; 163 #endif 161 164 #if HHI_MPI 162 165 Bool m_bUseMVI; … … 232 235 #endif 233 236 #if POZNAN_NONLINEAR_DEPTH 234 Float m_fDepthPower; 237 TComNonlinearDepthModel m_cNonlinearDepthModel; 238 Bool m_bUseNonlinearDepth; 235 239 #endif 236 240 … … 335 339 336 340 #if POZNAN_NONLINEAR_DEPTH 337 inline Float getDepthPower() { return m_fDepthPower; } 338 inline Void setDepthPower(Float p) { m_fDepthPower = p; } 339 #else 340 inline Float getDepthPower() { return 1.0f; } 341 inline TComNonlinearDepthModel& getNonlinearDepthModel() { return m_cNonlinearDepthModel; } 342 inline Void setNonlinearDepthModel( TComNonlinearDepthModel &rp ) { m_cNonlinearDepthModel = rp; } 343 344 Void setUseNonlinearDepth ( Bool bVal ) { m_bUseNonlinearDepth = bVal; } 345 bool getUseNonlinearDepth () { return m_bUseNonlinearDepth; } 341 346 #endif 342 347 … … 457 462 Bool getUseDMM() { return m_bUseDMM; } 458 463 #endif 459 464 #if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER 465 Void setUseDMM34( Bool b) { m_bUseDMM34 = b; } 466 Bool getUseDMM34() { return m_bUseDMM34; } 467 #endif 460 468 #if LM_CHROMA 461 469 Bool getUseLMChroma () { return m_bUseLMChroma; } -
branches/0.3-poznan-univ/source/Lib/TLibEncoder/TEncGOP.cpp
r28 r41 175 175 // GT FIX 176 176 std::vector<TComPic*> apcSpatRefPics = m_pcEncTop->getEncTop()->getSpatialRefPics( pcPic->getViewIdx(), pcSlice->getPOC(), m_pcEncTop->isDepthCoder() ); 177 TComPic * const pcTexturePic = m_pcEncTop->isDepthCoder() ? m_pcEncTop->getEncTop()->getPicFromView( pcPic->getViewIdx(), pcSlice->getPOC(), false ) : NULL; 177 TComPic * const pcTexturePic = ( m_pcEncTop->isDepthCoder()) ? m_pcEncTop->getEncTop()->getPicFromView( pcPic->getViewIdx(), pcSlice->getPOC(), false ) : NULL; 178 TComPic * const pcDepthPic = (!m_pcEncTop->isDepthCoder()) ? m_pcEncTop->getEncTop()->getPicFromView( pcPic->getViewIdx(), pcSlice->getPOC(), true ) : NULL; 178 179 assert( ! m_pcEncTop->isDepthCoder() || pcTexturePic != NULL ); 180 assert( m_pcEncTop->isDepthCoder() || pcDepthPic != NULL ); 179 181 pcSlice->setTexturePic( pcTexturePic ); 182 pcSlice->setDepthPic ( pcDepthPic ); 180 183 181 184 pcSlice->setRefPicListFromGOPSTring( rcListPic, apcSpatRefPics ); -
branches/0.3-poznan-univ/source/Lib/TLibEncoder/TEncSbac.cpp
r28 r41 1178 1178 #endif 1179 1179 #if HHI_DMM_PRED_TEX 1180 #if FLEX_CODING_ORDER 1181 if ( !pcCU->getSlice()->getSPS()->getUseDMM34() ) 1182 { 1183 assert( uiDir != DMM_WEDGE_PREDTEX_D_IDX ); 1184 assert( uiDir != DMM_CONTOUR_PREDTEX_D_IDX ); 1185 } 1186 #endif 1180 1187 if( uiDir == DMM_WEDGE_PREDTEX_D_IDX ) { xCodeWedgePredTexDeltaInfo ( pcCU, uiAbsPartIdx ); } 1181 1188 if( uiDir == DMM_CONTOUR_PREDTEX_D_IDX ) { xCodeContourPredTexDeltaInfo( pcCU, uiAbsPartIdx ); } -
branches/0.3-poznan-univ/source/Lib/TLibEncoder/TEncSearch.cpp
r28 r41 1934 1934 #endif 1935 1935 #if HHI_DMM_PRED_TEX 1936 #if FLEX_CODING_ORDER 1937 if ( pcCU->getSlice()->getSPS()->getUseDMM34() ) 1938 { 1939 #endif 1936 1940 TComYuv cTempYuv; cTempYuv.create( uiWidth, uiHeight ); cTempYuv.clear(); 1937 1941 Pel* piTempY = cTempYuv.getLumaAddr(); … … 1968 1972 1969 1973 cTempYuv.destroy(); 1974 #if FLEX_CODING_ORDER 1975 } 1976 #endif 1970 1977 #endif 1971 1978 } … … 1996 2003 #else 1997 2004 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 2005 #if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER 2006 if( m_pcEncCfg->isDepthCoder() && !predIntraLumaDMMAvailable( uiOrgMode, uiWidth, uiHeight, pcCU->getSlice()->getSPS()->getUseDMM34() ) ) 2007 #else 1998 2008 if( m_pcEncCfg->isDepthCoder() && !predIntraLumaDMMAvailable( uiOrgMode, uiWidth, uiHeight ) ) 2009 #endif 1999 2010 continue; 2000 2011 #endif … … 2084 2095 #else 2085 2096 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 2097 #if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER 2098 if( m_pcEncCfg->isDepthCoder() && !predIntraLumaDMMAvailable( uiOrgMode, uiWidth, uiHeight, pcCU->getSlice()->getSPS()->getUseDMM34() ) ) 2099 #else 2086 2100 if( m_pcEncCfg->isDepthCoder() && !predIntraLumaDMMAvailable( uiOrgMode, uiWidth, uiHeight ) ) 2101 #endif 2087 2102 continue; 2088 2103 #endif … … 2727 2742 } 2728 2743 2744 #if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER 2745 Bool TEncSearch::predIntraLumaDMMAvailable( UInt uiMode, UInt uiWidth, UInt uiHeight, Bool bDMMAvailable34 ) 2746 #else 2729 2747 Bool TEncSearch::predIntraLumaDMMAvailable( UInt uiMode, UInt uiWidth, UInt uiHeight ) 2748 #endif 2730 2749 { 2731 2750 if( uiMode <= MAX_MODE_ID_INTRA_DIR ) return true; … … 2755 2774 bDMMAvailable = false; 2756 2775 } 2776 #if FLEX_CODING_ORDER 2777 if ( !bDMMAvailable34 ) 2778 { 2779 bDMMAvailable = false; 2780 } 2781 #endif 2757 2782 } 2758 2783 -
branches/0.3-poznan-univ/source/Lib/TLibEncoder/TEncSearch.h
r28 r41 210 210 Bool predIntraLumaDMMAvailable( UInt uiMode, 211 211 UInt uiWidth, 212 #if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER 213 UInt uiHeight, 214 Bool bDMMAvailable34 ); 215 #else 212 216 UInt uiHeight ); 217 #endif 213 218 #endif 214 219 #if HHI_DMM_WEDGE_INTRA -
branches/0.3-poznan-univ/source/Lib/TLibEncoder/TEncTop.cpp
r28 r41 304 304 305 305 bool bSomethingCoded = false ; 306 306 #if FLEX_CODING_ORDER 307 if (TEncTop::m_bPicWaitingForCoding ) 308 #else 307 309 if (m_bPicWaitingForCoding ) 310 #endif 308 311 { 309 312 std::map<Int, TComPic*>::iterator cIter = m_acInputPicMap.find( (Int)m_cSeqIter.getPoc() ); … … 659 662 #endif 660 663 661 #if POZNAN_NONLINEAR_DEPTH 662 m_cSPS.setDepthPower ( m_fDepthPower ); 663 // OLGIERD: ToDo - QP-Tex should not use getDepthPower() from texture SPS. 664 #if POZNAN_NONLINEAR_DEPTH 665 m_cSPS.setNonlinearDepthModel ( m_cNonlinearDepthModel ); 666 m_cSPS.setUseNonlinearDepth ( m_bUseNonlinearDepth ); 667 // OLGIERD: ToDo - QP-Tex should not use getNonlinearDepthModel() from texture SPS. 664 668 #endif 665 669 -
branches/0.3-poznan-univ/source/Lib/TLibRenderer/TRenSingleModel.cpp
r28 r41 448 448 m_iLastOccludedSPosFP = xRangeLeftL( m_iLastOccludedSPos ); 449 449 xExtrapolateMarginL ( iCurSPos, iEndChangePos, iError ); 450 iMinChangedSPos = Min( iMinChangedSPos, (iEndChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement LUT( Max(m_apiBaseDepthPelRow[m_iCurViewPos][iEndChangePos], m_piNewDepthData[iPosXinNewData] )) ]);450 iMinChangedSPos = Min( iMinChangedSPos, (iEndChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement( Max(m_apiBaseDepthPelRow[m_iCurViewPos][iEndChangePos], m_piNewDepthData[iPosXinNewData] )) ]); 451 451 iLastSPos = iCurSPos; 452 452 m_iLastDepth = m_iCurDepth; … … 466 466 { 467 467 // Get minimal changed sample position 468 iMinChangedSPos = Min( iMinChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement LUT( Max(m_apiBaseDepthPelRow[m_iCurViewPos][iCurPosX], m_piNewDepthData[iPosXinNewData] )) ]);468 iMinChangedSPos = Min( iMinChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement( Max(m_apiBaseDepthPelRow[m_iCurViewPos][iCurPosX], m_piNewDepthData[iPosXinNewData] )) ]); 469 469 Int iCurSPos = xShiftNewData(iCurPosX,iPosXinNewData); 470 470 m_iCurDepth = m_piNewDepthData[iPosXinNewData]; … … 541 541 m_iLastOccludedSPosFP = xRangeRightR( m_iLastOccludedSPos ); 542 542 xExtrapolateMarginR ( iCurSPos, iStartChangePos, iError ); 543 iMaxChangedSPos = Max( iMaxChangedSPos, (iStartChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement LUT( Max(m_apiBaseDepthPelRow[m_iCurViewPos][iStartChangePos], m_piNewDepthData[iPosXinNewData] )) ]);543 iMaxChangedSPos = Max( iMaxChangedSPos, (iStartChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement( Max(m_apiBaseDepthPelRow[m_iCurViewPos][iStartChangePos], m_piNewDepthData[iPosXinNewData] )) ]); 544 544 iLastSPos = iCurSPos; 545 545 m_iLastDepth = m_iCurDepth; … … 559 559 { 560 560 // Get minimal changed sample position 561 iMaxChangedSPos = Max( iMaxChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement LUT( Max(m_apiBaseDepthPelRow[m_iCurViewPos][iCurPosX], m_piNewDepthData[iPosXinNewData] )) ]);561 iMaxChangedSPos = Max( iMaxChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement( Max(m_apiBaseDepthPelRow[m_iCurViewPos][iCurPosX], m_piNewDepthData[iPosXinNewData] )) ]); 562 562 Int iCurSPos = xShiftNewData(iCurPosX,iPosXinNewData); 563 563 m_iCurDepth = m_piNewDepthData[iPosXinNewData]; … … 948 948 AOF( iPosInNewData < m_iNewDataWidth ); 949 949 950 return (iPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement LUT( m_piNewDepthData[iPosInNewData] )];950 return (iPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement( m_piNewDepthData[iPosInNewData] )]; 951 951 } 952 952 … … 956 956 AOT( iPosX < 0); 957 957 AOF( iPosX < m_iWidth); 958 return (iPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement LUT( m_apiBaseDepthPelRow[m_iCurViewPos][iPosX] )];958 return (iPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement( m_apiBaseDepthPelRow[m_iCurViewPos][iPosX] )]; 959 959 } 960 960 … … 1149 1149 m_aapiSynthVideoPelRow [1][2][iTargetSPos] , 1150 1150 #endif 1151 m_piInvZLUTLeft [RemoveBitIncrement LUT(m_iThisDepth) ],1152 m_piInvZLUTRight[RemoveBitIncrement LUT(m_apiSynthDepthPelRow[1] [iTargetSPos])],1151 m_piInvZLUTLeft [RemoveBitIncrement(m_iThisDepth) ], 1152 m_piInvZLUTRight[RemoveBitIncrement(m_apiSynthDepthPelRow[1] [iTargetSPos])], 1153 1153 iFilled, 1154 1154 m_apiFilledRow [1] [iTargetSPos] , … … 1171 1171 m_aapiBaseVideoPelRow [1][2][iSourcePos ], 1172 1172 #endif 1173 m_piInvZLUTLeft [RemoveBitIncrement LUT(m_apiSynthDepthPelRow[0] [iTargetSPos])],1174 m_piInvZLUTRight[RemoveBitIncrement LUT(m_iThisDepth) ],1173 m_piInvZLUTLeft [RemoveBitIncrement(m_apiSynthDepthPelRow[0] [iTargetSPos])], 1174 m_piInvZLUTRight[RemoveBitIncrement(m_iThisDepth) ], 1175 1175 m_apiFilledRow [0] [iTargetSPos], 1176 1176 iFilled , -
branches/0.3-poznan-univ/source/Lib/TLibRenderer/TRenTop.cpp
r28 r41 498 498 499 499 // compute disparity and shift 500 iShiftedPos = ( iPosX << m_iRelShiftLUTPrec ) - m_aiShiftLUTCur[RemoveBitIncrement LUT( pcDepthData[iPosX])];500 iShiftedPos = ( iPosX << m_iRelShiftLUTPrec ) - m_aiShiftLUTCur[RemoveBitIncrement( pcDepthData[iPosX])]; 501 501 502 502 if (iPosX == 0) … … 652 652 653 653 // compute disparity and shift 654 assert( RemoveBitIncrement LUT(pcDepthData[iPosX]) >= 0 && RemoveBitIncrementLUT(pcDepthData[iPosX]) <= SizeOfLUT );655 dPrevShiftedPos = (Double) iPosX - m_adShiftLUTCur[ RemoveBitIncrement LUT(pcDepthData[iPosX])];654 assert( RemoveBitIncrement(pcDepthData[iPosX]) >= 0 && RemoveBitIncrement(pcDepthData[iPosX]) <= SizeOfLUT ); 655 dPrevShiftedPos = (Double) iPosX - m_adShiftLUTCur[ RemoveBitIncrement(pcDepthData[iPosX])]; 656 656 657 657 if (iPosX == 0) … … 833 833 for(Int iPosX = 0; iPosX < iWidth; iPosX++) 834 834 { 835 assert( RemoveBitIncrement LUT(pcDepthData[iPosX]) >= 0 && RemoveBitIncrementLUT(pcDepthData[iPosX]) <= SizeOfLUT );836 Int iShiftedPos = iPosX - m_aiShiftLUTCur[ RemoveBitIncrement LUT(pcDepthData[iPosX])] ;835 assert( RemoveBitIncrement(pcDepthData[iPosX]) >= 0 && RemoveBitIncrement(pcDepthData[iPosX]) <= SizeOfLUT ); 836 Int iShiftedPos = iPosX - m_aiShiftLUTCur[ RemoveBitIncrement(pcDepthData[iPosX])] ; 837 837 if (iShiftedPos < iWidth && iShiftedPos >= 0) 838 838 { … … 908 908 for(Int iPosX = 0; iPosX < iOutputWidth; iPosX ++) 909 909 { 910 Int iBackShiftedPos = (iPosX << m_iRelShiftLUTPrec) - m_aiShiftLUTCur[ RemoveBitIncrement LUT( pcDepthData[iPosX] )];910 Int iBackShiftedPos = (iPosX << m_iRelShiftLUTPrec) - m_aiShiftLUTCur[ RemoveBitIncrement( pcDepthData[iPosX] )]; 911 911 if( ( pcFilledData[iPosX] == REN_IS_FILLED ) && (iBackShiftedPos >= 0 ) && ( iBackShiftedPos < iInputWidth ) ) 912 912 { … … 981 981 { 982 982 // compute disparity and shift 983 iShiftedPos = iPosX - m_aiShiftLUTCur[RemoveBitIncrement LUT(pcDepthData[iPosX])];983 iShiftedPos = iPosX - m_aiShiftLUTCur[RemoveBitIncrement(pcDepthData[iPosX])]; 984 984 985 985 if ( iPosX == 0 ) … … 1866 1866 if ( (pcFilledRightData[uiXPos] != REN_IS_HOLE ) && ( pcFilledLeftData[uiXPos] != REN_IS_HOLE) ) 1867 1867 { 1868 Int iDepthDifference = m_piInvZLUTLeft[RemoveBitIncrement LUT(pcLeftDepthData[uiXPos])] - m_piInvZLUTRight[RemoveBitIncrementLUT(pcRightDepthData[uiXPos])];1868 Int iDepthDifference = m_piInvZLUTLeft[RemoveBitIncrement(pcLeftDepthData[uiXPos])] - m_piInvZLUTRight[RemoveBitIncrement(pcRightDepthData[uiXPos])]; 1869 1869 1870 1870 if ( abs ( iDepthDifference ) <= m_iBlendZThres ) … … 1895 1895 else if ( (pcFilledRightData[uiXPos] == REN_IS_HOLE) && (pcFilledLeftData[uiXPos] == REN_IS_HOLE)) 1896 1896 { 1897 pcOutputData[uiXPos] = m_piInvZLUTLeft[RemoveBitIncrement LUT( pcLeftDepthData[uiXPos])] < m_piInvZLUTRight[RemoveBitIncrementLUT(pcRightDepthData[uiXPos])] ? pcLeftVideoData[uiXPos] : pcRightVideoData[uiXPos];1897 pcOutputData[uiXPos] = m_piInvZLUTLeft[RemoveBitIncrement( pcLeftDepthData[uiXPos])] < m_piInvZLUTRight[RemoveBitIncrement(pcRightDepthData[uiXPos])] ? pcLeftVideoData[uiXPos] : pcRightVideoData[uiXPos]; 1898 1898 } 1899 1899 else
Note: See TracChangeset for help on using the changeset viewer.