Changeset 651 in 3DVCSoftware for branches/HTM-8.2-dev0-Cleanup/source/App
- Timestamp:
- 21 Oct 2013, 17:52:23 (11 years ago)
- Location:
- branches/HTM-8.2-dev0-Cleanup/source/App
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-8.2-dev0-Cleanup/source/App/TAppDecoder/TAppDecTop.cpp
r648 r651 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 } … … 321 303 if ( m_pchReconFiles[decIdxLastPic] && !m_reconOpen[decIdxLastPic] ) 322 304 #else 323 if ( m_pchReconFile && ! recon_opened)305 if ( m_pchReconFile && !openedReconFile ) 324 306 #endif 325 307 { … … 334 316 #else 335 317 m_cTVideoIOYuvReconFile.open( m_pchReconFile, true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode 336 recon_opened= true;318 openedReconFile = true; 337 319 } 338 320 if ( bNewPicture && … … 462 444 { 463 445 TComList<TComPic*>::iterator iterPic = pcListPic->begin(); 464 Int not_displayed = 0; 465 466 while (iterPic != pcListPic->end()) 467 { 468 TComPic* pcPic = *(iterPic); 469 #if H_MV 470 if(pcPic->getOutputMark() && pcPic->getPOC() > m_pocLastDisplay[decIdx]) 471 #else 472 if(pcPic->getOutputMark() && pcPic->getPOC() > m_iPOCLastDisplay) 473 #endif 474 { 475 not_displayed++; 476 } 477 iterPic++; 478 } 479 iterPic = pcListPic->begin(); 446 Int numPicsNotYetDisplayed = 0; 480 447 481 448 while (iterPic != pcListPic->end()) 482 449 { 483 450 TComPic* pcPic = *(iterPic); 484 485 #if H_MV 486 if ( pcPic->getOutputMark() && (not_displayed > pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_pocLastDisplay[decIdx])) 487 #else 488 if ( pcPic->getOutputMark() && (not_displayed > pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_iPOCLastDisplay)) 489 #endif 490 { 491 // write to file 492 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; 493 489 #if H_MV 494 490 if ( m_pchReconFiles[decIdx] ) 495 491 #else 496 if ( m_pchReconFile ) 497 #endif 498 { 499 const Window &conf = pcPic->getConformanceWindow(); 500 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 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 500 assert( conf .getScaledFlag() ); 501 assert( defDisp.getScaledFlag() ); 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(); 501 578 #if H_MV 502 579 assert( conf .getScaledFlag() ); … … 504 581 m_tVideoIOYuvReconFile[decIdx]->write( pcPic->getPicYuvRec(), 505 582 #else 506 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), 507 #endif 508 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 509 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 510 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 511 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); 512 615 } 513 616 514 // update POC of display order 515 #if H_MV 516 m_pocLastDisplay[decIdx] = pcPic->getPOC(); 517 #else 518 m_iPOCLastDisplay = pcPic->getPOC(); 519 #endif 520 521 // erase non-referenced picture in the reference picture list after display 522 if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true ) 523 { 524 #if !DYN_REF_FREE 525 pcPic->setReconMark(false); 526 527 // mark it should be extended later 528 pcPic->getPicYuvRec()->setBorderExtension( false ); 529 530 #else 531 pcPic->destroy(); 532 pcListPic->erase( iterPic ); 533 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 534 continue; 535 #endif 536 } 537 pcPic->setOutputMark(false); 538 } 539 540 iterPic++; 541 } 542 } 543 617 iterPic++; 618 } 619 } 620 } 544 621 /** \param pcListPic list of pictures to be written to file 545 622 \todo DYN_REF_FREE should be revised … … 554 631 { 555 632 return; 556 } 633 } 557 634 TComList<TComPic*>::iterator iterPic = pcListPic->begin(); 558 635 559 636 iterPic = pcListPic->begin(); 637 TComPic* pcPic = *(iterPic); 560 638 561 while (iterPic != pcListPic->end()) 562 { 563 TComPic* pcPic = *(iterPic); 564 565 if ( pcPic->getOutputMark() ) 566 { 567 // 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 568 653 #if H_MV 569 654 if ( m_pchReconFiles[decIdx] ) 570 655 #else 571 if ( m_pchReconFile ) 572 #endif 573 { 574 const Window &conf = pcPic->getConformanceWindow(); 575 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 656 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 663 assert( conf .getScaledFlag() ); 664 assert( defDisp.getScaledFlag() ); 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 ( m_pchReconFile ) 742 { 743 const Window &conf = pcPic->getConformanceWindow(); 744 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 576 745 #if H_MV 577 746 assert( conf .getScaledFlag() ); … … 579 748 m_tVideoIOYuvReconFile[decIdx]->write( pcPic->getPicYuvRec(), 580 749 #else 581 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(),582 #endif 583 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),584 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),585 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),586 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() );587 }588 589 // update POC of display order750 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), 751 #endif 752 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 753 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 754 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 755 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 756 } 757 758 // update POC of display order 590 759 #if H_MV 591 760 m_pocLastDisplay[decIdx] = pcPic->getPOC(); 592 761 #else 593 m_iPOCLastDisplay = pcPic->getPOC();594 #endif 595 596 // erase non-referenced picture in the reference picture list after display597 if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true )598 {762 m_iPOCLastDisplay = pcPic->getPOC(); 763 #endif 764 765 // erase non-referenced picture in the reference picture list after display 766 if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true ) 767 { 599 768 #if !DYN_REF_FREE 600 pcPic->setReconMark(false);601 602 // mark it should be extended later603 pcPic->getPicYuvRec()->setBorderExtension( false );604 605 #else 606 pcPic->destroy();607 pcListPic->erase( iterPic );608 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised!609 continue;610 #endif 611 }612 pcPic->setOutputMark(false);613 }769 pcPic->setReconMark(false); 770 771 // mark it should be extended later 772 pcPic->getPicYuvRec()->setBorderExtension( false ); 773 774 #else 775 pcPic->destroy(); 776 pcListPic->erase( iterPic ); 777 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 778 continue; 779 #endif 780 } 781 pcPic->setOutputMark(false); 782 } 614 783 #if !H_MV 615 784 #if !DYN_REF_FREE 616 if(pcPic) 617 { 618 pcPic->destroy(); 619 delete pcPic; 620 pcPic = NULL; 621 } 622 #endif 623 #endif 624 iterPic++; 785 if(pcPic) 786 { 787 pcPic->destroy(); 788 delete pcPic; 789 pcPic = NULL; 790 } 791 #endif 792 #endif 793 iterPic++; 794 } 625 795 } 626 796 #if H_MV -
branches/HTM-8.2-dev0-Cleanup/source/App/TAppDecoder/TAppDecTop.h
r608 r651 72 72 #endif 73 73 // for output control 74 Bool m_abDecFlag[ MAX_GOP ]; ///< decoded flag in one GOP75 74 #if H_MV 76 75 Int m_pocLastDisplay [ MAX_NUM_LAYERS ]; ///< last POC in display order -
branches/HTM-8.2-dev0-Cleanup/source/App/TAppEncoder/TAppEncCfg.cpp
r648 r651 418 418 ("FramesToBeEncoded,f", m_framesToBeEncoded, 0, "Number of frames to be encoded (default=all)") 419 419 420 //Field coding parameters 421 ("FieldCoding", m_isField, false, "Signals if it's a field based coding") 422 ("TopFieldFirst, Tff", m_isTopFieldFirst, false, "In case of field based coding, signals whether if it's a top field first or not") 423 420 424 // Profile and level 421 425 ("Profile", m_profile, Profile::NONE, "Profile to be used when encoding (Incomplete)") … … 812 816 const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv); 813 817 818 if(m_isField) 819 { 820 //Frame height 821 m_iSourceHeightOrg = m_iSourceHeight; 822 //Field height 823 m_iSourceHeight = m_iSourceHeight >> 1; 824 //number of fields to encode 825 m_framesToBeEncoded *= 2; 826 } 827 814 828 for (list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++) 815 829 { … … 930 944 m_aiPad[1] = m_confBottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight; 931 945 m_iSourceHeight += m_confBottom; 946 if ( m_isField ) 947 { 948 m_iSourceHeightOrg += m_confBottom << 1; 949 m_aiPad[1] = m_confBottom << 1; 950 } 932 951 } 933 952 if (m_aiPad[0] % TComSPS::getWinUnitX(CHROMA_420) != 0) … … 1692 1711 Bool errorGOP=false; 1693 1712 Int checkGOP=1; 1694 Int numRefs = 1;1713 Int numRefs = m_isField ? 2 : 1; 1695 1714 Int refList[MAX_NUM_REF_PICS+1]; 1696 1715 refList[0]=0; 1716 if(m_isField) 1717 { 1718 refList[1] = 1; 1719 } 1697 1720 Bool isOK[MAX_GOP]; 1698 1721 for(Int i=0; i<MAX_GOP; i++) … … 2213 2236 printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - m_confLeft - m_confRight, m_iSourceHeight - m_confTop - m_confBottom, m_iFrameRate ); 2214 2237 printf("Internal Format : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate ); 2238 if (m_isField) 2239 { 2240 printf("Frame/Field : Field based coding\n"); 2241 printf("Field index : %u - %d (%d fields)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded ); 2242 if (m_isTopFieldFirst) 2243 { 2244 printf("Field Order : Top field first\n"); 2245 } 2246 else 2247 { 2248 printf("Field Order : Bottom field first\n"); 2249 } 2250 } 2251 else 2252 { 2253 printf("Frame/Field : Frame based coding\n"); 2215 2254 printf("Frame index : %u - %d (%d frames)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded ); 2255 } 2216 2256 printf("CU size / depth : %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth ); 2217 2257 printf("RQT trans. size (min / max) : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize ); -
branches/HTM-8.2-dev0-Cleanup/source/App/TAppEncoder/TAppEncCfg.h
r648 r651 139 139 UInt m_FrameSkip; ///< number of skipped frames from the beginning 140 140 Int m_iSourceWidth; ///< source width in pixel 141 Int m_iSourceHeight; ///< source height in pixel 141 Int m_iSourceHeight; ///< source height in pixel (when interlaced = field height) 142 143 Int m_iSourceHeightOrg; ///< original source height in pixel (when interlaced = frame height) 144 145 bool m_isField; ///< enable field coding 146 bool m_isTopFieldFirst; 147 142 148 Int m_conformanceMode; 143 149 Int m_confLeft; -
branches/HTM-8.2-dev0-Cleanup/source/App/TAppEncoder/TAppEncTop.cpp
r648 r651 756 756 } 757 757 758 Void TAppEncTop::xInitLib( )758 Void TAppEncTop::xInitLib(Bool isFieldCoding) 759 759 { 760 760 #if H_MV … … 762 762 { 763 763 #if KWU_RC_MADPRED_E0227 764 m_acTEncTopList[layer]->init( this );765 #else 766 m_acTEncTopList[layer]->init( );767 #endif 768 } 769 #else 770 m_cTEncTop.init( );764 m_acTEncTopList[layer]->init( isFieldCoding, this ); 765 #else 766 m_acTEncTopList[layer]->init( isFieldCoding ); 767 #endif 768 } 769 #else 770 m_cTEncTop.init( isFieldCoding ); 771 771 #endif 772 772 } … … 799 799 xInitLibCfg(); 800 800 xCreateLib(); 801 xInitLib( );801 xInitLib(m_isField); 802 802 803 803 // main encoder loop … … 824 824 825 825 // allocate original YUV buffer 826 if( m_isField ) 827 { 828 pcPicYuvOrg->create( m_iSourceWidth, m_iSourceHeightOrg, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 829 } 830 else 831 { 826 832 pcPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 833 } 827 834 828 835 #if H_MV … … 900 907 for(Int layer=0; layer < m_numberOfLayers; layer++ ) 901 908 { 902 m_acTEncTopList[layer]->printSummary( m_acTEncTopList[layer]->getNumAllPicCoded() );909 m_acTEncTopList[layer]->printSummary( m_acTEncTopList[layer]->getNumAllPicCoded(), m_isField ); 903 910 } 904 911 #else … … 914 921 m_iFrameRcvd++; 915 922 916 bEos = (m_i FrameRcvd == m_framesToBeEncoded);923 bEos = (m_isField && (m_iFrameRcvd == (m_framesToBeEncoded >> 1) )) || ( !m_isField && (m_iFrameRcvd == m_framesToBeEncoded) ); 917 924 918 925 Bool flush = 0; … … 927 934 928 935 // call encoding function for one frame 936 if ( m_isField ) 937 { 938 m_cTEncTop.encode( bEos, flush ? 0 : pcPicYuvOrg, m_cListPicYuvRec, outputAccessUnits, iNumEncoded, m_isTopFieldFirst); 939 } 940 else 941 { 929 942 m_cTEncTop.encode( bEos, flush ? 0 : pcPicYuvOrg, m_cListPicYuvRec, outputAccessUnits, iNumEncoded ); 943 } 930 944 931 945 // write bistream to file if necessary … … 937 951 } 938 952 939 m_cTEncTop.printSummary( );953 m_cTEncTop.printSummary(m_isField); 940 954 #endif 941 955 … … 1048 1062 #endif 1049 1063 { 1050 Int i; 1051 1064 if (m_isField) 1065 { 1066 //Reinterlace fields 1067 Int i; 1052 1068 #if H_MV 1053 1069 if( iNumEncoded > 0 ) … … 1055 1071 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_picYuvRec[layerId]->end(); 1056 1072 #else 1057 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_cListPicYuvRec.end(); 1058 list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin(); 1059 #endif 1060 1061 for ( i = 0; i < iNumEncoded; i++ ) 1062 { 1063 --iterPicYuvRec; 1064 } 1065 1066 for ( i = 0; i < iNumEncoded; i++ ) 1067 { 1068 TComPicYuv* pcPicYuvRec = *(iterPicYuvRec++); 1073 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_cListPicYuvRec.end(); 1074 list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin(); 1075 #endif 1076 1077 for ( i = 0; i < iNumEncoded; i++ ) 1078 { 1079 --iterPicYuvRec; 1080 } 1081 1082 for ( i = 0; i < iNumEncoded/2; i++ ) 1083 { 1084 TComPicYuv* pcPicYuvRecTop = *(iterPicYuvRec++); 1085 TComPicYuv* pcPicYuvRecBottom = *(iterPicYuvRec++); 1086 1069 1087 #if H_MV 1070 1088 if (m_pchReconFileList[layerId]) 1071 1089 { 1072 m_acTVideoIOYuvReconFileList[layerId]->write( pcPicYuvRec, m_confLeft, m_confRight, m_confTop, m_confBottom ); 1073 } 1074 } 1075 } 1090 m_acTVideoIOYuvReconFileList[layerId]->write( pcPicYuvRecTop, pcPicYuvRecBottom, m_confLeft, m_confRight, m_confTop, m_confBottom, m_isTopFieldFirst ); 1091 } 1092 } 1076 1093 if( ! accessUnits.empty() ) 1077 1094 { … … 1079 1096 for( aUIter = accessUnits.begin(); aUIter != accessUnits.end(); aUIter++ ) 1080 1097 { 1098 const vector<UInt>& stats = writeAnnexB(bitstreamFile, *aUIter); 1099 rateStatsAccum(*aUIter, stats); 1100 } 1101 } 1102 #else 1103 if (m_pchReconFile) 1104 { 1105 m_cTVideoIOYuvReconFile.write( pcPicYuvRecTop, pcPicYuvRecBottom, m_confLeft, m_confRight, m_confTop, m_confBottom, m_isTopFieldFirst ); 1106 } 1107 1108 const AccessUnit& auTop = *(iterBitstream++); 1109 const vector<UInt>& statsTop = writeAnnexB(bitstreamFile, auTop); 1110 rateStatsAccum(auTop, statsTop); 1111 1112 const AccessUnit& auBottom = *(iterBitstream++); 1113 const vector<UInt>& statsBottom = writeAnnexB(bitstreamFile, auBottom); 1114 rateStatsAccum(auBottom, statsBottom); 1115 } 1116 #endif 1117 } 1118 else 1119 { 1120 Int i; 1121 #if H_MV 1122 if( iNumEncoded > 0 ) 1123 { 1124 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_picYuvRec[layerId]->end(); 1125 #else 1126 TComList<TComPicYuv*>::iterator iterPicYuvRec = m_cListPicYuvRec.end(); 1127 list<AccessUnit>::const_iterator iterBitstream = accessUnits.begin(); 1128 #endif 1129 1130 for ( i = 0; i < iNumEncoded; i++ ) 1131 { 1132 --iterPicYuvRec; 1133 } 1134 1135 for ( i = 0; i < iNumEncoded; i++ ) 1136 { 1137 TComPicYuv* pcPicYuvRec = *(iterPicYuvRec++); 1138 #if H_MV 1139 if (m_pchReconFileList[layerId]) 1140 { 1141 m_acTVideoIOYuvReconFileList[layerId]->write( pcPicYuvRec, m_confLeft, m_confRight, m_confTop, m_confBottom ); 1142 } 1143 } 1144 } 1145 if( ! accessUnits.empty() ) 1146 { 1147 list<AccessUnit>::iterator aUIter; 1148 for( aUIter = accessUnits.begin(); aUIter != accessUnits.end(); aUIter++ ) 1149 { 1081 1150 const vector<unsigned>& stats = writeAnnexB(bitstreamFile, *aUIter); 1082 1151 rateStatsAccum(*aUIter, stats); … … 1084 1153 } 1085 1154 #else 1086 if (m_pchReconFile)1087 {1088 m_cTVideoIOYuvReconFile.write( pcPicYuvRec, m_confLeft, m_confRight, m_confTop, m_confBottom );1089 }1090 1091 const AccessUnit& au = *(iterBitstream++);1092 const vector<UInt>& stats = writeAnnexB(bitstreamFile, au);1093 rateStatsAccum(au, stats);1094 } 1095 #endif 1096 }1097 1155 if (m_pchReconFile) 1156 { 1157 m_cTVideoIOYuvReconFile.write( pcPicYuvRec, m_confLeft, m_confRight, m_confTop, m_confBottom ); 1158 } 1159 1160 const AccessUnit& au = *(iterBitstream++); 1161 const vector<UInt>& stats = writeAnnexB(bitstreamFile, au); 1162 rateStatsAccum(au, stats); 1163 #endif 1164 } 1165 } 1166 } 1098 1167 /** 1099 1168 * -
branches/HTM-8.2-dev0-Cleanup/source/App/TAppEncoder/TAppEncTop.h
r648 r651 96 96 Void xCreateLib (); ///< create files & encoder class 97 97 Void xInitLibCfg (); ///< initialize internal variables 98 Void xInitLib ( );///< initialize encoder class98 Void xInitLib (Bool isFieldCoding); ///< initialize encoder class 99 99 Void xDestroyLib (); ///< destroy encoder class 100 100
Note: See TracChangeset for help on using the changeset viewer.