<div dir="ltr">pushed to master and Release_3.5 branches </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 5, 2023 at 9:29 PM Karam Singh <<a href="mailto:karam.singh@multicorewareinc.com">karam.singh@multicorewareinc.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">From 0a9a9bb09d0c214cabaecccf69725034366e6938 Mon Sep 17 00:00:00 2001<br>From: Karam Singh <<a href="mailto:karam.singh@multicorewareinc.com" target="_blank">karam.singh@multicorewareinc.com</a>><br>Date: Fri, 5 May 2023 12:55:22 +0530<br>Subject: [PATCH] Fix Avg I Slice QP value issue in zonefile<br><br>---<br> source/CMakeLists.txt          | 2 +-<br> source/common/param.cpp        | 1 +<br> source/encoder/ratecontrol.cpp | 3 ++-<br> source/x265.h                  | 4 ++++<br> source/x265cli.cpp             | 2 ++<br> source/x265cli.h               | 1 +<br> 6 files changed, 11 insertions(+), 2 deletions(-)<br><br>diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt<br>index 4150eb9c6..ca6a2ceee 100644<br>--- a/source/CMakeLists.txt<br>+++ b/source/CMakeLists.txt<br>@@ -29,7 +29,7 @@ option(NATIVE_BUILD "Target the build CPU" OFF)<br> option(STATIC_LINK_CRT "Statically link C runtime for release builds" OFF)<br> mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)<br> # X265_BUILD must be incremented each time the public API is changed<br>-set(X265_BUILD 207)<br>+set(X265_BUILD 208)<br> configure_file("${PROJECT_SOURCE_DIR}/<a href="http://x265.def.in" target="_blank">x265.def.in</a>"<br>                "${PROJECT_BINARY_DIR}/x265.def")<br> configure_file("${PROJECT_SOURCE_DIR}/<a href="http://x265_config.h.in" target="_blank">x265_config.h.in</a>"<br>diff --git a/source/common/param.cpp b/source/common/param.cpp<br>index e9ca077d7..6af9f8184 100644<br>--- a/source/common/param.cpp<br>+++ b/source/common/param.cpp<br>@@ -2587,6 +2587,7 @@ void x265_copy_params(x265_param* dst, x265_param* src)<br>     dst->rc.zonefileCount = src->rc.zonefileCount;<br>     dst->reconfigWindowSize = src->reconfigWindowSize;<br>     dst->bResetZoneConfig = src->bResetZoneConfig;<br>+    dst->bNoResetZoneConfig = src->bNoResetZoneConfig;<br>     dst->decoderVbvMaxRate = src->decoderVbvMaxRate;<br> <br>     if (src->rc.zonefileCount && src->rc.zones && src->bResetZoneConfig)<br>diff --git a/source/encoder/ratecontrol.cpp b/source/encoder/ratecontrol.cpp<br>index a275fca42..08327c52d 100644<br>--- a/source/encoder/ratecontrol.cpp<br>+++ b/source/encoder/ratecontrol.cpp<br>@@ -1306,7 +1306,8 @@ int RateControl::rateControlStart(Frame* curFrame, RateControlEntry* rce, Encode<br>             {<br>                 m_param = m_param->rc.zones[i].zoneParam;<br>                 reconfigureRC();<br>-                init(*m_curSlice->m_sps);<br>+                if (!m_param->bNoResetZoneConfig)<br>+                    init(*m_curSlice->m_sps);<br>             }<br>         }<br>     }<br>diff --git a/source/x265.h b/source/x265.h<br>index d621e4394..7bf25c368 100644<br>--- a/source/x265.h<br>+++ b/source/x265.h<br>@@ -1928,6 +1928,10 @@ typedef struct x265_param<br>       Default 1 (Enabled). API only. */<br>     int       bResetZoneConfig;<br> <br>+    /*Flag to indicate rate-control history has not to be reset during zone reconfiguration.<br>+      Default 0 (Disabled) */<br>+    int       bNoResetZoneConfig;<br>+<br>     /* It reduces the bits spent on the inter-frames within the scenecutWindow before and / or after a scenecut<br>      * by increasing their QP in ratecontrol pass2 algorithm without any deterioration in visual quality.<br>      * 0 - Disabled (default).<br>diff --git a/source/x265cli.cpp b/source/x265cli.cpp<br>index 120a6706d..612c0891f 100755<br>--- a/source/x265cli.cpp<br>+++ b/source/x265cli.cpp<br>@@ -284,6 +284,7 @@ namespace X265_NS {<br>         H1("                                       q=<integer> (force QP)\n");<br>         H1("                                   or  b=<float> (bitrate multiplier)\n");<br>         H0("   --zonefile <filename>         Zone file containing the zone boundaries and the parameters to be reconfigured.\n");<br>+        H0("   --no-zonefile-rc-init         This allow to use rate-control history across zones in zonefile.\n");<br>         H1("   --lambda-file <string>        Specify a file containing replacement values for the lambda tables\n");<br>         H1("                                 MAX_MAX_QP+1 floats for lambda table, then again for lambda2 table\n");<br>         H1("                                 Blank lines and lines starting with hash(#) are ignored\n");<br>@@ -733,6 +734,7 @@ namespace X265_NS {<br>                     if (!this->zoneFile)<br>                         x265_log_file(param, X265_LOG_ERROR, "%s zone file not found or error in opening zone file\n", optarg);<br>                 }<br>+                OPT("no-zonefile-rc-init") this->param->bNoResetZoneConfig = true;<br>                 OPT("fullhelp")<br>                 {<br>                     param->logLevel = X265_LOG_FULL;<br>diff --git a/source/x265cli.h b/source/x265cli.h<br>index 8683ce481..462745a0a 100644<br>--- a/source/x265cli.h<br>+++ b/source/x265cli.h<br>@@ -274,6 +274,7 @@ static const struct option long_options[] =<br>     { "zones",          required_argument, NULL, 0 },<br>     { "qpfile",         required_argument, NULL, 0 },<br>     { "zonefile",       required_argument, NULL, 0 },<br>+    { "no-zonefile-rc-init",  no_argument, NULL, 0 },<br>     { "lambda-file",    required_argument, NULL, 0 },<br>     { "b-intra",              no_argument, NULL, 0 },<br>     { "no-b-intra",           no_argument, NULL, 0 },<br>-- <br>2.36.0.windows.1<br><br><div><div dir="ltr"><div dir="ltr"><div><br></div><div><br></div><div>Karam Singh</div>Senior Video Codec Engineer<div>MulticoreWare, India</div></div></div></div></div>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org" target="_blank">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div>