Skip to content

Commit

Permalink
move per-pic psnr
Browse files Browse the repository at this point in the history
  • Loading branch information
fippo committed Dec 13, 2024
1 parent 573d9ce commit 444a538
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions codec/encoder/core/src/encoder_ext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)

{
Expand All @@ -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) {
Expand Down

0 comments on commit 444a538

Please sign in to comment.