<div dir="ltr"><div>From 3b5391aed1d50348a1c00744221913bddcb3f1fb Mon Sep 17 00:00:00 2001<br>From: Kirithika <<a href="mailto:kirithika@multicorewareinc.com">kirithika@multicorewareinc.com</a>><br>Date: Fri, 8 Nov 2024 09:10:20 +0530<br>Subject: [PATCH] Add CLI support for configuring RC at frame level<br><br>This patch also does cleanup and docs update<br>---<br> doc/reST/cli.rst               |  9 +++-<br> source/CMakeLists.txt          |  2 +-<br> source/common/frame.h          |  4 +-<br> source/common/param.cpp        |  5 ++<br> source/encoder/api.cpp         | 22 +++++++--<br> source/encoder/encoder.cpp     | 84 +++++++++++++++-------------------<br> source/encoder/ratecontrol.cpp | 73 +++++++++++++----------------<br> source/x265.h                  |  5 ++<br> source/x265cli.cpp             |  3 +-<br> source/x265cli.h               |  2 +<br> 10 files changed, 114 insertions(+), 95 deletions(-)<br><br>diff --git a/doc/reST/cli.rst b/doc/reST/cli.rst<br>index 4d4774613..b5a04a136 100755<br>--- a/doc/reST/cli.rst<br>+++ b/doc/reST/cli.rst<br>@@ -2102,7 +2102,14 @@ Quality, rate control and rate distortion options<br>    Used to trigger encoding of selective GOPs; Disabled by default.<br>     <br>     **API ONLY**<br>- <br>+<br>+.. option:: --frame-rc, --no-frame-rc<br>+<br>+    This option allows configuring Rate control parameter of the chosen Rate Control<br>+    mode(CRF or QP or Bitrate) at frame level.<br>+    This option is recommended to be enabled only when planning to invoke the API function<br>+    x265_encoder_reconfig() to configure Rate control parameter value for each frame.<br>+    Default: disabled.<br> <br> Quantization Options<br> ====================<br>diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt<br>index 14f6ccc49..9e5af81e4 100755<br>--- a/source/CMakeLists.txt<br>+++ b/source/CMakeLists.txt<br>@@ -31,7 +31,7 @@ option(NATIVE_BUILD "Target the build CPU" OFF)<br> option(STATIC_LINK_CRT "Statically link C and C++ runtimes 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 214)<br>+set(X265_BUILD 215)<br> configure_file("${PROJECT_SOURCE_DIR}/<a href="http://x265.def.in">x265.def.in</a>"<br>                "${PROJECT_BINARY_DIR}/x265.def")<br> configure_file("${PROJECT_SOURCE_DIR}/<a href="http://x265_config.h.in">x265_config.h.in</a>"<br>diff --git a/source/common/frame.h b/source/common/frame.h<br>index 035c0655c..704f19422 100644<br>--- a/source/common/frame.h<br>+++ b/source/common/frame.h<br>@@ -175,10 +175,10 @@ public:<br>     Frame*                 m_nextSubDPB;           // PicList doubly linked list pointers<br>     Frame*                 m_prevSubDPB;<br> <br>-    /*Target bitrate*/<br>+    /*Target bitrate for this picture*/<br>     int64_t                m_targetBitrate;<br>     /* target CRF for this picture.*/<br>-    int                    m_targetCrf;<br>+    double                 m_targetCrf;<br>     /* target QP for this picture.*/<br>     int                    m_targetQp;<br> <br>diff --git a/source/common/param.cpp b/source/common/param.cpp<br>index 85dd5df98..dd8a12ef4 100755<br>--- a/source/common/param.cpp<br>+++ b/source/common/param.cpp<br>@@ -444,6 +444,8 @@ void x265_param_default(x265_param* param)<br> <br>     /* SCC */<br>     param->bEnableSCC = 0;<br>+<br>+    param->bConfigRCFrame = 0;<br> }<br> <br> int x265_param_default_preset(x265_param* param, const char* preset, const char* tune)<br>@@ -1517,6 +1519,7 @@ int x265_param_parse(x265_param* p, const char* name, const char* value)<br>                 p->bEnableWeightedPred = false;<br>         }<br> #endif<br>+        OPT("frame-rc") p->bConfigRCFrame = atobool(value);<br>         else<br>             return X265_PARAM_BAD_NAME;<br>     }<br>@@ -2472,6 +2475,7 @@ char *x265_param2string(x265_param* p, int padx, int pady)<br>     s += snprintf(s, bufSize - (s - buf), "scc=%d", p->bEnableSCC);<br> #endif<br>     BOOL(p->bEnableSBRC, "sbrc");<br>+    BOOL(p->bConfigRCFrame, "frame-rc");<br> #undef BOOL<br>     return buf;<br> }<br>@@ -3020,6 +3024,7 @@ void x265_copy_params(x265_param* dst, x265_param* src)<br>     if (src->aomFilmGrain)<br>         dst->aomFilmGrain = src->aomFilmGrain;<br>     dst->bEnableSBRC = src->bEnableSBRC;<br>+    dst->bConfigRCFrame = src->bConfigRCFrame;<br> }<br> <br> #ifdef SVT_HEVC<br>diff --git a/source/encoder/api.cpp b/source/encoder/api.cpp<br>index 5024314f6..5b6e959c0 100644<br>--- a/source/encoder/api.cpp<br>+++ b/source/encoder/api.cpp<br>@@ -358,7 +358,7 @@ int x265_encoder_reconfig(x265_encoder* enc, x265_param* param_in)<br>         }<br>         if (!isReconfigureRc)<br>             encoder->m_reconfigure = true;<br>-        else if (encoder->m_reconfigureRc)<br>+        else if (encoder->m_reconfigureRc || encoder->m_latestParam->bConfigRCFrame)<br>         {<br>             VPS saveVPS;<br>             memcpy(&saveVPS.ptl, &encoder->m_vps.ptl, sizeof(saveVPS.ptl));<br>@@ -1408,7 +1408,15 @@ FILE* x265_csvlog_open(const x265_param* param)<br> #if ENABLE_LIBVMAF<br>                     fprintf(csvfp, ", VMAF Frame Score");<br> #endif<br>-                    fprintf(csvfp, ", Target bitrate");<br>+                    if (param->bConfigRCFrame)<br>+                    {<br>+                        if (param->rc.rateControlMode == X265_RC_ABR)<br>+                            fprintf(csvfp, ", Target bitrate");<br>+                        else if (param->rc.rateControlMode == X265_RC_CRF)<br>+                            fprintf(csvfp, ", Target CRF");<br>+                        else if (param->rc.rateControlMode == X265_RC_CQP)<br>+                            fprintf(csvfp, ", Target QP");<br>+                    }<br>                 }<br>                 fprintf(csvfp, "\n");<br>             }<br>@@ -1536,7 +1544,15 @@ void x265_csvlog_frame(const x265_param* param, const x265_picture* pic)<br> #if ENABLE_LIBVMAF<br>         fprintf(param->csvfpt, ", %lf", frameStats->vmafFrameScore);<br> #endif<br>-        fprintf(param->csvfpt, ", %I64d", frameStats->currTrBitrate);<br>+        if (param->bConfigRCFrame)<br>+        {<br>+            if(param->rc.rateControlMode == X265_RC_ABR)<br>+                fprintf(param->csvfpt, ", %ld", (long)frameStats->currTrBitrate);<br>+            else if (param->rc.rateControlMode == X265_RC_CRF)<br>+                fprintf(param->csvfpt, ", %f", frameStats->currTrCRF);<br>+            else if (param->rc.rateControlMode == X265_RC_CQP)<br>+                fprintf(param->csvfpt, ", %d", frameStats->currTrQP);<br>+        }<br>     }<br>     fprintf(param->csvfpt, "\n");<br>     fflush(stderr);<br>diff --git a/source/encoder/encoder.cpp b/source/encoder/encoder.cpp<br>index 17f14c561..1fbaf3228 100644<br>--- a/source/encoder/encoder.cpp<br>+++ b/source/encoder/encoder.cpp<br>@@ -1522,7 +1522,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)<br>                 inputPic[view] = pic_in + view;<br>         }<br> <br>-        x265_param* p = (m_reconfigure || m_reconfigureRc) ? m_latestParam : m_param;<br>+        x265_param* p = (m_reconfigure || m_reconfigureRc || m_param->bConfigRCFrame) ? m_latestParam : m_param;<br>         Frame* inFrame[MAX_LAYERS];<br>         for (int layer = 0; layer < m_param->numLayers; layer++)<br>         {<br>@@ -1664,8 +1664,17 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)<br>             }<br> <br>             inFrame[layer]->m_forceqp = inputPic[0]->forceqp;<br>-            inFrame[layer]->m_param = (m_reconfigure || m_reconfigureRc) ? m_latestParam : m_param;<br>+            inFrame[layer]->m_param = (m_reconfigure || m_reconfigureRc || m_param->bConfigRCFrame) ? m_latestParam : m_param;<br>             inFrame[layer]->m_picStruct = inputPic[0]->picStruct;<br>+<br>+            /*Copy reconfigured RC parameters to frame*/<br>+            if (m_param->rc.rateControlMode == X265_RC_ABR)<br>+                inFrame[layer]->m_targetBitrate = inFrame[layer]->m_param->rc.bitrate;<br>+            else if (m_param->rc.rateControlMode == X265_RC_CRF)<br>+                inFrame[layer]->m_targetCrf = inFrame[layer]->m_param->rc.rfConstant;<br>+            else if (m_param->rc.rateControlMode == X265_RC_CQP)<br>+                inFrame[layer]->m_targetQp = inFrame[layer]->m_param->rc.qp;<br>+<br>             if (m_param->bField && m_param->interlaceMode)<br>                 inFrame[layer]->m_fieldNum = inputPic[0]->fieldNum;<br> <br>@@ -1802,26 +1811,8 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)<br>             }<br>         }<br> <br>-        if (m_reconfigureRc)<br>-        {<br>-            if (m_param->rc.rateControlMode == X265_RC_ABR)<br>-                inFrame[0]->m_targetBitrate = m_latestParam->rc.bitrate;<br>-            else if (m_param->rc.rateControlMode == X265_RC_CRF)<br>-                inFrame[0]->m_targetCrf = (int)m_latestParam->rc.rfConstant;<br>-            else if (m_param->rc.rateControlMode == X265_RC_CQP)<br>-                inFrame[0]->m_targetQp = m_latestParam->rc.qp;<br>+        if (m_reconfigureRc || m_param->bConfigRCFrame)<br>             inFrame[0]->m_reconfigureRc = true;<br>-            m_reconfigureRc = false;<br>-        }<br>-        else<br>-        {<br>-            if (m_param->rc.rateControlMode == X265_RC_ABR)<br>-                inFrame[0]->m_targetBitrate = m_latestParam->rc.bitrate;<br>-            else if (m_param->rc.rateControlMode == X265_RC_CRF)<br>-                inFrame[0]->m_targetCrf = (int)m_latestParam->rc.rfConstant;<br>-            else if (m_param->rc.rateControlMode == X265_RC_CQP)<br>-                inFrame[0]->m_targetQp = m_latestParam->rc.qp;<br>-        }<br> <br>         if (m_param->bEnableTemporalFilter)<br>         {<br>@@ -2005,16 +1996,6 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)<br>                         if (m_param->bUseAnalysisFile)<br>                             x265_free_analysis_data(m_param, &pic_out[sLayer].analysisData);<br>                     }<br>-                    if (sLayer == 0)<br>-                    {<br>-                        if (outFrame->m_targetBitrate && m_param->rc.rateControlMode == X265_RC_ABR)<br>-                            pic_out[sLayer].frameData.currTrBitrate = outFrame->m_targetBitrate;<br>-                        else<br>-                            pic_out[sLayer].frameData.currTrBitrate = 0;<br>-                    }<br>-                    else<br>-                        x265_log(m_param, X265_LOG_WARNING, "Frame wise bitrate reconfigure are not supported for enhancement layers\n");<br>-<br>                 }<br>                 if (m_param->rc.bStatWrite && (m_param->analysisMultiPassRefine || m_param->analysisMultiPassDistortion))<br>                 {<br>@@ -2230,26 +2211,30 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)<br> <br>             if (frameEnc[0]->m_reconfigureRc)<br>             {<br>-                m_rateControl->m_bRcReConfig = true;<br>-                if (m_param->rc.rateControlMode == X265_RC_ABR)<br>+                if (m_reconfigureRc)<br>+                    x265_copy_params(m_param, m_latestParam);<br>+                else if (m_param->bConfigRCFrame)<br>                 {<br>-                    m_param->rc.bitrate = (int)frameEnc[0]->m_targetBitrate;<br>-                    m_rateControl->m_param->rc.bitrate = (int)frameEnc[0]->m_targetBitrate;<br>-                }<br>-                else if (m_param->rc.rateControlMode == X265_RC_CRF)<br>-                {<br>-                    m_param->rc.rfConstant = (double)frameEnc[0]->m_targetCrf;<br>-                    m_rateControl->m_param->rc.rfConstant = frameEnc[0]->m_targetCrf;<br>-                }<br>-                else if (m_param->rc.rateControlMode == X265_RC_CQP)<br>-                {<br>-                    m_param->rc.qp = frameEnc[0]->m_targetQp;<br>-                    m_rateControl->m_param->rc.qp = frameEnc[0]->m_targetQp;<br>+                    m_rateControl->m_bRcReConfig = true;<br>+                    if (m_param->rc.rateControlMode == X265_RC_ABR)<br>+                    {<br>+                        m_param->rc.bitrate = (int)frameEnc[0]->m_targetBitrate;<br>+                        m_rateControl->m_param->rc.bitrate = (int)frameEnc[0]->m_targetBitrate;<br>+                    }<br>+                    else if (m_param->rc.rateControlMode == X265_RC_CRF)<br>+                    {<br>+                        m_param->rc.rfConstant = (double)frameEnc[0]->m_targetCrf;<br>+                        m_rateControl->m_param->rc.rfConstant = frameEnc[0]->m_targetCrf;<br>+                    }<br>+                    else if (m_param->rc.rateControlMode == X265_RC_CQP)<br>+                    {<br>+                        m_param->rc.qp = frameEnc[0]->m_targetQp;<br>+                        m_rateControl->m_param->rc.qp = frameEnc[0]->m_targetQp;<br>+                    }<br>                 }<br>                 m_rateControl->reconfigureRC();<br>                 m_reconfigureRc = false;<br>             }<br>-<br>             if (frameEnc[0]->m_reconfigureRc && !m_reconfigureRc)<br>                 frameEnc[0]->m_reconfigureRc = false;<br>             if (curEncoder->m_reconfigure)<br>@@ -2522,6 +2507,10 @@ int Encoder::reconfigureParam(x265_param* encParam, x265_param* param)<br>         encParam->rc.rfConstant = param->rc.rfConstant;<br>         m_reconfigureRc |= encParam->rc.qp != param->rc.qp;<br>         encParam->rc.qp = param->rc.qp;<br>+<br>+        /*Allow encoder to reconfigure RC for each input frame*/<br>+        if (encParam->bConfigRCFrame)<br>+            m_reconfigureRc = false;<br>     }<br>     else<br>     {<br>@@ -3204,6 +3193,9 @@ void Encoder::finishFrameStats(Frame* curFrame, FrameEncoder *curEncoder, x265_f<br>                     }<br>                 }<br>             }<br>+            frameStats->currTrBitrate = curFrame->m_targetBitrate;<br>+            frameStats->currTrCRF = curFrame->m_targetCrf;<br>+            frameStats->currTrQP = curFrame->m_targetQp;<br>         }<br> <br>         if (m_param->csvLogLevel >= 1)<br>diff --git a/source/encoder/ratecontrol.cpp b/source/encoder/ratecontrol.cpp<br>index 300e27534..d1f335e30 100644<br>--- a/source/encoder/ratecontrol.cpp<br>+++ b/source/encoder/ratecontrol.cpp<br>@@ -1935,11 +1935,13 @@ double RateControl::rateEstimateQscale(Frame* curFrame, RateControlEntry *rce)<br>         if (m_param->rc.rateControlMode == X265_RC_ABR)<br>             m_bitrate = (double)curFrame->m_targetBitrate * 1000;<br>         else if (m_param->rc.rateControlMode == X265_RC_CRF)<br>-            m_param->rc.rfConstant = (double)curFrame->m_targetCrf;<br>-        else if (m_param->rc.rateControlMode == X265_RC_CQP)<br>-            m_param->rc.qp = curFrame->m_targetQp;<br>+        {<br>+            double mbtree_offset = m_param->rc.cuTree ? (1.0 - m_param->rc.qCompress) * 13.5 : 0;<br>+            double qComp = (m_param->rc.cuTree && !m_param->rc.hevcAq) ? 0.99 : m_param->rc.qCompress;<br>+            m_rateFactorConstant = pow(m_currentSatd, 1.0 - qComp) /<br>+                x265_qp2qScale(curFrame->m_targetCrf + mbtree_offset);<br>+        }<br>     }<br>-<br>     if ((m_param->bliveVBV2pass && m_param->rc.rateControlMode == X265_RC_ABR) || m_isAbr)<br>     {<br>         int pos = m_sliderPos % s_slidingWindowFrames;<br>@@ -2021,11 +2023,6 @@ double RateControl::rateEstimateQscale(Frame* curFrame, RateControlEntry *rce)<br> <br>         if (m_bRcReConfig && m_param->rc.rateControlMode == X265_RC_CRF)<br>         {<br>-            double rfConstant = m_param->rc.rfConstant;<br>-            double mbtree_offset = m_param->rc.cuTree ? (1.0 - m_param->rc.qCompress) * 13.5 : 0;<br>-            double qComp = (m_param->rc.cuTree && !m_param->rc.hevcAq) ? 0.99 : m_param->rc.qCompress;<br>-            m_rateFactorConstant = pow(m_currentSatd, 1.0 - qComp) /<br>-                x265_qp2qScale(rfConstant + mbtree_offset);<br>             double qScale = getQScale(rce, m_rateFactorConstant);<br>             q = x265_qScale2qp(qScale);<br>         }<br>@@ -2277,14 +2274,6 @@ double RateControl::rateEstimateQscale(Frame* curFrame, RateControlEntry *rce)<br>                     m_rateFactorConstant = pow(m_currentSatd, 1.0 - qComp) /<br>                         x265_qp2qScale(rfConstant + mbtree_offset);<br>                 }<br>-                if (m_bRcReConfig)<br>-                {<br>-                    double rfConstant = m_param->rc.rfConstant;<br>-                    double mbtree_offset = m_param->rc.cuTree ? (1.0 - m_param->rc.qCompress) * 13.5 : 0;<br>-                    double qComp = (m_param->rc.cuTree && !m_param->rc.hevcAq) ? 0.99 : m_param->rc.qCompress;<br>-                    m_rateFactorConstant = pow(m_currentSatd, 1.0 - qComp) /<br>-                        x265_qp2qScale(rfConstant + mbtree_offset);<br>-                }<br>                 q = getQScale(rce, m_rateFactorConstant);<br>                 x265_zone* zone = getZone();<br>                 if (zone)<br>@@ -2596,34 +2585,36 @@ double RateControl::tuneQscaleForSBRC(Frame* curFrame, double q)<br> double RateControl::tuneQscaleToUpdatedBitrate(Frame* curFrame, double q)<br> {<br>     int depth = 18;<br>-<br>-    for (int iterations = 0; iterations < 100; iterations++)<br>+    if (m_isVbv && m_currentSatd > 0 && curFrame)<br>     {<br>-        int i;<br>-        double frameBitsTotal = m_fps * predictSize(&m_pred[m_predType], q, (double)m_currentSatd);<br>-        for (i = 0; i < depth; i++)<br>+        for (int iterations = 0; iterations < 100; iterations++)<br>         {<br>-            int type = curFrame->m_lowres.plannedType[i];<br>-            if (type == X265_TYPE_AUTO)<br>+            int i;<br>+            double frameBitsTotal = m_fps * predictSize(&m_pred[m_predType], q, (double)m_currentSatd);<br>+            for (i = 0; i < depth; i++)<br>+            {<br>+                int type = curFrame->m_lowres.plannedType[i];<br>+                if (type == X265_TYPE_AUTO)<br>+                    break;<br>+                int64_t satd = curFrame->m_lowres.plannedSatd[i] >> (X265_DEPTH - 8);<br>+                type = IS_X265_TYPE_I(curFrame->m_lowres.plannedType[i]) ? I_SLICE : IS_X265_TYPE_B(curFrame->m_lowres.plannedType[i]) ? B_SLICE : P_SLICE;<br>+                int predType = getPredictorType(curFrame->m_lowres.plannedType[i], type);<br>+                double curBits = m_fps * predictSize(&m_pred[predType], q, (double)satd);<br>+                frameBitsTotal += curBits;<br>+            }<br>+            frameBitsTotal /= i;<br>+            double allowedSize = (double)(curFrame->m_targetBitrate * 1000);<br>+            if (frameBitsTotal >= 1.1 * allowedSize)<br>+                q = q * 1.1;<br>+            else if (frameBitsTotal >= 1.05 * allowedSize)<br>+                q = q * 1.05;<br>+            else if (frameBitsTotal <= 0.9 * allowedSize)<br>+                q = q / 1.1;<br>+            else if (frameBitsTotal <= 0.95 * allowedSize)<br>+                q = q / 1.05;<br>+            else<br>                 break;<br>-            int64_t satd = curFrame->m_lowres.plannedSatd[i] >> (X265_DEPTH - 8);<br>-            type = IS_X265_TYPE_I(curFrame->m_lowres.plannedType[i]) ? I_SLICE : IS_X265_TYPE_B(curFrame->m_lowres.plannedType[i]) ? B_SLICE : P_SLICE;<br>-            int predType = getPredictorType(curFrame->m_lowres.plannedType[i], type);<br>-            double curBits = m_fps * predictSize(&m_pred[predType], q, (double)satd);<br>-            frameBitsTotal += curBits;<br>         }<br>-        frameBitsTotal /= i;<br>-        double allowedSize = (double)(curFrame->m_targetBitrate * 1000);<br>-        if (frameBitsTotal >= 1.1 * allowedSize)<br>-            q = q * 1.1;<br>-        else if (frameBitsTotal >= 1.05 * allowedSize)<br>-            q = q * 1.05;<br>-        else if (frameBitsTotal <= 0.9 * allowedSize)<br>-            q = q / 1.1;<br>-        else if (frameBitsTotal <= 0.95 * allowedSize)<br>-            q = q / 1.05;<br>-        else<br>-            break;<br>     }<br>     return q;<br> }<br>diff --git a/source/x265.h b/source/x265.h<br>index 31060b1ee..c4fb1a54d 100644<br>--- a/source/x265.h<br>+++ b/source/x265.h<br>@@ -316,6 +316,8 @@ typedef struct x265_frame_stats<br>     double           unclippedBufferFillFinal;<br>     uint8_t          tLayer;<br>     int64_t          currTrBitrate;<br>+    double           currTrCRF;<br>+    int              currTrQP;<br> } x265_frame_stats;<br> <br> typedef struct x265_ctu_info_t<br>@@ -2338,6 +2340,9 @@ typedef struct x265_param<br> <br>     /*Screen Content Coding*/<br>     int     bEnableSCC;<br>+<br>+    /*Frame level RateControl Configuration*/<br>+    int     bConfigRCFrame;<br> } x265_param;<br> <br> /* x265_param_alloc:<br>diff --git a/source/x265cli.cpp b/source/x265cli.cpp<br>index 3993543eb..a7d5f492a 100755<br>--- a/source/x265cli.cpp<br>+++ b/source/x265cli.cpp<br>@@ -434,7 +434,8 @@ namespace X265_NS {<br>         H0("\nSEI Message Options\n");<br>         H0("   --film-grain <filename>       File containing Film Grain Characteristics to be written as a SEI Message\n");<br>         H0("   --aom-film-grain <filename>   File containing Aom Film Grain Characteristics to be written as a SEI Message\n");<br>-<br>+        H0("   --[no-]frame-rc              Enable configuring Rate Control parameters(QP, CRF or Bitrate) at frame level.Default 0\n"<br>+           "                                Enable this option only when planning to invoke the API function x265_encoder_reconfig to configure Rate Control parameters\n");<br> #undef OPT<br> #undef H0<br> #undef H1<br>diff --git a/source/x265cli.h b/source/x265cli.h<br>index aaa385cb4..86fd14caf 100644<br>--- a/source/x265cli.h<br>+++ b/source/x265cli.h<br>@@ -396,6 +396,8 @@ static const struct option long_options[] =<br>     { "scenecut-qp-config", required_argument, NULL, 0 },<br>     { "film-grain", required_argument, NULL, 0 },<br>     { "aom-film-grain", required_argument, NULL, 0 },<br>+    { "frame-rc",no_argument, NULL, 0 },<br>+    { "no-frame-rc",no_argument, NULL, 0 },<br>     { 0, 0, 0, 0 },<br>     { 0, 0, 0, 0 },<br>     { 0, 0, 0, 0 },<br>-- <br>2.28.0.windows.1<br><br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><i>Thanks,</i><div><i>Kirithika</i></div></div></div></div></div>