Changeset 210 in 3DVCSoftware for trunk/source/App/TAppDecoder/TAppDecTop.cpp
- Timestamp:
- 11 Dec 2012, 18:52:43 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/App/TAppDecoder/TAppDecTop.cpp
r189 r210 82 82 Void TAppDecTop::decode() 83 83 { 84 #if VIDYO_VPS_INTEGRATION 84 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 85 85 increaseNumberOfViews( 0, 0, 0 ); 86 86 #else … … 88 88 #endif 89 89 90 #if FLEX_CODING_ORDER_M23723 91 Int iDepthViewIdx = 0; 92 Int iTextureViewIdx=0; 93 Bool firstFrame=1; 94 Bool viewIdZero=true; 95 Int fcoIndex=0; //when the current frame is not first frame,use FCO_index stand for viewDepth. 96 #endif 97 90 98 #if SONY_COLPIC_AVAILABILITY 91 99 m_tDecTop[0]->setViewOrderIdx(0); … … 102 110 pcListPic[i] = NULL; 103 111 newPicture[i] = false; 112 #if FLEX_CODING_ORDER_M23723 113 #if FIX_FCO_COMP_WARNING 114 m_fcoOrder[i] = ' '; 115 #else 116 m_fcoOrder[i]=NULL; 117 #endif 118 #endif 119 104 120 } 105 121 … … 145 161 { 146 162 read(nalu, nalUnit); 163 #if QC_MVHEVC_B0046 164 viewDepthId = nalu.m_layerId; 165 Int depth = 0; 166 Int viewId = viewDepthId; 167 #else 147 168 #if VIDYO_VPS_INTEGRATION 148 169 Int viewId = 0; … … 156 177 depth = getVPSAccess()->getActiveVPS()->getDepthFlag(nalu.m_layerId); 157 178 } 179 #if FLEX_CODING_ORDER_M23723 180 if (viewId>0) 181 { 182 viewIdZero=false; 183 } 184 if (viewIdZero==false&&viewId==0) 185 { 186 firstFrame=0; //if viewId has been more than zero and now it set to zero again, we can see that it is not the first view 187 } 188 if (firstFrame) 189 { // if the current view is first frame, we set the viewDepthId as texture plus depth and get the FCO order 190 viewDepthId = iDepthViewIdx+iTextureViewIdx; 191 m_fcoViewDepthId=viewDepthId; 192 } 193 else 194 {//if current view is not first frame, we set the viewDepthId depended on the FCO order 195 viewDepthId=0; 196 if (depth) 197 { 198 for (fcoIndex=0;fcoIndex<2*MAX_VIEW_NUM;fcoIndex++ ) 199 { 200 if (m_fcoOrder[fcoIndex]=='D') 201 { 202 if (viewId==viewDepthId) 203 break; 204 else 205 viewDepthId++; 206 } 207 } 208 } 209 else 210 { 211 for (fcoIndex=0;fcoIndex<2*MAX_VIEW_NUM;fcoIndex++ ) 212 { 213 if (m_fcoOrder[fcoIndex]=='T') 214 { 215 if (viewId==viewDepthId) 216 break; 217 else 218 viewDepthId++; 219 } 220 } 221 } 222 223 viewDepthId=fcoIndex; 224 225 } 226 227 228 #else 158 229 viewDepthId = nalu.m_layerId; // coding order T0D0T1D1T2D2 230 #endif 231 159 232 #else 160 233 Int viewId = nalu.m_viewId; 161 234 Int depth = nalu.m_isDepth ? 1 : 0; 235 #if FLEX_CODING_ORDER_M23723 236 if (viewId>0) 237 { 238 viewIdZero=false; 239 } 240 if (viewIdZero==false&&viewId==0) 241 { 242 firstFrame=0; 243 } 244 if (firstFrame) 245 { 246 viewDepthId = iDepthViewIdx+iTextureViewIdx; 247 m_fcoViewDepthId=viewDepthId; 248 } 249 else 250 { 251 viewDepthId=0; 252 if (depth) 253 { 254 for (fcoIndex=0;fcoIndex<2*MAX_VIEW_NUM;fcoIndex++ ) 255 { 256 if (m_fcoOrder[fcoIndex]=='D') 257 { 258 if (viewId==viewDepthId) 259 break; 260 else 261 viewDepthId++; 262 } 263 } 264 } 265 else 266 { 267 for (fcoIndex=0;fcoIndex<2*MAX_VIEW_NUM;fcoIndex++ ) 268 { 269 if (m_fcoOrder[fcoIndex]=='T') 270 { 271 if (viewId==viewDepthId) 272 break; 273 else 274 viewDepthId++; 275 } 276 } 277 } 278 viewDepthId=fcoIndex; 279 } 280 #else 162 281 viewDepthId = viewId * 2 + depth; // coding order T0D0T1D1T2D2 163 282 #endif 164 283 #endif 284 #endif 165 285 newPicture[viewDepthId] = false; 166 286 if( viewDepthId >= m_tDecTop.size() ) 167 287 { 168 #if VIDYO_VPS_INTEGRATION 288 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 169 289 increaseNumberOfViews( viewDepthId, viewId, depth ); 170 290 #else … … 195 315 if( !(m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) ) 196 316 { 317 #if QC_MVHEVC_B0046 318 if(viewDepthId && m_tDecTop[viewDepthId]->m_bFirstNal== false) 319 { 320 m_tDecTop[viewDepthId]->m_bFirstNal = true; 321 ParameterSetManagerDecoder* pDecV0 = m_tDecTop[0]->xGetParaSetDec(); 322 m_tDecTop[viewDepthId]->xCopyVPS(pDecV0->getPrefetchedVPS(0)); 323 m_tDecTop[viewDepthId]->xCopySPS(pDecV0->getPrefetchedSPS(0)); 324 m_tDecTop[viewDepthId]->xCopyPPS(pDecV0->getPrefetchedPPS(0)); 325 } 326 #endif 197 327 newPicture[viewDepthId] = m_tDecTop[viewDepthId]->decode(nalu, m_iSkipFrame, m_pocLastDisplay[viewDepthId]); 198 328 if (newPicture[viewDepthId]) … … 209 339 { 210 340 previousPictureDecoded = true; 341 #if FLEX_CODING_ORDER_M23723 342 if (firstFrame) 343 { 344 if (depth) 345 { 346 iDepthViewIdx++; 347 m_fcoOrder[viewDepthId]='D'; 348 } 349 else 350 { 351 iTextureViewIdx++; 352 m_fcoOrder[viewDepthId]='T'; 353 } 354 } 355 356 #endif 211 357 } 212 358 } … … 218 364 if( pcListPic[viewDepthId] ) 219 365 { 366 #if QC_REM_IDV_B0046 367 Int iviewId = m_tDecTop[viewDepthId]->getViewId(); 368 if( newPicture[viewDepthId] && (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR || ((nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR && iviewId) && m_tDecTop[viewDepthId]->getNalUnitTypeBaseView() == NAL_UNIT_CODED_SLICE_IDR)) ) 369 #else 220 370 if( newPicture[viewDepthId] && (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR || (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDV && m_tDecTop[viewDepthId]->getNalUnitTypeBaseView() == NAL_UNIT_CODED_SLICE_IDR)) ) 371 #endif 221 372 { 222 373 xFlushOutput( pcListPic[viewDepthId], viewDepthId ); … … 275 426 m_tDecTop[viewDepthIdx]->destroy() ; 276 427 } 428 #if QC_MVHEVC_B0046 429 if(viewDepthIdx) 430 { 431 //Call clear function to remove the record, which has been freed during viewDepthIdx = 0 case. 432 m_tDecTop[viewDepthIdx]->xGetParaSetDec()->clearSPS(); 433 m_tDecTop[viewDepthIdx]->xGetParaSetDec()->clearVPS(); 434 m_tDecTop[viewDepthIdx]->xGetParaSetDec()->clearPPS(); 435 } 436 #endif 277 437 delete m_tDecTop[viewDepthIdx] ; 278 438 m_tDecTop[viewDepthIdx] = NULL ; … … 416 576 m_pocLastDisplay[viewDepthId] = -MAX_INT; 417 577 } 418 #if VIDYO_VPS_INTEGRATION 578 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 419 579 Void TAppDecTop::increaseNumberOfViews ( UInt layerId, UInt viewId, UInt isDepth ) 420 580 #else … … 422 582 #endif 423 583 { 424 #if VIDYO_VPS_INTEGRATION 584 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 425 585 Int newNumberOfViewDepth = layerId + 1; 426 586 #endif … … 429 589 m_outputBitDepth = g_uiBitDepth + g_uiBitIncrement; 430 590 } 431 #if !VIDYO_VPS_INTEGRATION 591 #if !VIDYO_VPS_INTEGRATION&!QC_MVHEVC_B0046 432 592 Int viewId = (newNumberOfViewDepth-1)>>1; // coding order T0D0T1D1T2D2 433 593 Bool isDepth = ((newNumberOfViewDepth % 2) == 0); // coding order T0D0T1D1T2D2 … … 442 602 m_tVideoIOYuvReconFile.push_back(new TVideoIOYuv); 443 603 Char buffer[4]; 444 #if VIDYO_VPS_INTEGRATION 604 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 445 605 sprintf(buffer,"_%i", viewId ); 446 606 #else … … 448 608 #endif 449 609 Char* nextFilename = NULL; 450 #if VIDYO_VPS_INTEGRATION 610 #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 451 611 if( isDepth) 452 612 #else … … 463 623 xAppendToFileNameEnd( m_pchReconFile, buffer, nextFilename); 464 624 } 465 #if !VIDYO_VPS_INTEGRATION 625 #if !VIDYO_VPS_INTEGRATION&!QC_MVHEVC_B0046 466 626 if( isDepth || ( !isDepth && (m_tVideoIOYuvReconFile.size() % 2) == 1 ) ) 467 627 #endif … … 480 640 { 481 641 m_tDecTop.push_back(new TDecTop); 482 #if !VIDYO_VPS_INTEGRATION 642 #if !VIDYO_VPS_INTEGRATION&!QC_MVHEVC_B0046 483 643 if( isDepth || ( !isDepth && (m_tVideoIOYuvReconFile.size() % 2) == 1 ) ) 484 644 { … … 490 650 m_tDecTop.back()->setPictureDigestEnabled(m_pictureDigestEnabled); 491 651 m_tDecTop.back()->setCamParsCollector( &m_cCamParsCollector ); 492 #if !VIDYO_VPS_INTEGRATION 652 #if !VIDYO_VPS_INTEGRATION&!QC_MVHEVC_B0046 493 653 } 494 654 #endif … … 498 658 TDecTop* TAppDecTop::getTDecTop( Int viewId, Bool isDepth ) 499 659 { 660 #if FLEX_CODING_ORDER_M23723 661 Int viewnumber=0; 662 Int i=0; 663 Bool fcoFlag=0; 664 if (viewId>m_fcoViewDepthId) 665 { 666 return NULL; 667 } 668 else 669 { 670 if (isDepth) 671 { 672 for ( i=0; i<=m_fcoViewDepthId;i++) 673 { 674 if (m_fcoOrder[i]=='D') 675 { 676 if (viewnumber==viewId) 677 { 678 fcoFlag=1; 679 break; 680 } 681 else 682 viewnumber++; 683 } 684 } 685 } 686 else 687 { 688 for ( i=0; i<=m_fcoViewDepthId;i++) 689 { 690 if (m_fcoOrder[i]=='T') 691 { 692 if (viewnumber==viewId) 693 { 694 fcoFlag=1; 695 break; 696 } 697 else 698 viewnumber++; 699 } 700 } 701 } 702 if (fcoFlag) 703 { 704 return m_tDecTop[i]; 705 } 706 else 707 return NULL; 708 709 } 710 711 // coding order T0D0T1D1T2D2 712 #else 500 713 return m_tDecTop[(isDepth ? 1 : 0) + viewId * 2]; // coding order T0D0T1D1T2D2 714 #endif 715 501 716 } 502 717 … … 517 732 assert( ( viewId >= 0 ) ); 518 733 734 #if FLEX_CODING_ORDER_M23723 735 if (getTDecTop(viewId,isDepth)) 736 { 519 737 TComList<TComPic*>* apcListPic = getTDecTop( viewId, isDepth )->getListPic(); 520 738 TComPic* pcPic = NULL; … … 529 747 return pcPic; 530 748 } 749 else 750 return NULL; 751 #else 752 753 TComList<TComPic*>* apcListPic = getTDecTop( viewId, isDepth )->getListPic(); 754 TComPic* pcPic = NULL; 755 for( TComList<TComPic*>::iterator it=apcListPic->begin(); it!=apcListPic->end(); it++ ) 756 { 757 if( (*it)->getPOC() == poc ) 758 { 759 pcPic = *it; 760 break; 761 } 762 } 763 return pcPic; 764 #endif 765 } 531 766 //! \}
Note: See TracChangeset for help on using the changeset viewer.