Changeset 367 in 3DVCSoftware for branches/HTM-DEV-0.1-dev/source/Lib
- Timestamp:
- 3 May 2013, 17:09:57 (12 years ago)
- Location:
- branches/HTM-DEV-0.1-dev/source/Lib
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.1-dev/source/Lib/TAppCommon/program_options_lite.h
r365 r367 37 37 #include <map> 38 38 39 #if H_MV40 #include <vector>41 #include <errno.h>42 #include <cstring>43 44 #ifdef WIN3245 #define strdup _strdup46 #endif47 #endif48 39 //! \ingroup TAppCommon 49 40 //! \{ … … 145 136 } 146 137 147 #if H_MV148 template<>149 inline void150 Option<char*>::parse(const std::string& arg)151 {152 opt_storage = arg.empty() ? NULL : strdup(arg.c_str()) ;153 }154 155 template<>156 inline void157 Option< std::vector<char*> >::parse(const std::string& arg)158 {159 opt_storage.clear();160 161 char* pcStart = (char*) arg.data();162 char* pcEnd = strtok (pcStart," ");163 164 while (pcEnd != NULL)165 {166 size_t uiStringLength = pcEnd - pcStart;167 char* pcNewStr = (char*) malloc( uiStringLength + 1 );168 strncpy( pcNewStr, pcStart, uiStringLength);169 pcNewStr[uiStringLength] = '\0';170 pcStart = pcEnd+1;171 pcEnd = strtok (NULL, " ,.-");172 opt_storage.push_back( pcNewStr );173 }174 }175 176 177 template<>178 inline void179 Option< std::vector<double> >::parse(const std::string& arg)180 {181 char* pcNextStart = (char*) arg.data();182 char* pcEnd = pcNextStart + arg.length();183 184 char* pcOldStart = 0;185 186 size_t iIdx = 0;187 188 while (pcNextStart < pcEnd)189 {190 errno = 0;191 192 if ( iIdx < opt_storage.size() )193 {194 opt_storage[iIdx] = strtod(pcNextStart, &pcNextStart);195 }196 else197 {198 opt_storage.push_back( strtod(pcNextStart, &pcNextStart)) ;199 }200 iIdx++;201 202 if ( errno == ERANGE || (pcNextStart == pcOldStart) )203 {204 std::cerr << "Error Parsing Doubles: `" << arg << "'" << std::endl;205 exit(EXIT_FAILURE);206 };207 while( (pcNextStart < pcEnd) && ( *pcNextStart == ' ' || *pcNextStart == '\t' || *pcNextStart == '\r' ) ) pcNextStart++;208 pcOldStart = pcNextStart;209 210 }211 }212 213 template<>214 inline void215 Option< std::vector<int> >::parse(const std::string& arg)216 {217 opt_storage.clear();218 219 220 char* pcNextStart = (char*) arg.data();221 char* pcEnd = pcNextStart + arg.length();222 223 char* pcOldStart = 0;224 225 size_t iIdx = 0;226 227 228 while (pcNextStart < pcEnd)229 {230 231 if ( iIdx < opt_storage.size() )232 {233 opt_storage[iIdx] = (int) strtol(pcNextStart, &pcNextStart,10);234 }235 else236 {237 opt_storage.push_back( (int) strtol(pcNextStart, &pcNextStart,10)) ;238 }239 iIdx++;240 if ( errno == ERANGE || (pcNextStart == pcOldStart) )241 {242 std::cerr << "Error Parsing Integers: `" << arg << "'" << std::endl;243 exit(EXIT_FAILURE);244 };245 while( (pcNextStart < pcEnd) && ( *pcNextStart == ' ' || *pcNextStart == '\t' || *pcNextStart == '\r' ) ) pcNextStart++;246 pcOldStart = pcNextStart;247 }248 }249 250 251 template<>252 inline void253 Option< std::vector<bool> >::parse(const std::string& arg)254 {255 char* pcNextStart = (char*) arg.data();256 char* pcEnd = pcNextStart + arg.length();257 258 char* pcOldStart = 0;259 260 size_t iIdx = 0;261 262 while (pcNextStart < pcEnd)263 {264 if ( iIdx < opt_storage.size() )265 {266 opt_storage[iIdx] = (strtol(pcNextStart, &pcNextStart,10) != 0);267 }268 else269 {270 opt_storage.push_back(strtol(pcNextStart, &pcNextStart,10) != 0) ;271 }272 iIdx++;273 274 if ( errno == ERANGE || (pcNextStart == pcOldStart) )275 {276 std::cerr << "Error Parsing Bools: `" << arg << "'" << std::endl;277 exit(EXIT_FAILURE);278 };279 while( (pcNextStart < pcEnd) && ( *pcNextStart == ' ' || *pcNextStart == '\t' || *pcNextStart == '\r' ) ) pcNextStart++;280 pcOldStart = pcNextStart;281 }282 }283 #endif284 138 /** Option class for argument handling using a user provided function */ 285 139 struct OptionFunc : public OptionBase … … 356 210 } 357 211 358 #if H_MV359 template<typename T>360 OptionSpecific&361 operator()(const std::string& name, std::vector<T>& storage, T default_val, unsigned uiMaxNum, const std::string& desc = "" )362 {363 std::string cNameBuffer;364 std::string cDescriptionBuffer;365 366 cNameBuffer .resize( name.size() + 10 );367 cDescriptionBuffer.resize( desc.size() + 10 );368 369 storage.resize(uiMaxNum);370 for ( unsigned int uiK = 0; uiK < uiMaxNum; uiK++ )371 {372 // isn't there are sprintf function for string??373 sprintf((char*) cNameBuffer.c_str() ,name.c_str(),uiK,uiK);374 sprintf((char*) cDescriptionBuffer.c_str(),desc.c_str(),uiK,uiK);375 376 parent.addOption(new Option<T>( cNameBuffer, (storage[uiK]), default_val, cDescriptionBuffer ));377 }378 379 return *this;380 }381 #endif382 212 /** 383 213 * Add option described by name to the parent Options list, -
branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/CommonDef.h
r364 r367 56 56 // ==================================================================================================================== 57 57 58 #if H_MV59 #define NV_VERSION "0.1" ///< Current software version60 #define HM_VERSION "10.1" ///<61 #else62 58 #define NV_VERSION "10.1" ///< Current software version 63 #endif64 59 65 60 // ==================================================================================================================== … … 157 152 } 158 153 159 #if H_MV160 161 #define AOF( exp ) \162 { \163 if( !( exp ) ) \164 { \165 assert( 0 ); \166 } \167 }168 169 #endif170 154 171 155 // ==================================================================================================================== -
branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/NAL.h
r364 r367 47 47 NalUnitType m_nalUnitType; ///< nal_unit_type 48 48 UInt m_temporalId; ///< temporal_id 49 #if H_MV50 Int m_layerId; ///< layer id51 #else52 49 UInt m_reservedZero6Bits; ///< reserved_zero_6bits 53 #endif54 50 55 51 /** construct an NALunit structure with given header values. */ … … 57 53 NalUnitType nalUnitType, 58 54 Int temporalId = 0, 59 #if H_MV60 Int layerId = 0)61 #else62 55 Int reservedZero6Bits = 0) 63 #endif64 56 :m_nalUnitType (nalUnitType) 65 57 ,m_temporalId (temporalId) 66 #if H_MV67 ,m_layerId (layerId)68 #else69 58 ,m_reservedZero6Bits(reservedZero6Bits) 70 #endif71 59 {} 72 60 -
branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TComPic.cpp
r365 r367 64 64 , m_pNDBFilterYuvTmp (NULL) 65 65 , m_bCheckLTMSB (false) 66 #if H_MV67 , m_layerId (0)68 , m_viewId (0)69 #if H_3D70 , m_isDepth (false)71 #endif72 #endif73 66 { 74 67 m_apcPicYuv[0] = NULL; … … 471 464 472 465 } 473 #if H_MV474 Void TComPic::print( Bool legend )475 {476 if ( legend )477 std::cout << "LId" << "\t" << "POC" << "\t" << "Rec" << "\t" << "Ref" << "\t" << "LT" << std::endl;478 else479 std::cout << getLayerId() << "\t" << getPOC()<< "\t" << getReconMark() << "\t" << getSlice(0)->isReferenced() << "\t" << getIsLongTerm() << std::endl;480 }481 #endif482 466 483 467 -
branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TComPic.h
r364 r367 86 86 SEIMessages m_SEIs; ///< Any SEI messages that have been received. If !NULL we own the object. 87 87 88 #if H_MV89 Int m_layerId;90 Int m_viewId;91 #if H_3D92 Bool m_isDepth;93 #endif94 #endif95 88 public: 96 89 TComPic(); … … 105 98 Void setTLayer( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } 106 99 107 #if H_MV108 Void setLayerId ( Int layerId ) { m_layerId = layerId; }109 Int getLayerId () { return m_layerId; }110 Void setViewId ( Int viewId ) { m_viewId = viewId; }111 Int getViewId () { return m_viewId; }112 #if H_3D113 Void setIsDepth ( Bool isDepth ) { m_isDepth = isDepth; }114 Bool getIsDepth () { return m_isDepth; }115 #endif116 #endif117 100 Bool getUsedByCurr() { return m_bUsedByCurr; } 118 101 Void setUsedByCurr( Bool bUsed ) { m_bUsedByCurr = bUsed; } … … 181 164 std::vector<TComDataCU*>& getOneSliceCUDataForNDBFilter (Int sliceID) { return m_vSliceCUDataLink[sliceID];} 182 165 183 #if H_MV184 Void print( Bool legend );185 #endif186 166 /** transfer ownership of seis to this picture */ 187 167 void setSEIs(SEIMessages& seis) { m_SEIs = seis; } … … 199 179 };// END CLASS DEFINITION TComPic 200 180 201 #if H_MV202 class TComPicLists203 {204 private:205 TComList<TComList<TComPic*>*> m_lists;206 public:207 208 Void push_back( TComList<TComPic*>* list ) { m_lists.push_back( list ); }209 Int size () { return (Int) m_lists.size (); }210 211 TComPic* getPic( Int layerIdInNuh, Int poc )212 {213 TComPic* pcPic = NULL;214 for(TComList<TComList<TComPic*>*>::iterator itL = m_lists.begin(); ( itL != m_lists.end() && pcPic == NULL ); itL++)215 {216 for(TComList<TComPic*>::iterator itP=(*itL)->begin(); ( itP!=(*itL)->end() && pcPic == NULL ); itP++)217 {218 if ( ( (*itP)->getPOC() == poc ) && ( (*itP)->getLayerId() == layerIdInNuh ) )219 {220 pcPic = *itP ;221 }222 }223 }224 return pcPic;225 }226 227 Void print( )228 {229 Bool first = true;230 for(TComList<TComList<TComPic*>*>::iterator itL = m_lists.begin(); ( itL != m_lists.end() ); itL++)231 {232 for(TComList<TComPic*>::iterator itP=(*itL)->begin(); ( itP!=(*itL)->end() ); itP++)233 {234 if ( first )235 {236 (*itP)->print( true );237 first = false;238 }239 (*itP)->print( false );240 }241 }242 }243 244 245 }; // END CLASS DEFINITION TComPicLists246 247 #endif248 181 //! \} 249 182 -
branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TComSlice.cpp
r366 r367 107 107 , m_temporalLayerNonReferenceFlag ( false ) 108 108 , m_enableTMVPFlag ( true ) 109 #if H_MV110 , m_layerId (0)111 , m_viewId (0)112 #if H_3D113 , m_isDepth (false)114 #endif115 #endif116 109 { 117 110 #if L0034_COMBINED_LIST_CLEANUP … … 145 138 m_aiRefPOCList [0][iNumCount] = 0; 146 139 m_aiRefPOCList [1][iNumCount] = 0; 147 #if H_MV148 m_aiRefLayerIdList[0][iNumCount] = 0;149 m_aiRefLayerIdList[1][iNumCount] = 0;150 #endif151 140 } 152 141 resetWpScaling(); … … 320 309 { 321 310 m_aiRefPOCList[iDir][iNumRefIdx] = m_apcRefPicList[iDir][iNumRefIdx]->getPOC(); 322 #if H_MV323 m_aiRefLayerIdList[iDir][iNumRefIdx] = m_apcRefPicList[iDir][iNumRefIdx]->getLayerId();324 #endif325 311 } 326 312 } … … 368 354 for ( Int iRefIdxLC = 0; iRefIdxLC < m_aiNumRefIdx[REF_PIC_LIST_C]; iRefIdxLC++ ) 369 355 { 370 #if H_MV371 if ( m_apcRefPicList[REF_PIC_LIST_0][iNumRefIdx]->getPOC() == m_apcRefPicList[m_eListIdFromIdxOfLC[iRefIdxLC]][m_iRefIdxFromIdxOfLC[iRefIdxLC]]->getPOC() &&372 m_apcRefPicList[REF_PIC_LIST_0][iNumRefIdx]->getLayerId() == m_apcRefPicList[m_eListIdFromIdxOfLC[iRefIdxLC]][m_iRefIdxFromIdxOfLC[iRefIdxLC]]->getLayerId() )373 #else374 356 if ( m_apcRefPicList[REF_PIC_LIST_0][iNumRefIdx]->getPOC() == m_apcRefPicList[m_eListIdFromIdxOfLC[iRefIdxLC]][m_iRefIdxFromIdxOfLC[iRefIdxLC]]->getPOC() ) 375 #endif376 357 { 377 358 m_iRefIdxOfL1FromRefIdxOfL0[iNumRefIdx] = m_iRefIdxFromIdxOfLC[iRefIdxLC]; … … 395 376 for ( Int iRefIdxLC = 0; iRefIdxLC < m_aiNumRefIdx[REF_PIC_LIST_C]; iRefIdxLC++ ) 396 377 { 397 #if H_MV398 if ( m_apcRefPicList[REF_PIC_LIST_1][iNumRefIdx]->getPOC() == m_apcRefPicList[m_eListIdFromIdxOfLC[iRefIdxLC]][m_iRefIdxFromIdxOfLC[iRefIdxLC]]->getPOC() &&399 m_apcRefPicList[REF_PIC_LIST_1][iNumRefIdx]->getLayerId() == m_apcRefPicList[m_eListIdFromIdxOfLC[iRefIdxLC]][m_iRefIdxFromIdxOfLC[iRefIdxLC]]->getLayerId() )400 #else401 378 if ( m_apcRefPicList[REF_PIC_LIST_1][iNumRefIdx]->getPOC() == m_apcRefPicList[m_eListIdFromIdxOfLC[iRefIdxLC]][m_iRefIdxFromIdxOfLC[iRefIdxLC]]->getPOC() ) 402 #endif403 379 { 404 380 m_iRefIdxOfL0FromRefIdxOfL1[iNumRefIdx] = m_iRefIdxFromIdxOfLC[iRefIdxLC]; … … 420 396 #endif 421 397 422 #if H_MV423 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer , Bool checkNumPocTotalCurr)424 #else425 398 #if FIX1071 426 399 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr ) … … 428 401 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic ) 429 402 #endif 430 #endif431 403 { 432 404 #if FIX1071 … … 442 414 } 443 415 444 #if !H_MV445 416 m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0); 446 417 m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1); 447 #endif448 418 } 449 419 … … 455 425 UInt NumPocStCurr1 = 0; 456 426 UInt NumPocLtCurr = 0; 457 #if H_MV458 Int numDirectRefLayers = getVPS()->getNumDirectRefLayers( getLayerIdInVps() );459 assert( numDirectRefLayers == refPicSetInterLayer.size() );460 #endif461 427 Int i; 462 428 … … 507 473 TComPic* rpsCurrList0[MAX_NUM_REF+1]; 508 474 TComPic* rpsCurrList1[MAX_NUM_REF+1]; 509 #if H_MV510 Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr + numDirectRefLayers;511 assert( numPocTotalCurr == getNumRpsCurrTempList() );512 #else513 475 Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr; 514 #endif515 476 #if FIX1071 516 477 if (checkNumPocTotalCurr) … … 552 513 rpsCurrList0[cIdx] = RefPicSetLtCurr[i]; 553 514 } 554 #if H_MV555 for ( i=0; i<numDirectRefLayers; i++, cIdx++)556 {557 if( cIdx <= MAX_NUM_REF )558 {559 rpsCurrList0[cIdx] = refPicSetInterLayer[i];560 }561 }562 #endif563 515 564 516 if (m_eSliceType==B_SLICE) … … 577 529 rpsCurrList1[cIdx] = RefPicSetLtCurr[i]; 578 530 } 579 #if H_MV580 for ( i=0; i<numDirectRefLayers; i++, cIdx++)581 {582 if( cIdx <= MAX_NUM_REF )583 {584 rpsCurrList1[cIdx] = refPicSetInterLayer[i];585 }586 }587 #endif588 531 } 589 532 … … 627 570 } 628 571 } 629 #if H_MV630 numRpsCurrTempList = numRpsCurrTempList + getVPS()->getNumDirectRefLayers( getLayerIdInVps() );631 #endif632 572 return numRpsCurrTempList; 633 573 } … … 792 732 m_iPOC = pSrc->m_iPOC; 793 733 m_eNalUnitType = pSrc->m_eNalUnitType; 794 #if H_MV795 m_layerId = pSrc->m_layerId;796 #endif797 734 m_eSliceType = pSrc->m_eSliceType; 798 735 m_iSliceQp = pSrc->m_iSliceQp; … … 847 784 m_apcRefPicList[i][j] = pSrc->m_apcRefPicList[i][j]; 848 785 m_aiRefPOCList[i][j] = pSrc->m_aiRefPOCList[i][j]; 849 #if H_MV850 m_aiRefLayerIdList[i][j] = pSrc->m_aiRefLayerIdList[i][j];851 #endif852 786 } 853 787 } … … 865 799 866 800 // access channel 867 #if H_MV868 m_pcVPS = pSrc->m_pcVPS;869 #endif870 801 m_pcSPS = pSrc->m_pcSPS; 871 802 m_pcPPS = pSrc->m_pcPPS; … … 1381 1312 , m_bTemporalIdNestingFlag (false) 1382 1313 , m_numHrdParameters ( 0) 1383 #if H_MV1384 , m_maxNuhLayerId ( 0)1385 #else1386 1314 , m_maxNuhReservedZeroLayerId ( 0) 1387 #endif1388 1315 , m_hrdParameters (NULL) 1389 1316 , m_hrdOpSetIdx (NULL) … … 1400 1327 m_uiMaxLatencyIncrease[i] = 0; 1401 1328 } 1402 #if H_MV1403 m_avcBaseLayerFlag = false;1404 m_splittingFlag = false;1405 1406 for( Int i = 0; i < MAX_NUM_SCALABILITY_TYPES; i++ )1407 {1408 m_scalabilityMask[i] = false;1409 m_dimensionIdLen [i] = -1;1410 }1411 1412 m_vpsNuhLayerIdPresentFlag = false;1413 m_numOutputLayerSets = 0;1414 1415 for( Int i = 0; i < MAX_VPS_OP_SETS_PLUS1; i++ )1416 {1417 m_vpsProfilePresentFlag [i] = false;1418 m_profileLayerSetRefMinus1[i] = 0;1419 m_outputLayerSetIdx [i] = 0;1420 for( Int j = 0; j < MAX_VPS_NUH_LAYER_ID_PLUS1; j++ )1421 {1422 m_outputLayerFlag[i][j] = false;1423 }1424 }1425 1426 for( Int i = 0; i < MAX_NUM_LAYER_IDS; i++ )1427 {1428 m_layerIdInVps[i] = (i == 0 ) ? 0 : -1;1429 }1430 1431 for( Int i = 0; i < MAX_NUM_LAYERS; i++ )1432 {1433 m_layerIdInNuh [i] = ( i == 0 ) ? 0 : -1;1434 m_numDirectRefLayers[i] = 0;1435 1436 for( Int j = 0; j < MAX_NUM_LAYERS; j++ )1437 {1438 m_directDependencyFlag[i][j] = false;1439 m_refLayerId[i][j] = -1;1440 }1441 1442 for( Int j = 0; j < MAX_NUM_SCALABILITY_TYPES; j++ )1443 {1444 m_dimensionId[i][j] = 0;1445 }1446 1447 }1448 #endif1449 1329 } 1450 1330 … … 1456 1336 } 1457 1337 1458 #if H_MV1459 1460 Bool TComVPS::checkVPSExtensionSyntax()1461 {1462 // check splitting flag constraint1463 if ( getSplittingFlag() )1464 {1465 // Derive dimBitOffset[j]1466 Int dimBitOffset[MAX_NUM_SCALABILITY_TYPES+1];1467 Int numScalabilityTypes = getNumScalabilityTypes();1468 dimBitOffset[0] = 0;1469 1470 for (Int type = 1; type <= numScalabilityTypes; type++ )1471 {1472 dimBitOffset[ type ] = 0;1473 for (Int dimIdx = 0; dimIdx <= type - 1; dimIdx++)1474 dimBitOffset[ type ] += ( getDimensionIdLen( dimIdx ) );1475 }1476 1477 for (Int type = 0; type < getNumScalabilityTypes(); type++ )1478 {1479 for( Int layer = 1; layer < getMaxLayers(); layer++ )1480 {1481 assert( getDimensionId( layer, type ) == ( ( getLayerIdInNuh( layer ) & ( (1 << dimBitOffset[ type + 1 ] ) - 1) ) >> dimBitOffset[ type ] ) );1482 };1483 };1484 }1485 1486 for( Int layer = 1; layer < getMaxLayers(); layer++ )1487 {1488 // check layer_id_in_nuh constraint1489 assert( getLayerIdInNuh( layer ) > getLayerIdInNuh( layer -1 ) );1490 }1491 return true;1492 }1493 1494 Int TComVPS::getNumScalabilityTypes()1495 {1496 return scalTypeToScalIdx( ScalabilityType(MAX_NUM_SCALABILITY_TYPES) );1497 }1498 1499 Int TComVPS::scalTypeToScalIdx( ScalabilityType scalType )1500 {1501 assert( scalType >= 0 && scalType <= MAX_NUM_SCALABILITY_TYPES );1502 assert( scalType == MAX_NUM_SCALABILITY_TYPES || getScalabilityMask( scalType ) );1503 1504 Int scalIdx = 0;1505 for( Int curScalType = 0; curScalType < scalType; curScalType++ )1506 {1507 scalIdx += ( getScalabilityMask( curScalType ) ? 1 : 0 );1508 }1509 1510 return scalIdx;1511 }1512 1513 1514 1515 Void TComVPS::setScalabilityMask( UInt val )1516 {1517 for ( Int scalType = 0; scalType < MAX_NUM_SCALABILITY_TYPES; scalType++ )1518 setScalabilityMask( scalType, ( val & (1 << scalType ) ) == 1 );1519 }1520 1521 Void TComVPS::calcIvRefLayers()1522 {1523 for( Int i = 1; i <= getMaxLayers(); i++ )1524 {1525 m_numDirectRefLayers[ i ] = 0;1526 for( Int j = 0 ; j < i; j++ )1527 if( m_directDependencyFlag[ i ][ j ])1528 m_refLayerId[ i ][ m_numDirectRefLayers[ i ]++ ] = m_layerIdInNuh[ j ];1529 }1530 }1531 1532 Int TComVPS::getRefLayerId( Int layerIdInVps, Int idx )1533 {1534 assert( idx >= 0 && idx < m_numDirectRefLayers[layerIdInVps] );1535 Int layerIdInNuh = m_refLayerId[ layerIdInVps ][ idx ];1536 assert ( layerIdInNuh >= 0 );1537 return layerIdInNuh;1538 }1539 1540 Int TComVPS::getScalabilityId( Int layerIdInVps, ScalabilityType scalType )1541 {1542 return ( ( layerIdInVps != 0 )&& getScalabilityMask( scalType ) ) ? getDimensionId( layerIdInVps, scalTypeToScalIdx( scalType ) ) : 0;1543 }1544 #endif1545 1338 // ------------------------------------------------------------------------------------------------ 1546 1339 // Sequence parameter set (SPS) … … 1589 1382 , m_vuiParametersPresentFlag (false) 1590 1383 , m_vuiParameters () 1591 #if H_MV1592 , m_interViewMvVertConstraintFlag (false)1593 #endif1594 1384 { 1595 1385 for ( Int i = 0; i < MAX_TLAYER; i++ ) … … 2055 1845 } 2056 1846 2057 #if H_MV2058 Void TComSlice::createAndApplyIvReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer )2059 {2060 refPicSetInterLayer.clear();2061 2062 for( Int i = 0; i < getVPS()->getNumDirectRefLayers( getLayerIdInVps() ); i++ )2063 {2064 Int layerIdRef = getVPS()->getRefLayerId( getLayerIdInVps(), i );2065 TComPic* picRef = ivPicLists->getPic( layerIdRef, getPOC() ) ;2066 assert ( picRef != 0 );2067 2068 picRef->getPicYuvRec()->extendPicBorder();2069 picRef->setIsLongTerm( true );2070 picRef->getSlice(0)->setReferenced( true );2071 2072 refPicSetInterLayer.push_back( picRef );2073 }2074 }2075 2076 Void TComSlice::markIvRefPicsAsShortTerm( std::vector<TComPic*> refPicSetInterLayer )2077 {2078 // Mark as shortterm2079 for ( Int i = 0; i < refPicSetInterLayer.size(); i++ )2080 {2081 refPicSetInterLayer[i]->setIsLongTerm( false );2082 }2083 }2084 2085 Void TComSlice::markIvRefPicsAsUnused( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc )2086 {2087 // Fill targetDecLayerIdSet with all layers if empty.2088 if (targetDecLayerIdSet.size() == 0 )2089 {2090 for ( Int layerIdInVps = 0; layerIdInVps < vps->getMaxLayers(); layerIdInVps++ )2091 {2092 targetDecLayerIdSet.push_back( vps->getLayerIdInNuh( layerIdInVps ) );2093 }2094 }2095 2096 Int numTargetDecLayers = (Int) targetDecLayerIdSet.size();2097 Int latestDecIdx;2098 for ( latestDecIdx = 0; latestDecIdx < numTargetDecLayers; latestDecIdx++)2099 {2100 if ( targetDecLayerIdSet[ latestDecIdx ] == curLayerId )2101 break;2102 }2103 2104 for( Int i = 0; i <= latestDecIdx; i++ )2105 {2106 if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ i ] ) )2107 {2108 TComPic* pcPic = ivPicLists->getPic( targetDecLayerIdSet[ i ], curPoc );2109 if( pcPic->getSlice(0)->isReferenced() && pcPic->getSlice(0)->getTemporalLayerNonReferenceFlag() )2110 {2111 Bool remainingInterLayerReferencesFlag = false;2112 for( Int j = latestDecIdx + 1; j < numTargetDecLayers; j++ )2113 {2114 TComVPS* vpsSlice = pcPic->getSlice(0)->getVPS();2115 if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ j ] ) )2116 {2117 Int targetDecLayerIdinVPS = vpsSlice->getLayerIdInVps( targetDecLayerIdSet[ j ] );2118 for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdinVPS ); k++ )2119 if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdinVPS, k ) )2120 remainingInterLayerReferencesFlag = true;2121 }2122 }2123 if( !remainingInterLayerReferencesFlag )2124 pcPic->getSlice(0)->setReferenced( false );2125 }2126 }2127 }2128 }2129 2130 Void TComSlice::xPrintRefPicList()2131 {2132 for ( Int li = 0; li < 2; li++)2133 {2134 std::cout << std::endl << "RefPicListL" << li << ":" << std::endl;2135 for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[li]-1); rIdx ++)2136 {2137 if (rIdx == 0 && li == 0) m_apcRefPicList[li][rIdx]->print( true );2138 2139 m_apcRefPicList[li][rIdx]->print( false );2140 }2141 }2142 }2143 #endif2144 1847 /** get scaling matrix from RefMatrixID 2145 1848 * \param sizeId size index … … 2364 2067 { 2365 2068 Int spsId = pps->getSPSId(); 2366 #if H_MV2367 // active parameter sets per layer should be used here2368 #else2369 2069 if (!isIRAP && (spsId != m_activeSPSId)) 2370 2070 { … … 2372 2072 return false; 2373 2073 } 2374 #endif2375 2074 TComSPS *sps = m_spsMap.getPS(spsId); 2376 2075 if (sps) … … 2427 2126 } 2428 2127 2429 #if H_MV2430 Void TComPTL::copyLevelFrom( TComPTL* source )2431 {2432 getGeneralPTL()->setLevelIdc( source->getGeneralPTL()->getLevelIdc() );2433 for( Int subLayer = 0; subLayer < 6; subLayer++ )2434 {2435 setSubLayerLevelPresentFlag( subLayer, source->getSubLayerLevelPresentFlag( subLayer ) );2436 getSubLayerPTL( subLayer )->setLevelIdc( source->getSubLayerPTL( subLayer )->getLevelIdc() );2437 }2438 }2439 #endif2440 2128 #if SIGNAL_BITRATE_PICRATE_IN_VPS 2441 2129 TComBitRatePicRateInfo::TComBitRatePicRateInfo() -
branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TComSlice.h
r366 r367 51 51 class TComPic; 52 52 class TComTrQuant; 53 #if H_MV54 class TComPicLists;55 #endif56 53 // ==================================================================================================================== 57 54 // Constants … … 248 245 ProfileTierLevel* getGeneralPTL() { return &m_generalPTL; } 249 246 ProfileTierLevel* getSubLayerPTL(Int i) { return &m_subLayerPTL[i]; } 250 #if H_MV251 Void copyLevelFrom( TComPTL* source );252 #endif253 247 }; 254 248 /// VPS class … … 486 480 487 481 UInt m_numHrdParameters; 488 #if H_MV489 UInt m_maxNuhLayerId;490 #else491 482 UInt m_maxNuhReservedZeroLayerId; 492 #endif493 483 TComHRD* m_hrdParameters; 494 484 UInt* m_hrdOpSetIdx; 495 485 Bool* m_cprmsPresentFlag; 496 486 UInt m_numOpSets; 497 #if H_MV498 Bool m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_LAYER_ID_PLUS1];499 #else500 487 Bool m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1]; 501 #endif 502 503 #if H_MV 504 TComPTL m_pcPTL[MAX_VPS_OP_SETS_PLUS1]; 505 #else 488 506 489 TComPTL m_pcPTL; 507 #endif508 490 #if SIGNAL_BITRATE_PICRATE_IN_VPS 509 491 TComBitRatePicRateInfo m_bitRatePicRateInfo; … … 513 495 #endif 514 496 515 #if H_MV516 Bool m_avcBaseLayerFlag;517 Bool m_splittingFlag;518 Bool m_scalabilityMask [MAX_NUM_SCALABILITY_TYPES];519 Int m_dimensionIdLen [MAX_NUM_SCALABILITY_TYPES];520 Bool m_vpsNuhLayerIdPresentFlag;521 Int m_layerIdInNuh [MAX_NUM_LAYER_IDS];522 Int m_layerIdInVps [MAX_NUM_LAYERS ];523 Int m_dimensionId [MAX_NUM_LAYER_IDS][MAX_NUM_SCALABILITY_TYPES];524 525 526 Bool m_vpsProfilePresentFlag [MAX_VPS_OP_SETS_PLUS1];527 Int m_profileLayerSetRefMinus1 [MAX_VPS_OP_SETS_PLUS1];528 Int m_numOutputLayerSets;529 Int m_outputLayerSetIdx [MAX_VPS_OP_SETS_PLUS1];530 Bool m_outputLayerFlag [MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_LAYER_ID_PLUS1];531 Bool m_directDependencyFlag [MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS];532 533 Int m_numDirectRefLayers [ MAX_NUM_LAYERS ];534 Int m_refLayerId [ MAX_NUM_LAYERS ][MAX_NUM_LAYERS];535 536 #endif537 497 public: 538 498 TComVPS(); … … 576 536 Void setNumHrdParameters(UInt v) { m_numHrdParameters = v; } 577 537 578 #if H_MV579 UInt getMaxNuhLayerId() { return m_maxNuhLayerId; }580 Void setMaxNuhLayerId(UInt v) { m_maxNuhLayerId = v; }581 #else582 538 UInt getMaxNuhReservedZeroLayerId() { return m_maxNuhReservedZeroLayerId; } 583 539 Void setMaxNuhReservedZeroLayerId(UInt v) { m_maxNuhReservedZeroLayerId = v; } 584 #endif585 540 586 541 UInt getMaxOpSets() { return m_numOpSets; } … … 589 544 Void setLayerIdIncludedFlag(Bool v, UInt opsIdx, UInt id) { m_layerIdIncludedFlag[opsIdx][id] = v; } 590 545 591 #if H_MV592 TComPTL* getPTL( Int layerSet = 0 ) { return &m_pcPTL[layerSet]; }593 #else594 546 TComPTL* getPTL() { return &m_pcPTL; } 595 #endif596 547 #if SIGNAL_BITRATE_PICRATE_IN_VPS 597 548 TComBitRatePicRateInfo *getBitratePicrateInfo() { return &m_bitRatePicRateInfo; } … … 599 550 #if L0043_TIMING_INFO 600 551 TimingInfo* getTimingInfo() { return &m_timingInfo; } 601 #endif602 #if H_MV603 Void setAvcBaseLayerFlag( Bool val ) { m_avcBaseLayerFlag = val; }604 Bool getAvcBaseLayerFlag() { return m_avcBaseLayerFlag; }605 606 Void setSplittingFlag( Bool val ) { m_splittingFlag = val; }607 Bool getSplittingFlag() { return m_splittingFlag; }608 609 Void setScalabilityMask( UInt val );610 611 Void setScalabilityMask( Int scalType, Bool val ) { m_scalabilityMask[scalType] = val; }612 Bool getScalabilityMask( Int scalType ) { return m_scalabilityMask[scalType]; }613 614 Int getNumScalabilityTypes( );615 616 Void setDimensionIdLen( Int sIdx, Int val ) { m_dimensionIdLen[sIdx] = val; }617 Int getDimensionIdLen( Int sIdx ) { assert( m_dimensionIdLen[sIdx] > 0) ; return m_dimensionIdLen[sIdx]; }618 619 Void setVpsNuhLayerIdPresentFlag( Bool val ) { m_vpsNuhLayerIdPresentFlag = val; }620 Bool getVpsNuhLayerIdPresentFlag() { return m_vpsNuhLayerIdPresentFlag; }621 622 Void setLayerIdInNuh( Int layerIdInVps, Int val ) { m_layerIdInNuh[layerIdInVps] = val; }623 Int getLayerIdInNuh( Int layerIdInVps ) { assert( m_layerIdInNuh[layerIdInVps] >= 0 ); return m_layerIdInNuh[layerIdInVps]; }624 625 Void setLayerIdInVps( Int layerIdInNuh, Int val ) { m_layerIdInVps[layerIdInNuh] = val; }626 Int getLayerIdInVps( Int layerIdInNuh ) { assert( m_layerIdInVps[layerIdInNuh] >= 0 ); return m_layerIdInVps[layerIdInNuh]; }627 628 Bool nuhLayerIdIncluded( Int layerIdinNuh ) { return ( m_layerIdInVps[ layerIdinNuh ] > 0 ); }629 630 Void setDimensionId( Int layerIdInVps, Int scalIdx, Int val ) { m_dimensionId[layerIdInVps][scalIdx] = val; }631 Int getDimensionId( Int layerIdInVps, Int scalIdx ) { return m_dimensionId[layerIdInVps][scalIdx]; }632 633 Int getScalabilityId ( Int layerIdInVps, ScalabilityType scalType );634 635 Int getViewId ( Int layerIdInVps ) { return getScalabilityId( layerIdInVps, VIEW_ID ); }636 #if H_3D637 Int getDepthId ( Int layerIdInVps ) { return getScalabilityId( layerIdInVps, DEPTH_ID ); }638 #endif639 640 641 Void setVpsProfilePresentFlag( Int layerSet, Bool val ) { m_vpsProfilePresentFlag[layerSet] = val; }642 Bool getVpsProfilePresentFlag( Int layerSet ) { return m_vpsProfilePresentFlag[layerSet]; }643 644 Void setProfileLayerSetRefMinus1( Int layerSet, Int val ) { m_profileLayerSetRefMinus1[layerSet] = val; }645 Bool getProfileLayerSetRefMinus1( Int layerSet ) { return m_profileLayerSetRefMinus1[layerSet]; }646 647 Void setNumOutputLayerSets( Int val ) { m_numOutputLayerSets = val; }648 Int getNumOutputLayerSets() { return m_numOutputLayerSets; }649 650 Void setOutputLayerSetIdx( Int layerSet, Int val ) { m_outputLayerSetIdx[layerSet] = val; }651 Int getOutputLayerSetIdx( Int layerSet ) { return m_outputLayerSetIdx[layerSet]; }652 653 Void setOutputLayerFlag( Int layerSet, Int layer, Bool val ) { m_outputLayerFlag[layerSet][layer] = val; }654 Bool getOutputLayerFlag( Int layerSet, Int layer ) { return m_outputLayerFlag[layerSet][layer]; }655 656 Void setDirectDependencyFlag( Int layerHigh, Int layerLow, Bool val ) { m_directDependencyFlag[layerHigh][layerLow] = val; }657 Bool getDirectDependencyFlag( Int layerHigh, Int layerLow ) { return m_directDependencyFlag[layerHigh][layerLow]; }658 659 Void calcIvRefLayers();660 661 Int getNumDirectRefLayers( Int layerIdInVps ) { return m_numDirectRefLayers[ layerIdInVps ]; };662 Int getRefLayerId ( Int layerIdInVps, Int idx );;663 664 Bool checkVPSExtensionSyntax();665 Int scalTypeToScalIdx ( ScalabilityType scalType );666 552 #endif 667 553 }; … … 967 853 static const Int m_winUnitY[MAX_CHROMA_FORMAT_IDC+1]; 968 854 TComPTL m_pcPTL; 969 #if H_MV970 Bool m_interViewMvVertConstraintFlag;971 #endif972 855 public: 973 856 TComSPS(); … … 1100 983 1101 984 TComPTL* getPTL() { return &m_pcPTL; } 1102 #if H_MV1103 Void setInterViewMvVertConstraintFlag(Bool val) { m_interViewMvVertConstraintFlag = val; }1104 Bool getInterViewMvVertConstraintFlag() { return m_interViewMvVertConstraintFlag;}1105 #endif1106 985 }; 1107 986 … … 1130 1009 Void setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL1[idx] = refPicSetIdx; } 1131 1010 UInt getRefPicSetIdxL1(UInt idx) { return m_RefPicSetIdxL1[idx]; } 1132 #if H_MV1133 // Why not an listIdx for all members, would avoid code duplication??1134 Void setRefPicSetIdxL(UInt li, UInt idx, UInt refPicSetIdx) {( li==0 ? m_RefPicSetIdxL0[idx] : m_RefPicSetIdxL1[idx] ) = refPicSetIdx; };1135 Void setRefPicListModificationFlagL(UInt li, Bool flag) { ( li==0 ? m_bRefPicListModificationFlagL0 : m_bRefPicListModificationFlagL1 ) = flag; };1136 #endif1137 1011 }; 1138 1012 … … 1389 1263 TComPic* m_apcRefPicList [2][MAX_NUM_REF+1]; 1390 1264 Int m_aiRefPOCList [2][MAX_NUM_REF+1]; 1391 #if H_MV1392 Int m_aiRefLayerIdList[2][MAX_NUM_REF+1];1393 #endif1394 1265 Bool m_bIsUsedAsLongTerm[2][MAX_NUM_REF+1]; 1395 1266 Int m_iDepth; … … 1457 1328 1458 1329 Bool m_enableTMVPFlag; 1459 #if H_MV1460 Int m_layerId;1461 Int m_viewId;1462 #if H_3D1463 Bool m_isDepth;1464 #endif1465 #endif1466 1330 public: 1467 1331 TComSlice(); … … 1570 1434 Void setDepth ( Int iDepth ) { m_iDepth = iDepth; } 1571 1435 1572 #if H_MV1573 Int getRefLayerId ( RefPicList e, Int iRefIdx) { return m_aiRefLayerIdList[e][iRefIdx]; }1574 Void setRefLayerId ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefLayerIdList[e][iRefIdx] = i; }1575 #endif1576 #if H_MV1577 Void setRefPicList ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& interLayerRefPicSet , Bool checkNumPocTotalCurr = false );1578 #else1579 1436 #if FIX1071 1580 1437 Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false ); 1581 1438 #else 1582 1439 Void setRefPicList ( TComList<TComPic*>& rcListPic ); 1583 #endif1584 1440 #endif 1585 1441 Void setRefPOCList (); … … 1629 1485 Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); 1630 1486 Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); 1631 #if H_MV1632 Void createAndApplyIvReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer );1633 static Void markIvRefPicsAsShortTerm ( std::vector<TComPic*> refPicSetInterLayer );1634 static Void markIvRefPicsAsUnused ( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc );1635 1636 1637 Void xPrintRefPicList();1638 #endif1639 1487 Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic ); 1640 1488 Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic ); … … 1712 1560 Bool getEnableTMVPFlag () { return m_enableTMVPFlag;} 1713 1561 1714 #if H_MV1715 Void setLayerId ( Int layerId ) { m_layerId = layerId; }1716 Int getLayerId () { return m_layerId; }1717 Int getLayerIdInVps () { return getVPS()->getLayerIdInVps( m_layerId ); };1718 Void setViewId ( Int viewId ) { m_viewId = viewId; }1719 Int getViewId () { return m_viewId; }1720 #if H_3D1721 Void setIsDepth ( Bool isDepth ) { m_isDepth = isDepth; }1722 Bool getIsDepth () { return m_isDepth; }1723 #endif1724 #endif1725 1562 protected: 1726 1563 TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, 1727 1564 Int poc); 1728 1565 TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb); 1729 #if H_MV1730 TComPic* xGetInterLayerRefPic( std::vector<TComPic*>& rcListIlPic, Int layerId );1731 #endif1732 1566 };// END CLASS DEFINITION TComSlice 1733 1567 -
branches/HTM-DEV-0.1-dev/source/Lib/TLibCommon/TypeDef.h
r364 r367 45 45 46 46 47 #if H_MV48 #define H_3D 049 #endif50 47 51 48 ///// ***** HM 10.1 ********* … … 91 88 #define MAX_VPS_NUM_HRD_PARAMETERS 1 92 89 #define MAX_VPS_OP_SETS_PLUS1 1024 93 #if H_MV94 #define MAX_VPS_NUH_LAYER_ID_PLUS1 6495 #define MAX_NUM_SCALABILITY_TYPES 1696 #define ENC_CFG_CONSOUT_SPACE 2997 #else98 90 #define MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1 1 99 #endif100 91 101 92 #define RATE_CONTROL_LAMBDA_DOMAIN 1 ///< JCTVC-K0103, rate control by R-lambda model … … 104 95 #define MAX_CPB_CNT 32 ///< Upper bound of (cpb_cnt_minus1 + 1) 105 96 #define MAX_NUM_LAYER_IDS 64 106 #if H_MV107 #define MAX_NUM_LAYERS 64108 #endif109 97 110 98 #define COEF_REMAIN_BIN_REDUCTION 3 ///< indicates the level at which the VLC … … 521 509 MAIN10 = 2, 522 510 MAINSTILLPICTURE = 3, 523 #if H_MV524 MAINSTEREO = 4,525 MAINMULTIVIEW = 5,526 #if H_3D527 MAIN3D = 6,528 #endif529 #endif530 511 }; 531 512 } … … 559 540 //! \} 560 541 561 #if H_MV 562 /// scalability types 563 enum ScalabilityType 564 { 565 VIEW_ID = 0, 566 #if H_3D 567 DEPTH_ID = 1, 568 #endif 569 }; 570 #endif 571 #endif 542 #endif -
branches/HTM-DEV-0.1-dev/source/Lib/TLibDecoder/NALread.cpp
r362 r367 103 103 assert(forbidden_zero_bit == 0); 104 104 nalu.m_nalUnitType = (NalUnitType) bs.read(6); // nal_unit_type 105 #if H_MV106 nalu.m_layerId = bs.read(6); // layerId107 #else108 105 nalu.m_reservedZero6Bits = bs.read(6); // nuh_reserved_zero_6bits 109 106 assert(nalu.m_reservedZero6Bits == 0); 110 #endif111 107 nalu.m_temporalId = bs.read(3) - 1; // nuh_temporal_id_plus1 112 108 -
branches/HTM-DEV-0.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r362 r367 680 680 if (uiCode) 681 681 { 682 #if H_MV683 READ_FLAG( uiCode, "inter_view_mv_vert_constraint_flag" ); pcSPS->setInterViewMvVertConstraintFlag(uiCode == 1 ? true : false);684 #else685 682 while ( xMoreRbspData() ) 686 683 { 687 684 READ_FLAG( uiCode, "sps_extension_data_flag"); 688 685 } 689 #endif690 686 } 691 687 } … … 697 693 READ_CODE( 4, uiCode, "vps_video_parameter_set_id" ); pcVPS->setVPSId( uiCode ); 698 694 READ_CODE( 2, uiCode, "vps_reserved_three_2bits" ); assert(uiCode == 3); 699 #if H_MV700 READ_CODE( 6, uiCode, "vps_max_layers_minus1" ); pcVPS->setMaxLayers( uiCode + 1 );701 #else702 695 READ_CODE( 6, uiCode, "vps_reserved_zero_6bits" ); assert(uiCode == 0); 703 #endif704 696 READ_CODE( 3, uiCode, "vps_max_sub_layers_minus1" ); pcVPS->setMaxTLayers( uiCode + 1 ); 705 697 READ_FLAG( uiCode, "vps_temporal_id_nesting_flag" ); pcVPS->setTemporalNestingFlag( uiCode ? true:false ); 706 698 assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag()); 707 #if H_MV708 READ_CODE( 16, uiCode, "vps_extension_offset" );709 #else710 699 READ_CODE( 16, uiCode, "vps_reserved_ffff_16bits" ); assert(uiCode == 0xffff); 711 #endif712 700 parsePTL ( pcVPS->getPTL(), true, pcVPS->getMaxTLayers()-1); 713 701 #if SIGNAL_BITRATE_PICRATE_IN_VPS … … 739 727 740 728 assert( pcVPS->getNumHrdParameters() < MAX_VPS_OP_SETS_PLUS1 ); 741 #if H_MV742 assert( pcVPS->getMaxNuhLayerId() < MAX_VPS_NUH_LAYER_ID_PLUS1 );743 READ_CODE( 6, uiCode, "vps_max_nuh_layer_id" ); pcVPS->setMaxNuhLayerId( uiCode );744 #else745 729 assert( pcVPS->getMaxNuhReservedZeroLayerId() < MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1 ); 746 730 READ_CODE( 6, uiCode, "vps_max_nuh_reserved_zero_layer_id" ); pcVPS->setMaxNuhReservedZeroLayerId( uiCode ); 747 #endif748 731 READ_UVLC( uiCode, "vps_max_op_sets_minus1" ); pcVPS->setMaxOpSets( uiCode + 1 ); 749 732 for( UInt opsIdx = 1; opsIdx <= ( pcVPS->getMaxOpSets() - 1 ); opsIdx ++ ) 750 733 { 751 734 // Operation point set 752 #if H_MV753 for( UInt i = 0; i <= pcVPS->getMaxNuhLayerId(); i ++ )754 #else755 735 for( UInt i = 0; i <= pcVPS->getMaxNuhReservedZeroLayerId(); i ++ ) 756 #endif757 736 { 758 737 READ_FLAG( uiCode, "layer_id_included_flag[opsIdx][i]" ); pcVPS->setLayerIdIncludedFlag( uiCode == 1 ? true : false, opsIdx, i ); … … 793 772 if (uiCode) 794 773 { 795 #if H_MV796 m_pcBitstream->readOutTrailingBits();797 798 READ_FLAG( uiCode, "avc_base_layer_flag" ); pcVPS->setAvcBaseLayerFlag( uiCode == 1 ? true : false );799 READ_FLAG( uiCode, "splitting_flag" ); pcVPS->setSplittingFlag( uiCode == 1 ? true : false );800 801 // Parse scalability_mask[i]802 for( Int sIdx = 0; sIdx < MAX_NUM_SCALABILITY_TYPES; sIdx++ )803 {804 READ_FLAG( uiCode, "scalability_mask[i]" ); pcVPS->setScalabilityMask( sIdx, uiCode == 1 ? true : false );805 }806 807 Int numScalabilityTypes = pcVPS->getNumScalabilityTypes();808 809 // Parse dimension_id_len_minus1[j]810 for( Int sIdx = 0; sIdx < numScalabilityTypes; sIdx++ )811 {812 READ_CODE( 3, uiCode, "dimension_id_len_minus1[j]" ); pcVPS->setDimensionIdLen( sIdx, uiCode + 1 );813 }814 815 // vps_nuh_layer_id_present_flag816 READ_FLAG( uiCode, "vps_nuh_layer_id_present_flag" ); pcVPS->setVpsNuhLayerIdPresentFlag( uiCode == 1 ? true : false );817 818 // parse layer_id_in_nuh[i] and derive LayerIdInVps819 pcVPS->setLayerIdInNuh( 0, 0 ); pcVPS->setLayerIdInVps( 0, 0 );820 821 for( Int layer = 1; layer <= pcVPS->getMaxLayers() - 1; layer++ )822 {823 UInt layerIdInNuh;824 if ( pcVPS->getVpsNuhLayerIdPresentFlag() )825 {826 READ_CODE( 6, uiCode, "layer_id_in_nuh[i]" ); layerIdInNuh = uiCode;827 }828 else829 {830 layerIdInNuh = layer;831 }832 833 pcVPS->setLayerIdInNuh( layer, layerIdInNuh );834 pcVPS->setLayerIdInVps( layerIdInNuh, layer );835 836 // parse dimension_id[i][j]837 for( Int sIdx = 0; sIdx < numScalabilityTypes; sIdx++ )838 {839 READ_CODE( pcVPS->getDimensionIdLen( sIdx ), uiCode, "dimension_id[i][j]" ); pcVPS->setDimensionId( layer, sIdx, uiCode );840 }841 }842 843 for( Int layerSet = 1; layerSet <= pcVPS->getMaxOpSets() - 1; layerSet++ )844 {845 READ_FLAG( uiCode, "vps_profile_present_flag[lsIdx]" ); pcVPS->setVpsProfilePresentFlag( layerSet, uiCode == 1 ? true : false );846 if( pcVPS->getVpsProfilePresentFlag( layerSet ) == false )847 {848 READ_UVLC( uiCode, "profile_layer_set_ref_minus1[lsIdx]" ); pcVPS->setProfileLayerSetRefMinus1( layerSet, uiCode );849 }850 851 parsePTL ( pcVPS->getPTL( layerSet ), pcVPS->getVpsProfilePresentFlag( layerSet ), pcVPS->getMaxTLayers()-1);852 if( pcVPS->getVpsProfilePresentFlag( layerSet ) == false )853 {854 TComPTL temp = *pcVPS->getPTL( layerSet );855 *pcVPS->getPTL( layerSet ) = *pcVPS->getPTL( pcVPS->getProfileLayerSetRefMinus1( layerSet ) + 1 );856 pcVPS->getPTL( layerSet )->copyLevelFrom( &temp );857 }858 }859 860 READ_UVLC( uiCode, "num_output_layer_sets" ); pcVPS->setNumOutputLayerSets( uiCode );861 862 for( Int layerSet = 0; layerSet < pcVPS->getNumOutputLayerSets(); layerSet++ )863 {864 READ_UVLC( uiCode, "output_layer_set_idx[i]" ); pcVPS->setOutputLayerSetIdx( layerSet, uiCode );865 for( Int layer = 0; layer <= pcVPS->getMaxNuhLayerId(); layer++ )866 {867 if( pcVPS->getLayerIdIncludedFlag( pcVPS->getOutputLayerSetIdx( layerSet ), layer ) == true )868 {869 READ_FLAG( uiCode, "output_layer_flag" ); pcVPS->setOutputLayerFlag( layerSet, layer, uiCode == 1 ? true : false );870 }871 }872 }873 874 for( Int i = 1; i <= pcVPS->getMaxLayers() - 1; i++ )875 {876 for( Int j = 0; j < i; j++ )877 {878 READ_FLAG( uiCode, "direct_dependency_flag[i][j]" ); pcVPS->setDirectDependencyFlag( i, j, uiCode );879 }880 }881 882 READ_FLAG( uiCode, "vps_extension2_flag" );883 if (uiCode)884 {885 while ( xMoreRbspData() )886 {887 READ_FLAG( uiCode, "vps_extension2_data_flag");888 }889 }890 891 pcVPS->checkVPSExtensionSyntax();892 893 pcVPS->calcIvRefLayers();894 895 #else896 774 while ( xMoreRbspData() ) 897 775 { 898 776 READ_FLAG( uiCode, "vps_extension_data_flag"); 899 777 } 900 #endif901 778 } 902 779 … … 914 791 TComPPS* pps = NULL; 915 792 TComSPS* sps = NULL; 916 #if H_MV917 TComVPS* vps = NULL;918 #endif919 793 920 794 UInt firstSliceSegmentInPic; … … 931 805 //!KS: need to add error handling code here, if SPS is not available 932 806 assert(sps!=0); 933 #if H_MV934 vps = parameterSetManager->getPrefetchedVPS(sps->getVPSId());935 assert(vps!=0);936 rpcSlice->setVPS(vps);937 #endif938 807 rpcSlice->setSPS(sps); 939 808 rpcSlice->setPPS(pps); … … 1523 1392 for (Int i = 0; i < maxNumSubLayersMinus1; i++) 1524 1393 { 1525 #if !H_MV1526 1394 if(profilePresentFlag) 1527 1395 { 1528 #endif1529 1396 READ_FLAG( uiCode, "sub_layer_profile_present_flag[i]" ); rpcPTL->setSubLayerProfilePresentFlag(i, uiCode); 1530 #if H_MV 1531 rpcPTL->setSubLayerProfilePresentFlag( i, profilePresentFlag && rpcPTL->getSubLayerProfilePresentFlag(i) ); 1532 #else 1533 } 1534 #endif 1397 } 1535 1398 READ_FLAG( uiCode, "sub_layer_level_present_flag[i]" ); rpcPTL->setSubLayerLevelPresentFlag (i, uiCode); 1536 1399 } -
branches/HTM-DEV-0.1-dev/source/Lib/TLibDecoder/TDecGop.cpp
r364 r367 205 205 } 206 206 207 #if !H_3D208 207 rpcPic->compressMotion(); 209 #endif210 208 Char c = (pcSlice->isIntra() ? 'I' : pcSlice->isInterP() ? 'P' : 'B'); 211 209 if (!pcSlice->isReferenced()) c += 32; 212 210 213 211 //-- For time output for each slice 214 #if H_MV215 printf("\nLayer %2d POC %4d TId: %1d ( %c-SLICE, QP%3d ) ", pcSlice->getLayerId(),216 pcSlice->getPOC(),217 pcSlice->getTLayer(),218 c,219 pcSlice->getSliceQp() );220 #else221 212 printf("\nPOC %4d TId: %1d ( %c-SLICE, QP%3d ) ", pcSlice->getPOC(), 222 213 pcSlice->getTLayer(), 223 214 c, 224 215 pcSlice->getSliceQp() ); 225 #endif226 216 227 217 m_dDecTime += (Double)(clock()-iBeforeTime) / CLOCKS_PER_SEC; … … 234 224 for (Int iRefIndex = 0; iRefIndex < pcSlice->getNumRefIdx(RefPicList(iRefList)); iRefIndex++) 235 225 { 236 #if H_MV237 if( pcSlice->getLayerId() != pcSlice->getRefLayerId( RefPicList(iRefList), iRefIndex ) )238 {239 printf( "V%d ", pcSlice->getRefLayerId( RefPicList(iRefList), iRefIndex ) );240 }241 else242 {243 #endif244 226 printf ("%d ", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex)); 245 #if H_MV246 }247 #endif248 227 } 249 228 printf ("] "); -
branches/HTM-DEV-0.1-dev/source/Lib/TLibDecoder/TDecTop.cpp
r364 r367 39 39 #include "TDecTop.h" 40 40 41 #if H_MV42 ParameterSetManagerDecoder TDecTop::m_parameterSetManagerDecoder;43 #endif44 41 //! \ingroup TLibDecoder 45 42 //! \{ … … 60 57 m_bFirstSliceInPicture = true; 61 58 m_bFirstSliceInSequence = true; 62 #if H_MV63 m_layerId = 0;64 m_viewId = 0;65 #if H_3D66 m_isDepth = false;67 #endif68 #endif69 59 } 70 60 … … 96 86 { 97 87 // initialize ROM 98 #if !H_MV99 88 initROM(); 100 #endif101 89 m_cGopDecoder.init( &m_cEntropyDecoder, &m_cSbacDecoder, &m_cBinCABAC, &m_cCavlcDecoder, &m_cSliceDecoder, &m_cLoopFilter, &m_cSAO); 102 90 m_cSliceDecoder.init( &m_cEntropyDecoder, &m_cCuDecoder ); … … 112 100 { 113 101 TComPic* pcPic = *(iterPic++); 114 #if H_MV115 if( pcPic )116 {117 #endif118 102 pcPic->destroy(); 119 103 120 104 delete pcPic; 121 105 pcPic = NULL; 122 #if H_MV123 }124 #endif125 106 } 126 107 … … 129 110 m_cLoopFilter. destroy(); 130 111 131 #if !H_MV132 112 // destroy ROM 133 113 destroyROM(); 134 #endif135 114 } 136 115 … … 198 177 } 199 178 200 #if H_MV201 Void TDecTop::endPicDecoding(Int& poc, TComList<TComPic*>*& rpcListPic, std::vector<Int>& targetDecLayerIdSet )202 #else203 179 Void TDecTop::executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic) 204 #endif205 180 { 206 181 if (!m_pcPic) … … 220 195 rpcListPic = &m_cListPic; 221 196 m_cCuDecoder.destroy(); 222 #if H_MV223 TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer );224 TComSlice::markIvRefPicsAsUnused ( m_ivPicLists, targetDecLayerIdSet, m_parameterSetManagerDecoder.getActiveVPS(), m_layerId, poc );225 #endif226 197 m_bFirstSliceInPicture = true; 227 198 … … 340 311 } 341 312 342 #if H_MV343 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag )344 {345 assert( nalu.m_layerId == m_layerId );346 347 #else348 313 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay ) 349 314 { 350 #endif351 315 TComPic*& pcPic = m_pcPic; 352 316 m_apcSlicePilot->initSlice(); … … 373 337 m_apcSlicePilot->setTLayerInfo(nalu.m_temporalId); 374 338 375 #if H_MV376 m_apcSlicePilot->setLayerId( nalu.m_layerId );377 #endif378 339 m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder); 379 340 380 #if H_MV381 TComVPS* vps = m_apcSlicePilot->getVPS();382 Int layerIdInVps = vps->getLayerIdInVps( nalu.m_layerId );383 384 setViewId( vps->getViewId( layerIdInVps ) );385 m_apcSlicePilot->setViewId( getViewId() );386 #if H_3D387 setIsDepth( vps->getDepthId( layerIdInVps ) == 1 );388 m_apcSlicePilot->setIsDepth( getIsDepth() );389 #endif390 #endif391 341 // Skip pictures due to random access 392 342 if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay)) … … 415 365 m_prevPOC = m_apcSlicePilot->getPOC(); 416 366 } 417 #if H_MV418 if ( newLayerFlag )419 {420 return false;421 }422 #endif423 367 // actual decoding starts here 424 368 xActivateParameterSets(); … … 440 384 m_cPrediction.initTempBuff(); 441 385 m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS()); 442 #if H_MV443 m_apcSlicePilot->createAndApplyIvReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer );444 #endif445 386 // Get a new picture buffer 446 387 xGetNewPicBuffer (m_apcSlicePilot, pcPic); … … 574 515 pcPic->setTLayer(nalu.m_temporalId); 575 516 576 #if H_MV577 pcPic->setLayerId( nalu.m_layerId );578 pcPic->setViewId ( getViewId() );579 #if H_3D580 pcPic->setIsDepth( getIsDepth() );581 #endif582 #endif583 517 if (bNextSlice) 584 518 { 585 519 pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_prevRAPisBLA, m_cListPic ); 586 520 // Set reference list 587 #if H_MV588 pcSlice->setRefPicList( m_cListPic, m_refPicSetInterLayer, true );589 #else590 521 #if FIX1071 591 522 pcSlice->setRefPicList( m_cListPic, true ); … … 594 525 #endif 595 526 596 #endif597 527 // For generalized B 598 528 // note: maybe not existed case (always L0 is copied to L1 if L1 is empty) … … 732 662 } 733 663 734 #if H_MV735 Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayerFlag)736 #else737 664 Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay) 738 #endif739 665 { 740 666 // Initialize entropy decoder … … 777 703 case NAL_UNIT_CODED_SLICE_RASL_N: 778 704 case NAL_UNIT_CODED_SLICE_RASL_R: 779 #if H_MV780 return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, newLayerFlag);781 #else782 705 return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay); 783 #endif784 706 break; 785 707 default: … … 861 783 } 862 784 863 #if H_MV864 TComPic* TDecTop::getPic( Int poc )865 {866 xGetPic( m_layerId, poc );867 TComList<TComPic*>* listPic = getListPic();868 TComPic* pcPic = NULL;869 for(TComList<TComPic*>::iterator it=listPic->begin(); it!=listPic->end(); it++)870 {871 if( (*it)->getPOC() == poc )872 {873 pcPic = *it ;874 break ;875 }876 }877 return pcPic;878 }879 880 TComPic* TDecTop::xGetPic( Int layerId, Int poc )881 {882 return m_ivPicLists->getPic( layerId, poc ) ;883 }884 885 #endif886 785 //! \} -
branches/HTM-DEV-0.1-dev/source/Lib/TLibDecoder/TDecTop.h
r366 r367 61 61 // ==================================================================================================================== 62 62 63 #if H_MV64 class TAppDecTop;65 #endif66 63 /// decoder class 67 64 class TDecTop … … 75 72 76 73 TComList<TComPic*> m_cListPic; // Dynamic buffer 77 #if H_MV78 static ParameterSetManagerDecoder m_parameterSetManagerDecoder; // storage for parameter sets79 #else80 74 ParameterSetManagerDecoder m_parameterSetManagerDecoder; // storage for parameter sets 81 #endif82 75 TComSlice* m_apcSlicePilot; 83 76 … … 105 98 Bool m_bFirstSliceInPicture; 106 99 Bool m_bFirstSliceInSequence; 107 #if H_MV108 // For H_MV m_bFirstSliceInSequence indicates first slice in sequence of the particular layer109 Int m_layerId;110 Int m_viewId;111 TComPicLists* m_ivPicLists;112 std::vector<TComPic*> m_refPicSetInterLayer;113 #if H_3D114 Bool m_isDepth;115 #endif116 #endif117 100 118 101 public: … … 126 109 127 110 Void init(); 128 #if H_MV129 Bool decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayer );130 #else131 111 Bool decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay); 132 #endif133 112 134 113 Void deletePicBuffer(); 135 114 136 #if H_MV137 Void endPicDecoding(Int& poc, TComList<TComPic*>*& rpcListPic, std::vector<Int>& targetDecLayerIdSet);138 #else139 115 Void executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic); 140 #endif141 116 142 #if H_MV143 TComPic* getPic ( Int poc );144 TComList<TComPic*>* getListPic () { return &m_cListPic; }145 Void setIvPicLists ( TComPicLists* picLists) { m_ivPicLists = picLists; }146 147 Int getCurrPoc () { return m_apcSlicePilot->getPOC(); }148 Void setLayerId ( Int layer) { m_layerId = layer; }149 Int getLayerId () { return m_layerId; }150 Void setViewId ( Int viewId ) { m_viewId = viewId; }151 Int getViewId () { return m_viewId; }152 #if H_3D153 Void setIsDepth ( Bool isDepth ) { m_isDepth = isDepth; }154 Bool getIsDepth () { return m_isDepth; }155 #endif156 #endif157 117 protected: 158 118 Void xGetNewPicBuffer (TComSlice* pcSlice, TComPic*& rpcPic); … … 160 120 161 121 Void xActivateParameterSets(); 162 #if H_MV163 TComPic* xGetPic( Int layerId, Int poc );164 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag );165 #else166 122 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay); 167 #endif168 123 Void xDecodeVPS(); 169 124 Void xDecodeSPS(); -
branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/NALwrite.cpp
r324 r367 53 53 bsNALUHeader.write(0,1); // forbidden_zero_bit 54 54 bsNALUHeader.write(nalu.m_nalUnitType, 6); // nal_unit_type 55 #if H_MV56 bsNALUHeader.write(nalu.m_layerId, 6); // layerId57 #else58 55 bsNALUHeader.write(nalu.m_reservedZero6Bits, 6); // nuh_reserved_zero_6bits 59 #endif60 56 bsNALUHeader.write(nalu.m_temporalId+1, 3); // nuh_temporal_id_plus1 61 57 … … 146 142 { 147 143 naluDest.m_nalUnitType = naluSrc.m_nalUnitType; 148 #if H_MV149 naluDest.m_layerId = naluSrc.m_layerId;150 #else151 144 naluDest.m_reservedZero6Bits = naluSrc.m_reservedZero6Bits; 152 #endif153 145 naluDest.m_temporalId = naluSrc.m_temporalId; 154 146 naluDest.m_Bitstream = naluSrc.m_Bitstream; -
branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/NALwrite.h
r324 r367 57 57 NalUnitType nalUnitType, 58 58 UInt temporalID = 0, 59 #if H_MV60 Int layerId = 0)61 #else62 59 UInt reserved_zero_6bits = 0) 63 #endif64 #if H_MV65 : NALUnit(nalUnitType, temporalID, layerId)66 #else67 60 : NALUnit(nalUnitType, temporalID, reserved_zero_6bits) 68 #endif69 61 , m_Bitstream() 70 62 {} -
branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/TEncAnalyze.cpp
r324 r367 36 36 */ 37 37 38 #if !H_MV39 38 #include "TEncAnalyze.h" 40 #endif41 39 42 40 //! \ingroup TLibEncoder … … 47 45 ////////////////////////////////////////////////////////////////////// 48 46 49 #if !H_MV50 47 TEncAnalyze m_gcAnalyzeAll; 51 48 TEncAnalyze m_gcAnalyzeI; 52 49 TEncAnalyze m_gcAnalyzeP; 53 50 TEncAnalyze m_gcAnalyzeB; 54 #endif55 51 56 52 //! \} -
branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/TEncAnalyze.h
r324 r367 150 150 }; 151 151 152 #if !H_MV153 152 extern TEncAnalyze m_gcAnalyzeAll; 154 153 extern TEncAnalyze m_gcAnalyzeI; 155 154 extern TEncAnalyze m_gcAnalyzeP; 156 155 extern TEncAnalyze m_gcAnalyzeB; 157 #endif158 156 159 157 //! \} -
branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r366 r367 549 549 } 550 550 551 #if H_MV552 WRITE_FLAG( 1, "sps_extension_flag" );553 554 WRITE_FLAG( pcSPS->getInterViewMvVertConstraintFlag() ? 1 : 0, "inter_view_mv_vert_constraint_flag" );555 #else556 551 WRITE_FLAG( 0, "sps_extension_flag" ); 557 #endif558 552 } 559 553 … … 562 556 WRITE_CODE( pcVPS->getVPSId(), 4, "vps_video_parameter_set_id" ); 563 557 WRITE_CODE( 3, 2, "vps_reserved_three_2bits" ); 564 #if H_MV565 WRITE_CODE( pcVPS->getMaxLayers() - 1, 6, "vps_max_layers_minus1" );566 #else567 558 WRITE_CODE( 0, 6, "vps_reserved_zero_6bits" ); 568 #endif569 559 WRITE_CODE( pcVPS->getMaxTLayers() - 1, 3, "vps_max_sub_layers_minus1" ); 570 560 WRITE_FLAG( pcVPS->getTemporalNestingFlag(), "vps_temporal_id_nesting_flag" ); 571 561 assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag()); 572 #if H_MV573 WRITE_CODE( 0xffff, 16, "vps_extension_offset" );574 #else575 562 WRITE_CODE( 0xffff, 16, "vps_reserved_ffff_16bits" ); 576 #endif577 563 codePTL( pcVPS->getPTL(), true, pcVPS->getMaxTLayers() - 1 ); 578 564 #if SIGNAL_BITRATE_PICRATE_IN_VPS … … 597 583 598 584 assert( pcVPS->getNumHrdParameters() <= MAX_VPS_NUM_HRD_PARAMETERS ); 599 #if H_MV600 assert( pcVPS->getMaxNuhLayerId() < MAX_VPS_NUH_LAYER_ID_PLUS1 );601 WRITE_CODE( pcVPS->getMaxNuhLayerId(), 6, "vps_max_nuh_layer_id" );602 #else603 585 assert( pcVPS->getMaxNuhReservedZeroLayerId() < MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1 ); 604 586 WRITE_CODE( pcVPS->getMaxNuhReservedZeroLayerId(), 6, "vps_max_nuh_reserved_zero_layer_id" ); 605 #endif606 587 pcVPS->setMaxOpSets(1); 607 588 WRITE_UVLC( pcVPS->getMaxOpSets() - 1, "vps_max_op_sets_minus1" ); … … 609 590 { 610 591 // Operation point set 611 #if H_MV612 for( UInt i = 0; i <= pcVPS->getMaxNuhLayerId(); i ++ )613 #else614 592 for( UInt i = 0; i <= pcVPS->getMaxNuhReservedZeroLayerId(); i ++ ) 615 #endif616 593 { 617 594 // Only applicable for version 1 … … 654 631 } 655 632 #endif 656 #if H_MV657 WRITE_FLAG( 1, "vps_extension_flag" );658 659 m_pcBitIf->writeAlignOne();660 661 WRITE_FLAG( pcVPS->getAvcBaseLayerFlag() ? 1 : 0, "avc_base_layer_flag" );662 WRITE_FLAG( pcVPS->getSplittingFlag() ? 1 : 0, "splitting_flag" );663 664 for( Int type = 0; type < MAX_NUM_SCALABILITY_TYPES; type++ )665 {666 WRITE_FLAG( pcVPS->getScalabilityMask( type ) ? 1 : 0, "scalability_mask[i]" );667 }668 669 for( Int sIdx = 0; sIdx < pcVPS->getNumScalabilityTypes( ); sIdx++ )670 {671 WRITE_CODE( pcVPS->getDimensionIdLen( sIdx ) - 1 , 3, "dimension_id_len_minus1[j]");672 }673 674 WRITE_FLAG( pcVPS->getVpsNuhLayerIdPresentFlag() ? 1 : 0, "vps_nuh_layer_id_present_flag");675 676 for( Int layer = 1; layer <= pcVPS->getMaxLayers() - 1; layer++ )677 {678 if (pcVPS->getVpsNuhLayerIdPresentFlag() )679 WRITE_CODE( pcVPS->getLayerIdInNuh( layer ), 6, "layer_id_in_nuh[i]");680 for( Int sIdx = 0; sIdx < pcVPS->getNumScalabilityTypes() ; sIdx++ )681 {682 WRITE_CODE( pcVPS->getDimensionId( layer, sIdx ), pcVPS->getDimensionIdLen( sIdx ), "dimension_id[i][j]");683 }684 }685 686 for( Int layerSet = 1; layerSet <= pcVPS->getMaxOpSets() - 1; layerSet++ )687 {688 WRITE_FLAG( pcVPS->getVpsProfilePresentFlag( layerSet ) ? 1 : 0, "vps_profile_present_flag[lsIdx]" );689 if( pcVPS->getVpsProfilePresentFlag( layerSet ) == false )690 {691 WRITE_UVLC( pcVPS->getProfileLayerSetRefMinus1( layerSet ), "profile_layer_set_ref_minus1[lsIdx]" );692 }693 codePTL( pcVPS->getPTL( layerSet ), pcVPS->getVpsProfilePresentFlag( layerSet ), pcVPS->getMaxTLayers() - 1 );694 }695 696 WRITE_UVLC( pcVPS->getNumOutputLayerSets(), "num_output_layer_sets" );697 698 for( Int layerSet = 0; layerSet < pcVPS->getNumOutputLayerSets(); layerSet++ )699 {700 WRITE_UVLC( pcVPS->getOutputLayerSetIdx( layerSet ), "output_layer_set_idx[i]" );701 for( Int layer = 0; layer <= pcVPS->getMaxNuhLayerId(); layer++ )702 {703 if( pcVPS->getLayerIdIncludedFlag( pcVPS->getOutputLayerSetIdx( layerSet ), layer ) == true )704 {705 WRITE_FLAG( pcVPS->getOutputLayerFlag( layerSet, layer ) ? 1 : 0, "output_layer_flag" );706 }707 }708 }709 710 for( Int i = 1; i <= pcVPS->getMaxLayers() - 1; i++ )711 {712 for( Int j = 0; j < i; j++ )713 {714 WRITE_FLAG( pcVPS->getDirectDependencyFlag( i, j ), "direct_dependency_flag[i][j]" );715 }716 }717 WRITE_FLAG( 0, "vps_extension2_flag" );718 #else719 633 WRITE_FLAG( 0, "vps_extension_flag" ); 720 #endif721 634 722 635 //future extensions here.. … … 1091 1004 for (Int i = 0; i < maxNumSubLayersMinus1; i++) 1092 1005 { 1093 #if !H_MV1094 1006 if(profilePresentFlag) 1095 1007 { 1096 #endif1097 1008 WRITE_FLAG( pcPTL->getSubLayerProfilePresentFlag(i), "sub_layer_profile_present_flag[i]" ); 1098 #if !H_MV 1099 } 1100 #endif 1009 } 1101 1010 1102 1011 WRITE_FLAG( pcPTL->getSubLayerLevelPresentFlag(i), "sub_layer_level_present_flag[i]" ); -
branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/TEncCfg.h
r364 r367 69 69 Int m_numRefIdc; 70 70 Int m_refIdc[MAX_NUM_REF_PICS+1]; 71 #if H_MV72 Int m_numInterViewRefPics;73 Int m_interViewRefs [MAX_NUM_REF_PICS];74 Int m_interViewRefPosL[2][MAX_NUM_REF_PICS];75 #endif76 71 GOPEntry() 77 72 : m_POC(-1) … … 88 83 , m_deltaRPS(0) 89 84 , m_numRefIdc(0) 90 #if H_MV91 , m_numInterViewRefPics(0)92 #endif93 85 { 94 86 ::memset( m_referencePics, 0, sizeof(m_referencePics) ); 95 87 ::memset( m_usedByCurrPic, 0, sizeof(m_usedByCurrPic) ); 96 88 ::memset( m_refIdc, 0, sizeof(m_refIdc) ); 97 #if H_MV98 ::memset( m_interViewRefs, 0, sizeof(m_interViewRefs) );99 ::memset( m_interViewRefPosL[0], -1, sizeof(m_interViewRefPosL[0]) ); ::memset( m_interViewRefPosL[1], -1, sizeof(m_interViewRefPosL[1]) );100 #endif101 89 } 102 90 }; … … 139 127 UInt m_uiDecodingRefreshType; ///< the type of decoding refresh employed for the random access. 140 128 Int m_iGOPSize; 141 #if H_MV142 GOPEntry m_GOPList[MAX_GOP+1];143 #else144 129 GOPEntry m_GOPList[MAX_GOP]; 145 #endif146 130 Int m_extraRPSs; 147 131 Int m_maxDecPicBuffering[MAX_TLAYER]; … … 353 337 Bool m_useStrongIntraSmoothing; ///< enable the use of strong intra smoothing (bi_linear interpolation) for 32x32 blocks when reference samples are flat. 354 338 355 #if H_MV356 Int m_layerId;357 Int m_layerIdInVps;358 Int m_viewId;359 #if H_3D360 Bool m_isDepth;361 #endif362 #endif363 339 public: 364 340 TEncCfg() 365 341 : m_puiColumnWidth() 366 342 , m_puiRowHeight() 367 #if H_MV368 , m_layerId(-1)369 , m_layerIdInVps(-1)370 , m_viewId(-1)371 #if H_3D372 , m_isDepth(false)373 #endif374 #endif375 343 {} 376 344 … … 394 362 Void setFramesToBeEncoded ( Int i ) { m_framesToBeEncoded = i; } 395 363 396 #if H_MV397 Void setLayerId ( Int layerId ) { m_layerId = layerId; }398 Int getLayerId () { return m_layerId; }399 Int getLayerIdInVps () { return m_layerIdInVps; }400 Void setLayerIdInVps ( Int layerIdInVps) { m_layerIdInVps = layerIdInVps; }401 Void setViewId ( Int viewId ) { m_viewId = viewId; }402 Int getViewId () { return m_viewId; }403 #if H_3D404 Void setIsDepth ( Bool isDepth ) { m_isDepth = isDepth; }405 Bool getIsDepth () { return m_isDepth; }406 #endif407 #endif408 364 //====== Coding Structure ======== 409 365 Void setIntraPeriod ( Int i ) { m_uiIntraPeriod = (UInt)i; } 410 366 Void setDecodingRefreshType ( Int i ) { m_uiDecodingRefreshType = (UInt)i; } 411 367 Void setGOPSize ( Int i ) { m_iGOPSize = i; } 412 #if H_MV413 Void setGopList ( GOPEntry* GOPList ) { for ( Int i = 0; i < MAX_GOP+1; i++ ) m_GOPList[i] = GOPList[i]; }414 #else415 368 Void setGopList ( GOPEntry* GOPList ) { for ( Int i = 0; i < MAX_GOP; i++ ) m_GOPList[i] = GOPList[i]; } 416 #endif417 369 Void setExtraRPSs ( Int i ) { m_extraRPSs = i; } 418 370 GOPEntry getGOPEntry ( Int i ) { return m_GOPList[i]; } -
branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r366 r367 100 100 #endif 101 101 #endif 102 #if H_MV103 m_layerId = 0;104 m_viewId = 0;105 m_pocLastCoded = -1;106 #if H_3D107 m_isDepth = false;108 #endif109 #endif110 102 return; 111 103 } … … 147 139 m_totalCoded = 0; 148 140 149 #if H_MV150 m_ivPicLists = pcTEncTop->getIvPicLists();151 m_layerId = pcTEncTop->getLayerId();152 m_viewId = pcTEncTop->getViewId();153 #if H_3D154 m_isDepth = pcTEncTop->getIsDepth();155 #endif156 #endif157 141 } 158 142 … … 358 342 // Public member functions 359 343 // ==================================================================================================================== 360 #if H_MV361 Void TEncGOP::initGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP)362 {363 xInitGOP( iPOCLast, iNumPicRcvd, rcListPic, rcListPicYuvRecOut );364 m_iNumPicCoded = 0;365 }366 #endif367 #if H_MV368 Void TEncGOP::compressPicInGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP, Int iGOPid)369 #else370 344 Void TEncGOP::compressGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP) 371 #endif372 345 { 373 346 TComPic* pcPic; … … 381 354 TComOutputBitstream* pcSubstreamsOut = NULL; 382 355 383 #if !H_MV384 356 xInitGOP( iPOCLast, iNumPicRcvd, rcListPic, rcListPicYuvRecOut ); 385 357 386 358 m_iNumPicCoded = 0; 387 #endif388 359 SEIPictureTiming pictureTimingSEI; 389 360 #if L0208_SOP_DESCRIPTION_SEI … … 408 379 UInt *accumNalsDU = NULL; 409 380 SEIDecodingUnitInfo decodingUnitInfoSEI; 410 #if !H_MV411 381 for ( Int iGOPid=0; iGOPid < m_iGopSize; iGOPid++ ) 412 #endif413 382 { 414 383 UInt uiColDir = 1; … … 469 438 if(pocCurr>=m_pcCfg->getFramesToBeEncoded()) 470 439 { 471 #if H_MV472 delete pcBitstreamRedirect;473 return;474 #else475 440 continue; 476 #endif477 441 } 478 442 … … 495 459 pcSlice->setLastIDR(m_iLastIDR); 496 460 pcSlice->setSliceIdx(0); 497 #if H_MV498 pcPic ->setLayerId ( getLayerId() );499 pcPic ->setViewId ( getViewId() );500 pcSlice->setLayerId ( getLayerId() );501 pcSlice->setViewId ( getViewId() );502 pcSlice->setVPS ( m_pcEncTop->getVPS() );503 #if H_3D504 pcPic ->setIsDepth( getIsDepth() );505 pcSlice->setIsDepth( getIsDepth() );506 #endif507 #endif508 461 //set default slice level flag to the same as SPS level flag 509 462 pcSlice->setLFCrossSliceBoundaryFlag( pcSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag() ); … … 543 496 } 544 497 545 #if H_MV 498 if(pcSlice->getSliceType()==B_SLICE&&m_pcCfg->getGOPEntry(iGOPid).m_sliceType=='P') 499 { 500 pcSlice->setSliceType(P_SLICE); 501 } 546 502 // Set the nal unit type 547 503 pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR)); 548 if( pcSlice->getSliceType() == B_SLICE )549 {550 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' )551 {552 pcSlice->setSliceType( P_SLICE );553 }554 }555 #else556 if(pcSlice->getSliceType()==B_SLICE&&m_pcCfg->getGOPEntry(iGOPid).m_sliceType=='P')557 {558 pcSlice->setSliceType(P_SLICE);559 }560 // Set the nal unit type561 pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR));562 #endif563 504 if(pcSlice->getTemporalLayerNonReferenceFlag()) 564 505 { … … 648 589 refPicListModification->setRefPicListModificationFlagL0(0); 649 590 refPicListModification->setRefPicListModificationFlagL1(0); 650 #if H_MV651 pcSlice->createAndApplyIvReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer );652 pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid ).m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer.size() ) ) );653 pcSlice->setNumRefIdx(REF_PIC_LIST_1,min(m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid ).m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer.size() ) ) );654 xSetRefPicListModificationsMvc( pcSlice, pocCurr, iGOPid );655 #else656 591 pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive,pcSlice->getRPS()->getNumberOfPictures())); 657 592 pcSlice->setNumRefIdx(REF_PIC_LIST_1,min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive,pcSlice->getRPS()->getNumberOfPictures())); 658 #endif659 593 660 594 #if ADAPTIVE_QP_SELECTION … … 663 597 664 598 // Set reference list 665 #if H_MV666 pcSlice->setRefPicList( rcListPic, m_refPicSetInterLayer );667 #else668 599 pcSlice->setRefPicList ( rcListPic ); 669 #endif670 600 671 601 // Slice info. refinement 672 #if H_MV673 if ( pcSlice->getSliceType() == B_SLICE )674 {675 if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() == true && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' )676 {677 pcSlice->setSliceType( P_SLICE );678 }679 }680 #else681 602 if ( (pcSlice->getSliceType() == B_SLICE) && (pcSlice->getNumRefIdx(REF_PIC_LIST_1) == 0) ) 682 603 { 683 604 pcSlice->setSliceType ( P_SLICE ); 684 605 } 685 #endif686 606 #if !L0034_COMBINED_LIST_CLEANUP 687 607 if (pcSlice->getSliceType() != B_SLICE || !pcSlice->getSPS()->getUseLComb()) … … 1100 1020 { 1101 1021 OutputNALUnit nalu(NAL_UNIT_VPS); 1102 #if H_MV1103 if( getLayerId() == 0 )1104 {1105 #endif1106 1022 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 1107 1023 m_pcEntropyCoder->encodeVPS(m_pcEncTop->getVPS()); … … 1112 1028 #endif 1113 1029 1114 #if H_MV1115 }1116 nalu = NALUnit(NAL_UNIT_SPS, 0, getLayerId());1117 #else1118 1030 nalu = NALUnit(NAL_UNIT_SPS); 1119 #endif1120 1031 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 1121 1032 if (m_bSeqFirst) … … 1150 1061 #endif 1151 1062 1152 #if H_MV1153 nalu = NALUnit(NAL_UNIT_PPS, 0, getLayerId());1154 #else1155 1063 nalu = NALUnit(NAL_UNIT_PPS); 1156 #endif1157 1064 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 1158 1065 m_pcEntropyCoder->encodePPS(pcSlice->getPPS()); … … 1476 1383 m_pcEntropyCoder->resetEntropy (); 1477 1384 /* start slice NALunit */ 1478 #if H_MV1479 OutputNALUnit nalu( pcSlice->getNalUnitType(), pcSlice->getTLayer(), getLayerId() );1480 #else1481 1385 OutputNALUnit nalu( pcSlice->getNalUnitType(), pcSlice->getTLayer() ); 1482 #endif1483 1386 Bool sliceSegment = (!pcSlice->isNextSlice()); 1484 1387 if (!sliceSegment) … … 1707 1610 } 1708 1611 1709 #if !H_3D1710 1612 pcPic->compressMotion(); 1711 #endif1712 #if H_MV1713 m_pocLastCoded = pcPic->getPOC();1714 #endif1715 1613 //-- For time output for each slice 1716 1614 Double dEncTime = (Double)(clock()-iBeforeTime) / CLOCKS_PER_SEC; … … 2023 1921 2024 1922 pcPic->setReconMark ( true ); 2025 #if H_MV2026 TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer );2027 std::vector<Int> temp;2028 TComSlice::markIvRefPicsAsUnused ( m_ivPicLists, temp, pcPic->getSlice(0)->getVPS(), m_layerId, pcPic->getPOC() );2029 #endif2030 1923 m_bFirst = false; 2031 1924 m_iNumPicCoded++; … … 2048 1941 if( accumNalsDU != NULL) delete accumNalsDU; 2049 1942 2050 #if !H_MV2051 1943 assert ( m_iNumPicCoded == iNumPicRcvd ); 2052 #endif2053 1944 } 2054 1945 2055 #if !H_MV2056 1946 Void TEncGOP::printOutSummary(UInt uiNumAllPicCoded) 2057 1947 { … … 2089 1979 printf("\nRVM: %.3lf\n" , xCalculateRVM()); 2090 1980 } 2091 #endif2092 1981 2093 1982 Void TEncGOP::preLoopFilterPicAll( TComPic* pcPic, UInt64& ruiDist, UInt64& ruiBits ) … … 2365 2254 2366 2255 //===== add PSNR ===== 2367 #if H_MV2368 m_pcEncTop->getAnalyzeAll()->addResult (dYPSNR, dUPSNR, dVPSNR, (Double)uibits);2369 #else2370 2256 m_gcAnalyzeAll.addResult (dYPSNR, dUPSNR, dVPSNR, (Double)uibits); 2371 #endif2372 2257 TComSlice* pcSlice = pcPic->getSlice(0); 2373 2258 if (pcSlice->isIntra()) 2374 2259 { 2375 #if H_MV2376 m_pcEncTop->getAnalyzeI()->addResult (dYPSNR, dUPSNR, dVPSNR, (Double)uibits);2377 #else2378 2260 m_gcAnalyzeI.addResult (dYPSNR, dUPSNR, dVPSNR, (Double)uibits); 2379 #endif2380 2261 } 2381 2262 if (pcSlice->isInterP()) 2382 2263 { 2383 #if H_MV2384 m_pcEncTop->getAnalyzeP()->addResult (dYPSNR, dUPSNR, dVPSNR, (Double)uibits);2385 #else2386 2264 m_gcAnalyzeP.addResult (dYPSNR, dUPSNR, dVPSNR, (Double)uibits); 2387 #endif2388 2265 } 2389 2266 if (pcSlice->isInterB()) 2390 2267 { 2391 #if H_MV2392 m_pcEncTop->getAnalyzeB()->addResult (dYPSNR, dUPSNR, dVPSNR, (Double)uibits);2393 #else2394 2268 m_gcAnalyzeB.addResult (dYPSNR, dUPSNR, dVPSNR, (Double)uibits); 2395 #endif2396 2269 } 2397 2270 … … 2400 2273 2401 2274 #if ADAPTIVE_QP_SELECTION 2402 #if H_MV2403 printf("Layer %3d POC %4d TId: %1d ( %c-SLICE, nQP %d QP %d ) %10d bits",2404 pcSlice->getLayerId(),2405 pcSlice->getPOC(),2406 pcSlice->getTLayer(),2407 c,2408 pcSlice->getSliceQpBase(),2409 pcSlice->getSliceQp(),2410 uibits );2411 #else2412 2275 printf("POC %4d TId: %1d ( %c-SLICE, nQP %d QP %d ) %10d bits", 2413 2276 pcSlice->getPOC(), … … 2417 2280 pcSlice->getSliceQp(), 2418 2281 uibits ); 2419 #endif2420 #else2421 #if H_MV2422 printf("Layer %3d POC %4d TId: %1d ( %c-SLICE, QP %d ) %10d bits",2423 pcSlice->getLayerId(),2424 pcSlice->getPOC()-pcSlice->getLastIDR(),2425 pcSlice->getTLayer(),2426 c,2427 pcSlice->getSliceQp(),2428 uibits );2429 2282 #else 2430 2283 printf("POC %4d TId: %1d ( %c-SLICE, QP %d ) %10d bits", … … 2434 2287 pcSlice->getSliceQp(), 2435 2288 uibits ); 2436 #endif2437 2289 2438 2290 #endif … … 2445 2297 for (Int iRefIndex = 0; iRefIndex < pcSlice->getNumRefIdx(RefPicList(iRefList)); iRefIndex++) 2446 2298 { 2447 #if H_MV2448 if( pcSlice->getLayerId() != pcSlice->getRefLayerId( RefPicList(iRefList), iRefIndex ) )2449 {2450 printf( "V%d ", pcSlice->getRefLayerId( RefPicList(iRefList), iRefIndex ) );2451 }2452 else2453 {2454 #endif2455 2299 printf ("%d ", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex)-pcSlice->getLastIDR()); 2456 #if H_MV2457 }2458 #endif2459 2300 } 2460 2301 printf("]"); … … 2822 2663 } 2823 2664 #endif 2824 #if H_MV2825 Void TEncGOP::xSetRefPicListModificationsMvc( TComSlice* pcSlice, UInt uiPOCCurr, UInt iGOPid )2826 {2827 TComVPS* vps = pcSlice->getVPS();2828 Int layer = pcSlice->getLayerIdInVps( );2829 2830 if( pcSlice->getSliceType() == I_SLICE || !(pcSlice->getPPS()->getListsModificationPresentFlag()) || vps->getNumDirectRefLayers( layer ) == 0 )2831 {2832 return;2833 }2834 2835 // analyze inter-view modifications2836 GOPEntry ge = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && ( layer > 0) ) ? MAX_GOP : iGOPid );2837 2838 TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification();2839 2840 Int maxRefListSize = pcSlice->getNumRpsCurrTempList();2841 Int numTemporalRefs = maxRefListSize - vps->getNumDirectRefLayers( layer );2842 2843 2844 for (Int li = 0; li < 2; li ++) // Loop over lists L0 and L12845 {2846 Int numModifications = 0;2847 2848 for( Int k = 0; k < ge.m_numInterViewRefPics; k++ )2849 {2850 numModifications += ( ge.m_interViewRefPosL[li][k] >= 0 ) ? 1 : 0;2851 }2852 2853 // set inter-view modifications2854 if( (maxRefListSize > 1) && (numModifications > 0) )2855 {2856 refPicListModification->setRefPicListModificationFlagL( li, true );2857 Int tempList[16];2858 for( Int k = 0; k < 16; k++ ) { tempList[k] = -1; }2859 2860 Bool isModified = false;2861 for( Int k = 0; k < ge.m_numInterViewRefPics; k++ )2862 {2863 if( ge.m_interViewRefPosL[li][k] >= 0 )2864 {2865 Int orgIdx = numTemporalRefs;2866 Int targetIdx = ge.m_interViewRefPosL[ li ][ k ];2867 for( Int idx = 0; idx < vps->getNumDirectRefLayers( layer ); idx++ )2868 {2869 Int refLayer = vps->getLayerIdInVps( vps->getRefLayerId( layer, idx ) );2870 if( ( layer + ge.m_interViewRefs[ k ]) == refLayer )2871 {2872 tempList[ targetIdx ] = orgIdx;2873 isModified = ( targetIdx != orgIdx );2874 }2875 orgIdx++;2876 }2877 }2878 }2879 if( isModified )2880 {2881 Int temporalRefIdx = 0;2882 for( Int i = 0; i < pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 ); i++ )2883 {2884 if( tempList[i] >= 0 )2885 {2886 refPicListModification->setRefPicSetIdxL( li, i, tempList[i] );2887 }2888 else2889 {2890 refPicListModification->setRefPicSetIdxL( li, i, temporalRefIdx );2891 temporalRefIdx++;2892 }2893 }2894 }2895 else2896 {2897 refPicListModification->setRefPicListModificationFlagL( li, false );2898 }2899 }2900 }2901 }2902 #endif2903 2665 //! \} -
branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/TEncGOP.h
r364 r367 97 97 SEIWriter m_seiWriter; 98 98 99 #if H_MV100 TComPicLists* m_ivPicLists;101 std::vector<TComPic*> m_refPicSetInterLayer;102 103 Int m_pocLastCoded;104 Int m_layerId;105 Int m_viewId;106 #if H_3D107 Bool m_isDepth;108 #endif109 #endif110 99 //--Adaptive Loop filter 111 100 TEncSampleAdaptiveOffset* m_pcSAO; … … 144 133 145 134 Void init ( TEncTop* pcTEncTop ); 146 #if H_MV147 Void initGOP ( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP);148 Void compressPicInGOP ( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP, Int iGOPid );149 #else150 135 Void compressGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRec, std::list<AccessUnit>& accessUnitsInGOP ); 151 #endif152 136 Void xAttachSliceDataToNalUnit (OutputNALUnit& rNalu, TComOutputBitstream*& rpcBitstreamRedirect); 153 137 154 #if H_MV155 Int getPocLastCoded () { return m_pocLastCoded; }156 Int getLayerId () { return m_layerId; }157 Int getViewId () { return m_viewId; }158 #if H_3D159 Bool getIsDepth () { return m_isDepth; }160 #endif161 #endif162 138 163 139 Int getGOPSize() { return m_iGopSize; } … … 165 141 TComList<TComPic*>* getListPic() { return m_pcListPic; } 166 142 167 #if !H_MV168 143 Void printOutSummary ( UInt uiNumAllPicCoded ); 169 #endif170 144 Void preLoopFilterPicAll ( TComPic* pcPic, UInt64& ruiDist, UInt64& ruiBits ); 171 145 … … 211 185 #endif 212 186 #endif 213 #if H_MV214 Void xSetRefPicListModificationsMvc( TComSlice* pcSlice, UInt uiPOCCurr, UInt iGOPid );215 #endif216 187 #if L0386_DB_METRIC 217 188 Void dblMetric( TComPic* pcPic, UInt uiNumSlices ); -
branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/TEncSlice.cpp
r365 r367 219 219 220 220 // slice type 221 #if H_MV222 SliceType eSliceTypeBaseView;223 if( pocLast == 0 || pocCurr % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0 )224 {225 eSliceTypeBaseView = I_SLICE;226 }227 else228 {229 eSliceTypeBaseView = B_SLICE;230 }231 SliceType eSliceType = eSliceTypeBaseView;232 if( eSliceTypeBaseView == I_SLICE && m_pcCfg->getGOPEntry(MAX_GOP).m_POC == 0 && m_pcCfg->getGOPEntry(MAX_GOP).m_sliceType != 'I' )233 {234 eSliceType = B_SLICE;235 }236 #else237 221 SliceType eSliceType; 238 222 … … 241 225 242 226 rpcSlice->setSliceType ( eSliceType ); 243 #endif244 227 245 228 // ------------------------------------------------------------------------------------------------------------------ … … 270 253 if (!(( m_pcCfg->getMaxDeltaQP() == 0 ) && (dQP == -rpcSlice->getSPS()->getQpBDOffsetY() ) && (rpcSlice->getSPS()->getUseLossless()))) 271 254 { 272 #if H_MV273 dQP += m_pcCfg->getGOPEntry( (eSliceTypeBaseView == I_SLICE) ? MAX_GOP : iGOPid ).m_QPOffset;274 #else275 255 dQP += m_pcCfg->getGOPEntry(iGOPid).m_QPOffset; 276 #endif277 256 } 278 257 } … … 317 296 #endif 318 297 // Case #1: I or P-slices (key-frame) 319 #if H_MV320 Double dQPFactor;321 if( eSliceType != I_SLICE )322 {323 dQPFactor = m_pcCfg->getGOPEntry( (eSliceTypeBaseView == I_SLICE) ? MAX_GOP : iGOPid ).m_QPFactor;324 }325 else326 #else327 298 Double dQPFactor = m_pcCfg->getGOPEntry(iGOPid).m_QPFactor; 328 299 if ( eSliceType==I_SLICE ) 329 #endif330 300 { 331 301 dQPFactor=0.57*dLambda_scale; … … 362 332 if( rpcSlice->getSliceType( ) != I_SLICE ) 363 333 { 364 #if H_MV365 dLambda *= m_pcCfg->getLambdaModifier( m_pcCfg->getGOPEntry((eSliceTypeBaseView == I_SLICE) ? MAX_GOP : iGOPid).m_temporalId );366 #else367 334 dLambda *= m_pcCfg->getLambdaModifier( m_pcCfg->getGOPEntry(iGOPid).m_temporalId ); 368 #endif369 335 } 370 336 … … 405 371 #if HB_LAMBDA_FOR_LDC 406 372 // restore original slice type 407 #if H_MV408 eSliceType = eSliceTypeBaseView;409 if( eSliceTypeBaseView == I_SLICE && m_pcCfg->getGOPEntry(MAX_GOP).m_POC == 0 && m_pcCfg->getGOPEntry(MAX_GOP).m_sliceType != 'I' )410 {411 eSliceType = B_SLICE;412 }413 #else414 373 eSliceType = (pocLast == 0 || pocCurr % m_pcCfg->getIntraPeriod() == 0 || m_pcGOPEncoder->getGOPSize() == 0) ? I_SLICE : eSliceType; 415 #endif416 374 417 375 rpcSlice->setSliceType ( eSliceType ); … … 431 389 rpcSlice->setSliceQpDeltaCb ( 0 ); 432 390 rpcSlice->setSliceQpDeltaCr ( 0 ); 433 #if H_MV434 rpcSlice->setNumRefIdx(REF_PIC_LIST_0,m_pcCfg->getGOPEntry( (eSliceTypeBaseView == I_SLICE) ? MAX_GOP : iGOPid ).m_numRefPicsActive);435 rpcSlice->setNumRefIdx(REF_PIC_LIST_1,m_pcCfg->getGOPEntry( (eSliceTypeBaseView == I_SLICE) ? MAX_GOP : iGOPid ).m_numRefPicsActive);436 #else437 391 rpcSlice->setNumRefIdx(REF_PIC_LIST_0,m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive); 438 392 rpcSlice->setNumRefIdx(REF_PIC_LIST_1,m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive); 439 #endif440 393 441 394 #if L0386_DB_METRIC … … 458 411 if ( !m_pcCfg->getLoopFilterOffsetInPPS() && eSliceType!=I_SLICE) 459 412 { 460 #if H_MV461 rpcSlice->getPPS()->setDeblockingFilterBetaOffsetDiv2( m_pcCfg->getGOPEntry((eSliceTypeBaseView == I_SLICE) ? MAX_GOP : iGOPid).m_betaOffsetDiv2 + m_pcCfg->getLoopFilterBetaOffset() );462 rpcSlice->getPPS()->setDeblockingFilterTcOffsetDiv2( m_pcCfg->getGOPEntry((eSliceTypeBaseView == I_SLICE) ? MAX_GOP : iGOPid).m_tcOffsetDiv2 + m_pcCfg->getLoopFilterTcOffset() );463 rpcSlice->setDeblockingFilterBetaOffsetDiv2( m_pcCfg->getGOPEntry((eSliceTypeBaseView == I_SLICE) ? MAX_GOP : iGOPid).m_betaOffsetDiv2 + m_pcCfg->getLoopFilterBetaOffset() );464 rpcSlice->setDeblockingFilterTcOffsetDiv2( m_pcCfg->getGOPEntry((eSliceTypeBaseView == I_SLICE) ? MAX_GOP : iGOPid).m_tcOffsetDiv2 + m_pcCfg->getLoopFilterTcOffset() );465 #else466 413 rpcSlice->getPPS()->setDeblockingFilterBetaOffsetDiv2( m_pcCfg->getGOPEntry(iGOPid).m_betaOffsetDiv2 + m_pcCfg->getLoopFilterBetaOffset() ); 467 414 rpcSlice->getPPS()->setDeblockingFilterTcOffsetDiv2( m_pcCfg->getGOPEntry(iGOPid).m_tcOffsetDiv2 + m_pcCfg->getLoopFilterTcOffset() ); 468 415 rpcSlice->setDeblockingFilterBetaOffsetDiv2( m_pcCfg->getGOPEntry(iGOPid).m_betaOffsetDiv2 + m_pcCfg->getLoopFilterBetaOffset() ); 469 416 rpcSlice->setDeblockingFilterTcOffsetDiv2( m_pcCfg->getGOPEntry(iGOPid).m_tcOffsetDiv2 + m_pcCfg->getLoopFilterTcOffset() ); 470 #endif471 417 } 472 418 else … … 489 435 rpcSlice->setDepth ( depth ); 490 436 491 #if H_MV492 pcPic->setTLayer( m_pcCfg->getGOPEntry( (eSliceTypeBaseView == I_SLICE) ? MAX_GOP : iGOPid ).m_temporalId );493 #else494 437 pcPic->setTLayer( m_pcCfg->getGOPEntry(iGOPid).m_temporalId ); 495 #endif496 438 if(eSliceType==I_SLICE) 497 439 { -
branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/TEncTop.cpp
r366 r367 42 42 #include "TLibCommon/ContextModel.h" 43 43 #endif 44 #if H_MV45 #include "../../App/TAppEncoder/TAppEncTop.h"46 #endif47 44 48 45 //! \ingroup TLibEncoder … … 81 78 m_pcBitCounters = NULL; 82 79 m_pcRdCosts = NULL; 83 #if H_MV84 m_ivPicLists = NULL;85 #endif86 80 } 87 81 … … 95 89 Void TEncTop::create () 96 90 { 97 #if !H_MV98 91 // initialize global variables 99 92 initROM(); 100 #endif101 93 102 94 // create processing unit classes … … 276 268 delete[] m_pcRdCosts; 277 269 278 #if !H_MV279 270 // destroy ROM 280 271 destroyROM(); 281 #endif282 272 283 273 return; … … 329 319 // ==================================================================================================================== 330 320 331 #if H_MV332 Void TEncTop::initNewPic( TComPicYuv* pcPicYuvOrg )333 {334 TComPic* pcPicCurr = NULL;335 336 // get original YUV337 xGetNewPicBuffer( pcPicCurr );338 pcPicYuvOrg->copyToPic( pcPicCurr->getPicYuvOrg() );339 340 // compute image characteristics341 if ( getUseAdaptiveQP() )342 {343 m_cPreanalyzer.xPreanalyze( dynamic_cast<TEncPic*>( pcPicCurr ) );344 }345 }346 #endif347 321 Void TEncTop::deletePicBuffer() 348 322 { … … 371 345 \retval iNumEncoded number of encoded pictures 372 346 */ 373 #if H_MV374 Void TEncTop::encode(Bool flush, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded , Int gopId )375 {376 #else377 347 Void TEncTop::encode(Bool flush, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded ) 378 348 { 379 #endif380 #if H_3D381 TComPic* picLastCoded = getPic( getGOPEncoder()->getPocLastCoded() );382 if( picLastCoded )383 {384 picLastCoded->compressMotion();385 }386 #endif387 #if H_MV388 if( gopId == 0)389 {390 m_cGOPEncoder.initGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut);391 #else392 349 if (pcPicYuvOrg) { 393 350 // get original YUV … … 408 365 return; 409 366 } 410 #endif411 367 412 368 #if RATE_CONTROL_LAMBDA_DOMAIN … … 417 373 #endif 418 374 419 #if H_MV420 }421 m_cGOPEncoder.compressPicInGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut, gopId );422 423 if( gopId + 1 == m_cGOPEncoder.getGOPSize() )424 {425 #else426 375 // compress GOP 427 376 m_cGOPEncoder.compressGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut); 428 #endif429 377 430 378 #if RATE_CONTROL_LAMBDA_DOMAIN … … 438 386 m_iNumPicRcvd = 0; 439 387 m_uiNumAllPicCoded += iNumEncoded; 440 #if H_MV441 }442 #endif443 388 } 444 389 … … 505 450 Void TEncTop::xInitSPS() 506 451 { 507 #if H_MV508 m_cSPS.setSPSId( getLayerIdInVps() );509 #endif510 452 ProfileTierLevel& profileTierLevel = *m_cSPS.getPTL()->getGeneralPTL(); 511 453 profileTierLevel.setLevelIdc(m_level); … … 652 594 Void TEncTop::xInitPPS() 653 595 { 654 #if H_MV655 if( m_cVPS.getNumDirectRefLayers( getLayerIdInVps() ) > 0 )656 {657 m_cPPS.setListsModificationPresentFlag( true );658 }659 m_cPPS.setPPSId( getLayerIdInVps() );660 m_cPPS.setSPSId( getLayerIdInVps() );661 #endif662 596 m_cPPS.setConstrainedIntraPred( m_bUseConstrainedIntraPred ); 663 597 Bool bUseDQP = (getMaxCuDQPDepth() > 0)? true : false; … … 963 897 Void TEncTop::selectReferencePictureSet(TComSlice* slice, Int POCCurr, Int GOPid ) 964 898 { 965 #if H_MV966 if( slice->getRapPicFlag() == true && getLayerId() > 0 && POCCurr == 0 )967 {968 TComReferencePictureSet* rps = slice->getLocalRPS();969 rps->setNumberOfNegativePictures(0);970 rps->setNumberOfPositivePictures(0);971 rps->setNumberOfLongtermPictures(0);972 rps->setNumberOfPictures(0);973 slice->setRPS(rps);974 }975 else976 {977 #endif978 899 slice->setRPSidx(GOPid); 979 900 … … 1003 924 slice->setRPS(getSPS()->getRPSList()->getReferencePictureSet(slice->getRPSidx())); 1004 925 slice->getRPS()->setNumberOfPictures(slice->getRPS()->getNumberOfNegativePictures()+slice->getRPS()->getNumberOfPositivePictures()); 1005 #if H_MV1006 }1007 #endif1008 926 1009 927 } … … 1120 1038 } 1121 1039 } 1122 #if H_MV1123 Void TEncTop::printSummary( Int numAllPicCoded )1124 {1125 assert (numAllPicCoded == m_cAnalyzeAll.getNumPic());1126 1127 //--CFG_KDY1128 m_cAnalyzeAll.setFrmRate( getFrameRate() );1129 m_cAnalyzeI.setFrmRate( getFrameRate() );1130 m_cAnalyzeP.setFrmRate( getFrameRate() );1131 m_cAnalyzeB.setFrmRate( getFrameRate() );1132 1133 //-- all1134 printf( "\n\nSUMMARY ------------------------------------------- LayerId %2d\n", m_layerId );1135 1136 m_cAnalyzeAll.printOut('a');1137 1138 printf( "\n\nI Slices--------------------------------------------------------\n" );1139 m_cAnalyzeI.printOut('i');1140 1141 printf( "\n\nP Slices--------------------------------------------------------\n" );1142 m_cAnalyzeP.printOut('p');1143 1144 printf( "\n\nB Slices--------------------------------------------------------\n" );1145 m_cAnalyzeB.printOut('b');1146 1147 #if _SUMMARY_OUT_1148 m_cAnalyzeAll.printSummaryOut();1149 #endif1150 #if _SUMMARY_PIC_1151 m_cAnalyzeI.printSummary('I');1152 m_cAnalyzeP.printSummary('P');1153 m_cAnalyzeB.printSummary('B');1154 #endif1155 }1156 1157 Int TEncTop::getFrameId(Int iGOPid)1158 {1159 if(m_iPOCLast == 0)1160 {1161 return(0 );1162 }1163 else1164 {1165 return m_iPOCLast -m_iNumPicRcvd+ getGOPEntry(iGOPid).m_POC ;1166 }1167 }1168 1169 TComPic* TEncTop::getPic( Int poc )1170 {1171 TComList<TComPic*>* listPic = getListPic();1172 TComPic* pcPic = NULL;1173 for(TComList<TComPic*>::iterator it=listPic->begin(); it!=listPic->end(); it++)1174 {1175 if( (*it)->getPOC() == poc )1176 {1177 pcPic = *it ;1178 break ;1179 }1180 }1181 return pcPic;1182 }1183 #endif1184 1040 //! \} -
branches/HTM-DEV-0.1-dev/source/Lib/TLibEncoder/TEncTop.h
r364 r367 74 74 TComList<TComPic*> m_cListPic; ///< dynamic list of pictures 75 75 76 #if H_MV77 TComPicLists* m_ivPicLists; ///< access to picture lists of other layers78 #endif79 76 // encoder search 80 77 TEncSearch m_cSearch; ///< encoder search class … … 125 122 TEncRateCtrl m_cRateCtrl; ///< Rate control class 126 123 127 #if H_MV128 TEncAnalyze m_cAnalyzeAll;129 TEncAnalyze m_cAnalyzeI;130 TEncAnalyze m_cAnalyzeP;131 TEncAnalyze m_cAnalyzeB;132 #endif133 124 protected: 134 125 Void xGetNewPicBuffer ( TComPic*& rpcPic ); ///< get picture buffer which will be processed … … 146 137 Void destroy (); 147 138 Void init (); 148 #if H_MV149 TComPicLists* getIvPicLists() { return m_ivPicLists; }150 #endif151 139 Void deletePicBuffer (); 152 140 153 141 Void createWPPCoders(Int iNumSubstreams); 154 142 155 #if H_MV156 Void initNewPic(TComPicYuv* pcPicYuvOrg);157 #endif158 143 // ------------------------------------------------------------------------------------------------------------------- 159 144 // member access functions … … 192 177 #endif 193 178 TComScalingList* getScalingList () { return &m_scalingList; } 194 #if H_MV195 TEncAnalyze* getAnalyzeAll () { return &m_cAnalyzeAll; }196 TEncAnalyze* getAnalyzeI () { return &m_cAnalyzeI; }197 TEncAnalyze* getAnalyzeP () { return &m_cAnalyzeP; }198 TEncAnalyze* getAnalyzeB () { return &m_cAnalyzeB; }199 200 Int getNumAllPicCoded () { return m_uiNumAllPicCoded; }201 202 Int getFrameId (Int iGOPid);203 204 TComPic* getPic ( Int poc );205 Void setIvPicLists ( TComPicLists* picLists) { m_ivPicLists = picLists; }206 #endif207 179 // ------------------------------------------------------------------------------------------------------------------- 208 180 // encoder function … … 210 182 211 183 /// encode several number of pictures until end-of-sequence 212 #if H_MV213 Void encode( Bool bEos, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded , Int gopId );214 #else215 184 Void encode( Bool bEos, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, 216 185 std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded ); 217 #endif218 186 219 #if H_MV220 Void printSummary ( Int numAllPicCoded );221 #else222 187 void printSummary() { m_cGOPEncoder.printOutSummary (m_uiNumAllPicCoded); } 223 #endif224 188 }; 225 189
Note: See TracChangeset for help on using the changeset viewer.