Changeset 411 in SHVCSoftware
- Timestamp:
- 8 Oct 2013, 08:00:50 (11 years ago)
- Location:
- branches/SHM-3.1-dev/source/Lib
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-3.1-dev/source/Lib/TLibCommon/TComSlice.cpp
r409 r411 71 71 , m_iDepth ( 0 ) 72 72 , m_bRefenced ( false ) 73 #if POC_RESET_FLAG 74 , m_bPocResetFlag ( false ) 75 #endif 73 76 #if SH_DISCARDABLE_FLAG 74 77 , m_bDiscardableFlag ( false ) … … 269 272 pcPic = *(iterPic); 270 273 } 274 #if POC_RESET_FLAG 275 assert( pcPic->getSlice(0)->isReferenced() ); 276 #endif 271 277 return pcPic; 272 278 } … … 2768 2774 return; 2769 2775 } 2776 #if POC_RESET_FLAG 2777 if( this->getPocResetFlag() ) 2778 { 2779 setBaseColPic(refLayerIdc, xGetRefPic(rcListPic, 0)); 2780 } 2781 else 2782 { 2783 setBaseColPic(refLayerIdc, xGetRefPic(rcListPic, getPOC())); 2784 } 2785 #else 2770 2786 setBaseColPic(refLayerIdc, xGetRefPic(rcListPic, getPOC())); 2787 #endif 2771 2788 } 2772 2789 #endif … … 2782 2799 //set reference picture POC of each ILP reference 2783 2800 Int thePoc = ilpPic[refLayerIdc]->getPOC(); 2784 assert(thePoc >= 0); 2801 assert(thePoc >= 0); 2785 2802 assert(thePoc == pcRefPicBL->getPOC()); 2786 2803 -
branches/SHM-3.1-dev/source/Lib/TLibCommon/TComSlice.h
r409 r411 1568 1568 Bool m_bRefenced; 1569 1569 1570 #if POC_RESET_FLAG 1571 Bool m_bPocResetFlag; 1572 Int m_pocValueBeforeReset; 1573 #endif 1570 1574 #if SH_DISCARDABLE_FLAG 1571 1575 Bool m_bDiscardableFlag; 1572 1576 #endif 1573 1574 1577 // access channel 1575 1578 TComVPS* m_pcVPS; … … 1730 1733 #endif 1731 1734 1735 #if POC_RESET_FLAG 1736 Bool getPocResetFlag () { return m_bPocResetFlag; } 1737 Void setPocResetFlag (Bool b) { m_bPocResetFlag = b; } 1738 Int getPocValueBeforeReset () { return m_pocValueBeforeReset; } 1739 Void setPocValueBeforeReset (Int x) { m_pocValueBeforeReset = x ; } 1740 #endif 1732 1741 #if SH_DISCARDABLE_FLAG 1733 1742 Bool getDiscardableFlag () { return m_bDiscardableFlag; } -
branches/SHM-3.1-dev/source/Lib/TLibCommon/TypeDef.h
r410 r411 49 49 #define VPS_NUH_LAYER_ID 1 ///< N0085: Assert that the nuh_layer_id of VPS NAL unit should be 0 50 50 #if SVC_EXTENSION 51 #define POC_RESET_FLAG 1 ///< N0244: POC reset flag for layer pictures. 51 52 #define MAX_LAYERS 2 ///< max number of layers the codec is supposed to handle 52 53 #define REPN_FORMAT_IN_VPS 1 ///< N0092: Signal represenation format (spatial resolution, bit depth, colour format) in the VPS -
branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r409 r411 1439 1439 if(!rpcSlice->getDependentSliceSegmentFlag()) 1440 1440 { 1441 1441 #if POC_RESET_FLAG 1442 Int i = 0; 1443 if(rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > i) 1444 { 1445 READ_FLAG(uiCode, "poc_reset_flag"); rpcSlice->setPocResetFlag( uiCode ? true : false ); 1446 i++; 1447 } 1448 if(rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > i) 1449 { 1450 READ_FLAG(uiCode, "discardable_flag"); // ignored 1451 i++; 1452 } 1453 for (; i < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++) 1454 { 1455 READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored 1456 } 1457 #else 1442 1458 #if SH_DISCARDABLE_FLAG 1443 1459 if(rpcSlice->getPPS()->getNumExtraSliceHeaderBits()>0) … … 1454 1470 READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored 1455 1471 } 1472 #endif 1456 1473 #endif 1457 1474 -
branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecTop.cpp
r410 r411 647 647 648 648 #if SVC_EXTENSION 649 #if POC_RESET_FLAG 650 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int &iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC ) 651 #else 649 652 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC ) 653 #endif 650 654 #else 651 655 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay ) … … 780 784 } 781 785 m_bFirstSliceInSequence = false; 786 #if POC_RESET_FLAG 787 // This operation would do the following: 788 // 1. Update the other picture in the DPB. This should be done only for the first slice of the picture. 789 // 2. Update the value of m_pocCRA. 790 // 3. Reset the POC values at the decoder for the current picture to be zero. 791 // 4. update value of POCLastDisplay 792 if( m_apcSlicePilot->getPocResetFlag() ) 793 { 794 if( m_apcSlicePilot->getSliceIdx() == 0 ) 795 { 796 Int pocAdjustValue = m_apcSlicePilot->getPOC(); 797 798 // If poc reset flag is set to 1, reset all POC for DPB -> basically do it for each slice in the picutre 799 TComList<TComPic*>::iterator iterPic = m_cListPic.begin(); 800 801 // Iterate through all picture in DPB 802 while( iterPic != m_cListPic.end() ) 803 { 804 TComPic *dpbPic = *iterPic; 805 // Check if the picture pointed to by iterPic is either used for reference or 806 // needed for output, are in the same layer, and not the current picture. 807 if( /* ( ( dpbPic->getSlice(0)->isReferenced() ) || ( dpbPic->getOutputMark() ) ) 808 &&*/ ( dpbPic->getLayerId() == m_apcSlicePilot->getLayerId() ) 809 && ( dpbPic->getReconMark() ) 810 ) 811 { 812 for(Int i = dpbPic->getNumAllocatedSlice()-1; i >= 0; i--) 813 { 814 815 TComSlice *slice = dpbPic->getSlice(i); 816 TComReferencePictureSet *rps = slice->getRPS(); 817 slice->setPOC( slice->getPOC() - pocAdjustValue ); 818 819 // Also adjust the POC value stored in the RPS of each such slice 820 for(Int j = rps->getNumberOfPictures(); j >= 0; j--) 821 { 822 rps->setPOC( j, rps->getPOC(j) - pocAdjustValue ); 823 } 824 // Also adjust the value of refPOC 825 for(Int k = 0; k < 2; k++) // For List 0 and List 1 826 { 827 RefPicList list = (k == 1) ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 828 for(Int j = 0; j < slice->getNumRefIdx(list); j++) 829 { 830 slice->setRefPOC( slice->getRefPOC(list, j) - pocAdjustValue, list, j); 831 } 832 } 833 } 834 } 835 iterPic++; 836 } 837 // Update the value of pocCRA 838 m_pocCRA -= pocAdjustValue; 839 // Update value of POCLastDisplay 840 iPOCLastDisplay -= pocAdjustValue; 841 } 842 // Reset current poc for current slice and RPS 843 m_apcSlicePilot->setPOC( 0 ); 844 } 845 #endif 782 846 //detect lost reference picture and insert copy of earlier frame. 783 847 Int lostPoc; -
branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecTop.h
r389 r411 229 229 Void xActivateParameterSets(); 230 230 #if SVC_EXTENSION 231 #if POC_RESET_FLAG 232 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int &iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC); 233 #else 231 234 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC); 235 #endif 232 236 #else 233 237 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay); -
branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r409 r411 1105 1105 { 1106 1106 1107 #if POC_RESET_FLAG 1108 Int i = 0; 1109 if( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > i ) 1110 { 1111 WRITE_FLAG( pcSlice->getPocResetFlag(), "poc_reset_flag" ); 1112 i++; 1113 } 1114 if( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > i ) 1115 { 1116 assert(!!"discardable_flag"); 1117 WRITE_FLAG(pcSlice->getDiscardableFlag(), "discardable_flag"); 1118 i++; 1119 } 1120 for ( ; i < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++) 1121 { 1122 assert(!!"slice_reserved_undetermined_flag[]"); 1123 WRITE_FLAG(0, "slice_reserved_undetermined_flag[]"); 1124 } 1125 #else 1107 1126 #if SH_DISCARDABLE_FLAG 1108 1127 if (pcSlice->getPPS()->getNumExtraSliceHeaderBits()>0) … … 1122 1141 WRITE_FLAG(0, "slice_reserved_undetermined_flag[]"); 1123 1142 } 1143 #endif 1124 1144 #endif 1125 1145 … … 1143 1163 if( !pcSlice->getIdrPicFlag() ) 1144 1164 { 1165 #if POC_RESET_FLAG 1166 Int picOrderCntLSB; 1167 if( !pcSlice->getPocResetFlag() ) 1168 { 1169 picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC()))%(1<<pcSlice->getSPS()->getBitsForPOC()); 1170 } 1171 else 1172 { 1173 picOrderCntLSB = (pcSlice->getPocValueBeforeReset()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC()))%(1<<pcSlice->getSPS()->getBitsForPOC()); 1174 } 1175 #else 1145 1176 Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC()))%(1<<pcSlice->getSPS()->getBitsForPOC()); 1177 #endif 1146 1178 WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb"); 1147 1179 TComReferencePictureSet* rps = pcSlice->getRPS(); -
branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r410 r411 503 503 m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getSPS(), m_pcEncTop->getPPS() ); 504 504 #endif 505 505 #if POC_RESET_FLAG 506 if( !pcSlice->getPocResetFlag() ) // For picture that are not reset, we should adjust the value of POC calculated from the configuration files. 507 { 508 // Subtract POC adjustment value until now. 509 pcSlice->setPOC( pcSlice->getPOC() - m_pcEncTop->getPocAdjustmentValue() ); 510 } 511 else 512 { 513 // Check if this is the first slice in the picture 514 // In the encoder, the POC values are copied along with copySliceInfo, so we only need 515 // to do this for the first slice. 516 Int pocAdjustValue = pcSlice->getPOC() - m_pcEncTop->getPocAdjustmentValue(); 517 if( pcSlice->getSliceIdx() == 0 ) 518 { 519 TComList<TComPic*>::iterator iterPic = rcListPic.begin(); 520 521 // Iterate through all picture in DPB 522 while( iterPic != rcListPic.end() ) 523 { 524 TComPic *dpbPic = *iterPic; 525 if( dpbPic->getPOC() == pocCurr ) 526 { 527 if( dpbPic->getReconMark() ) 528 { 529 assert( !( dpbPic->getSlice(0)->isReferenced() ) && !( dpbPic->getOutputMark() ) ); 530 } 531 } 532 // Check if the picture pointed to by iterPic is either used for reference or 533 // needed for output, are in the same layer, and not the current picture. 534 if( /* ( ( dpbPic->getSlice(0)->isReferenced() ) || ( dpbPic->getOutputMark() ) ) 535 && */ ( dpbPic->getLayerId() == pcSlice->getLayerId() ) 536 && ( dpbPic->getReconMark() ) 537 ) 538 { 539 for(Int i = dpbPic->getNumAllocatedSlice()-1; i >= 0; i--) 540 { 541 TComSlice *slice = dpbPic->getSlice(i); 542 TComReferencePictureSet *rps = slice->getRPS(); 543 slice->setPOC( dpbPic->getSlice(i)->getPOC() - pocAdjustValue ); 544 545 // Also adjust the POC value stored in the RPS of each such slice 546 for(Int j = rps->getNumberOfPictures(); j >= 0; j--) 547 { 548 rps->setPOC( j, rps->getPOC(j) - pocAdjustValue ); 549 } 550 // Also adjust the value of refPOC 551 for(Int k = 0; k < 2; k++) // For List 0 and List 1 552 { 553 RefPicList list = (k == 1) ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 554 for(Int j = 0; j < slice->getNumRefIdx(list); j++) 555 { 556 slice->setRefPOC( slice->getRefPOC(list, j) - pocAdjustValue, list, j); 557 } 558 } 559 } 560 } 561 iterPic++; 562 } 563 m_pcEncTop->setPocAdjustmentValue( m_pcEncTop->getPocAdjustmentValue() + pocAdjustValue ); 564 } 565 pcSlice->setPocValueBeforeReset( pcSlice->getPOC() - m_pcEncTop->getPocAdjustmentValue() + pocAdjustValue ); 566 pcSlice->setPOC( 0 ); 567 } 568 #endif 506 569 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 507 570 if (m_pcEncTop->getAdaptiveResolutionChange() > 0 && m_layerId == 1 && pocCurr > m_pcEncTop->getAdaptiveResolutionChange()) … … 810 873 { 811 874 #if RESTR_CHK 875 #if POC_RESET_FLAG 876 if ( pocCurr > 0 && pcSlice->isRADL() && pcPic->getSlice(0)->getBaseColPic(pcPic->getSlice(0)->getInterLayerPredLayerIdc(0))->getSlice(0)->isRASL()) 877 #else 812 878 if (pcSlice->getPOC()>0 && pcSlice->isRADL() && pcPic->getSlice(0)->getBaseColPic(pcPic->getSlice(0)->getInterLayerPredLayerIdc(0))->getSlice(0)->isRASL()) 879 #endif 813 880 { 814 881 #if JCTVC_M0458_INTERLAYER_RPS_SIG … … 1065 1132 1066 1133 Int sliceQP = m_pcCfg->getInitialQP(); 1134 #if POC_RESET_FLAG 1135 if ( ( pocCurr == 0 && m_pcCfg->getInitialQP() > 0 ) || ( frameLevel == 0 && m_pcCfg->getForceIntraQP() ) ) // QP is specified 1136 #else 1067 1137 if ( ( pcSlice->getPOC() == 0 && m_pcCfg->getInitialQP() > 0 ) || ( frameLevel == 0 && m_pcCfg->getForceIntraQP() ) ) // QP is specified 1138 #endif 1068 1139 { 1069 1140 Int NumberBFrames = ( m_pcCfg->getGOPSize() - 1 ); … … 1510 1581 } 1511 1582 pictureTimingSEI.m_auCpbRemovalDelay = std::max<Int>(1, m_totalCoded - m_lastBPSEI); // Syntax element signalled as minus, hence the . 1583 #if POC_RESET_FLAG 1584 pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(0) + pocCurr - m_totalCoded; 1585 #else 1512 1586 pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(0) + pcSlice->getPOC() - m_totalCoded; 1587 #endif 1513 1588 Int factor = pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getTickDivisorMinus2() + 2; 1514 1589 pictureTimingSEI.m_picDpbOutputDuDelay = factor * pictureTimingSEI.m_picDpbOutputDelay; … … 1615 1690 SEIRecoveryPoint sei_recovery_point; 1616 1691 sei_recovery_point.m_recoveryPocCnt = 0; 1692 #if POC_RESET_FLAG 1693 sei_recovery_point.m_exactMatchingFlag = ( pocCurr == 0 ) ? (true) : (false); 1694 #else 1617 1695 sei_recovery_point.m_exactMatchingFlag = ( pcSlice->getPOC() == 0 ) ? (true) : (false); 1696 #endif 1618 1697 sei_recovery_point.m_brokenLinkFlag = false; 1619 1698 … … 1751 1830 tmpBitsBeforeWriting = m_pcEntropyCoder->getNumberOfWrittenBits(); 1752 1831 #endif 1832 1753 1833 m_pcEntropyCoder->encodeSliceHeader(pcSlice); 1834 1754 1835 #if RATE_CONTROL_LAMBDA_DOMAIN 1755 1836 actualHeadBits += ( m_pcEntropyCoder->getNumberOfWrittenBits() - tmpBitsBeforeWriting ); -
branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncTop.cpp
r405 r411 92 92 #endif 93 93 #endif 94 #if POC_RESET_FLAG 95 m_pocAdjustmentValue = 0; 96 #endif 94 97 } 95 98 … … 898 901 m_cPPS.setSPSId ( m_iSPSIdCnt ); 899 902 #endif 903 #if POC_RESET_FLAG 904 m_cPPS.setNumExtraSliceHeaderBits( 2 ); 905 #endif 900 906 } 901 907 -
branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncTop.h
r377 r411 144 144 #endif 145 145 #endif 146 #if POC_RESET_FLAG 147 Int m_pocAdjustmentValue; 148 #endif 146 149 protected: 147 150 Void xGetNewPicBuffer ( TComPic*& rpcPic ); ///< get picture buffer which will be processed … … 243 246 244 247 void printSummary() { m_cGOPEncoder.printOutSummary (m_uiNumAllPicCoded); } 248 #if POC_RESET_FLAG 249 Int getPocAdjustmentValue() { return m_pocAdjustmentValue;} 250 Void setPocAdjustmentValue(Int x) { m_pocAdjustmentValue = x; } 251 #endif 245 252 }; 246 253
Note: See TracChangeset for help on using the changeset viewer.