From a7bffa5e6575b454cfa50f6465e6d2b72e3b1bdf Mon Sep 17 00:00:00 2001
 From: Mr-Z-2697 <74594146+mr-z-2...@users.noreply.github.com&gt;
 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
 ---
 &nbsp;source/encoder/slicetype.cpp | 5 +----
 &nbsp;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)
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int bframes = 0;
 &nbsp;
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x265_emms();
 -&nbsp;&nbsp;&nbsp;&nbsp;double totalDuration = 0.0;
 -&nbsp;&nbsp;&nbsp;&nbsp;for (int j = 0; j <= numframes; j++)
 -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;totalDuration += 
(double)m_param-&gt;fpsDenom / m_param-&gt;fpsNum;
 &nbsp;
 -&nbsp;&nbsp;&nbsp;&nbsp;double averageDuration = totalDuration / (numframes + 
1);
 +&nbsp;&nbsp;&nbsp;&nbsp;double averageDuration = (double)m_param-&gt;fpsDenom 
/ m_param-&gt;fpsNum;
 &nbsp;
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int i = numframes;
 &nbsp;
 --&nbsp;
 2.49.0.windows.1

Attachment: 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

Reply via email to