Changeset 655 in 3DVCSoftware for trunk/source/App/TAppDecoder/TAppDecTop.cpp
- Timestamp:
- 23 Oct 2013, 23:01:30 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/App/TAppDecoder/TAppDecTop.cpp
r622 r655 60 60 #endif 61 61 { 62 ::memset (m_abDecFlag, 0, sizeof (m_abDecFlag));63 62 #if H_MV 64 63 for (Int i = 0; i < MAX_NUM_LAYER_IDS; i++) m_layerIdToDecIdx[i] = -1; … … 148 147 149 148 // main decoder loop 150 Bool recon_opened= false; // reconstruction file not yet opened. (must be performed after SPS is seen)149 Bool openedReconFile = false; // reconstruction file not yet opened. (must be performed after SPS is seen) 151 150 #else 152 151 #if H_3D … … 176 175 #endif 177 176 AnnexBStats stats = AnnexBStats(); 178 #if !H_MV179 Bool bPreviousPictureDecoded = false;180 #endif181 182 177 vector<uint8_t> nalUnit; 183 178 InputNALUnit nalu; … … 246 241 #endif 247 242 } 248 249 250 243 #else 251 244 if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu) ) 252 245 { 253 if(bPreviousPictureDecoded) 254 { 255 bNewPicture = true; 256 bPreviousPictureDecoded = false; 257 } 258 else 259 { 260 bNewPicture = false; 261 } 246 bNewPicture = false; 262 247 } 263 248 else … … 290 275 #endif 291 276 } 292 #if !H_MV293 bPreviousPictureDecoded = true;294 #endif295 277 } 296 278 } … … 311 293 TComPic* picLastCoded = m_ivPicLists.getPic( m_tDecTop[dI]->getLayerId(), pocLastPic ); 312 294 assert( picLastCoded != NULL ); 313 #if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170314 295 picLastCoded->compressMotion(1); 315 #else316 picLastCoded->compressMotion();317 #endif318 296 } 319 297 } … … 325 303 if ( m_pchReconFiles[decIdxLastPic] && !m_reconOpen[decIdxLastPic] ) 326 304 #else 327 if ( m_pchReconFile && ! recon_opened)305 if ( m_pchReconFile && !openedReconFile ) 328 306 #endif 329 307 { … … 338 316 #else 339 317 m_cTVideoIOYuvReconFile.open( m_pchReconFile, true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode 340 recon_opened= true;318 openedReconFile = true; 341 319 } 342 320 if ( bNewPicture && … … 466 444 { 467 445 TComList<TComPic*>::iterator iterPic = pcListPic->begin(); 468 Int not_displayed = 0; 469 470 while (iterPic != pcListPic->end()) 471 { 472 TComPic* pcPic = *(iterPic); 473 #if H_MV 474 if(pcPic->getOutputMark() && pcPic->getPOC() > m_pocLastDisplay[decIdx]) 475 #else 476 if(pcPic->getOutputMark() && pcPic->getPOC() > m_iPOCLastDisplay) 477 #endif 478 { 479 not_displayed++; 480 } 481 iterPic++; 482 } 483 iterPic = pcListPic->begin(); 446 Int numPicsNotYetDisplayed = 0; 484 447 485 448 while (iterPic != pcListPic->end()) 486 449 { 487 450 TComPic* pcPic = *(iterPic); 488 489 #if H_MV 490 if ( pcPic->getOutputMark() && (not_displayed > pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_pocLastDisplay[decIdx])) 491 #else 492 if ( pcPic->getOutputMark() && (not_displayed > pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_iPOCLastDisplay)) 493 #endif 494 { 495 // write to file 496 not_displayed--; 451 #if H_MV 452 if(pcPic->getOutputMark() && pcPic->getPOC() > m_pocLastDisplay[decIdx]) 453 #else 454 if(pcPic->getOutputMark() && pcPic->getPOC() > m_iPOCLastDisplay) 455 #endif 456 { 457 numPicsNotYetDisplayed++; 458 } 459 iterPic++; 460 } 461 iterPic = pcListPic->begin(); 462 if (numPicsNotYetDisplayed>2) 463 { 464 iterPic++; 465 } 466 467 TComPic* pcPic = *(iterPic); 468 if (numPicsNotYetDisplayed>2 && pcPic->isField()) //Field Decoding 469 { 470 TComList<TComPic*>::iterator endPic = pcListPic->end(); 471 endPic--; 472 iterPic = pcListPic->begin(); 473 while (iterPic != endPic) 474 { 475 TComPic* pcPicTop = *(iterPic); 476 iterPic++; 477 TComPic* pcPicBottom = *(iterPic); 478 479 #if H_MV 480 if ( pcPicTop->getOutputMark() && (numPicsNotYetDisplayed > pcPicTop->getNumReorderPics(tId) && !(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) 481 && pcPicBottom->getOutputMark() && (numPicsNotYetDisplayed > pcPicBottom->getNumReorderPics(tId) && (pcPicTop->getPOC() == m_pocLastDisplay[decIdx]+1 || m_pocLastDisplay[decIdx]<0))) 482 #else 483 if ( pcPicTop->getOutputMark() && (numPicsNotYetDisplayed > pcPicTop->getNumReorderPics(tId) && !(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) 484 && pcPicBottom->getOutputMark() && (numPicsNotYetDisplayed > pcPicBottom->getNumReorderPics(tId) && (pcPicTop->getPOC() == m_iPOCLastDisplay+1 || m_iPOCLastDisplay<0))) 485 #endif 486 { 487 // write to file 488 numPicsNotYetDisplayed = numPicsNotYetDisplayed-2; 497 489 #if H_MV 498 490 if ( m_pchReconFiles[decIdx] ) 499 491 #else 500 if ( m_pchReconFile ) 501 #endif 502 { 503 const Window &conf = pcPic->getConformanceWindow(); 504 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 505 #if H_MV 506 #if H_MV5 492 if ( m_pchReconFile ) 493 #endif 494 { 495 const Window &conf = pcPicTop->getConformanceWindow(); 496 const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window(); 497 498 const Bool isTff = pcPicTop->isTopField(); 499 #if H_MV 507 500 assert( conf .getScaledFlag() ); 508 501 assert( defDisp.getScaledFlag() ); 509 #endif 502 m_tVideoIOYuvReconFile[decIdx]->write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 503 #else 504 m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 505 #endif 506 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 507 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 508 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 509 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff ); 510 } 511 512 // update POC of display order 513 #if H_MV 514 m_pocLastDisplay[decIdx] = pcPic->getPOC(); 515 #else 516 m_iPOCLastDisplay = pcPicBottom->getPOC(); 517 #endif 518 519 // erase non-referenced picture in the reference picture list after display 520 if ( !pcPicTop->getSlice(0)->isReferenced() && pcPicTop->getReconMark() == true ) 521 { 522 #if !DYN_REF_FREE 523 pcPicTop->setReconMark(false); 524 525 // mark it should be extended later 526 pcPicTop->getPicYuvRec()->setBorderExtension( false ); 527 528 #else 529 pcPicTop->destroy(); 530 pcListPic->erase( iterPic ); 531 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 532 continue; 533 #endif 534 } 535 if ( !pcPicBottom->getSlice(0)->isReferenced() && pcPicBottom->getReconMark() == true ) 536 { 537 #if !DYN_REF_FREE 538 pcPicBottom->setReconMark(false); 539 540 // mark it should be extended later 541 pcPicBottom->getPicYuvRec()->setBorderExtension( false ); 542 543 #else 544 pcPicBottom->destroy(); 545 pcListPic->erase( iterPic ); 546 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 547 continue; 548 #endif 549 } 550 pcPicTop->setOutputMark(false); 551 pcPicBottom->setOutputMark(false); 552 } 553 } 554 } 555 else if (!pcPic->isField()) //Frame Decoding 556 { 557 iterPic = pcListPic->begin(); 558 while (iterPic != pcListPic->end()) 559 { 560 pcPic = *(iterPic); 561 562 #if H_MV 563 if ( pcPic->getOutputMark() && (numPicsNotYetDisplayed > pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_pocLastDisplay[decIdx])) 564 #else 565 if ( pcPic->getOutputMark() && (numPicsNotYetDisplayed > pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_iPOCLastDisplay)) 566 #endif 567 { 568 // write to file 569 numPicsNotYetDisplayed--; 570 #if H_MV 571 if ( m_pchReconFiles[decIdx] ) 572 #else 573 if ( m_pchReconFile ) 574 #endif 575 { 576 const Window &conf = pcPic->getConformanceWindow(); 577 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 578 #if H_MV 579 assert( conf .getScaledFlag() ); 580 assert( defDisp.getScaledFlag() ); 510 581 m_tVideoIOYuvReconFile[decIdx]->write( pcPic->getPicYuvRec(), 511 582 #else 512 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), 513 #endif 514 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 515 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 516 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 517 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 583 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), 584 #endif 585 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 586 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 587 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 588 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 589 } 590 591 // update POC of display order 592 #if H_MV 593 m_pocLastDisplay[decIdx] = pcPic->getPOC(); 594 #else 595 m_iPOCLastDisplay = pcPic->getPOC(); 596 #endif 597 598 // erase non-referenced picture in the reference picture list after display 599 if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true ) 600 { 601 #if !DYN_REF_FREE 602 pcPic->setReconMark(false); 603 604 // mark it should be extended later 605 pcPic->getPicYuvRec()->setBorderExtension( false ); 606 607 #else 608 pcPic->destroy(); 609 pcListPic->erase( iterPic ); 610 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 611 continue; 612 #endif 613 } 614 pcPic->setOutputMark(false); 518 615 } 519 616 520 // update POC of display order 521 #if H_MV 522 m_pocLastDisplay[decIdx] = pcPic->getPOC(); 523 #else 524 m_iPOCLastDisplay = pcPic->getPOC(); 525 #endif 526 527 // erase non-referenced picture in the reference picture list after display 528 if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true ) 529 { 530 #if !DYN_REF_FREE 531 pcPic->setReconMark(false); 532 533 // mark it should be extended later 534 pcPic->getPicYuvRec()->setBorderExtension( false ); 535 536 #else 537 pcPic->destroy(); 538 pcListPic->erase( iterPic ); 539 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 540 continue; 541 #endif 542 } 543 pcPic->setOutputMark(false); 544 } 545 546 iterPic++; 547 } 548 } 549 617 iterPic++; 618 } 619 } 620 } 550 621 /** \param pcListPic list of pictures to be written to file 551 622 \todo DYN_REF_FREE should be revised … … 560 631 { 561 632 return; 562 } 633 } 563 634 TComList<TComPic*>::iterator iterPic = pcListPic->begin(); 564 635 565 636 iterPic = pcListPic->begin(); 637 TComPic* pcPic = *(iterPic); 566 638 567 while (iterPic != pcListPic->end()) 568 { 569 TComPic* pcPic = *(iterPic); 570 571 if ( pcPic->getOutputMark() ) 572 { 573 // write to file 639 if (pcPic->isField()) //Field Decoding 640 { 641 TComList<TComPic*>::iterator endPic = pcListPic->end(); 642 endPic--; 643 TComPic *pcPicTop, *pcPicBottom = NULL; 644 while (iterPic != endPic) 645 { 646 pcPicTop = *(iterPic); 647 iterPic++; 648 pcPicBottom = *(iterPic); 649 650 if ( pcPicTop->getOutputMark() && pcPicBottom->getOutputMark() && !(pcPicTop->getPOC()%2) && (pcPicBottom->getPOC() == pcPicTop->getPOC()+1) ) 651 { 652 // write to file 574 653 #if H_MV 575 654 if ( m_pchReconFiles[decIdx] ) 576 655 #else 577 if ( m_pchReconFile )578 #endif 579 {580 const Window &conf = pcPic->getConformanceWindow();581 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window();582 #if H_MV 583 #if H_MV 5656 if ( m_pchReconFile ) 657 #endif 658 { 659 const Window &conf = pcPicTop->getConformanceWindow(); 660 const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window(); 661 const Bool isTff = pcPicTop->isTopField(); 662 #if H_MV 584 663 assert( conf .getScaledFlag() ); 585 664 assert( defDisp.getScaledFlag() ); 586 #endif 665 m_tVideoIOYuvReconFile[decIdx]->write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 666 #else 667 m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 668 #endif 669 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 670 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 671 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 672 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff ); 673 } 674 675 // update POC of display order 676 #if H_MV 677 m_pocLastDisplay[decIdx] = pcPic->getPOC(); 678 #else 679 m_iPOCLastDisplay = pcPicBottom->getPOC(); 680 #endif 681 // erase non-referenced picture in the reference picture list after display 682 if ( !pcPicTop->getSlice(0)->isReferenced() && pcPicTop->getReconMark() == true ) 683 { 684 #if !DYN_REF_FREE 685 pcPicTop->setReconMark(false); 686 687 // mark it should be extended later 688 pcPicTop->getPicYuvRec()->setBorderExtension( false ); 689 690 #else 691 pcPicTop->destroy(); 692 pcListPic->erase( iterPic ); 693 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 694 continue; 695 #endif 696 } 697 if ( !pcPicBottom->getSlice(0)->isReferenced() && pcPicBottom->getReconMark() == true ) 698 { 699 #if !DYN_REF_FREE 700 pcPicBottom->setReconMark(false); 701 702 // mark it should be extended later 703 pcPicBottom->getPicYuvRec()->setBorderExtension( false ); 704 705 #else 706 pcPicBottom->destroy(); 707 pcListPic->erase( iterPic ); 708 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 709 continue; 710 #endif 711 } 712 pcPicTop->setOutputMark(false); 713 pcPicBottom->setOutputMark(false); 714 715 #if !DYN_REF_FREE 716 if(pcPicTop) 717 { 718 pcPicTop->destroy(); 719 delete pcPicTop; 720 pcPicTop = NULL; 721 } 722 #endif 723 } 724 } 725 if(pcPicBottom) 726 { 727 pcPicBottom->destroy(); 728 delete pcPicBottom; 729 pcPicBottom = NULL; 730 } 731 } 732 else //Frame decoding 733 { 734 while (iterPic != pcListPic->end()) 735 { 736 pcPic = *(iterPic); 737 738 if ( pcPic->getOutputMark() ) 739 { 740 // write to file 741 #if H_MV 742 if ( m_pchReconFiles[decIdx] ) 743 #else 744 if ( m_pchReconFile ) 745 #endif 746 { 747 const Window &conf = pcPic->getConformanceWindow(); 748 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 749 #if H_MV 750 assert( conf .getScaledFlag() ); 751 assert( defDisp.getScaledFlag() ); 587 752 m_tVideoIOYuvReconFile[decIdx]->write( pcPic->getPicYuvRec(), 588 753 #else 589 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(),590 #endif 591 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),592 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),593 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),594 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() );595 }596 597 // update POC of display order754 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), 755 #endif 756 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 757 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 758 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 759 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 760 } 761 762 // update POC of display order 598 763 #if H_MV 599 764 m_pocLastDisplay[decIdx] = pcPic->getPOC(); 600 765 #else 601 m_iPOCLastDisplay = pcPic->getPOC();602 #endif 603 604 // erase non-referenced picture in the reference picture list after display605 if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true )606 {766 m_iPOCLastDisplay = pcPic->getPOC(); 767 #endif 768 769 // erase non-referenced picture in the reference picture list after display 770 if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true ) 771 { 607 772 #if !DYN_REF_FREE 608 pcPic->setReconMark(false);609 610 // mark it should be extended later611 pcPic->getPicYuvRec()->setBorderExtension( false );612 613 #else 614 pcPic->destroy();615 pcListPic->erase( iterPic );616 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised!617 continue;618 #endif 619 }620 pcPic->setOutputMark(false);621 }773 pcPic->setReconMark(false); 774 775 // mark it should be extended later 776 pcPic->getPicYuvRec()->setBorderExtension( false ); 777 778 #else 779 pcPic->destroy(); 780 pcListPic->erase( iterPic ); 781 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 782 continue; 783 #endif 784 } 785 pcPic->setOutputMark(false); 786 } 622 787 #if !H_MV 623 788 #if !DYN_REF_FREE 624 if(pcPic) 625 { 626 pcPic->destroy(); 627 delete pcPic; 628 pcPic = NULL; 629 } 630 #endif 631 #endif 632 iterPic++; 789 if(pcPic) 790 { 791 pcPic->destroy(); 792 delete pcPic; 793 pcPic = NULL; 794 } 795 #endif 796 #endif 797 iterPic++; 798 } 633 799 } 634 800 #if H_MV
Note: See TracChangeset for help on using the changeset viewer.