commit
51d8682139
@ -247,19 +247,6 @@ enum {
|
||||
WELS_LOG_DEFAULT = WELS_LOG_DEBUG // Default log iLevel in Wels codec
|
||||
};
|
||||
|
||||
typedef enum{
|
||||
FRAMEIDC_IDR = 0x00,
|
||||
FRAMEIDC_I = 0x04,
|
||||
FRAMEIDC_LTR = 0x08,
|
||||
FRAMEIDC_T0 = 0x10,
|
||||
FRAMEIDC_T1 = 0x11,
|
||||
FRAMEIDC_T2 = 0x12,
|
||||
FRAMEIDC_T3 = 0x13,
|
||||
FRAMEIDC_T4 = 0x14,
|
||||
FRAMEIDC_UNKNOWN = 0x20,
|
||||
FRAMEIDC_INVALID = 0xFF,
|
||||
}EFrameIDC;
|
||||
|
||||
typedef struct {
|
||||
SliceModeEnum uiSliceMode; //by default, uiSliceMode will be SM_SINGLE_SLICE
|
||||
SSliceArgument sSliceArgument;
|
||||
@ -376,8 +363,6 @@ typedef struct {
|
||||
unsigned char uiSpatialId;
|
||||
unsigned char uiQualityId;
|
||||
|
||||
unsigned char uiPriorityId; //ignore it currently
|
||||
|
||||
unsigned char uiLayerType;
|
||||
|
||||
int iNalCount; // Count number of NAL coded already
|
||||
@ -388,12 +373,14 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
int iTemporalId; // Temporal ID
|
||||
EFrameIDC eFrameIdc;
|
||||
//The sub sequence layers are ordered hierarchically based on their dependency on each other so that any picture in a layer shall not be
|
||||
//predicted from any picture on any higher layer.
|
||||
int iSubSeqId; //refer to D.2.11 Sub-sequence information SEI message semantics
|
||||
|
||||
int iLayerNum;
|
||||
SLayerBSInfo sLayerInfo[MAX_LAYER_NUM_OF_FRAME];
|
||||
|
||||
EVideoFrameType eOutputFrameType;
|
||||
EVideoFrameType eFrameType;
|
||||
long long uiTimeStamp;
|
||||
} SFrameBSInfo, *PFrameBSInfo;
|
||||
|
||||
|
@ -805,7 +805,7 @@ int ProcessEncoding(ISVCEncoder* pPtrEnc, int argc, char** argv,bool bConfigFile
|
||||
iTotal += WelsTime() - iStart;
|
||||
|
||||
// fixed issue in case dismatch source picture introduced by frame skipped, 1/12/2010
|
||||
if (videoFrameTypeSkip == sFbi.eOutputFrameType) {
|
||||
if (videoFrameTypeSkip == sFbi.eFrameType) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -2885,7 +2885,6 @@ int32_t WelsEncoderEncodeParameterSets (sWelsEncCtx* pCtx, void* pDst) {
|
||||
int32_t iReturn = WelsWriteParameterSets (pCtx, &pLayerBsInfo->pNalLengthInByte[0], &iCountNal);
|
||||
WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)
|
||||
|
||||
pLayerBsInfo->uiPriorityId = 0;
|
||||
pLayerBsInfo->uiSpatialId = 0;
|
||||
pLayerBsInfo->uiTemporalId = 0;
|
||||
pLayerBsInfo->uiQualityId = 0;
|
||||
@ -2948,13 +2947,13 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
|
||||
iSpatialNum = pCtx->pVpp->BuildSpatialPicList (pCtx, pSrcPic);
|
||||
if (iSpatialNum < 1) { // skip due to temporal layer settings (different frame rate)
|
||||
++ pCtx->iCodingIndex;
|
||||
pFbi->eOutputFrameType = videoFrameTypeSkip;
|
||||
pFbi->eFrameType = videoFrameTypeSkip;
|
||||
return ENC_RETURN_SUCCESS;
|
||||
}
|
||||
|
||||
eFrameType = DecideFrameType (pCtx, iSpatialNum);
|
||||
if (eFrameType == videoFrameTypeSkip) {
|
||||
pFbi->eOutputFrameType = eFrameType;
|
||||
pFbi->eFrameType = eFrameType;
|
||||
return ENC_RETURN_SUCCESS;
|
||||
}
|
||||
|
||||
@ -2969,7 +2968,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
|
||||
}
|
||||
}
|
||||
if (true == bSkipMustFlag) {
|
||||
pFbi->eOutputFrameType = videoFrameTypeSkip;
|
||||
pFbi->eFrameType = videoFrameTypeSkip;
|
||||
return ENC_RETURN_SUCCESS;
|
||||
}
|
||||
}
|
||||
@ -2992,7 +2991,6 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
|
||||
pCtx->iEncoderError = WelsWriteParameterSets (pCtx, &pLayerBsInfo->pNalLengthInByte[0], &iCountNal);
|
||||
WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS)
|
||||
|
||||
pLayerBsInfo->uiPriorityId = 0;
|
||||
pLayerBsInfo->uiSpatialId = 0;
|
||||
pLayerBsInfo->uiTemporalId = 0;
|
||||
pLayerBsInfo->uiQualityId = 0;
|
||||
@ -3095,7 +3093,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
|
||||
WelsLog (pCtx, WELS_LOG_WARNING,
|
||||
"WelsEncoderEncodeExt(), WelsBuildRefList failed for P frames, pCtx->iNumRef0= %d. ForceCodingIDR!\n",
|
||||
pCtx->iNumRef0);
|
||||
pFbi->eOutputFrameType = videoFrameTypeIDR;
|
||||
pFbi->eFrameType = videoFrameTypeIDR;
|
||||
pCtx->iEncoderError = ENC_RETURN_CORRECTED;
|
||||
return ENC_RETURN_CORRECTED;
|
||||
}
|
||||
@ -3150,7 +3148,6 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
|
||||
pLayerBsInfo->uiSpatialId = iCurDid;
|
||||
pLayerBsInfo->uiTemporalId = iCurTid;
|
||||
pLayerBsInfo->uiQualityId = 0;
|
||||
pLayerBsInfo->uiPriorityId = 0;
|
||||
pLayerBsInfo->iNalCount = ++ iNalIdxInLayer;
|
||||
}
|
||||
// for dynamic slicing single threading..
|
||||
@ -3336,7 +3333,6 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
|
||||
pLayerBsInfo->uiSpatialId = iCurDid;
|
||||
pLayerBsInfo->uiTemporalId = iCurTid;
|
||||
pLayerBsInfo->uiQualityId = 0;
|
||||
pLayerBsInfo->uiPriorityId = 0;
|
||||
pLayerBsInfo->iNalCount = iNalIdxInLayer;
|
||||
}
|
||||
}
|
||||
@ -3360,7 +3356,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
|
||||
ForceCodingIDR (pCtx);
|
||||
WelsLog (pCtx, WELS_LOG_WARNING, "WelsEncoderEncodeExt(), WelsUpdateRefList failed. ForceCodingIDR!\n");
|
||||
//the above is to set the next frame to be IDR
|
||||
pFbi->eOutputFrameType = eFrameType;
|
||||
pFbi->eFrameType = eFrameType;
|
||||
return ENC_RETURN_CORRECTED;
|
||||
}
|
||||
}
|
||||
@ -3474,7 +3470,6 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
|
||||
|
||||
pCtx->pWelsSvcRc[pCtx->uiDependencyId].iPaddingSize = 0;
|
||||
|
||||
pLayerBsInfo->uiPriorityId = 0;
|
||||
pLayerBsInfo->uiSpatialId = 0;
|
||||
pLayerBsInfo->uiTemporalId = 0;
|
||||
pLayerBsInfo->uiQualityId = 0;
|
||||
@ -3512,7 +3507,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
|
||||
ForceCodingIDR (pCtx);
|
||||
WelsLog (pCtx, WELS_LOG_WARNING, "WelsEncoderEncodeExt(), Logic Error Found in temporal level. ForceCodingIDR!\n");
|
||||
//the above is to set the next frame IDR
|
||||
pFbi->eOutputFrameType = eFrameType;
|
||||
pFbi->eFrameType = eFrameType;
|
||||
return ENC_RETURN_CORRECTED;
|
||||
}
|
||||
|
||||
@ -3548,7 +3543,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
|
||||
|
||||
WelsEmms();
|
||||
|
||||
pFbi->eOutputFrameType = eFrameType;
|
||||
pFbi->eFrameType = eFrameType;
|
||||
return ENC_RETURN_SUCCESS;
|
||||
}
|
||||
|
||||
@ -3939,7 +3934,6 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx,
|
||||
pLayerBsInfo->uiSpatialId = pCtx->uiDependencyId;
|
||||
pLayerBsInfo->uiTemporalId = pCtx->uiTemporalId;
|
||||
pLayerBsInfo->uiQualityId = 0;
|
||||
pLayerBsInfo->uiPriorityId = 0;
|
||||
pLayerBsInfo->iNalCount = iNalIdxInLayer;
|
||||
|
||||
return ENC_RETURN_SUCCESS;
|
||||
|
@ -634,7 +634,6 @@ int32_t WriteSliceToFrameBs (sWelsEncCtx* pCtx, SLayerBSInfo* pLbi, uint8_t* pFr
|
||||
pLbi->uiSpatialId = pNalHdrExt->uiDependencyId;
|
||||
pLbi->uiTemporalId = pNalHdrExt->uiTemporalId;
|
||||
pLbi->uiQualityId = 0;
|
||||
pLbi->uiPriorityId = 0;
|
||||
pLbi->iNalCount = kiNalCnt;
|
||||
} else {
|
||||
pLbi->iNalCount += kiNalCnt;
|
||||
|
@ -360,7 +360,7 @@ class OpenH264VideoEncoder : public GMPVideoEncoder {
|
||||
GMPVideoFrameType encoded_type;
|
||||
bool has_frame = false;
|
||||
|
||||
switch (encoded.eOutputFrameType) {
|
||||
switch (encoded.eFrameType) {
|
||||
case videoFrameTypeIDR:
|
||||
encoded_type = kGMPKeyFrame;
|
||||
has_frame = true;
|
||||
@ -379,7 +379,7 @@ class OpenH264VideoEncoder : public GMPVideoEncoder {
|
||||
case videoFrameTypeIPMixed://this type is currently not suppported
|
||||
case videoFrameTypeInvalid:
|
||||
GMPLOG (GL_ERROR, "Couldn't encode frame. Type = "
|
||||
<< encoded.eOutputFrameType);
|
||||
<< encoded.eFrameType);
|
||||
break;
|
||||
default:
|
||||
// The API is defined as returning a type.
|
||||
|
@ -96,7 +96,7 @@ void BaseEncoderTest::EncodeStream(InputStream* in, EUsageType usageType, int wi
|
||||
while (in->read(buf.data(), frameSize) == frameSize) {
|
||||
rv = encoder_->EncodeFrame(&pic, &info);
|
||||
ASSERT_TRUE(rv == cmResultSuccess);
|
||||
if (info.eOutputFrameType != videoFrameTypeSkip && cbk != NULL) {
|
||||
if (info.eFrameType != videoFrameTypeSkip && cbk != NULL) {
|
||||
cbk->onEncodeFrame(info);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user