Merge pull request #396 from volvet/refine_frame_idx
remove uiFrameIdxRc
This commit is contained in:
commit
d623bd0334
@ -151,7 +151,6 @@ typedef struct TagWelsEncCtx {
|
|||||||
// Derived
|
// Derived
|
||||||
int32_t iCodingIndex;
|
int32_t iCodingIndex;
|
||||||
int32_t iFrameIndex; // count how many frames elapsed during coding context currently
|
int32_t iFrameIndex; // count how many frames elapsed during coding context currently
|
||||||
uint32_t uiFrameIdxRc; //only for RC
|
|
||||||
int32_t iFrameNum; // current frame number coding
|
int32_t iFrameNum; // current frame number coding
|
||||||
int32_t iPOC; // frame iPOC
|
int32_t iPOC; // frame iPOC
|
||||||
EWelsSliceType eSliceType; // currently coding slice type
|
EWelsSliceType eSliceType; // currently coding slice type
|
||||||
|
@ -213,11 +213,7 @@ void InitFrameCoding (sWelsEncCtx* pEncCtx, const EFrameType keFrameType) {
|
|||||||
InitBits (&pEncCtx->pOut->sBsWrite, pEncCtx->pOut->pBsBuffer, pEncCtx->pOut->uiSize);
|
InitBits (&pEncCtx->pOut->sBsWrite, pEncCtx->pOut->pBsBuffer, pEncCtx->pOut->uiSize);
|
||||||
|
|
||||||
if (keFrameType == WELS_FRAME_TYPE_P) {
|
if (keFrameType == WELS_FRAME_TYPE_P) {
|
||||||
if (pEncCtx->pSvcParam->uiIntraPeriod) {
|
++pEncCtx->iFrameIndex;
|
||||||
++pEncCtx->iFrameIndex;
|
|
||||||
}
|
|
||||||
|
|
||||||
++pEncCtx->uiFrameIdxRc;
|
|
||||||
|
|
||||||
if (pEncCtx->iPOC < (1 << pEncCtx->pSps->iLog2MaxPocLsb) - 2) // if iPOC type is no 0, this need be modification
|
if (pEncCtx->iPOC < (1 << pEncCtx->pSps->iLog2MaxPocLsb) - 2) // if iPOC type is no 0, this need be modification
|
||||||
pEncCtx->iPOC += 2; // for POC type 0
|
pEncCtx->iPOC += 2; // for POC type 0
|
||||||
@ -237,10 +233,7 @@ void InitFrameCoding (sWelsEncCtx* pEncCtx, const EFrameType keFrameType) {
|
|||||||
pEncCtx->iFrameNum = 0;
|
pEncCtx->iFrameNum = 0;
|
||||||
pEncCtx->iPOC = 0;
|
pEncCtx->iPOC = 0;
|
||||||
pEncCtx->bEncCurFrmAsIdrFlag = false;
|
pEncCtx->bEncCurFrmAsIdrFlag = false;
|
||||||
if (pEncCtx->pSvcParam->uiIntraPeriod) {
|
pEncCtx->iFrameIndex = 0;
|
||||||
pEncCtx->iFrameIndex = 0;
|
|
||||||
}
|
|
||||||
pEncCtx->uiFrameIdxRc = 0;
|
|
||||||
|
|
||||||
pEncCtx->eNalType = NAL_UNIT_CODED_SLICE_IDR;
|
pEncCtx->eNalType = NAL_UNIT_CODED_SLICE_IDR;
|
||||||
pEncCtx->eSliceType = I_SLICE;
|
pEncCtx->eSliceType = I_SLICE;
|
||||||
@ -286,7 +279,7 @@ EFrameType DecideFrameType (sWelsEncCtx* pEncCtx, const int8_t kiSpatialNum) {
|
|||||||
// perform scene change detection
|
// perform scene change detection
|
||||||
if ((!pSvcParam->bEnableSceneChangeDetect) || pEncCtx->pVaa->bIdrPeriodFlag ||
|
if ((!pSvcParam->bEnableSceneChangeDetect) || pEncCtx->pVaa->bIdrPeriodFlag ||
|
||||||
(kiSpatialNum < pSvcParam->iSpatialLayerNum)
|
(kiSpatialNum < pSvcParam->iSpatialLayerNum)
|
||||||
|| (pEncCtx->uiFrameIdxRc < (VGOP_SIZE << 1))) { // avoid too frequent I frame coding, rc control
|
|| (pEncCtx->iFrameIndex < (VGOP_SIZE << 1))) { // avoid too frequent I frame coding, rc control
|
||||||
bSceneChangeFlag = false;
|
bSceneChangeFlag = false;
|
||||||
} else {
|
} else {
|
||||||
bSceneChangeFlag = pEncCtx->pVaa->bSceneChangeFlag;
|
bSceneChangeFlag = pEncCtx->pVaa->bSceneChangeFlag;
|
||||||
|
@ -678,7 +678,7 @@ void RcTraceFrameBits (sWelsEncCtx* pEncCtx) {
|
|||||||
|
|
||||||
WelsLog (pEncCtx, WELS_LOG_INFO,
|
WelsLog (pEncCtx, WELS_LOG_INFO,
|
||||||
"[Rc] encoding_qp%d, qp = %3d, index = %8d, iTid = %1d, used = %8d, target = %8d, remaingbits = %8d\n",
|
"[Rc] encoding_qp%d, qp = %3d, index = %8d, iTid = %1d, used = %8d, target = %8d, remaingbits = %8d\n",
|
||||||
pEncCtx->uiDependencyId, pWelsSvcRc->iAverageFrameQp, pEncCtx->uiFrameIdxRc, pEncCtx->uiTemporalId,
|
pEncCtx->uiDependencyId, pWelsSvcRc->iAverageFrameQp, pEncCtx->iFrameIndex, pEncCtx->uiTemporalId,
|
||||||
pWelsSvcRc->iFrameDqBits,
|
pWelsSvcRc->iFrameDqBits,
|
||||||
pWelsSvcRc->iTargetBits, pWelsSvcRc->iRemainingBits);
|
pWelsSvcRc->iTargetBits, pWelsSvcRc->iRemainingBits);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user