Merge pull request #2473 from ruil2/update_interface
modify the interface that use a independent subseqID for each layer
This commit is contained in:
commit
c17a58efdf
@ -578,6 +578,11 @@ typedef struct {
|
|||||||
EVideoFrameType eFrameType;
|
EVideoFrameType eFrameType;
|
||||||
unsigned char uiLayerType;
|
unsigned char uiLayerType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The sub sequence layers are ordered hierarchically based on their dependency on each other so that any picture in a layer shall not be
|
||||||
|
* predicted from any picture on any higher layer.
|
||||||
|
*/
|
||||||
|
int iSubSeqId; ///< refer to D.2.11 Sub-sequence information SEI message semantics
|
||||||
int iNalCount; ///< count number of NAL coded already
|
int iNalCount; ///< count number of NAL coded already
|
||||||
int* pNalLengthInByte; ///< length of NAL size in byte from 0 to iNalCount-1
|
int* pNalLengthInByte; ///< length of NAL size in byte from 0 to iNalCount-1
|
||||||
unsigned char* pBsBuf; ///< buffer of bitstream contained
|
unsigned char* pBsBuf; ///< buffer of bitstream contained
|
||||||
@ -587,14 +592,6 @@ typedef struct {
|
|||||||
* @brief Frame bit stream info
|
* @brief Frame bit stream info
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int iTemporalId; ///< temporal ID
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The sub sequence layers are ordered hierarchically based on their dependency on each other so that any picture in a layer shall not be
|
|
||||||
* predicted from any picture on any higher layer.
|
|
||||||
*/
|
|
||||||
int iSubSeqId; ///< refer to D.2.11 Sub-sequence information SEI message semantics
|
|
||||||
|
|
||||||
int iLayerNum;
|
int iLayerNum;
|
||||||
SLayerBSInfo sLayerInfo[MAX_LAYER_NUM_OF_FRAME];
|
SLayerBSInfo sLayerInfo[MAX_LAYER_NUM_OF_FRAME];
|
||||||
|
|
||||||
|
@ -3181,6 +3181,7 @@ int32_t WelsEncoderEncodeParameterSets (sWelsEncCtx* pCtx, void* pDst) {
|
|||||||
pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;
|
pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;
|
||||||
pLayerBsInfo->iNalCount = iCountNal;
|
pLayerBsInfo->iNalCount = iCountNal;
|
||||||
pLayerBsInfo->eFrameType = videoFrameTypeInvalid;
|
pLayerBsInfo->eFrameType = videoFrameTypeInvalid;
|
||||||
|
pLayerBsInfo->iSubSeqId = 0;
|
||||||
//pCtx->eLastNalPriority = NRI_PRI_HIGHEST;
|
//pCtx->eLastNalPriority = NRI_PRI_HIGHEST;
|
||||||
pFbi->iLayerNum = 1;
|
pFbi->iLayerNum = 1;
|
||||||
pFbi->eFrameType = videoFrameTypeInvalid;
|
pFbi->eFrameType = videoFrameTypeInvalid;
|
||||||
@ -3218,6 +3219,7 @@ int32_t WriteSsvcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum,
|
|||||||
pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;
|
pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;
|
||||||
pLayerBsInfo->iNalCount = iCountNal;
|
pLayerBsInfo->iNalCount = iCountNal;
|
||||||
pLayerBsInfo->eFrameType = videoFrameTypeIDR;
|
pLayerBsInfo->eFrameType = videoFrameTypeIDR;
|
||||||
|
pLayerBsInfo->iSubSeqId = GetSubSequenceId (pCtx, videoFrameTypeIDR);
|
||||||
//point to next pLayerBsInfo
|
//point to next pLayerBsInfo
|
||||||
++ pLayerBsInfo;
|
++ pLayerBsInfo;
|
||||||
++ pCtx->pOut->iLayerBsIndex;
|
++ pCtx->pOut->iLayerBsIndex;
|
||||||
@ -3262,6 +3264,7 @@ int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t iIdx,
|
|||||||
pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;
|
pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;
|
||||||
pLayerBsInfo->iNalCount = iCountNal;
|
pLayerBsInfo->iNalCount = iCountNal;
|
||||||
pLayerBsInfo->eFrameType = videoFrameTypeIDR;
|
pLayerBsInfo->eFrameType = videoFrameTypeIDR;
|
||||||
|
pLayerBsInfo->iSubSeqId = GetSubSequenceId (pCtx, videoFrameTypeIDR);
|
||||||
//point to next pLayerBsInfo
|
//point to next pLayerBsInfo
|
||||||
++ pLayerBsInfo;
|
++ pLayerBsInfo;
|
||||||
++ pCtx->pOut->iLayerBsIndex;
|
++ pCtx->pOut->iLayerBsIndex;
|
||||||
@ -3296,6 +3299,7 @@ int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t iIdx,
|
|||||||
pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;
|
pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;
|
||||||
pLayerBsInfo->iNalCount = iCountNal;
|
pLayerBsInfo->iNalCount = iCountNal;
|
||||||
pLayerBsInfo->eFrameType = videoFrameTypeIDR;
|
pLayerBsInfo->eFrameType = videoFrameTypeIDR;
|
||||||
|
pLayerBsInfo->iSubSeqId = GetSubSequenceId (pCtx, videoFrameTypeIDR);
|
||||||
//point to next pLayerBsInfo
|
//point to next pLayerBsInfo
|
||||||
++ pLayerBsInfo;
|
++ pLayerBsInfo;
|
||||||
++ pCtx->pOut->iLayerBsIndex;
|
++ pCtx->pOut->iLayerBsIndex;
|
||||||
@ -3343,6 +3347,7 @@ int32_t WriteSavcParaset_Listing (sWelsEncCtx* pCtx, const int32_t kiSpatialNum,
|
|||||||
pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;
|
pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;
|
||||||
pLayerBsInfo->iNalCount = iCountNal;
|
pLayerBsInfo->iNalCount = iCountNal;
|
||||||
pLayerBsInfo->eFrameType = videoFrameTypeIDR;
|
pLayerBsInfo->eFrameType = videoFrameTypeIDR;
|
||||||
|
pLayerBsInfo->iSubSeqId = GetSubSequenceId (pCtx, videoFrameTypeIDR);
|
||||||
//point to next pLayerBsInfo
|
//point to next pLayerBsInfo
|
||||||
++ pLayerBsInfo;
|
++ pLayerBsInfo;
|
||||||
++ pCtx->pOut->iLayerBsIndex;
|
++ pCtx->pOut->iLayerBsIndex;
|
||||||
@ -3376,6 +3381,7 @@ int32_t WriteSavcParaset_Listing (sWelsEncCtx* pCtx, const int32_t kiSpatialNum,
|
|||||||
pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;
|
pLayerBsInfo->uiLayerType = NON_VIDEO_CODING_LAYER;
|
||||||
pLayerBsInfo->iNalCount = iCountNal;
|
pLayerBsInfo->iNalCount = iCountNal;
|
||||||
pLayerBsInfo->eFrameType = videoFrameTypeIDR;
|
pLayerBsInfo->eFrameType = videoFrameTypeIDR;
|
||||||
|
pLayerBsInfo->iSubSeqId = GetSubSequenceId (pCtx, videoFrameTypeIDR);
|
||||||
//point to next pLayerBsInfo
|
//point to next pLayerBsInfo
|
||||||
++ pLayerBsInfo;
|
++ pLayerBsInfo;
|
||||||
++ pCtx->pOut->iLayerBsIndex;
|
++ pCtx->pOut->iLayerBsIndex;
|
||||||
@ -3772,6 +3778,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
|
|||||||
pLayerBsInfo->uiQualityId = 0;
|
pLayerBsInfo->uiQualityId = 0;
|
||||||
pLayerBsInfo->iNalCount = ++ iNalIdxInLayer;
|
pLayerBsInfo->iNalCount = ++ iNalIdxInLayer;
|
||||||
pLayerBsInfo->eFrameType = eFrameType;
|
pLayerBsInfo->eFrameType = eFrameType;
|
||||||
|
pLayerBsInfo->iSubSeqId = GetSubSequenceId (pCtx, eFrameType);
|
||||||
}
|
}
|
||||||
// for dynamic slicing single threading..
|
// for dynamic slicing single threading..
|
||||||
else if ((SM_SIZELIMITED_SLICE == pParam->sSliceArgument.uiSliceMode) && (pSvcParam->iMultipleThreadIdc <= 1)) {
|
else if ((SM_SIZELIMITED_SLICE == pParam->sSliceArgument.uiSliceMode) && (pSvcParam->iMultipleThreadIdc <= 1)) {
|
||||||
@ -3779,6 +3786,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
|
|||||||
pCtx->iEncoderError = WelsCodeOnePicPartition (pCtx, pFbi, pLayerBsInfo, &iNalIdxInLayer, &iLayerSize, 0,
|
pCtx->iEncoderError = WelsCodeOnePicPartition (pCtx, pFbi, pLayerBsInfo, &iNalIdxInLayer, &iLayerSize, 0,
|
||||||
kiLastMbInFrame, 0);
|
kiLastMbInFrame, 0);
|
||||||
pLayerBsInfo->eFrameType = eFrameType;
|
pLayerBsInfo->eFrameType = eFrameType;
|
||||||
|
pLayerBsInfo->iSubSeqId = GetSubSequenceId (pCtx, eFrameType);
|
||||||
WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS)
|
WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS)
|
||||||
} else {
|
} else {
|
||||||
//other multi-slice uiSliceMode
|
//other multi-slice uiSliceMode
|
||||||
@ -3805,6 +3813,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
|
|||||||
pLayerBsInfo->uiQualityId = 0;
|
pLayerBsInfo->uiQualityId = 0;
|
||||||
pLayerBsInfo->iNalCount = 0;
|
pLayerBsInfo->iNalCount = 0;
|
||||||
pLayerBsInfo->eFrameType = eFrameType;
|
pLayerBsInfo->eFrameType = eFrameType;
|
||||||
|
pLayerBsInfo->iSubSeqId = GetSubSequenceId (pCtx, eFrameType);
|
||||||
pCtx->pTaskManage->ExecuteTasks();
|
pCtx->pTaskManage->ExecuteTasks();
|
||||||
if (pCtx->iEncoderError) {
|
if (pCtx->iEncoderError) {
|
||||||
WelsLog (pLogCtx, WELS_LOG_ERROR,
|
WelsLog (pLogCtx, WELS_LOG_ERROR,
|
||||||
@ -3856,7 +3865,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
|
|||||||
pLbi->uiQualityId = 0;
|
pLbi->uiQualityId = 0;
|
||||||
pLbi->iNalCount = 0;
|
pLbi->iNalCount = 0;
|
||||||
pLbi->eFrameType = eFrameType;
|
pLbi->eFrameType = eFrameType;
|
||||||
|
pLbi->iSubSeqId = GetSubSequenceId (pCtx, eFrameType);
|
||||||
int32_t iIdx = 0;
|
int32_t iIdx = 0;
|
||||||
while (iIdx < kiPartitionCnt) {
|
while (iIdx < kiPartitionCnt) {
|
||||||
pCtx->pSliceThreading->pThreadPEncCtx[iIdx].pFrameBsInfo = pFbi;
|
pCtx->pSliceThreading->pThreadPEncCtx[iIdx].pFrameBsInfo = pFbi;
|
||||||
@ -3925,6 +3934,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
|
|||||||
pLayerBsInfo->uiQualityId = 0;
|
pLayerBsInfo->uiQualityId = 0;
|
||||||
pLayerBsInfo->iNalCount = iNalIdxInLayer;
|
pLayerBsInfo->iNalCount = iNalIdxInLayer;
|
||||||
pLayerBsInfo->eFrameType = eFrameType;
|
pLayerBsInfo->eFrameType = eFrameType;
|
||||||
|
pLayerBsInfo->iSubSeqId = GetSubSequenceId (pCtx, eFrameType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4103,6 +4113,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
|
|||||||
pLayerBsInfo->iNalCount = 1;
|
pLayerBsInfo->iNalCount = 1;
|
||||||
pLayerBsInfo->pNalLengthInByte[0] = iPaddingNalSize;
|
pLayerBsInfo->pNalLengthInByte[0] = iPaddingNalSize;
|
||||||
pLayerBsInfo->eFrameType = eFrameType;
|
pLayerBsInfo->eFrameType = eFrameType;
|
||||||
|
pLayerBsInfo->iSubSeqId = GetSubSequenceId (pCtx, eFrameType);
|
||||||
++ pLayerBsInfo;
|
++ pLayerBsInfo;
|
||||||
++ pCtx->pOut->iLayerBsIndex;
|
++ pCtx->pOut->iLayerBsIndex;
|
||||||
pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer;
|
pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer;
|
||||||
@ -4187,17 +4198,14 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
|
|||||||
|
|
||||||
|
|
||||||
pFbi->iLayerNum = iLayerNum;
|
pFbi->iLayerNum = iLayerNum;
|
||||||
pFbi->iSubSeqId = GetSubSequenceId (pCtx, eFrameType);
|
|
||||||
|
|
||||||
WelsLog (pLogCtx, WELS_LOG_DEBUG, "WelsEncoderEncodeExt() OutputInfo iLayerNum = %d,iSubSeqId = %d,iFrameSize = %d",
|
WelsLog (pLogCtx, WELS_LOG_DEBUG, "WelsEncoderEncodeExt() OutputInfo iLayerNum = %d,iFrameSize = %d",
|
||||||
iLayerNum,
|
iLayerNum,iFrameSize);
|
||||||
pFbi->iSubSeqId, iFrameSize);
|
|
||||||
for (int32_t i = 0; i < iLayerNum; i++)
|
for (int32_t i = 0; i < iLayerNum; i++)
|
||||||
WelsLog (pLogCtx, WELS_LOG_DEBUG,
|
WelsLog (pLogCtx, WELS_LOG_DEBUG,
|
||||||
"WelsEncoderEncodeExt() OutputInfo iLayerId = %d,iNalType = %d,iNalCount = %d, first Nal Length=%d,uiSpatialId = %d,uiTemporalId = %d",
|
"WelsEncoderEncodeExt() OutputInfo iLayerId = %d,iNalType = %d,iNalCount = %d, first Nal Length=%d,uiSpatialId = %d,uiTemporalId = %d,iSubSeqId = %d",i,
|
||||||
i,
|
|
||||||
pFbi->sLayerInfo[i].uiLayerType, pFbi->sLayerInfo[i].iNalCount, pFbi->sLayerInfo[i].pNalLengthInByte[0],
|
pFbi->sLayerInfo[i].uiLayerType, pFbi->sLayerInfo[i].iNalCount, pFbi->sLayerInfo[i].pNalLengthInByte[0],
|
||||||
pFbi->sLayerInfo[i].uiSpatialId, pFbi->sLayerInfo[i].uiTemporalId);
|
pFbi->sLayerInfo[i].uiSpatialId, pFbi->sLayerInfo[i].uiTemporalId,pFbi->sLayerInfo[i].iSubSeqId);
|
||||||
WelsEmms();
|
WelsEmms();
|
||||||
|
|
||||||
pLayerBsInfo->eFrameType = eFrameType;
|
pLayerBsInfo->eFrameType = eFrameType;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user