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