fix codingIdx update issue

This commit is contained in:
Karina 2016-06-02 21:17:31 +08:00
parent f6b6a0f6aa
commit 4f41c3a5bf
4 changed files with 4632 additions and 4633 deletions

View File

@ -3498,17 +3498,6 @@ EVideoFrameType PrepareEncodeFrame (sWelsEncCtx* pCtx, SLayerBSInfo*& pLayerBsIn
++ pCtx->uiIdrPicId;
}
}
if (!pSvcParam->bSimulcastAVC) {
for (int32_t i = 0; i < pSvcParam->iSpatialLayerNum; i++) {
SSpatialLayerInternal* pParamInternal = &pSvcParam->sDependencyLayers[i];
pParamInternal->iCodingIndex ++;
pCtx->pWelsSvcRc[i].iContinualSkipFrames = 0;
}
} else {
SSpatialLayerInternal* pParamInternal = &pSvcParam->sDependencyLayers[iCurDid];
pParamInternal->iCodingIndex++;
pCtx->pWelsSvcRc[iCurDid].iContinualSkipFrames = 0;
}
}
return eFrameType;
}
@ -4138,9 +4127,17 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
&& (pCtx->pLtr[pCtx->uiDependencyId].iLTRMarkMode == LTR_DIRECT_MARK)) || eFrameType == videoFrameTypeIDR)) {
pCtx->bRefOfCurTidIsLtr[iCurDid][iCurTid] = true;
}
// ++ pParamInternal->iCodingIndex;
if (pSvcParam->bSimulcastAVC)
++ pParamInternal->iCodingIndex;
}//end of (iSpatialIdx/iSpatialNum)
if (!pSvcParam->bSimulcastAVC) {
for (int32_t i = 0; i < pSvcParam->iSpatialLayerNum; i++) {
SSpatialLayerInternal* pParamInternal = &pSvcParam->sDependencyLayers[i];
pParamInternal->iCodingIndex ++;
}
}
if (ENC_RETURN_CORRECTED == pCtx->iEncoderError) {
pCtx->pVpp->UpdateSpatialPictures (pCtx, pSvcParam, iCurTid, (pSpatialIndexMap + iSpatialIdx)->iDid);
ForceCodingIDR (pCtx);
@ -4186,7 +4183,8 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
iLayerNum, iFrameSize);
for (int32_t i = 0; i < iLayerNum; i++)
WelsLog (pLogCtx, WELS_LOG_DEBUG,
"WelsEncoderEncodeExt() OutputInfo iLayerId = %d,iNalType = %d,iNalCount = %d, first Nal Length=%d,uiSpatialId = %d,uiTemporalId = %d,iSubSeqId = %d",i,
"WelsEncoderEncodeExt() OutputInfo iLayerId = %d,iNalType = %d,iNalCount = %d, first Nal Length=%d,uiSpatialId = %d,uiTemporalId = %d,iSubSeqId = %d",
i,
pFbi->sLayerInfo[i].uiLayerType, pFbi->sLayerInfo[i].iNalCount, pFbi->sLayerInfo[i].pNalLengthInByte[0],
pFbi->sLayerInfo[i].uiSpatialId, pFbi->sLayerInfo[i].uiTemporalId, pFbi->sLayerInfo[i].iSubSeqId);
WelsEmms();

View File

@ -123,7 +123,7 @@ void RcInitSequenceParameter (sWelsEncCtx* pEncCtx) {
pWelsSvcRc->iCost2BitsIntra = 1;
pWelsSvcRc->iAvgCost2Bits = 1;
pWelsSvcRc->iSkipBufferRatio = SKIP_RATIO;
pWelsSvcRc->iContinualSkipFrames = 0;
pWelsSvcRc->iQpRangeUpperInFrame = (QP_RANGE_UPPER_MODE1 * MAX_BITS_VARY_PERCENTAGE - ((
QP_RANGE_UPPER_MODE1 - QP_RANGE_MODE0) *
pWelsSvcRc->iRcVaryRatio)) / MAX_BITS_VARY_PERCENTAGE;
@ -1056,6 +1056,7 @@ int32_t RcCalculateCascadingQp (struct TagWelsEncCtx* pEncCtx, int32_t iQp) {
void WelsRcPictureInitGom (sWelsEncCtx* pEncCtx, long long uiTimeStamp) {
SWelsSvcRc* pWelsSvcRc = &pEncCtx->pWelsSvcRc[pEncCtx->uiDependencyId];
pWelsSvcRc->iContinualSkipFrames = 0;
if (pEncCtx->eSliceType == I_SLICE) {
if (0 == pWelsSvcRc->iIdrNum) { //iIdrNum == 0 means encoder has been initialed