Changeset 1093 in SHVCSoftware for branches/SHM-dev/source
- Timestamp:
- 2 Jul 2015, 21:00:14 (9 years ago)
- Location:
- branches/SHM-dev/source/Lib
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
r1092 r1093 126 126 , m_bMFMEnabledFlag ( false ) 127 127 #endif 128 #if POC_RESET_FLAG129 , m_bPocResetFlag ( false )130 #endif131 128 , m_bDiscardableFlag ( false ) 132 129 #if O0149_CROSS_LAYER_BLA_FLAG … … 320 317 pcPic = *(iterPic); 321 318 } 322 #if POC_RESET_ FLAG || POC_RESET_IDC_DECODER319 #if POC_RESET_IDC_DECODER 323 320 assert( pcPic->getSlice(0)->isReferenced() ); 324 321 #endif … … 350 347 } 351 348 352 #if POC_RESET_RPS353 if( ((!pocHasMsb) && ((poc & (pocCycle-1)) == picPoc)) || ( pocHasMsb && (poc == picPoc)) )354 #else355 349 if (poc == picPoc) 356 #endif357 350 { 358 351 if(pcPic->getIsLongTerm()) … … 4158 4151 return false; 4159 4152 } 4160 #if POC_RESET_FLAG || POC_RESET_IDC_DECODER4161 4153 #if POC_RESET_IDC_DECODER 4162 4154 TComPic* pic = xGetRefPic( rcListPic, getPOC() ); 4163 #else4164 TComPic* pic = xGetRefPic( rcListPic, m_bPocResetFlag ? 0 : m_iPOC );4165 #endif4166 4155 4167 4156 if( pic ) … … 4184 4173 TComPic* TComSlice::getBaseColPic( TComList<TComPic*>& rcListPic ) 4185 4174 { 4186 #if POC_RESET_FLAG4187 return xGetRefPic( rcListPic, m_bPocResetFlag ? 0 : m_iPOC );4188 #else4189 4175 return xGetRefPic( rcListPic, m_iPOC ); 4190 #endif4191 4176 } 4192 4177 #endif -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
r1092 r1093 2331 2331 Int m_activeNumILRRefIdx; //< Active inter-layer reference pictures 2332 2332 Int m_interLayerPredLayerIdc [MAX_VPS_LAYER_IDX_PLUS1]; 2333 #if POC_RESET_FLAG2334 Bool m_bPocResetFlag;2335 Int m_pocValueBeforeReset;2336 #endif2337 2333 Bool m_bDiscardableFlag; 2338 2334 #if O0149_CROSS_LAYER_BLA_FLAG … … 2478 2474 2479 2475 #if SVC_EXTENSION 2480 #if PREVTID0_POC_RESET2481 Void adjustPrevTid0POC (Int adj) { m_prevTid0POC=m_prevTid0POC-adj; }2482 #endif2483 2476 #if POC_RESET_IDC_DECODER 2484 2477 Void setPrevTid0POC( Int x ) { m_prevTid0POC = x; } … … 2676 2669 || m_eNalUnitType == NAL_UNIT_RESERVED_VCL_N14 ); } 2677 2670 #endif 2678 #if POC_RESET_FLAG2679 Bool getPocResetFlag () { return m_bPocResetFlag; }2680 Void setPocResetFlag (Bool b) { m_bPocResetFlag = b; }2681 Int getPocValueBeforeReset () { return m_pocValueBeforeReset; }2682 Void setPocValueBeforeReset (Int x) { m_pocValueBeforeReset = x ; }2683 #endif2684 2671 Bool getDiscardableFlag () { return m_bDiscardableFlag; } 2685 2672 Void setDiscardableFlag (Bool b) { m_bDiscardableFlag = b; } -
branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
r1090 r1093 134 134 #endif 135 135 #define O0194_WEIGHTED_PREDICTION_CGS 1 ///< JCTVC-O0194: Weighted prediction for colour gamut scalability 136 #define POC_RESET_FLAG 0 ///< JCTVC-N0244: POC reset flag for layer pictures. 137 #define POC_RESET_IDC 1 ///< JCTVC-P0041: Include poc_reset_idc and related derivation - eventually will replace POC_RESET_FLAG 136 #define POC_RESET_IDC 1 ///< JCTVC-P0041: Include poc_reset_idc and related derivation 138 137 #if POC_RESET_IDC 139 138 #define POC_RESET_IDC_SIGNALLING 1 ///< JCTVC-P0041: Include signalling for poc_reset related syntax elements … … 158 157 #define SCALINGLIST_INFERRING 1 ///< JCTVC-N0371: inter-layer scaling list 159 158 #define O0142_CONDITIONAL_SPS_EXTENSION 1 ///< JCTVC-O0142: Conditional SPS extension 160 #if POC_RESET_FLAG161 #define PREVTID0_POC_RESET 1 ///< JCTVC-O0117 Modification of the PicOrderCntVal of prevTid0Pic162 #define POC_RESET_RPS 1 ///< JCTVC-O0117 Modification to the decoding process for rps163 #endif164 159 165 160 #define P0297_VPS_POC_LSB_ALIGNED_FLAG 1 ///< JCTVC-P0297: vps_poc_lsb_aligned_flag for cross-layer POC anchor picture derivation -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1092 r1093 1242 1242 { 1243 1243 #if SVC_EXTENSION 1244 #if POC_RESET_FLAG1245 Int iBits = 0;1246 if(pcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits)1247 {1248 READ_FLAG(uiCode, "poc_reset_flag"); pcSlice->setPocResetFlag( uiCode ? true : false );1249 iBits++;1250 }1251 if(pcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits)1252 {1253 #if DISCARDABLE_PIC_RPS1254 READ_FLAG(uiCode, "discardable_flag"); pcSlice->setDiscardableFlag( uiCode ? true : false );1255 #else1256 READ_FLAG(uiCode, "discardable_flag"); // ignored1257 #endif1258 iBits++;1259 }1260 #if O0149_CROSS_LAYER_BLA_FLAG1261 if(pcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits)1262 {1263 READ_FLAG(uiCode, "cross_layer_bla_flag"); pcSlice->setCrossLayerBLAFlag( uiCode ? true : false );1264 iBits++;1265 }1266 #endif1267 for (; iBits < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); iBits++)1268 {1269 READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored1270 }1271 #else1272 1244 #if CROSS_LAYER_BLA_FLAG_FIX 1273 1245 Int iBits = 0; … … 1306 1278 READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored 1307 1279 } 1308 #endif1309 1280 #else //SVC_EXTENSION 1310 1281 for (Int i = 0; i < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++) -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
r1092 r1093 736 736 737 737 #if SVC_EXTENSION 738 #if POC_RESET_FLAG739 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int &iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC )740 #else741 738 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC ) 742 #endif743 739 #else 744 740 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay ) … … 1339 1335 m_bFirstSliceInSequence = false; 1340 1336 m_bFirstSliceInBitstream = false; 1341 #if POC_RESET_FLAG 1342 // This operation would do the following: 1343 // 1. Update the other picture in the DPB. This should be done only for the first slice of the picture. 1344 // 2. Update the value of m_pocCRA. 1345 // 3. Reset the POC values at the decoder for the current picture to be zero. 1346 // 4. update value of POCLastDisplay 1347 if( m_apcSlicePilot->getPocResetFlag() ) 1348 { 1349 if( m_apcSlicePilot->getSliceIdx() == 0 ) 1350 { 1351 Int pocAdjustValue = m_apcSlicePilot->getPOC(); 1352 1353 #if PREVTID0_POC_RESET 1354 m_apcSlicePilot->adjustPrevTid0POC(pocAdjustValue); 1355 #endif 1356 // If poc reset flag is set to 1, reset all POC for DPB -> basically do it for each slice in the picutre 1357 TComList<TComPic*>::iterator iterPic = m_cListPic.begin(); 1358 1359 // Iterate through all picture in DPB 1360 while( iterPic != m_cListPic.end() ) 1361 { 1362 TComPic *dpbPic = *iterPic; 1363 // Check if the picture pointed to by iterPic is either used for reference or 1364 // needed for output, are in the same layer, and not the current picture. 1365 if( /* ( ( dpbPic->getSlice(0)->isReferenced() ) || ( dpbPic->getOutputMark() ) ) 1366 &&*/ ( dpbPic->getLayerId() == m_apcSlicePilot->getLayerId() ) 1367 && ( dpbPic->getReconMark() ) 1368 ) 1369 { 1370 for(Int i = dpbPic->getNumAllocatedSlice()-1; i >= 0; i--) 1371 { 1372 1373 TComSlice *slice = dpbPic->getSlice(i); 1374 TComReferencePictureSet *rps = slice->getRPS(); 1375 slice->setPOC( slice->getPOC() - pocAdjustValue ); 1376 1377 // Also adjust the POC value stored in the RPS of each such slice 1378 for(Int j = rps->getNumberOfPictures(); j >= 0; j--) 1379 { 1380 rps->setPOC( j, rps->getPOC(j) - pocAdjustValue ); 1381 } 1382 // Also adjust the value of refPOC 1383 for(Int k = 0; k < 2; k++) // For List 0 and List 1 1384 { 1385 RefPicList list = (k == 1) ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 1386 for(Int j = 0; j < slice->getNumRefIdx(list); j++) 1387 { 1388 slice->setRefPOC( slice->getRefPOC(list, j) - pocAdjustValue, list, j); 1389 } 1390 } 1391 } 1392 } 1393 iterPic++; 1394 } 1395 // Update the value of pocCRA 1396 m_pocCRA -= pocAdjustValue; 1397 // Update value of POCLastDisplay 1398 iPOCLastDisplay -= pocAdjustValue; 1399 } 1400 // Reset current poc for current slice and RPS 1401 m_apcSlicePilot->setPOC( 0 ); 1402 } 1403 #endif 1337 1404 1338 // Alignment of TSA and STSA pictures across AU 1405 1339 #if !Q0108_TSA_STSA -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h
r1089 r1093 312 312 Void xActivateParameterSets(); 313 313 #if SVC_EXTENSION 314 #if POC_RESET_FLAG315 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int &iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC);316 #else317 314 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC); 318 #endif319 315 Void xSetSpatialEnhLayerFlag(TComSlice* slice, TComPic* pic); 320 316 #else -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r1090 r1093 975 975 { 976 976 #if SVC_EXTENSION 977 #if POC_RESET_FLAG978 Int iBits = 0;979 if( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits )980 {981 WRITE_FLAG( pcSlice->getPocResetFlag(), "poc_reset_flag" );982 iBits++;983 }984 if( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits )985 {986 assert(!!"discardable_flag");987 WRITE_FLAG(pcSlice->getDiscardableFlag(), "discardable_flag");988 iBits++;989 }990 #if O0149_CROSS_LAYER_BLA_FLAG991 if( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits )992 {993 assert(!!"cross_layer_bla_flag");994 WRITE_FLAG(pcSlice->getCrossLayerBLAFlag(), "cross_layer_bla_flag");995 iBits++;996 }997 #endif998 for ( ; iBits < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); iBits++)999 {1000 assert(!!"slice_reserved_undetermined_flag[]");1001 WRITE_FLAG(0, "slice_reserved_undetermined_flag[]");1002 }1003 #else1004 977 #if CROSS_LAYER_BLA_FLAG_FIX 1005 978 Int iBits = 0; … … 1040 1013 WRITE_FLAG(0, "slice_reserved_undetermined_flag[]"); 1041 1014 } 1042 #endif1043 1015 #else //SVC_EXTENSION 1044 1016 for (Int i = 0; i < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++) … … 1066 1038 #endif 1067 1039 { 1068 #if POC_RESET_FLAG1069 Int picOrderCntLSB;1070 if( !pcSlice->getPocResetFlag() )1071 {1072 picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1);1073 }1074 else1075 {1076 picOrderCntLSB = (pcSlice->getPocValueBeforeReset()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1);1077 }1078 #else1079 1040 #if POC_RESET_IDC_ENCODER 1080 1041 Int picOrderCntLSB; … … 1089 1050 #else 1090 1051 Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1); 1091 #endif1092 1052 #endif 1093 1053 WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb"); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1090 r1093 1144 1144 1145 1145 #if SVC_EXTENSION 1146 #if POC_RESET_FLAG1147 if( !pcSlice->getPocResetFlag() ) // For picture that are not reset, we should adjust the value of POC calculated from the configuration files.1148 {1149 // Subtract POC adjustment value until now.1150 pcSlice->setPOC( pcSlice->getPOC() - m_pcEncTop->getPocAdjustmentValue() );1151 }1152 else1153 {1154 // Check if this is the first slice in the picture1155 // In the encoder, the POC values are copied along with copySliceInfo, so we only need1156 // to do this for the first slice.1157 Int pocAdjustValue = pcSlice->getPOC() - m_pcEncTop->getPocAdjustmentValue();1158 if( pcSlice->getSliceIdx() == 0 )1159 {1160 TComList<TComPic*>::iterator iterPic = rcListPic.begin();1161 1162 // Iterate through all picture in DPB1163 while( iterPic != rcListPic.end() )1164 {1165 TComPic *dpbPic = *iterPic;1166 if( dpbPic->getPOC() == pocCurr )1167 {1168 if( dpbPic->getReconMark() )1169 {1170 assert( !( dpbPic->getSlice(0)->isReferenced() ) && !( dpbPic->getOutputMark() ) );1171 }1172 }1173 // Check if the picture pointed to by iterPic is either used for reference or1174 // needed for output, are in the same layer, and not the current picture.1175 if( /* ( ( dpbPic->getSlice(0)->isReferenced() ) || ( dpbPic->getOutputMark() ) )1176 && */ ( dpbPic->getLayerId() == pcSlice->getLayerId() )1177 && ( dpbPic->getReconMark() )1178 )1179 {1180 for(Int i = dpbPic->getNumAllocatedSlice()-1; i >= 0; i--)1181 {1182 TComSlice *slice = dpbPic->getSlice(i);1183 TComReferencePictureSet *rps = slice->getRPS();1184 slice->setPOC( dpbPic->getSlice(i)->getPOC() - pocAdjustValue );1185 1186 // Also adjust the POC value stored in the RPS of each such slice1187 for(Int j = rps->getNumberOfPictures(); j >= 0; j--)1188 {1189 rps->setPOC( j, rps->getPOC(j) - pocAdjustValue );1190 }1191 // Also adjust the value of refPOC1192 for(Int k = 0; k < 2; k++) // For List 0 and List 11193 {1194 RefPicList list = (k == 1) ? REF_PIC_LIST_1 : REF_PIC_LIST_0;1195 for(Int j = 0; j < slice->getNumRefIdx(list); j++)1196 {1197 slice->setRefPOC( slice->getRefPOC(list, j) - pocAdjustValue, list, j);1198 }1199 }1200 }1201 }1202 iterPic++;1203 }1204 m_pcEncTop->setPocAdjustmentValue( m_pcEncTop->getPocAdjustmentValue() + pocAdjustValue );1205 }1206 pcSlice->setPocValueBeforeReset( pcSlice->getPOC() - m_pcEncTop->getPocAdjustmentValue() + pocAdjustValue );1207 pcSlice->setPOC( 0 );1208 }1209 #endif1210 1146 #if POC_RESET_IDC_ENCODER 1211 1147 pcSlice->setPocValueBeforeReset( pocCurr ); … … 1893 1829 if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() ) 1894 1830 { 1895 #if POC_RESET_ FLAG || POC_RESET_IDC_ENCODER1831 #if POC_RESET_IDC_ENCODER 1896 1832 if ( pocCurr > 0 && pcSlice->isRADL() && pcPic->getSlice(0)->getBaseColPic(pcPic->getSlice(0)->getInterLayerPredLayerIdc(0))->getSlice(0)->isRASL()) 1897 1833 #else … … 2302 2238 2303 2239 Int sliceQP = m_pcCfg->getInitialQP(); 2304 #if POC_RESET_ FLAG || POC_RESET_IDC_ENCODER2240 #if POC_RESET_IDC_ENCODER 2305 2241 if ( ( pocCurr == 0 && m_pcCfg->getInitialQP() > 0 ) || ( frameLevel == 0 && m_pcCfg->getForceIntraQP() ) ) // QP is specified 2306 2242 #else … … 2720 2656 } 2721 2657 pictureTimingSEI.m_auCpbRemovalDelay = std::min<Int>(std::max<Int>(1, m_totalCoded - m_lastBPSEI), static_cast<Int>(pow(2, static_cast<Double>(pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getCpbRemovalDelayLengthMinus1()+1)))); // Syntax element signalled as minus, hence the . 2722 #if POC_RESET_ FLAG || POC_RESET_IDC_ENCODER2658 #if POC_RESET_IDC_ENCODER 2723 2659 pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(pcSlice->getSPS()->getMaxTLayers()-1) + pocCurr - m_totalCoded; 2724 2660 #else … … 2868 2804 SEIRecoveryPoint sei_recovery_point; 2869 2805 sei_recovery_point.m_recoveryPocCnt = 0; 2870 #if POC_RESET_ FLAG || POC_RESET_IDC_ENCODER2806 #if POC_RESET_IDC_ENCODER 2871 2807 sei_recovery_point.m_exactMatchingFlag = ( pocCurr == 0 ) ? (true) : (false); 2872 2808 #else -
branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp
r1090 r1093 85 85 #endif 86 86 m_numRefLayerLocationOffsets = 0; 87 #if POC_RESET_ FLAG || POC_RESET_IDC_ENCODER87 #if POC_RESET_IDC_ENCODER 88 88 m_pocAdjustmentValue = 0; 89 89 #endif … … 1065 1065 m_cPPS.setPPSId( m_iPPSIdCnt ); 1066 1066 m_cPPS.setSPSId( m_iSPSIdCnt ); 1067 #if POC_RESET_FLAG1068 m_cPPS.setNumExtraSliceHeaderBits( 2 );1069 #endif1070 1067 #if O0149_CROSS_LAYER_BLA_FLAG 1071 1068 if (m_crossLayerBLAFlag) -
branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h
r1090 r1093 137 137 Int m_phaseVerChroma[MAX_LAYERS]; 138 138 Int m_resamplePhaseSetPresentFlag[MAX_LAYERS]; 139 #if POC_RESET_ FLAG || POC_RESET_IDC_ENCODER139 #if POC_RESET_IDC_ENCODER 140 140 Int m_pocAdjustmentValue; 141 141 #endif … … 262 262 TEncTop* getRefLayerEnc(UInt refLayerIdx); 263 263 #endif 264 #if POC_RESET_ FLAG || POC_RESET_IDC_ENCODER264 #if POC_RESET_IDC_ENCODER 265 265 Int getPocAdjustmentValue() { return m_pocAdjustmentValue;} 266 266 Void setPocAdjustmentValue(Int x) { m_pocAdjustmentValue = x; }
Note: See TracChangeset for help on using the changeset viewer.