Changeset 411 in SHVCSoftware for branches/SHM-3.1-dev/source/Lib/TLibEncoder
- Timestamp:
- 8 Oct 2013, 08:00:50 (12 years ago)
- Location:
- branches/SHM-3.1-dev/source/Lib/TLibEncoder
- Files:
-
- 4 edited
-
TEncCavlc.cpp (modified) (3 diffs)
-
TEncGOP.cpp (modified) (6 diffs)
-
TEncTop.cpp (modified) (2 diffs)
-
TEncTop.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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.