<div dir="ltr">From 2c75f9426ec716313482ef47f33e2015d3a95e78 Mon Sep 17 00:00:00 2001<br>From: Ponsanthini <<a href="mailto:ponsanthini.arunachalam@multicorewareinc.com">ponsanthini.arunachalam@multicorewareinc.com</a>><br>Date: Fri, 13 Sep 2024 12:35:34 +0530<br>Subject: [PATCH] Fix encode hang issue when using maximum reference<br><br>---<br> source/encoder/level.cpp | 1 +<br> 1 file changed, 1 insertion(+)<br><br>diff --git a/source/encoder/level.cpp b/source/encoder/level.cpp<br>index a87b49d90..defcc7950 100644<br>--- a/source/encoder/level.cpp<br>+++ b/source/encoder/level.cpp<br>@@ -528,6 +528,7 @@ bool enforceLevel(x265_param& param, VPS& vps)<br>     int savedRefCount = param.maxNumReferences;<br>     while (vps.maxDecPicBuffering[vps.maxTempSubLayers - 1] > maxDpbSize && param.maxNumReferences > 1)<br>     {<br>+        param.maxNumReferences--;<br>         vps.maxDecPicBuffering[vps.maxTempSubLayers - 1] = X265_MIN(MAX_NUM_REF, X265_MAX(vps.numReorderPics[vps.maxTempSubLayers - 1] + 1, (uint32_t)param.maxNumReferences) + 1 + !!param.bEnableSCC);<br>     }<br>     if (param.maxNumReferences != savedRefCount)<br>-- <br>2.41.0.windows.3<br><br></div>