History

add UT for LTR setopton and fix crash issue

ruil2 committed 12 years ago

Commit 7e8cde01 parent cef43e34 files · +125 −56Browse files

Showing the changes to codec/encoder/core (2 of 4 files). Show all

Unified · Split

2 files
  1. codec/encoder/core/inc/extern.h +1 −1
  2. codec/encoder/core/src/encoder_ext.cpp +4 −4
codec/encoder/core/inc/extern.h+1−1
@@ -108,7 +108,7 @@ int32_t ForceCodingIDR (sWelsEncCtx* pCtx); · 107 unmodified lines
108108 int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNew);
109109 void WelsEncoderApplyFrameRate (SWelsSvcCodingParam* pParam);
110110 void WelsEncoderApplyBitRate (SLogContext* pLogCtx, SWelsSvcCodingParam* pParam, int32_t iLayer);
111−void WelsEncoderApplyLTR (SLogContext* pLogCtx, sWelsEncCtx*pCtx,SLTRConfig* pLTRValue);
111+void WelsEncoderApplyLTR (SLogContext* pLogCtx, sWelsEncCtx** ppCtx, SLTRConfig* pLTRValue);
112112 int32_t FilterLTRRecoveryRequest (sWelsEncCtx* pCtx, SLTRRecoverRequest* pLTRRecoverRequest);
113113
114114 void FilterLTRMarkingFeedback (sWelsEncCtx* pCtx, SLTRMarkingFeedback* pLTRMarkingFeedback);
codec/encoder/core/src/encoder_ext.cpp+4−4
@@ -3825,10 +3825,10 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 3824 unmodified lines
38253825 return 0;
38263826 }
38273827
3828−void WelsEncoderApplyLTR (SLogContext* pLogCtx, sWelsEncCtx* pCtx, SLTRConfig* pLTRValue) {
3828+void WelsEncoderApplyLTR (SLogContext* pLogCtx, sWelsEncCtx** ppCtx, SLTRConfig* pLTRValue) {
38293829 SWelsSvcCodingParam sConfig;
38303830 int32_t iNumRefFrame = 1;
3831− memcpy (&sConfig, pCtx->pSvcParam, sizeof (SWelsSvcCodingParam));
3831+ memcpy (&sConfig, (*ppCtx)->pSvcParam, sizeof (SWelsSvcCodingParam));
38323832 sConfig.bEnableLongTermReference = pLTRValue->bEnableLongTermReference;
38333833 sConfig.iLTRRefNum = pLTRValue->iLTRRefNum;
38343834 int32_t uiGopSize = 1 << (sConfig.iTemporalLayerNum - 1);
@@ -3856,9 +3856,9 @@ void WelsEncoderApplyLTR (SLogContext* pLogCtx, sWelsEncCtx* pCtx, SLTRConfig* p · 21 unmodified lines
38563856 if (sConfig.iNumRefFrame > sConfig.iMaxNumRefFrame)
38573857 sConfig.iMaxNumRefFrame = sConfig.iNumRefFrame;
38583858
3859− WelsLog (pLogCtx, WELS_LOG_WARNING, " CWelsH264SVCEncoder::SetOption enable LTR = %d,ltrnum = %d",
3859+ WelsLog (pLogCtx, WELS_LOG_INFO, " CWelsH264SVCEncoder::SetOption enable LTR = %d,ltrnum = %d",
38603860 sConfig.bEnableLongTermReference, sConfig.iLTRRefNum);
3861− WelsEncoderParamAdjust (&pCtx, &sConfig);
3861+ WelsEncoderParamAdjust (ppCtx, &sConfig);
38623862 }
38633863 int32_t DynSliceRealloc (sWelsEncCtx* pCtx,
38643864 SFrameBSInfo* pFrameBsInfo,

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