Skip to content

Commit 444a538

Browse files
committed
move per-pic psnr
1 parent 573d9ce commit 444a538

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

codec/encoder/core/src/encoder_ext.cpp

+13-12
Original file line numberDiff line numberDiff line change
@@ -3956,6 +3956,19 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
39563956
(iLayerSize << 3));
39573957
#endif//LAYER_INFO_OUTPUT
39583958

3959+
pLayerBsInfo->rPsnr[0] = NAN;
3960+
pLayerBsInfo->rPsnr[1] = NAN;
3961+
pLayerBsInfo->rPsnr[2] = NAN;
3962+
if (pSrcPic->bPsnrY) {
3963+
pLayerBsInfo->rPsnr[0] = fSnrY;
3964+
}
3965+
if (pSrcPic->bPsnrU) {
3966+
pLayerBsInfo->rPsnr[1] = fSnrU;
3967+
}
3968+
if (pSrcPic->bPsnrV) {
3969+
pLayerBsInfo->rPsnr[2] = fSnrV;
3970+
}
3971+
39593972
#if defined(STAT_OUTPUT)
39603973

39613974
{
@@ -3969,18 +3982,6 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
39693982
pCtx->sStatData[iCurDid][0].sQualityStat.rVPsnr[pCtx->eSliceType] += fSnrV;
39703983
}
39713984
}
3972-
pLayerBsInfo->rPsnr[0] = NAN;
3973-
pLayerBsInfo->rPsnr[1] = NAN;
3974-
pLayerBsInfo->rPsnr[2] = NAN;
3975-
if (pSrcPic->bPsnrY) {
3976-
pLayerBsInfo->rPsnr[0] = fSnrY;
3977-
}
3978-
if (pSrcPic->bPsnrU) {
3979-
pLayerBsInfo->rPsnr[1] = fSnrU;
3980-
}
3981-
if (pSrcPic->bPsnrV) {
3982-
pLayerBsInfo->rPsnr[2] = fSnrV;
3983-
}
39843985

39853986
#if defined(MB_TYPES_CHECK) //091025, frame output
39863987
if (pCtx->eSliceType == P_SLICE) {

0 commit comments

Comments
 (0)