Changeset 976 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComSlice.cpp
- Timestamp:
- 7 Jul 2014, 17:27:51 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/TComSlice.cpp
r964 r976 48 48 TComSlice::TComSlice() 49 49 : m_iPPSId ( -1 ) 50 #if H_MV _HLS_8_POC_Q0142_3250 #if H_MV 51 51 , m_slicePicOrderCntLsb ( 0 ) 52 52 #endif … … 1863 1863 #endif 1864 1864 { 1865 #if H_MV _HLS_8_SYN_Q0041_031865 #if H_MV 1866 1866 m_vpsBaseLayerInternalFlag = true; 1867 1867 #endif … … 1883 1883 m_vpsNumProfileTierLevelMinus1 = -1; 1884 1884 1885 #if H_MV_HLS_8_SYN_39_191886 1885 m_numAddLayerSets = 0; 1887 1886 m_numAddOlss = 0; 1888 #else1889 m_numAddLayerSets = -1;1890 #endif1891 1887 m_defaultOutputLayerIdc = 0; 1892 1888 … … 1902 1898 } 1903 1899 1904 #if H_MV_HLS_8_PMS_Q0195_201905 1900 m_repFormatIdxPresentFlag = false; 1906 #endif1907 1901 m_maxOneActiveRefLayerFlag = false; 1908 1902 m_directDepTypeLenMinus2 = 0; 1909 1903 1910 1904 1911 #if H_MV_HLS_8_RPS_Q0100_361912 1905 m_vpsExtensionFlag = true; 1913 #endif1914 m_avcBaseLayerFlag = false;1915 1906 m_vpsNonVuiExtensionLength = 0; 1916 1907 m_splittingFlag = false; … … 2032 2023 } 2033 2024 2034 2035 #if H_MV_HLS_8_PMS_Q0195_202036 2025 //The value of vps_num_rep_formats_minus1 shall be in the range of 0 to 255, inclusive. 2037 2026 assert( getVpsNumRepFormatsMinus1() >= 0 ); 2038 2027 assert( getVpsNumRepFormatsMinus1() <= 255 ); 2039 #endif2040 2028 2041 2029 return true; … … 2083 2071 } 2084 2072 2085 #if H_MV_HLS_82086 2073 for (Int i = 0 ; i < MAX_NUM_LAYER_IDS; i++ ) 2087 2074 { … … 2096 2083 } 2097 2084 } 2098 2099 2085 2100 2086 for( Int i = 0; i <= getMaxLayersMinus1(); i++ ) … … 2107 2093 } 2108 2094 } 2109 2110 2095 2111 2096 for( Int i = 0; i <= getMaxLayersMinus1(); i++ ) // Bug in spec "<" instead of "<=" … … 2149 2134 m_numIndependentLayers = k; 2150 2135 } 2151 #endif2152 2136 } 2153 2137 … … 2314 2298 Int TComVPS::getNumOutputLayerSets() 2315 2299 { 2316 #if H_MV_HLS_8_SYN_39_192317 2300 return getNumAddOlss() + getNumLayerSets(); 2318 #else2319 return getNumAddLayerSets() + getVpsNumLayerSetsMinus1() + 1;2320 #endif2321 2301 } 2322 2302 … … 2384 2364 } 2385 2365 } 2386 #if H_MV_HLS_8_PMS_Q0165_182387 2366 assert( getNumOutputLayersInOutputLayerSet( i ) > 0 ); 2388 #endif2389 2367 } 2390 2368 … … 2420 2398 { 2421 2399 Int maxSLMinus1 = 0; 2422 #if H_MV_HLS_8_MIS_Q0102_302423 2400 for( Int k = 0; k < getNumLayersInIdList( i ); k++ ) 2424 2401 { 2425 2402 Int lId = m_layerSetLayerIdList[i][k]; 2426 #else2427 Int optLsIdx = olsIdxToLsIdx( i );2428 2429 for( Int k = 0; k < getNumLayersInIdList( optLsIdx ); k++ )2430 {2431 Int lId = m_layerSetLayerIdList[optLsIdx][k];2432 #endif2433 2403 maxSLMinus1 = std::max( maxSLMinus1, getSubLayersVpsMaxMinus1( getLayerIdInVps( lId ) )); 2434 2404 } 2435 2405 return maxSLMinus1; 2436 2406 } 2437 #if H_MV_HLS_8_RPS_Q0100_36 2407 2438 2408 Void TComVPS::inferDbpSizeLayerSetZero( TComSPS* sps, Bool encoder ) 2439 2409 { … … 2458 2428 } 2459 2429 } 2460 #endif 2430 2431 Bool TComVPS::getAltOutputLayerFlagVar( Int i ) 2432 { 2433 // Semantics variable not syntax element ! 2434 2435 Bool altOptLayerFlag = false; 2436 if ( i > 0 && getNumOutputLayersInOutputLayerSet( i ) == 1 && 2437 getNumDirectRefLayers( getOlsHighestOutputLayerId( i ) ) > 0 ) 2438 { 2439 altOptLayerFlag = getAltOutputLayerFlag( i ); 2440 } 2441 return altOptLayerFlag; 2442 } 2443 2444 Int TComVPS::getMaxNumPics( Int layerId ) 2445 { 2446 Int maxNumPics = MAX_INT; 2447 for( Int olsIdx = 0; olsIdx < getNumOutputLayerSets(); olsIdx++) 2448 { 2449 Int lsIdx = olsIdxToLsIdx( olsIdx ); 2450 for( Int j = 0; j < getNumLayersInIdList( lsIdx ); j++ ) 2451 { 2452 if( getLayerSetLayerIdList(lsIdx, j ) == layerId ) 2453 { 2454 Int maxSL = getMaxSubLayersInLayerSetMinus1( lsIdx ); 2455 maxNumPics = std::min( maxNumPics, getDpbSize()->getMaxVpsDecPicBufferingMinus1( olsIdx , j, maxSL ) ); 2456 } 2457 } 2458 } 2459 assert( maxNumPics != MAX_INT ); 2460 return maxNumPics; 2461 } 2462 2463 Void TComVPS::xSetRefLayerFlags( Int currLayerId ) 2464 { 2465 for( Int j = 0; j < getNumDirectRefLayers( currLayerId ); j++ ) 2466 { 2467 Int refLayerId = m_refLayerId[ currLayerId ][ j ]; 2468 m_recursiveRefLayerFlag[ currLayerId ][ refLayerId ] = 1; 2469 for( Int k = 0; k < MAX_NUM_LAYER_IDS; k++ ) 2470 { 2471 m_recursiveRefLayerFlag[ currLayerId ][ k ] = m_recursiveRefLayerFlag[ currLayerId ][ k ] || m_recursiveRefLayerFlag[ refLayerId ][ k ]; 2472 } 2473 } 2474 } 2475 2461 2476 #endif // H_MV 2462 2477 … … 2530 2545 ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag)); 2531 2546 #if H_MV 2532 #if !H_MV_HLS_8_SPS_NODOC_482533 m_spsExtensionPresentFlag = false;2534 for( Int i = 0; i < PS_EX_T_MAX_NUM; i++ )2535 {2536 m_spsExtensionTypeFlag[ i ] = false;2537 }2538 #else2539 2547 m_spsRangeExtensionsFlag = false; 2540 2548 m_spsMultilayerExtensionFlag = false; … … 2544 2552 #else 2545 2553 m_spsExtension6bits = 0; 2546 #endif2547 2554 #endif 2548 2555 … … 2726 2733 2727 2734 #if H_MV 2728 #if H_MV_HLS_8_SPS_NODOC_482729 2735 m_ppsRangeExtensionsFlag = false; 2730 2736 m_ppsMultilayerExtensionFlag = false; … … 2734 2740 m_pps3dExtensionFlag = false; 2735 2741 m_ppsExtension5bits = 0; 2736 #endif2737 #else2738 for( Int i = 0; i < PS_EX_T_MAX_NUM; i++ )2739 {2740 m_ppsExtensionTypeFlag[ i ] = false;2741 }2742 2742 #endif 2743 2743 #endif … … 2984 2984 } 2985 2985 } 2986 2987 Void TComSPS::inferSpsMaxDecPicBufferingMinus1( TComVPS* vps, Int targetOptLayerSetIdx, Int currLayerId, Bool encoder ) 2988 { 2989 const std::vector<Int>& targetDecLayerIdList = vps->getTargetDecLayerIdList( vps->olsIdxToLsIdx( targetOptLayerSetIdx )); 2990 2991 if (getLayerId() > 0 ) 2992 { 2993 Int layerIdx = 0; 2994 while (layerIdx < (Int) targetDecLayerIdList.size() ) 2995 { 2996 if ( targetDecLayerIdList[layerIdx] == currLayerId ) 2997 { 2998 break; 2999 } 3000 layerIdx++; 3001 } 3002 3003 assert( layerIdx < (Int) targetDecLayerIdList.size() ); 3004 3005 for (Int i = 0; i <= getSpsMaxSubLayersMinus1(); i++ ) 3006 { 3007 Int maxDecPicBufferingMinus1 = vps->getDpbSize()->getMaxVpsDecPicBufferingMinus1( targetOptLayerSetIdx, layerIdx, i ) ; 3008 3009 if ( encoder ) 3010 { 3011 assert( getMaxDecPicBuffering( i ) - 1 == maxDecPicBufferingMinus1 ); 3012 } 3013 else 3014 { 3015 setMaxDecPicBuffering(i, maxDecPicBufferingMinus1 + 1 ); 3016 } 3017 } 3018 } 3019 } 3020 3021 Void TComSPS::checkRpsMaxNumPics( TComVPS* vps, Int currLayerId ) 3022 { 3023 // In spec, when rps is in SPS, nuh_layer_id of SPS is used instead 3024 // of nuh_layer_id of slice (currLayerId), this seems to be a bug. 3025 3026 for (Int i = 0; i < getRPSList()->getNumberOfReferencePictureSets(); i++ ) 3027 { 3028 TComReferencePictureSet* rps = getRPSList()->getReferencePictureSet( i ); 3029 if ( !rps->getInterRPSPrediction() ) 3030 { 3031 rps->checkMaxNumPics( vps->getVpsExtensionFlag(), vps->getMaxNumPics( currLayerId ), 3032 getLayerId(), getMaxDecPicBuffering( getSpsMaxSubLayersMinus1() ) - 1 ); 3033 } 3034 } 3035 } 3036 2986 3037 #endif 2987 3038 … … 3133 3184 printf("}\n"); 3134 3185 } 3186 #if H_MV 3187 Void TComReferencePictureSet::checkMaxNumPics( Bool vpsExtensionFlag, Int maxNumPics, Int nuhLayerId, Int spsMaxDecPicBufferingMinus1 ) 3188 { 3189 assert( getNumberOfPictures() >= 0 ); 3190 if ( nuhLayerId == 0 ) 3191 { 3192 assert( getNumberOfPictures() <= spsMaxDecPicBufferingMinus1 ); 3193 } 3194 3195 if ( vpsExtensionFlag ) 3196 { 3197 assert( getNumberOfPictures() <= maxNumPics ); 3198 } 3199 } 3200 #endif 3135 3201 3136 3202 TComRPSList::TComRPSList() … … 3279 3345 } 3280 3346 3281 #if !H_MV_HLS_8_DBP_NODOC_423282 Void TComSlice::markIvRefPicsAsUnused( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc )3283 {3284 // Fill targetDecLayerIdSet with all layers if empty (at encoder side)3285 if (targetDecLayerIdSet.size() == 0 )3286 {3287 for ( Int layerIdInVps = 0; layerIdInVps <= vps->getMaxLayersMinus1(); layerIdInVps++ )3288 {3289 targetDecLayerIdSet.push_back( vps->getLayerIdInNuh( layerIdInVps ) );3290 }3291 }3292 3293 Int numTargetDecLayers = (Int) targetDecLayerIdSet.size();3294 Int latestDecIdx;3295 for ( latestDecIdx = 0; latestDecIdx < numTargetDecLayers; latestDecIdx++)3296 {3297 if ( targetDecLayerIdSet[ latestDecIdx ] == curLayerId )3298 {3299 break;3300 }3301 }3302 3303 for( Int i = 0; i <= latestDecIdx; i++ )3304 {3305 if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ i ] ) )3306 {3307 TComPic* pcPic = ivPicLists->getPic( targetDecLayerIdSet[ i ], curPoc );3308 if ( pcPic )3309 {3310 if( pcPic->getSlice(0)->isReferenced() && pcPic->getSlice(0)->getTemporalLayerNonReferenceFlag() )3311 {3312 Bool remainingInterLayerReferencesFlag = false;3313 for( Int j = latestDecIdx + 1; j < numTargetDecLayers; j++ )3314 {3315 TComVPS* vpsSlice = pcPic->getSlice(0)->getVPS();3316 if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ j ] ) )3317 {3318 for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdSet[ j ] ); k++ )3319 {3320 if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdSet[ j ], k ) )3321 {3322 remainingInterLayerReferencesFlag = true;3323 }3324 }3325 }3326 }3327 if( !remainingInterLayerReferencesFlag )3328 {3329 pcPic->getSlice(0)->setReferenced( false );3330 }3331 }3332 }3333 }3334 }3335 }3336 #endif3337 3347 Void TComSlice::printRefPicList() 3338 3348 { … … 3351 3361 Void TComSlice::markCurrPic( TComPic* currPic ) 3352 3362 { 3353 3354 #if !H_MV_HLS_8_DBP_NODOC_42 3355 if ( !currPic->getSlice(0)->getDiscardableFlag() ) 3356 { 3357 #endif 3358 currPic->getSlice(0)->setReferenced( true ) ; 3359 currPic->setIsLongTerm( false ); 3360 #if !H_MV_HLS_8_DBP_NODOC_42 3361 } 3362 else 3363 { 3364 currPic->getSlice(0)->setReferenced( false ) ; 3365 } 3366 #endif 3367 3368 #if H_MV_HLS_7_VPS_P0300_27 3363 currPic->getSlice(0)->setReferenced( true ) ; 3364 currPic->setIsLongTerm( false ); 3365 3369 3366 currPic->setReconMark( true ); 3370 3367 currPic->setPicOutputFlag( currPic->getSlice(0)->getPicOutputFlag() ); 3371 #endif3372 3368 } 3373 3369 … … 3403 3399 Int refLayerIdx = vps->getLayerIdInVps( vps->getRefLayerId( getLayerId(), i ) ); 3404 3400 3405 #if H_MV_HLS_8_RPS_Q0060_173406 3401 Bool refLayerPicFlag = ( vps->getSubLayersVpsMaxMinus1( refLayerIdx ) >= getTLayer() ) && ( getTLayer() == 0 ) && 3407 3402 ( vps->getMaxTidIlRefPicsPlus1( refLayerIdx, vps->getLayerIdInVps( getLayerId() )) > getTLayer() ); 3408 #else3409 Bool refLayerPicFlag = ( vps->getSubLayersVpsMaxMinus1( refLayerIdx ) >= getTLayer() ) &&3410 ( vps->getMaxTidIlRefPicsPlus1( refLayerIdx, vps->getLayerIdInVps( getLayerId() )) > getTLayer() );3411 #endif3412 3403 3413 3404 return refLayerPicFlag; … … 3541 3532 #endif 3542 3533 #if H_3D_IC 3543 #if MTK_LOW_LATENCY_IC_ENCODING_H00863544 3534 Void TComSlice::xSetApplyIC(Bool bUseLowLatencyICEnc) 3545 #else 3546 Void TComSlice::xSetApplyIC() 3547 #endif 3548 { 3549 #if MTK_LOW_LATENCY_IC_ENCODING_H0086 3535 { 3550 3536 if(bUseLowLatencyICEnc) 3551 3537 { … … 3592 3578 Double ratio=Double(g_aICEnableNUM[refLayer])/Double(g_aICEnableCANDIDATE[refLayer]); 3593 3579 3594 if( ratio > MTK_LOW_LATENCY_IC_ENCODING_THRESHOLD_H0086)3580 if( ratio > IC_LOW_LATENCY_ENCODING_THRESHOLD) 3595 3581 { 3596 3582 m_bApplyIC=true; … … 3608 3594 else 3609 3595 { 3610 #endif3611 3596 Int iMaxPelValue = ( 1 << g_bitDepthY ); 3612 3597 Int *aiRefOrgHist; … … 3682 3667 aiCurrHist = NULL; 3683 3668 aiRefOrgHist = NULL; 3684 #if MTK_LOW_LATENCY_IC_ENCODING_H00863685 3669 }//if(bUseLowLatencyICEnc) 3686 #endif3687 3670 } 3688 3671 #endif … … 3774 3757 3775 3758 #if H_3D_DDD 3776 InitializeDDDPara( vps->getCamParPrecision(), codScale[ i ], codOffset[ i ], i );3759 initializeDDDPara( vps->getCamParPrecision(), codScale[ i ], codOffset[ i ], i ); 3777 3760 #endif 3778 3761 } … … 3782 3765 3783 3766 #if H_3D_DDD 3784 Void TComSlice:: InitializeDDDPara( UInt uiCamParsCodedPrecision, Int iCodedScale,Int iCodedOffset, Int iBaseViewIdx )3767 Void TComSlice::initializeDDDPara( UInt uiCamParsCodedPrecision, Int iCodedScale,Int iCodedOffset, Int iBaseViewIdx ) 3785 3768 { 3786 3769 UInt uiViewId = getViewIndex(); … … 3839 3822 3840 3823 return; 3824 } 3825 3826 3827 #endif 3828 3829 #if H_MV 3830 Void TComSlice::checkCrossLayerBlaFlag() 3831 { 3832 // cross_layer_bla_flag shall be equal to 0 for pictures with nal_unit_type not equal to IDR_W_RADL or IDR_N_LP or with nuh_layer_id not equal to 0. 3833 if ( getLayerId() != 0 || getNalUnitType() != NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) 3834 { 3835 assert( m_crossLayerBlaFlag == 0 ); 3836 } 3837 } 3838 3839 Bool TComSlice::inferPocMsbValPresentFlag() 3840 { 3841 Bool pocMsbValPresentFlag; 3842 if( getSliceSegmentHeaderExtensionLength() == 0 ) 3843 { 3844 pocMsbValPresentFlag = false; 3845 } 3846 else if ( getPocMsbValRequiredFlag() ) 3847 { 3848 pocMsbValPresentFlag = true; 3849 } 3850 else 3851 { 3852 pocMsbValPresentFlag = false; 3853 } 3854 3855 return pocMsbValPresentFlag; 3856 } 3857 3858 3859 #endif 3860 3861 #if H_3D_DBBP 3862 Int TComSlice::getDepthFromDV( Int iDV, Int iBaseViewIdx ) 3863 { 3864 return ClipY(( iDV * m_aiDDDInvScale[ iBaseViewIdx ] + m_aiDDDInvOffset[ iBaseViewIdx ] ) >> m_aiDDDShift[ iBaseViewIdx ]); 3841 3865 } 3842 3866 #endif … … 4331 4355 } 4332 4356 4357 Void TComVpsVuiBspHrdParameters::checkBspCombHrdAndShedIdx( TComVPS* vps, Int h, Int i, Int j ) 4358 { 4359 // bsp_comb_hrd_idx 4360 assert( getBspCombSchedIdx(h, i, j ) >= 0 ); 4361 assert( getBspCombSchedIdx(h, i, j ) <= getVpsNumBspHrdParametersMinus1() ); 4362 4363 // bsp_comb_sched_idx 4364 assert( getBspCombSchedIdx(h, i, j ) >= 0 ); 4365 4366 //* This check needs to activated, when HighestTid is available here 4367 // assert( getBspCombSchedIdx(h, i, j ) <= vps->getHrdParameters( getBspCombHrdIdx( h, i, j ) )->getCpbCntMinus1( highestTid ) ); 4368 } 4369 4333 4370 Void TComVUI::inferVideoSignalInfo( TComVPS* vps, Int layerIdCurr ) 4334 4371 { … … 4370 4407 } 4371 4408 } 4372 #endif 4409 4410 Void Window::scaleOffsets( Int scal ) 4411 { 4412 if (! m_scaledFlag ) 4413 { 4414 m_scaledFlag = true; 4415 m_winLeftOffset *= scal; 4416 m_winRightOffset *= scal; 4417 m_winTopOffset *= scal; 4418 m_winBottomOffset *= scal; 4419 } 4420 } 4421 #endif 4422
Note: See TracChangeset for help on using the changeset viewer.