add interface for error concealment, to be continued

This commit is contained in:
huili2 2014-04-03 02:20:56 -07:00
parent f305096f01
commit 79c0cec248
4 changed files with 26 additions and 4 deletions

View File

@ -105,8 +105,16 @@ typedef enum {
DECODER_OPTION_IDR_PIC_ID, // feedback current frame belong to which IDR period
DECODER_OPTION_LTR_MARKING_FLAG, // feedback wether current frame mark a LTR
DECODER_OPTION_LTR_MARKED_FRAME_NUM, // feedback frame num marked by current Frame
DECODER_OPTION_ERROR_CON_IDC, //not finished yet, indicate decoder error concealment status, in progress
} DECODER_OPTION;
//enuerate the types of error concealment methods
typedef enum {
ERROR_CON_DISABLE = 0,
ERROR_CON_SLICE_COPY,
} ERROR_CON_IDC;
typedef enum { //feedback that whether or not have VCL NAL in current AU
FEEDBACK_NON_VCL_NAL = 0,
FEEDBACK_VCL_NAL,

View File

@ -273,9 +273,10 @@ typedef struct TagWelsDecoderContext {
uint16_t uiCurIdrPicId;
#endif
PGetIntraPredFunc pGetI16x16LumaPredFunc[7]; //h264_predict_copy_16x16;
PGetIntraPredFunc pGetI4x4LumaPredFunc[14]; // h264_predict_4x4_t
PGetIntraPredFunc pGetIChromaPredFunc[7]; // h264_predict_8x8_t
int32_t iErrorConMethod; //
PGetIntraPredFunc pGetI16x16LumaPredFunc[7]; //h264_predict_copy_16x16;
PGetIntraPredFunc pGetI4x4LumaPredFunc[14]; // h264_predict_4x4_t
PGetIntraPredFunc pGetIChromaPredFunc[7]; // h264_predict_8x8_t
PIdctResAddPredFunc pIdctResAddPredFunc;
SMcFunc sMcFunc;
/* For Deblocking */

View File

@ -163,6 +163,7 @@ void WelsDecoderDefaults (PWelsDecoderContext pCtx) {
pCtx->pPicBuff[LIST_1] = NULL;
pCtx->bAvcBasedFlag = true;
pCtx->iErrorConMethod = ERROR_CON_DISABLE;
}
@ -531,6 +532,8 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
}
}
//TODO error concealment here
if ((IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) || IS_SEI_NAL (pCtx->sCurNalHead.eNalUnitType))
&& pNalPayload) {
if (ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes)) {

View File

@ -256,10 +256,16 @@ long CWelsDecoder::SetOption (DECODER_OPTION eOptID, void* pOption) {
m_pDecContext->bEndOfStreamFlag = iVal ? true : false;
return cmResultSuccess;
} else if (eOptID == DECODER_OPTION_ERROR_CON_IDC) { // Indicate error concealment status
if (pOption == NULL) //Default: SLICE_COPY, enable
iVal = ERROR_CON_SLICE_COPY;
else
iVal = * ((int*)pOption); //EC method
m_pDecContext->iErrorConMethod = iVal;
return cmResultSuccess;
}
return cmInitParaError;
}
@ -311,6 +317,10 @@ long CWelsDecoder::GetOption (DECODER_OPTION eOptID, void* pOption) {
iVal = m_pDecContext->iFeedbackTidInAu;
* ((int*)pOption) = iVal;
return cmResultSuccess;
} else if (DECODER_OPTION_ERROR_CON_IDC == eOptID) {
iVal = m_pDecContext->iErrorConMethod;
* ((int*)pOption) = iVal;
return cmResultSuccess;
}
return cmInitParaError;