Changeset 41 in 3DVCSoftware for branches/0.3-poznan-univ/source/App
- Timestamp:
- 26 Mar 2012, 09:03:21 (13 years ago)
- Location:
- branches/0.3-poznan-univ/source/App
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset for help on using the changeset viewer.