Changeset 713 in SHVCSoftware for trunk/source/App
- Timestamp:
- 21 Apr 2014, 04:44:16 (11 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-6-dev (added) merged: 651-712
- Property svn:mergeinfo changed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-6-dev/source (added) merged: 652-678,680,683-684,686-691,693-700,702-705,707-711
- Property svn:mergeinfo changed
-
trunk/source/App/TAppDecoder/TAppDecCfg.cpp
r595 r713 92 92 #if AVC_BASE 93 93 ("BLReconFile,-ibl", cfg_BLReconFile, string(""), "BL reconstructed YUV input file name") 94 #if !REPN_FORMAT_IN_VPS 94 95 ("BLSourceWidth,-wdt", m_iBLSourceWidth, 0, "BL source picture width") 95 96 ("BLSourceHeight,-hgt", m_iBLSourceHeight, 0, "BL source picture height") 97 #endif 96 98 #if AVC_SYNTAX 97 99 ("BLSyntaxFile,-ibs", cfg_BLSyntaxFile, string(""), "BL syntax input file name") -
trunk/source/App/TAppDecoder/TAppDecCfg.h
r595 r713 74 74 #if AVC_BASE 75 75 Char* m_pchBLReconFile; ///< input BL reconstruction file name 76 #if !REPN_FORMAT_IN_VPS 76 77 Int m_iBLSourceWidth; 77 78 Int m_iBLSourceHeight; 79 #endif 78 80 #if AVC_SYNTAX 79 81 Char* m_pchBLSyntaxFile; ///< input BL syntax file name … … 84 86 #if SYNTAX_OUTPUT 85 87 Char* m_pchBLSyntaxFile; ///< input BL syntax file name 88 #if !REPN_FORMAT_IN_VPS 86 89 Int m_iBLSourceWidth; 87 90 Int m_iBLSourceHeight; 91 #endif 88 92 Int m_iBLFrames; 89 93 #endif … … 108 112 #if SVC_EXTENSION 109 113 , m_tgtLayerId(0) 110 #if AVC_BASE 114 #if AVC_BASE && !REPN_FORMAT_IN_VPS 111 115 , m_iBLSourceWidth(0) 112 116 , m_iBLSourceHeight(0) -
trunk/source/App/TAppDecoder/TAppDecTop.cpp
r644 r713 163 163 } 164 164 TComList<TComPic*> *cListPic = m_acTDecTop[0].getListPic(); 165 #if AVC_SYNTAX || !REPN_FORMAT_IN_VPS 165 166 m_acTDecTop[0].setBLsize( m_iBLSourceWidth, m_iBLSourceHeight ); 167 #endif 166 168 m_acTDecTop[0].setBLReconFile( &streamYUV ); 167 169 pcBLPic.setLayerId( 0 ); … … 257 259 Bool outputPicturesFlag = true; 258 260 #if NO_OUTPUT_OF_PRIOR_PICS 259 if( m_acTDecTop[nalu.m_layerId].getNoOutput OfPriorPicsFlags() )261 if( m_acTDecTop[nalu.m_layerId].getNoOutputPriorPicsFlag() ) 260 262 { 261 263 outputPicturesFlag = false; … … 449 451 loopFiltered = (nalu.m_nalUnitType == NAL_UNIT_EOS); 450 452 } 453 #if !FIX_WRITING_OUTPUT 454 #if SETTING_NO_OUT_PIC_PRIOR 455 if (bNewPicture && m_cTDecTop.getNoOutputPriorPicsFlag()) 456 { 457 m_cTDecTop.checkNoOutputPriorPics( pcListPic ); 458 } 459 #endif 460 #endif 451 461 452 462 if( pcListPic ) … … 460 470 openedReconFile = true; 461 471 } 472 #if FIX_WRITING_OUTPUT 473 // write reconstruction to file 474 if( bNewPicture ) 475 { 476 xWriteOutput( pcListPic, nalu.m_temporalId ); 477 } 478 #if SETTING_NO_OUT_PIC_PRIOR 479 if ( (bNewPicture || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA) && m_cTDecTop.getNoOutputPriorPicsFlag() ) 480 { 481 m_cTDecTop.checkNoOutputPriorPics( pcListPic ); 482 m_cTDecTop.setNoOutputPriorPicsFlag (false); 483 } 484 #endif 485 #endif 462 486 if ( bNewPicture && 463 487 ( nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL … … 471 495 if (nalu.m_nalUnitType == NAL_UNIT_EOS) 472 496 { 497 #if FIX_OUTPUT_EOS 498 xWriteOutput( pcListPic, nalu.m_temporalId ); 499 #else 473 500 xFlushOutput( pcListPic ); 474 } 475 // write reconstruction to file 501 #endif 502 } 503 // write reconstruction to file -- for additional bumping as defined in C.5.2.3 504 #if FIX_WRITING_OUTPUT 505 if(!bNewPicture && nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_TRAIL_N && nalu.m_nalUnitType <= NAL_UNIT_RESERVED_VCL31) 506 #else 476 507 if(bNewPicture) 508 #endif 477 509 { 478 510 xWriteOutput( pcListPic, nalu.m_temporalId ); … … 586 618 TComList<TComPic*>::iterator iterPic = pcListPic->begin(); 587 619 Int numPicsNotYetDisplayed = 0; 620 Int dpbFullness = 0; 621 #if SVC_EXTENSION 622 TComSPS* activeSPS = m_acTDecTop[layerId].getActiveSPS(); 623 #else 624 TComSPS* activeSPS = m_cTDecTop.getActiveSPS(); 625 #endif 626 UInt numReorderPicsHighestTid; 627 UInt maxDecPicBufferingHighestTid; 628 UInt maxNrSublayers = activeSPS->getMaxTLayers(); 629 630 if(m_iMaxTemporalLayer == -1 || m_iMaxTemporalLayer >= maxNrSublayers) 631 { 632 numReorderPicsHighestTid = activeSPS->getNumReorderPics(maxNrSublayers-1); 633 maxDecPicBufferingHighestTid = activeSPS->getMaxDecPicBuffering(maxNrSublayers-1); 634 } 635 else 636 { 637 numReorderPicsHighestTid = activeSPS->getNumReorderPics(m_iMaxTemporalLayer); 638 maxDecPicBufferingHighestTid = activeSPS->getMaxDecPicBuffering(m_iMaxTemporalLayer); 639 } 588 640 589 641 while (iterPic != pcListPic->end()) … … 597 649 { 598 650 numPicsNotYetDisplayed++; 651 dpbFullness++; 652 } 653 else if(pcPic->getSlice( 0 )->isReferenced()) 654 { 655 dpbFullness++; 599 656 } 600 657 iterPic++; … … 619 676 620 677 #if SVC_EXTENSION 621 if ( pcPicTop->getOutputMark() && (numPicsNotYetDisplayed > pcPicTop->getNumReorderPics(tId) && !(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) 622 && pcPicBottom->getOutputMark() && (numPicsNotYetDisplayed > pcPicBottom->getNumReorderPics(tId) && (pcPicTop->getPOC() == m_aiPOCLastDisplay[layerId]+1 || m_aiPOCLastDisplay[layerId]<0))) 623 #else 624 if ( pcPicTop->getOutputMark() && (numPicsNotYetDisplayed > pcPicTop->getNumReorderPics(tId) && !(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) 625 && pcPicBottom->getOutputMark() && (numPicsNotYetDisplayed > pcPicBottom->getNumReorderPics(tId) && (pcPicTop->getPOC() == m_iPOCLastDisplay+1 || m_iPOCLastDisplay<0))) 678 if( pcPicTop->getOutputMark() && pcPicBottom->getOutputMark() && 679 (numPicsNotYetDisplayed > numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid) && 680 (!(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) && 681 (pcPicTop->getPOC() == m_aiPOCLastDisplay[layerId]+1 || m_aiPOCLastDisplay[layerId]<0) ) 682 #else 683 if ( pcPicTop->getOutputMark() && pcPicBottom->getOutputMark() && 684 (numPicsNotYetDisplayed > numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid) && 685 (!(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) && 686 (pcPicTop->getPOC() == m_iPOCLastDisplay+1 || m_iPOCLastDisplay < 0)) 626 687 #endif 627 688 { … … 634 695 const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window(); 635 696 const Bool isTff = pcPicTop->isTopField(); 697 TComPicYuv* pPicCYuvRecTop = pcPicTop->getPicYuvRec(); 698 TComPicYuv* pPicCYuvRecBot = pcPicBottom->getPicYuvRec(); 699 #if Q0074_SEI_COLOR_MAPPING 700 if( m_acTDecTop[layerId].m_ColorMapping->getColorMappingFlag() ) 701 { 702 pPicCYuvRecTop = m_acTDecTop[layerId].m_ColorMapping->getColorMapping( pPicCYuvRecTop, 0, layerId ); 703 pPicCYuvRecBot = m_acTDecTop[layerId].m_ColorMapping->getColorMapping( pPicCYuvRecBot, 1, layerId ); 704 } 705 #endif 636 706 #if REPN_FORMAT_IN_VPS 637 707 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); 638 708 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 639 m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 709 710 m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRecTop, pPicCYuvRecBot, 640 711 conf.getWindowLeftOffset() * xScal + defDisp.getWindowLeftOffset(), 641 712 conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(), 642 713 conf.getWindowTopOffset() * yScal + defDisp.getWindowTopOffset(), 643 714 conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset(), isTff ); 644 645 #else 646 #if O0194_DIFFERENT_BITDEPTH_EL_BL 647 // Compile time bug-fix 648 m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 649 #else 650 m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 651 #endif 715 #else 716 m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRecTop, pPicCYuvRecBot, 717 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 718 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 719 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 720 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff ); 721 #endif 722 } 723 724 // update POC of display order 725 m_aiPOCLastDisplay[layerId] = pcPicBottom->getPOC(); 726 #else 727 if ( m_pchReconFile ) 728 { 729 const Window &conf = pcPicTop->getConformanceWindow(); 730 const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window(); 731 const Bool isTff = pcPicTop->isTopField(); 732 TComPicYuv* pPicCYuvRecTop = pcPicTop->getPicYuvRec(); 733 TComPicYuv* pPicCYuvRecBot = pcPicBottom->getPicYuvRec(); 734 #if Q0074_SEI_COLOR_MAPPING 735 if ( m_cTDecTop.m_ColorMapping->getColorMappingFlag() ) 736 { 737 pPicCYuvRecTop = m_cTDecTop.m_ColorMapping->getColorMapping( pPicCYuvRecTop, 0 ); 738 pPicCYuvRecBot = m_cTDecTop.m_ColorMapping->getColorMapping( pPicCYuvRecBot, 1 ); 739 } 740 #endif 741 m_cTVideoIOYuvReconFile.write( pPicCYuvRecTop, pPicCYuvRecBot, 652 742 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 653 743 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 654 744 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 655 745 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff ); 656 #endif657 746 } 658 747 659 748 // update POC of display order 660 m_aiPOCLastDisplay[layerId] = pcPicBottom->getPOC(); 749 m_iPOCLastDisplay = pcPicBottom->getPOC(); 750 #endif 751 752 // erase non-referenced picture in the reference picture list after display 753 if ( !pcPicTop->getSlice(0)->isReferenced() && pcPicTop->getReconMark() == true ) 754 { 755 #if !DYN_REF_FREE 756 pcPicTop->setReconMark(false); 757 758 // mark it should be extended later 759 pcPicTop->getPicYuvRec()->setBorderExtension( false ); 760 761 #else 762 pcPicTop->destroy(); 763 pcListPic->erase( iterPic ); 764 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 765 continue; 766 #endif 767 } 768 if ( !pcPicBottom->getSlice(0)->isReferenced() && pcPicBottom->getReconMark() == true ) 769 { 770 #if !DYN_REF_FREE 771 pcPicBottom->setReconMark(false); 772 773 // mark it should be extended later 774 pcPicBottom->getPicYuvRec()->setBorderExtension( false ); 775 776 #else 777 pcPicBottom->destroy(); 778 pcListPic->erase( iterPic ); 779 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 780 continue; 781 #endif 782 } 783 pcPicTop->setOutputMark(false); 784 pcPicBottom->setOutputMark(false); 785 } 786 } 787 } 788 else if (!pcPic->isField()) //Frame Decoding 789 { 790 iterPic = pcListPic->begin(); 791 while (iterPic != pcListPic->end()) 792 { 793 pcPic = *(iterPic); 794 795 #if SVC_EXTENSION 796 if( pcPic->getOutputMark() && pcPic->getPOC() > m_aiPOCLastDisplay[layerId] && 797 (numPicsNotYetDisplayed > numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid) ) 798 #else 799 if(pcPic->getOutputMark() && pcPic->getPOC() > m_iPOCLastDisplay && 800 (numPicsNotYetDisplayed > numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid)) 801 #endif 802 { 803 // write to file 804 numPicsNotYetDisplayed--; 805 if(pcPic->getSlice(0)->isReferenced() == false) 806 { 807 dpbFullness--; 808 } 809 #if SVC_EXTENSION 810 if( m_pchReconFile[layerId] ) 811 { 812 const Window &conf = pcPic->getConformanceWindow(); 813 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 814 TComPicYuv* pPicCYuvRec = pcPic->getPicYuvRec(); 815 #if Q0074_SEI_COLOR_MAPPING 816 if ( m_acTDecTop[layerId].m_ColorMapping->getColorMappingFlag() ) 817 { 818 pPicCYuvRec = m_acTDecTop[layerId].m_ColorMapping->getColorMapping( pPicCYuvRec, 0, layerId ); 819 } 820 #endif 821 822 #if REPN_FORMAT_IN_VPS 823 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); 824 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 825 826 m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRec, 827 conf.getWindowLeftOffset() * xScal + defDisp.getWindowLeftOffset(), 828 conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(), 829 conf.getWindowTopOffset() * yScal + defDisp.getWindowTopOffset(), 830 conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset() ); 831 #else 832 m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRec, 833 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 834 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 835 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 836 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 837 #endif 838 } 839 840 // update POC of display order 841 m_aiPOCLastDisplay[layerId] = pcPic->getPOC(); 661 842 #else 662 843 if ( m_pchReconFile ) 844 { 845 #if SYNTAX_OUTPUT 846 TComPicYuv* pPicCYuvRec = pcPic->getPicYuvRec(); 847 #if Q0074_SEI_COLOR_MAPPING 848 if( m_acTDecTop[layerIdx].m_ColorMapping->getColorMappingFlag() ) 849 { 850 pPicCYuvRec = m_acTDecTop[layerIdx].m_ColorMapping->getColorMapping( pPicCYuvRec, 0, layerIdx ); 851 } 852 #endif 853 const Window &conf = pcPic->getConformanceWindow(); 854 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 855 m_cTVideoIOYuvReconFile.write( pPicCYuvRec, 856 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 857 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 858 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 859 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 860 #endif 861 } 862 863 // update POC of display order 864 m_iPOCLastDisplay = pcPic->getPOC(); 865 #endif 866 867 // erase non-referenced picture in the reference picture list after display 868 if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true ) 869 { 870 #if !DYN_REF_FREE 871 pcPic->setReconMark(false); 872 873 // mark it should be extended later 874 pcPic->getPicYuvRec()->setBorderExtension( false ); 875 876 #else 877 pcPic->destroy(); 878 pcListPic->erase( iterPic ); 879 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 880 continue; 881 #endif 882 } 883 pcPic->setOutputMark(false); 884 } 885 886 iterPic++; 887 } 888 } 889 } 890 891 /** \param pcListPic list of pictures to be written to file 892 \todo DYN_REF_FREE should be revised 893 */ 894 #if SVC_EXTENSION 895 Void TAppDecTop::xFlushOutput( TComList<TComPic*>* pcListPic, UInt layerId ) 896 #else 897 Void TAppDecTop::xFlushOutput( TComList<TComPic*>* pcListPic ) 898 #endif 899 { 900 if(!pcListPic || pcListPic->empty()) 901 { 902 return; 903 } 904 TComList<TComPic*>::iterator iterPic = pcListPic->begin(); 905 906 iterPic = pcListPic->begin(); 907 TComPic* pcPic = *(iterPic); 908 909 if (pcPic->isField()) //Field Decoding 910 { 911 TComList<TComPic*>::iterator endPic = pcListPic->end(); 912 endPic--; 913 TComPic *pcPicTop, *pcPicBottom = NULL; 914 while (iterPic != endPic) 915 { 916 pcPicTop = *(iterPic); 917 iterPic++; 918 pcPicBottom = *(iterPic); 919 920 if ( pcPicTop->getOutputMark() && pcPicBottom->getOutputMark() && !(pcPicTop->getPOC()%2) && (pcPicBottom->getPOC() == pcPicTop->getPOC()+1) ) 921 { 922 // write to file 923 #if SVC_EXTENSION 924 if ( m_pchReconFile[layerId] ) 663 925 { 664 926 const Window &conf = pcPicTop->getConformanceWindow(); 665 927 const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window(); 666 928 const Bool isTff = pcPicTop->isTopField(); 667 m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 929 TComPicYuv* pPicCYuvRecTop = pcPicTop->getPicYuvRec(); 930 TComPicYuv* pPicCYuvRecBot = pcPicBottom->getPicYuvRec(); 931 #if Q0074_SEI_COLOR_MAPPING 932 if( m_acTDecTop[layerId].m_ColorMapping->getColorMappingFlag() ) 933 { 934 pPicCYuvRecTop = m_acTDecTop[layerId].m_ColorMapping->getColorMapping( pPicCYuvRecTop, 0, layerId ); 935 pPicCYuvRecBot = m_acTDecTop[layerId].m_ColorMapping->getColorMapping( pPicCYuvRecBot, 1, layerId ); 936 } 937 #endif 938 #if REPN_FORMAT_IN_VPS 939 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); 940 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 941 942 m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRecTop, pPicCYuvRecBot, 943 conf.getWindowLeftOffset() *xScal + defDisp.getWindowLeftOffset(), 944 conf.getWindowRightOffset() *xScal + defDisp.getWindowRightOffset(), 945 conf.getWindowTopOffset() *yScal + defDisp.getWindowTopOffset(), 946 conf.getWindowBottomOffset()*yScal + defDisp.getWindowBottomOffset(), isTff ); 947 #else 948 m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRecTop, pPicCYuvRecBot, 949 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 950 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 951 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 952 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff ); 953 #endif 954 } 955 956 // update POC of display order 957 m_aiPOCLastDisplay[layerId] = pcPicBottom->getPOC(); 958 #else 959 if ( m_pchReconFile ) 960 { 961 const Window &conf = pcPicTop->getConformanceWindow(); 962 const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window(); 963 const Bool isTff = pcPicTop->isTopField(); 964 TComPicYuv* pPicCYuvRecTop = pcPicTop->getPicYuvRec(); 965 TComPicYuv* pPicCYuvRecBot = pcPicBottom->getPicYuvRec(); 966 #if Q0074_SEI_COLOR_MAPPING 967 if( m_cTDecTop.m_ColorMapping->getColorMappingFlag() ) 968 { 969 pPicCYuvRecTop = m_cTDecTop.m_ColorMapping->getColorMapping( pPicCYuvRecTop, 0 ); 970 pPicCYuvRecBot = m_cTDecTop.m_ColorMapping->getColorMapping( pPicCYuvRecBot, 1 ); 971 } 972 #endif 973 m_cTVideoIOYuvReconFile.write( pPicCYuvRecTop, pPicCYuvRecBot, 668 974 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 669 975 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), … … 709 1015 pcPicTop->setOutputMark(false); 710 1016 pcPicBottom->setOutputMark(false); 711 } 712 } 713 } 714 else if (!pcPic->isField()) //Frame Decoding 715 { 716 iterPic = pcListPic->begin(); 1017 1018 #if !DYN_REF_FREE 1019 if(pcPicTop) 1020 { 1021 pcPicTop->destroy(); 1022 delete pcPicTop; 1023 pcPicTop = NULL; 1024 } 1025 #endif 1026 } 1027 } 1028 if(pcPicBottom) 1029 { 1030 pcPicBottom->destroy(); 1031 delete pcPicBottom; 1032 pcPicBottom = NULL; 1033 } 1034 } 1035 else //Frame decoding 1036 { 717 1037 while (iterPic != pcListPic->end()) 718 1038 { 719 1039 pcPic = *(iterPic); 720 1040 721 #if SVC_EXTENSION 722 if ( pcPic->getOutputMark() && (numPicsNotYetDisplayed > pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_aiPOCLastDisplay[layerId])) 723 #else 724 if ( pcPic->getOutputMark() && (numPicsNotYetDisplayed > pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_iPOCLastDisplay)) 725 #endif 1041 if ( pcPic->getOutputMark() ) 726 1042 { 727 1043 // write to file 728 numPicsNotYetDisplayed--;729 1044 #if SVC_EXTENSION 730 1045 if ( m_pchReconFile[layerId] ) … … 732 1047 const Window &conf = pcPic->getConformanceWindow(); 733 1048 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 1049 TComPicYuv* pPicCYuvRec = pcPic->getPicYuvRec(); 1050 #if Q0074_SEI_COLOR_MAPPING 1051 if( m_acTDecTop[layerId].m_ColorMapping->getColorMappingFlag() ) 1052 { 1053 pPicCYuvRec = m_acTDecTop[layerId].m_ColorMapping->getColorMapping( pPicCYuvRec, 0, layerId ); 1054 } 1055 #endif 734 1056 #if REPN_FORMAT_IN_VPS 735 1057 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); 736 1058 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 737 m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), 738 conf.getWindowLeftOffset() * xScal + defDisp.getWindowLeftOffset(), 739 conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(), 740 conf.getWindowTopOffset() * yScal + defDisp.getWindowTopOffset(), 741 conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset() ); 742 743 #else 744 m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), 745 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 746 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 747 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 748 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 749 #endif 750 } 751 752 // update POC of display order 753 m_aiPOCLastDisplay[layerId] = pcPic->getPOC(); 754 #else 755 if ( m_pchReconFile ) 756 { 757 #if SYNTAX_OUTPUT 758 const Window &conf = pcPic->getConformanceWindow(); 759 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 760 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), 761 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 762 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 763 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 764 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 765 #endif 766 } 767 768 // update POC of display order 769 m_iPOCLastDisplay = pcPic->getPOC(); 770 #endif 771 772 // erase non-referenced picture in the reference picture list after display 773 if ( !pcPic->getSlice(0)->isReferenced() && pcPic->getReconMark() == true ) 774 { 775 #if !DYN_REF_FREE 776 pcPic->setReconMark(false); 777 778 // mark it should be extended later 779 pcPic->getPicYuvRec()->setBorderExtension( false ); 780 781 #else 782 pcPic->destroy(); 783 pcListPic->erase( iterPic ); 784 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 785 continue; 786 #endif 787 } 788 pcPic->setOutputMark(false); 789 } 790 791 iterPic++; 792 } 793 } 794 } 795 796 /** \param pcListPic list of pictures to be written to file 797 \todo DYN_REF_FREE should be revised 798 */ 799 #if SVC_EXTENSION 800 Void TAppDecTop::xFlushOutput( TComList<TComPic*>* pcListPic, UInt layerId ) 801 #else 802 Void TAppDecTop::xFlushOutput( TComList<TComPic*>* pcListPic ) 803 #endif 804 { 805 if(!pcListPic || pcListPic->empty()) 806 { 807 return; 808 } 809 TComList<TComPic*>::iterator iterPic = pcListPic->begin(); 810 811 iterPic = pcListPic->begin(); 812 TComPic* pcPic = *(iterPic); 813 814 if (pcPic->isField()) //Field Decoding 815 { 816 TComList<TComPic*>::iterator endPic = pcListPic->end(); 817 endPic--; 818 TComPic *pcPicTop, *pcPicBottom = NULL; 819 while (iterPic != endPic) 820 { 821 pcPicTop = *(iterPic); 822 iterPic++; 823 pcPicBottom = *(iterPic); 824 825 if ( pcPicTop->getOutputMark() && pcPicBottom->getOutputMark() && !(pcPicTop->getPOC()%2) && (pcPicBottom->getPOC() == pcPicTop->getPOC()+1) ) 826 { 827 // write to file 828 #if SVC_EXTENSION 829 if ( m_pchReconFile[layerId] ) 830 { 831 const Window &conf = pcPicTop->getConformanceWindow(); 832 const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window(); 833 const Bool isTff = pcPicTop->isTopField(); 834 #if REPN_FORMAT_IN_VPS 835 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); 836 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 837 m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 838 conf.getWindowLeftOffset() *xScal + defDisp.getWindowLeftOffset(), 839 conf.getWindowRightOffset() *xScal + defDisp.getWindowRightOffset(), 840 conf.getWindowTopOffset() *yScal + defDisp.getWindowTopOffset(), 841 conf.getWindowBottomOffset()*yScal + defDisp.getWindowBottomOffset(), isTff ); 842 843 #else 844 #if O0194_DIFFERENT_BITDEPTH_EL_BL 845 // Compile time bug-fix 846 m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 847 #else 848 m_cTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 849 #endif 850 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 851 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 852 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 853 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff ); 854 #endif 855 } 856 857 // update POC of display order 858 m_aiPOCLastDisplay[layerId] = pcPicBottom->getPOC(); 859 #else 860 if ( m_pchReconFile ) 861 { 862 const Window &conf = pcPicTop->getConformanceWindow(); 863 const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window(); 864 const Bool isTff = pcPicTop->isTopField(); 865 m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 866 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 867 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 868 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 869 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff ); 870 } 871 872 // update POC of display order 873 m_iPOCLastDisplay = pcPicBottom->getPOC(); 874 #endif 875 876 // erase non-referenced picture in the reference picture list after display 877 if ( !pcPicTop->getSlice(0)->isReferenced() && pcPicTop->getReconMark() == true ) 878 { 879 #if !DYN_REF_FREE 880 pcPicTop->setReconMark(false); 881 882 // mark it should be extended later 883 pcPicTop->getPicYuvRec()->setBorderExtension( false ); 884 885 #else 886 pcPicTop->destroy(); 887 pcListPic->erase( iterPic ); 888 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 889 continue; 890 #endif 891 } 892 if ( !pcPicBottom->getSlice(0)->isReferenced() && pcPicBottom->getReconMark() == true ) 893 { 894 #if !DYN_REF_FREE 895 pcPicBottom->setReconMark(false); 896 897 // mark it should be extended later 898 pcPicBottom->getPicYuvRec()->setBorderExtension( false ); 899 900 #else 901 pcPicBottom->destroy(); 902 pcListPic->erase( iterPic ); 903 iterPic = pcListPic->begin(); // to the beginning, non-efficient way, have to be revised! 904 continue; 905 #endif 906 } 907 pcPicTop->setOutputMark(false); 908 pcPicBottom->setOutputMark(false); 909 910 #if !DYN_REF_FREE 911 if(pcPicTop) 912 { 913 pcPicTop->destroy(); 914 delete pcPicTop; 915 pcPicTop = NULL; 916 } 917 #endif 918 } 919 } 920 if(pcPicBottom) 921 { 922 pcPicBottom->destroy(); 923 delete pcPicBottom; 924 pcPicBottom = NULL; 925 } 926 } 927 else //Frame decoding 928 { 929 while (iterPic != pcListPic->end()) 930 { 931 pcPic = *(iterPic); 932 933 if ( pcPic->getOutputMark() ) 934 { 935 // write to file 936 #if SVC_EXTENSION 937 if ( m_pchReconFile[layerId] ) 938 { 939 const Window &conf = pcPic->getConformanceWindow(); 940 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 941 #if REPN_FORMAT_IN_VPS 942 UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc(); 943 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 944 m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), 1059 1060 m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRec, 945 1061 conf.getWindowLeftOffset() *xScal + defDisp.getWindowLeftOffset(), 946 1062 conf.getWindowRightOffset() *xScal + defDisp.getWindowRightOffset(), 947 1063 conf.getWindowTopOffset() *yScal + defDisp.getWindowTopOffset(), 948 1064 conf.getWindowBottomOffset()*yScal + defDisp.getWindowBottomOffset() ); 949 950 #else 951 m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), 952 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 953 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 954 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 1065 #else 1066 m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRec, 1067 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 1068 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), 1069 conf.getWindowTopOffset() + defDisp.getWindowTopOffset(), 955 1070 conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() ); 956 1071 #endif … … 964 1079 const Window &conf = pcPic->getConformanceWindow(); 965 1080 const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window(); 966 m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(), 1081 TComPicYuv* pPicCYuvRec = pcPic->getPicYuvRec(); 1082 #if Q0074_SEI_COLOR_MAPPING 1083 if( m_cTDecTop.m_ColorMapping->getColorMappingFlag() ) 1084 { 1085 pPicCYuvRec = m_cTDecTop.m_ColorMapping->getColorMapping( pPicCYuvRec ); 1086 } 1087 #endif 1088 m_cTVideoIOYuvReconFile.write( pPicCYuvRec, 967 1089 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 968 1090 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), … … 1045 1167 yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 1046 1168 #endif 1047 m_acTVideoIOYuvReconFile[layerIdx].write( pic->getPicYuvRec(), 1169 TComPicYuv* pPicCYuvRec = pic->getPicYuvRec(); 1170 #if Q0074_SEI_COLOR_MAPPING 1171 pPicCYuvRec = m_acTDecTop[layerIdx].m_ColorMapping->getColorMapping( pPicCYuvRec, 0, layerIdx ); 1172 #endif 1173 m_acTVideoIOYuvReconFile[layerIdx].write( pPicCYuvRec, 1048 1174 conf.getWindowLeftOffset() * xScal + defDisp.getWindowLeftOffset(), 1049 1175 conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(), -
trunk/source/App/TAppEncoder/TAppEncCfg.cpp
r649 r713 339 339 string* cfg_ReconFile [MAX_LAYERS]; 340 340 Double* cfg_fQP [MAX_LAYERS]; 341 #if Q0074_SEI_COLOR_MAPPING 342 string* cfg_seiColorMappingFile[MAX_LAYERS]; 343 #endif 341 344 342 345 #if REPN_FORMAT_IN_VPS … … 433 436 cfg_IntraPeriod[layer] = &m_acLayerCfg[layer].m_iIntraPeriod; 434 437 cfg_conformanceMode[layer] = &m_acLayerCfg[layer].m_conformanceMode; 438 #if Q0074_SEI_COLOR_MAPPING 439 cfg_seiColorMappingFile[layer] = &m_acLayerCfg[layer].m_cSeiColorMappingFile; 440 #endif 435 441 #if LAYER_CTB 436 442 // coding unit (CU) definition … … 616 622 #endif 617 623 ("EnableElRapB,-use-rap-b", m_elRapSliceBEnabled, 0, "Set ILP over base-layer I picture to B picture (default is P picture)") 624 #if Q0074_SEI_COLOR_MAPPING 625 ("SEIColorMappingFile%d", cfg_seiColorMappingFile, string(""), MAX_LAYERS, "File Containing SEI Color Mapping data") 626 #endif 618 627 #else //SVC_EXTENSION 619 628 ("InputFile,i", cfg_InputFile, string(""), "Original YUV input file name") … … 710 719 ("IntraPeriod,-ip", m_iIntraPeriod, -1, "Intra period in frames, (-1: only first frame)") 711 720 #endif 721 #if ALLOW_RECOVERY_POINT_AS_RAP 722 ("DecodingRefreshType,-dr", m_iDecodingRefreshType, 0, "Intra refresh type (0:none 1:CRA 2:IDR 3:RecPointSEI)") 723 #else 712 724 ("DecodingRefreshType,-dr", m_iDecodingRefreshType, 0, "Intra refresh type (0:none 1:CRA 2:IDR)") 725 #endif 713 726 ("GOPSize,g", m_iGOPSize, 1, "GOP size of temporal structure") 714 727 // motion options … … 905 918 ("SEIToneMapCameraIsoSpeedIdc", m_cameraIsoSpeedIdc, 0, "Indicates the camera ISO speed for daylight illumination") 906 919 ("SEIToneMapCameraIsoSpeedValue", m_cameraIsoSpeedValue, 400, "Specifies the camera ISO speed for daylight illumination of Extended_ISO") 920 ("SEIToneMapExposureIndexIdc", m_exposureIndexIdc, 0, "Indicates the exposure index setting of the camera") 921 ("SEIToneMapExposureIndexValue", m_exposureIndexValue, 400, "Specifies the exposure index setting of the cameran of Extended_ISO") 907 922 ("SEIToneMapExposureCompensationValueSignFlag", m_exposureCompensationValueSignFlag, 0, "Specifies the sign of ExposureCompensationValue") 908 923 ("SEIToneMapExposureCompensationValueNumerator", m_exposureCompensationValueNumerator, 0, "Specifies the numerator of ExposureCompensationValue") … … 955 970 ("CrossLayerBLAFlag", m_crossLayerBLAFlag, false, "Specifies the value of cross_layer_bla_flag in VPS") 956 971 #endif 972 #if Q0048_CGS_3D_ASYMLUT 973 ("CGS", m_nCGSFlag , 0, "whether CGS is enabled") 974 ("CGSMaxOctantDepth", m_nCGSMaxOctantDepth , 1, "max octant depth") 975 ("CGSMaxYPartNumLog", m_nCGSMaxYPartNumLog2 , 2, "max Y part number ") 976 ("CGSLUTBit", m_nCGSLUTBit , 12, "bit depth of CGS LUT") 977 #endif 957 978 ; 958 979 … … 1202 1223 if( i >= m_acLayerCfg[layer].m_numSamplePredRefLayers ) 1203 1224 { 1204 printf( "NumSamplePredRefLayers : The number of columns whose width are defined is larger than the allowed number of columns.\n");1225 printf( "NumSamplePredRefLayers%d: The number of columns whose width are defined is larger than the allowed number of columns.\n", layer ); 1205 1226 exit( EXIT_FAILURE ); 1206 1227 } … … 1211 1232 if( i < m_acLayerCfg[layer].m_numSamplePredRefLayers ) 1212 1233 { 1213 printf( "NumSamplePredRefLayers : The width of some columns is not defined.\n");1234 printf( "NumSamplePredRefLayers%d: The width of some columns is not defined.\n", layer ); 1214 1235 exit( EXIT_FAILURE ); 1215 1236 } … … 1233 1254 if( i >= m_acLayerCfg[layer].m_numMotionPredRefLayers ) 1234 1255 { 1235 printf( "NumMotionPredRefLayers : The number of columns whose width are defined is larger than the allowed number of columns.\n");1256 printf( "NumMotionPredRefLayers%d: The number of columns whose width are defined is larger than the allowed number of columns.\n", layer ); 1236 1257 exit( EXIT_FAILURE ); 1237 1258 } … … 1242 1263 if( i < m_acLayerCfg[layer].m_numMotionPredRefLayers ) 1243 1264 { 1244 printf( "NumMotionPredRefLayers : The width of some columns is not defined.\n");1265 printf( "NumMotionPredRefLayers%d: The width of some columns is not defined.\n", layer ); 1245 1266 exit( EXIT_FAILURE ); 1246 1267 } … … 1272 1293 if( i >= m_acLayerCfg[layer].m_numActiveRefLayers ) 1273 1294 { 1274 printf( "NumActiveRefLayers : The number of columns whose width are defined is larger than the allowed number of columns.\n");1295 printf( "NumActiveRefLayers%d: The number of columns whose width are defined is larger than the allowed number of columns.\n", layer ); 1275 1296 exit( EXIT_FAILURE ); 1276 1297 } … … 1281 1302 if( i < m_acLayerCfg[layer].m_numActiveRefLayers ) 1282 1303 { 1283 printf( "NumActiveRefLayers : The width of some columns is not defined.\n");1304 printf( "NumActiveRefLayers%d: The width of some columns is not defined.\n", layer ); 1284 1305 exit( EXIT_FAILURE ); 1285 1306 } … … 1474 1495 } 1475 1496 } 1497 1476 1498 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 1477 1499 if (m_interLayerConstrainedTileSetsSEIEnabled) … … 1587 1609 xConfirmPara( (m_iIntraPeriod > 0 && m_iIntraPeriod < m_iGOPSize) || m_iIntraPeriod == 0, "Intra period must be more than GOP size, or -1 , not 0" ); 1588 1610 #endif 1611 #if ALLOW_RECOVERY_POINT_AS_RAP 1612 xConfirmPara( m_iDecodingRefreshType < 0 || m_iDecodingRefreshType > 3, "Decoding Refresh Type must be comprised between 0 and 3 included" ); 1613 if(m_iDecodingRefreshType == 3) 1614 { 1615 xConfirmPara( !m_recoveryPointSEIEnabled, "When using RecoveryPointSEI messages as RA points, recoveryPointSEI must be enabled" ); 1616 } 1617 #else 1589 1618 xConfirmPara( m_iDecodingRefreshType < 0 || m_iDecodingRefreshType > 2, "Decoding Refresh Type must be equal to 0, 1 or 2" ); 1619 #endif 1590 1620 #if !SVC_EXTENSION 1591 1621 xConfirmPara( m_iQP < -6 * (m_internalBitDepthY - 8) || m_iQP > 51, "QP exceeds supported range (-QpBDOffsety to 51)" ); … … 2160 2190 xConfirmPara( m_toneMapModelId < 0 || m_toneMapModelId > 4 , "SEIToneMapModelId must be in rage 0 to 4"); 2161 2191 xConfirmPara( m_cameraIsoSpeedValue == 0, "SEIToneMapCameraIsoSpeedValue shall not be equal to 0"); 2192 xConfirmPara( m_exposureIndexValue == 0, "SEIToneMapExposureIndexValue shall not be equal to 0"); 2162 2193 xConfirmPara( m_extendedRangeWhiteLevel < 100, "SEIToneMapExtendedRangeWhiteLevel should be greater than or equal to 100"); 2163 2194 xConfirmPara( m_nominalBlackLevelLumaCodeValue >= m_nominalWhiteLevelLumaCodeValue, "SEIToneMapNominalWhiteLevelLumaCodeValue shall be greater than SEIToneMapNominalBlackLevelLumaCodeValue"); … … 2286 2317 } 2287 2318 #endif 2319 #if Q0048_CGS_3D_ASYMLUT 2320 xConfirmPara( m_nCGSFlag < 0 || m_nCGSFlag > 1 , "0<=CGS<=1" ); 2321 #endif 2288 2322 #undef xConfirmPara 2289 2323 if (check_failed) … … 2545 2579 printf("RecalQP:%d", m_recalculateQPAccordingToLambda ? 1 : 0 ); 2546 2580 #endif 2581 #if Q0048_CGS_3D_ASYMLUT 2582 printf("CGS: %d CGSMaxOctantDepth: %d CGSMaxYPartNumLog2: %d CGSLUTBit:%d " , m_nCGSFlag , m_nCGSMaxOctantDepth , m_nCGSMaxYPartNumLog2 , m_nCGSLUTBit ); 2583 #endif 2547 2584 printf("\n\n"); 2548 2585 -
trunk/source/App/TAppEncoder/TAppEncCfg.h
r644 r713 255 255 Int m_cameraIsoSpeedIdc; 256 256 Int m_cameraIsoSpeedValue; 257 Int m_exposureIndexIdc; 258 Int m_exposureIndexValue; 257 259 Int m_exposureCompensationValueSignFlag; 258 260 Int m_exposureCompensationValueNumerator; … … 266 268 Int* m_codedPivotValue; 267 269 Int* m_targetPivotValue; 270 #if Q0074_SEI_COLOR_MAPPING 271 Char* m_pchSEIColorMappingFile; ///< SEI Color Mapping File (initialized from external file) 272 #endif 268 273 Int m_framePackingSEIEnabled; 269 274 Int m_framePackingSEIType; … … 393 398 Bool m_useInterLayerWeightedPred; 394 399 #endif 400 #if Q0048_CGS_3D_ASYMLUT 401 Int m_nCGSFlag; 402 Int m_nCGSMaxOctantDepth; 403 Int m_nCGSMaxYPartNumLog2; 404 Int m_nCGSLUTBit; 405 #endif 395 406 public: 396 407 TAppEncCfg(); -
trunk/source/App/TAppEncoder/TAppEncLayerCfg.cpp
r644 r713 171 171 } 172 172 #endif 173 #if REPN_FORMAT_IN_VPS 174 printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - ( m_confLeft + m_confRight ) * TComSPS::getWinUnitX( m_chromaFormatIDC ), m_iSourceHeight - ( m_confTop + m_confBottom ) * TComSPS::getWinUnitY( m_chromaFormatIDC ), m_iFrameRate ); 175 #else 173 176 printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - m_confLeft - m_confRight, m_iSourceHeight - m_confTop - m_confBottom, m_iFrameRate ); 177 #endif 174 178 printf("Internal Format : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate ); 175 179 #if O0194_DIFFERENT_BITDEPTH_EL_BL … … 229 233 m_aiPad[0] = m_confRight = ((m_iSourceWidth / minCuSize) + 1) * minCuSize - m_iSourceWidth; 230 234 m_iSourceWidth += m_confRight; 235 #if REPN_FORMAT_IN_VPS 236 m_confRight /= TComSPS::getWinUnitX( m_chromaFormatIDC ); 237 #endif 231 238 } 232 239 if (m_iSourceHeight % minCuSize) … … 239 246 m_aiPad[1] = m_confBottom << 1; 240 247 } 248 #if REPN_FORMAT_IN_VPS 249 m_confBottom /= TComSPS::getWinUnitY( m_chromaFormatIDC ); 250 #endif 241 251 } 242 252 break; … … 249 259 m_confRight = m_aiPad[0]; 250 260 m_confBottom = m_aiPad[1]; 261 #if REPN_FORMAT_IN_VPS 262 m_confRight /= TComSPS::getWinUnitX( m_chromaFormatIDC ); 263 m_confBottom /= TComSPS::getWinUnitY( m_chromaFormatIDC ); 264 #endif 251 265 break; 252 266 } … … 331 345 xConfirmPara( m_aiPad[1] % TComSPS::getWinUnitY(CHROMA_420) != 0, "Vertical padding must be an integer multiple of the specified chroma subsampling"); 332 346 347 #if !REPN_FORMAT_IN_VPS 333 348 xConfirmPara( m_confLeft % TComSPS::getWinUnitX(CHROMA_420) != 0, "Left conformance window offset must be an integer multiple of the specified chroma subsampling"); 334 349 xConfirmPara( m_confRight % TComSPS::getWinUnitX(CHROMA_420) != 0, "Right conformance window offset must be an integer multiple of the specified chroma subsampling"); 335 350 xConfirmPara( m_confTop % TComSPS::getWinUnitY(CHROMA_420) != 0, "Top conformance window offset must be an integer multiple of the specified chroma subsampling"); 336 351 xConfirmPara( m_confBottom % TComSPS::getWinUnitY(CHROMA_420) != 0, "Bottom conformance window offset must be an integer multiple of the specified chroma subsampling"); 352 #endif 337 353 338 354 #if LAYER_CTB -
trunk/source/App/TAppEncoder/TAppEncLayerCfg.h
r644 r713 54 54 Int *m_predLayerIds; 55 55 Int m_numActiveRefLayers; 56 #endif 57 #if Q0074_SEI_COLOR_MAPPING 58 string m_cSeiColorMappingFile; 56 59 #endif 57 60 -
trunk/source/App/TAppEncoder/TAppEncTop.cpp
r649 r713 91 91 } 92 92 93 #if REPN_FORMAT_IN_VPS 94 vps->setRepFormatIdxPresentFlag( true ); // Could be disabled to optimize in some cases. 93 #if REPN_FORMAT_IN_VPS 95 94 Int maxRepFormatIdx = -1; 96 95 Int formatIdx = -1; … … 125 124 126 125 assert( m_acLayerCfg[layer].getRepFormatIdx() != -1 && "RepFormatIdx not assigned for a layer" ); 126 127 127 vps->setVpsRepFormatIdx( layer, m_acLayerCfg[layer].getRepFormatIdx() ); 128 128 129 maxRepFormatIdx = std::max( m_acLayerCfg[layer].getRepFormatIdx(), maxRepFormatIdx ); 129 130 } 131 130 132 assert( vps->getVpsRepFormatIdx( 0 ) == 0 ); // Base layer should point to the first one. 133 131 134 Int* mapIdxToLayer = new Int[maxRepFormatIdx + 1]; 135 132 136 // Check that all the indices from 0 to maxRepFormatIdx are used in the VPS 133 137 for(Int i = 0; i <= maxRepFormatIdx; i++) … … 145 149 assert( layer != m_numLayers ); // One of the VPS Rep format indices not set 146 150 } 151 147 152 vps->setVpsNumRepFormats( maxRepFormatIdx + 1 ); 153 154 #if Q0195_REP_FORMAT_CLEANUP 155 // When not present, the value of rep_format_idx_present_flag is inferred to be equal to 0 156 vps->setRepFormatIdxPresentFlag( vps->getVpsNumRepFormats() > 1 ? true : false ); 157 #else 158 vps->setRepFormatIdxPresentFlag( true ); 159 #endif 160 148 161 for(UInt idx=0; idx < vps->getVpsNumRepFormats(); idx++) 149 162 { … … 467 480 m_acTEncTop[layer].setTMISEINominalWhiteLevelLumaCodeValue ( m_nominalWhiteLevelLumaCodeValue ); 468 481 m_acTEncTop[layer].setTMISEIExtendedWhiteLevelLumaCodeValue ( m_extendedWhiteLevelLumaCodeValue ); 482 #if Q0074_SEI_COLOR_MAPPING 483 m_acTEncTop[layer].setColorMappingInfoSEIFile ( m_acLayerCfg[layer].m_cSeiColorMappingFile.empty() ? NULL : const_cast<Char *>(m_acLayerCfg[layer].m_cSeiColorMappingFile.c_str()) ); 484 #endif 469 485 m_acTEncTop[layer].setFramePackingArrangementSEIEnabled( m_framePackingSEIEnabled ); 470 486 m_acTEncTop[layer].setFramePackingArrangementSEIType( m_framePackingSEIType ); … … 592 608 m_acTEncTop[layer].setCrossLayerBLAFlag( m_crossLayerBLAFlag ); 593 609 #endif 610 #if Q0048_CGS_3D_ASYMLUT 611 m_acTEncTop[layer].setCGSFlag( layer == 0 ? 0 : m_nCGSFlag ); 612 m_acTEncTop[layer].setCGSMaxOctantDepth( m_nCGSMaxOctantDepth ); 613 m_acTEncTop[layer].setCGSMaxYPartNumLog2( m_nCGSMaxYPartNumLog2 ); 614 m_acTEncTop[layer].setCGSLUTBit( m_nCGSLUTBit ); 615 #endif 594 616 } 595 617 } … … 767 789 m_cTEncTop.setTMISEICameraIsoSpeedIdc ( m_cameraIsoSpeedIdc ); 768 790 m_cTEncTop.setTMISEICameraIsoSpeedValue ( m_cameraIsoSpeedValue ); 791 m_cTEncTop.setTMISEIExposureIndexIdc ( m_exposureIndexIdc ); 792 m_cTEncTop.setTMISEIExposureIndexValue ( m_exposureIndexValue ); 769 793 m_cTEncTop.setTMISEIExposureCompensationValueSignFlag ( m_exposureCompensationValueSignFlag ); 770 794 m_cTEncTop.setTMISEIExposureCompensationValueNumerator ( m_exposureCompensationValueNumerator ); … … 775 799 m_cTEncTop.setTMISEINominalWhiteLevelLumaCodeValue ( m_nominalWhiteLevelLumaCodeValue ); 776 800 m_cTEncTop.setTMISEIExtendedWhiteLevelLumaCodeValue ( m_extendedWhiteLevelLumaCodeValue ); 801 #if Q0074_SEI_COLOR_MAPPING 802 m_cTEncTop.setColorMappingInfoSEIFile ( m_pchSEIColorMappingFile ); 803 #endif 777 804 m_cTEncTop.setFramePackingArrangementSEIEnabled( m_framePackingSEIEnabled ); 778 805 m_cTEncTop.setFramePackingArrangementSEIType( m_framePackingSEIType ); … … 974 1001 vps->setMaxLayerId(m_numLayers - 1); // Set max-layer ID 975 1002 1003 vps->setVpsExtensionFlag( m_numLayers > 1 ? true : false ); 1004 976 1005 vps->setNumLayerSets(m_numLayers); 977 1006 for(Int setId = 1; setId < vps->getNumLayerSets(); setId++) … … 1068 1097 #if VPS_TSLAYERS 1069 1098 vps->setMaxTSLayersPresentFlag(true); 1070 for( i = 0; i < MAX_VPS_LAYER_ID_PLUS1 - 1; i++ )1071 { 1072 1099 for( i = 0; i < vps->getMaxLayers(); i++ ) 1100 { 1101 vps->setMaxTSLayersMinus1(i, vps->getMaxTLayers()-1); 1073 1102 } 1074 1103 #endif … … 1081 1110 if (vps->getMaxTidRefPresentFlag()) 1082 1111 { 1083 for( i = 0; i < MAX_VPS_LAYER_ID_PLUS1- 1; i++ )1112 for( i = 0; i < vps->getMaxLayers() - 1; i++ ) 1084 1113 { 1085 1114 #if N0120_MAX_TID_REF_CFG 1086 1115 #if O0225_MAX_TID_FOR_REF_LAYERS 1087 for( Int j = i+1; j < = MAX_VPS_LAYER_ID_PLUS1 - 1; j++)1116 for( Int j = i+1; j < vps->getMaxLayers(); j++) 1088 1117 { 1089 1118 vps->setMaxTidIlRefPicsPlus1(i, j, m_acTEncTop[i].getMaxTidIlRefPicsPlus1()); … … 1094 1123 #else 1095 1124 #if O0225_MAX_TID_FOR_REF_LAYERS 1096 for( Int j = i+1; j < = MAX_VPS_LAYER_ID_PLUS1 - 1; j++)1125 for( Int j = i+1; j < vps->getMaxLayers(); j++) 1097 1126 { 1098 1127 vps->setMaxTidIlRefPicsPlus1(i, j, vps->getMaxTLayers()+1); … … 1106 1135 else 1107 1136 { 1108 for( i = 0; i < MAX_VPS_LAYER_ID_PLUS1- 1; i++ )1137 for( i = 0; i < vps->getMaxLayers() - 1; i++ ) 1109 1138 { 1110 1139 #if O0225_MAX_TID_FOR_REF_LAYERS 1111 for( Int j = i+1; j < = MAX_VPS_LAYER_ID_PLUS1 - 1; j++)1140 for( Int j = i+1; j < vps->getMaxLayers(); j++) 1112 1141 { 1113 1142 vps->setMaxTidIlRefPicsPlus1(i, j, 7); … … 1297 1326 if(vps->getMaxLayers() > MAX_REF_LAYERS) 1298 1327 { 1299 for(UInt layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++)1328 for(UInt layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++) 1300 1329 { 1301 1330 assert( vps->getNumRefLayers(vps->getLayerIdInNuh(layerCtr)) <= MAX_REF_LAYERS); … … 1400 1429 Int iPicWidth = pcCfgLayer->getSourceWidth(); 1401 1430 Int iPicHeight = pcCfgLayer->getSourceHeight(); 1431 #if LAYER_CTB 1432 UInt uiWidthInCU = ( iPicWidth % m_acLayerCfg[layerId].m_uiMaxCUWidth ) ? iPicWidth / m_acLayerCfg[layerId].m_uiMaxCUWidth + 1 : iPicWidth / m_acLayerCfg[layerId].m_uiMaxCUWidth; 1433 UInt uiHeightInCU = ( iPicHeight % m_acLayerCfg[layerId].m_uiMaxCUHeight ) ? iPicHeight / m_acLayerCfg[layerId].m_uiMaxCUHeight + 1 : iPicHeight / m_acLayerCfg[layerId].m_uiMaxCUHeight; 1434 #else 1402 1435 UInt uiWidthInCU = ( iPicWidth %m_uiMaxCUWidth ) ? iPicWidth /m_uiMaxCUWidth + 1 : iPicWidth /m_uiMaxCUWidth; 1403 1436 UInt uiHeightInCU = ( iPicHeight%m_uiMaxCUHeight ) ? iPicHeight/m_uiMaxCUHeight + 1 : iPicHeight/m_uiMaxCUHeight; 1437 #endif 1404 1438 UInt uiNumCUsInFrame = uiWidthInCU * uiHeightInCU; 1405 1439 1440 #if LAYER_CTB 1441 UInt maxCU = pcCfgLayer->getSliceArgument() >> ( m_acLayerCfg[layerId].m_uiMaxCUDepth << 1); 1442 #else 1406 1443 UInt maxCU = pcCfgLayer->getSliceArgument() >> ( m_uiMaxCUDepth << 1); 1444 #endif 1407 1445 UInt numDU = ( pcCfgLayer->getSliceMode() == 1 ) ? ( uiNumCUsInFrame / maxCU ) : ( 0 ); 1408 1446 if( uiNumCUsInFrame % maxCU != 0 || numDU == 0 )
Note: See TracChangeset for help on using the changeset viewer.