<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 25, 2018 at 10:26 AM, <span dir="ltr"><<a href="mailto:jayashree.c@multicorewareinc.com" target="_blank">jayashree.c@multicorewareinc.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Jayashree <<a href="mailto:jayashree.c@multicorewareinc.com">jayashree.c@multicorewareinc.<wbr>com</a>><br>
# Date 1524546422 -19800<br>
# Tue Apr 24 10:37:02 2018 +0530<br>
# Branch stable<br>
# Node ID afb9323648ec1d3c7d465ecc8729a8<wbr>df1a451b4a<br>
# Parent 930e3cc385df412a227b2671856a6e<wbr>a871696694<br>
cleanup - runtime flag to enable/disable avx512<br></blockquote><div><br></div><div>Pushed to stable branch.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
diff -r 930e3cc385df -r afb9323648ec source/common/param.cpp<br>
--- a/source/common/param.cpp Thu Apr 19 22:57:59 2018 +0200<br>
+++ b/source/common/param.cpp Tue Apr 24 10:37:02 2018 +0530<br>
@@ -99,13 +99,13 @@<br>
{<br>
x265_free(p);<br>
}<br>
-bool benableavx512 = false;<br>
+<br>
void x265_param_default(x265_param* param)<br>
{<br>
memset(param, 0, sizeof(x265_param));<br>
<br>
/* Applying default values to all elements in the param structure */<br>
- param->cpuid = X265_NS::cpu_detect(<wbr>benableavx512);<br>
+ param->cpuid = X265_NS::cpu_detect(false);<br>
param->bEnableWavefront = 1;<br>
param->frameNumThreads = 0;<br>
<br>
@@ -618,20 +618,20 @@<br>
#if X265_ARCH_X86<br>
if (!strcasecmp(value, "avx512"))<br>
{<br>
- p->bEnableavx512 = 1;<br>
- benableavx512 = true;<br>
- p->cpuid = X265_NS::cpu_detect(<wbr>benableavx512);<br>
+ p->bEnableavx512 = true;<br>
+<br>
+ p->cpuid = X265_NS::cpu_detect(p-><wbr>bEnableavx512);<br>
if (!(p->cpuid & X265_CPU_AVX512))<br>
x265_log(p, X265_LOG_WARNING, "AVX512 is not supported\n");<br>
}<br>
else<br>
{<br>
- p->bEnableavx512 = 0;<br>
- benableavx512 = false;<br>
+ p->bEnableavx512 = false;<br>
+<br>
if (bValueWasNull)<br>
p->cpuid = atobool(value);<br>
else<br>
- p->cpuid = parseCpuName(value, bError);<br>
+ p->cpuid = parseCpuName(value, bError, p->bEnableavx512);<br>
}<br>
#else<br>
if (bValueWasNull)<br>
@@ -1089,7 +1089,7 @@<br>
* false || no - disabled<br>
* integer bitmap value<br>
* comma separated list of SIMD names, eg: SSE4.1,XOP */<br>
-int parseCpuName(const char* value, bool& bError)<br>
+int parseCpuName(const char* value, bool& bError, bool bEnableavx512)<br>
{<br>
if (!value)<br>
{<br>
@@ -1100,7 +1100,7 @@<br>
if (isdigit(value[0]))<br>
cpu = x265_atoi(value, bError);<br>
else<br>
- cpu = !strcmp(value, "auto") || x265_atobool(value, bError) ? X265_NS::cpu_detect(<wbr>benableavx512) : 0;<br>
+ cpu = !strcmp(value, "auto") || x265_atobool(value, bError) ? X265_NS::cpu_detect(<wbr>bEnableavx512) : 0;<br>
<br>
if (bError)<br>
{<br>
diff -r 930e3cc385df -r afb9323648ec source/common/param.h<br>
--- a/source/common/param.h Thu Apr 19 22:57:59 2018 +0200<br>
+++ b/source/common/param.h Tue Apr 24 10:37:02 2018 +0530<br>
@@ -33,7 +33,7 @@<br>
char* x265_param2string(x265_param *param, int padx, int pady);<br>
int x265_atoi(const char *str, bool& bError);<br>
double x265_atof(const char *str, bool& bError);<br>
-int parseCpuName(const char *value, bool& bError);<br>
+int parseCpuName(const char *value, bool& bError, bool bEnableavx512);<br>
void setParamAspectRatio(x265_param *p, int width, int height);<br>
void getParamAspectRatio(x265_param *p, int& width, int& height);<br>
bool parseLambdaFile(x265_param *param);<br>
diff -r 930e3cc385df -r afb9323648ec source/test/testbench.cpp<br>
--- a/source/test/testbench.cpp Thu Apr 19 22:57:59 2018 +0200<br>
+++ b/source/test/testbench.cpp Tue Apr 24 10:37:02 2018 +0530<br>
@@ -118,7 +118,7 @@<br>
if (!strncmp(name, "cpuid", strlen(name)))<br>
{<br>
bool bError = false;<br>
- cpuid = parseCpuName(value, bError);<br>
+ cpuid = parseCpuName(value, bError, enableavx512);<br>
if (bError)<br>
{<br>
printf("Invalid CPU name: %s\n", value);<br>
diff -r 930e3cc385df -r afb9323648ec source/x265.h<br>
--- a/source/x265.h Thu Apr 19 22:57:59 2018 +0200<br>
+++ b/source/x265.h Tue Apr 24 10:37:02 2018 +0530<br>
@@ -635,7 +635,8 @@<br>
* hence the encoding will happen without avx512 assembly primitives even if the cpu has <br>
* avx512 capabilities. <br>
* Ensure to use --asm avx512 if you need to encode with avx512 assembly primitives*/<br>
- int bEnableavx512;<br>
+<br>
+ bool bEnableavx512;<br>
/*== Parallelism Features ==*/<br>
<br>
/* Number of concurrently encoded frames between 1 and X265_MAX_FRAME_THREADS<br>
<br>______________________________<wbr>_________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/<wbr>listinfo/x265-devel</a><br>
<br></blockquote></div><br></div></div>