diff --git a/codec/encoder/core/src/encoder_ext.cpp b/codec/encoder/core/src/encoder_ext.cpp index 126441fd6..b715f6dc3 100644 --- a/codec/encoder/core/src/encoder_ext.cpp +++ b/codec/encoder/core/src/encoder_ext.cpp @@ -3956,6 +3956,19 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour (iLayerSize << 3)); #endif//LAYER_INFO_OUTPUT + pLayerBsInfo->rPsnr[0] = NAN; + pLayerBsInfo->rPsnr[1] = NAN; + pLayerBsInfo->rPsnr[2] = NAN; + if (pSrcPic->bPsnrY) { + pLayerBsInfo->rPsnr[0] = fSnrY; + } + if (pSrcPic->bPsnrU) { + pLayerBsInfo->rPsnr[1] = fSnrU; + } + if (pSrcPic->bPsnrV) { + pLayerBsInfo->rPsnr[2] = fSnrV; + } + #if defined(STAT_OUTPUT) { @@ -3969,18 +3982,6 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour pCtx->sStatData[iCurDid][0].sQualityStat.rVPsnr[pCtx->eSliceType] += fSnrV; } } - pLayerBsInfo->rPsnr[0] = NAN; - pLayerBsInfo->rPsnr[1] = NAN; - pLayerBsInfo->rPsnr[2] = NAN; - if (pSrcPic->bPsnrY) { - pLayerBsInfo->rPsnr[0] = fSnrY; - } - if (pSrcPic->bPsnrU) { - pLayerBsInfo->rPsnr[1] = fSnrU; - } - if (pSrcPic->bPsnrV) { - pLayerBsInfo->rPsnr[2] = fSnrV; - } #if defined(MB_TYPES_CHECK) //091025, frame output if (pCtx->eSliceType == P_SLICE) {