<div dir="ltr">From aaff52c8a1d2f1c48800dac864fab2bad79307cd Mon Sep 17 00:00:00 2001<br>From: AnusuyaKumarasamy <<a href="mailto:anusuya.kumarasamy@multicorewareinc.com">anusuya.kumarasamy@multicorewareinc.com</a>><br>Date: Fri, 6 Sep 2024 17:21:20 +0530<br>Subject: [PATCH 7/7] Fix issue in non scalable flow & increased NAL unit size<br> for scalable feature<br><br>---<br> source/common/param.cpp         | 2 ++<br> source/common/slice.h           | 2 +-<br> source/encoder/encoder.cpp      | 5 ++++-<br> source/encoder/frameencoder.cpp | 4 ++--<br> source/encoder/nal.h            | 4 ++++<br> source/x265cli.cpp              | 6 +++---<br> 6 files changed, 16 insertions(+), 7 deletions(-)<br><br>diff --git a/source/common/param.cpp b/source/common/param.cpp<br>index 72561a9cf..d08bb604e 100755<br>--- a/source/common/param.cpp<br>+++ b/source/common/param.cpp<br>@@ -1959,11 +1959,13 @@ int x265_check_params(x265_param* param)<br>     if (param->bEnableAlpha)<br>     {<br>         CHECK((param->internalCsp != X265_CSP_I420), "Alpha encode supported only with i420a colorspace");<br>+        CHECK((param->analysisMultiPassDistortion || param->analysisMultiPassRefine), "Alpha encode doesnot support multipass feature");<br>     }<br> #endif<br> #if ENABLE_MULTIVIEW<br>     CHECK((param->numViews > 2), "Multi-View Encoding currently support only 2 views");<br>     CHECK((param->numViews > 1) && (param->internalBitDepth != 8), "BitDepthConstraint must be 8 for Multiview main profile");<br>+    CHECK((param->numViews > 1) && (param->analysisMultiPassDistortion || param->analysisMultiPassRefine), "Multiview encode doesnot support multipass feature");<br> #endif<br> #if ENABLE_SCC_EXT<br>     CHECK(!!param->bEnableSCC&& param->rdLevel != 6, "Enabling scc extension in x265 requires rdlevel of 6 ");<br>diff --git a/source/common/slice.h b/source/common/slice.h<br>index 022ce4d75..041bc451e 100644<br>--- a/source/common/slice.h<br>+++ b/source/common/slice.h<br>@@ -173,7 +173,7 @@ struct VPS<br>     int              scalabilityTypes;<br>     uint8_t          m_dimensionIdLen[MAX_VPS_NUM_SCALABILITY_TYPES];<br>     uint8_t          m_dimensionId[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_NUM_SCALABILITY_TYPES];<br>-    bool              m_nuhLayerIdPresentFlag;<br>+    bool             m_nuhLayerIdPresentFlag;<br>     uint8_t          m_layerIdInNuh[MAX_VPS_LAYER_ID_PLUS1];<br>     uint8_t          m_layerIdInVps[MAX_VPS_LAYER_ID_PLUS1];<br>     int              m_viewIdLen;<br>diff --git a/source/encoder/encoder.cpp b/source/encoder/encoder.cpp<br>index 5d718392f..65c247aba 100644<br>--- a/source/encoder/encoder.cpp<br>+++ b/source/encoder/encoder.cpp<br>@@ -3670,7 +3670,10 @@ void Encoder::initSPS(SPS *sps)<br>     }<br> #endif<br> <br>-    sps->sps_extension_flag = m_param->bEnableSCC ? true : false;<br>+#if ENABLE_SCC_EXT<br>+    if(m_param->bEnableSCC)<br>+        sps->sps_extension_flag = true;<br>+#endif<br> <br> }<br> <br>diff --git a/source/encoder/frameencoder.cpp b/source/encoder/frameencoder.cpp<br>index 09ed0b9f7..b1c6f333b 100644<br>--- a/source/encoder/frameencoder.cpp<br>+++ b/source/encoder/frameencoder.cpp<br>@@ -2338,8 +2338,8 @@ void FrameEncoder::readModel(FilmGrainCharacteristics* m_filmGrain, FILE* filmgr<br> #if ENABLE_LIBVMAF<br> void FrameEncoder::vmafFrameLevelScore()<br> {<br>-    PicYuv *fenc = m_frame->m_fencPic;<br>-    PicYuv *recon = m_frame->m_reconPic[0];<br>+    PicYuv *fenc = m_frame[0]->m_fencPic;<br>+    PicYuv *recon = m_frame[0]->m_reconPic[0];<br> <br>     x265_vmaf_framedata *vmafframedata = (x265_vmaf_framedata*)x265_malloc(sizeof(x265_vmaf_framedata));<br>     if (!vmafframedata)<br>diff --git a/source/encoder/nal.h b/source/encoder/nal.h<br>index 03752cdd6..15d3205d9 100644<br>--- a/source/encoder/nal.h<br>+++ b/source/encoder/nal.h<br>@@ -35,7 +35,11 @@ class Bitstream;<br> class NALList<br> {<br> public:<br>+#if ENABLE_MULTIVIEW || ENABLE_ALPHA<br>+    static const int MAX_NAL_UNITS = 32;<br>+#else<br>     static const int MAX_NAL_UNITS = 16;<br>+#endif<br> <br> public:<br> <br>diff --git a/source/x265cli.cpp b/source/x265cli.cpp<br>index d4fe886cc..89852c701 100755<br>--- a/source/x265cli.cpp<br>+++ b/source/x265cli.cpp<br>@@ -1009,7 +1009,7 @@ namespace X265_NS {<br>             x265_log(param, X265_LOG_ERROR, "recon file must be specified to get VMAF score, try --help for help\n");<br>             return true;<br>         }<br>-        const char *str = strrchr(info.filename, '.');<br>+        const char *str = strrchr(info[0].filename, '.');<br> <br>         if (!strcmp(str, ".y4m"))<br>         {<br>@@ -1018,8 +1018,8 @@ namespace X265_NS {<br>         }<br>         if (param->internalCsp == X265_CSP_I420 || param->internalCsp == X265_CSP_I422 || param->internalCsp == X265_CSP_I444)<br>         {<br>-            vmafData->reference_file = x265_fopen(inputfn, "rb");<br>-            vmafData->distorted_file = x265_fopen(reconfn, "rb");<br>+            vmafData->reference_file = x265_fopen(inputfn[0], "rb");<br>+            vmafData->distorted_file = x265_fopen(reconfn[0], "rb");<br>         }<br>         else<br>         {<br>-- <br>2.36.0.windows.1<br><br></div>