Skip to content

Commit

Permalink
psnr: do not use NAN, initialize to 0
Browse files Browse the repository at this point in the history
which is not supported in some older compilers as pointed out in #3824
Applications should always check whether they requested calculating
PSNR before evaluating that field in the result.
  • Loading branch information
fippo committed Jan 24, 2025
1 parent e49c095 commit 756dc08
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions codec/encoder/core/src/encoder_ext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3956,9 +3956,9 @@ 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;
pLayerBsInfo->rPsnr[0] = 0;
pLayerBsInfo->rPsnr[1] = 0;
pLayerBsInfo->rPsnr[2] = 0;
if (pSrcPic->bPsnrY) {
pLayerBsInfo->rPsnr[0] = fSnrY;
}
Expand Down

0 comments on commit 756dc08

Please sign in to comment.