Changeset 644 in SHVCSoftware
- Timestamp:
- 25 Mar 2014, 21:51:30 (11 years ago)
- Location:
- trunk
- Files:
-
- 48 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-5.1-dev (added) merged: 599-600,602-643
- Property svn:mergeinfo changed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-5.0-dev/source merged: 601 /branches/SHM-5.1-dev/source (added) merged: 600,602-643
- Property svn:mergeinfo changed
-
trunk/source/App/TAppDecoder/TAppDecTop.cpp
r595 r644 41 41 #include <fcntl.h> 42 42 #include <assert.h> 43 43 #include <iostream> 44 44 #include "TAppDecTop.h" 45 45 #include "TLibDecoder/AnnexBread.h" 46 46 #include "TLibDecoder/NALread.h" 47 48 47 //! \ingroup TAppDecoder 49 48 //! \{ … … 255 254 openedReconFile[curLayerId] = true; 256 255 } 256 #if ALIGNED_BUMPING 257 Bool outputPicturesFlag = true; 258 #if NO_OUTPUT_OF_PRIOR_PICS 259 if( m_acTDecTop[nalu.m_layerId].getNoOutputOfPriorPicsFlags() ) 260 { 261 outputPicturesFlag = false; 262 } 263 #endif 264 265 if (nalu.m_nalUnitType == NAL_UNIT_EOS) // End of sequence 266 { 267 flushAllPictures( nalu.m_layerId, outputPicturesFlag ); 268 } 269 if( bNewPicture ) // New picture, slice header parsed but picture not decoded 270 { 271 #if NO_OUTPUT_OF_PRIOR_PICS 272 if( 273 #else 274 if ( bNewPOC && 275 #endif 276 ( nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL 277 || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP 278 || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP 279 || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL 280 || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP ) ) 281 { 282 flushAllPictures( nalu.m_layerId, outputPicturesFlag ); 283 } 284 else 285 { 286 this->checkOutputBeforeDecoding( nalu.m_layerId ); 287 } 288 } 289 290 /* The following code has to be executed when the last DU of the picture is decoded 291 TODO: Need code to identify end of decoding a picture 292 { 293 this->checkOutputAfterDecoding( ); 294 } */ 295 #else 257 296 if ( bNewPicture && bNewPOC && 258 297 ( nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL … … 273 312 xWriteOutput( pcListPic, curLayerId, nalu.m_temporalId ); 274 313 } 275 } 276 } 314 #endif 315 } 316 } 317 #if ALIGNED_BUMPING 318 flushAllPictures( true ); 319 #else 277 320 for(UInt layer = 0; layer <= m_tgtLayerId; layer++) 278 321 { 279 322 xFlushOutput( m_acTDecTop[layer].getListPic(), layer ); 280 323 } 324 #endif 281 325 // delete buffers 282 326 #if AVC_BASE … … 987 1031 return false; 988 1032 } 989 1033 #if ALIGNED_BUMPING 1034 // Function outputs a picture, and marks it as not needed for output. 1035 Void TAppDecTop::xOutputAndMarkPic( TComPic *pic, const Char *reconFile, const Int layerIdx, Int &pocLastDisplay, DpbStatus &dpbStatus ) 1036 { 1037 if ( reconFile ) 1038 { 1039 const Window &conf = pic->getConformanceWindow(); 1040 const Window &defDisp = m_respectDefDispWindow ? pic->getDefDisplayWindow() : Window(); 1041 Int xScal = 1, yScal = 1; 1042 #if REPN_FORMAT_IN_VPS 1043 UInt chromaFormatIdc = pic->getSlice(0)->getChromaFormatIdc(); 1044 xScal = TComSPS::getWinUnitX( chromaFormatIdc ); 1045 yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 1046 #endif 1047 m_acTVideoIOYuvReconFile[layerIdx].write( pic->getPicYuvRec(), 1048 conf.getWindowLeftOffset() * xScal + defDisp.getWindowLeftOffset(), 1049 conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(), 1050 conf.getWindowTopOffset() * yScal + defDisp.getWindowTopOffset(), 1051 conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset() ); 1052 } 1053 // update POC of display order 1054 pocLastDisplay = pic->getPOC(); 1055 1056 // Mark as not needed for output 1057 pic->setOutputMark(false); 1058 1059 // "erase" non-referenced picture in the reference picture list after display 1060 if ( !pic->getSlice(0)->isReferenced() && pic->getReconMark() == true ) 1061 { 1062 pic->setReconMark(false); 1063 1064 // mark it should be extended later 1065 pic->getPicYuvRec()->setBorderExtension( false ); 1066 1067 dpbStatus.m_numPicsInLayer[layerIdx]--; 1068 } 1069 } 1070 1071 Void TAppDecTop::flushAllPictures(Int layerId, Bool outputPictures) 1072 { 1073 // First "empty" all pictures that are not used for reference and not needed for output 1074 emptyUnusedPicturesNotNeededForOutput(); 1075 1076 if( outputPictures ) // All pictures in the DPB in that layer are to be output; this means other pictures would also be output 1077 { 1078 std::vector<Int> listOfPocs; 1079 std::vector<Int> listOfPocsInEachLayer[MAX_LAYERS]; 1080 std::vector<Int> listOfPocsPositionInEachLayer[MAX_LAYERS]; 1081 DpbStatus dpbStatus; 1082 1083 // Find the status of the DPB 1084 xFindDPBStatus(listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, dpbStatus); 1085 1086 if( listOfPocs.size() ) 1087 { 1088 while( listOfPocsInEachLayer[layerId].size() ) // As long as there picture in the layer to be output 1089 { 1090 bumpingProcess( listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, dpbStatus ); 1091 } 1092 } 1093 } 1094 1095 // Now remove all pictures from the layer DPB? 1096 markAllPicturesAsErased(layerId); 1097 } 1098 Void TAppDecTop::flushAllPictures(Bool outputPictures) 1099 { 1100 // First "empty" all pictures that are not used for reference and not needed for output 1101 emptyUnusedPicturesNotNeededForOutput(); 1102 1103 if( outputPictures ) // All pictures in the DPB are to be output 1104 { 1105 std::vector<Int> listOfPocs; 1106 std::vector<Int> listOfPocsInEachLayer[MAX_LAYERS]; 1107 std::vector<Int> listOfPocsPositionInEachLayer[MAX_LAYERS]; 1108 DpbStatus dpbStatus; 1109 1110 // Find the status of the DPB 1111 xFindDPBStatus(listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, dpbStatus); 1112 1113 while( dpbStatus.m_numAUsNotDisplayed ) 1114 { 1115 bumpingProcess( listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, dpbStatus ); 1116 } 1117 } 1118 1119 // Now remove all pictures from the DPB? 1120 markAllPicturesAsErased(); 1121 } 1122 1123 Void TAppDecTop::markAllPicturesAsErased() 1124 { 1125 for(Int i = 0; i < MAX_LAYERS; i++) 1126 { 1127 m_acTDecTop[i].getListPic()->clear(); 1128 } 1129 } 1130 1131 Void TAppDecTop::markAllPicturesAsErased(Int layerIdx) 1132 { 1133 m_acTDecTop[layerIdx].getListPic()->clear(); 1134 } 1135 1136 Void TAppDecTop::checkOutputBeforeDecoding(Int layerIdx) 1137 { 1138 1139 std::vector<Int> listOfPocs; 1140 std::vector<Int> listOfPocsInEachLayer[MAX_LAYERS]; 1141 std::vector<Int> listOfPocsPositionInEachLayer[MAX_LAYERS]; 1142 DpbStatus dpbStatus; 1143 1144 // First "empty" all pictures that are not used for reference and not needed for output 1145 emptyUnusedPicturesNotNeededForOutput(); 1146 1147 // Find the status of the DPB 1148 xFindDPBStatus(listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, dpbStatus); 1149 1150 // If not picture to be output, return 1151 if( listOfPocs.size() == 0 ) 1152 { 1153 return; 1154 } 1155 1156 // Find DPB-information from the VPS 1157 DpbStatus maxDpbLimit; 1158 Int targetLsIdx, subDpbIdx; 1159 TComVPS *vps = findDpbParametersFromVps(listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, maxDpbLimit); 1160 if( getCommonDecoderParams()->getTargetOutputLayerSetIdx() == 0 ) 1161 { 1162 targetLsIdx = 0; 1163 subDpbIdx = 0; 1164 } 1165 else 1166 { 1167 targetLsIdx = vps->getOutputLayerSetIdx( getCommonDecoderParams()->getTargetOutputLayerSetIdx() ); 1168 subDpbIdx = vps->getSubDpbAssigned( targetLsIdx, layerIdx ); 1169 } 1170 // Assume that listOfPocs is sorted in increasing order - if not have to sort it. 1171 while( ifInvokeBumpingBeforeDecoding(dpbStatus, maxDpbLimit, layerIdx, subDpbIdx) ) 1172 { 1173 bumpingProcess( listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, dpbStatus ); 1174 } 1175 } 1176 1177 Void TAppDecTop::checkOutputAfterDecoding() 1178 { 1179 std::vector<Int> listOfPocs; 1180 std::vector<Int> listOfPocsInEachLayer[MAX_LAYERS]; 1181 std::vector<Int> listOfPocsPositionInEachLayer[MAX_LAYERS]; 1182 DpbStatus dpbStatus; 1183 1184 // First "empty" all pictures that are not used for reference and not needed for output 1185 emptyUnusedPicturesNotNeededForOutput(); 1186 1187 // Find the status of the DPB 1188 xFindDPBStatus(listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, dpbStatus); 1189 1190 // If not picture to be output, return 1191 if( listOfPocs.size() == 0 ) 1192 { 1193 return; 1194 } 1195 1196 // Find DPB-information from the VPS 1197 DpbStatus maxDpbLimit; 1198 findDpbParametersFromVps(listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, maxDpbLimit); 1199 1200 // Assume that listOfPocs is sorted in increasing order - if not have to sort it. 1201 while( ifInvokeBumpingAfterDecoding(dpbStatus, maxDpbLimit) ) 1202 { 1203 bumpingProcess( listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, dpbStatus ); 1204 } 1205 } 1206 1207 Void TAppDecTop::bumpingProcess(std::vector<Int> &listOfPocs, std::vector<Int> *listOfPocsInEachLayer, std::vector<Int> *listOfPocsPositionInEachLayer, DpbStatus &dpbStatus) 1208 { 1209 // Choose the smallest POC value 1210 Int pocValue = *(listOfPocs.begin()); 1211 std::vector<int>::iterator it; 1212 TComList<TComPic*>::iterator iterPic; 1213 for( Int layerIdx = 0; layerIdx < dpbStatus.m_numLayers; layerIdx++) 1214 { 1215 // Check if picture with pocValue is present. 1216 it = find( listOfPocsInEachLayer[layerIdx].begin(), listOfPocsInEachLayer[layerIdx].end(), pocValue ); 1217 if( it != listOfPocsInEachLayer[layerIdx].end() ) // picture found. 1218 { 1219 Int picPosition = std::distance( listOfPocsInEachLayer[layerIdx].begin(), it ); 1220 Int j; 1221 for(j = 0, iterPic = m_acTDecTop[layerIdx].getListPic()->begin(); j < listOfPocsPositionInEachLayer[layerIdx][picPosition]; j++) // Picture to be output 1222 { 1223 iterPic++; 1224 } 1225 TComPic *pic = *iterPic; 1226 1227 xOutputAndMarkPic( pic, m_pchReconFile[layerIdx], layerIdx, m_aiPOCLastDisplay[layerIdx], dpbStatus ); 1228 1229 listOfPocsInEachLayer[layerIdx].erase( it ); 1230 listOfPocsPositionInEachLayer[layerIdx].erase( listOfPocsPositionInEachLayer[layerIdx].begin() + picPosition ); 1231 } 1232 } 1233 // Update sub-DPB status 1234 for( Int subDpbIdx = 0; subDpbIdx < dpbStatus.m_numSubDpbs; subDpbIdx++) 1235 { 1236 dpbStatus.m_numPicsInSubDpb[subDpbIdx]--; 1237 } 1238 dpbStatus.m_numAUsNotDisplayed--; 1239 1240 // Remove the picture from the listOfPocs 1241 listOfPocs.erase( listOfPocs.begin() ); 1242 } 1243 1244 TComVPS *TAppDecTop::findDpbParametersFromVps(std::vector<Int> const &listOfPocs, std::vector<Int> const *listOfPocsInEachLayer, std::vector<Int> const *listOfPocsPositionInEachLayer, DpbStatus &maxDpbLimit) 1245 { 1246 Int targetOutputLsIdx = getCommonDecoderParams()->getTargetOutputLayerSetIdx(); 1247 TComVPS *vps = NULL; 1248 1249 if( targetOutputLsIdx == 0 ) // Only base layer is output 1250 { 1251 TComSPS *sps = NULL; 1252 assert( listOfPocsInEachLayer[0].size() != 0 ); 1253 TComList<TComPic*>::iterator iterPic; 1254 Int j; 1255 for(j = 0, iterPic = m_acTDecTop[0].getListPic()->begin(); j < listOfPocsPositionInEachLayer[0][0]; j++) // Picture to be output 1256 { 1257 iterPic++; 1258 } 1259 TComPic *pic = *iterPic; 1260 sps = pic->getSlice(0)->getSPS(); assert( sps->getLayerId() == 0 ); 1261 vps = pic->getSlice(0)->getVPS(); 1262 Int highestTId = sps->getMaxTLayers() - 1; 1263 1264 maxDpbLimit.m_numAUsNotDisplayed = sps->getNumReorderPics( highestTId ); // m_numAUsNotDisplayed is only variable name - stores reorderpics 1265 maxDpbLimit.m_maxLatencyIncrease = sps->getMaxLatencyIncrease( highestTId ) > 0; 1266 if( maxDpbLimit.m_maxLatencyIncrease ) 1267 { 1268 maxDpbLimit.m_maxLatencyPictures = sps->getMaxLatencyIncrease( highestTId ) + sps->getNumReorderPics( highestTId ) - 1; 1269 } 1270 maxDpbLimit.m_numPicsInLayer[0] = sps->getMaxDecPicBuffering( highestTId ); 1271 maxDpbLimit.m_numPicsInSubDpb[0] = sps->getMaxDecPicBuffering( highestTId ); 1272 } 1273 else 1274 { 1275 // ------------------------------------- 1276 // Find the VPS used for the pictures 1277 // ------------------------------------- 1278 for(Int i = 0; i < MAX_LAYERS; i++) 1279 { 1280 if( m_acTDecTop[i].getListPic()->empty() ) 1281 { 1282 assert( listOfPocsInEachLayer[i].size() == 0 ); 1283 continue; 1284 } 1285 std::vector<Int>::const_iterator it; 1286 it = find( listOfPocsInEachLayer[i].begin(), listOfPocsInEachLayer[i].end(), listOfPocs[0] ); 1287 TComList<TComPic*>::iterator iterPic; 1288 if( it != listOfPocsInEachLayer[i].end() ) 1289 { 1290 Int picPosition = std::distance( listOfPocsInEachLayer[i].begin(), it ); 1291 Int j; 1292 for(j = 0, iterPic = m_acTDecTop[i].getListPic()->begin(); j < listOfPocsPositionInEachLayer[i][picPosition]; j++) // Picture to be output 1293 { 1294 iterPic++; 1295 } 1296 TComPic *pic = *iterPic; 1297 vps = pic->getSlice(0)->getVPS(); 1298 break; 1299 } 1300 } 1301 1302 Int targetLsIdx = vps->getOutputLayerSetIdx( getCommonDecoderParams()->getTargetOutputLayerSetIdx() ); 1303 Int highestTId = vps->getMaxTLayers() - 1; 1304 1305 maxDpbLimit.m_numAUsNotDisplayed = vps->getMaxVpsNumReorderPics( targetOutputLsIdx, highestTId ); // m_numAUsNotDisplayed is only variable name - stores reorderpics 1306 maxDpbLimit.m_maxLatencyIncrease = vps->getMaxVpsLatencyIncreasePlus1(targetOutputLsIdx, highestTId ) > 0; 1307 if( maxDpbLimit.m_maxLatencyIncrease ) 1308 { 1309 maxDpbLimit.m_maxLatencyPictures = vps->getMaxVpsNumReorderPics( targetOutputLsIdx, highestTId ) + vps->getMaxVpsLatencyIncreasePlus1(targetOutputLsIdx, highestTId ) - 1; 1310 } 1311 for(Int i = 0; i < vps->getNumLayersInIdList( targetLsIdx ); i++) 1312 { 1313 maxDpbLimit.m_numPicsInLayer[i] = vps->getMaxVpsLayerDecPicBuffMinus1( targetOutputLsIdx, i, highestTId ) + 1; 1314 maxDpbLimit.m_numPicsInSubDpb[vps->getSubDpbAssigned( targetLsIdx, i )] = vps->getMaxVpsDecPicBufferingMinus1( targetOutputLsIdx, vps->getSubDpbAssigned( targetLsIdx, i ), highestTId) + 1; 1315 } 1316 // ------------------------------------- 1317 } 1318 return vps; 1319 } 1320 Void TAppDecTop::emptyUnusedPicturesNotNeededForOutput() 1321 { 1322 for(Int layerIdx = 0; layerIdx < MAX_LAYERS; layerIdx++) 1323 { 1324 TComList <TComPic*> *pcListPic = m_acTDecTop[layerIdx].getListPic(); 1325 TComList<TComPic*>::iterator iterPic = pcListPic->begin(); 1326 while ( iterPic != pcListPic->end() ) 1327 { 1328 TComPic *pic = *iterPic; 1329 if( !pic->getSlice(0)->isReferenced() && !pic->getOutputMark() ) 1330 { 1331 // Emtpy the picture buffer 1332 pic->setReconMark( false ); 1333 } 1334 iterPic++; 1335 } 1336 } 1337 } 1338 1339 Bool TAppDecTop::ifInvokeBumpingBeforeDecoding( const DpbStatus &dpbStatus, const DpbStatus &dpbLimit, const Int layerIdx, const Int subDpbIdx ) 1340 { 1341 Bool retVal = false; 1342 // Number of reorder picutres 1343 retVal |= ( dpbStatus.m_numAUsNotDisplayed > dpbLimit.m_numAUsNotDisplayed ); 1344 1345 // Number of pictures in each sub-DPB 1346 retVal |= ( dpbStatus.m_numPicsInSubDpb[subDpbIdx] >= dpbLimit.m_numPicsInSubDpb[subDpbIdx] ); 1347 1348 // Number of pictures in each layer 1349 retVal |= ( dpbStatus.m_numPicsInLayer[layerIdx] >= dpbLimit.m_numPicsInLayer[layerIdx]); 1350 1351 return retVal; 1352 } 1353 1354 Bool TAppDecTop::ifInvokeBumpingAfterDecoding( const DpbStatus &dpbStatus, const DpbStatus &dpbLimit ) 1355 { 1356 Bool retVal = false; 1357 1358 // Number of reorder picutres 1359 retVal |= ( dpbStatus.m_numAUsNotDisplayed > dpbLimit.m_numAUsNotDisplayed ); 1360 1361 return retVal; 1362 } 1363 1364 Void TAppDecTop::xFindDPBStatus( std::vector<Int> &listOfPocs 1365 , std::vector<Int> *listOfPocsInEachLayer 1366 , std::vector<Int> *listOfPocsPositionInEachLayer 1367 , DpbStatus &dpbStatus 1368 ) 1369 { 1370 TComVPS *vps = NULL; 1371 dpbStatus.init(); 1372 for( Int i = 0; i < MAX_LAYERS; i++ ) 1373 { 1374 if( m_acTDecTop[i].getListPic()->empty() ) 1375 { 1376 continue; 1377 } 1378 1379 // To check # AUs that have at least one picture not output, 1380 // For each layer, populate listOfPOcs if not already present 1381 TComList<TComPic*>::iterator iterPic = m_acTDecTop[i].getListPic()->begin(); 1382 Int picPositionInList = 0; 1383 while (iterPic != m_acTDecTop[i].getListPic()->end()) 1384 { 1385 TComPic* pic = *(iterPic); 1386 if( pic->getReconMark() ) 1387 { 1388 if( vps == NULL ) 1389 { 1390 vps = pic->getSlice(0)->getVPS(); 1391 } 1392 1393 std::vector<Int>::iterator it; 1394 if( pic->getOutputMark() ) // && pic->getPOC() > m_aiPOCLastDisplay[i]) 1395 { 1396 it = find( listOfPocs.begin(), listOfPocs.end(), pic->getPOC() ); // Check if already included 1397 if( it == listOfPocs.end() ) // New POC value - i.e. new AU - add to the list 1398 { 1399 listOfPocs.push_back( pic->getPOC() ); 1400 } 1401 listOfPocsInEachLayer [i].push_back( pic->getPOC() ); // POC to be output in each layer 1402 listOfPocsPositionInEachLayer [i].push_back( picPositionInList ); // For ease of access 1403 } 1404 if( pic->getSlice(0)->isReferenced() || pic->getOutputMark() ) 1405 { 1406 dpbStatus.m_numPicsInLayer[i]++; // Count pictures that are "used for reference" or "needed for output" 1407 } 1408 } 1409 iterPic++; 1410 picPositionInList++; 1411 } 1412 } 1413 1414 assert( vps != NULL ); // No picture in any DPB? 1415 std::sort( listOfPocs.begin(), listOfPocs.end() ); // Sort in increasing order of POC 1416 Int targetLsIdx = vps->getOutputLayerSetIdx( getCommonDecoderParams()->getTargetOutputLayerSetIdx() ); 1417 // Update status 1418 dpbStatus.m_numAUsNotDisplayed = listOfPocs.size(); // Number of AUs not displayed 1419 dpbStatus.m_numLayers = vps->getNumLayersInIdList( targetLsIdx ); 1420 dpbStatus.m_numSubDpbs = vps->getNumSubDpbs( vps->getOutputLayerSetIdx( 1421 this->getCommonDecoderParams()->getTargetOutputLayerSetIdx() ) ); 1422 1423 for(Int i = 0; i < dpbStatus.m_numLayers; i++) 1424 { 1425 dpbStatus.m_numPicsNotDisplayedInLayer[i] = listOfPocsInEachLayer[i].size(); 1426 dpbStatus.m_numPicsInSubDpb[vps->getSubDpbAssigned(targetLsIdx,i)] += dpbStatus.m_numPicsInLayer[i]; 1427 } 1428 assert( dpbStatus.m_numAUsNotDisplayed != -1 ); 1429 1430 1431 } 1432 #endif 990 1433 //! \} -
trunk/source/App/TAppDecoder/TAppDecTop.h
r595 r644 55 55 // Class definition 56 56 // ==================================================================================================================== 57 57 #if ALIGNED_BUMPING 58 struct DpbStatus; 59 #endif 58 60 /// decoder application class 59 61 class TAppDecTop : public TAppDecCfg … … 98 100 #endif 99 101 Bool isNaluWithinTargetDecLayerIdSet ( InputNALUnit* nalu ); ///< check whether given Nalu is within targetDecLayerIdSet 102 #if ALIGNED_BUMPING 103 Void checkOutputBeforeDecoding(Int layerIdx); 104 Void checkOutputAfterDecoding(); 105 Void flushAllPictures(Bool outputPictures); 106 Void flushAllPictures(Int layerId, Bool outputPictures); 107 108 Void xOutputAndMarkPic( TComPic *pic, const Char *reconFile, const Int layerID, Int &pocLastDisplay, DpbStatus &dpbStatus); 109 Void xFindDPBStatus( std::vector<Int> &listOfPocs 110 , std::vector<Int> *listOfPocsInEachLayer 111 , std::vector<Int> *listOfPocsPositionInEachLayer 112 , DpbStatus &dpbStatus 113 ); 114 115 Bool ifInvokeBumpingBeforeDecoding( const DpbStatus &dpbStatus, const DpbStatus &dpbLimit, const Int layerIdx, const Int subDpbIdx ); 116 Bool ifInvokeBumpingAfterDecoding ( const DpbStatus &dpbStatus, const DpbStatus &dpbLimit ); 117 Void bumpingProcess(std::vector<Int> &listOfPocs, std::vector<Int> *listOfPocsInEachLayer, std::vector<Int> *listOfPocsPositionInEachLayer, DpbStatus &dpbStatus); 118 Void emptyUnusedPicturesNotNeededForOutput(); 119 Void markAllPicturesAsErased(); 120 Void markAllPicturesAsErased(Int layerIdx); 121 TComVPS* findDpbParametersFromVps(std::vector<Int> const &listOfPocs, std::vector<Int> const *listOfPocsInEachLayer, std::vector<Int> const *listOfPocsPositionInEachLayer, DpbStatus &maxDpbLimit); 122 #endif 100 123 }; 101 124 125 #if ALIGNED_BUMPING 126 struct DpbStatus 127 { 128 // Number of AUs and pictures 129 Int m_numAUsNotDisplayed; 130 Int m_numPicsNotDisplayedInLayer[MAX_LAYERS]; 131 Int m_numPicsInLayer[MAX_LAYERS]; // Pictures marked as used_for_reference or needed for output in the layer 132 Int m_numPicsInSubDpb[MAX_LAYERS]; // Pictures marked as used_for_reference or needed for output in the sub-DPB 133 Bool m_maxLatencyIncrease; 134 Int m_maxLatencyPictures; 135 136 Int m_numSubDpbs; 137 Int m_numLayers; 138 139 DpbStatus() 140 { 141 init(); 142 } 143 Void init() 144 { 145 m_numAUsNotDisplayed = 0; 146 m_maxLatencyIncrease = false; 147 m_maxLatencyPictures = 0; 148 ::memset( m_numPicsInLayer, 0, sizeof(m_numPicsInLayer) ); 149 ::memset( m_numPicsInSubDpb, 0, sizeof(m_numPicsInSubDpb) ); 150 ::memset(m_numPicsNotDisplayedInLayer, 0, sizeof(m_numPicsNotDisplayedInLayer) ); 151 m_numSubDpbs = -1; 152 m_numLayers = -1; 153 } 154 }; 155 #endif 102 156 //! \} 103 157 -
trunk/source/App/TAppEncoder/TAppEncCfg.cpp
r595 r644 385 385 string cfg_scaledRefLayerBottomOffset [MAX_LAYERS]; 386 386 Int* cfg_numScaledRefLayerOffsets[MAX_LAYERS]; 387 #if P0312_VERT_PHASE_ADJ 388 string cfg_vertPhasePositionEnableFlag[MAX_LAYERS]; 389 #endif 387 390 388 391 #if O0098_SCALED_REF_LAYER_ID … … 393 396 string* cfg_scaledRefLayerRightOffsetPtr [MAX_LAYERS]; 394 397 string* cfg_scaledRefLayerBottomOffsetPtr [MAX_LAYERS]; 398 #if P0312_VERT_PHASE_ADJ 399 string* cfg_vertPhasePositionEnableFlagPtr[MAX_LAYERS]; 400 #endif 401 395 402 #if RC_SHVC_HARMONIZATION 396 403 Bool* cfg_RCEnableRateControl [MAX_LAYERS]; … … 451 458 { 452 459 #if O0098_SCALED_REF_LAYER_ID 453 cfg_scaledRefLayerIdPtr [layer] = &cfg_scaledRefLayerId[layer] 454 #endif 455 cfg_scaledRefLayerLeftOffsetPtr [layer] = &cfg_scaledRefLayerLeftOffset[layer] 456 cfg_scaledRefLayerTopOffsetPtr [layer] = &cfg_scaledRefLayerTopOffset[layer] 457 cfg_scaledRefLayerRightOffsetPtr [layer] = &cfg_scaledRefLayerRightOffset[layer] 460 cfg_scaledRefLayerIdPtr [layer] = &cfg_scaledRefLayerId[layer]; 461 #endif 462 cfg_scaledRefLayerLeftOffsetPtr [layer] = &cfg_scaledRefLayerLeftOffset[layer]; 463 cfg_scaledRefLayerTopOffsetPtr [layer] = &cfg_scaledRefLayerTopOffset[layer]; 464 cfg_scaledRefLayerRightOffsetPtr [layer] = &cfg_scaledRefLayerRightOffset[layer]; 458 465 cfg_scaledRefLayerBottomOffsetPtr[layer] = &cfg_scaledRefLayerBottomOffset[layer]; 466 #if P0312_VERT_PHASE_ADJ 467 cfg_vertPhasePositionEnableFlagPtr[layer] = &cfg_vertPhasePositionEnableFlag[layer]; 468 #endif 459 469 } 460 470 #if RC_SHVC_HARMONIZATION … … 569 579 " bottom-right luma sample of the EL picture, in units of two luma samples") 570 580 ("ScaledRefLayerBottomOffset%d", cfg_scaledRefLayerBottomOffsetPtr,string(""), MAX_LAYERS, "Vertical offset of bottom-right luma sample of scaled base layer picture with respect to" 571 " bottom-right luma sample of the EL picture, in units of two luma samples") 581 " bottom-right luma sample of the EL picture, in units of two luma samples") 582 #if P0312_VERT_PHASE_ADJ 583 ("VertPhasePositionEnableFlag%d", cfg_vertPhasePositionEnableFlagPtr,string(""), MAX_LAYERS, "VertPhasePositionEnableFlag for layer %d") 584 #endif 572 585 #if O0194_DIFFERENT_BITDEPTH_EL_BL 573 586 ("InputBitDepth%d", cfg_InputBitDepthY, 8, MAX_LAYERS, "Bit-depth of input file for layer %d") … … 588 601 #if N0147_IRAP_ALIGN_FLAG 589 602 ("CrossLayerIrapAlignFlag", m_crossLayerIrapAlignFlag, true, "align IRAP across layers" ) 603 #endif 604 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 605 ("CrossLayerAlignedIdrOnlyFlag", m_crossLayerAlignedIdrOnlyFlag, true, "only idr for IRAP across layers" ) 590 606 #endif 591 607 #if O0194_WEIGHTED_PREDICTION_CGS … … 714 730 ("LambdaModifier5,-LM5", m_adLambdaModifier[ 5 ], ( Double )1.0, "Lambda modifier for temporal layer 5") 715 731 ("LambdaModifier6,-LM6", m_adLambdaModifier[ 6 ], ( Double )1.0, "Lambda modifier for temporal layer 6") 716 ("LambdaModifier7,-LM7", m_adLambdaModifier[ 7 ], ( Double )1.0, "Lambda modifier for temporal layer 7")717 732 #endif 718 733 … … 1070 1085 assert( strcmp(cfg_scaledRefLayerId[layer].c_str(), "")); 1071 1086 #endif 1087 #if P0312_VERT_PHASE_ADJ 1072 1088 assert( strcmp(cfg_scaledRefLayerLeftOffset[layer].c_str(), "") || 1073 1089 strcmp(cfg_scaledRefLayerRightOffset[layer].c_str(), "") || 1074 1090 strcmp(cfg_scaledRefLayerTopOffset[layer].c_str(), "") || 1075 strcmp(cfg_scaledRefLayerBottomOffset[layer].c_str(),"") 1076 ); 1091 strcmp(cfg_scaledRefLayerBottomOffset[layer].c_str(),"") || 1092 strcmp(cfg_vertPhasePositionEnableFlag[layer].c_str(),"") ); 1093 #else 1094 assert( strcmp(cfg_scaledRefLayerLeftOffset[layer].c_str(), "") || 1095 strcmp(cfg_scaledRefLayerRightOffset[layer].c_str(), "") || 1096 strcmp(cfg_scaledRefLayerTopOffset[layer].c_str(), "") || 1097 strcmp(cfg_scaledRefLayerBottomOffset[layer].c_str(),"") ); 1098 #endif 1077 1099 } 1078 1100 … … 1150 1172 } 1151 1173 } 1174 #if P0312_VERT_PHASE_ADJ 1175 // VertPhasePositionEnableFlag // 1176 if(strcmp(cfg_vertPhasePositionEnableFlag[layer].c_str(), "")) 1177 { 1178 cfgStringToArray( &tempArray, cfg_vertPhasePositionEnableFlag[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "VertPhasePositionEnableFlag"); 1179 if(tempArray) 1180 { 1181 for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++) 1182 { 1183 m_acLayerCfg[layer].m_vertPhasePositionEnableFlag[i] = tempArray[i]; 1184 } 1185 delete [] tempArray; tempArray = NULL; 1186 } 1187 } 1188 #endif 1152 1189 } 1153 1190 #if VPS_EXTN_DIRECT_REF_LAYERS … … 2342 2379 printf("Cross layer IRAP alignment : %d\n", m_crossLayerIrapAlignFlag ); 2343 2380 #endif 2381 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 2382 printf("IDR only for IRAP : %d\n", m_crossLayerAlignedIdrOnlyFlag ); 2383 #endif 2344 2384 #if O0194_WEIGHTED_PREDICTION_CGS 2345 2385 printf("InterLayerWeightedPred : %d\n", m_useInterLayerWeightedPred ); -
trunk/source/App/TAppEncoder/TAppEncCfg.h
r595 r644 384 384 Bool m_crossLayerIrapAlignFlag; 385 385 #endif 386 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 387 Bool m_crossLayerAlignedIdrOnlyFlag; 388 #endif 386 389 #if O0149_CROSS_LAYER_BLA_FLAG 387 390 Bool m_crossLayerBLAFlag; -
trunk/source/App/TAppEncoder/TAppEncLayerCfg.cpp
r540 r644 60 60 ::memset(m_scaledRefLayerRightOffset, 0, sizeof(m_scaledRefLayerRightOffset)); 61 61 ::memset(m_scaledRefLayerBottomOffset, 0, sizeof(m_scaledRefLayerBottomOffset)); 62 #if P0312_VERT_PHASE_ADJ 63 ::memset(m_vertPhasePositionEnableFlag, 0, sizeof(m_vertPhasePositionEnableFlag)); 64 #endif 62 65 } 63 66 -
trunk/source/App/TAppEncoder/TAppEncLayerCfg.h
r588 r644 97 97 Int m_scaledRefLayerRightOffset [MAX_LAYERS]; 98 98 Int m_scaledRefLayerBottomOffset[MAX_LAYERS]; 99 #if P0312_VERT_PHASE_ADJ 100 Bool m_vertPhasePositionEnableFlag[MAX_LAYERS]; 101 #endif 102 99 103 #if O0194_DIFFERENT_BITDEPTH_EL_BL 100 104 Int m_inputBitDepthY; ///< bit-depth of input file (luma component) -
trunk/source/App/TAppEncoder/TAppEncTop.cpp
r597 r644 570 570 m_acTEncTop[layer].setScaledRefLayerId(i, m_acLayerCfg[layer].m_scaledRefLayerId[i]); 571 571 #endif 572 #if P0312_VERT_PHASE_ADJ 573 m_acTEncTop[layer].setVertPhasePositionEnableFlag( i, m_acLayerCfg[layer].m_vertPhasePositionEnableFlag[i] ); 574 m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow( 2*m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i], 575 2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i], m_acLayerCfg[layer].m_vertPhasePositionEnableFlag[i] ); 576 #else 572 577 m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow( 2*m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i], 573 578 2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i]); 579 #endif 574 580 } 575 581 } … … 956 962 #endif 957 963 m_acTEncTop[layer].init(isFieldCoding); 964 #if P0182_VPS_VUI_PS_FLAG 965 m_acTEncTop[layer].getVPS()->setSPSId(layer, m_acTEncTop[layer].getSPS()->getSPSId()); 966 m_acTEncTop[layer].getVPS()->setPPSId(layer, m_acTEncTop[layer].getPPS()->getPPSId()); 967 #endif 958 968 } 959 969 #if VPS_RENAME … … 1193 1203 // at the encoder, modify below 1194 1204 Int oldValue = vps->getMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j ); 1195 oldValue += vps->getMaxVpsLayerDecPicBuffMinus1( i, k, j ) ;1205 oldValue += vps->getMaxVpsLayerDecPicBuffMinus1( i, k, j ) + 1; 1196 1206 vps->setMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j, oldValue ); 1197 1207 #else … … 1200 1210 maxNumReorderPics = std::max( maxNumReorderPics, m_acTEncTop[layerId].getNumReorderPics(j)); 1201 1211 } 1212 #if RESOLUTION_BASED_DPB 1213 for(Int k = 0; k < vps->getNumSubDpbs(i); k++) 1214 { 1215 // Decrement m_maxVpsDecPicBufferingMinus1 1216 Int oldValue = vps->getMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j ); 1217 vps->setMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j, oldValue - 1 ); 1218 } 1219 #endif 1202 1220 vps->setMaxVpsNumReorderPics(i, j, maxNumReorderPics); 1203 1221 vps->determineSubDpbInfoFlags(); … … 1286 1304 vps->setCrossLayerPictureTypeAlignFlag( m_crossLayerPictureTypeAlignFlag ); 1287 1305 #endif 1306 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 1307 vps->setCrossLayerAlignedIdrOnlyFlag( m_crossLayerAlignedIdrOnlyFlag ); 1308 #endif 1288 1309 #if N0147_IRAP_ALIGN_FLAG 1289 1310 vps->setCrossLayerIrapAlignFlag( m_crossLayerIrapAlignFlag ); … … 1327 1348 #endif 1328 1349 1350 #if P0300_ALT_OUTPUT_LAYER_FLAG 1351 for (Int k = 0; k < MAX_VPS_LAYER_SETS_PLUS1; k++) 1352 { 1353 vps->setAltOuputLayerFlag( k, m_altOutputLayerFlag ); 1354 } 1355 #else 1329 1356 #if O0153_ALT_OUTPUT_LAYER_FLAG 1330 1357 vps->setAltOuputLayerFlag( m_altOutputLayerFlag ); 1358 #endif 1359 #endif 1360 1361 #if P0312_VERT_PHASE_ADJ 1362 Bool vpsVuiVertPhaseInUseFlag = false; 1363 for( UInt layerId = 1; layerId < m_numLayers; layerId++ ) 1364 { 1365 for( i = 0; i < m_acLayerCfg[layerId].m_numScaledRefLayerOffsets; i++ ) 1366 { 1367 if( m_acTEncTop[layerId].getVertPhasePositionEnableFlag(i) ) 1368 { 1369 vpsVuiVertPhaseInUseFlag = true; 1370 break; 1371 } 1372 } 1373 } 1374 vps->setVpsVuiVertPhaseInUseFlag( vpsVuiVertPhaseInUseFlag ); 1375 #endif 1376 1377 #if O0164_MULTI_LAYER_HRD 1378 vps->setVpsVuiBspHrdPresentFlag(false); 1379 TEncTop *pcCfg = &m_acTEncTop[0]; 1380 if( pcCfg->getBufferingPeriodSEIEnabled() ) 1381 { 1382 vps->setVpsVuiBspHrdPresentFlag(true); 1383 vps->setVpsNumBspHrdParametersMinus1(vps->getNumLayerSets() - 2); 1384 vps->createBspHrdParamBuffer(vps->getVpsNumBspHrdParametersMinus1() + 1); 1385 for ( i = 0; i <= vps->getVpsNumBspHrdParametersMinus1(); i++ ) 1386 { 1387 vps->setBspCprmsPresentFlag(i, true); 1388 1389 UInt layerId = i + 1; 1390 TEncTop *pcCfgLayer = &m_acTEncTop[layerId]; 1391 1392 Int iPicWidth = pcCfgLayer->getSourceWidth(); 1393 Int iPicHeight = pcCfgLayer->getSourceHeight(); 1394 UInt uiWidthInCU = ( iPicWidth %m_uiMaxCUWidth ) ? iPicWidth /m_uiMaxCUWidth + 1 : iPicWidth /m_uiMaxCUWidth; 1395 UInt uiHeightInCU = ( iPicHeight%m_uiMaxCUHeight ) ? iPicHeight/m_uiMaxCUHeight + 1 : iPicHeight/m_uiMaxCUHeight; 1396 UInt uiNumCUsInFrame = uiWidthInCU * uiHeightInCU; 1397 1398 UInt maxCU = pcCfgLayer->getSliceArgument() >> ( m_uiMaxCUDepth << 1); 1399 UInt numDU = ( pcCfgLayer->getSliceMode() == 1 ) ? ( uiNumCUsInFrame / maxCU ) : ( 0 ); 1400 if( uiNumCUsInFrame % maxCU != 0 || numDU == 0 ) 1401 { 1402 numDU ++; 1403 } 1404 vps->getBspHrd(i)->setNumDU( numDU ); 1405 vps->setBspHrdParameters( i, pcCfgLayer->getFrameRate(), numDU, pcCfgLayer->getTargetBitrate(), ( pcCfgLayer->getIntraPeriod() > 0 ) ); 1406 } 1407 for(UInt h = 1; h <= (vps->getNumLayerSets()-1); h++) 1408 { 1409 vps->setNumBitstreamPartitions(h, 1); 1410 for( i = 0; i < vps->getNumBitstreamPartitions(h); i++ ) 1411 { 1412 for( UInt j = 0; j <= (vps->getMaxLayers()-1); j++ ) 1413 { 1414 if (vps->getLayerIdIncludedFlag(h, j) && h == j) 1415 { 1416 vps->setLayerInBspFlag(h, i, j, true); 1417 } 1418 } 1419 } 1420 vps->setNumBspSchedCombinations(h, 1); 1421 for( i = 0; i < vps->getNumBspSchedCombinations(h); i++ ) 1422 { 1423 for( UInt j = 0; j < vps->getNumBitstreamPartitions(h); j++ ) 1424 { 1425 vps->setBspCombHrdIdx(h, i, j, 0); 1426 vps->setBspCombSchedIdx(h, i, j, 0); 1427 } 1428 } 1429 } 1430 } 1331 1431 #endif 1332 1432 -
trunk/source/Lib/TLibCommon/CommonDef.h
r595 r644 58 58 #if SVC_EXTENSION 59 59 #include <vector> 60 #define NV_VERSION "5. 0(HM-13.0)" ///< Current software version60 #define NV_VERSION "5.1 (HM-13.0)" ///< Current software version 61 61 #else 62 62 #define NV_VERSION "13.0" ///< Current software version … … 178 178 179 179 // Explicit temporal layer QP offset 180 #define MAX_TLAYER 8///< max number of temporal layer180 #define MAX_TLAYER 7 ///< max number of temporal layer 181 181 #define HB_LAMBDA_FOR_LDC 1 ///< use of B-style lambda for non-key pictures in low-delay mode 182 182 … … 288 288 std::vector<Int> *m_targetDecLayerIdSet; 289 289 Bool m_valueCheckedFlag; 290 Int m_highestTId; 290 291 public: 291 292 CommonDecoderParams(): … … 294 295 , m_targetDecLayerIdSet(NULL) 295 296 , m_valueCheckedFlag(false) 297 , m_highestTId(6) 296 298 {} 297 299 … … 308 310 Bool getValueCheckedFlag() { return m_valueCheckedFlag;} 309 311 312 Void setHighestTId(const Int x) { m_highestTId = x; } 313 Int getHighestTId() { return m_highestTId; } 310 314 }; 311 315 #endif -
trunk/source/Lib/TLibCommon/SEI.h
r595 r644 40 40 //! \{ 41 41 class TComSPS; 42 #if O0164_MULTI_LAYER_HRD 43 class TComHRD; 44 #endif 42 45 43 46 /** … … 81 84 ,SUB_BITSTREAM_PROPERTY = 139 // Final PayloadType to be defined after finalization 82 85 #endif 86 #if O0164_MULTI_LAYER_HRD 87 ,BSP_NESTING = 140 88 ,BSP_INITIAL_ARRIVAL_TIME = 141 89 ,BSP_HRD = 142 90 #endif 83 91 }; 84 92 … … 157 165 , m_cpbDelayOffset (0) 158 166 , m_dpbDelayOffset (0) 167 #if P0138_USE_ALT_CPB_PARAMS_FLAG 168 , m_useAltCpbParamsFlagPresent(false) 169 , m_useAltCpbParamsFlag (false) 170 #endif 159 171 { 160 172 ::memset(m_initialCpbRemovalDelay, 0, sizeof(m_initialCpbRemovalDelay)); … … 175 187 Bool m_concatenationFlag; 176 188 UInt m_auCpbRemovalDelayDelta; 189 #if P0138_USE_ALT_CPB_PARAMS_FLAG 190 Bool m_useAltCpbParamsFlagPresent; 191 Bool m_useAltCpbParamsFlag; 192 #endif 177 193 }; 178 194 class SEIPictureTiming : public SEI … … 440 456 Void deleteSEIs (SEIMessages &seiList); 441 457 458 #if O0164_MULTI_LAYER_HRD 459 460 class SEIBspNesting : public SEI 461 { 462 public: 463 PayloadType payloadType() const { return BSP_NESTING; } 464 465 SEIBspNesting() {} 466 virtual ~SEIBspNesting() 467 { 468 if (!m_callerOwnsSEIs) 469 { 470 deleteSEIs(m_nestedSEIs); 471 } 472 } 473 474 Int m_bspIdx; 475 Bool m_callerOwnsSEIs; 476 SEIMessages m_nestedSEIs; 477 }; 478 479 class SEIBspInitialArrivalTime : public SEI 480 { 481 public: 482 PayloadType payloadType() const { return BSP_INITIAL_ARRIVAL_TIME; } 483 484 SEIBspInitialArrivalTime () {} 485 virtual ~SEIBspInitialArrivalTime () {} 486 487 UInt m_nalInitialArrivalDelay[256]; 488 UInt m_vclInitialArrivalDelay[256]; 489 }; 490 491 class SEIBspHrd : public SEI 492 { 493 public: 494 PayloadType payloadType() const { return BSP_HRD; } 495 496 SEIBspHrd () {} 497 virtual ~SEIBspHrd () {} 498 499 UInt m_seiNumBspHrdParametersMinus1; 500 Bool m_seiBspCprmsPresentFlag[MAX_VPS_LAYER_SETS_PLUS1]; 501 UInt m_seiNumBitstreamPartitionsMinus1[MAX_VPS_LAYER_SETS_PLUS1]; 502 Bool m_seiLayerInBspFlag[MAX_VPS_LAYER_SETS_PLUS1][8][MAX_LAYERS]; 503 UInt m_seiNumBspSchedCombinationsMinus1[MAX_VPS_LAYER_SETS_PLUS1]; 504 UInt m_seiBspCombHrdIdx[MAX_VPS_LAYER_SETS_PLUS1][16][16]; 505 UInt m_seiBspCombScheddx[MAX_VPS_LAYER_SETS_PLUS1][16][16]; 506 UInt m_vpsMaxLayers; 507 Bool m_layerIdIncludedFlag[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 508 509 TComHRD *hrd; 510 }; 511 512 #endif 513 442 514 class SEIScalableNesting : public SEI 443 515 { -
trunk/source/Lib/TLibCommon/TComBitStream.cpp
r595 r644 229 229 UChar saved_held_bits = m_held_bits; 230 230 UInt saved_fifo_idx = m_fifo_idx; 231 #if P0138_USE_ALT_CPB_PARAMS_FLAG 232 UInt saved_numBitsRead = m_numBitsRead; 233 #endif 231 234 232 235 UInt num_bits_to_read = min(uiNumberOfBits, getNumBitsLeft()); … … 237 240 m_held_bits = saved_held_bits; 238 241 m_num_held_bits = saved_num_held_bits; 242 #if P0138_USE_ALT_CPB_PARAMS_FLAG 243 m_numBitsRead = saved_numBitsRead; 244 #endif 239 245 } 240 246 -
trunk/source/Lib/TLibCommon/TComPrediction.cpp
r595 r644 768 768 #if O0215_PHASE_ALIGNMENT 769 769 #if O0194_JOINT_US_BITSHIFT 770 Void TComPrediction::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag )770 Void TComPrediction::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag ) 771 771 { 772 772 m_cUsf.upsampleBasePic( currSlice, refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window, phaseAlignFlag ); 773 773 } 774 774 #else 775 Void TComPrediction::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag )775 Void TComPrediction::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag ) 776 776 { 777 777 m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window, phaseAlignFlag ); -
trunk/source/Lib/TLibCommon/TComPrediction.h
r595 r644 49 49 50 50 #if SVC_UPSAMPLING 51 #include "TComDataCU.h"52 51 #include "TComUpsampleFilter.h" 53 52 #endif … … 122 121 #if O0215_PHASE_ALIGNMENT 123 122 #if O0194_JOINT_US_BITSHIFT 124 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag );123 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag ); 125 124 #else 126 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag );125 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag ); 127 126 #endif 128 127 #else -
trunk/source/Lib/TLibCommon/TComRom.h
r595 r644 273 273 #if SVC_EXTENSION 274 274 #if FAST_INTRA_SHVC 275 extern UIntg_reducedSetIntraModes[NUM_INTRA_MODE-1];276 extern UIntg_predefSetIntraModes[NUM_INTRA_MODE-1];275 extern UInt g_reducedSetIntraModes[NUM_INTRA_MODE-1]; 276 extern UInt g_predefSetIntraModes[NUM_INTRA_MODE-1]; 277 277 #endif 278 278 extern Int g_mvScalingFactor [MAX_LAYERS][2]; -
trunk/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp
r595 r644 44 44 //! \ingroup TLibCommon 45 45 //! \{ 46 #if !SVC_EXTENSION 46 47 UInt g_saoMaxOffsetQVal[NUM_SAO_COMPONENTS]; 48 #endif 47 49 48 50 SAOOffset::SAOOffset() … … 160 162 Int bitDepthSample = (compIdx == SAO_Y)?g_bitDepthY:g_bitDepthC; 161 163 m_offsetStepLog2 [compIdx] = max(bitDepthSample - MAX_SAO_TRUNCATED_BITDEPTH, 0); 164 #if SVC_EXTENSION 165 m_saoMaxOffsetQVal[compIdx] = (1<<(min(bitDepthSample,MAX_SAO_TRUNCATED_BITDEPTH)-5))-1; //Table 9-32, inclusive 166 #else 162 167 g_saoMaxOffsetQVal[compIdx] = (1<<(min(bitDepthSample,MAX_SAO_TRUNCATED_BITDEPTH)-5))-1; //Table 9-32, inclusive 168 #endif 163 169 } 164 170 … … 168 174 Int bitDepthSample = (compIdx == SAO_Y)?g_bitDepthY:g_bitDepthC; //exclusive 169 175 Int maxSampleValue = (1<< bitDepthSample); //exclusive 176 #if SVC_EXTENSION 177 Int maxOffsetValue = (m_saoMaxOffsetQVal[compIdx] << m_offsetStepLog2[compIdx]); 178 #else 170 179 Int maxOffsetValue = (g_saoMaxOffsetQVal[compIdx] << m_offsetStepLog2[compIdx]); 180 #endif 171 181 172 182 m_offsetClipTable[compIdx] = new Int[(maxSampleValue + maxOffsetValue -1)+ (maxOffsetValue)+1 ]; //positive & negative range plus 0 -
trunk/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h
r595 r644 53 53 // Class definition 54 54 // ==================================================================================================================== 55 #if !SVC_EXTENSION 55 56 extern UInt g_saoMaxOffsetQVal[NUM_SAO_COMPONENTS]; 57 #endif 56 58 57 59 class TComSampleAdaptiveOffset … … 69 71 Void reconstructBlkSAOParams(TComPic* pic, SAOBlkParam* saoBlkParams); 70 72 Void PCMLFDisableProcess (TComPic* pcPic); 73 #if SVC_EXTENSION 74 UInt* getSaoMaxOffsetQVal() { return m_saoMaxOffsetQVal; } 75 #endif 71 76 protected: 72 77 Void offsetBlock(Int compIdx, Int typeIdx, Int* offset, Pel* srcBlk, Pel* resBlk, Int srcStride, Int resStride, Int width, Int height … … 101 106 Int* m_offsetClipTable[NUM_SAO_COMPONENTS]; 102 107 Short* m_signTable; 103 108 #if SVC_EXTENSION 109 UInt m_saoMaxOffsetQVal[NUM_SAO_COMPONENTS]; 110 #endif 104 111 }; 105 112 -
trunk/source/Lib/TLibCommon/TComSlice.cpp
r597 r644 111 111 , m_bCrossLayerBLAFlag ( false ) 112 112 #endif 113 #if NO_OUTPUT_OF_PRIOR_PICS 114 , m_noOutputOfPriorPicsFlag ( false ) 115 , m_noRaslOutputFlag ( false ) 116 , m_handleCraAsBlaFlag ( false ) 117 #endif 118 #if POC_RESET_IDC_SIGNALLING 119 , m_pocResetIdc ( 0 ) 120 , m_pocResetPeriodId ( 0 ) 121 , m_fullPocResetFlag ( false ) 122 , m_pocLsbVal ( 0 ) 123 , m_pocMsbVal ( 0 ) 124 , m_pocMsbValRequiredFlag ( false ) 125 , m_pocMsbValPresentFlag ( false ) 126 #endif 113 127 #endif //SVC_EXTENSION 114 128 { … … 120 134 m_interLayerPredEnabledFlag = 0; 121 135 ::memset( m_interLayerPredLayerIdc, 0, sizeof(m_interLayerPredLayerIdc) ); 136 #if P0312_VERT_PHASE_ADJ 137 ::memset( m_vertPhasePositionFlag, 0, sizeof(m_vertPhasePositionFlag) ); 138 #endif 122 139 #endif //SVC_EXTENSION 123 140 … … 194 211 || getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA; 195 212 } 213 #if NO_OUTPUT_OF_PRIOR_PICS 214 Bool TComSlice::getBlaPicFlag () 215 { 216 return getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP 217 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL 218 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP; 219 } 220 Bool TComSlice::getCraPicFlag () 221 { 222 return getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA; 223 } 224 #endif 196 225 197 226 /** … … 848 877 849 878 #if SVC_EXTENSION 850 if( m_eSliceType == I_SLICE || ( m_ pcSPS->getLayerId()&&879 if( m_eSliceType == I_SLICE || ( m_layerId && 851 880 (m_eNalUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && 852 881 (m_eNalUnitType <= NAL_UNIT_CODED_SLICE_CRA) ) ) … … 872 901 { 873 902 numRpsCurrTempList += m_activeNumILRRefIdx; 874 }903 } 875 904 #endif 876 905 … … 1105 1134 m_interLayerPredEnabledFlag = pSrc->m_interLayerPredEnabledFlag; 1106 1135 memcpy( m_interLayerPredLayerIdc, pSrc->m_interLayerPredLayerIdc, sizeof( m_interLayerPredLayerIdc ) ); 1136 #if P0312_VERT_PHASE_ADJ 1137 memcpy( m_vertPhasePositionFlag, pSrc->m_vertPhasePositionFlag, sizeof( m_vertPhasePositionFlag ) ); 1138 #endif 1107 1139 #endif 1108 1140 m_pcSPS = pSrc->m_pcSPS; … … 1389 1421 Int i, isReference; 1390 1422 1423 #if !ALIGNED_BUMPING 1391 1424 checkLeadingPictureRestrictions(rcListPic); 1425 #endif 1392 1426 1393 1427 // loop through all pictures in the reference picture buffer … … 2071 2105 m_crossLayerIrapAlignFlag = true; 2072 2106 #endif 2107 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 2108 m_crossLayerAlignedIdrOnlyFlag = false; 2109 #endif 2073 2110 #if N0120_MAX_TID_REF_PRESENT_FLAG 2074 2111 m_maxTidRefPresentFlag = true; … … 2455 2492 return -1; // Layer not found 2456 2493 } 2494 #if O0164_MULTI_LAYER_HRD 2495 Void TComVPS::setBspHrdParameters( UInt hrdIdx, UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ) 2496 { 2497 if( !getVpsVuiBspHrdPresentFlag() ) 2498 { 2499 return; 2500 } 2501 2502 TComHRD *hrd = getBspHrd(hrdIdx); 2503 2504 Bool rateCnt = ( bitRate > 0 ); 2505 hrd->setNalHrdParametersPresentFlag( rateCnt ); 2506 hrd->setVclHrdParametersPresentFlag( rateCnt ); 2507 2508 hrd->setSubPicCpbParamsPresentFlag( ( numDU > 1 ) ); 2509 2510 if( hrd->getSubPicCpbParamsPresentFlag() ) 2511 { 2512 hrd->setTickDivisorMinus2( 100 - 2 ); // 2513 hrd->setDuCpbRemovalDelayLengthMinus1( 7 ); // 8-bit precision ( plus 1 for last DU in AU ) 2514 hrd->setSubPicCpbParamsInPicTimingSEIFlag( true ); 2515 hrd->setDpbOutputDelayDuLengthMinus1( 5 + 7 ); // With sub-clock tick factor of 100, at least 7 bits to have the same value as AU dpb delay 2516 } 2517 else 2518 { 2519 hrd->setSubPicCpbParamsInPicTimingSEIFlag( false ); 2520 } 2521 2522 hrd->setBitRateScale( 4 ); // in units of 2~( 6 + 4 ) = 1,024 bps 2523 hrd->setCpbSizeScale( 6 ); // in units of 2~( 4 + 4 ) = 1,024 bit 2524 hrd->setDuCpbSizeScale( 6 ); // in units of 2~( 4 + 4 ) = 1,024 bit 2525 2526 hrd->setInitialCpbRemovalDelayLengthMinus1(15); // assuming 0.5 sec, log2( 90,000 * 0.5 ) = 16-bit 2527 if( randomAccess ) 2528 { 2529 hrd->setCpbRemovalDelayLengthMinus1(5); // 32 = 2^5 (plus 1) 2530 hrd->setDpbOutputDelayLengthMinus1 (5); // 32 + 3 = 2^6 2531 } 2532 else 2533 { 2534 hrd->setCpbRemovalDelayLengthMinus1(9); // max. 2^10 2535 hrd->setDpbOutputDelayLengthMinus1 (9); // max. 2^10 2536 } 2537 2538 /* 2539 Note: only the case of "vps_max_temporal_layers_minus1 = 0" is supported. 2540 */ 2541 Int i, j; 2542 UInt birateValue, cpbSizeValue; 2543 UInt ducpbSizeValue; 2544 UInt duBitRateValue = 0; 2545 2546 for( i = 0; i < MAX_TLAYER; i ++ ) 2547 { 2548 hrd->setFixedPicRateFlag( i, 1 ); 2549 hrd->setPicDurationInTcMinus1( i, 0 ); 2550 hrd->setLowDelayHrdFlag( i, 0 ); 2551 hrd->setCpbCntMinus1( i, 0 ); 2552 2553 birateValue = bitRate; 2554 cpbSizeValue = bitRate; // 1 second 2555 ducpbSizeValue = bitRate/numDU; 2556 duBitRateValue = bitRate; 2557 for( j = 0; j < ( hrd->getCpbCntMinus1( i ) + 1 ); j ++ ) 2558 { 2559 hrd->setBitRateValueMinus1( i, j, 0, ( birateValue - 1 ) ); 2560 hrd->setCpbSizeValueMinus1( i, j, 0, ( cpbSizeValue - 1 ) ); 2561 hrd->setDuCpbSizeValueMinus1( i, j, 0, ( ducpbSizeValue - 1 ) ); 2562 hrd->setCbrFlag( i, j, 0, ( j == 0 ) ); 2563 2564 hrd->setBitRateValueMinus1( i, j, 1, ( birateValue - 1) ); 2565 hrd->setCpbSizeValueMinus1( i, j, 1, ( cpbSizeValue - 1 ) ); 2566 hrd->setDuCpbSizeValueMinus1( i, j, 1, ( ducpbSizeValue - 1 ) ); 2567 hrd->setDuBitRateValueMinus1( i, j, 1, ( duBitRateValue - 1 ) ); 2568 hrd->setCbrFlag( i, j, 1, ( j == 0 ) ); 2569 } 2570 } 2571 } 2572 #endif 2457 2573 // RepFormat Assignment operator 2458 2574 RepFormat& RepFormat::operator= (const RepFormat &other) … … 2548 2664 ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps)); 2549 2665 ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag)); 2666 2667 #if P0312_VERT_PHASE_ADJ 2668 ::memset(m_vertPhasePositionEnableFlag, 0, sizeof(m_vertPhasePositionEnableFlag)); 2669 #endif 2550 2670 } 2551 2671 … … 2736 2856 , m_scalingListRefLayerId ( 0 ) 2737 2857 #endif 2858 #if POC_RESET_IDC 2859 , m_pocResetInfoPresentFlag (false) 2860 #endif 2738 2861 { 2739 2862 m_scalingList = new TComScalingList; … … 3405 3528 //set reference picture POC of each ILP reference 3406 3529 Int thePoc = ilpPic[refLayerIdc]->getPOC(); 3407 assert(thePoc >= 0);3408 3530 assert(thePoc == pcRefPicBL->getPOC()); 3409 3531 -
trunk/source/Lib/TLibCommon/TComSlice.h
r595 r644 231 231 { 232 232 ProfileTierLevel m_generalPTL; 233 ProfileTierLevel m_subLayerPTL [6]; // max. value of max_sub_layers_minus1 is 6234 Bool m_subLayerProfilePresentFlag [6];235 Bool m_subLayerLevelPresentFlag [6];233 ProfileTierLevel m_subLayerPTL [MAX_TLAYER-1]; // max. value of max_sub_layers_minus1 is MAX_TLAYER-1 ( = 6 ) 234 Bool m_subLayerProfilePresentFlag [MAX_TLAYER-1]; 235 Bool m_subLayerLevelPresentFlag [MAX_TLAYER-1]; 236 236 237 237 public: … … 568 568 Bool m_crossLayerIrapAlignFlag; 569 569 #endif 570 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 571 Bool m_crossLayerAlignedIdrOnlyFlag; 572 #endif 570 573 #if O0225_MAX_TID_FOR_REF_LAYERS 571 574 UInt m_maxTidIlRefPicsPlus1[MAX_VPS_LAYER_ID_PLUS1 - 1][MAX_VPS_LAYER_ID_PLUS1]; … … 599 602 #endif 600 603 #if N0160_VUI_EXT_ILP_REF 601 Bool 602 Int 603 Bool 604 Int 604 Bool m_ilpRestrictedRefLayersFlag; 605 Int m_minSpatialSegmentOffsetPlus1[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 606 Bool m_ctuBasedOffsetEnabledFlag [MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 607 Int m_minHorizontalCtuOffsetPlus1 [MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 605 608 #endif 606 609 #if VPS_VUI_VIDEO_SIGNAL 607 Bool 608 Int 609 Int 610 Int 611 Bool 612 Int 613 Int 614 Int 610 Bool m_vidSigPresentVpsFlag; 611 Int m_vpsVidSigInfo; 612 Int m_vpsVidSigIdx[MAX_VPS_LAYER_ID_PLUS1]; 613 Int m_vpsVidFormat[16]; 614 Bool m_vpsFullRangeFlag[16]; 615 Int m_vpsColorPrimaries[16]; 616 Int m_vpsTransChar[16]; 617 Int m_vpsMatCoeff[16]; 615 618 #endif 616 619 #if VPS_VUI_BITRATE_PICRATE 617 Bool m_bitRatePresentVpsFlag; 618 Bool m_picRatePresentVpsFlag; 619 Bool m_bitRatePresentFlag [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 620 Bool m_picRatePresentFlag [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 621 Int m_avgBitRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 622 Int m_maxBitRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 623 Int m_constPicRateIdc [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 624 Int m_avgPicRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 625 #endif 620 Bool m_bitRatePresentVpsFlag; 621 Bool m_picRatePresentVpsFlag; 622 Bool m_bitRatePresentFlag [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 623 Bool m_picRatePresentFlag [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 624 Int m_avgBitRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 625 Int m_maxBitRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 626 Int m_constPicRateIdc [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 627 Int m_avgPicRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 628 #endif 629 630 #if P0312_VERT_PHASE_ADJ 631 Bool m_vpsVuiVertPhaseInUseFlag; 632 #endif 633 634 #if P0300_ALT_OUTPUT_LAYER_FLAG 635 Bool m_altOutputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1]; 636 #else 626 637 #if O0153_ALT_OUTPUT_LAYER_FLAG 627 638 Bool m_altOutputLayerFlag; 639 #endif 628 640 #endif 629 641 #if REPN_FORMAT_IN_VPS … … 635 647 #if VIEW_ID_RELATED_SIGNALING 636 648 #if O0109_VIEW_ID_LEN 637 Int 649 Int m_viewIdLen; 638 650 #else 639 Int 640 #endif 641 Int 651 Int m_viewIdLenMinus1; 652 #endif 653 Int m_viewIdVal [MAX_LAYERS]; 642 654 #endif 643 655 … … 650 662 Bool m_recursiveRefLayerFlag[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; // flag to indicate if j-th layer is a direct or indirect reference layer of i-th layer 651 663 #endif 664 #if SPS_DPB_PARAMS 665 Int m_TolsIdx; 666 #endif 652 667 #if VPS_DPB_SIZE_TABLE 653 Bool m_subLayerFlagInfoPresentFlag [MAX_VPS_OP_LAYER_SETS_PLUS1];654 Bool m_subLayerDpbInfoPresentFlag [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];655 Int m_maxVpsDecPicBufferingMinus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS][MAX_TLAYER];668 Bool m_subLayerFlagInfoPresentFlag [MAX_VPS_OP_LAYER_SETS_PLUS1]; 669 Bool m_subLayerDpbInfoPresentFlag [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS]; 670 Int m_maxVpsDecPicBufferingMinus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS][MAX_TLAYER]; 656 671 #if RESOLUTION_BASED_DPB 657 Int m_maxVpsLayerDecPicBuffMinus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS][MAX_TLAYER];658 #endif 659 Int m_maxVpsNumReorderPics [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];660 Int m_maxVpsLatencyIncreasePlus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];672 Int m_maxVpsLayerDecPicBuffMinus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS][MAX_TLAYER]; 673 #endif 674 Int m_maxVpsNumReorderPics [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS]; 675 Int m_maxVpsLatencyIncreasePlus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS]; 661 676 #if CHANGE_NUMSUBDPB_IDX 662 Int m_numSubDpbs [MAX_VPS_LAYER_SETS_PLUS1];677 Int m_numSubDpbs [MAX_VPS_LAYER_SETS_PLUS1]; 663 678 #else 664 Int m_numSubDpbs [MAX_VPS_OP_LAYER_SETS_PLUS1];679 Int m_numSubDpbs [MAX_VPS_OP_LAYER_SETS_PLUS1]; 665 680 #endif 666 681 #endif … … 670 685 #endif 671 686 687 #if O0164_MULTI_LAYER_HRD 688 Bool m_vpsVuiBspHrdPresentFlag; 689 UInt m_vpsNumBspHrdParametersMinus1; 690 Bool m_bspCprmsPresentFlag[MAX_VPS_LAYER_SETS_PLUS1]; 691 TComHRD *m_bspHrd; 692 UInt m_numBitstreamPartitions[MAX_VPS_LAYER_SETS_PLUS1]; 693 Bool m_layerInBspFlag[MAX_VPS_LAYER_SETS_PLUS1][8][MAX_LAYERS]; 694 UInt m_numBspSchedCombinations[MAX_VPS_LAYER_SETS_PLUS1]; 695 UInt m_bspCombHrdIdx[MAX_VPS_LAYER_SETS_PLUS1][16][16]; 696 UInt m_bspCombSchedIdx[MAX_VPS_LAYER_SETS_PLUS1][16][16]; 697 #endif 698 699 #if P0182_VPS_VUI_PS_FLAG 700 UInt m_SPSId[MAX_LAYERS]; 701 UInt m_PPSId[MAX_LAYERS]; 702 UInt m_baseLayerPSCompatibilityFlag[MAX_LAYERS]; 703 #endif 704 672 705 #if !P0307_REMOVE_VPS_VUI_OFFSET 673 706 #if VPS_VUI_OFFSET 674 Int m_vpsVuiOffset;707 Int m_vpsVuiOffset; 675 708 #endif 676 709 #endif 677 710 #if P0307_VPS_NON_VUI_EXTENSION 678 Int m_vpsNonVuiExtLength;711 Int m_vpsNonVuiExtLength; 679 712 #endif 680 713 #if RESOLUTION_BASED_DPB 681 Int m_subDpbAssigned [MAX_VPS_LAYER_SETS_PLUS1][MAX_LAYERS];714 Int m_subDpbAssigned [MAX_VPS_LAYER_SETS_PLUS1][MAX_LAYERS]; 682 715 #endif 683 716 #endif //SVC_EXTENSION … … 692 725 m_cprmsPresentFlag = new Bool [ getNumHrdParameters() ]; 693 726 } 727 728 #if O0164_MULTI_LAYER_HRD 729 Void createBspHrdParamBuffer(UInt numHrds) 730 { 731 m_bspHrd = new TComHRD[ numHrds ]; 732 // m_hrdOpSetIdx = new UInt [ getNumHrdParameters() ]; 733 // m_cprmsPresentFlag = new Bool [ getNumHrdParameters() ]; 734 } 735 #endif 694 736 695 737 TComHRD* getHrdParameters ( UInt i ) { return &m_hrdParameters[ i ]; } … … 875 917 Bool getCrossLayerPictureTypeAlignFlag() { return m_crossLayerPictureTypeAlignFlag; } 876 918 Void setCrossLayerPictureTypeAlignFlag(Bool x) { m_crossLayerPictureTypeAlignFlag = x; } 919 #endif 920 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 921 Bool getCrossLayerAlignedIdrOnlyFlag() { return m_crossLayerAlignedIdrOnlyFlag; } 922 Void setCrossLayerAlignedIdrOnlyFlag(Bool x) { m_crossLayerAlignedIdrOnlyFlag = x; } 877 923 #endif 878 924 #if N0147_IRAP_ALIGN_FLAG … … 892 938 #endif 893 939 #if VPS_TSLAYERS 894 895 896 897 940 Bool getMaxTSLayersPresentFlag() { return m_maxTSLayersPresentFlag ;} 941 Void setMaxTSLayersPresentFlag(Bool x) { m_maxTSLayersPresentFlag = x;} 942 UInt getMaxTSLayersMinus1(Int layerId) { return m_maxTSLayerMinus1[layerId];} 943 Void setMaxTSLayersMinus1(Int layerId, UInt maxTSublayer) { m_maxTSLayerMinus1[layerId] = maxTSublayer;} 898 944 #endif 899 945 #if M0040_ADAPTIVE_RESOLUTION_CHANGE … … 924 970 #endif 925 971 #if N0160_VUI_EXT_ILP_REF 926 Bool getIlpRestrictedRefLayersFlag ( ) { return m_ilpRestrictedRefLayersFlag ;}927 Void setIlpRestrictedRefLayersFlag ( Int val ) { m_ilpRestrictedRefLayersFlag = val;}928 929 Int getMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId ) { return m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId];}930 Void setMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId, Int val ) { m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId] = val;}931 932 Bool getCtuBasedOffsetEnabledFlag ( Int currLayerId, Int refLayerId ) { return m_ctuBasedOffsetEnabledFlag[currLayerId][refLayerId];}933 Void setCtuBasedOffsetEnabledFlag ( Int currLayerId, Int refLayerId, Bool flag ) { m_ctuBasedOffsetEnabledFlag[currLayerId][refLayerId] = flag;}934 935 Int getMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId ) { return m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId];}936 Void setMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId, Int val ) { m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId] = val;}972 Bool getIlpRestrictedRefLayersFlag ( ) { return m_ilpRestrictedRefLayersFlag ;} 973 Void setIlpRestrictedRefLayersFlag ( Int val ) { m_ilpRestrictedRefLayersFlag = val;} 974 975 Int getMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId ) { return m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId];} 976 Void setMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId, Int val ) { m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId] = val;} 977 978 Bool getCtuBasedOffsetEnabledFlag ( Int currLayerId, Int refLayerId ) { return m_ctuBasedOffsetEnabledFlag[currLayerId][refLayerId];} 979 Void setCtuBasedOffsetEnabledFlag ( Int currLayerId, Int refLayerId, Bool flag ) { m_ctuBasedOffsetEnabledFlag[currLayerId][refLayerId] = flag;} 980 981 Int getMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId ) { return m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId];} 982 Void setMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId, Int val ) { m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId] = val;} 937 983 #endif 938 984 #if VPS_VUI_VIDEO_SIGNAL 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 985 Bool getVideoSigPresentVpsFlag() { return m_vidSigPresentVpsFlag; } 986 Void setVideoSigPresentVpsFlag(Bool x) { m_vidSigPresentVpsFlag = x; } 987 Int getNumVideoSignalInfo() { return m_vpsVidSigInfo; } 988 Void setNumVideoSignalInfo(Int x) { m_vpsVidSigInfo = x; } 989 Int getVideoSignalInfoIdx(Int idx) { return m_vpsVidSigIdx[idx]; } 990 Void setVideoSignalInfoIdx(Int idx, Int x) { m_vpsVidSigIdx[idx] = x; } 991 Int getVideoVPSFormat(Int idx) { return m_vpsVidFormat[idx]; } 992 Void setVideoVPSFormat(Int idx, Int x) { m_vpsVidFormat[idx] = x; } 993 Bool getVideoFullRangeVpsFlag(Int idx) { return m_vpsFullRangeFlag[idx];} 994 Void setVideoFullRangeVpsFlag(Int idx, Bool x) { m_vpsFullRangeFlag[idx] = x; } 995 Int getColorPrimaries(Int idx) { return m_vpsColorPrimaries[idx]; } 996 Void setColorPrimaries(Int idx, Int x) { m_vpsColorPrimaries[idx] = x; } 997 Int getTransCharacter(Int idx) { return m_vpsTransChar[idx]; } 998 Void setTransCharacter(Int idx, Int x) { m_vpsTransChar[idx] = x; } 999 Int getMaxtrixCoeff(Int idx) { return m_vpsMatCoeff[idx]; } 1000 Void setMaxtrixCoeff(Int idx, Int x) { m_vpsMatCoeff[idx] = x; } 955 1001 #endif 956 1002 #if VPS_VUI_BITRATE_PICRATE 957 Bool getBitRatePresentVpsFlag() { return m_bitRatePresentVpsFlag; } 958 Void setBitRatePresentVpsFlag(Bool x) { m_bitRatePresentVpsFlag = x; } 959 Bool getPicRatePresentVpsFlag() { return m_picRatePresentVpsFlag; } 960 Void setPicRatePresentVpsFlag(Bool x) { m_picRatePresentVpsFlag = x; } 961 962 Bool getBitRatePresentFlag(Int i, Int j) { return m_bitRatePresentFlag[i][j]; } 963 Void setBitRatePresentFlag(Int i, Int j, Bool x) { m_bitRatePresentFlag[i][j] = x; } 964 Bool getPicRatePresentFlag(Int i, Int j) { return m_picRatePresentFlag[i][j]; } 965 Void setPicRatePresentFlag(Int i, Int j, Bool x) { m_picRatePresentFlag[i][j] = x; } 966 967 Int getAvgBitRate(Int i, Int j) { return m_avgBitRate[i][j]; } 968 Void setAvgBitRate(Int i, Int j, Int x) { m_avgBitRate[i][j] = x; } 969 Int getMaxBitRate(Int i, Int j) { return m_maxBitRate[i][j]; } 970 Void setMaxBitRate(Int i, Int j, Int x) { m_maxBitRate[i][j] = x; } 971 972 Int getConstPicRateIdc(Int i, Int j) { return m_constPicRateIdc[i][j]; } 973 Void setConstPicRateIdc(Int i, Int j, Int x) { m_constPicRateIdc[i][j] = x; } 974 Int getAvgPicRate(Int i, Int j) { return m_avgPicRate[i][j]; } 975 Void setAvgPicRate(Int i, Int j, Int x) { m_avgPicRate[i][j] = x; } 976 #endif 1003 Bool getBitRatePresentVpsFlag() { return m_bitRatePresentVpsFlag; } 1004 Void setBitRatePresentVpsFlag(Bool x) { m_bitRatePresentVpsFlag = x; } 1005 Bool getPicRatePresentVpsFlag() { return m_picRatePresentVpsFlag; } 1006 Void setPicRatePresentVpsFlag(Bool x) { m_picRatePresentVpsFlag = x; } 1007 1008 Bool getBitRatePresentFlag(Int i, Int j) { return m_bitRatePresentFlag[i][j]; } 1009 Void setBitRatePresentFlag(Int i, Int j, Bool x) { m_bitRatePresentFlag[i][j] = x; } 1010 Bool getPicRatePresentFlag(Int i, Int j) { return m_picRatePresentFlag[i][j]; } 1011 Void setPicRatePresentFlag(Int i, Int j, Bool x) { m_picRatePresentFlag[i][j] = x; } 1012 1013 Int getAvgBitRate(Int i, Int j) { return m_avgBitRate[i][j]; } 1014 Void setAvgBitRate(Int i, Int j, Int x) { m_avgBitRate[i][j] = x; } 1015 Int getMaxBitRate(Int i, Int j) { return m_maxBitRate[i][j]; } 1016 Void setMaxBitRate(Int i, Int j, Int x) { m_maxBitRate[i][j] = x; } 1017 1018 Int getConstPicRateIdc(Int i, Int j) { return m_constPicRateIdc[i][j]; } 1019 Void setConstPicRateIdc(Int i, Int j, Int x) { m_constPicRateIdc[i][j] = x; } 1020 Int getAvgPicRate(Int i, Int j) { return m_avgPicRate[i][j]; } 1021 Void setAvgPicRate(Int i, Int j, Int x) { m_avgPicRate[i][j] = x; } 1022 #endif 1023 #if O0164_MULTI_LAYER_HRD 1024 Bool getVpsVuiBspHrdPresentFlag() { return m_vpsVuiBspHrdPresentFlag; } 1025 Void setVpsVuiBspHrdPresentFlag(Bool x) { m_vpsVuiBspHrdPresentFlag = x; } 1026 UInt getVpsNumBspHrdParametersMinus1() { return m_vpsNumBspHrdParametersMinus1; } 1027 Void setVpsNumBspHrdParametersMinus1(UInt i) { m_vpsNumBspHrdParametersMinus1 = i; } 1028 Bool getBspCprmsPresentFlag(UInt i) { return m_bspCprmsPresentFlag[i]; } 1029 Void setBspCprmsPresentFlag(UInt i, Bool val) { m_bspCprmsPresentFlag[i] = val; } 1030 TComHRD* getBspHrd(UInt i) { return &m_bspHrd[i]; } 1031 UInt getNumBitstreamPartitions(UInt i) { return m_numBitstreamPartitions[i]; } 1032 Void setNumBitstreamPartitions(UInt i, UInt val) { m_numBitstreamPartitions[i] = val; } 1033 UInt getLayerInBspFlag(UInt h, UInt i, UInt j) { return m_layerInBspFlag[h][i][j]; } 1034 Void setLayerInBspFlag(UInt h, UInt i, UInt j, UInt val) { m_layerInBspFlag[h][i][j] = val; } 1035 UInt getNumBspSchedCombinations(UInt i) { return m_numBspSchedCombinations[i]; } 1036 Void setNumBspSchedCombinations(UInt i, UInt val) { m_numBspSchedCombinations[i] = val; } 1037 UInt getBspCombHrdIdx(UInt h, UInt i, UInt j) { return m_bspCombHrdIdx[h][i][j]; } 1038 Void setBspCombHrdIdx(UInt h, UInt i, UInt j, UInt val) { m_bspCombHrdIdx[h][i][j] = val; } 1039 UInt getBspCombSchedIdx(UInt h, UInt i, UInt j) { return m_bspCombSchedIdx[h][i][j]; } 1040 Void setBspCombSchedIdx(UInt h, UInt i, UInt j, UInt val) { m_bspCombSchedIdx[h][i][j] = val; } 1041 #endif 1042 #if P0182_VPS_VUI_PS_FLAG 1043 Int getSPSId (Int layer) { return m_SPSId[layer]; } 1044 Void setSPSId (Int layer, Int val) { m_SPSId[layer] = val; } 1045 Int getPPSId (Int layer) { return m_PPSId[layer]; } 1046 Void setPPSId (Int layer, Int val) { m_PPSId[layer] = val; } 1047 Void setBaseLayerPSCompatibilityFlag (Int layer, int val) { m_baseLayerPSCompatibilityFlag[layer] = val; } 1048 Int getBaseLayerPSCompatibilityFlag (Int layer) { return m_baseLayerPSCompatibilityFlag[layer];} 1049 #endif 1050 1051 #if P0312_VERT_PHASE_ADJ 1052 Bool getVpsVuiVertPhaseInUseFlag() { return m_vpsVuiVertPhaseInUseFlag; } 1053 Void setVpsVuiVertPhaseInUseFlag(Bool x) { m_vpsVuiVertPhaseInUseFlag = x; } 1054 #endif 1055 1056 #if P0300_ALT_OUTPUT_LAYER_FLAG 1057 Bool getAltOuputLayerFlag(Int idx) { return m_altOutputLayerFlag[idx]; } 1058 Void setAltOuputLayerFlag(Int idx, Bool x) { m_altOutputLayerFlag[idx] = x; } 1059 #else 977 1060 #if O0153_ALT_OUTPUT_LAYER_FLAG 978 1061 Bool getAltOuputLayerFlag() { return m_altOutputLayerFlag; } 979 1062 Void setAltOuputLayerFlag(Bool x) { m_altOutputLayerFlag = x; } 980 1063 #endif 1064 #endif 981 1065 #if REPN_FORMAT_IN_VPS 982 1066 Bool getRepFormatIdxPresentFlag() { return m_repFormatIdxPresentFlag; } … … 988 1072 RepFormat* getVpsRepFormat(Int idx) { return &m_vpsRepFormat[idx]; } 989 1073 990 Int getVpsRepFormatIdx(Int idx) { return m_vpsRepFormatIdx[idx]; }991 Void setVpsRepFormatIdx(Int idx, Int x) { m_vpsRepFormatIdx[idx] = x; }1074 Int getVpsRepFormatIdx(Int idx) { return m_vpsRepFormatIdx[idx]; } 1075 Void setVpsRepFormatIdx(Int idx, Int x) { m_vpsRepFormatIdx[idx] = x; } 992 1076 #endif 993 1077 #if VIEW_ID_RELATED_SIGNALING 994 1078 #if O0109_VIEW_ID_LEN 995 Void setViewIdLen( Int val ) { m_viewIdLen = val;}996 Int 1079 Void setViewIdLen( Int val ) { m_viewIdLen = val; } 1080 Int getViewIdLen( ) { return m_viewIdLen; } 997 1081 #else 998 Void setViewIdLenMinus1( Int val ) { m_viewIdLenMinus1 = val;}999 Int getViewIdLenMinus1( ){ return m_viewIdLenMinus1; }1000 #endif 1001 1002 Void setViewIdVal( Int viewOrderIndex, Int val ) { m_viewIdVal[viewOrderIndex] = val;}1003 Int getViewIdVal( Int viewOrderIndex ){ return m_viewIdVal[viewOrderIndex]; }1004 Int 1005 1006 Int getViewIndex ( Int layerIdInNuh ){ return getScalabilityId( getLayerIdInVps(layerIdInNuh), VIEW_ORDER_INDEX ); }1007 1008 Int 1009 Int 1082 Void setViewIdLenMinus1( Int val ) { m_viewIdLenMinus1 = val; } 1083 Int getViewIdLenMinus1( ) { return m_viewIdLenMinus1; } 1084 #endif 1085 1086 Void setViewIdVal( Int viewOrderIndex, Int val ) { m_viewIdVal[viewOrderIndex] = val; } 1087 Int getViewIdVal( Int viewOrderIndex ) { return m_viewIdVal[viewOrderIndex]; } 1088 Int getScalabilityId(Int, ScalabilityType scalType ); 1089 1090 Int getViewIndex ( Int layerIdInNuh ) { return getScalabilityId( getLayerIdInVps(layerIdInNuh), VIEW_ORDER_INDEX ); } 1091 1092 Int getNumViews(); 1093 Int scalTypeToScalIdx( ScalabilityType scalType ); 1010 1094 #endif 1011 1095 #if !P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED 1012 1096 #if VPS_EXTN_OFFSET 1013 Int 1014 Void 1097 Int getExtensionOffset() { return m_extensionOffset; } 1098 Void setExtensionOffset( UInt offset ) { m_extensionOffset = offset; } 1015 1099 #endif 1016 1100 #endif … … 1020 1104 #endif 1021 1105 #if VPS_DPB_SIZE_TABLE 1022 Bool 1023 Void 1024 1025 Bool 1026 Void 1106 Bool getSubLayerFlagInfoPresentFlag(Int i) {return m_subLayerFlagInfoPresentFlag[i]; } 1107 Void setSubLayerFlagInfoPresentFlag(Int i, Bool x) {m_subLayerFlagInfoPresentFlag[i] = x; } 1108 1109 Bool getSubLayerDpbInfoPresentFlag(Int i, Int j) {return m_subLayerDpbInfoPresentFlag[i][j]; } 1110 Void setSubLayerDpbInfoPresentFlag(Int i, Int j, Bool x) {m_subLayerDpbInfoPresentFlag[i][j] = x; } 1027 1111 1028 1112 // For the 0-th output layer set, use the date from the active SPS for base layer. 1029 Int 1030 Void 1113 Int getMaxVpsDecPicBufferingMinus1(Int i, Int k, Int j) { assert(i != 0); return m_maxVpsDecPicBufferingMinus1[i][k][j]; } 1114 Void setMaxVpsDecPicBufferingMinus1(Int i, Int k, Int j, Int x) { m_maxVpsDecPicBufferingMinus1[i][k][j] = x; } 1031 1115 1032 1116 #if RESOLUTION_BASED_DPB 1033 Int 1034 Void 1035 #endif 1036 1037 Int getMaxVpsNumReorderPics(Int i, Int j){ assert(i != 0); return m_maxVpsNumReorderPics[i][j]; }1038 Void 1039 1040 Int getMaxVpsLatencyIncreasePlus1(Int i, Int j){ assert(i != 0); return m_maxVpsLatencyIncreasePlus1[i][j]; }1041 Void 1042 1043 Int 1044 Void 1045 Void 1117 Int getMaxVpsLayerDecPicBuffMinus1(Int i, Int k, Int j) { assert(i != 0); return m_maxVpsLayerDecPicBuffMinus1[i][k][j]; } 1118 Void setMaxVpsLayerDecPicBuffMinus1(Int i, Int k, Int j, Int x) { m_maxVpsLayerDecPicBuffMinus1[i][k][j] = x; } 1119 #endif 1120 1121 Int getMaxVpsNumReorderPics(Int i, Int j) { assert(i != 0); return m_maxVpsNumReorderPics[i][j]; } 1122 Void setMaxVpsNumReorderPics(Int i, Int j, Int x) { m_maxVpsNumReorderPics[i][j] = x; } 1123 1124 Int getMaxVpsLatencyIncreasePlus1(Int i, Int j) { assert(i != 0); return m_maxVpsLatencyIncreasePlus1[i][j]; } 1125 Void setMaxVpsLatencyIncreasePlus1(Int i, Int j, Int x) { m_maxVpsLatencyIncreasePlus1[i][j] = x; } 1126 1127 Int getNumSubDpbs(Int i) { return m_numSubDpbs[i]; } 1128 Void setNumSubDpbs(Int i, Int x) { m_numSubDpbs[i] = x; } 1129 Void determineSubDpbInfoFlags(); 1046 1130 #endif 1047 1131 … … 1053 1137 #if !P0307_REMOVE_VPS_VUI_OFFSET 1054 1138 #if VPS_VUI_OFFSET 1055 Int 1056 Void 1139 Int getVpsVuiOffset() { return m_vpsVuiOffset; } 1140 Void setVpsVuiOffset(Int x) { m_vpsVuiOffset = x; } 1057 1141 #endif 1058 1142 #endif 1059 1143 #if P0307_VPS_NON_VUI_EXTENSION 1060 Int 1061 Void 1144 Int getVpsNonVuiExtLength() { return m_vpsNonVuiExtLength; } 1145 Void setVpsNonVuiExtLength(Int x) { m_vpsNonVuiExtLength = x; } 1062 1146 #endif 1063 1147 #if RESOLUTION_BASED_DPB 1064 Void assignSubDpbIndices(); 1065 Int getSubDpbAssigned (Int lsIdx, Int layerIdx) { return m_subDpbAssigned[lsIdx][layerIdx]; } 1066 Int findLayerIdxInLayerSet ( Int lsIdx, Int nuhLayerId ); 1148 Void assignSubDpbIndices(); 1149 Int getSubDpbAssigned (Int lsIdx, Int layerIdx) { return m_subDpbAssigned[lsIdx][layerIdx]; } 1150 Int findLayerIdxInLayerSet ( Int lsIdx, Int nuhLayerId ); 1151 #endif 1152 #if O0164_MULTI_LAYER_HRD 1153 Void setBspHrdParameters( UInt hrdIdx, UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ); 1067 1154 #endif 1068 1155 #endif //SVC_EXTENSION … … 1077 1164 Int m_winTopOffset; 1078 1165 Int m_winBottomOffset; 1166 #if P0312_VERT_PHASE_ADJ 1167 Bool m_vertPhasePositionEnableFlag; 1168 #endif 1079 1169 public: 1080 1170 Window() … … 1084 1174 , m_winTopOffset (0) 1085 1175 , m_winBottomOffset (0) 1176 #if P0312_VERT_PHASE_ADJ 1177 , m_vertPhasePositionEnableFlag(false) 1178 #endif 1086 1179 { } 1087 1180 1088 1181 Bool getWindowEnabledFlag() const { return m_enabledFlag; } 1089 Void resetWindow() { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; } 1182 #if P0312_VERT_PHASE_ADJ 1183 Void resetWindow() { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; m_vertPhasePositionEnableFlag = false; } 1184 #else 1185 Void resetWindow() { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0;} 1186 #endif 1090 1187 Int getWindowLeftOffset() const { return m_enabledFlag ? m_winLeftOffset : 0; } 1091 1188 Void setWindowLeftOffset(Int val) { m_winLeftOffset = val; m_enabledFlag = true; } … … 1097 1194 Void setWindowBottomOffset(Int val) { m_winBottomOffset = val; m_enabledFlag = true; } 1098 1195 1196 #if P0312_VERT_PHASE_ADJ 1197 Bool getVertPhasePositionEnableFlag() const { return m_vertPhasePositionEnableFlag; } 1198 Void setVertPhasePositionEnableFlag(Bool val) { m_vertPhasePositionEnableFlag = val; } 1199 Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom, Bool vertPhasePositionEnableFlag = 0) 1200 #else 1099 1201 Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom) 1202 #endif 1100 1203 { 1101 1204 m_enabledFlag = true; … … 1104 1207 m_winTopOffset = offsetLTop; 1105 1208 m_winBottomOffset = offsetLBottom; 1209 #if P0312_VERT_PHASE_ADJ 1210 m_vertPhasePositionEnableFlag = vertPhasePositionEnableFlag; 1211 #endif 1106 1212 } 1107 1213 }; … … 1353 1459 1354 1460 #if SVC_EXTENSION 1355 UInt m_layerId;1461 UInt m_layerId; 1356 1462 UInt m_numScaledRefLayerOffsets; 1463 #if P0312_VERT_PHASE_ADJ 1464 Bool m_vertPhasePositionEnableFlag[MAX_LAYERS]; 1465 #endif 1357 1466 #if O0098_SCALED_REF_LAYER_ID 1358 1467 UInt m_scaledRefLayerId[MAX_LAYERS]; … … 1360 1469 Window m_scaledRefLayerWindow[MAX_LAYERS]; 1361 1470 #if REPN_FORMAT_IN_VPS 1362 Bool m_updateRepFormatFlag;1471 Bool m_updateRepFormatFlag; 1363 1472 #if O0096_REP_FORMAT_INDEX 1364 UInt m_updateRepFormatIndex;1473 UInt m_updateRepFormatIndex; 1365 1474 #endif 1366 1475 #endif 1367 1476 #if SCALINGLIST_INFERRING 1368 Bool m_inferScalingListFlag;1369 UInt m_scalingListRefLayerId;1477 Bool m_inferScalingListFlag; 1478 UInt m_scalingListRefLayerId; 1370 1479 #endif 1371 1480 #endif //SVC_EXTENSION … … 1507 1616 1508 1617 #if SVC_EXTENSION 1509 Void setLayerId(UInt layerId) { m_layerId = layerId; } 1510 UInt getLayerId() { return m_layerId; } 1511 UInt getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; } 1512 Void setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; } 1618 Void setLayerId(UInt layerId) { m_layerId = layerId; } 1619 UInt getLayerId() { return m_layerId; } 1620 UInt getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; } 1621 Void setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; } 1622 #if P0312_VERT_PHASE_ADJ 1623 Bool getVertPhasePositionEnableFlag(Int x) { return m_vertPhasePositionEnableFlag[x]; } 1624 Void setVertPhasePositionEnableFlag(Int x, Bool b) { m_vertPhasePositionEnableFlag[x] = b; } 1625 #endif 1513 1626 #if O0098_SCALED_REF_LAYER_ID 1514 1627 UInt getScaledRefLayerId(Int x) { return m_scaledRefLayerId[x]; } 1515 Void setScaledRefLayerId(Int x, UInt id) { m_scaledRefLayerId[x] = id; }1628 Void setScaledRefLayerId(Int x, UInt id) { m_scaledRefLayerId[x] = id; } 1516 1629 Window& getScaledRefLayerWindowForLayer( Int layerId ); 1517 1630 #endif … … 1624 1737 Bool m_inferScalingListFlag; 1625 1738 UInt m_scalingListRefLayerId; 1739 #endif 1740 #if POC_RESET_IDC 1741 Bool m_pocResetInfoPresentFlag; 1626 1742 #endif 1627 1743 #endif … … 1762 1878 Bool getSliceHeaderExtensionPresentFlag () { return m_sliceHeaderExtensionPresentFlag; } 1763 1879 Void setSliceHeaderExtensionPresentFlag (Bool val) { m_sliceHeaderExtensionPresentFlag = val; } 1880 #if POC_RESET_IDC 1881 Bool getPocResetInfoPresentFlag () { return m_pocResetInfoPresentFlag; } 1882 Void setPocResetInfoPresentFlag (const Bool val) { m_pocResetInfoPresentFlag = val; } 1883 #endif 1764 1884 }; 1765 1885 … … 1899 2019 Int m_activeNumILRRefIdx; //< Active inter-layer reference pictures 1900 2020 Int m_interLayerPredLayerIdc [MAX_VPS_LAYER_ID_PLUS1]; 2021 #if P0312_VERT_PHASE_ADJ 2022 Bool m_vertPhasePositionFlag[MAX_VPS_LAYER_ID_PLUS1]; 2023 #endif 1901 2024 #if POC_RESET_FLAG 1902 2025 Bool m_bPocResetFlag; … … 1906 2029 #if O0149_CROSS_LAYER_BLA_FLAG 1907 2030 Bool m_bCrossLayerBLAFlag; 2031 #endif 2032 #if NO_OUTPUT_OF_PRIOR_PICS 2033 Bool m_noOutputOfPriorPicsFlag; 2034 Bool m_noRaslOutputFlag; 2035 Bool m_handleCraAsBlaFlag; 2036 #endif 2037 #if POC_RESET_IDC_SIGNALLING 2038 Int m_pocResetIdc; 2039 Int m_pocResetPeriodId; 2040 Bool m_fullPocResetFlag; 2041 Int m_pocLsbVal; 2042 Int m_pocMsbVal; 2043 Bool m_pocMsbValRequiredFlag; 2044 Bool m_pocMsbValPresentFlag; 1908 2045 #endif 1909 2046 #endif //SVC_EXTENSION … … 1993 2130 NalUnitType getNalUnitType () const { return m_eNalUnitType; } 1994 2131 Bool getRapPicFlag (); 2132 #if NO_OUTPUT_OF_PRIOR_PICS 2133 Bool getBlaPicFlag (); 2134 Bool getCraPicFlag (); 2135 #endif 1995 2136 Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } 1996 2137 Bool isIRAP () const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } … … 2170 2311 Bool getInterLayerPredEnabledFlag () { return m_interLayerPredEnabledFlag;} 2171 2312 2313 #if P0312_VERT_PHASE_ADJ 2314 Int getVertPhasePositionFlag (UInt layerIdx) { return m_vertPhasePositionFlag[layerIdx];} 2315 Void setVertPhasePositionFlag (Bool b, UInt layerIdx) { m_vertPhasePositionFlag[layerIdx] = b; } 2316 #endif 2317 2172 2318 Void setNumMotionPredRefLayers(int i) { m_numMotionPredRefLayers = i; } 2173 2319 Int getNumMotionPredRefLayers() { return m_numMotionPredRefLayers; } … … 2214 2360 2215 2361 Void setILRPic(TComPic **pcIlpPic); 2362 #if NO_OUTPUT_OF_PRIOR_PICS 2363 Void setNoOutputOfPriorPicsFlag(const Bool x) { m_noOutputOfPriorPicsFlag = x; } 2364 Bool getNoOutputOfPriorPicsFlag() { return m_noOutputOfPriorPicsFlag; } 2365 2366 Void setNoRaslOutputFlag ( const Bool val ) { m_noRaslOutputFlag = val; } 2367 Bool getNoRaslOutputFlag () { return m_noRaslOutputFlag; } 2368 2369 Void setHandleCraAsBlaFlag ( const Bool val ) { m_handleCraAsBlaFlag = val; } 2370 Bool getHandleCraAsBlaFlag () { return m_handleCraAsBlaFlag; } 2371 2372 #endif 2373 #if POC_RESET_IDC_SIGNALLING 2374 Int getPocResetIdc () { return m_pocResetIdc; } 2375 Void setPocResetIdc (Int b) { m_pocResetIdc = b; } 2376 Int getPocResetPeriodId () { return m_pocResetPeriodId; } 2377 Void setPocResetPeriodId (Int b) { m_pocResetPeriodId = b; } 2378 Bool getFullPocResetFlag () { return m_fullPocResetFlag; } 2379 Void setFullPocResetFlag (Bool b) { m_fullPocResetFlag = b; } 2380 Int getPocLsbVal () { return m_pocLsbVal; } 2381 Void setPocLsbVal (Int b) { m_pocLsbVal = b; } 2382 Int getPocMsbVal () { return m_pocMsbVal; } 2383 Void setPocMsbVal (Int b) { m_pocMsbVal = b; } 2384 Bool getPocMsbValPresentFlag () { return m_pocMsbValPresentFlag; } 2385 Void setPocMsbValPresentFlag (Bool x) { m_pocMsbValPresentFlag = x; } 2386 Bool getPocMsbValRequiredFlag () { return m_pocMsbValRequiredFlag; } 2387 Void setPocMsbValRequiredFlag (Bool x) { m_pocMsbValRequiredFlag = x; } 2388 #endif 2216 2389 2217 2390 #endif //SVC_EXTENSION -
trunk/source/Lib/TLibCommon/TComUpsampleFilter.cpp
r498 r644 127 127 Int strideEL = pcUsPic->getStride(); 128 128 129 #if P0312_VERT_PHASE_ADJ 130 Bool vertPhasePositionEnableFlag = scalEL.getVertPhasePositionEnableFlag(); 131 Bool vertPhasePositionFlag = currSlice->getVertPhasePositionFlag( refLayerIdc ); 132 if( vertPhasePositionFlag ) 133 { 134 assert( vertPhasePositionEnableFlag ); 135 } 136 #endif 137 129 138 Pel* piTempBufY = pcTempPic->getLumaAddr(); 130 139 Pel* piSrcBufY = pcBasePic->getLumaAddr(); … … 155 164 #endif 156 165 166 // non-normative software optimization for certain simple resampling cases 157 167 if( scaleX == 65536 && scaleY == 65536 ) // ratio 1x 158 168 { 159 169 piSrcY = piSrcBufY; 160 170 piDstY = piDstBufY + scalEL.getWindowLeftOffset() + scalEL.getWindowTopOffset() * strideEL; 171 172 #if O0194_JOINT_US_BITSHIFT 173 Int shift = g_bitDepthYLayer[currLayerId] - g_bitDepthYLayer[refLayerId]; 174 #endif 175 161 176 for( i = 0; i < heightBL; i++ ) 162 177 { 178 #if O0194_JOINT_US_BITSHIFT 179 for( j = 0; j < widthBL; j++ ) 180 { 181 piDstY[j] = piSrcY[j] << shift; 182 } 183 #else 163 184 memcpy( piDstY, piSrcY, sizeof(Pel) * widthBL ); 185 #endif 164 186 piSrcY += strideBL; 165 187 piDstY += strideEL; … … 172 194 heightBL >>= 1; 173 195 174 strideBL 175 strideEL 196 strideBL = pcBasePic->getCStride(); 197 strideEL = pcUsPic->getCStride(); 176 198 177 199 piSrcU = piSrcBufU; … … 181 203 piDstV = piDstBufV + ( scalEL.getWindowLeftOffset() >> 1 ) + ( scalEL.getWindowTopOffset() >> 1 ) * strideEL; 182 204 205 #if O0194_JOINT_US_BITSHIFT 206 shift = g_bitDepthCLayer[currLayerId] - g_bitDepthCLayer[refLayerId]; 207 #endif 208 183 209 for( i = 0; i < heightBL; i++ ) 184 210 { 211 #if O0194_JOINT_US_BITSHIFT 212 for( j = 0; j < widthBL; j++ ) 213 { 214 piDstU[j] = piSrcU[j] << shift; 215 piDstV[j] = piSrcV[j] << shift; 216 } 217 #else 185 218 memcpy( piDstU, piSrcU, sizeof(Pel) * widthBL ); 186 219 memcpy( piDstV, piSrcV, sizeof(Pel) * widthBL ); 220 #endif 187 221 piSrcU += strideBL; 188 222 piSrcV += strideBL; … … 191 225 } 192 226 } 193 else 227 else // general resampling process 194 228 { 195 229 Int refPos16 = 0; … … 212 246 213 247 pcBasePic->setBorderExtension(false); 214 pcBasePic->extendPicBorder 248 pcBasePic->extendPicBorder(); // extend the border. 215 249 216 250 Int shiftX = 16; … … 219 253 #if O0215_PHASE_ALIGNMENT //for Luma, if Phase 0, then both PhaseX and PhaseY should be 0. If symmetric: both PhaseX and PhaseY should be 2 220 254 Int phaseX = 2*phaseAlignFlag; 255 #if P0312_VERT_PHASE_ADJ 256 Int phaseY = vertPhasePositionEnableFlag ? ( vertPhasePositionFlag * 4 ) : ( 2 * phaseAlignFlag ); 257 #else 221 258 Int phaseY = 2*phaseAlignFlag; 259 #endif 222 260 #else 223 261 Int phaseX = 0; 262 #if P0312_VERT_PHASE_ADJ 263 Int phaseY = (vertPhasePositionEnableFlag?(vertPhasePositionFlag *4):(0)); 264 #else 224 265 Int phaseY = 0; 266 #endif 225 267 #endif 226 268 … … 251 293 Int leftOffset = leftStartL > 0 ? leftStartL : 0; 252 294 253 #if 295 #if N0214_INTERMEDIATE_BUFFER_16BITS 254 296 #if O0194_JOINT_US_BITSHIFT 255 297 // g_bitDepthY was set to EL bit-depth, but shift1 should be calculated using BL bit-depth … … 274 316 for( j = 0; j < heightBL ; j++ ) 275 317 { 276 #if 318 #if N0214_INTERMEDIATE_BUFFER_16BITS 277 319 *piDstY = sumLumaHor(piSrcY, coeff) >> shift1; 278 320 #else … … 290 332 pcTempPic->setHeight(heightEL); 291 333 292 #if 334 #if N0214_INTERMEDIATE_BUFFER_16BITS 293 335 #if O0194_JOINT_US_BITSHIFT 294 336 Int nShift = 20 - g_bitDepthYLayer[currLayerId]; … … 363 405 364 406 #if O0215_PHASE_ALIGNMENT 407 Int phaseXC = phaseAlignFlag; 408 #if P0312_VERT_PHASE_ADJ 409 Int phaseYC = vertPhasePositionEnableFlag ? ( vertPhasePositionFlag * 4 ) : ( phaseAlignFlag + 1 ); 410 #else 411 Int phaseYC = phaseAlignFlag + 1; 412 #endif 413 #else 365 414 Int phaseXC = 0; 415 #if P0312_VERT_PHASE_ADJ 416 Int phaseYC = vertPhasePositionEnableFlag ? (vertPhasePositionFlag * 4): 1; 417 #else 366 418 Int phaseYC = 1; 367 419 #endif 420 #endif 421 368 422 #if ROUNDING_OFFSET 369 addX = ( ( (phaseXC+phaseAlignFlag) * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) ); 370 addY = ( ( (phaseYC+phaseAlignFlag) * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) ); 371 #else 372 addX = ( ( ( widthBL * (phaseXC+phaseAlignFlag) ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) ); 373 addY = ( ( ( heightBL * (phaseYC+phaseAlignFlag) ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) ); 374 #endif 375 376 deltaX = 4 * (phaseXC+phaseAlignFlag); 377 deltaY = 4 * (phaseYC+phaseAlignFlag); 378 #else 379 phaseX = 0; 380 phaseY = 1; 381 382 #if ROUNDING_OFFSET 383 addX = ( ( phaseX * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) ); 384 addY = ( ( phaseY * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) ); 385 #else 386 addX = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) ); 387 addY = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) ); 388 #endif 389 390 deltaX = 4 * phaseX; 391 deltaY = 4 * phaseY; 392 #endif 423 addX = ( ( phaseXC * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) ); 424 addY = ( ( phaseYC * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) ); 425 #else 426 addX = ( ( ( widthBL * (phaseXC) ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) ); 427 addY = ( ( ( heightBL * (phaseYC) ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) ); 428 #endif 429 430 deltaX = 4 * phaseXC; 431 deltaY = 4 * phaseYC; 393 432 394 433 shiftXM4 = shiftX - 4; … … 401 440 heightBL = min<Int>( pcBasePic->getHeight() >> 1, heightEL ); 402 441 403 #if 442 #if N0214_INTERMEDIATE_BUFFER_16BITS 404 443 #if O0194_JOINT_US_BITSHIFT 405 444 // g_bitDepthC was set to EL bit-depth, but shift1 should be calculated using BL bit-depth … … 426 465 for( j = 0; j < heightBL ; j++ ) 427 466 { 428 #if 467 #if N0214_INTERMEDIATE_BUFFER_16BITS 429 468 *piDstU = sumChromaHor(piSrcU, coeff) >> shift1; 430 469 *piDstV = sumChromaHor(piSrcV, coeff) >> shift1; … … 447 486 pcTempPic->setHeight(heightEL << 1); 448 487 449 #if 488 #if N0214_INTERMEDIATE_BUFFER_16BITS 450 489 #if O0194_JOINT_US_BITSHIFT 451 490 nShift = 20 - g_bitDepthCLayer[currLayerId]; -
trunk/source/Lib/TLibCommon/TComUpsampleFilter.h
r494 r644 45 45 #if O0215_PHASE_ALIGNMENT 46 46 #if O0194_JOINT_US_BITSHIFT 47 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag );47 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag ); 48 48 #else 49 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag );49 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag ); 50 50 #endif 51 51 #else -
trunk/source/Lib/TLibCommon/TypeDef.h
r595 r644 50 50 #define O0137_MAX_LAYERID 1 ///< JCTVC-O0137, JCTVC-O0200, JCTVC-O0223: restrict nuh_layer_id and vps_max_layers_minus1 51 51 52 #define P0312_VERT_PHASE_ADJ 1 ///< JCTVC-P0312: vertical phase adjustment in re-sampling process (BoG report) 52 53 #define P0130_EOB 1 ///< JCTVC-P0130, set layer Id of EOB NALU to be fixed to 0 53 54 #define P0307_REMOVE_VPS_VUI_OFFSET 1 ///< JCTVC-P0307, remove implementation related to VPS VUI offset signalling 54 55 #define P0307_VPS_NON_VUI_EXTENSION 1 ///< JCTVC-P0307, implementation related to NON VUI VPS Extension signalling 56 #define P0307_VPS_NON_VUI_EXT_UPDATE 1 ///< JCTVC-P0307, implementation related to NON VUI VPS Extension signalling 55 57 56 58 #define DISCARDABLE_PIC_RPS 1 ///< JCTVC-P0130: Inter-layer RPS and temporal RPS should not contain picture with discardable_flag equal to 1 … … 58 60 #define CHANGE_NUMSUBDPB_IDX 1 ///< Change index of NumSubDpb from output layer set to layer set, to be more aligned with the Spec 59 61 #define RESOLUTION_BASED_DPB 1 ///< JCTVC-P0192: Assign layers to sub-DPBs based on the rep_format() signaled in the VPS 62 #define ALIGNED_BUMPING 1 ///< JCTVC-P0192: Align bumping of pictures in an AU 63 #define MAX_SUBDPBS MAX_LAYERS 60 64 #define SUB_BITSTREAM_PROPERTY_SEI 1 ///< JCTVC-P0204: Sub-bitstream property SEI message 61 65 #if SUB_BITSTREAM_PROPERTY_SEI … … 75 79 76 80 #define O0135_DEFAULT_ONE_OUT_SEMANTIC 1 ///< JCTVC-O0135: semantics change of default_one_target_output_layer_idc for auxiliary pictures 81 82 #define O0164_MULTI_LAYER_HRD 1 ///< JCTVC-O0164: Multi-layer HRD operation 77 83 78 84 #define O0194_DIFFERENT_BITDEPTH_EL_BL 1 ///< JCTVC-O0194: Support for different bitdepth values for BL and EL, add required configuration parameters (and Some bugfixes when REPN_FORMAT_IN_VPS (JCTVC-N0092) is enabled) … … 84 90 #define VPS_NUH_LAYER_ID 1 ///< JCTVC-N0085: Assert that the nuh_layer_id of VPS NAL unit should be 0 85 91 #define POC_RESET_FLAG 1 ///< JCTVC-N0244: POC reset flag for layer pictures. 92 #define POC_RESET_IDC 1 ///< JCTVC-P0041: Include poc_reset_idc and related derivation - eventually will replace POC_RESET_FLAG 93 #if POC_RESET_IDC 94 #define POC_RESET_IDC_SIGNALLING 1 ///< JCTVC-P0041: Include signalling for poc_reset related syntax elements 95 #endif 96 #define NO_OUTPUT_OF_PRIOR_PICS 1 ///< Use no_output_of_prior_pics_flag 86 97 #define ALIGN_TSA_STSA_PICS 1 ///< JCTVC-N0084: Alignment of TSA and STSA pictures across AU. 87 98 #define REPN_FORMAT_IN_VPS 1 ///< JCTVC-N0092: Signal represenation format (spatial resolution, bit depth, colour format) in the VPS … … 137 148 #define VPS_VUI_VIDEO_SIGNAL_MOVE 1 ///< JCTVC-P0076 Move video signal information syntax structure earlier in the VPS VUI 138 149 #endif 150 #define P0182_VPS_VUI_PS_FLAG 1 ///< JCTVC-P0182, add base_layer_parameter_set_compatibility_flag 139 151 #endif //VPS_VUI 140 152 … … 179 191 #define O0223_PICTURE_TYPES_ALIGN_FLAG 1 ///< a flag to indicatate whether picture types are aligned across layers. 180 192 193 #define P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 1 ///< a flag to indicatate whether picture types for IRAP are IDR across layers. 194 181 195 #define N0147_IRAP_ALIGN_FLAG 1 ///< a flag to indicatate whether IRAPs are aligned across layers 182 196 #if N0147_IRAP_ALIGN_FLAG … … 216 230 217 231 #define O0153_ALT_OUTPUT_LAYER_FLAG 1 ///< JCTVC-O0153: alt output layer flag 232 #define P0300_ALT_OUTPUT_LAYER_FLAG 1 ///< JCTVC-P0300: alt output layer flag 218 233 219 234 #define VPS_DPB_SIZE_TABLE 1 ///< JCTVC-O0217: DPB operations: signaling DPB-related parameters … … 224 239 #endif 225 240 #endif 226 241 #define SPS_DPB_PARAMS 1 ///< JCTVC-P0155 signaling & inferrence for sps dpb parameters for nuh_layer_id > 0 242 #define DPB_PARAMS_MAXTLAYERS 1 ///< JCTVC-P0156 DPB parameters up to maximum temporal sub-layers in the layer set 243 #define NUM_OL_FLAGS 1 ///< JCTVC-P0156 output_layer_flag[ i ][ j ] is signalled for j equal to 0 to NumLayersInIdList[ lsIdx ] inclusive 227 244 #define NO_CLRAS_OUTPUT_FLAG 1 228 245 #define O0149_CROSS_LAYER_BLA_FLAG 1 ///< JCTVC-O0149: signal cross_layer_bla_flag in slice header 246 247 #define P0138_USE_ALT_CPB_PARAMS_FLAG 1 ///< JCTVC-P0138: use_alt_cpb_params_flag syntax in buffering period SEI message extension 248 #define P0166_MODIFIED_PPS_EXTENSION 1 ///< JCTVC-P0166: add pps_extension_type_flag 229 249 230 250 #if VIEW_ID_RELATED_SIGNALING -
trunk/source/Lib/TLibDecoder/SEIread.cpp
r595 r644 111 111 #endif 112 112 #if SUB_BITSTREAM_PROPERTY_SEI 113 case SEI::SUB_BITSTREAM_PROPERTY: 114 fprintf( g_hTrace, "=========== Sub-bitstream property SEI message ===========\n"); 115 break; 113 case SEI::SUB_BITSTREAM_PROPERTY: 114 fprintf( g_hTrace, "=========== Sub-bitstream property SEI message ===========\n"); 115 break; 116 #endif 117 #if O0164_MULTI_LAYER_HRD 118 case SEI::BSP_NESTING: 119 fprintf( g_hTrace, "=========== Bitstream parition nesting SEI message ===========\n"); 120 break; 121 case SEI::BSP_INITIAL_ARRIVAL_TIME: 122 fprintf( g_hTrace, "=========== Bitstream parition initial arrival time SEI message ===========\n"); 123 break; 124 case SEI::BSP_HRD: 125 fprintf( g_hTrace, "=========== Bitstream parition HRD parameters SEI message ===========\n"); 126 break; 116 127 #endif 117 128 #endif //SVC_EXTENSION … … 152 163 } 153 164 165 #if O0164_MULTI_LAYER_HRD 166 #if LAYERS_NOT_PRESENT_SEI 167 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps, const SEIScalableNesting *nestingSei, const SEIBspNesting *bspNestingSei) 168 #else 169 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps, const SEIScalableNesting *nestingSei) 170 #endif 171 #else 154 172 #if LAYERS_NOT_PRESENT_SEI 155 173 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps) 156 174 #else 157 175 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps) 176 #endif 158 177 #endif 159 178 { … … 272 291 xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, sps); 273 292 #endif 293 break; 274 294 #if SVC_EXTENSION 275 295 #if LAYERS_NOT_PRESENT_SEI … … 296 316 sei = new SEISubBitstreamProperty; 297 317 xParseSEISubBitstreamProperty((SEISubBitstreamProperty&) *sei); 318 break; 319 #endif 320 #if O0164_MULTI_LAYER_HRD 321 case SEI::BSP_NESTING: 322 sei = new SEIBspNesting; 323 #if LAYERS_NOT_PRESENT_SEI 324 xParseSEIBspNesting((SEIBspNesting&) *sei, nalUnitType, vps, sps, *nestingSei); 325 #else 326 xParseSEIBspNesting((SEIBspNesting&) *sei, nalUnitType, sps, *nestingSei); 327 #endif 328 break; 329 case SEI::BSP_INITIAL_ARRIVAL_TIME: 330 sei = new SEIBspInitialArrivalTime; 331 xParseSEIBspInitialArrivalTime((SEIBspInitialArrivalTime&) *sei, vps, sps, *nestingSei, *bspNestingSei); 332 break; 333 case SEI::BSP_HRD: 334 sei = new SEIBspHrd; 335 xParseSEIBspHrd((SEIBspHrd&) *sei, sps, *nestingSei); 298 336 break; 299 337 #endif … … 380 418 } 381 419 420 #if P0138_USE_ALT_CPB_PARAMS_FLAG 421 /** 422 * Check if SEI message contains payload extension 423 */ 424 Bool SEIReader::xPayloadExtensionPresent() 425 { 426 Int payloadBitsRemaining = getBitstream()->getNumBitsLeft(); 427 Bool payloadExtensionPresent = false; 428 429 if (payloadBitsRemaining > 8) 430 { 431 payloadExtensionPresent = true; 432 } 433 else 434 { 435 Int finalBits = getBitstream()->peekBits(payloadBitsRemaining); 436 while (payloadBitsRemaining && (finalBits & 1) == 0) 437 { 438 payloadBitsRemaining--; 439 finalBits >>= 1; 440 } 441 payloadBitsRemaining--; 442 if (payloadBitsRemaining > 0) 443 { 444 payloadExtensionPresent = true; 445 } 446 } 447 448 return payloadExtensionPresent; 449 } 450 #endif 451 382 452 /** 383 453 * parse bitstream bs and unpack a user_data_unregistered SEI message … … 536 606 } 537 607 } 608 609 #if P0138_USE_ALT_CPB_PARAMS_FLAG 610 sei.m_useAltCpbParamsFlag = false; 611 sei.m_useAltCpbParamsFlagPresent = false; 612 if (xPayloadExtensionPresent()) 613 { 614 READ_FLAG (code, "use_alt_cpb_params_flag"); 615 sei.m_useAltCpbParamsFlag = code; 616 sei.m_useAltCpbParamsFlagPresent = true; 617 } 618 #endif 619 538 620 xParseByteAlign(); 539 621 } … … 826 908 // read nested SEI messages 827 909 do { 910 #if O0164_MULTI_LAYER_HRD 911 #if LAYERS_NOT_PRESENT_SEI 912 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, vps, sps, &sei); 913 #else 914 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, sps, &sei); 915 #endif 916 #else 828 917 #if LAYERS_NOT_PRESENT_SEI 829 918 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, vps, sps); 830 919 #else 831 920 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, sps); 921 #endif 832 922 #endif 833 923 } while (m_pcBitstream->getNumBitsLeft() > 8); … … 930 1020 } 931 1021 #endif 1022 1023 #if O0164_MULTI_LAYER_HRD 1024 #if LAYERS_NOT_PRESENT_SEI 1025 Void SEIReader::xParseSEIBspNesting(SEIBspNesting &sei, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei) 1026 #else 1027 Void SEIReader::xParseSEIBspNesting(SEIBspNesting &sei, const NalUnitType nalUnitType, TComSPS *sps, const SEIScalableNesting &nestingSei) 1028 #endif 1029 { 1030 UInt uiCode; 1031 READ_UVLC( uiCode, "bsp_idx" ); sei.m_bspIdx = uiCode; 1032 1033 // byte alignment 1034 while ( m_pcBitstream->getNumBitsRead() % 8 != 0 ) 1035 { 1036 UInt code; 1037 READ_FLAG( code, "bsp_nesting_zero_bit" ); 1038 } 1039 1040 sei.m_callerOwnsSEIs = false; 1041 1042 // read nested SEI messages 1043 do { 1044 #if LAYERS_NOT_PRESENT_SEI 1045 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, vps, sps, &nestingSei, &sei); 1046 #else 1047 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, sps, &nestingSei); 1048 #endif 1049 } while (m_pcBitstream->getNumBitsLeft() > 8); 1050 } 1051 1052 Void SEIReader::xParseSEIBspInitialArrivalTime(SEIBspInitialArrivalTime &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei) 1053 { 1054 assert(vps->getVpsVuiPresentFlag()); 1055 1056 UInt schedCombCnt = vps->getNumBspSchedCombinations(nestingSei.m_nestingOpIdx[0]); 1057 UInt len; 1058 UInt hrdIdx; 1059 UInt uiCode; 1060 1061 if (schedCombCnt > 0) 1062 { 1063 hrdIdx = vps->getBspCombHrdIdx(nestingSei.m_nestingOpIdx[0], 0, bspNestingSei.m_bspIdx); 1064 } 1065 else 1066 { 1067 hrdIdx = 0; 1068 } 1069 1070 TComHRD *hrd = vps->getBspHrd(hrdIdx); 1071 1072 if (hrd->getNalHrdParametersPresentFlag() || hrd->getVclHrdParametersPresentFlag()) 1073 { 1074 len = hrd->getInitialCpbRemovalDelayLengthMinus1() + 1; 1075 } 1076 else 1077 { 1078 len = 23 + 1; 1079 } 1080 1081 if (hrd->getNalHrdParametersPresentFlag()) 1082 { 1083 for(UInt i = 0; i < schedCombCnt; i++) 1084 { 1085 READ_CODE( len, uiCode, "nal_initial_arrival_delay" ); sei.m_nalInitialArrivalDelay[i] = uiCode; 1086 } 1087 } 1088 else 1089 { 1090 for(UInt i = 0; i < schedCombCnt; i++) 1091 { 1092 READ_CODE( len, uiCode, "vcl_initial_arrival_delay" ); sei.m_vclInitialArrivalDelay[i] = uiCode; 1093 } 1094 } 1095 } 1096 1097 Void SEIReader::xParseSEIBspHrd(SEIBspHrd &sei, TComSPS *sps, const SEIScalableNesting &nestingSei) 1098 { 1099 UInt uiCode; 1100 READ_UVLC( uiCode, "sei_num_bsp_hrd_parameters_minus1" ); sei.m_seiNumBspHrdParametersMinus1 = uiCode; 1101 for (UInt i = 0; i <= sei.m_seiNumBspHrdParametersMinus1; i++) 1102 { 1103 if (i > 0) 1104 { 1105 READ_FLAG( uiCode, "sei_bsp_cprms_present_flag" ); sei.m_seiBspCprmsPresentFlag[i] = uiCode; 1106 } 1107 xParseHrdParameters(sei.hrd, i==0 ? 1 : sei.m_seiBspCprmsPresentFlag[i], nestingSei.m_nestingMaxTemporalIdPlus1[0]-1); 1108 } 1109 for (UInt h = 0; h <= nestingSei.m_nestingNumOpsMinus1; h++) 1110 { 1111 UInt lsIdx = nestingSei.m_nestingOpIdx[h]; 1112 READ_UVLC( uiCode, "num_sei_bitstream_partitions_minus1[i]"); sei.m_seiNumBitstreamPartitionsMinus1[lsIdx] = uiCode; 1113 for (UInt i = 0; i <= sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]; i++) 1114 { 1115 for (UInt j = 0; j < sei.m_vpsMaxLayers; j++) 1116 { 1117 if (sei.m_layerIdIncludedFlag[lsIdx][j]) 1118 { 1119 READ_FLAG( uiCode, "sei_layer_in_bsp_flag[lsIdx][i][j]" ); sei.m_seiLayerInBspFlag[lsIdx][i][j] = uiCode; 1120 } 1121 } 1122 } 1123 READ_UVLC( uiCode, "sei_num_bsp_sched_combinations_minus1[i]"); sei.m_seiNumBspSchedCombinationsMinus1[lsIdx] = uiCode; 1124 for (UInt i = 0; i <= sei.m_seiNumBspSchedCombinationsMinus1[lsIdx]; i++) 1125 { 1126 for (UInt j = 0; j <= sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]; j++) 1127 { 1128 READ_UVLC( uiCode, "sei_bsp_comb_hrd_idx[lsIdx][i][j]"); sei.m_seiBspCombHrdIdx[lsIdx][i][j] = uiCode; 1129 READ_UVLC( uiCode, "sei_bsp_comb_sched_idx[lsIdx][i][j]"); sei.m_seiBspCombScheddx[lsIdx][i][j] = uiCode; 1130 } 1131 } 1132 } 1133 } 1134 1135 Void SEIReader::xParseHrdParameters(TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1) 1136 { 1137 UInt uiCode; 1138 if( commonInfPresentFlag ) 1139 { 1140 READ_FLAG( uiCode, "nal_hrd_parameters_present_flag" ); hrd->setNalHrdParametersPresentFlag( uiCode == 1 ? true : false ); 1141 READ_FLAG( uiCode, "vcl_hrd_parameters_present_flag" ); hrd->setVclHrdParametersPresentFlag( uiCode == 1 ? true : false ); 1142 if( hrd->getNalHrdParametersPresentFlag() || hrd->getVclHrdParametersPresentFlag() ) 1143 { 1144 READ_FLAG( uiCode, "sub_pic_cpb_params_present_flag" ); hrd->setSubPicCpbParamsPresentFlag( uiCode == 1 ? true : false ); 1145 if( hrd->getSubPicCpbParamsPresentFlag() ) 1146 { 1147 READ_CODE( 8, uiCode, "tick_divisor_minus2" ); hrd->setTickDivisorMinus2( uiCode ); 1148 READ_CODE( 5, uiCode, "du_cpb_removal_delay_length_minus1" ); hrd->setDuCpbRemovalDelayLengthMinus1( uiCode ); 1149 READ_FLAG( uiCode, "sub_pic_cpb_params_in_pic_timing_sei_flag" ); hrd->setSubPicCpbParamsInPicTimingSEIFlag( uiCode == 1 ? true : false ); 1150 READ_CODE( 5, uiCode, "dpb_output_delay_du_length_minus1" ); hrd->setDpbOutputDelayDuLengthMinus1( uiCode ); 1151 } 1152 READ_CODE( 4, uiCode, "bit_rate_scale" ); hrd->setBitRateScale( uiCode ); 1153 READ_CODE( 4, uiCode, "cpb_size_scale" ); hrd->setCpbSizeScale( uiCode ); 1154 if( hrd->getSubPicCpbParamsPresentFlag() ) 1155 { 1156 READ_CODE( 4, uiCode, "cpb_size_du_scale" ); hrd->setDuCpbSizeScale( uiCode ); 1157 } 1158 READ_CODE( 5, uiCode, "initial_cpb_removal_delay_length_minus1" ); hrd->setInitialCpbRemovalDelayLengthMinus1( uiCode ); 1159 READ_CODE( 5, uiCode, "au_cpb_removal_delay_length_minus1" ); hrd->setCpbRemovalDelayLengthMinus1( uiCode ); 1160 READ_CODE( 5, uiCode, "dpb_output_delay_length_minus1" ); hrd->setDpbOutputDelayLengthMinus1( uiCode ); 1161 } 1162 } 1163 Int i, j, nalOrVcl; 1164 for( i = 0; i <= maxNumSubLayersMinus1; i ++ ) 1165 { 1166 READ_FLAG( uiCode, "fixed_pic_rate_general_flag" ); hrd->setFixedPicRateFlag( i, uiCode == 1 ? true : false ); 1167 if( !hrd->getFixedPicRateFlag( i ) ) 1168 { 1169 READ_FLAG( uiCode, "fixed_pic_rate_within_cvs_flag" ); hrd->setFixedPicRateWithinCvsFlag( i, uiCode == 1 ? true : false ); 1170 } 1171 else 1172 { 1173 hrd->setFixedPicRateWithinCvsFlag( i, true ); 1174 } 1175 hrd->setLowDelayHrdFlag( i, 0 ); // Infered to be 0 when not present 1176 hrd->setCpbCntMinus1 ( i, 0 ); // Infered to be 0 when not present 1177 if( hrd->getFixedPicRateWithinCvsFlag( i ) ) 1178 { 1179 READ_UVLC( uiCode, "elemental_duration_in_tc_minus1" ); hrd->setPicDurationInTcMinus1( i, uiCode ); 1180 } 1181 else 1182 { 1183 READ_FLAG( uiCode, "low_delay_hrd_flag" ); hrd->setLowDelayHrdFlag( i, uiCode == 1 ? true : false ); 1184 } 1185 if (!hrd->getLowDelayHrdFlag( i )) 1186 { 1187 READ_UVLC( uiCode, "cpb_cnt_minus1" ); hrd->setCpbCntMinus1( i, uiCode ); 1188 } 1189 for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ ) 1190 { 1191 if( ( ( nalOrVcl == 0 ) && ( hrd->getNalHrdParametersPresentFlag() ) ) || 1192 ( ( nalOrVcl == 1 ) && ( hrd->getVclHrdParametersPresentFlag() ) ) ) 1193 { 1194 for( j = 0; j <= ( hrd->getCpbCntMinus1( i ) ); j ++ ) 1195 { 1196 READ_UVLC( uiCode, "bit_rate_value_minus1" ); hrd->setBitRateValueMinus1( i, j, nalOrVcl, uiCode ); 1197 READ_UVLC( uiCode, "cpb_size_value_minus1" ); hrd->setCpbSizeValueMinus1( i, j, nalOrVcl, uiCode ); 1198 if( hrd->getSubPicCpbParamsPresentFlag() ) 1199 { 1200 READ_UVLC( uiCode, "cpb_size_du_value_minus1" ); hrd->setDuCpbSizeValueMinus1( i, j, nalOrVcl, uiCode ); 1201 READ_UVLC( uiCode, "bit_rate_du_value_minus1" ); hrd->setDuBitRateValueMinus1( i, j, nalOrVcl, uiCode ); 1202 } 1203 READ_FLAG( uiCode, "cbr_flag" ); hrd->setCbrFlag( i, j, nalOrVcl, uiCode == 1 ? true : false ); 1204 } 1205 } 1206 } 1207 } 1208 } 1209 #endif 1210 932 1211 #endif //SVC_EXTENSION 933 1212 -
trunk/source/Lib/TLibDecoder/SEIread.h
r595 r644 62 62 #endif 63 63 protected: 64 #if O0164_MULTI_LAYER_HRD 65 #if LAYERS_NOT_PRESENT_SEI 66 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps, const SEIScalableNesting *nestingSei=NULL, const SEIBspNesting *bspNestingSei=NULL); 67 #else 68 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps, const SEIScalableNesting *nestingSei=NULL); 69 #endif 70 #else 64 71 #if LAYERS_NOT_PRESENT_SEI 65 72 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps); 66 73 #else 67 74 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps); 75 #endif 76 #endif 77 #if P0138_USE_ALT_CPB_PARAMS_FLAG 78 Bool xPayloadExtensionPresent (); 68 79 #endif 69 80 Void xParseSEIuserDataUnregistered (SEIuserDataUnregistered &sei, UInt payloadSize); … … 92 103 Void xParseSEIScalableNesting (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps); 93 104 #endif 105 #if O0164_MULTI_LAYER_HRD 106 #if LAYERS_NOT_PRESENT_SEI 107 Void xParseSEIBspNesting(SEIBspNesting &sei, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei); 108 #else 109 Void xParseSEIBspNesting(SEIBspNesting &sei, const NalUnitType nalUnitType, TComSPS *sps, const SEIScalableNesting &nestingSei); 110 #endif 111 Void xParseSEIBspInitialArrivalTime(SEIBspInitialArrivalTime &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei); 112 Void xParseSEIBspHrd(SEIBspHrd &sei, TComSPS *sps, const SEIScalableNesting &nestingSei); 113 Void xParseHrdParameters(TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1); 114 #endif 94 115 Void xParseByteAlign(); 95 116 }; -
trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
r595 r644 334 334 if (uiCode) 335 335 { 336 #if P0166_MODIFIED_PPS_EXTENSION 337 UInt ppsExtensionTypeFlag[8]; 338 for (UInt i = 0; i < 8; i++) 339 { 340 READ_FLAG( ppsExtensionTypeFlag[i], "pps_extension_type_flag" ); 341 } 342 #if !POC_RESET_IDC 343 if (ppsExtensionTypeFlag[1]) 344 { 345 #else 346 if( ppsExtensionTypeFlag[0] ) 347 { 348 READ_FLAG( uiCode, "poc_reset_info_present_flag" ); 349 pcPPS->setPocResetInfoPresentFlag(uiCode ? true : false); 350 #endif 351 } 352 if (ppsExtensionTypeFlag[7]) 353 { 354 #endif 355 336 356 while ( xMoreRbspData() ) 337 357 { 338 358 READ_FLAG( uiCode, "pps_extension_data_flag"); 339 359 } 360 #if P0166_MODIFIED_PPS_EXTENSION 361 } 362 #endif 340 363 } 341 364 } … … 514 537 } 515 538 516 #if SVC_EXTENSION 539 #if SVC_EXTENSION && !SPS_DPB_PARAMS 517 540 Void TDecCavlc::parseSPS(TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager) 518 541 #else … … 536 559 #if SVC_EXTENSION 537 560 } 561 #if !SPS_DPB_PARAMS 538 562 else 539 563 { … … 542 566 } 543 567 #endif 568 #endif 569 544 570 if ( pcSPS->getMaxTLayers() == 1 ) 545 571 { 546 572 // sps_temporal_id_nesting_flag must be 1 when sps_max_sub_layers_minus1 is 0 547 573 #if SVC_EXTENSION 574 #if !SPS_DPB_PARAMS 548 575 assert( pcSPS->getTemporalIdNestingFlag() == true ); 576 #endif 549 577 #else 550 578 assert( uiCode == 1 ); … … 644 672 assert(uiCode <= 12); 645 673 646 UInt subLayerOrderingInfoPresentFlag; 647 READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag"); 648 649 for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++) 650 { 651 READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1"); 652 pcSPS->setMaxDecPicBuffering( uiCode + 1, i); 653 READ_UVLC ( uiCode, "sps_num_reorder_pics" ); 654 pcSPS->setNumReorderPics(uiCode, i); 655 READ_UVLC ( uiCode, "sps_max_latency_increase_plus1"); 656 pcSPS->setMaxLatencyIncrease( uiCode, i ); 657 658 if (!subLayerOrderingInfoPresentFlag) 659 { 660 for (i++; i <= pcSPS->getMaxTLayers()-1; i++) 661 { 662 pcSPS->setMaxDecPicBuffering(pcSPS->getMaxDecPicBuffering(0), i); 663 pcSPS->setNumReorderPics(pcSPS->getNumReorderPics(0), i); 664 pcSPS->setMaxLatencyIncrease(pcSPS->getMaxLatencyIncrease(0), i); 665 } 666 break; 667 } 668 } 669 674 #if SPS_DPB_PARAMS 675 if( pcSPS->getLayerId() == 0 ) 676 { 677 #endif 678 UInt subLayerOrderingInfoPresentFlag; 679 READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag"); 680 681 for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++) 682 { 683 READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1"); 684 pcSPS->setMaxDecPicBuffering( uiCode + 1, i); 685 READ_UVLC ( uiCode, "sps_num_reorder_pics" ); 686 pcSPS->setNumReorderPics(uiCode, i); 687 READ_UVLC ( uiCode, "sps_max_latency_increase_plus1"); 688 pcSPS->setMaxLatencyIncrease( uiCode, i ); 689 690 if (!subLayerOrderingInfoPresentFlag) 691 { 692 for (i++; i <= pcSPS->getMaxTLayers()-1; i++) 693 { 694 pcSPS->setMaxDecPicBuffering(pcSPS->getMaxDecPicBuffering(0), i); 695 pcSPS->setNumReorderPics(pcSPS->getNumReorderPics(0), i); 696 pcSPS->setMaxLatencyIncrease(pcSPS->getMaxLatencyIncrease(0), i); 697 } 698 break; 699 } 700 } 701 #if SPS_DPB_PARAMS 702 } 703 #endif 670 704 READ_UVLC( uiCode, "log2_min_coding_block_size_minus3" ); 671 705 Int log2MinCUSize = uiCode + 3; … … 824 858 Window& scaledWindow = pcSPS->getScaledRefLayerWindow(i); 825 859 #if O0098_SCALED_REF_LAYER_ID 826 READ_CODE( 6, uiCode, "scaled_ref_layer_ left_id" );pcSPS->setScaledRefLayerId( i, uiCode );860 READ_CODE( 6, uiCode, "scaled_ref_layer_id" ); pcSPS->setScaledRefLayerId( i, uiCode ); 827 861 #endif 828 862 READ_SVLC( iCode, "scaled_ref_layer_left_offset" ); scaledWindow.setWindowLeftOffset (iCode << 1); … … 830 864 READ_SVLC( iCode, "scaled_ref_layer_right_offset" ); scaledWindow.setWindowRightOffset (iCode << 1); 831 865 READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" ); scaledWindow.setWindowBottomOffset(iCode << 1); 866 #if P0312_VERT_PHASE_ADJ 867 READ_FLAG( uiCode, "vert_phase_position_enable_flag" ); scaledWindow.setVertPhasePositionEnableFlag(uiCode); pcSPS->setVertPhasePositionEnableFlag( pcSPS->getScaledRefLayerId(i), uiCode); 868 #endif 832 869 } 833 870 } … … 850 887 READ_CODE( 6, uiCode, "vps_reserved_zero_6bits" ); assert(uiCode == 0); 851 888 #endif 852 READ_CODE( 3, uiCode, "vps_max_sub_layers_minus1" ); pcVPS->setMaxTLayers( uiCode + 1 ); 889 READ_CODE( 3, uiCode, "vps_max_sub_layers_minus1" ); pcVPS->setMaxTLayers( uiCode + 1 ); assert(uiCode <= 6); 853 890 READ_FLAG( uiCode, "vps_temporal_id_nesting_flag" ); pcVPS->setTemporalNestingFlag( uiCode ? true:false ); 854 891 assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag()); … … 970 1007 UInt uiCode; 971 1008 // ... More syntax elements to be parsed here 1009 #if P0300_ALT_OUTPUT_LAYER_FLAG 1010 Int NumOutputLayersInOutputLayerSet[MAX_VPS_LAYER_SETS_PLUS1]; 1011 Int OlsHighestOutputLayerId[MAX_VPS_LAYER_SETS_PLUS1]; 1012 #endif 972 1013 #if VPS_EXTN_MASK_AND_DIM_INFO 973 1014 UInt numScalabilityTypes = 0, i = 0, j = 0; … … 1091 1132 if (vps->getMaxTSLayersPresentFlag()) 1092 1133 { 1093 for(i = 0; i < vps->getMaxLayers() - 1; i++)1134 for(i = 0; i < vps->getMaxLayers(); i++) 1094 1135 { 1095 1136 READ_CODE( 3, uiCode, "sub_layers_vps_max_minus1[i]" ); vps->setMaxTSLayersMinus1(i, uiCode); … … 1098 1139 else 1099 1140 { 1100 for( i = 0; i < vps->getMaxLayers() - 1; i++)1141 for( i = 0; i < vps->getMaxLayers(); i++) 1101 1142 { 1102 1143 vps->setMaxTSLayersMinus1(i, vps->getMaxTLayers()-1); … … 1238 1279 { 1239 1280 Int lsIdx = vps->getOutputLayerSetIdx(i); 1281 #if NUM_OL_FLAGS 1282 for(j = 0; j < vps->getNumLayersInIdList(lsIdx) ; j++) 1283 #else 1240 1284 for(j = 0; j < vps->getNumLayersInIdList(lsIdx) - 1; j++) 1285 #endif 1241 1286 { 1242 1287 READ_FLAG( uiCode, "output_layer_flag[i][j]"); vps->setOutputLayerFlag(i, j, uiCode); … … 1269 1314 } 1270 1315 READ_CODE( numBits, uiCode, "profile_level_tier_idx[i]" ); vps->setProfileLevelTierIdx(i, uiCode); 1316 #if P0300_ALT_OUTPUT_LAYER_FLAG 1317 NumOutputLayersInOutputLayerSet[i] = 0; 1318 Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx(i); 1319 for (j = 0; j < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet); j++) 1320 { 1321 NumOutputLayersInOutputLayerSet[i] += vps->getOutputLayerFlag(i, j); 1322 if (vps->getOutputLayerFlag(i, j)) 1323 { 1324 OlsHighestOutputLayerId[i] = vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, j); 1325 } 1326 } 1327 if (NumOutputLayersInOutputLayerSet[i] == 1 && vps->getNumDirectRefLayers(OlsHighestOutputLayerId[i]) > 0) 1328 { 1329 READ_FLAG(uiCode, "alt_output_layer_flag[i]"); 1330 vps->setAltOuputLayerFlag(i, uiCode ? true : false); 1331 } 1332 #endif 1271 1333 } 1272 1334 #else … … 1292 1354 READ_CODE( numBits, uiCode, "output_layer_set_idx_minus1"); vps->setOutputLayerSetIdx( i, uiCode + 1); 1293 1355 Int lsIdx = vps->getOutputLayerSetIdx(i); 1356 #if NUM_OL_FLAGS 1357 for(j = 0; j < vps->getNumLayersInIdList(lsIdx) ; j++) 1358 #else 1294 1359 for(j = 0; j < vps->getNumLayersInIdList(lsIdx) - 1; j++) 1360 #endif 1295 1361 { 1296 1362 READ_FLAG( uiCode, "output_layer_flag[i][j]"); vps->setOutputLayerFlag(i, j, uiCode); … … 1354 1420 #endif 1355 1421 1422 #if !P0300_ALT_OUTPUT_LAYER_FLAG 1356 1423 #if O0153_ALT_OUTPUT_LAYER_FLAG 1357 1424 if( vps->getMaxLayers() > 1 ) … … 1360 1427 vps->setAltOuputLayerFlag( uiCode ? true : false ); 1361 1428 } 1429 #endif 1362 1430 #endif 1363 1431 … … 1510 1578 #if P0307_VPS_NON_VUI_EXTENSION 1511 1579 READ_UVLC( uiCode, "vps_non_vui_extension_length"); vps->setVpsNonVuiExtLength((Int)uiCode); 1580 #if P0307_VPS_NON_VUI_EXT_UPDATE 1581 Int nonVuiExtByte = uiCode; 1582 for (i = 1; i <= nonVuiExtByte; i++) 1583 { 1584 READ_CODE( 8, uiCode, "vps_non_vui_extension_data_byte" ); //just parse and discard for now. 1585 } 1586 #else 1512 1587 if ( vps->getVpsNonVuiExtLength() > 0 ) 1513 1588 { 1514 1589 printf("\n\nUp to the current spec, the value of vps_non_vui_extension_length is supposed to be 0\n"); 1515 1590 } 1591 #endif 1516 1592 #endif 1517 1593 … … 1596 1672 { 1597 1673 UInt uiCode; 1674 #if DPB_PARAMS_MAXTLAYERS 1675 Int * MaxSubLayersInLayerSetMinus1 = new Int[vps->getNumOutputLayerSets()]; 1676 for(Int i = 1; i < vps->getNumOutputLayerSets(); i++) 1677 { 1678 UInt maxSLMinus1 = 0; 1679 #if CHANGE_NUMSUBDPB_IDX 1680 Int optLsIdx = vps->getOutputLayerSetIdx( i ); 1681 #else 1682 Int optLsIdx = i; 1683 #endif 1684 for(Int k = 0; k < vps->getNumLayersInIdList(optLsIdx); k++ ) { 1685 Int lId = vps->getLayerSetLayerIdList(optLsIdx, k); 1686 maxSLMinus1 = max(maxSLMinus1, vps->getMaxTSLayersMinus1(vps->getLayerIdInVps(lId))); 1687 } 1688 MaxSubLayersInLayerSetMinus1[ i ] = maxSLMinus1; 1689 } 1690 #endif 1691 1598 1692 #if !RESOLUTION_BASED_DPB 1599 1693 vps->deriveNumberOfSubDpbs(); … … 1605 1699 #endif 1606 1700 READ_FLAG( uiCode, "sub_layer_flag_info_present_flag[i]"); vps->setSubLayerFlagInfoPresentFlag( i, uiCode ? true : false ); 1607 for(Int j = 0; j < vps->getMaxTLayers(); j++) 1701 #if DPB_PARAMS_MAXTLAYERS 1702 for(Int j = 0; j <= MaxSubLayersInLayerSetMinus1[ i ]; j++) 1703 #else 1704 for(Int j = 0; j <= vps->getMaxTLayers(); j++) 1705 #endif 1608 1706 { 1609 1707 if( j > 0 && vps->getSubLayerFlagInfoPresentFlag(i) ) … … 1652 1750 } 1653 1751 } 1752 for(Int j = vps->getMaxTLayers(); j < MAX_TLAYER; j++) 1753 { 1754 vps->setSubLayerDpbInfoPresentFlag( i, j, false ); 1755 } 1756 } 1757 1758 // Infer values when not signalled 1759 for(Int i = 1; i < vps->getNumOutputLayerSets(); i++) 1760 { 1761 Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx( i ); 1762 for(Int j = 0; j < MAX_TLAYER; j++) 1763 { 1764 if( !vps->getSubLayerDpbInfoPresentFlag(i, j) ) // If sub-layer DPB information is NOT present 1765 { 1766 for(Int k = 0; k < vps->getNumSubDpbs(layerSetIdxForOutputLayerSet); k++) 1767 { 1768 vps->setMaxVpsDecPicBufferingMinus1( i, k, j, vps->getMaxVpsDecPicBufferingMinus1( i, k, j - 1 ) ); 1769 } 1770 vps->setMaxVpsNumReorderPics( i, j, vps->getMaxVpsNumReorderPics( i, j - 1) ); 1771 for(Int k = 0; k < vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet ); k++) 1772 { 1773 vps->setMaxVpsLayerDecPicBuffMinus1( i, k, j, vps->getMaxVpsLayerDecPicBuffMinus1( i, k, j - 1)); 1774 } 1775 vps->setMaxVpsLatencyIncreasePlus1( i, j, vps->getMaxVpsLatencyIncreasePlus1( i, j - 1 ) ); 1776 } 1777 } 1654 1778 } 1655 1779 } … … 1669 1793 READ_FLAG(uiCode, "cross_layer_irap_aligned_flag" ); 1670 1794 vps->setCrossLayerIrapAlignFlag(uiCode); 1795 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 1796 if (uiCode) 1797 { 1798 READ_FLAG(uiCode, "only_idr_for_IRAP_across_layers" ); 1799 vps->setCrossLayerIrapAlignFlag(uiCode); 1800 } 1801 #endif 1671 1802 #endif 1672 1803 #if O0223_PICTURE_TYPES_ALIGN_FLAG … … 1825 1956 #endif 1826 1957 #endif 1827 1958 #if P0312_VERT_PHASE_ADJ 1959 READ_FLAG( uiCode, "vps_vui_vert_phase_in_use_flag" ); vps->setVpsVuiVertPhaseInUseFlag(uiCode); 1960 #endif 1828 1961 #if N0160_VUI_EXT_ILP_REF 1829 1962 READ_FLAG( uiCode, "ilp_restricted_ref_layers_flag" ); vps->setIlpRestrictedRefLayersFlag( uiCode == 1 ); … … 1892 2025 #endif 1893 2026 #endif 2027 2028 #if O0164_MULTI_LAYER_HRD 2029 READ_FLAG(uiCode, "vps_vui_bsp_hrd_present_flag" ); vps->setVpsVuiBspHrdPresentFlag(uiCode); 2030 if (vps->getVpsVuiBspHrdPresentFlag()) 2031 { 2032 READ_UVLC( uiCode, "vps_num_bsp_hrd_parameters_minus1" ); vps->setVpsNumBspHrdParametersMinus1(uiCode); 2033 vps->createBspHrdParamBuffer(vps->getVpsNumBspHrdParametersMinus1() + 1); 2034 for( i = 0; i <= vps->getVpsNumBspHrdParametersMinus1(); i++ ) 2035 { 2036 if( i > 0 ) 2037 { 2038 READ_FLAG( uiCode, "bsp_cprms_present_flag[i]" ); vps->setBspCprmsPresentFlag(i, uiCode); 2039 } 2040 parseHrdParameters(vps->getBspHrd(i), i==0 ? 1 : vps->getBspCprmsPresentFlag(i), vps->getMaxTLayers()-1); 2041 } 2042 for( UInt h = 1; h <= (vps->getNumLayerSets()-1); h++ ) 2043 { 2044 READ_UVLC( uiCode, "num_bitstream_partitions[i]"); vps->setNumBitstreamPartitions(h, uiCode); 2045 for( i = 0; i < vps->getNumBitstreamPartitions(h); i++ ) 2046 { 2047 for( j = 0; j <= (vps->getMaxLayers()-1); j++ ) 2048 { 2049 if( vps->getLayerIdIncludedFlag(h, j) ) 2050 { 2051 READ_FLAG( uiCode, "layer_in_bsp_flag[h][i][j]" ); vps->setLayerInBspFlag(h, i, j, uiCode); 2052 } 2053 } 2054 } 2055 if (vps->getNumBitstreamPartitions(h)) 2056 { 2057 READ_UVLC( uiCode, "num_bsp_sched_combinations[h]"); vps->setNumBspSchedCombinations(h, uiCode); 2058 for( i = 0; i < vps->getNumBspSchedCombinations(h); i++ ) 2059 { 2060 for( j = 0; j < vps->getNumBitstreamPartitions(h); j++ ) 2061 { 2062 READ_UVLC( uiCode, "bsp_comb_hrd_idx[h][i][j]"); vps->setBspCombHrdIdx(h, i, j, uiCode); 2063 READ_UVLC( uiCode, "bsp_comb_sched_idx[h][i][j]"); vps->setBspCombSchedIdx(h, i, j, uiCode); 2064 } 2065 } 2066 } 2067 } 2068 } 2069 #endif 2070 2071 #if P0182_VPS_VUI_PS_FLAG 2072 for(i = 1; i < vps->getMaxLayers(); i++) 2073 { 2074 if (vps->getNumRefLayers(vps->getLayerIdInNuh(i)) == 0) 2075 { 2076 READ_FLAG( uiCode, "base_layer_parameter_set_compatibility_flag" ); 2077 vps->setBaseLayerPSCompatibilityFlag( i, uiCode ); 2078 } 2079 else 2080 { 2081 vps->setBaseLayerPSCompatibilityFlag( i, 0 ); 2082 } 2083 } 2084 #endif 1894 2085 } 1895 2086 #endif … … 1911 2102 if( rpcSlice->getRapPicFlag()) 1912 2103 { 2104 #if !NO_OUTPUT_OF_PRIOR_PICS 1913 2105 READ_FLAG( uiCode, "no_output_of_prior_pics_flag" ); //ignored 2106 #else 2107 READ_FLAG( uiCode, "no_output_of_prior_pics_flag" ); rpcSlice->setNoOutputOfPriorPicsFlag( uiCode ? true : false ); 2108 #endif 1914 2109 } 1915 2110 READ_UVLC ( uiCode, "slice_pic_parameter_set_id" ); rpcSlice->setPPSId(uiCode); … … 2229 2424 #if ILP_SSH_SIG 2230 2425 #if ILP_SSH_SIG_FIX 2231 if(( sps->getLayerId() > 0) && !(rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag()) && (rpcSlice->getNumILRRefIdx() > 0) )2232 #else 2233 if(( sps->getLayerId() > 0) && rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag() && (rpcSlice->getNumILRRefIdx() > 0) )2234 #endif 2235 #else 2236 if(( sps->getLayerId() > 0) && (rpcSlice->getNumILRRefIdx() > 0) )2426 if((rpcSlice->getLayerId() > 0) && !(rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag()) && (rpcSlice->getNumILRRefIdx() > 0) ) 2427 #else 2428 if((rpcSlice->getLayerId() > 0) && rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag() && (rpcSlice->getNumILRRefIdx() > 0) ) 2429 #endif 2430 #else 2431 if((rpcSlice->getLayerId() > 0) && (rpcSlice->getNumILRRefIdx() > 0) ) 2237 2432 #endif 2238 2433 { … … 2256 2451 { 2257 2452 #if P0079_DERIVE_NUMACTIVE_REF_PICS 2258 Int numRefLayerPics = 0; 2259 Int i = 0; 2260 Int refLayerPicIdc [MAX_VPS_LAYER_ID_PLUS1]; 2261 for(i = 0, numRefLayerPics = 0; i < rpcSlice->getNumILRRefIdx(); i++ ) 2453 for( Int i = 0; i < rpcSlice->getNumILRRefIdx(); i++ ) 2262 2454 { 2263 2455 if(rpcSlice->getVPS()->getMaxTidIlRefPicsPlus1(rpcSlice->getVPS()->getLayerIdInVps(i),rpcSlice->getLayerId()) > rpcSlice->getTLayer() && 2264 2456 (rpcSlice->getVPS()->getMaxTSLayersMinus1(rpcSlice->getVPS()->getLayerIdInVps(i)) >= rpcSlice->getTLayer()) ) 2265 2457 { 2266 refLayerPicIdc[ numRefLayerPics++ ] = i; 2458 rpcSlice->setActiveNumILRRefIdx(1); 2459 break; 2267 2460 } 2268 2461 } 2269 if (numRefLayerPics)2270 rpcSlice->setActiveNumILRRefIdx(1);2271 2462 #else 2272 2463 rpcSlice->setActiveNumILRRefIdx(1); … … 2344 2535 #endif 2345 2536 #endif 2537 #if P0312_VERT_PHASE_ADJ 2538 for(Int i = 0; i < rpcSlice->getActiveNumILRRefIdx(); i++ ) 2539 { 2540 UInt refLayerIdc = rpcSlice->getInterLayerPredLayerIdc(i); 2541 if( rpcSlice->getSPS()->getVertPhasePositionEnableFlag(refLayerIdc) ) 2542 { 2543 READ_FLAG( uiCode, "vert_phase_position_flag" ); rpcSlice->setVertPhasePositionFlag( uiCode? true : false, refLayerIdc ); 2544 } 2545 } 2546 #endif 2346 2547 2347 2548 if(sps->getUseSAO()) … … 2661 2862 } 2662 2863 2864 #if POC_RESET_IDC_SIGNALLING 2865 Int sliceHederExtensionLength = 0; 2866 if(pps->getSliceHeaderExtensionPresentFlag()) 2867 { 2868 READ_UVLC( uiCode, "slice_header_extension_length"); sliceHederExtensionLength = uiCode; 2869 } 2870 else 2871 { 2872 sliceHederExtensionLength = 0; 2873 } 2874 UInt startBits = m_pcBitstream->getNumBitsRead(); // Start counter of # SH Extn bits 2875 if( sliceHederExtensionLength > 0 ) 2876 { 2877 if( rpcSlice->getPPS()->getPocResetInfoPresentFlag() ) 2878 { 2879 READ_CODE( 2, uiCode, "poc_reset_idc"); rpcSlice->setPocResetIdc(uiCode); 2880 } 2881 else 2882 { 2883 rpcSlice->setPocResetIdc( 0 ); 2884 } 2885 if( rpcSlice->getPocResetIdc() > 0 ) 2886 { 2887 READ_CODE(6, uiCode, "poc_reset_period_id"); rpcSlice->setPocResetPeriodId(uiCode); 2888 } 2889 else 2890 { 2891 2892 rpcSlice->setPocResetPeriodId( 0 ); 2893 } 2894 2895 if (rpcSlice->getPocResetIdc() == 3) 2896 { 2897 READ_FLAG( uiCode, "full_poc_reset_flag"); rpcSlice->setFullPocResetFlag((uiCode == 1) ? true : false); 2898 READ_CODE(rpcSlice->getSPS()->getBitsForPOC(), uiCode,"poc_lsb_val"); rpcSlice->setPocLsbVal(uiCode); 2899 } 2900 2901 // Derive the value of PocMsbValRequiredFlag 2902 rpcSlice->setPocMsbValRequiredFlag( rpcSlice->getCraPicFlag() || rpcSlice->getBlaPicFlag() 2903 /* || related to vps_poc_lsb_aligned_flag */ 2904 ); 2905 2906 if( !rpcSlice->getPocMsbValRequiredFlag() /* vps_poc_lsb_aligned_flag */ ) 2907 { 2908 READ_FLAG( uiCode, "poc_msb_val_present_flag"); rpcSlice->setPocMsbValPresentFlag( uiCode ? true : false ); 2909 } 2910 else 2911 { 2912 if( rpcSlice->getPocMsbValRequiredFlag() ) 2913 { 2914 rpcSlice->setPocMsbValPresentFlag( true ); 2915 } 2916 else 2917 { 2918 rpcSlice->setPocMsbValPresentFlag( false ); 2919 } 2920 } 2921 2922 Int maxPocLsb = 1 << rpcSlice->getSPS()->getBitsForPOC(); 2923 if( rpcSlice->getPocMsbValPresentFlag() ) 2924 { 2925 READ_UVLC( uiCode, "poc_msb_val"); rpcSlice->setPocMsbVal( uiCode ); 2926 // Update POC of the slice based on this MSB val 2927 Int pocLsb = rpcSlice->getPOC() % maxPocLsb; 2928 rpcSlice->setPOC((rpcSlice->getPocMsbVal() * maxPocLsb) + pocLsb); 2929 } 2930 else 2931 { 2932 rpcSlice->setPocMsbVal( rpcSlice->getPOC() / maxPocLsb ); 2933 } 2934 2935 // Read remaining bits in the slice header extension. 2936 UInt endBits = m_pcBitstream->getNumBitsRead(); 2937 Int counter = (endBits - startBits) % 8; 2938 if( counter ) 2939 { 2940 counter = 8 - counter; 2941 } 2942 2943 while( counter ) 2944 { 2945 READ_FLAG( uiCode, "slice_segment_header_extension_reserved_bit" ); assert( uiCode == 1 ); 2946 counter--; 2947 } 2948 } 2949 #else 2663 2950 if(pps->getSliceHeaderExtensionPresentFlag()) 2664 2951 { … … 2670 2957 } 2671 2958 } 2959 #endif 2672 2960 m_pcBitstream->readByteAlignment(); 2673 2961 -
trunk/source/Lib/TLibDecoder/TDecCAVLC.h
r595 r644 86 86 Void parseVpsDpbSizeTable( TComVPS *vps ); 87 87 #endif 88 #if SPS_DPB_PARAMS 89 Void parseSPS ( TComSPS* pcSPS ); // it should be removed after macro clean up 90 #else 88 91 Void parseSPS ( TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager ); 92 #endif 89 93 Void parseSPSExtension ( TComSPS* pcSPS ); 90 94 #else //SVC_EXTENSION -
trunk/source/Lib/TLibDecoder/TDecEntropy.h
r595 r644 66 66 67 67 virtual Void parseVPS ( TComVPS* pcVPS ) = 0; 68 #if SVC_EXTENSION 68 #if SVC_EXTENSION && !SPS_DPB_PARAMS 69 69 virtual Void parseSPS ( TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager ) = 0; 70 70 #else … … 133 133 Void resetEntropy ( TComSlice* p) { m_pcEntropyDecoderIf->resetEntropy(p); } 134 134 Void decodeVPS ( TComVPS* pcVPS ) { m_pcEntropyDecoderIf->parseVPS(pcVPS); } 135 #if SVC_EXTENSION 135 #if SVC_EXTENSION && !SPS_DPB_PARAMS 136 136 Void decodeSPS ( TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager ) { m_pcEntropyDecoderIf->parseSPS(pcSPS, parameterSetManager); } 137 137 #else -
trunk/source/Lib/TLibDecoder/TDecSbac.cpp
r595 r644 1394 1394 1395 1395 Void TDecSbac::parseSAOBlkParam (SAOBlkParam& saoBlkParam 1396 #if SVC_EXTENSION 1397 , UInt* saoMaxOffsetQVal 1398 #endif 1396 1399 , Bool* sliceEnabled 1397 1400 , Bool leftMergeAvail … … 1468 1471 for(Int i=0; i< 4; i++) 1469 1472 { 1473 #if SVC_EXTENSION 1474 parseSaoMaxUvlc(uiSymbol, saoMaxOffsetQVal[compIdx] ); //sao_offset_abs 1475 #else 1470 1476 parseSaoMaxUvlc(uiSymbol, g_saoMaxOffsetQVal[compIdx] ); //sao_offset_abs 1477 #endif 1471 1478 offset[i] = (Int)uiSymbol; 1472 1479 } -
trunk/source/Lib/TLibDecoder/TDecSbac.h
r595 r644 76 76 Void setBitstream ( TComInputBitstream* p ) { m_pcBitstream = p; m_pcTDecBinIf->init( p ); } 77 77 Void parseVPS ( TComVPS* /*pcVPS*/ ) {} 78 #if SVC_EXTENSION 78 #if SVC_EXTENSION && !SPS_DPB_PARAMS 79 79 Void parseSPS ( TComSPS* /*pcSPS*/, ParameterSetManagerDecoder * /*parameterSetManager*/ ) {} 80 80 #else … … 90 90 Void parseSaoTypeIdx ( UInt& ruiVal ); 91 91 Void parseSaoUflc ( UInt uiLength, UInt& ruiVal ); 92 93 #if SVC_EXTENSION 94 Void parseSAOBlkParam (SAOBlkParam& saoBlkParam, UInt* saoMaxOffsetQVal, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail ); 95 #else 92 96 Void parseSAOBlkParam (SAOBlkParam& saoBlkParam, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail); 97 #endif 93 98 Void parseSaoSign(UInt& val); 94 99 private: -
trunk/source/Lib/TLibDecoder/TDecSlice.cpp
r595 r644 105 105 106 106 #if SVC_EXTENSION 107 Void TDecSlice::init(TDec Top** ppcDecTop,TDecEntropy* pcEntropyDecoder, TDecCu* pcCuDecoder)107 Void TDecSlice::init(TDecEntropy* pcEntropyDecoder, TDecCu* pcCuDecoder, UInt* saoMaxOffsetQVal) 108 108 { 109 109 m_pcEntropyDecoder = pcEntropyDecoder; 110 110 m_pcCuDecoder = pcCuDecoder; 111 m_ ppcTDecTop = ppcDecTop;111 m_saoMaxOffsetQVal = saoMaxOffsetQVal; 112 112 } 113 113 #else … … 347 347 aboveMergeAvail = rpcPic->getSAOMergeAvailability(iCUAddr, iCUAddr-uiWidthInLCUs); 348 348 } 349 349 #if SVC_EXTENSION 350 pcSbacDecoder->parseSAOBlkParam( saoblkParam, m_saoMaxOffsetQVal, sliceEnabled, leftMergeAvail, aboveMergeAvail); 351 #else 350 352 pcSbacDecoder->parseSAOBlkParam( saoblkParam, sliceEnabled, leftMergeAvail, aboveMergeAvail); 353 #endif 351 354 } 352 355 else -
trunk/source/Lib/TLibDecoder/TDecSlice.h
r595 r644 72 72 std::vector<TDecSbac*> CTXMem; 73 73 #if SVC_EXTENSION 74 TDecTop** m_ppcTDecTop;74 UInt* m_saoMaxOffsetQVal; 75 75 #endif 76 76 … … 80 80 81 81 #if SVC_EXTENSION 82 Void init ( TDec Top** ppcDecTop, TDecEntropy* pcEntropyDecoder, TDecCu* pcMbDecoder);82 Void init ( TDecEntropy* pcEntropyDecoder, TDecCu* pcMbDecoder, UInt* saoMaxOffsetQVal ); 83 83 #else 84 84 Void init ( TDecEntropy* pcEntropyDecoder, TDecCu* pcMbDecoder ); … … 91 91 Void setCtxMem( TDecSbac* sb, Int b ) { CTXMem[b] = sb; } 92 92 Int getCtxMemSize( ) { return (Int)CTXMem.size(); } 93 #if SVC_EXTENSION94 TDecTop* getLayerDec ( UInt LayerId ) { return m_ppcTDecTop[LayerId]; }95 #endif96 93 }; 97 94 -
trunk/source/Lib/TLibDecoder/TDecTop.cpp
r595 r644 138 138 #if SVC_EXTENSION 139 139 m_cGopDecoder.init( m_ppcTDecTop, &m_cEntropyDecoder, &m_cSbacDecoder, &m_cBinCABAC, &m_cCavlcDecoder, &m_cSliceDecoder, &m_cLoopFilter, &m_cSAO); 140 m_cSliceDecoder.init( m_ppcTDecTop, &m_cEntropyDecoder, &m_cCuDecoder);140 m_cSliceDecoder.init( &m_cEntropyDecoder, &m_cCuDecoder, m_cSAO.getSaoMaxOffsetQVal() ); 141 141 #else 142 142 m_cGopDecoder.init( &m_cEntropyDecoder, &m_cSbacDecoder, &m_cBinCABAC, &m_cCavlcDecoder, &m_cSliceDecoder, &m_cLoopFilter, &m_cSAO); … … 349 349 TComPicYuv* pcPicYuvRecBase = (*(pcTDecTopBase->getListPic()->begin()))->getPicYuvRec(); 350 350 #if REPN_FORMAT_IN_VPS 351 #if O0194_DIFFERENT_BITDEPTH_EL_BL 352 UInt refLayerId = pcSlice->getVPS()->getRefLayerId(m_layerId, i); 353 Bool sameBitDepths = ( g_bitDepthYLayer[m_layerId] == g_bitDepthYLayer[refLayerId] ) && ( g_bitDepthCLayer[m_layerId] == g_bitDepthCLayer[refLayerId] ); 354 355 if( pcPicYuvRecBase->getWidth() != pcSlice->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getPicHeightInLumaSamples() || !zeroOffsets || !sameBitDepths ) 356 #else 351 357 if(pcPicYuvRecBase->getWidth() != pcSlice->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getPicHeightInLumaSamples() || !zeroOffsets ) 358 #endif 352 359 #else 353 360 if(pcPicYuvRecBase->getWidth() != pcSlice->getSPS()->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getSPS()->getPicHeightInLumaSamples() || !zeroOffsets ) … … 726 733 #endif 727 734 735 #if P0312_VERT_PHASE_ADJ 736 if( activeVPS->getVpsVuiVertPhaseInUseFlag() == 0 ) 737 { 738 for(Int i = 0; i < activeSPS->getNumScaledRefLayerOffsets(); i++) 739 { 740 UInt scaledRefLayerId = activeSPS->getScaledRefLayerId(i); 741 if( activeSPS->getVertPhasePositionEnableFlag( scaledRefLayerId ) ) 742 { 743 printf("\nWarning: LayerId = %d: vert_phase_position_enable_flag[%d] = 1, however indication vert_phase_position_in_use_flag = 0\n", m_layerId, scaledRefLayerId ); 744 break; 745 } 746 } 747 } 748 #endif 749 750 #if SPS_DPB_PARAMS 751 if( m_layerId > 0 ) 752 { 753 // When not present sps_max_sub_layers_minus1 is inferred to be equal to vps_max_sub_layers_minus1. 754 sps->setMaxTLayers( activeVPS->getMaxTLayers() ); 755 756 // When not present sps_temporal_id_nesting_flag is inferred to be equal to vps_temporal_id_nesting_flag 757 sps->setTemporalIdNestingFlag( activeVPS->getTemporalNestingFlag() ); 758 759 // When sps_max_dec_pic_buffering_minus1[ i ] is not present for i in the range of 0 to sps_max_sub_layers_minus1, inclusive, due to nuh_layer_id being greater than 0, 760 // it is inferred to be equal to max_vps_dec_pic_buffering_minus1[ TargetOptLayerSetIdx ][ currLayerId ][ i ] of the active VPS, where currLayerId is the nuh_layer_id of the layer that refers to the SPS. 761 for(UInt i=0; i < sps->getMaxTLayers(); i++) 762 { 763 // to avoid compiler warning "array subscript is above array bounds" 764 assert( i < MAX_TLAYER ); 765 766 sps->setMaxDecPicBuffering( activeVPS->getMaxVpsDecPicBufferingMinus1( getCommonDecoderParams()->getTargetOutputLayerSetIdx(), sps->getLayerId(), i) + 1, i); 767 } 768 } 769 #endif 770 728 771 if( pps->getDependentSliceSegmentsEnabledFlag() ) 729 772 { … … 800 843 TComPic*& pcPic = m_pcPic; 801 844 #if SVC_EXTENSION 845 #if !NO_OUTPUT_OF_PRIOR_PICS 802 846 #if NO_CLRAS_OUTPUT_FLAG 803 847 Bool bFirstSliceInSeq; 848 #endif 804 849 #endif 805 850 m_apcSlicePilot->setVPS( m_parameterSetManagerDecoder.getPrefetchedVPS(0) ); … … 855 900 m_apcSlicePilot->setAssociatedIRAPType(m_associatedIRAPType); 856 901 902 #if NO_OUTPUT_OF_PRIOR_PICS 903 // Infer the value of NoOutputOfPriorPicsFlag 904 if( m_apcSlicePilot->getRapPicFlag() ) 905 { 906 if ( m_apcSlicePilot->getBlaPicFlag() || m_apcSlicePilot->getIdrPicFlag() || 907 (m_apcSlicePilot->getCraPicFlag() && m_bFirstSliceInSequence) || 908 (m_apcSlicePilot->getCraPicFlag() && m_apcSlicePilot->getHandleCraAsBlaFlag())) 909 { 910 m_apcSlicePilot->setNoRaslOutputFlag( true ); 911 } 912 else 913 { 914 m_apcSlicePilot->setNoRaslOutputFlag( false ); 915 } 916 } 917 #endif 918 857 919 // Skip pictures due to random access 858 920 if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay)) … … 876 938 #if SVC_EXTENSION 877 939 bNewPOC = (m_apcSlicePilot->getPOC()!= m_prevPOC); 940 941 #if NO_OUTPUT_OF_PRIOR_PICS 942 #if NO_CLRAS_OUTPUT_FLAG 943 if (m_layerId == 0 && m_apcSlicePilot->getRapPicFlag() ) 944 { 945 if (m_bFirstSliceInSequence) 946 { 947 setNoClrasOutputFlag(true); 948 } 949 else if ( m_apcSlicePilot->getBlaPicFlag() ) 950 { 951 setNoClrasOutputFlag(true); 952 } 953 #if O0149_CROSS_LAYER_BLA_FLAG 954 else if (m_apcSlicePilot->getIdrPicFlag() && m_apcSlicePilot->getCrossLayerBLAFlag()) 955 { 956 setNoClrasOutputFlag(true); 957 } 958 #endif 959 else 960 { 961 setNoClrasOutputFlag(false); 962 } 963 } 964 else 965 { 966 setNoClrasOutputFlag(false); 967 } 968 969 m_apcSlicePilot->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, m_cListPic, getNoClrasOutputFlag()); 970 #endif 971 972 // Derive the value of NoOutputOfPriorPicsFlag 973 if( bNewPOC || m_layerId!=m_uiPrevLayerId ) // i.e. new coded picture 974 { 975 if( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getNoRaslOutputFlag() ) 976 { 977 this->setNoOutputOfPriorPicsFlags( true ); 978 } 979 else if( m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoRaslOutputFlag() ) 980 { 981 this->setNoOutputOfPriorPicsFlags( m_apcSlicePilot->getNoOutputOfPriorPicsFlag() ); 982 } 983 else 984 { 985 if( this->m_ppcTDecTop[0]->getNoClrasOutputFlag() ) 986 { 987 this->setNoOutputOfPriorPicsFlags( true ); 988 } 989 } 990 } 991 #endif 992 993 #if ALIGNED_BUMPING 994 if (bNewPOC || m_layerId!=m_uiPrevLayerId) 995 { 996 m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS()); 997 } 998 #endif 878 999 if (m_apcSlicePilot->isNextSlice() && (bNewPOC || m_layerId!=m_uiPrevLayerId) && !m_bFirstSliceInSequence ) 879 1000 { … … 929 1050 #endif 930 1051 } 1052 #if !NO_OUTPUT_OF_PRIOR_PICS 931 1053 #if NO_CLRAS_OUTPUT_FLAG 932 1054 bFirstSliceInSeq = m_bFirstSliceInSequence; 1055 #endif 933 1056 #endif 934 1057 m_bFirstSliceInSequence = false; … … 1093 1216 #endif 1094 1217 1218 #if !NO_OUTPUT_OF_PRIOR_PICS 1095 1219 #if NO_CLRAS_OUTPUT_FLAG 1096 1220 if (m_layerId == 0 && … … 1137 1261 m_apcSlicePilot->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, m_cListPic, getNoClrasOutputFlag()); 1138 1262 #endif 1139 1263 #else 1264 if ( m_layerId == 0 && m_apcSlicePilot->getRapPicFlag() && getNoClrasOutputFlag() ) 1265 { 1266 for (UInt i = 0; i < m_apcSlicePilot->getVPS()->getMaxLayers(); i++) 1267 { 1268 m_ppcTDecTop[i]->setLayerInitializedFlag(false); 1269 m_ppcTDecTop[i]->setFirstPicInLayerDecodedFlag(false); 1270 } 1271 } 1272 #endif 1140 1273 // Buffer initialize for prediction. 1141 1274 m_cPrediction.initTempBuff(); 1275 #if !ALIGNED_BUMPING 1142 1276 m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS()); 1277 #else 1278 m_apcSlicePilot->checkLeadingPictureRestrictions(m_cListPic); 1279 #endif 1143 1280 // Get a new picture buffer 1144 1281 xGetNewPicBuffer (m_apcSlicePilot, pcPic); … … 1600 1737 #if SVC_EXTENSION 1601 1738 sps->setLayerId(m_layerId); 1739 #if SPS_DPB_PARAMS 1740 m_cEntropyDecoder.decodeSPS( sps ); // it should be removed after macro clean up 1741 #else 1602 1742 m_cEntropyDecoder.decodeSPS( sps, &m_parameterSetManagerDecoder ); 1743 #endif 1603 1744 m_parameterSetManagerDecoder.storePrefetchedSPS(sps); 1604 1745 #if !REPN_FORMAT_IN_VPS // ILRP can only be initialized at activation -
trunk/source/Lib/TLibDecoder/TDecTop.h
r595 r644 239 239 fstream* getBLSyntaxFile() { return m_pBLSyntaxFile; } 240 240 #endif 241 241 #if NO_OUTPUT_OF_PRIOR_PICS 242 #if NO_CLRAS_OUTPUT_FLAG 243 Bool getNoOutputOfPriorPicsFlags() { return m_noOutputOfPriorPicsFlags;} 244 Void setNoOutputOfPriorPicsFlags(Bool x) { m_noOutputOfPriorPicsFlags = x; } 245 #endif 246 #endif 242 247 protected: 243 248 Void xGetNewPicBuffer (TComSlice* pcSlice, TComPic*& rpcPic); … … 266 271 Int getFirstPicInLayerDecodedFlag() { return m_firstPicInLayerDecodedFlag;} 267 272 Void setFirstPicInLayerDecodedFlag(Bool x) { m_firstPicInLayerDecodedFlag = x; } 273 #if !NO_OUTPUT_OF_PRIOR_PICS 268 274 Int getNoOutputOfPriorPicsFlags() { return m_noOutputOfPriorPicsFlags;} 269 275 Void setNoOutputOfPriorPicsFlags(Bool x) { m_noOutputOfPriorPicsFlags = x; } 270 276 #endif 277 #endif 271 278 };// END CLASS DEFINITION TDecTop 272 279 -
trunk/source/Lib/TLibEncoder/SEIwrite.cpp
r595 r644 105 105 #endif 106 106 #if SUB_BITSTREAM_PROPERTY_SEI 107 case SEI::SUB_BITSTREAM_PROPERTY: 108 fprintf( g_hTrace, "=========== Sub-bitstream property SEI message ===========\n"); 109 break; 107 case SEI::SUB_BITSTREAM_PROPERTY: 108 fprintf( g_hTrace, "=========== Sub-bitstream property SEI message ===========\n"); 109 break; 110 #endif 111 #if O0164_MULTI_LAYER_HRD 112 case SEI::BSP_NESTING: 113 fprintf( g_hTrace, "=========== Bitstream partition nesting SEI message ===========\n"); 114 break; 115 case SEI::BSP_INITIAL_ARRIVAL_TIME: 116 fprintf( g_hTrace, "=========== Bitstream parition initial arrival time SEI message ===========\n"); 117 break; 118 case SEI::BSP_HRD: 119 fprintf( g_hTrace, "=========== Bitstream parition HRD parameters SEI message ===========\n"); 120 break; 110 121 #endif 111 122 #endif //SVC_EXTENSION … … 117 128 #endif 118 129 130 #if O0164_MULTI_LAYER_HRD 131 void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting& nestingSei, const SEIBspNesting& bspNestingSei) 132 #else 119 133 void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComSPS *sps) 134 #endif 120 135 { 121 136 switch (sei.payloadType()) … … 161 176 break; 162 177 case SEI::SCALABLE_NESTING: 178 #if O0164_MULTI_LAYER_HRD 179 xWriteSEIScalableNesting(bs, *static_cast<const SEIScalableNesting*>(&sei), vps, sps); 180 #else 163 181 xWriteSEIScalableNesting(bs, *static_cast<const SEIScalableNesting*>(&sei), sps); 182 #endif 164 183 break; 165 184 #if SVC_EXTENSION … … 179 198 break; 180 199 #endif 200 #if O0164_MULTI_LAYER_HRD 201 case SEI::BSP_NESTING: 202 xWriteSEIBspNesting(bs, *static_cast<const SEIBspNesting*>(&sei), vps, sps, nestingSei); 203 break; 204 case SEI::BSP_INITIAL_ARRIVAL_TIME: 205 xWriteSEIBspInitialArrivalTime(*static_cast<const SEIBspInitialArrivalTime*>(&sei), vps, sps, nestingSei, bspNestingSei); 206 break; 207 case SEI::BSP_HRD: 208 xWriteSEIBspHrd(*static_cast<const SEIBspHrd*>(&sei), sps, nestingSei); 209 break; 210 #endif 181 211 #endif //SVC_EXTENSION 182 212 default: … … 189 219 * in bitstream bs. 190 220 */ 221 #if O0164_MULTI_LAYER_HRD 222 Void SEIWriter::writeSEImessage(TComBitIf& bs, const SEI& sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei) 223 #else 191 224 Void SEIWriter::writeSEImessage(TComBitIf& bs, const SEI& sei, TComSPS *sps) 225 #endif 192 226 { 193 227 /* calculate how large the payload data is */ … … 202 236 g_HLSTraceEnable = false; 203 237 #endif 238 #if O0164_MULTI_LAYER_HRD 239 xWriteSEIpayloadData(bs_count, sei, vps, sps, *nestingSei, *bspNestingSei); 240 #else 204 241 xWriteSEIpayloadData(bs_count, sei, sps); 242 #endif 205 243 #if ENC_DEC_TRACE 206 244 g_HLSTraceEnable = traceEnable; … … 237 275 #endif 238 276 277 #if O0164_MULTI_LAYER_HRD 278 xWriteSEIpayloadData(bs, sei, vps, sps, *nestingSei, *bspNestingSei); 279 #else 239 280 xWriteSEIpayloadData(bs, sei, sps); 281 #endif 240 282 } 241 283 … … 367 409 } 368 410 } 411 #if P0138_USE_ALT_CPB_PARAMS_FLAG 412 if (sei.m_useAltCpbParamsFlagPresent) 413 { 414 WRITE_FLAG( sei.m_useAltCpbParamsFlag, "use_alt_cpb_params_flag"); 415 } 416 #endif 369 417 xWriteByteAlign(); 370 418 } … … 571 619 } 572 620 621 #if O0164_MULTI_LAYER_HRD 622 Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComVPS *vps, TComSPS *sps) 623 #else 573 624 Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps) 625 #endif 574 626 { 575 627 WRITE_FLAG( sei.m_bitStreamSubsetFlag, "bitstream_subset_flag" ); … … 581 633 for (UInt i = (sei.m_defaultOpFlag ? 1 : 0); i <= sei.m_nestingNumOpsMinus1; i++) 582 634 { 583 WRITE_CODE( sei.m_nestingNoOpMaxTemporalIdPlus1, 3, "nesting_no_op_max_temporal_id" );584 635 WRITE_CODE( sei.m_nestingMaxTemporalIdPlus1[i], 3, "nesting_max_temporal_id" ); 585 636 WRITE_UVLC( sei.m_nestingOpIdx[i], "nesting_op_idx" ); … … 609 660 for (SEIMessages::const_iterator it = sei.m_nestedSEIs.begin(); it != sei.m_nestedSEIs.end(); it++) 610 661 { 662 #if O0164_MULTI_LAYER_HRD 663 writeSEImessage(bs, *(*it), vps, sps, &sei); 664 #else 611 665 writeSEImessage(bs, *(*it), sps); 666 #endif 612 667 } 613 668 } … … 693 748 } 694 749 #endif 750 751 #if O0164_MULTI_LAYER_HRD 752 Void SEIWriter::xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei) 753 { 754 WRITE_UVLC( sei.m_bspIdx, "bsp_idx" ); 755 756 while ( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0 ) 757 { 758 WRITE_FLAG( 0, "bsp_nesting_zero_bit" ); 759 } 760 761 // write nested SEI messages 762 for (SEIMessages::const_iterator it = sei.m_nestedSEIs.begin(); it != sei.m_nestedSEIs.end(); it++) 763 { 764 writeSEImessage(bs, *(*it), vps, sps, &nestingSei, &sei); 765 } 766 } 767 768 Void SEIWriter::xWriteSEIBspInitialArrivalTime(const SEIBspInitialArrivalTime &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei) 769 { 770 assert(vps->getVpsVuiPresentFlag()); 771 772 UInt schedCombCnt = vps->getNumBspSchedCombinations(nestingSei.m_nestingOpIdx[0]); 773 UInt len; 774 UInt hrdIdx; 775 776 if (schedCombCnt > 0) 777 { 778 hrdIdx = vps->getBspCombHrdIdx(nestingSei.m_nestingOpIdx[0], 0, bspNestingSei.m_bspIdx); 779 } 780 else 781 { 782 hrdIdx = 0; 783 } 784 785 TComHRD *hrd = vps->getBspHrd(hrdIdx); 786 787 if (hrd->getNalHrdParametersPresentFlag() || hrd->getVclHrdParametersPresentFlag()) 788 { 789 len = hrd->getInitialCpbRemovalDelayLengthMinus1() + 1; 790 } 791 else 792 { 793 len = 23 + 1; 794 } 795 796 if (hrd->getNalHrdParametersPresentFlag()) 797 { 798 for(UInt i = 0; i < schedCombCnt; i++) 799 { 800 WRITE_CODE( sei.m_nalInitialArrivalDelay[i], len, "nal_initial_arrival_delay" ); 801 } 802 } 803 else 804 { 805 for(UInt i = 0; i < schedCombCnt; i++) 806 { 807 WRITE_CODE( sei.m_vclInitialArrivalDelay[i], len, "vcl_initial_arrival_delay" ); 808 } 809 } 810 } 811 812 Void SEIWriter::xWriteSEIBspHrd(const SEIBspHrd &sei, TComSPS *sps, const SEIScalableNesting &nestingSei) 813 { 814 WRITE_UVLC( sei.m_seiNumBspHrdParametersMinus1, "sei_num_bsp_hrd_parameters_minus1" ); 815 for (UInt i = 0; i <= sei.m_seiNumBspHrdParametersMinus1; i++) 816 { 817 if (i > 0) 818 { 819 WRITE_FLAG( sei.m_seiBspCprmsPresentFlag[i], "sei_bsp_cprms_present_flag" ); 820 } 821 xCodeHrdParameters(sei.hrd, i==0 ? 1 : sei.m_seiBspCprmsPresentFlag[i], nestingSei.m_nestingMaxTemporalIdPlus1[0]-1); 822 } 823 for (UInt h = 0; h <= nestingSei.m_nestingNumOpsMinus1; h++) 824 { 825 UInt lsIdx = nestingSei.m_nestingOpIdx[h]; 826 WRITE_UVLC( sei.m_seiNumBitstreamPartitionsMinus1[lsIdx], "num_sei_bitstream_partitions_minus1[i]"); 827 for (UInt i = 0; i <= sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]; i++) 828 { 829 for (UInt j = 0; j < sei.m_vpsMaxLayers; j++) 830 { 831 if (sei.m_layerIdIncludedFlag[lsIdx][j]) 832 { 833 WRITE_FLAG( sei.m_seiLayerInBspFlag[lsIdx][i][j], "sei_layer_in_bsp_flag[lsIdx][i][j]" ); 834 } 835 } 836 } 837 WRITE_UVLC( sei.m_seiNumBspSchedCombinationsMinus1[lsIdx], "sei_num_bsp_sched_combinations_minus1[i]"); 838 for (UInt i = 0; i <= sei.m_seiNumBspSchedCombinationsMinus1[lsIdx]; i++) 839 { 840 for (UInt j = 0; j <= sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]; j++) 841 { 842 WRITE_UVLC( sei.m_seiBspCombHrdIdx[lsIdx][i][j], "sei_bsp_comb_hrd_idx[lsIdx][i][j]"); 843 WRITE_UVLC( sei.m_seiBspCombScheddx[lsIdx][i][j], "sei_bsp_comb_sched_idx[lsIdx][i][j]"); 844 } 845 } 846 } 847 } 848 849 Void SEIWriter::xCodeHrdParameters( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 ) 850 { 851 if( commonInfPresentFlag ) 852 { 853 WRITE_FLAG( hrd->getNalHrdParametersPresentFlag() ? 1 : 0 , "nal_hrd_parameters_present_flag" ); 854 WRITE_FLAG( hrd->getVclHrdParametersPresentFlag() ? 1 : 0 , "vcl_hrd_parameters_present_flag" ); 855 if( hrd->getNalHrdParametersPresentFlag() || hrd->getVclHrdParametersPresentFlag() ) 856 { 857 WRITE_FLAG( hrd->getSubPicCpbParamsPresentFlag() ? 1 : 0, "sub_pic_cpb_params_present_flag" ); 858 if( hrd->getSubPicCpbParamsPresentFlag() ) 859 { 860 WRITE_CODE( hrd->getTickDivisorMinus2(), 8, "tick_divisor_minus2" ); 861 WRITE_CODE( hrd->getDuCpbRemovalDelayLengthMinus1(), 5, "du_cpb_removal_delay_length_minus1" ); 862 WRITE_FLAG( hrd->getSubPicCpbParamsInPicTimingSEIFlag() ? 1 : 0, "sub_pic_cpb_params_in_pic_timing_sei_flag" ); 863 WRITE_CODE( hrd->getDpbOutputDelayDuLengthMinus1(), 5, "dpb_output_delay_du_length_minus1" ); 864 } 865 WRITE_CODE( hrd->getBitRateScale(), 4, "bit_rate_scale" ); 866 WRITE_CODE( hrd->getCpbSizeScale(), 4, "cpb_size_scale" ); 867 if( hrd->getSubPicCpbParamsPresentFlag() ) 868 { 869 WRITE_CODE( hrd->getDuCpbSizeScale(), 4, "du_cpb_size_scale" ); 870 } 871 WRITE_CODE( hrd->getInitialCpbRemovalDelayLengthMinus1(), 5, "initial_cpb_removal_delay_length_minus1" ); 872 WRITE_CODE( hrd->getCpbRemovalDelayLengthMinus1(), 5, "au_cpb_removal_delay_length_minus1" ); 873 WRITE_CODE( hrd->getDpbOutputDelayLengthMinus1(), 5, "dpb_output_delay_length_minus1" ); 874 } 875 } 876 Int i, j, nalOrVcl; 877 for( i = 0; i <= maxNumSubLayersMinus1; i ++ ) 878 { 879 WRITE_FLAG( hrd->getFixedPicRateFlag( i ) ? 1 : 0, "fixed_pic_rate_general_flag"); 880 if( !hrd->getFixedPicRateFlag( i ) ) 881 { 882 WRITE_FLAG( hrd->getFixedPicRateWithinCvsFlag( i ) ? 1 : 0, "fixed_pic_rate_within_cvs_flag"); 883 } 884 else 885 { 886 hrd->setFixedPicRateWithinCvsFlag( i, true ); 887 } 888 if( hrd->getFixedPicRateWithinCvsFlag( i ) ) 889 { 890 WRITE_UVLC( hrd->getPicDurationInTcMinus1( i ), "elemental_duration_in_tc_minus1"); 891 } 892 else 893 { 894 WRITE_FLAG( hrd->getLowDelayHrdFlag( i ) ? 1 : 0, "low_delay_hrd_flag"); 895 } 896 if (!hrd->getLowDelayHrdFlag( i )) 897 { 898 WRITE_UVLC( hrd->getCpbCntMinus1( i ), "cpb_cnt_minus1"); 899 } 900 901 for( nalOrVcl = 0; nalOrVcl < 2; nalOrVcl ++ ) 902 { 903 if( ( ( nalOrVcl == 0 ) && ( hrd->getNalHrdParametersPresentFlag() ) ) || 904 ( ( nalOrVcl == 1 ) && ( hrd->getVclHrdParametersPresentFlag() ) ) ) 905 { 906 for( j = 0; j <= ( hrd->getCpbCntMinus1( i ) ); j ++ ) 907 { 908 WRITE_UVLC( hrd->getBitRateValueMinus1( i, j, nalOrVcl ), "bit_rate_value_minus1"); 909 WRITE_UVLC( hrd->getCpbSizeValueMinus1( i, j, nalOrVcl ), "cpb_size_value_minus1"); 910 if( hrd->getSubPicCpbParamsPresentFlag() ) 911 { 912 WRITE_UVLC( hrd->getDuCpbSizeValueMinus1( i, j, nalOrVcl ), "cpb_size_du_value_minus1"); 913 WRITE_UVLC( hrd->getDuBitRateValueMinus1( i, j, nalOrVcl ), "bit_rate_du_value_minus1"); 914 } 915 WRITE_FLAG( hrd->getCbrFlag( i, j, nalOrVcl ) ? 1 : 0, "cbr_flag"); 916 } 917 } 918 } 919 } 920 } 921 922 #endif 923 695 924 #endif //SVC_EXTENSION 696 925 -
trunk/source/Lib/TLibEncoder/SEIwrite.h
r595 r644 47 47 virtual ~SEIWriter() {}; 48 48 49 #if O0164_MULTI_LAYER_HRD 50 void writeSEImessage(TComBitIf& bs, const SEI& sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting* nestingSei=NULL, const SEIBspNesting* bspNestingSei=NULL); 51 #else 49 52 void writeSEImessage(TComBitIf& bs, const SEI& sei, TComSPS *sps); 53 #endif 50 54 51 55 protected: 56 #if O0164_MULTI_LAYER_HRD 57 Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting& nestingSei, const SEIBspNesting& bspNestingSei); 58 #else 52 59 Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComSPS *sps); 60 #endif 53 61 Void xWriteSEIuserDataUnregistered(const SEIuserDataUnregistered &sei); 54 62 Void xWriteSEIActiveParameterSets(const SEIActiveParameterSets& sei); … … 65 73 Void xWriteSEIToneMappingInfo(const SEIToneMappingInfo& sei); 66 74 Void xWriteSEISOPDescription(const SEISOPDescription& sei); 75 #if O0164_MULTI_LAYER_HRD 76 Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComVPS *vps, TComSPS *sps); 77 #else 67 78 Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps); 79 #endif 68 80 Void xWriteByteAlign(); 69 81 #if SVC_EXTENSION … … 77 89 Void xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei); 78 90 #endif 91 #if O0164_MULTI_LAYER_HRD 92 Void xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei); 93 Void xWriteSEIBspInitialArrivalTime(const SEIBspInitialArrivalTime &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei); 94 Void xWriteSEIBspHrd(const SEIBspHrd &sei, TComSPS *sps, const SEIScalableNesting &nestingSei); 95 Void xCodeHrdParameters( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 ); 96 #endif 79 97 #endif //SVC_EXTENSION 80 98 }; -
trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
r595 r644 251 251 WRITE_UVLC( pcPPS->getLog2ParallelMergeLevelMinus2(), "log2_parallel_merge_level_minus2"); 252 252 WRITE_FLAG( pcPPS->getSliceHeaderExtensionPresentFlag() ? 1 : 0, "slice_segment_header_extension_present_flag"); 253 #if P0166_MODIFIED_PPS_EXTENSION 254 WRITE_FLAG( 1, "pps_extension_flag" ); 255 if( 1 ) //pps_extension_flag 256 { 257 #if !POC_RESET_IDC 258 UInt ppsExtensionTypeFlag[8] = { 0, 1, 0, 0, 0, 0, 0, 0 }; 259 #else 260 UInt ppsExtensionTypeFlag[8] = { 1, 0, 0, 0, 0, 0, 0, 0 }; 261 #endif 262 for (UInt i = 0; i < 8; i++) 263 { 264 WRITE_FLAG( ppsExtensionTypeFlag[i], "pps_extension_type_flag" ); 265 } 266 #if POC_RESET_IDC 267 if( ppsExtensionTypeFlag[0] ) 268 { 269 WRITE_FLAG( pcPPS->getPocResetInfoPresentFlag() ? 1 : 0, "poc_reset_info_present_flag" ); 270 #endif 271 } 272 } 273 #else 253 274 WRITE_FLAG( 0, "pps_extension_flag" ); 275 #endif 254 276 } 255 277 … … 496 518 WRITE_UVLC( pcSPS->getBitsForPOC()-4, "log2_max_pic_order_cnt_lsb_minus4" ); 497 519 520 #if SPS_DPB_PARAMS 521 if( pcSPS->getLayerId() == 0 ) 522 { 523 #endif 498 524 const Bool subLayerOrderingInfoPresentFlag = 1; 499 525 WRITE_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag"); … … 508 534 } 509 535 } 536 #if SPS_DPB_PARAMS 537 } 538 #endif 510 539 assert( pcSPS->getMaxCUWidth() == pcSPS->getMaxCUHeight() ); 511 540 … … 632 661 WRITE_SVLC( scaledWindow.getWindowRightOffset() >> 1, "scaled_ref_layer_right_offset" ); 633 662 WRITE_SVLC( scaledWindow.getWindowBottomOffset() >> 1, "scaled_ref_layer_bottom_offset" ); 663 #if P0312_VERT_PHASE_ADJ 664 WRITE_FLAG( scaledWindow.getVertPhasePositionEnableFlag(), "vert_phase_position_enable_flag" ); 665 #endif 634 666 } 635 667 } … … 776 808 { 777 809 // ... More syntax elements to be written here 810 #if P0300_ALT_OUTPUT_LAYER_FLAG 811 Int NumOutputLayersInOutputLayerSet[MAX_VPS_LAYER_SETS_PLUS1]; 812 Int OlsHighestOutputLayerId[MAX_VPS_LAYER_SETS_PLUS1]; 813 #endif 778 814 #if VPS_EXTN_MASK_AND_DIM_INFO 779 815 UInt i = 0, j = 0; … … 887 923 if (vps->getMaxTSLayersPresentFlag()) 888 924 { 889 for( i = 0; i < vps->getMaxLayers() - 1; i++)925 for( i = 0; i < vps->getMaxLayers(); i++) 890 926 { 891 927 WRITE_CODE(vps->getMaxTSLayersMinus1(i), 3, "sub_layers_vps_max_minus1[i]" ); … … 993 1029 #endif 994 1030 Int lsIdx = vps->getOutputLayerSetIdx(i); 1031 #if NUM_OL_FLAGS 1032 for(j = 0; j < vps->getNumLayersInIdList(lsIdx) ; j++) 1033 #else 995 1034 for(j = 0; j < vps->getNumLayersInIdList(lsIdx) - 1; j++) 1035 #endif 996 1036 { 997 1037 WRITE_FLAG( vps->getOutputLayerFlag(i,j), "output_layer_flag[i][j]"); … … 1004 1044 } 1005 1045 WRITE_CODE( vps->getProfileLevelTierIdx(i), numBits, "profile_level_tier_idx[i]" ); 1006 } 1007 1046 #if P0300_ALT_OUTPUT_LAYER_FLAG 1047 NumOutputLayersInOutputLayerSet[i] = 0; 1048 Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx(i); 1049 for (j = 0; j < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet); j++) 1050 { 1051 NumOutputLayersInOutputLayerSet[i] += vps->getOutputLayerFlag(i, j); 1052 if (vps->getOutputLayerFlag(i, j)) 1053 { 1054 OlsHighestOutputLayerId[i] = vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, j); 1055 } 1056 } 1057 if (NumOutputLayersInOutputLayerSet[i] == 1 && vps->getNumDirectRefLayers(OlsHighestOutputLayerId[i]) > 0) 1058 { 1059 WRITE_FLAG(vps->getAltOuputLayerFlag(i), "alt_output_layer_flag[i]"); 1060 } 1061 #endif 1062 } 1063 1064 #if !P0300_ALT_OUTPUT_LAYER_FLAG 1008 1065 #if O0153_ALT_OUTPUT_LAYER_FLAG 1009 1066 if( vps->getMaxLayers() > 1 ) … … 1011 1068 WRITE_FLAG( vps->getAltOuputLayerFlag(), "alt_output_layer_flag" ); 1012 1069 } 1070 #endif 1013 1071 #endif 1014 1072 … … 1124 1182 #if P0307_VPS_NON_VUI_EXTENSION 1125 1183 WRITE_UVLC( vps->getVpsNonVuiExtLength(), "vps_non_vui_extension_length" ); 1184 #if P0307_VPS_NON_VUI_EXT_UPDATE 1185 for (i = 1; i <= vps->getVpsNonVuiExtLength(); i++) 1186 { 1187 WRITE_CODE(1, 8, "vps_non_vui_extension_data_byte"); 1188 } 1189 #else 1126 1190 if ( vps->getVpsNonVuiExtLength() > 0 ) 1127 1191 { 1128 1192 printf("\n\nUp to the current spec, the value of vps_non_vui_extension_length is supposed to be 0\n"); 1129 1193 } 1194 #endif 1130 1195 #endif 1131 1196 … … 1217 1282 Void TEncCavlc::codeVpsDpbSizeTable(TComVPS *vps) 1218 1283 { 1284 #if DPB_PARAMS_MAXTLAYERS 1285 Int * MaxSubLayersInLayerSetMinus1 = new Int[vps->getNumOutputLayerSets()]; 1286 for(Int i = 1; i < vps->getNumOutputLayerSets(); i++) 1287 { 1288 UInt maxSLMinus1 = 0; 1289 #if CHANGE_NUMSUBDPB_IDX 1290 Int optLsIdx = vps->getOutputLayerSetIdx( i ); 1291 #else 1292 Int optLsIdx = i; 1293 #endif 1294 for(Int k = 0; k < vps->getNumLayersInIdList(optLsIdx); k++ ) { 1295 Int lId = vps->getLayerSetLayerIdList(optLsIdx, k); 1296 maxSLMinus1 = max(maxSLMinus1, vps->getMaxTSLayersMinus1(vps->getLayerIdInVps(lId))); 1297 } 1298 MaxSubLayersInLayerSetMinus1[ i ] = maxSLMinus1; 1299 } 1300 #endif 1301 1219 1302 for(Int i = 1; i < vps->getNumOutputLayerSets(); i++) 1220 1303 { … … 1222 1305 Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx( i ); 1223 1306 #endif 1224 WRITE_FLAG( vps->getSubLayerFlagInfoPresentFlag( i ), "sub_layer_flag_info_present_flag[i]"); 1307 WRITE_FLAG( vps->getSubLayerFlagInfoPresentFlag( i ), "sub_layer_flag_info_present_flag[i]"); 1308 #if DPB_PARAMS_MAXTLAYERS 1309 for(Int j = 0; j <= MaxSubLayersInLayerSetMinus1[ i ]; j++) 1310 #else 1225 1311 for(Int j = 0; j < vps->getMaxTLayers(); j++) 1312 #endif 1226 1313 { 1227 1314 if( j > 0 && vps->getSubLayerFlagInfoPresentFlag(i) ) … … 1266 1353 #if IRAP_ALIGN_FLAG_IN_VPS_VUI 1267 1354 WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag"); 1355 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 1356 if(vps->getCrossLayerIrapAlignFlag()) 1357 { 1358 WRITE_FLAG(vps->getCrossLayerAlignedIdrOnlyFlag(), "only_idr_for_IRAP_across_layers"); 1359 } 1360 #endif 1268 1361 #endif 1269 1362 #if O0223_PICTURE_TYPES_ALIGN_FLAG … … 1375 1468 WRITE_FLAG(vps->getHigherLayerIrapSkipFlag(), "higher_layer_irap_skip_flag" ); 1376 1469 #endif 1470 #endif 1471 #if P0312_VERT_PHASE_ADJ 1472 WRITE_FLAG( vps->getVpsVuiVertPhaseInUseFlag(), "vps_vui_vert_phase_in_use_flag" ); 1377 1473 #endif 1378 1474 #if N0160_VUI_EXT_ILP_REF … … 1424 1520 #endif 1425 1521 #endif 1522 #if O0164_MULTI_LAYER_HRD 1523 WRITE_FLAG(vps->getVpsVuiBspHrdPresentFlag(), "vps_vui_bsp_hrd_present_flag" ); 1524 if (vps->getVpsVuiBspHrdPresentFlag()) 1525 { 1526 WRITE_UVLC( vps->getVpsNumBspHrdParametersMinus1(), "vps_num_bsp_hrd_parameters_minus1" ); 1527 for( i = 0; i <= vps->getVpsNumBspHrdParametersMinus1(); i++ ) 1528 { 1529 if( i > 0 ) 1530 { 1531 WRITE_FLAG( vps->getBspCprmsPresentFlag(i), "bsp_cprms_present_flag[i]" ); 1532 } 1533 codeHrdParameters(vps->getBspHrd(i), i==0 ? 1 : vps->getBspCprmsPresentFlag(i), vps->getMaxTLayers()-1); 1534 } 1535 for( UInt h = 1; h <= (vps->getNumLayerSets()-1); h++ ) 1536 { 1537 WRITE_UVLC( vps->getNumBitstreamPartitions(h), "num_bitstream_partitions[i]"); 1538 for( i = 0; i < vps->getNumBitstreamPartitions(h); i++ ) 1539 { 1540 for( j = 0; j <= (vps->getMaxLayers()-1); j++ ) 1541 { 1542 if (vps->getLayerIdIncludedFlag(h, j)) 1543 { 1544 WRITE_FLAG( vps->getLayerInBspFlag(h, i, j), "layer_in_bsp_flag[h][i][j]" ); 1545 } 1546 } 1547 } 1548 if (vps->getNumBitstreamPartitions(h)) 1549 { 1550 WRITE_UVLC( vps->getNumBspSchedCombinations(h), "num_bsp_sched_combinations[h]"); 1551 for( i = 0; i < vps->getNumBspSchedCombinations(h); i++ ) 1552 { 1553 for( j = 0; j < vps->getNumBitstreamPartitions(h); j++ ) 1554 { 1555 WRITE_UVLC( vps->getBspCombHrdIdx(h, i, j), "bsp_comb_hrd_idx[h][i][j]"); 1556 WRITE_UVLC( vps->getBspCombSchedIdx(h, i, j), "bsp_comb_sched_idx[h][i][j]"); 1557 } 1558 } 1559 } 1560 } 1561 } 1562 #endif 1563 #if P0182_VPS_VUI_PS_FLAG 1564 for(i = 1; i < vps->getMaxLayers(); i++) 1565 { 1566 if(vps->getNumRefLayers(vps->getLayerIdInNuh(i)) == 0) 1567 { 1568 if ((vps->getSPSId(i) == 0) && (vps->getPPSId(i) == 0)) 1569 { 1570 vps->setBaseLayerPSCompatibilityFlag(i, 1); 1571 WRITE_FLAG(vps->getBaseLayerPSCompatibilityFlag(i), "base_layer_parameter_set_compatibility_flag" ); 1572 } 1573 else 1574 { 1575 vps->setBaseLayerPSCompatibilityFlag(i, 0); 1576 } 1577 } 1578 } 1579 #endif 1426 1580 } 1427 1581 #endif … … 1458 1612 if ( pcSlice->getRapPicFlag() ) 1459 1613 { 1614 #if NO_OUTPUT_OF_PRIOR_PICS 1615 WRITE_FLAG( pcSlice->getNoOutputOfPriorPicsFlag(), "no_output_of_prior_pics_flag" ); 1616 #else 1460 1617 WRITE_FLAG( 0, "no_output_of_prior_pics_flag" ); 1618 #endif 1461 1619 } 1462 1620 WRITE_UVLC( pcSlice->getPPS()->getPPSId(), "slice_pic_parameter_set_id" ); … … 1690 1848 #if ILP_SSH_SIG 1691 1849 #if ILP_SSH_SIG_FIX 1692 if((pcSlice->get SPS()->getLayerId() > 0) && !(pcSlice->getVPS()->getIlpSshSignalingEnabledFlag()) && (pcSlice->getNumILRRefIdx() > 0) )1693 #else 1694 if((pcSlice->get SPS()->getLayerId() > 0) && pcSlice->getVPS()->getIlpSshSignalingEnabledFlag() && (pcSlice->getNumILRRefIdx() > 0) )1695 #endif 1696 #else 1697 if((pcSlice->get SPS()->getLayerId() > 0) && (pcSlice->getNumILRRefIdx() > 0) )1850 if((pcSlice->getLayerId() > 0) && !(pcSlice->getVPS()->getIlpSshSignalingEnabledFlag()) && (pcSlice->getNumILRRefIdx() > 0) ) 1851 #else 1852 if((pcSlice->getLayerId() > 0) && pcSlice->getVPS()->getIlpSshSignalingEnabledFlag() && (pcSlice->getNumILRRefIdx() > 0) ) 1853 #endif 1854 #else 1855 if((pcSlice->getLayerId() > 0) && (pcSlice->getNumILRRefIdx() > 0) ) 1698 1856 #endif 1699 1857 { … … 1726 1884 } 1727 1885 } 1886 #if P0312_VERT_PHASE_ADJ 1887 for(Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ ) 1888 { 1889 UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i); 1890 if( pcSlice->getSPS()->getVertPhasePositionEnableFlag(refLayerIdc) ) 1891 { 1892 WRITE_FLAG( pcSlice->getVertPhasePositionFlag(refLayerIdc), "vert_phase_position_flag" ); 1893 } 1894 } 1895 #endif 1728 1896 #endif //SVC_EXTENSION 1729 1897 … … 1886 2054 } 1887 2055 } 2056 2057 #if !POC_RESET_IDC_SIGNALLING // Wrong place to put slice header extension 1888 2058 if(pcSlice->getPPS()->getSliceHeaderExtensionPresentFlag()) 1889 2059 { 1890 2060 WRITE_UVLC(0,"slice_header_extension_length"); 1891 2061 } 2062 #endif 1892 2063 } 1893 2064 … … 2025 2196 } 2026 2197 2198 #if POC_RESET_IDC_SIGNALLING 2199 Void TEncCavlc::codeSliceHeaderExtn( TComSlice* slice, Int shBitsWrittenTillNow ) 2200 { 2201 Int tmpBitsBeforeWriting = getNumberOfWrittenBits(); 2202 if(slice->getPPS()->getSliceHeaderExtensionPresentFlag()) 2203 { 2204 // Derive the value of PocMsbValRequiredFlag 2205 slice->setPocMsbValRequiredFlag( slice->getCraPicFlag() || slice->getBlaPicFlag() 2206 /* || related to vps_poc_lsb_aligned_flag */ 2207 ); 2208 2209 // Determine value of SH extension length. 2210 Int shExtnLengthInBit = 0; 2211 if (slice->getPPS()->getPocResetInfoPresentFlag()) 2212 { 2213 shExtnLengthInBit += 2; 2214 } 2215 if (slice->getPocResetIdc() > 0) 2216 { 2217 shExtnLengthInBit += 6; 2218 } 2219 if (slice->getPocResetIdc() == 3) 2220 { 2221 shExtnLengthInBit += (slice->getSPS()->getBitsForPOC() + 1); 2222 } 2223 2224 2225 if( !slice->getPocMsbValRequiredFlag() /* && vps_poc_lsb_aligned_flag */ ) 2226 { 2227 shExtnLengthInBit++; 2228 } 2229 else 2230 { 2231 if( slice->getPocMsbValRequiredFlag() ) 2232 { 2233 slice->setPocMsbValPresentFlag( true ); 2234 } 2235 else 2236 { 2237 slice->setPocMsbValPresentFlag( false ); 2238 } 2239 } 2240 2241 if( slice->getPocMsbValPresentFlag() ) 2242 { 2243 UInt lengthVal = 1; 2244 UInt tempVal = slice->getPocMsbVal() + 1; 2245 assert ( tempVal ); 2246 while( 1 != tempVal ) 2247 { 2248 tempVal >>= 1; 2249 lengthVal += 2; 2250 } 2251 shExtnLengthInBit += lengthVal; 2252 } 2253 Int shExtnAdditionalBits = 0; 2254 if(shExtnLengthInBit % 8 != 0) 2255 { 2256 shExtnAdditionalBits = 8 - (shExtnLengthInBit % 8); 2257 } 2258 Int shExtnLength = (shExtnLengthInBit + shExtnAdditionalBits) / 8; 2259 WRITE_UVLC( shExtnLength, "slice_header_extension_length" ); 2260 2261 if(slice->getPPS()->getPocResetInfoPresentFlag()) 2262 { 2263 WRITE_CODE( slice->getPocResetIdc(), 2, "poc_reset_idc"); 2264 } 2265 if(slice->getPocResetIdc() > 0) 2266 { 2267 WRITE_CODE( slice->getPocResetPeriodId(), 6, "poc_reset_period_id"); 2268 } 2269 if(slice->getPocResetIdc() == 3) 2270 { 2271 WRITE_FLAG( slice->getFullPocResetFlag() ? 1 : 0, "full_poc_reset_flag"); 2272 WRITE_CODE( slice->getPocLsbVal(), slice->getSPS()->getBitsForPOC(), "poc_lsb_val"); 2273 } 2274 2275 if( !slice->getPocMsbValRequiredFlag() /* && vps_poc_lsb_aligned_flag */ ) 2276 { 2277 WRITE_FLAG( slice->getPocMsbValPresentFlag(), "poc_msb_val_present_flag" ); 2278 } 2279 if( slice->getPocMsbValPresentFlag() ) 2280 { 2281 WRITE_UVLC( slice->getPocMsbVal(), "poc_msb_val" ); 2282 } 2283 for (Int i = 0; i < shExtnAdditionalBits; i++) 2284 { 2285 WRITE_FLAG( 1, "slice_segment_header_extension_reserved_bit"); 2286 } 2287 } 2288 shBitsWrittenTillNow += ( getNumberOfWrittenBits() - tmpBitsBeforeWriting ); 2289 2290 // Slice header byte_alignment() included in xAttachSliceDataToNalUnit 2291 } 2292 #endif 2293 2027 2294 Void TEncCavlc::codeTerminatingBit ( UInt uilsLast ) 2028 2295 { -
trunk/source/Lib/TLibEncoder/TEncCavlc.h
r595 r644 96 96 Void codeHrdParameters ( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 ); 97 97 Void codeTilesWPPEntryPoint( TComSlice* pSlice ); 98 #if POC_RESET_IDC_SIGNALLING 99 Void codeSliceHeaderExtn( TComSlice* slice, Int shBitsWrittenTillNow ); 100 #endif 98 101 Void codeTerminatingBit ( UInt uilsLast ); 99 102 Void codeSliceFinish (); 100 103 101 104 Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ); 105 #if SVC_EXTENSION 106 Void codeSAOBlkParam(SAOBlkParam& saoBlkParam, UInt* saoMaxOffsetQVal, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail, Bool onlyEstMergeInfo = false){printf("only supported in CABAC"); assert(0); exit(-1);} 107 #else 102 108 Void codeSAOBlkParam(SAOBlkParam& saoBlkParam, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail, Bool onlyEstMergeInfo = false){printf("only supported in CABAC"); assert(0); exit(-1);} 109 #endif 103 110 Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ); 104 111 Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); -
trunk/source/Lib/TLibEncoder/TEncCfg.h
r595 r644 386 386 387 387 Window &getConformanceWindow() { return m_conformanceWindow; } 388 #if P0312_VERT_PHASE_ADJ 389 Void setConformanceWindow (Int confLeft, Int confRight, Int confTop, Int confBottom ) { m_conformanceWindow.setWindow (confLeft, confRight, confTop, confBottom, false); } 390 #else 388 391 Void setConformanceWindow (Int confLeft, Int confRight, Int confTop, Int confBottom ) { m_conformanceWindow.setWindow (confLeft, confRight, confTop, confBottom); } 392 #endif 389 393 390 394 Void setFramesToBeEncoded ( Int i ) { m_framesToBeEncoded = i; } -
trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
r595 r644 60 60 } 61 61 62 #if POC_RESET_IDC_SIGNALLING 63 Void TEncEntropy::encodeSliceHeaderExtn( TComSlice* pSlice, Int shBitsWrittenTillNow ) 64 { 65 m_pcEntropyCoderIf->codeSliceHeaderExtn( pSlice, shBitsWrittenTillNow ); 66 } 67 #endif 68 62 69 Void TEncEntropy::encodeTerminatingBit ( UInt uiIsLast ) 63 70 { -
trunk/source/Lib/TLibEncoder/TEncEntropy.h
r595 r644 74 74 75 75 virtual Void codeTilesWPPEntryPoint ( TComSlice* pSlice ) = 0; 76 #if POC_RESET_IDC_SIGNALLING 77 virtual Void codeSliceHeaderExtn ( TComSlice* pSlice, Int shBitsWrittenTillNow ) = 0; 78 #endif 76 79 virtual Void codeTerminatingBit ( UInt uilsLast ) = 0; 77 80 virtual Void codeSliceFinish () = 0; … … 105 108 virtual Void codeCoeffNxN ( TComDataCU* pcCU, TCoeff* pcCoef, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt uiDepth, TextType eTType ) = 0; 106 109 virtual Void codeTransformSkipFlags ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt width, UInt height, TextType eTType ) = 0; 110 #if SVC_EXTENSION 111 virtual Void codeSAOBlkParam(SAOBlkParam& saoBlkParam, UInt* saoMaxOffsetQVal, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail, Bool onlyEstMergeInfo = false) =0; 112 #else 107 113 virtual Void codeSAOBlkParam(SAOBlkParam& saoBlkParam, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail, Bool onlyEstMergeInfo = false) =0; 114 #endif 108 115 virtual Void estBit (estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, TextType eTType) = 0; 109 116 … … 138 145 Void encodeSliceHeader ( TComSlice* pcSlice ); 139 146 Void encodeTilesWPPEntryPoint( TComSlice* pSlice ); 147 #if POC_RESET_IDC_SIGNALLING 148 Void encodeSliceHeaderExtn( TComSlice* pSlice, Int shBitsWrittenTillNow ); 149 #endif 140 150 Void encodeTerminatingBit ( UInt uiIsLast ); 141 151 Void encodeSliceFinish (); … … 184 194 185 195 Void estimateBit ( estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, TextType eTType); 196 #if SVC_EXTENSION 197 Void encodeSAOBlkParam(SAOBlkParam& saoBlkParam, UInt* saoMaxOffsetQVal, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail){m_pcEntropyCoderIf->codeSAOBlkParam(saoBlkParam, saoMaxOffsetQVal, sliceEnabled, leftMergeAvail, aboveMergeAvail, false);} 198 #else 186 199 Void encodeSAOBlkParam(SAOBlkParam& saoBlkParam, Bool* sliceEnabled, Bool leftMergeAvail, Bool aboveMergeAvail){m_pcEntropyCoderIf->codeSAOBlkParam(saoBlkParam, sliceEnabled, leftMergeAvail, aboveMergeAvail, false);} 200 #endif 187 201 static Int countNonZeroCoeffs( TCoeff* pcCoef, UInt uiSize ); 188 202 -
trunk/source/Lib/TLibEncoder/TEncGOP.cpp
r595 r644 303 303 //nalu = NALUnit(NAL_UNIT_SEI); 304 304 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 305 #if O0164_MULTI_LAYER_HRD 306 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps); 307 #else 305 308 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps); 309 #endif 306 310 writeRBSPTrailingBits(nalu.m_Bitstream); 307 311 accessUnit.push_back(new NALUnitEBSP(nalu)); … … 316 320 nalu = NALUnit(NAL_UNIT_PREFIX_SEI); 317 321 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 322 #if O0164_MULTI_LAYER_HRD 323 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps); 324 #else 318 325 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps); 326 #endif 319 327 writeRBSPTrailingBits(nalu.m_Bitstream); 320 328 accessUnit.push_back(new NALUnitEBSP(nalu)); … … 327 335 nalu = NALUnit(NAL_UNIT_PREFIX_SEI); 328 336 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 337 #if O0164_MULTI_LAYER_HRD 338 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps); 339 #else 329 340 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps); 341 #endif 330 342 writeRBSPTrailingBits(nalu.m_Bitstream); 331 343 accessUnit.push_back(new NALUnitEBSP(nalu)); … … 338 350 nalu = NALUnit(NAL_UNIT_PREFIX_SEI); 339 351 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 352 #if O0164_MULTI_LAYER_HRD 353 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps); 354 #else 340 355 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps); 356 #endif 341 357 writeRBSPTrailingBits(nalu.m_Bitstream); 342 358 accessUnit.push_back(new NALUnitEBSP(nalu)); … … 350 366 SEILayersNotPresent *sei = xCreateSEILayersNotPresent (); 351 367 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 368 #if O0164_MULTI_LAYER_HRD 369 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps); 370 #else 352 371 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps); 372 #endif 353 373 writeRBSPTrailingBits(nalu.m_Bitstream); 354 374 accessUnit.push_back(new NALUnitEBSP(nalu)); … … 364 384 nalu = NALUnit(NAL_UNIT_PREFIX_SEI, 0, m_pcCfg->getNumLayer()-1); // For highest layer 365 385 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 386 #if O0164_MULTI_LAYER_HRD 387 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps); 388 #else 366 389 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps); 390 #endif 367 391 writeRBSPTrailingBits(nalu.m_Bitstream); 368 392 accessUnit.push_back(new NALUnitEBSP(nalu)); … … 797 821 Window scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc); 798 822 #endif*/ 823 #if P0312_VERT_PHASE_ADJ 824 //when PhasePositionEnableFlag is equal to 1, set vertPhasePositionFlag to 0 if BL is top field and 1 if bottom 825 if( scalEL.getVertPhasePositionEnableFlag() ) 826 { 827 pcSlice->setVertPhasePositionFlag( pcSlice->getPOC()%2, refLayerIdc ); 828 } 829 #endif 799 830 #if O0215_PHASE_ALIGNMENT 800 831 #if O0194_JOINT_US_BITSHIFT … … 928 959 pcSlice->createExplicitReferencePictureSetFromReference(rcListPic, pcSlice->getRPS(), pcSlice->isIRAP()); 929 960 } 961 #if ALIGNED_BUMPING 962 pcSlice->checkLeadingPictureRestrictions(rcListPic); 963 #endif 930 964 pcSlice->applyReferencePictureSet(rcListPic, pcSlice->getRPS()); 931 965 … … 1716 1750 xCreateLeadingSEIMessages(accessUnit, pcSlice->getSPS()); 1717 1751 1752 #if O0164_MULTI_LAYER_HRD 1753 if (pcSlice->getLayerId() == 0 && m_pcEncTop->getVPS()->getVpsVuiBspHrdPresentFlag()) 1754 { 1755 nalu = NALUnit(NAL_UNIT_PREFIX_SEI, 0, 1); 1756 m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice); 1757 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 1758 SEIScalableNesting *scalableBspNestingSei = xCreateBspNestingSEI(pcSlice); 1759 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *scalableBspNestingSei, m_pcEncTop->getVPS(), pcSlice->getSPS()); 1760 writeRBSPTrailingBits(nalu.m_Bitstream); 1761 1762 UInt seiPositionInAu = xGetFirstSeiLocation(accessUnit); 1763 UInt offsetPosition = m_activeParameterSetSEIPresentInAU 1764 + m_bufferingPeriodSEIPresentInAU 1765 + m_pictureTimingSEIPresentInAU 1766 + m_nestedPictureTimingSEIPresentInAU; // Insert SEI after APS, BP and PT SEI 1767 AccessUnit::iterator it; 1768 for(j = 0, it = accessUnit.begin(); j < seiPositionInAu + offsetPosition; j++) 1769 { 1770 it++; 1771 } 1772 accessUnit.insert(it, new NALUnitEBSP(nalu)); 1773 } 1774 #endif 1775 1718 1776 m_bSeqFirst = false; 1719 1777 } … … 1750 1808 SOPDescriptionSEI.m_numPicsInSopMinus1 = i - 1; 1751 1809 1810 #if O0164_MULTI_LAYER_HRD 1811 m_seiWriter.writeSEImessage( nalu.m_Bitstream, SOPDescriptionSEI, m_pcEncTop->getVPS(), pcSlice->getSPS()); 1812 #else 1752 1813 m_seiWriter.writeSEImessage( nalu.m_Bitstream, SOPDescriptionSEI, pcSlice->getSPS()); 1814 #endif 1753 1815 writeRBSPTrailingBits(nalu.m_Bitstream); 1754 1816 accessUnit.push_back(new NALUnitEBSP(nalu)); … … 1834 1896 sei_buffering_period.m_dpbDelayOffset = 0; 1835 1897 1898 #if O0164_MULTI_LAYER_HRD 1899 m_seiWriter.writeSEImessage( nalu.m_Bitstream, sei_buffering_period, m_pcEncTop->getVPS(), pcSlice->getSPS()); 1900 #else 1836 1901 m_seiWriter.writeSEImessage( nalu.m_Bitstream, sei_buffering_period, pcSlice->getSPS()); 1902 #endif 1837 1903 writeRBSPTrailingBits(nalu.m_Bitstream); 1838 1904 { … … 1855 1921 scalableNestingSEI.m_nestedSEIs.clear(); 1856 1922 scalableNestingSEI.m_nestedSEIs.push_back(&sei_buffering_period); 1923 #if O0164_MULTI_LAYER_HRD 1924 m_seiWriter.writeSEImessage( naluTmp.m_Bitstream, scalableNestingSEI, m_pcEncTop->getVPS(), pcSlice->getSPS()); 1925 #else 1857 1926 m_seiWriter.writeSEImessage( naluTmp.m_Bitstream, scalableNestingSEI, pcSlice->getSPS()); 1927 #endif 1858 1928 writeRBSPTrailingBits(naluTmp.m_Bitstream); 1859 1929 UInt seiPositionInAu = xGetFirstSeiLocation(accessUnit); … … 1884 1954 seiGradualDecodingRefreshInfo.m_gdrForegroundFlag = true; // Indicating all "foreground" 1885 1955 1956 #if O0164_MULTI_LAYER_HRD 1957 m_seiWriter.writeSEImessage( nalu.m_Bitstream, seiGradualDecodingRefreshInfo, m_pcEncTop->getVPS(), pcSlice->getSPS() ); 1958 #else 1886 1959 m_seiWriter.writeSEImessage( nalu.m_Bitstream, seiGradualDecodingRefreshInfo, pcSlice->getSPS() ); 1960 #endif 1887 1961 writeRBSPTrailingBits(nalu.m_Bitstream); 1888 1962 accessUnit.push_back(new NALUnitEBSP(nalu)); … … 1902 1976 sei_recovery_point.m_brokenLinkFlag = false; 1903 1977 1978 #if O0164_MULTI_LAYER_HRD 1979 m_seiWriter.writeSEImessage( nalu.m_Bitstream, sei_recovery_point, m_pcEncTop->getVPS(), pcSlice->getSPS() ); 1980 #else 1904 1981 m_seiWriter.writeSEImessage( nalu.m_Bitstream, sei_recovery_point, pcSlice->getSPS() ); 1982 #endif 1905 1983 writeRBSPTrailingBits(nalu.m_Bitstream); 1906 1984 accessUnit.push_back(new NALUnitEBSP(nalu)); … … 2128 2206 m_pcEntropyCoder->setEntropyCoder ( m_pcCavlcCoder, pcSlice ); 2129 2207 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 2208 #if !POC_RESET_IDC_SIGNALLING 2130 2209 m_pcEntropyCoder->encodeTilesWPPEntryPoint( pcSlice ); 2210 #else 2211 tmpBitsBeforeWriting = m_pcEntropyCoder->getNumberOfWrittenBits(); 2212 m_pcEntropyCoder->encodeTilesWPPEntryPoint( pcSlice ); 2213 actualHeadBits += ( m_pcEntropyCoder->getNumberOfWrittenBits() - tmpBitsBeforeWriting ); 2214 m_pcEntropyCoder->encodeSliceHeaderExtn( pcSlice, actualHeadBits ); 2215 #endif 2131 2216 2132 2217 // Substreams... … … 2269 2354 /* write the SEI messages */ 2270 2355 m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice); 2356 #if O0164_MULTI_LAYER_HRD 2357 m_seiWriter.writeSEImessage(nalu.m_Bitstream, sei_recon_picture_digest, m_pcEncTop->getVPS(), pcSlice->getSPS()); 2358 #else 2271 2359 m_seiWriter.writeSEImessage(nalu.m_Bitstream, sei_recon_picture_digest, pcSlice->getSPS()); 2360 #endif 2272 2361 writeRBSPTrailingBits(nalu.m_Bitstream); 2273 2362 … … 2293 2382 /* write the SEI messages */ 2294 2383 m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice); 2384 #if O0164_MULTI_LAYER_HRD 2385 m_seiWriter.writeSEImessage(nalu.m_Bitstream, sei_temporal_level0_index, m_pcEncTop->getVPS(), pcSlice->getSPS()); 2386 #else 2295 2387 m_seiWriter.writeSEImessage(nalu.m_Bitstream, sei_temporal_level0_index, pcSlice->getSPS()); 2388 #endif 2296 2389 writeRBSPTrailingBits(nalu.m_Bitstream); 2297 2390 … … 2443 2536 m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice); 2444 2537 pictureTimingSEI.m_picStruct = (isField && pcSlice->getPic()->isTopField())? 1 : isField? 2 : 0; 2538 #if O0164_MULTI_LAYER_HRD 2539 m_seiWriter.writeSEImessage(nalu.m_Bitstream, pictureTimingSEI, m_pcEncTop->getVPS(), pcSlice->getSPS()); 2540 #else 2445 2541 m_seiWriter.writeSEImessage(nalu.m_Bitstream, pictureTimingSEI, pcSlice->getSPS()); 2542 #endif 2446 2543 writeRBSPTrailingBits(nalu.m_Bitstream); 2447 2544 UInt seiPositionInAu = xGetFirstSeiLocation(accessUnit); … … 2462 2559 scalableNestingSEI.m_nestedSEIs.clear(); 2463 2560 scalableNestingSEI.m_nestedSEIs.push_back(&pictureTimingSEI); 2561 #if O0164_MULTI_LAYER_HRD 2562 m_seiWriter.writeSEImessage(nalu.m_Bitstream, scalableNestingSEI, m_pcEncTop->getVPS(), pcSlice->getSPS()); 2563 #else 2464 2564 m_seiWriter.writeSEImessage(nalu.m_Bitstream, scalableNestingSEI, pcSlice->getSPS()); 2565 #endif 2465 2566 writeRBSPTrailingBits(nalu.m_Bitstream); 2466 2567 UInt seiPositionInAu = xGetFirstSeiLocation(accessUnit); … … 2494 2595 { 2495 2596 // Insert before the first slice. 2597 #if O0164_MULTI_LAYER_HRD 2598 m_seiWriter.writeSEImessage(nalu.m_Bitstream, tempSEI, m_pcEncTop->getVPS(), pcSlice->getSPS()); 2599 #else 2496 2600 m_seiWriter.writeSEImessage(nalu.m_Bitstream, tempSEI, pcSlice->getSPS()); 2601 #endif 2497 2602 writeRBSPTrailingBits(nalu.m_Bitstream); 2498 2603 … … 2516 2621 { 2517 2622 // Insert before the first slice. 2623 #if O0164_MULTI_LAYER_HRD 2624 m_seiWriter.writeSEImessage(nalu.m_Bitstream, tempSEI, m_pcEncTop->getVPS(), pcSlice->getSPS()); 2625 #else 2518 2626 m_seiWriter.writeSEImessage(nalu.m_Bitstream, tempSEI, pcSlice->getSPS()); 2627 #endif 2519 2628 writeRBSPTrailingBits(nalu.m_Bitstream); 2520 2629 … … 3652 3761 } 3653 3762 #endif 3763 3764 #if O0164_MULTI_LAYER_HRD 3765 SEIScalableNesting* TEncGOP::xCreateBspNestingSEI(TComSlice *pcSlice) 3766 { 3767 SEIScalableNesting *seiScalableNesting = new SEIScalableNesting(); 3768 SEIBspInitialArrivalTime *seiBspInitialArrivalTime = new SEIBspInitialArrivalTime(); 3769 SEIBspNesting *seiBspNesting = new SEIBspNesting(); 3770 SEIBufferingPeriod *seiBufferingPeriod = new SEIBufferingPeriod(); 3771 3772 // Scalable nesting SEI 3773 3774 seiScalableNesting->m_bitStreamSubsetFlag = 1; // If the nested SEI messages are picture buffereing SEI mesages, picure timing SEI messages or sub-picture timing SEI messages, bitstream_subset_flag shall be equal to 1 3775 seiScalableNesting->m_nestingOpFlag = 1; 3776 seiScalableNesting->m_defaultOpFlag = 0; 3777 seiScalableNesting->m_nestingNumOpsMinus1 = 0; //nesting_num_ops_minus1 3778 seiScalableNesting->m_nestingOpIdx[0] = 1; 3779 seiScalableNesting->m_allLayersFlag = 0; 3780 seiScalableNesting->m_nestingNoOpMaxTemporalIdPlus1 = 6 + 1; //nesting_no_op_max_temporal_id_plus1 3781 seiScalableNesting->m_nestingNumLayersMinus1 = 1 - 1; //nesting_num_layers_minus1 3782 seiScalableNesting->m_nestingLayerId[0] = 0; 3783 seiScalableNesting->m_callerOwnsSEIs = true; 3784 3785 // Bitstream partition nesting SEI 3786 3787 seiBspNesting->m_bspIdx = 0; 3788 seiBspNesting->m_callerOwnsSEIs = true; 3789 3790 // Buffering period SEI 3791 3792 UInt uiInitialCpbRemovalDelay = (90000/2); // 0.5 sec 3793 seiBufferingPeriod->m_initialCpbRemovalDelay [0][0] = uiInitialCpbRemovalDelay; 3794 seiBufferingPeriod->m_initialCpbRemovalDelayOffset[0][0] = uiInitialCpbRemovalDelay; 3795 seiBufferingPeriod->m_initialCpbRemovalDelay [0][1] = uiInitialCpbRemovalDelay; 3796 seiBufferingPeriod->m_initialCpbRemovalDelayOffset[0][1] = uiInitialCpbRemovalDelay; 3797 3798 Double dTmp = (Double)pcSlice->getSPS()->getVuiParameters()->getTimingInfo()->getNumUnitsInTick() / (Double)pcSlice->getSPS()->getVuiParameters()->getTimingInfo()->getTimeScale(); 3799 3800 UInt uiTmp = (UInt)( dTmp * 90000.0 ); 3801 uiInitialCpbRemovalDelay -= uiTmp; 3802 uiInitialCpbRemovalDelay -= uiTmp / ( pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getTickDivisorMinus2() + 2 ); 3803 seiBufferingPeriod->m_initialAltCpbRemovalDelay [0][0] = uiInitialCpbRemovalDelay; 3804 seiBufferingPeriod->m_initialAltCpbRemovalDelayOffset[0][0] = uiInitialCpbRemovalDelay; 3805 seiBufferingPeriod->m_initialAltCpbRemovalDelay [0][1] = uiInitialCpbRemovalDelay; 3806 seiBufferingPeriod->m_initialAltCpbRemovalDelayOffset[0][1] = uiInitialCpbRemovalDelay; 3807 3808 seiBufferingPeriod->m_rapCpbParamsPresentFlag = 0; 3809 //for the concatenation, it can be set to one during splicing. 3810 seiBufferingPeriod->m_concatenationFlag = 0; 3811 //since the temporal layer HRD is not ready, we assumed it is fixed 3812 seiBufferingPeriod->m_auCpbRemovalDelayDelta = 1; 3813 seiBufferingPeriod->m_cpbDelayOffset = 0; 3814 seiBufferingPeriod->m_dpbDelayOffset = 0; 3815 3816 // Intial arrival time SEI message 3817 3818 seiBspInitialArrivalTime->m_nalInitialArrivalDelay[0] = 0; 3819 seiBspInitialArrivalTime->m_vclInitialArrivalDelay[0] = 0; 3820 3821 3822 seiBspNesting->m_nestedSEIs.push_back(seiBufferingPeriod); 3823 seiBspNesting->m_nestedSEIs.push_back(seiBspInitialArrivalTime); 3824 seiScalableNesting->m_nestedSEIs.push_back(seiBspNesting); // BSP nesting SEI is contained in scalable nesting SEI 3825 3826 return seiScalableNesting; 3827 } 3828 #endif 3829 3654 3830 #endif //SVC_EXTENSION 3655 3831 -
trunk/source/Lib/TLibEncoder/TEncGOP.h
r595 r644 211 211 SEIInterLayerConstrainedTileSets* xCreateSEIInterLayerConstrainedTileSets(); 212 212 #endif 213 #if O0164_MULTI_LAYER_HRD 214 SEIScalableNesting* xCreateBspNestingSEI(TComSlice *pcSlice); 215 #endif 213 216 #endif //SVC_EXTENSION 214 217 };// END CLASS DEFINITION TEncGOP -
trunk/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp
r595 r644 463 463 Int bitDepth = (compIdx== SAO_Y) ? g_bitDepthY : g_bitDepthC; 464 464 Int shift = 2 * DISTORTION_PRECISION_ADJUSTMENT(bitDepth-8); 465 #if SVC_EXTENSION 466 Int offsetTh = getSaoMaxOffsetQVal()[compIdx]; //inclusive 467 #else 465 468 Int offsetTh = g_saoMaxOffsetQVal[compIdx]; //inclusive 469 #endif 466 470 467 471 ::memset(quantOffsets, 0, sizeof(Int)*MAX_NUM_SAO_CLASSES); … … 582 586 modeParam[SAO_Y ].modeIdc = SAO_MODE_OFF; 583 587 m_pcRDGoOnSbacCoder->load(cabacCoderRDO[inCabacLabel]); 588 #if SVC_EXTENSION 589 m_pcRDGoOnSbacCoder->codeSAOBlkParam(modeParam, getSaoMaxOffsetQVal(), sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), true); 590 #else 584 591 m_pcRDGoOnSbacCoder->codeSAOBlkParam(modeParam, sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), true); 592 #endif 585 593 m_pcRDGoOnSbacCoder->store(cabacCoderRDO[SAO_CABACSTATE_BLK_MID]); 586 594 … … 590 598 modeParam[compIdx].modeIdc = SAO_MODE_OFF; 591 599 m_pcRDGoOnSbacCoder->resetBits(); 600 #if SVC_EXTENSION 601 m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, modeParam[compIdx], sliceEnabled[compIdx], getSaoMaxOffsetQVal()); 602 #else 592 603 m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, modeParam[compIdx], sliceEnabled[compIdx]); 604 #endif 593 605 modeDist[compIdx] = 0; 594 606 minCost= m_lambda[compIdx]*((Double)m_pcRDGoOnSbacCoder->getNumberOfWrittenBits()); … … 613 625 m_pcRDGoOnSbacCoder->load(cabacCoderRDO[SAO_CABACSTATE_BLK_MID]); 614 626 m_pcRDGoOnSbacCoder->resetBits(); 627 #if SVC_EXTENSION 628 m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, testOffset[compIdx], sliceEnabled[compIdx], getSaoMaxOffsetQVal()); 629 #else 615 630 m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, testOffset[compIdx], sliceEnabled[compIdx]); 631 #endif 616 632 rate = m_pcRDGoOnSbacCoder->getNumberOfWrittenBits(); 617 633 cost = (Double)dist[compIdx] + m_lambda[compIdx]*((Double)rate); … … 638 654 modeDist [component] = 0; 639 655 656 #if SVC_EXTENSION 657 m_pcRDGoOnSbacCoder->codeSAOOffsetParam(component, modeParam[component], sliceEnabled[component], getSaoMaxOffsetQVal()); 658 #else 640 659 m_pcRDGoOnSbacCoder->codeSAOOffsetParam(component, modeParam[component], sliceEnabled[component]); 660 #endif 641 661 642 662 const UInt currentWrittenBits = m_pcRDGoOnSbacCoder->getNumberOfWrittenBits(); … … 672 692 dist[compIdx]= getDistortion(ctu, compIdx, typeIdc, testOffset[compIdx].typeAuxInfo, invQuantOffset, blkStats[ctu][compIdx][typeIdc]); 673 693 694 #if SVC_EXTENSION 695 m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, testOffset[compIdx], sliceEnabled[compIdx], getSaoMaxOffsetQVal()); 696 #else 674 697 m_pcRDGoOnSbacCoder->codeSAOOffsetParam(compIdx, testOffset[compIdx], sliceEnabled[compIdx]); 698 #endif 675 699 676 700 const UInt currentWrittenBits = m_pcRDGoOnSbacCoder->getNumberOfWrittenBits(); … … 699 723 m_pcRDGoOnSbacCoder->load(cabacCoderRDO[inCabacLabel]); 700 724 m_pcRDGoOnSbacCoder->resetBits(); 725 #if SVC_EXTENSION 726 m_pcRDGoOnSbacCoder->codeSAOBlkParam(modeParam, getSaoMaxOffsetQVal(), sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), false); 727 #else 701 728 m_pcRDGoOnSbacCoder->codeSAOBlkParam(modeParam, sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), false); 729 #endif 702 730 modeNormCost += (Double)m_pcRDGoOnSbacCoder->getNumberOfWrittenBits(); 703 731 … … 742 770 m_pcRDGoOnSbacCoder->load(cabacCoderRDO[inCabacLabel]); 743 771 m_pcRDGoOnSbacCoder->resetBits(); 772 #if SVC_EXTENSION 773 m_pcRDGoOnSbacCoder->codeSAOBlkParam(testBlkParam, getSaoMaxOffsetQVal(), sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), false); 774 #else 744 775 m_pcRDGoOnSbacCoder->codeSAOBlkParam(testBlkParam, sliceEnabled, (mergeList[SAO_MERGE_LEFT]!= NULL), (mergeList[SAO_MERGE_ABOVE]!= NULL), false); 776 #endif 745 777 Int rate = m_pcRDGoOnSbacCoder->getNumberOfWrittenBits(); 746 778 -
trunk/source/Lib/TLibEncoder/TEncSbac.cpp
r595 r644 266 266 } 267 267 268 #if POC_RESET_IDC_SIGNALLING 269 Void TEncSbac::codeSliceHeaderExtn( TComSlice* pSlice, Int shBitsWrittenTillNow ) 270 { 271 assert (0); 272 return; 273 } 274 #endif 268 275 Void TEncSbac::codeTerminatingBit( UInt uilsLast ) 269 276 { … … 1592 1599 } 1593 1600 1601 #if SVC_EXTENSION 1602 Void TEncSbac::codeSAOOffsetParam(Int compIdx, SAOOffset& ctbParam, Bool sliceEnabled, UInt* saoMaxOffsetQVal) 1603 #else 1594 1604 Void TEncSbac::codeSAOOffsetParam(Int compIdx, SAOOffset& ctbParam, Bool sliceEnabled) 1605 #endif 1595 1606 { 1596 1607 UInt uiSymbol; … … 1639 1650 for(Int i=0; i< 4; i++) 1640 1651 { 1652 #if SVC_EXTENSION 1653 codeSaoMaxUvlc((offset[i]<0)?(-offset[i]):(offset[i]), saoMaxOffsetQVal[compIdx] ); //sao_offset_abs 1654 #else 1641 1655 codeSaoMaxUvlc((offset[i]<0)?(-offset[i]):(offset[i]), g_saoMaxOffsetQVal[compIdx] ); //sao_offset_abs 1656 #endif 1642 1657 } 1643 1658 … … 1669 1684 1670 1685 Void TEncSbac::codeSAOBlkParam(SAOBlkParam& saoBlkParam 1686 #if SVC_EXTENSION 1687 , UInt* saoMaxOffsetQVal 1688 #endif 1671 1689 , Bool* sliceEnabled 1672 1690 , Bool leftMergeAvail … … 1700 1718 for(Int compIdx=0; compIdx < NUM_SAO_COMPONENTS; compIdx++) 1701 1719 { 1720 #if SVC_EXTENSION 1721 codeSAOOffsetParam(compIdx, saoBlkParam[compIdx], sliceEnabled[compIdx], saoMaxOffsetQVal); 1722 #else 1702 1723 codeSAOOffsetParam(compIdx, saoBlkParam[compIdx], sliceEnabled[compIdx]); 1724 #endif 1703 1725 } 1704 1726 } -
trunk/source/Lib/TLibEncoder/TEncSbac.h
r595 r644 95 95 Void codeSliceHeader ( TComSlice* pcSlice ); 96 96 Void codeTilesWPPEntryPoint( TComSlice* pSlice ); 97 #if POC_RESET_IDC_SIGNALLING 98 Void codeSliceHeaderExtn ( TComSlice* pSlice, Int shBitsWrittenTillNow ); 99 #endif 97 100 Void codeTerminatingBit ( UInt uilsLast ); 98 101 Void codeSliceFinish (); … … 104 107 Void codeScalingList ( TComScalingList* /*scalingList*/ ){ assert (0); return;}; 105 108 109 #if SVC_EXTENSION 110 Void codeSAOOffsetParam(Int compIdx, SAOOffset& ctbParam, Bool sliceEnabled, UInt* saoMaxOffsetQVal); 111 Void codeSAOBlkParam(SAOBlkParam& saoBlkParam 112 , UInt* saoMaxOffsetQVal 113 , Bool* sliceEnabled 114 , Bool leftMergeAvail 115 , Bool aboveMergeAvail 116 , Bool onlyEstMergeInfo = false 117 ); 118 #else 106 119 Void codeSAOOffsetParam(Int compIdx, SAOOffset& ctbParam, Bool sliceEnabled); 107 120 Void codeSAOBlkParam(SAOBlkParam& saoBlkParam … … 111 124 , Bool onlyEstMergeInfo = false 112 125 ); 126 #endif 113 127 114 128 private: -
trunk/source/Lib/TLibEncoder/TEncSlice.cpp
r595 r644 1356 1356 } 1357 1357 1358 #if SVC_EXTENSION 1359 m_pcEntropyCoder->encodeSAOBlkParam(saoblkParam, m_ppcTEncTop[pcSlice->getLayerId()]->getSAO()->getSaoMaxOffsetQVal(), sliceEnabled, leftMergeAvail, aboveMergeAvail); 1360 #else 1358 1361 m_pcEntropyCoder->encodeSAOBlkParam(saoblkParam,sliceEnabled, leftMergeAvail, aboveMergeAvail); 1362 #endif 1359 1363 } 1360 1364 } -
trunk/source/Lib/TLibEncoder/TEncTop.cpp
r595 r644 791 791 TEncTop *pcEncTopBase = (TEncTop *)getLayerEnc( m_layerId-1 ); 792 792 #endif 793 #if O0194_DIFFERENT_BITDEPTH_EL_BL 794 UInt refLayerId = m_cVPS.getRefLayerId(m_layerId, i); 795 Bool sameBitDepths = ( g_bitDepthYLayer[m_layerId] == g_bitDepthYLayer[refLayerId] ) && ( g_bitDepthCLayer[m_layerId] == g_bitDepthCLayer[refLayerId] ); 796 797 if( m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets || !sameBitDepths ) 798 #else 793 799 if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets ) 800 #endif 794 801 { 795 802 pcEPic->setSpatialEnhLayerFlag( i, true ); … … 846 853 TEncTop *pcEncTopBase = (TEncTop *)getLayerEnc( m_layerId-1 ); 847 854 #endif 855 #if O0194_DIFFERENT_BITDEPTH_EL_BL 856 UInt refLayerId = m_cVPS.getRefLayerId(m_layerId, i); 857 Bool sameBitDepths = ( g_bitDepthYLayer[m_layerId] == g_bitDepthYLayer[refLayerId] ) && ( g_bitDepthCLayer[m_layerId] == g_bitDepthCLayer[refLayerId] ); 858 859 if( m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets || !sameBitDepths ) 860 #else 848 861 if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets ) 862 #endif 849 863 { 850 864 rpcPic->setSpatialEnhLayerFlag( i, true ); … … 902 916 #endif 903 917 m_cSPS.getScaledRefLayerWindow(i) = m_scaledRefLayerWindow[i]; 918 #if P0312_VERT_PHASE_ADJ 919 m_cSPS.setVertPhasePositionEnableFlag( m_scaledRefLayerId[i], m_scaledRefLayerWindow[i].getVertPhasePositionEnableFlag() ); 920 #endif 904 921 } 905 922 #endif //SVC_EXTENSION -
trunk/source/Lib/TLibEncoder/TEncTop.h
r595 r644 139 139 #endif 140 140 Window m_scaledRefLayerWindow[MAX_LAYERS]; 141 #if P0312_VERT_PHASE_ADJ 142 Bool m_vertPhasePositionEnableFlag[MAX_LAYERS]; 143 #endif 141 144 #if POC_RESET_FLAG 142 145 Int m_pocAdjustmentValue; … … 213 216 /// encode several number of pictures until end-of-sequence 214 217 #if SVC_EXTENSION 215 Void setLayerEnc(TEncTop** p) {m_ppcTEncTop = p;}216 TEncTop** getLayerEnc() {return m_ppcTEncTop;}217 Int getPOCLast () { return m_iPOCLast;}218 Int getNumPicRcvd () { return m_iNumPicRcvd;}219 Void setNumPicRcvd ( Int num ) { m_iNumPicRcvd = num;}220 Void setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x;}221 UInt getNumScaledRefLayerOffsets(){ return m_numScaledRefLayerOffsets; }218 Void setLayerEnc(TEncTop** p) { m_ppcTEncTop = p; } 219 TEncTop** getLayerEnc() { return m_ppcTEncTop; } 220 Int getPOCLast () { return m_iPOCLast; } 221 Int getNumPicRcvd () { return m_iNumPicRcvd; } 222 Void setNumPicRcvd ( Int num ) { m_iNumPicRcvd = num; } 223 Void setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; } 224 UInt getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; } 222 225 #if O0098_SCALED_REF_LAYER_ID 223 Void setScaledRefLayerId(Int x, UInt id) { m_scaledRefLayerId[x] = id; } 224 UInt getScaledRefLayerId(Int x) { return m_scaledRefLayerId[x]; } 225 Window& getScaledRefLayerWindowForLayer(Int layerId); 226 #endif 227 Window& getScaledRefLayerWindow(Int x) { return m_scaledRefLayerWindow[x]; } 226 Void setScaledRefLayerId(Int x, UInt id) { m_scaledRefLayerId[x] = id; } 227 UInt getScaledRefLayerId(Int x) { return m_scaledRefLayerId[x]; } 228 Window& getScaledRefLayerWindowForLayer(Int layerId); 229 #endif 230 Window& getScaledRefLayerWindow(Int x) { return m_scaledRefLayerWindow[x]; } 231 #if P0312_VERT_PHASE_ADJ 232 Void setVertPhasePositionEnableFlag(Int x, Bool b) { m_vertPhasePositionEnableFlag[x] = b; } 233 UInt getVertPhasePositionEnableFlag(Int x) { return m_vertPhasePositionEnableFlag[x]; } 234 #endif 235 228 236 TComPic** getIlpList() { return m_cIlpPic; } 229 237 #if REF_IDX_MFM 230 Void setMFMEnabledFlag (Bool flag) { m_bMFMEnabledFlag = flag;}231 Bool getMFMEnabledFlag() { return m_bMFMEnabledFlag;}238 Void setMFMEnabledFlag (Bool flag) { m_bMFMEnabledFlag = flag; } 239 Bool getMFMEnabledFlag() { return m_bMFMEnabledFlag; } 232 240 #endif 233 241 #if O0194_WEIGHTED_PREDICTION_CGS … … 247 255 #endif 248 256 #if POC_RESET_FLAG 249 Int getPocAdjustmentValue() { return m_pocAdjustmentValue;}250 Void setPocAdjustmentValue(Int x) { m_pocAdjustmentValue = x; }257 Int getPocAdjustmentValue() { return m_pocAdjustmentValue;} 258 Void setPocAdjustmentValue(Int x) { m_pocAdjustmentValue = x; } 251 259 #endif 252 260 #if NO_CLRAS_OUTPUT_FLAG
Note: See TracChangeset for help on using the changeset viewer.