add more LTR parameters

This commit is contained in:
ruil2 2014-08-26 11:06:30 +08:00
parent a4eea4c64d
commit d6f0dee0c4
2 changed files with 14 additions and 6 deletions

View File

@ -89,7 +89,7 @@ typedef enum {
ENCODER_LTR_RECOVERY_REQUEST,
ENCODER_LTR_MARKING_FEEDBACK,
ENCOCER_LTR_MARKING_PERIOD,
ENCODER_LTR_MARKING_PERIOD,
ENCODER_OPTION_LTR,
ENCODER_OPTION_COMPLEXITY,
@ -177,6 +177,10 @@ typedef struct {
int iLTRFrameNum; //specify current decoder frame_num
} SLTRMarkingFeedback;
typedef struct {
bool bEnableLongTermReference; // 1: on, 0: off
int iLTRRefNum;
}SLTRConfig;
typedef struct {
unsigned int
uiSliceMbNum[MAX_SLICES_NUM_TMP]; //here we use a tmp fixed value since MAX_SLICES_NUM is not defined here and its definition may be changed;

View File

@ -818,16 +818,20 @@ int CWelsH264SVCEncoder::SetOption (ENCODER_OPTION eOptionId, void* pOption) {
FilterLTRMarkingFeedback (m_pEncContext, fb);
}
break;
case ENCOCER_LTR_MARKING_PERIOD: {
case ENCODER_LTR_MARKING_PERIOD: {
uint32_t iValue = * ((uint32_t*) (pOption));
m_pEncContext->pSvcParam->iLtrMarkPeriod = iValue;
}
break;
case ENCODER_OPTION_LTR: {
uint32_t iValue = * ((uint32_t*) (pOption));
m_pEncContext->pSvcParam->bEnableLongTermReference = iValue ? true : false;
WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, " CWelsH264SVCEncoder::SetOption enable LTR = %d",
m_pEncContext->pSvcParam->bEnableLongTermReference);
SLTRConfig* pLTRValue = ((SLTRConfig*) (pOption));
SWelsSvcCodingParam sConfig;
memcpy (&sConfig, m_pEncContext->pSvcParam, sizeof (SWelsSvcCodingParam));
sConfig.bEnableLongTermReference = pLTRValue->bEnableLongTermReference;
sConfig.iLTRRefNum = pLTRValue->iLTRRefNum;
WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, " CWelsH264SVCEncoder::SetOption enable LTR = %d,ltrnum = %d",
sConfig.bEnableLongTermReference, sConfig.iLTRRefNum);
WelsEncoderParamAdjust (&m_pEncContext, &sConfig);
}
break;
case ENCODER_OPTION_ENABLE_SSEI: {