📄 scalableseimodifycode.cpp
字号:
{
pcScalableModifyCode->WriteCode( pcScalableSei->getHorizontalOffset( uiLayer ), 16 );
pcScalableModifyCode->WriteCode( pcScalableSei->getVerticalOffset( uiLayer ), 16 );
pcScalableModifyCode->WriteCode( pcScalableSei->getRegionWidth( uiLayer ), 16 );
pcScalableModifyCode->WriteCode( pcScalableSei->getRegionHeight( uiLayer ), 16 );
}
}
//SEI changes update
//else
//{//JVT-S036 lsj
// pcScalableModifyCode->WriteUVLC( pcScalableSei->getSubRegionInfoSrcLayerIdDelta( uiLayer ) );
//}
//JVT-S036 lsj start
if( pcScalableSei->getSubPicLayerFlag( uiLayer ) )
{
//JVT-W051 {
//pcScalableModifyCode->WriteCode( pcScalableSei->getRoiId( uiLayer ), 3 );
pcScalableModifyCode->WriteUVLC( pcScalableSei->getRoiId( uiLayer ) );
//JVT-W051 }
}
// if( pcScalableSei->getIroiSliceDivisionInfoPresentFlag( uiLayer ) )
// {
// //JVT-W051 {
// //pcScalableModifyCode->WriteCode( pcScalableSei->getIroiSliceDivisionType( uiLayer ) , 2 );
// pcScalableModifyCode->WriteCode( pcScalableSei->getIroiSliceDivisionType( uiLayer ) , 1 );
// //JVT-W051 }
// if( pcScalableSei->getIroiSliceDivisionType(uiLayer) == 0 )
// {
// pcScalableModifyCode->WriteUVLC( pcScalableSei->getGridSliceWidthInMbsMinus1( uiLayer ) );
// pcScalableModifyCode->WriteUVLC( pcScalableSei->getGridSliceHeightInMbsMinus1( uiLayer ) );
// }
// else if( pcScalableSei->getIroiSliceDivisionType(uiLayer) == 1 )
// {
// pcScalableModifyCode->WriteUVLC( pcScalableSei->getNumSliceMinus1( uiLayer ) );
// for (UInt nslice = 0; nslice <= pcScalableSei->getNumSliceMinus1( uiLayer ) ; nslice ++ )
// {
// pcScalableModifyCode->WriteUVLC( pcScalableSei->getFirstMbInSlice( uiLayer, nslice ) );
// pcScalableModifyCode->WriteUVLC( pcScalableSei->getSliceWidthInMbsMinus1( uiLayer, nslice ) );
// pcScalableModifyCode->WriteUVLC( pcScalableSei->getSliceHeightInMbsMinus1( uiLayer, nslice ) );
// }
// }
// else if( pcScalableSei->getIroiSliceDivisionType(uiLayer) == 2 )
// {
// // JVT-S054 (REPLACE) ->
// pcScalableModifyCode->WriteUVLC( pcScalableSei->getNumSliceMinus1( uiLayer ) );
// UInt uiFrameHeightInMb = pcScalableSei->getFrmHeightInMbsMinus1( uiLayer ) + 1;
// UInt uiFrameWidthInMb = pcScalableSei->getFrmWidthInMbsMinus1( uiLayer ) + 1;
// UInt uiPicSizeInMbs = uiFrameHeightInMb * uiFrameWidthInMb;
// UInt uiWriteBits = ( UInt) ceil( log((Double)(pcScalableSei->getNumSliceMinus1( uiLayer ) + 1) ) / log(2.) );
// if (uiWriteBits == 0)
// uiWriteBits = 1;
// for( UInt j = 0; j < uiPicSizeInMbs; j++ )
// {
// pcScalableModifyCode->WriteCode( pcScalableSei->getSliceId( uiLayer, j ), uiWriteBits );
// }
// // JVT-S054 (REPLACE) <-
// }
// }
////JVT-S036 lsj end
if( pcScalableSei->getIroiSliceDivisionInfoPresentFlag( uiLayer ) )
{
//JVT-W051 {
pcScalableModifyCode->WriteFlag( pcScalableSei->getIroiGridFlag( uiLayer ));
//JVT-W051 }
if( pcScalableSei->getIroiGridFlag(uiLayer) )
{
pcScalableModifyCode->WriteUVLC( pcScalableSei->getGridSliceWidthInMbsMinus1( uiLayer ) );
pcScalableModifyCode->WriteUVLC( pcScalableSei->getGridSliceHeightInMbsMinus1( uiLayer ) );
}
else
{
pcScalableModifyCode->WriteUVLC( pcScalableSei->getNumSliceMinus1( uiLayer ) );
for (UInt nslice = 0; nslice <= pcScalableSei->getNumSliceMinus1( uiLayer ) ; nslice ++ )
{
pcScalableModifyCode->WriteUVLC( pcScalableSei->getFirstMbInSlice( uiLayer, nslice ) );
pcScalableModifyCode->WriteUVLC( pcScalableSei->getSliceWidthInMbsMinus1( uiLayer, nslice ) );
pcScalableModifyCode->WriteUVLC( pcScalableSei->getSliceHeightInMbsMinus1( uiLayer, nslice ) );
}
}
}
//JVT-S036 lsj end
//SEI changes update
if( pcScalableSei->getLayerDependencyInfoPresentFlag( uiLayer ) )
{
pcScalableModifyCode->WriteUVLC( pcScalableSei->getNumDirectlyDependentLayers( uiLayer ) );
for( UInt ui = 0; ui < pcScalableSei->getNumDirectlyDependentLayers( uiLayer ); ui++ )
{
pcScalableModifyCode->WriteUVLC( pcScalableSei->getNumDirectlyDependentLayerIdDeltaMinus1(uiLayer, ui ) ); //JVT-S036 lsj
}
}
else
{//JVT-S036 lsj
pcScalableModifyCode->WriteUVLC( pcScalableSei->getLayerDependencyInfoSrcLayerIdDelta( uiLayer ) );
}
//if( pcScalableSei->getInitParameterSetsInfoPresentFlag( uiLayer ) )//SEI changes update
if( pcScalableSei->getParameterSetsInfoPresentFlag( uiLayer ) )//SEI changes update
{
pcScalableModifyCode->WriteUVLC( pcScalableSei->getNumInitSPSMinus1( uiLayer ) );
UInt ui;
for( ui = 0; ui <= pcScalableSei->getNumInitSPSMinus1( uiLayer ); ui++ )
{
pcScalableModifyCode->WriteUVLC( pcScalableSei->getInitSPSIdDelta( uiLayer, ui ) );
}
//SEI changes update {
pcScalableModifyCode->WriteUVLC( pcScalableSei->getNumInitSSPSMinus1( uiLayer ) );
for( ui = 0; ui <= pcScalableSei->getNumInitSSPSMinus1( uiLayer ); ui++ )
{
pcScalableModifyCode->WriteUVLC( pcScalableSei->getInitSSPSIdDelta( uiLayer, ui ) );
}
//SEI changes update }
pcScalableModifyCode->WriteUVLC( pcScalableSei->getNumInitPPSMinus1( uiLayer ) );
for( ui = 0; ui <= pcScalableSei->getNumInitPPSMinus1( uiLayer ); ui++ )
{
pcScalableModifyCode->WriteUVLC( pcScalableSei->getInitPPSIdDelta( uiLayer, ui ) );
}
}
else
{//JVT-S036 lsj
pcScalableModifyCode->WriteUVLC( pcScalableSei->getInitParameterSetsInfoSrcLayerIdDelta( uiLayer ) );
}
//JVT-W051 & JVT-W064 {
//if ( pcScalableSei->getBitstreamRestrictionFlag( uiLayer ) )//SEI changes update
if ( pcScalableSei->getBitstreamRestrictionInfoPresentFlag( uiLayer ) )//SEI changes update
{
pcScalableModifyCode->WriteFlag( pcScalableSei->getMotionVectorsOverPicBoundariesFlag( uiLayer ) );
pcScalableModifyCode->WriteUVLC( pcScalableSei->getMaxBytesPerPicDenom( uiLayer ) );
pcScalableModifyCode->WriteUVLC( pcScalableSei->getMaxBitsPerMbDenom( uiLayer ) );
pcScalableModifyCode->WriteUVLC( pcScalableSei->getLog2MaxMvLengthHorizontal( uiLayer ) );
pcScalableModifyCode->WriteUVLC( pcScalableSei->getLog2MaxMvLengthVertical( uiLayer ) );
pcScalableModifyCode->WriteUVLC( pcScalableSei->getNumReorderFrames( uiLayer ) );
pcScalableModifyCode->WriteUVLC( pcScalableSei->getMaxDecFrameBuffering( uiLayer ) );
}
//JVT-W051 & JVT-W064 }
//SEI changes update {
//JVT-W046 {
//if( pcScalableSei->getAvcLayerConversionFlag( uiLayer ) )
if( pcScalableSei->getLayerConversionFlag( uiLayer ) )
{
UInt ui;
//pcScalableModifyCode->WriteUVLC( pcScalableSei->getAvcConversionTypeIdc( uiLayer ) );
pcScalableModifyCode->WriteUVLC( pcScalableSei->getConversionTypeIdc( uiLayer ) );
for( ui = 0; ui < 2; ui++)
{
//pcScalableModifyCode->WriteFlag( pcScalableSei->getAvcInfoFlag( uiLayer,ui ) );
pcScalableModifyCode->WriteFlag( pcScalableSei->getRewritingInfoFlag( uiLayer,ui ) );
if(pcScalableSei->getRewritingInfoFlag( uiLayer,ui ))
{
//pcScalableModifyCode->WriteCode(pcScalableSei->getAvcProfileLevelIdc( uiLayer,ui ),24 );
//pcScalableModifyCode->WriteCode(pcScalableSei->getAvcAvgBitrate( uiLayer,ui ),16 );
//pcScalableModifyCode->WriteCode(pcScalableSei->getAvcMaxBitrate( uiLayer,ui ),16 );
pcScalableModifyCode->WriteCode(pcScalableSei->getRewritingProfileLevelIdc( uiLayer,ui ),24 );
pcScalableModifyCode->WriteCode(pcScalableSei->getRewritingAvgBitrateCode( uiLayer,ui ),16 );
pcScalableModifyCode->WriteCode(pcScalableSei->getRewritingMaxBitrateCode( uiLayer,ui ),16 );
}
}
}
//JVT-W046 }
}// for
//JVT-W051 {
//if ( pcScalableSei->getQualityLayerInfoPresentFlag() )//SEI changes update
//{
// pcScalableModifyCode->WriteUVLC( pcScalableSei->getQlNumdIdMinus1() );
// for ( UInt i = 0; i <= pcScalableSei->getQlNumdIdMinus1(); i++ )
// {
// pcScalableModifyCode->WriteCode( pcScalableSei->getQlDependencyId( i ), 3 );
// pcScalableModifyCode->WriteUVLC( pcScalableSei->getQlNumMinus1( i ) );
// for ( UInt j = 0; j <= pcScalableSei->getQlNumMinus1( i ); j++ )
// {
// pcScalableModifyCode->WriteUVLC( pcScalableSei->getQlId( i, j ) );
// pcScalableModifyCode->WriteCode( pcScalableSei->getQlProfileLevelIdc( i, j ),24 );
// pcScalableModifyCode->WriteCode( pcScalableSei->getQlAvgBitrate( i, j ), 16 );
// pcScalableModifyCode->WriteCode( pcScalableSei->getQlMaxBitrate( i, j ), 16 );
// }
// }
//}
if ( pcScalableSei->getPriorityLayerInfoPresentFlag() )
{
pcScalableModifyCode->WriteUVLC( pcScalableSei->getPrNumdIdMinus1() );
for ( UInt i = 0; i <= pcScalableSei->getPrNumdIdMinus1(); i++ )
{
pcScalableModifyCode->WriteCode( pcScalableSei->getPrDependencyId( i ), 3 );
pcScalableModifyCode->WriteUVLC( pcScalableSei->getPrNumMinus1( i ) );
for ( UInt j = 0; j <= pcScalableSei->getPrNumMinus1( i ); j++ )
{
pcScalableModifyCode->WriteUVLC( pcScalableSei->getPrId( i, j ) );
pcScalableModifyCode->WriteCode( pcScalableSei->getPrProfileLevelIdc( i, j ),24 );
pcScalableModifyCode->WriteCode( pcScalableSei->getPrAvgBitrateCode( i, j ), 16 );
pcScalableModifyCode->WriteCode( pcScalableSei->getPrMaxBitrateCode( i, j ), 16 );
}
}
}
//JVT-W051 }
//JVT-W053 wxwan
//SEI changes update }
if(pcScalableSei->getPriorityIdSettingFlag() )
{
UInt PriorityIdSettingUriIdx = 0;
do{
pcScalableModifyCode->WriteCode( pcScalableSei->getPriorityIdSettingUri(PriorityIdSettingUriIdx), 8) ;
PriorityIdSettingUriIdx++;
}while( pcScalableSei->getPriorityIdSettingUri( PriorityIdSettingUriIdx-1 ) != 0 );
}
//JVT-W053 wxwan
return Err::m_nOK;
}
//JVT-S080 LMI {
ErrVal
ScalableSEIModifyCode::SEICode( h264::SEI::ScalableSeiLayersNotPresent* pcScalableSeiLayersNotPresent, ScalableSEIModifyCode *pcScalableModifyCode )
{
UInt uiNumScalableLayers = pcScalableSeiLayersNotPresent->getNumLayers();
UInt uiLayer;
pcScalableModifyCode->WriteUVLC( uiNumScalableLayers );
for( uiLayer = 0; uiLayer < uiNumScalableLayers; uiLayer++ )
{
pcScalableModifyCode->WriteCode( pcScalableSeiLayersNotPresent->getLayerId( uiLayer ), 8);
}
return Err::m_nOK;
}
ErrVal
ScalableSEIModifyCode::SEICode ( h264::SEI::ScalableSeiDependencyChange* pcScalableSeiDependencyChange, ScalableSEIModifyCode *pcScalableModifyCode )
{
UInt uiNumScalableLayersMinus1 = pcScalableSeiDependencyChange->getNumLayersMinus1();
UInt uiLayer, uiDirectLayer;
pcScalableModifyCode->WriteUVLC( uiNumScalableLayersMinus1 );
for( uiLayer = 0; uiLayer <= uiNumScalableLayersMinus1; uiLayer++ )
{
pcScalableModifyCode->WriteCode( pcScalableSeiDependencyChange->getDependencyId( uiLayer ), 8);
pcScalableModifyCode->WriteFlag( pcScalableSeiDependencyChange->getLayerDependencyInfoPresentFlag( uiLayer ) );
if ( pcScalableSeiDependencyChange->getLayerDependencyInfoPresentFlag( uiLayer ) )
{
pcScalableModifyCode->WriteUVLC( pcScalableSeiDependencyChange->getNumDirectDependentLayers( uiLayer ) );
for ( uiDirectLayer = 0; uiDirectLayer < pcScalableSeiDependencyChange->getNumDirectDependentLayers( uiLayer ); uiDirectLayer++)
pcScalableModifyCode->WriteUVLC(pcScalableSeiDependencyChange->getDirectDependentLayerIdDeltaMinus1( uiLayer, uiDirectLayer ));
}
else
pcScalableModifyCode->WriteUVLC(pcScalableSeiDependencyChange->getLayerDependencyInfoSrcLayerIdDeltaMinus1( uiLayer ) );
}
return Err::m_nOK;
}
//JVT-S080 LMI }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -