From a7bffa5e6575b454cfa50f6465e6d2b72e3b1bdf Mon Sep 17 00:00:00 2001 From: Mr-Z-2697 <74594146+mr-z-2...@users.noreply.github.com> Date: Sat, 28 Dec 2024 15:26:16 +0800 Subject: [PATCH] CUTree: Improve the accuracy of frame duration calculate This loop has no practical use. The precision problem with IEEE 754 binary formats will cause slight inaccuracy, and inconsistency when compiled with different compilers and options (Machine-Dependent Options). Fixes https://bitbucket.org/multicoreware/x265_git/issues/957/different-metrics-with-avx-versions --- source/encoder/slicetype.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/source/encoder/slicetype.cpp b/source/encoder/slicetype.cpp index e94a7eb9c..e6b831349 100644 --- a/source/encoder/slicetype.cpp +++ b/source/encoder/slicetype.cpp @@ -3546,11 +3546,8 @@ void Lookahead::cuTree(Lowres **frames, int numframes, bool bIntra) int bframes = 0; x265_emms(); - double totalDuration = 0.0; - for (int j = 0; j <= numframes; j++) - totalDuration += (double)m_param->fpsDenom / m_param->fpsNum; - double averageDuration = totalDuration / (numframes + 1); + double averageDuration = (double)m_param->fpsDenom / m_param->fpsNum; int i = numframes; -- 2.49.0.windows.1
0001-CUTree-Improve-the-accuracy-of-frame-duration-calcul.patch
Description: Binary data
_______________________________________________ x265-devel mailing list x265-devel@videolan.org https://mailman.videolan.org/listinfo/x265-devel