<div dir="ltr"><div dir="ltr">Please ignore this mail, Will send an updated version.<br><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Thanks and Regards,<br><b>Snehaa.G</b></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Dec 27, 2019 at 2:02 PM Snehaa Giridharan <<a href="mailto:snehaa@multicorewareinc.com">snehaa@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"># HG changeset patch<br># User <a href="mailto:snehaa@multicorewareinc.com" target="_blank">snehaa@multicorewareinc.com</a><br># Date 1576060884 -19800<br>#      Wed Dec 11 16:11:24 2019 +0530<br># Node ID 0e7ecd346c395e8f0f6c6f4f0b34bb22c675258a<br># Parent  a4e060a4483913e28df2ce8b8549f3ba8b63ac5a<br>Fix x265 SVT integration<br><br>This patch does the following.<br>- Fix error for newly added param variables and other default variables<br>- Remove EbTime.h file as its no longer present in include directory of SVT<br>- Set SVT-HEVC lib version required to 1.4.1<br><br>diff -r a4e060a44839 -r 0e7ecd346c39 doc/reST/svthevc.rst<br>--- a/doc/reST/svthevc.rst Wed Sep 11 15:38:06 2019 +0530<br>+++ b/doc/reST/svthevc.rst      Wed Dec 11 16:11:24 2019 +0530<br>@@ -12,6 +12,10 @@<br> wont't be mapped to SVT-HEVC. This document describes the steps needed to compile x265 <br> with SVT-HEVC and CLI options mapping between x265 and SVT-HEVC.<br> <br>+Supported Version<br>+=================<br>+Version - 1.4.1<br>+<br> Build Steps<br> ===========<br> This section describes the build steps to be followed to link SVT-HEVC with x265.<br>@@ -109,7 +113,15 @@<br> +-------------------------------------------+------------------------------+------------------------------+<br> | :option:`--nalu-file`                     | NaluFile                     | Any String                   |<br> +-------------------------------------------+------------------------------+------------------------------+<br>-| :option:`--tune` zerolatency              | LatencyMode                  |                              |<br>+| :option:`--hrd`                           | hrdFlag                      | [0, 1]                       |<br>++-------------------------------------------+------------------------------+------------------------------+<br>+| :option:`--vbv-maxrate`                   | vbvMaxrate                   | Any Positive Integer         |<br>++-------------------------------------------+------------------------------+------------------------------+<br>+| :option:`--vbv-bufsize`                   | vbvBufsize                   | Any Positive Integer         |<br>++-------------------------------------------+------------------------------+------------------------------+<br>+| :option:`--vbv-init`                      | VbvBufInit                   | [0 - 100]                    |<br>++-------------------------------------------+------------------------------+------------------------------+<br>+| :option:`--frame-threads`                 | ThreadCount                  | Any Number                   |<br> +-------------------------------------------+------------------------------+------------------------------+<br> | :option:`--svt-search-width`              | SearchAreaWidth              | [1 - 256]                    |<br> +-------------------------------------------+------------------------------+------------------------------+<br>diff -r a4e060a44839 -r 0e7ecd346c39 source/CMakeLists.txt<br>--- a/source/CMakeLists.txt       Wed Sep 11 15:38:06 2019 +0530<br>+++ b/source/CMakeLists.txt     Wed Dec 11 16:11:24 2019 +0530<br>@@ -573,7 +573,6 @@<br> if(SVTHEVC_FOUND)<br>     install(FILES "${SVT_HEVC_INCLUDE_DIR}/EbApi.h" DESTINATION include)<br>     install(FILES "${SVT_HEVC_INCLUDE_DIR}/EbErrorCodes.h" DESTINATION include)<br>-    install(FILES "${SVT_HEVC_INCLUDE_DIR}/EbTime.h" DESTINATION include)<br>     install(FILES "${SVT_HEVC_LIBRARY}" DESTINATION ${BIN_INSTALL_DIR})<br> endif()<br> <br>diff -r a4e060a44839 -r 0e7ecd346c39 source/cmake/Findsvthevc.cmake<br>--- a/source/cmake/Findsvthevc.cmake        Wed Sep 11 15:38:06 2019 +0530<br>+++ b/source/cmake/Findsvthevc.cmake    Wed Dec 11 16:11:24 2019 +0530<br>@@ -15,34 +15,37 @@<br> SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")<br> endif()<br> <br>-set(SVT_VERSION_MAJOR_REQUIRED 1)<br>-set(SVT_VERSION_MINOR_REQUIRED 3)<br>-set(SVT_VERSION_PATCHLEVEL_REQUIRED 0)<br>+set(SVT_VERSION_MAJOR_REQUIRED       1)<br>+set(SVT_VERSION_MINOR_REQUIRED       4)<br>+set(SVT_VERSION_PATCHLEVEL_REQUIRED  1)<br> <br> find_path(SVT_HEVC_INCLUDE_DIR<br>-    NAMES EbApi.h EbErrorCodes.h EbTime.h<br>+    NAMES EbApiVersion.h EbErrorCodes.h<br>     HINTS $ENV{SVT_HEVC_INCLUDE_DIR}<br>     PATHS ENV<br>     DOC "SVT-HEVC include directory")<br> <br> if(SVT_HEVC_INCLUDE_DIR)<br>-file(READ "${SVT_HEVC_INCLUDE_DIR}/EbApi.h" version)<br>+    if(EXISTS "${SVT_HEVC_INCLUDE_DIR}/EbApiVersion.h")<br>+        file(READ "${SVT_HEVC_INCLUDE_DIR}/EbApiVersion.h" version)<br> <br>-string(REGEX MATCH "SVT_VERSION_MAJOR       ([0-9]*)" _ ${version})<br>-set(SVT_VERSION_MAJOR ${CMAKE_MATCH_1})<br>+        string(REGEX MATCH "SVT_VERSION_MAJOR       \\(([0-9]*)\\)" _ ${version})<br>+        set(SVT_VERSION_MAJOR ${CMAKE_MATCH_1})<br> <br>-string(REGEX MATCH "SVT_VERSION_MINOR       ([0-9]*)" _ ${version})<br>-set(SVT_VERSION_MINOR ${CMAKE_MATCH_1})<br>+        string(REGEX MATCH "SVT_VERSION_MINOR       \\(([0-9]*)\\)" _ ${version})<br>+        set(SVT_VERSION_MINOR ${CMAKE_MATCH_1})<br> <br>-string(REGEX MATCH "SVT_VERSION_PATCHLEVEL  ([0-9]*)" _ ${version})<br>-set(SVT_VERSION_PATCHLEVEL ${CMAKE_MATCH_1})<br>+        string(REGEX MATCH "SVT_VERSION_PATCHLEVEL  \\(([0-9]*)\\)" _ ${version})<br>+        set(SVT_VERSION_PATCHLEVEL ${CMAKE_MATCH_1})<br> <br>-if(NOT ${SVT_VERSION_MAJOR} EQUAL "1" OR NOT ${SVT_VERSION_MINOR} EQUAL "3" OR NOT ${SVT_VERSION_PATCHLEVEL} EQUAL "0")<br>-    message (SEND_ERROR "-- Found SVT-HEVC Lib Version: ${SVT_VERSION_MAJOR}.${SVT_VERSION_MINOR}.${SVT_VERSION_PATCHLEVEL} which doesn't match the required version: ${SVT_VERSION_MAJOR_REQUIRED}.${SVT_VERSION_MINOR_REQUIRED}.${SVT_VERSION_PATCHLEVEL_REQUIRED}; Aborting configure  ")<br>-else()<br>-    message(STATUS "-- Found SVT-HEVC Lib Version: ${SVT_VERSION_MAJOR}.${SVT_VERSION_MINOR}.${SVT_VERSION_PATCHLEVEL}")<br>-endif()<br>-<br>+        if(NOT ${SVT_VERSION_MAJOR} EQUAL "1" OR NOT ${SVT_VERSION_MINOR} EQUAL "4" OR NOT ${SVT_VERSION_PATCHLEVEL} EQUAL "1")<br>+            message (SEND_ERROR "-- Found SVT-HEVC Lib Version: ${SVT_VERSION_MAJOR}.${SVT_VERSION_MINOR}.${SVT_VERSION_PATCHLEVEL} which doesn't match the required version: ${SVT_VERSION_MAJOR_REQUIRED}.${SVT_VERSION_MINOR_REQUIRED}.${SVT_VERSION_PATCHLEVEL_REQUIRED}; Aborting configure  ")<br>+        else()<br>+            message(STATUS "-- Found SVT-HEVC Lib Version: ${SVT_VERSION_MAJOR}.${SVT_VERSION_MINOR}.${SVT_VERSION_PATCHLEVEL}")<br>+        endif()<br>+    else()<br>+        message (SEND_ERROR "-- Required version of SVT-HEVC Lib: ${SVT_VERSION_MAJOR_REQUIRED}.${SVT_VERSION_MINOR_REQUIRED}.${SVT_VERSION_PATCHLEVEL_REQUIRED}; Aborting configure  ")<br>+    endif()<br> endif()<br> <br> find_library(SVT_HEVC_LIBRARY<br>diff -r a4e060a44839 -r 0e7ecd346c39 source/common/param.cpp<br>--- a/source/common/param.cpp       Wed Sep 11 15:38:06 2019 +0530<br>+++ b/source/common/param.cpp   Wed Dec 11 16:11:24 2019 +0530<br>@@ -2553,8 +2553,8 @@<br>     svtHevcParam->latencyMode = 0;<br> <br>     //Preset & Tune<br>-    svtHevcParam->encMode = 9;<br>-    svtHevcParam->tune = 0;<br>+    svtHevcParam->encMode = 7;<br>+    svtHevcParam->tune = 1;<br> <br>     // Interlaced Video <br>     svtHevcParam->interlacedVideo = 0;<br>@@ -2594,10 +2594,10 @@<br>     svtHevcParam->targetBitRate = 7000000;<br>     svtHevcParam->maxQpAllowed = 48;<br>     svtHevcParam->minQpAllowed = 10;<br>-    svtHevcParam->bitRateReduction = 1;<br>+    svtHevcParam->bitRateReduction = 0;<br> <br>     // Thresholds<br>-    svtHevcParam->improveSharpness = 1;<br>+    svtHevcParam->improveSharpness = 0;<br>     svtHevcParam->videoUsabilityInfo = 0;<br>     svtHevcParam->highDynamicRangeInput = 0;<br>     svtHevcParam->accessUnitDelimiter = 0;<br>@@ -2607,7 +2607,7 @@<br>     svtHevcParam->unregisteredUserDataSeiFlag = 0;<br>     svtHevcParam->recoveryPointSeiFlag = 0;<br>     svtHevcParam->enableTemporalId = 1;<br>-    svtHevcParam->profile = 2;<br>+    svtHevcParam->profile = 1;<br>     svtHevcParam->tier = 0;<br>     svtHevcParam->level = 0;<br> <br>@@ -2638,6 +2638,13 @@<br>     svtHevcParam->tileRowCount = 1;<br>     svtHevcParam->tileSliceMode = 0;<br>     svtHevcParam->unrestrictedMotionVector = 1;<br>+    svtHevcParam->threadCount = 0;<br>+<br>+    // vbv<br>+    svtHevcParam->hrdFlag = 0;<br>+    svtHevcParam->vbvMaxrate = 0;<br>+    svtHevcParam->vbvBufsize = 0;<br>+    svtHevcParam->vbvBufInit = 90;<br> }<br> <br> int svt_set_preset_tune(x265_param* param, const char* preset, const char* tune)<br>@@ -2660,13 +2667,7 @@<br>     }<br>     if (tune)<br>     {<br>-        if (!strcmp(tune, "psnr")) svtHevcParam->tune = 1;<br>-        else if (!strcmp(tune, "ssim")) svtHevcParam->tune = 1;<br>-        else if (!strcmp(tune, "grain")) svtHevcParam->tune = 0;<br>-        else if (!strcmp(tune, "animation")) svtHevcParam->tune = 0;<br>-        else if (!strcmp(tune, "vmaf")) svtHevcParam->tune = 2;<br>-        else if (!strcmp(tune, "zero-latency") || !strcmp(tune, "zerolatency")) svtHevcParam->latencyMode = 1;<br>-        else  return -1;<br>+        svtHevcParam->tune = 1;<br>     }<br>     return 0;<br> }<br>@@ -2850,6 +2851,16 @@<br>         else<br>             bError = true;<br>     }<br>+    OPT("hrd")<br>+        svtHevcParam->hrdFlag = (uint32_t)x265_atobool(value, bError);<br>+    OPT("vbv-maxrate")<br>+        svtHevcParam->vbvMaxrate = (uint32_t)x265_atoi(value, bError);<br>+    OPT("vbv-bufsize")<br>+        svtHevcParam->vbvBufsize = (uint32_t)x265_atoi(value, bError);<br>+    OPT("vbv-init")<br>+        svtHevcParam->vbvBufInit = (uint64_t)x265_atof(value, bError);<br>+    OPT("frame-threads")<br>+        svtHevcParam->threadCount = (uint32_t)x265_atoi(value, bError);<br>     else<br>         x265_log(param, X265_LOG_INFO, "SVT doesn't support %s param; Disabling it \n", name);<br> <br>diff -r a4e060a44839 -r 0e7ecd346c39 source/encoder/svt.h<br>--- a/source/encoder/svt.h        Wed Sep 11 15:38:06 2019 +0530<br>+++ b/source/encoder/svt.h      Wed Dec 11 16:11:24 2019 +0530<br>@@ -29,7 +29,6 @@<br> <br> #include "EbApi.h"<br> #include "EbErrorCodes.h"<br>-#include "EbTime.h"<br> <br> namespace X265_NS {<br> <br>@@ -49,4 +48,4 @@<br> <br> #endif // ifdef SVT_HEVC<br> <br>-#endif // ifndef SVT_H<br>\ No newline at end of file<br>+#endif // ifndef SVT_H<br><div><div dir="ltr"><div dir="ltr"><br><br>Thanks and Regards,<br><b>Snehaa.G</b></div></div></div></div>
</blockquote></div></div>