From cf3b514ba34a3a6c4f14b3ae8714325dd30bfa08 Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Sat, 25 Jan 2025 19:07:03 -0800 Subject: [PATCH] psnr: do not use NAN, initialize to 0 (#3836) 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. --- codec/encoder/core/src/encoder_ext.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/codec/encoder/core/src/encoder_ext.cpp b/codec/encoder/core/src/encoder_ext.cpp index dc36c85e7..71ec0d1a0 100644 --- a/codec/encoder/core/src/encoder_ext.cpp +++ b/codec/encoder/core/src/encoder_ext.cpp @@ -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; }