Ticket #287: num_reorder_frames_r2.patch
File num_reorder_frames_r2.patch, 13.2 KB (added by jonatan, 13 years ago) |
---|
-
source/App/TAppDecoder/TAppDecTop.cpp
272 272 273 273 #if G1002_RPS 274 274 #if G1002_IDR_POC_ZERO_BUGFIX 275 if ( pcPic->getOutputMark() && (not_displayed > m_cTDecTop.getSPS()->get MaxNumberOfReorderPictures() && pcPic->getPOC() > m_iPOCLastDisplay))275 if ( pcPic->getOutputMark() && (not_displayed > m_cTDecTop.getSPS()->getNumReorderFrames() && pcPic->getPOC() > m_iPOCLastDisplay)) 276 276 #else 277 277 if ( pcPic->getReconMark() && not_displayed > m_cTDecTop.getSPS()->getMaxNumberOfReorderPictures() && pcPic->getPOC() > m_iPOCLastDisplay) 278 278 #endif -
source/App/TAppEncoder/TAppEncCfg.cpp
188 188 ("DecodingRefreshType,-dr",m_iDecodingRefreshType, 0, "intra refresh, (0:none 1:CDR 2:IDR)") 189 189 ("GOPSize,g", m_iGOPSize, 1, "GOP size of temporal structure") 190 190 #if G1002_RPS 191 ("MaxNumberOfReorderPictures", m_ uiMaxNumberOfReorderPictures, 4u, "Max number of reorder pictures")192 ("MaxNumberOfReferencePictures", m_uiMaxNumberOfReferencePictures, 6u, "Max number of reference pictures")191 ("MaxNumberOfReorderPictures", m_numReorderFrames, -1, "Max. number of reorder pictures: 0: encoder determines value, >0: set explicitly") 192 ("MaxNumberOfReferencePictures", m_uiMaxNumberOfReferencePictures, 6u, "Max. number of reference pictures") 193 193 #else 194 194 ("RateGOPSize,-rg",m_iRateGOPSize, -1, "GOP size of hierarchical QP assignment (-1: implies inherit GOPSize value)") 195 195 ("NumOfReference,r", m_iNumOfReference, 1, "Number of reference (P)") … … 654 654 bIsOK[i]=false; 655 655 } 656 656 Int iNumOK=0; 657 m_uiMaxNumberOfReorderPictures=0;657 Int numReorderFramesRequired=0; 658 658 m_uiMaxNumberOfReferencePictures=0; 659 659 Int iLastDisp = -1; 660 660 m_iExtraRPSs=0; … … 840 840 if(aRefList[i]>iLastDisp) 841 841 iNonDisplayed++; 842 842 } 843 if(iNonDisplayed>m_uiMaxNumberOfReorderPictures) 844 m_uiMaxNumberOfReorderPictures=iNonDisplayed; 843 if(iNonDisplayed>numReorderFramesRequired) 844 { 845 numReorderFramesRequired=iNonDisplayed; 846 } 845 847 } 846 848 iCheckGOP++; 847 849 } 850 if (m_numReorderFrames == -1) 851 { 852 m_numReorderFrames = numReorderFramesRequired; 853 } 848 854 xConfirmPara(bError_GOP,"Invalid GOP structure given"); 849 855 for(Int i=0; i<m_iGOPSize; i++) 850 856 { 851 857 xConfirmPara(m_pcGOPList[i].m_iSliceType!='B'&&m_pcGOPList[i].m_iSliceType!='P', "Slice type must be equal to B or P"); 852 858 } 853 xConfirmPara( m_bUseLComb==false && m_uiMaxNumberOfReorderPictures!=0, "ListCombination can only be 0 in low delay coding (more precisely when L0 and L1 are identical)" ); // Note however this is not the full necessary condition as ref_pic_list_combination_flag can only be 0 if L0 == L1. 859 xConfirmPara( m_bUseLComb==false && m_numReorderFrames!=0, "ListCombination can only be 0 in low delay coding (more precisely when L0 and L1 are identical)" ); // Note however this is not the full necessary condition as ref_pic_list_combination_flag can only be 0 if L0 == L1. 860 xConfirmPara( m_numReorderFrames < numReorderFramesRequired, "For the used GOP the encoder requires more pictures for reordering than specified in MaxNumberOfReorderPictures" ); 854 861 #else 855 862 #if REF_SETTING_FOR_LD 856 863 xConfirmPara( m_bUseNewRefSetting && m_iGOPSize>1, "New reference frame setting was only designed for LD setting" ); -
source/App/TAppEncoder/TAppEncCfg.h
76 76 #if G1002_RPS 77 77 Int m_iExtraRPSs; 78 78 GOPEntry m_pcGOPList[MAX_GOP]; 79 UInt m_uiMaxNumberOfReorderPictures;///< total number of reorder pictures79 Int m_numReorderFrames; ///< total number of reorder pictures 80 80 UInt m_uiMaxNumberOfReferencePictures; ///< total number of reference pictures needed for decoding 81 81 #else 82 82 Int m_iRateGOPSize; ///< GOP size for QP variance -
source/App/TAppEncoder/TAppEncTop.cpp
80 80 #if G1002_RPS 81 81 m_cTEncTop.setGopList ( m_pcGOPList ); 82 82 m_cTEncTop.setExtraRPSs ( m_iExtraRPSs ); 83 m_cTEncTop.set MaxNumberOfReorderPictures ( m_uiMaxNumberOfReorderPictures );83 m_cTEncTop.setNumReorderFrames ( m_numReorderFrames ); 84 84 m_cTEncTop.setMaxNumberOfReferencePictures ( m_uiMaxNumberOfReferencePictures ); 85 85 #else 86 86 m_cTEncTop.setRateGOPSize ( m_iRateGOPSize ); -
source/Lib/TLibCommon/TComSlice.cpp
1598 1598 , m_uiMaxCUDepth ( 3) 1599 1599 , m_uiMinTrDepth ( 0) 1600 1600 , m_uiMaxTrDepth ( 1) 1601 #if G1002_RPS 1602 , m_numReorderFrames ( 0) 1603 #endif 1601 1604 , m_uiQuadtreeTULog2MaxSize ( 0) 1602 1605 , m_uiQuadtreeTULog2MinSize ( 0) 1603 1606 , m_uiQuadtreeTUMaxDepthInter ( 0) … … 1650 1653 #endif 1651 1654 #if MAX_DPB_AND_LATENCY 1652 1655 , m_uiMaxDecFrameBuffering ( 0) 1653 , m_uiNumReorderFrames ( 0)1654 1656 , m_uiMaxLatencyIncrease ( 0) 1655 1657 #endif 1656 1658 { -
source/Lib/TLibCommon/TComSlice.h
86 86 UInt m_uiMaxTrDepth; 87 87 #if G1002_RPS 88 88 UInt m_uiMaxNumberOfReferencePictures; 89 UInt m_uiMaxNumberOfReorderPictures;89 Int m_numReorderFrames; 90 90 #endif 91 91 92 92 // Tool list … … 172 172 #endif 173 173 #if MAX_DPB_AND_LATENCY // These could be used later when encoder wants to set their values 174 174 UInt m_uiMaxDecFrameBuffering; 175 UInt m_uiNumReorderFrames;176 175 UInt m_uiMaxLatencyIncrease; 177 176 #endif 178 177 … … 239 238 #if G1002_RPS 240 239 Void setMaxNumberOfReferencePictures( UInt u ) { m_uiMaxNumberOfReferencePictures = u; } 241 240 UInt getMaxNumberOfReferencePictures() { return m_uiMaxNumberOfReferencePictures; } 242 Void set MaxNumberOfReorderPictures( UInt u ) { m_uiMaxNumberOfReorderPictures = u; }243 UInt getMaxNumberOfReorderPictures() { return m_uiMaxNumberOfReorderPictures; }241 Void setNumReorderFrames( Int i ) { m_numReorderFrames = i; } 242 Int getNumReorderFrames() { return m_numReorderFrames; } 244 243 #endif 245 244 Void setPadX ( Int u ) { m_aiPad[0] = u; } 246 245 Void setPadY ( Int u ) { m_aiPad[1] = u; } … … 378 377 #if MAX_DPB_AND_LATENCY 379 378 UInt getMaxDecFrameBuffering () { return m_uiMaxDecFrameBuffering; } 380 379 Void setMaxDecFrameBuffering ( UInt ui ) { m_uiMaxDecFrameBuffering = ui; } 381 UInt getNumReorderFrames () { return m_uiNumReorderFrames; }382 Void setNumReorderFrames ( UInt ui ) { m_uiNumReorderFrames = ui; }383 380 UInt getMaxLatencyIncrease () { return m_uiMaxLatencyIncrease; } 384 381 Void setMaxLatencyIncrease ( UInt ui ) { m_uiMaxLatencyIncrease= ui; } 385 382 #endif -
source/Lib/TLibDecoder/TDecCAVLC.cpp
531 531 #if G1002_RPS 532 532 READ_UVLC( uiCode, "log2_max_pic_order_cnt_lsb_minus4" ); pcSPS->setBitsForPOC( 4 + uiCode ); 533 533 READ_UVLC( uiCode, "max_num_ref_pics" ); pcSPS->setMaxNumberOfReferencePictures(uiCode); 534 READ_UVLC( uiCode, " max_num_reorder_pics" ); pcSPS->setMaxNumberOfReorderPictures(uiCode);534 READ_UVLC( uiCode, "num_reorder_frames" ); pcSPS->setNumReorderFrames(uiCode); 535 535 #endif 536 #if MAX_DPB_AND_LATENCY 537 READ_UVLC ( uiCode, "max_dec_frame_buffering"); 538 pcSPS->setMaxDecFrameBuffering( uiCode ); 539 READ_UVLC ( uiCode, "max_latency_increase"); 540 pcSPS->setMaxLatencyIncrease( uiCode ); 541 #endif 536 542 #if !G507_COND_4X4_ENABLE_FLAG 537 543 #if DISABLE_4x4_INTER 538 544 xReadFlag( uiCode ); pcSPS->setDisInter4x4( uiCode ? true : false ); … … 691 697 692 698 #endif 693 699 694 #if MAX_DPB_AND_LATENCY695 READ_UVLC ( uiCode, "max_dec_frame_buffering");696 pcSPS->setMaxDecFrameBuffering( uiCode );697 READ_UVLC ( uiCode, "num_reorder_frames");698 pcSPS->setNumReorderFrames( uiCode );699 READ_UVLC ( uiCode, "max_latency_increase");700 pcSPS->setMaxLatencyIncrease( uiCode );701 #endif702 703 700 // Software-only flags 704 701 #if NSQT 705 702 READ_FLAG( uiCode, "enable_nsqt" ); -
source/Lib/TLibDecoder/TDecTop.cpp
175 175 xUpdateGopSize(pcSlice); 176 176 177 177 #if G1002_RPS 178 m_iMaxRefPicNum = pcSlice->getSPS()->getMaxNumberOfReferencePictures()+pcSlice->getSPS()->get MaxNumberOfReorderPictures() + 1; // +1 to have space for the picture currently being decoded178 m_iMaxRefPicNum = pcSlice->getSPS()->getMaxNumberOfReferencePictures()+pcSlice->getSPS()->getNumReorderFrames() + 1; // +1 to have space for the picture currently being decoded 179 179 #else 180 180 m_iMaxRefPicNum = max(m_iMaxRefPicNum, max(max(2, pcSlice->getNumRefIdx(REF_PIC_LIST_0)+1), m_iGopSize/2 + 2 + pcSlice->getNumRefIdx(REF_PIC_LIST_0))); 181 181 -
source/Lib/TLibEncoder/TEncCavlc.cpp
487 487 #if G1002_RPS 488 488 WRITE_UVLC( pcSPS->getBitsForPOC()-4, "log2_max_pic_order_cnt_lsb_minus4" ); 489 489 WRITE_UVLC( pcSPS->getMaxNumberOfReferencePictures(), "max_num_ref_pics" ); 490 WRITE_UVLC( pcSPS->get MaxNumberOfReorderPictures(), "max_num_reorder_pics" );490 WRITE_UVLC( pcSPS->getNumReorderFrames(), "num_reorder_frames" ); 491 491 #endif 492 #if MAX_DPB_AND_LATENCY 493 WRITE_UVLC(pcSPS->getMaxDecFrameBuffering(), "max_dec_frame_buffering" ); 494 WRITE_UVLC(pcSPS->getMaxLatencyIncrease(), "max_latency_increase" ); 495 #endif 492 496 #if !G507_COND_4X4_ENABLE_FLAG 493 497 #if DISABLE_4x4_INTER 494 498 xWriteFlag ( (pcSPS->getDisInter4x4()) ? 1 : 0 ); … … 629 633 630 634 #endif 631 635 632 #if MAX_DPB_AND_LATENCY633 WRITE_UVLC(pcSPS->getMaxDecFrameBuffering(), "max_dec_frame_buffering" );634 WRITE_UVLC(pcSPS->getNumReorderFrames(), "max_reorder_frames" );635 WRITE_UVLC(pcSPS->getMaxLatencyIncrease(), "max_latency_increase" );636 #endif637 638 636 // Software-only flags 639 637 #if NSQT 640 638 WRITE_FLAG( pcSPS->getUseNSQT(), "enable_nsqt" ); -
source/Lib/TLibEncoder/TEncCfg.h
117 117 GOPEntry m_pcGOPList[MAX_GOP]; 118 118 Int m_iExtraRPSs; 119 119 UInt m_uiMaxNumberOfReferencePictures; 120 UInt m_uiMaxNumberOfReorderPictures;120 Int m_numReorderFrames; 121 121 #else 122 122 Int m_iRateGOPSize; 123 123 Int m_iNumOfReference; … … 342 342 Void setExtraRPSs ( Int i ) { m_iExtraRPSs = i; } 343 343 GOPEntry getGOPEntry ( Int i ) { return m_pcGOPList[i]; } 344 344 Void setMaxNumberOfReferencePictures ( UInt u ) { m_uiMaxNumberOfReferencePictures = u; } 345 Void set MaxNumberOfReorderPictures ( UInt u ) { m_uiMaxNumberOfReorderPictures = u; }345 Void setNumReorderFrames ( Int i ) { m_numReorderFrames = i; } 346 346 #else 347 347 Void setRateGOPSize ( Int i ) { m_iRateGOPSize = i; } 348 348 Void setNumOfReference ( Int i ) { m_iNumOfReference = i; } … … 433 433 434 434 #else 435 435 UInt getMaxNumberOfReferencePictures () { return m_uiMaxNumberOfReferencePictures; } 436 UInt getMaxNumberOfReorderPictures () { return m_uiMaxNumberOfReorderPictures; }436 Int geNumReorderFrames () { return m_numReorderFrames; } 437 437 #endif 438 438 Int getQP () { return m_iQP; } 439 439 -
source/Lib/TLibEncoder/TEncTop.cpp
576 576 577 577 #if G1002_RPS 578 578 m_cSPS.setMaxNumberOfReferencePictures(m_uiMaxNumberOfReferencePictures); 579 m_cSPS.set MaxNumberOfReorderPictures(m_uiMaxNumberOfReorderPictures);579 m_cSPS.setNumReorderFrames(m_numReorderFrames); 580 580 #endif 581 581 m_cSPS.setPCMLog2MinSize (m_uiPCMLog2MinSize); 582 582 #if MAX_PCM_SIZE