History

Add fix for simulcast if frame rate in the middle spatial layer is smaller

Sijia Chen committed 11 years ago

Commit 82cc0531 parent f9f2bbf2 files · +23 −21Browse files

Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 2 files). Show all

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+7−8
@@ -3114,11 +3114,8 @@ void PreprocessSliceCoding (sWelsEncCtx* pCtx) { · 3113 unmodified lines
31143114 * \brief swap pDq layers between current pDq layer and reference pDq layer
31153115 */
31163116
3117−static inline void WelsSwapDqLayers (sWelsEncCtx* pCtx) {
3117+static inline void WelsSwapDqLayers (sWelsEncCtx* pCtx, const int32_t kiNextDqIdx) {
31183118 // swap and assign reference
3119− const int32_t kiDid = pCtx->uiDependencyId;
3120− const int32_t kiNextDqIdx = 1 + kiDid;
3121−
31223119 SDqLayer* pTmpLayer = pCtx->ppDqLayerList[kiNextDqIdx];
31233120 SDqLayer* pRefLayer = pCtx->pCurDqLayer;
31243121 pCtx->pCurDqLayer = pTmpLayer;
@@ -4384,7 +4381,8 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 1259 unmodified lines
43844381 ++ iSpatialIdx;
43854382
43864383 if (iCurDid + 1 < pSvcParam->iSpatialLayerNum) {
4387− WelsSwapDqLayers (pCtx);
4384+ //for next layer, note that iSpatialIdx has been ++ so it is pointer to next layer
4385+ WelsSwapDqLayers (pCtx, (pSpatialIndexMap + iSpatialIdx)->iDid);
43884386 }
43894387
43904388 if (pCtx->pVpp->UpdateSpatialPictures (pCtx, pSvcParam, iCurTid, iDidIdx) != 0) {
@@ -4400,7 +4398,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 9 unmodified lines
44004398 && (pCtx->pLtr[pCtx->uiDependencyId].iLTRMarkMode == LTR_DIRECT_MARK)) || eFrameType == videoFrameTypeIDR)) {
44014399 pCtx->bRefOfCurTidIsLtr[iDidIdx][iCurTid] = true;
44024400 }
4403− }
4401+ }//end of (iSpatialIdx/iSpatialNum)
44044402
44054403 if (ENC_RETURN_CORRECTED == pCtx->iEncoderError) {
44064404 pCtx->pVpp->UpdateSpatialPictures (pCtx, pSvcParam, iCurTid, (pSpatialIndexMap + iSpatialIdx)->iDid);
@@ -4448,8 +4446,9 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 41 unmodified lines
44484446 iLayerNum,
44494447 pFbi->iSubSeqId, iFrameSize);
44504448 for (int32_t i = 0; i < iLayerNum; i++)
4451− WelsLog (pLogCtx, WELS_LOG_DEBUG, "WelsEncoderEncodeExt() OutputInfo iLayerId = %d,iNalType = %d,iNalCount = %d", i,
4452− pFbi->sLayerInfo[i].uiLayerType, pFbi->sLayerInfo[i].iNalCount);
4449+ WelsLog (pLogCtx, WELS_LOG_DEBUG,
4450+ "WelsEncoderEncodeExt() OutputInfo iLayerId = %d,iNalType = %d,iNalCount = %d, first Nal Length=%d", i,
4451+ pFbi->sLayerInfo[i].uiLayerType, pFbi->sLayerInfo[i].iNalCount, pFbi->sLayerInfo[i].pNalLengthInByte[0]);
44534452 WelsEmms();
44544453
44554454 pFbi->eFrameType = eFrameType;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t